@helpai/elements 0.73.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configurator.mjs +1 -1
- package/elements-web-component.esm.js +30 -30
- package/elements-web-component.esm.js.map +3 -3
- package/elements.cjs.js +28 -28
- package/elements.cjs.js.map +3 -3
- package/elements.esm.js +28 -28
- package/elements.esm.js.map +3 -3
- package/elements.js +28 -28
- package/elements.js.map +3 -3
- package/index.d.ts +18 -15
- package/index.mjs +6 -6
- package/package.json +1 -1
- package/schema.d.ts +8 -8
- package/schema.json +4 -4
- package/schema.mjs +1 -1
- package/style.css +1 -1
- package/web-component.mjs +6 -6
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var au=Object.defineProperty;var iu=(e,t,n)=>t in e?au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ee=(e,t,n)=>iu(e,typeof t!="symbol"?t+"":t,n);var or,j,ai,To,yt,ti,ii,si,wo,Zn,yn,li,Io,Co,Ro,su,tr={},nr=[],lu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Pn=Array.isArray;function dt(e,t){for(var n in t)e[n]=t[n];return e}function Eo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ut(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?or.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return er(e,s,r,o,null)}function er(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++ai,__i:-1,__u:0};return o==null&&j.vnode!=null&&j.vnode(i),i}function le(e){return e.children}function Ve(e,t){this.props=e,this.context=t}function Jt(e,t){if(t==null)return e.__?Jt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Jt(e):null}function cu(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=dt({},t);i.__v=t.__v+1,j.vnode&&j.vnode(i),Ao(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??Jt(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,pi(r,i,o),t.__e=t.__=null,i.__e!=n&&ci(i)}}function ci(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),ci(e)}function ni(e){(!e.__d&&(e.__d=!0)&&yt.push(e)&&!rr.__r++||ti!=j.debounceRendering)&&((ti=j.debounceRendering)||ii)(rr)}function rr(){try{for(var e,t=1;yt.length;)yt.length>t&&yt.sort(si),e=yt.shift(),t=yt.length,cu(e)}finally{yt.length=rr.__r=0}}function di(e,t,n,r,o,i,s,l,c,u,p){var _,d,f,m,P,v,g,k=r&&r.__k||nr,h=t.length;for(c=du(n,t,k,c,h),_=0;_<h;_++)(f=n.__k[_])!=null&&(d=f.__i!=-1&&k[f.__i]||tr,f.__i=_,v=Ao(e,f,d,o,i,s,l,c,u,p),m=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&Mo(d.ref,null,f),p.push(f.ref,f.__c||m,f)),P==null&&m!=null&&(P=m),(g=!!(4&f.__u))||d.__k===f.__k?(c=ui(f,c,e,g),g&&d.__e&&(d.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=P,c}function du(e,t,n,r,o){var i,s,l,c,u,p=n.length,_=p,d=0;for(e.__k=new Array(o),i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[i]=er(null,s,null,null,null):Pn(s)?s=e.__k[i]=er(le,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[i]=er(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,c=i+d,s.__=e,s.__b=e.__b+1,l=null,(u=s.__i=uu(s,n,c,_))!=-1&&(_--,(l=n[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(o>p?d--:o<p&&d++),typeof s.type!="function"&&(s.__u|=4)):u!=c&&(u==c-1?d--:u==c+1?d++:(u>c?d--:d++,s.__u|=4))):e.__k[i]=null;if(_)for(i=0;i<p;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=Jt(l)),mi(l,l));return r}function ui(e,t,n,r){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=ui(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Jt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function xn(e,t){return t=t||[],e==null||typeof e=="boolean"||(Pn(e)?e.some(function(n){xn(n,t)}):t.push(e)),t}function uu(e,t,n,r){var o,i,s,l=e.key,c=e.type,u=t[n],p=u!=null&&(2&u.__u)==0;if(u===null&&l==null||p&&l==u.key&&c==u.type)return n;if(r>(p?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((u=t[s=o>=0?o--:i++])!=null&&(2&u.__u)==0&&l==u.key&&c==u.type)return s}return-1}function ri(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||lu.test(t)?n:n+"px"}function Qn(e,t,n,r,o){var i,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ri(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||ri(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(li,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n[yn]=r[yn]:(n[yn]=Io,e.addEventListener(t,i?Ro:Co,i)):e.removeEventListener(t,i?Ro:Co,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function oi(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Zn]==null)t[Zn]=Io++;else if(t[Zn]<n[yn])return;return n(j.event?j.event(t):t)}}}function Ao(e,t,n,r,o,i,s,l,c,u){var p,_,d,f,m,P,v,g,k,h,x,C,I,z,K,W,L=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[l=t.__e=n.__e]),(p=j.__b)&&p(t);e:if(typeof L=="function"){_=s.length;try{if(k=t.props,h=L.prototype&&L.prototype.render,x=(p=L.contextType)&&r[p.__c],C=p?x?x.props.value:p.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:(h?t.__c=d=new L(k,C):(t.__c=d=new Ve(k,C),d.constructor=L,d.render=pu),x&&x.sub(d),d.state||(d.state={}),d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),h&&d.__s==null&&(d.__s=d.state),h&&L.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=dt({},d.__s)),dt(d.__s,L.getDerivedStateFromProps(k,d.__s))),m=d.props,P=d.state,d.__v=t,f)h&&L.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),h&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(h&&L.getDerivedStateFromProps==null&&k!==m&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(k,C),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(k,d.__s,C)===!1){t.__v!=n.__v&&(d.props=k,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(F){F&&(F.__=t)}),nr.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(k,d.__s,C),h&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(m,P,v)})}if(d.context=C,d.props=k,d.__P=e,d.__e=!1,I=j.__r,z=0,h)d.state=d.__s,d.__d=!1,I&&I(t),p=d.render(d.props,d.state,d.context),nr.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,I&&I(t),p=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++z<25);d.state=d.__s,d.getChildContext!=null&&(r=dt(dt({},r),d.getChildContext())),h&&!f&&d.getSnapshotBeforeUpdate!=null&&(v=d.getSnapshotBeforeUpdate(m,P)),K=p!=null&&p.type===le&&p.key==null?fi(p.props.children):p,l=di(e,Pn(K)?K:[K],t,n,r,o,i,s,l,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(F){if(s.length=_,t.__v=null,c||i!=null){if(F.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i!=null&&(i[i.indexOf(l)]=null),t.__e=l}else if(i!=null)for(W=i.length;W--;)Eo(i[W])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),F.then||_i(t),j.__e(F,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=_u(n.__e,t,n,r,o,i,s,c,u);return(p=j.diffed)&&p(t),128&t.__u?void 0:l}function _i(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(_i))}function pi(e,t,n){for(var r=0;r<n.length;r++)Mo(n[r],n[++r],n[++r]);j.__c&&j.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){j.__e(i,o.__v)}})}function fi(e){return typeof e!="object"||e==null||e.__b>0?e:Pn(e)?e.map(fi):e.constructor!==void 0?null:dt({},e)}function _u(e,t,n,r,o,i,s,l,c){var u,p,_,d,f,m,P,v=n.props||tr,g=t.props,k=t.type;if(k=="svg"?o="http://www.w3.org/2000/svg":k=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!k&&(k?f.localName==k:f.nodeType==3)){e=f,i[u]=null;break}}if(e==null){if(k==null)return document.createTextNode(g);e=document.createElementNS(o,k,g.is&&g),l&&(j.__m&&j.__m(t,i),l=!1),i=null}if(k==null)v===g||l&&e.data==g||(e.data=g);else{if(i=k=="textarea"&&g.defaultValue!=null?null:i&&or.call(e.childNodes),!l&&i!=null)for(v={},u=0;u<e.attributes.length;u++)v[(f=e.attributes[u]).name]=f.value;for(u in v)f=v[u],u=="dangerouslySetInnerHTML"?_=f:u=="children"||u in g||u=="value"&&"defaultValue"in g||u=="checked"&&"defaultChecked"in g||Qn(e,u,null,f,o);for(u in g)f=g[u],u=="children"?d=f:u=="dangerouslySetInnerHTML"?p=f:u=="value"?m=f:u=="checked"?P=f:l&&typeof f!="function"||v[u]===f||Qn(e,u,f,v[u],o);if(p)l||_&&(p.__html==_.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(_&&(e.innerHTML=""),di(t.type=="template"?e.content:e,Pn(d)?d:[d],t,n,r,k=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:n.__k&&Jt(n,0),l,c),i!=null)for(u=i.length;u--;)Eo(i[u]);l&&k!="textarea"||(u="value",k=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[u]||k=="progress"&&!m||k=="option"&&m!=v[u])&&Qn(e,u,m,v[u],o),u="checked",P!=null&&P!=e[u]&&Qn(e,u,P,v[u],o))}return e}function Mo(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){j.__e(o,n)}}function mi(e,t,n){var r,o;if(j.unmount&&j.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Mo(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){j.__e(i,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&mi(r[o],t,n||typeof e.type!="function");n||Eo(e.__e),e.__c=e.__=e.__e=void 0}function pu(e,t,n){return this.constructor(e,n)}function Sn(e,t,n){var r,o,i,s;t==document&&(t=document.documentElement),j.__&&j.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],Ao(t,e=(!r&&n||t).__k=ut(le,null,[e]),o||tr,tr,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?or.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),pi(i,e,s),e.props.children=null}or=nr.slice,j={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(l){e=l}throw e}},ai=0,To=function(e){return e!=null&&e.constructor===void 0},Ve.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=dt({},this.state),typeof e=="function"&&(e=e(dt({},n),this.props)),e&&dt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ni(this))},Ve.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ni(this))},Ve.prototype.render=le,yt=[],ii=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,si=function(e,t){return e.__v.__b-t.__v.__b},rr.__r=0,wo=Math.random().toString(8),Zn="__d"+wo,yn="__a"+wo,li=/(PointerCapture)$|Capture$/i,Io=0,Co=oi(!1),Ro=oi(!0),su=0;var w={id:"help-ai",name:"@helpai/elements",global:"HelpAI",tagName:"web-ai-chat",cssPrefix:"helpai",defaultBaseUrl:"https://help.ai",displayName:"Help AI",domain:"help.ai",siteUrl:"https://help.ai"};var gi={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This chat is closed",conversationLoading:"Loading chat\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new chat",talkToOperator:"Talk to an operator",connectingOperator:"Connecting you to an operator\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",cancelOperatorRequest:"Keep chatting with the AI",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",showOptions:"Show options",hideOptions:"Hide options",qtypeText:"Your answer",qtypeEmail:"Email address",qtypePhone:"Phone number",qtypeNumber:"Number",qtypeDate:"Date",qtypeChooseOne:"Pick one",qtypeChooseAny:"Pick any",qtypeBoolean:"Yes / No",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approve:"Approve",reject:"Reject",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Submitted",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},fu={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Ce chat est ferm\xE9",conversationLoading:"Chargement du chat\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer un nouveau chat",talkToOperator:"Parler \xE0 un op\xE9rateur",connectingOperator:"Mise en relation avec un op\xE9rateur\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",cancelOperatorRequest:"Continuer avec l'IA",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",showOptions:"Afficher les options",hideOptions:"Masquer les options",qtypeText:"Votre r\xE9ponse",qtypeEmail:"Adresse e-mail",qtypePhone:"Num\xE9ro de t\xE9l\xE9phone",qtypeNumber:"Nombre",qtypeDate:"Date",qtypeChooseOne:"Choisir une",qtypeChooseAny:"Choisir plusieurs",qtypeBoolean:"Oui / Non",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approve:"Approuver",reject:"Refuser",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"Envoy\xE9",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},mu={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u062F\u0631\u062F\u0634\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062F\u0631\u062F\u0634\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0645\u0648\u0638\u0641",connectingOperator:"\u062C\u0627\u0631\u064A \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0623\u062D\u062F \u0627\u0644\u0645\u0648\u0638\u0641\u064A\u0646\u2026",noOperatorAvailable:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u0648\u0638\u0641\u0648\u0646 \u0645\u062A\u0627\u062D\u0648\u0646 \u0627\u0644\u0622\u0646 \u2014 \u0627\u062A\u0631\u0643 \u0628\u064A\u0627\u0646\u0627\u062A\u0643 \u0648\u0633\u0646\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643.",chattingWithOperator:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 {operator}",cancelOperatorRequest:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0639 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",feedbackUp:"\u0631\u062F \u062C\u064A\u062F",feedbackDown:"\u0631\u062F \u0633\u064A\u0626",feedbackThanks:"\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643",copy:"\u0646\u0633\u062E",copied:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",showOptions:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",hideOptions:"\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",qtypeText:"\u0625\u062C\u0627\u0628\u062A\u0643",qtypeEmail:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",qtypePhone:"\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641",qtypeNumber:"\u0631\u0642\u0645",qtypeDate:"\u062A\u0627\u0631\u064A\u062E",qtypeChooseOne:"\u0627\u062E\u062A\u0631 \u0648\u0627\u062D\u062F\u064B\u0627",qtypeChooseAny:"\u0627\u062E\u062A\u0631 \u0623\u064A\u064B\u0627",qtypeBoolean:"\u0646\u0639\u0645 / \u0644\u0627",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},gu={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Este chat est\xE1 cerrado",conversationLoading:"Cargando chat\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar un chat nuevo",talkToOperator:"Hablar con un operador",connectingOperator:"Conect\xE1ndote con un operador\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",cancelOperatorRequest:"Seguir con la IA",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",showOptions:"Mostrar opciones",hideOptions:"Ocultar opciones",qtypeText:"Tu respuesta",qtypeEmail:"Correo electr\xF3nico",qtypePhone:"N\xFAmero de tel\xE9fono",qtypeNumber:"N\xFAmero",qtypeDate:"Fecha",qtypeChooseOne:"Elige una",qtypeChooseAny:"Elige varias",qtypeBoolean:"S\xED / No",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approve:"Aprobar",reject:"Rechazar",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Enviado",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},vu={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E0\u05E1\u05D2\u05E8",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",collapse:"\u05DB\u05D9\u05D5\u05D5\u05E5",collapseSidebar:"\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",composerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",dateLastWeek:"7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",dateOlder:"\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",dateToday:"\u05D4\u05D9\u05D5\u05DD",dateYesterday:"\u05D0\u05EA\u05DE\u05D5\u05DC",dropZone:"\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E6\u05F3\u05D0\u05D8",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E7\u05D5\u05D3\u05DE\u05D9\u05DD",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E6\u05F3\u05D0\u05D8",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",talkToOperator:"\u05D3\u05D1\u05E8 \u05E2\u05DD \u05E0\u05E6\u05D9\u05D2",connectingOperator:"\u05DE\u05D7\u05D1\u05E8 \u05D0\u05D5\u05EA\u05DA \u05DC\u05E0\u05E6\u05D9\u05D2\u2026",noOperatorAvailable:"\u05D0\u05D9\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05DB\u05E2\u05EA \u2014 \u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA \u05D5\u05E0\u05D7\u05D6\u05D5\u05E8 \u05D0\u05DC\u05D9\u05DA.",chattingWithOperator:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD {operator}",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",feedbackUp:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D8\u05D5\u05D1\u05D4",feedbackDown:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D2\u05E8\u05D5\u05E2\u05D4",feedbackThanks:"\u05EA\u05D5\u05D3\u05D4 \u05E2\u05DC \u05D4\u05DE\u05E9\u05D5\u05D1",copy:"\u05D4\u05E2\u05EA\u05E7",copied:"\u05D4\u05D5\u05E2\u05EA\u05E7",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",showOptions:"\u05D4\u05E6\u05D2 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",hideOptions:"\u05D4\u05E1\u05EA\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",qtypeText:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",qtypeEmail:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",qtypePhone:"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF",qtypeNumber:"\u05DE\u05E1\u05E4\u05E8",qtypeDate:"\u05EA\u05D0\u05E8\u05D9\u05DA",qtypeChooseOne:"\u05D1\u05D7\u05E8 \u05D0\u05D7\u05EA",qtypeChooseAny:"\u05D1\u05D7\u05E8 \u05DB\u05DE\u05D4",qtypeBoolean:"\u05DB\u05DF / \u05DC\u05D0",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E9\u05DC\u05D7",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},hu={en:gi,fr:fu,ar:mu,es:gu,he:vu};function ar(e,t){let n=vi(e),r=ir(t),o=n==="en"?{}:hu[n]??{},i=r?t[n]??{}:t??{},s=r?t.en??{}:{};return{...gi,...o,...s,...i}}function vi(e){return(e.split("-")[0]??"en").toLowerCase()}var bu=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function hi(e){return bu.has(vi(e))}function ze(e,t){return e[t]??t}function ir(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function bi(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function yi(e,t){let{translations:n,defaultLocale:r,...o}=e,i=bi(n,t);return i?{...o,title:i.title??o.title,description:i.description??o.description,content:i.content??o.content}:o}function Pi(e,t){let{translations:n,defaultLocale:r,...o}=e,i=bi(n,t);if(!i)return o;let s=new Map((i.fields??[]).map(c=>[c.name,c])),l=o.fields.map(c=>{let u=s.get(c.name);if(!u)return c;let p=new Map((u.options??[]).map(_=>[_.value,_]));return{...c,label:u.label??c.label,placeholder:u.placeholder??c.placeholder,validationHint:u.validationHint??c.validationHint,options:c.options?.map(_=>{let d=p.get(_.value);return d?{..._,label:d.label??_.label,description:d.description??_.description}:_})}});return{...o,title:i.title??o.title,description:i.description??o.description,submitLabel:i.submitLabel??o.submitLabel,fields:l}}var Lo=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},sr=new Lo;var yu=["off","error","warn","info","debug","trace"],Oo=w.cssPrefix,Pu=`${Oo}.debug`,xu=`__${w.global}_DEBUG__`,Su=`${Oo}-debug`,ki=2,xi=null;function ku(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Su);if(e!==null){let t=Si(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Pu);if(e){let t=Si(e);if(t>=0)return t}}catch{}return Reflect.get(window,xu)?4:2}function Si(e){if(e===!0||e==="1"||e==="true")return 4;if(e===!1||e==="0"||e==="false"||e==="off")return 0;if(typeof e=="number")return Math.max(0,Math.min(5,Math.floor(e)));if(typeof e=="string"){let t=yu.indexOf(e);if(t>=0)return t}return-1}ki=ku();function wi(e){let t=`[${Oo}:${e}]`,n=(r,o,i)=>(s,l)=>{if(!(ki<r)&&(l===void 0?console[o](t,s):console[o](t,s,l),xi))try{xi({level:i,scope:e,message:s,payload:l})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:r=>wi(`${e}:${r}`)}}var Z=wi("core");var At=Z.scope("context"),wu=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),Ci=50,No=1024,Cu=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Do(e){return Ri(e,"userContext",!0)}function $o(e){return Ri(e,"pageContext",!1)}function Ri(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){At.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let r={},o=0;for(let[i,s]of Object.entries(e)){if(wu.has(i)){At.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(s==null)continue;if(o>=Ci){At.warn(`${t} truncated at ${Ci} keys \u2014 dropped "${i}"`);continue}let l=Ru(t,i,s);l!==void 0&&(r[i]=l,o++)}return n&&typeof r.email=="string"&&!Cu.test(r.email)&&(At.warn(`dropped malformed ${t}.email "${r.email}"`),delete r.email),Object.keys(r).length>0?r:void 0}function Ru(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){At.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let r=n.trim();return r===""?void 0:r.length>No?(At.warn(`truncated ${e}.${t} to ${No} chars`),r.slice(0,No)):r}At.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var lr={maxBytes:10485760,maxCount:10,accept:"*/*"},Ti={voice:"local"},Ii={list:[],byTrigger:{}},Fo={enabled:!0,sampleRate:1},cr={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Qt={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Ei={floating:["theme","textSize","history","close","clear","expand","fullscreen","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","sound","language"]},Bo={enabled:!0,volume:.3,events:void 0},Ai={enabled:!0,events:void 0},Mi=[{label:"tabConversations",layout:"chat"}];function Zt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},r=t.behavior??{},o=t.i18n??{},i=t.feedback??{},s=t.footer??{},l=t.header??{},{themeMode:c,themeOverrides:u}=Tu(t.theme),p=n.mode??"floating",_=Iu(o.defaultLocale),d=o.availableLocales??[o.locale??_],f=en(o.locale??_,d,_),m=(t.baseUrl??w.defaultBaseUrl).replace(/\/$/,""),P=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:P,dataApiBaseUrl:v,userContext:Do(t.userContext),pageContext:$o(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:u,mode:p,iframe:n.iframe??!1,responseMode:r.responseMode??"streaming",showReasoning:r.showReasoning??!1,showToolCalls:r.showToolCalls??!1,showSources:r.showSources??!1,enableMessageFeedback:!(r.disableMessageFeedback??!1),autoSendSuggestions:r.autoSendSuggestions??!1,features:{voice:t.features?.voice??Ti.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0},forms:kn(t.forms,f),endpoints:{upload:t.endpoints?.upload??cr.upload,transcribe:t.endpoints?.transcribe??cr.transcribe,submitForm:t.endpoints?.submitForm??cr.submitForm},attachments:{accept:t.composer?.attachments?.accept??lr.accept,maxBytes:t.composer?.attachments?.maxBytes??lr.maxBytes,maxCount:t.composer?.attachments?.maxCount??lr.maxCount},locale:f,defaultLocale:_,availableLocales:d,startMinimized:r.startMinimized??!0,actions:Eu(p,l.actions),size:n.size??{},launcher:Fu(t.launcher),sound:Au(i.sound),haptics:Mu(i.haptics),strings:ar(f,o.strings),stringsOverride:o.strings,composerDisclaimer:s.composerDisclaimer??"",poweredBy:Ou(s.poweredBy),composer:Nu(t.composer),modules:Du(t.modules),tracking:Lu(t.tracking,v),storage:t.storage??sr,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Tu(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function Iu(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function en(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function Eu(e,t){return t??Ei[e]}function Au(e){return{enabled:e?.enabled??Bo.enabled,volume:e?.volume??Bo.volume,events:e?.events}}function Mu(e){return{enabled:e?.enabled??Ai.enabled,events:e?.events}}function Lu(e,t){let n=e?.sampleRate??Fo.sampleRate;return{enabled:e?.enabled??Fo.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(n)?n:1)),token:e?.token}}function Ou(e){let n={...{text:`Powered by ${w.displayName}`,href:w.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function Nu(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Du(e){let t=e===void 0?Mi:e,n=new Set,r=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let s=i.contentTags?.filter(Boolean),l=i.id??s?.[0]??i.layout;for(;n.has(l);)l=`${l}-${r.length}`;n.add(l);let c={id:l,label:i.label,layout:i.layout};s&&s.length>0&&(c.contentTags=s),i.layout==="home"&&(c.brandName=i.brandName,c.greetingText=i.greetingText,c.showGreeting=!(i.hideGreeting??!1),c.showSearchBar=!(i.hideSearchBar??!1),c.showRecentConversations=!(i.hideRecentConversations??!1),i.userAvatars&&i.userAvatars.length>0&&(c.userAvatars=i.userAvatars),i.status&&(c.status=i.status),c.contentBlockTitle=i.contentBlockTitle),r.push(c)}let o=Object.fromEntries(r.map(i=>[i.id,i]));return{list:r,byId:o}}function kn(e,t){var i;if(!e?.length)return Ii;let n=[],r=new Set;for(let s of e){if(!s?.id||r.has(s.id))continue;let l=Pi(s,t),c=(l.fields??[]).filter(p=>!!(p&&p.name&&p.label&&p.type)),u=(Array.isArray(l.on)?l.on:[l.on]).map($u).filter(p=>p!==null);c.length===0||u.length===0||(r.add(l.id),n.push({id:l.id,triggers:u,when:l.when,fields:c,title:l.title,description:l.description,submitLabel:l.submitLabel,skippable:l.skippable??!1,frequency:l.frequency??"once",mirrorToContext:l.mirrorToContext??!0,reopenable:l.reopenable??!0,reviewable:l.reviewable??!0}))}let o={};for(let s of n)for(let l of s.triggers)(o[i=l.kind]??(o[i]=[])).push(s);return{list:n,byTrigger:o}}function $u(e){if(typeof e!="string")return null;if(e==="pre-chat"||e==="conversation-closed"||e==="panel-close"||e==="manual")return{kind:e};let[t,n]=e.split(":",2);if(t==="after-messages"){let r=Number(n);return Number.isFinite(r)&&r>0?{kind:"after-messages",param:r}:null}if(t==="idle"){let r=Number(n);return Number.isFinite(r)&&r>0?{kind:"idle",param:r}:null}return t==="page-area"&&n?{kind:"page-area",param:n}:null}function Fu(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??Qt.variant,size:e?.size??Qt.size,label:e?.label??Qt.label,icon:e?.icon??Qt.icon,hidden:e?.hidden??Qt.hidden,callout:t}}function Ho(e,t,n,r){let o=en(t,e.availableLocales,e.defaultLocale);if(o===e.locale&&n===e.themeMode&&r===e.textSize)return e;let i={...e};return o!==e.locale&&(i.locale=o,i.strings=ar(o,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),r!==e.textSize&&(i.textSize=r),i}var Bu=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Uo(e,t){if(!t)return e;let n={...e};for(let i of Bu){let s=t[i];if(s===void 0)continue;let l=e[i];if(i==="theme"){l===void 0&&(n[i]=s);continue}i!=="i18n"&&(n[i]=Li(s,l))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let r=e.i18n,o=t.i18n;if(r||o){let i=Li(o??{},r);o?.availableLocales!==void 0&&(i.availableLocales=o.availableLocales),o?.defaultLocale!==void 0&&(i.defaultLocale=o.defaultLocale);let s=r?.strings,l=o?.strings;(s||l)&&(i.strings=Hu(l,s)),n.i18n=i}return n}function Li(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return n}function Hu(e,t){if(!e)return t;if(!t)return e;let n=ir(e),r=ir(t);if(!n&&!r)return{...e,...t};let o={},i=n?e:{en:e},s=r?t:{en:t};for(let[l,c]of Object.entries(i))o[l]={...c};for(let[l,c]of Object.entries(s))o[l]={...o[l],...c};return o}var Uu=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],_t=e=>e!=="false",zu=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Ni=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["theme","theme",e=>e]],Di=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",_t]],$i=[["width","width"],["height","height"]],Fi=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",_t],["show-reasoning","showReasoning",_t],["show-tool-calls","showToolCalls",_t],["show-sources","showSources",_t],["disable-message-feedback","disableMessageFeedback",_t],["auto-send-suggestions","autoSendSuggestions",_t]],Bi=[["locale","locale"]],qu=new Set(Uu),Vu=e=>zu(e).filter(t=>qu.has(t)),Hi=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",_t]],Ui=[["features-disable-file-upload","disableFileUpload",_t],["features-voice","voice",e=>e]],zi=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],qi=[["user-id","id"],["user-email","email"],["user-name","name"]],Vi=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Wu=["launcher-label","callout-text","callout-delay","actions","user-context","page-context"],Gu=[Ni,Di,$i,Fi,Bi,Hi,Ui,zi,qi,Vi],Ku=new Set(["iframe","start-minimized"]),zo=[...Gu.flatMap(e=>e.map(([t])=>t).filter(t=>!Ku.has(t))),...Wu];function qo(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,P]of Ni){let v=n(f);v!==void 0&&(t[m]=P?P(v):v)}let r=Mt(n,Di),o=Mt(n,$i);(r||o)&&(t.presentation={...r,...o?{size:o}:{}});let i=Mt(n,Fi);i&&(t.behavior=i);let s=Mt(n,Bi);s&&(t.i18n=s);let l=ju(e,n);l&&(t.launcher=l);let c=Mt(n,Ui);c&&(t.features=c);let u=Mt(n,zi);u&&(t.endpoints=u);let p=Oi(n,qi,"user-context");p&&(t.userContext=p);let _=Oi(n,Vi,"page-context");_&&(t.pageContext=_);let d=n("actions");return d!==void 0&&(t.header={actions:Vu(d)}),t}function Mt(e,t){let n={};for(let[r,o,i]of t){let s=e(r);s!==void 0&&(n[o]=i?i(s):s)}return Object.keys(n).length>0?n:null}function Oi(e,t,n){let r={};for(let[l,c]of t){let u=e(l);u!==void 0&&(r[c]=u)}let o={},i=e(n);if(i)try{let l=JSON.parse(i);l&&typeof l=="object"&&!Array.isArray(l)&&(o=l)}catch{}let s={...o,...r};return Object.keys(s).length>0?s:null}function ju(e,t){let n=Mt(t,Hi)??{},r=e("launcher-label");r!==null&&(n.label=r);let o=t("callout-text");if(o){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:o,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}function et(){let e=Date.now(),t=new Uint8Array(16);t[0]=Math.floor(e/2**40)&255,t[1]=Math.floor(e/2**32)&255,t[2]=e>>>24&255,t[3]=e>>>16&255,t[4]=e>>>8&255,t[5]=e&255,Xu(t.subarray(6)),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function Xu(e){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){crypto.getRandomValues(e);return}for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256)}var Lt=Z.scope("persistence");function tn(e,t=sr,n){let r=n?`${e}.${n}`:e,o=`${w.cssPrefix}.storageVersion`,i=t.get(o)??void 0,s=i?`.v${i}`:"",l=`${w.cssPrefix}.${r}${s}`,c=`${w.cssPrefix}${s}.visitorId`,u=`${l}.conversationId`,p=`${l}.userPrefs`,_=`${l}.panelOpen`,d=`${l}.panelSize`,f=`${l}.calloutDismissed`,m=`${l}.sidebarCollapsed`,P=`${l}.activeModule`,v=`${l}.historyCount`,g=`${l}.formsDone`,k={getVisitorId(){let h=t.get(c);if(h)return h;let x=et();return t.set(c,x),x},setVisitorId(h){Lt.debug("setVisitorId (rebind)",{id:h,scope:r}),t.set(c,h)},loadConversationId(){return t.get(u)??void 0},saveConversationId(h){Lt.trace("saveConversationId",{id:h,scope:r}),h?t.set(u,h):t.remove(u)},loadUserPrefs(){let h=t.get(p);if(!h)return{};try{let x=JSON.parse(h);return Wi(x)?x:{}}catch(x){return Lt.warn("loadUserPrefs parse failed",{error:x}),{}}},saveUserPrefs(h){try{t.set(p,JSON.stringify(h))}catch(x){Lt.warn("saveUserPrefs serialise failed",{error:x})}},patchUserPrefs(h){let x=k.loadUserPrefs();k.saveUserPrefs({...x,...h})},loadPanelOpen(){let h=t.get(_);return h==="1"?!0:h==="0"?!1:null},savePanelOpen(h){t.set(_,h?"1":"0")},loadPanelSize(){let h=t.get(d);return h==="normal"||h==="expanded"||h==="fullscreen"?h:null},savePanelSize(h){t.set(d,h)},loadCalloutDismissed(h){if(!h)return!1;let x=t.get(f);return!!x&&x===h},saveCalloutDismissed(h){h?t.set(f,h):t.remove(f)},loadSidebarCollapsed(){let h=t.get(m);return h==="1"?!0:h==="0"?!1:null},saveSidebarCollapsed(h){t.set(m,h?"1":"0")},loadActiveModule(){return t.get(P)||null},saveActiveModule(h){t.set(P,h)},loadHistoryCount(){let h=t.get(v);if(!h)return null;let x=Number.parseInt(h,10);return Number.isFinite(x)&&x>=0?x:null},saveHistoryCount(h){t.set(v,String(h))},loadFormsDone(){let h=t.get(g);if(!h)return{};try{let x=JSON.parse(h);return Wi(x)?x:{}}catch(x){return Lt.warn("loadFormsDone parse failed",{error:x}),{}}},saveFormDone(h){try{let x=k.loadFormsDone();x[h]=Date.now(),t.set(g,JSON.stringify(x))}catch(x){Lt.warn("saveFormDone serialise failed",{error:x})}},rememberStorageVersion(h){h&&h!==t.get(o)&&(Lt.debug("rememberStorageVersion (force-reset on next load)",{version:h}),t.set(o,h))},clearConversation(){t.remove(u)}};return k}function Wi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Gi=`:host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent: var(--__P__-accent-user);--__P__-accent-text-user: __BRAND_ACCENT_TEXT__;--__P__-accent-text: var(--__P__-accent-text-user);--__P__-accent-fg: var(--__P__-accent);--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-pill-l-min: .3;--__P__-pill-l-max: .46;--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-conversation-max: 768px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-scale: 1;--__P__-text-xs: calc(12px * var(--__P__-text-scale));--__P__-text-sm: calc(13px * var(--__P__-text-scale));--__P__-text-base: calc(15px * var(--__P__-text-scale));--__P__-text-md: calc(16px * var(--__P__-text-scale));--__P__-text-lg: calc(18px * var(--__P__-text-scale));--__P__-text-xl: calc(22px * var(--__P__-text-scale));--__P__-text-2xl: calc(30px * var(--__P__-text-scale))}:host([data-mode="modal"]),:host([data-mode="drawer"]){--__P__-conversation-max: 100%}:host([data-text-size="small"]){--__P__-text-scale: .9}:host([data-text-size="large"]){--__P__-text-scale: 1.15}:host{--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light;--__P__-color-scheme: light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;color-scheme:dark;--__P__-color-scheme: dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark;--__P__-color-scheme: dark}}@supports (color: oklch(from red l c h)){:host{--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.3, l, .62) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h);--__P__-accent-fg: oklch(from var(--__P__-accent-user) clamp(.3, l, .46) c h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
|
|
2
|
-
`;var
|
|
3
|
-
`;var ji=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent-fg);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent-fg);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent-fg);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list--fade{--__P__-fade-size: 20px;--__P__-fade-top: 0px;--__P__-fade-bottom: 0px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%);mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%)}.__P__-list--fade[data-fade-top=true]{--__P__-fade-top: var(--__P__-fade-size)}.__P__-list--fade[data-fade-bottom=true]{--__P__-fade-bottom: var(--__P__-fade-size)}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-date-divider{display:flex;justify-content:center;margin-block:var(--__P__-space-3)}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:break-word;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border:1px solid var(--__P__-border);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble{display:flex;align-items:stretch;padding:0;overflow:hidden;background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-author{display:flex;flex:0 0 auto;align-items:center;padding:0 .875rem;border-inline-end:1px solid color-mix(in oklab,var(--__P__-accent),transparent 60%);color:var(--__P__-accent);font-size:calc(13px * var(--__P__-text-scale));font-weight:600;letter-spacing:.025em;user-select:none}.__P__-bubble-row[data-role=operator] .__P__-bubble-body{flex:1 1 auto;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4)}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-meta{display:flex;align-items:center;gap:8px;margin-top:2px;padding:0 2px;min-height:24px}.__P__-bubble-actions{display:flex;align-items:center;gap:2px}.__P__-bubble-time{font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-feedback{display:flex;align-items:center;gap:2px}.__P__-msg-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:var(--__P__-radius-sm);background:transparent;color:var(--__P__-fg-muted);cursor:pointer;opacity:.65;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-msg-action:hover{opacity:1;background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-msg-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-msg-action[data-active=true]{opacity:1;color:var(--__P__-accent-fg)}.__P__-msg-action svg{width:15px;height:15px}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent-fg);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent-fg)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent-fg);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-operator-banner{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 var(--__P__-space-3) var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg-elevated),var(--__P__-accent) 6%);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);line-height:1.3;text-align:center}.__P__-operator-pulse{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-operator-banner[data-mode=awaiting_operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}.__P__-cancel-operator-request{flex:0 0 auto;padding:0;border:0;background:none;color:var(--__P__-accent);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.__P__-cancel-operator-request:hover{opacity:.8}.__P__-cancel-operator-request:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-radius:var(--__P__-radius-sm)}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent-fg)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent-fg);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent-fg)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-2px;left:calc(50% + 6px);width:8px;height:8px;border-radius:50%;background:var(--__P__-accent);box-shadow:0 0 0 2px var(--__P__-bg-elevated)}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent-fg)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent-fg);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-history>*,.__P__-home-scroll>*,.__P__-module-scroll>*,.__P__-help-list>*,.__P__-history-footer>*,.__P__-module-pad{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-header,.__P__-back-header{padding-inline:max(12px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-tabbar{padding-inline:max(0px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--__P__-space-2)}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-type{flex-shrink:0;align-self:center;margin-inline-start:auto;border:1px solid var(--__P__-border);border-radius:5px;background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);padding:1px 7px;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);white-space:nowrap}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent-fg)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none;-webkit-tap-highlight-color:transparent;user-select:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-chevron{display:inline-flex;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}details.__P__-toolui-collapsible>summary .__P__-toolui-status{margin-inline-start:auto}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{--__P__-pill: var(--__P__-fg-muted);display:inline-flex;min-width:0;align-items:center;gap:5px;padding:3px 7px;border-radius:5px;border:1px solid var(--__P__-border);background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);color:var(--__P__-pill);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge svg,.__P__-toolui-name-pill svg,.__P__-toolui-q-pill svg{flex-shrink:0;width:14px;height:14px}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-name-pill{--__P__-pill: oklch(.68 .13 233)}.__P__-toolui-q-pill{--__P__-pill: oklch(.66 .12 195)}.__P__-toolui-status[data-status=completed]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=responded]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=awaiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=denied]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=error]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=superseded]{--__P__-pill: var(--__P__-fg-muted)}@supports (color: oklch(from red l c h)){.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{color:oklch(from var(--__P__-pill) clamp(var(--__P__-pill-l-min),l,var(--__P__-pill-l-max)) c h)}}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-head-end{display:inline-flex;align-items:center;gap:var(--__P__-space-2);margin-inline-start:auto}.__P__-toolui-collapse-body{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-summary{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-toolui-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);margin-inline:calc(-1 * var(--__P__-space-4));padding:var(--__P__-space-3) var(--__P__-space-4) 0;border-top:1px solid var(--__P__-border)}.__P__-toolui-options-toggle{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:0;cursor:pointer;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);transition:color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-toolui-options-toggle:hover{color:var(--__P__-fg)}.__P__-toolui-options-chevron{display:inline-flex;transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-options-chevron svg{width:14px;height:14px}.__P__-toolui-options-chevron.__P__-open{transform:rotate(180deg)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
|
|
4
|
-
`;var
|
|
5
|
-
`;var
|
|
6
|
-
`;var
|
|
7
|
-
`).replace(/__P__/g,t_).replaceAll("__BRAND_ACCENT_TEXT__",r_).replaceAll("__BRAND_ACCENT__",n_).replaceAll("__BRAND_RADIUS__",o_).replaceAll("__BRAND_FONT__",a_);var i_=Z.scope("mount"),Ji=new WeakMap,Qi={floating:"all: initial; position: fixed; z-index: 2147483600;",flow:"all: initial; display: block; position: relative; width: 100%; height: 100%; z-index: 1; contain: size;",viewport:"all: initial; display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;"};function Zi(e,t){e.style.cssText=Qi[t]}function dr(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function es(e={}){let t=e.position??"flow";i_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${w.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let r;e.existingHost?r=e.existingHost:(r=document.createElement(n),(e.target??document.body).appendChild(r)),r.setAttribute("data-brand",w.id),r.style.cssText=Qi[t];let o=r.shadowRoot??r.attachShadow({mode:"open"}),i=r.ownerDocument;if(!s_(o,i)){let l=i.createElement("style");l.textContent=Vo,o.appendChild(l)}let s=document.createElement("div");return s.className=`${w.cssPrefix}-app`,o.appendChild(s),{appRoot:s,destroy:()=>r.remove(),hostElement:r,shadowRoot:o}}function s_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let r=Ji.get(t);if(!r)try{r=new n.CSSStyleSheet,r.replaceSync(Vo),Ji.set(t,r)}catch{return!1}try{return e.adoptedStyleSheets=[r],!0}catch{return!1}}function l_(e,t){let n=w.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${n}-conversation-max`,t.contentMaxWidth)}function c_(e,t){e.dataset.theme=t}function d_(e,t){let n=w.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${n}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${n}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${n}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${n}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${n}-panel-inset`,t.inset)}function u_(e,t){e.dataset.position=t}function ur(e,t){e.dataset.mode=t}function ts(e,t){c_(e,t.themeMode),l_(e,t.themeOverrides),u_(e,t.position),d_(e,t.size)}var nn,Se,Wo,ns,wn=0,ds=[],Te=j,rs=Te.__b,os=Te.__r,as=Te.diffed,is=Te.__c,ss=Te.unmount,ls=Te.__;function pr(e,t){Te.__h&&Te.__h(Se,e,wn||t),wn=0;var n=Se.__H||(Se.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function $(e){return wn=1,us(_s,e)}function us(e,t,n){var r=pr(nn++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):_s(void 0,t),function(l){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,l);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=Se,!Se.__f)){var o=function(l,c,u){if(!r.__c.__H)return!0;var p=!1,_=r.__c.props!==l;if(r.__c.__H.__.some(function(f){if(f.__N){p=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(_=!0)}}),i){var d=i.call(this,l,c,u);return p?d||_:d}return!p||_};Se.__f=!0;var i=Se.shouldComponentUpdate,s=Se.componentWillUpdate;Se.componentWillUpdate=function(l,c,u){if(this.__e){var p=i;i=void 0,o(l,c,u),i=p}s&&s.call(this,l,c,u)},Se.shouldComponentUpdate=o}return r.__N||r.__}function M(e,t){var n=pr(nn++,3);!Te.__s&&Ko(n.__H,t)&&(n.__=e,n.u=t,Se.__H.__h.push(n))}function ot(e,t){var n=pr(nn++,4);!Te.__s&&Ko(n.__H,t)&&(n.__=e,n.u=t,Se.__h.push(n))}function B(e){return wn=5,Q(function(){return{current:e}},[])}function Q(e,t){var n=pr(nn++,7);return Ko(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function N(e,t){return wn=8,Q(function(){return e},t)}function __(){for(var e;e=ds.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(_r),t.__h.some(Go),t.__h=[]}catch(n){t.__h=[],Te.__e(n,e.__v)}}}Te.__b=function(e){Se=null,rs&&rs(e)},Te.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ls&&ls(e,t)},Te.__r=function(e){os&&os(e),nn=0;var t=(Se=e.__c).__H;t&&(Wo===Se?(t.__h=[],Se.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(_r),t.__h.some(Go),t.__h=[],nn=0)),Wo=Se},Te.diffed=function(e){as&&as(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ds.push(t)!==1&&ns===Te.requestAnimationFrame||((ns=Te.requestAnimationFrame)||p_)(__)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Wo=Se=null},Te.__c=function(e,t){t.some(function(n){try{n.__h.some(_r),n.__h=n.__h.filter(function(r){return!r.__||Go(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Te.__e(r,n.__v)}}),is&&is(e,t)},Te.unmount=function(e){ss&&ss(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{_r(r)}catch(o){t=o}}),n.__H=void 0,t&&Te.__e(t,n.__v))};var cs=typeof requestAnimationFrame=="function";function p_(e){var t,n=function(){clearTimeout(r),cs&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);cs&&(t=requestAnimationFrame(n))}function _r(e){var t=Se,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Se=t}function Go(e){var t=Se;e.__c=e.__(),Se=t}function Ko(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function _s(e,t){return typeof t=="function"?t(e):t}var f_=Symbol.for("preact-signals");function vr(){if(pt>1)pt--;else{var e,t=!1;for((function(){var o=mr;for(mr=void 0;o!==void 0;){var i=o.S;if(i.v===o.v)for(var s=i.t;s!==void 0;s=s.x)s.i===o.i&&(s.i=i.i);o=o.o}})();Rn!==void 0;){var n=Rn;for(Rn=void 0,fr++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&fs(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(fr=0,pt--,t)throw e}}function ft(e){if(pt>0)return e();jo=++m_,pt++;try{return e()}finally{vr()}}var Cn,ye=void 0;function Tn(e){var t=ye,n=Cn;ye=void 0,Cn=void 0;try{return e()}finally{ye=t,Cn=n}}var Rn=void 0,pt=0,fr=0,m_=0,jo=0,mr=void 0,gr=0;function ps(e){if(ye!==void 0){var t=e.n;if(t===void 0||t.t!==ye)return t={i:0,S:e,p:ye.s,n:void 0,t:ye,e:void 0,x:void 0,r:t},ye.s!==void 0&&(ye.s.n=t),ye.s=t,e.n=t,32&ye.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=ye.s,t.n=void 0,ye.s.n=t,ye.s=t),t}}function Me(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Me.prototype.brand=f_;Me.prototype.h=function(){return!0};Me.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Tn(function(){var r;(r=t.W)==null||r.call(t)}))};Me.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Tn(function(){var o;(o=t.Z)==null||o.call(t)}))}};Me.prototype.subscribe=function(e){var t=this;return mt(function(){var n=t.value;Tn(function(){return e(n)})},{name:"sub"})};Me.prototype.valueOf=function(){return this.value};Me.prototype.toString=function(){return this.value+""};Me.prototype.toJSON=function(){return this.value};Me.prototype.peek=function(){var e=this;return Tn(function(){return e.value})};Object.defineProperty(Me.prototype,"value",{get:function(){var e=ps(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(fr>100)throw new Error("Cycle detected");(function(n){pt!==0&&fr===0&&n.l!==jo&&(n.l=jo,mr={S:n,v:n.v,i:n.i,o:mr})})(this),this.v=e,this.i++,gr++,pt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{vr()}}}});function X(e,t){return new Me(e,t)}function fs(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ms(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function gs(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Ot(e,t){Me.call(this,void 0,t),this.x=e,this.s=void 0,this.g=gr-1,this.f=4}Ot.prototype=new Me;Ot.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===gr))return!0;if(this.g=gr,this.f|=1,this.i>0&&!fs(this))return this.f&=-2,!0;var e=ye;try{ms(this),ye=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return ye=e,gs(this),this.f&=-2,!0};Ot.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Me.prototype.S.call(this,e)};Ot.prototype.U=function(e){if(this.t!==void 0&&(Me.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Ot.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Ot.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=ps(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function de(e,t){return new Ot(e,t)}function vs(e){var t=e.m;if(e.m=void 0,typeof t=="function"){pt++;var n=ye;ye=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Xo(e),r}finally{ye=n,vr()}}}function Xo(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,vs(e)}function g_(e){if(ye!==this)throw new Error("Out-of-order effect");gs(this),ye=e,this.f&=-2,8&this.f&&Xo(this),vr()}function rn(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Cn&&Cn.push(this)}rn.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};rn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,vs(this),ms(this),pt++;var e=ye;return ye=this,g_.bind(this,e)};rn.prototype.N=function(){2&this.f||(this.f|=2,this.u=Rn,Rn=this)};rn.prototype.d=function(){this.f|=8,1&this.f||Xo(this)};rn.prototype.dispose=function(){this.d()};function mt(e,t){var n=new rn(e,t);try{n.c()}catch(o){throw n.d(),o}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var hs,yr,hr,v_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var bs=[];mt(function(){hs=this.N})();function on(e,t){j[e]=t.bind(null,j[e]||function(){})}function br(e){if(hr){var t=hr;hr=void 0,t()}hr=e&&e.S()}function ys(e){var t=this,n=e.data,r=at(n);r.value=n;var o=Q(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=de(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),p=de(function(){return!Array.isArray(u.value)&&!To(u.value)}),_=mt(function(){if(this.N=Ps,p.value){var f=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){_(),d.call(this)},[p,u]},[]),i=o[0],s=o[1];return i.value?s.peek():s.value}ys.displayName="ReactiveTextNode";Object.defineProperties(Me.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ys},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});on("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var i=r[o];i instanceof Me&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)});on("__r",function(e,t){if(e(t),t.type!==le){br();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(o,i){var s;return mt(function(){s=this},{name:i}),s.c=o,s})(function(){var o;v_&&((o=n.y)==null||o.call(n)),r.__$f|=1,r.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),yr=r,br(n)}});on("__e",function(e,t,n,r){br(),yr=void 0,e(t,n,r)});on("diffed",function(e,t){br(),yr=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props,i=n.U;if(i)for(var s in i){var l=i[s];l===void 0||r&&s in r||(l.d(),i[s]=void 0)}if(r){i||(i={},n.U=i);for(var c in r){var u=i[c],p=r[c];u===void 0?(u=h_(n,c,p,o),i[c]=u):u.o(p,o)}}}e(t)});function h_(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,i=X(n);return{o:function(s,l){i.value=s,r=l},d:mt(function(){this.N=Ps;var s=i.value.value;r[t]!==s&&(r[t]=s,o?e[t]=s:s!=null&&(s!==!1||t[4]==="-")?e.setAttribute(t,s):e.removeAttribute(t))})}}on("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var i=r[o];i&&i.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var u=t.__c;if(u){var p=u.__$u;p&&(u.__$u=void 0,p.d())}}e(t)});on("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)});Ve.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(r||i||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function at(e,t){return Q(function(){return X(e,t)},[])}function gt(e,t){var n=B(e);return n.current=e,yr.__$f|=4,Q(function(){return de(function(){return n.current()},t)},[])}var b_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function y_(){ft(function(){for(var e;e=bs.shift();)hs.call(e)})}function Ps(){bs.push(this)===1&&(j.requestAnimationFrame||b_)(y_)}function xs(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ss(e){return xs(e)}function ks(e){return!(!xs(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function P_(e){return`${w.cssPrefix}:${e}`}function ws(e,t){let r=Object.entries(t).map(([o,i])=>{let s=P_(o),l=c=>i(c.detail);return e.addEventListener(s,l),[s,l]});return()=>{for(let[o,i]of r)e.removeEventListener(o,i)}}function Pr(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var x_=900,S_=640;function Yo(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let r=t.initialSize;return r==="expanded"||r==="fullscreen"||r==="normal"?r:n>0&&n<S_?"fullscreen":n>=(t.autoSizeBreakpoint??x_)?"expanded":"normal"}function In(e,t,n,r=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&r?r:Yo(e.mode,e.size,t);return{panelOpen:i,panelSize:l}}function an(){return typeof window>"u"?0:window.innerWidth}var k_="x-public-key",w_="x-ai-agent-deployment-id";function Cs(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[w_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??k_]=e.publicKey),t}}}function sn(e,t){return new Promise(n=>{if(t?.aborted)return n();let r=setTimeout(i,e),o=()=>i();t?.addEventListener("abort",o,{once:!0});function i(){clearTimeout(r),t?.removeEventListener("abort",o),n()}})}var xr="0.73.0";var $e=class extends Error{constructor(n,r,o,i){super(n);ee(this,"code",r);ee(this,"status",o);ee(this,"cause",i);this.name="StreamError"}};var Rs=Z.scope("parser");async function*Ts(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new $e(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of C_(e,t)){let r=R_(n);if(r==="done")return;r&&(yield r)}}async function*C_(e,t){if(!e.body)throw new $e("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),r="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:o,value:i}=await n.read();if(o){let l=r.trim();l&&(yield l);return}r+=i;let s;for(;(s=r.indexOf(`
|
|
1
|
+
var mu=Object.defineProperty;var gu=(e,t,n)=>t in e?mu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ne=(e,t,n)=>gu(e,typeof t!="symbol"?t+"":t,n);var fo,Y,_i,$r,Rt,li,pi,fi,Or,lo,In,mi,Fr,Nr,Dr,vu,uo={},_o=[],hu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,En=Array.isArray;function ht(e,t){for(var n in t)e[n]=t[n];return e}function Br(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function bt(e,t,n){var o,r,i,s={};for(i in t)i=="key"?o=t[i]:i=="ref"?r=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?fo.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return co(e,s,o,r,null)}function co(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++_i,__i:-1,__u:0};return r==null&&Y.vnode!=null&&Y.vnode(i),i}function le(e){return e.children}function et(e,t){this.props=e,this.context=t}function an(e,t){if(t==null)return e.__?an(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?an(e):null}function bu(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],r=[],i=ht({},t);i.__v=t.__v+1,Y.vnode&&Y.vnode(i),Hr(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??an(t),!!(32&t.__u),r),i.__v=t.__v,i.__.__k[i.__i]=i,yi(o,i,r),t.__e=t.__=null,i.__e!=n&&gi(i)}}function gi(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),gi(e)}function ci(e){(!e.__d&&(e.__d=!0)&&Rt.push(e)&&!po.__r++||li!=Y.debounceRendering)&&((li=Y.debounceRendering)||pi)(po)}function po(){try{for(var e,t=1;Rt.length;)Rt.length>t&&Rt.sort(fi),e=Rt.shift(),t=Rt.length,bu(e)}finally{Rt.length=po.__r=0}}function vi(e,t,n,o,r,i,s,l,c,u,_){var p,d,f,m,h,b,x,P=o&&o.__k||_o,v=t.length;for(c=yu(n,t,P,c,v),p=0;p<v;p++)(f=n.__k[p])!=null&&(d=f.__i!=-1&&P[f.__i]||uo,f.__i=p,b=Hr(e,f,d,r,i,s,l,c,u,_),m=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&Ur(d.ref,null,f),_.push(f.ref,f.__c||m,f)),h==null&&m!=null&&(h=m),(x=!!(4&f.__u))||d.__k===f.__k?(c=hi(f,c,e,x),x&&d.__e&&(d.__e=null)):typeof f.type=="function"&&b!==void 0?c=b:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=h,c}function yu(e,t,n,o,r){var i,s,l,c,u,_=n.length,p=_,d=0;for(e.__k=new Array(r),i=0;i<r;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[i]=co(null,s,null,null,null):En(s)?s=e.__k[i]=co(le,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[i]=co(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,c=i+d,s.__=e,s.__b=e.__b+1,l=null,(u=s.__i=Pu(s,n,c,p))!=-1&&(p--,(l=n[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(r>_?d--:r<_&&d++),typeof s.type!="function"&&(s.__u|=4)):u!=c&&(u==c-1?d--:u==c+1?d++:(u>c?d--:d++,s.__u|=4))):e.__k[i]=null;if(p)for(i=0;i<_;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==o&&(o=an(l)),xi(l,l));return o}function hi(e,t,n,o){var r,i;if(typeof e.type=="function"){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=hi(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=an(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function An(e,t){return t=t||[],e==null||typeof e=="boolean"||(En(e)?e.some(function(n){An(n,t)}):t.push(e)),t}function Pu(e,t,n,o){var r,i,s,l=e.key,c=e.type,u=t[n],_=u!=null&&(2&u.__u)==0;if(u===null&&l==null||_&&l==u.key&&c==u.type)return n;if(o>(_?1:0)){for(r=n-1,i=n+1;r>=0||i<t.length;)if((u=t[s=r>=0?r--:i++])!=null&&(2&u.__u)==0&&l==u.key&&c==u.type)return s}return-1}function di(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||hu.test(t)?n:n+"px"}function so(e,t,n,o,r){var i,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||di(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||di(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(mi,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[In]=o[In]:(n[In]=Fr,e.addEventListener(t,i?Dr:Nr,i)):e.removeEventListener(t,i?Dr:Nr,i);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function ui(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[lo]==null)t[lo]=Fr++;else if(t[lo]<n[In])return;return n(Y.event?Y.event(t):t)}}}function Hr(e,t,n,o,r,i,s,l,c,u){var _,p,d,f,m,h,b,x,P,v,y,k,w,F,z,q,I=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[l=t.__e=n.__e]),(_=Y.__b)&&_(t);e:if(typeof I=="function"){p=s.length;try{if(P=t.props,v=I.prototype&&I.prototype.render,y=(_=I.contextType)&&o[_.__c],k=_?y?y.props.value:_.__:o,n.__c?x=(d=t.__c=n.__c).__=d.__E:(v?t.__c=d=new I(P,k):(t.__c=d=new et(P,k),d.constructor=I,d.render=Su),y&&y.sub(d),d.state||(d.state={}),d.__n=o,f=d.__d=!0,d.__h=[],d._sb=[]),v&&d.__s==null&&(d.__s=d.state),v&&I.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ht({},d.__s)),ht(d.__s,I.getDerivedStateFromProps(P,d.__s))),m=d.props,h=d.state,d.__v=t,f)v&&I.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),v&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(v&&I.getDerivedStateFromProps==null&&P!==m&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(P,k),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(P,d.__s,k)===!1){t.__v!=n.__v&&(d.props=P,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(H){H&&(H.__=t)}),_o.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(P,d.__s,k),v&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(m,h,b)})}if(d.context=k,d.props=P,d.__P=e,d.__e=!1,w=Y.__r,F=0,v)d.state=d.__s,d.__d=!1,w&&w(t),_=d.render(d.props,d.state,d.context),_o.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,w&&w(t),_=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++F<25);d.state=d.__s,d.getChildContext!=null&&(o=ht(ht({},o),d.getChildContext())),v&&!f&&d.getSnapshotBeforeUpdate!=null&&(b=d.getSnapshotBeforeUpdate(m,h)),z=_!=null&&_.type===le&&_.key==null?Pi(_.props.children):_,l=vi(e,En(z)?z:[z],t,n,o,r,i,s,l,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),x&&(d.__E=d.__=null)}catch(H){if(s.length=p,t.__v=null,c||i!=null){if(H.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i!=null&&(i[i.indexOf(l)]=null),t.__e=l}else if(i!=null)for(q=i.length;q--;)Br(i[q])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),H.then||bi(t),Y.__e(H,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=xu(n.__e,t,n,o,r,i,s,c,u);return(_=Y.diffed)&&_(t),128&t.__u?void 0:l}function bi(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(bi))}function yi(e,t,n){for(var o=0;o<n.length;o++)Ur(n[o],n[++o],n[++o]);Y.__c&&Y.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(i){i.call(r)})}catch(i){Y.__e(i,r.__v)}})}function Pi(e){return typeof e!="object"||e==null||e.__b>0?e:En(e)?e.map(Pi):e.constructor!==void 0?null:ht({},e)}function xu(e,t,n,o,r,i,s,l,c){var u,_,p,d,f,m,h,b=n.props||uo,x=t.props,P=t.type;if(P=="svg"?r="http://www.w3.org/2000/svg":P=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!P&&(P?f.localName==P:f.nodeType==3)){e=f,i[u]=null;break}}if(e==null){if(P==null)return document.createTextNode(x);e=document.createElementNS(r,P,x.is&&x),l&&(Y.__m&&Y.__m(t,i),l=!1),i=null}if(P==null)b===x||l&&e.data==x||(e.data=x);else{if(i=P=="textarea"&&x.defaultValue!=null?null:i&&fo.call(e.childNodes),!l&&i!=null)for(b={},u=0;u<e.attributes.length;u++)b[(f=e.attributes[u]).name]=f.value;for(u in b)f=b[u],u=="dangerouslySetInnerHTML"?p=f:u=="children"||u in x||u=="value"&&"defaultValue"in x||u=="checked"&&"defaultChecked"in x||so(e,u,null,f,r);for(u in x)f=x[u],u=="children"?d=f:u=="dangerouslySetInnerHTML"?_=f:u=="value"?m=f:u=="checked"?h=f:l&&typeof f!="function"||b[u]===f||so(e,u,f,b[u],r);if(_)l||p&&(_.__html==p.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(p&&(e.innerHTML=""),vi(t.type=="template"?e.content:e,En(d)?d:[d],t,n,o,P=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,s,i?i[0]:n.__k&&an(n,0),l,c),i!=null)for(u=i.length;u--;)Br(i[u]);l&&P!="textarea"||(u="value",P=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[u]||P=="progress"&&!m||P=="option"&&m!=b[u])&&so(e,u,m,b[u],r),u="checked",h!=null&&h!=e[u]&&so(e,u,h,b[u],r))}return e}function Ur(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(r){Y.__e(r,n)}}function xi(e,t,n){var o,r;if(Y.unmount&&Y.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Ur(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){Y.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&xi(o[r],t,n||typeof e.type!="function");n||Br(e.__e),e.__c=e.__=e.__e=void 0}function Su(e,t,n){return this.constructor(e,n)}function Mn(e,t,n){var o,r,i,s;t==document&&(t=document.documentElement),Y.__&&Y.__(e,t),r=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],Hr(t,e=(!o&&n||t).__k=bt(le,null,[e]),r||uo,uo,t.namespaceURI,!o&&n?[n]:r?null:t.firstChild?fo.call(t.childNodes):null,i,!o&&n?n:r?r.__e:t.firstChild,o,s),yi(i,e,s),e.props.children=null}fo=_o.slice,Y={__e:function(e,t,n,o){for(var r,i,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(e)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),s=r.__d),s)return r.__E=r}catch(l){e=l}throw e}},_i=0,$r=function(e){return e!=null&&e.constructor===void 0},et.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ht({},this.state),typeof e=="function"&&(e=e(ht({},n),this.props)),e&&ht(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ci(this))},et.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ci(this))},et.prototype.render=le,Rt=[],pi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fi=function(e,t){return e.__v.__b-t.__v.__b},po.__r=0,Or=Math.random().toString(8),lo="__d"+Or,In="__a"+Or,mi=/(PointerCapture)$|Capture$/i,Fr=0,Nr=ui(!1),Dr=ui(!0),vu=0;var C={id:"help-ai",name:"@helpai/elements",global:"HelpAI",tagName:"web-ai-chat",cssPrefix:"helpai",defaultBaseUrl:"https://help.ai",displayName:"Help AI",domain:"help.ai",siteUrl:"https://help.ai"};var Si={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This chat is closed",conversationLoading:"Loading chat\u2026",loadPreviousMessages:"Load previous messages",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",loadMoreConversations:"Load more conversations",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new chat",talkToOperator:"Talk to an operator",connectingOperator:"Connecting you to an operator\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",cancelOperatorRequest:"Keep chatting with the AI",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",showOptions:"Show options",hideOptions:"Hide options",qtypeText:"Your answer",qtypeEmail:"Email address",qtypePhone:"Phone number",qtypeNumber:"Number",qtypeDate:"Date",qtypeChooseOne:"Pick one",qtypeChooseAny:"Pick any",qtypeBoolean:"Yes / No",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approve:"Approve",reject:"Reject",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Submitted",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},ku={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Ce chat est ferm\xE9",conversationLoading:"Chargement du chat\u2026",loadPreviousMessages:"Charger les messages pr\xE9c\xE9dents",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",loadMoreConversations:"Charger plus de conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer un nouveau chat",talkToOperator:"Parler \xE0 un op\xE9rateur",connectingOperator:"Mise en relation avec un op\xE9rateur\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",cancelOperatorRequest:"Continuer avec l'IA",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",showOptions:"Afficher les options",hideOptions:"Masquer les options",qtypeText:"Votre r\xE9ponse",qtypeEmail:"Adresse e-mail",qtypePhone:"Num\xE9ro de t\xE9l\xE9phone",qtypeNumber:"Nombre",qtypeDate:"Date",qtypeChooseOne:"Choisir une",qtypeChooseAny:"Choisir plusieurs",qtypeBoolean:"Oui / Non",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approve:"Approuver",reject:"Refuser",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"Envoy\xE9",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},wu={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",loadPreviousMessages:"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0631\u0633\u0627\u0626\u0644 \u0627\u0644\u0633\u0627\u0628\u0642\u0629",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u062F\u0631\u062F\u0634\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062F\u0631\u062F\u0634\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",loadMoreConversations:"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0632\u064A\u062F \u0645\u0646 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0645\u0648\u0638\u0641",connectingOperator:"\u062C\u0627\u0631\u064A \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0623\u062D\u062F \u0627\u0644\u0645\u0648\u0638\u0641\u064A\u0646\u2026",noOperatorAvailable:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u0648\u0638\u0641\u0648\u0646 \u0645\u062A\u0627\u062D\u0648\u0646 \u0627\u0644\u0622\u0646 \u2014 \u0627\u062A\u0631\u0643 \u0628\u064A\u0627\u0646\u0627\u062A\u0643 \u0648\u0633\u0646\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643.",chattingWithOperator:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 {operator}",cancelOperatorRequest:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0639 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",feedbackUp:"\u0631\u062F \u062C\u064A\u062F",feedbackDown:"\u0631\u062F \u0633\u064A\u0626",feedbackThanks:"\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643",copy:"\u0646\u0633\u062E",copied:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",showOptions:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",hideOptions:"\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",qtypeText:"\u0625\u062C\u0627\u0628\u062A\u0643",qtypeEmail:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",qtypePhone:"\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641",qtypeNumber:"\u0631\u0642\u0645",qtypeDate:"\u062A\u0627\u0631\u064A\u062E",qtypeChooseOne:"\u0627\u062E\u062A\u0631 \u0648\u0627\u062D\u062F\u064B\u0627",qtypeChooseAny:"\u0627\u062E\u062A\u0631 \u0623\u064A\u064B\u0627",qtypeBoolean:"\u0646\u0639\u0645 / \u0644\u0627",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},Cu={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Este chat est\xE1 cerrado",conversationLoading:"Cargando chat\u2026",loadPreviousMessages:"Cargar mensajes anteriores",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",loadMoreConversations:"Cargar m\xE1s conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar un chat nuevo",talkToOperator:"Hablar con un operador",connectingOperator:"Conect\xE1ndote con un operador\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",cancelOperatorRequest:"Seguir con la IA",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",showOptions:"Mostrar opciones",hideOptions:"Ocultar opciones",qtypeText:"Tu respuesta",qtypeEmail:"Correo electr\xF3nico",qtypePhone:"N\xFAmero de tel\xE9fono",qtypeNumber:"N\xFAmero",qtypeDate:"Fecha",qtypeChooseOne:"Elige una",qtypeChooseAny:"Elige varias",qtypeBoolean:"S\xED / No",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approve:"Aprobar",reject:"Rechazar",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Enviado",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},Ru={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E0\u05E1\u05D2\u05E8",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",loadPreviousMessages:"\u05D8\u05E2\u05D9\u05E0\u05EA \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05E7\u05D5\u05D3\u05DE\u05D5\u05EA",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",collapse:"\u05DB\u05D9\u05D5\u05D5\u05E5",collapseSidebar:"\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",composerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",dateLastWeek:"7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",dateOlder:"\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",dateToday:"\u05D4\u05D9\u05D5\u05DD",dateYesterday:"\u05D0\u05EA\u05DE\u05D5\u05DC",dropZone:"\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E6\u05F3\u05D0\u05D8",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E7\u05D5\u05D3\u05DE\u05D9\u05DD",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E6\u05F3\u05D0\u05D8",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",loadMoreConversations:"\u05D8\u05E2\u05D9\u05E0\u05EA \u05E9\u05D9\u05D7\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",talkToOperator:"\u05D3\u05D1\u05E8 \u05E2\u05DD \u05E0\u05E6\u05D9\u05D2",connectingOperator:"\u05DE\u05D7\u05D1\u05E8 \u05D0\u05D5\u05EA\u05DA \u05DC\u05E0\u05E6\u05D9\u05D2\u2026",noOperatorAvailable:"\u05D0\u05D9\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05DB\u05E2\u05EA \u2014 \u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA \u05D5\u05E0\u05D7\u05D6\u05D5\u05E8 \u05D0\u05DC\u05D9\u05DA.",chattingWithOperator:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD {operator}",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",feedbackUp:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D8\u05D5\u05D1\u05D4",feedbackDown:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D2\u05E8\u05D5\u05E2\u05D4",feedbackThanks:"\u05EA\u05D5\u05D3\u05D4 \u05E2\u05DC \u05D4\u05DE\u05E9\u05D5\u05D1",copy:"\u05D4\u05E2\u05EA\u05E7",copied:"\u05D4\u05D5\u05E2\u05EA\u05E7",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",showOptions:"\u05D4\u05E6\u05D2 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",hideOptions:"\u05D4\u05E1\u05EA\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",qtypeText:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",qtypeEmail:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",qtypePhone:"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF",qtypeNumber:"\u05DE\u05E1\u05E4\u05E8",qtypeDate:"\u05EA\u05D0\u05E8\u05D9\u05DA",qtypeChooseOne:"\u05D1\u05D7\u05E8 \u05D0\u05D7\u05EA",qtypeChooseAny:"\u05D1\u05D7\u05E8 \u05DB\u05DE\u05D4",qtypeBoolean:"\u05DB\u05DF / \u05DC\u05D0",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E9\u05DC\u05D7",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},Tu={en:Si,fr:ku,ar:wu,es:Cu,he:Ru};function mo(e,t){let n=ki(e),o=go(t),r=n==="en"?{}:Tu[n]??{},i=o?t[n]??{}:t??{},s=o?t.en??{}:{};return{...Si,...r,...s,...i}}function ki(e){return(e.split("-")[0]??"en").toLowerCase()}var Iu=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function wi(e){return Iu.has(ki(e))}function Ze(e,t){return e[t]??t}function go(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function Ci(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function Ri(e,t){let{translations:n,defaultLocale:o,...r}=e,i=Ci(n,t);return i?{...r,title:i.title??r.title,description:i.description??r.description,content:i.content??r.content}:r}function Ti(e,t){let{translations:n,defaultLocale:o,...r}=e,i=Ci(n,t);if(!i)return r;let s=new Map((i.fields??[]).map(c=>[c.name,c])),l=r.fields.map(c=>{let u=s.get(c.name);if(!u)return c;let _=new Map((u.options??[]).map(p=>[p.value,p]));return{...c,label:u.label??c.label,placeholder:u.placeholder??c.placeholder,validationHint:u.validationHint??c.validationHint,options:c.options?.map(p=>{let d=_.get(p.value);return d?{...p,label:d.label??p.label,description:d.description??p.description}:p})}});return{...r,title:i.title??r.title,description:i.description??r.description,submitLabel:i.submitLabel??r.submitLabel,fields:l}}var zr=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},vo=new zr;var Eu=["off","error","warn","info","debug","trace"],qr=C.cssPrefix,Au=`${qr}.debug`,Mu=`__${C.global}_DEBUG__`,Lu=`${qr}-debug`,Ai=2,Ii=null;function Ou(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Lu);if(e!==null){let t=Ei(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Au);if(e){let t=Ei(e);if(t>=0)return t}}catch{}return Reflect.get(window,Mu)?4:2}function Ei(e){if(e===!0||e==="1"||e==="true")return 4;if(e===!1||e==="0"||e==="false"||e==="off")return 0;if(typeof e=="number")return Math.max(0,Math.min(5,Math.floor(e)));if(typeof e=="string"){let t=Eu.indexOf(e);if(t>=0)return t}return-1}Ai=Ou();function Mi(e){let t=`[${qr}:${e}]`,n=(o,r,i)=>(s,l)=>{if(!(Ai<o)&&(l===void 0?console[r](t,s):console[r](t,s,l),Ii))try{Ii({level:i,scope:e,message:s,payload:l})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:o=>Mi(`${e}:${o}`)}}var ee=Mi("core");var Ht=ee.scope("context"),Nu=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),Li=50,Vr=1024,Du=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Wr(e){return Oi(e,"userContext",!0)}function Gr(e){return Oi(e,"pageContext",!1)}function Oi(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){Ht.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},r=0;for(let[i,s]of Object.entries(e)){if(Nu.has(i)){Ht.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(s==null)continue;if(r>=Li){Ht.warn(`${t} truncated at ${Li} keys \u2014 dropped "${i}"`);continue}let l=$u(t,i,s);l!==void 0&&(o[i]=l,r++)}return n&&typeof o.email=="string"&&!Du.test(o.email)&&(Ht.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function $u(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){Ht.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Vr?(Ht.warn(`truncated ${e}.${t} to ${Vr} chars`),o.slice(0,Vr)):o}Ht.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var ho={maxBytes:10485760,maxCount:10,accept:"*/*"},Ni={voice:"local"},Di={list:[],byTrigger:{}},Kr={enabled:!0,sampleRate:1},bo={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},sn={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},$i={floating:["theme","textSize","history","close","clear","expand","fullscreen","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","sound","language"]},jr={enabled:!0,volume:.3,events:void 0},Fi={enabled:!0,events:void 0},Bi=[{label:"tabConversations",layout:"chat"}];function ln(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},r=t.i18n??{},i=t.feedback??{},s=t.footer??{},l=t.header??{},{themeMode:c,themeOverrides:u}=Fu(t.theme),_=n.mode??"floating",p=Bu(r.defaultLocale),d=r.availableLocales??[r.locale??p],f=cn(r.locale??p,d,p),m=(t.baseUrl??C.defaultBaseUrl).replace(/\/$/,""),h=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),b=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:h,dataApiBaseUrl:b,userContext:Wr(t.userContext),pageContext:Gr(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:u,mode:_,iframe:n.iframe??!1,responseMode:o.responseMode??"streaming",showReasoning:o.showReasoning??!1,showToolCalls:o.showToolCalls??!1,showSources:o.showSources??!1,enableMessageFeedback:!(o.disableMessageFeedback??!1),autoSendSuggestions:o.autoSendSuggestions??!1,features:{voice:t.features?.voice??Ni.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0},forms:Ln(t.forms,f),endpoints:{upload:t.endpoints?.upload??bo.upload,transcribe:t.endpoints?.transcribe??bo.transcribe,submitForm:t.endpoints?.submitForm??bo.submitForm},attachments:{accept:t.composer?.attachments?.accept??ho.accept,maxBytes:t.composer?.attachments?.maxBytes??ho.maxBytes,maxCount:t.composer?.attachments?.maxCount??ho.maxCount},locale:f,defaultLocale:p,availableLocales:d,startMinimized:o.startMinimized??!0,actions:Hu(_,l.actions),size:n.size??{},launcher:ju(t.launcher),sound:Uu(i.sound),haptics:zu(i.haptics),strings:mo(f,r.strings),stringsOverride:r.strings,composerDisclaimer:s.composerDisclaimer??"",poweredBy:Vu(s.poweredBy),composer:Wu(t.composer),modules:Gu(t.modules),tracking:qu(t.tracking,b),storage:t.storage??vo,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Fu(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function Bu(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function cn(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function Hu(e,t){return t??$i[e]}function Uu(e){return{enabled:e?.enabled??jr.enabled,volume:e?.volume??jr.volume,events:e?.events}}function zu(e){return{enabled:e?.enabled??Fi.enabled,events:e?.events}}function qu(e,t){let n=e?.sampleRate??Kr.sampleRate;return{enabled:e?.enabled??Kr.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(n)?n:1)),token:e?.token}}function Vu(e){let n={...{text:`Powered by ${C.displayName}`,href:C.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function Wu(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Gu(e){let t=e===void 0?Bi:e,n=new Set,o=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let s=i.contentTags?.filter(Boolean),l=i.id??s?.[0]??i.layout;for(;n.has(l);)l=`${l}-${o.length}`;n.add(l);let c={id:l,label:i.label,layout:i.layout};s&&s.length>0&&(c.contentTags=s),i.layout==="home"&&(c.brandName=i.brandName,c.greetingText=i.greetingText,c.showGreeting=!(i.hideGreeting??!1),c.showSearchBar=!(i.hideSearchBar??!1),c.showRecentConversations=!(i.hideRecentConversations??!1),i.userAvatars&&i.userAvatars.length>0&&(c.userAvatars=i.userAvatars),i.status&&(c.status=i.status),c.contentBlockTitle=i.contentBlockTitle),o.push(c)}let r=Object.fromEntries(o.map(i=>[i.id,i]));return{list:o,byId:r}}function Ln(e,t){var i;if(!e?.length)return Di;let n=[],o=new Set;for(let s of e){if(!s?.id||o.has(s.id))continue;let l=Ti(s,t),c=(l.fields??[]).filter(_=>!!(_&&_.name&&_.label&&_.type)),u=(Array.isArray(l.on)?l.on:[l.on]).map(Ku).filter(_=>_!==null);c.length===0||u.length===0||(o.add(l.id),n.push({id:l.id,triggers:u,when:l.when,fields:c,title:l.title,description:l.description,submitLabel:l.submitLabel,skippable:l.skippable??!1,frequency:l.frequency??"once",mirrorToContext:l.mirrorToContext??!0,reopenable:l.reopenable??!0,reviewable:l.reviewable??!0}))}let r={};for(let s of n)for(let l of s.triggers)(r[i=l.kind]??(r[i]=[])).push(s);return{list:n,byTrigger:r}}function Ku(e){if(typeof e!="string")return null;if(e==="pre-chat"||e==="conversation-closed"||e==="panel-close"||e==="manual")return{kind:e};let[t,n]=e.split(":",2);if(t==="after-messages"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"after-messages",param:o}:null}if(t==="idle"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"idle",param:o}:null}return t==="page-area"&&n?{kind:"page-area",param:n}:null}function ju(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??sn.variant,size:e?.size??sn.size,label:e?.label??sn.label,icon:e?.icon??sn.icon,hidden:e?.hidden??sn.hidden,callout:t}}function Xr(e,t,n,o){let r=cn(t,e.availableLocales,e.defaultLocale);if(r===e.locale&&n===e.themeMode&&o===e.textSize)return e;let i={...e};return r!==e.locale&&(i.locale=r,i.strings=mo(r,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var Xu=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Yr(e,t){if(!t)return e;let n={...e};for(let i of Xu){let s=t[i];if(s===void 0)continue;let l=e[i];if(i==="theme"){l===void 0&&(n[i]=s);continue}i!=="i18n"&&(n[i]=Hi(s,l))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let o=e.i18n,r=t.i18n;if(o||r){let i=Hi(r??{},o);r?.availableLocales!==void 0&&(i.availableLocales=r.availableLocales),r?.defaultLocale!==void 0&&(i.defaultLocale=r.defaultLocale);let s=o?.strings,l=r?.strings;(s||l)&&(i.strings=Yu(l,s)),n.i18n=i}return n}function Hi(e,t){if(!t)return e;let n={...e};for(let[o,r]of Object.entries(t))r!==void 0&&(n[o]=r);return n}function Yu(e,t){if(!e)return t;if(!t)return e;let n=go(e),o=go(t);if(!n&&!o)return{...e,...t};let r={},i=n?e:{en:e},s=o?t:{en:t};for(let[l,c]of Object.entries(i))r[l]={...c};for(let[l,c]of Object.entries(s))r[l]={...r[l],...c};return r}var Ju=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],yt=e=>e!=="false",Qu=e=>e.split(",").map(t=>t.trim()).filter(Boolean),zi=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["theme","theme",e=>e]],qi=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",yt]],Vi=[["width","width"],["height","height"]],Wi=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",yt],["show-reasoning","showReasoning",yt],["show-tool-calls","showToolCalls",yt],["show-sources","showSources",yt],["disable-message-feedback","disableMessageFeedback",yt],["auto-send-suggestions","autoSendSuggestions",yt]],Gi=[["locale","locale"]],Zu=new Set(Ju),e_=e=>Qu(e).filter(t=>Zu.has(t)),Ki=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",yt]],ji=[["features-disable-file-upload","disableFileUpload",yt],["features-voice","voice",e=>e]],Xi=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Yi=[["user-id","id"],["user-email","email"],["user-name","name"]],Ji=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],t_=["launcher-label","callout-text","callout-delay","actions","user-context","page-context"],n_=[zi,qi,Vi,Wi,Gi,Ki,ji,Xi,Yi,Ji],o_=new Set(["iframe","start-minimized"]),Jr=[...n_.flatMap(e=>e.map(([t])=>t).filter(t=>!o_.has(t))),...t_];function Qr(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,h]of zi){let b=n(f);b!==void 0&&(t[m]=h?h(b):b)}let o=Ut(n,qi),r=Ut(n,Vi);(o||r)&&(t.presentation={...o,...r?{size:r}:{}});let i=Ut(n,Wi);i&&(t.behavior=i);let s=Ut(n,Gi);s&&(t.i18n=s);let l=r_(e,n);l&&(t.launcher=l);let c=Ut(n,ji);c&&(t.features=c);let u=Ut(n,Xi);u&&(t.endpoints=u);let _=Ui(n,Yi,"user-context");_&&(t.userContext=_);let p=Ui(n,Ji,"page-context");p&&(t.pageContext=p);let d=n("actions");return d!==void 0&&(t.header={actions:e_(d)}),t}function Ut(e,t){let n={};for(let[o,r,i]of t){let s=e(o);s!==void 0&&(n[r]=i?i(s):s)}return Object.keys(n).length>0?n:null}function Ui(e,t,n){let o={};for(let[l,c]of t){let u=e(l);u!==void 0&&(o[c]=u)}let r={},i=e(n);if(i)try{let l=JSON.parse(i);l&&typeof l=="object"&&!Array.isArray(l)&&(r=l)}catch{}let s={...r,...o};return Object.keys(s).length>0?s:null}function r_(e,t){let n=Ut(t,Ki)??{},o=e("launcher-label");o!==null&&(n.label=o);let r=t("callout-text");if(r){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:r,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}function at(){let e=Date.now(),t=new Uint8Array(16);t[0]=Math.floor(e/2**40)&255,t[1]=Math.floor(e/2**32)&255,t[2]=e>>>24&255,t[3]=e>>>16&255,t[4]=e>>>8&255,t[5]=e&255,a_(t.subarray(6)),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function a_(e){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){crypto.getRandomValues(e);return}for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256)}var zt=ee.scope("persistence");function dn(e,t=vo,n){let o=n?`${e}.${n}`:e,r=`${C.cssPrefix}.storageVersion`,i=t.get(r)??void 0,s=i?`.v${i}`:"",l=`${C.cssPrefix}.${o}${s}`,c=`${C.cssPrefix}${s}.visitorId`,u=`${l}.conversationId`,_=`${l}.userPrefs`,p=`${l}.panelOpen`,d=`${l}.panelSize`,f=`${l}.calloutDismissed`,m=`${l}.sidebarCollapsed`,h=`${l}.activeModule`,b=`${l}.historyCount`,x=`${l}.formsDone`,P={getVisitorId(){let v=t.get(c);if(v)return v;let y=at();return t.set(c,y),y},setVisitorId(v){zt.debug("setVisitorId (rebind)",{id:v,scope:o}),t.set(c,v)},loadConversationId(){return t.get(u)??void 0},saveConversationId(v){zt.trace("saveConversationId",{id:v,scope:o}),v?t.set(u,v):t.remove(u)},loadDraft(v){return t.get(`${l}.draft.${v}`)??""},saveDraft(v,y){let k=`${l}.draft.${v}`;y?t.set(k,y):t.remove(k)},loadUserPrefs(){let v=t.get(_);if(!v)return{};try{let y=JSON.parse(v);return Qi(y)?y:{}}catch(y){return zt.warn("loadUserPrefs parse failed",{error:y}),{}}},saveUserPrefs(v){try{t.set(_,JSON.stringify(v))}catch(y){zt.warn("saveUserPrefs serialise failed",{error:y})}},patchUserPrefs(v){let y=P.loadUserPrefs();P.saveUserPrefs({...y,...v})},loadPanelOpen(){let v=t.get(p);return v==="1"?!0:v==="0"?!1:null},savePanelOpen(v){t.set(p,v?"1":"0")},loadPanelSize(){let v=t.get(d);return v==="normal"||v==="expanded"||v==="fullscreen"?v:null},savePanelSize(v){t.set(d,v)},loadCalloutDismissed(v){if(!v)return!1;let y=t.get(f);return!!y&&y===v},saveCalloutDismissed(v){v?t.set(f,v):t.remove(f)},loadSidebarCollapsed(){let v=t.get(m);return v==="1"?!0:v==="0"?!1:null},saveSidebarCollapsed(v){t.set(m,v?"1":"0")},loadActiveModule(){return t.get(h)||null},saveActiveModule(v){t.set(h,v)},loadHistoryCount(){let v=t.get(b);if(!v)return null;let y=Number.parseInt(v,10);return Number.isFinite(y)&&y>=0?y:null},saveHistoryCount(v){t.set(b,String(v))},loadFormsDone(){let v=t.get(x);if(!v)return{};try{let y=JSON.parse(v);return Qi(y)?y:{}}catch(y){return zt.warn("loadFormsDone parse failed",{error:y}),{}}},saveFormDone(v){try{let y=P.loadFormsDone();y[v]=Date.now(),t.set(x,JSON.stringify(y))}catch(y){zt.warn("saveFormDone serialise failed",{error:y})}},rememberStorageVersion(v){v&&v!==t.get(r)&&(zt.debug("rememberStorageVersion (force-reset on next load)",{version:v}),t.set(r,v))},clearConversation(){t.remove(u)}};return P}function Qi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Zi=`:host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent: var(--__P__-accent-user);--__P__-accent-text-user: __BRAND_ACCENT_TEXT__;--__P__-accent-text: var(--__P__-accent-text-user);--__P__-accent-fg: var(--__P__-accent);--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-pill-l-min: .3;--__P__-pill-l-max: .46;--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-conversation-max: 768px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-scale: 1;--__P__-text-xs: calc(12px * var(--__P__-text-scale));--__P__-text-sm: calc(13px * var(--__P__-text-scale));--__P__-text-base: calc(15px * var(--__P__-text-scale));--__P__-text-md: calc(16px * var(--__P__-text-scale));--__P__-text-lg: calc(18px * var(--__P__-text-scale));--__P__-text-xl: calc(22px * var(--__P__-text-scale));--__P__-text-2xl: calc(30px * var(--__P__-text-scale))}:host([data-mode="modal"]),:host([data-mode="drawer"]){--__P__-conversation-max: 100%}:host([data-text-size="small"]){--__P__-text-scale: .9}:host([data-text-size="large"]){--__P__-text-scale: 1.15}:host{--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light;--__P__-color-scheme: light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;color-scheme:dark;--__P__-color-scheme: dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark;--__P__-color-scheme: dark}}@supports (color: oklch(from red l c h)){:host{--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.3, l, .62) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h);--__P__-accent-fg: oklch(from var(--__P__-accent-user) clamp(.3, l, .46) c h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
|
|
2
|
+
`;var es=`*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent-fg);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
3
|
+
`;var ts=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent-fg);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent-fg);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent-fg);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list--fade{--__P__-fade-size: 20px;--__P__-fade-top: 0px;--__P__-fade-bottom: 0px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%);mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%)}.__P__-list--fade[data-fade-top=true]{--__P__-fade-top: var(--__P__-fade-size)}.__P__-list--fade[data-fade-bottom=true]{--__P__-fade-bottom: var(--__P__-fade-size)}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-load-previous,.__P__-history-more{display:flex;justify-content:center}.__P__-load-previous button,.__P__-history-more button{border:0;padding:4px 8px;background:transparent;color:var(--__P__-accent);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;cursor:pointer}.__P__-load-previous button:hover,.__P__-history-more button:hover{text-decoration:underline}.__P__-load-previous button:focus-visible,.__P__-history-more button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-load-previous button:disabled,.__P__-history-more button:disabled{cursor:wait;opacity:.6}.__P__-date-divider{display:flex;justify-content:center;margin-block:var(--__P__-space-3)}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:break-word;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border:1px solid var(--__P__-border);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble{display:flex;align-items:stretch;padding:0;overflow:hidden;background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-author{display:flex;flex:0 0 auto;align-items:center;padding:0 .875rem;border-inline-end:1px solid color-mix(in oklab,var(--__P__-accent),transparent 60%);color:var(--__P__-accent);font-size:calc(13px * var(--__P__-text-scale));font-weight:600;letter-spacing:.025em;user-select:none}.__P__-bubble-row[data-role=operator] .__P__-bubble-body{flex:1 1 auto;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4)}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-meta{display:flex;align-items:center;gap:8px;margin-top:2px;padding:0 2px;min-height:24px}.__P__-bubble-actions{display:flex;align-items:center;gap:2px}.__P__-bubble-time{font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-feedback{display:flex;align-items:center;gap:2px}.__P__-msg-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:var(--__P__-radius-sm);background:transparent;color:var(--__P__-fg-muted);cursor:pointer;opacity:.65;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-msg-action:hover{opacity:1;background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-msg-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-msg-action[data-active=true]{opacity:1;color:var(--__P__-accent-fg)}.__P__-msg-action svg{width:15px;height:15px}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent-fg);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent-fg)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent-fg);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-operator-banner{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 var(--__P__-space-3) var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg-elevated),var(--__P__-accent) 6%);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);line-height:1.3;text-align:center}.__P__-operator-pulse{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-operator-banner[data-mode=awaiting_operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}.__P__-cancel-operator-request{flex:0 0 auto;padding:0;border:0;background:none;color:var(--__P__-accent);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.__P__-cancel-operator-request:hover{opacity:.8}.__P__-cancel-operator-request:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-radius:var(--__P__-radius-sm)}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent-fg)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent-fg);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent-fg)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-2px;left:calc(50% + 6px);width:8px;height:8px;border-radius:50%;background:var(--__P__-accent);box-shadow:0 0 0 2px var(--__P__-bg-elevated)}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent-fg)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent-fg);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-history>*,.__P__-home-scroll>*,.__P__-module-scroll>*,.__P__-help-list>*,.__P__-history-footer>*,.__P__-module-pad{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-header,.__P__-back-header{padding-inline:max(12px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-tabbar{padding-inline:max(0px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--__P__-space-2)}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-type{flex-shrink:0;align-self:center;margin-inline-start:auto;border:1px solid var(--__P__-border);border-radius:5px;background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);padding:1px 7px;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);white-space:nowrap}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent-fg)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none;-webkit-tap-highlight-color:transparent;user-select:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-chevron{display:inline-flex;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}details.__P__-toolui-collapsible>summary .__P__-toolui-status{margin-inline-start:auto}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{--__P__-pill: var(--__P__-fg-muted);display:inline-flex;min-width:0;align-items:center;gap:5px;padding:3px 7px;border-radius:5px;border:1px solid var(--__P__-border);background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);color:var(--__P__-pill);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge svg,.__P__-toolui-name-pill svg,.__P__-toolui-q-pill svg{flex-shrink:0;width:14px;height:14px}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-name-pill{--__P__-pill: oklch(.68 .13 233)}.__P__-toolui-q-pill{--__P__-pill: oklch(.66 .12 195)}.__P__-toolui-status[data-status=completed]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=responded]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=awaiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=denied]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=error]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=superseded]{--__P__-pill: var(--__P__-fg-muted)}@supports (color: oklch(from red l c h)){.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{color:oklch(from var(--__P__-pill) clamp(var(--__P__-pill-l-min),l,var(--__P__-pill-l-max)) c h)}}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-head-end{display:inline-flex;align-items:center;gap:var(--__P__-space-2);margin-inline-start:auto}.__P__-toolui-collapse-body{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-summary{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-toolui-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);margin-inline:calc(-1 * var(--__P__-space-4));padding:var(--__P__-space-3) var(--__P__-space-4) 0;border-top:1px solid var(--__P__-border)}.__P__-toolui-options-toggle{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:0;cursor:pointer;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);transition:color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-toolui-options-toggle:hover{color:var(--__P__-fg)}.__P__-toolui-options-chevron{display:inline-flex;transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-options-chevron svg{width:14px;height:14px}.__P__-toolui-options-chevron.__P__-open{transform:rotate(180deg)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
|
|
4
|
+
`;var ns=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
|
|
5
|
+
`;var os=`:host([data-mode="page"]){min-height:0}:host([data-mode="page"]) .__P__-page-shell{display:grid;grid-template-columns:280px 1fr;width:100%;height:100%;min-height:0;background:var(--__P__-bg);color:var(--__P__-fg);transition:grid-template-columns var(--__P__-dur-base) var(--__P__-ease-in-out)}:host([data-mode="page"]) .__P__-page-shell[data-sidebar-collapsed=true]{grid-template-columns:48px 1fr}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}:host([data-mode="page"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-width:0;min-height:0;flex:1 1 0}:host([data-mode="page"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;animation:none}:host([data-mode="page"]) .__P__-sidebar{border-inline-end:1px solid var(--__P__-border);display:flex;flex-direction:column;overflow:hidden;background:var(--__P__-surface)}:host([data-mode="page"]) .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-5);border-bottom:1px solid var(--__P__-border);display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2);min-height:56px;box-sizing:border-box}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-2);justify-content:center}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-logo,:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-title{display:none}:host([data-mode="page"]) .__P__-sidebar-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--__P__-border);border-radius:6px;background:transparent;color:var(--__P__-fg);cursor:pointer;transition:background .12s,border-color .12s}:host([data-mode="page"]) .__P__-sidebar-toggle:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-toggle:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-logo{height:32px;display:block}:host([data-mode="page"]) .__P__-sidebar-title{font-size:var(--__P__-text-md);font-weight:600}:host([data-mode="page"]) .__P__-sidebar-section{padding:var(--__P__-space-3) var(--__P__-space-4);border-bottom:1px solid var(--__P__-border)}:host([data-mode="page"]) .__P__-sidebar-nav{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}:host([data-mode="page"]) .__P__-sidebar-nav-item{display:flex;align-items:center;gap:10px;padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);text-decoration:none;font-size:calc(14px * var(--__P__-text-scale));transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-nav-item:hover{background:var(--__P__-hover)}:host([data-mode="page"]) .__P__-sidebar-nav-item:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}:host([data-mode="page"]) .__P__-sidebar-cards{display:grid;grid-template-columns:1fr;gap:var(--__P__-space-2)}:host([data-mode="page"]) .__P__-sidebar-card{display:block;padding:10px 12px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);text-decoration:none;color:var(--__P__-fg);transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-card:hover{border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-card-label{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}:host([data-mode="page"]) .__P__-sidebar-card-desc{font-size:var(--__P__-text-xs);color:var(--__P__-muted);margin-top:2px}:host([data-mode="page"]) .__P__-sidebar-conversations{flex:1 1 auto;overflow-y:auto;padding:var(--__P__-space-3) var(--__P__-space-4)}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;overflow:hidden}@media(max-width:768px){:host([data-mode="page"]) .__P__-page-shell{grid-template-columns:1fr}:host([data-mode="page"]) .__P__-sidebar{display:none}}
|
|
6
|
+
`;var u_="helpai",__="#5B5BD6",p_="#FFFFFF",f_="12px",m_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",Zr=[Zi,es,ts,ns,os].join(`
|
|
7
|
+
`).replace(/__P__/g,u_).replaceAll("__BRAND_ACCENT_TEXT__",p_).replaceAll("__BRAND_ACCENT__",__).replaceAll("__BRAND_RADIUS__",f_).replaceAll("__BRAND_FONT__",m_);var g_=ee.scope("mount"),rs=new WeakMap,as={floating:"all: initial; position: fixed; z-index: 2147483600;",flow:"all: initial; display: block; position: relative; width: 100%; height: 100%; z-index: 1; contain: size;",viewport:"all: initial; display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;"};function is(e,t){e.style.cssText=as[t]}function yo(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function ss(e={}){let t=e.position??"flow";g_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${C.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let o;e.existingHost?o=e.existingHost:(o=document.createElement(n),(e.target??document.body).appendChild(o)),o.setAttribute("data-brand",C.id),o.style.cssText=as[t];let r=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!v_(r,i)){let l=i.createElement("style");l.textContent=Zr,r.appendChild(l)}let s=document.createElement("div");return s.className=`${C.cssPrefix}-app`,r.appendChild(s),{appRoot:s,destroy:()=>o.remove(),hostElement:o,shadowRoot:r}}function v_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=rs.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(Zr),rs.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function h_(e,t){let n=C.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${n}-conversation-max`,t.contentMaxWidth)}function b_(e,t){e.dataset.theme=t}function y_(e,t){let n=C.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${n}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${n}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${n}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${n}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${n}-panel-inset`,t.inset)}function P_(e,t){e.dataset.position=t}function Po(e,t){e.dataset.mode=t}function ls(e,t){b_(e,t.themeMode),h_(e,t.themeOverrides),P_(e,t.position),y_(e,t.size)}var un,Le,ea,cs,On=0,vs=[],$e=Y,ds=$e.__b,us=$e.__r,_s=$e.diffed,ps=$e.__c,fs=$e.unmount,ms=$e.__;function So(e,t){$e.__h&&$e.__h(Le,e,On||t),On=0;var n=Le.__H||(Le.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function O(e){return On=1,hs(bs,e)}function hs(e,t,n){var o=So(un++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):bs(void 0,t),function(l){var c=o.__N?o.__N[0]:o.__[0],u=o.t(c,l);c!==u&&(o.__N=[u,o.__[1]],o.__c.setState({}))}],o.__c=Le,!Le.__f)){var r=function(l,c,u){if(!o.__c.__H)return!0;var _=!1,p=o.__c.props!==l;if(o.__c.__H.__.some(function(f){if(f.__N){_=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(p=!0)}}),i){var d=i.call(this,l,c,u);return _?d||p:d}return!_||p};Le.__f=!0;var i=Le.shouldComponentUpdate,s=Le.componentWillUpdate;Le.componentWillUpdate=function(l,c,u){if(this.__e){var _=i;i=void 0,r(l,c,u),i=_}s&&s.call(this,l,c,u)},Le.shouldComponentUpdate=r}return o.__N||o.__}function E(e,t){var n=So(un++,3);!$e.__s&&na(n.__H,t)&&(n.__=e,n.u=t,Le.__H.__h.push(n))}function ut(e,t){var n=So(un++,4);!$e.__s&&na(n.__H,t)&&(n.__=e,n.u=t,Le.__h.push(n))}function A(e){return On=5,Z(function(){return{current:e}},[])}function Z(e,t){var n=So(un++,7);return na(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function L(e,t){return On=8,Z(function(){return e},t)}function x_(){for(var e;e=vs.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(xo),t.__h.some(ta),t.__h=[]}catch(n){t.__h=[],$e.__e(n,e.__v)}}}$e.__b=function(e){Le=null,ds&&ds(e)},$e.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ms&&ms(e,t)},$e.__r=function(e){us&&us(e),un=0;var t=(Le=e.__c).__H;t&&(ea===Le?(t.__h=[],Le.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(xo),t.__h.some(ta),t.__h=[],un=0)),ea=Le},$e.diffed=function(e){_s&&_s(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(vs.push(t)!==1&&cs===$e.requestAnimationFrame||((cs=$e.requestAnimationFrame)||S_)(x_)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),ea=Le=null},$e.__c=function(e,t){t.some(function(n){try{n.__h.some(xo),n.__h=n.__h.filter(function(o){return!o.__||ta(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],$e.__e(o,n.__v)}}),ps&&ps(e,t)},$e.unmount=function(e){fs&&fs(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{xo(o)}catch(r){t=r}}),n.__H=void 0,t&&$e.__e(t,n.__v))};var gs=typeof requestAnimationFrame=="function";function S_(e){var t,n=function(){clearTimeout(o),gs&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);gs&&(t=requestAnimationFrame(n))}function xo(e){var t=Le,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Le=t}function ta(e){var t=Le;e.__c=e.__(),Le=t}function na(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function bs(e,t){return typeof t=="function"?t(e):t}var k_=Symbol.for("preact-signals");function Ro(){if(Pt>1)Pt--;else{var e,t=!1;for((function(){var r=wo;for(wo=void 0;r!==void 0;){var i=r.S;if(i.v===r.v)for(var s=i.t;s!==void 0;s=s.x)s.i===r.i&&(s.i=i.i);r=r.o}})();Dn!==void 0;){var n=Dn;for(Dn=void 0,ko++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ps(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(ko=0,Pt--,t)throw e}}function _t(e){if(Pt>0)return e();oa=++w_,Pt++;try{return e()}finally{Ro()}}var Nn,Re=void 0;function $n(e){var t=Re,n=Nn;Re=void 0,Nn=void 0;try{return e()}finally{Re=t,Nn=n}}var Dn=void 0,Pt=0,ko=0,w_=0,oa=0,wo=void 0,Co=0;function ys(e){if(Re!==void 0){var t=e.n;if(t===void 0||t.t!==Re)return t={i:0,S:e,p:Re.s,n:void 0,t:Re,e:void 0,x:void 0,r:t},Re.s!==void 0&&(Re.s.n=t),Re.s=t,e.n=t,32&Re.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Re.s,t.n=void 0,Re.s.n=t,Re.s=t),t}}function qe(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}qe.prototype.brand=k_;qe.prototype.h=function(){return!0};qe.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:$n(function(){var o;(o=t.W)==null||o.call(t)}))};qe.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&$n(function(){var r;(r=t.Z)==null||r.call(t)}))}};qe.prototype.subscribe=function(e){var t=this;return xt(function(){var n=t.value;$n(function(){return e(n)})},{name:"sub"})};qe.prototype.valueOf=function(){return this.value};qe.prototype.toString=function(){return this.value+""};qe.prototype.toJSON=function(){return this.value};qe.prototype.peek=function(){var e=this;return $n(function(){return e.value})};Object.defineProperty(qe.prototype,"value",{get:function(){var e=ys(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ko>100)throw new Error("Cycle detected");(function(n){Pt!==0&&ko===0&&n.l!==oa&&(n.l=oa,wo={S:n,v:n.v,i:n.i,o:wo})})(this),this.v=e,this.i++,Co++,Pt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ro()}}}});function J(e,t){return new qe(e,t)}function Ps(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function xs(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ss(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function qt(e,t){qe.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Co-1,this.f=4}qt.prototype=new qe;qt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Co))return!0;if(this.g=Co,this.f|=1,this.i>0&&!Ps(this))return this.f&=-2,!0;var e=Re;try{xs(this),Re=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Re=e,Ss(this),this.f&=-2,!0};qt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}qe.prototype.S.call(this,e)};qt.prototype.U=function(e){if(this.t!==void 0&&(qe.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};qt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(qt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=ys(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function _e(e,t){return new qt(e,t)}function ks(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Pt++;var n=Re;Re=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,ra(e),o}finally{Re=n,Ro()}}}function ra(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ks(e)}function C_(e){if(Re!==this)throw new Error("Out-of-order effect");Ss(this),Re=e,this.f&=-2,8&this.f&&ra(this),Ro()}function _n(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Nn&&Nn.push(this)}_n.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};_n.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ks(this),xs(this),Pt++;var e=Re;return Re=this,C_.bind(this,e)};_n.prototype.N=function(){2&this.f||(this.f|=2,this.u=Dn,Dn=this)};_n.prototype.d=function(){this.f|=8,1&this.f||ra(this)};_n.prototype.dispose=function(){this.d()};function xt(e,t){var n=new _n(e,t);try{n.c()}catch(r){throw n.d(),r}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var ws,Eo,To,R_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Cs=[];xt(function(){ws=this.N})();function pn(e,t){Y[e]=t.bind(null,Y[e]||function(){})}function Io(e){if(To){var t=To;To=void 0,t()}To=e&&e.S()}function Rs(e){var t=this,n=e.data,o=ct(n);o.value=n;var r=Z(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=_e(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),_=_e(function(){return!Array.isArray(u.value)&&!$r(u.value)}),p=xt(function(){if(this.N=Ts,_.value){var f=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){p(),d.call(this)},[_,u]},[]),i=r[0],s=r[1];return i.value?s.peek():s.value}Rs.displayName="ReactiveTextNode";Object.defineProperties(qe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Rs},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});pn("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var r in o)if(r!=="children"){var i=o[r];i instanceof qe&&(n||(t.__np=n={}),n[r]=i,o[r]=i.peek())}}e(t)});pn("__r",function(e,t){if(e(t),t.type!==le){Io();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(r,i){var s;return xt(function(){s=this},{name:i}),s.c=r,s})(function(){var r;R_&&((r=n.y)==null||r.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),Eo=o,Io(n)}});pn("__e",function(e,t,n,o){Io(),Eo=void 0,e(t,n,o)});pn("diffed",function(e,t){Io(),Eo=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,r=t.props,i=n.U;if(i)for(var s in i){var l=i[s];l===void 0||o&&s in o||(l.d(),i[s]=void 0)}if(o){i||(i={},n.U=i);for(var c in o){var u=i[c],_=o[c];u===void 0?(u=T_(n,c,_,r),i[c]=u):u.o(_,r)}}}e(t)});function T_(e,t,n,o){var r=t in e&&e.ownerSVGElement===void 0,i=J(n);return{o:function(s,l){i.value=s,o=l},d:xt(function(){this.N=Ts;var s=i.value.value;o[t]!==s&&(o[t]=s,r?e[t]=s:s!=null&&(s!==!1||t[4]==="-")?e.setAttribute(t,s):e.removeAttribute(t))})}}pn("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var r in o){var i=o[r];i&&i.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var u=t.__c;if(u){var _=u.__$u;_&&(u.__$u=void 0,_.d())}}e(t)});pn("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});et.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var r in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(o||i||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function ct(e,t){return Z(function(){return J(e,t)},[])}function St(e,t){var n=A(e);return n.current=e,Eo.__$f|=4,Z(function(){return _e(function(){return n.current()},t)},[])}var I_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function E_(){_t(function(){for(var e;e=Cs.shift();)ws.call(e)})}function Ts(){Cs.push(this)===1&&(Y.requestAnimationFrame||I_)(E_)}function Is(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Es(e){return Is(e)}function As(e){return!(!Is(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function A_(e){return`${C.cssPrefix}:${e}`}function Ms(e,t){let o=Object.entries(t).map(([r,i])=>{let s=A_(r),l=c=>i(c.detail);return e.addEventListener(s,l),[s,l]});return()=>{for(let[r,i]of o)e.removeEventListener(r,i)}}function Ao(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var M_=900,L_=640;function aa(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;return o==="expanded"||o==="fullscreen"||o==="normal"?o:n>0&&n<L_?"fullscreen":n>=(t.autoSizeBreakpoint??M_)?"expanded":"normal"}function Fn(e,t,n,o=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:aa(e.mode,e.size,t);return{panelOpen:i,panelSize:l}}function fn(){return typeof window>"u"?0:window.innerWidth}var O_="x-public-key",N_="x-ai-agent-deployment-id";function Ls(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[N_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??O_]=e.publicKey),t}}}function Bn(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),r=()=>i();t?.addEventListener("abort",r,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",r),n()}})}var Mo="1.1.0";var Ve=class extends Error{constructor(n,o,r,i){super(n);ne(this,"code",o);ne(this,"status",r);ne(this,"cause",i);this.name="StreamError"}};var Os=ee.scope("parser");async function*Ns(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new Ve(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of D_(e,t)){let o=$_(n);if(o==="done")return;o&&(yield o)}}async function*D_(e,t){if(!e.body)throw new Ve("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),o="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:r,value:i}=await n.read();if(r){let l=o.trim();l&&(yield l);return}o+=i;let s;for(;(s=o.indexOf(`
|
|
8
8
|
|
|
9
|
-
`))!==-1;){let l=
|
|
10
|
-
`))if(!(
|
|
11
|
-
${o}`:o;continue}r.startsWith("id:")&&(n=r.slice(3).trim())}if(t==="[DONE]")return"done";if(!t)return null;try{let r=JSON.parse(t);return Rs.trace("chunk",{type:r.type,eventId:n}),{chunk:r,eventId:n}}catch(r){return Rs.trace("frame parse failed",{err:r,payload:t.slice(0,200)}),null}}function T_(e){let t=new TextEncoder().encode(e),n="";for(let r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Is=e=>e&&Object.keys(e).length>0?e:void 0;function Es(e,t){let n=Is(e),r=Is(t);if(!n&&!r)return;let o={};return n&&(o.user=n),r&&(o.page=r),T_(JSON.stringify(o))}function Sr(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function I_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function As(e){return e.startsWith("tool-")?e.slice(5):e}var We={handshake:"/pai/handshake",streamMessage:"/pai/stream-message",streamResume:"/pai/stream-resume",cancelStream:"/pai/cancel-stream",listConversations:"/pai/list-conversations",listMessages:"/pai/list-messages",updateSettings:"/pai/update-settings",markRead:"/pai/mark-read",messageFeedback:"/pai/message-feedback",requestOperator:"/pai/request-operator",cancelOperatorRequest:"/pai/cancel-request-operator",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Ms="context";function Pt(e){let t=e??{},n=t.controlMode;return{controlMode:n==="awaiting_operator"||n==="operator"?n:"ai-agent",controlRevision:typeof t.controlRevision=="number"&&Number.isSafeInteger(t.controlRevision)&&t.controlRevision>=0?t.controlRevision:void 0,assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function kr(e){let t=e?.suggestions;if(!Array.isArray(t))return[];let n=[];for(let r of t){if(!r||typeof r!="object")continue;let{id:o,label:i,text:s}=r;typeof i!="string"||!i||n.push({id:typeof o=="string"&&o?o:`s${n.length}`,label:i,text:typeof s=="string"&&s?s:i})}return n}function Jo(e){let n={messages:e.messages.map(r=>({id:r.serverMessageId??r.id,parts:A_(r),role:r.role,createdAt:r.createdAt!==void 0?new Date(r.createdAt).toISOString():void 0})),conversationId:e.conversationId,responseType:"ack"};return e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs),n}function E_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function A_(e){let t=[];for(let n of e.parts)if(n.kind==="step-start"&&t.push({type:"step-start"}),n.kind==="reasoning"&&n.text&&t.push({type:"reasoning",text:n.text,state:n.done?"done":"streaming"}),n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url}),n.kind==="tool"&&E_(n)){let r=n.dynamic?{type:"dynamic-tool",toolName:n.toolName,toolCallId:n.toolCallId,state:n.state}:{type:I_(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(r.input=n.input),n.output!==void 0&&(r.output=n.output),n.error!==void 0&&(r.errorText=n.error),n.approval&&n.approval.approved!==void 0&&(r.approval=n.approval),t.push(r)}for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var re=Z.scope("transport"),M_=6e4,L_=1e4,Ls=3,O_=400,N_=3e4,D_=6e4,$_=15e3,F_=1024*1024,Os=new Set([408,425,429,500,502,503,504]);function Ns(e){return O_*2**e+Math.floor(Math.random()*250)}function B_(e){return D_+Math.ceil(e/F_)*$_}function H_(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),r=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(r)&&r>=0?Math.min(r,3e4):null}var wr=class{constructor(t){ee(this,"ttlMs",t);ee(this,"map",new Map)}getOrFetch(t,n){let r=this.map.get(t);if(r&&Date.now()-r.at<this.ttlMs)return r.result;let o={at:Date.now(),result:n().then(i=>(o.value=i,i)).catch(i=>{throw this.map.delete(t),i})};return this.map.set(t,o),o.result}peek(t){let n=this.map.get(t);if(n?.value!==void 0&&Date.now()-n.at<this.ttlMs)return n.value}clear(){this.map.clear()}},Cr=class{constructor(t){ee(this,"opts",t);ee(this,"visitorId");ee(this,"conversationId");ee(this,"userContext");ee(this,"pageContext");ee(this,"locale");ee(this,"conversationsCache",new wr(L_));ee(this,"loadConversationInflight",new Map);ee(this,"contentCache",new wr(M_))}setContext(t,n){this.userContext=t,this.pageContext=n}setLocale(t){this.locale=t}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.conversationId=n)}envelope(){let t={_ev:xr};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Es(this.userContext,this.pageContext);return n&&(t[Ms]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,r]of Object.entries(this.envelope()))t.append(n,r);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[r,o]of Object.entries(this.envelope()))n.searchParams.has(r)||n.searchParams.set(r,o);return n.toString()}async handshake(t){re.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(We.handshake,t,"handshake");return re.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),q_(n)||re.warn("handshake response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t,n){re.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let r=new FormData;r.append("file",t,t.name);let o=await this.postForm(this.uploadPath,r,"upload",n,B_(t.size));return re.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){re.debug("transcribe \u2192",{size:t.size,mimeType:n});let r=new FormData;r.append("audio",t,`voice.${U_(n)}`),r.append("mimeType",n);let o=await this.postForm(this.transcribePath,r,"transcribe");return re.debug("transcribe \u2190",{textLen:o.text.length}),o}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={}){return this.conversationsCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchConversations(t))}async fetchConversations(t){let n=new URL(this.url(We.listConversations));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.limit&&n.searchParams.set("limit",String(t.limit)),t.cursor&&n.searchParams.set("cursor",t.cursor),re.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let r=await this.getJson(n.toString(),"listConversations"),o=r.conversations??[];return re.debug("listConversations \u2190",{count:o.length,nextCursor:r.nextCursor}),{conversations:o,nextCursor:r.nextCursor}}async loadConversation(t,n=[]){let r=`${t}\0${n.join(",")}`,o=this.loadConversationInflight.get(r);if(o)return o;let i=this.loadConversationDirect(t,n).finally(()=>this.loadConversationInflight.delete(r));return this.loadConversationInflight.set(r,i),i}async loadConversationDirect(t,n){let r=new URL(this.url(We.listMessages));r.searchParams.set("conversationId",t),n.length>0&&r.searchParams.set("ids",n.join(",")),re.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId,ids:n.length>0?n:void 0});let o=await this.getJson(r.toString(),"loadConversation"),i=o.messages??[];return re.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:i.length,hasSuggestions:!!o.suggestions}),{...o,messages:i,canContinue:o.canContinue??!0}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),re.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(We.markRead,{conversationId:t},"markRead")}catch(n){re.debug("markRead failed (non-fatal)",{err:n})}}}async requestOperator(){if(!(!this.visitorId||!this.conversationId)){re.debug("requestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(We.requestOperator,{},"requestOperator")).controlState}catch(t){re.debug("requestOperator failed (non-fatal)",{err:t});return}}}async cancelOperatorRequest(){if(!(!this.visitorId||!this.conversationId)){re.debug("cancelOperatorRequest \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(We.cancelOperatorRequest,{},"cancelOperatorRequest")).controlState}catch(t){re.debug("cancelOperatorRequest failed (non-fatal)",{err:t});return}}}listContent(t={}){return this.contentCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchContent(t))}async fetchContent(t){let n=new URL(this.dataUrl(We.content));for(let[i,s]of Object.entries(t))s!==void 0&&n.searchParams.set(i,Array.isArray(s)?s.join(","):String(s));re.debug("listContent \u2192",t);let r=await this.getJson(n.toString(),"listContent"),o=(r.items??[]).map(i=>yi(i,this.locale));return re.debug("listContent \u2190",{count:o.length,total:r.pagination?.total}),{...r,items:o}}async bootstrap(t){let n=new URL(this.dataUrl(We.bootstrap));t&&n.searchParams.set("conversationId",t),re.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let r=await this.getJson(n.toString(),"bootstrap"),o=r.forms??[],i=r.formSubmissions??[];return re.debug("bootstrap \u2190",{forms:o.length,formSubmissions:i.length}),{forms:o,formSubmissions:i}}async saveUserPrefs(t){re.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(We.updateSettings,{userPrefs:t},"saveUserPrefs");return re.debug("saveUserPrefs \u2190",{success:n.success}),n}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}get submitFormPath(){return this.opts.endpoints?.submitForm??We.submitForm}async submitForm(t){re.debug("submitForm \u2192",{formId:t.formId,trigger:t.trigger,fields:Object.keys(t.values).length});try{await this.postJson(this.dataUrl(this.submitFormPath),t,"submitForm")}catch(n){re.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){re.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(We.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){re.debug("submitFeedback failed (non-fatal)",{err:n})}}async sendTurn(t){this.conversationsCache.clear(),re.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageCount:t.messages.length});try{return await this.runWithAbort(async n=>{let r=await this.fetchImpl(this.url(We.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});if(r.status!==202)throw new $e(`sendTurn failed: expected 202, received ${r.status}`,"server",r.status);let o;try{o=await r.json()}catch(i){throw n?.aborted?i:new $e("sendTurn failed: invalid acknowledgement","server",r.status,i)}if(!z_(o))throw new $e("sendTurn failed: invalid acknowledgement","server",r.status);return o},void 0,N_)}catch(n){throw n instanceof $e?n:new $e("sendTurn failed: network error","network",void 0,n)}}cancelTurn(t,n){!this.visitorId||!t||!n||(re.debug("cancel stream",{conversationId:t,runId:n,visitorId:this.visitorId}),this.fetchImpl(this.url(We.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({conversationId:t,runId:n})),keepalive:!0}).catch(r=>re.debug("cancel POST failed (non-fatal)",{err:r})))}async connectResumeStream(t){let n;try{n=await this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(r){return t.signal.aborted||re.debug("resume-stream fetch failed \u2014 reconnecting",{err:r}),"held"}if(!n.ok)return n.status===409||Os.has(n.status)?(re.debug("resume-stream \u2192 transient response; reconnecting",{status:n.status}),"held"):(re.debug("resume-stream \u2192 endpoint unavailable",{status:n.status}),"unavailable");if(!n.body)return re.debug("resume-stream \u2192 bodyless response; stopping",{status:n.status}),"unavailable";if(!(n.headers.get("content-type")??"").includes("text/event-stream"))return re.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";t.onConnected();try{for await(let{chunk:r}of Ts(n,t.signal)){if(t.signal.aborted)return"held";t.onChunk(r)}}catch(r){if(t.signal.aborted)return"held";re.debug("resume-stream segment dropped \u2014 reconnecting",{err:r})}return"held"}resumeUrl(){return this.withEnvelopeQuery(We.streamResume)}async postJson(t,n,r){let o=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],r);return this.assertOk(o,r)}async postForm(t,n,r,o,i){return this.runWithAbort(async s=>{let l=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n),signal:s});return this.assertOk(l,r)},o,i)}async runWithAbort(t,n,r){if(!n&&r===void 0)return t();let o=new AbortController,i=()=>o.abort(n?.reason);n?.aborted?i():n?.addEventListener("abort",i,{once:!0});let s=r===void 0?void 0:setTimeout(()=>o.abort(),r);try{return await t(o.signal)}finally{s!==void 0&&clearTimeout(s),n?.removeEventListener("abort",i)}}async getJson(t,n){let r=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(r,n)}async fetchWithRetry(t,n){for(let r=0;;r++){let[o,i]=t(),s;try{s=await this.fetchImpl(o,i)}catch(c){if(r>=Ls)throw new $e(`${n} failed: network error`,"network",void 0,c);re.debug("request network error \u2014 retrying",{label:n,attempt:r}),await sn(Ns(r));continue}if(s.ok||!Os.has(s.status)||r>=Ls)return s;let l=H_(s.headers)??Ns(r);re.debug("request retryable status \u2014 retrying",{label:n,status:s.status,attempt:r,wait:l}),await sn(l)}}async assertOk(t,n){if(!t.ok)throw new $e(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function U_(e){return e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mp4")||e.includes("m4a")?"m4a":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":"bin"}function z_(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"status"),n=Reflect.get(e,"conversationId"),r=Reflect.get(e,"runId");return t==="accepted"&&typeof n=="string"&&n.length>0&&(r===void 0||typeof r=="string"&&r.length>0)}function q_(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function ea(e,t){let n=e?[{kind:"text",id:"t0",textSig:X(e),doneSig:X(!0)}]:[];return{id:et(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:X(n)}}function vt(){return{id:et(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:X([])}}function $s(e){let t=et();return V_({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function V_(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,feedback:e.feedback,partsSig:X(e.parts.map(J_))}}var Fs=new Set(["completed","failed","canceled"]);function W_(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status!=null&&!Fs.has(e.status)?"streaming":"complete"}function G_(e){let t=new Set,n=e.parts.map((o,i)=>o.type==="text"?{kind:"text",id:`${e.id}-t${i}`,textSig:X(o.text),doneSig:X(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${i}`,textSig:X(o.text),doneSig:X(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${i}`}:o.type==="file"?{kind:"file",url:o.url,mediaType:o.mediaType}:o.type==="source-url"?{kind:"source",sourceId:o.sourceId,url:o.url,title:o.title}:o.type==="source-document"?{kind:"source",sourceId:o.sourceId,title:o.title,filename:o.filename,mediaType:o.mediaType}:o.type==="data-suggestions"?null:o.type==="dynamic-tool"||o.type.startsWith("tool-")?{kind:"tool",toolCallId:o.toolCallId,toolName:o.type==="dynamic-tool"?o.toolName:As(o.type),dynamic:o.type==="dynamic-tool"?!0:void 0,inputPartialSig:X(""),inputSig:X(o.input),outputSig:X(o.output),errorSig:X(o.errorText),stateSig:X(o.state),approvalSig:X(o.approval)}:null).filter(o=>o!==null).filter(o=>o.kind!=="source"?!0:t.has(o.sourceId)?!1:(t.add(o.sourceId),!0)),r=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:r?.type==="data-suggestions"?kr(r.data):void 0,serverMessageId:e.id,createdAt:Sr(e.createdAt)??Date.now(),status:W_(e),canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:X(n)}}function K_(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type==="dynamic-tool"||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function j_(e){return e.role==="assistant"&&e.status!=null&&!Fs.has(e.status)&&K_(e)}function xt(e){let t=e.length-1;return e.filter((n,r)=>r===t||!j_(n)).map(G_)}function Bs(e,t){let n=!t&&e.at(-1)?.role==="assistant"?-2:-1,r=e.at(n);return!r||r.ephemeral?[]:[r]}function ta(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,parts:e.partsSig.value.map(Q_)}}function Ae(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function St(e){return Ae(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function X_(e){return Ae(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function Hs(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}var Rr=e=>e.kind==="tool",Us=e=>e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file"||e.kind==="source";function En(e){let t=e.partsSig.value,n=t.findLastIndex(r=>r.kind==="tool");return t.slice(n+1).some(Us)}function $t(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(Rr);return t.length>0&&t.every(n=>Hs(n.stateSig.value))}function Ft(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!En(e)}function Tr(e,t){return!e.partsSig.value.slice(t+1).some(n=>n.kind==="step-start"||Us(n))}function Ir(e){return e.partsSig.value.some(t=>Rr(t)&&!Hs(t.stateSig.value))}function na(e){return e!==void 0&&e.role!=="user"&&!e.ephemeral&&(e.status==="streaming"||e.continuationStreaming===!0)}function Nt(e,t){return t.id=e.id,e.canceled&&(t.canceled=!0),e.feedback!==void 0&&(t.feedback=e.feedback),t.suggestions??(t.suggestions=e.suggestions),t}function zs(e,t,n,r){if(!ra(e))return;if(t.length===0){let s=Math.max(...r.values());return n.find(l=>l.role==="assistant"&&r.get(l.serverMessageId??l.id)===s&&Ae(l).length>=Ae(e).length)}let o=t.at(-1);if(o?.role!=="user")return;let i=r.get(o.serverMessageId??o.id);if(i!==void 0)return n.find(s=>s.role==="assistant"&&r.get(s.serverMessageId??s.id)===i+1&&Ae(s).length>=Ae(e).length)}function ra(e){return e?.role==="assistant"&&e.status==="streaming"&&e.serverMessageId===void 0}function qs(e,t){let n=t.filter(_=>!_.ephemeral&&(_.status==="streaming"||_.status==="pending"||_.status==="error"||_.retryAction!==void 0||(_.attachments?.length??0)>0||St(_))),r=new Map;for(let _ of n)r.set(_.id,_),_.serverMessageId!==void 0&&r.set(_.serverMessageId,_);let o=new Set,i=[],s=e.map(_=>{let d=(_.serverMessageId!==void 0?r.get(_.serverMessageId):void 0)??r.get(_.id);return d===void 0?(i.push(_),_):(o.add(d),d.role!==_.role?_:d.role==="user"&&d.serverMessageId===void 0&&(d.status==="pending"||d.status==="error")?Nt(d,_):d.status==="streaming"||Ae(d).length>=Ae(_).length?(d.suggestions??(d.suggestions=_.suggestions),d.feedback===void 0&&(d.feedback=_.feedback),_.canceled&&(d.canceled=!0),d):Nt(d,_))}),l=n.filter(_=>!o.has(_)),c=l.findLast(ra),u=new Map;e.forEach((_,d)=>{u.set(_.id,d),_.serverMessageId!==void 0&&u.set(_.serverMessageId,d)});let p=zs(c,c?n.slice(0,n.indexOf(c)):[],i,u);if(c&&p){let _=s.indexOf(p);_>=0&&(s[_]=Nt(c,p)),l=l.filter(d=>d!==c)}return[...s,...l]}function An(e,t){let n=new Map(t.filter(_=>_.serverMessageId!==void 0).map(_=>[_.serverMessageId,_])),r=new Map;t.forEach((_,d)=>{r.set(_.id,d),_.serverMessageId!==void 0&&r.set(_.serverMessageId,d)});let o=new Set(e.flatMap(_=>[_.serverMessageId,_.id].filter(d=>d!==void 0))),i=!1,s=e.map(_=>{let d=n.get(_.serverMessageId??_.id);if(d===void 0||d.role!==_.role)return _;if(_.role==="user"&&_.serverMessageId===void 0)return i=!0,Nt(_,d);if(_.serverMessageId===void 0)return _;let f=Ae(d),m=Ae(_),P=d.status!=="streaming"&&f.length>=m.length&&Zo(_,d);if(f.length>m.length||f===m&&d.partsSig.value.length>_.partsSig.value.length||P)return i=!0,Nt(_,d);if(_.status==="streaming"&&d.status!=="streaming"&&Y_(_,d)){if(_.continuationStreaming&&Ir(d))return _;if(!Zo(d,_))return i=!0,Nt(_,d)}return _}),l=[...n.values()].filter(_=>!o.has(_.serverMessageId)),c=s.findLastIndex(ra),u=s[c],p=zs(u,s.slice(0,c),l,r);if(u!==void 0&&p!==void 0&&Ae(p).length>=Ae(u).length&&(Nt(u,p),s[c]=p,l.splice(l.indexOf(p),1),i=!0),l.length===0)return{messages:i?s:e,changed:i};for(let _ of l){let d=r.get(_.serverMessageId??_.id),f=!1,m=s.findIndex(P=>{let v=r.get(P.serverMessageId??P.id);return d===void 0?!1:v===void 0?f:v>d?!0:(f=!0,!1)});m===-1?s.push(_):s.splice(m,0,_)}return{messages:s,changed:!0}}function Vs(e,t){if(e.role!==t.role)return!1;let n=Ae(t),r=Ae(e);return n.length>r.length||t.partsSig.value.length>e.partsSig.value.length||Zo(e,t)}function Y_(e,t){let n=e.partsSig.value,r=t.partsSig.value;return n.length!==r.length?!1:n.every((o,i)=>{let s=r[i];switch(o.kind){case"text":return s?.kind==="text"&&s.textSig.value===o.textSig.value;case"reasoning":return s?.kind==="reasoning"&&s.textSig.value===o.textSig.value;case"step-start":return s?.kind==="step-start";case"tool":return s?.kind==="tool"&&s.toolCallId===o.toolCallId&&Er(s.toolName,o.toolName);case"file":return s?.kind==="file"&&s.url===o.url&&s.mediaType===o.mediaType;case"source":return s?.kind==="source"&&s.sourceId===o.sourceId&&s.url===o.url&&s.title===o.title&&s.filename===o.filename&&s.mediaType===o.mediaType;default:return o}})}function Er(e,t){let n=e.startsWith("tool:")?e.slice(5):e,r=t.startsWith("tool:")?t.slice(5):t;return n===r}var Ds={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function Zo(e,t){let n=new Map(e.partsSig.value.filter(Rr).map(r=>[r.toolCallId,r]));return t.partsSig.value.filter(Rr).some(r=>{let o=n.get(r.toolCallId);if(!o||Ds[r.stateSig.value]>Ds[o.stateSig.value])return!0;let i=r.approvalSig.value?.approved;return i!==void 0&&i!==o.approvalSig.value?.approved})}function Dt(e){return e.role==="assistant"&&e.status!=="streaming"&&!St(e)}function Ar(e,t){if(!e.includes(t)||t.retryAction===null)return;if(t.retryAction)return t.retryAction;if(t!==e.at(-1)||t.role!=="assistant"||t.serverMessageId===void 0||t.status!=="error"&&!Dt(t))return;let n=e.indexOf(t);for(let r=n-1;r>=0;r--){let o=e[r];if(o?.role==="user"&&!o.ephemeral)return{kind:"repeat-user",messageId:o.id}}}function Ws(e){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!X_(e)}function Gs(e,t){return e.operatorRoutedTurn?Dt(e)?"drop":"complete-operator-routed":t||Dt(e)?"error":"complete"}function J_(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:X(e.text),doneSig:X(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,dynamic:e.dynamic,inputPartialSig:X(e.inputPartial),inputSig:X(e.input),outputSig:X(e.output),errorSig:X(e.error),stateSig:X(e.state),approvalSig:X(e.approval)}:e}function Q_(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,dynamic:e.dynamic,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var Ks=Z.scope("feedback:audio"),Mr=class{constructor(){ee(this,"ctx",null);ee(this,"master",null);ee(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){Ks.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let o=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((s,l)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=s;let u=n.createGain(),p=o+l*i;u.gain.setValueAtTime(1e-4,p),u.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),u.gain.exponentialRampToValueAtTime(1e-4,p+i),c.connect(u).connect(r),c.start(p),c.stop(p+i+.01)})}async playUrl(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let o=await this.getBuffer(t);if(!o)return;let i=n.createBufferSource();i.buffer=o,i.connect(r),i.start()}destroy(){this.ctx&&this.ctx.close().catch(()=>{}),this.ctx=null,this.master=null,this.buffers.clear()}async getBuffer(t){if(!this.ctx)return null;let n=this.buffers.get(t);if(n)return n instanceof Promise,n;let r=this.ctx,o=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>r.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(Ks.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,o),o}};var js={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},Xs={messageReceived:{notes:[880,1318.51],noteMs:90,type:"sine",peakGain:.45},messageSent:{notes:[1568],noteMs:60,type:"sine",peakGain:.25},error:{notes:[523.25,392],noteMs:120,type:"triangle",peakGain:.55},voiceStart:{notes:[1318.51],noteMs:50,type:"sine",peakGain:.3},voiceStop:{notes:[880],noteMs:50,type:"sine",peakGain:.3}};var kt=null,Lr=0;function Z_(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function ep(){if(typeof document>"u")return null;let e=document.createElement("input");e.type="checkbox",e.setAttribute("switch",""),e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.id=`__${w.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function Ys(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(Z_())try{navigator.vibrate(e);return}catch{}if(kt||(kt=ep()),!!kt)try{kt.label.click()}catch{}}}function Js(){Lr++;let e=!1;return()=>{e||(e=!0,Lr=Math.max(0,Lr-1),Lr===0&&kt&&(kt.input.remove(),kt.label.remove(),kt=null))}}var tp=Z.scope("feedback"),np=100,Or=class{constructor(t,n){ee(this,"mutedSig",X(!1));ee(this,"audio",new Mr);ee(this,"releaseHaptics");ee(this,"sound");ee(this,"haptics");ee(this,"lastPlayed",new Map);ee(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=Js(),this.audio.setVolume(this.effectiveVolume()),typeof matchMedia<"u"&&(this.reducedMotionMq=matchMedia("(prefers-reduced-motion: reduce)"))}unlock(){this.audio.unlock(),this.audio.setVolume(this.effectiveVolume())}update(t,n){this.sound=t,this.haptics=n,this.audio.setVolume(this.effectiveVolume())}setMuted(t){this.mutedSig.value!==t&&(this.mutedSig.value=t)}toggleMuted(){this.mutedSig.value=!this.mutedSig.value}play(t){this.mutedSig.value||this.isDeduped(t)||(this.lastPlayed.set(t,performance.now()),this.sound.enabled&&this.playSound(t),this.haptics.enabled&&this.isTouchDevice()&&this.playHaptic(t))}destroy(){this.audio.destroy(),this.releaseHaptics()}isDeduped(t){let n=this.lastPlayed.get(t);return n===void 0?!1:performance.now()-n<np}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(o=>tp.warn("audio play failed",{err:o,url:n}));return}let r=Xs[t];r&&this.audio.playTone(r)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let r=n===!0||n===void 0?js[t]:n;Ys(r)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};var rp=0;function a(e,t,n,r,o,i){t||(t={});var s,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var u={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--rp,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)c[l]===void 0&&(c[l]=s[l]);return j.vnode&&j.vnode(u),u}var G={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Mn=`${w.cssPrefix}-icon-dir`,oa=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),it=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M18 6 6 18M6 6l12 12"})}),Qs=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M12 5v14M5 12h14"})}),Zs=()=>a("svg",{...G,class:Mn,"aria-hidden":"true",children:[a("path",{d:"m22 2-7 20-4-9-9-4Z"}),a("path",{d:"M22 2 11 13"})]}),el=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M12 19V5M5 12l7-7 7 7"})}),tl=()=>a("svg",{...G,class:Mn,"aria-hidden":"true",children:a("path",{d:"M3 20V4l18 8-18 8Z"})}),ln=()=>a("svg",{...G,class:Mn,"aria-hidden":"true",children:a("path",{d:"m9 18 6-6-6-6"})}),nl=()=>a("svg",{...G,"aria-hidden":"true",children:a("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),rl=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),ol=()=>a("svg",{...G,"aria-hidden":"true",children:[a("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),a("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),al=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),il=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),sl=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),ll=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),cl=()=>a("svg",{...G,"aria-hidden":"true",viewBox:"0 0 10 10",children:a("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),dl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),ul=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),_l=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),pl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),a("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),fl=()=>a("svg",{...G,class:Mn,"aria-hidden":"true",children:a("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),Bt=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M20 6 9 17l-5-5"})}),ml=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M3 3v6h6"}),a("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),a("path",{d:"M12 7v5l3 2"})]}),gl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M2 12h20"}),a("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),Ln=()=>a("svg",{...G,class:Mn,"aria-hidden":"true",children:a("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),vl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M12 20h9"}),a("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),Ht=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"m6 9 6 6 6-6"})}),hl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),a("path",{d:"M14 2v6h6"})]}),op=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),a("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),aa=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),On=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),a("path",{d:"M12 17h.01"})]}),ap=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"m15 4 3 3-9 9-3-3z"}),a("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),ip=()=>a("svg",{...G,"aria-hidden":"true",children:[a("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),a("path",{d:"M12 8V4"}),a("circle",{cx:"12",cy:"3",r:"1"}),a("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),ia=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),a("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),a("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),a("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),sp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("circle",{cx:"12",cy:"12",r:"4"}),a("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),sa=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"11",cy:"11",r:"7"}),a("path",{d:"m21 21-4.3-4.3"})]}),bl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),yl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M3 9.5 12 3l9 6.5"}),a("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),Pl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"m3 11 15-5v12L3 13z"}),a("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),a("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),a("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Nn=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),a("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),xl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"4"}),a("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),Sl=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),kl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 3v18"}),a("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),lp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),a("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),a("path",{d:"m20 20-4.4-4.4"})]}),cp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),a("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),dp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M4 18h16"}),a("path",{d:"M5 18a7 7 0 0 1 14 0"}),a("path",{d:"M12 8V6"}),a("path",{d:"M10 6h4"})]}),up=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),a("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),wl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),a("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]}),Cl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),a("path",{d:"M7 10l4-7a2.5 2.5 0 0 1 2.5 2.5V8h5a2 2 0 0 1 2 2.3l-1.2 8A2 2 0 0 1 17.3 20H7"})]}),Rl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),a("path",{d:"M17 14l-4 7a2.5 2.5 0 0 1-2.5-2.5V16h-5a2 2 0 0 1-2-2.3l1.2-8A2 2 0 0 1 6.7 4H17"})]}),Tl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"3.5"}),a("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M19.1 4.9l-2.1 2.1M7 17l-2.1 2.1"})]}),Il=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 7v5l3 2"})]}),Nr=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Dr=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m15 9-6 6M9 9l6 6"})]}),El={chat:oa,message:aa,bubbles:Nn,spark:op,wand:ap,bot:ip,help:On,lifebuoy:sp,headset:ia,search:lp,sparkles:cp,concierge:dp,wave:up};var H=w.cssPrefix,R={launcher:`${H}-launcher`,callout:`${H}-callout`,calloutDismiss:`${H}-callout-dismiss`,panel:`${H}-panel`,panelHeader:`${H}-panel-header`,resizeGrip:`${H}-resize-grip`,scrollToBottom:`${H}-scroll-to-bottom`,actionHistory:`${H}-action-history`,actionClose:`${H}-action-close`,langSegment:`${H}-lang-segment`,composer:`${H}-composer`,composerInput:`${H}-composer-input`,composerSend:`${H}-composer-send`,composerStop:`${H}-composer-stop`,composerAttach:`${H}-composer-attach`,composerFileInput:`${H}-composer-file-input`,composerVoice:`${H}-composer-voice`,attachmentChip:`${H}-attachment-chip`,attachmentRemove:`${H}-attachment-remove`,suggestion:`${H}-suggestion`,messageBubble:`${H}-message`,messageRetry:`${H}-message-retry`,messageFeedback:`${H}-message-feedback`,feedbackUp:`${H}-feedback-up`,feedbackDown:`${H}-feedback-down`,messageCopy:`${H}-message-copy`,historyPane:`${H}-history-pane`,historyBack:`${H}-history-back`,historyItem:`${H}-history-item`,sidebar:`${H}-sidebar`,sidebarToggle:`${H}-sidebar-toggle`,sidebarNewConversation:`${H}-sidebar-new-conversation`,sidebarItem:`${H}-sidebar-item`,messengerHome:`${H}-messenger-home`,modulesEmpty:`${H}-modules-empty`,tab:`${H}-tab`,tabBadge:`${H}-tab-badge`,homeView:`${H}-home-view`,homeGreeting:`${H}-home-greeting`,homeBrand:`${H}-home-brand`,backHeader:`${H}-back-header`,contentView:`${H}-content-view`,contentScroll:`${H}-content-scroll`,homeSearch:`${H}-home-search`,helpSearch:`${H}-help-search`,homeRecent:`${H}-home-recent`,homeContentRow:`${H}-home-content-row`,helpArticle:`${H}-help-article`,newsItem:`${H}-news-item`,formGate:`${H}-form-gate`,formDone:`${H}-form-done`,formDoneToggle:`${H}-form-done-toggle`,formAnswers:`${H}-form-answers`,formFill:`${H}-form-fill`,formSubmit:`${H}-form-submit`,formSkip:`${H}-form-skip`,formField:`${H}-form-field`,toolAskQuestions:`${H}-tool-ask-questions`,toolInputSubmit:`${H}-tool-input-submit`,toolInputSkip:`${H}-tool-input-skip`,toolApproval:`${H}-tool-approval`,toolApprove:`${H}-tool-approve`,toolReject:`${H}-tool-reject`,toolEdit:`${H}-tool-edit`,toolDecision:`${H}-tool-decision`,typingDots:`${H}-typing-dots`,reasoning:`${H}-reasoning`,toolAskSummary:`${H}-ask-questions-summary`,toolAskOptions:`${H}-ask-questions-options-toggle`,toolCall:`${H}-tool-call`,source:`${H}-source`,operatorRequest:`${H}-operator-request`,operatorBanner:`${H}-operator-banner`,cancelOperatorRequest:`${H}-cancel-operator-request`};function Le(e,t){return`${e}-${t}`}var $r=w.cssPrefix;function Al({onToggle:e,launcher:t,strings:n,leaving:r,edgeTab:o}){let i=t.variant!=="circle"&&!!t.label;return a("button",{type:"button",class:`${$r}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":o?"true":void 0,"data-leaving":r?"true":void 0,"data-testid":R.launcher,onClick:e,"aria-label":n.launcherOpen,children:[_p(t.icon),i?a("span",{class:`${$r}-fab-label`,children:ze(n,t.label??"")}):null]})}function _p(e){let t=El[e];return t?a(t,{}):a(pp,{source:e})}function pp({source:e}){return a("span",{ref:t=>{t&&fp(t,e)},"aria-hidden":"true"})}function fp(e,t){if(e.dataset.svgMounted!==t)try{let r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;r&&r.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(r,!0)),e.dataset.svgMounted=t)}catch{}}function Ml({callout:e,launcherPosition:t,strings:n,closeLabel:r,onDismiss:o}){let[i,s]=$(!1);return M(()=>{let l=setTimeout(()=>s(!0),e.delayMs);return()=>clearTimeout(l)},[e.delayMs]),M(()=>{if(!i||e.autoDismissMs<=0)return;let l=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(l)},[i,e.autoDismissMs,o]),i?a("div",{class:`${$r}-callout`,role:"status","data-shape":e.shape,"data-position":mp(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":R.callout,children:[a("span",{children:ze(n,e.text)}),a("button",{type:"button",class:`${$r}-callout-close`,onClick:o,"aria-label":r,title:r,"data-testid":R.calloutDismiss,children:a(it,{})})]}):null}function mp(e,t){let n=t.endsWith("-right"),r=t.startsWith("bottom-");return e==="vertical"?r?"top":"bottom":n?"left":"right"}function Fr({panelEl:e,resize:t,position:n,initialSize:r,onSizeChange:o,strings:i}){let s=w.cssPrefix,l=B(null);if(M(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${s}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${s}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${s}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${s}-resize-max-h`,t.maxHeight),r&&(m.setProperty(`--${s}-widget-w`,`${r.width}px`),m.setProperty(`--${s}-widget-h`,`${r.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,s,r]),!e)return null;let c=n.startsWith("top-"),u=n.endsWith("-right"),p=`${s}-resize-grip ${s}-resize-grip--${c?"bottom":"top"}-${u?"left":"right"}`,_=m=>{if(!e)return;let P=m.currentTarget,v=e.getBoundingClientRect();l.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:v.width,startH:v.height,dirX:u?-1:1,dirY:c?1:-1},P.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},d=m=>{let P=l.current;if(!P||m.pointerId!==P.pointerId||!e)return;let v=(m.clientX-P.startX)*P.dirX,g=(m.clientY-P.startY)*P.dirY;e.style.setProperty(`--${s}-widget-w`,`${P.startW+v}px`),e.style.setProperty(`--${s}-widget-h`,`${P.startH+g}px`)},f=m=>{let P=l.current;if(!P||m.pointerId!==P.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let v=e.getBoundingClientRect();o({width:Math.round(v.width),height:Math.round(v.height)}),l.current=null};return a("div",{class:p,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:_,onPointerMove:d,onPointerUp:f,onPointerCancel:f,"data-testid":R.resizeGrip,children:a(cl,{})})}var Ut=w.cssPrefix,gp=`.${Ut}-header, .${Ut}-back-header, .${Ut}-home-hero`,vp='button, a, input, textarea, select, [role="tab"], [contenteditable]',Ll=56;function Br(e,t){M(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,r=(c,u)=>Math.min(u,Math.max(-u,c)),o=null,i=c=>{let u=c.target;if(!(u instanceof Element)||!u.closest(gp)||u.closest(vp))return;let p=e.getBoundingClientRect();o={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Ut}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Ut}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-Ll,maxY:(window.innerHeight+p.height)/2-Ll},e.dataset.dragging="true",c.preventDefault()},s=c=>{if(!o||c.pointerId!==o.id)return;let u=r(o.dx+c.clientX-o.x,o.maxX),p=r(o.dy+c.clientY-o.y,o.maxY);e.style.setProperty(`--${Ut}-modal-dx`,`${u}px`),e.style.setProperty(`--${Ut}-modal-dy`,`${p}px`)},l=c=>{!o||c.pointerId!==o.id||(o=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",s),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)}},[e,t])}function Dn(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function Hr(e,t,n){return Dn("close",e,t)?n.includes("close"):!1}function Ol(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var hp='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Ur(e){let t=n=>{if(n.key!=="Tab")return;let r=[...e.querySelectorAll(hp)].filter(l=>l.offsetParent!==null||l===document.activeElement);if(r.length===0){n.preventDefault();return}let o=r[0],i=r[r.length-1];if(!o||!i)return;let s=e.getRootNode().activeElement;n.shiftKey&&s===o?(n.preventDefault(),i.focus()):!n.shiftKey&&s===i&&(n.preventDefault(),o.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function zr(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var la=w.cssPrefix;function Nl({agent:e,strings:t}){let n=e.status??"online",r=ze(t,e.name),o=e.title?ze(t,e.title):null;return a("div",{class:`${la}-agent`,children:[a("div",{class:`${la}-agent-avatar`,"data-status":n,children:e.avatar?a("img",{src:e.avatar,alt:""}):a("span",{children:zr(r)})}),a("div",{class:`${la}-agent-meta`,children:[a("strong",{children:r}),o?a("span",{children:o}):null]})]})}var Dl=Z.scope("attachments");function qr(e,t,n){let r=yp(e),o=[],i=[],s=Sp(n.accept),l=t.reduce((u,p)=>u+p.size,0),c=t.length;for(let u of r){let p=bp(u,c,l,n,s);if(p){i.push({file:u,reason:p});continue}o.push(xp(u)),l+=u.size,c+=1}return(o.length||i.length)&&Dl.debug("ingest",{accepted:o.length,rejected:i.map(u=>({name:u.file.name,reason:u.reason}))}),{accepted:o,rejected:i}}function Vr(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Dl.debug("revokeObjectURL failed",{error:t})}}function bp(e,t,n,r,o){return t>=r.maxCount?"count":n+e.size>r.maxBytes?"bytes":kp(e,o)?null:"mime"}function yp(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Pp(t)).filter(t=>t!==null):[]}function Pp(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function xp(e){return{file:e,id:et(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Sp(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",r="*"]=t.split("/");return{kind:"mime",type:n,subtype:r}})}function kp(e,t){if(t.length===0)return!0;let[n="*",r="*"]=(e.type||"").toLowerCase().split("/"),o=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?o.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===r))}var $n=w.cssPrefix;function $l({attachment:e,onRemove:t,disabled:n=!1}){let r=e.mediaType.startsWith("image/");return a("span",{class:`${$n}-attachment-chip`,title:e.name,"data-testid":Le(R.attachmentChip,e.id),children:[r?a("img",{class:`${$n}-attachment-thumb`,src:e.previewUrl,alt:""}):a("span",{class:`${$n}-attachment-thumb`,"aria-hidden":"true",children:a(hl,{})}),a("span",{class:`${$n}-attachment-name`,children:e.name}),a("button",{type:"button",class:`${$n}-attachment-remove`,onClick:t,disabled:n,"aria-label":`Remove ${e.name}`,"data-testid":Le(R.attachmentRemove,e.id),children:a(it,{})})]})}var ca={isSupported:!1,start:()=>{},stop:()=>{},cancel:()=>{}};function da(e,t,n){return e==="disabled"?ca:e==="server"?Tp(n):wp(t)}function wp(e){let t=Cp();if(!t)return ca;let n=null,r=0;return{isSupported:!0,start(o,i){let s=n,l=++r;n=null,s?.abort();let c=new t;n=c,c.continuous=!0,c.interimResults=!0,c.lang=e;let u=!1;c.addEventListener("result",_=>{if(r!==l||n!==c)return;let d=_,f="",m=!1;for(let P=d.resultIndex;P<d.results.length;P++){let v=d.results[P];v&&(f+=v[0].transcript,v.isFinal&&(m=!0))}o(f,m)});let p=()=>{u||r!==l||n!==c||(u=!0,n=null,i())};c.addEventListener("end",p),c.addEventListener("error",p);try{c.start()}catch{p()}},stop(){n?.stop()},cancel(){r++;let o=n;n=null,o?.abort()}}}function Cp(){return window.SpeechRecognition??window.webkitSpeechRecognition}var Rp=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Tp(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ca;let t=0,n=null,r=s=>{for(let l of s.stream?.getTracks()??[])l.stop();s.stream=null},o=()=>{t++;let s=n;n=null,s&&(r(s),s.recorder?.state!=="inactive"&&s.recorder?.stop())},i=async s=>{if(s.finishing)return;s.finishing=!0;let l=s.recorder?.mimeType??"audio/webm";r(s);let c=new Blob(s.chunks,{type:l});s.chunks=[];try{let{text:u}=await e(c,l);n===s&&t===s.generation&&u&&s.onText(u,!0)}catch{}finally{n===s&&t===s.generation&&(n=null,s.onEnd())}};return{isSupported:!0,async start(s,l){o();let c={generation:t,recorder:null,stream:null,chunks:[],onText:s,onEnd:l,finishing:!1};n=c;try{let u=await navigator.mediaDevices.getUserMedia({audio:!0});if(n!==c||t!==c.generation){for(let d of u.getTracks())d.stop();return}c.stream=u;let p=Ip(),_=new MediaRecorder(u,p?{mimeType:p}:void 0);c.recorder=_,_.addEventListener("dataavailable",d=>{n===c&&t===c.generation&&d.data.size>0&&c.chunks.push(d.data)}),_.addEventListener("stop",()=>{n===c&&t===c.generation&&i(c)}),_.start()}catch{r(c),n===c&&t===c.generation&&(n=null,l())}},stop(){let s=n;if(s){if(!s.recorder){o();return}s.recorder.state!=="inactive"&&s.recorder.stop()}},cancel(){o()}}}function Ip(){for(let e of Rp)if(MediaRecorder.isTypeSupported(e))return e}var Ye=w.cssPrefix,cn=Z.scope("composer");function dn(e){return e.reduce((t,n)=>t+n.size,0)}var Ep={arrowUp:el,paperPlane:Zs,send:tl,chevron:ln};function Fl({options:e,transport:t,feedback:n,bus:r,isStreaming:o,active:i=!0,isPreparing:s=!1,operatorRequestEnabled:l,controlMode:c,onRequestOperator:u,onSend:p,onStop:_,attachApiRef:d}){let f=e.strings,[m,P]=$(""),[v,g]=$([]),[k,h]=$(!1),[x,C]=$(!1),I=B(!1),z=B(null),K=B(null),W=B(null),L=B(0),F=B(i);F.current=i;let V=B(s);V.current=s;let A=x||s||!i,ae=e.features.fileUpload,ce=e.features.voice,[ie,we]=$(()=>da(ce,e.locale,(b,E)=>t.transcribe(b,E))),xe=B(ie);xe.current=ie;let De=B({mode:ce,locale:e.locale,transport:t});M(()=>{let b=De.current;b.mode===ce&&b.locale===e.locale&&b.transport===t||(De.current={mode:ce,locale:e.locale,transport:t},L.current++,xe.current.cancel(),W.current=null,h(!1),we(da(ce,e.locale,(E,O)=>t.transcribe(E,O))))},[e.locale,ce,t]),M(()=>()=>{L.current++,ie.cancel()},[ie]);let He=N(b=>{let E=W.current;if(E===null)return!1;let O=Date.now()-E;return cn[b]("voiceStop",{durationMs:O}),r.emit("voiceStop",{durationMs:O}),W.current=null,!0},[r]),Ee=N(()=>{W.current!==null&&(ie.stop(),h(!1),He("info")&&n.play("voiceStop"))},[He,n,ie]),Ue=N(()=>{L.current++,ie.cancel(),h(!1),He("info")&&n.play("voiceStop")},[He,n,ie]);M(()=>{(s||!i)&&Ue()},[i,Ue,s]),M(()=>{let b=z.current;if(!b)return;let E=b.getRootNode(),O="activeElement"in E?E.activeElement:null;O&&b.closest(`.${Ye}-panel`)?.contains(O)||b.focus({preventScroll:!0})},[]),M(()=>{let b=z.current;if(!b)return;if(m.length===0){b.style.height="";return}b.style.height="auto";let E=parseFloat(getComputedStyle(b).fontSize)*.7,O=Math.min(b.scrollHeight,160);b.style.height=`${O<40+E?40:O}px`},[m]);let Ce=B(v);Ce.current=v,M(()=>()=>Ce.current.forEach(Vr),[]),M(()=>{if(d)return d.current={attachFromDrop:b=>{if(!ae||!F.current||I.current||V.current)return;let E=qr(b,Ce.current,e.attachments);E.accepted.length!==0&&(cn.info("attach (drop)",{count:E.accepted.length,totalBytes:dn(E.accepted)}),r.emit("attach",{count:E.accepted.length,totalBytes:dn(E.accepted)}),g(O=>[...O,...E.accepted]))},fill:b=>{if(!F.current||I.current||V.current)return;P(b);let E=z.current;E&&(E.focus({preventScroll:!0}),requestAnimationFrame(()=>E.setSelectionRange(E.value.length,E.value.length)))}},()=>{d.current&&(d.current=null)}},[d,ae,s,e.attachments]),M(()=>{let b=z.current;if(!b)return;let E=b.closest(`.${Ye}-panel`);if(!E)return;let O=Y=>{if(!F.current||I.current||V.current)return;let ne=Y.clipboardData;if(!ne)return;let fe=Y.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(fe&&fe!==b)return;if(ae){let Re=qr(ne.items,Ce.current,e.attachments);if(Re.accepted.length>0){Y.preventDefault(),cn.info("attach (paste)",{count:Re.accepted.length,totalBytes:dn(Re.accepted)}),r.emit("attach",{count:Re.accepted.length,totalBytes:dn(Re.accepted)}),g(tt=>[...tt,...Re.accepted]);return}}if(fe===b)return;let be=ne.getData("text/plain");be&&(Y.preventDefault(),P(Re=>Re+be),b.focus())};return E.addEventListener("paste",O),()=>E.removeEventListener("paste",O)},[ae,e.attachments,Ye]);let ge=async()=>{let b=m.trim();if(!b&&v.length===0||!i||o||I.current||s)return;Ue(),I.current=!0,C(!0);let E=m,O=v;try{await p(b,O)&&(P(Y=>Y===E?"":Y),g(Y=>Y!==O?Y:(O.forEach(Vr),Ce.current=[],[])))}finally{I.current=!1,C(!1)}},qe=b=>{b.key!=="Enter"||b.shiftKey||b.isComposing||(b.preventDefault(),o?_():ge())},Qe=b=>{let E=b.target;if(!i||I.current||s){E.value="";return}let O=qr(E.files,v,e.attachments);O.accepted.length>0&&(cn.info("attach (file picker)",{count:O.accepted.length,totalBytes:dn(O.accepted)}),r.emit("attach",{count:O.accepted.length,totalBytes:dn(O.accepted)}),g(Y=>[...Y,...O.accepted])),E.value=""},S=b=>{!i||I.current||s||(cn.info("removeAttachment",{id:b}),r.emit("removeAttachment",{id:b}),g(E=>{let O=E.find(Y=>Y.id===b);return O&&Vr(O),E.filter(Y=>Y.id!==b)}))},q=()=>{if(k){Ee();return}if(!i||!ie.isSupported||I.current||s)return;let b=++L.current;W.current=Date.now(),cn.info("voiceStart"),r.emit("voiceStart",void 0),h(!0),n.play("voiceStart"),ie.start((E,O)=>{L.current!==b||!F.current||V.current||I.current||!O||P(Y=>`${Y}${E} `)},()=>{L.current!==b||!F.current||(h(!1),He("debug"))})},oe=Ep[e.composer.sendButton.icon];return a("div",{class:`${Ye}-composer`,"data-testid":R.composer,children:[v.length>0?a("div",{class:`${Ye}-attachments`,children:v.map(b=>a($l,{attachment:b,onRemove:()=>S(b.id),disabled:A},b.id))}):null,a("div",{class:`${Ye}-composer-row`,children:[a("div",{class:`${Ye}-composer-actions`,children:[ae?a("button",{type:"button",class:`${Ye}-icon-btn`,onClick:()=>K.current?.click(),disabled:A,"aria-label":f.attach,"data-testid":R.composerAttach,children:a(rl,{})}):null,ie.isSupported?a("button",{type:"button",class:`${Ye}-icon-btn`,onClick:q,disabled:A,"aria-label":k?f.micStop:f.micStart,"aria-pressed":k,"data-recording":k?"true":void 0,"data-testid":R.composerVoice,children:a(ol,{})}):null,l&&c==="ai-agent"&&u?a("button",{type:"button",class:`${Ye}-icon-btn`,onClick:u,disabled:A,"aria-label":f.talkToOperator,title:f.talkToOperator,"data-testid":R.operatorRequest,children:a(ia,{})}):null]}),a("textarea",{ref:z,name:"message",class:`${Ye}-textarea`,rows:1,value:m,placeholder:f.composerPlaceholder,onInput:b=>P(b.target.value),onKeyDown:qe,disabled:A,"aria-label":f.composerPlaceholder,"data-testid":R.composerInput}),o?a("button",{type:"button",class:`${Ye}-send`,onClick:_,disabled:A,"aria-label":f.stop,"data-testid":R.composerStop,children:a(nl,{})}):a("button",{type:"button",class:`${Ye}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:()=>{ge()},disabled:A||!m.trim()&&v.length===0,"aria-label":f.send,"data-testid":R.composerSend,children:a(oe,{})})]}),a("input",{ref:K,name:"attachments",type:"file",multiple:!0,accept:e.attachments.accept,onChange:Qe,disabled:A,class:`${Ye}-sr-only`,"data-testid":R.composerFileInput})]})}var Ap=w.cssPrefix;function Bl({visible:e,strings:t}){return e?a("div",{class:`${Ap}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function Wr({containerRef:e,onDrop:t,disabled:n=!1}){let[r,o]=$(!1);return M(()=>{if(n){o(!1);return}let i=e.current;if(!i)return;let s=0,l=_=>{s+=1,_.dataTransfer?.types.includes("Files")&&(_.preventDefault(),o(!0))},c=()=>{s-=1,!(s>0)&&(s=0,o(!1))},u=_=>{_.dataTransfer?.types.includes("Files")&&_.preventDefault()},p=_=>{s=0,o(!1),_.dataTransfer&&(_.preventDefault(),t(_.dataTransfer.items))};return i.addEventListener("dragenter",l),i.addEventListener("dragleave",c),i.addEventListener("dragover",u),i.addEventListener("drop",p),()=>{i.removeEventListener("dragenter",l),i.removeEventListener("dragleave",c),i.removeEventListener("dragover",u),i.removeEventListener("drop",p)}},[e,n,t]),{visible:n?!1:r}}function Hl({itemCount:e,initialFocusIndex:t}){let[n,r]=$(!1),o=B(null),i=B(null),[s,l]=$(-1),c=N(()=>{r(!1),l(-1),o.current?.focus()},[]),u=N(()=>r(d=>!d),[]);M(()=>{if(!n)return;let d=f=>{let m=i.current,P=o.current;if(!m||!P)return;let v=f.composedPath();v.includes(m)||v.includes(P)||(r(!1),l(-1))};return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[n]),M(()=>{if(!n||e===0)return;let d=t?.()??0,f=d<0||d>=e?0:d;l(f)},[n,e,t]),M(()=>{if(!n||s<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[s]?.focus()},[n,s]);let p=N(d=>{(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r(!0))},[]),_=N(d=>{if(e!==0)switch(d.key){case"Escape":d.preventDefault(),c();return;case"ArrowDown":d.preventDefault(),l(f=>(f+1)%e);return;case"ArrowUp":d.preventDefault(),l(f=>(f-1+e)%e);return;case"Home":d.preventDefault(),l(0);return;case"End":d.preventDefault(),l(e-1)}},[e,c]);return{open:n,focusIndex:s,triggerRef:o,menuRef:i,toggle:u,close:c,onTriggerKey:p,onMenuKey:_}}function Ul({items:e,triggerLabel:t}){let n=w.cssPrefix,r=Hl({itemCount:e.length}),o=l=>{l.disabled||(l.onSelect?.(),l.keepOpen||r.close())},i=(l,c)=>l.onSelectValue?.(c),s=(l,c)=>{let u=c.segments;if(!u?.length)return;let p=Math.max(0,u.findIndex(d=>d.value===c.value)),_=-1;if(l.key==="ArrowRight"||l.key==="Enter"||l.key===" ")_=(p+1)%u.length;else if(l.key==="ArrowLeft")_=(p-1+u.length)%u.length;else return;l.preventDefault(),l.stopPropagation(),i(c,u[_].value)};return a("div",{class:`${n}-menu-wrap`,children:[a("button",{ref:r.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":r.open,title:t,onClick:r.toggle,onKeyDown:r.onTriggerKey,children:a(dl,{})}),r.open?a("div",{ref:r.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:r.onMenuKey,tabIndex:-1,children:e.map(l=>l.segments?a("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":l.label,tabIndex:-1,onKeyDown:c=>s(c,l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),a("span",{class:`${n}-segmented`,role:"group","aria-label":l.label,children:l.segments.map(c=>{let u=c.value===l.value;return a("button",{type:"button",role:"menuitemradio","aria-checked":u,class:`${n}-segment`,"data-on":u?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${R.langSegment}-${c.value}`,onClick:()=>i(l,c.value),children:c.label},c.value)})})]},l.id):a("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":l.type==="switch"?l.on:void 0,disabled:l.disabled,onClick:()=>o(l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),l.type==="switch"&&l.on?a("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:a(Bt,{})}):null]},l.id))}):null]})}var ua=w.cssPrefix;function Mp(e){let t=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)").matches:!0;return e==="auto"?t?"light":"dark":t?e==="light"?"dark":"auto":e==="dark"?"light":"auto"}var Lp={normal:"large",large:"small",small:"normal"};function Op(e){return e==="light"?a(xl,{}):e==="dark"?a(Sl,{}):a(kl,{})}function Np(e){return(e.split("-")[0]??e).toUpperCase()}function st({panelProps:e,variant:t}){let{options:n,panelSize:r,feedback:o,onClose:i,onClear:s,onExpand:l,onFullscreen:c,onSoundToggle:u}=e,{onToggleHistory:p,onLocaleChange:_,onThemeChange:d,onTextSizeChange:f}=e,m=n.strings,P=n.mode,v=t==="chat",g=gt(()=>o.mutedSig.value).value,k=new Set(n.actions),h=A=>k.has(A),x=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,C=A=>x?!1:Dn(A,P,r),I=n.themeMode,z={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},K=n.textSize,W={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},L=[];if(v&&h("clear")&&L.push({id:"clear",icon:a(vl,{}),label:m.newConversation,onSelect:s}),h("expand")&&C("expand")){let A=r==="expanded";L.push({id:"expand",icon:A?a(il,{}):a(al,{}),label:A?m.collapse:m.expand,type:"switch",on:A,onSelect:l})}if(h("fullscreen")&&C("fullscreen")){let A=r==="fullscreen";L.push({id:"fullscreen",icon:A?a(ll,{}):a(sl,{}),label:A?m.exitFullscreen:m.fullscreen,type:"switch",on:A,onSelect:c})}v&&h("sound")&&L.push({id:"sound",icon:g?a(_l,{}):a(ul,{}),label:g?m.soundOff:m.soundOn,type:"switch",on:!g,onSelect:u}),h("theme")&&L.push({id:"theme",icon:Op(I),label:`${m.theme}: ${z[I]}`,onSelect:()=>d(Mp(I)),keepOpen:!0}),h("textSize")&&L.push({id:"textSize",icon:a(pl,{}),label:`${m.textSize}: ${W[K]}`,onSelect:()=>f(Lp[K]),keepOpen:!0}),h("language")&&n.availableLocales.length>1&&L.push({id:"language",icon:a(gl,{}),label:m.language,segments:n.availableLocales.map(A=>({value:A,label:Np(A),lang:A})),value:n.locale,onSelectValue:_});let F=!!i&&Hr(P,r,n.actions),V=v&&h("history");return a("div",{class:`${ua}-header-actions`,children:[V?a("button",{type:"button",class:`${ua}-icon-btn`,onClick:p,"aria-label":m.history,title:m.history,"data-testid":R.actionHistory,children:a(ml,{})}):null,L.length>0?a(Ul,{items:L,triggerLabel:m.moreActions}):null,F?a("button",{type:"button",class:`${ua}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":R.actionClose,children:a(it,{})}):null]})}var Dp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,$p=/^https?:\/\/[^\s.]+\.[^\s]+$/i,Fp=/^[+]?[\d\s().-]{6,}$/;function un(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>String(t[r]??`{${r}}`))}function Bp(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function Hp(e,t,n){let r=e.required??!0,o=e.validation;if(e.type==="multiselect"){let s=Bp(t);return r&&s===0?n.formRequired:s===0?void 0:o?.minSelections!=null&&s<o.minSelections?un(n.formChooseAtLeast,{min:o.minSelections}):o?.maxSelections!=null&&s>o.maxSelections?un(n.formChooseAtMost,{max:o.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return r?n.formRequired:void 0;switch(e.type){case"email":if(!Dp.test(i))return n.formInvalidEmail;break;case"url":if(!$p.test(i))return n.formInvalidUrl;break;case"tel":if(!Fp.test(i))return n.formInvalidTel;break;case"number":{let s=Number(i);if(!Number.isFinite(s))return n.formInvalidNumber;if(o?.min!=null&&s<o.min)return un(n.formNumberTooSmall,{min:o.min});if(o?.max!=null&&s>o.max)return un(n.formNumberTooLarge,{max:o.max});break}default:break}if(o?.minLength!=null&&i.length<o.minLength)return un(n.formTooShort,{min:o.minLength});if(o?.maxLength!=null&&i.length>o.maxLength)return un(n.formTooLong,{max:o.maxLength});if(o?.pattern)try{if(!new RegExp(o.pattern).test(i))return n.formPatternMismatch}catch{}}function zl(e,t,n){let r={};for(let o of e){let i=Hp(o,t[o.name],n);i&&(r[o.name]=i)}return r}function ql(e){let t={};for(let[n,r]of Object.entries(e)){let o=Array.isArray(r)?r.join(", "):r;o&&o.trim()&&(t[n]=o.trim())}return t}var ve=w.cssPrefix,Gr="__other__";function Fn({fields:e,strings:t,submitLabel:n,onSubmit:r,skipLabel:o,onSkip:i,footerHint:s,submitOnEnter:l,disabled:c,initialValues:u,hideActions:p,fieldTypeLabels:_,rootTestId:d,submitTestId:f,skipTestId:m}){let[P,v]=$(()=>({...Vp(e),...u})),[g,k]=$({}),[h,x]=$({}),C=L=>{h[L]&&x(F=>({...F,[L]:""}))},I=(L,F)=>{v(V=>({...V,[L]:F})),C(L)},z=(L,F)=>{k(V=>({...V,[L]:F})),C(L)},K=L=>{if(L.preventDefault(),c)return;let F=Wp(e,P,g),V=zl(e,F,t);if(Object.keys(V).length>0){x(V);return}r(ql(F))},W=L=>{!l||L.key!=="Enter"||L.shiftKey||L.isComposing||L.target?.tagName==="TEXTAREA"&&K(L)};return a("form",{class:`${ve}-form`,onSubmit:K,onKeyDown:W,"data-testid":d,noValidate:!0,children:[e.map(L=>a(Up,{field:L,value:P[L.name],otherText:g[L.name]??"",error:h[L.name],disabled:c,typeLabel:_?.[L.name],strings:t,onChange:F=>I(L.name,F),onOtherChange:F=>z(L.name,F)},L.name)),p?null:a("div",{class:`${ve}-form-actions`,children:[s?a("span",{class:`${ve}-form-hint`,children:s}):null,o&&i?a("button",{type:"button",class:`${ve}-form-skip`,onClick:i,disabled:c,"data-testid":m,children:o}):null,a("button",{type:"submit",class:`${ve}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function Up({field:e,value:t,otherText:n,error:r,disabled:o,typeLabel:i,strings:s,onChange:l,onOtherChange:c}){let u=Le(R.formField,e.name),p=zp({field:e,value:t,otherText:n,disabled:o,strings:s,onChange:l,onOtherChange:c,fieldTid:u});return a("label",{class:`${ve}-field`,"data-field":e.name,"data-invalid":r?"true":void 0,children:[a("span",{class:`${ve}-field-head`,children:[a("span",{class:`${ve}-field-label`,children:[e.label,e.required??!0?a("span",{class:`${ve}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?a("span",{class:`${ve}-field-type`,children:i}):null]}),p,e.validationHint&&!r?a("span",{class:`${ve}-field-hint`,children:e.validationHint}):null,r?a("span",{class:`${ve}-field-error`,role:"alert",children:r}):null]})}function zp(e){let{field:t,value:n,otherText:r,disabled:o,strings:i,onChange:s,onOtherChange:l,fieldTid:c}=e,u=typeof n=="string"?n:"";switch(t.type){case"textarea":return a("textarea",{class:`${ve}-field-input`,rows:3,value:u,placeholder:t.placeholder,disabled:o,onInput:p=>s(p.target.value),"data-testid":c});case"select":return a("select",{class:`${ve}-field-input`,value:u,disabled:o,onChange:p=>s(p.target.value),"data-testid":c,children:[a("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(p=>a("option",{value:p.value,children:p.label??p.value},p.value))]});case"radio":{let p=t.allowOther&&u===Gr;return a("div",{class:`${ve}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(_=>a("label",{class:`${ve}-choice`,children:[a("input",{type:"radio",name:`${ve}-${t.name}`,checked:u===_.value,disabled:o,onChange:()=>s(_.value)}),a("span",{children:_.label??_.value})]},_.value)),t.allowOther?a("label",{class:`${ve}-choice`,children:[a("input",{type:"radio",name:`${ve}-${t.name}`,checked:u===Gr,disabled:o,onChange:()=>s(Gr)}),a("span",{children:i.formOther})]}):null,p?a("input",{class:`${ve}-field-input`,value:r,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:o,onInput:_=>l(_.target.value)}):null]})}case"checkbox":return a("label",{class:`${ve}-choice`,children:[a("input",{type:"checkbox",checked:u==="true",disabled:o,onChange:p=>s(p.target.checked?"true":""),"data-testid":c}),a("span",{children:t.placeholder??t.label})]});case"multiselect":{let p=Array.isArray(n)?n:[],_=(d,f)=>s(f?[...p,d]:p.filter(m=>m!==d));return a("div",{class:`${ve}-field-choices`,"data-testid":c,children:[(t.options??[]).map(d=>a("label",{class:`${ve}-choice`,children:[a("input",{type:"checkbox",checked:p.includes(d.value),disabled:o,onChange:f=>_(d.value,f.target.checked)}),a("span",{children:d.label??d.value})]},d.value)),t.allowOther||(t.options??[]).length===0?a("textarea",{class:`${ve}-field-input`,rows:2,value:r,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:o,onInput:d=>l(d.target.value)}):null]})}default:return a("input",{class:`${ve}-field-input`,type:qp(t.type),value:u,placeholder:t.placeholder,disabled:o,onInput:p=>s(p.target.value),"data-testid":c})}}function qp(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function Vp(e){let t={};for(let n of e)n.defaultValue!=null&&(t[n.name]=n.type==="multiselect"?n.defaultValue.split(",").map(r=>r.trim()).filter(Boolean):n.defaultValue);return t}function Wp(e,t,n){let r={...t};for(let o of e){let i=n[o.name]?.trim();if(o.type==="radio"&&o.allowOther&&t[o.name]===Gr)r[o.name]=i??"";else if(o.type==="multiselect"&&i){let s=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),l=Array.isArray(t[o.name])?t[o.name]:[];r[o.name]=[...l,...s]}}return r}var lt=w.cssPrefix;function _a({form:e,strings:t,onSubmit:n,onSkip:r}){return a("div",{class:`${lt}-form-gate`,"data-testid":R.formGate,children:[e.title?a("h3",{class:`${lt}-form-gate-title`,children:e.title}):null,e.description?a("p",{class:`${lt}-form-gate-desc`,children:e.description}):null,a(Fn,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?r:void 0,submitTestId:R.formSubmit,skipTestId:R.formSkip})]})}function Vl({marker:e,strings:t,onFill:n}){let r=e.outcome==="skipped",o=r?t.formSkipped:t.formSubmitted,i=e.title?a(le,{children:[a("span",{children:e.title}),a("span",{class:`${lt}-sr-only`,children:o})]}):a("span",{children:o}),s=e.form?.reviewable??!1,l=!r&&s&&e.values&&Object.keys(e.values).length>0?e.values:null;if(l){let c=u=>e.form?.fields.find(p=>p.name===u)?.label??u;return a("details",{class:`${lt}-form-done`,"data-outcome":e.outcome,"data-testid":R.formDone,children:[a("summary",{class:`${lt}-form-done-summary`,"data-testid":R.formDoneToggle,children:[a(Bt,{}),i,a(ln,{})]}),a("dl",{class:`${lt}-form-answers`,"data-testid":R.formAnswers,children:Object.entries(l).map(([u,p])=>a("div",{class:`${lt}-form-answer`,children:[a("dt",{children:c(u)}),a("dd",{children:p})]},u))})]})}return a("div",{class:`${lt}-form-done`,"data-outcome":e.outcome,"data-testid":R.formDone,role:"status",children:[r?a(fl,{}):a(Bt,{}),i,r&&e.form?.reopenable&&n?a("button",{type:"button",class:`${lt}-form-done-fill`,"data-testid":R.formFill,onClick:n,children:t.formFillOut}):null]})}function jp(e,t){for(var n in t)e[n]=t[n];return e}function fa(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Wl(e,t){this.props=e,this.context=t}function Zl(e,t){function n(o){var i=this.props.ref;return i!=o.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,o)||i!=o.ref:fa(this.props,o)}function r(o){return this.shouldComponentUpdate=n,ut(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.__f=r.prototype.isReactComponent=!0,r.type=e,r}(Wl.prototype=new Ve).isPureReactComponent=!0,Wl.prototype.shouldComponentUpdate=function(e,t){return fa(this.props,e)||fa(this.state,t)};var Gl=j.__b;j.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Gl&&Gl(e)};var $b=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Xp=j.__e;j.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k||[]),o.__c(e,t)}Xp(e,t,n,r)};var Kl=j.unmount;function ec(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=jp({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return ec(r,t,n)})),e}function tc(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return tc(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function pa(){this.__u=0,this.o=null,this.__b=null}function nc(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Kr(){this.i=null,this.l=null}j.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Kl&&Kl(e)},(pa.prototype=new Ve).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=nc(r.__v),i=!1,s=function(){i||r.__z||(i=!0,n.__R=null,o?o(c):c())};n.__R=s;var l=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=tc(u,u.__c.__P,u.__c.__O)}var p;for(r.setState({__a:r.__b=null});p=r.o.pop();)p.__P=l,p.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},pa.prototype.componentWillUnmount=function(){this.o=[]},pa.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=ec(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&ut(le,null,e.fallback);return o&&(o.__u&=-33),[ut(le,null,t.__a?null:e.children),o]};var jl=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Kr.prototype=new Ve).__a=function(e){var t=this,n=nc(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),jl(t,e,r)):o()};n?n(i):i()}},Kr.prototype.render=function(e){this.i=null,this.l=new Map;var t=xn(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Kr.prototype.componentDidUpdate=Kr.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){jl(e,n,t)})};var Yp=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Jp=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Qp=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Zp=/[A-Z0-9]/g,ef=typeof document<"u",tf=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Ve.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ve.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Xl=j.event;j.event=function(e){return Xl&&(e=Xl(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var rc,nf={configurable:!0,get:function(){return this.class}},Yl=j.vnode;j.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,r=t.type,o={},i=r.indexOf("-")==-1;for(var s in n){var l=n[s];if(!(s==="value"&&"defaultValue"in n&&l==null||ef&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||tf(n.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":Qp.test(s)&&(s=c):c=s="oninput":i&&Jp.test(s)?s=s.replace(Zp,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[s=c]&&(s="oninputCapture"),o[s]=l}}r=="select"&&(o.multiple&&Array.isArray(o.value)&&(o.value=xn(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),o.defaultValue!=null&&(o.value=xn(n.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",nf)):n.className&&(o.class=o.className=n.className),t.props=o})(e),e.$$typeof=Yp,Yl&&Yl(e)};var Jl=j.__r;j.__r=function(e){Jl&&Jl(e),rc=e.__c};var Ql=j.diffed;j.diffed=function(e){Ql&&Ql(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),rc=null};function jr(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var nt=w.cssPrefix;function ga(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function Xr(e,t){let n=e==="output-available"||e==="output-error"||e==="output-denied",r=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:r,decided:n||r}}function va({status:e,icon:t,label:n}){return a("span",{class:`${nt}-toolui-badge ${nt}-toolui-status`,"data-status":e,children:[a("span",{class:`${nt}-toolui-status-icon`,children:t}),n]})}function rf(e,t){return e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function ha(e,t,n={}){return n.submitted?"responded":sf(rf(e,t),n.superseded,n.live??!0)}function of({status:e}){return e==="denied"||e==="error"||e==="superseded"?a(Dr,{}):e==="completed"||e==="responded"?a(Nr,{}):a(Il,{})}function af(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;default:return t.statusRunning}}function sf(e,t,n){return t&&(e==="awaiting"||e==="running")?"superseded":!n&&e==="running"?"error":e}function lf({state:e,approval:t,strings:n,superseded:r,live:o=!0,submitted:i=!1}){let s=ha(e,t,{superseded:r,live:o,submitted:i});return a(va,{status:s,icon:a(of,{status:s}),label:af(s,n)})}function cf({name:e,state:t,approval:n,strings:r,superseded:o,live:i,submitted:s}){return a(le,{children:[a("span",{class:`${nt}-toolui-name-pill`,children:[a(Tl,{}),a("span",{class:`${nt}-toolui-name-text`,children:e})]}),a(lf,{state:t,approval:n,strings:r,superseded:o,live:i,submitted:s}),a("span",{class:`${nt}-toolui-chevron`,children:a(Ht,{})})]})}function Yr({part:e,strings:t,testid:n,superseded:r,live:o,submitted:i}){let s=Q(()=>de(()=>e.inputSig.value),[e]),l=Q(()=>de(()=>e.outputSig.value),[e]),c=Q(()=>de(()=>e.errorSig.value),[e]),u=Q(()=>de(()=>e.stateSig.value),[e]),p=Q(()=>de(()=>e.approvalSig.value),[e]);return a("details",{class:`${nt}-toolui ${nt}-toolui-collapsible`,"data-testid":n,children:[a("summary",{class:`${nt}-toolui-head`,children:a(cf,{name:ga(e.toolName),state:u.value,approval:p.value,strings:t,superseded:r,live:o,submitted:i})}),a(ma,{label:t.toolParameters,value:s.value}),l.value!==void 0?a(ma,{label:t.toolResult,value:l.value}):null,c.value?a(ma,{label:t.statusError,value:c.value,error:!0}):null]})}function ma({label:e,value:t,error:n}){let r=n?String(t??""):Jr(ba(t));return r?a("div",{class:`${nt}-toolui-section`,children:[a("span",{class:`${nt}-toolui-label`,children:e}),a("pre",{class:`${nt}-toolui-code`,"data-error":n?"true":void 0,children:r})]}):null}function ba(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Jr(e){if(e==null)return"";try{let t=typeof e=="string"?e:JSON.stringify(e,null,2);return!t||t==="{}"||t==="[]"||t==='""'?"":t.length>800?`${t.slice(0,800)}\u2026`:t}catch{return""}}function oc(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function ac(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function df(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function ic(e){let{streaming:t,reasoningVisible:n,emptyReply:r,hidden:o}=e,i=e.responseMode==="buffered"&&t,s=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:i,reasoningVisible:n,working:s,showStreamDots:df({streaming:t,bufferedHold:i,reasoningVisible:n,working:s}),emptyReply:r,hidden:o}}function sc(e,t){let n=e.stateSig.value,r=e.approvalSig.value,{terminal:o,responded:i,decided:s}=Xr(n,r),l=t.continuationStreaming===!0&&!s,c=t.superseded&&!s&&!l;return{pill:ha(n,r,{superseded:c,live:t.live,submitted:l}),state:n,terminal:o,decided:s||l,showApproveReject:!s&&!t.superseded&&!l,showAnswered:i&&!o&&!c,showSubmitted:l,showEdit:i&&t.active&&!o,skipped:c,answeredApproved:r?.approved}}var xa=1,cc=2,dc=4,uc=8,_c=16;function uf(e){switch(e){case xa:return"href";case cc:return"src";case dc:return"class";case uc:return"checked";case _c:return"start"}}var _f=e=>{switch(e){case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;case 5:return 7;default:return 8}},pf=_f;var lc=24;function ka(e){let t=new Uint32Array(lc);return t[0]=1,{renderer:e,text:"",pending:"",tokens:t,len:0,token:1,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(lc),indent:"",indent_len:0,table_state:0}}function pc(e){e.pending.length>0&&Fe(e,`
|
|
12
|
-
`)}function
|
|
13
|
-
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){
|
|
14
|
-
`:if(e.hr_chars<3)break;
|
|
15
|
-
`:{
|
|
16
|
-
`:e.table_state=2,e.pending="";continue;default:
|
|
17
|
-
`:
|
|
18
|
-
`:
|
|
9
|
+
`))!==-1;){let l=o.slice(0,s);o=o.slice(s+2),yield l}}}finally{n.releaseLock()}}function $_(e){let t="",n;for(let o of e.split(`
|
|
10
|
+
`))if(!(o===""||o.startsWith(":"))){if(o.startsWith("data:")){let r=o.slice(5).replace(/^ /,"");t=t?`${t}
|
|
11
|
+
${r}`:r;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(t==="[DONE]")return"done";if(!t)return null;try{let o=JSON.parse(t);return Os.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){throw Os.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),new Ve("invalid SSE frame","network",void 0,o)}}function F_(e){let t=new TextEncoder().encode(e),n="";for(let o of t)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Ds=e=>e&&Object.keys(e).length>0?e:void 0;function $s(e,t){let n=Ds(e),o=Ds(t);if(!n&&!o)return;let r={};return n&&(r.user=n),o&&(r.page=o),F_(JSON.stringify(r))}function Lo(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function B_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Fs(e){return e.startsWith("tool-")?e.slice(5):e}var tt={handshake:"/pai/handshake",streamMessage:"/pai/stream-message",streamResume:"/pai/stream-resume",cancelStream:"/pai/cancel-stream",listConversations:"/pai/list-conversations",listMessages:"/pai/list-messages",updateSettings:"/pai/update-settings",markRead:"/pai/mark-read",messageFeedback:"/pai/message-feedback",requestOperator:"/pai/request-operator",cancelOperatorRequest:"/pai/cancel-request-operator",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Bs="context";function Tt(e){let t=e??{},n=t.controlMode;return{controlMode:n==="awaiting_operator"||n==="operator"?n:"ai-agent",controlRevision:typeof t.controlRevision=="number"&&Number.isSafeInteger(t.controlRevision)&&t.controlRevision>=0?t.controlRevision:void 0,assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function Oo(e){let t=e?.suggestions;if(!Array.isArray(t))return[];let n=[];for(let o of t){if(!o||typeof o!="object")continue;let{id:r,label:i,text:s}=o;typeof i!="string"||!i||n.push({id:typeof r=="string"&&r?r:`s${n.length}`,label:i,text:typeof s=="string"&&s?s:i})}return n}function ia(e){let n={messages:e.messages.map(o=>({id:o.serverMessageId??o.id,parts:U_(o),role:o.role,createdAt:o.createdAt!==void 0?new Date(o.createdAt).toISOString():void 0})),conversationId:e.conversationId,responseType:"ack"};return e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs),n}function H_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function U_(e){let t=[];for(let n of e.parts)if(n.kind==="step-start"&&t.push({type:"step-start"}),n.kind==="reasoning"&&n.text&&t.push({type:"reasoning",text:n.text,state:n.done?"done":"streaming"}),n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url}),n.kind==="tool"&&H_(n)){let o=n.dynamic?{type:"dynamic-tool",toolName:n.toolName,toolCallId:n.toolCallId,state:n.state}:{type:B_(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(o.input=n.input),n.output!==void 0&&(o.output=n.output),n.error!==void 0&&(o.errorText=n.error),n.approval&&n.approval.approved!==void 0&&(o.approval=n.approval),t.push(o)}for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var re=ee.scope("transport"),z_=6e4,q_=1e4,la=50,Hs=3,V_=400,W_=3e4,G_=6e4,K_=15e3,j_=1024*1024,Us=new Set([408,425,429,500,502,503,504]);function zs(e){return V_*2**e+Math.floor(Math.random()*250)}function X_(e){return G_+Math.ceil(e/j_)*K_}function Y_(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),o=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(o)&&o>=0?Math.min(o,3e4):null}var No=class{constructor(t){ne(this,"ttlMs",t);ne(this,"map",new Map)}getOrFetch(t,n){let o=this.map.get(t);if(o&&Date.now()-o.at<this.ttlMs)return o.result;let r={at:Date.now(),result:n().then(i=>(r.value=i,i)).catch(i=>{throw this.map.delete(t),i})};return this.map.set(t,r),r.result}peek(t){let n=this.map.get(t);if(n?.value!==void 0&&Date.now()-n.at<this.ttlMs)return n.value}clear(){this.map.clear()}},Do=class{constructor(t){ne(this,"opts",t);ne(this,"visitorId");ne(this,"conversationId");ne(this,"userContext");ne(this,"pageContext");ne(this,"locale");ne(this,"conversationsCache",new No(q_));ne(this,"contentCache",new No(z_))}setContext(t,n){this.userContext=t,this.pageContext=n}setLocale(t){this.locale=t}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.conversationId=n)}envelope(){let t={_ev:Mo};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=$s(this.userContext,this.pageContext);return n&&(t[Bs]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,o]of Object.entries(this.envelope()))t.append(n,o);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[o,r]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,r);return n.toString()}async handshake(t){re.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(tt.handshake,t,"handshake");return re.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),Z_(n)||re.warn("handshake response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t,n){re.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let o=new FormData;o.append("file",t,t.name);let r=await this.postForm(this.uploadPath,o,"upload",n,X_(t.size));return re.debug("uploadFile \u2190",{id:r.id,url:r.url}),r}async transcribe(t,n="audio/webm"){re.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${J_(n)}`),o.append("mimeType",n);let r=await this.postForm(this.transcribePath,o,"transcribe");return re.debug("transcribe \u2190",{textLen:r.text.length}),r}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={}){return this.conversationsCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchConversations(t))}async fetchConversations(t){let n=new URL(this.url(tt.listConversations));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.page&&n.searchParams.set("page",String(t.page)),t.limit&&n.searchParams.set("limit",String(t.limit)),t.ids?.length&&n.searchParams.set("ids",t.ids.join(",")),re.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,page:t.page,limit:t.limit,ids:t.ids});let o=await this.getJson(n.toString(),"listConversations");return re.debug("listConversations \u2190",{count:o.conversations.length,page:o.pagination.page,hasNext:o.pagination.hasNext}),o}async loadConversation(t,{ids:n=[],beforeId:o}={}){let r=new URL(this.url(tt.listMessages));r.searchParams.set("conversationId",t),r.searchParams.set("limit",String(la)),r.searchParams.set("sortBy","_id"),r.searchParams.set("sortOrder","desc"),n.length>0&&r.searchParams.set("ids",n.join(",")),o&&r.searchParams.set("beforeId",o),re.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId,ids:n.length>0?n:void 0,beforeId:o});let i=await this.getJson(r.toString(),"loadConversation"),s=(i.messages??[]).toReversed();return re.debug("loadConversation \u2190",{conversationId:i.conversationId,canContinue:i.canContinue,messageCount:s.length,hasSuggestions:!!i.suggestions}),{...i,messages:s,canContinue:i.canContinue??!0}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),re.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(tt.markRead,{conversationId:t},"markRead")}catch(n){re.debug("markRead failed (non-fatal)",{err:n})}}}async requestOperator(){if(!(!this.visitorId||!this.conversationId)){re.debug("requestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(tt.requestOperator,{},"requestOperator")).controlState}catch(t){re.debug("requestOperator failed (non-fatal)",{err:t});return}}}async cancelOperatorRequest(){if(!(!this.visitorId||!this.conversationId)){re.debug("cancelOperatorRequest \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson(tt.cancelOperatorRequest,{},"cancelOperatorRequest")).controlState}catch(t){re.debug("cancelOperatorRequest failed (non-fatal)",{err:t});return}}}listContent(t={}){return this.contentCache.getOrFetch(this.localeCacheKey(t),()=>this.fetchContent(t))}async fetchContent(t){let n=new URL(this.dataUrl(tt.content));for(let[i,s]of Object.entries(t))s!==void 0&&n.searchParams.set(i,Array.isArray(s)?s.join(","):String(s));re.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),r=(o.items??[]).map(i=>Ri(i,this.locale));return re.debug("listContent \u2190",{count:r.length,total:o.pagination?.total}),{...o,items:r}}async bootstrap(t){let n=new URL(this.dataUrl(tt.bootstrap));t&&n.searchParams.set("conversationId",t),re.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),r=o.forms??[],i=o.formSubmissions??[];return re.debug("bootstrap \u2190",{forms:r.length,formSubmissions:i.length}),{forms:r,formSubmissions:i}}async saveUserPrefs(t){re.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(tt.updateSettings,{userPrefs:t},"saveUserPrefs");return re.debug("saveUserPrefs \u2190",{success:n.success}),n}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}get submitFormPath(){return this.opts.endpoints?.submitForm??tt.submitForm}async submitForm(t){re.debug("submitForm \u2192",{formId:t.formId,trigger:t.trigger,fields:Object.keys(t.values).length});try{await this.postJson(this.dataUrl(this.submitFormPath),t,"submitForm")}catch(n){re.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){re.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(tt.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){re.debug("submitFeedback failed (non-fatal)",{err:n})}}async sendTurn(t){this.conversationsCache.clear(),re.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageCount:t.messages.length});try{return await this.runWithAbort(async n=>{let o=await this.fetchImpl(this.url(tt.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});if(o.status!==202)throw new Ve(`sendTurn failed: expected 202, received ${o.status}`,"server",o.status);let r;try{r=await o.json()}catch(i){throw n?.aborted?i:new Ve("sendTurn failed: invalid acknowledgement","server",o.status,i)}if(!Q_(r))throw new Ve("sendTurn failed: invalid acknowledgement","server",o.status);return r},void 0,W_)}catch(n){throw n instanceof Ve?n:new Ve("sendTurn failed: network error","network",void 0,n)}}cancelTurn(t,n){!this.visitorId||!t||!n||(re.debug("cancel stream",{conversationId:t,runId:n,visitorId:this.visitorId}),this.fetchImpl(this.url(tt.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({conversationId:t,runId:n})),keepalive:!0}).catch(o=>re.debug("cancel POST failed (non-fatal)",{err:o})))}async connectResumeStream(t){let n;try{n=await this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(o){return t.signal.aborted||re.debug("resume-stream fetch failed \u2014 reconnecting",{err:o}),"held"}if(!n.ok)return n.status===409||Us.has(n.status)?(re.debug("resume-stream \u2192 transient response; reconnecting",{status:n.status}),"held"):(re.debug("resume-stream \u2192 endpoint unavailable",{status:n.status}),"unavailable");if(!n.body)return re.debug("resume-stream \u2192 bodyless response; stopping",{status:n.status}),"unavailable";if(!(n.headers.get("content-type")??"").includes("text/event-stream"))return re.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";t.onConnected();try{for await(let{chunk:o}of Ns(n,t.signal)){if(t.signal.aborted)return"held";t.onChunk(o)}}catch(o){if(t.signal.aborted)return"held";re.debug("resume-stream segment dropped \u2014 reconnecting",{err:o})}return"held"}resumeUrl(){return this.withEnvelopeQuery(tt.streamResume)}async postJson(t,n,o){let r=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],o);return this.assertOk(r,o)}async postForm(t,n,o,r,i){return this.runWithAbort(async s=>{let l=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n),signal:s});return this.assertOk(l,o)},r,i)}async runWithAbort(t,n,o){if(!n&&o===void 0)return t();let r=new AbortController,i=()=>r.abort(n?.reason);n?.aborted?i():n?.addEventListener("abort",i,{once:!0});let s=o===void 0?void 0:setTimeout(()=>r.abort(),o);try{return await t(r.signal)}finally{s!==void 0&&clearTimeout(s),n?.removeEventListener("abort",i)}}async getJson(t,n){let o=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(o,n)}async fetchWithRetry(t,n){for(let o=0;;o++){let[r,i]=t(),s;try{s=await this.fetchImpl(r,i)}catch(c){if(o>=Hs)throw new Ve(`${n} failed: network error`,"network",void 0,c);re.debug("request network error \u2014 retrying",{label:n,attempt:o}),await Bn(zs(o));continue}if(s.ok||!Us.has(s.status)||o>=Hs)return s;let l=Y_(s.headers)??zs(o);re.debug("request retryable status \u2014 retrying",{label:n,status:s.status,attempt:o,wait:l}),await Bn(l)}}async assertOk(t,n){if(!t.ok)throw new Ve(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function J_(e){return e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mp4")||e.includes("m4a")?"m4a":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":"bin"}function Q_(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"status"),n=Reflect.get(e,"conversationId"),o=Reflect.get(e,"runId");return t==="accepted"&&typeof n=="string"&&n.length>0&&(o===void 0||typeof o=="string"&&o.length>0)}function Z_(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function da(e,t){let n=e?[{kind:"text",id:"t0",textSig:J(e),doneSig:J(!0)}]:[];return{id:at(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:J(n)}}function kt(){return{id:at(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:J([])}}function Vs(e){let t=at();return ep({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function ep(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,feedback:e.feedback,partsSig:J(e.parts.map(ip))}}var Ws=new Set(["completed","failed","canceled"]);function tp(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status!=null&&!Ws.has(e.status)?"streaming":"complete"}function ua(e){let t=new Set,n=e.parts.map((r,i)=>r.type==="text"?{kind:"text",id:`${e.id}-t${i}`,textSig:J(r.text),doneSig:J(!0)}:r.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${i}`,textSig:J(r.text),doneSig:J(r.state!=="streaming")}:r.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${i}`}:r.type==="file"?{kind:"file",url:r.url,mediaType:r.mediaType}:r.type==="source-url"?{kind:"source",sourceId:r.sourceId,url:r.url,title:r.title}:r.type==="source-document"?{kind:"source",sourceId:r.sourceId,title:r.title,filename:r.filename,mediaType:r.mediaType}:r.type==="data-suggestions"?null:r.type==="dynamic-tool"||r.type.startsWith("tool-")?{kind:"tool",toolCallId:r.toolCallId,toolName:r.type==="dynamic-tool"?r.toolName:Fs(r.type),dynamic:r.type==="dynamic-tool"?!0:void 0,inputPartialSig:J(""),inputSig:J(r.input),outputSig:J(r.output),errorSig:J(r.errorText),stateSig:J(r.state),approvalSig:J(r.approval)}:null).filter(r=>r!==null).filter(r=>r.kind!=="source"?!0:t.has(r.sourceId)?!1:(t.add(r.sourceId),!0)),o=e.parts.find(r=>r.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:o?.type==="data-suggestions"?Oo(o.data):void 0,serverMessageId:e.id,createdAt:Lo(e.createdAt)??Date.now(),status:tp(e),canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:J(n)}}function np(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type==="dynamic-tool"||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function op(e){return e.role==="assistant"&&e.status!=null&&!Ws.has(e.status)&&np(e)}function It(e){let t=e.length-1;return e.filter((n,o)=>o===t||!op(n)).map(ua)}function Gs(e,t){let n=!t&&e.at(-1)?.role==="assistant"?-2:-1,o=e.at(n);return!o||o.ephemeral?[]:[o]}function _a(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,parts:e.partsSig.value.map(sp)}}function Ue(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function Et(e){return Ue(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function rp(e){return Ue(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function Ks(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}var $o=e=>e.kind==="tool",js=e=>e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file";function Hn(e){let t=e.partsSig.value,n=t.findLastIndex(o=>o.kind==="tool");return t.slice(n+1).some(js)}function Gt(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter($o);return t.length>0&&t.every(n=>Ks(n.stateSig.value))}function Kt(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!Hn(e)}function Fo(e,t){return!e.partsSig.value.slice(t+1).some(n=>n.kind==="step-start"||js(n))}function Bo(e){return e.partsSig.value.some(t=>$o(t)&&!Ks(t.stateSig.value))}function Xs(e,t){if(t.length===0)return e;let n=new Set;for(let s of e)n.add(s.id),s.serverMessageId&&n.add(s.serverMessageId);let o=t.filter(s=>{let l=[s.id,s.serverMessageId].filter(c=>c!==void 0);return l.some(c=>n.has(c))?!1:(l.forEach(c=>n.add(c)),!0)});if(o.length===0)return e;let r=e.findIndex(s=>!s.ephemeral),i=r<0?e.length:r;return[...e.slice(0,i),...o,...e.slice(i)]}function Vt(e,t){return t.id=e.id,e.canceled&&(t.canceled=!0),e.feedback!==void 0&&(t.feedback=e.feedback),t.suggestions??(t.suggestions=e.suggestions),t}function Ys(e,t,n,o){if(!pa(e))return;if(t.length===0){let s=Math.max(...o.values());return n.find(l=>l.role==="assistant"&&o.get(l.serverMessageId??l.id)===s&&Ue(l).length>=Ue(e).length)}let r=t.at(-1);if(r?.role!=="user")return;let i=o.get(r.serverMessageId??r.id);if(i!==void 0)return n.find(s=>s.role==="assistant"&&o.get(s.serverMessageId??s.id)===i+1&&Ue(s).length>=Ue(e).length)}function pa(e){return e?.role==="assistant"&&e.status==="streaming"&&e.serverMessageId===void 0}function Js(e,t){let n=t.filter(p=>!p.ephemeral&&(p.status==="streaming"||p.status==="pending"||p.status==="error"||p.retryAction!==void 0||(p.attachments?.length??0)>0||Et(p))),o=new Map;for(let p of n)o.set(p.id,p),p.serverMessageId!==void 0&&o.set(p.serverMessageId,p);let r=new Set,i=[],s=e.map(p=>{let d=(p.serverMessageId!==void 0?o.get(p.serverMessageId):void 0)??o.get(p.id);return d===void 0?(i.push(p),p):(r.add(d),d.role!==p.role?p:d.role==="user"&&d.serverMessageId===void 0&&(d.status==="pending"||d.status==="error")?Vt(d,p):d.status==="streaming"||Ue(d).length>=Ue(p).length?(d.suggestions??(d.suggestions=p.suggestions),d.feedback===void 0&&(d.feedback=p.feedback),p.canceled&&(d.canceled=!0),d):Vt(d,p))}),l=n.filter(p=>!r.has(p)),c=l.findLast(pa),u=new Map;e.forEach((p,d)=>{u.set(p.id,d),p.serverMessageId!==void 0&&u.set(p.serverMessageId,d)});let _=Ys(c,c?n.slice(0,n.indexOf(c)):[],i,u);if(c&&_){let p=s.indexOf(_);p>=0&&(s[p]=Vt(c,_)),l=l.filter(d=>d!==c)}return[...s,...l]}function Un(e,t){let n=new Map(t.filter(p=>p.serverMessageId!==void 0).map(p=>[p.serverMessageId,p])),o=new Map;t.forEach((p,d)=>{o.set(p.id,d),p.serverMessageId!==void 0&&o.set(p.serverMessageId,d)});let r=new Set(e.flatMap(p=>[p.serverMessageId,p.id].filter(d=>d!==void 0))),i=!1,s=e.map(p=>{let d=n.get(p.serverMessageId??p.id);if(d===void 0||d.role!==p.role)return p;if(p.role==="user"&&p.serverMessageId===void 0)return i=!0,Vt(p,d);if(p.serverMessageId===void 0)return p;let f=Ue(d),m=Ue(p),h=d.status!=="streaming"&&f.length>=m.length&&ca(p,d);if(f.length>m.length||f===m&&d.partsSig.value.length>p.partsSig.value.length||h)return i=!0,Vt(p,d);if(p.status==="streaming"&&d.status!=="streaming"&&ap(p,d)){if(p.continuationStreaming&&Bo(d))return p;if(!ca(d,p))return i=!0,Vt(p,d)}return p}),l=[...n.values()].filter(p=>!r.has(p.serverMessageId)),c=s.findLastIndex(pa),u=s[c],_=Ys(u,s.slice(0,c),l,o);if(u!==void 0&&_!==void 0&&Ue(_).length>=Ue(u).length&&(Vt(u,_),s[c]=_,l.splice(l.indexOf(_),1),i=!0),l.length===0)return{messages:i?s:e,changed:i};for(let p of l){let d=o.get(p.serverMessageId??p.id),f=!1,m=s.findIndex(h=>{let b=o.get(h.serverMessageId??h.id);return d===void 0?!1:b===void 0?f:b>d?!0:(f=!0,!1)});m===-1?s.push(p):s.splice(m,0,p)}return{messages:s,changed:!0}}function Qs(e,t){if(e.role!==t.role)return!1;let n=Ue(t),o=Ue(e);return n.length>o.length||t.partsSig.value.length>e.partsSig.value.length||ca(e,t)}function ap(e,t){let n=e.partsSig.value,o=t.partsSig.value;return n.length!==o.length?!1:n.every((r,i)=>{let s=o[i];switch(r.kind){case"text":return s?.kind==="text"&&s.textSig.value===r.textSig.value;case"reasoning":return s?.kind==="reasoning"&&s.textSig.value===r.textSig.value;case"step-start":return s?.kind==="step-start";case"tool":return s?.kind==="tool"&&s.toolCallId===r.toolCallId&&Ho(s.toolName,r.toolName);case"file":return s?.kind==="file"&&s.url===r.url&&s.mediaType===r.mediaType;case"source":return s?.kind==="source"&&s.sourceId===r.sourceId&&s.url===r.url&&s.title===r.title&&s.filename===r.filename&&s.mediaType===r.mediaType;default:return r}})}function Ho(e,t){let n=e.startsWith("tool:")?e.slice(5):e,o=t.startsWith("tool:")?t.slice(5):t;return n===o}var qs={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function ca(e,t){let n=new Map(e.partsSig.value.filter($o).map(o=>[o.toolCallId,o]));return t.partsSig.value.filter($o).some(o=>{let r=n.get(o.toolCallId);if(!r||qs[o.stateSig.value]>qs[r.stateSig.value])return!0;let i=o.approvalSig.value?.approved;return i!==void 0&&i!==r.approvalSig.value?.approved})}function Wt(e){return e.role==="assistant"&&e.status!=="streaming"&&!Et(e)}function Uo(e,t){if(!e.includes(t)||t.retryAction===null)return;if(t.retryAction)return t.retryAction;if(t!==e.at(-1)||t.role!=="assistant"||t.serverMessageId===void 0||t.status!=="error"&&!Wt(t))return;let n=e.indexOf(t);for(let o=n-1;o>=0;o--){let r=e[o];if(r?.role==="user"&&!r.ephemeral)return{kind:"repeat-user",messageId:r.id}}}function Zs(e){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!rp(e)}function el(e,t){return e.operatorRoutedTurn?Wt(e)?"drop":"complete-operator-routed":t||Wt(e)?"error":"complete"}function ip(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:J(e.text),doneSig:J(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,dynamic:e.dynamic,inputPartialSig:J(e.inputPartial),inputSig:J(e.input),outputSig:J(e.output),errorSig:J(e.error),stateSig:J(e.state),approvalSig:J(e.approval)}:e}function sp(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,dynamic:e.dynamic,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var tl=ee.scope("feedback:audio"),zo=class{constructor(){ne(this,"ctx",null);ne(this,"master",null);ne(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){tl.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let r=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((s,l)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=s;let u=n.createGain(),_=r+l*i;u.gain.setValueAtTime(1e-4,_),u.gain.exponentialRampToValueAtTime(t.peakGain,_+.005),u.gain.exponentialRampToValueAtTime(1e-4,_+i),c.connect(u).connect(o),c.start(_),c.stop(_+i+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let r=await this.getBuffer(t);if(!r)return;let i=n.createBufferSource();i.buffer=r,i.connect(o),i.start()}destroy(){this.ctx&&this.ctx.close().catch(()=>{}),this.ctx=null,this.master=null,this.buffers.clear()}async getBuffer(t){if(!this.ctx)return null;let n=this.buffers.get(t);if(n)return n instanceof Promise,n;let o=this.ctx,r=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>o.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(tl.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,r),r}};var nl={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},ol={messageReceived:{notes:[880,1318.51],noteMs:90,type:"sine",peakGain:.45},messageSent:{notes:[1568],noteMs:60,type:"sine",peakGain:.25},error:{notes:[523.25,392],noteMs:120,type:"triangle",peakGain:.55},voiceStart:{notes:[1318.51],noteMs:50,type:"sine",peakGain:.3},voiceStop:{notes:[880],noteMs:50,type:"sine",peakGain:.3}};var At=null,qo=0;function lp(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function cp(){if(typeof document>"u")return null;let e=document.createElement("input");e.type="checkbox",e.setAttribute("switch",""),e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.id=`__${C.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function rl(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(lp())try{navigator.vibrate(e);return}catch{}if(At||(At=cp()),!!At)try{At.label.click()}catch{}}}function al(){qo++;let e=!1;return()=>{e||(e=!0,qo=Math.max(0,qo-1),qo===0&&At&&(At.input.remove(),At.label.remove(),At=null))}}var dp=ee.scope("feedback"),up=100,Vo=class{constructor(t,n){ne(this,"mutedSig",J(!1));ne(this,"audio",new zo);ne(this,"releaseHaptics");ne(this,"sound");ne(this,"haptics");ne(this,"lastPlayed",new Map);ne(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=al(),this.audio.setVolume(this.effectiveVolume()),typeof matchMedia<"u"&&(this.reducedMotionMq=matchMedia("(prefers-reduced-motion: reduce)"))}unlock(){this.audio.unlock(),this.audio.setVolume(this.effectiveVolume())}update(t,n){this.sound=t,this.haptics=n,this.audio.setVolume(this.effectiveVolume())}setMuted(t){this.mutedSig.value!==t&&(this.mutedSig.value=t)}toggleMuted(){this.mutedSig.value=!this.mutedSig.value}play(t){this.mutedSig.value||this.isDeduped(t)||(this.lastPlayed.set(t,performance.now()),this.sound.enabled&&this.playSound(t),this.haptics.enabled&&this.isTouchDevice()&&this.playHaptic(t))}destroy(){this.audio.destroy(),this.releaseHaptics()}isDeduped(t){let n=this.lastPlayed.get(t);return n===void 0?!1:performance.now()-n<up}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(r=>dp.warn("audio play failed",{err:r,url:n}));return}let o=ol[t];o&&this.audio.playTone(o)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let o=n===!0||n===void 0?nl[t]:n;rl(o)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};var _p=0;function a(e,t,n,o,r,i){t||(t={});var s,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var u={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--_p,__i:-1,__u:0,__source:r,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)c[l]===void 0&&(c[l]=s[l]);return Y.vnode&&Y.vnode(u),u}var G={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},zn=`${C.cssPrefix}-icon-dir`,fa=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),pt=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M18 6 6 18M6 6l12 12"})}),il=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M12 5v14M5 12h14"})}),sl=()=>a("svg",{...G,class:zn,"aria-hidden":"true",children:[a("path",{d:"m22 2-7 20-4-9-9-4Z"}),a("path",{d:"M22 2 11 13"})]}),ll=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M12 19V5M5 12l7-7 7 7"})}),cl=()=>a("svg",{...G,class:zn,"aria-hidden":"true",children:a("path",{d:"M3 20V4l18 8-18 8Z"})}),mn=()=>a("svg",{...G,class:zn,"aria-hidden":"true",children:a("path",{d:"m9 18 6-6-6-6"})}),dl=()=>a("svg",{...G,"aria-hidden":"true",children:a("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),ul=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),_l=()=>a("svg",{...G,"aria-hidden":"true",children:[a("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),a("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),pl=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),fl=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),ml=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),gl=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),vl=()=>a("svg",{...G,"aria-hidden":"true",viewBox:"0 0 10 10",children:a("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),hl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),bl=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),yl=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),Pl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),a("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),xl=()=>a("svg",{...G,class:zn,"aria-hidden":"true",children:a("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),jt=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M20 6 9 17l-5-5"})}),Sl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M3 3v6h6"}),a("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),a("path",{d:"M12 7v5l3 2"})]}),kl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M2 12h20"}),a("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),qn=()=>a("svg",{...G,class:zn,"aria-hidden":"true",children:a("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),wl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M12 20h9"}),a("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),Xt=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"m6 9 6 6 6-6"})}),Cl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),a("path",{d:"M14 2v6h6"})]}),pp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),a("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),ma=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),Vn=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),a("path",{d:"M12 17h.01"})]}),fp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"m15 4 3 3-9 9-3-3z"}),a("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),mp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),a("path",{d:"M12 8V4"}),a("circle",{cx:"12",cy:"3",r:"1"}),a("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),ga=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),a("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),a("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),a("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),gp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("circle",{cx:"12",cy:"12",r:"4"}),a("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),va=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"11",cy:"11",r:"7"}),a("path",{d:"m21 21-4.3-4.3"})]}),Rl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Tl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M3 9.5 12 3l9 6.5"}),a("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),Il=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"m3 11 15-5v12L3 13z"}),a("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),a("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),a("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Wn=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),a("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),El=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"4"}),a("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),Al=()=>a("svg",{...G,"aria-hidden":"true",children:a("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Ml=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 3v18"}),a("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),vp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),a("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),a("path",{d:"m20 20-4.4-4.4"})]}),hp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),a("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),bp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M4 18h16"}),a("path",{d:"M5 18a7 7 0 0 1 14 0"}),a("path",{d:"M12 8V6"}),a("path",{d:"M10 6h4"})]}),yp=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),a("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),Ll=()=>a("svg",{...G,"aria-hidden":"true",children:[a("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),a("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]}),Ol=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),a("path",{d:"M7 10l4-7a2.5 2.5 0 0 1 2.5 2.5V8h5a2 2 0 0 1 2 2.3l-1.2 8A2 2 0 0 1 17.3 20H7"})]}),Nl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),a("path",{d:"M17 14l-4 7a2.5 2.5 0 0 1-2.5-2.5V16h-5a2 2 0 0 1-2-2.3l1.2-8A2 2 0 0 1 6.7 4H17"})]}),Dl=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"3.5"}),a("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M19.1 4.9l-2.1 2.1M7 17l-2.1 2.1"})]}),$l=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 7v5l3 2"})]}),Wo=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Go=()=>a("svg",{...G,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m15 9-6 6M9 9l6 6"})]}),Fl={chat:fa,message:ma,bubbles:Wn,spark:pp,wand:fp,bot:mp,help:Vn,lifebuoy:gp,headset:ga,search:vp,sparkles:hp,concierge:bp,wave:yp};var $=C.cssPrefix,R={launcher:`${$}-launcher`,callout:`${$}-callout`,calloutDismiss:`${$}-callout-dismiss`,panel:`${$}-panel`,panelHeader:`${$}-panel-header`,resizeGrip:`${$}-resize-grip`,scrollToBottom:`${$}-scroll-to-bottom`,loadPreviousMessages:`${$}-load-previous-messages`,actionHistory:`${$}-action-history`,actionClose:`${$}-action-close`,langSegment:`${$}-lang-segment`,composer:`${$}-composer`,composerInput:`${$}-composer-input`,composerSend:`${$}-composer-send`,composerStop:`${$}-composer-stop`,composerAttach:`${$}-composer-attach`,composerFileInput:`${$}-composer-file-input`,composerVoice:`${$}-composer-voice`,attachmentChip:`${$}-attachment-chip`,attachmentRemove:`${$}-attachment-remove`,suggestion:`${$}-suggestion`,messageBubble:`${$}-message`,messageRetry:`${$}-message-retry`,messageFeedback:`${$}-message-feedback`,feedbackUp:`${$}-feedback-up`,feedbackDown:`${$}-feedback-down`,messageCopy:`${$}-message-copy`,historyPane:`${$}-history-pane`,historyBack:`${$}-history-back`,historyItem:`${$}-history-item`,historyLoadMore:`${$}-history-load-more`,sidebar:`${$}-sidebar`,sidebarToggle:`${$}-sidebar-toggle`,sidebarNewConversation:`${$}-sidebar-new-conversation`,sidebarItem:`${$}-sidebar-item`,messengerHome:`${$}-messenger-home`,modulesEmpty:`${$}-modules-empty`,tab:`${$}-tab`,tabBadge:`${$}-tab-badge`,homeView:`${$}-home-view`,homeGreeting:`${$}-home-greeting`,homeBrand:`${$}-home-brand`,backHeader:`${$}-back-header`,contentView:`${$}-content-view`,contentScroll:`${$}-content-scroll`,homeSearch:`${$}-home-search`,helpSearch:`${$}-help-search`,homeRecent:`${$}-home-recent`,homeContentRow:`${$}-home-content-row`,helpArticle:`${$}-help-article`,newsItem:`${$}-news-item`,formGate:`${$}-form-gate`,formDone:`${$}-form-done`,formDoneToggle:`${$}-form-done-toggle`,formAnswers:`${$}-form-answers`,formFill:`${$}-form-fill`,formSubmit:`${$}-form-submit`,formSkip:`${$}-form-skip`,formField:`${$}-form-field`,toolAskQuestions:`${$}-tool-ask-questions`,toolInputSubmit:`${$}-tool-input-submit`,toolInputSkip:`${$}-tool-input-skip`,toolApproval:`${$}-tool-approval`,toolApprove:`${$}-tool-approve`,toolReject:`${$}-tool-reject`,toolEdit:`${$}-tool-edit`,toolDecision:`${$}-tool-decision`,typingDots:`${$}-typing-dots`,reasoning:`${$}-reasoning`,toolAskSummary:`${$}-ask-questions-summary`,toolAskOptions:`${$}-ask-questions-options-toggle`,toolCall:`${$}-tool-call`,source:`${$}-source`,operatorRequest:`${$}-operator-request`,operatorBanner:`${$}-operator-banner`,cancelOperatorRequest:`${$}-cancel-operator-request`};function We(e,t){return`${e}-${t}`}var Ko=C.cssPrefix;function Bl({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:r}){let i=t.variant!=="circle"&&!!t.label;return a("button",{type:"button",class:`${Ko}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":r?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":R.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Pp(t.icon),i?a("span",{class:`${Ko}-fab-label`,children:Ze(n,t.label??"")}):null]})}function Pp(e){let t=Fl[e];return t?a(t,{}):a(xp,{source:e})}function xp({source:e}){return a("span",{ref:t=>{t&&Sp(t,e)},"aria-hidden":"true"})}function Sp(e,t){if(e.dataset.svgMounted!==t)try{let o=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;o&&o.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(o,!0)),e.dataset.svgMounted=t)}catch{}}function Hl({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:r}){let[i,s]=O(!1);return E(()=>{let l=setTimeout(()=>s(!0),e.delayMs);return()=>clearTimeout(l)},[e.delayMs]),E(()=>{if(!i||e.autoDismissMs<=0)return;let l=setTimeout(r,e.autoDismissMs);return()=>clearTimeout(l)},[i,e.autoDismissMs,r]),i?a("div",{class:`${Ko}-callout`,role:"status","data-shape":e.shape,"data-position":kp(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":R.callout,children:[a("span",{children:Ze(n,e.text)}),a("button",{type:"button",class:`${Ko}-callout-close`,onClick:r,"aria-label":o,title:o,"data-testid":R.calloutDismiss,children:a(pt,{})})]}):null}function kp(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function jo({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:r,strings:i}){let s=C.cssPrefix,l=A(null);if(E(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${s}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${s}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${s}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${s}-resize-max-h`,t.maxHeight),o&&(m.setProperty(`--${s}-widget-w`,`${o.width}px`),m.setProperty(`--${s}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,s,o]),!e)return null;let c=n.startsWith("top-"),u=n.endsWith("-right"),_=`${s}-resize-grip ${s}-resize-grip--${c?"bottom":"top"}-${u?"left":"right"}`,p=m=>{if(!e)return;let h=m.currentTarget,b=e.getBoundingClientRect();l.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:b.width,startH:b.height,dirX:u?-1:1,dirY:c?1:-1},h.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},d=m=>{let h=l.current;if(!h||m.pointerId!==h.pointerId||!e)return;let b=(m.clientX-h.startX)*h.dirX,x=(m.clientY-h.startY)*h.dirY;e.style.setProperty(`--${s}-widget-w`,`${h.startW+b}px`),e.style.setProperty(`--${s}-widget-h`,`${h.startH+x}px`)},f=m=>{let h=l.current;if(!h||m.pointerId!==h.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let b=e.getBoundingClientRect();r({width:Math.round(b.width),height:Math.round(b.height)}),l.current=null};return a("div",{class:_,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:p,onPointerMove:d,onPointerUp:f,onPointerCancel:f,"data-testid":R.resizeGrip,children:a(vl,{})})}var Yt=C.cssPrefix,wp=`.${Yt}-header, .${Yt}-back-header, .${Yt}-home-hero`,Cp='button, a, input, textarea, select, [role="tab"], [contenteditable]',Ul=56;function Xo(e,t){E(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,u)=>Math.min(u,Math.max(-u,c)),r=null,i=c=>{let u=c.target;if(!(u instanceof Element)||!u.closest(wp)||u.closest(Cp))return;let _=e.getBoundingClientRect();r={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Yt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Yt}-modal-dy`)),maxX:(window.innerWidth+_.width)/2-Ul,maxY:(window.innerHeight+_.height)/2-Ul},e.dataset.dragging="true",c.preventDefault()},s=c=>{if(!r||c.pointerId!==r.id)return;let u=o(r.dx+c.clientX-r.x,r.maxX),_=o(r.dy+c.clientY-r.y,r.maxY);e.style.setProperty(`--${Yt}-modal-dx`,`${u}px`),e.style.setProperty(`--${Yt}-modal-dy`,`${_}px`)},l=c=>{!r||c.pointerId!==r.id||(r=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",s),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)}},[e,t])}function Gn(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function Yo(e,t,n){return Gn("close",e,t)?n.includes("close"):!1}function zl(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Rp='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Jo(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(Rp)].filter(l=>l.offsetParent!==null||l===document.activeElement);if(o.length===0){n.preventDefault();return}let r=o[0],i=o[o.length-1];if(!r||!i)return;let s=e.getRootNode().activeElement;n.shiftKey&&s===r?(n.preventDefault(),i.focus()):!n.shiftKey&&s===i&&(n.preventDefault(),r.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Qo(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var ha=C.cssPrefix;function ql({agent:e,strings:t}){let n=e.status??"online",o=Ze(t,e.name),r=e.title?Ze(t,e.title):null;return a("div",{class:`${ha}-agent`,children:[a("div",{class:`${ha}-agent-avatar`,"data-status":n,children:e.avatar?a("img",{src:e.avatar,alt:""}):a("span",{children:Qo(o)})}),a("div",{class:`${ha}-agent-meta`,children:[a("strong",{children:o}),r?a("span",{children:r}):null]})]})}var Vl=ee.scope("attachments");function Zo(e,t,n){let o=Ip(e),r=[],i=[],s=Mp(n.accept),l=t.reduce((u,_)=>u+_.size,0),c=t.length;for(let u of o){let _=Tp(u,c,l,n,s);if(_){i.push({file:u,reason:_});continue}r.push(Ap(u)),l+=u.size,c+=1}return(r.length||i.length)&&Vl.debug("ingest",{accepted:r.length,rejected:i.map(u=>({name:u.file.name,reason:u.reason}))}),{accepted:r,rejected:i}}function er(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Vl.debug("revokeObjectURL failed",{error:t})}}function Tp(e,t,n,o,r){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Lp(e,r)?null:"mime"}function Ip(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Ep(t)).filter(t=>t!==null):[]}function Ep(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Ap(e){return{file:e,id:at(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Mp(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",o="*"]=t.split("/");return{kind:"mime",type:n,subtype:o}})}function Lp(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),r=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?r.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===o))}var Kn=C.cssPrefix;function Wl({attachment:e,onRemove:t,disabled:n=!1}){let o=e.mediaType.startsWith("image/");return a("span",{class:`${Kn}-attachment-chip`,title:e.name,"data-testid":We(R.attachmentChip,e.id),children:[o?a("img",{class:`${Kn}-attachment-thumb`,src:e.previewUrl,alt:""}):a("span",{class:`${Kn}-attachment-thumb`,"aria-hidden":"true",children:a(Cl,{})}),a("span",{class:`${Kn}-attachment-name`,children:e.name}),a("button",{type:"button",class:`${Kn}-attachment-remove`,onClick:t,disabled:n,"aria-label":`Remove ${e.name}`,"data-testid":We(R.attachmentRemove,e.id),children:a(pt,{})})]})}var ba={isSupported:!1,start:()=>{},stop:()=>{},cancel:()=>{}};function ya(e,t,n){return e==="disabled"?ba:e==="server"?$p(n):Op(t)}function Op(e){let t=Np();if(!t)return ba;let n=null,o=0;return{isSupported:!0,start(r,i){let s=n,l=++o;n=null,s?.abort();let c=new t;n=c,c.continuous=!0,c.interimResults=!0,c.lang=e;let u=!1;c.addEventListener("result",p=>{if(o!==l||n!==c)return;let d=p,f="",m=!1;for(let h=d.resultIndex;h<d.results.length;h++){let b=d.results[h];b&&(f+=b[0].transcript,b.isFinal&&(m=!0))}r(f,m)});let _=()=>{u||o!==l||n!==c||(u=!0,n=null,i())};c.addEventListener("end",_),c.addEventListener("error",_);try{c.start()}catch{_()}},stop(){n?.stop()},cancel(){o++;let r=n;n=null,r?.abort()}}}function Np(){return window.SpeechRecognition??window.webkitSpeechRecognition}var Dp=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function $p(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ba;let t=0,n=null,o=s=>{for(let l of s.stream?.getTracks()??[])l.stop();s.stream=null},r=()=>{t++;let s=n;n=null,s&&(o(s),s.recorder?.state!=="inactive"&&s.recorder?.stop())},i=async s=>{if(s.finishing)return;s.finishing=!0;let l=s.recorder?.mimeType??"audio/webm";o(s);let c=new Blob(s.chunks,{type:l});s.chunks=[];try{let{text:u}=await e(c,l);n===s&&t===s.generation&&u&&s.onText(u,!0)}catch{}finally{n===s&&t===s.generation&&(n=null,s.onEnd())}};return{isSupported:!0,async start(s,l){r();let c={generation:t,recorder:null,stream:null,chunks:[],onText:s,onEnd:l,finishing:!1};n=c;try{let u=await navigator.mediaDevices.getUserMedia({audio:!0});if(n!==c||t!==c.generation){for(let d of u.getTracks())d.stop();return}c.stream=u;let _=Fp(),p=new MediaRecorder(u,_?{mimeType:_}:void 0);c.recorder=p,p.addEventListener("dataavailable",d=>{n===c&&t===c.generation&&d.data.size>0&&c.chunks.push(d.data)}),p.addEventListener("stop",()=>{n===c&&t===c.generation&&i(c)}),p.start()}catch{o(c),n===c&&t===c.generation&&(n=null,l())}},stop(){let s=n;if(s){if(!s.recorder){r();return}s.recorder.state!=="inactive"&&s.recorder.stop()}},cancel(){r()}}}function Fp(){for(let e of Dp)if(MediaRecorder.isTypeSupported(e))return e}var it=C.cssPrefix,gn=ee.scope("composer");function vn(e){return e.reduce((t,n)=>t+n.size,0)}var Bp={arrowUp:ll,paperPlane:sl,send:cl,chevron:mn};function Hp(e){return"activeElement"in e}function Up(e){return"host"in e&&"activeElement"in e}function Gl({options:e,transport:t,feedback:n,bus:o,persistence:r,conversationId:i,isStreaming:s,active:l=!0,isPreparing:c=!1,operatorRequestEnabled:u,controlMode:_,onRequestOperator:p,onSend:d,onStop:f,attachApiRef:m}){let h=e.strings,[b,x]=O(()=>r.loadDraft(i)),[P,v]=O([]),[y,k]=O(!1),[w,F]=O(!1),z=A(!1),q=A(null),I=A(null),H=A(null),V=A(0),N=A(i);N.current=i;let te=A(l);te.current=l;let ae=A(c);ae.current=c;let oe=w||c||!l,Ie=L(U=>{x(K=>{let j=typeof U=="function"?U(K):U;return j===K?K:(r.saveDraft(N.current,j),j)})},[r]),me=e.features.fileUpload,Pe=e.features.voice,[xe,D]=O(()=>ya(Pe,e.locale,(U,K)=>t.transcribe(U,K))),ge=A(xe);ge.current=xe;let ce=A({mode:Pe,locale:e.locale,transport:t});E(()=>{let U=ce.current;U.mode===Pe&&U.locale===e.locale&&U.transport===t||(ce.current={mode:Pe,locale:e.locale,transport:t},V.current++,ge.current.cancel(),H.current=null,k(!1),D(ya(Pe,e.locale,(K,j)=>t.transcribe(K,j))))},[e.locale,Pe,t]),E(()=>()=>{V.current++,xe.cancel()},[xe]);let Se=L(U=>{let K=H.current;if(K===null)return!1;let j=Date.now()-K;return gn[U]("voiceStop",{durationMs:j}),o.emit("voiceStop",{durationMs:j}),H.current=null,!0},[o]),Be=L(()=>{H.current!==null&&(xe.stop(),k(!1),Se("info")&&n.play("voiceStop"))},[Se,n,xe]),ke=L(()=>{V.current++,xe.cancel(),k(!1),Se("info")&&n.play("voiceStop")},[Se,n,xe]);E(()=>{(c||!l)&&ke()},[l,ke,c]),E(()=>{let U=q.current;if(!U)return;let K=U.getRootNode(),j="activeElement"in K?K.activeElement:null;j&&U.closest(`.${it}-panel`)?.contains(j)||U.focus({preventScroll:!0})},[]),E(()=>{let U=q.current;if(!U)return;if(b.length===0){U.style.height="";return}U.style.height="auto";let K=parseFloat(getComputedStyle(U).fontSize)*.7,j=Math.min(U.scrollHeight,160);U.style.height=`${j<40+K?40:j}px`},[b]);let be=A(P);be.current=P,E(()=>()=>be.current.forEach(er),[]),E(()=>{if(m)return m.current={attachFromDrop:U=>{if(!me||!te.current||z.current||ae.current)return;let K=Zo(U,be.current,e.attachments);K.accepted.length!==0&&(gn.info("attach (drop)",{count:K.accepted.length,totalBytes:vn(K.accepted)}),o.emit("attach",{count:K.accepted.length,totalBytes:vn(K.accepted)}),v(j=>[...j,...K.accepted]))},fill:U=>{if(!te.current||z.current||ae.current)return;Ie(U);let K=q.current;K&&(K.focus({preventScroll:!0}),requestAnimationFrame(()=>K.setSelectionRange(K.value.length,K.value.length)))}},()=>{m.current&&(m.current=null)}},[m,me,c,e.attachments,Ie]),E(()=>{let U=q.current;if(!U)return;let K=U.closest(`.${it}-panel`);if(!K)return;let j=ue=>{if(!te.current||z.current||ae.current)return;let Qe=ue.clipboardData;if(!Qe)return;let S=ue.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(S&&S!==U)return;if(me){let ie=Zo(Qe.items,be.current,e.attachments);if(ie.accepted.length>0){ue.preventDefault(),gn.info("attach (paste)",{count:ie.accepted.length,totalBytes:vn(ie.accepted)}),o.emit("attach",{count:ie.accepted.length,totalBytes:vn(ie.accepted)}),v(ve=>[...ve,...ie.accepted]);return}}if(S===U)return;let X=Qe.getData("text/plain");X&&(ue.preventDefault(),Ie(ie=>ie+X),U.focus())};return K.addEventListener("paste",j),()=>K.removeEventListener("paste",j)},[me,e.attachments,Ie]);let ye=async()=>{let U=b.trim();if(!U&&P.length===0||!l||s||z.current||c)return;ke(),z.current=!0,F(!0);let K=b,j=P;try{await d(U,j)&&(Ie(ue=>ue===K?"":ue),v(ue=>ue!==j?ue:(j.forEach(er),be.current=[],[])))}finally{z.current=!1,F(!1),requestAnimationFrame(()=>{let ue=q.current;if(!ue||ue.disabled||!te.current)return;let Qe=ue.getRootNode(),S=Hp(Qe)?Qe.activeElement:null,X=S?.getAttribute("data-testid");if(!(S&&S!==ue&&X!==R.composerSend&&X!==R.composerStop)){if(Up(Qe)){let ie=Qe.host.ownerDocument;if(!ie.hasFocus())return;let ve=ie.activeElement;if(ve&&ve!==Qe.host&&ve!==ie.body)return}ue.focus({preventScroll:!0})}})}},Ee=U=>{U.key!=="Enter"||U.shiftKey||U.isComposing||(U.preventDefault(),s?f():ye())},Ne=U=>{let K=U.target;if(!l||z.current||c){K.value="";return}let j=Zo(K.files,P,e.attachments);j.accepted.length>0&&(gn.info("attach (file picker)",{count:j.accepted.length,totalBytes:vn(j.accepted)}),o.emit("attach",{count:j.accepted.length,totalBytes:vn(j.accepted)}),v(ue=>[...ue,...j.accepted])),K.value=""},Ae=U=>{!l||z.current||c||(gn.info("removeAttachment",{id:U}),o.emit("removeAttachment",{id:U}),v(K=>{let j=K.find(ue=>ue.id===U);return j&&er(j),K.filter(ue=>ue.id!==U)}))},De=()=>{if(y){Be();return}if(!l||!xe.isSupported||z.current||c)return;let U=++V.current;H.current=Date.now(),gn.info("voiceStart"),o.emit("voiceStart",void 0),k(!0),n.play("voiceStart"),xe.start((K,j)=>{V.current!==U||!te.current||ae.current||z.current||!j||Ie(ue=>`${ue}${K} `)},()=>{V.current!==U||!te.current||(k(!1),Se("debug"))})},ze=Bp[e.composer.sendButton.icon];return a("div",{class:`${it}-composer`,"data-testid":R.composer,children:[P.length>0?a("div",{class:`${it}-attachments`,children:P.map(U=>a(Wl,{attachment:U,onRemove:()=>Ae(U.id),disabled:oe},U.id))}):null,a("div",{class:`${it}-composer-row`,children:[a("div",{class:`${it}-composer-actions`,children:[me?a("button",{type:"button",class:`${it}-icon-btn`,onClick:()=>I.current?.click(),disabled:oe,"aria-label":h.attach,"data-testid":R.composerAttach,children:a(ul,{})}):null,xe.isSupported?a("button",{type:"button",class:`${it}-icon-btn`,onClick:De,disabled:oe,"aria-label":y?h.micStop:h.micStart,"aria-pressed":y,"data-recording":y?"true":void 0,"data-testid":R.composerVoice,children:a(_l,{})}):null,u&&_==="ai-agent"&&p?a("button",{type:"button",class:`${it}-icon-btn`,onClick:p,disabled:oe,"aria-label":h.talkToOperator,title:h.talkToOperator,"data-testid":R.operatorRequest,children:a(ga,{})}):null]}),a("textarea",{ref:q,name:"message",class:`${it}-textarea`,rows:1,value:b,placeholder:h.composerPlaceholder,onInput:U=>Ie(U.currentTarget.value),onKeyDown:Ee,disabled:oe,"aria-label":h.composerPlaceholder,"data-testid":R.composerInput}),s?a("button",{type:"button",class:`${it}-send`,onClick:f,disabled:oe,"aria-label":h.stop,"data-testid":R.composerStop,children:a(dl,{})}):a("button",{type:"button",class:`${it}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:()=>{ye()},disabled:oe||!b.trim()&&P.length===0,"aria-label":h.send,"data-testid":R.composerSend,children:a(ze,{})})]}),a("input",{ref:I,name:"attachments",type:"file",multiple:!0,accept:e.attachments.accept,onChange:Ne,disabled:oe,class:`${it}-sr-only`,"data-testid":R.composerFileInput})]})}var zp=C.cssPrefix;function Kl({visible:e,strings:t}){return e?a("div",{class:`${zp}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function tr({containerRef:e,onDrop:t,disabled:n=!1}){let[o,r]=O(!1);return E(()=>{if(n){r(!1);return}let i=e.current;if(!i)return;let s=0,l=p=>{s+=1,p.dataTransfer?.types.includes("Files")&&(p.preventDefault(),r(!0))},c=()=>{s-=1,!(s>0)&&(s=0,r(!1))},u=p=>{p.dataTransfer?.types.includes("Files")&&p.preventDefault()},_=p=>{s=0,r(!1),p.dataTransfer&&(p.preventDefault(),t(p.dataTransfer.items))};return i.addEventListener("dragenter",l),i.addEventListener("dragleave",c),i.addEventListener("dragover",u),i.addEventListener("drop",_),()=>{i.removeEventListener("dragenter",l),i.removeEventListener("dragleave",c),i.removeEventListener("dragover",u),i.removeEventListener("drop",_)}},[e,n,t]),{visible:n?!1:o}}function jl({itemCount:e,initialFocusIndex:t}){let[n,o]=O(!1),r=A(null),i=A(null),[s,l]=O(-1),c=L(()=>{o(!1),l(-1),r.current?.focus()},[]),u=L(()=>o(d=>!d),[]);E(()=>{if(!n)return;let d=f=>{let m=i.current,h=r.current;if(!m||!h)return;let b=f.composedPath();b.includes(m)||b.includes(h)||(o(!1),l(-1))};return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[n]),E(()=>{if(!n||e===0)return;let d=t?.()??0,f=d<0||d>=e?0:d;l(f)},[n,e,t]),E(()=>{if(!n||s<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[s]?.focus()},[n,s]);let _=L(d=>{(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(d.preventDefault(),o(!0))},[]),p=L(d=>{if(e!==0)switch(d.key){case"Escape":d.preventDefault(),c();return;case"ArrowDown":d.preventDefault(),l(f=>(f+1)%e);return;case"ArrowUp":d.preventDefault(),l(f=>(f-1+e)%e);return;case"Home":d.preventDefault(),l(0);return;case"End":d.preventDefault(),l(e-1)}},[e,c]);return{open:n,focusIndex:s,triggerRef:r,menuRef:i,toggle:u,close:c,onTriggerKey:_,onMenuKey:p}}function Xl({items:e,triggerLabel:t}){let n=C.cssPrefix,o=jl({itemCount:e.length}),r=l=>{l.disabled||(l.onSelect?.(),l.keepOpen||o.close())},i=(l,c)=>l.onSelectValue?.(c),s=(l,c)=>{let u=c.segments;if(!u?.length)return;let _=Math.max(0,u.findIndex(d=>d.value===c.value)),p=-1;if(l.key==="ArrowRight"||l.key==="Enter"||l.key===" ")p=(_+1)%u.length;else if(l.key==="ArrowLeft")p=(_-1+u.length)%u.length;else return;l.preventDefault(),l.stopPropagation(),i(c,u[p].value)};return a("div",{class:`${n}-menu-wrap`,children:[a("button",{ref:o.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":o.open,title:t,onClick:o.toggle,onKeyDown:o.onTriggerKey,children:a(hl,{})}),o.open?a("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(l=>l.segments?a("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":l.label,tabIndex:-1,onKeyDown:c=>s(c,l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),a("span",{class:`${n}-segmented`,role:"group","aria-label":l.label,children:l.segments.map(c=>{let u=c.value===l.value;return a("button",{type:"button",role:"menuitemradio","aria-checked":u,class:`${n}-segment`,"data-on":u?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${R.langSegment}-${c.value}`,onClick:()=>i(l,c.value),children:c.label},c.value)})})]},l.id):a("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":l.type==="switch"?l.on:void 0,disabled:l.disabled,onClick:()=>r(l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),l.type==="switch"&&l.on?a("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:a(jt,{})}):null]},l.id))}):null]})}var Pa=C.cssPrefix;function qp(e){let t=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)").matches:!0;return e==="auto"?t?"light":"dark":t?e==="light"?"dark":"auto":e==="dark"?"light":"auto"}var Vp={normal:"large",large:"small",small:"normal"};function Wp(e){return e==="light"?a(El,{}):e==="dark"?a(Al,{}):a(Ml,{})}function Gp(e){return(e.split("-")[0]??e).toUpperCase()}function ft({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:r,onClose:i,onClear:s,onExpand:l,onFullscreen:c,onSoundToggle:u}=e,{onToggleHistory:_,onLocaleChange:p,onThemeChange:d,onTextSizeChange:f}=e,m=n.strings,h=n.mode,b=t==="chat",x=St(()=>r.mutedSig.value).value,P=new Set(n.actions),v=N=>P.has(N),y=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,k=N=>y?!1:Gn(N,h,o),w=n.themeMode,F={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},z=n.textSize,q={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},I=[];if(b&&v("clear")&&I.push({id:"clear",icon:a(wl,{}),label:m.newConversation,onSelect:s}),v("expand")&&k("expand")){let N=o==="expanded";I.push({id:"expand",icon:N?a(fl,{}):a(pl,{}),label:N?m.collapse:m.expand,type:"switch",on:N,onSelect:l})}if(v("fullscreen")&&k("fullscreen")){let N=o==="fullscreen";I.push({id:"fullscreen",icon:N?a(gl,{}):a(ml,{}),label:N?m.exitFullscreen:m.fullscreen,type:"switch",on:N,onSelect:c})}b&&v("sound")&&I.push({id:"sound",icon:x?a(yl,{}):a(bl,{}),label:x?m.soundOff:m.soundOn,type:"switch",on:!x,onSelect:u}),v("theme")&&I.push({id:"theme",icon:Wp(w),label:`${m.theme}: ${F[w]}`,onSelect:()=>d(qp(w)),keepOpen:!0}),v("textSize")&&I.push({id:"textSize",icon:a(Pl,{}),label:`${m.textSize}: ${q[z]}`,onSelect:()=>f(Vp[z]),keepOpen:!0}),v("language")&&n.availableLocales.length>1&&I.push({id:"language",icon:a(kl,{}),label:m.language,segments:n.availableLocales.map(N=>({value:N,label:Gp(N),lang:N})),value:n.locale,onSelectValue:p});let H=!!i&&Yo(h,o,n.actions),V=b&&v("history");return a("div",{class:`${Pa}-header-actions`,children:[V?a("button",{type:"button",class:`${Pa}-icon-btn`,onClick:_,"aria-label":m.history,title:m.history,"data-testid":R.actionHistory,children:a(Sl,{})}):null,I.length>0?a(Xl,{items:I,triggerLabel:m.moreActions}):null,H?a("button",{type:"button",class:`${Pa}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":R.actionClose,children:a(pt,{})}):null]})}var Kp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,jp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,Xp=/^[+]?[\d\s().-]{6,}$/;function hn(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function Yp(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function Jp(e,t,n){let o=e.required??!0,r=e.validation;if(e.type==="multiselect"){let s=Yp(t);return o&&s===0?n.formRequired:s===0?void 0:r?.minSelections!=null&&s<r.minSelections?hn(n.formChooseAtLeast,{min:r.minSelections}):r?.maxSelections!=null&&s>r.maxSelections?hn(n.formChooseAtMost,{max:r.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return o?n.formRequired:void 0;switch(e.type){case"email":if(!Kp.test(i))return n.formInvalidEmail;break;case"url":if(!jp.test(i))return n.formInvalidUrl;break;case"tel":if(!Xp.test(i))return n.formInvalidTel;break;case"number":{let s=Number(i);if(!Number.isFinite(s))return n.formInvalidNumber;if(r?.min!=null&&s<r.min)return hn(n.formNumberTooSmall,{min:r.min});if(r?.max!=null&&s>r.max)return hn(n.formNumberTooLarge,{max:r.max});break}default:break}if(r?.minLength!=null&&i.length<r.minLength)return hn(n.formTooShort,{min:r.minLength});if(r?.maxLength!=null&&i.length>r.maxLength)return hn(n.formTooLong,{max:r.maxLength});if(r?.pattern)try{if(!new RegExp(r.pattern).test(i))return n.formPatternMismatch}catch{}}function Yl(e,t,n){let o={};for(let r of e){let i=Jp(r,t[r.name],n);i&&(o[r.name]=i)}return o}function Jl(e){let t={};for(let[n,o]of Object.entries(e)){let r=Array.isArray(o)?o.join(", "):o;r&&r.trim()&&(t[n]=r.trim())}return t}var we=C.cssPrefix,nr="__other__";function jn({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:r,onSkip:i,footerHint:s,submitOnEnter:l,disabled:c,initialValues:u,hideActions:_,fieldTypeLabels:p,rootTestId:d,submitTestId:f,skipTestId:m}){let[h,b]=O(()=>({...tf(e),...u})),[x,P]=O({}),[v,y]=O({}),k=I=>{v[I]&&y(H=>({...H,[I]:""}))},w=(I,H)=>{b(V=>({...V,[I]:H})),k(I)},F=(I,H)=>{P(V=>({...V,[I]:H})),k(I)},z=I=>{if(I.preventDefault(),c)return;let H=nf(e,h,x),V=Yl(e,H,t);if(Object.keys(V).length>0){y(V);return}o(Jl(H))},q=I=>{!l||I.key!=="Enter"||I.shiftKey||I.isComposing||I.target?.tagName==="TEXTAREA"&&z(I)};return a("form",{class:`${we}-form`,onSubmit:z,onKeyDown:q,"data-testid":d,noValidate:!0,children:[e.map(I=>a(Qp,{field:I,value:h[I.name],otherText:x[I.name]??"",error:v[I.name],disabled:c,typeLabel:p?.[I.name],strings:t,onChange:H=>w(I.name,H),onOtherChange:H=>F(I.name,H)},I.name)),_?null:a("div",{class:`${we}-form-actions`,children:[s?a("span",{class:`${we}-form-hint`,children:s}):null,r&&i?a("button",{type:"button",class:`${we}-form-skip`,onClick:i,disabled:c,"data-testid":m,children:r}):null,a("button",{type:"submit",class:`${we}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function Qp({field:e,value:t,otherText:n,error:o,disabled:r,typeLabel:i,strings:s,onChange:l,onOtherChange:c}){let u=We(R.formField,e.name),_=Zp({field:e,value:t,otherText:n,disabled:r,strings:s,onChange:l,onOtherChange:c,fieldTid:u});return a("label",{class:`${we}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[a("span",{class:`${we}-field-head`,children:[a("span",{class:`${we}-field-label`,children:[e.label,e.required??!0?a("span",{class:`${we}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?a("span",{class:`${we}-field-type`,children:i}):null]}),_,e.validationHint&&!o?a("span",{class:`${we}-field-hint`,children:e.validationHint}):null,o?a("span",{class:`${we}-field-error`,role:"alert",children:o}):null]})}function Zp(e){let{field:t,value:n,otherText:o,disabled:r,strings:i,onChange:s,onOtherChange:l,fieldTid:c}=e,u=typeof n=="string"?n:"";switch(t.type){case"textarea":return a("textarea",{class:`${we}-field-input`,rows:3,value:u,placeholder:t.placeholder,disabled:r,onInput:_=>s(_.target.value),"data-testid":c});case"select":return a("select",{class:`${we}-field-input`,value:u,disabled:r,onChange:_=>s(_.target.value),"data-testid":c,children:[a("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(_=>a("option",{value:_.value,children:_.label??_.value},_.value))]});case"radio":{let _=t.allowOther&&u===nr;return a("div",{class:`${we}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(p=>a("label",{class:`${we}-choice`,children:[a("input",{type:"radio",name:`${we}-${t.name}`,checked:u===p.value,disabled:r,onChange:()=>s(p.value)}),a("span",{children:p.label??p.value})]},p.value)),t.allowOther?a("label",{class:`${we}-choice`,children:[a("input",{type:"radio",name:`${we}-${t.name}`,checked:u===nr,disabled:r,onChange:()=>s(nr)}),a("span",{children:i.formOther})]}):null,_?a("input",{class:`${we}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:r,onInput:p=>l(p.target.value)}):null]})}case"checkbox":return a("label",{class:`${we}-choice`,children:[a("input",{type:"checkbox",checked:u==="true",disabled:r,onChange:_=>s(_.target.checked?"true":""),"data-testid":c}),a("span",{children:t.placeholder??t.label})]});case"multiselect":{let _=Array.isArray(n)?n:[],p=(d,f)=>s(f?[..._,d]:_.filter(m=>m!==d));return a("div",{class:`${we}-field-choices`,"data-testid":c,children:[(t.options??[]).map(d=>a("label",{class:`${we}-choice`,children:[a("input",{type:"checkbox",checked:_.includes(d.value),disabled:r,onChange:f=>p(d.value,f.target.checked)}),a("span",{children:d.label??d.value})]},d.value)),t.allowOther||(t.options??[]).length===0?a("textarea",{class:`${we}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:r,onInput:d=>l(d.target.value)}):null]})}default:return a("input",{class:`${we}-field-input`,type:ef(t.type),value:u,placeholder:t.placeholder,disabled:r,onInput:_=>s(_.target.value),"data-testid":c})}}function ef(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function tf(e){let t={};for(let n of e)n.defaultValue!=null&&(t[n.name]=n.type==="multiselect"?n.defaultValue.split(",").map(o=>o.trim()).filter(Boolean):n.defaultValue);return t}function nf(e,t,n){let o={...t};for(let r of e){let i=n[r.name]?.trim();if(r.type==="radio"&&r.allowOther&&t[r.name]===nr)o[r.name]=i??"";else if(r.type==="multiselect"&&i){let s=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),l=Array.isArray(t[r.name])?t[r.name]:[];o[r.name]=[...l,...s]}}return o}var mt=C.cssPrefix;function xa({form:e,strings:t,onSubmit:n,onSkip:o}){return a("div",{class:`${mt}-form-gate`,"data-testid":R.formGate,children:[e.title?a("h3",{class:`${mt}-form-gate-title`,children:e.title}):null,e.description?a("p",{class:`${mt}-form-gate-desc`,children:e.description}):null,a(jn,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?o:void 0,submitTestId:R.formSubmit,skipTestId:R.formSkip})]})}function Ql({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",r=o?t.formSkipped:t.formSubmitted,i=e.title?a(le,{children:[a("span",{children:e.title}),a("span",{class:`${mt}-sr-only`,children:r})]}):a("span",{children:r}),s=e.form?.reviewable??!1,l=!o&&s&&e.values&&Object.keys(e.values).length>0?e.values:null;if(l){let c=u=>e.form?.fields.find(_=>_.name===u)?.label??u;return a("details",{class:`${mt}-form-done`,"data-outcome":e.outcome,"data-testid":R.formDone,children:[a("summary",{class:`${mt}-form-done-summary`,"data-testid":R.formDoneToggle,children:[a(jt,{}),i,a(mn,{})]}),a("dl",{class:`${mt}-form-answers`,"data-testid":R.formAnswers,children:Object.entries(l).map(([u,_])=>a("div",{class:`${mt}-form-answer`,children:[a("dt",{children:c(u)}),a("dd",{children:_})]},u))})]})}return a("div",{class:`${mt}-form-done`,"data-outcome":e.outcome,"data-testid":R.formDone,role:"status",children:[o?a(xl,{}):a(jt,{}),i,o&&e.form?.reopenable&&n?a("button",{type:"button",class:`${mt}-form-done-fill`,"data-testid":R.formFill,onClick:n,children:t.formFillOut}):null]})}function af(e,t){for(var n in t)e[n]=t[n];return e}function ka(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function Zl(e,t){this.props=e,this.context=t}function sc(e,t){function n(r){var i=this.props.ref;return i!=r.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,r)||i!=r.ref:ka(this.props,r)}function o(r){return this.shouldComponentUpdate=n,bt(e,r)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=e,o}(Zl.prototype=new et).isPureReactComponent=!0,Zl.prototype.shouldComponentUpdate=function(e,t){return ka(this.props,e)||ka(this.state,t)};var ec=Y.__b;Y.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ec&&ec(e)};var Hb=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var sf=Y.__e;Y.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k||[]),r.__c(e,t)}sf(e,t,n,o)};var tc=Y.unmount;function lc(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=af({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return lc(o,t,n)})),e}function cc(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return cc(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Sa(){this.__u=0,this.o=null,this.__b=null}function dc(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function or(){this.i=null,this.l=null}Y.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),tc&&tc(e)},(Sa.prototype=new et).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=dc(o.__v),i=!1,s=function(){i||o.__z||(i=!0,n.__R=null,r?r(c):c())};n.__R=s;var l=n.__P;n.__P=null;var c=function(){if(!--o.__u){if(o.state.__a){var u=o.state.__a;o.__v.__k[0]=cc(u,u.__c.__P,u.__c.__O)}var _;for(o.setState({__a:o.__b=null});_=o.o.pop();)_.__P=l,_.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(s,s)},Sa.prototype.componentWillUnmount=function(){this.o=[]},Sa.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=lc(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&bt(le,null,e.fallback);return r&&(r.__u&=-33),[bt(le,null,t.__a?null:e.children),r]};var nc=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(or.prototype=new et).__a=function(e){var t=this,n=dc(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),nc(t,e,o)):r()};n?n(i):i()}},or.prototype.render=function(e){this.i=null,this.l=new Map;var t=An(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},or.prototype.componentDidUpdate=or.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){nc(e,n,t)})};var lf=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,cf=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,df=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,uf=/[A-Z0-9]/g,_f=typeof document<"u",pf=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};et.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(et.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var oc=Y.event;Y.event=function(e){return oc&&(e=oc(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var uc,ff={configurable:!0,get:function(){return this.class}},rc=Y.vnode;Y.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,o=t.type,r={},i=o.indexOf("-")==-1;for(var s in n){var l=n[s];if(!(s==="value"&&"defaultValue"in n&&l==null||_f&&s==="children"&&o==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||o!=="input"&&o!=="textarea"||pf(n.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":df.test(s)&&(s=c):c=s="oninput":i&&cf.test(s)?s=s.replace(uf,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&r[s=c]&&(s="oninputCapture"),r[s]=l}}o=="select"&&(r.multiple&&Array.isArray(r.value)&&(r.value=An(n.children).forEach(function(u){u.props.selected=r.value.indexOf(u.props.value)!=-1})),r.defaultValue!=null&&(r.value=An(n.children).forEach(function(u){u.props.selected=r.multiple?r.defaultValue.indexOf(u.props.value)!=-1:r.defaultValue==u.props.value}))),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",ff)):n.className&&(r.class=r.className=n.className),t.props=r})(e),e.$$typeof=lf,rc&&rc(e)};var ac=Y.__r;Y.__r=function(e){ac&&ac(e),uc=e.__c};var ic=Y.diffed;Y.diffed=function(e){ic&&ic(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),uc=null};function rr(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var st=C.cssPrefix;function Ca(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function ar(e,t){let n=e==="output-available"||e==="output-error"||e==="output-denied",o=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:o,decided:n||o}}function Ra({status:e,icon:t,label:n}){return a("span",{class:`${st}-toolui-badge ${st}-toolui-status`,"data-status":e,children:[a("span",{class:`${st}-toolui-status-icon`,children:t}),n]})}function mf(e,t){return e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function Ta(e,t,n={}){return n.submitted?"responded":hf(mf(e,t),n.superseded,n.live??!0)}function gf({status:e}){return e==="denied"||e==="error"||e==="superseded"?a(Go,{}):e==="completed"||e==="responded"?a(Wo,{}):a($l,{})}function vf(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;default:return t.statusRunning}}function hf(e,t,n){return t&&(e==="awaiting"||e==="running")?"superseded":!n&&e==="running"?"error":e}function bf({state:e,approval:t,strings:n,superseded:o,live:r=!0,submitted:i=!1}){let s=Ta(e,t,{superseded:o,live:r,submitted:i});return a(Ra,{status:s,icon:a(gf,{status:s}),label:vf(s,n)})}function yf({name:e,state:t,approval:n,strings:o,superseded:r,live:i,submitted:s}){return a(le,{children:[a("span",{class:`${st}-toolui-name-pill`,children:[a(Dl,{}),a("span",{class:`${st}-toolui-name-text`,children:e})]}),a(bf,{state:t,approval:n,strings:o,superseded:r,live:i,submitted:s}),a("span",{class:`${st}-toolui-chevron`,children:a(Xt,{})})]})}function ir({part:e,strings:t,testid:n,superseded:o,live:r,submitted:i}){let s=Z(()=>_e(()=>e.inputSig.value),[e]),l=Z(()=>_e(()=>e.outputSig.value),[e]),c=Z(()=>_e(()=>e.errorSig.value),[e]),u=Z(()=>_e(()=>e.stateSig.value),[e]),_=Z(()=>_e(()=>e.approvalSig.value),[e]);return a("details",{class:`${st}-toolui ${st}-toolui-collapsible`,"data-testid":n,children:[a("summary",{class:`${st}-toolui-head`,children:a(yf,{name:Ca(e.toolName),state:u.value,approval:_.value,strings:t,superseded:o,live:r,submitted:i})}),a(wa,{label:t.toolParameters,value:s.value}),l.value!==void 0?a(wa,{label:t.toolResult,value:l.value}):null,c.value?a(wa,{label:t.statusError,value:c.value,error:!0}):null]})}function wa({label:e,value:t,error:n}){let o=n?String(t??""):sr(Ia(t));return o?a("div",{class:`${st}-toolui-section`,children:[a("span",{class:`${st}-toolui-label`,children:e}),a("pre",{class:`${st}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function Ia(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function sr(e){if(e==null)return"";try{let t=typeof e=="string"?e:JSON.stringify(e,null,2);return!t||t==="{}"||t==="[]"||t==='""'?"":t.length>800?`${t.slice(0,800)}\u2026`:t}catch{return""}}function _c(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function pc(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function Pf(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function fc(e){let{streaming:t,reasoningVisible:n,emptyReply:o,hidden:r}=e,i=e.responseMode==="buffered"&&t,s=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:i,reasoningVisible:n,working:s,showStreamDots:Pf({streaming:t,bufferedHold:i,reasoningVisible:n,working:s}),emptyReply:o,hidden:r}}function mc(e,t){let n=e.stateSig.value,o=e.approvalSig.value,{terminal:r,responded:i,decided:s}=ar(n,o),l=t.continuationStreaming===!0&&!s,c=t.superseded&&!s&&!l;return{pill:Ta(n,o,{superseded:c,live:t.live,submitted:l}),state:n,terminal:r,decided:s||l,showApproveReject:!s&&!t.superseded&&!l,showAnswered:i&&!r&&!c,showSubmitted:l,showEdit:i&&t.active&&!r,skipped:c,answeredApproved:o?.approved}}var Ma=1,vc=2,hc=4,bc=8,yc=16;function xf(e){switch(e){case Ma:return"href";case vc:return"src";case hc:return"class";case bc:return"checked";case yc:return"start"}}var Sf=e=>{switch(e){case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;case 5:return 7;default:return 8}},kf=Sf;var gc=24;function Oa(e){let t=new Uint32Array(gc);return t[0]=1,{renderer:e,text:"",pending:"",tokens:t,len:0,token:1,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(gc),indent:"",indent_len:0,table_state:0}}function Pc(e){e.pending.length>0&&Xe(e,`
|
|
12
|
+
`)}function pe(e){e.text.length!==0&&(console.assert(e.len>0,"Never adding text to root"),e.renderer.add_text(e.renderer.data,e.text),e.text="")}function Oe(e){console.assert(e.len>0,"No nodes to end"),e.len-=1,e.token=e.tokens[e.len],e.renderer.end_token(e.renderer.data)}function fe(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&Oe(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function wf(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function Jt(e,t){for(e.fence_start=0;e.len>t;)Oe(e)}function lr(e,t){let n=0;for(let o=0;o<=e.len&&(t-=e.spaces[o],!(t<0));o+=1)switch(e.tokens[o]){case 9:case 10:case 20:case 25:n=o;break}for(;e.len>n;)Oe(e);return t}function Ea(e,t){let n=-1,o=-1;for(let r=e.blockquote_idx+1;r<=e.len;r+=1)if(e.tokens[r]===25){if(e.indent_len<e.spaces[r]){o=-1;break}o=r}else e.tokens[r]===t&&(n=r);return o===-1?n===-1?(Jt(e,e.blockquote_idx),fe(e,t),!0):(Jt(e,n),!1):(Jt(e,o),fe(e,t),!0)}function Aa(e,t){fe(e,25),e.spaces[e.len]=e.indent_len+t,wt(e),e.token=103}function wt(e){e.indent="",e.indent_len=0,e.pending=""}function La(e){switch(e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return!0;default:return!1}}function Cf(e){switch(e){case 32:case 58:case 59:case 41:case 44:case 33:case 46:case 63:case 93:case 10:return!0;default:return!1}}function Rf(e){return La(e)||Cf(e)}function Xe(e,t){for(let n of t){if(e.token===101){switch(n){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let r=lr(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],r>0&&Xe(e," ".repeat(r))}let o=e.pending+n;switch(e.token){case 21:case 1:case 20:case 24:case 23:switch(console.assert(e.text.length===0,"Root should not have any text"),e.pending[0]){case void 0:e.pending=n;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=4;continue;case`
|
|
13
|
+
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){Oe(e),wt(e),e.pending=n;continue}Jt(e,e.blockquote_idx),wt(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=o;continue}break;case" ":lr(e,e.indent_len),fe(e,kf(e.pending.length)),wt(e);continue}break;case">":{let i=wf(e,20,e.blockquote_idx+1);i===-1?(Jt(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,fe(e,20)):e.blockquote_idx=i,wt(e),e.pending=n;continue}case"-":case"*":case"_":if(e.hr_chars===0&&(console.assert(e.pending.length===1,"Pending should be one character"),e.hr_chars=1,e.hr_char=e.pending),e.hr_chars>0){switch(n){case e.hr_char:e.hr_chars+=1,e.pending=o;continue;case" ":e.pending=o;continue;case`
|
|
14
|
+
`:if(e.hr_chars<3)break;lr(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),wt(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){Ea(e,23),Aa(e,2),Xe(e,o.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=o,e.fence_start=o.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=o,e.fence_start=o.length):(fe(e,2),wt(e),e.fence_start=0,Xe(e,o));continue;case`
|
|
15
|
+
`:{lr(e,e.indent_len),fe(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,hc,e.pending.slice(e.fence_start)),wt(e),e.token=101;continue}default:e.pending=o;continue}case"+":if(n!==" ")break;Ea(e,23),Aa(e,2);continue;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":if(e.pending[e.pending.length-1]==="."){if(n!==" ")break;Ea(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,yc,e.pending.slice(0,-1)),Aa(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||La(i)){e.pending=o;continue}}break;case"|":Jt(e,e.blockquote_idx),fe(e,27),fe(e,28),e.pending="",Xe(e,n);continue}let r=o;if(e.token===21)e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data);else if(e.indent_len>=4){let i=0;for(;i<4;i+=1)if(e.indent[i]===" "){i=i+1;break}r=e.indent.slice(i)+o,fe(e,9)}else fe(e,2);wt(e),Xe(e,r);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=o;continue;case`
|
|
16
|
+
`:e.table_state=2,e.pending="";continue;default:Oe(e),e.table_state=0;break}else switch(e.pending){case"|":fe(e,28),e.pending="",Xe(e,n);continue;case`
|
|
17
|
+
`:Oe(e),e.pending="",e.table_state=0,Xe(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":fe(e,29),Oe(e),e.pending="",Xe(e,n);continue;case`
|
|
18
|
+
`:Oe(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Xe(e,n);continue;default:fe(e,29),Xe(e,n);continue}break;case 29:if(e.pending==="|"){pe(e),Oe(e),e.pending="",Xe(e,n);continue}break;case 9:switch(o){case`
|
|
19
19
|
`:case`
|
|
20
20
|
`:case`
|
|
21
21
|
`:case`
|
|
@@ -25,18 +25,18 @@ ${o}`:o;continue}r.startsWith("id:")&&(n=r.slice(3).trim())}if(t==="[DONE]")retu
|
|
|
25
25
|
`:case`
|
|
26
26
|
`:case`
|
|
27
27
|
`:case`
|
|
28
|
-
`:e.pending=
|
|
29
|
-
`:if(
|
|
30
|
-
`){e.pending=
|
|
31
|
-
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,
|
|
32
|
-
`?(
|
|
33
|
-
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,
|
|
34
|
-
`:e.pending=n;continue;default:let
|
|
35
|
-
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:
|
|
36
|
-
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let
|
|
37
|
-
`){
|
|
38
|
-
`){
|
|
39
|
-
`){ue(e),pe(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=r;continue}else{if(gf(n.charCodeAt(0)))break;ue(e),pe(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){ue(e),pe(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){ue(e),pe(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}ue(e)}function wa(e){return{add_token:vf,end_token:hf,add_text:bf,set_attr:yf,data:{nodes:[e,,,,,],index:0}}}function vf(e,t){let n=e.nodes[e.index],r;switch(t){case 1:return;case 20:r=document.createElement("blockquote");break;case 2:r=document.createElement("p");break;case 21:r=document.createElement("br");break;case 22:r=document.createElement("hr");break;case 3:r=document.createElement("h1");break;case 4:r=document.createElement("h2");break;case 5:r=document.createElement("h3");break;case 6:r=document.createElement("h4");break;case 7:r=document.createElement("h5");break;case 8:r=document.createElement("h6");break;case 12:case 13:r=document.createElement("em");break;case 14:case 15:r=document.createElement("strong");break;case 16:r=document.createElement("s");break;case 11:r=document.createElement("code");break;case 18:case 17:r=document.createElement("a");break;case 19:r=document.createElement("img");break;case 23:r=document.createElement("ul");break;case 24:r=document.createElement("ol");break;case 25:r=document.createElement("li");break;case 26:let o=r=document.createElement("input");o.type="checkbox",o.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),r=document.createElement("code");break;case 27:r=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}r=document.createElement("tr");break;case 29:r=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:r=document.createElement("equation-block");break;case 31:r=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(r)}function hf(e){e.index-=1}function bf(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function yf(e,t,n){e.nodes[e.index].setAttribute(uf(t),n)}function Zr({textSig:e,doneSig:t}){let n=B(null);return ot(()=>{let r=n.current;if(!r)return;r.classList.add(`${w.cssPrefix}-md`);let o=wa(r),i=ka(o),s=0,l=mt(()=>{let p=e.value,_=t.value;p.length<s&&(r.replaceChildren(),o=wa(r),i=ka(o),s=0);let d=p.slice(s);d&&Fe(i,d),s=p.length,_&&pc(i)}),c=new MutationObserver(p=>{for(let _ of p)for(let d of _.addedNodes){if(!(d instanceof HTMLElement))continue;let f=d.matches?.("a")?[d]:[...d.querySelectorAll?.("a")??[]];for(let m of f)fc(m)}});c.observe(r,{childList:!0,subtree:!0});for(let p of r.querySelectorAll("a"))fc(p);let u=p=>{let _=p.target?.closest?.("a");if(!_||!(_ instanceof HTMLAnchorElement))return;let d=_.getAttribute("href")??"";!d||d.startsWith("#")||(p.preventDefault(),window.open(d,"_blank","noopener,noreferrer"))};return r.addEventListener("click",u),()=>{l(),c.disconnect(),r.removeEventListener("click",u)}},[e,t]),a("div",{ref:n})}function mc({text:e}){let t=Q(()=>X(e),[e]),n=Q(()=>X(!0),[]);return a(Zr,{textSig:t,doneSig:n})}function fc(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var eo=w.cssPrefix;function gc({messageId:e,initial:t,strings:n,onFeedback:r}){let[o,i]=$(t);M(()=>i(t),[e,t]);let s=l=>{let c=o===l?null:l;i(c),r(e,c)};return a("div",{class:`${eo}-feedback`,role:"group","data-testid":R.messageFeedback,children:[a("button",{type:"button",class:`${eo}-msg-action`,"data-active":o==="up"?"true":void 0,"aria-pressed":o==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>s("up"),"data-testid":R.feedbackUp,children:a(Cl,{})}),a("button",{type:"button",class:`${eo}-msg-action`,"data-active":o==="down"?"true":void 0,"aria-pressed":o==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>s("down"),"data-testid":R.feedbackDown,children:a(Rl,{})}),a("span",{class:`${eo}-sr-only`,role:"status","aria-live":"polite",children:o?n.feedbackThanks:""})]})}var _n=w.cssPrefix;function vc({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?a("a",{class:`${_n}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":R.source,children:[a("span",{class:`${_n}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),a("span",{class:`${_n}-source-label`,children:n})]}):a("span",{class:`${_n}-source`,"data-testid":R.source,children:[a("span",{class:`${_n}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),a("span",{class:`${_n}-source-label`,children:n})]})}var Je=w.cssPrefix;function hc({part:e,strings:t,active:n,superseded:r=!1,continuationStreaming:o=!1,onDecision:i,onEdit:s}){let l=Q(()=>de(()=>e.approvalSig.value),[e]),c=Q(()=>de(()=>sc(e,{active:n,superseded:r,continuationStreaming:o})),[e,n,r,o]).value,{terminal:u,showApproveReject:p,showAnswered:_,showSubmitted:d,showEdit:f,skipped:m}=c,P=ga(e.toolName),v=c.answeredApproved,g=e.toolCallId,k=a(le,{children:[a("p",{class:`${Je}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",P)}),a("p",{class:`${Je}-toolui-subtle`,children:t.approvalBody})]});d?k=a("p",{class:`${Je}-toolui-subtle`,children:t.approvalSubmitting}):_&&v!==!1?k=a(le,{children:[a("p",{class:`${Je}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",v?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),f?a("p",{class:`${Je}-toolui-subtle`,children:t.approvalEditHint}):null,f?null:a("p",{class:`${Je}-toolui-subtle`,children:t.approvalSubmitting})]}):_&&(k=a(le,{}));let h=p||d||f||_&&v!==!1;return a("div",{class:`${Je}-toolui-group`,"data-testid":c.decided?R.toolDecision:R.toolApproval,children:[a(Yr,{part:e,strings:t,superseded:m,submitted:d}),m||u||!h?null:a("div",{class:`${Je}-toolui ${Je}-toolui-body`,children:[k,p?a("div",{class:`${Je}-toolui-actions`,children:[a("button",{type:"button",class:`${Je}-form-skip`,disabled:!n,onClick:()=>i(g,!1),"data-testid":R.toolReject,children:t.reject}),a("button",{type:"button",class:`${Je}-form-submit`,disabled:!n,onClick:()=>i(g,!0),"data-testid":R.toolApprove,children:t.approve})]}):null,f?a("div",{class:`${Je}-toolui-actions`,children:a("button",{type:"button",class:`${Je}-form-skip`,onClick:()=>s(g),"data-testid":R.toolEdit,children:t.edit})}):null]})]})}var xf=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function bc(e){let t=e&&typeof e=="object"?e:{},r=(Array.isArray(t.questions)?t.questions:[]).map(Sf).filter(o=>o!==null);return{intro:to(t.intro),questions:r}}function Sf(e,t){if(!e||typeof e!="object")return null;let n=e,r=xf.has(n.type)?n.type:"text";return{key:to(n.key)??`q${t+1}`,question:to(n.question)??"Please provide the missing information.",type:r,options:Array.isArray(n.options)?n.options.filter(o=>typeof o=="string"&&o.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:to(n.helpText)}}function kf(e){switch(e){case"text":return"textarea";case"phone":return"tel";case"single-select":case"boolean":return"radio";case"multi-select":return"multiselect";default:return e}}function Ca(e,t,n){return e.questions.map(r=>{let o=kf(r.type),i=r.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(r.options??[]).map(s=>({value:s,label:s}));return{name:r.key,label:r.question,type:o,required:r.required??!1,options:i.length>0?i:void 0,validationHint:r.helpText}})}function to(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var Ie=w.cssPrefix,wf={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function yc(e,t){let n={};for(let r of e)n[r.key]=t[wf[r.type]];return n}function Pc({part:e,strings:t,active:n,superseded:r=!1,continuationStreaming:o=!1,onDecision:i,onEdit:s}){let l=Q(()=>de(()=>e.stateSig.value),[e]).value,c=Q(()=>de(()=>e.approvalSig.value),[e]).value,u=Q(()=>de(()=>bc(e.inputSig.value)),[e]).value,{terminal:p,decided:_}=Xr(l,c),d=_&&c?.approved===!0,f=o&&!_,m=!_&&!r&&!f,P=!m&&!d&&!f,v=d&&n&&!p,g=u.questions,[k,h]=$(null),C=k??(m||d||f),[I,z]=$(!1),K=g.length>1?oa:On,W=m?t.inputRequired:t.inputBadge,L=f?a("p",{class:`${Ie}-toolui-subtle`,children:t.approvalSubmitting}):m?a(Cf,{req:u,strings:t,active:n,resolve:(A,ae)=>i(e.toolCallId,ae,A)}):I?a(Fn,{fields:Ca(u,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:yc(g,t),initialValues:d?Af(g,c?.reason):void 0}):a(Rf,{questions:g,answers:d?Ef(c?.reason):{},strings:t}),F="completed",V=t.inputAnswered;return P?(F="superseded",V=t.inputSkipped):f&&(F="responded",V=t.statusResponded),a("details",{class:`${Ie}-toolui ${Ie}-toolui-collapsible${r?` ${Ie}-toolui-stale`:""}`,open:C,onToggle:A=>{let ae=A.currentTarget.open;ae!==C&&h(ae)},"data-testid":m?R.toolAskQuestions:R.toolDecision,children:[a("summary",{class:`${Ie}-toolui-head`,children:[a("span",{class:`${Ie}-toolui-q-pill`,children:[a(K,{}),W]}),a("span",{class:`${Ie}-toolui-head-end`,children:[m?null:a(va,{status:F,icon:P?a(Dr,{}):a(Nr,{}),label:V}),a("span",{class:`${Ie}-toolui-chevron`,children:a(Ht,{})})]})]}),a("div",{class:`${Ie}-toolui-collapse-body`,children:[u.intro?a("div",{class:`${Ie}-toolui-desc`,children:u.intro}):null,L,m||f?null:a("div",{class:`${Ie}-toolui-footer`,children:[a("button",{type:"button",class:`${Ie}-toolui-options-toggle`,onClick:()=>z(A=>!A),"data-testid":R.toolAskOptions,children:[a("span",{class:`${Ie}-toolui-options-chevron${I?` ${Ie}-open`:""}`,children:a(Ht,{})}),I?t.hideOptions:t.showOptions]}),v?a("button",{type:"button",class:`${Ie}-form-skip`,onClick:()=>s(e.toolCallId),"data-testid":R.toolEdit,children:t.edit}):null]})]})]})}function Cf({req:e,strings:t,active:n,resolve:r}){let o=Ca(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return a(Fn,{fields:o,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:s=>r(If(e.questions,s),!0),skipLabel:t.inputSkip,onSkip:()=>r(void 0,!1),submitOnEnter:i,fieldTypeLabels:yc(e.questions,t),submitTestId:R.toolInputSubmit,skipTestId:R.toolInputSkip})}function Rf({questions:e,answers:t,strings:n}){return a("div",{class:`${Ie}-toolui-summary`,"data-testid":R.toolAskSummary,children:e.map(r=>a("div",{class:`${Ie}-field`,children:[a("span",{class:`${Ie}-field-head`,children:a("span",{class:`${Ie}-field-label`,children:[r.question,r.required?a("span",{class:`${Ie}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),a("p",{class:`${Ie}-toolui-answer`,children:Tf(r,t[r.key],n)||"\u2014"})]},r.key))})}function Tf(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function If(e,t){let n=e.flatMap(r=>{let o=t[r.key];if(o==null||o.trim()==="")return[];let i=r.type==="multi-select"?o.split(",").map(s=>s.trim()).filter(Boolean):o;return[{key:r.key,value:i}]});return JSON.stringify({answers:n})}function xc(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let r={};for(let o of n)if(o&&typeof o=="object"&&"key"in o){let{key:i,value:s}=o;if(typeof i!="string")continue;typeof s=="string"?r[i]=s:Array.isArray(s)&&(r[i]=s.filter(l=>typeof l=="string"))}return r}function Ef(e){let t=xc(e),n={};for(let[r,o]of Object.entries(t))n[r]=Array.isArray(o)?o.join(", "):o;return n}function Af(e,t){let n=xc(t),r={};for(let o of e){let i=n[o.key];i!==void 0&&(o.type==="multi-select"?r[o.key]=Array.isArray(i)?i:[i]:r[o.key]=Array.isArray(i)?i[0]??"":i)}return r}function Sc({part:e,strings:t,live:n}){let r=Q(()=>de(()=>e.inputSig.value),[e]),o=Q(()=>de(()=>e.outputSig.value),[e]),i=Q(()=>de(()=>e.errorSig.value),[e]);return Q(()=>de(()=>!!Jr(r.value)||!!i.value||!!Jr(ba(o.value))),[r,o,i]).value?a(Yr,{part:e,strings:t,testid:R.toolCall,live:n}):null}var Oe=w.cssPrefix,kc=Zl(Mf);function Mf({message:e,status:t,strings:n,responseMode:r,showReasoning:o,showToolCalls:i,showSources:s,interactive:l=!1,superseded:c=!1,tool:u,onRetry:p,enableMessageFeedback:_=!1,onFeedback:d}){let m=Q(()=>de(()=>e.partsSig.value),[e]).value,P=Q(()=>de(()=>Dt(e)),[e]),v=Q(()=>de(()=>Ws(e)),[e]),g=Q(()=>de(()=>oc(e)),[e]),k=Q(()=>de(()=>o&&ac(e)),[e,o]),h=t==="streaming",x=e.role==="assistant"&&h,C=ic({streaming:x,responseMode:r,reasoningVisible:k.value,hasAnswerText:g.value,emptyReply:P.value,hidden:v.value}),{bufferedHold:I,working:z,showStreamDots:K}=C;if(C.hidden)return null;let W=Of(e.createdAt),L=e.role==="assistant"||e.role==="operator",F=_&&!!d&&!!e.serverMessageId&&L&&!h&&t!=="error"&&!P.value,V=h?"":m.filter(ce=>ce.kind==="text").map(ce=>ce.textSig.peek()).join(`
|
|
28
|
+
`:e.pending=o;continue;default:e.pending.length!==0?(pe(e),Oe(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=o;continue;case`
|
|
29
|
+
`:if(o.length===e.fence_start+e.fence_end+1){pe(e),Oe(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
|
|
30
|
+
`){e.pending=o,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case 11:switch(n){case"`":o.length===e.fence_start+ +(e.pending[0]===" ")?(pe(e),Oe(e),e.pending="",e.fence_start=0):e.pending=o;continue;case`
|
|
31
|
+
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,pe(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=o,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=o;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=o;continue;case 2:if(n!=="]")break;e.pending=o;continue;case 3:if(n!==" ")break;e.renderer.add_token(e.renderer.data,26),e.pending[1]==="x"&&e.renderer.set_attr(e.renderer.data,bc,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Xe(e,o);continue;case 14:case 15:{let i="*",s=12;if(e.token===15&&(i="_",s=13),i===e.pending){if(pe(e),i===n){Oe(e),e.pending="";continue}fe(e,s),e.pending=n;continue}break}case 12:case 13:{let i="*",s=14;switch(e.token===13&&(i="_",s=15),e.pending){case i:i===n?e.tokens[e.len-1]===s?e.pending=o:(pe(e),fe(e,s),e.pending=""):(pe(e),Oe(e),e.pending=n);continue;case i+i:let l=e.token;pe(e),Oe(e),Oe(e),i!==n?(fe(e,l),e.pending=n):e.pending="";continue}break}case 16:if(o==="~~"){pe(e),Oe(e),e.pending="";continue}break;case 105:n===`
|
|
32
|
+
`?(pe(e),fe(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Xe(e,n));continue;case 30:if(o==="\\]"||o==="$$"){pe(e),Oe(e),e.pending="";continue}break;case 31:if(o==="\\)"||e.pending[0]==="$"){pe(e),Oe(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:o==="http://"||o==="https://"?(pe(e),fe(e,18),e.pending=o,e.text=o):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=o:(e.token=e.tokens[e.len],Xe(e,n));continue;case 17:case 19:if(e.pending==="]"){pe(e),n==="("?e.pending=o:(Oe(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?Ma:vc,s=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,s),Oe(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
|
|
33
|
+
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,Ma,e.pending),pe(e),Oe(e),e.pending=n):(e.text+=n,e.pending=o);continue;case 104:if(o.startsWith("<br")){if(o.length===3||n===" "||n==="/"&&(o.length===4||e.pending[e.pending.length-1]===" ")){e.pending=o;continue}if(n===">"){pe(e),e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data),e.pending="";continue}}e.token=e.tokens[e.len],e.text+="<",e.pending=e.pending.slice(1),Xe(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":pe(e),fe(e,31),e.pending="";continue;case"[":e.token=105,e.pending=o;continue;case`
|
|
34
|
+
`:e.pending=n;continue;default:let r=n.charCodeAt(0);e.pending="",e.text+=La(r)||r>=65&&r<=90||r>=97&&r<=122?o:n;continue}case`
|
|
35
|
+
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:pe(e),Jt(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:pe(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){pe(e),e.pending=o,e.token=104;continue}break;case"`":if(e.token===19)break;n==="`"?(e.fence_start+=1,e.pending=o):(e.fence_start+=1,pe(e),fe(e,11),e.text=n===" "||n===`
|
|
36
|
+
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let r=12,i=14,s=e.pending[0];if(s==="_"&&(r=13,i=15),e.pending.length===1){if(s===n){e.pending=o;continue}if(n!==" "&&n!==`
|
|
37
|
+
`){pe(e),fe(e,r),e.pending=n;continue}}else{if(s===n){pe(e),fe(e,i),fe(e,r),e.pending="";continue}if(n!==" "&&n!==`
|
|
38
|
+
`){pe(e),fe(e,i),e.pending=n;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(n==="~"){e.pending=o;continue}}else if(n!==" "&&n!==`
|
|
39
|
+
`){pe(e),fe(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=o;continue}else{if(Rf(n.charCodeAt(0)))break;pe(e),fe(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){pe(e),fe(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){pe(e),fe(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}pe(e)}function Na(e){return{add_token:Tf,end_token:If,add_text:Ef,set_attr:Af,data:{nodes:[e,,,,,],index:0}}}function Tf(e,t){let n=e.nodes[e.index],o;switch(t){case 1:return;case 20:o=document.createElement("blockquote");break;case 2:o=document.createElement("p");break;case 21:o=document.createElement("br");break;case 22:o=document.createElement("hr");break;case 3:o=document.createElement("h1");break;case 4:o=document.createElement("h2");break;case 5:o=document.createElement("h3");break;case 6:o=document.createElement("h4");break;case 7:o=document.createElement("h5");break;case 8:o=document.createElement("h6");break;case 12:case 13:o=document.createElement("em");break;case 14:case 15:o=document.createElement("strong");break;case 16:o=document.createElement("s");break;case 11:o=document.createElement("code");break;case 18:case 17:o=document.createElement("a");break;case 19:o=document.createElement("img");break;case 23:o=document.createElement("ul");break;case 24:o=document.createElement("ol");break;case 25:o=document.createElement("li");break;case 26:let r=o=document.createElement("input");r.type="checkbox",r.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),o=document.createElement("code");break;case 27:o=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}o=document.createElement("tr");break;case 29:o=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:o=document.createElement("equation-block");break;case 31:o=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(o)}function If(e){e.index-=1}function Ef(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Af(e,t,n){e.nodes[e.index].setAttribute(xf(t),n)}function cr({textSig:e,doneSig:t}){let n=A(null);return ut(()=>{let o=n.current;if(!o)return;o.classList.add(`${C.cssPrefix}-md`);let r=Na(o),i=Oa(r),s=0,l=xt(()=>{let _=e.value,p=t.value;_.length<s&&(o.replaceChildren(),r=Na(o),i=Oa(r),s=0);let d=_.slice(s);d&&Xe(i,d),s=_.length,p&&Pc(i)}),c=new MutationObserver(_=>{for(let p of _)for(let d of p.addedNodes){if(!(d instanceof HTMLElement))continue;let f=d.matches?.("a")?[d]:[...d.querySelectorAll?.("a")??[]];for(let m of f)xc(m)}});c.observe(o,{childList:!0,subtree:!0});for(let _ of o.querySelectorAll("a"))xc(_);let u=_=>{let p=_.target?.closest?.("a");if(!p||!(p instanceof HTMLAnchorElement))return;let d=p.getAttribute("href")??"";!d||d.startsWith("#")||(_.preventDefault(),window.open(d,"_blank","noopener,noreferrer"))};return o.addEventListener("click",u),()=>{l(),c.disconnect(),o.removeEventListener("click",u)}},[e,t]),a("div",{ref:n})}function Sc({text:e}){let t=Z(()=>J(e),[e]),n=Z(()=>J(!0),[]);return a(cr,{textSig:t,doneSig:n})}function xc(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var dr=C.cssPrefix;function kc({messageId:e,initial:t,strings:n,onFeedback:o}){let[r,i]=O(t);E(()=>i(t),[e,t]);let s=l=>{let c=r===l?null:l;i(c),o(e,c)};return a("div",{class:`${dr}-feedback`,role:"group","data-testid":R.messageFeedback,children:[a("button",{type:"button",class:`${dr}-msg-action`,"data-active":r==="up"?"true":void 0,"aria-pressed":r==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>s("up"),"data-testid":R.feedbackUp,children:a(Ol,{})}),a("button",{type:"button",class:`${dr}-msg-action`,"data-active":r==="down"?"true":void 0,"aria-pressed":r==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>s("down"),"data-testid":R.feedbackDown,children:a(Nl,{})}),a("span",{class:`${dr}-sr-only`,role:"status","aria-live":"polite",children:r?n.feedbackThanks:""})]})}var bn=C.cssPrefix;function wc({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?a("a",{class:`${bn}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":R.source,children:[a("span",{class:`${bn}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),a("span",{class:`${bn}-source-label`,children:n})]}):a("span",{class:`${bn}-source`,"data-testid":R.source,children:[a("span",{class:`${bn}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),a("span",{class:`${bn}-source-label`,children:n})]})}var rt=C.cssPrefix;function Cc({part:e,strings:t,active:n,superseded:o=!1,continuationStreaming:r=!1,onDecision:i,onEdit:s}){let l=Z(()=>_e(()=>e.approvalSig.value),[e]),c=Z(()=>_e(()=>mc(e,{active:n,superseded:o,continuationStreaming:r})),[e,n,o,r]).value,{terminal:u,showApproveReject:_,showAnswered:p,showSubmitted:d,showEdit:f,skipped:m}=c,h=Ca(e.toolName),b=c.answeredApproved,x=e.toolCallId,P=a(le,{children:[a("p",{class:`${rt}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",h)}),a("p",{class:`${rt}-toolui-subtle`,children:t.approvalBody})]});d?P=a("p",{class:`${rt}-toolui-subtle`,children:t.approvalSubmitting}):p&&b!==!1?P=a(le,{children:[a("p",{class:`${rt}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",b?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),f?a("p",{class:`${rt}-toolui-subtle`,children:t.approvalEditHint}):null,f?null:a("p",{class:`${rt}-toolui-subtle`,children:t.approvalSubmitting})]}):p&&(P=a(le,{}));let v=_||d||f||p&&b!==!1;return a("div",{class:`${rt}-toolui-group`,"data-testid":c.decided?R.toolDecision:R.toolApproval,children:[a(ir,{part:e,strings:t,superseded:m,submitted:d}),m||u||!v?null:a("div",{class:`${rt}-toolui ${rt}-toolui-body`,children:[P,_?a("div",{class:`${rt}-toolui-actions`,children:[a("button",{type:"button",class:`${rt}-form-skip`,disabled:!n,onClick:()=>i(x,!1),"data-testid":R.toolReject,children:t.reject}),a("button",{type:"button",class:`${rt}-form-submit`,disabled:!n,onClick:()=>i(x,!0),"data-testid":R.toolApprove,children:t.approve})]}):null,f?a("div",{class:`${rt}-toolui-actions`,children:a("button",{type:"button",class:`${rt}-form-skip`,onClick:()=>s(x),"data-testid":R.toolEdit,children:t.edit})}):null]})]})}var Lf=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Rc(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(Of).filter(r=>r!==null);return{intro:ur(t.intro),questions:o}}function Of(e,t){if(!e||typeof e!="object")return null;let n=e,o=Lf.has(n.type)?n.type:"text";return{key:ur(n.key)??`q${t+1}`,question:ur(n.question)??"Please provide the missing information.",type:o,options:Array.isArray(n.options)?n.options.filter(r=>typeof r=="string"&&r.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:ur(n.helpText)}}function Nf(e){switch(e){case"text":return"textarea";case"phone":return"tel";case"single-select":case"boolean":return"radio";case"multi-select":return"multiselect";default:return e}}function Da(e,t,n){return e.questions.map(o=>{let r=Nf(o.type),i=o.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(o.options??[]).map(s=>({value:s,label:s}));return{name:o.key,label:o.question,type:r,required:o.required??!1,options:i.length>0?i:void 0,validationHint:o.helpText}})}function ur(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var Fe=C.cssPrefix,Df={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Tc(e,t){let n={};for(let o of e)n[o.key]=t[Df[o.type]];return n}function Ic({part:e,strings:t,active:n,superseded:o=!1,continuationStreaming:r=!1,onDecision:i,onEdit:s}){let l=Z(()=>_e(()=>e.stateSig.value),[e]).value,c=Z(()=>_e(()=>e.approvalSig.value),[e]).value,u=Z(()=>_e(()=>Rc(e.inputSig.value)),[e]).value,{terminal:_,decided:p}=ar(l,c),d=p&&c?.approved===!0,f=r&&!p,m=!p&&!o&&!f,h=!m&&!d&&!f,b=d&&n&&!_,x=u.questions,[P,v]=O(null),k=P??(m||d||f),[w,F]=O(!1),z=x.length>1?fa:Vn,q=m?t.inputRequired:t.inputBadge,I=f?a("p",{class:`${Fe}-toolui-subtle`,children:t.approvalSubmitting}):m?a($f,{req:u,strings:t,active:n,resolve:(N,te)=>i(e.toolCallId,te,N)}):w?a(jn,{fields:Da(u,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Tc(x,t),initialValues:d?zf(x,c?.reason):void 0}):a(Ff,{questions:x,answers:d?Uf(c?.reason):{},strings:t}),H="completed",V=t.inputAnswered;return h?(H="superseded",V=t.inputSkipped):f&&(H="responded",V=t.statusResponded),a("details",{class:`${Fe}-toolui ${Fe}-toolui-collapsible${o?` ${Fe}-toolui-stale`:""}`,open:k,onToggle:N=>{let te=N.currentTarget.open;te!==k&&v(te)},"data-testid":m?R.toolAskQuestions:R.toolDecision,children:[a("summary",{class:`${Fe}-toolui-head`,children:[a("span",{class:`${Fe}-toolui-q-pill`,children:[a(z,{}),q]}),a("span",{class:`${Fe}-toolui-head-end`,children:[m?null:a(Ra,{status:H,icon:h?a(Go,{}):a(Wo,{}),label:V}),a("span",{class:`${Fe}-toolui-chevron`,children:a(Xt,{})})]})]}),a("div",{class:`${Fe}-toolui-collapse-body`,children:[u.intro?a("div",{class:`${Fe}-toolui-desc`,children:u.intro}):null,I,m||f?null:a("div",{class:`${Fe}-toolui-footer`,children:[a("button",{type:"button",class:`${Fe}-toolui-options-toggle`,onClick:()=>F(N=>!N),"data-testid":R.toolAskOptions,children:[a("span",{class:`${Fe}-toolui-options-chevron${w?` ${Fe}-open`:""}`,children:a(Xt,{})}),w?t.hideOptions:t.showOptions]}),b?a("button",{type:"button",class:`${Fe}-form-skip`,onClick:()=>s(e.toolCallId),"data-testid":R.toolEdit,children:t.edit}):null]})]})]})}function $f({req:e,strings:t,active:n,resolve:o}){let r=Da(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return a(jn,{fields:r,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:s=>o(Hf(e.questions,s),!0),skipLabel:t.inputSkip,onSkip:()=>o(void 0,!1),submitOnEnter:i,fieldTypeLabels:Tc(e.questions,t),submitTestId:R.toolInputSubmit,skipTestId:R.toolInputSkip})}function Ff({questions:e,answers:t,strings:n}){return a("div",{class:`${Fe}-toolui-summary`,"data-testid":R.toolAskSummary,children:e.map(o=>a("div",{class:`${Fe}-field`,children:[a("span",{class:`${Fe}-field-head`,children:a("span",{class:`${Fe}-field-label`,children:[o.question,o.required?a("span",{class:`${Fe}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),a("p",{class:`${Fe}-toolui-answer`,children:Bf(o,t[o.key],n)||"\u2014"})]},o.key))})}function Bf(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Hf(e,t){let n=e.flatMap(o=>{let r=t[o.key];if(r==null||r.trim()==="")return[];let i=o.type==="multi-select"?r.split(",").map(s=>s.trim()).filter(Boolean):r;return[{key:o.key,value:i}]});return JSON.stringify({answers:n})}function Ec(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let o={};for(let r of n)if(r&&typeof r=="object"&&"key"in r){let{key:i,value:s}=r;if(typeof i!="string")continue;typeof s=="string"?o[i]=s:Array.isArray(s)&&(o[i]=s.filter(l=>typeof l=="string"))}return o}function Uf(e){let t=Ec(e),n={};for(let[o,r]of Object.entries(t))n[o]=Array.isArray(r)?r.join(", "):r;return n}function zf(e,t){let n=Ec(t),o={};for(let r of e){let i=n[r.key];i!==void 0&&(r.type==="multi-select"?o[r.key]=Array.isArray(i)?i:[i]:o[r.key]=Array.isArray(i)?i[0]??"":i)}return o}function Ac({part:e,strings:t,live:n}){let o=Z(()=>_e(()=>e.inputSig.value),[e]),r=Z(()=>_e(()=>e.outputSig.value),[e]),i=Z(()=>_e(()=>e.errorSig.value),[e]);return Z(()=>_e(()=>!!sr(o.value)||!!i.value||!!sr(Ia(r.value))),[o,r,i]).value?a(ir,{part:e,strings:t,testid:R.toolCall,live:n}):null}var Ge=C.cssPrefix,Mc=sc(qf);function qf({message:e,status:t,strings:n,responseMode:o,showReasoning:r,showToolCalls:i,showSources:s,interactive:l=!1,superseded:c=!1,tool:u,onRetry:_,enableMessageFeedback:p=!1,onFeedback:d}){let m=Z(()=>_e(()=>e.partsSig.value),[e]).value,h=Z(()=>_e(()=>Wt(e)),[e]),b=Z(()=>_e(()=>Zs(e)),[e]),x=Z(()=>_e(()=>_c(e)),[e]),P=Z(()=>_e(()=>r&&pc(e)),[e,r]),v=t==="streaming",y=e.role==="assistant"&&v,k=fc({streaming:y,responseMode:o,reasoningVisible:P.value,hasAnswerText:x.value,emptyReply:h.value,hidden:b.value}),{bufferedHold:w,working:F,showStreamDots:z}=k;if(k.hidden)return null;let q=Wf(e.createdAt),I=e.role==="assistant"||e.role==="operator",H=p&&!!d&&!!e.serverMessageId&&I&&!v&&t!=="error"&&!h.value,V=v?"":m.filter(ae=>ae.kind==="text").map(ae=>ae.textSig.peek()).join(`
|
|
40
40
|
|
|
41
|
-
`).trim(),A=!h&&t!=="error"&&!P.value&&V.length>0,ae=F||A;return a("div",{class:`${Oe}-bubble-row`,"data-role":e.role,"data-testid":Le(R.messageBubble,e.serverMessageId??e.id),children:a("div",{class:`${Oe}-bubble-col`,children:[a("div",{class:`${Oe}-bubble`,children:[e.role==="operator"&&e.operatorInitials?a("span",{class:`${Oe}-bubble-author`,children:e.operatorInitials}):null,a("div",{class:`${Oe}-bubble-body`,children:[I?a(Hf,{label:n.loading}):m.map((ce,ie)=>a(Nf,{part:ce,active:z,live:x,strings:n,showReasoning:o,showToolCalls:i,showSources:s,interactive:l&&t==="complete"&&(ce.kind!=="tool"||Tr(e,ie)),superseded:c,continuationStreaming:e.continuationStreaming===!0,tool:u},`${Ff(ce)}#${ie}`)),K&&a(Bf,{}),t==="error"||P.value?a("div",{class:`${Oe}-error`,role:"alert",children:[a("span",{children:e.errorText??n.errorGeneric}),p?a("button",{type:"button",class:`${Oe}-error-retry`,onClick:()=>p(e),"data-testid":R.messageRetry,children:n.errorRetry}):null]}):null]})]}),W||ae?a("div",{class:`${Oe}-bubble-meta`,children:[W?a("time",{class:`${Oe}-bubble-time`,dateTime:W.iso,title:W.full,children:W.short}):null,ae?a("div",{class:`${Oe}-bubble-actions`,children:[F&&e.serverMessageId?a(gc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:n,onFeedback:d}):null,A?a(Lf,{text:V,strings:n}):null]}):null]}):null]})})}function Lf({text:e,strings:t}){let[n,r]=$(!1),o=()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})},i=n?t.copied:t.copy;return a("button",{type:"button",class:`${Oe}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:o,"data-testid":R.messageCopy,children:n?a(Bt,{}):a(wl,{})})}function Of(e){if(typeof e!="number"||!Number.isFinite(e))return null;try{let t=new Date(e);return{short:t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),full:t.toLocaleString(void 0,{dateStyle:"full",timeStyle:"short"}),iso:t.toISOString()}}catch{return null}}function Nf({part:e,active:t,live:n,strings:r,showReasoning:o,showToolCalls:i,showSources:s,interactive:l,superseded:c,continuationStreaming:u,tool:p}){switch(e.kind){case"step-start":return null;case"text":return a(Zr,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?a($f,{part:e,active:t,strings:r}):null;case"tool":return a(Df,{part:e,strings:r,showToolCalls:i,interactive:l,superseded:c,continuationStreaming:u,live:n,tool:p});case"file":return e.mediaType.startsWith("image/")?a("img",{src:e.url,alt:"",loading:"lazy"}):a("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return s?a(vc,{part:e,strings:r}):null}}function Df({part:e,strings:t,showToolCalls:n,interactive:r,superseded:o,continuationStreaming:i,live:s,tool:l}){let c=Q(()=>de(()=>e.approvalSig.value!==void 0),[e]);return l?.humanInLoop&&c.value?jr(e.toolName)?a(Pc,{part:e,strings:t,active:r,superseded:o,continuationStreaming:i,onDecision:l.onDecision,onEdit:l.onEdit}):a(hc,{part:e,strings:t,active:r,superseded:o,continuationStreaming:i,onDecision:l.onDecision,onEdit:l.onEdit}):n?a(Sc,{part:e,strings:t,live:s}):null}function $f({part:e,active:t,strings:n}){return a("details",{class:`${Oe}-reasoning`,"data-testid":R.reasoning,open:t,"data-active":t?"true":void 0,children:[a("summary",{class:`${Oe}-reasoning-summary`,children:a("span",{class:`${Oe}-reasoning-label`,children:t?n.thinking:n.thoughts})}),a("div",{class:`${Oe}-reasoning-body`,children:a(Zr,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Ff(e){switch(e.kind){case"text":case"reasoning":case"step-start":return`${e.kind}:${e.id}`;case"tool":return`tool:${e.toolCallId}`;case"file":return`file:${e.url}`;case"source":return`source:${e.sourceId}`}}function Bf(){return a("span",{class:`${Oe}-typing`,"data-testid":R.typingDots,"aria-hidden":"true",children:[a("span",{}),a("span",{}),a("span",{})]})}function Hf({label:e}){return a("span",{class:`${Oe}-loading`,role:"status",children:[a("span",{class:`${Oe}-loading-spinner`,"aria-hidden":"true"}),a("span",{class:`${Oe}-loading-label`,children:e})]})}var qt=w.cssPrefix,Ra=120,Uf=350;function wc({messagesSig:e,strings:t,responseMode:n,showReasoning:r,showToolCalls:o,showSources:i,enableMessageFeedback:s,onFeedback:l,loading:c,idle:u,controlMode:p="ai-agent",tool:_,onRetry:d,form:f,formMarkers:m,onFillForm:P}){let v=B(null),g=gt(()=>e.value),[k,h]=$(!1),x=B(!1),C=B(!1),I=B(!1),z=B(0),K=()=>I.current||performance.now()-z.current<Uf,W=B(0),L=S=>{let q=S.scrollHeight-S.clientHeight>1;S.dataset.fadeTop=q&&S.scrollTop>1?"true":"false",S.dataset.fadeBottom=q&&S.scrollHeight-S.scrollTop-S.clientHeight>1?"true":"false"},F=S=>h(S.scrollHeight-S.scrollTop-S.clientHeight>Ra*2),V=S=>{W.current=performance.now(),S.scrollTop=S.scrollHeight,L(S)},A=(S,q)=>{V(S);let oe=q,b=0,E=()=>{C.current||K()||(V(S),--oe>0&&(b=requestAnimationFrame(E)))};return q>0&&(b=requestAnimationFrame(E)),()=>cancelAnimationFrame(b)},ae=(S,q)=>{let oe,b,E,O=-1,Y=()=>{oe.disconnect(),b.disconnect(),clearTimeout(E)},ne=()=>{if(C.current||K()||O>=0&&S.scrollTop<O-4)return Y();V(S),O=S.scrollTop};return oe=new ResizeObserver(ne),b=new MutationObserver(ne),ne(),oe.observe(S),b.observe(S,{childList:!0,subtree:!0,characterData:!0}),E=setTimeout(Y,q),Y},ce=g.value[0]?.id;ot(()=>{let S=v.current;if(S&&g.value.length!==0&&(x.current=!0,!!g.value.some(q=>q.role==="user")))return ae(S,300)},[ce]);let ie=B(0);M(()=>{let S=v.current,q=g.value,oe=ie.current;if(ie.current=q.length,!S||!x.current)return;if(q.slice(oe).some(E=>E.role==="user"))return C.current=!1,A(S,3);if(!q.some(E=>E.role==="user")||C.current||K())return;S.scrollHeight-S.scrollTop-S.clientHeight<Ra&&V(S)},[g.value.length]);let we=B(null);M(()=>{let S=v.current,q=g.value.at(-1),oe=we.current;if(we.current=q?{id:q.id,streaming:q.status==="streaming"}:null,!!S&&x.current&&!(!q||q.id!==oe?.id||oe.streaming||q.status!=="streaming"))return C.current=!1,A(S,3)},[g.value]),M(()=>{let S=v.current;if(!S)return;let q=g.value.at(-1);if(!q||q.status!=="streaming"&&!g.value.some(E=>E.role==="user"))return;let oe=()=>{if(C.current||K())return;S.scrollHeight-S.scrollTop-S.clientHeight<Ra*2&&V(S)};if(q.status!=="streaming")return ae(S,300);oe();let b=new MutationObserver(oe);return b.observe(S,{childList:!0,subtree:!0,characterData:!0}),()=>b.disconnect()},[g.value]);let xe=f?.form.id,De=!!f&&(m??[]).some(S=>S.formId===f.form.id);ot(()=>{let S=v.current;!S||!xe||C.current||g.value.some(q=>q.role==="user")&&(De?S.querySelector(`[data-testid="${R.formGate}"]`)?.scrollIntoView({block:"nearest"}):V(S))},[xe,De]),M(()=>{let S=v.current;if(!S)return;let q=()=>{F(S),L(S),performance.now()-W.current>150&&(C.current=S.scrollHeight-S.scrollTop-S.clientHeight>8)},oe=()=>{C.current=!0},b=be=>{be.deltaY<0&&oe()},E=0,O=be=>{E=be.touches[0]?.clientY??0,I.current=!0},Y=be=>{(be.touches[0]?.clientY??0)>E+4&&oe()},ne=()=>{I.current=!1,z.current=performance.now()},fe=()=>{I.current=!0};return S.addEventListener("scroll",q,{passive:!0}),S.addEventListener("wheel",b,{passive:!0}),S.addEventListener("touchstart",O,{passive:!0}),S.addEventListener("touchmove",Y,{passive:!0}),S.addEventListener("touchend",ne,{passive:!0}),S.addEventListener("touchcancel",ne,{passive:!0}),S.addEventListener("pointerdown",fe,{passive:!0}),window.addEventListener("pointerup",ne,{passive:!0}),window.addEventListener("pointercancel",ne,{passive:!0}),F(S),()=>{S.removeEventListener("scroll",q),S.removeEventListener("wheel",b),S.removeEventListener("touchstart",O),S.removeEventListener("touchmove",Y),S.removeEventListener("touchend",ne),S.removeEventListener("touchcancel",ne),S.removeEventListener("pointerdown",fe),window.removeEventListener("pointerup",ne),window.removeEventListener("pointercancel",ne)}},[]);let He=()=>{let S=v.current;S&&(C.current=!1,V(S))},Ee=[],Ue="",Ce=g.value.at(-1)?.id,ge=[...m??[]].toSorted((S,q)=>(S.createdAt??1/0)-(q.createdAt??1/0)),qe=S=>f&&S.formId===f.form.id?a(_a,{form:f.form,strings:t,onSubmit:f.onSubmit,onSkip:f.onSkip},`gate:${S.formId}`):a(Vl,{marker:S,strings:t,onFill:!f&&P?()=>P(S.formId):void 0},S.key),Qe=S=>{for(let q=ge[0];q?.createdAt!==void 0&&!(S!==void 0&&q.createdAt>S);q=ge[0])ge.shift(),Ee.push(qe(q))};for(let S of g.value){if(S.role==="assistant"&&S.id!==Ce&&Dt(S))continue;Qe(S.createdAt);let q=zf(S.createdAt);q&&q!==Ue&&(Ee.push(a("div",{class:`${qt}-date-divider`,children:a("span",{class:`${qt}-date-pill`,title:qf(S.createdAt),children:Vf(S.createdAt,t)})},`day:${q}`)),Ue=q);let b=S.retryAction!==void 0||S.role==="assistant"&&S.id===Ce?Ar(g.value,S):void 0,E=b!==void 0&&(b.kind!=="continue-assistant"||p==="ai-agent");Ee.push(a(kc,{message:S,status:S.status,strings:t,responseMode:n,showReasoning:r,showToolCalls:o,showSources:i,interactive:!!u&&p==="ai-agent"&&S.id===Ce,superseded:S.id!==Ce,tool:_,onRetry:u&&E&&(S.role==="user"||S.id===Ce)?d:void 0,enableMessageFeedback:s,onFeedback:l},S.id))}for(let S of ge)Ee.push(qe(S));return a("div",{class:`${qt}-list-wrap`,children:[a("div",{ref:v,class:`${qt}-list ${qt}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&g.value.length===0?a("div",{class:`${qt}-list-loading`,role:"status",children:t.conversationLoading}):null,Ee,f&&!De?a(_a,{form:f.form,strings:t,onSubmit:f.onSubmit,onSkip:f.onSkip}):null]}),k?a("button",{type:"button",class:`${qt}-jump`,onClick:He,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":R.scrollToBottom,children:a(Ht,{})}):null]})}function zf(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function qf(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Vf(e,t){let n=new Date(e),r=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),o=Math.round((r(new Date)-r(n))/864e5);return o<=0?t.dateToday:o===1?t.dateYesterday:o<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var Wf=["today","yesterday","lastWeek","older"];function Gf(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let r=Math.floor((Cc(e)-Cc(n))/(1440*60*1e3));return r<=0?"today":r===1?"yesterday":r<7?"lastWeek":"older"}function Rc(e,t){let n=new Map;for(let r of t){let o=Gf(e,r.lastMessageAt),i=n.get(o);i?i.push(r):n.set(o,[r])}return Wf.filter(r=>n.has(r)).map(r=>({bucket:r,conversations:n.get(r)}))}function Cc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Kf=Z.scope("history"),jf=3,Xf=6,Yf={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Jf(e,t,n){let r=Date.parse(e);return Number.isFinite(r)?new Date(r).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(r):t-r<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(r):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(r):""}function no({transport:e,strings:t,locale:n,persistence:r,visitorId:o,onSelect:i,onNewConversation:s}){let l=w.cssPrefix,c=e.peekConversations({visitorId:o}),[u,p]=$(c?"loaded":"loading"),[_,d]=$(c?.conversations??[]);M(()=>{let v=!1;return e.listConversations({visitorId:o}).then(g=>{if(v)return;let k=g.conversations??[];d(k),p("loaded"),r.saveHistoryCount(k.length)}).catch(g=>{v||(Kf.warn("listConversations failed",{err:g}),p("error"))}),()=>{v=!0}},[e,o,r]);let f=s?a("div",{class:`${l}-history-footer`,children:a("button",{type:"button",class:`${l}-history-new`,onClick:s,"data-testid":R.sidebarNewConversation,children:[a(Qs,{}),t.newConversation]})}):null;if(u==="loading"){let v=Math.min(r.loadHistoryCount()??jf,Xf);return a(le,{children:[a("div",{class:`${l}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:a("div",{class:`${l}-history-group`,"aria-hidden":"true",children:[a("div",{class:`${l}-history-heading`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-heading`})}),a("div",{class:`${l}-history-card`,children:Array.from({length:Math.max(1,v)},(g,k)=>a("div",{class:`${l}-history-item ${l}-history-item-skeleton`,children:[a("span",{class:`${l}-history-avatar ${l}-skeleton`}),a("span",{class:`${l}-history-body`,children:[a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-title`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-title`})}),a("span",{class:`${l}-history-time`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-time`})})]}),a("span",{class:`${l}-history-row`,children:a("span",{class:`${l}-history-preview`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-preview`})})})]})]},k))})]})}),f]})}if(u==="error"||_.length===0)return a(le,{children:[a("div",{class:`${l}-history-empty`,children:t.historyEmpty}),f]});let m=Date.now(),P=Rc(m,_);return a(le,{children:[a("div",{class:`${l}-history`,role:"list",children:P.map(v=>a("div",{class:`${l}-history-group`,children:[a("div",{class:`${l}-history-heading`,children:t[Yf[v.bucket]]}),a("div",{class:`${l}-history-card`,children:v.conversations.map(g=>a("button",{type:"button",role:"listitem",class:`${l}-history-item`,onClick:()=>i(g),"data-closed":g.canContinue?void 0:"true","data-unread":g.hasUnread?"true":void 0,"data-testid":Le(R.historyItem,g.conversationId),children:[a("span",{class:`${l}-history-avatar`,"aria-hidden":"true",children:a(aa,{})}),a("span",{class:`${l}-history-body`,children:[a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-title`,children:g.title}),a("span",{class:`${l}-history-time`,children:Jf(g.lastMessageAt,m,n)})]}),a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-preview`,children:g.preview??(g.canContinue?t.historyContinue:t.conversationClosed)}),g.hasUnread?a("span",{class:`${l}-history-dot`}):null]})]})]},g.conversationId))})]},v.bucket))}),f]})}var Tc=w.cssPrefix;function Ic({suggestions:e,onPick:t,disabled:n=!1}){return e.length===0?null:a("div",{class:`${Tc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((r,o)=>a("button",{type:"button",class:`${Tc}-suggestion`,onClick:()=>t(r),disabled:n,"data-testid":Le(R.suggestion,o),children:r.label},r.id))})}var Ne=w.cssPrefix;function Ec(e){let{options:t,onClose:n}=e,r=t.strings,o=B(null);M(()=>{let u=o.current;if(!u)return;let p=Ur(u),_=d=>{d.key==="Escape"&&n?.()};return u.addEventListener("keydown",_),()=>{p(),u.removeEventListener("keydown",_)}},[n]);let i=e.composerApiRef,s=e.composerActive&&e.view==="chat"&&e.canSend&&!e.activeForm&&!e.sendPreparing&&e.options.features.fileUpload,l=N(u=>{s&&i.current?.attachFromDrop(u)},[i,s]),{visible:c}=Wr({containerRef:o,onDrop:l,disabled:!s});return Br(o.current,t.mode==="modal"),a("div",{ref:o,class:`${Ne}-panel`,role:"dialog","aria-modal":"false","aria-label":r.panelTitle,style:{position:"relative"},"data-testid":R.panel,children:[a(Ta,{...e,containerEl:o.current,dragOver:c,composerAttachApiRef:i}),a(Ia,{poweredBy:e.options.poweredBy})]})}function Ta(e){let{options:t,transport:n,feedback:r,bus:o,persistence:i,panelSize:s,view:l,canSend:c,isStreaming:u,sendPreparing:p,controlMode:_,assignedOperatorInitials:d,operatorAvailable:f,operatorRequestEnabled:m,onRequestOperator:P,onCancelOperatorRequest:v,loadingMessages:g,messagesSig:k,agent:h,suggestions:x,initialWidgetSize:C,visitorId:I,onClose:z,onBack:K,onClear:W,onToggleHistory:L,onSelectHistoryConversation:F,onNewConversation:V,onWidgetSizeChange:A,onSend:ae,onStop:ce,onSuggestion:ie,activeForm:we,formMarkers:xe,onFormSubmit:De,onFormSkip:He,onFormFill:Ee,tool:Ue,onRetry:Ce,onMessageFeedback:ge,containerEl:qe,dragOver:Qe,composerAttachApiRef:S}=e,q=t.strings,oe;return we?oe=null:c?oe=a(le,{children:[_&&_!=="ai-agent"?a(em,{controlMode:_,operatorInitials:d,operatorAvailable:f,onCancelOperatorRequest:v,strings:q}):null,!u&&_==="ai-agent"&&a(Ic,{suggestions:x,onPick:ie,disabled:p}),a(Fl,{options:t,transport:n,feedback:r,bus:o,isStreaming:u,active:e.composerActive&&l==="chat",isPreparing:p,operatorRequestEnabled:m,controlMode:_,onRequestOperator:P,onSend:ae,onStop:ce,attachApiRef:S})]}):oe=a(Zf,{label:q.conversationClosed,ctaLabel:q.startNewConversation,onNewConversation:W}),a(le,{children:[l==="history"?a(Qf,{strings:q,onBack:L,onClose:z,showClose:Hr(t.mode,s,t.actions)}):a("header",{class:`${Ne}-header`,"data-testid":R.panelHeader,children:[K?a("button",{type:"button",class:`${Ne}-icon-btn`,onClick:K,"aria-label":q.moduleBack,title:q.moduleBack,children:a(Ln,{})}):null,h?a(Nl,{agent:h,strings:q}):a("h1",{children:q.panelTitle}),a(st,{panelProps:e,variant:"chat"})]}),l==="history"?a(no,{transport:n,strings:q,locale:t.locale,persistence:i,visitorId:I,onSelect:b=>F(b.conversationId),onNewConversation:V}):a(le,{children:[a(Bl,{visible:Qe,strings:q}),a(wc,{messagesSig:k,strings:q,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:ge,loading:g,idle:!u&&!p&&c&&!we,controlMode:_,tool:Ue,onRetry:Ce,form:we?{form:we,onSubmit:De,onSkip:He}:null,formMarkers:xe,onFillForm:Ee}),oe,a(nm,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?a(Fr,{panelEl:qe,resize:t.size.resize,position:t.position,initialSize:C,onSizeChange:A,strings:q}):null]})}function Qf({strings:e,onBack:t,onClose:n,showClose:r}){return a("header",{class:`${Ne}-header`,children:[a("button",{type:"button",class:`${Ne}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:a(Ln,{})}),a("h1",{children:e.historyTitle}),r?a("button",{type:"button",class:`${Ne}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:a(it,{})}):null]})}function Zf({label:e,ctaLabel:t,onNewConversation:n}){return a("div",{class:`${Ne}-readonly-banner`,role:"note",children:[a("span",{class:`${Ne}-readonly-label`,children:e}),a("button",{type:"button",class:`${Ne}-readonly-cta`,onClick:n,children:t})]})}function em({controlMode:e,operatorInitials:t,operatorAvailable:n,onCancelOperatorRequest:r,strings:o}){let i=tm(e,t,n,o);return a("div",{class:`${Ne}-operator-banner`,role:"status","data-mode":e,"data-testid":R.operatorBanner,children:[a("span",{class:`${Ne}-operator-pulse`,"aria-hidden":"true"}),a("span",{class:`${Ne}-operator-label`,children:i}),e==="awaiting_operator"&&r?a("button",{type:"button",class:`${Ne}-cancel-operator-request`,"data-testid":R.cancelOperatorRequest,onClick:r,children:o.cancelOperatorRequest}):null]})}function tm(e,t,n,r){return e==="operator"?r.chattingWithOperator.replace("{operator}",t??""):n===!1?r.noOperatorAvailable:r.connectingOperator}function nm({disclaimer:e}){return e?a("div",{class:`${Ne}-composer-footer`,children:a("div",{class:`${Ne}-disclaimer`,children:e})}):null}function Ia({poweredBy:e}){return e?a("div",{class:`${Ne}-poweredby-bar`,children:a(rm,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function rm({logoUrl:e,text:t,href:n}){let r=a(le,{children:[e?a("img",{class:`${Ne}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?a("span",{children:t}):null]});return n?a("a",{class:`${Ne}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:r}):a("span",{class:`${Ne}-poweredby`,children:r})}function Ac(e){let t=B(e);t.current=e;let n=B(null);return n.current??(n.current=om(t)),n.current}function om(e){let t=X(null),n=new Set,r=c=>`${e.current.conversationId()??""}:${c}`,o=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(r(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,u)=>{if(t.value)return;let p=e.current;if(c==="manual"){let _=p.forms.list.find(d=>d.id===u);_&&(t.value={form:_,trigger:"manual"});return}for(let _ of p.forms.byTrigger[c]??[]){let d=_.triggers.find(f=>f.kind===c);if(!(!d||!am(d,p)||o(_)||!im(_,p))){t.value={form:_,trigger:c};return}}},s=(c,u)=>{let p=t.value;if(!p)return;t.value=null;let{form:_,trigger:d}=p;_.frequency==="conversation"?n.add(r(_.id)):_.frequency!=="always"&&e.current.persistence.saveFormDone(_.id),e.current.onComplete(_,d,c,u)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let u=e.current.forms.list.find(p=>p.id===c.form.id);u&&u!==c.form&&(t.value={form:u,trigger:c.trigger})},complete:c=>s(c,!1),skip:()=>s({},!0)}}function am(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function im(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let o=t.userContext()??{};if(n.missingContext.some(i=>o[i]!==void 0&&o[i]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let r=t.messageCount();return!(n.minMessages!=null&&r<n.minMessages||n.maxMessages!=null&&r>n.maxMessages)}function Mc(e){let t=w.cssPrefix,{site:n,blocks:r,strings:o,collapsed:i}=e,s=r?.navigation??[],l=r?.linkCards??[],c=i?o.expandSidebar:o.collapseSidebar;return a("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":R.sidebar,children:[a("div",{class:`${t}-sidebar-header`,children:[a(sm,{site:n}),a("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":R.sidebarToggle,children:a(lm,{collapsed:i})})]}),i?null:a(le,{children:[s.length>0?a("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:a(cm,{items:s})}):null,l.length>0?a("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:a(dm,{items:l})}):null,e.showConversations?a("div",{class:`${t}-sidebar-conversations`,children:a(no,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function sm({site:e}){let t=w.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return a("picture",{children:[e.logoDark?.url?a("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,a("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return a("div",{class:`${t}-sidebar-title`,children:e?.title??w.name})}function lm({collapsed:e}){return a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?a("polyline",{points:"9 6 15 12 9 18"}):a("polyline",{points:"15 6 9 12 15 18"})})}function cm({items:e}){let t=w.cssPrefix;return a("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>a("li",{children:a("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?a("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,a("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function dm({items:e}){let t=w.cssPrefix;return a("div",{class:`${t}-sidebar-cards`,children:e.map(n=>a("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[a("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?a("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var Lc=w.cssPrefix;function Oc(e){return a("main",{class:`${Lc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[a(Mc,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),a("section",{class:`${Lc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Nc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Ea(e,t,n){return e.includes(t)?t:e.includes(n)?n:e[0]??""}function Dc(e,t,n){let r=[...new Set(t)],o=Ea(r,e,""),i=X({activeTab:o,stacks:Nc(r)});return{sig:i,reconcile(s,l){let c=[...new Set(s)],u=i.value,p=Ea(c,u.activeTab,l),_=Object.fromEntries(c.map(f=>[f,u.stacks[f]??[]])),d=p===u.activeTab&&c.length===Object.keys(u.stacks).length&&c.every(f=>u.stacks[f]===_[f]);r=c,!d&&(i.value={activeTab:p,stacks:_},p!==u.activeTab&&p&&n?.(p))},switchTab(s){!(s in i.value.stacks)||i.value.activeTab===s||(i.value={...i.value,activeTab:s},n?.(s))},push(s){let l=i.value,c=l.stacks[l.activeTab]??[];i.value={...l,stacks:{...l.stacks,[l.activeTab]:[...c,s]}}},pop(){let s=i.value,l=s.stacks[s.activeTab]??[];l.length!==0&&(i.value={...s,stacks:{...s.stacks,[s.activeTab]:l.slice(0,-1)}})},reset(s){i.value={activeTab:Ea(r,s,""),stacks:Nc(r)}}}}var $c=e=>e.stacks[e.activeTab]??[],Fc=e=>$c(e).at(-1),Bc=e=>$c(e).length===0;var Hc={Icon:Nn};var wt=w.cssPrefix;function ro({title:e,actions:t}){return a("header",{class:`${wt}-back-header`,"data-variant":"title",children:[a("span",{class:`${wt}-back-spacer`,"aria-hidden":"true"}),a("h1",{class:`${wt}-back-title`,children:e}),t??a("span",{class:`${wt}-back-spacer`,"aria-hidden":"true"})]})}function oo({title:e,backLabel:t,onBack:n,actions:r,testid:o}){return a("header",{class:`${wt}-back-header`,"data-testid":o,children:[a("button",{type:"button",class:`${wt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:a(Ln,{})}),a("h1",{class:`${wt}-back-title`,children:e}),r??a("span",{class:`${wt}-back-spacer`,"aria-hidden":"true"})]})}function Vt(e,t){return e instanceof $e&&e.status===429?t.errorRateLimited:t.errorGeneric}var pn=w.cssPrefix;function Uc({placeholder:e,onActivate:t}){return a("button",{type:"button",class:`${pn}-home-search`,onClick:t,"data-testid":R.homeSearch,children:[a("span",{class:`${pn}-home-search-text`,children:e}),a("span",{class:`${pn}-home-search-icon`,"aria-hidden":"true",children:a(sa,{})})]})}function zc({placeholder:e,value:t,onInput:n}){return a("div",{class:`${pn}-home-search`,"data-input":"true",children:[a("input",{type:"search",class:`${pn}-home-search-input`,placeholder:e,value:t,onInput:r=>n(r.currentTarget.value),"data-testid":R.helpSearch}),a("span",{class:`${pn}-home-search-icon`,"aria-hidden":"true",children:a(sa,{})})]})}var Bn=w.cssPrefix;function ao({title:e,subtitle:t,onClick:n,testid:r}){return a("button",{type:"button",class:`${Bn}-list-row`,onClick:n,"data-testid":r,children:[a("span",{class:`${Bn}-list-row-body`,children:[a("span",{class:`${Bn}-list-row-title`,children:e}),t?a("span",{class:`${Bn}-list-row-sub`,children:t}):null]}),a("span",{class:`${Bn}-list-row-chevron`,"aria-hidden":"true",children:a(ln,{})})]})}var qc=w.cssPrefix;function rt({tone:e="info",message:t,onRetry:n,strings:r}){return a("div",{class:`${qc}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[a("span",{children:t}),n?a("button",{type:"button",class:`${qc}-module-retry`,onClick:n,children:r.errorRetry}):null]})}var Wt=w.cssPrefix,um=Z.scope("help"),_m=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function pm(e){let t=new Map;for(let n of e){let r=n.categories?.[0]??"";(t.get(r)??t.set(r,[]).get(r)).push(n)}return[...t.entries()]}function Vc(e,t){let n=t.toLowerCase(),r=n.indexOf(e);if(r!==-1)return 100-Math.min(r,99);let o=0;for(let i of e){if(o=n.indexOf(i,o),o===-1)return 0;o+=1}return 1}function fm(e,t){let n=t.toLowerCase().trim();return n?e.map(r=>({item:r,score:Math.max(Vc(n,r.title)*2,Vc(n,r.description??""))})).filter(r=>r.score>0).toSorted((r,o)=>o.score-r.score).map(r=>r.item):[]}function Wc({article:e,nav:t}){return a(ao,{title:e.title,subtitle:e.description,onClick:()=>_m(t,e),testid:Le(R.helpArticle,e.id)})}function mm({transport:e,strings:t,config:n,nav:r,bus:o,panelProps:i}){let s=n.contentTags,[l,c]=$("loading"),[u,p]=$(t.errorGeneric),[_,d]=$([]),[f,m]=$(""),[P,v]=$(0);M(()=>{let h=!1;return c("loading"),e.listContent({tags:s,sortBy:"order",limit:100}).then(x=>{if(h)return;let C=x.items??[];d(C),c("loaded"),o.emit("contentView",{section:"help",tags:s?.join(","),count:C.length})}).catch(x=>{h||(um.warn("listContent (help) failed",{err:x}),p(Vt(x,t)),c("error"))}),()=>{h=!0}},[e,s,P,o]);let g=Q(()=>fm(_,f),[_,f]);M(()=>{let h=f.trim();if(!h)return;let x=setTimeout(()=>o.emit("contentSearch",{queryLength:h.length,hitCount:g.length}),600);return()=>clearTimeout(x)},[f,g,o]);function k(){return f.trim().length>0?g.length===0?a(rt,{message:t.helpSearchEmpty,strings:t}):a("div",{class:`${Wt}-help-card`,children:g.map(h=>a(Wc,{article:h,nav:r},h.id))}):l==="loading"?a(rt,{message:t.helpLoading,strings:t}):l==="error"?a(rt,{tone:"error",message:u,onRetry:()=>v(h=>h+1),strings:t}):_.length===0?a(rt,{message:t.helpEmpty,strings:t}):pm(_).map(([h,x])=>a("section",{class:`${Wt}-help-group`,children:[h?a("h2",{class:`${Wt}-help-section-title`,children:h}):null,a("div",{class:`${Wt}-help-card`,children:x.map(C=>a(Wc,{article:C,nav:r},C.id))})]},h))}return a("div",{class:`${Wt}-module`,children:[a(ro,{title:t.helpTitle,actions:a(st,{panelProps:i,variant:"plain"})}),a("div",{class:`${Wt}-module-pad`,children:a(zc,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),a("div",{class:`${Wt}-help-list`,children:k()})]})}var Gc={Icon:On,Root:e=>a(mm,{...e})};var Kc=w.cssPrefix;function Aa({onClick:e,children:t,testid:n}){return e?a("button",{type:"button",class:`${Kc}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):a("div",{class:`${Kc}-home-card`,"data-testid":n,children:t})}var he=w.cssPrefix,jc=Z.scope("home");function gm(e){let t=e.options.userContext?.name,n=e.config.greetingText?ze(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var vm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function hm(e){let{transport:t,strings:n,config:r,nav:o,bus:i,panelProps:s}=e,[l,c]=$(null),[u,p]=$([]),_=r.contentTags?.join(",");M(()=>{if(r.showRecentConversations===!1)return;let g=!1;return t.listConversations({limit:1}).then(k=>!g&&c(k.conversations?.[0]??null)).catch(k=>!g&&jc.warn("listConversations (home) failed",{err:k})),()=>{g=!0}},[t,r.showRecentConversations]),M(()=>{if(!r.contentTags?.length)return;let g=!1;return t.listContent({tags:r.contentTags,limit:6}).then(k=>{if(g)return;let h=k.items??[];p(h),i.emit("contentView",{section:"home",tags:_,count:h.length})}).catch(k=>!g&&jc.warn("listContent (home) failed",{err:k})),()=>{g=!0}},[t,_,i]);let d=gm(e),f=r.userAvatars??[],m=r.status,P=m?.text?ze(n,m.text):n.homeStatus,v=r.contentBlockTitle?ze(n,r.contentBlockTitle):n.homeContentTitle;return a("div",{class:`${he}-module ${he}-home`,"data-testid":R.homeView,children:a("div",{class:`${he}-home-scroll`,children:[a("div",{class:`${he}-home-hero`,children:[a("div",{class:`${he}-home-hero-top`,children:[r.brandName?a("span",{class:`${he}-home-brand`,"data-testid":R.homeBrand,children:r.brandName}):a("span",{class:`${he}-home-brand-spacer`,"aria-hidden":"true"}),a("div",{class:`${he}-home-hero-actions`,children:[f.length>0?a("div",{class:`${he}-home-avatars`,children:f.map(g=>a("span",{class:`${he}-home-avatar`,title:g.role?`${g.name} \xB7 ${g.role}`:g.name,children:g.avatar?a("img",{src:g.avatar,alt:"",loading:"lazy"}):a("span",{children:zr(g.name)})},g.name))}):null,a(st,{panelProps:s,variant:"plain"})]})]}),r.showGreeting!==!1?a(le,{children:[a("h1",{class:`${he}-home-greeting`,"data-testid":R.homeGreeting,children:d.title}),d.subtitle?a("p",{class:`${he}-home-lead`,children:d.subtitle}):null]}):null]}),a("div",{class:`${he}-home-cards`,children:[r.showSearchBar!==!1?a(Uc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>o.switchToLayout("help")}):null,l?a(Aa,{onClick:()=>o.selectConversation(l.conversationId),testid:R.homeRecent,children:a("div",{class:`${he}-home-recent-row`,"data-unread":l.hasUnread?"true":void 0,children:[a("span",{class:`${he}-home-recent-avatar`,"aria-hidden":"true",children:a(Nn,{})}),a("span",{class:`${he}-home-recent-body`,children:[a("span",{class:`${he}-home-recent-title`,children:l.title}),l.preview?a("span",{class:`${he}-home-recent-preview`,children:l.preview}):null]}),l.hasUnread?a("span",{class:`${he}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,m?a(Aa,{onClick:m.url?()=>o.push({kind:"iframe",url:m.url,title:P}):void 0,children:a("div",{class:`${he}-home-status`,"data-level":m.level??"operational",children:[a("span",{class:`${he}-home-status-icon`,"aria-hidden":"true",children:a(bl,{})}),a("span",{class:`${he}-home-status-text`,children:P})]})}):null,u.length>0?a("section",{class:`${he}-home-content`,children:[a("div",{class:`${he}-home-content-title`,children:v}),a("div",{class:`${he}-home-content-list`,children:u.map(g=>a(ao,{title:g.title,subtitle:g.description,onClick:()=>vm(o,g),testid:Le(R.homeContentRow,g.id)},g.id))})]}):null]})]})})}var Xc={Icon:yl,Root:e=>a(hm,{...e})};var Ct=w.cssPrefix,bm=Z.scope("news");function ym({transport:e,strings:t,config:n,nav:r,bus:o,panelProps:i}){let s=n.contentTags,[l,c]=$("loading"),[u,p]=$(t.errorGeneric),[_,d]=$([]),[f,m]=$(0);M(()=>{let v=!1;return c("loading"),e.listContent({tags:s,sortBy:"publishedAt",sortOrder:"desc"}).then(g=>{if(v)return;let k=g.items??[];d(k),c("loaded"),o.emit("contentView",{section:"news",tags:s?.join(","),count:k.length})}).catch(g=>{v||(bm.warn("listContent (news) failed",{err:g}),p(Vt(g,t)),c("error"))}),()=>{v=!0}},[e,s,f,o]);function P(){return l==="loading"?a(rt,{message:t.newsLoading,strings:t}):l==="error"?a(rt,{tone:"error",message:u,onRetry:()=>m(v=>v+1),strings:t}):_.length===0?a(rt,{message:t.newsEmpty,strings:t}):a("div",{class:`${Ct}-news-list`,children:_.map(v=>a("button",{type:"button",class:`${Ct}-news-card`,onClick:()=>r.push({kind:"content",id:v.id,title:v.title}),"data-testid":Le(R.newsItem,v.id),children:[v.image?a("img",{class:`${Ct}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,a("span",{class:`${Ct}-news-body`,children:[a("span",{class:`${Ct}-news-title`,children:v.title}),v.description?a("span",{class:`${Ct}-news-summary`,children:v.description}):null]})]},v.id))})}return a("div",{class:`${Ct}-module`,children:[a(ro,{title:t.newsTitle,actions:a(st,{panelProps:i,variant:"plain"})}),a("div",{class:`${Ct}-module-scroll`,children:P()})]})}var Yc={Icon:Pl,Root:e=>a(ym,{...e})};var io={chat:Hc,home:Xc,help:Gc,news:Yc};var Hn=w.cssPrefix;function Jc({modules:e,activeTab:t,strings:n,hasUnread:r,onSelect:o}){return a("nav",{class:`${Hn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let s=io[i.layout].Icon,l=i.id===t,c=i.layout==="chat"&&r;return a("button",{type:"button",role:"tab","aria-selected":l,class:`${Hn}-tab`,onClick:()=>o(i.id),"data-testid":Le(R.tab,i.id),children:[a("span",{class:`${Hn}-tab-icon`,"aria-hidden":"true",children:[a(s,{}),c?a("span",{class:`${Hn}-tab-badge`,"data-testid":R.tabBadge,"aria-label":"Unread"}):null]}),a("span",{class:`${Hn}-tab-label`,children:ze(n,i.label)})]},i.id)})})}var Qc=w.cssPrefix,Pm="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function Zc({url:e,title:t,strings:n,onBack:r,actions:o}){return a("div",{class:`${Qc}-module`,children:[a(oo,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:r,actions:o}),a("iframe",{class:`${Qc}-content-frame`,src:e,title:t||"content",sandbox:Pm,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Un=w.cssPrefix,xm=Z.scope("content"),Sm=5e3;function ed({id:e,title:t,transport:n,strings:r,bus:o,onBack:i,actions:s}){let[l,c]=$(null),[u,p]=$(!1),[_,d]=$(0),f=N(()=>{p(!1),c(null),d(v=>v+1)},[]);M(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(g=>{if(v)return;let k=g.items[0];k?(c(k),o.emit("contentOpen",{contentId:e,tags:k.tags?.length?k.tags.join(","):void 0})):p(!0)}).catch(g=>{v||(xm.warn("listContent (reader) failed",{err:g}),p(!0))}),()=>{v=!0}},[n,e,_,o]),M(()=>{if(!l)return;let v=setTimeout(()=>o.emit("contentRead",{contentId:e}),Sm);return()=>clearTimeout(v)},[l,e,o]);let m=N(v=>{let k=v.target?.closest?.("a")?.getAttribute("href")??"";k&&!k.startsWith("#")&&o.emit("contentLinkClick",{contentId:e})},[o,e]);function P(){return u?a(rt,{tone:"error",message:r.errorGeneric,onRetry:f,strings:r}):l===null?a(rt,{message:r.contentLoading,strings:r}):a("article",{class:`${Un}-content`,"data-testid":R.contentView,onClick:m,children:[l.image?a("img",{class:`${Un}-content-hero`,src:l.image,alt:"",loading:"lazy"}):null,l.description?a("p",{class:`${Un}-content-subtitle`,children:l.description}):null,a(mc,{text:l.content??""})]})}return a("div",{class:`${Un}-module`,children:[a(oo,{title:l?.title||t||r.moduleBack,backLabel:r.moduleBack,onBack:i,actions:s,testid:R.backHeader}),a("div",{class:`${Un}-module-scroll`,"data-testid":R.contentScroll,children:P()})]})}var so=w.cssPrefix;function td({panelProps:e,enabledModules:t,nav:n,bus:r,hasUnread:o,onSelectConversation:i,onStartNewConversation:s,onSetPanelSize:l}){let c=e.options,u=c.strings,p=B(null),_=B(new Set);M(()=>{let A=p.current;if(!A)return;let ae=Ur(A),ce=ie=>{ie.key==="Escape"&&e.onClose?.()};return A.addEventListener("keydown",ce),()=>{ae(),A.removeEventListener("keydown",ce)}},[e.onClose]);let d=gt(()=>n.sig.value).value,f=Fc(d),m=c.modules.byId[d.activeTab],P=e.composerActive&&m?.layout==="chat"&&f===void 0,v=e.composerApiRef,g=P&&e.view==="chat"&&e.canSend&&!e.activeForm&&!e.sendPreparing&&e.options.features.fileUpload,k=N(A=>{g&&v.current?.attachFromDrop(A)},[v,g]),{visible:h}=Wr({containerRef:p,onDrop:k,disabled:!g});Br(p.current,c.mode==="modal");let x=f?.kind==="iframe"||f?.kind==="content",C=t.length>1&&(Bc(d)||!x),I=B(null);M(()=>{if(x&&I.current===null)I.current=e.panelSize,e.panelSize==="normal"&&l("expanded");else if(!x&&I.current!==null){let A=I.current;I.current=null,l(A)}},[x]);let z={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:A=>{let ae=t.find(ce=>ce.layout===A);ae&&n.switchTab(ae.id)},selectConversation:i,startNewConversation:s},K=A=>({options:c,transport:e.transport,strings:u,config:A,visitorId:e.visitorId,nav:z,bus:r,panelProps:e}),W=a(st,{panelProps:e,variant:"plain"});m&&_.current.add(m.id);let L=t.filter(A=>_.current.has(A.id)),F=A=>{if(A.layout==="chat")return a(Ta,{...e,composerActive:P,containerEl:p.current,dragOver:h,composerAttachApiRef:v});let ae=io[A.layout].Root;return ae?a(ae,{...K(A)}):null},V=()=>f?.kind==="iframe"?a(Zc,{url:f.url,title:f.title,strings:u,onBack:n.pop,actions:W}):f?.kind==="content"?a(ed,{id:f.id,title:f.title,transport:e.transport,strings:u,bus:r,onBack:n.pop,actions:W}):null;return a("div",{ref:p,class:`${so}-panel ${so}-messenger`,role:"dialog","aria-modal":"false","aria-label":u.panelTitle,style:{position:"relative"},"data-testid":R.messengerHome,children:[a("div",{class:`${so}-messenger-body`,children:[L.map(A=>a("div",{class:`${so}-messenger-pane`,hidden:x||A.id!==m?.id,children:F(A)},A.id)),V()]}),C?a(Jc,{modules:t,activeTab:d.activeTab,strings:u,hasUnread:o,onSelect:n.switchTab}):null,a(Ia,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(m?.layout==="chat"&&!f)?a(Fr,{panelEl:p.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:u}):null]})}var zn=w.cssPrefix;function nd({strings:e,onClose:t}){return a("div",{class:`${zn}-panel ${zn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":R.modulesEmpty,children:[t?a("button",{type:"button",class:`${zn}-icon-btn ${zn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:a(it,{})}):null,a("p",{class:`${zn}-modules-empty-text`,children:e.modulesEmpty})]})}function fn(e,t,n,r){let o={role:n,text:r};e.emit("message",o),t.onMessage?.(o)}var Ma=Z.scope("hitl");function rd(e){let{streaming:t,controlModeSig:n,messagesSig:r,sendAiTurn:o,bus:i,humanInLoop:s}=e,l=B(t);l.current=t;let c=N((d,f,m)=>{if(l.current||n.value!=="ai-agent")return!1;let P=r.value.at(-1),v=P?.partsSig.value.findIndex(k=>k.kind==="tool"&&k.toolCallId===d)??-1,g=P?.partsSig.value[v];return!P||g?.kind!=="tool"?(Ma.warn("decideTool: tool part not found",{toolCallId:d}),!1):P.status!=="complete"||!Tr(P,v)||!f(g)?!1:(m(g),P.partsSig.value=[...P.partsSig.value],$t(P)&&(P.status="streaming",P.retryAction={kind:"continue-assistant",messageId:P.serverMessageId??P.id},P.awaitingContinuation=!0,r.value=[...r.value],o({continueExisting:!0})),!0)},[n,r,o]),u=N((d,f,m)=>{let P=!1;if(c(d,g=>g.stateSig.value==="approval-requested",g=>{P=jr(g.toolName);let k=g.approvalSig.value?.id??d;g.approvalSig.value={id:k,approved:f,reason:m},g.stateSig.value="approval-responded"})){if(P){Ma.info("toolResult",{toolCallId:d}),i.emit("toolResult",{toolCallId:d});return}Ma.info("toolDecision",{toolCallId:d,approved:f}),i.emit("toolDecision",{toolCallId:d,approved:f})}},[i,c]),p=N(d=>{c(d,f=>f.stateSig.value==="approval-responded"&&f.approvalSig.value?.approved!==void 0,f=>{let m=f.approvalSig.value?.id??d;f.approvalSig.value={id:m},f.stateSig.value="approval-requested"})},[c]);return{toolInteraction:Q(()=>({humanInLoop:s,onDecision:u,onEdit:p}),[s,u,p])}}function od({callout:e,persistence:t}){let n=e?.text??"",r=e?.persistent??!0,[o,i]=$(()=>r?!1:t.loadCalloutDismissed(n));M(()=>{i(r?!1:t.loadCalloutDismissed(n))},[n,r,t]);let s=N(()=>{i(!0),r||t.saveCalloutDismissed(n)},[t,n,r]);return{dismissed:o,dismissCallout:s}}function ad(e){let{transport:t,conversationIdSig:n}=e,r=at("ai-agent"),o=at(void 0),i=at(void 0),s=B(),l=N(_=>{let d=_.controlRevision??0,f=s.current;f&&f.conversationId===n.value&&d<f.revision||(s.current={conversationId:n.value,revision:d},r.value=_.controlMode,o.value=_.assignedOperatorInitials,_.controlMode!=="awaiting_operator"?i.value=void 0:_.operatorAvailable!==void 0&&(i.value=_.operatorAvailable))},[n,r,o,i]),c=N(_=>{_.type==="data-control-state"&&l(Pt(_.data))},[l]),u=N(async()=>{let _=n.value,d=await t.requestOperator();d&&n.value===_&&l(Pt(d))},[t,n,l]),p=N(async()=>{let _=n.value,d=await t.cancelOperatorRequest();d&&n.value===_&&l(Pt(d))},[t,n,l]);return{controlModeSig:r,assignedOperatorInitialsSig:o,operatorAvailableSig:i,applyControlState:l,adoptControlStateChunk:c,requestOperator:u,cancelOperatorRequest:p}}function id(e){let{hostElement:t,mode:n,panelSize:r,isOpen:o,setIsOpen:i}=e;ot(()=>{ur(t,Pr(n,r,o))},[t,o,r,n]),M(()=>{if(n!=="modal"||!o)return;let s=l=>{l.composedPath().some(u=>u instanceof HTMLElement&&u.classList.contains(`${w.cssPrefix}-panel`))||i(!1)};return t.addEventListener("click",s),()=>t.removeEventListener("click",s)},[t,o,n,i]),M(()=>{if(n!=="drawer"||!o)return;let s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[o,n,i])}var La=Z.scope("reducer"),lo=class{constructor(t,n){ee(this,"messagesSig",t);ee(this,"onReconcileNeeded",n);ee(this,"active",null);ee(this,"openTextParts",new Map);ee(this,"partSeq",0);ee(this,"replay",null)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.replay=null,this.openTextParts.clear()}beginReplay(t,n){let r=vt();r.id=t.id;let o=Gt(t)||Ft(t)&&(t.status!=="streaming"||$t(t)),i=t.status==="streaming"&&$t(t)&&En(t);this.replay={baseline:t,shadow:r,chunks:[n],probeContinuation:o,continuationTailReplay:i,liveCatchUp:t.status==="streaming"&&!o},this.attach(r),this.apply(n)}refreshReplayBaseline(){let t=this.replay;if(!t)return null;let n=t.shadow.serverMessageId??t.baseline.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t.baseline||o?.id===t.baseline.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t.baseline)??r.find(l=>l.id===t.baseline.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t.baseline)return t;let s=t.baseline;return t.baseline=i,sd(s,i),t.liveCatchUp&&Gt(t.shadow)&&(i.status==="streaming"||Ft(i))?(t.probeContinuation=!1,t.continuationTailReplay=!1,t):(t.probeContinuation=Gt(i)||Ft(i)&&(i.status!=="streaming"||$t(i)),t.continuationTailReplay=i.status==="streaming"&&$t(i)&&En(i),t.liveCatchUp=i.status==="streaming"&&!t.probeContinuation,t)}refreshActive(){let t=this.active;if(!t)return null;let n=t.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t||o?.id===t.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t)??r.find(l=>l.id===t.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t)return t;sd(t,i);let s=Gt(t)&&Ft(i);return i.status!=="streaming"&&!s?(this.detach(),null):(this.replay={baseline:i,shadow:t,chunks:[],probeContinuation:!1,continuationTailReplay:!1,liveCatchUp:!0},t)}promoteReplay(){let{baseline:t,shadow:n}=this.replay;return t.role=n.role,t.serverMessageId=n.serverMessageId,t.operatorInitials=n.operatorInitials,t.status=n.status,n.canceled&&(t.canceled=!0),t.finishReason=n.finishReason,t.errorText=n.errorText,t.suggestions=n.suggestions??t.suggestions,t.partsSig.value=n.partsSig.value,this.replay=null,this.active=t,this.messagesSig.value=[...this.messagesSig.value],t}promoteContinuation(t=!1){let{baseline:n,chunks:r}=this.replay,o=Ir(n);return this.replay=null,ft(()=>{if(t){let i=n.partsSig.value.findLastIndex(s=>s.kind==="tool");n.partsSig.value=n.partsSig.value.slice(0,i+1)}n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n);for(let i of r)this.apply(i);n.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}settleOwnedContinuation(t){let{baseline:n}=this.replay,r=Ir(n);return this.replay=null,ft(()=>{n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n),this.apply(t),n.continuationStreaming=r||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}applyResume(t){if(t.type==="start"){let o=(this.replay?.baseline??this.active)?.serverMessageId;o!==void 0&&t.messageId!==void 0&&o!==t.messageId&&this.onReconcileNeeded?.({messageId:o,waitFor:"terminal"}),this.detach();let i=t.messageId,s=i!==void 0?this.messagesSig.value.find(p=>p.serverMessageId===i||p.id===i):void 0;if(s!==void 0)return t.messageMetadata?.senderRole==="visitor"&&s.role==="user"&&(s.status==="pending"||s.status==="error")&&(s.serverMessageId=i,s.status="complete",s.errorText=void 0,s.retryAction=void 0,this.messagesSig.value=[...this.messagesSig.value]),this.beginReplay(s,t),null;let l=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(l===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!St(c))return this.attach(c),this.apply(t),null;let u=vt();return this.attach(u),this.messagesSig.value=[...this.messagesSig.value,u],this.apply(t),null}if(this.replay){let r=this.refreshReplayBaseline();if(!r)return null;r.chunks.push(t),t.type==="data-control-state"&&(r.baseline.operatorRoutedTurn=t.data.controlMode!=="ai-agent"),this.apply(t);let{baseline:o,shadow:i,probeContinuation:s,continuationTailReplay:l,liveCatchUp:c}=r,u=t.type==="finish"||t.type==="error"||t.type==="abort";if(s){if(!Cm(o,i,t))return u&&(Em(o,i)&&(o.continuationStreaming=!0,this.messagesSig.value=[...this.messagesSig.value],this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id,waitFor:"continuation"})),this.detach()),null;let _=Gt(o)&&u?this.settleOwnedContinuation(t):this.promoteContinuation();return u?(_.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:_.serverMessageId??_.id,waitFor:"continuation"}):_.continuationStreaming=!1),this.detach(),_):null}if(l&&wm(o,i)){let _=this.promoteContinuation(!0);return u?(this.detach(),_):null}if(!c)return u&&this.detach(),null;if(u&&!St(o)&&St(i)){let _=this.promoteReplay();return this.detach(),_}if(!km(o,i))return u&&(this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id,waitFor:"terminal"}),this.detach()),null;let p=this.promoteReplay();return u?(this.detach(),p):null}let n=this.refreshActive();if(!n)return null;if(this.replay)return this.applyResume(t);if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let r=n;return r.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:r.serverMessageId??r.id,waitFor:"continuation"}):r.continuationStreaming=!1),this.detach(),r}return null}ensureTextPart(t,n,r){let o=`${n}:${r}`,i=this.openTextParts.get(o);if(i)return i;let s={kind:n,id:`${r}#${this.partSeq++}`,textSig:X(""),doneSig:X(!1)};return this.openTextParts.set(o,s),qn(t,s),s}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let r=t.messageMetadata;r?.senderRole==="operator"?(n.role="operator",r.operatorInitials&&(n.operatorInitials=r.operatorInitials)):r?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":qn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":La.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",n.retryAction=void 0,t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":La.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"abort":La.debug("stream abort chunk (canceled)"),n.status="complete",n.canceled=!0,n.retryAction=void 0,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let r=this.ensureTextPart(n,"text",t.id);r.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let r=this.ensureTextPart(n,"reasoning",t.id);r.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-input-error":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":Am(n,t);return;case"file":qn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":ld(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":ld(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-suggestions":n.suggestions=kr(t.data);return;case"data-control-state":n.operatorRoutedTurn=t.data.controlMode!=="ai-agent";return;default:{let r=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value.includes(t)&&(this.messagesSig.value=[...this.messagesSig.value])}},Oa={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function Gt(e){return e.awaitingContinuation===!0||e.continuationStreaming===!0||e.retryAction?.kind==="continue-assistant"}function sd(e,t){e.canceled&&(t.canceled=!0),!(!Gt(e)||t.status!=="streaming"&&!Ft(t))&&(t.awaitingContinuation??(t.awaitingContinuation=e.awaitingContinuation),t.continuationStreaming??(t.continuationStreaming=e.continuationStreaming),t.retryAction===void 0&&(t.retryAction=e.retryAction))}function km(e,t){let n=e.partsSig.value,r=t.partsSig.value;return e.role!==t.role||r.length<n.length?!1:n.every((o,i)=>cd(o,r[i]))}function wm(e,t){let n=e.partsSig.value,r=n.findLastIndex(l=>l.kind==="tool"),o=new Set(n.slice(0,r+1).flatMap(l=>l.kind==="tool"?[l.toolCallId]:[])),i=t.partsSig.value.filter(l=>l.kind!=="tool"||!o.has(l.toolCallId)),s=n.slice(r+1);return i.length<s.length?!1:s.every((l,c)=>cd(l,i[c]))}function cd(e,t){switch(e.kind){case"text":case"reasoning":return t?.kind===e.kind&&t.textSig.value.startsWith(e.textSig.value);case"step-start":return t?.kind==="step-start";case"tool":{if(t?.kind!=="tool"||t.toolCallId!==e.toolCallId||!Er(t.toolName,e.toolName)||Oa[t.stateSig.value]<Oa[e.stateSig.value])return!1;let n=e.approvalSig.value?.approved;return n===void 0||t.approvalSig.value?.approved===n}case"file":return t?.kind==="file"&&t.url===e.url&&t.mediaType===e.mediaType;case"source":return t?.kind==="source"&&t.sourceId===e.sourceId&&t.url===e.url&&t.title===e.title&&t.filename===e.filename&&t.mediaType===e.mediaType;default:return e}}function Cm(e,t,n){return Rm(e,n)||!Tm(e,t)?!0:n.type!=="finish"&&n.type!=="error"&&n.type!=="abort"?!1:En(t)||e.awaitingContinuation===!0&&n.type!=="finish"?!0:e.awaitingContinuation===!0&&t.partsSig.value.every(r=>r.kind==="step-start")}function Rm(e,t){if(t.type!=="tool-output-available"&&t.type!=="tool-output-error"&&t.type!=="tool-output-denied")return!1;let n=e.partsSig.value.find(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId);return n!==void 0&&Oa[n.stateSig.value]<4}function Tm(e,t){let n=t.partsSig.value;if(n.length===0)return!0;let r=e.partsSig.value;return r.some((o,i)=>n.every((s,l)=>Im(r[i+l],s)))}function Im(e,t){switch(t.kind){case"text":case"reasoning":return e?.kind===t.kind&&e.textSig.value.startsWith(t.textSig.value);case"step-start":return e?.kind==="step-start";case"tool":return e?.kind==="tool"&&e.toolCallId===t.toolCallId&&(t.toolName==="tool"||Er(e.toolName,t.toolName));case"file":return e?.kind==="file"&&e.url===t.url&&e.mediaType===t.mediaType;case"source":return e?.kind==="source"&&e.sourceId===t.sourceId&&e.url===t.url&&e.title===t.title&&e.filename===t.filename&&e.mediaType===t.mediaType;default:return t}}function Em(e,t){if(Gt(e)||!Ft(e))return!1;let n=new Set(e.partsSig.value.filter(o=>o.kind==="tool").map(o=>o.toolCallId));return!t.partsSig.value.some(o=>o.kind==="tool"&&n.has(o.toolCallId))}function Rt(e,t,n,r){let o=e.partsSig.value.find(s=>s.kind==="tool"&&s.toolCallId===t);if(o)return r&&(o.dynamic=!0),o;let i={kind:"tool",toolCallId:t,toolName:n??"tool",dynamic:r?!0:void 0,inputPartialSig:X(""),inputSig:X(void 0),outputSig:X(void 0),errorSig:X(void 0),stateSig:X("input-streaming"),approvalSig:X(void 0)};return qn(e,i),i}function qn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function ld(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||qn(e,t)}function Am(e,t){switch(t.type){case"tool-input-start":Rt(e,t.toolCallId,t.toolName,t.dynamic);return;case"tool-input-delta":{let n=Rt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=Rt(e,t.toolCallId,t.toolName,t.dynamic);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-input-error":{let n=Rt(e,t.toolCallId,t.toolName,t.dynamic);n.inputSig.value=t.input,n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-approval-request":{let n=Rt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=Rt(e,t.toolCallId,void 0,t.dynamic);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=Rt(e,t.toolCallId,void 0,t.dynamic);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=Rt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function dd(e){let t=1e3;for(;!e.signal.aborted;){let n,r="held";try{r=await e.connect(()=>{n=e.now(),e.backfill()})}catch{}if(e.signal.aborted||r==="unavailable")return;n!==void 0&&e.now()-n>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var Na=Z.scope("resume-stream"),Mm=2500,Lm=30,Om=2e3,Nm=8,Dm=400,$m=200,Fm=1200;function ud(e){let{activated:t,conversationReady:n,conversationIdSig:r,messagesSig:o,streamingRef:i,optionsRef:s,isChatActiveRef:l,transport:c,visitorId:u,adoptControlStateChunk:p,settleSuggestions:_,markActiveConversationRead:d,onReplyLanded:f,runCancellation:m,setCanSend:P,feedback:v,bus:g,homeNav:k}=e;M(()=>{if(!t||!n||!r.value)return;let h=r.value,x=new AbortController,C=b=>{},I=new lo(o,b=>C(b));c.primeIdentity(u,h),Na.debug("resume stream opened",{conversationId:h});let z=!1,K=!1,W,L,F=0,V=0,A=(b,E)=>{(b||!m.localSendRef.current)&&m.settle(E),b&&(d(),f())},ae=(b,E=[],O=!1,Y)=>{let ne=s.current;if(b.canceled){A(O,Y),o.value=[...o.value];return}let fe=b.status==="error";switch(Gs(b,fe)){case"drop":o.value=o.value.filter(be=>be!==b);break;case"complete-operator-routed":b.status="complete",O&&(v.play("messageReceived"),fn(g,ne,"assistant",Ae(b)));break;case"error":{if(b.status="error",b.errorText=ne.strings.errorGeneric,O){v.play("error");let be=new Error(fe?"stream error chunk":"empty reply");g.emit("error",be),ne.onError?.(be)}break}case"complete":b.status="complete",O&&(v.play("messageReceived"),fn(g,ne,"assistant",Ae(b))),_(b,E);break}A(O,Y),o.value=[...o.value]},ce=b=>{if(x.signal.aborted||r.value!==h)return;if(p(b),b.type==="start"){let be=L?.senderRole==="visitor"?L.messageId:void 0;if(L={messageId:b.messageId,senderRole:b.messageMetadata?.senderRole},F+=1,z=b.messageMetadata?.senderRole===void 0,K=!1,W=z?b.messageMetadata?.runId:void 0,z){let Re=b.messageId!==void 0&&o.value.some(Ge=>Ge.serverMessageId===b.messageId||Ge.id===b.messageId),tt=o.value.at(-1),Ze=b.messageId!==void 0&&(tt?.serverMessageId===b.messageId||tt?.id===b.messageId),Tt=m.localSendRef.current&&(!Re||Ze)&&tt?.role==="assistant"&&tt.status==="streaming"&&(Ze||tt.serverMessageId===void 0&&tt.partsSig.value.length===0);K=m.captureStart(h,b,Tt,be)}}z&&(V+=1);let E=z&&(b.type==="finish"||b.type==="error"||b.type==="abort"),O=E?W:void 0,Y=E&&(K||m.ownsLocalRun(O));E&&(z=!1,K=!1,W=void 0);let ne=o.value.length,fe=I.applyResume(b);if(b.type==="finish"&&b.canContinue===!1&&P(!1),o.value.length>ne){let be=s.current.modules.list.find(Re=>Re.layout==="chat")?.id;be&&k?.switchTab(be)}if(!fe){E&&(Y||!m.localSendRef.current)&&m.settle(O);return}if(fe.role==="operator"){v.play("messageReceived"),fn(g,s.current,"operator",Ae(fe)),!document.hidden&&l.current()&&c.markRead(h).catch(()=>{}),E&&(Y||!m.localSendRef.current)&&m.settle(O);return}fe.role==="assistant"&&ae(fe,[],Y,O)},ie=async b=>{let E=F,O=await c.loadConversation(h,b?[b]:[]).catch(()=>null);if(x.signal.aborted||r.value!==h||!O)return!1;O.controlState&&p({type:"data-control-state",data:O.controlState});let Y=o.value.at(-1),ne=E===F&&(b===void 0||Y!==void 0&&(Y.serverMessageId===b||Y.id===b));if(!O.messages?.length)return!1;ne&&P(O.canContinue??!0);let fe=o.value,be=b===void 0?fe.at(-1):fe.find(Ge=>Ge.serverMessageId===b||Ge.id===b),{messages:Re,changed:tt}=An(fe,xt(O.messages));if(!tt)return!1;o.value=Re;let Ze=b===void 0?Re.at(-1):Re.find(Ge=>Ge.serverMessageId===b||Ge.id===b),Tt=be?.role==="assistant"&&be.status==="streaming"&&Ze?.role==="assistant"&&Ze.status!=="streaming"&&Ze.id===be.id;return ne&&Tt?ae(Ze,O.suggestions??[],m.localSendRef.current):ne&&Ze?.role==="assistant"&&Ze.status!=="streaming"&&_(Ze,O.suggestions??[]),!0},we,xe=b=>{if(!o.value.some(O=>O.serverMessageId===b||O.id===b))return Promise.resolve(!1);if(we)return we.messageId===b?we.promise:Promise.resolve(!1);let E=ie(b).finally(()=>{we?.promise===E&&(we=void 0)});return we={messageId:b,promise:E},E},De=new Set;C=({messageId:b,waitFor:E})=>{De.has(b)||(De.add(b),(async()=>{try{for(let O=0;O<Nm&&!x.signal.aborted;O++){await xe(b);let Y=o.value.find(ne=>ne.serverMessageId===b||ne.id===b);if(E==="terminal"&&!na(Y)||E==="continuation"&&!Y?.continuationStreaming||x.signal.aborted)return;await sn(Math.min(Dm+O*$m,Fm),x.signal)}x.signal.aborted||Na.warn("durable turn reconcile did not land",{conversationId:h,messageId:b})}finally{De.delete(b)}})())};let He=Number.NEGATIVE_INFINITY,Ee,Ue,Ce=!1,ge=()=>{if(x.signal.aborted||r.value!==h)return;if(Ue){Ce=!0;return}He=performance.now();let b=ie();Ue=b;let E=()=>{Ue===b&&(Ue=void 0,Ce&&(Ce=!1,ge()))};b.then(E,E)};dd({signal:x.signal,now:()=>performance.now(),sleep:b=>sn(b,x.signal),connect:b=>c.connectResumeStream({signal:x.signal,onChunk:ce,onConnected:b}),backfill:()=>{let b=performance.now(),E=Om-(b-He);if(E<=0){Ee!==void 0&&clearTimeout(Ee),Ee=void 0,ge();return}Ee??(Ee=setTimeout(()=>{Ee=void 0,ge()},E))}});let qe=b=>b.partsSig.value.reduce((E,O)=>E+(O.kind==="text"||O.kind==="reasoning"?O.textSig.value.length:1),0),Qe=0,S=-1,q=V,oe=setInterval(()=>{if(x.signal.aborted||r.value!==h)return;let b=o.value.at(-1);i.current&&b?.role==="assistant"&&b.status!=="streaming"&&m.settle();let E=b?.serverMessageId;if(!(!m.localSendRef.current&&na(b))||!E){Qe=0,S=-1,q=V;return}let Y=qe(b);if(V!==q||Y!==S){q=V,S=Y,Qe=0;return}Qe++>=Lm||xe(E).then(ne=>{ne&&(Qe=0)})},Mm);return()=>{x.abort(),Ee!==void 0&&clearTimeout(Ee),clearInterval(oe),I.detach(),Na.debug("resume stream closed",{conversationId:h})}},[t,n,r,r.value,u,c,p,_,d,f,m,P,o,g,v,k])}var Bm=32;function _d(e){let{transport:t,setStreaming:n}=e,r=B(),o=B(),i=B(!1),s=B(),l=B(!1),c=B(new Map),u=B(new Set),p=N((C,I)=>{let z=`${C}:${I}`;s.current!==z&&(s.current=z,t.cancelTurn(C,I))},[t]),_=N(C=>{r.current=void 0,o.current=C,i.current=!1,s.current=void 0,l.current=!0,n(!0)},[n]),d=N((C,I)=>{c.current.set(C,{messageId:I})},[]),f=N(C=>{C!==void 0&&(u.current.add(C),u.current.size>Bm&&u.current.delete(u.current.values().next().value)),!(C!==void 0&&r.current?.runId!==C)&&(r.current=void 0,o.current=void 0,i.current=!1,l.current=!1,n(!1))},[n]),m=N((C,I)=>o.current!==C?I.runId&&r.current?.runId===I.runId?(r.current={conversationId:I.conversationId,runId:I.runId},i.current&&p(I.conversationId,I.runId),!0):!1:(o.current=void 0,I.runId?(r.current={conversationId:I.conversationId,runId:I.runId},n(!0),i.current&&p(I.conversationId,I.runId),!0):(f(),!0)),[p,n,f]),P=N((C,I)=>{let z=c.current.get(C);return z?(c.current.delete(C),!I.runId||u.current.has(I.runId)?!0:z.runId!==void 0?(z.runId!==I.runId||r.current?.runId===I.runId&&(r.current={conversationId:I.conversationId,runId:I.runId},i.current&&p(I.conversationId,I.runId)),!0):(l.current||o.current||(r.current={conversationId:I.conversationId,runId:I.runId},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0)),!0)):!1},[p,n]),v=N(C=>o.current!==C?!1:(f(),!0),[f]),g=N(C=>{let I=c.current.get(C);return I?(c.current.delete(C),I.runId===void 0):!1},[]),k=N((C,I,z,K)=>{let W=I.messageMetadata?.runId;if(I.messageMetadata?.senderRole!==void 0||typeof W!="string"||!W||u.current.has(W))return!1;if(r.current?.runId===W)return l.current;if(l.current)return r.current||!z?!1:(o.current=void 0,r.current={conversationId:C,runId:W},n(!0),i.current&&p(C,W),!0);let F=[...c.current.values()].filter(V=>V.runId===void 0).find(V=>V.messageId===K);return F?(F.runId=W,r.current={conversationId:C,runId:W},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0),!0):(o.current=void 0,r.current={conversationId:C,runId:W},n(!0),i.current&&p(C,W),l.current)},[p,n]),h=N(C=>typeof C=="string"&&r.current?.runId===C&&l.current,[]),x=N(()=>{let C=r.current;if(C)return i.current=!0,p(C.conversationId,C.runId),!0;let I=o.current;return I?(i.current=!0,I.then(z=>{z.runId&&p(z.conversationId,z.runId)}).catch(()=>{}),!0):!1},[p]);return Q(()=>({localSendRef:l,begin:_,beginRouted:d,acceptAck:m,acceptRoutedAck:P,reject:v,rejectRouted:g,captureStart:k,ownsLocalRun:h,settle:f,stop:x}),[m,P,_,d,k,h,v,g,f,x])}var Hm=Z.scope("send");function pd(e){return!(e instanceof $e)||e.code==="network"||e.status===void 0||e.status===202?!0:e.status===408||e.status===425||e.status===429||e.status>=500&&e.status<600}function fd(e){let{transport:t,messagesSig:n,conversationIdSig:r,options:o,bus:i,feedback:s,persistence:l,visitorId:c,adoptConversationId:u,applyControlState:p,setCanSend:_,settleSuggestions:d,runCancellation:f}=e,m=N(()=>{let g=r.value??et();return r.value||(r.value=g,l.saveConversationId(g)),g},[r,l]),P=N(async({continueExisting:g,turn:k})=>{let h=m(),x=n.value.at(-1),C=k?[k]:Bs(n.value,g),I=Jo({messages:C.map(ta),conversationId:h,visitorId:c,userPrefs:l.loadUserPrefs()}),z=t.sendTurn(I);f.begin(z);try{let K=await z;if(r.value!==h||!f.acceptAck(z,K))return;if(u(K.conversationId),!K.runId){let W=await t.loadConversation(K.conversationId).catch(()=>null);if(r.value!==K.conversationId)return;if(W){W.controlState&&p(W.controlState),_(W.canContinue??!0);let{messages:L,changed:F}=An(n.value,xt(W.messages??[]));F&&(n.value=L);let V=x?n.value.find(A=>A.id===x.id&&A.role==="assistant"&&A.status!=="streaming"):void 0;V&&d(V,W.suggestions??[]),!g&&x?.role==="assistant"&&n.value.includes(x)&&x.serverMessageId===void 0&&!St(x)&&(n.value=n.value.filter(A=>A!==x))}else if(x?.role==="assistant"&&n.value.includes(x)){x.status="error",x.errorText=o.strings.errorGeneric;let L=C[0];g?x.retryAction={kind:"continue-assistant",messageId:x.serverMessageId??x.id}:x.retryAction=L?.role==="user"?{kind:"resend-user",messageId:L.id}:null,n.value=[...n.value]}}}catch(K){if(r.value!==h||!f.reject(z))return;let W=Vt(K,o.strings),L=pd(K),F=k?.role==="assistant"?k:n.value.at(-1);if(g&&F?.role==="assistant"&&K instanceof $e&&K.status===409){let V=F.serverMessageId??F.id,A=await t.loadConversation(h,[V]).catch(()=>null);if(r.value!==h)return;if(A){A.controlState&&p(A.controlState),_(A.canContinue??!0);let ae=xt(A.messages??[]),ce=ae.find(ie=>(ie.serverMessageId??ie.id)===V);if(ce&&Vs(F,ce)){let{messages:ie,changed:we}=An(n.value,ae),xe=ie.find(De=>(De.serverMessageId??De.id)===V);if(we&&xe&&xe!==F){xe.awaitingContinuation=!1,xe.continuationStreaming=void 0,xe.retryAction=null,n.value=ie,xe.status!=="streaming"&&d(xe,A.suggestions??[]);return}}}if(!n.value.includes(F)||F.status!=="streaming")return;F.continuationStreaming=!0}if(g&&F?.role==="assistant")F.status="error",F.errorText=W,F.retryAction=L?{kind:"continue-assistant",messageId:F.serverMessageId??F.id}:null,n.value=[...n.value];else if(x?.role==="assistant"&&n.value.includes(x)){x.status="error",x.errorText=W;let V=C[0];x.retryAction=L&&V?.role==="user"?{kind:"resend-user",messageId:V.id}:null,n.value=[...n.value]}else{let V=vt();V.status="error",V.errorText=W;let A=C[0];V.retryAction=L&&A?.role==="user"?{kind:"resend-user",messageId:A.id}:null,n.value=[...n.value,V]}s.play("error"),i.emit("error",K),o.onError?.(K)}},[t,n,o,i,s,l,c,u,p,_,d,m,f]),v=N(async g=>{let k=m();g.status="pending",g.errorText=void 0,g.retryAction=void 0,n.value.includes(g)&&(n.value=[...n.value]);let h=Jo({messages:[ta(g)],conversationId:k,visitorId:c,userPrefs:l.loadUserPrefs()}),x=t.sendTurn(h);f.beginRouted(x,g.id);try{let C=await x;if(r.value!==k){f.rejectRouted(x);return}if(!f.acceptRoutedAck(x,C))return;u(C.conversationId),g.status==="pending"&&(g.status="complete",n.value.includes(g)&&(n.value=[...n.value]))}catch(C){let I=f.rejectRouted(x);if(r.value!==k)return;if(!I){g.status==="pending"&&(g.status="complete",n.value.includes(g)&&(n.value=[...n.value]));return}if(g.status!=="pending")return;Hm.debug("operator-routed send failed",{error:C});let z=C instanceof Error?C:new Error(String(C));g.status="error",g.errorText=Vt(C,o.strings),g.retryAction=pd(C)?{kind:"resend-user",messageId:g.id}:null,n.value.includes(g)&&(n.value=[...n.value]),s.play("error"),i.emit("error",z),o.onError?.(z)}},[t,n,o,i,s,l,c,u,m,f]);return{sendAiTurn:P,sendRoutedTurn:v}}var Um=Z.scope("unread"),zm=300;function md(e){let{transport:t,options:n,conversationIdSig:r,isChatActiveRef:o,activated:i,conversationReady:s}=e,l=at(!1),c=B(new Set),u=B();M(()=>()=>clearTimeout(u.current),[]);let p=N(()=>{let P=o.current()?r.value:void 0;l.value=[...c.current].some(v=>v!==P)},[l,r,o]),_=N(()=>{n.modules.list.some(P=>P.layout==="chat")&&t.listConversations({limit:50}).then(P=>{c.current=new Set(P.conversations.filter(v=>v.hasUnread).map(v=>v.conversationId)),p()}).catch(P=>Um.debug("refreshUnread failed (non-fatal)",{err:P}))},[t,n.modules,p]),d=N(P=>{c.current.delete(P),p()},[p]),f=N(()=>{if(!o.current())return;let P=r.value;P&&(clearTimeout(u.current),u.current=setTimeout(()=>{d(P),t.markRead(P)},zm))},[t,r,d,o]),m=B(!1);return M(()=>{!i||!s||m.current||(m.current=!0,_())},[i,s,_]),M(()=>{if(!i)return;let P=()=>{document.visibilityState==="visible"&&_()};return document.addEventListener("visibilitychange",P),()=>document.removeEventListener("visibilitychange",P)},[i,_]),{hasUnreadSig:l,refreshUnread:_,clearUnread:d,markActiveConversationRead:f}}var Vn=Z.scope("settings");function gd(e){let{options:t,persistence:n,transport:r,feedback:o,hostElement:i,bus:s}=e,l=n.loadUserPrefs(),[c,u]=$(()=>l.locale??t.locale),[p,_]=$(()=>l.themeMode??t.themeMode),[d,f]=$(()=>l.textSize??t.textSize),m=N(x=>{n.patchUserPrefs(x),r.saveUserPrefs(n.loadUserPrefs()).catch(C=>Vn.warn("saveUserPrefs failed",{err:C}))},[n,r]);M(()=>{l.soundMuted!==void 0&&o.setMuted(l.soundMuted)},[]),M(()=>{i.dataset.theme=p},[i,p,t]),M(()=>{i.dataset.textSize=d},[i,d,t]),M(()=>{let x=!0;return o.mutedSig.subscribe(C=>{if(x){x=!1;return}m({soundMuted:C})})},[o,m]);let P=en(c,t.availableLocales,t.defaultLocale);M(()=>{r.setLocale(P)},[r,P]),M(()=>{i.dir=hi(P)?"rtl":"ltr"},[i,P]),M(()=>{P!==c&&u(P)},[P,c]);let v=N(x=>{Vn.info("localeChange",{locale:x}),u(x),m({locale:x}),s.emit("localeChange",x)},[m,s]),g=N(x=>{Vn.info("themeChange",{mode:x}),_(x),i.dataset.theme=x,m({themeMode:x}),s.emit("themeChange",x)},[i,m,s]),k=N(x=>{Vn.info("textSizeChange",{size:x}),f(x),i.dataset.textSize=x,m({textSize:x}),s.emit("textSizeChange",x)},[i,m,s]),h=N(()=>{o.toggleMuted();let x=o.mutedSig.value;Vn.info("soundToggle",{muted:x}),s.emit("soundToggle",{muted:x})},[o,s]);return{activeLocale:c,activeThemeMode:p,activeTextSize:d,effectiveLocale:P,setActiveLocale:u,setActiveThemeMode:_,setActiveTextSize:f,patchAndSync:m,handleLocaleChange:v,handleThemeChange:g,handleTextSizeChange:k,handleSoundToggle:h}}var me=Z.scope("app"),co=w.cssPrefix;function vd(e,t){return $s({...e,text:ze(t,e.text)})}function hd({options:e,hostElement:t,bus:n}){let[r]=$(()=>tn(e.widgetId,e.storage,e.aiAgentDeploymentId)),[o,i]=$(()=>r.getVisitorId()),s=r.loadUserPrefs(),l=at(r.loadConversationId()),c=at([]),[u,p]=$(!1),[_,d]=$([]);function f(){let y=e.modules.list,T=new Set(y.map(U=>U.id)),J=r.loadActiveModule();return J&&T.has(J)?J:y[0]?.id??""}function m(){return e.modules.list.find(y=>y.layout==="chat")?.id}function P(){let y=m();return y?e.modules.list.length===1?!0:k.sig.value.activeTab===y:!1}let v=B(P);v.current=P;let g=B();if(!g.current){let y=e.modules.list.map(T=>T.id);g.current=Dc(f(),y,T=>r.saveActiveModule(T))}let k=g.current,[h,x]=$(!1),[C,I]=$(null),[z,K]=$(!1),W=e.mode==="standalone"||e.mode==="inline",L=B(In(e,an(),r.loadPanelOpen(),r.loadPanelSize())),[F,V]=$(L.current.panelOpen),[A,ae]=$(L.current.panelOpen),ce=B(!1),ie=B(void 0);M(()=>{F&&ae(!0)},[F]);let we=B(!1),[xe,De]=$(!1),{dismissed:He,dismissCallout:Ee}=od({callout:e.launcher.callout,persistence:r}),Ue=e.launcher.callout?.persistent??!0,Ce=N(()=>{me.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Ee()},[n,Ee]),[ge,qe]=$(L.current.panelSize),Qe=B(!1),[S,q]=$("chat"),[oe,b]=$(!0),E=B(oe);E.current=oe;let[O,Y]=$(!1),ne=B(O);ne.current=O;let fe=B(null),[be,Re]=$(!1),[tt,Ze]=$(null),[Tt,Ge]=$([]),Wn=B(e.strings),$a=B(e);$a.current=e;let[Sd,kd]=$(void 0),[wd,Cd]=$(void 0),[Rd,Td]=$(()=>r.loadSidebarCollapsed()??!1),[po,Id]=$({}),[se]=$(()=>new Cr({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Cs({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[Ke]=$(()=>new Or(e.sound,e.haptics)),bt=_d({transport:se,setStreaming:Y}),{activeLocale:Gn,activeThemeMode:Fa,activeTextSize:Ba,effectiveLocale:Kt,setActiveLocale:Ed,setActiveThemeMode:Ad,setActiveTextSize:Md,patchAndSync:Ha,handleLocaleChange:Ld,handleThemeChange:Od,handleTextSizeChange:Nd,handleSoundToggle:Dd}=gd({options:e,persistence:r,transport:se,feedback:Ke,hostElement:t,bus:n}),{controlModeSig:ct,assignedOperatorInitialsSig:$d,operatorAvailableSig:Fd,applyControlState:jt,adoptControlStateChunk:Bd,requestOperator:Hd,cancelOperatorRequest:Ud}=ad({transport:se,conversationIdSig:l}),{hasUnreadSig:zd,refreshUnread:Ua,clearUnread:za,markActiveConversationRead:qd}=md({transport:se,options:e,conversationIdSig:l,isChatActiveRef:v,activated:A,conversationReady:h});M(()=>{Ke.update(e.sound,e.haptics)},[Ke,e.sound,e.haptics]),M(()=>()=>Ke.destroy(),[Ke]),M(()=>{Qe.current||!e.size.initialSize||(Qe.current=!0,!r.loadPanelSize()&&qe(Yo(e.mode,e.size,an())))},[e.mode,e.size,r]),M(()=>{if(!h||we.current)return;we.current=!0;let y=In(e,an(),r.loadPanelOpen(),r.loadPanelSize());V(y.panelOpen),qe(y.panelSize)},[h,e,r]);let qa=B(null);M(()=>{h&&k.reconcile(e.modules.list.map(y=>y.id),f())},[h,e.modules.list,k]);let Kn=N(y=>{!y||y.length===0||(c.value=y.map(T=>vd(T,Wn.current)))},[c]),fo=B(null),jn=N(async y=>{try{let{formSubmissions:T}=await(y?se.bootstrap(y):fo.current??se.bootstrap()),J=new Map;return T.forEach((U,te)=>J.set(U.formId,te)),T.filter((U,te)=>!U.skipped||J.get(U.formId)===te).map((U,te)=>({key:`wire:${U.formId}:${U.createdAt??te}`,formId:U.formId,outcome:U.skipped?"skipped":"submitted",createdAt:Sr(U.createdAt),values:U.values}))}catch(T){return me.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:T}),[]}},[se]),It=B(0),Xn=N((y,T)=>{let J=[...y.map(D=>D.createdAt),...T.map(D=>D.createdAt)].filter(D=>D!==void 0),U=(J.length?Math.min(...J):Date.now())-1;return[...(ie.current?.messages??[]).map(D=>{let je=vd(D,Wn.current);return je.createdAt=U,je}),...y]},[]),Va=N(async y=>{let T=It.current,J=()=>T!==It.current;p(!0);try{let[U,te]=await Promise.all([se.loadConversation(y),jn()]);if(J())return;let D=xt(U.messages??[]);if(d(te),c.value=Xn(qs(D,c.value),te),b(U.canContinue??!0),D.length){jt(Pt(U.controlState));let je=D.findLast(_e=>_e.role==="assistant"&&!_e.ephemeral);Ge(je?.suggestions??U.suggestions??[])}}catch(U){if(J())return;me.warn("loadThread failed; resetting conversationId",{err:U,conversationId:y}),l.value=void 0,r.saveConversationId(void 0)}finally{J()||p(!1)}},[se,jn,c,l,r,Xn]),mn=N(async({newConversation:y})=>{let T=++It.current,J=()=>T!==It.current,U=l.value,te=y||!U?et():U;te!==U&&(l.value=te,r.saveConversationId(te)),se.primeIdentity(o,te);let D;try{D=await se.handshake({visitorId:o,conversationId:te,userPrefs:r.loadUserPrefs(),locale:Gn})}catch(_e){if(J())return;n.emit("error",_e),e.onError?.(_e),y||x(!0);return}if(J())return;if(D.visitorId&&D.visitorId!==o&&(me.info("visitor rebound",{previous:o,current:D.visitorId,reason:D.rebind?.visitorId}),r.setVisitorId(D.visitorId),i(D.visitorId),n.emit("visitorRebound",{previous:o,current:D.visitorId,reason:D.rebind?.visitorId})),D.conversationId&&D.conversationId!==te&&(me.info("conversation rebound",{previous:te,current:D.conversationId,reason:D.rebind?.conversationId}),n.emit("conversationRebound",{previous:te,current:D.conversationId,reason:D.rebind?.conversationId})),D.agent&&Ze(D.agent),jt(Pt(D.controlState)),e.mode==="page"&&(D.site&&Ss(D.site)?kd(D.site):D.site&&me.warn("invalid site config, using fallback",{site:D.site}),D.blocks&&ks(D.blocks)?Cd(D.blocks):D.blocks&&me.warn("invalid blocks config, using fallback",{blocks:D.blocks})),D.userPrefs&&!y&&(r.saveUserPrefs(D.userPrefs),D.userPrefs.locale&&Ed(D.userPrefs.locale),D.userPrefs.soundMuted!==void 0&&Ke.setMuted(D.userPrefs.soundMuted),D.userPrefs.themeMode&&Ad(D.userPrefs.themeMode),D.userPrefs.textSize&&Md(D.userPrefs.textSize)),ie.current=D.welcome,y||n.emit("handshake",D),D.welcome?.suggestions){let _e=Wn.current;Ge(D.welcome.suggestions.map(Xe=>({...Xe,label:ze(_e,Xe.label),...Xe.text===void 0?{}:{text:ze(_e,Xe.text)}})))}!y&&U&&D.conversationId===U?ce.current=!0:(l.value=D.conversationId,r.saveConversationId(D.conversationId),Kn(D.welcome?.messages)),y||x(!0)},[se,o,r,e,n,l,Ke,Kn,Va,Gn]),gn=JSON.stringify(e.userContext??null),Vd=JSON.stringify(e.pageContext??null),Wd=JSON.stringify(po);M(()=>{let y=Object.keys(po).length?{...po,...e.userContext}:e.userContext;se.setContext(y,qm(e.pageContext))},[se,gn,Vd,Wd]);let Wa=N((y,T=[])=>Ge(y.suggestions??T),[]),Gd=N(y=>{if(!y||y===l.value)return;let T=l.value;l.value=y,r.saveConversationId(y),se.primeIdentity(void 0,y),me.info("conversation rebound",{previous:T,current:y}),T&&n.emit("conversationRebound",{previous:T,current:y,reason:y})},[l,r,se,n]);M(()=>(se.primeIdentity(o,l.value),mn({newConversation:!1}),()=>{It.current++}),[]);let Ga=B(!1);M(()=>{if(!(!A||!h||Ga.current)&&(Ga.current=!0,fo.current=se.bootstrap(),(async()=>{try{let y=await fo.current;I(kn((y??{forms:[]}).forms,Kt))}catch(y){me.debug("bootstrap failed \u2014 treating as no forms",{err:y})}finally{K(!0)}})(),ce.current)){ce.current=!1;let y=l.value;y&&Va(y)}},[A,h]);let Yn=B(null);M(()=>{if(!A||!h)return;if(Yn.current===null){Yn.current=Kt;return}if(Yn.current===Kt)return;Yn.current=Kt;let y=!1;return se.bootstrap().then(T=>{y||I(kn((T??{forms:[]}).forms,Kt))}).catch(T=>me.debug("forms re-localize failed \u2014 keeping current copy",{err:T})),()=>{y=!0}},[A,h,Kt,se]);let Ka=B(gn);M(()=>{!h||Ka.current===gn||(Ka.current=gn,mn({newConversation:!1}))},[gn,h,mn]),id({hostElement:t,mode:e.mode,panelSize:ge,isOpen:F,setIsOpen:V});let{sendAiTurn:Et,sendRoutedTurn:vn}=fd({transport:se,messagesSig:c,conversationIdSig:l,options:e,bus:n,feedback:Ke,persistence:r,visitorId:o,adoptConversationId:Gd,applyControlState:jt,setCanSend:b,settleSuggestions:Wa,runCancellation:bt}),{toolInteraction:Kd}=rd({streaming:O,controlModeSig:ct,messagesSig:c,sendAiTurn:Et,bus:n,humanInLoop:e.features.humanInLoop}),jd=N((y,T)=>{let J=c.value.find(U=>U.serverMessageId===y);J&&(J.feedback=T),me.info("messageFeedback",{messageId:y,value:T}),n.emit("messageFeedback",{messageId:y,value:T}),se.submitFeedback({messageId:y,value:T})},[n,c,se]),Xd=()=>c.value.reduce((y,T)=>y+(T.role==="user"?1:0),0),Xt=e.forms.list.length>0?e.forms:C??e.forms,Pe=Ac({forms:Xt,persistence:r,userContext:()=>e.userContext,messageCount:Xd,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>l.value,onComplete:(y,T,J,U)=>{me.info("formSubmit",{formId:y.id,trigger:T,skipped:U}),n.emit("formSubmit",{formId:y.id,values:J,skipped:U}),d(D=>{let _e=D.find(Xe=>Xe.formId===y.id&&Xe.outcome==="skipped")?.createdAt??Date.now();return[...D.filter(Xe=>!(Xe.formId===y.id&&Xe.outcome==="skipped")),{key:`local:${y.id}:${_e}`,formId:y.id,outcome:U?"skipped":"submitted",createdAt:_e,...U?{}:{values:J}}]});let te=l.value??et();l.value||(l.value=te,r.saveConversationId(te),se.primeIdentity(void 0,te)),!U&&y.mirrorToContext&&Id(D=>({...D,...J})),se.submitForm({formId:y.id,conversationId:te,trigger:T,values:J,skipped:U})}}),mo=gt(()=>Pe.activeForm.value),Yd=N(()=>Pe.fire("after-messages"),[Pe]);ud({activated:A,conversationReady:h,conversationIdSig:l,messagesSig:c,streamingRef:ne,optionsRef:$a,isChatActiveRef:v,transport:se,visitorId:o,adoptControlStateChunk:Bd,settleSuggestions:Wa,markActiveConversationRead:qd,onReplyLanded:Yd,runCancellation:bt,setCanSend:b,feedback:Ke,bus:n,homeNav:k}),M(()=>{Pe.refresh()},[Xt,Pe]);let ja=e.pageContext?.area?String(e.pageContext.area):void 0,Jd=gt(()=>c.value.length);M(()=>{h&&z&&Pe.fire("pre-chat")},[h,z,Pe]),M(()=>{z&&!oe&&Pe.fire("conversation-closed")},[z,oe,Pe]),M(()=>{h&&z&&ja&&Pe.fire("page-area")},[h,z,ja,Pe]);let go=Q(()=>{let y=Xt.list.flatMap(T=>T.triggers).filter(T=>T.kind==="idle").map(T=>Number(T.param));return y.length?Math.min(...y)*1e3:0},[Xt]);M(()=>{if(!go||!F)return;let y=setTimeout(()=>Pe.fire("idle"),go);return()=>clearTimeout(y)},[go,F,Pe,Jd.value]);let Xa=N(async(y,T)=>{if(fe.current)return!1;let J=l.value,U=ct.value!=="ai-agent";if(me.info("send",{textLen:y.length,attachments:T.length,streaming:ne.current,routedToOperator:U}),ne.current&&!U)return!1;let te=new AbortController,D={conversationId:J,controller:te};fe.current=D,Re(!0);try{Ke.unlock();let je=await Wm(se,T,te.signal,ko=>{te.signal.aborted||(me.warn("upload failed",{err:ko}),n.emit("error",ko),e.onError?.(ko))});if(te.signal.aborted||l.value!==J||!E.current||Pe.activeForm.value)return!1;let _e=ct.value!=="ai-agent";if(ne.current&&!_e||!y&&je.length===0)return!1;n.emit("send",{text:y,attachmentCount:T.length}),Tt.length>0&&Ge([]),Ke.play("messageSent");let Xe=ea(y,je);return fn(n,e,"user",y),_e?(c.value=[...c.value,Xe],vn(Xe),!0):(c.value=[...c.value,Xe,vt()],Et({continueExisting:!1}),!0)}finally{fe.current===D&&(fe.current=null,Re(!1))}},[se,n,e,Tt.length,c,l,Et,vn,ct]);M(()=>{let y=l.value;return()=>{let T=fe.current;!T||T.conversationId!==y||(fe.current=null,Re(!1),T.controller.abort())}},[l.value]),M(()=>{oe&&!mo.value||fe.current?.controller.abort()},[mo.value,oe]);let Qd=N(()=>{if(!bt.stop())return;me.info("stop"),n.emit("stop",void 0);let y=c.value.at(-1);y&&y.role!=="user"&&y.status==="streaming"&&(y.canceled=!0,c.value=[...c.value])},[bt,n,c]),Zd=N(y=>{if(O)return;let T=c.value,J=Ar(T,y);if(J)switch(me.info("retry",{kind:J.kind,messageId:J.messageId}),J.kind){case"continue-assistant":{if(ct.value!=="ai-agent"||y.role!=="assistant"||(y.serverMessageId??y.id)!==J.messageId)return;y.status="streaming",y.errorText=void 0,y.retryAction=void 0,y.awaitingContinuation=!0,c.value=[...T],Et({continueExisting:!0,turn:y});return}case"resend-user":{let U=T.find(D=>D.role==="user"&&D.id===J.messageId);if(!U)return;if(U.status="complete",U.errorText=void 0,U.retryAction=void 0,ct.value!=="ai-agent"){c.value=y.role==="assistant"?T.filter(D=>D!==y):[...T],vn(U);return}let te=vt();c.value=y.role==="assistant"?T.map(D=>D===y?te:D):[...T,te],Et({continueExisting:!1,turn:U});return}case"repeat-user":{let U=T.find(_e=>_e.role==="user"&&_e.id===J.messageId);if(!U)return;let te=ea(Ae(U),U.attachments?.map(_e=>({..._e}))??[]),D=new Set(te.attachments?.flatMap(_e=>_e.url?[_e.url]:[])??[]),je=U.partsSig.value.flatMap(_e=>_e.kind==="file"&&!D.has(_e.url)?[{..._e}]:[]);if(je.length>0&&(te.partsSig.value=[...te.partsSig.value,...je]),ct.value!=="ai-agent"){c.value=[...T,te],vn(te);return}c.value=[...T,te,vt()],Et({continueExisting:!1,turn:te});return}default:return J}},[O,c,ct,Et,vn]),hn=N(()=>{if(Ol(e.mode,ge)==="exit-fullscreen"){me.info("close \u2192 exit-fullscreen",{mode:e.mode}),qe("normal"),n.emit("fullscreen",!1);return}me.info("close \u2192 panel closed",{mode:e.mode}),Pe.fire("panel-close"),V(!1),r.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,r,ge,Pe]),vo=N(()=>{me.info("open",{mode:e.mode}),Ke.unlock(),De(!0),V(!0),r.savePanelOpen(!0),!He&&!Ue&&Ce(),setTimeout(()=>De(!1),Vm),Ua(),n.emit("open",void 0),e.onOpen?.()},[n,e,Ke,r,He,Ue,Ce,Ua]),ho=N(()=>{if(!c.value.some(T=>T.role==="user")&&oe&&l.value){me.info("clear \u2192 reusing empty conversation",{conversationId:l.value}),c.value.length===0&&Kn(ie.current?.messages);return}me.info("clear \u2192 new conversation",{wasStreaming:O}),n.emit("clear",void 0),bt.settle(),ft(()=>{c.value=[],l.value=void 0,jt({controlMode:"ai-agent",controlRevision:0})}),r.clearConversation(),b(!0),d([]),mn({newConversation:!0})},[O,c,l,r,mn,n,oe,Kn,bt,jt]),bo=N(()=>{ho(),q("chat");let y=e.modules.list.find(T=>T.layout==="chat")?.id;y&&k.switchTab(y)},[ho,k,e]),yo=N(()=>{let y=ge==="expanded"?"normal":"expanded";me.info("expand",{from:ge,expanded:y==="expanded"}),qe(y),r.savePanelSize(y),n.emit("expand",y==="expanded")},[n,ge,r]),Po=N(()=>{let y=ge==="fullscreen"?"normal":"fullscreen";me.info("fullscreen",{from:ge,fullscreen:y==="fullscreen"}),qe(y),r.savePanelSize(y),n.emit("fullscreen",y==="fullscreen")},[n,ge,r]),eu=N(()=>{q(y=>{let T=y==="history"?"chat":"history";return me.info("toggleHistory",{view:T}),n.emit("toggleHistory",{view:T}),T})},[n]),tu=N(()=>{Td(y=>{let T=!y;return me.info("sidebarToggle",{collapsed:T}),r.saveSidebarCollapsed(T),n.emit("sidebarToggle",{collapsed:T}),T})},[r,n]),nu=N(y=>{me.info("resize",y),Ha({widgetSize:y}),n.emit("resize",y)},[Ha,n]),xo=N(async y=>{let T=++It.current,J=()=>T!==It.current;me.info("selectConversation",{conversationId:y,wasStreaming:O}),n.emit("selectConversation",{conversationId:y});try{let[U,te]=await Promise.all([se.loadConversation(y),jn(y)]);if(J())return;bt.settle();let D=xt(U.messages);ft(()=>{c.value=Xn(D,te),l.value=U.conversationId}),d(te),r.saveConversationId(U.conversationId),se.primeIdentity(o,U.conversationId),U.agent&&Ze(U.agent),b(U.canContinue),jt(Pt(U.controlState));let je=D.findLast(_e=>_e.role==="assistant"&&!_e.ephemeral);if(Ge(je?.suggestions??U.suggestions??[]),q("chat"),await se.markRead(y),J())return;za(y)}catch(U){if(J())return;n.emit("error",U),e.onError?.(U)}},[se,c,l,n,e,r,za,jn,Xn,O,o,bt]),Jn=B(null),Ya=N(y=>{typeof y=="string"&&(z?Pe.fire("manual",y):Jn.current=y)},[z,Pe]);M(()=>{!z||!Jn.current||(Pe.fire("manual",Jn.current),Jn.current=null)},[z,Pe]);let Yt=B({handleOpen:vo,handleClose:hn,handleExpand:yo,handleFullscreen:Po,openForm:Ya});Yt.current={handleOpen:vo,handleClose:hn,handleExpand:yo,handleFullscreen:Po,openForm:Ya},ot(()=>ws(t,{open:()=>Yt.current.handleOpen(),close:()=>Yt.current.handleClose(),expand:()=>Yt.current.handleExpand(),fullscreen:()=>Yt.current.handleFullscreen(),openForm:y=>Yt.current.openForm(y)}),[t]);let Be=Q(()=>Ho(e,Gn,Fa,Ba),[e,Gn,Fa,Ba]);Wn.current=Be.strings;let ru=Q(()=>_.map(y=>{let T=Xt.list.find(J=>J.id===y.formId);return{...y,title:T?.title,form:T}}),[_,Xt]),Ja={options:Be,transport:se,feedback:Ke,bus:n,persistence:r,composerApiRef:qa,view:S,canSend:oe,isStreaming:O,sendPreparing:be,composerActive:Be.mode==="page"||Be.mode==="inline"||Be.mode==="standalone"||F,controlMode:ct.value,assignedOperatorInitials:$d.value,operatorAvailable:Fd.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Hd,onCancelOperatorRequest:Ud,loadingMessages:u,messagesSig:c,agent:tt,suggestions:Tt,initialWidgetSize:s.widgetSize??null,visitorId:o,onClose:hn,onClear:ho,onExpand:yo,onFullscreen:Po,onSoundToggle:Dd,onToggleHistory:eu,onSelectHistoryConversation:xo,onNewConversation:bo,onLocaleChange:Ld,onThemeChange:Od,onTextSizeChange:Nd,onWidgetSizeChange:nu,onSend:Xa,onStop:Qd,onSuggestion:y=>{if(fe.current)return;let T=y.text??y.label;me.info("suggestion",{text:T,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:T}),e.autoSendSuggestions?Xa(T,[]):qa.current?.fill(T)},activeForm:mo.value?.form??null,formMarkers:ru,onFormSubmit:Pe.complete,onFormSkip:Pe.skip,onFormFill:y=>Pe.fire("manual",y),tool:Kd,onRetry:Zd,onMessageFeedback:jd},ou=y=>{xo(y);let T=m();T&&k.switchTab(T)};if(!h)return null;let bn=Be.modules.list,So=y=>{let T=Dn("close",Be.mode,y);return bn.length===0?a(nd,{strings:Be.strings,onClose:T?hn:void 0}):bn.length===1&&bn[0]?.layout==="chat"?a(Ec,{...Ja,panelSize:y}):a(td,{panelProps:{...Ja,panelSize:y,onClose:T?hn:void 0},enabledModules:bn,nav:k,bus:n,hasUnread:zd.value,onSelectConversation:ou,onStartNewConversation:bo,onSetPanelSize:qe})};if(e.mode==="page"){let y=J=>{xo(J.conversationId)},T=bn.some(J=>J.layout==="chat");return a("div",{class:`${co}-anchor`,children:a(Oc,{site:Sd,blocks:wd,transport:se,strings:Be.strings,locale:Be.locale,persistence:r,visitorId:o,showConversations:T,onSelectConversation:y,onNewConversation:bo,sidebarCollapsed:Rd,onToggleSidebarCollapsed:tu,children:So("fullscreen")})})}if(W){let y=e.mode==="standalone"?"fullscreen":ge;return a("div",{class:`${co}-anchor`,children:So(y)})}let Qa=e.mode==="drawer",Za=!(e.mode==="modal")&&!e.launcher.hidden&&(!F||xe),ei=Za&&!xe&&!He&&!Qa?Be.launcher.callout:null;return a("div",{class:`${co}-anchor`,"data-launcher-size":Be.launcher.size,children:[F||A?a("div",{class:`${co}-surface`,hidden:!F,children:So(ge)}):null,Za?a(Al,{onToggle:vo,launcher:Be.launcher,strings:Be.strings,leaving:xe,edgeTab:Qa}):null,ei?a(Ml,{callout:ei,launcherPosition:Be.position,strings:Be.strings,closeLabel:Be.strings.close,onDismiss:Ce}):null]})}function qm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Vm=120;async function Wm(e,t,n,r){return(await Promise.all(t.map(async i=>{try{let{id:s,url:l}=await e.uploadFile(i.file,n);return{id:s,name:i.name,mediaType:i.mediaType,size:i.size,url:l}}catch(s){r(s);return}}))).filter(i=>i!==void 0)}var Gm=Z.scope("error-boundary"),uo=class extends Ve{constructor(){super(...arguments);ee(this,"state",{crashed:!1})}componentDidCatch(n,r){Gm.error("widget render crashed",{error:n,componentStack:r?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,r?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};var Km="1",jm=60,Xm=2e3,bd={open:()=>{},close:()=>{},expand:e=>({on:e}),fullscreen:e=>({on:e}),send:e=>({attachments:e.attachmentCount}),message:e=>({role:e.role}),stop:()=>{},clear:()=>{},suggestion:()=>{},toggleHistory:e=>({view:e.view}),handshake:()=>{},formSubmit:e=>({formId:e.formId,skipped:e.skipped}),toolResult:()=>{},toolDecision:e=>({approved:e.approved}),messageFeedback:e=>({value:e.value??"none"}),contentView:e=>({section:e.section,tags:e.tags,count:e.count}),contentOpen:e=>({contentId:e.contentId,tags:e.tags}),contentSearch:e=>({qlen:e.queryLength,hits:e.hitCount}),contentRead:e=>({contentId:e.contentId}),contentLinkClick:e=>({contentId:e.contentId}),attach:e=>({count:e.count,bytes:e.totalBytes}),voiceStart:()=>{},voiceStop:e=>({ms:e.durationMs}),voiceCancel:()=>{},localeChange:e=>({locale:e}),themeChange:e=>({theme:e}),textSizeChange:e=>({size:e}),soundToggle:e=>({muted:e.muted}),sidebarToggle:e=>({collapsed:e.collapsed}),calloutDismiss:()=>{},error:()=>{}};function Ym(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Jm(){return location.origin+location.pathname}function Qm(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function yd(e,t){let n=Math.random(),r=0,o=0,i=new Set,s=(c,u)=>{let{tracking:p,publicKey:_,aiAgentDeploymentId:d,mode:f,themeMode:m}=t.getOptions();if(!p.enabled||Ym()||n>=p.sampleRate)return;let P=performance.now();if(P-r>6e4&&(r=P,o=0),++o>jm)return;let v=new URLSearchParams;v.set("v",Km),v.set("_ev",xr),v.set("e",c),p.token&&v.set("tk",p.token),_&&v.set("pk",_),d&&v.set("dep",d),v.set("vid",t.getVisitorId());let g=t.getConversationId();g&&v.set("cid",g),v.set("url",Jm());let k=Qm();k&&v.set("ref",k),v.set("sw",String(screen.width)),v.set("sh",String(screen.height)),v.set("vw",String(innerWidth)),v.set("vh",String(innerHeight)),v.set("dpr",String(devicePixelRatio)),v.set("lang",navigator.language);try{v.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(v.set("m",f),v.set("th",m),u)for(let[I,z]of Object.entries(u))z!==void 0&&v.set(I,String(z));v.set("ts",String(Date.now()));let h=`${p.endpoint}?${v}`;if(h.length>Xm)return;let x=new Image(1,1);i.add(x);let C=()=>i.delete(x);x.addEventListener("load",C,{once:!0}),x.addEventListener("error",C,{once:!0}),x.src=h},l=Object.keys(bd).map(c=>e.on(c,u=>s(c,bd[c]?.(u))));return()=>{for(let c of l)c();i.clear()}}function Pd(e){let{bus:t,host:n,appRoot:r,persistence:o,reportError:i}=e,s=e.initialRaw,l,c=Zt(s),u=!0,p=()=>{c=Zt(l?Uo(s,l):s)},_=()=>{Zi(n,dr(c.mode));let m=o.loadUserPrefs().themeMode;ts(n,m?{...c,themeMode:m}:c),u&&(ur(n,Zm(c)),u=!1)},d=()=>{_(),Sn(ut(uo,{onError:i},ut(hd,{bus:t,hostElement:n,options:c})),r)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&o.rememberStorageVersion(m.config.storageVersion),l=m.config,p(),d())});let f=yd(t,{getOptions:()=>c,getVisitorId:()=>o.getVisitorId(),getConversationId:()=>o.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>s,render:d,setUserOptions:m=>{s=m,p(),d()},patchUserOptions:m=>{s={...s,...m},p(),d()},destroy:()=>f()}}function Zm(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=tn(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:r}=In(e,an(),t.loadPanelOpen(),t.loadPanelSize());return Pr(e.mode,r,n)}var _o=class{constructor(){ee(this,"handlers",new Map)}on(t,n){let r=this.handlers.get(t);return r||(r=new Set,this.handlers.set(t,r)),r.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let r=this.handlers.get(t);if(r)for(let o of r)try{o(n)}catch{}}clear(){this.handlers.clear()}};var Da=class extends HTMLElement{constructor(){super(...arguments);ee(this,"bus",new _o);ee(this,"mountResult",null);ee(this,"runtime",null)}static get observedAttributes(){return zo}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Sn(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=qo(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let r=Zt(n);this.mountResult||(this.mountResult=es({existingHost:this,position:dr(r.mode)}));let o=tn(r.widgetId,r.storage,r.aiAgentDeploymentId);this.runtime=Pd({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:o,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},xd=!1;function eg(){if(xd||typeof customElements>"u")return;let e=w.tagName;customElements.get(e)||customElements.define(e,Da),xd=!0}typeof customElements<"u"&&eg();export{eg as registerWebComponent};
|
|
41
|
+
`).trim(),N=!v&&t!=="error"&&!h.value&&V.length>0,te=H||N;return a("div",{class:`${Ge}-bubble-row`,"data-role":e.role,"data-testid":We(R.messageBubble,e.serverMessageId??e.id),children:a("div",{class:`${Ge}-bubble-col`,children:[a("div",{class:`${Ge}-bubble`,children:[e.role==="operator"&&e.operatorInitials?a("span",{class:`${Ge}-bubble-author`,children:e.operatorInitials}):null,a("div",{class:`${Ge}-bubble-body`,children:[w?a(Jf,{label:n.loading}):m.map((ae,oe)=>a(Gf,{part:ae,active:F,live:y,strings:n,showReasoning:r,showToolCalls:i,showSources:s,interactive:l&&t==="complete"&&(ae.kind!=="tool"||Fo(e,oe)),superseded:c,continuationStreaming:e.continuationStreaming===!0,tool:u},`${Xf(ae)}#${oe}`)),z&&a(Yf,{}),t==="error"||h.value?a("div",{class:`${Ge}-error`,role:"alert",children:[a("span",{children:e.errorText??n.errorGeneric}),_?a("button",{type:"button",class:`${Ge}-error-retry`,onClick:()=>_(e),"data-testid":R.messageRetry,children:n.errorRetry}):null]}):null]})]}),q||te?a("div",{class:`${Ge}-bubble-meta`,children:[q?a("time",{class:`${Ge}-bubble-time`,dateTime:q.iso,title:q.full,children:q.short}):null,te?a("div",{class:`${Ge}-bubble-actions`,children:[H&&e.serverMessageId?a(kc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:n,onFeedback:d}):null,N?a(Vf,{text:V,strings:n}):null]}):null]}):null]})})}function Vf({text:e,strings:t}){let[n,o]=O(!1),r=()=>{navigator.clipboard?.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)}).catch(()=>{})},i=n?t.copied:t.copy;return a("button",{type:"button",class:`${Ge}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:r,"data-testid":R.messageCopy,children:n?a(jt,{}):a(Ll,{})})}function Wf(e){if(typeof e!="number"||!Number.isFinite(e))return null;try{let t=new Date(e);return{short:t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),full:t.toLocaleString(void 0,{dateStyle:"full",timeStyle:"short"}),iso:t.toISOString()}}catch{return null}}function Gf({part:e,active:t,live:n,strings:o,showReasoning:r,showToolCalls:i,showSources:s,interactive:l,superseded:c,continuationStreaming:u,tool:_}){switch(e.kind){case"step-start":return null;case"text":return a(cr,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return r?a(jf,{part:e,active:t,strings:o}):null;case"tool":return a(Kf,{part:e,strings:o,showToolCalls:i,interactive:l,superseded:c,continuationStreaming:u,live:n,tool:_});case"file":return e.mediaType.startsWith("image/")?a("img",{src:e.url,alt:"",loading:"lazy"}):a("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return s?a(wc,{part:e,strings:o}):null}}function Kf({part:e,strings:t,showToolCalls:n,interactive:o,superseded:r,continuationStreaming:i,live:s,tool:l}){let c=Z(()=>_e(()=>e.approvalSig.value!==void 0),[e]);return l?.humanInLoop&&c.value?rr(e.toolName)?a(Ic,{part:e,strings:t,active:o,superseded:r,continuationStreaming:i,onDecision:l.onDecision,onEdit:l.onEdit}):a(Cc,{part:e,strings:t,active:o,superseded:r,continuationStreaming:i,onDecision:l.onDecision,onEdit:l.onEdit}):n?a(Ac,{part:e,strings:t,live:s}):null}function jf({part:e,active:t,strings:n}){return a("details",{class:`${Ge}-reasoning`,"data-testid":R.reasoning,open:t,"data-active":t?"true":void 0,children:[a("summary",{class:`${Ge}-reasoning-summary`,children:a("span",{class:`${Ge}-reasoning-label`,children:t?n.thinking:n.thoughts})}),a("div",{class:`${Ge}-reasoning-body`,children:a(cr,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Xf(e){switch(e.kind){case"text":case"reasoning":case"step-start":return`${e.kind}:${e.id}`;case"tool":return`tool:${e.toolCallId}`;case"file":return`file:${e.url}`;case"source":return`source:${e.sourceId}`}}function Yf(){return a("span",{class:`${Ge}-typing`,"data-testid":R.typingDots,"aria-hidden":"true",children:[a("span",{}),a("span",{}),a("span",{})]})}function Jf({label:e}){return a("span",{class:`${Ge}-loading`,role:"status",children:[a("span",{class:`${Ge}-loading-spinner`,"aria-hidden":"true"}),a("span",{class:`${Ge}-loading-label`,children:e})]})}var Mt=C.cssPrefix,$a=120,Qf=350;function Lc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:r,showSources:i,enableMessageFeedback:s,onFeedback:l,loading:c,onLoadPreviousMessages:u,idle:_,controlMode:p="ai-agent",tool:d,onRetry:f,form:m,formMarkers:h,onFillForm:b}){let x=A(null),P=St(()=>e.value),[v,y]=O(!1),[k,w]=O(!1),F=A(!1),z=A(!1),[q,I]=O(),H=A(!1),V=A(!1),N=A(!1),te=A(0),ae=()=>N.current||performance.now()-te.current<Qf,oe=A(0),Ie=S=>{let X=S.scrollHeight-S.clientHeight>1;S.dataset.fadeTop=X&&S.scrollTop>1?"true":"false",S.dataset.fadeBottom=X&&S.scrollHeight-S.scrollTop-S.clientHeight>1?"true":"false"},me=S=>y(S.scrollHeight-S.scrollTop-S.clientHeight>$a*2),Pe=S=>{oe.current=performance.now(),S.scrollTop=S.scrollHeight,Ie(S)},xe=(S,X)=>{Pe(S);let ie=X,ve=0,Me=()=>{V.current||ae()||(Pe(S),--ie>0&&(ve=requestAnimationFrame(Me)))};return X>0&&(ve=requestAnimationFrame(Me)),()=>cancelAnimationFrame(ve)},D=(S,X)=>{let ie,ve,Me,dt=-1,nt=()=>{ie.disconnect(),ve.disconnect(),clearTimeout(Me)},Ye=()=>{if(V.current||ae()||dt>=0&&S.scrollTop<dt-4)return nt();Pe(S),dt=S.scrollTop};return ie=new ResizeObserver(Ye),ve=new MutationObserver(Ye),Ye(),ie.observe(S),ve.observe(S,{childList:!0,subtree:!0,characterData:!0}),Me=setTimeout(nt,X),nt},ge=P.value[0]?.id;ut(()=>{let S=x.current;if(S&&P.value.length!==0&&!z.current&&(H.current=!0,!!P.value.some(X=>X.role==="user")))return D(S,300)},[ge]);let ce=A(0);E(()=>{let S=x.current,X=P.value,ie=ce.current;if(ce.current=X.length,!S||!H.current||z.current)return;if(X.slice(ie).some(Me=>Me.role==="user"))return V.current=!1,xe(S,3);if(!X.some(Me=>Me.role==="user")||V.current||ae())return;S.scrollHeight-S.scrollTop-S.clientHeight<$a&&Pe(S)},[P.value.length]);let Se=A(null);E(()=>{let S=x.current,X=P.value.at(-1),ie=Se.current;if(Se.current=X?{id:X.id,streaming:X.status==="streaming"}:null,!!S&&H.current&&!(!X||X.id!==ie?.id||ie.streaming||X.status!=="streaming"))return V.current=!1,xe(S,3)},[P.value]),E(()=>{let S=x.current;if(!S)return;let X=P.value.at(-1);if(!X||X.status!=="streaming"&&!P.value.some(Me=>Me.role==="user"))return;let ie=()=>{if(V.current||ae())return;S.scrollHeight-S.scrollTop-S.clientHeight<$a*2&&Pe(S)};if(X.status!=="streaming")return D(S,300);ie();let ve=new MutationObserver(ie);return ve.observe(S,{childList:!0,subtree:!0,characterData:!0}),()=>ve.disconnect()},[P.value]);let Be=m?.form.id,ke=!!m&&(h??[]).some(S=>S.formId===m.form.id);ut(()=>{let S=x.current;!S||!Be||V.current||P.value.some(X=>X.role==="user")&&(ke?S.querySelector(`[data-testid="${R.formGate}"]`)?.scrollIntoView({block:"nearest"}):Pe(S))},[Be,ke]),E(()=>{let S=x.current;if(!S)return;let X=()=>{me(S),Ie(S),performance.now()-oe.current>150&&(V.current=S.scrollHeight-S.scrollTop-S.clientHeight>8)},ie=()=>{V.current=!0},ve=Dt=>{Dt.deltaY<0&&ie()},Me=0,dt=Dt=>{Me=Dt.touches[0]?.clientY??0,N.current=!0},nt=Dt=>{(Dt.touches[0]?.clientY??0)>Me+4&&ie()},Ye=()=>{N.current=!1,te.current=performance.now()},xn=()=>{N.current=!0};return S.addEventListener("scroll",X,{passive:!0}),S.addEventListener("wheel",ve,{passive:!0}),S.addEventListener("touchstart",dt,{passive:!0}),S.addEventListener("touchmove",nt,{passive:!0}),S.addEventListener("touchend",Ye,{passive:!0}),S.addEventListener("touchcancel",Ye,{passive:!0}),S.addEventListener("pointerdown",xn,{passive:!0}),window.addEventListener("pointerup",Ye,{passive:!0}),window.addEventListener("pointercancel",Ye,{passive:!0}),me(S),()=>{S.removeEventListener("scroll",X),S.removeEventListener("wheel",ve),S.removeEventListener("touchstart",dt),S.removeEventListener("touchmove",nt),S.removeEventListener("touchend",Ye),S.removeEventListener("touchcancel",Ye),S.removeEventListener("pointerdown",xn),window.removeEventListener("pointerup",Ye),window.removeEventListener("pointercancel",Ye)}},[]);let be=()=>{let S=x.current;S&&(V.current=!1,Pe(S))},ye=P.value.filter(S=>!S.ephemeral),Ee=ye[0],Ne=Ee?.serverMessageId??Ee?.id,Ae=!!(u&&ye.length>=la&&Ne!==q),De=async()=>{if(!u||F.current)return;let S=x.current,X=S?.scrollHeight??0,ie=S?.scrollTop??0;F.current=!0,z.current=!0,w(!0);try{let ve=await u();ve===!1&&Ne&&I(Ne),ve&&S&&(await new Promise(Me=>requestAnimationFrame(()=>requestAnimationFrame(()=>Me()))),S.scrollTop=ie+S.scrollHeight-X,Ie(S),me(S))}finally{z.current=!1,F.current=!1,w(!1)}},ze=[],U="",K=P.value.at(-1)?.id,j=[...h??[]].toSorted((S,X)=>(S.createdAt??1/0)-(X.createdAt??1/0)),ue=S=>m&&S.formId===m.form.id?a(xa,{form:m.form,strings:t,onSubmit:m.onSubmit,onSkip:m.onSkip},`gate:${S.formId}`):a(Ql,{marker:S,strings:t,onFill:!m&&b?()=>b(S.formId):void 0},S.key),Qe=S=>{for(let X=j[0];X?.createdAt!==void 0&&!(S!==void 0&&X.createdAt>S);X=j[0])j.shift(),ze.push(ue(X))};for(let S of P.value){if(S.role==="assistant"&&S.id!==K&&Wt(S))continue;Qe(S.createdAt);let X=Zf(S.createdAt);X&&X!==U&&(ze.push(a("div",{class:`${Mt}-date-divider`,children:a("span",{class:`${Mt}-date-pill`,title:em(S.createdAt),children:tm(S.createdAt,t)})},`day:${X}`)),U=X);let ve=S.retryAction!==void 0||S.role==="assistant"&&S.id===K?Uo(P.value,S):void 0,Me=ve!==void 0&&(ve.kind!=="continue-assistant"||p==="ai-agent");ze.push(a(Mc,{message:S,status:S.status,strings:t,responseMode:n,showReasoning:o,showToolCalls:r,showSources:i,interactive:!!_&&p==="ai-agent"&&S.id===K,superseded:S.id!==K,tool:d,onRetry:_&&Me&&(S.role==="user"||S.id===K)?f:void 0,enableMessageFeedback:s,onFeedback:l},S.id))}for(let S of j)ze.push(ue(S));return a("div",{class:`${Mt}-list-wrap`,children:[a("div",{ref:x,class:`${Mt}-list ${Mt}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&P.value.length===0?a("div",{class:`${Mt}-list-loading`,role:"status",children:t.conversationLoading}):null,Ae?a("div",{class:`${Mt}-load-previous`,children:a("button",{type:"button",onClick:De,disabled:k,"aria-busy":k,"data-testid":R.loadPreviousMessages,children:t.loadPreviousMessages})}):null,ze,m&&!ke?a(xa,{form:m.form,strings:t,onSubmit:m.onSubmit,onSkip:m.onSkip}):null]}),v?a("button",{type:"button",class:`${Mt}-jump`,onClick:be,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":R.scrollToBottom,children:a(Xt,{})}):null]})}function Zf(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function em(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function tm(e,t){let n=new Date(e),o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),r=Math.round((o(new Date)-o(n))/864e5);return r<=0?t.dateToday:r===1?t.dateYesterday:r<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var nm=["today","yesterday","lastWeek","older"];function om(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((Oc(e)-Oc(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function Nc(e,t){let n=new Map;for(let o of t){let r=om(e,o.lastMessageAt),i=n.get(r);i?i.push(o):n.set(r,[o])}return nm.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function Oc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Dc=ee.scope("history"),rm=3,am=6,im={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function sm(e,t,n){let o=Date.parse(e);return Number.isFinite(o)?new Date(o).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(o):t-o<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(o):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(o):""}function _r({transport:e,strings:t,locale:n,persistence:o,visitorId:r,onSelect:i,onNewConversation:s}){let l=C.cssPrefix,c=e.peekConversations({visitorId:r}),[u,_]=O(c?"loaded":"loading"),[p,d]=O(c),[f,m]=O(!1),h=A(),b=p?.conversations??[],x=p?.pagination;E(()=>{let w=!1;h.current=void 0,m(!1);let F=e.peekConversations({visitorId:r});return d(F),_(F?"loaded":"loading"),e.listConversations({visitorId:r}).then(z=>{w||(d(z),_("loaded"),o.saveHistoryCount(z.conversations.length))}).catch(z=>{w||(Dc.warn("listConversations failed",{err:z}),_("error"))}),()=>{w=!0,h.current=void 0}},[e,r,o,n]);let P=async()=>{if(h.current||!x?.hasNext)return;let w={};h.current=w,m(!0);try{let F=await e.listConversations({visitorId:r,page:x.page+1,limit:x.limit});if(h.current!==w)return;let z=new Set(b.map(I=>I.conversationId)),q=[...b,...F.conversations.filter(I=>!z.has(I.conversationId))];d({conversations:q,pagination:F.pagination}),o.saveHistoryCount(q.length)}catch(F){if(h.current!==w)return;Dc.warn("listConversations page failed",{err:F,page:x.page+1})}finally{h.current===w&&(h.current=void 0,m(!1))}},v=s?a("div",{class:`${l}-history-footer`,children:a("button",{type:"button",class:`${l}-history-new`,onClick:s,"data-testid":R.sidebarNewConversation,children:[a(il,{}),t.newConversation]})}):null;if(u==="loading"){let w=Math.min(o.loadHistoryCount()??rm,am);return a(le,{children:[a("div",{class:`${l}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:a("div",{class:`${l}-history-group`,"aria-hidden":"true",children:[a("div",{class:`${l}-history-heading`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-heading`})}),a("div",{class:`${l}-history-card`,children:Array.from({length:Math.max(1,w)},(F,z)=>a("div",{class:`${l}-history-item ${l}-history-item-skeleton`,children:[a("span",{class:`${l}-history-avatar ${l}-skeleton`}),a("span",{class:`${l}-history-body`,children:[a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-title`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-title`})}),a("span",{class:`${l}-history-time`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-time`})})]}),a("span",{class:`${l}-history-row`,children:a("span",{class:`${l}-history-preview`,children:a("span",{class:`${l}-skeleton ${l}-skeleton-preview`})})})]})]},z))})]})}),v]})}if(u==="error"||b.length===0)return a(le,{children:[a("div",{class:`${l}-history-empty`,children:t.historyEmpty}),v]});let y=Date.now(),k=Nc(y,b);return a(le,{children:[a("div",{class:`${l}-history`,role:"list",children:[k.map(w=>a("div",{class:`${l}-history-group`,children:[a("div",{class:`${l}-history-heading`,children:t[im[w.bucket]]}),a("div",{class:`${l}-history-card`,children:w.conversations.map(F=>a("button",{type:"button",role:"listitem",class:`${l}-history-item`,onClick:()=>i(F),"data-closed":F.canContinue?void 0:"true","data-unread":F.hasUnread?"true":void 0,"data-testid":We(R.historyItem,F.conversationId),children:[a("span",{class:`${l}-history-avatar`,"aria-hidden":"true",children:a(ma,{})}),a("span",{class:`${l}-history-body`,children:[a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-title`,children:F.title}),a("span",{class:`${l}-history-time`,children:sm(F.lastMessageAt,y,n)})]}),a("span",{class:`${l}-history-row`,children:[a("span",{class:`${l}-history-preview`,children:F.preview??(F.canContinue?t.historyContinue:t.conversationClosed)}),F.hasUnread?a("span",{class:`${l}-history-dot`}):null]})]})]},F.conversationId))})]},w.bucket)),x?.hasNext?a("div",{class:`${l}-history-more`,children:a("button",{type:"button",onClick:P,disabled:f,"aria-busy":f,"data-testid":R.historyLoadMore,children:t.loadMoreConversations})}):null]}),v]})}var $c=C.cssPrefix;function Fc({suggestions:e,onPick:t,disabled:n=!1}){return e.length===0?null:a("div",{class:`${$c}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((o,r)=>a("button",{type:"button",class:`${$c}-suggestion`,onClick:()=>t(o),disabled:n,"data-testid":We(R.suggestion,r),children:o.label},o.id))})}var Ke=C.cssPrefix;function Bc(e){let{options:t,onClose:n}=e,o=t.strings,r=A(null);E(()=>{let u=r.current;if(!u)return;let _=Jo(u),p=d=>{d.key==="Escape"&&n?.()};return u.addEventListener("keydown",p),()=>{_(),u.removeEventListener("keydown",p)}},[n]);let i=e.composerApiRef,s=e.composerActive&&e.view==="chat"&&e.canSend&&!e.activeForm&&!e.sendPreparing&&e.options.features.fileUpload,l=L(u=>{s&&i.current?.attachFromDrop(u)},[i,s]),{visible:c}=tr({containerRef:r,onDrop:l,disabled:!s});return Xo(r.current,t.mode==="modal"),a("div",{ref:r,class:`${Ke}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":R.panel,children:[a(Fa,{...e,containerEl:r.current,dragOver:c,composerAttachApiRef:i}),a(Ba,{poweredBy:e.options.poweredBy})]})}function Fa(e){let{options:t,transport:n,feedback:o,bus:r,persistence:i,conversationId:s,composerKey:l,panelSize:c,view:u,canSend:_,isStreaming:p,sendPreparing:d,controlMode:f,assignedOperatorInitials:m,operatorAvailable:h,operatorRequestEnabled:b,onRequestOperator:x,onCancelOperatorRequest:P,loadingMessages:v,onLoadPreviousMessages:y,messagesSig:k,agent:w,suggestions:F,initialWidgetSize:z,visitorId:q,onClose:I,onBack:H,onClear:V,onToggleHistory:N,onSelectHistoryConversation:te,onNewConversation:ae,onWidgetSizeChange:oe,onSend:Ie,onStop:me,onSuggestion:Pe,activeForm:xe,formMarkers:D,onFormSubmit:ge,onFormSkip:ce,onFormFill:Se,tool:Be,onRetry:ke,onMessageFeedback:be,containerEl:ye,dragOver:Ee,composerAttachApiRef:Ne}=e,Ae=t.strings,De;return xe?De=null:_?De=a(le,{children:[f&&f!=="ai-agent"?a(dm,{controlMode:f,operatorInitials:m,operatorAvailable:h,onCancelOperatorRequest:P,strings:Ae}):null,!p&&f==="ai-agent"&&a(Fc,{suggestions:F,onPick:Pe,disabled:d}),a(Gl,{options:t,transport:n,feedback:o,bus:r,persistence:i,conversationId:s,isStreaming:p,active:e.composerActive&&u==="chat",isPreparing:d,operatorRequestEnabled:b,controlMode:f,onRequestOperator:x,onSend:Ie,onStop:me,attachApiRef:Ne},l)]}):De=a(cm,{label:Ae.conversationClosed,ctaLabel:Ae.startNewConversation,onNewConversation:V}),a(le,{children:[u==="history"?a(lm,{strings:Ae,onBack:N,onClose:I,showClose:Yo(t.mode,c,t.actions)}):a("header",{class:`${Ke}-header`,"data-testid":R.panelHeader,children:[H?a("button",{type:"button",class:`${Ke}-icon-btn`,onClick:H,"aria-label":Ae.moduleBack,title:Ae.moduleBack,children:a(qn,{})}):null,w?a(ql,{agent:w,strings:Ae}):a("h1",{children:Ae.panelTitle}),a(ft,{panelProps:e,variant:"chat"})]}),u==="history"?a(_r,{transport:n,strings:Ae,locale:t.locale,persistence:i,visitorId:q,onSelect:ze=>te(ze.conversationId),onNewConversation:ae}):a(le,{children:[a(Kl,{visible:Ee,strings:Ae}),a(Lc,{messagesSig:k,strings:Ae,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:be,loading:v,onLoadPreviousMessages:y,idle:!p&&!d&&_&&!xe,controlMode:f,tool:Be,onRetry:ke,form:xe?{form:xe,onSubmit:ge,onSkip:ce}:null,formMarkers:D,onFillForm:Se}),De,a(_m,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?a(jo,{panelEl:ye,resize:t.size.resize,position:t.position,initialSize:z,onSizeChange:oe,strings:Ae}):null]})}function lm({strings:e,onBack:t,onClose:n,showClose:o}){return a("header",{class:`${Ke}-header`,children:[a("button",{type:"button",class:`${Ke}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:a(qn,{})}),a("h1",{children:e.historyTitle}),o?a("button",{type:"button",class:`${Ke}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:a(pt,{})}):null]})}function cm({label:e,ctaLabel:t,onNewConversation:n}){return a("div",{class:`${Ke}-readonly-banner`,role:"note",children:[a("span",{class:`${Ke}-readonly-label`,children:e}),a("button",{type:"button",class:`${Ke}-readonly-cta`,onClick:n,children:t})]})}function dm({controlMode:e,operatorInitials:t,operatorAvailable:n,onCancelOperatorRequest:o,strings:r}){let i=um(e,t,n,r);return a("div",{class:`${Ke}-operator-banner`,role:"status","data-mode":e,"data-testid":R.operatorBanner,children:[a("span",{class:`${Ke}-operator-pulse`,"aria-hidden":"true"}),a("span",{class:`${Ke}-operator-label`,children:i}),e==="awaiting_operator"&&o?a("button",{type:"button",class:`${Ke}-cancel-operator-request`,"data-testid":R.cancelOperatorRequest,onClick:o,children:r.cancelOperatorRequest}):null]})}function um(e,t,n,o){return e==="operator"?o.chattingWithOperator.replace("{operator}",t??""):n===!1?o.noOperatorAvailable:o.connectingOperator}function _m({disclaimer:e}){return e?a("div",{class:`${Ke}-composer-footer`,children:a("div",{class:`${Ke}-disclaimer`,children:e})}):null}function Ba({poweredBy:e}){return e?a("div",{class:`${Ke}-poweredby-bar`,children:a(pm,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function pm({logoUrl:e,text:t,href:n}){let o=a(le,{children:[e?a("img",{class:`${Ke}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?a("span",{children:t}):null]});return n?a("a",{class:`${Ke}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):a("span",{class:`${Ke}-poweredby`,children:o})}function Hc(e){let t=A(e);t.current=e;let n=A(null);return n.current??(n.current=fm(t)),n.current}function fm(e){let t=J(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,r=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(o(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,u)=>{if(t.value)return;let _=e.current;if(c==="manual"){let p=_.forms.list.find(d=>d.id===u);p&&(t.value={form:p,trigger:"manual"});return}for(let p of _.forms.byTrigger[c]??[]){let d=p.triggers.find(f=>f.kind===c);if(!(!d||!mm(d,_)||r(p)||!gm(p,_))){t.value={form:p,trigger:c};return}}},s=(c,u)=>{let _=t.value;if(!_)return;t.value=null;let{form:p,trigger:d}=_;p.frequency==="conversation"?n.add(o(p.id)):p.frequency!=="always"&&e.current.persistence.saveFormDone(p.id),e.current.onComplete(p,d,c,u)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let u=e.current.forms.list.find(_=>_.id===c.form.id);u&&u!==c.form&&(t.value={form:u,trigger:c.trigger})},complete:c=>s(c,!1),skip:()=>s({},!0)}}function mm(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function gm(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let r=t.userContext()??{};if(n.missingContext.some(i=>r[i]!==void 0&&r[i]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let o=t.messageCount();return!(n.minMessages!=null&&o<n.minMessages||n.maxMessages!=null&&o>n.maxMessages)}function Uc(e){let t=C.cssPrefix,{site:n,blocks:o,strings:r,collapsed:i}=e,s=o?.navigation??[],l=o?.linkCards??[],c=i?r.expandSidebar:r.collapseSidebar;return a("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":R.sidebar,children:[a("div",{class:`${t}-sidebar-header`,children:[a(vm,{site:n}),a("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":R.sidebarToggle,children:a(hm,{collapsed:i})})]}),i?null:a(le,{children:[s.length>0?a("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:a(bm,{items:s})}):null,l.length>0?a("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:a(ym,{items:l})}):null,e.showConversations?a("div",{class:`${t}-sidebar-conversations`,children:a(_r,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function vm({site:e}){let t=C.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return a("picture",{children:[e.logoDark?.url?a("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,a("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return a("div",{class:`${t}-sidebar-title`,children:e?.title??C.name})}function hm({collapsed:e}){return a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?a("polyline",{points:"9 6 15 12 9 18"}):a("polyline",{points:"15 6 9 12 15 18"})})}function bm({items:e}){let t=C.cssPrefix;return a("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>a("li",{children:a("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?a("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,a("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function ym({items:e}){let t=C.cssPrefix;return a("div",{class:`${t}-sidebar-cards`,children:e.map(n=>a("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[a("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?a("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var zc=C.cssPrefix;function qc(e){return a("main",{class:`${zc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[a(Uc,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),a("section",{class:`${zc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Vc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Ha(e,t,n){return e.includes(t)?t:e.includes(n)?n:e[0]??""}function Wc(e,t,n){let o=[...new Set(t)],r=Ha(o,e,""),i=J({activeTab:r,stacks:Vc(o)});return{sig:i,reconcile(s,l){let c=[...new Set(s)],u=i.value,_=Ha(c,u.activeTab,l),p=Object.fromEntries(c.map(f=>[f,u.stacks[f]??[]])),d=_===u.activeTab&&c.length===Object.keys(u.stacks).length&&c.every(f=>u.stacks[f]===p[f]);o=c,!d&&(i.value={activeTab:_,stacks:p},_!==u.activeTab&&_&&n?.(_))},switchTab(s){!(s in i.value.stacks)||i.value.activeTab===s||(i.value={...i.value,activeTab:s},n?.(s))},push(s){let l=i.value,c=l.stacks[l.activeTab]??[];i.value={...l,stacks:{...l.stacks,[l.activeTab]:[...c,s]}}},pop(){let s=i.value,l=s.stacks[s.activeTab]??[];l.length!==0&&(i.value={...s,stacks:{...s.stacks,[s.activeTab]:l.slice(0,-1)}})},reset(s){i.value={activeTab:Ha(o,s,""),stacks:Vc(o)}}}}var Gc=e=>e.stacks[e.activeTab]??[],Kc=e=>Gc(e).at(-1),jc=e=>Gc(e).length===0;var Xc={Icon:Wn};var Lt=C.cssPrefix;function pr({title:e,actions:t}){return a("header",{class:`${Lt}-back-header`,"data-variant":"title",children:[a("span",{class:`${Lt}-back-spacer`,"aria-hidden":"true"}),a("h1",{class:`${Lt}-back-title`,children:e}),t??a("span",{class:`${Lt}-back-spacer`,"aria-hidden":"true"})]})}function fr({title:e,backLabel:t,onBack:n,actions:o,testid:r}){return a("header",{class:`${Lt}-back-header`,"data-testid":r,children:[a("button",{type:"button",class:`${Lt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:a(qn,{})}),a("h1",{class:`${Lt}-back-title`,children:e}),o??a("span",{class:`${Lt}-back-spacer`,"aria-hidden":"true"})]})}function Qt(e,t){return e instanceof Ve&&e.status===429?t.errorRateLimited:t.errorGeneric}var yn=C.cssPrefix;function Yc({placeholder:e,onActivate:t}){return a("button",{type:"button",class:`${yn}-home-search`,onClick:t,"data-testid":R.homeSearch,children:[a("span",{class:`${yn}-home-search-text`,children:e}),a("span",{class:`${yn}-home-search-icon`,"aria-hidden":"true",children:a(va,{})})]})}function Jc({placeholder:e,value:t,onInput:n}){return a("div",{class:`${yn}-home-search`,"data-input":"true",children:[a("input",{type:"search",class:`${yn}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":R.helpSearch}),a("span",{class:`${yn}-home-search-icon`,"aria-hidden":"true",children:a(va,{})})]})}var Xn=C.cssPrefix;function mr({title:e,subtitle:t,onClick:n,testid:o}){return a("button",{type:"button",class:`${Xn}-list-row`,onClick:n,"data-testid":o,children:[a("span",{class:`${Xn}-list-row-body`,children:[a("span",{class:`${Xn}-list-row-title`,children:e}),t?a("span",{class:`${Xn}-list-row-sub`,children:t}):null]}),a("span",{class:`${Xn}-list-row-chevron`,"aria-hidden":"true",children:a(mn,{})})]})}var Qc=C.cssPrefix;function lt({tone:e="info",message:t,onRetry:n,strings:o}){return a("div",{class:`${Qc}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[a("span",{children:t}),n?a("button",{type:"button",class:`${Qc}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var Zt=C.cssPrefix,Pm=ee.scope("help"),xm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function Sm(e){let t=new Map;for(let n of e){let o=n.categories?.[0]??"";(t.get(o)??t.set(o,[]).get(o)).push(n)}return[...t.entries()]}function Zc(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let r=0;for(let i of e){if(r=n.indexOf(i,r),r===-1)return 0;r+=1}return 1}function km(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(Zc(n,o.title)*2,Zc(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,r)=>r.score-o.score).map(o=>o.item):[]}function ed({article:e,nav:t}){return a(mr,{title:e.title,subtitle:e.description,onClick:()=>xm(t,e),testid:We(R.helpArticle,e.id)})}function wm({transport:e,strings:t,config:n,nav:o,bus:r,panelProps:i}){let s=n.contentTags,[l,c]=O("loading"),[u,_]=O(t.errorGeneric),[p,d]=O([]),[f,m]=O(""),[h,b]=O(0);E(()=>{let v=!1;return c("loading"),e.listContent({tags:s,sortBy:"order",limit:100}).then(y=>{if(v)return;let k=y.items??[];d(k),c("loaded"),r.emit("contentView",{section:"help",tags:s?.join(","),count:k.length})}).catch(y=>{v||(Pm.warn("listContent (help) failed",{err:y}),_(Qt(y,t)),c("error"))}),()=>{v=!0}},[e,s,h,r]);let x=Z(()=>km(p,f),[p,f]);E(()=>{let v=f.trim();if(!v)return;let y=setTimeout(()=>r.emit("contentSearch",{queryLength:v.length,hitCount:x.length}),600);return()=>clearTimeout(y)},[f,x,r]);function P(){return f.trim().length>0?x.length===0?a(lt,{message:t.helpSearchEmpty,strings:t}):a("div",{class:`${Zt}-help-card`,children:x.map(v=>a(ed,{article:v,nav:o},v.id))}):l==="loading"?a(lt,{message:t.helpLoading,strings:t}):l==="error"?a(lt,{tone:"error",message:u,onRetry:()=>b(v=>v+1),strings:t}):p.length===0?a(lt,{message:t.helpEmpty,strings:t}):Sm(p).map(([v,y])=>a("section",{class:`${Zt}-help-group`,children:[v?a("h2",{class:`${Zt}-help-section-title`,children:v}):null,a("div",{class:`${Zt}-help-card`,children:y.map(k=>a(ed,{article:k,nav:o},k.id))})]},v))}return a("div",{class:`${Zt}-module`,children:[a(pr,{title:t.helpTitle,actions:a(ft,{panelProps:i,variant:"plain"})}),a("div",{class:`${Zt}-module-pad`,children:a(Jc,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),a("div",{class:`${Zt}-help-list`,children:P()})]})}var td={Icon:Vn,Root:e=>a(wm,{...e})};var nd=C.cssPrefix;function Ua({onClick:e,children:t,testid:n}){return e?a("button",{type:"button",class:`${nd}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):a("div",{class:`${nd}-home-card`,"data-testid":n,children:t})}var Ce=C.cssPrefix,od=ee.scope("home");function Cm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ze(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var Rm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function Tm(e){let{transport:t,strings:n,config:o,nav:r,bus:i,panelProps:s}=e,[l,c]=O(null),[u,_]=O([]),p=o.contentTags?.join(","),d=e.options.modules.list.some(P=>P.layout==="chat");E(()=>{if(o.showRecentConversations===!1)return;let P=!1;return t.listConversations({limit:d?50:1}).then(v=>!P&&c(v.conversations?.[0]??null)).catch(v=>!P&&od.warn("listConversations (home) failed",{err:v})),()=>{P=!0}},[t,o.showRecentConversations,d]),E(()=>{if(!o.contentTags?.length)return;let P=!1;return t.listContent({tags:o.contentTags,limit:6}).then(v=>{if(P)return;let y=v.items??[];_(y),i.emit("contentView",{section:"home",tags:p,count:y.length})}).catch(v=>!P&&od.warn("listContent (home) failed",{err:v})),()=>{P=!0}},[t,p,i]);let f=Cm(e),m=o.userAvatars??[],h=o.status,b=h?.text?Ze(n,h.text):n.homeStatus,x=o.contentBlockTitle?Ze(n,o.contentBlockTitle):n.homeContentTitle;return a("div",{class:`${Ce}-module ${Ce}-home`,"data-testid":R.homeView,children:a("div",{class:`${Ce}-home-scroll`,children:[a("div",{class:`${Ce}-home-hero`,children:[a("div",{class:`${Ce}-home-hero-top`,children:[o.brandName?a("span",{class:`${Ce}-home-brand`,"data-testid":R.homeBrand,children:o.brandName}):a("span",{class:`${Ce}-home-brand-spacer`,"aria-hidden":"true"}),a("div",{class:`${Ce}-home-hero-actions`,children:[m.length>0?a("div",{class:`${Ce}-home-avatars`,children:m.map(P=>a("span",{class:`${Ce}-home-avatar`,title:P.role?`${P.name} \xB7 ${P.role}`:P.name,children:P.avatar?a("img",{src:P.avatar,alt:"",loading:"lazy"}):a("span",{children:Qo(P.name)})},P.name))}):null,a(ft,{panelProps:s,variant:"plain"})]})]}),o.showGreeting!==!1?a(le,{children:[a("h1",{class:`${Ce}-home-greeting`,"data-testid":R.homeGreeting,children:f.title}),f.subtitle?a("p",{class:`${Ce}-home-lead`,children:f.subtitle}):null]}):null]}),a("div",{class:`${Ce}-home-cards`,children:[o.showSearchBar!==!1?a(Yc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>r.switchToLayout("help")}):null,l?a(Ua,{onClick:()=>r.selectConversation(l.conversationId),testid:R.homeRecent,children:a("div",{class:`${Ce}-home-recent-row`,"data-unread":l.hasUnread?"true":void 0,children:[a("span",{class:`${Ce}-home-recent-avatar`,"aria-hidden":"true",children:a(Wn,{})}),a("span",{class:`${Ce}-home-recent-body`,children:[a("span",{class:`${Ce}-home-recent-title`,children:l.title}),l.preview?a("span",{class:`${Ce}-home-recent-preview`,children:l.preview}):null]}),l.hasUnread?a("span",{class:`${Ce}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,h?a(Ua,{onClick:h.url?()=>r.push({kind:"iframe",url:h.url,title:b}):void 0,children:a("div",{class:`${Ce}-home-status`,"data-level":h.level??"operational",children:[a("span",{class:`${Ce}-home-status-icon`,"aria-hidden":"true",children:a(Rl,{})}),a("span",{class:`${Ce}-home-status-text`,children:b})]})}):null,u.length>0?a("section",{class:`${Ce}-home-content`,children:[a("div",{class:`${Ce}-home-content-title`,children:x}),a("div",{class:`${Ce}-home-content-list`,children:u.map(P=>a(mr,{title:P.title,subtitle:P.description,onClick:()=>Rm(r,P),testid:We(R.homeContentRow,P.id)},P.id))})]}):null]})]})})}var rd={Icon:Tl,Root:e=>a(Tm,{...e})};var Ot=C.cssPrefix,Im=ee.scope("news");function Em({transport:e,strings:t,config:n,nav:o,bus:r,panelProps:i}){let s=n.contentTags,[l,c]=O("loading"),[u,_]=O(t.errorGeneric),[p,d]=O([]),[f,m]=O(0);E(()=>{let b=!1;return c("loading"),e.listContent({tags:s,sortBy:"publishedAt",sortOrder:"desc"}).then(x=>{if(b)return;let P=x.items??[];d(P),c("loaded"),r.emit("contentView",{section:"news",tags:s?.join(","),count:P.length})}).catch(x=>{b||(Im.warn("listContent (news) failed",{err:x}),_(Qt(x,t)),c("error"))}),()=>{b=!0}},[e,s,f,r]);function h(){return l==="loading"?a(lt,{message:t.newsLoading,strings:t}):l==="error"?a(lt,{tone:"error",message:u,onRetry:()=>m(b=>b+1),strings:t}):p.length===0?a(lt,{message:t.newsEmpty,strings:t}):a("div",{class:`${Ot}-news-list`,children:p.map(b=>a("button",{type:"button",class:`${Ot}-news-card`,onClick:()=>o.push({kind:"content",id:b.id,title:b.title}),"data-testid":We(R.newsItem,b.id),children:[b.image?a("img",{class:`${Ot}-news-hero`,src:b.image,alt:"",loading:"lazy"}):null,a("span",{class:`${Ot}-news-body`,children:[a("span",{class:`${Ot}-news-title`,children:b.title}),b.description?a("span",{class:`${Ot}-news-summary`,children:b.description}):null]})]},b.id))})}return a("div",{class:`${Ot}-module`,children:[a(pr,{title:t.newsTitle,actions:a(ft,{panelProps:i,variant:"plain"})}),a("div",{class:`${Ot}-module-scroll`,children:h()})]})}var ad={Icon:Il,Root:e=>a(Em,{...e})};var gr={chat:Xc,home:rd,help:td,news:ad};var Yn=C.cssPrefix;function id({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:r}){return a("nav",{class:`${Yn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let s=gr[i.layout].Icon,l=i.id===t,c=i.layout==="chat"&&o;return a("button",{type:"button",role:"tab","aria-selected":l,class:`${Yn}-tab`,onClick:()=>r(i.id),"data-testid":We(R.tab,i.id),children:[a("span",{class:`${Yn}-tab-icon`,"aria-hidden":"true",children:[a(s,{}),c?a("span",{class:`${Yn}-tab-badge`,"data-testid":R.tabBadge,"aria-label":"Unread"}):null]}),a("span",{class:`${Yn}-tab-label`,children:Ze(n,i.label)})]},i.id)})})}var sd=C.cssPrefix,Am="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function ld({url:e,title:t,strings:n,onBack:o,actions:r}){return a("div",{class:`${sd}-module`,children:[a(fr,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:r}),a("iframe",{class:`${sd}-content-frame`,src:e,title:t||"content",sandbox:Am,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Jn=C.cssPrefix,Mm=ee.scope("content"),Lm=5e3;function cd({id:e,title:t,transport:n,strings:o,bus:r,onBack:i,actions:s}){let[l,c]=O(null),[u,_]=O(!1),[p,d]=O(0),f=L(()=>{_(!1),c(null),d(b=>b+1)},[]);E(()=>{let b=!1;return n.listContent({ids:[e],limit:1}).then(x=>{if(b)return;let P=x.items[0];P?(c(P),r.emit("contentOpen",{contentId:e,tags:P.tags?.length?P.tags.join(","):void 0})):_(!0)}).catch(x=>{b||(Mm.warn("listContent (reader) failed",{err:x}),_(!0))}),()=>{b=!0}},[n,e,p,r]),E(()=>{if(!l)return;let b=setTimeout(()=>r.emit("contentRead",{contentId:e}),Lm);return()=>clearTimeout(b)},[l,e,r]);let m=L(b=>{let P=b.target?.closest?.("a")?.getAttribute("href")??"";P&&!P.startsWith("#")&&r.emit("contentLinkClick",{contentId:e})},[r,e]);function h(){return u?a(lt,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):l===null?a(lt,{message:o.contentLoading,strings:o}):a("article",{class:`${Jn}-content`,"data-testid":R.contentView,onClick:m,children:[l.image?a("img",{class:`${Jn}-content-hero`,src:l.image,alt:"",loading:"lazy"}):null,l.description?a("p",{class:`${Jn}-content-subtitle`,children:l.description}):null,a(Sc,{text:l.content??""})]})}return a("div",{class:`${Jn}-module`,children:[a(fr,{title:l?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:s,testid:R.backHeader}),a("div",{class:`${Jn}-module-scroll`,"data-testid":R.contentScroll,children:h()})]})}var vr=C.cssPrefix;function dd({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:r,onSelectConversation:i,onStartNewConversation:s,onSetPanelSize:l}){let c=e.options,u=c.strings,_=A(null),p=A(new Set);E(()=>{let N=_.current;if(!N)return;let te=Jo(N),ae=oe=>{oe.key==="Escape"&&e.onClose?.()};return N.addEventListener("keydown",ae),()=>{te(),N.removeEventListener("keydown",ae)}},[e.onClose]);let d=St(()=>n.sig.value).value,f=Kc(d),m=c.modules.byId[d.activeTab],h=e.composerActive&&m?.layout==="chat"&&f===void 0,b=e.composerApiRef,x=h&&e.view==="chat"&&e.canSend&&!e.activeForm&&!e.sendPreparing&&e.options.features.fileUpload,P=L(N=>{x&&b.current?.attachFromDrop(N)},[b,x]),{visible:v}=tr({containerRef:_,onDrop:P,disabled:!x});Xo(_.current,c.mode==="modal");let y=f?.kind==="iframe"||f?.kind==="content",k=t.length>1&&(jc(d)||!y),w=A(null);E(()=>{if(y&&w.current===null)w.current=e.panelSize,e.panelSize==="normal"&&l("expanded");else if(!y&&w.current!==null){let N=w.current;w.current=null,l(N)}},[y]);let F={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:N=>{let te=t.find(ae=>ae.layout===N);te&&n.switchTab(te.id)},selectConversation:i,startNewConversation:s},z=N=>({options:c,transport:e.transport,strings:u,config:N,visitorId:e.visitorId,nav:F,bus:o,panelProps:e}),q=a(ft,{panelProps:e,variant:"plain"});m&&p.current.add(m.id);let I=t.filter(N=>p.current.has(N.id)),H=N=>{if(N.layout==="chat")return a(Fa,{...e,composerActive:h,containerEl:_.current,dragOver:v,composerAttachApiRef:b});let te=gr[N.layout].Root;return te?a(te,{...z(N)}):null},V=()=>f?.kind==="iframe"?a(ld,{url:f.url,title:f.title,strings:u,onBack:n.pop,actions:q}):f?.kind==="content"?a(cd,{id:f.id,title:f.title,transport:e.transport,strings:u,bus:o,onBack:n.pop,actions:q}):null;return a("div",{ref:_,class:`${vr}-panel ${vr}-messenger`,role:"dialog","aria-modal":"false","aria-label":u.panelTitle,style:{position:"relative"},"data-testid":R.messengerHome,children:[a("div",{class:`${vr}-messenger-body`,children:[I.map(N=>a("div",{class:`${vr}-messenger-pane`,hidden:y||N.id!==m?.id,children:H(N)},N.id)),V()]}),k?a(id,{modules:t,activeTab:d.activeTab,strings:u,hasUnread:r,onSelect:n.switchTab}):null,a(Ba,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(m?.layout==="chat"&&!f)?a(jo,{panelEl:_.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:u}):null]})}var Qn=C.cssPrefix;function ud({strings:e,onClose:t}){return a("div",{class:`${Qn}-panel ${Qn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":R.modulesEmpty,children:[t?a("button",{type:"button",class:`${Qn}-icon-btn ${Qn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:a(pt,{})}):null,a("p",{class:`${Qn}-modules-empty-text`,children:e.modulesEmpty})]})}function Pn(e,t,n,o){let r={role:n,text:o};e.emit("message",r),t.onMessage?.(r)}var za=ee.scope("hitl");function _d(e){let{streaming:t,controlModeSig:n,messagesSig:o,sendAiTurn:r,bus:i,humanInLoop:s}=e,l=A(t);l.current=t;let c=L((d,f,m)=>{if(l.current||n.value!=="ai-agent")return!1;let h=o.value.at(-1),b=h?.partsSig.value.findIndex(P=>P.kind==="tool"&&P.toolCallId===d)??-1,x=h?.partsSig.value[b];return!h||x?.kind!=="tool"?(za.warn("decideTool: tool part not found",{toolCallId:d}),!1):h.status!=="complete"||!Fo(h,b)||!f(x)?!1:(m(x),h.partsSig.value=[...h.partsSig.value],Gt(h)&&(h.status="streaming",h.retryAction={kind:"continue-assistant",messageId:h.serverMessageId??h.id},h.awaitingContinuation=!0,o.value=[...o.value],r({continueExisting:!0})),!0)},[n,o,r]),u=L((d,f,m)=>{let h=!1;if(c(d,x=>x.stateSig.value==="approval-requested",x=>{h=rr(x.toolName);let P=x.approvalSig.value?.id??d;x.approvalSig.value={id:P,approved:f,reason:m},x.stateSig.value="approval-responded"})){if(h){za.info("toolResult",{toolCallId:d}),i.emit("toolResult",{toolCallId:d});return}za.info("toolDecision",{toolCallId:d,approved:f}),i.emit("toolDecision",{toolCallId:d,approved:f})}},[i,c]),_=L(d=>{c(d,f=>f.stateSig.value==="approval-responded"&&f.approvalSig.value?.approved!==void 0,f=>{let m=f.approvalSig.value?.id??d;f.approvalSig.value={id:m},f.stateSig.value="approval-requested"})},[c]);return{toolInteraction:Z(()=>({humanInLoop:s,onDecision:u,onEdit:_}),[s,u,_])}}function pd({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[r,i]=O(()=>o?!1:t.loadCalloutDismissed(n));E(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let s=L(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:r,dismissCallout:s}}function fd(e){let{transport:t,conversationIdSig:n}=e,o=ct("ai-agent"),r=ct(void 0),i=ct(void 0),s=A(),l=L(p=>{let d=p.controlRevision??0,f=s.current;f&&f.conversationId===n.value&&d<f.revision||(s.current={conversationId:n.value,revision:d},o.value=p.controlMode,r.value=p.assignedOperatorInitials,p.controlMode!=="awaiting_operator"?i.value=void 0:p.operatorAvailable!==void 0&&(i.value=p.operatorAvailable))},[n,o,r,i]),c=L(p=>{p.type==="data-control-state"&&l(Tt(p.data))},[l]),u=L(async()=>{let p=n.value,d=await t.requestOperator();d&&n.value===p&&l(Tt(d))},[t,n,l]),_=L(async()=>{let p=n.value,d=await t.cancelOperatorRequest();d&&n.value===p&&l(Tt(d))},[t,n,l]);return{controlModeSig:o,assignedOperatorInitialsSig:r,operatorAvailableSig:i,applyControlState:l,adoptControlStateChunk:c,requestOperator:u,cancelOperatorRequest:_}}function md(e){let{hostElement:t,mode:n,panelSize:o,isOpen:r,setIsOpen:i}=e;ut(()=>{Po(t,Ao(n,o,r))},[t,r,o,n]),E(()=>{if(n!=="modal"||!r)return;let s=l=>{l.composedPath().some(u=>u instanceof HTMLElement&&u.classList.contains(`${C.cssPrefix}-panel`))||i(!1)};return t.addEventListener("click",s),()=>t.removeEventListener("click",s)},[t,r,n,i]),E(()=>{if(n!=="drawer"||!r)return;let s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[r,n,i])}var qa=ee.scope("reducer"),hr=class{constructor(t,n){ne(this,"messagesSig",t);ne(this,"onReconcileNeeded",n);ne(this,"active",null);ne(this,"openTextParts",new Map);ne(this,"partSeq",0);ne(this,"replay",null)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.replay=null,this.openTextParts.clear()}beginReplay(t,n){let o=kt();o.id=t.id;let r=en(t)||Kt(t)&&(t.status!=="streaming"||Gt(t)),i=t.status==="streaming"&&Gt(t)&&Hn(t);this.replay={baseline:t,shadow:o,chunks:[n],probeContinuation:r,continuationTailReplay:i,liveCatchUp:t.status==="streaming"&&!r},this.attach(o),this.apply(n)}refreshReplayBaseline(){let t=this.replay;if(!t)return null;let n=t.shadow.serverMessageId??t.baseline.serverMessageId,o=this.messagesSig.value,r=o.at(-1),i=r===t.baseline||r?.id===t.baseline.id||n!==void 0&&r?.serverMessageId===n?r:o.find(l=>l===t.baseline)??o.find(l=>l.id===t.baseline.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t.baseline)return t;let s=t.baseline;return t.baseline=i,gd(s,i),t.liveCatchUp&&en(t.shadow)&&(i.status==="streaming"||Kt(i))?(t.probeContinuation=!1,t.continuationTailReplay=!1,t):(t.probeContinuation=en(i)||Kt(i)&&(i.status!=="streaming"||Gt(i)),t.continuationTailReplay=i.status==="streaming"&&Gt(i)&&Hn(i),t.liveCatchUp=i.status==="streaming"&&!t.probeContinuation,t)}refreshActive(){let t=this.active;if(!t)return null;let n=t.serverMessageId,o=this.messagesSig.value,r=o.at(-1),i=r===t||r?.id===t.id||n!==void 0&&r?.serverMessageId===n?r:o.find(l=>l===t)??o.find(l=>l.id===t.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t)return t;gd(t,i);let s=en(t)&&Kt(i);return i.status!=="streaming"&&!s?(this.detach(),null):(this.replay={baseline:i,shadow:t,chunks:[],probeContinuation:!1,continuationTailReplay:!1,liveCatchUp:!0},t)}promoteReplay(){let{baseline:t,shadow:n}=this.replay;return t.role=n.role,t.serverMessageId=n.serverMessageId,t.operatorInitials=n.operatorInitials,t.status=n.status,n.canceled&&(t.canceled=!0),t.finishReason=n.finishReason,t.errorText=n.errorText,t.suggestions=n.suggestions??t.suggestions,t.partsSig.value=n.partsSig.value,this.replay=null,this.active=t,this.messagesSig.value=[...this.messagesSig.value],t}promoteContinuation(t=!1){let{baseline:n,chunks:o}=this.replay,r=Bo(n);return this.replay=null,_t(()=>{if(t){let i=n.partsSig.value.findLastIndex(s=>s.kind==="tool");n.partsSig.value=n.partsSig.value.slice(0,i+1)}n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n);for(let i of o)this.apply(i);n.continuationStreaming=r||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}settleOwnedContinuation(t){let{baseline:n}=this.replay,o=Bo(n);return this.replay=null,_t(()=>{n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n),this.apply(t),n.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}applyResume(t){if(t.type==="start"){let r=(this.replay?.baseline??this.active)?.serverMessageId;r!==void 0&&t.messageId!==void 0&&r!==t.messageId&&this.onReconcileNeeded?.({messageId:r}),this.detach();let i=t.messageId,s=i!==void 0?this.messagesSig.value.find(_=>_.serverMessageId===i||_.id===i):void 0;if(s!==void 0)return t.messageMetadata?.senderRole==="visitor"&&s.role==="user"&&(s.status==="pending"||s.status==="error")&&(s.serverMessageId=i,s.status="complete",s.errorText=void 0,s.retryAction=void 0,this.messagesSig.value=[...this.messagesSig.value]),this.beginReplay(s,t),null;let l=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(l===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!Et(c))return this.attach(c),this.apply(t),null;let u=kt();return this.attach(u),this.messagesSig.value=[...this.messagesSig.value,u],this.apply(t),null}if(this.replay){let o=this.refreshReplayBaseline();if(!o)return null;o.chunks.push(t),t.type==="data-control-state"&&(o.baseline.operatorRoutedTurn=t.data.controlMode!=="ai-agent"),this.apply(t);let{baseline:r,shadow:i,probeContinuation:s,continuationTailReplay:l,liveCatchUp:c}=o,u=t.type==="finish"||t.type==="error"||t.type==="abort";if(s){if(!Dm(r,i,t))return u&&(Hm(r,i)&&(r.continuationStreaming=!0,this.messagesSig.value=[...this.messagesSig.value],this.onReconcileNeeded?.({messageId:r.serverMessageId??r.id})),this.detach()),null;let p=en(r)&&u?this.settleOwnedContinuation(t):this.promoteContinuation();return u?(p.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:p.serverMessageId??p.id}):p.continuationStreaming=!1),this.detach(),p):null}if(l&&Nm(r,i)){let p=this.promoteContinuation(!0);return u?(this.detach(),p):null}if(!c)return u&&this.detach(),null;if(u&&!Et(r)&&Et(i)){let p=this.promoteReplay();return this.detach(),p}if(!Om(r,i))return u&&(this.onReconcileNeeded?.({messageId:r.serverMessageId??r.id}),this.detach()),null;let _=this.promoteReplay();return u?(this.detach(),_):null}let n=this.refreshActive();if(!n)return null;if(this.replay)return this.applyResume(t);if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let o=n;return o.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id}):o.continuationStreaming=!1),this.detach(),o}return null}ensureTextPart(t,n,o){let r=`${n}:${o}`,i=this.openTextParts.get(r);if(i)return i;let s={kind:n,id:`${o}#${this.partSeq++}`,textSig:J(""),doneSig:J(!1)};return this.openTextParts.set(r,s),Zn(t,s),s}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let o=t.messageMetadata;o?.senderRole==="operator"?(n.role="operator",o.operatorInitials&&(n.operatorInitials=o.operatorInitials)):o?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":Zn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":qa.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",n.retryAction=void 0,t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":qa.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"abort":qa.debug("stream abort chunk (canceled)"),n.status="complete",n.canceled=!0,n.retryAction=void 0,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let o=this.ensureTextPart(n,"text",t.id);o.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let o=this.ensureTextPart(n,"reasoning",t.id);o.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-input-error":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":Um(n,t);return;case"file":Zn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":vd(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":vd(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-suggestions":n.suggestions=Oo(t.data);return;case"data-control-state":n.operatorRoutedTurn=t.data.controlMode!=="ai-agent";return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value.includes(t)&&(this.messagesSig.value=[...this.messagesSig.value])}},Va={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function en(e){return e.awaitingContinuation===!0||e.continuationStreaming===!0||e.retryAction?.kind==="continue-assistant"}function gd(e,t){e.canceled&&(t.canceled=!0),!(!en(e)||t.status!=="streaming"&&!Kt(t))&&(t.awaitingContinuation??(t.awaitingContinuation=e.awaitingContinuation),t.continuationStreaming??(t.continuationStreaming=e.continuationStreaming),t.retryAction===void 0&&(t.retryAction=e.retryAction))}function Om(e,t){let n=e.partsSig.value,o=t.partsSig.value;return e.role!==t.role||o.length<n.length?!1:n.every((r,i)=>hd(r,o[i]))}function Nm(e,t){let n=e.partsSig.value,o=n.findLastIndex(l=>l.kind==="tool"),r=new Set(n.slice(0,o+1).flatMap(l=>l.kind==="tool"?[l.toolCallId]:[])),i=t.partsSig.value.filter(l=>l.kind!=="tool"||!r.has(l.toolCallId)),s=n.slice(o+1);return i.length<s.length?!1:s.every((l,c)=>hd(l,i[c]))}function hd(e,t){switch(e.kind){case"text":case"reasoning":return t?.kind===e.kind&&t.textSig.value.startsWith(e.textSig.value);case"step-start":return t?.kind==="step-start";case"tool":{if(t?.kind!=="tool"||t.toolCallId!==e.toolCallId||!Ho(t.toolName,e.toolName)||Va[t.stateSig.value]<Va[e.stateSig.value])return!1;let n=e.approvalSig.value?.approved;return n===void 0||t.approvalSig.value?.approved===n}case"file":return t?.kind==="file"&&t.url===e.url&&t.mediaType===e.mediaType;case"source":return t?.kind==="source"&&t.sourceId===e.sourceId&&t.url===e.url&&t.title===e.title&&t.filename===e.filename&&t.mediaType===e.mediaType;default:return e}}function Dm(e,t,n){return $m(e,n)||!Fm(e,t)?!0:n.type!=="finish"&&n.type!=="error"&&n.type!=="abort"?!1:Hn(t)||e.awaitingContinuation===!0&&n.type!=="finish"?!0:e.awaitingContinuation===!0&&t.partsSig.value.every(o=>o.kind==="step-start")}function $m(e,t){if(t.type!=="tool-output-available"&&t.type!=="tool-output-error"&&t.type!=="tool-output-denied")return!1;let n=e.partsSig.value.find(o=>o.kind==="tool"&&o.toolCallId===t.toolCallId);return n!==void 0&&Va[n.stateSig.value]<4}function Fm(e,t){let n=t.partsSig.value;if(n.length===0)return!0;let o=e.partsSig.value;return o.some((r,i)=>n.every((s,l)=>Bm(o[i+l],s)))}function Bm(e,t){switch(t.kind){case"text":case"reasoning":return e?.kind===t.kind&&e.textSig.value.startsWith(t.textSig.value);case"step-start":return e?.kind==="step-start";case"tool":return e?.kind==="tool"&&e.toolCallId===t.toolCallId&&(t.toolName==="tool"||Ho(e.toolName,t.toolName));case"file":return e?.kind==="file"&&e.url===t.url&&e.mediaType===t.mediaType;case"source":return e?.kind==="source"&&e.sourceId===t.sourceId&&e.url===t.url&&e.title===t.title&&e.filename===t.filename&&e.mediaType===t.mediaType;default:return t}}function Hm(e,t){if(en(e)||!Kt(e))return!1;let n=new Set(e.partsSig.value.filter(r=>r.kind==="tool").map(r=>r.toolCallId));return!t.partsSig.value.some(r=>r.kind==="tool"&&n.has(r.toolCallId))}function Nt(e,t,n,o){let r=e.partsSig.value.find(s=>s.kind==="tool"&&s.toolCallId===t);if(r)return o&&(r.dynamic=!0),r;let i={kind:"tool",toolCallId:t,toolName:n??"tool",dynamic:o?!0:void 0,inputPartialSig:J(""),inputSig:J(void 0),outputSig:J(void 0),errorSig:J(void 0),stateSig:J("input-streaming"),approvalSig:J(void 0)};return Zn(e,i),i}function Zn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function vd(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||Zn(e,t)}function Um(e,t){switch(t.type){case"tool-input-start":Nt(e,t.toolCallId,t.toolName,t.dynamic);return;case"tool-input-delta":{let n=Nt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=Nt(e,t.toolCallId,t.toolName,t.dynamic);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-input-error":{let n=Nt(e,t.toolCallId,t.toolName,t.dynamic);n.inputSig.value=t.input,n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-approval-request":{let n=Nt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=Nt(e,t.toolCallId,void 0,t.dynamic);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=Nt(e,t.toolCallId,void 0,t.dynamic);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=Nt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function bd(e){let t=1e3;for(;!e.signal.aborted;){let n,o="held";try{o=await e.connect(()=>{n=e.now(),e.backfill()})}catch{}if(e.signal.aborted||o==="unavailable")return;n!==void 0&&e.now()-n>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var yd=ee.scope("resume-stream");function Pd(e){let{activated:t,conversationReady:n,conversationIdSig:o,messagesSig:r,optionsRef:i,isChatActiveRef:s,transport:l,visitorId:c,adoptControlStateChunk:u,settleSuggestions:_,markActiveConversationRead:p,onReplyLanded:d,runCancellation:f,setCanSend:m,feedback:h,bus:b,homeNav:x,shouldReconcileOnConnect:P}=e;E(()=>{if(!t||!n||!o.value)return;let v=o.value,y=new AbortController,k=D=>{},w=new hr(r,D=>k(D));l.primeIdentity(c,v),yd.debug("resume stream opened",{conversationId:v});let F=!1,z=!1,q,I,H=0,V=(D,ge)=>{(D||!f.localSendRef.current)&&f.settle(ge),D&&(p(),d())},N=(D,ge=[],ce=!1,Se)=>{let Be=i.current;if(D.canceled){V(ce,Se);return}let ke=D.status==="error";switch(el(D,ke)){case"drop":r.value=r.value.filter(be=>be!==D);break;case"complete-operator-routed":D.status="complete",ce&&(h.play("messageReceived"),Pn(b,Be,"assistant",Ue(D)));break;case"error":{if(D.status="error",D.errorText=Be.strings.errorGeneric,ce){h.play("error");let be=new Error(ke?"stream error chunk":"empty reply");b.emit("error",be),Be.onError?.(be)}break}case"complete":D.status="complete",ce&&(h.play("messageReceived"),Pn(b,Be,"assistant",Ue(D))),_(D,ge);break}V(ce,Se)},te=D=>{if(y.signal.aborted||o.value!==v)return;if(u(D),D.type==="start"){let be=I?.senderRole==="visitor"?I.messageId:void 0;if(I={messageId:D.messageId,senderRole:D.messageMetadata?.senderRole},H+=1,F=D.messageMetadata?.senderRole===void 0,z=!1,q=F?D.messageMetadata?.runId:void 0,F){let ye=D.messageId!==void 0&&r.value.some(De=>De.serverMessageId===D.messageId||De.id===D.messageId),Ee=r.value.at(-1),Ne=D.messageId!==void 0&&(Ee?.serverMessageId===D.messageId||Ee?.id===D.messageId),Ae=f.localSendRef.current&&(!ye||Ne)&&Ee?.role==="assistant"&&Ee.status==="streaming"&&(Ne||Ee.serverMessageId===void 0&&Ee.partsSig.value.length===0);z=f.captureStart(v,D,Ae,be)}}let ge=F&&(D.type==="finish"||D.type==="error"||D.type==="abort"),ce=ge?q:void 0,Se=ge&&(z||f.ownsLocalRun(ce));ge&&(F=!1,z=!1,q=void 0);let Be=r.value.length,ke=w.applyResume(D);if(D.type==="finish"&&D.canContinue===!1&&m(!1),r.value.length>Be){let be=i.current.modules.list.find(ye=>ye.layout==="chat")?.id;be&&x?.switchTab(be)}if(!ke){ge&&(Se||!f.localSendRef.current)&&f.settle(ce);return}if(ke.role==="operator"){h.play("messageReceived"),Pn(b,i.current,"operator",Ue(ke)),!document.hidden&&s.current()&&l.markRead(v).catch(()=>{}),ge&&(Se||!f.localSendRef.current)&&f.settle(ce);return}ke.role==="assistant"&&N(ke,[],Se,ce)},ae=async D=>{let ge=H,ce=await l.loadConversation(v,D?{ids:[D]}:void 0).catch(()=>null);if(y.signal.aborted||o.value!==v||!ce)return!1;ce.controlState&&u({type:"data-control-state",data:ce.controlState});let Se=r.value.at(-1),Be=ge===H&&(D===void 0||Se!==void 0&&(Se.serverMessageId===D||Se.id===D));if(!ce.messages?.length)return!1;Be&&m(ce.canContinue??!0);let ke=r.value,be=D===void 0?ke.at(-1):ke.find(De=>De.serverMessageId===D||De.id===D),{messages:ye,changed:Ee}=Un(ke,It(ce.messages));if(!Ee)return!1;r.value=ye;let Ne=D===void 0?ye.at(-1):ye.find(De=>De.serverMessageId===D||De.id===D),Ae=be?.role==="assistant"&&be.status==="streaming"&&Ne?.role==="assistant"&&Ne.status!=="streaming"&&Ne.id===be.id;return Be&&Ae?N(Ne,ce.suggestions??[],f.localSendRef.current):Be&&Ne?.role==="assistant"&&Ne.status!=="streaming"&&_(Ne,ce.suggestions??[]),!0},oe=new Set;k=({messageId:D})=>{if(oe.has(D)||!r.value.some(ce=>ce.serverMessageId===D||ce.id===D))return;oe.add(D);let ge=()=>oe.delete(D);ae(D).then(ge,ge)};let Ie,me=!1,Pe=()=>{if(y.signal.aborted||o.value!==v){me=!1;return}if(Ie){me=!0;return}let D=ae();Ie=D;let ge=()=>{Ie===D&&(Ie=void 0,me&&(me=!1,Pe()))};D.then(ge,ge)},xe=!1;return bd({signal:y.signal,now:()=>performance.now(),sleep:D=>Bn(D,y.signal),connect:D=>l.connectResumeStream({signal:y.signal,onChunk:te,onConnected:D}),backfill:()=>{let D=xe||P();xe=!0,D&&Pe()}}),()=>{y.abort(),w.detach(),yd.debug("resume stream closed",{conversationId:v})}},[t,n,o,o.value,c,l,u,_,p,d,f,m,r,b,h,x,P])}var zm=32;function xd(e){let{transport:t,setStreaming:n}=e,o=A(),r=A(),i=A(!1),s=A(),l=A(!1),c=A(new Map),u=A(new Set),_=L((k,w)=>{let F=`${k}:${w}`;s.current!==F&&(s.current=F,t.cancelTurn(k,w))},[t]),p=L(k=>{o.current=void 0,r.current=k,i.current=!1,s.current=void 0,l.current=!0,n(!0)},[n]),d=L((k,w)=>{c.current.set(k,{messageId:w})},[]),f=L(k=>{k!==void 0&&(u.current.add(k),u.current.size>zm&&u.current.delete(u.current.values().next().value)),!(k!==void 0&&o.current?.runId!==k)&&(o.current=void 0,r.current=void 0,i.current=!1,l.current=!1,n(!1))},[n]),m=L((k,w)=>r.current!==k?w.runId&&o.current?.runId===w.runId?(o.current={conversationId:w.conversationId,runId:w.runId},i.current&&_(w.conversationId,w.runId),!0):!1:(r.current=void 0,w.runId?(o.current={conversationId:w.conversationId,runId:w.runId},n(!0),i.current&&_(w.conversationId,w.runId),!0):(f(),!0)),[_,n,f]),h=L((k,w)=>{let F=c.current.get(k);return F?(c.current.delete(k),!w.runId||u.current.has(w.runId)?!0:F.runId!==void 0?(F.runId!==w.runId||o.current?.runId===w.runId&&(o.current={conversationId:w.conversationId,runId:w.runId},i.current&&_(w.conversationId,w.runId)),!0):(l.current||r.current||(o.current={conversationId:w.conversationId,runId:w.runId},r.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0)),!0)):!1},[_,n]),b=L(k=>r.current!==k?!1:(f(),!0),[f]),x=L(k=>{let w=c.current.get(k);return w?(c.current.delete(k),w.runId===void 0):!1},[]),P=L((k,w,F,z)=>{let q=w.messageMetadata?.runId;if(w.messageMetadata?.senderRole!==void 0||typeof q!="string"||!q||u.current.has(q))return!1;if(o.current?.runId===q)return l.current;if(l.current)return o.current||!F?!1:(r.current=void 0,o.current={conversationId:k,runId:q},n(!0),i.current&&_(k,q),!0);let H=[...c.current.values()].filter(V=>V.runId===void 0).find(V=>V.messageId===z);return H?(H.runId=q,o.current={conversationId:k,runId:q},r.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0),!0):(r.current=void 0,o.current={conversationId:k,runId:q},n(!0),i.current&&_(k,q),l.current)},[_,n]),v=L(k=>typeof k=="string"&&o.current?.runId===k&&l.current,[]),y=L(()=>{let k=o.current;if(k)return i.current=!0,_(k.conversationId,k.runId),!0;let w=r.current;return w?(i.current=!0,w.then(F=>{F.runId&&_(F.conversationId,F.runId)}).catch(()=>{}),!0):!1},[_]);return Z(()=>({localSendRef:l,begin:p,beginRouted:d,acceptAck:m,acceptRoutedAck:h,reject:b,rejectRouted:x,captureStart:P,ownsLocalRun:v,settle:f,stop:y}),[m,h,p,d,P,v,b,x,f,y])}var qm=ee.scope("send");function Sd(e){return!(e instanceof Ve)||e.code==="network"||e.status===void 0||e.status===202?!0:e.status===408||e.status===425||e.status===429||e.status>=500&&e.status<600}function kd(e){let{transport:t,messagesSig:n,conversationIdSig:o,options:r,bus:i,feedback:s,persistence:l,visitorId:c,adoptConversationId:u,applyControlState:_,setCanSend:p,settleSuggestions:d,runCancellation:f}=e,m=L(()=>{let x=o.value??at();return o.value||(o.value=x,l.saveConversationId(x)),x},[o,l]),h=L(async({continueExisting:x,turn:P})=>{let v=m(),y=n.value.at(-1),k=P?[P]:Gs(n.value,x),w=ia({messages:k.map(_a),conversationId:v,visitorId:c,userPrefs:l.loadUserPrefs()}),F=t.sendTurn(w);f.begin(F);try{let z=await F;if(o.value!==v||!f.acceptAck(F,z))return;if(u(z.conversationId),!z.runId){let q=await t.loadConversation(z.conversationId).catch(()=>null);if(o.value!==z.conversationId)return;if(q){q.controlState&&_(q.controlState),p(q.canContinue??!0);let{messages:I,changed:H}=Un(n.value,It(q.messages??[]));H&&(n.value=I);let V=y?n.value.find(N=>N.id===y.id&&N.role==="assistant"&&N.status!=="streaming"):void 0;V&&d(V,q.suggestions??[]),!x&&y?.role==="assistant"&&n.value.includes(y)&&y.serverMessageId===void 0&&!Et(y)&&(n.value=n.value.filter(N=>N!==y))}else if(y?.role==="assistant"&&n.value.includes(y)){y.status="error",y.errorText=r.strings.errorGeneric;let I=k[0];x?y.retryAction={kind:"continue-assistant",messageId:y.serverMessageId??y.id}:y.retryAction=I?.role==="user"?{kind:"resend-user",messageId:I.id}:null,n.value=[...n.value]}}}catch(z){if(o.value!==v||!f.reject(F))return;let q=Qt(z,r.strings),I=Sd(z),H=P?.role==="assistant"?P:n.value.at(-1);if(x&&H?.role==="assistant"&&z instanceof Ve&&z.status===409){let V=H.serverMessageId??H.id,N=await t.loadConversation(v,{ids:[V]}).catch(()=>null);if(o.value!==v)return;if(N){N.controlState&&_(N.controlState),p(N.canContinue??!0);let te=It(N.messages??[]),ae=te.find(oe=>(oe.serverMessageId??oe.id)===V);if(ae&&Qs(H,ae)){let{messages:oe,changed:Ie}=Un(n.value,te),me=oe.find(Pe=>(Pe.serverMessageId??Pe.id)===V);if(Ie&&me&&me!==H){me.awaitingContinuation=!1,me.continuationStreaming=void 0,me.retryAction=null,n.value=oe,me.status!=="streaming"&&d(me,N.suggestions??[]);return}}}if(!n.value.includes(H)||H.status!=="streaming")return;H.continuationStreaming=!0}if(x&&H?.role==="assistant")H.status="error",H.errorText=q,H.retryAction=I?{kind:"continue-assistant",messageId:H.serverMessageId??H.id}:null,n.value=[...n.value];else if(y?.role==="assistant"&&n.value.includes(y)){y.status="error",y.errorText=q;let V=k[0];y.retryAction=I&&V?.role==="user"?{kind:"resend-user",messageId:V.id}:null,n.value=[...n.value]}else{let V=kt();V.status="error",V.errorText=q;let N=k[0];V.retryAction=I&&N?.role==="user"?{kind:"resend-user",messageId:N.id}:null,n.value=[...n.value,V]}s.play("error"),i.emit("error",z),r.onError?.(z)}},[t,n,r,i,s,l,c,u,_,p,d,m,f]),b=L(async x=>{let P=m();x.status="pending",x.errorText=void 0,x.retryAction=void 0,n.value.includes(x)&&(n.value=[...n.value]);let v=ia({messages:[_a(x)],conversationId:P,visitorId:c,userPrefs:l.loadUserPrefs()}),y=t.sendTurn(v);f.beginRouted(y,x.id);try{let k=await y;if(o.value!==P){f.rejectRouted(y);return}if(!f.acceptRoutedAck(y,k))return;u(k.conversationId),x.status==="pending"&&(x.status="complete",n.value.includes(x)&&(n.value=[...n.value]))}catch(k){let w=f.rejectRouted(y);if(o.value!==P)return;if(!w){x.status==="pending"&&(x.status="complete",n.value.includes(x)&&(n.value=[...n.value]));return}if(x.status!=="pending")return;qm.debug("operator-routed send failed",{error:k});let F=k instanceof Error?k:new Error(String(k));x.status="error",x.errorText=Qt(k,r.strings),x.retryAction=Sd(k)?{kind:"resend-user",messageId:x.id}:null,n.value.includes(x)&&(n.value=[...n.value]),s.play("error"),i.emit("error",F),r.onError?.(F)}},[t,n,r,i,s,l,c,u,m,f]);return{sendAiTurn:h,sendRoutedTurn:b}}var Vm=ee.scope("unread"),Wm=300;function wd(e){let{transport:t,options:n,conversationIdSig:o,isChatActiveRef:r,activated:i,conversationReady:s}=e,l=ct(!1),c=A(new Set),u=A();E(()=>()=>clearTimeout(u.current),[]);let _=L(()=>{let h=r.current()?o.value:void 0;l.value=[...c.current].some(b=>b!==h)},[l,o,r]),p=L(()=>{n.modules.list.some(h=>h.layout==="chat")&&t.listConversations({limit:50}).then(h=>{c.current=new Set(h.conversations.filter(b=>b.hasUnread).map(b=>b.conversationId)),_()}).catch(h=>Vm.debug("refreshUnread failed (non-fatal)",{err:h}))},[t,n.modules,_]),d=L(h=>{c.current.delete(h),_()},[_]),f=L(()=>{if(!r.current())return;let h=o.value;h&&(clearTimeout(u.current),u.current=setTimeout(()=>{d(h),t.markRead(h)},Wm))},[t,o,d,r]),m=A(!1);return E(()=>{!i||!s||m.current||(m.current=!0,p())},[i,s,p]),E(()=>{if(!i)return;let h=()=>{document.visibilityState==="visible"&&p()};return document.addEventListener("visibilitychange",h),()=>document.removeEventListener("visibilitychange",h)},[i,p]),{hasUnreadSig:l,refreshUnread:p,clearUnread:d,markActiveConversationRead:f}}var eo=ee.scope("settings");function Cd(e){let{options:t,persistence:n,transport:o,feedback:r,hostElement:i,bus:s}=e,l=n.loadUserPrefs(),[c,u]=O(()=>l.locale??t.locale),[_,p]=O(()=>l.themeMode??t.themeMode),[d,f]=O(()=>l.textSize??t.textSize),m=L(y=>{n.patchUserPrefs(y),o.saveUserPrefs(n.loadUserPrefs()).catch(k=>eo.warn("saveUserPrefs failed",{err:k}))},[n,o]);E(()=>{l.soundMuted!==void 0&&r.setMuted(l.soundMuted)},[]),E(()=>{i.dataset.theme=_},[i,_,t]),E(()=>{i.dataset.textSize=d},[i,d,t]),E(()=>{let y=!0;return r.mutedSig.subscribe(k=>{if(y){y=!1;return}m({soundMuted:k})})},[r,m]);let h=cn(c,t.availableLocales,t.defaultLocale);E(()=>{o.setLocale(h)},[o,h]),E(()=>{i.dir=wi(h)?"rtl":"ltr"},[i,h]),E(()=>{h!==c&&u(h)},[h,c]);let b=L(y=>{eo.info("localeChange",{locale:y}),u(y),m({locale:y}),s.emit("localeChange",y)},[m,s]),x=L(y=>{eo.info("themeChange",{mode:y}),p(y),i.dataset.theme=y,m({themeMode:y}),s.emit("themeChange",y)},[i,m,s]),P=L(y=>{eo.info("textSizeChange",{size:y}),f(y),i.dataset.textSize=y,m({textSize:y}),s.emit("textSizeChange",y)},[i,m,s]),v=L(()=>{r.toggleMuted();let y=r.mutedSig.value;eo.info("soundToggle",{muted:y}),s.emit("soundToggle",{muted:y})},[r,s]);return{activeLocale:c,activeThemeMode:_,activeTextSize:d,effectiveLocale:h,setActiveLocale:u,setActiveThemeMode:p,setActiveTextSize:f,patchAndSync:m,handleLocaleChange:b,handleThemeChange:x,handleTextSizeChange:P,handleSoundToggle:v}}var he=ee.scope("app"),br=C.cssPrefix;function Rd(e,t){return Vs({...e,text:Ze(t,e.text)})}function Td({options:e,hostElement:t,bus:n}){let[o]=O(()=>dn(e.widgetId,e.storage,e.aiAgentDeploymentId)),[r,i]=O(()=>o.getVisitorId()),s=o.loadUserPrefs(),l=ct(o.loadConversationId()),c=A(l.value!==void 0),u=ct(l.value??""),_=ct([]),[p,d]=O(!1),f=A(),[m,h]=O([]);function b(){let g=e.modules.list,T=new Set(g.map(B=>B.id)),W=o.loadActiveModule();return W&&T.has(W)?W:g[0]?.id??""}function x(){return e.modules.list.find(g=>g.layout==="chat")?.id}function P(){let g=x();return g?e.modules.list.length===1?!0:k.sig.value.activeTab===g:!1}let v=A(P);v.current=P;let y=A();if(!y.current){let g=e.modules.list.map(T=>T.id);y.current=Wc(b(),g,T=>o.saveActiveModule(T))}let k=y.current,[w,F]=O(!1),[z,q]=O(null),[I,H]=O(!1),V=e.mode==="standalone"||e.mode==="inline",N=A(Fn(e,fn(),o.loadPanelOpen(),o.loadPanelSize())),[te,ae]=O(N.current.panelOpen),[oe,Ie]=O(N.current.panelOpen),me=A(!1),Pe=A(!1),xe=A(void 0);E(()=>{te&&Ie(!0)},[te]);let D=A(!1),[ge,ce]=O(!1),{dismissed:Se,dismissCallout:Be}=pd({callout:e.launcher.callout,persistence:o}),ke=e.launcher.callout?.persistent??!0,be=L(()=>{he.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Be()},[n,Be]),[ye,Ee]=O(N.current.panelSize),Ne=A(!1),[Ae,De]=O("chat"),[ze,U]=O(!0),K=A(ze);K.current=ze;let[j,ue]=O(!1),Qe=A(j);Qe.current=j;let S=A(null),[X,ie]=O(!1),[ve,Me]=O(null),[dt,nt]=O([]),Ye=A(e.strings),xn=A(e);xn.current=e;let[Dt,Ga]=O(void 0),[Ld,Od]=O(void 0),[Nd,Dd]=O(()=>o.loadSidebarCollapsed()??!1),[xr,$d]=O({}),[se]=O(()=>new Do({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Ls({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[ot]=O(()=>new Vo(e.sound,e.haptics)),Ct=xd({transport:se,setStreaming:ue}),{activeLocale:to,activeThemeMode:Ka,activeTextSize:ja,effectiveLocale:tn,setActiveLocale:Fd,setActiveThemeMode:Bd,setActiveTextSize:Hd,patchAndSync:Xa,handleLocaleChange:Ud,handleThemeChange:zd,handleTextSizeChange:qd,handleSoundToggle:Vd}=Cd({options:e,persistence:o,transport:se,feedback:ot,hostElement:t,bus:n}),{controlModeSig:gt,assignedOperatorInitialsSig:Wd,operatorAvailableSig:Gd,applyControlState:nn,adoptControlStateChunk:Kd,requestOperator:jd,cancelOperatorRequest:Xd}=fd({transport:se,conversationIdSig:l}),{hasUnreadSig:Yd,refreshUnread:Ya,clearUnread:Ja,markActiveConversationRead:Jd}=wd({transport:se,options:e,conversationIdSig:l,isChatActiveRef:v,activated:oe,conversationReady:w});E(()=>{ot.update(e.sound,e.haptics)},[ot,e.sound,e.haptics]),E(()=>()=>ot.destroy(),[ot]),E(()=>{Ne.current||!e.size.initialSize||(Ne.current=!0,!o.loadPanelSize()&&Ee(aa(e.mode,e.size,fn())))},[e.mode,e.size,o]),E(()=>{if(!w||D.current)return;D.current=!0;let g=Fn(e,fn(),o.loadPanelOpen(),o.loadPanelSize());ae(g.panelOpen),Ee(g.panelSize)},[w,e,o]);let Qa=A(null);E(()=>{w&&k.reconcile(e.modules.list.map(g=>g.id),b())},[w,e.modules.list,k]);let no=L(g=>{!g||g.length===0||(_.value=g.map(T=>Rd(T,Ye.current)))},[_]),Sr=A(null),oo=L(async g=>{try{let{formSubmissions:T}=await(g?se.bootstrap(g):Sr.current??se.bootstrap()),W=new Map;return T.forEach((B,Q)=>W.set(B.formId,Q)),T.filter((B,Q)=>!B.skipped||W.get(B.formId)===Q).map((B,Q)=>({key:`wire:${B.formId}:${B.createdAt??Q}`,formId:B.formId,outcome:B.skipped?"skipped":"submitted",createdAt:Lo(B.createdAt),values:B.values}))}catch(T){return he.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:T}),[]}},[se]),Sn=A(0),vt=A(0),kr=L((g,T)=>{if(g===l.value)return;let W=l.value;vt.current++,d(!1),W&&(o.saveDraft(g,o.loadDraft(W)),o.saveDraft(W,"")),l.value=g,o.saveConversationId(g),se.primeIdentity(void 0,g),he.info("conversation rebound",{previous:W,current:g,reason:T}),W&&n.emit("conversationRebound",{previous:W,current:g,...T?{reason:T}:{}})},[n,l,o,se]),ro=L((g,T)=>{let W=[...g.map(M=>M.createdAt),...T.map(M=>M.createdAt)].filter(M=>M!==void 0),B=(W.length?Math.min(...W):Date.now())-1;return[...(xe.current?.messages??[]).map(M=>{let je=Rd(M,Ye.current);return je.createdAt=B,je}),...g]},[]),Qd=L(async g=>{let T=vt.current,W=()=>T!==vt.current||l.value!==g;d(!0);try{let[B,Q]=await Promise.all([se.loadConversation(g),oo()]);if(W())return;let M=It(B.messages??[]);if(h(Q),_.value=ro(Js(M,_.value),Q),M.length>0||B.controlState!==void 0){U(B.canContinue??!0),nn(Tt(B.controlState));let de=M.findLast(He=>He.role==="assistant"&&!He.ephemeral);nt(de?.suggestions??B.suggestions??[])}}catch(B){if(W())return;he.warn("loadThread failed; keeping conversation active",{err:B,conversationId:g}),n.emit("error",B),e.onError?.(B)}finally{W()||d(!1)}},[se,oo,_,l,ro,n,e]),Zd=L(()=>{if(f.current)return Promise.resolve(void 0);let g=l.value,T=_.value.find(M=>!M.ephemeral),W=T?.serverMessageId??T?.id;if(!g||!W)return Promise.resolve(void 0);let B=vt.current,Q={};return f.current=Q,(async()=>{try{let M=await se.loadConversation(g,{beforeId:W});if(f.current!==Q||vt.current!==B||l.value!==g)return;if(M.messages.length===0)return!1;let je=M.messages.map(ua),de=_.value,He=Xs(de,je);if(He!==de){let Ft=Math.min(...je.map(Bt=>Bt.createdAt??1/0),...m.map(Bt=>Bt.createdAt??1/0));if(Number.isFinite(Ft))for(let Bt of de){if(!Bt.ephemeral)break;(Bt.createdAt??1/0)>=Ft&&(Bt.createdAt=Ft-1)}_.value=He}return!0}catch(M){if(f.current!==Q||vt.current!==B||l.value!==g)return;he.warn("load previous messages failed",{err:M,conversationId:g,beforeId:W}),n.emit("error",M),e.onError?.(M);return}finally{f.current===Q&&(f.current=void 0)}})()},[n,l,m,_,e,se]),kn=L(async({newConversation:g})=>{let T=++Sn.current,W=()=>T!==Sn.current,B=l.value,Q=g||!B?at():B;Q!==B&&(vt.current++,d(!1),_t(()=>{l.value=Q,u.value=Q}),o.saveConversationId(Q)),se.primeIdentity(r,Q);let M;try{M=await se.handshake({visitorId:r,conversationId:Q,userPrefs:o.loadUserPrefs(),locale:to})}catch(de){if(W())return;n.emit("error",de),e.onError?.(de),g||F(!0);return}if(W())return;if(M.visitorId&&M.visitorId!==r&&(he.info("visitor rebound",{previous:r,current:M.visitorId,reason:M.rebind?.visitorId}),o.setVisitorId(M.visitorId),i(M.visitorId),n.emit("visitorRebound",{previous:r,current:M.visitorId,reason:M.rebind?.visitorId})),M.conversationId!==Q&&kr(M.conversationId,M.rebind?.conversationId),M.agent&&Me(M.agent),nn(Tt(M.controlState)),e.mode==="page"&&(M.site&&Es(M.site)?Ga(M.site):M.site&&he.warn("invalid site config, using fallback",{site:M.site}),M.blocks&&As(M.blocks)?Od(M.blocks):M.blocks&&he.warn("invalid blocks config, using fallback",{blocks:M.blocks})),M.userPrefs&&!g&&(o.saveUserPrefs(M.userPrefs),M.userPrefs.locale&&Fd(M.userPrefs.locale),M.userPrefs.soundMuted!==void 0&&ot.setMuted(M.userPrefs.soundMuted),M.userPrefs.themeMode&&Bd(M.userPrefs.themeMode),M.userPrefs.textSize&&Hd(M.userPrefs.textSize)),xe.current=M.welcome,g||n.emit("handshake",M),M.welcome?.suggestions){let de=Ye.current;nt(M.welcome.suggestions.map(He=>({...He,label:Ze(de,He.label),...He.text===void 0?{}:{text:Ze(de,He.text)}})))}let je=!g&&B&&M.conversationId===B;c.current=!!je,je?Pe.current||(me.current=!0):no(M.welcome?.messages),g||F(!0)},[se,r,o,e,n,l,u,ot,no,to,kr]),wn=JSON.stringify(e.userContext??null),eu=JSON.stringify(e.pageContext??null),tu=JSON.stringify(xr);E(()=>{let g=Object.keys(xr).length?{...xr,...e.userContext}:e.userContext;se.setContext(g,Gm(e.pageContext))},[se,wn,eu,tu]);let Za=L((g,T=[])=>nt(g.suggestions??T),[]);E(()=>(se.primeIdentity(r,l.value),kn({newConversation:!1}),()=>{Sn.current++,vt.current++}),[]),E(()=>{if(!(!oe||!w||Pe.current)&&(Pe.current=!0,Sr.current=se.bootstrap(),(async()=>{try{let g=await Sr.current;q(Ln((g??{forms:[]}).forms,tn))}catch(g){he.debug("bootstrap failed \u2014 treating as no forms",{err:g})}finally{H(!0)}})(),me.current)){me.current=!1;let g=l.value;g&&Qd(g)}},[oe,w]);let ao=A(null);E(()=>{if(!oe||!w)return;if(ao.current===null){ao.current=tn;return}if(ao.current===tn)return;ao.current=tn;let g=!1;return se.bootstrap().then(T=>{g||q(Ln((T??{forms:[]}).forms,tn))}).catch(T=>he.debug("forms re-localize failed \u2014 keeping current copy",{err:T})),()=>{g=!0}},[oe,w,tn,se]);let ei=A(wn);E(()=>{!w||ei.current===wn||(ei.current=wn,kn({newConversation:!1}))},[wn,w,kn]),md({hostElement:t,mode:e.mode,panelSize:ye,isOpen:te,setIsOpen:ae});let{sendAiTurn:$t,sendRoutedTurn:Cn}=kd({transport:se,messagesSig:_,conversationIdSig:l,options:e,bus:n,feedback:ot,persistence:o,visitorId:r,adoptConversationId:kr,applyControlState:nn,setCanSend:U,settleSuggestions:Za,runCancellation:Ct}),{toolInteraction:nu}=_d({streaming:j,controlModeSig:gt,messagesSig:_,sendAiTurn:$t,bus:n,humanInLoop:e.features.humanInLoop}),ou=L((g,T)=>{let W=_.value.find(B=>B.serverMessageId===g);W&&(W.feedback=T),he.info("messageFeedback",{messageId:g,value:T}),n.emit("messageFeedback",{messageId:g,value:T}),se.submitFeedback({messageId:g,value:T})},[n,_,se]),ru=()=>_.value.reduce((g,T)=>g+(T.role==="user"?1:0),0),on=e.forms.list.length>0?e.forms:z??e.forms,Te=Hc({forms:on,persistence:o,userContext:()=>e.userContext,messageCount:ru,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>l.value,onComplete:(g,T,W,B)=>{he.info("formSubmit",{formId:g.id,trigger:T,skipped:B}),n.emit("formSubmit",{formId:g.id,values:W,skipped:B}),h(M=>{let de=M.find(He=>He.formId===g.id&&He.outcome==="skipped")?.createdAt??Date.now();return[...M.filter(He=>!(He.formId===g.id&&He.outcome==="skipped")),{key:`local:${g.id}:${de}`,formId:g.id,outcome:B?"skipped":"submitted",createdAt:de,...B?{}:{values:W}}]});let Q=l.value??at();l.value||(l.value=Q,o.saveConversationId(Q),se.primeIdentity(void 0,Q)),!B&&g.mirrorToContext&&$d(M=>({...M,...W})),se.submitForm({formId:g.id,conversationId:Q,trigger:T,values:W,skipped:B})}}),wr=St(()=>Te.activeForm.value),au=L(()=>Te.fire("after-messages"),[Te]),iu=L(()=>c.current||_.value.some(g=>!g.ephemeral&&g.role==="user"),[_]);Pd({activated:oe,conversationReady:w,conversationIdSig:l,messagesSig:_,optionsRef:xn,isChatActiveRef:v,transport:se,visitorId:r,adoptControlStateChunk:Kd,settleSuggestions:Za,markActiveConversationRead:Jd,onReplyLanded:au,runCancellation:Ct,setCanSend:U,feedback:ot,bus:n,homeNav:k,shouldReconcileOnConnect:iu}),E(()=>{Te.refresh()},[on,Te]);let ti=e.pageContext?.area?String(e.pageContext.area):void 0,su=St(()=>_.value.length);E(()=>{w&&I&&Te.fire("pre-chat")},[w,I,Te]),E(()=>{I&&!ze&&Te.fire("conversation-closed")},[I,ze,Te]),E(()=>{w&&I&&ti&&Te.fire("page-area")},[w,I,ti,Te]);let Cr=Z(()=>{let g=on.list.flatMap(T=>T.triggers).filter(T=>T.kind==="idle").map(T=>Number(T.param));return g.length?Math.min(...g)*1e3:0},[on]);E(()=>{if(!Cr||!te)return;let g=setTimeout(()=>Te.fire("idle"),Cr);return()=>clearTimeout(g)},[Cr,te,Te,su.value]);let ni=L(async(g,T)=>{if(S.current)return!1;let W=l.value,B=gt.value!=="ai-agent";if(he.info("send",{textLen:g.length,attachments:T.length,streaming:Qe.current,routedToOperator:B}),Qe.current&&!B)return!1;let Q=new AbortController,M={conversationId:W,controller:Q};S.current=M,ie(!0);try{ot.unlock();let je=await jm(se,T,Q.signal,Ft=>{Q.signal.aborted||(he.warn("upload failed",{err:Ft}),n.emit("error",Ft),e.onError?.(Ft))});if(Q.signal.aborted||l.value!==W||!K.current||Te.activeForm.value)return!1;let de=gt.value!=="ai-agent";if(Qe.current&&!de||!g&&je.length===0)return!1;n.emit("send",{text:g,attachmentCount:T.length}),dt.length>0&&nt([]),ot.play("messageSent");let He=da(g,je);return Pn(n,e,"user",g),de?(_.value=[..._.value,He],Cn(He),!0):(_.value=[..._.value,He,kt()],$t({continueExisting:!1}),!0)}finally{S.current===M&&(S.current=null,ie(!1))}},[se,n,e,dt.length,_,l,$t,Cn,gt]);E(()=>{let g=l.value;return()=>{let T=S.current;!T||T.conversationId!==g||(S.current=null,ie(!1),T.controller.abort())}},[l.value]),E(()=>{ze&&!wr.value||S.current?.controller.abort()},[wr.value,ze]);let lu=L(()=>{if(!Ct.stop())return;he.info("stop"),n.emit("stop",void 0);let g=_.value.at(-1);g&&g.role!=="user"&&g.status==="streaming"&&(g.canceled=!0,_.value=[..._.value])},[Ct,n,_]),cu=L(g=>{if(j)return;let T=_.value,W=Uo(T,g);if(W)switch(he.info("retry",{kind:W.kind,messageId:W.messageId}),W.kind){case"continue-assistant":{if(gt.value!=="ai-agent"||g.role!=="assistant"||(g.serverMessageId??g.id)!==W.messageId)return;g.status="streaming",g.errorText=void 0,g.retryAction=void 0,g.awaitingContinuation=!0,_.value=[...T],$t({continueExisting:!0,turn:g});return}case"resend-user":{let B=T.find(M=>M.role==="user"&&M.id===W.messageId);if(!B)return;if(B.status="complete",B.errorText=void 0,B.retryAction=void 0,gt.value!=="ai-agent"){_.value=g.role==="assistant"?T.filter(M=>M!==g):[...T],Cn(B);return}let Q=kt();_.value=g.role==="assistant"?T.map(M=>M===g?Q:M):[...T,Q],$t({continueExisting:!1,turn:B});return}case"repeat-user":{let B=T.find(de=>de.role==="user"&&de.id===W.messageId);if(!B)return;let Q=da(Ue(B),B.attachments?.map(de=>({...de}))??[]),M=new Set(Q.attachments?.flatMap(de=>de.url?[de.url]:[])??[]),je=B.partsSig.value.flatMap(de=>de.kind==="file"&&!M.has(de.url)?[{...de}]:[]);if(je.length>0&&(Q.partsSig.value=[...Q.partsSig.value,...je]),gt.value!=="ai-agent"){_.value=[...T,Q],Cn(Q);return}_.value=[...T,Q,kt()],$t({continueExisting:!1,turn:Q});return}default:return W}},[j,_,gt,$t,Cn]),Rn=L(()=>{if(zl(e.mode,ye)==="exit-fullscreen"){he.info("close \u2192 exit-fullscreen",{mode:e.mode}),Ee("normal"),n.emit("fullscreen",!1);return}he.info("close \u2192 panel closed",{mode:e.mode}),Te.fire("panel-close"),ae(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,ye,Te]),Rr=L(()=>{he.info("open",{mode:e.mode}),ot.unlock(),ce(!0),ae(!0),o.savePanelOpen(!0),!Se&&!ke&&be(),setTimeout(()=>ce(!1),Km),oe&&Ya(),n.emit("open",void 0),e.onOpen?.()},[n,e,ot,o,Se,ke,be,oe,Ya]),Tr=L(()=>{if(!_.value.some(T=>T.role==="user")&&ze&&l.value){he.info("clear \u2192 reusing empty conversation",{conversationId:l.value}),_.value.length===0&&no(xe.current?.messages);return}he.info("clear \u2192 new conversation",{wasStreaming:j}),n.emit("clear",void 0),Ct.settle(),c.current=!1,_t(()=>{_.value=[],l.value=void 0,nn({controlMode:"ai-agent",controlRevision:0})}),o.clearConversation(),U(!0),h([]),nt([]),kn({newConversation:!0})},[j,_,l,o,kn,n,ze,no,Ct,nn]),Ir=L(()=>{Tr(),De("chat");let g=e.modules.list.find(T=>T.layout==="chat")?.id;g&&k.switchTab(g)},[Tr,k,e]),Er=L(()=>{let g=ye==="expanded"?"normal":"expanded";he.info("expand",{from:ye,expanded:g==="expanded"}),Ee(g),o.savePanelSize(g),n.emit("expand",g==="expanded")},[n,ye,o]),Ar=L(()=>{let g=ye==="fullscreen"?"normal":"fullscreen";he.info("fullscreen",{from:ye,fullscreen:g==="fullscreen"}),Ee(g),o.savePanelSize(g),n.emit("fullscreen",g==="fullscreen")},[n,ye,o]),du=L(()=>{De(g=>{let T=g==="history"?"chat":"history";return he.info("toggleHistory",{view:T}),n.emit("toggleHistory",{view:T}),T})},[n]),uu=L(()=>{Dd(g=>{let T=!g;return he.info("sidebarToggle",{collapsed:T}),o.saveSidebarCollapsed(T),n.emit("sidebarToggle",{collapsed:T}),T})},[o,n]),_u=L(g=>{he.info("resize",g),Xa({widgetSize:g}),n.emit("resize",g)},[Xa,n]),Mr=L(async g=>{let T=++Sn.current;vt.current++,d(!1);let W=()=>T!==Sn.current;he.info("selectConversation",{conversationId:g,wasStreaming:j}),n.emit("selectConversation",{conversationId:g});try{let[B,Q]=await Promise.all([se.loadConversation(g),oo(g)]);if(W())return;Ct.settle(),c.current=!0;let M=It(B.messages);_t(()=>{_.value=ro(M,Q),B.conversationId!==l.value&&(u.value=B.conversationId),l.value=B.conversationId}),h(Q),o.saveConversationId(B.conversationId),se.primeIdentity(r,B.conversationId),B.agent&&Me(B.agent),U(B.canContinue),nn(Tt(B.controlState));let je=M.findLast(de=>de.role==="assistant"&&!de.ephemeral);if(nt(je?.suggestions??B.suggestions??[]),De("chat"),await se.markRead(g),W())return;Ja(g)}catch(B){if(W())return;n.emit("error",B),e.onError?.(B)}},[se,_,l,u,n,e,o,Ja,oo,ro,j,r,Ct]),io=A(null),oi=L(g=>{typeof g=="string"&&(I?Te.fire("manual",g):io.current=g)},[I,Te]);E(()=>{!I||!io.current||(Te.fire("manual",io.current),io.current=null)},[I,Te]);let rn=A({handleOpen:Rr,handleClose:Rn,handleExpand:Er,handleFullscreen:Ar,openForm:oi});rn.current={handleOpen:Rr,handleClose:Rn,handleExpand:Er,handleFullscreen:Ar,openForm:oi},ut(()=>Ms(t,{open:()=>rn.current.handleOpen(),close:()=>rn.current.handleClose(),expand:()=>rn.current.handleExpand(),fullscreen:()=>rn.current.handleFullscreen(),openForm:g=>rn.current.openForm(g)}),[t]);let Je=Z(()=>Xr(e,to,Ka,ja),[e,to,Ka,ja]);Ye.current=Je.strings;let pu=Z(()=>m.map(g=>{let T=on.list.find(W=>W.id===g.formId);return{...g,title:T?.title,form:T}}),[m,on]),ri={options:Je,transport:se,feedback:ot,bus:n,persistence:o,conversationId:l.value??"",composerKey:u.value,composerApiRef:Qa,view:Ae,canSend:ze,isStreaming:j,sendPreparing:X,composerActive:Je.mode==="page"||Je.mode==="inline"||Je.mode==="standalone"||te,controlMode:gt.value,assignedOperatorInitials:Wd.value,operatorAvailable:Gd.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:jd,onCancelOperatorRequest:Xd,loadingMessages:p,onLoadPreviousMessages:Zd,messagesSig:_,agent:ve,suggestions:dt,initialWidgetSize:s.widgetSize??null,visitorId:r,onClose:Rn,onClear:Tr,onExpand:Er,onFullscreen:Ar,onSoundToggle:Vd,onToggleHistory:du,onSelectHistoryConversation:Mr,onNewConversation:Ir,onLocaleChange:Ud,onThemeChange:zd,onTextSizeChange:qd,onWidgetSizeChange:_u,onSend:ni,onStop:lu,onSuggestion:g=>{if(S.current)return;let T=g.text??g.label;he.info("suggestion",{text:T,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:T}),e.autoSendSuggestions?ni(T,[]):Qa.current?.fill(T)},activeForm:wr.value?.form??null,formMarkers:pu,onFormSubmit:Te.complete,onFormSkip:Te.skip,onFormFill:g=>Te.fire("manual",g),tool:nu,onRetry:cu,onMessageFeedback:ou},fu=g=>{Mr(g);let T=x();T&&k.switchTab(T)};if(!w)return null;let Tn=Je.modules.list,Lr=g=>{let T=Gn("close",Je.mode,g);return Tn.length===0?a(ud,{strings:Je.strings,onClose:T?Rn:void 0}):Tn.length===1&&Tn[0]?.layout==="chat"?a(Bc,{...ri,panelSize:g}):a(dd,{panelProps:{...ri,panelSize:g,onClose:T?Rn:void 0},enabledModules:Tn,nav:k,bus:n,hasUnread:Yd.value,onSelectConversation:fu,onStartNewConversation:Ir,onSetPanelSize:Ee})};if(e.mode==="page"){let g=W=>{Mr(W.conversationId)},T=Tn.some(W=>W.layout==="chat");return a("div",{class:`${br}-anchor`,children:a(qc,{site:Dt,blocks:Ld,transport:se,strings:Je.strings,locale:Je.locale,persistence:o,visitorId:r,showConversations:T,onSelectConversation:g,onNewConversation:Ir,sidebarCollapsed:Nd,onToggleSidebarCollapsed:uu,children:Lr("fullscreen")})})}if(V){let g=e.mode==="standalone"?"fullscreen":ye;return a("div",{class:`${br}-anchor`,children:Lr(g)})}let ai=e.mode==="drawer",ii=!(e.mode==="modal")&&!e.launcher.hidden&&(!te||ge),si=ii&&!ge&&!Se&&!ai?Je.launcher.callout:null;return a("div",{class:`${br}-anchor`,"data-launcher-size":Je.launcher.size,children:[te||oe?a("div",{class:`${br}-surface`,hidden:!te,children:Lr(ye)}):null,ii?a(Bl,{onToggle:Rr,launcher:Je.launcher,strings:Je.strings,leaving:ge,edgeTab:ai}):null,si?a(Hl,{callout:si,launcherPosition:Je.position,strings:Je.strings,closeLabel:Je.strings.close,onDismiss:be}):null]})}function Gm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Km=120;async function jm(e,t,n,o){return(await Promise.all(t.map(async i=>{try{let{id:s,url:l}=await e.uploadFile(i.file,n);return{id:s,name:i.name,mediaType:i.mediaType,size:i.size,url:l}}catch(s){o(s);return}}))).filter(i=>i!==void 0)}var Xm=ee.scope("error-boundary"),yr=class extends et{constructor(){super(...arguments);ne(this,"state",{crashed:!1})}componentDidCatch(n,o){Xm.error("widget render crashed",{error:n,componentStack:o?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,o?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};var Ym="1",Jm=60,Qm=2e3,Id={open:()=>{},close:()=>{},expand:e=>({on:e}),fullscreen:e=>({on:e}),send:e=>({attachments:e.attachmentCount}),message:e=>({role:e.role}),stop:()=>{},clear:()=>{},suggestion:()=>{},toggleHistory:e=>({view:e.view}),handshake:()=>{},formSubmit:e=>({formId:e.formId,skipped:e.skipped}),toolResult:()=>{},toolDecision:e=>({approved:e.approved}),messageFeedback:e=>({value:e.value??"none"}),contentView:e=>({section:e.section,tags:e.tags,count:e.count}),contentOpen:e=>({contentId:e.contentId,tags:e.tags}),contentSearch:e=>({qlen:e.queryLength,hits:e.hitCount}),contentRead:e=>({contentId:e.contentId}),contentLinkClick:e=>({contentId:e.contentId}),attach:e=>({count:e.count,bytes:e.totalBytes}),voiceStart:()=>{},voiceStop:e=>({ms:e.durationMs}),voiceCancel:()=>{},localeChange:e=>({locale:e}),themeChange:e=>({theme:e}),textSizeChange:e=>({size:e}),soundToggle:e=>({muted:e.muted}),sidebarToggle:e=>({collapsed:e.collapsed}),calloutDismiss:()=>{},error:()=>{}};function Zm(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function eg(){return location.origin+location.pathname}function tg(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Ed(e,t){let n=Math.random(),o=0,r=0,i=new Set,s=(c,u)=>{let{tracking:_,publicKey:p,aiAgentDeploymentId:d,mode:f,themeMode:m}=t.getOptions();if(!_.enabled||Zm()||n>=_.sampleRate)return;let h=performance.now();if(h-o>6e4&&(o=h,r=0),++r>Jm)return;let b=new URLSearchParams;b.set("v",Ym),b.set("_ev",Mo),b.set("e",c),_.token&&b.set("tk",_.token),p&&b.set("pk",p),d&&b.set("dep",d),b.set("vid",t.getVisitorId());let x=t.getConversationId();x&&b.set("cid",x),b.set("url",eg());let P=tg();P&&b.set("ref",P),b.set("sw",String(screen.width)),b.set("sh",String(screen.height)),b.set("vw",String(innerWidth)),b.set("vh",String(innerHeight)),b.set("dpr",String(devicePixelRatio)),b.set("lang",navigator.language);try{b.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(b.set("m",f),b.set("th",m),u)for(let[w,F]of Object.entries(u))F!==void 0&&b.set(w,String(F));b.set("ts",String(Date.now()));let v=`${_.endpoint}?${b}`;if(v.length>Qm)return;let y=new Image(1,1);i.add(y);let k=()=>i.delete(y);y.addEventListener("load",k,{once:!0}),y.addEventListener("error",k,{once:!0}),y.src=v},l=Object.keys(Id).map(c=>e.on(c,u=>s(c,Id[c]?.(u))));return()=>{for(let c of l)c();i.clear()}}function Ad(e){let{bus:t,host:n,appRoot:o,persistence:r,reportError:i}=e,s=e.initialRaw,l,c=ln(s),u=!0,_=()=>{c=ln(l?Yr(s,l):s)},p=()=>{is(n,yo(c.mode));let m=r.loadUserPrefs().themeMode;ls(n,m?{...c,themeMode:m}:c),u&&(Po(n,ng(c)),u=!1)},d=()=>{p(),Mn(bt(yr,{onError:i},bt(Td,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&r.rememberStorageVersion(m.config.storageVersion),l=m.config,_(),d())});let f=Ed(t,{getOptions:()=>c,getVisitorId:()=>r.getVisitorId(),getConversationId:()=>r.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>s,render:d,setUserOptions:m=>{s=m,_(),d()},patchUserOptions:m=>{s={...s,...m},_(),d()},destroy:()=>f()}}function ng(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=dn(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=Fn(e,fn(),t.loadPanelOpen(),t.loadPanelSize());return Ao(e.mode,o,n)}var Pr=class{constructor(){ne(this,"handlers",new Map)}on(t,n){let o=this.handlers.get(t);return o||(o=new Set,this.handlers.set(t,o)),o.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let o=this.handlers.get(t);if(o)for(let r of o)try{r(n)}catch{}}clear(){this.handlers.clear()}};var Wa=class extends HTMLElement{constructor(){super(...arguments);ne(this,"bus",new Pr);ne(this,"mountResult",null);ne(this,"runtime",null)}static get observedAttributes(){return Jr}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Mn(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=Qr(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let o=ln(n);this.mountResult||(this.mountResult=ss({existingHost:this,position:yo(o.mode)}));let r=dn(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=Ad({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:r,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},Md=!1;function og(){if(Md||typeof customElements>"u")return;let e=C.tagName;customElements.get(e)||customElements.define(e,Wa),Md=!0}typeof customElements<"u"&&og();export{og as registerWebComponent};
|
|
42
42
|
//# sourceMappingURL=elements-web-component.esm.js.map
|