@helpai/elements 0.67.3 → 0.67.4
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/elements-web-component.esm.js +28 -28
- 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.mjs +3 -3
- package/package.json +1 -1
- package/web-component.mjs +3 -3
package/elements.cjs.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";var Wn=Object.defineProperty;var pd=Object.getOwnPropertyDescriptor;var md=Object.getOwnPropertyNames;var fd=Object.prototype.hasOwnProperty;var gd=(e,t,n)=>t in e?Wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var hd=(e,t)=>{for(var n in t)Wn(e,n,{get:t[n],enumerable:!0})},vd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of md(t))!fd.call(e,a)&&a!==n&&Wn(e,a,{get:()=>t[a],enumerable:!(o=pd(t,a))||o.enumerable});return e};var bd=e=>vd(Wn({},"__esModule",{value:!0}),e);var K=(e,t,n)=>gd(e,typeof t!="symbol"?t+"":t,n);var Xm={};hd(Xm,{HOOK_WILDCARD:()=>ir,brand:()=>jm,destroy:()=>qm,getAllInstances:()=>Wm,getInstance:()=>Vm,hook:()=>Gm,init:()=>Um,mount:()=>Ic,resolveInitialHostMode:()=>ar,version:()=>Km});module.exports=bd(Xm);var Qn,te,Ja,Sr,_t,Ka,Qa,Za,yr,Kn,on,ei,kr,Pr,xr,yd,Xn={},Yn=[],Pd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Zn=Array.isArray;function ot(e,t){for(var n in t)e[n]=t[n];return e}function wr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function eo(e,t,n){var o,a,i,l={};for(i in t)i=="key"?o=t[i]:i=="ref"?a=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?Qn.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return jn(e,l,o,a,null)}function jn(e,t,n,o,a){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Ja,__i:-1,__u:0};return a==null&&te.vnode!=null&&te.vnode(i),i}function se(e){return e.children}function ut(e,t){this.props=e,this.context=t}function Mt(e,t){if(t==null)return e.__?Mt(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"?Mt(e):null}function xd(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],a=[],i=ot({},t);i.__v=t.__v+1,te.vnode&&te.vnode(i),Cr(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Mt(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,ai(o,i,a),t.__e=t.__=null,i.__e!=n&&ti(i)}}function ti(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}),ti(e)}function ja(e){(!e.__d&&(e.__d=!0)&&_t.push(e)&&!Jn.__r++||Ka!=te.debounceRendering)&&((Ka=te.debounceRendering)||Qa)(Jn)}function Jn(){try{for(var e,t=1;_t.length;)_t.length>t&&_t.sort(Za),e=_t.shift(),t=_t.length,xd(e)}finally{_t.length=Jn.__r=0}}function ni(e,t,n,o,a,i,l,s,c,d,u){var f,_,g,h,P,m,b,w=o&&o.__k||Yn,v=t.length;for(c=Sd(n,t,w,c,v),f=0;f<v;f++)(g=n.__k[f])!=null&&(_=g.__i!=-1&&w[g.__i]||Xn,g.__i=f,m=Cr(e,g,_,a,i,l,s,c,d,u),h=g.__e,g.ref&&_.ref!=g.ref&&(_.ref&&Tr(_.ref,null,g),u.push(g.ref,g.__c||h,g)),P==null&&h!=null&&(P=h),(b=!!(4&g.__u))||_.__k===g.__k?(c=oi(g,c,e,b),b&&_.__e&&(_.__e=null)):typeof g.type=="function"&&m!==void 0?c=m:h&&(c=h.nextSibling),g.__u&=-7);return n.__e=P,c}function Sd(e,t,n,o,a){var i,l,s,c,d,u=n.length,f=u,_=0;for(e.__k=new Array(a),i=0;i<a;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[i]=jn(null,l,null,null,null):Zn(l)?l=e.__k[i]=jn(se,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=jn(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,c=i+_,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=kd(l,n,c,f))!=-1&&(f--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(a>u?_--:a<u&&_++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?_--:d==c+1?_++:(d>c?_--:_++,l.__u|=4))):e.__k[i]=null;if(f)for(i=0;i<u;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Mt(s)),si(s,s));return o}function oi(e,t,n,o){var a,i;if(typeof e.type=="function"){for(a=e.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=e,t=oi(a[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Mt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function kd(e,t,n,o){var a,i,l,s=e.key,c=e.type,d=t[n],u=d!=null&&(2&d.__u)==0;if(d===null&&s==null||u&&s==d.key&&c==d.type)return n;if(o>(u?1:0)){for(a=n-1,i=n+1;a>=0||i<t.length;)if((d=t[l=a>=0?a--:i++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Xa(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Pd.test(t)?n:n+"px"}function Gn(e,t,n,o,a){var i,l;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||Xa(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Xa(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(ei,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[on]=o[on]:(n[on]=kr,e.addEventListener(t,i?xr:Pr,i)):e.removeEventListener(t,i?xr:Pr,i);else{if(a=="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 Ya(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Kn]==null)t[Kn]=kr++;else if(t[Kn]<n[on])return;return n(te.event?te.event(t):t)}}}function Cr(e,t,n,o,a,i,l,s,c,d){var u,f,_,g,h,P,m,b,w,v,k,$,J,Y,re,ne,N=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(u=te.__b)&&u(t);e:if(typeof N=="function"){f=l.length;try{if(w=t.props,v=N.prototype&&N.prototype.render,k=(u=N.contextType)&&o[u.__c],$=u?k?k.props.value:u.__:o,n.__c?b=(_=t.__c=n.__c).__=_.__E:(v?t.__c=_=new N(w,$):(t.__c=_=new ut(w,$),_.constructor=N,_.render=Cd),k&&k.sub(_),_.state||(_.state={}),_.__n=o,g=_.__d=!0,_.__h=[],_._sb=[]),v&&_.__s==null&&(_.__s=_.state),v&&N.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=ot({},_.__s)),ot(_.__s,N.getDerivedStateFromProps(w,_.__s))),h=_.props,P=_.state,_.__v=t,g)v&&N.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),v&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(v&&N.getDerivedStateFromProps==null&&w!==h&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(w,$),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(w,_.__s,$)===!1){t.__v!=n.__v&&(_.props=w,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(O){O&&(O.__=t)}),Yn.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(w,_.__s,$),v&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(h,P,m)})}if(_.context=$,_.props=w,_.__P=e,_.__e=!1,J=te.__r,Y=0,v)_.state=_.__s,_.__d=!1,J&&J(t),u=_.render(_.props,_.state,_.context),Yn.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,J&&J(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++Y<25);_.state=_.__s,_.getChildContext!=null&&(o=ot(ot({},o),_.getChildContext())),v&&!g&&_.getSnapshotBeforeUpdate!=null&&(m=_.getSnapshotBeforeUpdate(h,P)),re=u!=null&&u.type===se&&u.key==null?ii(u.props.children):u,s=ni(e,Zn(re)?re:[re],t,n,o,a,i,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),b&&(_.__E=_.__=null)}catch(O){if(l.length=f,t.__v=null,c||i!=null){if(O.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i!=null&&(i[i.indexOf(s)]=null),t.__e=s}else if(i!=null)for(ne=i.length;ne--;)wr(i[ne])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),O.then||ri(t),te.__e(O,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=wd(n.__e,t,n,o,a,i,l,c,d);return(u=te.diffed)&&u(t),128&t.__u?void 0:s}function ri(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ri))}function ai(e,t,n){for(var o=0;o<n.length;o++)Tr(n[o],n[++o],n[++o]);te.__c&&te.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){te.__e(i,a.__v)}})}function ii(e){return typeof e!="object"||e==null||e.__b>0?e:Zn(e)?e.map(ii):e.constructor!==void 0?null:ot({},e)}function wd(e,t,n,o,a,i,l,s,c){var d,u,f,_,g,h,P,m=n.props||Xn,b=t.props,w=t.type;if(w=="svg"?a="http://www.w3.org/2000/svg":w=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((g=i[d])&&"setAttribute"in g==!!w&&(w?g.localName==w:g.nodeType==3)){e=g,i[d]=null;break}}if(e==null){if(w==null)return document.createTextNode(b);e=document.createElementNS(a,w,b.is&&b),s&&(te.__m&&te.__m(t,i),s=!1),i=null}if(w==null)m===b||s&&e.data==b||(e.data=b);else{if(i=w=="textarea"&&b.defaultValue!=null?null:i&&Qn.call(e.childNodes),!s&&i!=null)for(m={},d=0;d<e.attributes.length;d++)m[(g=e.attributes[d]).name]=g.value;for(d in m)g=m[d],d=="dangerouslySetInnerHTML"?f=g:d=="children"||d in b||d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b||Gn(e,d,null,g,a);for(d in b)g=b[d],d=="children"?_=g:d=="dangerouslySetInnerHTML"?u=g:d=="value"?h=g:d=="checked"?P=g:s&&typeof g!="function"||m[d]===g||Gn(e,d,g,m[d],a);if(u)s||f&&(u.__html==f.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(f&&(e.innerHTML=""),ni(t.type=="template"?e.content:e,Zn(_)?_:[_],t,n,o,w=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,l,i?i[0]:n.__k&&Mt(n,0),s,c),i!=null)for(d=i.length;d--;)wr(i[d]);s&&w!="textarea"||(d="value",w=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[d]||w=="progress"&&!h||w=="option"&&h!=m[d])&&Gn(e,d,h,m[d],a),d="checked",P!=null&&P!=e[d]&&Gn(e,d,P,m[d],a))}return e}function Tr(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(a){te.__e(a,n)}}function si(e,t,n){var o,a;if(te.unmount&&te.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Tr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){te.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&si(o[a],t,n||typeof e.type!="function");n||wr(e.__e),e.__c=e.__=e.__e=void 0}function Cd(e,t,n){return this.constructor(e,n)}function to(e,t,n){var o,a,i,l;t==document&&(t=document.documentElement),te.__&&te.__(e,t),a=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],Cr(t,e=(!o&&n||t).__k=eo(se,null,[e]),a||Xn,Xn,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?Qn.call(t.childNodes):null,i,!o&&n?n:a?a.__e:t.firstChild,o,l),ai(i,e,l),e.props.children=null}Qn=Yn.slice,te={__e:function(e,t,n,o){for(var a,i,l;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),l=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,o||{}),l=a.__d),l)return a.__E=a}catch(s){e=s}throw e}},Ja=0,Sr=function(e){return e!=null&&e.constructor===void 0},ut.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ot({},this.state),typeof e=="function"&&(e=e(ot({},n),this.props)),e&&ot(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ja(this))},ut.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ja(this))},ut.prototype.render=se,_t=[],Qa=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Za=function(e,t){return e.__v.__b-t.__v.__b},Jn.__r=0,yr=Math.random().toString(8),Kn="__d"+yr,on="__a"+yr,ei=/(PointerCapture)$|Capture$/i,kr=0,Pr=Ya(!1),xr=Ya(!0),yd=0;var S={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 Lt="0.67.3";var li={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:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},Td={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:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},Ed={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\u0631\u062F",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"},Rd={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:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},Id={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\u05E2\u05E0\u05D4",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"},Ad={en:li,fr:Td,ar:Ed,es:Rd,he:Id};function no(e,t){let n=ci(e),o=oo(t),a=n==="en"?{}:Ad[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...li,...a,...l,...i}}function ci(e){return(e.split("-")[0]??"en").toLowerCase()}var Md=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function di(e){return Md.has(ci(e))}function Me(e,t){return e[t]??t}function oo(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function _i(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function ui(e,t){let{translations:n,defaultLocale:o,...a}=e,i=_i(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function pi(e,t){let{translations:n,defaultLocale:o,...a}=e,i=_i(n,t);if(!i)return a;let l=new Map((i.fields??[]).map(c=>[c.name,c])),s=a.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let u=new Map((d.options??[]).map(f=>[f.value,f]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(f=>{let _=u.get(f.value);return _?{...f,label:_.label??f.label,description:_.description??f.description}:f})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var Er=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{}}},ro=new Er;var Ar=["off","error","warn","info","debug","trace"],Mr=S.cssPrefix,mi=`${Mr}.debug`,Ld=`__${S.global}_DEBUG__`,Od=`${Mr}-debug`,ao=2,Rr=null;function Nd(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Od);if(e!==null){let t=Ir(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(mi);if(e){let t=Ir(e);if(t>=0)return t}}catch{}return Reflect.get(window,Ld)?4:2}function Ir(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=Ar.indexOf(e);if(t>=0)return t}return-1}function io(e){let t=Ir(e);if(!(t<0)){ao=t;try{window.localStorage?.setItem(mi,Ar[t])}catch{}}}function Lr(){return Ar[ao]}ao=Nd();function fi(e){let t=`[${Mr}:${e}]`,n=(o,a,i)=>(l,s)=>{if(!(ao<o)&&(s===void 0?console[a](t,l):console[a](t,l,s),Rr))try{Rr({level:i,scope:e,message:l,payload:s})}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=>fi(`${e}:${o}`)}}var V=fi("core");function gi(e){Rr=e}var ht=V.scope("context"),Dd=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),hi=50,Or=1024,$d=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Nr(e){return vi(e,"userContext",!0)}function Dr(e){return vi(e,"pageContext",!1)}function vi(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={},a=0;for(let[i,l]of Object.entries(e)){if(Dd.has(i)){ht.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=hi){ht.warn(`${t} truncated at ${hi} keys \u2014 dropped "${i}"`);continue}let s=Fd(t,i,l);s!==void 0&&(o[i]=s,a++)}return n&&typeof o.email=="string"&&!$d.test(o.email)&&(ht.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function Fd(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>Or?(ht.warn(`truncated ${e}.${t} to ${Or} chars`),o.slice(0,Or)):o}ht.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var so={maxBytes:10485760,maxCount:10,accept:"*/*"},bi={voice:"local"},yi={list:[],byTrigger:{}},$r={enabled:!0,sampleRate:1},lo={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Ot={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Pi={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"]},Fr={enabled:!0,volume:.3,events:void 0},xi={enabled:!0,events:void 0},Si=[{label:"tabConversations",layout:"chat"}];function Nt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},a=t.i18n??{},i=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=Bd(t.theme),u=n.mode??"floating",f=Hd(a.defaultLocale),_=a.availableLocales??[a.locale??f],g=Dt(a.locale??f,_,f),h=(t.baseUrl??S.defaultBaseUrl).replace(/\/$/,""),P=(t.agentApiBaseUrl??`${h}/api/agent`).replace(/\/$/,""),m=(t.dataApiBaseUrl??`${h}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:h,agentApiBaseUrl:P,dataApiBaseUrl:m,userContext:Nr(t.userContext),pageContext:Dr(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:u,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??bi.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0,tools:t.features?.tools},forms:rn(t.forms,g),endpoints:{upload:t.endpoints?.upload??lo.upload,transcribe:t.endpoints?.transcribe??lo.transcribe,submitForm:t.endpoints?.submitForm??lo.submitForm},attachments:{accept:t.composer?.attachments?.accept??so.accept,maxBytes:t.composer?.attachments?.maxBytes??so.maxBytes,maxCount:t.composer?.attachments?.maxCount??so.maxCount},locale:g,defaultLocale:f,availableLocales:_,startMinimized:o.startMinimized??!0,actions:zd(u,s.actions),size:n.size??{},launcher:Xd(t.launcher),sound:Ud(i.sound),haptics:qd(i.haptics),strings:no(g,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:Wd(l.poweredBy),composer:Gd(t.composer),modules:Kd(t.modules),tracking:Vd(t.tracking,m),storage:t.storage??ro,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Bd(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function Hd(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function Dt(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function zd(e,t){return t??Pi[e]}function Ud(e){return{enabled:e?.enabled??Fr.enabled,volume:e?.volume??Fr.volume,events:e?.events}}function qd(e){return{enabled:e?.enabled??xi.enabled,events:e?.events}}function Vd(e,t){let n=e?.sampleRate??$r.sampleRate;return{enabled:e?.enabled??$r.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 Wd(e){let n={...{text:`Powered by ${S.displayName}`,href:S.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function Gd(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Kd(e){let t=e===void 0?Si:e,n=new Set,o=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let l=i.contentTags?.filter(Boolean),s=i.id??l?.[0]??i.layout;for(;n.has(s);)s=`${s}-${o.length}`;n.add(s);let c={id:s,label:i.label,layout:i.layout};l&&l.length>0&&(c.contentTags=l),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 a=Object.fromEntries(o.map(i=>[i.id,i]));return{list:o,byId:a}}function rn(e,t){var i;if(!e?.length)return yi;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=pi(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(jd).filter(u=>u!==null);c.length===0||d.length===0||(o.add(s.id),n.push({id:s.id,triggers:d,when:s.when,fields:c,title:s.title,description:s.description,submitLabel:s.submitLabel,skippable:s.skippable??!1,frequency:s.frequency??"once",mirrorToContext:s.mirrorToContext??!0,reopenable:s.reopenable??!0,reviewable:s.reviewable??!0}))}let a={};for(let l of n)for(let s of l.triggers)(a[i=s.kind]??(a[i]=[])).push(l);return{list:n,byTrigger:a}}function jd(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 Xd(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??Ot.variant,size:e?.size??Ot.size,label:e?.label??Ot.label,icon:e?.icon??Ot.icon,hidden:e?.hidden??Ot.hidden,callout:t}}function Br(e,t,n,o){let a=Dt(t,e.availableLocales,e.defaultLocale);if(a===e.locale&&n===e.themeMode&&o===e.textSize)return e;let i={...e};return a!==e.locale&&(i.locale=a,i.strings=no(a,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var Yd=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Hr(e,t){if(!t)return e;let n={...e};for(let i of Yd){let l=t[i];if(l===void 0)continue;let s=e[i];if(i==="theme"){s===void 0&&(n[i]=l);continue}i!=="i18n"&&(n[i]=ki(l,s))}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,a=t.i18n;if(o||a){let i=ki(a??{},o);a?.availableLocales!==void 0&&(i.availableLocales=a.availableLocales),a?.defaultLocale!==void 0&&(i.defaultLocale=a.defaultLocale);let l=o?.strings,s=a?.strings;(l||s)&&(i.strings=Jd(s,l)),n.i18n=i}return n}function ki(e,t){if(!t)return e;let n={...e};for(let[o,a]of Object.entries(t))a!==void 0&&(n[o]=a);return n}function Jd(e,t){if(!e)return t;if(!t)return e;let n=oo(e),o=oo(t);if(!n&&!o)return{...e,...t};let a={},i=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(i))a[s]={...c};for(let[s,c]of Object.entries(l))a[s]={...a[s],...c};return a}var Qd=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],rt=e=>e!=="false",Zd=e=>e.split(",").map(t=>t.trim()).filter(Boolean),e_=[["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]],t_=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",rt]],n_=[["width","width"],["height","height"]],o_=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",rt],["show-reasoning","showReasoning",rt],["show-tool-calls","showToolCalls",rt],["show-sources","showSources",rt],["disable-message-feedback","disableMessageFeedback",rt],["auto-send-suggestions","autoSendSuggestions",rt]],r_=[["locale","locale"]],xf=new Set(Qd);var a_=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",rt]],i_=[["features-disable-file-upload","disableFileUpload",rt],["features-voice","voice",e=>e],["features-tools","tools",Zd]],s_=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],l_=[["user-id","id"],["user-email","email"],["user-name","name"]],c_=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],d_=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],__=[e_,t_,n_,o_,r_,a_,i_,s_,l_,c_],u_=new Set(["iframe","start-minimized"]),p_=[...__.flatMap(e=>e.map(([t])=>t).filter(t=>!u_.has(t))),...d_];function wi(e){return`${S.cssPrefix}:${e}`}function an(e,t,n){e.dispatchEvent(new CustomEvent(wi(t),{detail:n}))}function Ci(e,t){let o=Object.entries(t).map(([a,i])=>{let l=wi(a),s=c=>i(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[a,i]of o)e.removeEventListener(a,i)}}function ze(){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,m_(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 m_(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 vt=V.scope("persistence");function $t(e,t=ro,n){let o=n?`${e}.${n}`:e,a=`${S.cssPrefix}.storageVersion`,i=t.get(a)??void 0,l=i?`.v${i}`:"",s=`${S.cssPrefix}.${o}${l}`,c=`${S.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,f=`${s}.panelOpen`,_=`${s}.panelSize`,g=`${s}.calloutDismissed`,h=`${s}.sidebarCollapsed`,P=`${s}.activeModule`,m=`${s}.historyCount`,b=`${s}.formsDone`,w={getVisitorId(){let v=t.get(c);if(v)return v;let k=ze();return t.set(c,k),k},setVisitorId(v){vt.debug("setVisitorId (rebind)",{id:v,scope:o}),t.set(c,v)},loadConversationId(){return t.get(d)??void 0},saveConversationId(v){vt.trace("saveConversationId",{id:v,scope:o}),v?t.set(d,v):t.remove(d)},loadUserPrefs(){let v=t.get(u);if(!v)return{};try{let k=JSON.parse(v);return Ti(k)?k:{}}catch(k){return vt.warn("loadUserPrefs parse failed",{error:k}),{}}},saveUserPrefs(v){try{t.set(u,JSON.stringify(v))}catch(k){vt.warn("saveUserPrefs serialise failed",{error:k})}},patchUserPrefs(v){let k=w.loadUserPrefs();w.saveUserPrefs({...k,...v})},loadPanelOpen(){let v=t.get(f);return v==="1"?!0:v==="0"?!1:null},savePanelOpen(v){t.set(f,v?"1":"0")},loadPanelSize(){let v=t.get(_);return v==="normal"||v==="expanded"||v==="fullscreen"?v:null},savePanelSize(v){t.set(_,v)},loadCalloutDismissed(v){if(!v)return!1;let k=t.get(g);return!!k&&k===v},saveCalloutDismissed(v){v?t.set(g,v):t.remove(g)},loadSidebarCollapsed(){let v=t.get(h);return v==="1"?!0:v==="0"?!1:null},saveSidebarCollapsed(v){t.set(h,v?"1":"0")},loadActiveModule(){return t.get(P)||null},saveActiveModule(v){t.set(P,v)},loadHistoryCount(){let v=t.get(m);if(!v)return null;let k=Number.parseInt(v,10);return Number.isFinite(k)&&k>=0?k:null},saveHistoryCount(v){t.set(m,String(v))},loadFormsDone(){let v=t.get(b);if(!v)return{};try{let k=JSON.parse(v);return Ti(k)?k:{}}catch(k){return vt.warn("loadFormsDone parse failed",{error:k}),{}}},saveFormDone(v){try{let k=w.loadFormsDone();k[v]=Date.now(),t.set(b,JSON.stringify(k))}catch(k){vt.warn("saveFormDone serialise failed",{error:k})}},rememberStorageVersion(v){v&&v!==t.get(a)&&(vt.debug("rememberStorageVersion (force-reset on next load)",{version:v}),t.set(a,v))},clearConversation(){t.remove(d)}};return w}function Ti(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ei=`: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 Ii=`.__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__-operator-cancel{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__-operator-cancel:hover{opacity:.8}.__P__-operator-cancel: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,y_).replaceAll("__BRAND_ACCENT_TEXT__",x_).replaceAll("__BRAND_ACCENT__",P_).replaceAll("__BRAND_RADIUS__",S_).replaceAll("__BRAND_FONT__",k_);var w_=V.scope("mount"),Li=new WeakMap,Oi={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 Ni(e,t){e.style.cssText=Oi[t]}function sn(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function co(e={}){let t=e.position??"flow";w_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${S.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",S.id),o.style.cssText=Oi[t];let a=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!C_(a,i)){let s=i.createElement("style");s.textContent=zr,a.appendChild(s)}let l=document.createElement("div");return l.className=`${S.cssPrefix}-app`,a.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:a}}function C_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=Li.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(zr),Li.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function T_(e,t){let n=S.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 E_(e,t){e.dataset.theme=t}function R_(e,t){let n=S.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 I_(e,t){e.dataset.position=t}function _o(e,t){e.dataset.mode=t}function Di(e,t){E_(e,t.themeMode),T_(e,t.themeOverrides),I_(e,t.position),R_(e,t.size)}var A_=V.scope("iframe"),M_='<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:transparent;overflow:hidden}</style></head><body></body></html>';function Bi(e,t,n="closed",o="floating",a=null){A_.debug("createIframeMount",{position:t,initialMode:n,layoutMode:o,hasTarget:!!a});let i=document.createElement("iframe");i.title=`${S.name} chat`,i.setAttribute("allow","microphone; clipboard-write"),Fi(i,t,n,o),(o==="inline"&&a?a:document.body).appendChild(i);let s=i.contentDocument;if(!s)throw new Error("iframe contentDocument unavailable (cross-origin?)");s.open(),s.write(M_),s.close();let c=co({...e,target:s.body}),d=new MutationObserver(()=>{Fi(i,t,c.hostElement.dataset.mode??"closed",o)});return d.observe(c.hostElement,{attributes:!0,attributeFilter:["data-mode"]}),{...c,iframeElement:i,destroy(){d.disconnect(),c.destroy(),i.remove()}}}var uo="border:0;background:transparent;z-index:2147483647;pointer-events:auto;",$i={closed:{w:"88px",h:"88px"},expanded:{w:"min(calc(100vw - 32px), 680px)",h:"min(calc(100vh - 32px), 860px)"},open:{w:"min(calc(100vw - 32px), 440px)",h:"min(calc(100vh - 32px), 700px)"}};function Fi(e,t,n,o){if(n==="fullscreen"||o==="standalone"){e.style.cssText=`${uo}position:fixed;inset:0;width:100vw;height:100vh;`;return}if(o==="inline"){e.style.cssText=`${uo}position:static;display:block;width:100%;height:100%;`;return}if(typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches&&(n==="open"||n==="expanded")){e.style.cssText=`${uo}position:fixed;inset:0;width:100vw;height:100vh;`;return}let i=t.startsWith("top-")?"top":"bottom",l=t.endsWith("-left")?"left":"right",{w:s,h:c}=$i[n]??$i.open;e.style.cssText=`${uo}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var po=class{constructor(){K(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 a of o)try{a(n)}catch{}}clear(){this.handlers.clear()}};var Ft,ge,Ur,Hi,ln=0,ji=[],ye=te,zi=ye.__b,Ui=ye.__r,qi=ye.diffed,Vi=ye.__c,Wi=ye.unmount,Gi=ye.__;function fo(e,t){ye.__h&&ye.__h(ge,e,ln||t),ln=0;var n=ge.__H||(ge.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function R(e){return ln=1,L_(Xi,e)}function L_(e,t,n){var o=fo(Ft++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Xi(void 0,t),function(s){var c=o.__N?o.__N[0]:o.__[0],d=o.t(c,s);c!==d&&(o.__N=[d,o.__[1]],o.__c.setState({}))}],o.__c=ge,!ge.__f)){var a=function(s,c,d){if(!o.__c.__H)return!0;var u=!1,f=o.__c.props!==s;if(o.__c.__H.__.some(function(g){if(g.__N){u=!0;var h=g.__[0];g.__=g.__N,g.__N=void 0,h!==g.__[0]&&(f=!0)}}),i){var _=i.call(this,s,c,d);return u?_||f:_}return!u||f};ge.__f=!0;var i=ge.shouldComponentUpdate,l=ge.componentWillUpdate;ge.componentWillUpdate=function(s,c,d){if(this.__e){var u=i;i=void 0,a(s,c,d),i=u}l&&l.call(this,s,c,d)},ge.shouldComponentUpdate=a}return o.__N||o.__}function E(e,t){var n=fo(Ft++,3);!ye.__s&&Vr(n.__H,t)&&(n.__=e,n.u=t,ge.__H.__h.push(n))}function bt(e,t){var n=fo(Ft++,4);!ye.__s&&Vr(n.__H,t)&&(n.__=e,n.u=t,ge.__h.push(n))}function F(e){return ln=5,Le(function(){return{current:e}},[])}function Le(e,t){var n=fo(Ft++,7);return Vr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function D(e,t){return ln=8,Le(function(){return e},t)}function O_(){for(var e;e=ji.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(mo),t.__h.some(qr),t.__h=[]}catch(n){t.__h=[],ye.__e(n,e.__v)}}}ye.__b=function(e){ge=null,zi&&zi(e)},ye.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Gi&&Gi(e,t)},ye.__r=function(e){Ui&&Ui(e),Ft=0;var t=(ge=e.__c).__H;t&&(Ur===ge?(t.__h=[],ge.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(mo),t.__h.some(qr),t.__h=[],Ft=0)),Ur=ge},ye.diffed=function(e){qi&&qi(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ji.push(t)!==1&&Hi===ye.requestAnimationFrame||((Hi=ye.requestAnimationFrame)||N_)(O_)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Ur=ge=null},ye.__c=function(e,t){t.some(function(n){try{n.__h.some(mo),n.__h=n.__h.filter(function(o){return!o.__||qr(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],ye.__e(o,n.__v)}}),Vi&&Vi(e,t)},ye.unmount=function(e){Wi&&Wi(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{mo(o)}catch(a){t=a}}),n.__H=void 0,t&&ye.__e(t,n.__v))};var Ki=typeof requestAnimationFrame=="function";function N_(e){var t,n=function(){clearTimeout(o),Ki&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Ki&&(t=requestAnimationFrame(n))}function mo(e){var t=ge,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ge=t}function qr(e){var t=ge;e.__c=e.__(),ge=t}function Vr(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Xi(e,t){return typeof t=="function"?t(e):t}var D_=Symbol.for("preact-signals");function bo(){if(at>1)at--;else{var e,t=!1;for((function(){var a=ho;for(ho=void 0;a!==void 0;){var i=a.S;if(i.v===a.v)for(var l=i.t;l!==void 0;l=l.x)l.i===a.i&&(l.i=i.i);a=a.o}})();dn!==void 0;){var n=dn;for(dn=void 0,go++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ji(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=o}}if(go=0,at--,t)throw e}}function Bt(e){if(at>0)return e();Wr=++$_,at++;try{return e()}finally{bo()}}var cn,pe=void 0;function _n(e){var t=pe,n=cn;pe=void 0,cn=void 0;try{return e()}finally{pe=t,cn=n}}var dn=void 0,at=0,go=0,$_=0,Wr=0,ho=void 0,vo=0;function Yi(e){if(pe!==void 0){var t=e.n;if(t===void 0||t.t!==pe)return t={i:0,S:e,p:pe.s,n:void 0,t:pe,e:void 0,x:void 0,r:t},pe.s!==void 0&&(pe.s.n=t),pe.s=t,e.n=t,32&pe.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=pe.s,t.n=void 0,pe.s.n=t,pe.s=t),t}}function we(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}we.prototype.brand=D_;we.prototype.h=function(){return!0};we.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)}))};we.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 a;(a=t.Z)==null||a.call(t)}))}};we.prototype.subscribe=function(e){var t=this;return it(function(){var n=t.value;_n(function(){return e(n)})},{name:"sub"})};we.prototype.valueOf=function(){return this.value};we.prototype.toString=function(){return this.value+""};we.prototype.toJSON=function(){return this.value};we.prototype.peek=function(){var e=this;return _n(function(){return e.value})};Object.defineProperty(we.prototype,"value",{get:function(){var e=Yi(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(go>100)throw new Error("Cycle detected");(function(n){at!==0&&go===0&&n.l!==Wr&&(n.l=Wr,ho={S:n,v:n.v,i:n.i,o:ho})})(this),this.v=e,this.i++,vo++,at++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{bo()}}}});function U(e,t){return new we(e,t)}function Ji(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 Qi(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 Zi(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 yt(e,t){we.call(this,void 0,t),this.x=e,this.s=void 0,this.g=vo-1,this.f=4}yt.prototype=new we;yt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===vo))return!0;if(this.g=vo,this.f|=1,this.i>0&&!Ji(this))return this.f&=-2,!0;var e=pe;try{Qi(this),pe=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 pe=e,Zi(this),this.f&=-2,!0};yt.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)}we.prototype.S.call(this,e)};yt.prototype.U=function(e){if(this.t!==void 0&&(we.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)}};yt.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(yt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Yi(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function un(e,t){return new yt(e,t)}function es(e){var t=e.m;if(e.m=void 0,typeof t=="function"){at++;var n=pe;pe=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Gr(e),o}finally{pe=n,bo()}}}function Gr(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,es(e)}function F_(e){if(pe!==this)throw new Error("Out-of-order effect");Zi(this),pe=e,this.f&=-2,8&this.f&&Gr(this),bo()}function Ht(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)}Ht.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()}};Ht.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,es(this),Qi(this),at++;var e=pe;return pe=this,F_.bind(this,e)};Ht.prototype.N=function(){2&this.f||(this.f|=2,this.u=dn,dn=this)};Ht.prototype.d=function(){this.f|=8,1&this.f||Gr(this)};Ht.prototype.dispose=function(){this.d()};function it(e,t){var n=new Ht(e,t);try{n.c()}catch(a){throw n.d(),a}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var ts,xo,yo,B_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var ns=[];it(function(){ts=this.N})();function zt(e,t){te[e]=t.bind(null,te[e]||function(){})}function Po(e){if(yo){var t=yo;yo=void 0,t()}yo=e&&e.S()}function os(e){var t=this,n=e.data,o=Je(n);o.value=n;var a=Le(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=un(function(){var g=o.value.value;return g===0?0:g===!0?"":g||""}),u=un(function(){return!Array.isArray(d.value)&&!Sr(d.value)}),f=it(function(){if(this.N=rs,u.value){var g=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=g)}}),_=t.__$u.d;return t.__$u.d=function(){f(),_.call(this)},[u,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}os.displayName="ReactiveTextNode";Object.defineProperties(we.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:os},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});zt("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var a in o)if(a!=="children"){var i=o[a];i instanceof we&&(n||(t.__np=n={}),n[a]=i,o[a]=i.peek())}}e(t)});zt("__r",function(e,t){if(e(t),t.type!==se){Po();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(a,i){var l;return it(function(){l=this},{name:i}),l.c=a,l})(function(){var a;B_&&((a=n.y)==null||a.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),xo=o,Po(n)}});zt("__e",function(e,t,n,o){Po(),xo=void 0,e(t,n,o)});zt("diffed",function(e,t){Po(),xo=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,a=t.props,i=n.U;if(i)for(var l in i){var s=i[l];s===void 0||o&&l in o||(s.d(),i[l]=void 0)}if(o){i||(i={},n.U=i);for(var c in o){var d=i[c],u=o[c];d===void 0?(d=H_(n,c,u,a),i[c]=d):d.o(u,a)}}}e(t)});function H_(e,t,n,o){var a=t in e&&e.ownerSVGElement===void 0,i=U(n);return{o:function(l,s){i.value=l,o=s},d:it(function(){this.N=rs;var l=i.value.value;o[t]!==l&&(o[t]=l,a?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t))})}}zt("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 a in o){var i=o[a];i&&i.d()}}}var l=t.__np;if(l){var s=t.props;for(var c in l)s[c]=l[c]}t.__np=void 0}else{var d=t.__c;if(d){var u=d.__$u;u&&(d.__$u=void 0,u.d())}}e(t)});zt("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});ut.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var a 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 l in e)if(l!=="__source"&&e[l]!==this.props[l])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function Je(e,t){return Le(function(){return U(e,t)},[])}function Z(e,t){var n=F(e);return n.current=e,xo.__$f|=4,Le(function(){return un(function(){return n.current()},t)},[])}var z_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function U_(){Bt(function(){for(var e;e=ns.shift();)ts.call(e)})}function rs(){ns.push(this)===1&&(te.requestAnimationFrame||z_)(U_)}function as(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function is(e){return as(e)}function ss(e){return!(!as(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function So(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 q_=900,V_=640;function Kr(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<V_?"fullscreen":n>=(t.autoSizeBreakpoint??q_)?"expanded":"normal"}function pn(e,t,n,o=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),s=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:Kr(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function Ut(){return typeof window>"u"?0:window.innerWidth}var W_="x-public-key",G_="x-ai-agent-deployment-id";function ls(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[G_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??W_]=e.publicKey),t}}}function mn(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),a=()=>i();t?.addEventListener("abort",a,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",a),n()}})}var Ge=class extends Error{constructor(n,o,a,i){super(n);K(this,"code",o);K(this,"status",a);K(this,"cause",i);this.name="StreamError"}};var cs=V.scope("parser");async function*jr(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new Ge(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of K_(e,t)){let o=j_(n);if(o==="done")return;o&&(yield o)}}async function*K_(e,t){if(!e.body)throw new Ge("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:a,value:i}=await n.read();if(a){let s=o.trim();s&&(yield s);return}o+=i;let l;for(;(l=o.indexOf(`
|
|
1
|
+
"use strict";var Gn=Object.defineProperty;var fd=Object.getOwnPropertyDescriptor;var gd=Object.getOwnPropertyNames;var hd=Object.prototype.hasOwnProperty;var vd=(e,t,n)=>t in e?Gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var bd=(e,t)=>{for(var n in t)Gn(e,n,{get:t[n],enumerable:!0})},yd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of gd(t))!hd.call(e,a)&&a!==n&&Gn(e,a,{get:()=>t[a],enumerable:!(o=fd(t,a))||o.enumerable});return e};var Pd=e=>yd(Gn({},"__esModule",{value:!0}),e);var X=(e,t,n)=>vd(e,typeof t!="symbol"?t+"":t,n);var Zm={};bd(Zm,{HOOK_WILDCARD:()=>lr,brand:()=>Qm,destroy:()=>Gm,getAllInstances:()=>Xm,getInstance:()=>jm,hook:()=>Ym,init:()=>Km,mount:()=>Mc,resolveInitialHostMode:()=>sr,version:()=>Jm});module.exports=Pd(Zm);var eo,ne,Za,wr,ut,Xa,ei,ti,xr,Xn,rn,ni,Cr,Sr,kr,xd,Jn={},Qn=[],Sd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,to=Array.isArray;function ot(e,t){for(var n in t)e[n]=t[n];return e}function Tr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function no(e,t,n){var o,a,i,l={};for(i in t)i=="key"?o=t[i]:i=="ref"?a=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?eo.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return Yn(e,l,o,a,null)}function Yn(e,t,n,o,a){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Za,__i:-1,__u:0};return a==null&&ne.vnode!=null&&ne.vnode(i),i}function se(e){return e.children}function pt(e,t){this.props=e,this.context=t}function Lt(e,t){if(t==null)return e.__?Lt(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"?Lt(e):null}function kd(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],a=[],i=ot({},t);i.__v=t.__v+1,ne.vnode&&ne.vnode(i),Er(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Lt(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,si(o,i,a),t.__e=t.__=null,i.__e!=n&&oi(i)}}function oi(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}),oi(e)}function Ya(e){(!e.__d&&(e.__d=!0)&&ut.push(e)&&!Zn.__r++||Xa!=ne.debounceRendering)&&((Xa=ne.debounceRendering)||ei)(Zn)}function Zn(){try{for(var e,t=1;ut.length;)ut.length>t&&ut.sort(ti),e=ut.shift(),t=ut.length,kd(e)}finally{ut.length=Zn.__r=0}}function ri(e,t,n,o,a,i,l,s,c,d,u){var f,_,g,h,P,m,b,w=o&&o.__k||Qn,v=t.length;for(c=wd(n,t,w,c,v),f=0;f<v;f++)(g=n.__k[f])!=null&&(_=g.__i!=-1&&w[g.__i]||Jn,g.__i=f,m=Er(e,g,_,a,i,l,s,c,d,u),h=g.__e,g.ref&&_.ref!=g.ref&&(_.ref&&Rr(_.ref,null,g),u.push(g.ref,g.__c||h,g)),P==null&&h!=null&&(P=h),(b=!!(4&g.__u))||_.__k===g.__k?(c=ai(g,c,e,b),b&&_.__e&&(_.__e=null)):typeof g.type=="function"&&m!==void 0?c=m:h&&(c=h.nextSibling),g.__u&=-7);return n.__e=P,c}function wd(e,t,n,o,a){var i,l,s,c,d,u=n.length,f=u,_=0;for(e.__k=new Array(a),i=0;i<a;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[i]=Yn(null,l,null,null,null):to(l)?l=e.__k[i]=Yn(se,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=Yn(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,c=i+_,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=Cd(l,n,c,f))!=-1&&(f--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(a>u?_--:a<u&&_++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?_--:d==c+1?_++:(d>c?_--:_++,l.__u|=4))):e.__k[i]=null;if(f)for(i=0;i<u;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Lt(s)),ci(s,s));return o}function ai(e,t,n,o){var a,i;if(typeof e.type=="function"){for(a=e.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=e,t=ai(a[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Lt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Cd(e,t,n,o){var a,i,l,s=e.key,c=e.type,d=t[n],u=d!=null&&(2&d.__u)==0;if(d===null&&s==null||u&&s==d.key&&c==d.type)return n;if(o>(u?1:0)){for(a=n-1,i=n+1;a>=0||i<t.length;)if((d=t[l=a>=0?a--:i++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Ja(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Sd.test(t)?n:n+"px"}function jn(e,t,n,o,a){var i,l;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||Ja(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Ja(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(ni,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[rn]=o[rn]:(n[rn]=Cr,e.addEventListener(t,i?kr:Sr,i)):e.removeEventListener(t,i?kr:Sr,i);else{if(a=="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 Qa(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Xn]==null)t[Xn]=Cr++;else if(t[Xn]<n[rn])return;return n(ne.event?ne.event(t):t)}}}function Er(e,t,n,o,a,i,l,s,c,d){var u,f,_,g,h,P,m,b,w,v,k,$,Q,J,ae,oe,N=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(u=ne.__b)&&u(t);e:if(typeof N=="function"){f=l.length;try{if(w=t.props,v=N.prototype&&N.prototype.render,k=(u=N.contextType)&&o[u.__c],$=u?k?k.props.value:u.__:o,n.__c?b=(_=t.__c=n.__c).__=_.__E:(v?t.__c=_=new N(w,$):(t.__c=_=new pt(w,$),_.constructor=N,_.render=Ed),k&&k.sub(_),_.state||(_.state={}),_.__n=o,g=_.__d=!0,_.__h=[],_._sb=[]),v&&_.__s==null&&(_.__s=_.state),v&&N.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=ot({},_.__s)),ot(_.__s,N.getDerivedStateFromProps(w,_.__s))),h=_.props,P=_.state,_.__v=t,g)v&&N.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),v&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(v&&N.getDerivedStateFromProps==null&&w!==h&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(w,$),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(w,_.__s,$)===!1){t.__v!=n.__v&&(_.props=w,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(O){O&&(O.__=t)}),Qn.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(w,_.__s,$),v&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(h,P,m)})}if(_.context=$,_.props=w,_.__P=e,_.__e=!1,Q=ne.__r,J=0,v)_.state=_.__s,_.__d=!1,Q&&Q(t),u=_.render(_.props,_.state,_.context),Qn.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,Q&&Q(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++J<25);_.state=_.__s,_.getChildContext!=null&&(o=ot(ot({},o),_.getChildContext())),v&&!g&&_.getSnapshotBeforeUpdate!=null&&(m=_.getSnapshotBeforeUpdate(h,P)),ae=u!=null&&u.type===se&&u.key==null?li(u.props.children):u,s=ri(e,to(ae)?ae:[ae],t,n,o,a,i,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),b&&(_.__E=_.__=null)}catch(O){if(l.length=f,t.__v=null,c||i!=null){if(O.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i!=null&&(i[i.indexOf(s)]=null),t.__e=s}else if(i!=null)for(oe=i.length;oe--;)Tr(i[oe])}else t.__e=n.__e;t.__k==null&&(t.__k=n.__k||[]),O.then||ii(t),ne.__e(O,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Td(n.__e,t,n,o,a,i,l,c,d);return(u=ne.diffed)&&u(t),128&t.__u?void 0:s}function ii(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ii))}function si(e,t,n){for(var o=0;o<n.length;o++)Rr(n[o],n[++o],n[++o]);ne.__c&&ne.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){ne.__e(i,a.__v)}})}function li(e){return typeof e!="object"||e==null||e.__b>0?e:to(e)?e.map(li):e.constructor!==void 0?null:ot({},e)}function Td(e,t,n,o,a,i,l,s,c){var d,u,f,_,g,h,P,m=n.props||Jn,b=t.props,w=t.type;if(w=="svg"?a="http://www.w3.org/2000/svg":w=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((g=i[d])&&"setAttribute"in g==!!w&&(w?g.localName==w:g.nodeType==3)){e=g,i[d]=null;break}}if(e==null){if(w==null)return document.createTextNode(b);e=document.createElementNS(a,w,b.is&&b),s&&(ne.__m&&ne.__m(t,i),s=!1),i=null}if(w==null)m===b||s&&e.data==b||(e.data=b);else{if(i=w=="textarea"&&b.defaultValue!=null?null:i&&eo.call(e.childNodes),!s&&i!=null)for(m={},d=0;d<e.attributes.length;d++)m[(g=e.attributes[d]).name]=g.value;for(d in m)g=m[d],d=="dangerouslySetInnerHTML"?f=g:d=="children"||d in b||d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b||jn(e,d,null,g,a);for(d in b)g=b[d],d=="children"?_=g:d=="dangerouslySetInnerHTML"?u=g:d=="value"?h=g:d=="checked"?P=g:s&&typeof g!="function"||m[d]===g||jn(e,d,g,m[d],a);if(u)s||f&&(u.__html==f.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(f&&(e.innerHTML=""),ri(t.type=="template"?e.content:e,to(_)?_:[_],t,n,o,w=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,l,i?i[0]:n.__k&&Lt(n,0),s,c),i!=null)for(d=i.length;d--;)Tr(i[d]);s&&w!="textarea"||(d="value",w=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[d]||w=="progress"&&!h||w=="option"&&h!=m[d])&&jn(e,d,h,m[d],a),d="checked",P!=null&&P!=e[d]&&jn(e,d,P,m[d],a))}return e}function Rr(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(a){ne.__e(a,n)}}function ci(e,t,n){var o,a;if(ne.unmount&&ne.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Rr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){ne.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&ci(o[a],t,n||typeof e.type!="function");n||Tr(e.__e),e.__c=e.__=e.__e=void 0}function Ed(e,t,n){return this.constructor(e,n)}function oo(e,t,n){var o,a,i,l;t==document&&(t=document.documentElement),ne.__&&ne.__(e,t),a=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],Er(t,e=(!o&&n||t).__k=no(se,null,[e]),a||Jn,Jn,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?eo.call(t.childNodes):null,i,!o&&n?n:a?a.__e:t.firstChild,o,l),si(i,e,l),e.props.children=null}eo=Qn.slice,ne={__e:function(e,t,n,o){for(var a,i,l;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),l=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,o||{}),l=a.__d),l)return a.__E=a}catch(s){e=s}throw e}},Za=0,wr=function(e){return e!=null&&e.constructor===void 0},pt.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ot({},this.state),typeof e=="function"&&(e=e(ot({},n),this.props)),e&&ot(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ya(this))},pt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ya(this))},pt.prototype.render=se,ut=[],ei=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ti=function(e,t){return e.__v.__b-t.__v.__b},Zn.__r=0,xr=Math.random().toString(8),Xn="__d"+xr,rn="__a"+xr,ni=/(PointerCapture)$|Capture$/i,Cr=0,Sr=Qa(!1),kr=Qa(!0),xd=0;var S={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 Ot="0.67.4";var di={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:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},Rd={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:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},Id={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\u0631\u062F",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"},Ad={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:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},Md={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\u05E2\u05E0\u05D4",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"},Ld={en:di,fr:Rd,ar:Id,es:Ad,he:Md};function ro(e,t){let n=_i(e),o=ao(t),a=n==="en"?{}:Ld[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...di,...a,...l,...i}}function _i(e){return(e.split("-")[0]??"en").toLowerCase()}var Od=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function ui(e){return Od.has(_i(e))}function Me(e,t){return e[t]??t}function ao(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function pi(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function mi(e,t){let{translations:n,defaultLocale:o,...a}=e,i=pi(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function fi(e,t){let{translations:n,defaultLocale:o,...a}=e,i=pi(n,t);if(!i)return a;let l=new Map((i.fields??[]).map(c=>[c.name,c])),s=a.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let u=new Map((d.options??[]).map(f=>[f.value,f]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(f=>{let _=u.get(f.value);return _?{...f,label:_.label??f.label,description:_.description??f.description}:f})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var Ir=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{}}},io=new Ir;var Lr=["off","error","warn","info","debug","trace"],Or=S.cssPrefix,gi=`${Or}.debug`,Nd=`__${S.global}_DEBUG__`,Dd=`${Or}-debug`,so=2,Ar=null;function $d(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Dd);if(e!==null){let t=Mr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(gi);if(e){let t=Mr(e);if(t>=0)return t}}catch{}return Reflect.get(window,Nd)?4:2}function Mr(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=Lr.indexOf(e);if(t>=0)return t}return-1}function lo(e){let t=Mr(e);if(!(t<0)){so=t;try{window.localStorage?.setItem(gi,Lr[t])}catch{}}}function Nr(){return Lr[so]}so=$d();function hi(e){let t=`[${Or}:${e}]`,n=(o,a,i)=>(l,s)=>{if(!(so<o)&&(s===void 0?console[a](t,l):console[a](t,l,s),Ar))try{Ar({level:i,scope:e,message:l,payload:s})}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=>hi(`${e}:${o}`)}}var W=hi("core");function vi(e){Ar=e}var vt=W.scope("context"),Fd=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),bi=50,Dr=1024,Bd=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function $r(e){return yi(e,"userContext",!0)}function Fr(e){return yi(e,"pageContext",!1)}function yi(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){vt.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},a=0;for(let[i,l]of Object.entries(e)){if(Fd.has(i)){vt.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=bi){vt.warn(`${t} truncated at ${bi} keys \u2014 dropped "${i}"`);continue}let s=Hd(t,i,l);s!==void 0&&(o[i]=s,a++)}return n&&typeof o.email=="string"&&!Bd.test(o.email)&&(vt.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function Hd(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){vt.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Dr?(vt.warn(`truncated ${e}.${t} to ${Dr} chars`),o.slice(0,Dr)):o}vt.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var co={maxBytes:10485760,maxCount:10,accept:"*/*"},Pi={voice:"local"},xi={list:[],byTrigger:{}},Br={enabled:!0,sampleRate:1},_o={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Nt={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Si={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"]},Hr={enabled:!0,volume:.3,events:void 0},ki={enabled:!0,events:void 0},wi=[{label:"tabConversations",layout:"chat"}];function Dt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},a=t.i18n??{},i=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=zd(t.theme),u=n.mode??"floating",f=Ud(a.defaultLocale),_=a.availableLocales??[a.locale??f],g=$t(a.locale??f,_,f),h=(t.baseUrl??S.defaultBaseUrl).replace(/\/$/,""),P=(t.agentApiBaseUrl??`${h}/api/agent`).replace(/\/$/,""),m=(t.dataApiBaseUrl??`${h}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:h,agentApiBaseUrl:P,dataApiBaseUrl:m,userContext:$r(t.userContext),pageContext:Fr(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:u,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??Pi.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),operatorRequest:t.features?.enableOperatorRequest===!0,tools:t.features?.tools},forms:an(t.forms,g),endpoints:{upload:t.endpoints?.upload??_o.upload,transcribe:t.endpoints?.transcribe??_o.transcribe,submitForm:t.endpoints?.submitForm??_o.submitForm},attachments:{accept:t.composer?.attachments?.accept??co.accept,maxBytes:t.composer?.attachments?.maxBytes??co.maxBytes,maxCount:t.composer?.attachments?.maxCount??co.maxCount},locale:g,defaultLocale:f,availableLocales:_,startMinimized:o.startMinimized??!0,actions:qd(u,s.actions),size:n.size??{},launcher:Jd(t.launcher),sound:Vd(i.sound),haptics:Wd(i.haptics),strings:ro(g,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:Gd(l.poweredBy),composer:jd(t.composer),modules:Xd(t.modules),tracking:Kd(t.tracking,m),storage:t.storage??io,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function zd(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function Ud(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function $t(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function qd(e,t){return t??Si[e]}function Vd(e){return{enabled:e?.enabled??Hr.enabled,volume:e?.volume??Hr.volume,events:e?.events}}function Wd(e){return{enabled:e?.enabled??ki.enabled,events:e?.events}}function Kd(e,t){let n=e?.sampleRate??Br.sampleRate;return{enabled:e?.enabled??Br.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 Gd(e){let n={...{text:`Powered by ${S.displayName}`,href:S.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function jd(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Xd(e){let t=e===void 0?wi:e,n=new Set,o=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let l=i.contentTags?.filter(Boolean),s=i.id??l?.[0]??i.layout;for(;n.has(s);)s=`${s}-${o.length}`;n.add(s);let c={id:s,label:i.label,layout:i.layout};l&&l.length>0&&(c.contentTags=l),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 a=Object.fromEntries(o.map(i=>[i.id,i]));return{list:o,byId:a}}function an(e,t){var i;if(!e?.length)return xi;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=fi(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(Yd).filter(u=>u!==null);c.length===0||d.length===0||(o.add(s.id),n.push({id:s.id,triggers:d,when:s.when,fields:c,title:s.title,description:s.description,submitLabel:s.submitLabel,skippable:s.skippable??!1,frequency:s.frequency??"once",mirrorToContext:s.mirrorToContext??!0,reopenable:s.reopenable??!0,reviewable:s.reviewable??!0}))}let a={};for(let l of n)for(let s of l.triggers)(a[i=s.kind]??(a[i]=[])).push(l);return{list:n,byTrigger:a}}function Yd(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 Jd(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??Nt.variant,size:e?.size??Nt.size,label:e?.label??Nt.label,icon:e?.icon??Nt.icon,hidden:e?.hidden??Nt.hidden,callout:t}}function zr(e,t,n,o){let a=$t(t,e.availableLocales,e.defaultLocale);if(a===e.locale&&n===e.themeMode&&o===e.textSize)return e;let i={...e};return a!==e.locale&&(i.locale=a,i.strings=ro(a,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var Qd=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Ur(e,t){if(!t)return e;let n={...e};for(let i of Qd){let l=t[i];if(l===void 0)continue;let s=e[i];if(i==="theme"){s===void 0&&(n[i]=l);continue}i!=="i18n"&&(n[i]=Ci(l,s))}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,a=t.i18n;if(o||a){let i=Ci(a??{},o);a?.availableLocales!==void 0&&(i.availableLocales=a.availableLocales),a?.defaultLocale!==void 0&&(i.defaultLocale=a.defaultLocale);let l=o?.strings,s=a?.strings;(l||s)&&(i.strings=Zd(s,l)),n.i18n=i}return n}function Ci(e,t){if(!t)return e;let n={...e};for(let[o,a]of Object.entries(t))a!==void 0&&(n[o]=a);return n}function Zd(e,t){if(!e)return t;if(!t)return e;let n=ao(e),o=ao(t);if(!n&&!o)return{...e,...t};let a={},i=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(i))a[s]={...c};for(let[s,c]of Object.entries(l))a[s]={...a[s],...c};return a}var e_=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],rt=e=>e!=="false",t_=e=>e.split(",").map(t=>t.trim()).filter(Boolean),n_=[["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]],o_=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",rt]],r_=[["width","width"],["height","height"]],a_=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",rt],["show-reasoning","showReasoning",rt],["show-tool-calls","showToolCalls",rt],["show-sources","showSources",rt],["disable-message-feedback","disableMessageFeedback",rt],["auto-send-suggestions","autoSendSuggestions",rt]],i_=[["locale","locale"]],Cf=new Set(e_);var s_=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",rt]],l_=[["features-disable-file-upload","disableFileUpload",rt],["features-voice","voice",e=>e],["features-tools","tools",t_]],c_=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],d_=[["user-id","id"],["user-email","email"],["user-name","name"]],__=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],u_=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],p_=[n_,o_,r_,a_,i_,s_,l_,c_,d_,__],m_=new Set(["iframe","start-minimized"]),f_=[...p_.flatMap(e=>e.map(([t])=>t).filter(t=>!m_.has(t))),...u_];function Ti(e){return`${S.cssPrefix}:${e}`}function sn(e,t,n){e.dispatchEvent(new CustomEvent(Ti(t),{detail:n}))}function Ei(e,t){let o=Object.entries(t).map(([a,i])=>{let l=Ti(a),s=c=>i(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[a,i]of o)e.removeEventListener(a,i)}}function ze(){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,g_(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 g_(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 bt=W.scope("persistence");function Ft(e,t=io,n){let o=n?`${e}.${n}`:e,a=`${S.cssPrefix}.storageVersion`,i=t.get(a)??void 0,l=i?`.v${i}`:"",s=`${S.cssPrefix}.${o}${l}`,c=`${S.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,f=`${s}.panelOpen`,_=`${s}.panelSize`,g=`${s}.calloutDismissed`,h=`${s}.sidebarCollapsed`,P=`${s}.activeModule`,m=`${s}.historyCount`,b=`${s}.formsDone`,w={getVisitorId(){let v=t.get(c);if(v)return v;let k=ze();return t.set(c,k),k},setVisitorId(v){bt.debug("setVisitorId (rebind)",{id:v,scope:o}),t.set(c,v)},loadConversationId(){return t.get(d)??void 0},saveConversationId(v){bt.trace("saveConversationId",{id:v,scope:o}),v?t.set(d,v):t.remove(d)},loadUserPrefs(){let v=t.get(u);if(!v)return{};try{let k=JSON.parse(v);return Ri(k)?k:{}}catch(k){return bt.warn("loadUserPrefs parse failed",{error:k}),{}}},saveUserPrefs(v){try{t.set(u,JSON.stringify(v))}catch(k){bt.warn("saveUserPrefs serialise failed",{error:k})}},patchUserPrefs(v){let k=w.loadUserPrefs();w.saveUserPrefs({...k,...v})},loadPanelOpen(){let v=t.get(f);return v==="1"?!0:v==="0"?!1:null},savePanelOpen(v){t.set(f,v?"1":"0")},loadPanelSize(){let v=t.get(_);return v==="normal"||v==="expanded"||v==="fullscreen"?v:null},savePanelSize(v){t.set(_,v)},loadCalloutDismissed(v){if(!v)return!1;let k=t.get(g);return!!k&&k===v},saveCalloutDismissed(v){v?t.set(g,v):t.remove(g)},loadSidebarCollapsed(){let v=t.get(h);return v==="1"?!0:v==="0"?!1:null},saveSidebarCollapsed(v){t.set(h,v?"1":"0")},loadActiveModule(){return t.get(P)||null},saveActiveModule(v){t.set(P,v)},loadHistoryCount(){let v=t.get(m);if(!v)return null;let k=Number.parseInt(v,10);return Number.isFinite(k)&&k>=0?k:null},saveHistoryCount(v){t.set(m,String(v))},loadFormsDone(){let v=t.get(b);if(!v)return{};try{let k=JSON.parse(v);return Ri(k)?k:{}}catch(k){return bt.warn("loadFormsDone parse failed",{error:k}),{}}},saveFormDone(v){try{let k=w.loadFormsDone();k[v]=Date.now(),t.set(b,JSON.stringify(k))}catch(k){bt.warn("saveFormDone serialise failed",{error:k})}},rememberStorageVersion(v){v&&v!==t.get(a)&&(bt.debug("rememberStorageVersion (force-reset on next load)",{version:v}),t.set(a,v))},clearConversation(){t.remove(d)}};return w}function Ri(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ii=`: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 Ai=`*,*: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 Mi=`.__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__-operator-cancel{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__-operator-cancel:hover{opacity:.8}.__P__-operator-cancel: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 Li=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
|
|
5
|
+
`;var Oi=`: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 x_="helpai",S_="#5B5BD6",k_="#FFFFFF",w_="12px",C_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",qr=[Ii,Ai,Mi,Li,Oi].join(`
|
|
7
|
+
`).replace(/__P__/g,x_).replaceAll("__BRAND_ACCENT_TEXT__",k_).replaceAll("__BRAND_ACCENT__",S_).replaceAll("__BRAND_RADIUS__",w_).replaceAll("__BRAND_FONT__",C_);var T_=W.scope("mount"),Ni=new WeakMap,Di={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 $i(e,t){e.style.cssText=Di[t]}function ln(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function uo(e={}){let t=e.position??"flow";T_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${S.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",S.id),o.style.cssText=Di[t];let a=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!E_(a,i)){let s=i.createElement("style");s.textContent=qr,a.appendChild(s)}let l=document.createElement("div");return l.className=`${S.cssPrefix}-app`,a.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:a}}function E_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=Ni.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(qr),Ni.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function R_(e,t){let n=S.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 I_(e,t){e.dataset.theme=t}function A_(e,t){let n=S.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 M_(e,t){e.dataset.position=t}function po(e,t){e.dataset.mode=t}function Fi(e,t){I_(e,t.themeMode),R_(e,t.themeOverrides),M_(e,t.position),A_(e,t.size)}var L_=W.scope("iframe"),O_='<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:transparent;overflow:hidden}</style></head><body></body></html>';function zi(e,t,n="closed",o="floating",a=null){L_.debug("createIframeMount",{position:t,initialMode:n,layoutMode:o,hasTarget:!!a});let i=document.createElement("iframe");i.title=`${S.name} chat`,i.setAttribute("allow","microphone; clipboard-write"),Hi(i,t,n,o),(o==="inline"&&a?a:document.body).appendChild(i);let s=i.contentDocument;if(!s)throw new Error("iframe contentDocument unavailable (cross-origin?)");s.open(),s.write(O_),s.close();let c=uo({...e,target:s.body}),d=new MutationObserver(()=>{Hi(i,t,c.hostElement.dataset.mode??"closed",o)});return d.observe(c.hostElement,{attributes:!0,attributeFilter:["data-mode"]}),{...c,iframeElement:i,destroy(){d.disconnect(),c.destroy(),i.remove()}}}var mo="border:0;background:transparent;z-index:2147483647;pointer-events:auto;",Bi={closed:{w:"88px",h:"88px"},expanded:{w:"min(calc(100vw - 32px), 680px)",h:"min(calc(100vh - 32px), 860px)"},open:{w:"min(calc(100vw - 32px), 440px)",h:"min(calc(100vh - 32px), 700px)"}};function Hi(e,t,n,o){if(n==="fullscreen"||o==="standalone"){e.style.cssText=`${mo}position:fixed;inset:0;width:100vw;height:100vh;`;return}if(o==="inline"){e.style.cssText=`${mo}position:static;display:block;width:100%;height:100%;`;return}if(typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches&&(n==="open"||n==="expanded")){e.style.cssText=`${mo}position:fixed;inset:0;width:100vw;height:100vh;`;return}let i=t.startsWith("top-")?"top":"bottom",l=t.endsWith("-left")?"left":"right",{w:s,h:c}=Bi[n]??Bi.open;e.style.cssText=`${mo}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var fo=class{constructor(){X(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 a of o)try{a(n)}catch{}}clear(){this.handlers.clear()}};var Bt,fe,Vr,Ui,cn=0,Yi=[],be=ne,qi=be.__b,Vi=be.__r,Wi=be.diffed,Ki=be.__c,Gi=be.unmount,ji=be.__;function ho(e,t){be.__h&&be.__h(fe,e,cn||t),cn=0;var n=fe.__H||(fe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function R(e){return cn=1,N_(Ji,e)}function N_(e,t,n){var o=ho(Bt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Ji(void 0,t),function(s){var c=o.__N?o.__N[0]:o.__[0],d=o.t(c,s);c!==d&&(o.__N=[d,o.__[1]],o.__c.setState({}))}],o.__c=fe,!fe.__f)){var a=function(s,c,d){if(!o.__c.__H)return!0;var u=!1,f=o.__c.props!==s;if(o.__c.__H.__.some(function(g){if(g.__N){u=!0;var h=g.__[0];g.__=g.__N,g.__N=void 0,h!==g.__[0]&&(f=!0)}}),i){var _=i.call(this,s,c,d);return u?_||f:_}return!u||f};fe.__f=!0;var i=fe.shouldComponentUpdate,l=fe.componentWillUpdate;fe.componentWillUpdate=function(s,c,d){if(this.__e){var u=i;i=void 0,a(s,c,d),i=u}l&&l.call(this,s,c,d)},fe.shouldComponentUpdate=a}return o.__N||o.__}function T(e,t){var n=ho(Bt++,3);!be.__s&&Kr(n.__H,t)&&(n.__=e,n.u=t,fe.__H.__h.push(n))}function yt(e,t){var n=ho(Bt++,4);!be.__s&&Kr(n.__H,t)&&(n.__=e,n.u=t,fe.__h.push(n))}function F(e){return cn=5,Le(function(){return{current:e}},[])}function Le(e,t){var n=ho(Bt++,7);return Kr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function D(e,t){return cn=8,Le(function(){return e},t)}function D_(){for(var e;e=Yi.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(go),t.__h.some(Wr),t.__h=[]}catch(n){t.__h=[],be.__e(n,e.__v)}}}be.__b=function(e){fe=null,qi&&qi(e)},be.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ji&&ji(e,t)},be.__r=function(e){Vi&&Vi(e),Bt=0;var t=(fe=e.__c).__H;t&&(Vr===fe?(t.__h=[],fe.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(go),t.__h.some(Wr),t.__h=[],Bt=0)),Vr=fe},be.diffed=function(e){Wi&&Wi(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Yi.push(t)!==1&&Ui===be.requestAnimationFrame||((Ui=be.requestAnimationFrame)||$_)(D_)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Vr=fe=null},be.__c=function(e,t){t.some(function(n){try{n.__h.some(go),n.__h=n.__h.filter(function(o){return!o.__||Wr(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],be.__e(o,n.__v)}}),Ki&&Ki(e,t)},be.unmount=function(e){Gi&&Gi(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{go(o)}catch(a){t=a}}),n.__H=void 0,t&&be.__e(t,n.__v))};var Xi=typeof requestAnimationFrame=="function";function $_(e){var t,n=function(){clearTimeout(o),Xi&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Xi&&(t=requestAnimationFrame(n))}function go(e){var t=fe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),fe=t}function Wr(e){var t=fe;e.__c=e.__(),fe=t}function Kr(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Ji(e,t){return typeof t=="function"?t(e):t}var F_=Symbol.for("preact-signals");function Po(){if(at>1)at--;else{var e,t=!1;for((function(){var a=bo;for(bo=void 0;a!==void 0;){var i=a.S;if(i.v===a.v)for(var l=i.t;l!==void 0;l=l.x)l.i===a.i&&(l.i=i.i);a=a.o}})();_n!==void 0;){var n=_n;for(_n=void 0,vo++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Zi(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=o}}if(vo=0,at--,t)throw e}}function Ht(e){if(at>0)return e();Gr=++B_,at++;try{return e()}finally{Po()}}var dn,pe=void 0;function un(e){var t=pe,n=dn;pe=void 0,dn=void 0;try{return e()}finally{pe=t,dn=n}}var _n=void 0,at=0,vo=0,B_=0,Gr=0,bo=void 0,yo=0;function Qi(e){if(pe!==void 0){var t=e.n;if(t===void 0||t.t!==pe)return t={i:0,S:e,p:pe.s,n:void 0,t:pe,e:void 0,x:void 0,r:t},pe.s!==void 0&&(pe.s.n=t),pe.s=t,e.n=t,32&pe.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=pe.s,t.n=void 0,pe.s.n=t,pe.s=t),t}}function we(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}we.prototype.brand=F_;we.prototype.h=function(){return!0};we.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:un(function(){var o;(o=t.W)==null||o.call(t)}))};we.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&&un(function(){var a;(a=t.Z)==null||a.call(t)}))}};we.prototype.subscribe=function(e){var t=this;return it(function(){var n=t.value;un(function(){return e(n)})},{name:"sub"})};we.prototype.valueOf=function(){return this.value};we.prototype.toString=function(){return this.value+""};we.prototype.toJSON=function(){return this.value};we.prototype.peek=function(){var e=this;return un(function(){return e.value})};Object.defineProperty(we.prototype,"value",{get:function(){var e=Qi(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(vo>100)throw new Error("Cycle detected");(function(n){at!==0&&vo===0&&n.l!==Gr&&(n.l=Gr,bo={S:n,v:n.v,i:n.i,o:bo})})(this),this.v=e,this.i++,yo++,at++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Po()}}}});function U(e,t){return new we(e,t)}function Zi(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 es(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 ts(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 Pt(e,t){we.call(this,void 0,t),this.x=e,this.s=void 0,this.g=yo-1,this.f=4}Pt.prototype=new we;Pt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===yo))return!0;if(this.g=yo,this.f|=1,this.i>0&&!Zi(this))return this.f&=-2,!0;var e=pe;try{es(this),pe=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 pe=e,ts(this),this.f&=-2,!0};Pt.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)}we.prototype.S.call(this,e)};Pt.prototype.U=function(e){if(this.t!==void 0&&(we.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)}};Pt.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(Pt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Qi(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function pn(e,t){return new Pt(e,t)}function ns(e){var t=e.m;if(e.m=void 0,typeof t=="function"){at++;var n=pe;pe=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,jr(e),o}finally{pe=n,Po()}}}function jr(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ns(e)}function H_(e){if(pe!==this)throw new Error("Out-of-order effect");ts(this),pe=e,this.f&=-2,8&this.f&&jr(this),Po()}function zt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,dn&&dn.push(this)}zt.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()}};zt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ns(this),es(this),at++;var e=pe;return pe=this,H_.bind(this,e)};zt.prototype.N=function(){2&this.f||(this.f|=2,this.u=_n,_n=this)};zt.prototype.d=function(){this.f|=8,1&this.f||jr(this)};zt.prototype.dispose=function(){this.d()};function it(e,t){var n=new zt(e,t);try{n.c()}catch(a){throw n.d(),a}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var os,ko,xo,z_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var rs=[];it(function(){os=this.N})();function Ut(e,t){ne[e]=t.bind(null,ne[e]||function(){})}function So(e){if(xo){var t=xo;xo=void 0,t()}xo=e&&e.S()}function as(e){var t=this,n=e.data,o=Je(n);o.value=n;var a=Le(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=pn(function(){var g=o.value.value;return g===0?0:g===!0?"":g||""}),u=pn(function(){return!Array.isArray(d.value)&&!wr(d.value)}),f=it(function(){if(this.N=is,u.value){var g=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=g)}}),_=t.__$u.d;return t.__$u.d=function(){f(),_.call(this)},[u,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}as.displayName="ReactiveTextNode";Object.defineProperties(we.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:as},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Ut("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var a in o)if(a!=="children"){var i=o[a];i instanceof we&&(n||(t.__np=n={}),n[a]=i,o[a]=i.peek())}}e(t)});Ut("__r",function(e,t){if(e(t),t.type!==se){So();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(a,i){var l;return it(function(){l=this},{name:i}),l.c=a,l})(function(){var a;z_&&((a=n.y)==null||a.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),ko=o,So(n)}});Ut("__e",function(e,t,n,o){So(),ko=void 0,e(t,n,o)});Ut("diffed",function(e,t){So(),ko=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,a=t.props,i=n.U;if(i)for(var l in i){var s=i[l];s===void 0||o&&l in o||(s.d(),i[l]=void 0)}if(o){i||(i={},n.U=i);for(var c in o){var d=i[c],u=o[c];d===void 0?(d=U_(n,c,u,a),i[c]=d):d.o(u,a)}}}e(t)});function U_(e,t,n,o){var a=t in e&&e.ownerSVGElement===void 0,i=U(n);return{o:function(l,s){i.value=l,o=s},d:it(function(){this.N=is;var l=i.value.value;o[t]!==l&&(o[t]=l,a?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t))})}}Ut("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 a in o){var i=o[a];i&&i.d()}}}var l=t.__np;if(l){var s=t.props;for(var c in l)s[c]=l[c]}t.__np=void 0}else{var d=t.__c;if(d){var u=d.__$u;u&&(d.__$u=void 0,u.d())}}e(t)});Ut("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});pt.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var a 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 l in e)if(l!=="__source"&&e[l]!==this.props[l])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function Je(e,t){return Le(function(){return U(e,t)},[])}function ee(e,t){var n=F(e);return n.current=e,ko.__$f|=4,Le(function(){return pn(function(){return n.current()},t)},[])}var q_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function V_(){Ht(function(){for(var e;e=rs.shift();)os.call(e)})}function is(){rs.push(this)===1&&(ne.requestAnimationFrame||q_)(V_)}function ss(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ls(e){return ss(e)}function cs(e){return!(!ss(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function wo(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 W_=900,K_=640;function Xr(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<K_?"fullscreen":n>=(t.autoSizeBreakpoint??W_)?"expanded":"normal"}function mn(e,t,n,o=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),s=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:Xr(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function qt(){return typeof window>"u"?0:window.innerWidth}var G_="x-public-key",j_="x-ai-agent-deployment-id";function ds(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[j_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??G_]=e.publicKey),t}}}function fn(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),a=()=>i();t?.addEventListener("abort",a,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",a),n()}})}var Ke=class extends Error{constructor(n,o,a,i){super(n);X(this,"code",o);X(this,"status",a);X(this,"cause",i);this.name="StreamError"}};var _s=W.scope("parser");async function*Yr(e,t){if(!e.ok){let n=await e.text().catch(()=>"");throw new Ke(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of X_(e,t)){let o=Y_(n);if(o==="done")return;o&&(yield o)}}async function*X_(e,t){if(!e.body)throw new Ke("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:a,value:i}=await n.read();if(a){let s=o.trim();s&&(yield s);return}o+=i;let l;for(;(l=o.indexOf(`
|
|
8
8
|
|
|
9
|
-
`))!==-1;){let s=o.slice(0,l);o=o.slice(l+2),yield s}}}finally{n.releaseLock()}}function
|
|
9
|
+
`))!==-1;){let s=o.slice(0,l);o=o.slice(l+2),yield s}}}finally{n.releaseLock()}}function Y_(e){let t="",n;for(let o of e.split(`
|
|
10
10
|
`))if(!(o===""||o.startsWith(":"))){if(o.startsWith("data:")){let a=o.slice(5).replace(/^ /,"");t=t?`${t}
|
|
11
|
-
${a}`:a;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 cs.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return cs.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function X_(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 a={};return n&&(a.user=n),o&&(a.page=o),X_(JSON.stringify(a))}function ko(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Y_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function us(e){return e.startsWith("tool-")?e.slice(5):e}var $e={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",cancelRequestOperator:"/pai/cancel-request-operator",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},ps="context";function Qe(e){let t=e??{},n=t.controlMode;return{controlMode:n==="awaiting_operator"||n==="operator"?n:"ai-agent",assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function wo(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:a,label:i,text:l}=o;typeof i!="string"||!i||n.push({id:typeof a=="string"&&a?a:`s${n.length}`,label:i,text:typeof l=="string"&&l?l:i})}return n}function Xr(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:Z_(i),role:i.role,createdAt:i.createdAt!==void 0?new Date(i.createdAt).toISOString():void 0})),n={messages:t,conversationId:e.conversationId,trigger:e.trigger??"submit-message"},o=t.at(-1)?.id;o&&(n.messageId=o),e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let a=e.tools?.map(Q_).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function J_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function Q_(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function Z_(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"&&J_(n)){let o={type:Y_(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 X=V.scope("transport"),eu=6e4,tu=1e4,ms=3,nu=400,ou=new Set([408,425,429,500,502,503,504]);function fs(e){return nu*2**e+Math.floor(Math.random()*250)}function ru(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 Co=class{constructor(t){K(this,"ttlMs",t);K(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 a={at:Date.now(),result:n().then(i=>(a.value=i,i)).catch(i=>{throw this.map.delete(t),i})};return this.map.set(t,a),a.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()}},To=class{constructor(t){K(this,"opts",t);K(this,"visitorId");K(this,"conversationId");K(this,"userContext");K(this,"pageContext");K(this,"locale");K(this,"conversationsCache",new Co(tu));K(this,"contentCache",new Co(eu))}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:Lt};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[ps]=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,a]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,a);return n.toString()}async handshake(t){X.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson($e.handshake,t,"handshake");return X.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),iu(n)||X.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){X.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let n=new FormData;n.append("file",t,t.name);let o=await this.postForm(this.uploadPath,n,"upload");return X.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){X.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${au(n)}`),o.append("mimeType",n);let a=await this.postForm(this.transcribePath,o,"transcribe");return X.debug("transcribe \u2190",{textLen:a.text.length}),a}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($e.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),X.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let o=await this.getJson(n.toString(),"listConversations"),a=o.conversations??[];return X.debug("listConversations \u2190",{count:a.length,nextCursor:o.nextCursor}),{conversations:a,nextCursor:o.nextCursor}}async loadConversation(t){let n=new URL(this.url($e.listMessages));n.searchParams.set("conversationId",t),X.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),a=o.messages??[];return X.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:a.length,hasSuggestions:!!o.suggestions}),{...o,messages:a,canContinue:o.canContinue??!0}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),X.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson($e.markRead,{conversationId:t},"markRead")}catch(n){X.debug("markRead failed (non-fatal)",{err:n})}}}async requestOperator(){if(!(!this.visitorId||!this.conversationId)){X.debug("requestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson($e.requestOperator,{},"requestOperator")).controlState}catch(t){X.debug("requestOperator failed (non-fatal)",{err:t});return}}}async cancelRequestOperator(){if(!(!this.visitorId||!this.conversationId)){X.debug("cancelRequestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson($e.cancelRequestOperator,{},"cancelRequestOperator")).controlState}catch(t){X.debug("cancelRequestOperator 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($e.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));X.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),a=(o.items??[]).map(i=>ui(i,this.locale));return X.debug("listContent \u2190",{count:a.length,total:o.pagination?.total}),{...o,items:a}}async bootstrap(t){let n=new URL(this.dataUrl($e.bootstrap));t&&n.searchParams.set("conversationId",t),X.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),a=o.forms??[],i=o.formSubmissions??[];return X.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){X.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson($e.updateSettings,{userPrefs:t},"saveUserPrefs");return X.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??$e.submitForm}async submitForm(t){X.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){X.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){X.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson($e.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){X.debug("submitFeedback failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),X.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageId:t.messageId,messageCount:t.messages.length,trigger:t.trigger,tools:t.data?.tools?.map(l=>l.code)});let n=new AbortController,o=new Set;return{iter:this.runStream(t,n,o),cancel:()=>this.cancelStream(n,t.conversationId),detach:()=>n.abort()}}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||X.debug("resume-stream fetch failed \u2014 reconnecting",{err:o}),"held"}if(!n.ok||!n.body)return X.debug("resume-stream \u2192 endpoint unavailable",{status:n.status}),"unavailable";if(!(n.headers.get("content-type")??"").includes("text/event-stream"))return X.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";t.onConnected();try{for await(let{chunk:o}of jr(n,t.signal)){if(t.signal.aborted)return"held";t.onChunk(o)}}catch(o){if(t.signal.aborted)return"held";X.debug("resume-stream segment dropped \u2014 reconnecting",{err:o})}return"held"}async*runStream(t,n,o){try{yield*this.drain(this.openMessageStream(t,n.signal),o,n)}finally{n.abort()}}async*drain(t,n,o){try{for await(let a of t){if(o.signal.aborted)return;if(a.eventId){if(n.has(a.eventId))continue;n.add(a.eventId)}yield a}}catch(a){if(o.signal.aborted)return;if(a instanceof Ge&&a.status!==void 0)throw a;X.debug("stream segment dropped",{err:a})}}cancelStream(t,n){t.signal.aborted||(X.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url($e.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>X.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url($e.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"text/event-stream","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});yield*jr(o,n)}resumeUrl(){return this.withEnvelopeQuery($e.streamResume)}async postJson(t,n,o){let a=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(a,o)}async postForm(t,n,o){let a=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(a,o)}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[a,i]=t(),l;try{l=await this.fetchImpl(a,i)}catch(c){if(o>=ms)throw new Ge(`${n} failed: network error`,"network",void 0,c);X.debug("request network error \u2014 retrying",{label:n,attempt:o}),await mn(fs(o));continue}if(l.ok||!ou.has(l.status)||o>=ms)return l;let s=ru(l.headers)??fs(o);X.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await mn(s)}}async assertOk(t,n){if(!t.ok)throw new Ge(`${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 au(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 iu(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function gs(e,t){let n=e?[{kind:"text",id:"t0",textSig:U(e),doneSig:U(!0)}]:[];return{id:ze(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:U(n)}}function fn(){return{id:ze(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:U([])}}function hs(e){let t=ze();return su({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function su(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:U(e.parts.map(uu))}}function lu(e){let t=e.parts.map((o,a)=>o.type==="text"?{kind:"text",id:`${e.id}-t${a}`,textSig:U(o.text),doneSig:U(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${a}`,textSig:U(o.text),doneSig:U(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${a}`}: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.startsWith("tool-")?{kind:"tool",toolCallId:o.toolCallId,toolName:us(o.type),inputPartialSig:U(""),inputSig:U(o.input),outputSig:U(o.output),errorSig:U(o.errorText),stateSig:U(o.state),approvalSig:U(o.approval)}:null).filter(o=>o!==null),n=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:n?.type==="data-suggestions"?wo(n.data):void 0,serverMessageId:e.id,createdAt:ko(e.createdAt)??Date.now(),status:e.status==="failed"?"error":"complete",canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:U(t)}}var cu=new Set(["completed","failed","canceled"]);function du(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function _u(e){return e.role==="assistant"&&e.status!=null&&!cu.has(e.status)&&du(e)}function Eo(e){return e.filter(t=>!_u(t)).map(lu)}function vs(e,t){return(!t&&e.at(-1)?.role==="assistant"?e.slice(0,-1):e).filter(o=>!o.ephemeral)}function Jr(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(pu)}}function gn(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function hn(e){return gn(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function st(e){return e.role==="assistant"&&e.status!=="streaming"&&hn(e)}function bs(e){return e.canceled===!0&&st(e)}function ys(e,t){return e.operatorRoutedTurn?st(e)?"drop":"complete-operator-routed":t||st(e)?"error":"complete"}function uu(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:U(e.text),doneSig:U(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:U(e.inputPartial),inputSig:U(e.input),outputSig:U(e.output),errorSig:U(e.error),stateSig:U(e.state),approvalSig:U(e.approval)}:e}function pu(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,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 Ps=V.scope("reducer"),bn=class{constructor(t){K(this,"messagesSig",t);K(this,"active",null);K(this,"openTextParts",new Map);K(this,"partSeq",0);K(this,"resumeSeen",new Set);K(this,"resumeIgnore",!1)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.openTextParts.clear()}applyResume(t,n=!1){if(t.type==="data-control-state"||t.type==="data-conversation-rebind")return null;if(t.type==="start"){let o=t.messageId,a=t.messageMetadata?.senderRole,i=o!==void 0&&(this.resumeSeen.has(o)||this.messagesSig.value.some(c=>c.serverMessageId===o||c.id===o));if(o!==void 0&&this.resumeSeen.add(o),i||a===void 0&&n)return this.resumeIgnore=!0,this.detach(),null;this.resumeIgnore=!1;let s=fn();return this.attach(s),this.messagesSig.value=[...this.messagesSig.value,s],this.apply(t),null}if(this.resumeIgnore||!this.active)return null;if(this.apply(t),t.type==="finish"||t.type==="error"){let o=this.active;return this.detach(),o}return null}ensureTextPart(t,n,o){let a=`${n}:${o}`,i=this.openTextParts.get(a);if(i)return i;let l={kind:n,id:`${o}#${this.partSeq++}`,textSig:U(""),doneSig:U(!1)};return this.openTextParts.set(a,l),vn(t,l),l}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":vn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":Ps.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Ps.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,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-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":mu(n,t);return;case"file":vn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":xs(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":xs(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-notification":return;case"data-conversation-rebind":return;case"data-suggestions":n.suggestions=wo(t.data);return;case"data-control-state":n.operatorRoutedTurn=!0;return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function Pt(e,t,n){let o=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(o)return o;let a={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:U(""),inputSig:U(void 0),outputSig:U(void 0),errorSig:U(void 0),stateSig:U("input-streaming"),approvalSig:U(void 0)};return vn(e,a),a}function vn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function xs(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||vn(e,t)}function mu(e,t){switch(t.type){case"tool-input-start":Pt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=Pt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=Pt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=Pt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=Pt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=Pt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=Pt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function Ss(e){let t=1e3,n=!1;for(;!e.signal.aborted;){let o=n;n=!0;let a=e.now(),i="held";try{i=await e.connect(()=>e.backfill())}catch{}if(e.signal.aborted||i==="unavailable")return;e.now()-a>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var ks=V.scope("feedback:audio"),Ro=class{constructor(){K(this,"ctx",null);K(this,"master",null);K(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,o=this.master;if(!n||!o||n.state!=="running")return;let a=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((l,s)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=l;let d=n.createGain(),u=a+s*i;d.gain.setValueAtTime(1e-4,u),d.gain.exponentialRampToValueAtTime(t.peakGain,u+.005),d.gain.exponentialRampToValueAtTime(1e-4,u+i),c.connect(d).connect(o),c.start(u),c.stop(u+i+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let a=await this.getBuffer(t);if(!a)return;let i=n.createBufferSource();i.buffer=a,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,a=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=>(ks.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var ws={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},Cs={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 pt=null,Io=0;function fu(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function gu(){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=`__${S.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 Ts(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(fu())try{navigator.vibrate(e);return}catch{}if(pt||(pt=gu()),!!pt)try{pt.label.click()}catch{}}}function Es(){Io++;let e=!1;return()=>{e||(e=!0,Io=Math.max(0,Io-1),Io===0&&pt&&(pt.input.remove(),pt.label.remove(),pt=null))}}var hu=V.scope("feedback"),vu=100,Ao=class{constructor(t,n){K(this,"mutedSig",U(!1));K(this,"audio",new Ro);K(this,"releaseHaptics");K(this,"sound");K(this,"haptics");K(this,"lastPlayed",new Map);K(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=Es(),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<vu}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>hu.warn("audio play failed",{err:a,url:n}));return}let o=Cs[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?ws[t]:n;Ts(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}};function qt(e,t){return e instanceof Ge&&e.status===429?t.errorRateLimited:t.errorGeneric}var bu=0;function r(e,t,n,o,a,i){t||(t={});var l,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?l=t[s]:c[s]=t[s];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--bu,__i:-1,__u:0,__source:a,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return te.vnode&&te.vnode(d),d}var B={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},yn=`${S.cssPrefix}-icon-dir`,Qr=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Ze=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),Rs=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),Is=()=>r("svg",{...B,class:yn,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),As=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Ms=()=>r("svg",{...B,class:yn,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),Vt=()=>r("svg",{...B,class:yn,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),Ls=()=>r("svg",{...B,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Os=()=>r("svg",{...B,"aria-hidden":"true",children:r("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"})}),Ns=()=>r("svg",{...B,"aria-hidden":"true",children:[r("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),r("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),Ds=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),$s=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),Fs=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),Bs=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),Hs=()=>r("svg",{...B,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),zs=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),Us=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),qs=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),Vs=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),r("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),Ws=()=>r("svg",{...B,class:yn,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),xt=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),Gs=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M3 3v6h6"}),r("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),r("path",{d:"M12 7v5l3 2"})]}),Ks=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M2 12h20"}),r("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"})]}),Pn=()=>r("svg",{...B,class:yn,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),js=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M12 20h9"}),r("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),St=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),Xs=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),r("path",{d:"M14 2v6h6"})]}),yu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),r("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),Zr=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),xn=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),r("path",{d:"M12 17h.01"})]}),Pu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"m15 4 3 3-9 9-3-3z"}),r("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),xu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),r("path",{d:"M12 8V4"}),r("circle",{cx:"12",cy:"3",r:"1"}),r("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),ea=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),r("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),r("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),r("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),Su=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("circle",{cx:"12",cy:"12",r:"4"}),r("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"})]}),ta=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),Ys=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Js=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M3 9.5 12 3l9 6.5"}),r("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),Qs=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"m3 11 15-5v12L3 13z"}),r("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),r("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),r("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Sn=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),r("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),Zs=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"4"}),r("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"})]}),el=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),tl=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 3v18"}),r("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),ku=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),r("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),r("path",{d:"m20 20-4.4-4.4"})]}),wu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("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"}),r("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),Cu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M4 18h16"}),r("path",{d:"M5 18a7 7 0 0 1 14 0"}),r("path",{d:"M12 8V6"}),r("path",{d:"M10 6h4"})]}),Tu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),r("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"})]}),nl=()=>r("svg",{...B,"aria-hidden":"true",children:[r("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),r("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]}),ol=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),r("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=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),r("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"})]}),al=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"3.5"}),r("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=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),Mo=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Lo=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),sl={chat:Qr,message:Zr,bubbles:Sn,spark:yu,wand:Pu,bot:xu,help:xn,lifebuoy:Su,headset:ea,search:ku,sparkles:wu,concierge:Cu,wave:Tu};var I=S.cssPrefix,C={launcher:`${I}-launcher`,callout:`${I}-callout`,calloutDismiss:`${I}-callout-dismiss`,panel:`${I}-panel`,panelHeader:`${I}-panel-header`,resizeGrip:`${I}-resize-grip`,scrollToBottom:`${I}-scroll-to-bottom`,actionHistory:`${I}-action-history`,actionClose:`${I}-action-close`,langSegment:`${I}-lang-segment`,composer:`${I}-composer`,composerInput:`${I}-composer-input`,composerSend:`${I}-composer-send`,composerStop:`${I}-composer-stop`,composerAttach:`${I}-composer-attach`,composerFileInput:`${I}-composer-file-input`,composerVoice:`${I}-composer-voice`,attachmentChip:`${I}-attachment-chip`,attachmentRemove:`${I}-attachment-remove`,suggestion:`${I}-suggestion`,messageBubble:`${I}-message`,messageRetry:`${I}-message-retry`,messageFeedback:`${I}-message-feedback`,feedbackUp:`${I}-feedback-up`,feedbackDown:`${I}-feedback-down`,messageCopy:`${I}-message-copy`,historyPane:`${I}-history-pane`,historyBack:`${I}-history-back`,historyItem:`${I}-history-item`,sidebar:`${I}-sidebar`,sidebarToggle:`${I}-sidebar-toggle`,sidebarNewConversation:`${I}-sidebar-new-conversation`,sidebarItem:`${I}-sidebar-item`,messengerHome:`${I}-messenger-home`,modulesEmpty:`${I}-modules-empty`,tab:`${I}-tab`,tabBadge:`${I}-tab-badge`,homeView:`${I}-home-view`,homeGreeting:`${I}-home-greeting`,homeBrand:`${I}-home-brand`,backHeader:`${I}-back-header`,contentView:`${I}-content-view`,contentScroll:`${I}-content-scroll`,homeSearch:`${I}-home-search`,helpSearch:`${I}-help-search`,homeRecent:`${I}-home-recent`,homeContentRow:`${I}-home-content-row`,helpArticle:`${I}-help-article`,newsItem:`${I}-news-item`,formGate:`${I}-form-gate`,formDone:`${I}-form-done`,formDoneToggle:`${I}-form-done-toggle`,formAnswers:`${I}-form-answers`,formFill:`${I}-form-fill`,formSubmit:`${I}-form-submit`,formSkip:`${I}-form-skip`,formField:`${I}-form-field`,toolAskQuestions:`${I}-tool-ask-questions`,toolInputSubmit:`${I}-tool-input-submit`,toolInputSkip:`${I}-tool-input-skip`,toolApproval:`${I}-tool-approval`,toolApprove:`${I}-tool-approve`,toolReject:`${I}-tool-reject`,toolEdit:`${I}-tool-edit`,toolDecision:`${I}-tool-decision`,toolAskSummary:`${I}-ask-questions-summary`,toolAskOptions:`${I}-ask-questions-options-toggle`,toolCall:`${I}-tool-call`,source:`${I}-source`,operatorRequest:`${I}-operator-request`,operatorBanner:`${I}-operator-banner`,operatorCancelRequest:`${I}-operator-cancel-request`};function Ce(e,t){return`${e}-${t}`}var Oo=S.cssPrefix;function ll({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:a}){let i=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${Oo}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":C.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Eu(t.icon),i?r("span",{class:`${Oo}-fab-label`,children:Me(n,t.label??"")}):null]})}function Eu(e){let t=sl[e];return t?r(t,{}):r(Ru,{source:e})}function Ru({source:e}){return r("span",{ref:t=>{t&&Iu(t,e)},"aria-hidden":"true"})}function Iu(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 cl({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:a}){let[i,l]=R(!1);return E(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),E(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?r("div",{class:`${Oo}-callout`,role:"status","data-shape":e.shape,"data-position":Au(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":C.callout,children:[r("span",{children:Me(n,e.text)}),r("button",{type:"button",class:`${Oo}-callout-close`,onClick:a,"aria-label":o,title:o,"data-testid":C.calloutDismiss,children:r(Ze,{})})]}):null}function Au(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function No({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:a,strings:i}){let l=S.cssPrefix,s=F(null);if(E(()=>{if(!e)return;let h=e.style;t.minWidth&&h.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&h.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&h.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&h.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(h.setProperty(`--${l}-widget-w`,`${o.width}px`),h.setProperty(`--${l}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,l,o]),!e)return null;let c=n.startsWith("top-"),d=n.endsWith("-right"),u=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,f=h=>{if(!e)return;let P=h.currentTarget,m=e.getBoundingClientRect();s.current={pointerId:h.pointerId,startX:h.clientX,startY:h.clientY,startW:m.width,startH:m.height,dirX:d?-1:1,dirY:c?1:-1},P.setPointerCapture(h.pointerId),e.setAttribute("data-resizing",""),h.preventDefault()},_=h=>{let P=s.current;if(!P||h.pointerId!==P.pointerId||!e)return;let m=(h.clientX-P.startX)*P.dirX,b=(h.clientY-P.startY)*P.dirY;e.style.setProperty(`--${l}-widget-w`,`${P.startW+m}px`),e.style.setProperty(`--${l}-widget-h`,`${P.startH+b}px`)},g=h=>{let P=s.current;if(!P||h.pointerId!==P.pointerId||!e)return;h.currentTarget.releasePointerCapture(h.pointerId),e.removeAttribute("data-resizing");let m=e.getBoundingClientRect();a({width:Math.round(m.width),height:Math.round(m.height)}),s.current=null};return r("div",{class:u,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:f,onPointerMove:_,onPointerUp:g,onPointerCancel:g,"data-testid":C.resizeGrip,children:r(Hs,{})})}var kt=S.cssPrefix,Mu=`.${kt}-header, .${kt}-back-header, .${kt}-home-hero`,Lu='button, a, input, textarea, select, [role="tab"], [contenteditable]',dl=56;function Do(e,t){E(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,d)=>Math.min(d,Math.max(-d,c)),a=null,i=c=>{let d=c.target;if(!(d instanceof Element)||!d.closest(Mu)||d.closest(Lu))return;let u=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${kt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${kt}-modal-dy`)),maxX:(window.innerWidth+u.width)/2-dl,maxY:(window.innerHeight+u.height)/2-dl},e.dataset.dragging="true",c.preventDefault()},l=c=>{if(!a||c.pointerId!==a.id)return;let d=o(a.dx+c.clientX-a.x,a.maxX),u=o(a.dy+c.clientY-a.y,a.maxY);e.style.setProperty(`--${kt}-modal-dx`,`${d}px`),e.style.setProperty(`--${kt}-modal-dy`,`${u}px`)},s=c=>{!a||c.pointerId!==a.id||(a=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",l),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}},[e,t])}function kn(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 $o(e,t,n){return kn("close",e,t)?n.includes("close"):!1}function _l(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Ou='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Fo(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(Ou)].filter(s=>s.offsetParent!==null||s===document.activeElement);if(o.length===0){n.preventDefault();return}let a=o[0],i=o[o.length-1];if(!a||!i)return;let l=e.getRootNode().activeElement;n.shiftKey&&l===a?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),a.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Bo(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var na=S.cssPrefix;function ul({agent:e,strings:t}){let n=e.status??"online",o=Me(t,e.name),a=e.title?Me(t,e.title):null;return r("div",{class:`${na}-agent`,children:[r("div",{class:`${na}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:Bo(o)})}),r("div",{class:`${na}-agent-meta`,children:[r("strong",{children:o}),a?r("span",{children:a}):null]})]})}var pl=V.scope("attachments");function Ho(e,t,n){let o=Du(e),a=[],i=[],l=Bu(n.accept),s=t.reduce((d,u)=>d+u.size,0),c=t.length;for(let d of o){let u=Nu(d,c,s,n,l);if(u){i.push({file:d,reason:u});continue}a.push(Fu(d)),s+=d.size,c+=1}return(a.length||i.length)&&pl.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function oa(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){pl.debug("revokeObjectURL failed",{error:t})}}function Nu(e,t,n,o,a){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Hu(e,a)?null:"mime"}function Du(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:$u(t)).filter(t=>t!==null):[]}function $u(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Fu(e){return{file:e,id:ze(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Bu(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 Hu(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),a=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?a.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===o))}var wn=S.cssPrefix;function ml({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${wn}-attachment-chip`,title:e.name,"data-testid":Ce(C.attachmentChip,e.id),children:[n?r("img",{class:`${wn}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${wn}-attachment-thumb`,"aria-hidden":"true",children:r(Xs,{})}),r("span",{class:`${wn}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${wn}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":Ce(C.attachmentRemove,e.id),children:r(Ze,{})})]})}var ra={isSupported:!1,start:()=>{},stop:()=>{}};function aa(e,t,n){return e==="disabled"?ra:e==="server"?Vu(n):zu(t)}function zu(e){let t=Uu();if(!t)return ra;let n=null;return{isSupported:!0,start(o,a){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",l=>{let s=l,c="",d=!1;for(let u=s.resultIndex;u<s.results.length;u++){let f=s.results[u];f&&(c+=f[0].transcript,f.isFinal&&(d=!0))}o(c,d)});let i=()=>{n=null,a()};n.addEventListener("end",i),n.addEventListener("error",i),n.start()},stop(){n?.stop()}}}function Uu(){return window.SpeechRecognition??window.webkitSpeechRecognition}var qu=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Vu(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ra;let t=null,n=null,o=[],a=()=>{for(let i of n?.getTracks()??[])i.stop();n=null};return{isSupported:!0,async start(i,l){try{n=await navigator.mediaDevices.getUserMedia({audio:!0});let s=Wu();t=new MediaRecorder(n,s?{mimeType:s}:void 0),o=[],t.addEventListener("dataavailable",c=>{c.data.size>0&&o.push(c.data)}),t.addEventListener("stop",async()=>{let c=t?.mimeType??"audio/webm";a();let d=new Blob(o,{type:c});o=[];try{let{text:u}=await e(d,c);u&&i(u,!0)}catch{}finally{l()}}),t.start()}catch{a(),l()}},stop(){t?.stop()}}}function Wu(){for(let e of qu)if(MediaRecorder.isTypeSupported(e))return e}var Be=S.cssPrefix,wt=V.scope("composer");function Wt(e){return e.reduce((t,n)=>t+n.size,0)}var Gu={arrowUp:As,paperPlane:Is,send:Ms,chevron:Vt};function fl({options:e,transport:t,feedback:n,bus:o,isStreaming:a,operatorRequestEnabled:i,controlMode:l,onRequestOperator:s,onSend:c,onStop:d,attachApiRef:u}){let f=e.strings,[_,g]=R(""),[h,P]=R([]),[m,b]=R(!1),w=F(null),v=F(null),k=e.features.fileUpload,$=e.features.voice,[J,Y]=R(()=>aa($,e.locale,(L,z)=>t.transcribe(L,z)));E(()=>{m||$==="disabled"||Y(aa($,e.locale,(L,z)=>t.transcribe(L,z)))},[e.locale,$,t,m]),E(()=>{let L=w.current;if(!L)return;let z=L.getRootNode(),Q="activeElement"in z?z.activeElement:null;Q&&L.closest(`.${Be}-panel`)?.contains(Q)||L.focus({preventScroll:!0})},[]),E(()=>{let L=w.current;if(!L)return;if(_.length===0){L.style.height="";return}L.style.height="auto";let z=parseFloat(getComputedStyle(L).fontSize)*.7,Q=Math.min(L.scrollHeight,160);L.style.height=`${Q<40+z?40:Q}px`},[_]);let re=F(h);re.current=h,E(()=>()=>re.current.forEach(oa),[]),E(()=>{if(u)return u.current={attachFromDrop:L=>{let z=Ho(L,re.current,e.attachments);z.accepted.length!==0&&(wt.info("attach (drop)",{count:z.accepted.length,totalBytes:Wt(z.accepted)}),o.emit("attach",{count:z.accepted.length,totalBytes:Wt(z.accepted)}),P(Q=>[...Q,...z.accepted]))},fill:L=>{g(L);let z=w.current;z&&(z.focus({preventScroll:!0}),requestAnimationFrame(()=>z.setSelectionRange(z.value.length,z.value.length)))}},()=>{u.current&&(u.current=null)}},[u,e.attachments]),E(()=>{let L=w.current;if(!L)return;let z=L.closest(`.${Be}-panel`);if(!z)return;let Q=ve=>{let Ke=ve.clipboardData;if(!Ke)return;let Oe=ve.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(Oe&&Oe!==L)return;if(k){let Re=Ho(Ke.items,re.current,e.attachments);if(Re.accepted.length>0){ve.preventDefault(),wt.info("attach (paste)",{count:Re.accepted.length,totalBytes:Wt(Re.accepted)}),o.emit("attach",{count:Re.accepted.length,totalBytes:Wt(Re.accepted)}),P(qe=>[...qe,...Re.accepted]);return}}if(Oe===L)return;let je=Ke.getData("text/plain");je&&(ve.preventDefault(),g(Re=>Re+je),L.focus())};return z.addEventListener("paste",Q),()=>z.removeEventListener("paste",Q)},[k,e.attachments,Be]);let ne=()=>{let L=_.trim();!L&&h.length===0||a||(c(L,h),g(""),P([]))},N=L=>{L.key!=="Enter"||L.shiftKey||L.isComposing||(L.preventDefault(),a?d():ne())},O=L=>{let z=L.target,Q=Ho(z.files,h,e.attachments);Q.accepted.length>0&&(wt.info("attach (file picker)",{count:Q.accepted.length,totalBytes:Wt(Q.accepted)}),o.emit("attach",{count:Q.accepted.length,totalBytes:Wt(Q.accepted)}),P(ve=>[...ve,...Q.accepted])),z.value=""},j=L=>{wt.info("removeAttachment",{id:L}),o.emit("removeAttachment",{id:L}),P(z=>{let Q=z.find(ve=>ve.id===L);return Q&&oa(Q),z.filter(ve=>ve.id!==L)})},H=F(null),He=()=>{if(J.isSupported){if(m){let L=H.current?Date.now()-H.current:0;wt.info("voiceStop",{durationMs:L}),o.emit("voiceStop",{durationMs:L}),J.stop(),b(!1),n.play("voiceStop"),H.current=null;return}H.current=Date.now(),wt.info("voiceStart"),o.emit("voiceStart",void 0),b(!0),n.play("voiceStart"),J.start((L,z)=>g(Q=>z?`${Q}${L} `:Q),()=>{if(b(!1),H.current){let L=Date.now()-H.current;wt.debug("voiceStop (auto)",{durationMs:L}),o.emit("voiceStop",{durationMs:L}),H.current=null}})}},ue=Gu[e.composer.sendButton.icon];return r("div",{class:`${Be}-composer`,"data-testid":C.composer,children:[h.length>0?r("div",{class:`${Be}-attachments`,children:h.map(L=>r(ml,{attachment:L,onRemove:()=>j(L.id)},L.id))}):null,r("div",{class:`${Be}-composer-row`,children:[r("div",{class:`${Be}-composer-actions`,children:[k?r("button",{type:"button",class:`${Be}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":f.attach,"data-testid":C.composerAttach,children:r(Os,{})}):null,J.isSupported?r("button",{type:"button",class:`${Be}-icon-btn`,onClick:He,"aria-label":m?f.micStop:f.micStart,"aria-pressed":m,"data-recording":m?"true":void 0,"data-testid":C.composerVoice,children:r(Ns,{})}):null,i&&l==="ai-agent"&&s?r("button",{type:"button",class:`${Be}-icon-btn`,onClick:s,"aria-label":f.talkToOperator,title:f.talkToOperator,"data-testid":C.operatorRequest,children:r(ea,{})}):null]}),r("textarea",{ref:w,class:`${Be}-textarea`,rows:1,value:_,placeholder:f.composerPlaceholder,onInput:L=>g(L.target.value),onKeyDown:N,"aria-label":f.composerPlaceholder,"data-testid":C.composerInput}),a?r("button",{type:"button",class:`${Be}-send`,onClick:d,"aria-label":f.stop,"data-testid":C.composerStop,children:r(Ls,{})}):r("button",{type:"button",class:`${Be}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:ne,disabled:!_.trim()&&h.length===0,"aria-label":f.send,"data-testid":C.composerSend,children:r(ue,{})})]}),r("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:O,class:`${Be}-sr-only`,"data-testid":C.composerFileInput})]})}var Ku=S.cssPrefix;function gl({visible:e,strings:t}){return e?r("div",{class:`${Ku}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function zo({containerRef:e,onDrop:t}){let[n,o]=R(!1);return E(()=>{let a=e.current;if(!a)return;let i=0,l=u=>{i+=1,u.dataTransfer?.types.includes("Files")&&(u.preventDefault(),o(!0))},s=()=>{i-=1,!(i>0)&&(i=0,o(!1))},c=u=>{u.dataTransfer?.types.includes("Files")&&u.preventDefault()},d=u=>{i=0,o(!1),u.dataTransfer&&(u.preventDefault(),t(u.dataTransfer.items))};return a.addEventListener("dragenter",l),a.addEventListener("dragleave",s),a.addEventListener("dragover",c),a.addEventListener("drop",d),()=>{a.removeEventListener("dragenter",l),a.removeEventListener("dragleave",s),a.removeEventListener("dragover",c),a.removeEventListener("drop",d)}},[e,t]),{visible:n}}function hl({itemCount:e,initialFocusIndex:t}){let[n,o]=R(!1),a=F(null),i=F(null),[l,s]=R(-1),c=D(()=>{o(!1),s(-1),a.current?.focus()},[]),d=D(()=>o(_=>!_),[]);E(()=>{if(!n)return;let _=g=>{let h=i.current,P=a.current;if(!h||!P)return;let m=g.composedPath();m.includes(h)||m.includes(P)||(o(!1),s(-1))};return document.addEventListener("click",_,!0),()=>document.removeEventListener("click",_,!0)},[n]),E(()=>{if(!n||e===0)return;let _=t?.()??0,g=_<0||_>=e?0:_;s(g)},[n,e,t]),E(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let u=D(_=>{(_.key==="ArrowDown"||_.key==="Enter"||_.key===" ")&&(_.preventDefault(),o(!0))},[]),f=D(_=>{if(e!==0)switch(_.key){case"Escape":_.preventDefault(),c();return;case"ArrowDown":_.preventDefault(),s(g=>(g+1)%e);return;case"ArrowUp":_.preventDefault(),s(g=>(g-1+e)%e);return;case"Home":_.preventDefault(),s(0);return;case"End":_.preventDefault(),s(e-1)}},[e,c]);return{open:n,focusIndex:l,triggerRef:a,menuRef:i,toggle:d,close:c,onTriggerKey:u,onMenuKey:f}}function vl({items:e,triggerLabel:t}){let n=S.cssPrefix,o=hl({itemCount:e.length}),a=s=>{s.disabled||(s.onSelect?.(),s.keepOpen||o.close())},i=(s,c)=>s.onSelectValue?.(c),l=(s,c)=>{let d=c.segments;if(!d?.length)return;let u=Math.max(0,d.findIndex(_=>_.value===c.value)),f=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")f=(u+1)%d.length;else if(s.key==="ArrowLeft")f=(u-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[f].value)};return r("div",{class:`${n}-menu-wrap`,children:[r("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:r(zs,{})}),o.open?r("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(s=>s.segments?r("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":s.label,tabIndex:-1,onKeyDown:c=>l(c,s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),r("span",{class:`${n}-segmented`,role:"group","aria-label":s.label,children:s.segments.map(c=>{let d=c.value===s.value;return r("button",{type:"button",role:"menuitemradio","aria-checked":d,class:`${n}-segment`,"data-on":d?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${C.langSegment}-${c.value}`,onClick:()=>i(s,c.value),children:c.label},c.value)})})]},s.id):r("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":s.type==="switch"?s.on:void 0,disabled:s.disabled,onClick:()=>a(s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),s.type==="switch"&&s.on?r("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:r(xt,{})}):null]},s.id))}):null]})}var ia=S.cssPrefix;function ju(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 Xu={normal:"large",large:"small",small:"normal"};function Yu(e){return e==="light"?r(Zs,{}):e==="dark"?r(el,{}):r(tl,{})}function Ju(e){return(e.split("-")[0]??e).toUpperCase()}function et({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:a,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:u,onLocaleChange:f,onThemeChange:_,onTextSizeChange:g}=e,h=n.strings,P=n.mode,m=t==="chat",b=Z(()=>a.mutedSig.value).value,w=new Set(n.actions),v=H=>w.has(H),k=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,$=H=>k?!1:kn(H,P,o),J=n.themeMode,Y={auto:h.themeAuto,light:h.themeLight,dark:h.themeDark},re=n.textSize,ne={small:h.textSizeSmall,normal:h.textSizeNormal,large:h.textSizeLarge},N=[];if(m&&v("clear")&&N.push({id:"clear",icon:r(js,{}),label:h.newConversation,onSelect:l}),v("expand")&&$("expand")){let H=o==="expanded";N.push({id:"expand",icon:H?r($s,{}):r(Ds,{}),label:H?h.collapse:h.expand,type:"switch",on:H,onSelect:s})}if(v("fullscreen")&&$("fullscreen")){let H=o==="fullscreen";N.push({id:"fullscreen",icon:H?r(Bs,{}):r(Fs,{}),label:H?h.exitFullscreen:h.fullscreen,type:"switch",on:H,onSelect:c})}m&&v("sound")&&N.push({id:"sound",icon:b?r(qs,{}):r(Us,{}),label:b?h.soundOff:h.soundOn,type:"switch",on:!b,onSelect:d}),v("theme")&&N.push({id:"theme",icon:Yu(J),label:`${h.theme}: ${Y[J]}`,onSelect:()=>_(ju(J)),keepOpen:!0}),v("textSize")&&N.push({id:"textSize",icon:r(Vs,{}),label:`${h.textSize}: ${ne[re]}`,onSelect:()=>g(Xu[re]),keepOpen:!0}),v("language")&&n.availableLocales.length>1&&N.push({id:"language",icon:r(Ks,{}),label:h.language,segments:n.availableLocales.map(H=>({value:H,label:Ju(H),lang:H})),value:n.locale,onSelectValue:f});let O=!!i&&$o(P,o,n.actions),j=m&&v("history");return r("div",{class:`${ia}-header-actions`,children:[j?r("button",{type:"button",class:`${ia}-icon-btn`,onClick:u,"aria-label":h.history,title:h.history,"data-testid":C.actionHistory,children:r(Gs,{})}):null,N.length>0?r(vl,{items:N,triggerLabel:h.moreActions}):null,O?r("button",{type:"button",class:`${ia}-icon-btn`,onClick:i,"aria-label":h.close,title:h.close,"data-testid":C.actionClose,children:r(Ze,{})}):null]})}var Qu=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Zu=/^https?:\/\/[^\s.]+\.[^\s]+$/i,ep=/^[+]?[\d\s().-]{6,}$/;function Gt(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function tp(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function np(e,t,n){let o=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=tp(t);return o&&l===0?n.formRequired:l===0?void 0:a?.minSelections!=null&&l<a.minSelections?Gt(n.formChooseAtLeast,{min:a.minSelections}):a?.maxSelections!=null&&l>a.maxSelections?Gt(n.formChooseAtMost,{max:a.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return o?n.formRequired:void 0;switch(e.type){case"email":if(!Qu.test(i))return n.formInvalidEmail;break;case"url":if(!Zu.test(i))return n.formInvalidUrl;break;case"tel":if(!ep.test(i))return n.formInvalidTel;break;case"number":{let l=Number(i);if(!Number.isFinite(l))return n.formInvalidNumber;if(a?.min!=null&&l<a.min)return Gt(n.formNumberTooSmall,{min:a.min});if(a?.max!=null&&l>a.max)return Gt(n.formNumberTooLarge,{max:a.max});break}default:break}if(a?.minLength!=null&&i.length<a.minLength)return Gt(n.formTooShort,{min:a.minLength});if(a?.maxLength!=null&&i.length>a.maxLength)return Gt(n.formTooLong,{max:a.maxLength});if(a?.pattern)try{if(!new RegExp(a.pattern).test(i))return n.formPatternMismatch}catch{}}function bl(e,t,n){let o={};for(let a of e){let i=np(a,t[a.name],n);i&&(o[a.name]=i)}return o}function yl(e){let t={};for(let[n,o]of Object.entries(e)){let a=Array.isArray(o)?o.join(", "):o;a&&a.trim()&&(t[n]=a.trim())}return t}var de=S.cssPrefix,Uo="__other__";function Cn({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,initialValues:d,hideActions:u,fieldTypeLabels:f,rootTestId:_,submitTestId:g,skipTestId:h}){let[P,m]=R(()=>({...ip(e),...d})),[b,w]=R({}),[v,k]=R({}),$=N=>{v[N]&&k(O=>({...O,[N]:""}))},J=(N,O)=>{m(j=>({...j,[N]:O})),$(N)},Y=(N,O)=>{w(j=>({...j,[N]:O})),$(N)},re=N=>{if(N.preventDefault(),c)return;let O=sp(e,P,b),j=bl(e,O,t);if(Object.keys(j).length>0){k(j);return}o(yl(O))},ne=N=>{!s||N.key!=="Enter"||N.shiftKey||N.isComposing||N.target?.tagName==="TEXTAREA"&&re(N)};return r("form",{class:`${de}-form`,onSubmit:re,onKeyDown:ne,"data-testid":_,noValidate:!0,children:[e.map(N=>r(op,{field:N,value:P[N.name],otherText:b[N.name]??"",error:v[N.name],disabled:c,typeLabel:f?.[N.name],strings:t,onChange:O=>J(N.name,O),onOtherChange:O=>Y(N.name,O)},N.name)),u?null:r("div",{class:`${de}-form-actions`,children:[l?r("span",{class:`${de}-form-hint`,children:l}):null,a&&i?r("button",{type:"button",class:`${de}-form-skip`,onClick:i,disabled:c,"data-testid":h,children:a}):null,r("button",{type:"submit",class:`${de}-form-submit`,disabled:c,"data-testid":g,children:n})]})]})}function op({field:e,value:t,otherText:n,error:o,disabled:a,typeLabel:i,strings:l,onChange:s,onOtherChange:c}){let d=Ce(C.formField,e.name),u=rp({field:e,value:t,otherText:n,disabled:a,strings:l,onChange:s,onOtherChange:c,fieldTid:d});return r("label",{class:`${de}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[r("span",{class:`${de}-field-head`,children:[r("span",{class:`${de}-field-label`,children:[e.label,e.required??!0?r("span",{class:`${de}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?r("span",{class:`${de}-field-type`,children:i}):null]}),u,e.validationHint&&!o?r("span",{class:`${de}-field-hint`,children:e.validationHint}):null,o?r("span",{class:`${de}-field-error`,role:"alert",children:o}):null]})}function rp(e){let{field:t,value:n,otherText:o,disabled:a,strings:i,onChange:l,onOtherChange:s,fieldTid:c}=e,d=typeof n=="string"?n:"";switch(t.type){case"textarea":return r("textarea",{class:`${de}-field-input`,rows:3,value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c});case"select":return r("select",{class:`${de}-field-input`,value:d,disabled:a,onChange:u=>l(u.target.value),"data-testid":c,children:[r("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(u=>r("option",{value:u.value,children:u.label??u.value},u.value))]});case"radio":{let u=t.allowOther&&d===Uo;return r("div",{class:`${de}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(f=>r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===f.value,disabled:a,onChange:()=>l(f.value)}),r("span",{children:f.label??f.value})]},f.value)),t.allowOther?r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===Uo,disabled:a,onChange:()=>l(Uo)}),r("span",{children:i.formOther})]}):null,u?r("input",{class:`${de}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:f=>s(f.target.value)}):null]})}case"checkbox":return r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:d==="true",disabled:a,onChange:u=>l(u.target.checked?"true":""),"data-testid":c}),r("span",{children:t.placeholder??t.label})]});case"multiselect":{let u=Array.isArray(n)?n:[],f=(_,g)=>l(g?[...u,_]:u.filter(h=>h!==_));return r("div",{class:`${de}-field-choices`,"data-testid":c,children:[(t.options??[]).map(_=>r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:u.includes(_.value),disabled:a,onChange:g=>f(_.value,g.target.checked)}),r("span",{children:_.label??_.value})]},_.value)),t.allowOther||(t.options??[]).length===0?r("textarea",{class:`${de}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:_=>s(_.target.value)}):null]})}default:return r("input",{class:`${de}-field-input`,type:ap(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c})}}function ap(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function ip(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 sp(e,t,n){let o={...t};for(let a of e){let i=n[a.name]?.trim();if(a.type==="radio"&&a.allowOther&&t[a.name]===Uo)o[a.name]=i??"";else if(a.type==="multiselect"&&i){let l=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),s=Array.isArray(t[a.name])?t[a.name]:[];o[a.name]=[...s,...l]}}return o}var tt=S.cssPrefix;function sa({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${tt}-form-gate`,"data-testid":C.formGate,children:[e.title?r("h3",{class:`${tt}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${tt}-form-gate-desc`,children:e.description}):null,r(Cn,{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:C.formSubmit,skipTestId:C.formSkip})]})}function Pl({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",a=o?t.formSkipped:t.formSubmitted,i=e.title?r(se,{children:[r("span",{children:e.title}),r("span",{class:`${tt}-sr-only`,children:a})]}):r("span",{children:a}),l=e.form?.reviewable??!1,s=!o&&l&&e.values&&Object.keys(e.values).length>0?e.values:null;if(s){let c=d=>e.form?.fields.find(u=>u.name===d)?.label??d;return r("details",{class:`${tt}-form-done`,"data-outcome":e.outcome,"data-testid":C.formDone,children:[r("summary",{class:`${tt}-form-done-summary`,"data-testid":C.formDoneToggle,children:[r(xt,{}),i,r(Vt,{})]}),r("dl",{class:`${tt}-form-answers`,"data-testid":C.formAnswers,children:Object.entries(s).map(([d,u])=>r("div",{class:`${tt}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:u})]},d))})]})}return r("div",{class:`${tt}-form-done`,"data-outcome":e.outcome,"data-testid":C.formDone,role:"status",children:[o?r(Ws,{}):r(xt,{}),i,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${tt}-form-done-fill`,"data-testid":C.formFill,onClick:n,children:t.formFillOut}):null]})}function xl(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var da=1,kl=2,wl=4,Cl=8,Tl=16;function lp(e){switch(e){case da:return"href";case kl:return"src";case wl:return"class";case Cl:return"checked";case Tl:return"start"}}var cp=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}},dp=cp;var Sl=24;function ua(e){let t=new Uint32Array(Sl);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(Sl),indent:"",indent_len:0,table_state:0}}function El(e){e.pending.length>0&&Ie(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
|
-
`:
|
|
11
|
+
${a}`:a;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 _s.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return _s.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function J_(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 us=e=>e&&Object.keys(e).length>0?e:void 0;function ps(e,t){let n=us(e),o=us(t);if(!n&&!o)return;let a={};return n&&(a.user=n),o&&(a.page=o),J_(JSON.stringify(a))}function Co(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Q_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function ms(e){return e.startsWith("tool-")?e.slice(5):e}var $e={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",cancelRequestOperator:"/pai/cancel-request-operator",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},fs="context";function Qe(e){let t=e??{},n=t.controlMode;return{controlMode:n==="awaiting_operator"||n==="operator"?n:"ai-agent",assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function To(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:a,label:i,text:l}=o;typeof i!="string"||!i||n.push({id:typeof a=="string"&&a?a:`s${n.length}`,label:i,text:typeof l=="string"&&l?l:i})}return n}function Jr(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:tu(i),role:i.role,createdAt:i.createdAt!==void 0?new Date(i.createdAt).toISOString():void 0})),n={messages:t,conversationId:e.conversationId,trigger:e.trigger??"submit-message"},o=t.at(-1)?.id;o&&(n.messageId=o),e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let a=e.tools?.map(eu).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function Z_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function eu(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function tu(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"&&Z_(n)){let o={type:Q_(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 Y=W.scope("transport"),nu=6e4,ou=1e4,gs=3,ru=400,au=new Set([408,425,429,500,502,503,504]);function hs(e){return ru*2**e+Math.floor(Math.random()*250)}function iu(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 Eo=class{constructor(t){X(this,"ttlMs",t);X(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 a={at:Date.now(),result:n().then(i=>(a.value=i,i)).catch(i=>{throw this.map.delete(t),i})};return this.map.set(t,a),a.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()}},Ro=class{constructor(t){X(this,"opts",t);X(this,"visitorId");X(this,"conversationId");X(this,"userContext");X(this,"pageContext");X(this,"locale");X(this,"conversationsCache",new Eo(ou));X(this,"contentCache",new Eo(nu))}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:Ot};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=ps(this.userContext,this.pageContext);return n&&(t[fs]=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,a]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,a);return n.toString()}async handshake(t){Y.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson($e.handshake,t,"handshake");return Y.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),lu(n)||Y.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){Y.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let n=new FormData;n.append("file",t,t.name);let o=await this.postForm(this.uploadPath,n,"upload");return Y.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){Y.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${su(n)}`),o.append("mimeType",n);let a=await this.postForm(this.transcribePath,o,"transcribe");return Y.debug("transcribe \u2190",{textLen:a.text.length}),a}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($e.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),Y.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let o=await this.getJson(n.toString(),"listConversations"),a=o.conversations??[];return Y.debug("listConversations \u2190",{count:a.length,nextCursor:o.nextCursor}),{conversations:a,nextCursor:o.nextCursor}}async loadConversation(t){let n=new URL(this.url($e.listMessages));n.searchParams.set("conversationId",t),Y.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),a=o.messages??[];return Y.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:a.length,hasSuggestions:!!o.suggestions}),{...o,messages:a,canContinue:o.canContinue??!0}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),Y.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson($e.markRead,{conversationId:t},"markRead")}catch(n){Y.debug("markRead failed (non-fatal)",{err:n})}}}async requestOperator(){if(!(!this.visitorId||!this.conversationId)){Y.debug("requestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson($e.requestOperator,{},"requestOperator")).controlState}catch(t){Y.debug("requestOperator failed (non-fatal)",{err:t});return}}}async cancelRequestOperator(){if(!(!this.visitorId||!this.conversationId)){Y.debug("cancelRequestOperator \u2192",{conversationId:this.conversationId,visitorId:this.visitorId});try{return(await this.postJson($e.cancelRequestOperator,{},"cancelRequestOperator")).controlState}catch(t){Y.debug("cancelRequestOperator 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($e.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));Y.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),a=(o.items??[]).map(i=>mi(i,this.locale));return Y.debug("listContent \u2190",{count:a.length,total:o.pagination?.total}),{...o,items:a}}async bootstrap(t){let n=new URL(this.dataUrl($e.bootstrap));t&&n.searchParams.set("conversationId",t),Y.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),a=o.forms??[],i=o.formSubmissions??[];return Y.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){Y.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson($e.updateSettings,{userPrefs:t},"saveUserPrefs");return Y.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??$e.submitForm}async submitForm(t){Y.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){Y.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){Y.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson($e.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){Y.debug("submitFeedback failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),Y.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageId:t.messageId,messageCount:t.messages.length,trigger:t.trigger,tools:t.data?.tools?.map(l=>l.code)});let n=new AbortController,o=new Set;return{iter:this.runStream(t,n,o),cancel:()=>this.cancelStream(n,t.conversationId),detach:()=>n.abort()}}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||Y.debug("resume-stream fetch failed \u2014 reconnecting",{err:o}),"held"}if(!n.ok||!n.body)return Y.debug("resume-stream \u2192 endpoint unavailable",{status:n.status}),"unavailable";if(!(n.headers.get("content-type")??"").includes("text/event-stream"))return Y.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";t.onConnected();try{for await(let{chunk:o}of Yr(n,t.signal)){if(t.signal.aborted)return"held";t.onChunk(o)}}catch(o){if(t.signal.aborted)return"held";Y.debug("resume-stream segment dropped \u2014 reconnecting",{err:o})}return"held"}async*runStream(t,n,o){try{yield*this.drain(this.openMessageStream(t,n.signal),o,n)}finally{n.abort()}}async*drain(t,n,o){try{for await(let a of t){if(o.signal.aborted)return;if(a.eventId){if(n.has(a.eventId))continue;n.add(a.eventId)}yield a}}catch(a){if(o.signal.aborted)return;if(a instanceof Ke&&a.status!==void 0)throw a;Y.debug("stream segment dropped",{err:a})}}cancelStream(t,n){t.signal.aborted||(Y.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url($e.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>Y.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url($e.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"text/event-stream","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});yield*Yr(o,n)}resumeUrl(){return this.withEnvelopeQuery($e.streamResume)}async postJson(t,n,o){let a=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(a,o)}async postForm(t,n,o){let a=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(a,o)}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[a,i]=t(),l;try{l=await this.fetchImpl(a,i)}catch(c){if(o>=gs)throw new Ke(`${n} failed: network error`,"network",void 0,c);Y.debug("request network error \u2014 retrying",{label:n,attempt:o}),await fn(hs(o));continue}if(l.ok||!au.has(l.status)||o>=gs)return l;let s=iu(l.headers)??hs(o);Y.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await fn(s)}}async assertOk(t,n){if(!t.ok)throw new Ke(`${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 su(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 lu(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function vs(e,t){let n=e?[{kind:"text",id:"t0",textSig:U(e),doneSig:U(!0)}]:[];return{id:ze(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:U(n)}}function gn(){return{id:ze(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:U([])}}function bs(e){let t=ze();return cu({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function cu(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:U(e.parts.map(mu))}}function du(e){let t=e.parts.map((o,a)=>o.type==="text"?{kind:"text",id:`${e.id}-t${a}`,textSig:U(o.text),doneSig:U(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${a}`,textSig:U(o.text),doneSig:U(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${a}`}: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.startsWith("tool-")?{kind:"tool",toolCallId:o.toolCallId,toolName:ms(o.type),inputPartialSig:U(""),inputSig:U(o.input),outputSig:U(o.output),errorSig:U(o.errorText),stateSig:U(o.state),approvalSig:U(o.approval)}:null).filter(o=>o!==null),n=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:n?.type==="data-suggestions"?To(n.data):void 0,serverMessageId:e.id,createdAt:Co(e.createdAt)??Date.now(),status:e.status==="failed"?"error":"complete",canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:U(t)}}var _u=new Set(["completed","failed","canceled"]);function uu(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function pu(e){return e.role==="assistant"&&e.status!=null&&!_u.has(e.status)&&uu(e)}function Io(e){return e.filter(t=>!pu(t)).map(du)}function ys(e,t){return(!t&&e.at(-1)?.role==="assistant"?e.slice(0,-1):e).filter(o=>!o.ephemeral)}function Zr(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(fu)}}function hn(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function mt(e){return hn(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function st(e){return e.role==="assistant"&&e.status!=="streaming"&&mt(e)}function Ps(e){return e.canceled===!0&&st(e)}function xs(e,t){return e.operatorRoutedTurn?st(e)?"drop":"complete-operator-routed":t||st(e)?"error":"complete"}function mu(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:U(e.text),doneSig:U(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:U(e.inputPartial),inputSig:U(e.input),outputSig:U(e.output),errorSig:U(e.error),stateSig:U(e.state),approvalSig:U(e.approval)}:e}function fu(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,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 Ss=W.scope("reducer"),bn=class{constructor(t){X(this,"messagesSig",t);X(this,"active",null);X(this,"openTextParts",new Map);X(this,"partSeq",0);X(this,"resumeIgnore",!1)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.openTextParts.clear()}applyResume(t,n=!1){if(t.type==="data-control-state"||t.type==="data-conversation-rebind")return null;if(t.type==="start"){let o=t.messageId,a=t.messageMetadata?.senderRole,i=o!==void 0?this.messagesSig.value.find(d=>d.serverMessageId===o||d.id===o):void 0;if(i!==void 0&&!mt(i)||a===void 0&&n)return this.resumeIgnore=!0,this.detach(),null;this.resumeIgnore=!1,i!==void 0&&(this.messagesSig.value=this.messagesSig.value.filter(d=>d!==i));let c=gn();return this.attach(c),this.messagesSig.value=[...this.messagesSig.value,c],this.apply(t),null}if(this.resumeIgnore||!this.active)return null;if(this.apply(t),t.type==="finish"||t.type==="error"){let o=this.active;return this.detach(),o}return null}ensureTextPart(t,n,o){let a=`${n}:${o}`,i=this.openTextParts.get(a);if(i)return i;let l={kind:n,id:`${o}#${this.partSeq++}`,textSig:U(""),doneSig:U(!1)};return this.openTextParts.set(a,l),vn(t,l),l}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":vn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":Ss.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Ss.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,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-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":gu(n,t);return;case"file":vn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":ks(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":ks(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-notification":return;case"data-conversation-rebind":return;case"data-suggestions":n.suggestions=To(t.data);return;case"data-control-state":n.operatorRoutedTurn=!0;return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function xt(e,t,n){let o=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(o)return o;let a={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:U(""),inputSig:U(void 0),outputSig:U(void 0),errorSig:U(void 0),stateSig:U("input-streaming"),approvalSig:U(void 0)};return vn(e,a),a}function vn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function ks(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||vn(e,t)}function gu(e,t){switch(t.type){case"tool-input-start":xt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=xt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=xt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=xt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=xt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=xt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=xt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function ws(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 Cs=W.scope("feedback:audio"),Ao=class{constructor(){X(this,"ctx",null);X(this,"master",null);X(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){Cs.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 a=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((l,s)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=l;let d=n.createGain(),u=a+s*i;d.gain.setValueAtTime(1e-4,u),d.gain.exponentialRampToValueAtTime(t.peakGain,u+.005),d.gain.exponentialRampToValueAtTime(1e-4,u+i),c.connect(d).connect(o),c.start(u),c.stop(u+i+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let a=await this.getBuffer(t);if(!a)return;let i=n.createBufferSource();i.buffer=a,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,a=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=>(Cs.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var Ts={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},Es={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 ft=null,Mo=0;function hu(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function vu(){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=`__${S.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 Rs(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(hu())try{navigator.vibrate(e);return}catch{}if(ft||(ft=vu()),!!ft)try{ft.label.click()}catch{}}}function Is(){Mo++;let e=!1;return()=>{e||(e=!0,Mo=Math.max(0,Mo-1),Mo===0&&ft&&(ft.input.remove(),ft.label.remove(),ft=null))}}var bu=W.scope("feedback"),yu=100,Lo=class{constructor(t,n){X(this,"mutedSig",U(!1));X(this,"audio",new Ao);X(this,"releaseHaptics");X(this,"sound");X(this,"haptics");X(this,"lastPlayed",new Map);X(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=Is(),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<yu}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>bu.warn("audio play failed",{err:a,url:n}));return}let o=Es[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?Ts[t]:n;Rs(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}};function Vt(e,t){return e instanceof Ke&&e.status===429?t.errorRateLimited:t.errorGeneric}var Pu=0;function r(e,t,n,o,a,i){t||(t={});var l,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?l=t[s]:c[s]=t[s];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Pu,__i:-1,__u:0,__source:a,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return ne.vnode&&ne.vnode(d),d}var B={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},yn=`${S.cssPrefix}-icon-dir`,ea=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Ze=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),As=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),Ms=()=>r("svg",{...B,class:yn,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),Ls=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Os=()=>r("svg",{...B,class:yn,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),Wt=()=>r("svg",{...B,class:yn,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),Ns=()=>r("svg",{...B,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Ds=()=>r("svg",{...B,"aria-hidden":"true",children:r("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"})}),$s=()=>r("svg",{...B,"aria-hidden":"true",children:[r("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),r("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),Fs=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),Bs=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),Hs=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),zs=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),Us=()=>r("svg",{...B,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),qs=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),Vs=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),Ws=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),Ks=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),r("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),Gs=()=>r("svg",{...B,class:yn,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),St=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),js=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M3 3v6h6"}),r("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),r("path",{d:"M12 7v5l3 2"})]}),Xs=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M2 12h20"}),r("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"})]}),Pn=()=>r("svg",{...B,class:yn,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Ys=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M12 20h9"}),r("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),kt=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),Js=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),r("path",{d:"M14 2v6h6"})]}),xu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),r("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),ta=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),xn=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),r("path",{d:"M12 17h.01"})]}),Su=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"m15 4 3 3-9 9-3-3z"}),r("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),ku=()=>r("svg",{...B,"aria-hidden":"true",children:[r("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),r("path",{d:"M12 8V4"}),r("circle",{cx:"12",cy:"3",r:"1"}),r("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),na=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),r("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),r("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),r("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),wu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("circle",{cx:"12",cy:"12",r:"4"}),r("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"})]}),oa=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),Qs=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Zs=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M3 9.5 12 3l9 6.5"}),r("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),el=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"m3 11 15-5v12L3 13z"}),r("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),r("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),r("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Sn=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),r("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),tl=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"4"}),r("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"})]}),nl=()=>r("svg",{...B,"aria-hidden":"true",children:r("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),ol=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 3v18"}),r("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),Cu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),r("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),r("path",{d:"m20 20-4.4-4.4"})]}),Tu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("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"}),r("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),Eu=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M4 18h16"}),r("path",{d:"M5 18a7 7 0 0 1 14 0"}),r("path",{d:"M12 8V6"}),r("path",{d:"M10 6h4"})]}),Ru=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),r("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"})]}),rl=()=>r("svg",{...B,"aria-hidden":"true",children:[r("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),r("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]}),al=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),r("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"})]}),il=()=>r("svg",{...B,"aria-hidden":"true",children:[r("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),r("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"})]}),sl=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"3.5"}),r("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"})]}),ll=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),Oo=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),No=()=>r("svg",{...B,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),cl={chat:ea,message:ta,bubbles:Sn,spark:xu,wand:Su,bot:ku,help:xn,lifebuoy:wu,headset:na,search:Cu,sparkles:Tu,concierge:Eu,wave:Ru};var I=S.cssPrefix,C={launcher:`${I}-launcher`,callout:`${I}-callout`,calloutDismiss:`${I}-callout-dismiss`,panel:`${I}-panel`,panelHeader:`${I}-panel-header`,resizeGrip:`${I}-resize-grip`,scrollToBottom:`${I}-scroll-to-bottom`,actionHistory:`${I}-action-history`,actionClose:`${I}-action-close`,langSegment:`${I}-lang-segment`,composer:`${I}-composer`,composerInput:`${I}-composer-input`,composerSend:`${I}-composer-send`,composerStop:`${I}-composer-stop`,composerAttach:`${I}-composer-attach`,composerFileInput:`${I}-composer-file-input`,composerVoice:`${I}-composer-voice`,attachmentChip:`${I}-attachment-chip`,attachmentRemove:`${I}-attachment-remove`,suggestion:`${I}-suggestion`,messageBubble:`${I}-message`,messageRetry:`${I}-message-retry`,messageFeedback:`${I}-message-feedback`,feedbackUp:`${I}-feedback-up`,feedbackDown:`${I}-feedback-down`,messageCopy:`${I}-message-copy`,historyPane:`${I}-history-pane`,historyBack:`${I}-history-back`,historyItem:`${I}-history-item`,sidebar:`${I}-sidebar`,sidebarToggle:`${I}-sidebar-toggle`,sidebarNewConversation:`${I}-sidebar-new-conversation`,sidebarItem:`${I}-sidebar-item`,messengerHome:`${I}-messenger-home`,modulesEmpty:`${I}-modules-empty`,tab:`${I}-tab`,tabBadge:`${I}-tab-badge`,homeView:`${I}-home-view`,homeGreeting:`${I}-home-greeting`,homeBrand:`${I}-home-brand`,backHeader:`${I}-back-header`,contentView:`${I}-content-view`,contentScroll:`${I}-content-scroll`,homeSearch:`${I}-home-search`,helpSearch:`${I}-help-search`,homeRecent:`${I}-home-recent`,homeContentRow:`${I}-home-content-row`,helpArticle:`${I}-help-article`,newsItem:`${I}-news-item`,formGate:`${I}-form-gate`,formDone:`${I}-form-done`,formDoneToggle:`${I}-form-done-toggle`,formAnswers:`${I}-form-answers`,formFill:`${I}-form-fill`,formSubmit:`${I}-form-submit`,formSkip:`${I}-form-skip`,formField:`${I}-form-field`,toolAskQuestions:`${I}-tool-ask-questions`,toolInputSubmit:`${I}-tool-input-submit`,toolInputSkip:`${I}-tool-input-skip`,toolApproval:`${I}-tool-approval`,toolApprove:`${I}-tool-approve`,toolReject:`${I}-tool-reject`,toolEdit:`${I}-tool-edit`,toolDecision:`${I}-tool-decision`,toolAskSummary:`${I}-ask-questions-summary`,toolAskOptions:`${I}-ask-questions-options-toggle`,toolCall:`${I}-tool-call`,source:`${I}-source`,operatorRequest:`${I}-operator-request`,operatorBanner:`${I}-operator-banner`,operatorCancelRequest:`${I}-operator-cancel-request`};function Ce(e,t){return`${e}-${t}`}var Do=S.cssPrefix;function dl({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:a}){let i=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${Do}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":C.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Iu(t.icon),i?r("span",{class:`${Do}-fab-label`,children:Me(n,t.label??"")}):null]})}function Iu(e){let t=cl[e];return t?r(t,{}):r(Au,{source:e})}function Au({source:e}){return r("span",{ref:t=>{t&&Mu(t,e)},"aria-hidden":"true"})}function Mu(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 _l({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:a}){let[i,l]=R(!1);return T(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),T(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?r("div",{class:`${Do}-callout`,role:"status","data-shape":e.shape,"data-position":Lu(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":C.callout,children:[r("span",{children:Me(n,e.text)}),r("button",{type:"button",class:`${Do}-callout-close`,onClick:a,"aria-label":o,title:o,"data-testid":C.calloutDismiss,children:r(Ze,{})})]}):null}function Lu(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function $o({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:a,strings:i}){let l=S.cssPrefix,s=F(null);if(T(()=>{if(!e)return;let h=e.style;t.minWidth&&h.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&h.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&h.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&h.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(h.setProperty(`--${l}-widget-w`,`${o.width}px`),h.setProperty(`--${l}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,l,o]),!e)return null;let c=n.startsWith("top-"),d=n.endsWith("-right"),u=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,f=h=>{if(!e)return;let P=h.currentTarget,m=e.getBoundingClientRect();s.current={pointerId:h.pointerId,startX:h.clientX,startY:h.clientY,startW:m.width,startH:m.height,dirX:d?-1:1,dirY:c?1:-1},P.setPointerCapture(h.pointerId),e.setAttribute("data-resizing",""),h.preventDefault()},_=h=>{let P=s.current;if(!P||h.pointerId!==P.pointerId||!e)return;let m=(h.clientX-P.startX)*P.dirX,b=(h.clientY-P.startY)*P.dirY;e.style.setProperty(`--${l}-widget-w`,`${P.startW+m}px`),e.style.setProperty(`--${l}-widget-h`,`${P.startH+b}px`)},g=h=>{let P=s.current;if(!P||h.pointerId!==P.pointerId||!e)return;h.currentTarget.releasePointerCapture(h.pointerId),e.removeAttribute("data-resizing");let m=e.getBoundingClientRect();a({width:Math.round(m.width),height:Math.round(m.height)}),s.current=null};return r("div",{class:u,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:f,onPointerMove:_,onPointerUp:g,onPointerCancel:g,"data-testid":C.resizeGrip,children:r(Us,{})})}var wt=S.cssPrefix,Ou=`.${wt}-header, .${wt}-back-header, .${wt}-home-hero`,Nu='button, a, input, textarea, select, [role="tab"], [contenteditable]',ul=56;function Fo(e,t){T(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,d)=>Math.min(d,Math.max(-d,c)),a=null,i=c=>{let d=c.target;if(!(d instanceof Element)||!d.closest(Ou)||d.closest(Nu))return;let u=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${wt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${wt}-modal-dy`)),maxX:(window.innerWidth+u.width)/2-ul,maxY:(window.innerHeight+u.height)/2-ul},e.dataset.dragging="true",c.preventDefault()},l=c=>{if(!a||c.pointerId!==a.id)return;let d=o(a.dx+c.clientX-a.x,a.maxX),u=o(a.dy+c.clientY-a.y,a.maxY);e.style.setProperty(`--${wt}-modal-dx`,`${d}px`),e.style.setProperty(`--${wt}-modal-dy`,`${u}px`)},s=c=>{!a||c.pointerId!==a.id||(a=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",l),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}},[e,t])}function kn(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 Bo(e,t,n){return kn("close",e,t)?n.includes("close"):!1}function pl(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Du='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Ho(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(Du)].filter(s=>s.offsetParent!==null||s===document.activeElement);if(o.length===0){n.preventDefault();return}let a=o[0],i=o[o.length-1];if(!a||!i)return;let l=e.getRootNode().activeElement;n.shiftKey&&l===a?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),a.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function zo(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var ra=S.cssPrefix;function ml({agent:e,strings:t}){let n=e.status??"online",o=Me(t,e.name),a=e.title?Me(t,e.title):null;return r("div",{class:`${ra}-agent`,children:[r("div",{class:`${ra}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:zo(o)})}),r("div",{class:`${ra}-agent-meta`,children:[r("strong",{children:o}),a?r("span",{children:a}):null]})]})}var fl=W.scope("attachments");function Uo(e,t,n){let o=Fu(e),a=[],i=[],l=zu(n.accept),s=t.reduce((d,u)=>d+u.size,0),c=t.length;for(let d of o){let u=$u(d,c,s,n,l);if(u){i.push({file:d,reason:u});continue}a.push(Hu(d)),s+=d.size,c+=1}return(a.length||i.length)&&fl.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function aa(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){fl.debug("revokeObjectURL failed",{error:t})}}function $u(e,t,n,o,a){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Uu(e,a)?null:"mime"}function Fu(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Bu(t)).filter(t=>t!==null):[]}function Bu(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Hu(e){return{file:e,id:ze(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function zu(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 Uu(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),a=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?a.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===o))}var wn=S.cssPrefix;function gl({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${wn}-attachment-chip`,title:e.name,"data-testid":Ce(C.attachmentChip,e.id),children:[n?r("img",{class:`${wn}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${wn}-attachment-thumb`,"aria-hidden":"true",children:r(Js,{})}),r("span",{class:`${wn}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${wn}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":Ce(C.attachmentRemove,e.id),children:r(Ze,{})})]})}var ia={isSupported:!1,start:()=>{},stop:()=>{}};function sa(e,t,n){return e==="disabled"?ia:e==="server"?Ku(n):qu(t)}function qu(e){let t=Vu();if(!t)return ia;let n=null;return{isSupported:!0,start(o,a){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",l=>{let s=l,c="",d=!1;for(let u=s.resultIndex;u<s.results.length;u++){let f=s.results[u];f&&(c+=f[0].transcript,f.isFinal&&(d=!0))}o(c,d)});let i=()=>{n=null,a()};n.addEventListener("end",i),n.addEventListener("error",i),n.start()},stop(){n?.stop()}}}function Vu(){return window.SpeechRecognition??window.webkitSpeechRecognition}var Wu=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Ku(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ia;let t=null,n=null,o=[],a=()=>{for(let i of n?.getTracks()??[])i.stop();n=null};return{isSupported:!0,async start(i,l){try{n=await navigator.mediaDevices.getUserMedia({audio:!0});let s=Gu();t=new MediaRecorder(n,s?{mimeType:s}:void 0),o=[],t.addEventListener("dataavailable",c=>{c.data.size>0&&o.push(c.data)}),t.addEventListener("stop",async()=>{let c=t?.mimeType??"audio/webm";a();let d=new Blob(o,{type:c});o=[];try{let{text:u}=await e(d,c);u&&i(u,!0)}catch{}finally{l()}}),t.start()}catch{a(),l()}},stop(){t?.stop()}}}function Gu(){for(let e of Wu)if(MediaRecorder.isTypeSupported(e))return e}var Be=S.cssPrefix,Ct=W.scope("composer");function Kt(e){return e.reduce((t,n)=>t+n.size,0)}var ju={arrowUp:Ls,paperPlane:Ms,send:Os,chevron:Wt};function hl({options:e,transport:t,feedback:n,bus:o,isStreaming:a,operatorRequestEnabled:i,controlMode:l,onRequestOperator:s,onSend:c,onStop:d,attachApiRef:u}){let f=e.strings,[_,g]=R(""),[h,P]=R([]),[m,b]=R(!1),w=F(null),v=F(null),k=e.features.fileUpload,$=e.features.voice,[Q,J]=R(()=>sa($,e.locale,(L,z)=>t.transcribe(L,z)));T(()=>{m||$==="disabled"||J(sa($,e.locale,(L,z)=>t.transcribe(L,z)))},[e.locale,$,t,m]),T(()=>{let L=w.current;if(!L)return;let z=L.getRootNode(),Z="activeElement"in z?z.activeElement:null;Z&&L.closest(`.${Be}-panel`)?.contains(Z)||L.focus({preventScroll:!0})},[]),T(()=>{let L=w.current;if(!L)return;if(_.length===0){L.style.height="";return}L.style.height="auto";let z=parseFloat(getComputedStyle(L).fontSize)*.7,Z=Math.min(L.scrollHeight,160);L.style.height=`${Z<40+z?40:Z}px`},[_]);let ae=F(h);ae.current=h,T(()=>()=>ae.current.forEach(aa),[]),T(()=>{if(u)return u.current={attachFromDrop:L=>{let z=Uo(L,ae.current,e.attachments);z.accepted.length!==0&&(Ct.info("attach (drop)",{count:z.accepted.length,totalBytes:Kt(z.accepted)}),o.emit("attach",{count:z.accepted.length,totalBytes:Kt(z.accepted)}),P(Z=>[...Z,...z.accepted]))},fill:L=>{g(L);let z=w.current;z&&(z.focus({preventScroll:!0}),requestAnimationFrame(()=>z.setSelectionRange(z.value.length,z.value.length)))}},()=>{u.current&&(u.current=null)}},[u,e.attachments]),T(()=>{let L=w.current;if(!L)return;let z=L.closest(`.${Be}-panel`);if(!z)return;let Z=he=>{let Ge=he.clipboardData;if(!Ge)return;let Oe=he.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(Oe&&Oe!==L)return;if(k){let Re=Uo(Ge.items,ae.current,e.attachments);if(Re.accepted.length>0){he.preventDefault(),Ct.info("attach (paste)",{count:Re.accepted.length,totalBytes:Kt(Re.accepted)}),o.emit("attach",{count:Re.accepted.length,totalBytes:Kt(Re.accepted)}),P(qe=>[...qe,...Re.accepted]);return}}if(Oe===L)return;let je=Ge.getData("text/plain");je&&(he.preventDefault(),g(Re=>Re+je),L.focus())};return z.addEventListener("paste",Z),()=>z.removeEventListener("paste",Z)},[k,e.attachments,Be]);let oe=()=>{let L=_.trim();!L&&h.length===0||a||(c(L,h),g(""),P([]))},N=L=>{L.key!=="Enter"||L.shiftKey||L.isComposing||(L.preventDefault(),a?d():oe())},O=L=>{let z=L.target,Z=Uo(z.files,h,e.attachments);Z.accepted.length>0&&(Ct.info("attach (file picker)",{count:Z.accepted.length,totalBytes:Kt(Z.accepted)}),o.emit("attach",{count:Z.accepted.length,totalBytes:Kt(Z.accepted)}),P(he=>[...he,...Z.accepted])),z.value=""},j=L=>{Ct.info("removeAttachment",{id:L}),o.emit("removeAttachment",{id:L}),P(z=>{let Z=z.find(he=>he.id===L);return Z&&aa(Z),z.filter(he=>he.id!==L)})},H=F(null),He=()=>{if(Q.isSupported){if(m){let L=H.current?Date.now()-H.current:0;Ct.info("voiceStop",{durationMs:L}),o.emit("voiceStop",{durationMs:L}),Q.stop(),b(!1),n.play("voiceStop"),H.current=null;return}H.current=Date.now(),Ct.info("voiceStart"),o.emit("voiceStart",void 0),b(!0),n.play("voiceStart"),Q.start((L,z)=>g(Z=>z?`${Z}${L} `:Z),()=>{if(b(!1),H.current){let L=Date.now()-H.current;Ct.debug("voiceStop (auto)",{durationMs:L}),o.emit("voiceStop",{durationMs:L}),H.current=null}})}},ue=ju[e.composer.sendButton.icon];return r("div",{class:`${Be}-composer`,"data-testid":C.composer,children:[h.length>0?r("div",{class:`${Be}-attachments`,children:h.map(L=>r(gl,{attachment:L,onRemove:()=>j(L.id)},L.id))}):null,r("div",{class:`${Be}-composer-row`,children:[r("div",{class:`${Be}-composer-actions`,children:[k?r("button",{type:"button",class:`${Be}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":f.attach,"data-testid":C.composerAttach,children:r(Ds,{})}):null,Q.isSupported?r("button",{type:"button",class:`${Be}-icon-btn`,onClick:He,"aria-label":m?f.micStop:f.micStart,"aria-pressed":m,"data-recording":m?"true":void 0,"data-testid":C.composerVoice,children:r($s,{})}):null,i&&l==="ai-agent"&&s?r("button",{type:"button",class:`${Be}-icon-btn`,onClick:s,"aria-label":f.talkToOperator,title:f.talkToOperator,"data-testid":C.operatorRequest,children:r(na,{})}):null]}),r("textarea",{ref:w,class:`${Be}-textarea`,rows:1,value:_,placeholder:f.composerPlaceholder,onInput:L=>g(L.target.value),onKeyDown:N,"aria-label":f.composerPlaceholder,"data-testid":C.composerInput}),a?r("button",{type:"button",class:`${Be}-send`,onClick:d,"aria-label":f.stop,"data-testid":C.composerStop,children:r(Ns,{})}):r("button",{type:"button",class:`${Be}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:oe,disabled:!_.trim()&&h.length===0,"aria-label":f.send,"data-testid":C.composerSend,children:r(ue,{})})]}),r("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:O,class:`${Be}-sr-only`,"data-testid":C.composerFileInput})]})}var Xu=S.cssPrefix;function vl({visible:e,strings:t}){return e?r("div",{class:`${Xu}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function qo({containerRef:e,onDrop:t}){let[n,o]=R(!1);return T(()=>{let a=e.current;if(!a)return;let i=0,l=u=>{i+=1,u.dataTransfer?.types.includes("Files")&&(u.preventDefault(),o(!0))},s=()=>{i-=1,!(i>0)&&(i=0,o(!1))},c=u=>{u.dataTransfer?.types.includes("Files")&&u.preventDefault()},d=u=>{i=0,o(!1),u.dataTransfer&&(u.preventDefault(),t(u.dataTransfer.items))};return a.addEventListener("dragenter",l),a.addEventListener("dragleave",s),a.addEventListener("dragover",c),a.addEventListener("drop",d),()=>{a.removeEventListener("dragenter",l),a.removeEventListener("dragleave",s),a.removeEventListener("dragover",c),a.removeEventListener("drop",d)}},[e,t]),{visible:n}}function bl({itemCount:e,initialFocusIndex:t}){let[n,o]=R(!1),a=F(null),i=F(null),[l,s]=R(-1),c=D(()=>{o(!1),s(-1),a.current?.focus()},[]),d=D(()=>o(_=>!_),[]);T(()=>{if(!n)return;let _=g=>{let h=i.current,P=a.current;if(!h||!P)return;let m=g.composedPath();m.includes(h)||m.includes(P)||(o(!1),s(-1))};return document.addEventListener("click",_,!0),()=>document.removeEventListener("click",_,!0)},[n]),T(()=>{if(!n||e===0)return;let _=t?.()??0,g=_<0||_>=e?0:_;s(g)},[n,e,t]),T(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let u=D(_=>{(_.key==="ArrowDown"||_.key==="Enter"||_.key===" ")&&(_.preventDefault(),o(!0))},[]),f=D(_=>{if(e!==0)switch(_.key){case"Escape":_.preventDefault(),c();return;case"ArrowDown":_.preventDefault(),s(g=>(g+1)%e);return;case"ArrowUp":_.preventDefault(),s(g=>(g-1+e)%e);return;case"Home":_.preventDefault(),s(0);return;case"End":_.preventDefault(),s(e-1)}},[e,c]);return{open:n,focusIndex:l,triggerRef:a,menuRef:i,toggle:d,close:c,onTriggerKey:u,onMenuKey:f}}function yl({items:e,triggerLabel:t}){let n=S.cssPrefix,o=bl({itemCount:e.length}),a=s=>{s.disabled||(s.onSelect?.(),s.keepOpen||o.close())},i=(s,c)=>s.onSelectValue?.(c),l=(s,c)=>{let d=c.segments;if(!d?.length)return;let u=Math.max(0,d.findIndex(_=>_.value===c.value)),f=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")f=(u+1)%d.length;else if(s.key==="ArrowLeft")f=(u-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[f].value)};return r("div",{class:`${n}-menu-wrap`,children:[r("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:r(qs,{})}),o.open?r("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(s=>s.segments?r("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":s.label,tabIndex:-1,onKeyDown:c=>l(c,s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),r("span",{class:`${n}-segmented`,role:"group","aria-label":s.label,children:s.segments.map(c=>{let d=c.value===s.value;return r("button",{type:"button",role:"menuitemradio","aria-checked":d,class:`${n}-segment`,"data-on":d?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${C.langSegment}-${c.value}`,onClick:()=>i(s,c.value),children:c.label},c.value)})})]},s.id):r("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":s.type==="switch"?s.on:void 0,disabled:s.disabled,onClick:()=>a(s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),s.type==="switch"&&s.on?r("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:r(St,{})}):null]},s.id))}):null]})}var la=S.cssPrefix;function Yu(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 Ju={normal:"large",large:"small",small:"normal"};function Qu(e){return e==="light"?r(tl,{}):e==="dark"?r(nl,{}):r(ol,{})}function Zu(e){return(e.split("-")[0]??e).toUpperCase()}function et({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:a,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:u,onLocaleChange:f,onThemeChange:_,onTextSizeChange:g}=e,h=n.strings,P=n.mode,m=t==="chat",b=ee(()=>a.mutedSig.value).value,w=new Set(n.actions),v=H=>w.has(H),k=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,$=H=>k?!1:kn(H,P,o),Q=n.themeMode,J={auto:h.themeAuto,light:h.themeLight,dark:h.themeDark},ae=n.textSize,oe={small:h.textSizeSmall,normal:h.textSizeNormal,large:h.textSizeLarge},N=[];if(m&&v("clear")&&N.push({id:"clear",icon:r(Ys,{}),label:h.newConversation,onSelect:l}),v("expand")&&$("expand")){let H=o==="expanded";N.push({id:"expand",icon:H?r(Bs,{}):r(Fs,{}),label:H?h.collapse:h.expand,type:"switch",on:H,onSelect:s})}if(v("fullscreen")&&$("fullscreen")){let H=o==="fullscreen";N.push({id:"fullscreen",icon:H?r(zs,{}):r(Hs,{}),label:H?h.exitFullscreen:h.fullscreen,type:"switch",on:H,onSelect:c})}m&&v("sound")&&N.push({id:"sound",icon:b?r(Ws,{}):r(Vs,{}),label:b?h.soundOff:h.soundOn,type:"switch",on:!b,onSelect:d}),v("theme")&&N.push({id:"theme",icon:Qu(Q),label:`${h.theme}: ${J[Q]}`,onSelect:()=>_(Yu(Q)),keepOpen:!0}),v("textSize")&&N.push({id:"textSize",icon:r(Ks,{}),label:`${h.textSize}: ${oe[ae]}`,onSelect:()=>g(Ju[ae]),keepOpen:!0}),v("language")&&n.availableLocales.length>1&&N.push({id:"language",icon:r(Xs,{}),label:h.language,segments:n.availableLocales.map(H=>({value:H,label:Zu(H),lang:H})),value:n.locale,onSelectValue:f});let O=!!i&&Bo(P,o,n.actions),j=m&&v("history");return r("div",{class:`${la}-header-actions`,children:[j?r("button",{type:"button",class:`${la}-icon-btn`,onClick:u,"aria-label":h.history,title:h.history,"data-testid":C.actionHistory,children:r(js,{})}):null,N.length>0?r(yl,{items:N,triggerLabel:h.moreActions}):null,O?r("button",{type:"button",class:`${la}-icon-btn`,onClick:i,"aria-label":h.close,title:h.close,"data-testid":C.actionClose,children:r(Ze,{})}):null]})}var ep=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,tp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,np=/^[+]?[\d\s().-]{6,}$/;function Gt(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function op(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function rp(e,t,n){let o=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=op(t);return o&&l===0?n.formRequired:l===0?void 0:a?.minSelections!=null&&l<a.minSelections?Gt(n.formChooseAtLeast,{min:a.minSelections}):a?.maxSelections!=null&&l>a.maxSelections?Gt(n.formChooseAtMost,{max:a.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return o?n.formRequired:void 0;switch(e.type){case"email":if(!ep.test(i))return n.formInvalidEmail;break;case"url":if(!tp.test(i))return n.formInvalidUrl;break;case"tel":if(!np.test(i))return n.formInvalidTel;break;case"number":{let l=Number(i);if(!Number.isFinite(l))return n.formInvalidNumber;if(a?.min!=null&&l<a.min)return Gt(n.formNumberTooSmall,{min:a.min});if(a?.max!=null&&l>a.max)return Gt(n.formNumberTooLarge,{max:a.max});break}default:break}if(a?.minLength!=null&&i.length<a.minLength)return Gt(n.formTooShort,{min:a.minLength});if(a?.maxLength!=null&&i.length>a.maxLength)return Gt(n.formTooLong,{max:a.maxLength});if(a?.pattern)try{if(!new RegExp(a.pattern).test(i))return n.formPatternMismatch}catch{}}function Pl(e,t,n){let o={};for(let a of e){let i=rp(a,t[a.name],n);i&&(o[a.name]=i)}return o}function xl(e){let t={};for(let[n,o]of Object.entries(e)){let a=Array.isArray(o)?o.join(", "):o;a&&a.trim()&&(t[n]=a.trim())}return t}var de=S.cssPrefix,Vo="__other__";function Cn({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,initialValues:d,hideActions:u,fieldTypeLabels:f,rootTestId:_,submitTestId:g,skipTestId:h}){let[P,m]=R(()=>({...lp(e),...d})),[b,w]=R({}),[v,k]=R({}),$=N=>{v[N]&&k(O=>({...O,[N]:""}))},Q=(N,O)=>{m(j=>({...j,[N]:O})),$(N)},J=(N,O)=>{w(j=>({...j,[N]:O})),$(N)},ae=N=>{if(N.preventDefault(),c)return;let O=cp(e,P,b),j=Pl(e,O,t);if(Object.keys(j).length>0){k(j);return}o(xl(O))},oe=N=>{!s||N.key!=="Enter"||N.shiftKey||N.isComposing||N.target?.tagName==="TEXTAREA"&&ae(N)};return r("form",{class:`${de}-form`,onSubmit:ae,onKeyDown:oe,"data-testid":_,noValidate:!0,children:[e.map(N=>r(ap,{field:N,value:P[N.name],otherText:b[N.name]??"",error:v[N.name],disabled:c,typeLabel:f?.[N.name],strings:t,onChange:O=>Q(N.name,O),onOtherChange:O=>J(N.name,O)},N.name)),u?null:r("div",{class:`${de}-form-actions`,children:[l?r("span",{class:`${de}-form-hint`,children:l}):null,a&&i?r("button",{type:"button",class:`${de}-form-skip`,onClick:i,disabled:c,"data-testid":h,children:a}):null,r("button",{type:"submit",class:`${de}-form-submit`,disabled:c,"data-testid":g,children:n})]})]})}function ap({field:e,value:t,otherText:n,error:o,disabled:a,typeLabel:i,strings:l,onChange:s,onOtherChange:c}){let d=Ce(C.formField,e.name),u=ip({field:e,value:t,otherText:n,disabled:a,strings:l,onChange:s,onOtherChange:c,fieldTid:d});return r("label",{class:`${de}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[r("span",{class:`${de}-field-head`,children:[r("span",{class:`${de}-field-label`,children:[e.label,e.required??!0?r("span",{class:`${de}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?r("span",{class:`${de}-field-type`,children:i}):null]}),u,e.validationHint&&!o?r("span",{class:`${de}-field-hint`,children:e.validationHint}):null,o?r("span",{class:`${de}-field-error`,role:"alert",children:o}):null]})}function ip(e){let{field:t,value:n,otherText:o,disabled:a,strings:i,onChange:l,onOtherChange:s,fieldTid:c}=e,d=typeof n=="string"?n:"";switch(t.type){case"textarea":return r("textarea",{class:`${de}-field-input`,rows:3,value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c});case"select":return r("select",{class:`${de}-field-input`,value:d,disabled:a,onChange:u=>l(u.target.value),"data-testid":c,children:[r("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(u=>r("option",{value:u.value,children:u.label??u.value},u.value))]});case"radio":{let u=t.allowOther&&d===Vo;return r("div",{class:`${de}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(f=>r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===f.value,disabled:a,onChange:()=>l(f.value)}),r("span",{children:f.label??f.value})]},f.value)),t.allowOther?r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===Vo,disabled:a,onChange:()=>l(Vo)}),r("span",{children:i.formOther})]}):null,u?r("input",{class:`${de}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:f=>s(f.target.value)}):null]})}case"checkbox":return r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:d==="true",disabled:a,onChange:u=>l(u.target.checked?"true":""),"data-testid":c}),r("span",{children:t.placeholder??t.label})]});case"multiselect":{let u=Array.isArray(n)?n:[],f=(_,g)=>l(g?[...u,_]:u.filter(h=>h!==_));return r("div",{class:`${de}-field-choices`,"data-testid":c,children:[(t.options??[]).map(_=>r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:u.includes(_.value),disabled:a,onChange:g=>f(_.value,g.target.checked)}),r("span",{children:_.label??_.value})]},_.value)),t.allowOther||(t.options??[]).length===0?r("textarea",{class:`${de}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:_=>s(_.target.value)}):null]})}default:return r("input",{class:`${de}-field-input`,type:sp(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c})}}function sp(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function lp(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 cp(e,t,n){let o={...t};for(let a of e){let i=n[a.name]?.trim();if(a.type==="radio"&&a.allowOther&&t[a.name]===Vo)o[a.name]=i??"";else if(a.type==="multiselect"&&i){let l=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),s=Array.isArray(t[a.name])?t[a.name]:[];o[a.name]=[...s,...l]}}return o}var tt=S.cssPrefix;function ca({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${tt}-form-gate`,"data-testid":C.formGate,children:[e.title?r("h3",{class:`${tt}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${tt}-form-gate-desc`,children:e.description}):null,r(Cn,{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:C.formSubmit,skipTestId:C.formSkip})]})}function Sl({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",a=o?t.formSkipped:t.formSubmitted,i=e.title?r(se,{children:[r("span",{children:e.title}),r("span",{class:`${tt}-sr-only`,children:a})]}):r("span",{children:a}),l=e.form?.reviewable??!1,s=!o&&l&&e.values&&Object.keys(e.values).length>0?e.values:null;if(s){let c=d=>e.form?.fields.find(u=>u.name===d)?.label??d;return r("details",{class:`${tt}-form-done`,"data-outcome":e.outcome,"data-testid":C.formDone,children:[r("summary",{class:`${tt}-form-done-summary`,"data-testid":C.formDoneToggle,children:[r(St,{}),i,r(Wt,{})]}),r("dl",{class:`${tt}-form-answers`,"data-testid":C.formAnswers,children:Object.entries(s).map(([d,u])=>r("div",{class:`${tt}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:u})]},d))})]})}return r("div",{class:`${tt}-form-done`,"data-outcome":e.outcome,"data-testid":C.formDone,role:"status",children:[o?r(Gs,{}):r(St,{}),i,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${tt}-form-done-fill`,"data-testid":C.formFill,onClick:n,children:t.formFillOut}):null]})}function kl(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var ua=1,Cl=2,Tl=4,El=8,Rl=16;function dp(e){switch(e){case ua:return"href";case Cl:return"src";case Tl:return"class";case El:return"checked";case Rl:return"start"}}var _p=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}},up=_p;var wl=24;function ma(e){let t=new Uint32Array(wl);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(wl),indent:"",indent_len:0,table_state:0}}function Il(e){e.pending.length>0&&Ie(e,`
|
|
12
|
+
`)}function re(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 ge(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 ie(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&ge(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function pp(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function Tt(e,t){for(e.fence_start=0;e.len>t;)ge(e)}function Wo(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;)ge(e);return t}function da(e,t){let n=-1,o=-1;for(let a=e.blockquote_idx+1;a<=e.len;a+=1)if(e.tokens[a]===25){if(e.indent_len<e.spaces[a]){o=-1;break}o=a}else e.tokens[a]===t&&(n=a);return o===-1?n===-1?(Tt(e,e.blockquote_idx),ie(e,t),!0):(Tt(e,n),!1):(Tt(e,o),ie(e,t),!0)}function _a(e,t){ie(e,25),e.spaces[e.len]=e.indent_len+t,lt(e),e.token=103}function lt(e){e.indent="",e.indent_len=0,e.pending=""}function pa(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 mp(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 fp(e){return pa(e)||mp(e)}function Ie(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 a=Wo(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],a>0&&Ie(e," ".repeat(a))}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){ge(e),lt(e),e.pending=n;continue}Tt(e,e.blockquote_idx),lt(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" ":Wo(e,e.indent_len),ie(e,up(e.pending.length)),lt(e);continue}break;case">":{let i=pp(e,20,e.blockquote_idx+1);i===-1?(Tt(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,ie(e,20)):e.blockquote_idx=i,lt(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;Wo(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),lt(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){da(e,23),_a(e,2),Ie(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):(ie(e,2),lt(e),e.fence_start=0,Ie(e,o));continue;case`
|
|
15
|
+
`:{Wo(e,e.indent_len),ie(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,Tl,e.pending.slice(e.fence_start)),lt(e),e.token=101;continue}default:e.pending=o;continue}case"+":if(n!==" ")break;da(e,23),_a(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;da(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,Rl,e.pending.slice(0,-1)),_a(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||pa(i)){e.pending=o;continue}}break;case"|":Tt(e,e.blockquote_idx),ie(e,27),ie(e,28),e.pending="",Ie(e,n);continue}let a=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}a=e.indent.slice(i)+o,ie(e,9)}else ie(e,2);lt(e),Ie(e,a);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:ge(e),e.table_state=0;break}else switch(e.pending){case"|":ie(e,28),e.pending="",Ie(e,n);continue;case`
|
|
17
|
+
`:ge(e),e.pending="",e.table_state=0,Ie(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":ie(e,29),ge(e),e.pending="",Ie(e,n);continue;case`
|
|
18
|
+
`:ge(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Ie(e,n);continue;default:ie(e,29),Ie(e,n);continue}break;case 29:if(e.pending==="|"){re(e),ge(e),e.pending="",Ie(e,n);continue}break;case 9:switch(o){case`
|
|
19
19
|
`:case`
|
|
20
20
|
`:case`
|
|
21
21
|
`:case`
|
|
@@ -25,18 +25,18 @@ ${a}`:a;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(t==="[DONE]")retu
|
|
|
25
25
|
`:case`
|
|
26
26
|
`:case`
|
|
27
27
|
`:case`
|
|
28
|
-
`:e.pending=o;continue;default:e.pending.length!==0?(
|
|
29
|
-
`:if(o.length===e.fence_start+e.fence_end+1){
|
|
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]===" ")?(
|
|
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 a=n.charCodeAt(0);e.pending="",e.text+=
|
|
35
|
-
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:
|
|
28
|
+
`:e.pending=o;continue;default:e.pending.length!==0?(re(e),ge(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){re(e),ge(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]===" ")?(re(e),ge(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,re(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,El,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Ie(e,o);continue;case 14:case 15:{let i="*",l=12;if(e.token===15&&(i="_",l=13),i===e.pending){if(re(e),i===n){ge(e),e.pending="";continue}ie(e,l),e.pending=n;continue}break}case 12:case 13:{let i="*",l=14;switch(e.token===13&&(i="_",l=15),e.pending){case i:i===n?e.tokens[e.len-1]===l?e.pending=o:(re(e),ie(e,l),e.pending=""):(re(e),ge(e),e.pending=n);continue;case i+i:let s=e.token;re(e),ge(e),ge(e),i!==n?(ie(e,s),e.pending=n):e.pending="";continue}break}case 16:if(o==="~~"){re(e),ge(e),e.pending="";continue}break;case 105:n===`
|
|
32
|
+
`?(re(e),ie(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Ie(e,n));continue;case 30:if(o==="\\]"||o==="$$"){re(e),ge(e),e.pending="";continue}break;case 31:if(o==="\\)"||e.pending[0]==="$"){re(e),ge(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:o==="http://"||o==="https://"?(re(e),ie(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],Ie(e,n));continue;case 17:case 19:if(e.pending==="]"){re(e),n==="("?e.pending=o:(ge(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?ua:Cl,l=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,l),ge(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
|
|
33
|
+
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,ua,e.pending),re(e),ge(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===">"){re(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),Ie(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":re(e),ie(e,31),e.pending="";continue;case"[":e.token=105,e.pending=o;continue;case`
|
|
34
|
+
`:e.pending=n;continue;default:let a=n.charCodeAt(0);e.pending="",e.text+=pa(a)||a>=65&&a<=90||a>=97&&a<=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:re(e),Tt(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:re(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){re(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,re(e),ie(e,11),e.text=n===" "||n===`
|
|
36
36
|
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let a=12,i=14,l=e.pending[0];if(l==="_"&&(a=13,i=15),e.pending.length===1){if(l===n){e.pending=o;continue}if(n!==" "&&n!==`
|
|
37
|
-
`){
|
|
38
|
-
`){
|
|
39
|
-
`){oe(e),ie(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(pp(n.charCodeAt(0)))break;oe(e),ie(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){oe(e),ie(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){oe(e),ie(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}oe(e)}function pa(e){return{add_token:mp,end_token:fp,add_text:gp,set_attr:hp,data:{nodes:[e,,,,,],index:0}}}function mp(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 a=o=document.createElement("input");a.type="checkbox",a.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 fp(e){e.index-=1}function gp(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function hp(e,t,n){e.nodes[e.index].setAttribute(lp(t),n)}function Vo({textSig:e,doneSig:t}){let n=F(null);return bt(()=>{let o=n.current;if(!o)return;o.classList.add(`${S.cssPrefix}-md`);let a=pa(o),i=ua(a),l=0,s=it(()=>{let u=e.value,f=t.value;u.length<l&&(o.replaceChildren(),a=pa(o),i=ua(a),l=0);let _=u.slice(l);_&&Ie(i,_),l=u.length,f&&El(i)}),c=new MutationObserver(u=>{for(let f of u)for(let _ of f.addedNodes){if(!(_ instanceof HTMLElement))continue;let g=_.matches?.("a")?[_]:[..._.querySelectorAll?.("a")??[]];for(let h of g)Rl(h)}});c.observe(o,{childList:!0,subtree:!0});for(let u of o.querySelectorAll("a"))Rl(u);let d=u=>{let f=u.target?.closest?.("a");if(!f||!(f instanceof HTMLAnchorElement))return;let _=f.getAttribute("href")??"";!_||_.startsWith("#")||(u.preventDefault(),window.open(_,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),r("div",{ref:n})}function Il({text:e}){let t=Le(()=>U(e),[e]),n=Le(()=>U(!0),[]);return r(Vo,{textSig:t,doneSig:n})}function Rl(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 Wo=S.cssPrefix;function Al({messageId:e,initial:t,strings:n,onFeedback:o}){let[a,i]=R(t),l=s=>{let c=a===s?null:s;i(c),o(e,c)};return r("div",{class:`${Wo}-feedback`,role:"group","data-testid":C.messageFeedback,children:[r("button",{type:"button",class:`${Wo}-msg-action`,"data-active":a==="up"?"true":void 0,"aria-pressed":a==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>l("up"),"data-testid":C.feedbackUp,children:r(ol,{})}),r("button",{type:"button",class:`${Wo}-msg-action`,"data-active":a==="down"?"true":void 0,"aria-pressed":a==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>l("down"),"data-testid":C.feedbackDown,children:r(rl,{})}),r("span",{class:`${Wo}-sr-only`,role:"status","aria-live":"polite",children:a?n.feedbackThanks:""})]})}var Kt=S.cssPrefix;function Ml({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${Kt}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":C.source,children:[r("span",{class:`${Kt}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${Kt}-source-label`,children:n})]}):r("span",{class:`${Kt}-source`,"data-testid":C.source,children:[r("span",{class:`${Kt}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${Kt}-source-label`,children:n})]})}var Ve=S.cssPrefix;function fa(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function Go(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 ga({status:e,icon:t,label:n}){return r("span",{class:`${Ve}-toolui-badge ${Ve}-toolui-status`,"data-status":e,children:[r("span",{class:`${Ve}-toolui-status-icon`,children:t}),n]})}function bp(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 yp({status:e}){return e==="denied"||e==="error"||e==="superseded"?r(Lo,{}):e==="completed"||e==="responded"?r(Mo,{}):r(il,{})}function Pp(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 xp({state:e,approval:t,strings:n,superseded:o}){let a=bp(e,t),i=o&&(a==="awaiting"||a==="running")?"superseded":a;return r(ga,{status:i,icon:r(yp,{status:i}),label:Pp(i,n)})}function Sp({name:e,state:t,approval:n,strings:o,superseded:a}){return r(se,{children:[r("span",{class:`${Ve}-toolui-name-pill`,children:[r(al,{}),r("span",{class:`${Ve}-toolui-name-text`,children:e})]}),r(xp,{state:t,approval:n,strings:o,superseded:a}),r("span",{class:`${Ve}-toolui-chevron`,children:r(St,{})})]})}function Ko({part:e,strings:t,testid:n,superseded:o}){let a=Z(()=>e.inputSig.value),i=Z(()=>e.outputSig.value),l=Z(()=>e.errorSig.value),s=Z(()=>e.stateSig.value),c=Z(()=>e.approvalSig.value);return r("details",{class:`${Ve}-toolui ${Ve}-toolui-collapsible`,"data-testid":n,children:[r("summary",{class:`${Ve}-toolui-head`,children:r(Sp,{name:fa(e.toolName),state:s.value,approval:c.value,strings:t,superseded:o})}),r(ma,{label:t.toolParameters,value:a.value}),i.value!==void 0?r(ma,{label:t.toolResult,value:i.value}):null,l.value?r(ma,{label:t.statusError,value:l.value,error:!0}):null]})}function ma({label:e,value:t,error:n}){let o=n?String(t??""):jo(ha(t));return o?r("div",{class:`${Ve}-toolui-section`,children:[r("span",{class:`${Ve}-toolui-label`,children:e}),r("pre",{class:`${Ve}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function ha(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function jo(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""}}var Ue=S.cssPrefix;function Ll({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=Z(()=>e.approvalSig.value),s=Z(()=>e.stateSig.value),c=fa(e.toolName),d=l.value?.approved,{terminal:u,responded:f,decided:_}=Go(s.value,l.value),g=f&&n&&!u,h=o&&!_,P=e.toolCallId;return r("div",{class:`${Ue}-toolui-group`,"data-testid":_?C.toolDecision:C.toolApproval,children:[r(Ko,{part:e,strings:t,superseded:h}),h||u?null:r("div",{class:`${Ue}-toolui ${Ue}-toolui-body`,children:[f?r(se,{children:[r("p",{class:`${Ue}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",d?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),g?r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalEditHint}):null,!g&&!u?r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(se,{children:[r("p",{class:`${Ue}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",c)}),r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalBody})]}),!_&&!o?r("div",{class:`${Ue}-toolui-actions`,children:[r("button",{type:"button",class:`${Ue}-form-skip`,onClick:()=>a(P,!1),"data-testid":C.toolReject,children:t.reject}),r("button",{type:"button",class:`${Ue}-form-submit`,onClick:()=>a(P,!0),"data-testid":C.toolApprove,children:t.approve})]}):null,g?r("div",{class:`${Ue}-toolui-actions`,children:r("button",{type:"button",class:`${Ue}-form-skip`,onClick:()=>i(P),"data-testid":C.toolEdit,children:t.edit})}):null]})]})}var kp=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Ol(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(wp).filter(a=>a!==null);return{intro:Xo(t.intro),questions:o}}function wp(e,t){if(!e||typeof e!="object")return null;let n=e,o=kp.has(n.type)?n.type:"text";return{key:Xo(n.key)??`q${t+1}`,question:Xo(n.question)??"Please provide the missing information.",type:o,options:Array.isArray(n.options)?n.options.filter(a=>typeof a=="string"&&a.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:Xo(n.helpText)}}function Cp(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 va(e,t,n){return e.questions.map(o=>{let a=Cp(o.type),i=o.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(o.options??[]).map(l=>({value:l,label:l}));return{name:o.key,label:o.question,type:a,required:o.required??!1,options:i.length>0?i:void 0,validationHint:o.helpText}})}function Xo(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var Se=S.cssPrefix,Tp={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Nl(e,t){let n={};for(let o of e)n[o.key]=t[Tp[o.type]];return n}function Dl({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=Z(()=>e.stateSig.value).value,s=Z(()=>e.approvalSig.value).value,c=Z(()=>Ol(e.inputSig.value)).value,{terminal:d,decided:u}=Go(l,s),f=u&&s?.approved===!0,_=!u&&!o,g=!_&&!f,h=f&&n&&!d,P=c.questions,[m,b]=R(null),v=m??(_||f),[k,$]=R(!1),J=P.length>1?Qr:xn,Y=_?t.inputRequired:t.inputBadge,re=_?r(Ep,{req:c,strings:t,resolve:(ne,N)=>a(e.toolCallId,N,ne)}):k?r(Cn,{fields:va(c,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Nl(P,t),initialValues:f?Lp(P,s?.reason):void 0}):r(Rp,{questions:P,answers:f?Mp(s?.reason):{},strings:t});return r("details",{class:`${Se}-toolui ${Se}-toolui-collapsible${o?` ${Se}-toolui-stale`:""}`,open:v,onToggle:ne=>{let N=ne.currentTarget.open;N!==v&&b(N)},"data-testid":_?C.toolAskQuestions:C.toolDecision,children:[r("summary",{class:`${Se}-toolui-head`,children:[r("span",{class:`${Se}-toolui-q-pill`,children:[r(J,{}),Y]}),r("span",{class:`${Se}-toolui-head-end`,children:[_?null:r(ga,{status:g?"superseded":"completed",icon:g?r(Lo,{}):r(Mo,{}),label:g?t.inputSkipped:t.inputAnswered}),r("span",{class:`${Se}-toolui-chevron`,children:r(St,{})})]})]}),r("div",{class:`${Se}-toolui-collapse-body`,children:[c.intro?r("div",{class:`${Se}-toolui-desc`,children:c.intro}):null,re,_?null:r("div",{class:`${Se}-toolui-footer`,children:[r("button",{type:"button",class:`${Se}-toolui-options-toggle`,onClick:()=>$(ne=>!ne),"data-testid":C.toolAskOptions,children:[r("span",{class:`${Se}-toolui-options-chevron${k?` ${Se}-open`:""}`,children:r(St,{})}),k?t.hideOptions:t.showOptions]}),h?r("button",{type:"button",class:`${Se}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":C.toolEdit,children:t.edit}):null]})]})]})}function Ep({req:e,strings:t,resolve:n}){let o=va(e,t.confirmYes,t.confirmNo),a=e.questions.length===1&&e.questions[0]?.type==="text";return r(Cn,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:a?t.inputSubmitHint:void 0,onSubmit:i=>n(Ap(e.questions,i),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:a,fieldTypeLabels:Nl(e.questions,t),submitTestId:C.toolInputSubmit,skipTestId:C.toolInputSkip})}function Rp({questions:e,answers:t,strings:n}){return r("div",{class:`${Se}-toolui-summary`,"data-testid":C.toolAskSummary,children:e.map(o=>r("div",{class:`${Se}-field`,children:[r("span",{class:`${Se}-field-head`,children:r("span",{class:`${Se}-field-label`,children:[o.question,o.required?r("span",{class:`${Se}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),r("p",{class:`${Se}-toolui-answer`,children:Ip(o,t[o.key],n)||"\u2014"})]},o.key))})}function Ip(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Ap(e,t){let n=e.flatMap(o=>{let a=t[o.key];if(a==null||a.trim()==="")return[];let i=o.type==="multi-select"?a.split(",").map(l=>l.trim()).filter(Boolean):a;return[{key:o.key,value:i}]});return JSON.stringify({answers:n})}function $l(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let o={};for(let a of n)if(a&&typeof a=="object"&&"key"in a){let{key:i,value:l}=a;if(typeof i!="string")continue;typeof l=="string"?o[i]=l:Array.isArray(l)&&(o[i]=l.filter(s=>typeof s=="string"))}return o}function Mp(e){let t=$l(e),n={};for(let[o,a]of Object.entries(t))n[o]=Array.isArray(a)?a.join(", "):a;return n}function Lp(e,t){let n=$l(t),o={};for(let a of e){let i=n[a.key];i!==void 0&&(a.type==="multi-select"?o[a.key]=Array.isArray(i)?i:[i]:o[a.key]=Array.isArray(i)?i[0]??"":i)}return o}function Fl({part:e,strings:t}){let n=Z(()=>e.inputSig.value),o=Z(()=>e.outputSig.value),a=Z(()=>e.errorSig.value);return Z(()=>!!jo(n.value)||!!a.value||!!jo(ha(o.value))).value?r(Ko,{part:e,strings:t,testid:C.toolCall}):null}var Te=S.cssPrefix;function Bl({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d,enableMessageFeedback:u=!1,onFeedback:f,controlMode:_}){let h=Z(()=>e.partsSig.value).value,P=Z(()=>st(e)),m=Z(()=>bs(e)),b=Z(()=>e.partsSig.value.some(ue=>ue.kind==="text"&&ue.textSig.value.length>0)),w=Z(()=>o&&e.partsSig.value.some(ue=>ue.kind==="reasoning")),v=Z(()=>{let ue=e.partsSig.value,L=-1;for(let z=0;z<ue.length;z++){let Q=ue[z]?.kind;(Q==="text"||Q==="file"||Q==="source")&&(L=z)}return L}),k=_==="awaiting_operator"||_==="operator",$=e.role==="assistant"&&e.status==="streaming"&&!k,J=n==="buffered"&&$,Y=$&&!b.value,re=$&&!J&&!(w.value&&Y);if(m.value)return null;let ne=Np(e.createdAt),N=e.role==="assistant"||e.role==="operator",O=u&&!!f&&!!e.serverMessageId&&N&&!$&&e.status!=="error"&&!P.value,j=h.filter(ue=>ue.kind==="text").map(ue=>ue.textSig.value).join(`
|
|
37
|
+
`){re(e),ie(e,a),e.pending=n;continue}}else{if(l===n){re(e),ie(e,i),ie(e,a),e.pending="";continue}if(n!==" "&&n!==`
|
|
38
|
+
`){re(e),ie(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
|
+
`){re(e),ie(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(fp(n.charCodeAt(0)))break;re(e),ie(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){re(e),ie(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){re(e),ie(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}re(e)}function fa(e){return{add_token:gp,end_token:hp,add_text:vp,set_attr:bp,data:{nodes:[e,,,,,],index:0}}}function gp(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 a=o=document.createElement("input");a.type="checkbox",a.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 hp(e){e.index-=1}function vp(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function bp(e,t,n){e.nodes[e.index].setAttribute(dp(t),n)}function Ko({textSig:e,doneSig:t}){let n=F(null);return yt(()=>{let o=n.current;if(!o)return;o.classList.add(`${S.cssPrefix}-md`);let a=fa(o),i=ma(a),l=0,s=it(()=>{let u=e.value,f=t.value;u.length<l&&(o.replaceChildren(),a=fa(o),i=ma(a),l=0);let _=u.slice(l);_&&Ie(i,_),l=u.length,f&&Il(i)}),c=new MutationObserver(u=>{for(let f of u)for(let _ of f.addedNodes){if(!(_ instanceof HTMLElement))continue;let g=_.matches?.("a")?[_]:[..._.querySelectorAll?.("a")??[]];for(let h of g)Al(h)}});c.observe(o,{childList:!0,subtree:!0});for(let u of o.querySelectorAll("a"))Al(u);let d=u=>{let f=u.target?.closest?.("a");if(!f||!(f instanceof HTMLAnchorElement))return;let _=f.getAttribute("href")??"";!_||_.startsWith("#")||(u.preventDefault(),window.open(_,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),r("div",{ref:n})}function Ml({text:e}){let t=Le(()=>U(e),[e]),n=Le(()=>U(!0),[]);return r(Ko,{textSig:t,doneSig:n})}function Al(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 Go=S.cssPrefix;function Ll({messageId:e,initial:t,strings:n,onFeedback:o}){let[a,i]=R(t),l=s=>{let c=a===s?null:s;i(c),o(e,c)};return r("div",{class:`${Go}-feedback`,role:"group","data-testid":C.messageFeedback,children:[r("button",{type:"button",class:`${Go}-msg-action`,"data-active":a==="up"?"true":void 0,"aria-pressed":a==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>l("up"),"data-testid":C.feedbackUp,children:r(al,{})}),r("button",{type:"button",class:`${Go}-msg-action`,"data-active":a==="down"?"true":void 0,"aria-pressed":a==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>l("down"),"data-testid":C.feedbackDown,children:r(il,{})}),r("span",{class:`${Go}-sr-only`,role:"status","aria-live":"polite",children:a?n.feedbackThanks:""})]})}var jt=S.cssPrefix;function Ol({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${jt}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":C.source,children:[r("span",{class:`${jt}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${jt}-source-label`,children:n})]}):r("span",{class:`${jt}-source`,"data-testid":C.source,children:[r("span",{class:`${jt}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${jt}-source-label`,children:n})]})}var Ve=S.cssPrefix;function ha(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function jo(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 va({status:e,icon:t,label:n}){return r("span",{class:`${Ve}-toolui-badge ${Ve}-toolui-status`,"data-status":e,children:[r("span",{class:`${Ve}-toolui-status-icon`,children:t}),n]})}function Pp(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 xp({status:e}){return e==="denied"||e==="error"||e==="superseded"?r(No,{}):e==="completed"||e==="responded"?r(Oo,{}):r(ll,{})}function Sp(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 kp({state:e,approval:t,strings:n,superseded:o}){let a=Pp(e,t),i=o&&(a==="awaiting"||a==="running")?"superseded":a;return r(va,{status:i,icon:r(xp,{status:i}),label:Sp(i,n)})}function wp({name:e,state:t,approval:n,strings:o,superseded:a}){return r(se,{children:[r("span",{class:`${Ve}-toolui-name-pill`,children:[r(sl,{}),r("span",{class:`${Ve}-toolui-name-text`,children:e})]}),r(kp,{state:t,approval:n,strings:o,superseded:a}),r("span",{class:`${Ve}-toolui-chevron`,children:r(kt,{})})]})}function Xo({part:e,strings:t,testid:n,superseded:o}){let a=ee(()=>e.inputSig.value),i=ee(()=>e.outputSig.value),l=ee(()=>e.errorSig.value),s=ee(()=>e.stateSig.value),c=ee(()=>e.approvalSig.value);return r("details",{class:`${Ve}-toolui ${Ve}-toolui-collapsible`,"data-testid":n,children:[r("summary",{class:`${Ve}-toolui-head`,children:r(wp,{name:ha(e.toolName),state:s.value,approval:c.value,strings:t,superseded:o})}),r(ga,{label:t.toolParameters,value:a.value}),i.value!==void 0?r(ga,{label:t.toolResult,value:i.value}):null,l.value?r(ga,{label:t.statusError,value:l.value,error:!0}):null]})}function ga({label:e,value:t,error:n}){let o=n?String(t??""):Yo(ba(t));return o?r("div",{class:`${Ve}-toolui-section`,children:[r("span",{class:`${Ve}-toolui-label`,children:e}),r("pre",{class:`${Ve}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):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 Yo(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""}}var Ue=S.cssPrefix;function Nl({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=ee(()=>e.approvalSig.value),s=ee(()=>e.stateSig.value),c=ha(e.toolName),d=l.value?.approved,{terminal:u,responded:f,decided:_}=jo(s.value,l.value),g=f&&n&&!u,h=o&&!_,P=e.toolCallId;return r("div",{class:`${Ue}-toolui-group`,"data-testid":_?C.toolDecision:C.toolApproval,children:[r(Xo,{part:e,strings:t,superseded:h}),h||u?null:r("div",{class:`${Ue}-toolui ${Ue}-toolui-body`,children:[f?r(se,{children:[r("p",{class:`${Ue}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",d?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),g?r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalEditHint}):null,!g&&!u?r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(se,{children:[r("p",{class:`${Ue}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",c)}),r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalBody})]}),!_&&!o?r("div",{class:`${Ue}-toolui-actions`,children:[r("button",{type:"button",class:`${Ue}-form-skip`,onClick:()=>a(P,!1),"data-testid":C.toolReject,children:t.reject}),r("button",{type:"button",class:`${Ue}-form-submit`,onClick:()=>a(P,!0),"data-testid":C.toolApprove,children:t.approve})]}):null,g?r("div",{class:`${Ue}-toolui-actions`,children:r("button",{type:"button",class:`${Ue}-form-skip`,onClick:()=>i(P),"data-testid":C.toolEdit,children:t.edit})}):null]})]})}var Cp=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Dl(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(Tp).filter(a=>a!==null);return{intro:Jo(t.intro),questions:o}}function Tp(e,t){if(!e||typeof e!="object")return null;let n=e,o=Cp.has(n.type)?n.type:"text";return{key:Jo(n.key)??`q${t+1}`,question:Jo(n.question)??"Please provide the missing information.",type:o,options:Array.isArray(n.options)?n.options.filter(a=>typeof a=="string"&&a.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:Jo(n.helpText)}}function Ep(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 ya(e,t,n){return e.questions.map(o=>{let a=Ep(o.type),i=o.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(o.options??[]).map(l=>({value:l,label:l}));return{name:o.key,label:o.question,type:a,required:o.required??!1,options:i.length>0?i:void 0,validationHint:o.helpText}})}function Jo(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var Se=S.cssPrefix,Rp={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function $l(e,t){let n={};for(let o of e)n[o.key]=t[Rp[o.type]];return n}function Fl({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=ee(()=>e.stateSig.value).value,s=ee(()=>e.approvalSig.value).value,c=ee(()=>Dl(e.inputSig.value)).value,{terminal:d,decided:u}=jo(l,s),f=u&&s?.approved===!0,_=!u&&!o,g=!_&&!f,h=f&&n&&!d,P=c.questions,[m,b]=R(null),v=m??(_||f),[k,$]=R(!1),Q=P.length>1?ea:xn,J=_?t.inputRequired:t.inputBadge,ae=_?r(Ip,{req:c,strings:t,resolve:(oe,N)=>a(e.toolCallId,N,oe)}):k?r(Cn,{fields:ya(c,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:$l(P,t),initialValues:f?Np(P,s?.reason):void 0}):r(Ap,{questions:P,answers:f?Op(s?.reason):{},strings:t});return r("details",{class:`${Se}-toolui ${Se}-toolui-collapsible${o?` ${Se}-toolui-stale`:""}`,open:v,onToggle:oe=>{let N=oe.currentTarget.open;N!==v&&b(N)},"data-testid":_?C.toolAskQuestions:C.toolDecision,children:[r("summary",{class:`${Se}-toolui-head`,children:[r("span",{class:`${Se}-toolui-q-pill`,children:[r(Q,{}),J]}),r("span",{class:`${Se}-toolui-head-end`,children:[_?null:r(va,{status:g?"superseded":"completed",icon:g?r(No,{}):r(Oo,{}),label:g?t.inputSkipped:t.inputAnswered}),r("span",{class:`${Se}-toolui-chevron`,children:r(kt,{})})]})]}),r("div",{class:`${Se}-toolui-collapse-body`,children:[c.intro?r("div",{class:`${Se}-toolui-desc`,children:c.intro}):null,ae,_?null:r("div",{class:`${Se}-toolui-footer`,children:[r("button",{type:"button",class:`${Se}-toolui-options-toggle`,onClick:()=>$(oe=>!oe),"data-testid":C.toolAskOptions,children:[r("span",{class:`${Se}-toolui-options-chevron${k?` ${Se}-open`:""}`,children:r(kt,{})}),k?t.hideOptions:t.showOptions]}),h?r("button",{type:"button",class:`${Se}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":C.toolEdit,children:t.edit}):null]})]})]})}function Ip({req:e,strings:t,resolve:n}){let o=ya(e,t.confirmYes,t.confirmNo),a=e.questions.length===1&&e.questions[0]?.type==="text";return r(Cn,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:a?t.inputSubmitHint:void 0,onSubmit:i=>n(Lp(e.questions,i),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:a,fieldTypeLabels:$l(e.questions,t),submitTestId:C.toolInputSubmit,skipTestId:C.toolInputSkip})}function Ap({questions:e,answers:t,strings:n}){return r("div",{class:`${Se}-toolui-summary`,"data-testid":C.toolAskSummary,children:e.map(o=>r("div",{class:`${Se}-field`,children:[r("span",{class:`${Se}-field-head`,children:r("span",{class:`${Se}-field-label`,children:[o.question,o.required?r("span",{class:`${Se}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),r("p",{class:`${Se}-toolui-answer`,children:Mp(o,t[o.key],n)||"\u2014"})]},o.key))})}function Mp(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Lp(e,t){let n=e.flatMap(o=>{let a=t[o.key];if(a==null||a.trim()==="")return[];let i=o.type==="multi-select"?a.split(",").map(l=>l.trim()).filter(Boolean):a;return[{key:o.key,value:i}]});return JSON.stringify({answers:n})}function Bl(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let o={};for(let a of n)if(a&&typeof a=="object"&&"key"in a){let{key:i,value:l}=a;if(typeof i!="string")continue;typeof l=="string"?o[i]=l:Array.isArray(l)&&(o[i]=l.filter(s=>typeof s=="string"))}return o}function Op(e){let t=Bl(e),n={};for(let[o,a]of Object.entries(t))n[o]=Array.isArray(a)?a.join(", "):a;return n}function Np(e,t){let n=Bl(t),o={};for(let a of e){let i=n[a.key];i!==void 0&&(a.type==="multi-select"?o[a.key]=Array.isArray(i)?i:[i]:o[a.key]=Array.isArray(i)?i[0]??"":i)}return o}function Hl({part:e,strings:t}){let n=ee(()=>e.inputSig.value),o=ee(()=>e.outputSig.value),a=ee(()=>e.errorSig.value);return ee(()=>!!Yo(n.value)||!!a.value||!!Yo(ba(o.value))).value?r(Xo,{part:e,strings:t,testid:C.toolCall}):null}var Te=S.cssPrefix;function zl({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d,enableMessageFeedback:u=!1,onFeedback:f,controlMode:_}){let h=ee(()=>e.partsSig.value).value,P=ee(()=>st(e)),m=ee(()=>Ps(e)),b=ee(()=>e.partsSig.value.some(ue=>ue.kind==="text"&&ue.textSig.value.length>0)),w=ee(()=>o&&e.partsSig.value.some(ue=>ue.kind==="reasoning")),v=ee(()=>{let ue=e.partsSig.value,L=-1;for(let z=0;z<ue.length;z++){let Z=ue[z]?.kind;(Z==="text"||Z==="file"||Z==="source")&&(L=z)}return L}),k=_==="awaiting_operator"||_==="operator",$=e.role==="assistant"&&e.status==="streaming"&&!k,Q=n==="buffered"&&$,J=$&&!b.value,ae=$&&!Q&&!(w.value&&J);if(m.value)return null;let oe=$p(e.createdAt),N=e.role==="assistant"||e.role==="operator",O=u&&!!f&&!!e.serverMessageId&&N&&!$&&e.status!=="error"&&!P.value,j=h.filter(ue=>ue.kind==="text").map(ue=>ue.textSig.value).join(`
|
|
40
40
|
|
|
41
|
-
`).trim(),H=!$&&e.status!=="error"&&!P.value&&j.length>0,He=O||H;return r("div",{class:`${Te}-bubble-row`,"data-role":e.role,"data-mid":e.serverMessageId??e.id,"data-testid":Ce(C.messageBubble,e.id),children:r("div",{class:`${Te}-bubble-col`,children:[r("div",{class:`${Te}-bubble`,children:[e.role==="operator"&&e.operatorInitials?r("span",{class:`${Te}-bubble-author`,children:e.operatorInitials}):null,r("div",{class:`${Te}-bubble-body`,children:[J?r(zp,{label:t.loading}):h.map((ue,L)=>r(Dp,{part:ue,active:Y,strings:t,showReasoning:o,showToolCalls:a,showSources:i,interactive:l&&(ue.kind!=="tool"||L>v.value),superseded:s,tool:c},Bp(ue))),re&&r(Hp,{}),e.status==="error"&&e.errorText||P.value?r("div",{class:`${Te}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${Te}-error-retry`,onClick:d,"data-testid":C.messageRetry,children:t.errorRetry}):null]}):null]})]}),ne||He?r("div",{class:`${Te}-bubble-meta`,children:[ne?r("time",{class:`${Te}-bubble-time`,dateTime:ne.iso,title:ne.full,children:ne.short}):null,He?r("div",{class:`${Te}-bubble-actions`,children:[O&&e.serverMessageId?r(Al,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:f}):null,H?r(Op,{text:j,strings:t}):null]}):null]}):null]})})}function Op({text:e,strings:t}){let[n,o]=R(!1),a=()=>{navigator.clipboard?.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)}).catch(()=>{})},i=n?t.copied:t.copy;return r("button",{type:"button",class:`${Te}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:a,"data-testid":C.messageCopy,children:n?r(xt,{}):r(nl,{})})}function Np(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 Dp({part:e,active:t,strings:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l,superseded:s,tool:c}){switch(e.kind){case"step-start":return null;case"text":return r(Vo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(Fp,{part:e,active:t,strings:n}):null;case"tool":return r($p,{part:e,strings:n,showToolCalls:a,interactive:l,superseded:s,tool:c});case"file":return e.mediaType.startsWith("image/")?r("img",{src:e.url,alt:"",loading:"lazy"}):r("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return i?r(Ml,{part:e,strings:n}):null}}function $p({part:e,strings:t,showToolCalls:n,interactive:o,superseded:a,tool:i}){let l=Z(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(xl(e.toolName))return r(Dl,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit});if(l.value)return r(Ll,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(Fl,{part:e,strings:t}):null}function Fp({part:e,active:t,strings:n}){return r("details",{class:`${Te}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Te}-reasoning-summary`,children:r("span",{class:`${Te}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Te}-reasoning-body`,children:r(Vo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Bp(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 Hp(){return r("span",{class:`${Te}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function zp({label:e}){return r("span",{class:`${Te}-loading`,role:"status",children:[r("span",{class:`${Te}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Te}-loading-label`,children:e})]})}var Tt=S.cssPrefix,ba=120,Up=350;function Hl({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,enableMessageFeedback:l,onFeedback:s,loading:c,idle:d,controlMode:u,tool:f,onRetry:_,form:g,formMarkers:h,onFillForm:P}){let m=F(null),b=Z(()=>e.value),[w,v]=R(!1),k=F(!1),$=F(!1),J=F(!1),Y=F(0),re=()=>J.current||performance.now()-Y.current<Up,ne=F(0),N=x=>{let q=x.scrollHeight-x.clientHeight>1;x.dataset.fadeTop=q&&x.scrollTop>1?"true":"false",x.dataset.fadeBottom=q&&x.scrollHeight-x.scrollTop-x.clientHeight>1?"true":"false"},O=x=>v(x.scrollHeight-x.scrollTop-x.clientHeight>ba*2),j=x=>{ne.current=performance.now(),x.scrollTop=x.scrollHeight,N(x)},H=(x,q)=>{j(x);let be=q,Pe=0,xe=()=>{j(x),--be>0&&(Pe=requestAnimationFrame(xe))};return q>0&&(Pe=requestAnimationFrame(xe)),()=>cancelAnimationFrame(Pe)},He=(x,q)=>{let be,Pe,xe,ce=-1,Ye=()=>{be.disconnect(),Pe.disconnect(),clearTimeout(xe)},Ne=()=>{if($.current||re()||ce>=0&&x.scrollTop<ce-4)return Ye();j(x),ce=x.scrollTop};return be=new ResizeObserver(Ne),Pe=new MutationObserver(Ne),Ne(),be.observe(x),Pe.observe(x,{childList:!0,subtree:!0,characterData:!0}),xe=setTimeout(Ye,q),Ye},ue=b.value[0]?.id;bt(()=>{let x=m.current;if(x&&b.value.length!==0&&(k.current=!0,!!b.value.some(q=>q.role==="user")))return He(x,300)},[ue]);let L=F(0);E(()=>{let x=m.current,q=b.value,be=L.current;if(L.current=q.length,!x||!k.current)return;if(q.slice(be).some(xe=>xe.role==="user"))return $.current=!1,H(x,3);if(!q.some(xe=>xe.role==="user")||$.current||re())return;x.scrollHeight-x.scrollTop-x.clientHeight<ba&&j(x)},[b.value.length]);let z=F(null);E(()=>{let x=m.current,q=b.value.at(-1),be=z.current;if(z.current=q?.id??null,!!x&&k.current&&!(!q||q.id!==be||q.status!=="streaming"))return $.current=!1,H(x,3)},[b.value]),E(()=>{let x=m.current;if(!x)return;let q=b.value.at(-1);if(!q||q.status!=="streaming"&&!b.value.some(xe=>xe.role==="user"))return;let be=()=>{if($.current||re())return;x.scrollHeight-x.scrollTop-x.clientHeight<ba*2&&j(x)};if(q.status!=="streaming")return He(x,300);be();let Pe=new MutationObserver(be);return Pe.observe(x,{childList:!0,subtree:!0,characterData:!0}),()=>Pe.disconnect()},[b.value]);let Q=g?.form.id,ve=!!g&&(h??[]).some(x=>x.formId===g.form.id);bt(()=>{let x=m.current;!x||!Q||$.current||b.value.some(q=>q.role==="user")&&(ve?x.querySelector(`[data-testid="${C.formGate}"]`)?.scrollIntoView({block:"nearest"}):j(x))},[Q,ve]),E(()=>{let x=m.current;if(!x)return;let q=()=>{O(x),N(x),performance.now()-ne.current>150&&($.current=x.scrollHeight-x.scrollTop-x.clientHeight>8)},be=()=>{$.current=!0},Pe=dt=>{dt.deltaY<0&&be()},xe=0,ce=dt=>{xe=dt.touches[0]?.clientY??0,J.current=!0},Ye=dt=>{(dt.touches[0]?.clientY??0)>xe+4&&be()},Ne=()=>{J.current=!1,Y.current=performance.now()},Mn=()=>{J.current=!0};return x.addEventListener("scroll",q,{passive:!0}),x.addEventListener("wheel",Pe,{passive:!0}),x.addEventListener("touchstart",ce,{passive:!0}),x.addEventListener("touchmove",Ye,{passive:!0}),x.addEventListener("touchend",Ne,{passive:!0}),x.addEventListener("touchcancel",Ne,{passive:!0}),x.addEventListener("pointerdown",Mn,{passive:!0}),window.addEventListener("pointerup",Ne,{passive:!0}),window.addEventListener("pointercancel",Ne,{passive:!0}),O(x),()=>{x.removeEventListener("scroll",q),x.removeEventListener("wheel",Pe),x.removeEventListener("touchstart",ce),x.removeEventListener("touchmove",Ye),x.removeEventListener("touchend",Ne),x.removeEventListener("touchcancel",Ne),x.removeEventListener("pointerdown",Mn),window.removeEventListener("pointerup",Ne),window.removeEventListener("pointercancel",Ne)}},[]);let Ke=()=>{let x=m.current;x&&($.current=!1,j(x))},Oe=[],je="",Re=b.value.at(-1)?.id,qe=[...h??[]].toSorted((x,q)=>(x.createdAt??1/0)-(q.createdAt??1/0)),Ae=x=>g&&x.formId===g.form.id?r(sa,{form:g.form,strings:t,onSubmit:g.onSubmit,onSkip:g.onSkip},`gate:${x.formId}`):r(Pl,{marker:x,strings:t,onFill:!g&&P?()=>P(x.formId):void 0},x.key),Xe=x=>{for(let q=qe[0];q?.createdAt!==void 0&&!(x!==void 0&&q.createdAt>x);q=qe[0])qe.shift(),Oe.push(Ae(q))};for(let x of b.value){if(x.role==="assistant"&&x.id!==Re&&st(x))continue;Xe(x.createdAt);let q=qp(x.createdAt);q&&q!==je&&(Oe.push(r("div",{class:`${Tt}-date-divider`,children:r("span",{class:`${Tt}-date-pill`,title:Vp(x.createdAt),children:Wp(x.createdAt,t)})},`day:${q}`)),je=q),Oe.push(r(Bl,{message:x,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:!!d&&x.id===Re,controlMode:u,superseded:x.id!==Re,tool:f,onRetry:d&&x.id===Re?_:void 0,enableMessageFeedback:l,onFeedback:s},x.id))}for(let x of qe)Oe.push(Ae(x));return r("div",{class:`${Tt}-list-wrap`,children:[r("div",{ref:m,class:`${Tt}-list ${Tt}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&b.value.length===0?r("div",{class:`${Tt}-list-loading`,role:"status",children:t.conversationLoading}):null,Oe,g&&!ve?r(sa,{form:g.form,strings:t,onSubmit:g.onSubmit,onSkip:g.onSkip}):null]}),w?r("button",{type:"button",class:`${Tt}-jump`,onClick:Ke,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":C.scrollToBottom,children:r(St,{})}):null]})}function qp(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Vp(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Wp(e,t){let n=new Date(e),o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),a=Math.round((o(new Date)-o(n))/864e5);return a<=0?t.dateToday:a===1?t.dateYesterday:a<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var Gp=["today","yesterday","lastWeek","older"];function Kp(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((zl(e)-zl(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function Ul(e,t){let n=new Map;for(let o of t){let a=Kp(e,o.lastMessageAt),i=n.get(a);i?i.push(o):n.set(a,[o])}return Gp.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function zl(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var jp=V.scope("history"),Xp=3,Yp=6,Jp={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Qp(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 Yo({transport:e,strings:t,locale:n,persistence:o,visitorId:a,onSelect:i,onNewConversation:l}){let s=S.cssPrefix,c=e.peekConversations({visitorId:a}),[d,u]=R(c?"loaded":"loading"),[f,_]=R(c?.conversations??[]);E(()=>{let m=!1;return e.listConversations({visitorId:a}).then(b=>{if(m)return;let w=b.conversations??[];_(w),u("loaded"),o.saveHistoryCount(w.length)}).catch(b=>{m||(jp.warn("listConversations failed",{err:b}),u("error"))}),()=>{m=!0}},[e,a,o]);let g=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":C.sidebarNewConversation,children:[r(Rs,{}),t.newConversation]})}):null;if(d==="loading"){let m=Math.min(o.loadHistoryCount()??Xp,Yp);return r(se,{children:[r("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:r("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[r("div",{class:`${s}-history-heading`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),r("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,m)},(b,w)=>r("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[r("span",{class:`${s}-history-avatar ${s}-skeleton`}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),r("span",{class:`${s}-history-time`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),r("span",{class:`${s}-history-row`,children:r("span",{class:`${s}-history-preview`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},w))})]})}),g]})}if(d==="error"||f.length===0)return r(se,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),g]});let h=Date.now(),P=Ul(h,f);return r(se,{children:[r("div",{class:`${s}-history`,role:"list",children:P.map(m=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[Jp[m.bucket]]}),r("div",{class:`${s}-history-card`,children:m.conversations.map(b=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(b),"data-closed":b.canContinue?void 0:"true","data-unread":b.hasUnread?"true":void 0,"data-testid":Ce(C.historyItem,b.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(Zr,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:b.title}),r("span",{class:`${s}-history-time`,children:Qp(b.lastMessageAt,h,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:b.preview??(b.canContinue?t.historyContinue:t.conversationClosed)}),b.hasUnread?r("span",{class:`${s}-history-dot`}):null]})]})]},b.conversationId))})]},m.bucket))}),g]})}var ql=S.cssPrefix;function Vl({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${ql}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${ql}-suggestion`,onClick:()=>t(n),"data-testid":Ce(C.suggestion,o),children:n.label},n.id))})}var Ee=S.cssPrefix;function Wl(e){let{options:t,onClose:n}=e,o=t.strings,a=F(null);E(()=>{let c=a.current;if(!c)return;let d=Fo(c),u=f=>{f.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let i=e.composerApiRef,l=D(c=>{i.current?.attachFromDrop(c)},[i]),{visible:s}=zo({containerRef:a,onDrop:l});return Do(a.current,t.mode==="modal"),r("div",{ref:a,class:`${Ee}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":C.panel,children:[r(ya,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),r(Pa,{poweredBy:e.options.poweredBy})]})}function ya(e){let{options:t,transport:n,feedback:o,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,controlMode:u,assignedOperatorInitials:f,operatorAvailable:_,operatorRequestEnabled:g,onRequestOperator:h,onCancelRequest:P,loadingMessages:m,messagesSig:b,agent:w,suggestions:v,initialWidgetSize:k,visitorId:$,onClose:J,onBack:Y,onClear:re,onToggleHistory:ne,onSelectHistoryConversation:N,onNewConversation:O,onWidgetSizeChange:j,onSend:H,onStop:He,onSuggestion:ue,activeForm:L,formMarkers:z,onFormSubmit:Q,onFormSkip:ve,onFormFill:Ke,tool:Oe,onRetry:je,onMessageFeedback:Re,containerEl:qe,dragOver:Ae,composerAttachApiRef:Xe}=e,x=t.strings,q;return L?q=null:c?q=r(se,{children:[u&&u!=="ai-agent"?r(tm,{controlMode:u,operatorInitials:f,operatorAvailable:_,onCancelRequest:P,strings:x}):null,!d&&u==="ai-agent"&&r(Vl,{suggestions:v,onPick:ue}),r(fl,{options:t,transport:n,feedback:o,bus:a,isStreaming:d,operatorRequestEnabled:g,controlMode:u,onRequestOperator:h,onSend:H,onStop:He,attachApiRef:Xe})]}):q=r(em,{label:x.conversationClosed,ctaLabel:x.startNewConversation,onNewConversation:re}),r(se,{children:[s==="history"?r(Zp,{strings:x,onBack:ne,onClose:J,showClose:$o(t.mode,l,t.actions)}):r("header",{class:`${Ee}-header`,"data-testid":C.panelHeader,children:[Y?r("button",{type:"button",class:`${Ee}-icon-btn`,onClick:Y,"aria-label":x.moduleBack,title:x.moduleBack,children:r(Pn,{})}):null,w?r(ul,{agent:w,strings:x}):r("h1",{children:x.panelTitle}),r(et,{panelProps:e,variant:"chat"})]}),s==="history"?r(Yo,{transport:n,strings:x,locale:t.locale,persistence:i,visitorId:$,onSelect:be=>N(be.conversationId),onNewConversation:O}):r(se,{children:[r(gl,{visible:Ae,strings:x}),r(Hl,{messagesSig:b,strings:x,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Re,loading:m,idle:!d,controlMode:u,tool:Oe,onRetry:je,form:L?{form:L,onSubmit:Q,onSkip:ve}:null,formMarkers:z,onFillForm:Ke}),q,r(om,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(No,{panelEl:qe,resize:t.size.resize,position:t.position,initialSize:k,onSizeChange:j,strings:x}):null]})}function Zp({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Ee}-header`,children:[r("button",{type:"button",class:`${Ee}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(Pn,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Ee}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(Ze,{})}):null]})}function em({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Ee}-readonly-banner`,role:"note",children:[r("span",{class:`${Ee}-readonly-label`,children:e}),r("button",{type:"button",class:`${Ee}-readonly-cta`,onClick:n,children:t})]})}function tm({controlMode:e,operatorInitials:t,operatorAvailable:n,onCancelRequest:o,strings:a}){let i=nm(e,t,n,a);return r("div",{class:`${Ee}-operator-banner`,role:"status","data-mode":e,"data-testid":C.operatorBanner,children:[r("span",{class:`${Ee}-operator-pulse`,"aria-hidden":"true"}),r("span",{class:`${Ee}-operator-label`,children:i}),e==="awaiting_operator"&&o?r("button",{type:"button",class:`${Ee}-operator-cancel`,"data-testid":C.operatorCancelRequest,onClick:o,children:a.cancelOperatorRequest}):null]})}function nm(e,t,n,o){return e==="operator"?o.chattingWithOperator.replace("{operator}",t??""):n===!1?o.noOperatorAvailable:o.connectingOperator}function om({disclaimer:e}){return e?r("div",{class:`${Ee}-composer-footer`,children:r("div",{class:`${Ee}-disclaimer`,children:e})}):null}function Pa({poweredBy:e}){return e?r("div",{class:`${Ee}-poweredby-bar`,children:r(rm,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function rm({logoUrl:e,text:t,href:n}){let o=r(se,{children:[e?r("img",{class:`${Ee}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Ee}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Ee}-poweredby`,children:o})}function Gl(e){let t=F(e);t.current=e;let n=F(null);return n.current??(n.current=am(t)),n.current}function am(e){let t=U(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,a=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(o(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,d)=>{if(t.value)return;let u=e.current;if(c==="manual"){let f=u.forms.list.find(_=>_.id===d);f&&(t.value={form:f,trigger:"manual"});return}for(let f of u.forms.byTrigger[c]??[]){let _=f.triggers.find(g=>g.kind===c);if(!(!_||!im(_,u)||a(f)||!sm(f,u))){t.value={form:f,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:f,trigger:_}=u;f.frequency==="conversation"?n.add(o(f.id)):f.frequency!=="always"&&e.current.persistence.saveFormDone(f.id),e.current.onComplete(f,_,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(u=>u.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function im(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function sm(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let a=t.userContext()??{};if(n.missingContext.some(i=>a[i]!==void 0&&a[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 Kl(e){let t=S.cssPrefix,{site:n,blocks:o,strings:a,collapsed:i}=e,l=o?.navigation??[],s=o?.linkCards??[],c=i?a.expandSidebar:a.collapseSidebar;return r("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":C.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(lm,{site:n}),r("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":C.sidebarToggle,children:r(cm,{collapsed:i})})]}),i?null:r(se,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(dm,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(_m,{items:s})}):null,e.showConversations?r("div",{class:`${t}-sidebar-conversations`,children:r(Yo,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function lm({site:e}){let t=S.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return r("picture",{children:[e.logoDark?.url?r("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,r("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return r("div",{class:`${t}-sidebar-title`,children:e?.title??S.name})}function cm({collapsed:e}){return r("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?r("polyline",{points:"9 6 15 12 9 18"}):r("polyline",{points:"15 6 9 12 15 18"})})}function dm({items:e}){let t=S.cssPrefix;return r("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>r("li",{children:r("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?r("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,r("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function _m({items:e}){let t=S.cssPrefix;return r("div",{class:`${t}-sidebar-cards`,children:e.map(n=>r("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[r("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?r("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var jl=S.cssPrefix;function Xl(e){return r("main",{class:`${jl}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(Kl,{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}),r("section",{class:`${jl}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Yl=e=>Object.fromEntries(e.map(t=>[t,[]]));function Jl(e,t,n){let o=U({activeTab:e,stacks:Yl(t)});return{sig:o,switchTab(a){o.value.activeTab!==a&&(o.value={...o.value,activeTab:a},n?.(a))},push(a){let i=o.value,l=i.stacks[i.activeTab]??[];o.value={...i,stacks:{...i.stacks,[i.activeTab]:[...l,a]}}},pop(){let a=o.value,i=a.stacks[a.activeTab]??[];i.length!==0&&(o.value={...a,stacks:{...a.stacks,[a.activeTab]:i.slice(0,-1)}})},reset(a){o.value={activeTab:a,stacks:Yl(t)}}}}var Ql=e=>e.stacks[e.activeTab]??[],Zl=e=>Ql(e).at(-1),ec=e=>Ql(e).length===0;var tc={Icon:Sn};var mt=S.cssPrefix;function Jo({title:e,actions:t}){return r("header",{class:`${mt}-back-header`,"data-variant":"title",children:[r("span",{class:`${mt}-back-spacer`,"aria-hidden":"true"}),r("h1",{class:`${mt}-back-title`,children:e}),t??r("span",{class:`${mt}-back-spacer`,"aria-hidden":"true"})]})}function Qo({title:e,backLabel:t,onBack:n,actions:o,testid:a}){return r("header",{class:`${mt}-back-header`,"data-testid":a,children:[r("button",{type:"button",class:`${mt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:r(Pn,{})}),r("h1",{class:`${mt}-back-title`,children:e}),o??r("span",{class:`${mt}-back-spacer`,"aria-hidden":"true"})]})}var jt=S.cssPrefix;function nc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${jt}-home-search`,onClick:t,"data-testid":C.homeSearch,children:[r("span",{class:`${jt}-home-search-text`,children:e}),r("span",{class:`${jt}-home-search-icon`,"aria-hidden":"true",children:r(ta,{})})]})}function oc({placeholder:e,value:t,onInput:n}){return r("div",{class:`${jt}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${jt}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":C.helpSearch}),r("span",{class:`${jt}-home-search-icon`,"aria-hidden":"true",children:r(ta,{})})]})}var Tn=S.cssPrefix;function Zo({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${Tn}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${Tn}-list-row-body`,children:[r("span",{class:`${Tn}-list-row-title`,children:e}),t?r("span",{class:`${Tn}-list-row-sub`,children:t}):null]}),r("span",{class:`${Tn}-list-row-chevron`,"aria-hidden":"true",children:r(Vt,{})})]})}var rc=S.cssPrefix;function We({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${rc}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${rc}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var Et=S.cssPrefix,um=V.scope("help"),pm=(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 mm(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 ac(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let a=0;for(let i of e){if(a=n.indexOf(i,a),a===-1)return 0;a+=1}return 1}function fm(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(ac(n,o.title)*2,ac(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,a)=>a.score-o.score).map(o=>o.item):[]}function ic({article:e,nav:t}){return r(Zo,{title:e.title,subtitle:e.description,onClick:()=>pm(t,e),testid:Ce(C.helpArticle,e.id)})}function gm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,u]=R(t.errorGeneric),[f,_]=R([]),[g,h]=R(""),[P,m]=R(0);E(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(k=>{if(v)return;let $=k.items??[];_($),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:$.length})}).catch(k=>{v||(um.warn("listContent (help) failed",{err:k}),u(qt(k,t)),c("error"))}),()=>{v=!0}},[e,l,P,a]);let b=Le(()=>fm(f,g),[f,g]);E(()=>{let v=g.trim();if(!v)return;let k=setTimeout(()=>a.emit("contentSearch",{queryLength:v.length,hitCount:b.length}),600);return()=>clearTimeout(k)},[g,b,a]);function w(){return g.trim().length>0?b.length===0?r(We,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${Et}-help-card`,children:b.map(v=>r(ic,{article:v,nav:o},v.id))}):s==="loading"?r(We,{message:t.helpLoading,strings:t}):s==="error"?r(We,{tone:"error",message:d,onRetry:()=>m(v=>v+1),strings:t}):f.length===0?r(We,{message:t.helpEmpty,strings:t}):mm(f).map(([v,k])=>r("section",{class:`${Et}-help-group`,children:[v?r("h2",{class:`${Et}-help-section-title`,children:v}):null,r("div",{class:`${Et}-help-card`,children:k.map($=>r(ic,{article:$,nav:o},$.id))})]},v))}return r("div",{class:`${Et}-module`,children:[r(Jo,{title:t.helpTitle,actions:r(et,{panelProps:i,variant:"plain"})}),r("div",{class:`${Et}-module-pad`,children:r(oc,{placeholder:t.helpSearchPlaceholder,value:g,onInput:h})}),r("div",{class:`${Et}-help-list`,children:w()})]})}var sc={Icon:xn,Root:e=>r(gm,{...e})};var lc=S.cssPrefix;function xa({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${lc}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${lc}-home-card`,"data-testid":n,children:t})}var _e=S.cssPrefix,cc=V.scope("home");function hm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Me(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 bm(e){let{transport:t,strings:n,config:o,nav:a,bus:i,panelProps:l}=e,[s,c]=R(null),[d,u]=R([]),f=o.contentTags?.join(",");E(()=>{if(o.showRecentConversations===!1)return;let b=!1;return t.listConversations({limit:1}).then(w=>!b&&c(w.conversations?.[0]??null)).catch(w=>!b&&cc.warn("listConversations (home) failed",{err:w})),()=>{b=!0}},[t,o.showRecentConversations]),E(()=>{if(!o.contentTags?.length)return;let b=!1;return t.listContent({tags:o.contentTags,limit:6}).then(w=>{if(b)return;let v=w.items??[];u(v),i.emit("contentView",{section:"home",tags:f,count:v.length})}).catch(w=>!b&&cc.warn("listContent (home) failed",{err:w})),()=>{b=!0}},[t,f,i]);let _=hm(e),g=o.userAvatars??[],h=o.status,P=h?.text?Me(n,h.text):n.homeStatus,m=o.contentBlockTitle?Me(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${_e}-module ${_e}-home`,"data-testid":C.homeView,children:r("div",{class:`${_e}-home-scroll`,children:[r("div",{class:`${_e}-home-hero`,children:[r("div",{class:`${_e}-home-hero-top`,children:[o.brandName?r("span",{class:`${_e}-home-brand`,"data-testid":C.homeBrand,children:o.brandName}):r("span",{class:`${_e}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${_e}-home-hero-actions`,children:[g.length>0?r("div",{class:`${_e}-home-avatars`,children:g.map(b=>r("span",{class:`${_e}-home-avatar`,title:b.role?`${b.name} \xB7 ${b.role}`:b.name,children:b.avatar?r("img",{src:b.avatar,alt:"",loading:"lazy"}):r("span",{children:Bo(b.name)})},b.name))}):null,r(et,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(se,{children:[r("h1",{class:`${_e}-home-greeting`,"data-testid":C.homeGreeting,children:_.title}),_.subtitle?r("p",{class:`${_e}-home-lead`,children:_.subtitle}):null]}):null]}),r("div",{class:`${_e}-home-cards`,children:[o.showSearchBar!==!1?r(nc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}):null,s?r(xa,{onClick:()=>a.selectConversation(s.conversationId),testid:C.homeRecent,children:r("div",{class:`${_e}-home-recent-row`,"data-unread":s.hasUnread?"true":void 0,children:[r("span",{class:`${_e}-home-recent-avatar`,"aria-hidden":"true",children:r(Sn,{})}),r("span",{class:`${_e}-home-recent-body`,children:[r("span",{class:`${_e}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${_e}-home-recent-preview`,children:s.preview}):null]}),s.hasUnread?r("span",{class:`${_e}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,h?r(xa,{onClick:h.url?()=>a.push({kind:"iframe",url:h.url,title:P}):void 0,children:r("div",{class:`${_e}-home-status`,"data-level":h.level??"operational",children:[r("span",{class:`${_e}-home-status-icon`,"aria-hidden":"true",children:r(Ys,{})}),r("span",{class:`${_e}-home-status-text`,children:P})]})}):null,d.length>0?r("section",{class:`${_e}-home-content`,children:[r("div",{class:`${_e}-home-content-title`,children:m}),r("div",{class:`${_e}-home-content-list`,children:d.map(b=>r(Zo,{title:b.title,subtitle:b.description,onClick:()=>vm(a,b),testid:Ce(C.homeContentRow,b.id)},b.id))})]}):null]})]})})}var dc={Icon:Js,Root:e=>r(bm,{...e})};var ft=S.cssPrefix,ym=V.scope("news");function Pm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,u]=R(t.errorGeneric),[f,_]=R([]),[g,h]=R(0);E(()=>{let m=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(b=>{if(m)return;let w=b.items??[];_(w),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:w.length})}).catch(b=>{m||(ym.warn("listContent (news) failed",{err:b}),u(qt(b,t)),c("error"))}),()=>{m=!0}},[e,l,g,a]);function P(){return s==="loading"?r(We,{message:t.newsLoading,strings:t}):s==="error"?r(We,{tone:"error",message:d,onRetry:()=>h(m=>m+1),strings:t}):f.length===0?r(We,{message:t.newsEmpty,strings:t}):r("div",{class:`${ft}-news-list`,children:f.map(m=>r("button",{type:"button",class:`${ft}-news-card`,onClick:()=>o.push({kind:"content",id:m.id,title:m.title}),"data-testid":Ce(C.newsItem,m.id),children:[m.image?r("img",{class:`${ft}-news-hero`,src:m.image,alt:"",loading:"lazy"}):null,r("span",{class:`${ft}-news-body`,children:[r("span",{class:`${ft}-news-title`,children:m.title}),m.description?r("span",{class:`${ft}-news-summary`,children:m.description}):null]})]},m.id))})}return r("div",{class:`${ft}-module`,children:[r(Jo,{title:t.newsTitle,actions:r(et,{panelProps:i,variant:"plain"})}),r("div",{class:`${ft}-module-scroll`,children:P()})]})}var _c={Icon:Qs,Root:e=>r(Pm,{...e})};var er={chat:tc,home:dc,help:sc,news:_c};var En=S.cssPrefix;function uc({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:a}){return r("nav",{class:`${En}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=er[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&o;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${En}-tab`,onClick:()=>a(i.id),"data-testid":Ce(C.tab,i.id),children:[r("span",{class:`${En}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${En}-tab-badge`,"data-testid":C.tabBadge,"aria-label":"Unread"}):null]}),r("span",{class:`${En}-tab-label`,children:Me(n,i.label)})]},i.id)})})}var pc=S.cssPrefix,xm="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function mc({url:e,title:t,strings:n,onBack:o,actions:a}){return r("div",{class:`${pc}-module`,children:[r(Qo,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:a}),r("iframe",{class:`${pc}-content-frame`,src:e,title:t||"content",sandbox:xm,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Rn=S.cssPrefix,Sm=V.scope("content"),km=5e3;function fc({id:e,title:t,transport:n,strings:o,bus:a,onBack:i,actions:l}){let[s,c]=R(null),[d,u]=R(!1),[f,_]=R(0),g=D(()=>{u(!1),c(null),_(m=>m+1)},[]);E(()=>{let m=!1;return n.listContent({ids:[e],limit:1}).then(b=>{if(m)return;let w=b.items[0];w?(c(w),a.emit("contentOpen",{contentId:e,tags:w.tags?.length?w.tags.join(","):void 0})):u(!0)}).catch(b=>{m||(Sm.warn("listContent (reader) failed",{err:b}),u(!0))}),()=>{m=!0}},[n,e,f,a]),E(()=>{if(!s)return;let m=setTimeout(()=>a.emit("contentRead",{contentId:e}),km);return()=>clearTimeout(m)},[s,e,a]);let h=D(m=>{let w=m.target?.closest?.("a")?.getAttribute("href")??"";w&&!w.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function P(){return d?r(We,{tone:"error",message:o.errorGeneric,onRetry:g,strings:o}):s===null?r(We,{message:o.contentLoading,strings:o}):r("article",{class:`${Rn}-content`,"data-testid":C.contentView,onClick:h,children:[s.image?r("img",{class:`${Rn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Rn}-content-subtitle`,children:s.description}):null,r(Il,{text:s.content??""})]})}return r("div",{class:`${Rn}-module`,children:[r(Qo,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:C.backHeader}),r("div",{class:`${Rn}-module-scroll`,"data-testid":C.contentScroll,children:P()})]})}var tr=S.cssPrefix;function gc({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=F(null),f=F(new Set);E(()=>{let O=u.current;if(!O)return;let j=Fo(O),H=He=>{He.key==="Escape"&&e.onClose?.()};return O.addEventListener("keydown",H),()=>{j(),O.removeEventListener("keydown",H)}},[e.onClose]);let _=e.composerApiRef,g=D(O=>{_.current?.attachFromDrop(O)},[_]),{visible:h}=zo({containerRef:u,onDrop:g});Do(u.current,c.mode==="modal");let P=Z(()=>n.sig.value).value,m=Zl(P),b=c.modules.byId[P.activeTab],w=m?.kind==="iframe"||m?.kind==="content",v=t.length>1&&(ec(P)||!w),k=F(null);E(()=>{if(w&&k.current===null)k.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!w&&k.current!==null){let O=k.current;k.current=null,s(O)}},[w]);let $={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:O=>{let j=t.find(H=>H.layout===O);j&&n.switchTab(j.id)},selectConversation:i,startNewConversation:l},J=O=>({options:c,transport:e.transport,strings:d,config:O,visitorId:e.visitorId,nav:$,bus:o,panelProps:e}),Y=r(et,{panelProps:e,variant:"plain"});b&&f.current.add(b.id);let re=t.filter(O=>f.current.has(O.id)),ne=O=>{if(O.layout==="chat")return r(ya,{...e,containerEl:u.current,dragOver:h,composerAttachApiRef:_});let j=er[O.layout].Root;return j?r(j,{...J(O)}):null},N=()=>m?.kind==="iframe"?r(mc,{url:m.url,title:m.title,strings:d,onBack:n.pop,actions:Y}):m?.kind==="content"?r(fc,{id:m.id,title:m.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:Y}):null;return r("div",{ref:u,class:`${tr}-panel ${tr}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":C.messengerHome,children:[r("div",{class:`${tr}-messenger-body`,children:[re.map(O=>r("div",{class:`${tr}-messenger-pane`,hidden:w||O.id!==b?.id,children:ne(O)},O.id)),N()]}),v?r(uc,{modules:t,activeTab:P.activeTab,strings:d,hasUnread:a,onSelect:n.switchTab}):null,r(Pa,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(b?.layout==="chat"&&!m)?r(No,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var In=S.cssPrefix;function hc({strings:e,onClose:t}){return r("div",{class:`${In}-panel ${In}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":C.modulesEmpty,children:[t?r("button",{type:"button",class:`${In}-icon-btn ${In}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(Ze,{})}):null,r("p",{class:`${In}-modules-empty-text`,children:e.modulesEmpty})]})}function vc({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[a,i]=R(()=>o?!1:t.loadCalloutDismissed(n));E(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=D(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:a,dismissCallout:l}}function bc(e){let{transport:t}=e,n=Je("ai-agent"),o=Je(void 0),a=Je(void 0),i=D(d=>{n.value=d.controlMode,o.value=d.assignedOperatorInitials,d.operatorAvailable!==void 0&&(a.value=d.operatorAvailable)},[n,o,a]),l=D(d=>{d.type==="data-control-state"&&i(Qe(d.data))},[i]),s=D(async()=>{if(n.value!=="ai-agent")return;let d=await t.requestOperator();d&&i(Qe(d))},[t,n,i]),c=D(async()=>{if(n.value!=="awaiting_operator")return;let d=await t.cancelRequestOperator();d&&i(Qe(d))},[t,n,i]);return{controlModeSig:n,assignedOperatorInitialsSig:o,operatorAvailableSig:a,applyControlState:i,adoptControlStateChunk:l,requestOperator:s,cancelRequestOperator:c}}var wm=V.scope("unread"),Cm=300;function yc(e){let{transport:t,options:n,conversationIdSig:o,isChatActiveRef:a,applyControlState:i,activated:l,conversationReady:s}=e,c=Je(!1),d=F(new Set),u=F();E(()=>()=>clearTimeout(u.current),[]);let f=D(()=>{let m=a.current()?o.value:void 0;c.value=[...d.current].some(b=>b!==m)},[c,o,a]),_=D(()=>{n.modules.list.some(m=>m.layout==="chat")&&t.listConversations({limit:50}).then(m=>{d.current=new Set(m.conversations.filter(w=>w.hasUnread).map(w=>w.conversationId)),f();let b=m.conversations.find(w=>w.conversationId===o.value);b?.controlState&&i(Qe(b.controlState))}).catch(m=>wm.debug("refreshUnread failed (non-fatal)",{err:m}))},[t,n.modules,f,o,i]),g=D(m=>{d.current.delete(m),f()},[f]),h=D(()=>{if(!a.current())return;let m=o.value;m&&(clearTimeout(u.current),u.current=setTimeout(()=>{g(m),t.markRead(m)},Cm))},[t,o,g,a]),P=F(!1);return E(()=>{!l||!s||P.current||(P.current=!0,_())},[l,s,_]),E(()=>{if(!l)return;let m=()=>{document.visibilityState==="visible"&&_()};return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[l,_]),{hasUnreadSig:c,refreshUnread:_,clearUnread:g,markActiveConversationRead:h}}var An=V.scope("settings");function Pc(e){let{options:t,persistence:n,transport:o,feedback:a,hostElement:i,bus:l}=e,s=n.loadUserPrefs(),[c,d]=R(()=>s.locale??t.locale),[u,f]=R(()=>s.themeMode??t.themeMode),[_,g]=R(()=>s.textSize??t.textSize),h=D(k=>{n.patchUserPrefs(k),o.saveUserPrefs(n.loadUserPrefs()).catch($=>An.warn("saveUserPrefs failed",{err:$}))},[n,o]);E(()=>{s.soundMuted!==void 0&&a.setMuted(s.soundMuted)},[]),E(()=>{i.dataset.theme=u},[i,u,t]),E(()=>{i.dataset.textSize=_},[i,_,t]),E(()=>{let k=!0;return a.mutedSig.subscribe($=>{if(k){k=!1;return}h({soundMuted:$})})},[a,h]);let P=Dt(c,t.availableLocales,t.defaultLocale);E(()=>{o.setLocale(P)},[o,P]),E(()=>{i.dir=di(P)?"rtl":"ltr"},[i,P]),E(()=>{P!==c&&d(P)},[P,c]);let m=D(k=>{An.info("localeChange",{locale:k}),d(k),h({locale:k}),l.emit("localeChange",k)},[h,l]),b=D(k=>{An.info("themeChange",{mode:k}),f(k),i.dataset.theme=k,h({themeMode:k}),l.emit("themeChange",k)},[i,h,l]),w=D(k=>{An.info("textSizeChange",{size:k}),g(k),i.dataset.textSize=k,h({textSize:k}),l.emit("textSizeChange",k)},[i,h,l]),v=D(()=>{a.toggleMuted();let k=a.mutedSig.value;An.info("soundToggle",{muted:k}),l.emit("soundToggle",{muted:k})},[a,l]);return{activeLocale:c,activeThemeMode:u,activeTextSize:_,effectiveLocale:P,setActiveLocale:d,setActiveThemeMode:f,setActiveTextSize:g,patchAndSync:h,handleLocaleChange:m,handleThemeChange:b,handleTextSizeChange:w,handleSoundToggle:v}}var ee=V.scope("app"),nr=S.cssPrefix;function xc(e,t){return hs({...e,text:Me(t,e.text)})}function Tm(e){let t=e.partsSig.value.filter(n=>n.kind==="tool");return t.length>0&&t.every(n=>{let o=n.stateSig.value;return o==="output-available"||o==="output-error"||o==="output-denied"||o==="approval-responded"})}function Sc(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function kc({options:e,hostElement:t,bus:n}){let[o]=R(()=>$t(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=R(()=>o.getVisitorId()),l=o.loadUserPrefs(),s=Je(o.loadConversationId()),c=Je([]),[d,u]=R(!1),[f,_]=R([]);function g(){let p=e.modules.list,y=new Set(p.map(M=>M.id)),A=o.loadActiveModule();return A&&y.has(A)?A:p[0]?.id??""}function h(){return e.modules.list.find(p=>p.layout==="chat")?.id}function P(){let p=h();return p?e.modules.list.length===1?!0:w.sig.value.activeTab===p:!1}let m=F(P);m.current=P;let b=F();if(!b.current){let p=e.modules.list.map(y=>y.id);b.current=Jl(g(),p,y=>o.saveActiveModule(y))}let w=b.current,[v,k]=R(!1),[$,J]=R(null),[Y,re]=R(!1),ne=e.mode==="standalone"||e.mode==="inline",N=F(pn(e,Ut(),o.loadPanelOpen(),o.loadPanelSize())),[O,j]=R(N.current.panelOpen),[H,He]=R(N.current.panelOpen),ue=F(H);ue.current=H;let L=F(!1),z=F(void 0);E(()=>{O&&He(!0)},[O]);let Q=F(!1),[ve,Ke]=R(!1),{dismissed:Oe,dismissCallout:je}=vc({callout:e.launcher.callout,persistence:o}),Re=e.launcher.callout?.persistent??!0,qe=D(()=>{ee.info("calloutDismiss"),n.emit("calloutDismiss",void 0),je()},[n,je]),[Ae,Xe]=R(N.current.panelSize),x=F(!1),[q,be]=R("chat"),[Pe,xe]=R(!0),[ce,Ye]=R(!1),Ne=F(ce);Ne.current=ce;let[Mn,dt]=R(null),[Ln,Xt]=R([]),[ka,wa]=R(null),[On,Ca]=R(null),Nn=F(e.strings),sr=F(e);sr.current=e;let[Ac,Mc]=R(void 0),[Lc,Oc]=R(void 0),[Nc,Dc]=R(()=>o.loadSidebarCollapsed()??!1),[lr,$c]=R({}),[G]=R(()=>new To({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:ls({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[nt]=R(()=>new bn(c)),[ke]=R(()=>new Ao(e.sound,e.haptics)),{activeLocale:Dn,activeThemeMode:Ta,activeTextSize:Ea,effectiveLocale:Rt,setActiveLocale:Fc,setActiveThemeMode:Bc,setActiveTextSize:Hc,patchAndSync:Ra,handleLocaleChange:zc,handleThemeChange:Uc,handleTextSizeChange:qc,handleSoundToggle:Vc}=Pc({options:e,persistence:o,transport:G,feedback:ke,hostElement:t,bus:n}),{controlModeSig:cr,assignedOperatorInitialsSig:Wc,operatorAvailableSig:Gc,applyControlState:$n,adoptControlStateChunk:Yt,requestOperator:Kc,cancelRequestOperator:jc}=bc({transport:G}),{hasUnreadSig:Xc,refreshUnread:Ia,clearUnread:Aa,markActiveConversationRead:Yc}=yc({transport:G,options:e,conversationIdSig:s,isChatActiveRef:m,applyControlState:$n,activated:H,conversationReady:v});E(()=>{ke.update(e.sound,e.haptics)},[ke,e.sound,e.haptics]),E(()=>()=>ke.destroy(),[ke]),E(()=>{x.current||!e.size.initialSize||(x.current=!0,!o.loadPanelSize()&&Xe(Kr(e.mode,e.size,Ut())))},[e.mode,e.size,o]),E(()=>{if(!v||Q.current)return;Q.current=!0;let p=pn(e,Ut(),o.loadPanelOpen(),o.loadPanelSize());j(p.panelOpen),Xe(p.panelSize)},[v,e,o]);let Ma=F(!1),La=F(null);E(()=>{!v||Ma.current||(Ma.current=!0,w.reset(g()))},[v]);let Fn=D(p=>{!p||p.length===0||(c.value=p.map(y=>xc(y,Nn.current)))},[c]),dr=F(null),Bn=D(async p=>{try{let{formSubmissions:y}=await(p?G.bootstrap(p):dr.current??G.bootstrap()),A=new Map;return y.forEach((M,W)=>A.set(M.formId,W)),y.filter((M,W)=>!M.skipped||A.get(M.formId)===W).map((M,W)=>({key:`wire:${M.formId}:${M.createdAt??W}`,formId:M.formId,outcome:M.skipped?"skipped":"submitted",createdAt:ko(M.createdAt),values:M.values}))}catch(y){return ee.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:y}),[]}},[G]),Jt=F(0),Hn=D((p,y)=>{let A=[...p.map(T=>T.createdAt),...y.map(T=>T.createdAt)].filter(T=>T!==void 0),M=(A.length?Math.min(...A):Date.now())-1;return[...(z.current?.messages??[]).map(T=>{let me=xc(T,Nn.current);return me.createdAt=M,me}),...p]},[]),_r=D(async p=>{let y=Jt.current,A=()=>y!==Jt.current;u(!0);try{let[M,W]=await Promise.all([G.loadConversation(p),Bn()]);if(A())return;let T=Eo(M.messages??[]);_(W);let me=new Set(T.map(le=>le.serverMessageId).filter(le=>le!==void 0)),ae=c.value.filter(le=>le.status==="streaming"&&!le.ephemeral&&!(le.serverMessageId!==void 0&&me.has(le.serverMessageId)));if(c.value=[...Hn(T,W),...ae],T.length){xe(M.canContinue??!0),$n(Qe(M.controlState));let le=T.findLast(gt=>gt.role==="assistant"&&!gt.ephemeral);Xt(le?.suggestions??M.suggestions??[])}}catch(M){if(A())return;ee.warn("loadThread failed; resetting conversationId",{err:M,conversationId:p}),s.value=void 0,o.saveConversationId(void 0)}finally{A()||u(!1)}},[G,Bn,c,s,o,Hn]),Qt=D(async({newConversation:p})=>{let y=++Jt.current,A=()=>y!==Jt.current,M=s.value,W=p||!M?ze():M;W!==M&&(s.value=W,o.saveConversationId(W));let T;try{T=await G.handshake({visitorId:a,conversationId:W,userPrefs:o.loadUserPrefs(),locale:Dn})}catch(ae){if(A())return;n.emit("error",ae),e.onError?.(ae),p||k(!0);return}if(A())return;if(T.visitorId&&T.visitorId!==a&&(ee.info("visitor rebound",{previous:a,current:T.visitorId,reason:T.rebind?.visitorId}),o.setVisitorId(T.visitorId),i(T.visitorId),n.emit("visitorRebound",{previous:a,current:T.visitorId,reason:T.rebind?.visitorId})),T.conversationId&&T.conversationId!==W&&(ee.info("conversation rebound",{previous:W,current:T.conversationId,reason:T.rebind?.conversationId}),n.emit("conversationRebound",{previous:W,current:T.conversationId,reason:T.rebind?.conversationId})),T.agent&&dt(T.agent),$n(Qe(T.controlState)),e.mode==="page"&&(T.site&&is(T.site)?Mc(T.site):T.site&&ee.warn("invalid site config, using fallback",{site:T.site}),T.blocks&&ss(T.blocks)?Oc(T.blocks):T.blocks&&ee.warn("invalid blocks config, using fallback",{blocks:T.blocks})),T.userPrefs&&!p&&(o.saveUserPrefs(T.userPrefs),T.userPrefs.locale&&Fc(T.userPrefs.locale),T.userPrefs.soundMuted!==void 0&&ke.setMuted(T.userPrefs.soundMuted),T.userPrefs.themeMode&&Bc(T.userPrefs.themeMode),T.userPrefs.textSize&&Hc(T.userPrefs.textSize)),z.current=T.welcome,p||n.emit("handshake",T),T.welcome?.suggestions){let ae=Nn.current;Xt(T.welcome.suggestions.map(le=>({...le,label:Me(ae,le.label),...le.text===void 0?{}:{text:Me(ae,le.text)}})))}!p&&M&&T.conversationId===M?ue.current?_r(M):L.current=!0:(s.value=T.conversationId,o.saveConversationId(T.conversationId),Fn(T.welcome?.messages)),p||k(!0)},[G,a,o,e,n,s,ke,Fn,_r,Dn]),Zt=JSON.stringify(e.userContext??null),Jc=JSON.stringify(e.pageContext??null),Qc=JSON.stringify(lr);E(()=>{let p=Object.keys(lr).length?{...lr,...e.userContext}:e.userContext;G.setContext(p,Em(e.pageContext))},[G,Zt,Jc,Qc]);let Zc=D((p,y=[])=>Xt(p.suggestions??y),[]),zn=D(p=>{if(p.type!=="data-conversation-rebind")return!1;let y=p.data?.conversationId;if(y&&y!==s.value){let A=s.value;s.value=y,o.saveConversationId(y),G.primeIdentity(void 0,y),ee.info("conversation rebound (in-stream)",{previous:A,current:y}),A&&n.emit("conversationRebound",{previous:A,current:y,reason:y})}return!0},[s,o,G,n]);E(()=>(G.primeIdentity(a,s.value),Qt({newConversation:!1}),()=>{Jt.current++}),[]),E(()=>{if(H&&(dr.current=G.bootstrap(),(async()=>{try{let p=await dr.current;J(rn((p??{forms:[]}).forms,Rt))}catch(p){ee.debug("bootstrap failed \u2014 treating as no forms",{err:p})}finally{re(!0)}})(),L.current)){L.current=!1;let p=s.value;p&&_r(p)}},[H]);let Un=F(null);E(()=>{if(!H)return;if(Un.current===null){Un.current=Rt;return}if(Un.current===Rt)return;Un.current=Rt;let p=!1;return G.bootstrap().then(y=>{p||J(rn((y??{forms:[]}).forms,Rt))}).catch(y=>ee.debug("forms re-localize failed \u2014 keeping current copy",{err:y})),()=>{p=!0}},[H,Rt,G]);let Oa=F(Zt);E(()=>{!v||Oa.current===Zt||(Oa.current=Zt,Qt({newConversation:!1}))},[Zt,v,Qt]),E(()=>{if(!H||!v||!s.value)return;let p=s.value,y=new AbortController,A=new bn(c);G.primeIdentity(a,p),ee.debug("resume stream opened",{conversationId:p});let M=T=>{Yt(T);let me=c.value.length,ae=A.applyResume(T,Ne.current);if(c.value.length>me){let le=sr.current.modules.list.find(gt=>gt.layout==="chat")?.id;le&&w.switchTab(le)}ae?.role==="operator"&&(ke.play("messageReceived"),or(n,sr.current,"operator",gn(ae)),!document.hidden&&m.current()&&G.markRead(p).catch(()=>{}))},W=async()=>{let T=await G.loadConversation(p).catch(()=>null);if(y.signal.aborted||!T?.messages?.length)return;let me=new Map(Eo(T.messages).filter(De=>De.serverMessageId!==void 0).map(De=>[De.serverMessageId,De])),ae=c.value,le=new Set(ae.flatMap(De=>[De.serverMessageId,De.id].filter(nn=>nn!==void 0))),gt=!1,ud=ae.map(De=>{if(De.serverMessageId===void 0||!hn(De))return De;let nn=me.get(De.serverMessageId);return nn===void 0||hn(nn)?De:(gt=!0,nn)}),Ga=[...me.values()].filter(De=>!le.has(De.serverMessageId));(gt||Ga.length)&&(c.value=[...ud,...Ga])};return Ss({signal:y.signal,now:()=>performance.now(),sleep:T=>mn(T,y.signal),connect:T=>G.connectResumeStream({signal:y.signal,onChunk:M,onConnected:T}),backfill:()=>{W()}}),()=>{y.abort(),A.detach(),ee.debug("resume stream closed",{conversationId:p})}},[H,v,s,s.value,a,G,Yt,c,n,ke,w]),bt(()=>{_o(t,So(e.mode,Ae,O))},[t,O,Ae,e.mode]),E(()=>{if(e.mode!=="modal"||!O)return;let p=y=>{y.composedPath().some(W=>W instanceof HTMLElement&&W.classList.contains(`${S.cssPrefix}-panel`))||j(!1)};return t.addEventListener("click",p),()=>t.removeEventListener("click",p)},[t,O,e.mode]),E(()=>{if(e.mode!=="drawer"||!O)return;let p=y=>{y.key==="Escape"&&j(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[O,e.mode]);let It=D(async(p,{continueExisting:y})=>{let A=s.value??ze();s.value||(s.value=A,o.saveConversationId(A));let M=vs(c.value,y),W=Xr({messages:M.map(Jr),conversationId:A,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});Ye(!0);let T=G.sendMessage(W);wa(()=>T.cancel),Ca(()=>T.detach);try{for await(let ae of T.iter)zn(ae.chunk)||(Yt(ae.chunk),nt.apply(ae.chunk),ae.chunk.type==="finish"&&ae.chunk.canContinue===!1&&xe(!1));let me=p.status==="error";switch(ys(p,me)){case"drop":c.value=c.value.filter(ae=>ae!==p);break;case"complete-operator-routed":p.status="complete",ke.play("messageReceived"),or(n,e,"assistant",gn(p));break;case"error":{p.status="error",p.errorText=e.strings.errorGeneric,ke.play("error");let ae=new Error(me?"stream error chunk":"empty reply");n.emit("error",ae),e.onError?.(ae);break}case"complete":p.status="complete",ke.play("messageReceived"),or(n,e,"assistant",gn(p)),Zc(p);break}}catch(me){Sc(me)?hn(p)?c.value=c.value.filter(ae=>ae!==p):p.status="complete":(p.status="error",p.errorText=qt(me,e.strings),ke.play("error"),n.emit("error",me),e.onError?.(me))}finally{nt.detach(),Ye(!1),wa(null),Ca(null),c.value=[...c.value],Yc()}},[G,nt,c,s,e,n,ke,o,a,zn]),qn=D((p,y)=>{if(ce)return;let A=c.value.at(-1),M=A?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===p);if(!A||!M){ee.warn("decideTool: tool part not found",{toolCallId:p});return}y(M),A.partsSig.value=[...A.partsSig.value],Tm(A)&&(A.status="streaming",c.value=[...c.value],nt.attach(A),It(A,{continueExisting:!0}))},[ce,c,nt,It]),Na=D((p,y)=>{ee.info("toolResult",{toolCallId:p}),n.emit("toolResult",{toolCallId:p}),qn(p,A=>{A.outputSig.value=y,A.stateSig.value="output-available"})},[n,qn]),Da=D((p,y,A)=>{ee.info("toolDecision",{toolCallId:p,approved:y}),n.emit("toolDecision",{toolCallId:p,approved:y}),qn(p,M=>{let W=M.approvalSig.value?.id??p;M.approvalSig.value={id:W,approved:y,reason:A},M.stateSig.value="approval-responded"})},[n,qn]),$a=D(p=>{if(ce)return;let y=c.value.at(-1),A=y?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===p);if(!y||!A)return;let M=A.approvalSig.value?.id??p;A.approvalSig.value={id:M},A.stateSig.value="approval-requested",y.partsSig.value=[...y.partsSig.value]},[ce,c]),ed=D((p,y)=>{ee.info("messageFeedback",{messageId:p,value:y}),n.emit("messageFeedback",{messageId:p,value:y}),G.submitFeedback({messageId:p,value:y})},[n,G]),td=Le(()=>({humanInLoop:e.features.humanInLoop,onResult:Na,onDecision:Da,onEdit:$a}),[e.features.humanInLoop,Na,Da,$a]),nd=()=>c.value.reduce((p,y)=>p+(y.role==="user"?1:0),0),At=e.forms.list.length>0?e.forms:$??e.forms,fe=Gl({forms:At,persistence:o,userContext:()=>e.userContext,messageCount:nd,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>s.value,onComplete:(p,y,A,M)=>{ee.info("formSubmit",{formId:p.id,trigger:y,skipped:M}),n.emit("formSubmit",{formId:p.id,values:A,skipped:M}),_(T=>{let ae=T.find(le=>le.formId===p.id&&le.outcome==="skipped")?.createdAt??Date.now();return[...T.filter(le=>!(le.formId===p.id&&le.outcome==="skipped")),{key:`local:${p.id}:${ae}`,formId:p.id,outcome:M?"skipped":"submitted",createdAt:ae,...M?{}:{values:A}}]});let W=s.value??ze();s.value||(s.value=W,o.saveConversationId(W),G.primeIdentity(void 0,W)),!M&&p.mirrorToContext&&$c(T=>({...T,...A})),G.submitForm({formId:p.id,conversationId:W,trigger:y,values:A,skipped:M})}}),od=Z(()=>fe.activeForm.value);E(()=>{fe.refresh()},[At,fe]);let Fa=e.pageContext?.area?String(e.pageContext.area):void 0,rd=Z(()=>c.value.length);E(()=>{v&&Y&&fe.fire("pre-chat")},[v,Y,fe]),E(()=>{Y&&!Pe&&fe.fire("conversation-closed")},[Y,Pe,fe]),E(()=>{v&&Y&&Fa&&fe.fire("page-area")},[v,Y,Fa,fe]);let ur=Le(()=>{let p=At.list.flatMap(y=>y.triggers).filter(y=>y.kind==="idle").map(y=>Number(y.param));return p.length?Math.min(...p)*1e3:0},[At]);E(()=>{if(!ur||!O)return;let p=setTimeout(()=>fe.fire("idle"),ur);return()=>clearTimeout(p)},[ur,O,fe,rd.value]);let Ba=D(async p=>{let y=s.value??ze();s.value||(s.value=y,o.saveConversationId(y));let A=Xr({messages:[Jr(p)],conversationId:y,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});try{for await(let M of G.sendMessage(A).iter)zn(M.chunk)||(Yt(M.chunk),M.chunk.type==="start"&&M.chunk.messageId&&M.chunk.messageMetadata?.senderRole==="visitor"&&(p.serverMessageId=M.chunk.messageId))}catch(M){if(Sc(M))return;ee.debug("operator-routed send failed (non-fatal)",{error:M}),n.emit("error",M instanceof Error?M:new Error(String(M))),e.onError?.(M instanceof Error?M:new Error(String(M)))}},[G,s,o,e,a,zn,Yt,n]),Ha=D(async(p,y)=>{let A=cr.value!=="ai-agent";if(ee.info("send",{textLen:p.length,attachments:y.length,streaming:ce,routedToOperator:A}),ce&&!A)return;n.emit("send",{text:p,attachmentCount:y.length}),Ln.length>0&&Xt([]);let M=await Im(G,y,me=>{ee.warn("upload failed",{err:me}),n.emit("error",me),e.onError?.(me)});ke.unlock(),ke.play("messageSent");let W=gs(p,M);if(or(n,e,"user",p),A){c.value=[...c.value,W],Ba(W);return}let T=fn();c.value=[...c.value,W,T],nt.attach(T),await It(T,{continueExisting:!1}),fe.fire("after-messages")},[ce,G,n,e,Ln.length,c,nt,It,Ba,fe,cr]),ad=D(()=>{ee.info("stop"),n.emit("stop",void 0),ka?.()},[ka,n]),id=D(()=>{if(ce)return;let p=c.value,y=p.at(-1);if(!y||y.role!=="assistant"||y.status!=="error"&&!st(y))return;let A=fn();c.value=[...p.slice(0,-1),A],nt.attach(A),ee.info("retry"),It(A,{continueExisting:!1})},[ce,c,nt,It]),en=D(()=>{if(_l(e.mode,Ae)==="exit-fullscreen"){ee.info("close \u2192 exit-fullscreen",{mode:e.mode}),Xe("normal"),n.emit("fullscreen",!1);return}ee.info("close \u2192 panel closed",{mode:e.mode}),fe.fire("panel-close"),j(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,Ae,fe]),pr=D(()=>{ee.info("open",{mode:e.mode}),ke.unlock(),Ke(!0),j(!0),o.savePanelOpen(!0),!Oe&&!Re&&qe(),setTimeout(()=>Ke(!1),Rm),Ia(),n.emit("open",void 0),e.onOpen?.()},[n,e,ke,o,Oe,Re,qe,Ia]),mr=D(()=>{if(!c.value.some(y=>y.role==="user")&&Pe&&s.value){ee.info("clear \u2192 reusing empty conversation",{conversationId:s.value}),c.value.length===0&&Fn(z.current?.messages);return}ee.info("clear \u2192 new conversation",{wasStreaming:ce}),n.emit("clear",void 0),ce&&On?.(),Bt(()=>{c.value=[],s.value=void 0}),o.clearConversation(),xe(!0),_([]),Qt({newConversation:!0})},[ce,On,c,s,o,Qt,n,Pe,Fn]),fr=D(()=>{mr(),be("chat");let p=e.modules.list.find(y=>y.layout==="chat")?.id;p&&w.switchTab(p)},[mr,w,e]),gr=D(()=>{let p=Ae==="expanded"?"normal":"expanded";ee.info("expand",{from:Ae,expanded:p==="expanded"}),Xe(p),o.savePanelSize(p),n.emit("expand",p==="expanded")},[n,Ae,o]),hr=D(()=>{let p=Ae==="fullscreen"?"normal":"fullscreen";ee.info("fullscreen",{from:Ae,fullscreen:p==="fullscreen"}),Xe(p),o.savePanelSize(p),n.emit("fullscreen",p==="fullscreen")},[n,Ae,o]),sd=D(()=>{be(p=>{let y=p==="history"?"chat":"history";return ee.info("toggleHistory",{view:y}),n.emit("toggleHistory",{view:y}),y})},[n]),ld=D(()=>{Dc(p=>{let y=!p;return ee.info("sidebarToggle",{collapsed:y}),o.saveSidebarCollapsed(y),n.emit("sidebarToggle",{collapsed:y}),y})},[o,n]),cd=D(p=>{ee.info("resize",p),Ra({widgetSize:p}),n.emit("resize",p)},[Ra,n]),vr=D(async p=>{ee.info("selectConversation",{conversationId:p,wasStreaming:ce}),n.emit("selectConversation",{conversationId:p}),ce&&On?.();try{let[y,A]=await Promise.all([G.loadConversation(p),Bn(p)]),M=Eo(y.messages);Bt(()=>{c.value=Hn(M,A),s.value=y.conversationId}),_(A),o.saveConversationId(y.conversationId),G.primeIdentity(a,y.conversationId),y.agent&&dt(y.agent),xe(y.canContinue),$n(Qe(y.controlState));let W=M.findLast(T=>T.role==="assistant"&&!T.ephemeral);Xt(W?.suggestions??y.suggestions??[]),be("chat"),await G.markRead(p),Aa(p)}catch(y){n.emit("error",y),e.onError?.(y)}},[G,c,s,n,e,o,Aa,Bn,Hn,ce,On,a]),Vn=F(null),za=D(p=>{typeof p=="string"&&(Y?fe.fire("manual",p):Vn.current=p)},[Y,fe]);E(()=>{!Y||!Vn.current||(fe.fire("manual",Vn.current),Vn.current=null)},[Y,fe]),E(()=>Ci(t,{open:pr,close:en,expand:gr,fullscreen:hr,openForm:za}),[t,pr,en,gr,hr,za]);let Fe=Le(()=>Br(e,Dn,Ta,Ea),[e,Dn,Ta,Ea]);Nn.current=Fe.strings;let dd=Le(()=>f.map(p=>{let y=At.list.find(A=>A.id===p.formId);return{...p,title:y?.title,form:y}}),[f,At]),Ua={options:Fe,transport:G,feedback:ke,bus:n,persistence:o,composerApiRef:La,view:q,canSend:Pe,isStreaming:ce,controlMode:cr.value,assignedOperatorInitials:Wc.value,operatorAvailable:Gc.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Kc,onCancelRequest:jc,loadingMessages:d,messagesSig:c,agent:Mn,suggestions:Ln,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:en,onClear:mr,onExpand:gr,onFullscreen:hr,onSoundToggle:Vc,onToggleHistory:sd,onSelectHistoryConversation:vr,onNewConversation:fr,onLocaleChange:zc,onThemeChange:Uc,onTextSizeChange:qc,onWidgetSizeChange:cd,onSend:Ha,onStop:ad,onSuggestion:p=>{let y=p.text??p.label;ee.info("suggestion",{text:y,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:y}),e.autoSendSuggestions?Ha(y,[]):La.current?.fill(y)},activeForm:od.value?.form??null,formMarkers:dd,onFormSubmit:fe.complete,onFormSkip:fe.skip,onFormFill:p=>fe.fire("manual",p),tool:td,onRetry:id,onMessageFeedback:ed},_d=p=>{vr(p);let y=h();y&&w.switchTab(y)};if(!v)return null;let tn=Fe.modules.list,br=p=>{let y=kn("close",Fe.mode,p);return tn.length===0?r(hc,{strings:Fe.strings,onClose:y?en:void 0}):tn.length===1&&tn[0]?.layout==="chat"?r(Wl,{...Ua,panelSize:p}):r(gc,{panelProps:{...Ua,panelSize:p,onClose:y?en:void 0},enabledModules:tn,nav:w,bus:n,hasUnread:Xc.value,onSelectConversation:_d,onStartNewConversation:fr,onSetPanelSize:Xe})};if(e.mode==="page"){let p=A=>{vr(A.conversationId)},y=tn.some(A=>A.layout==="chat");return r("div",{class:`${nr}-anchor`,children:r(Xl,{site:Ac,blocks:Lc,transport:G,strings:Fe.strings,locale:Fe.locale,persistence:o,visitorId:a,showConversations:y,onSelectConversation:p,onNewConversation:fr,sidebarCollapsed:Nc,onToggleSidebarCollapsed:ld,children:br("fullscreen")})})}if(ne){let p=e.mode==="standalone"?"fullscreen":Ae;return r("div",{class:`${nr}-anchor`,children:br(p)})}let qa=e.mode==="drawer",Va=!(e.mode==="modal")&&!e.launcher.hidden&&(!O||ve),Wa=Va&&!ve&&!Oe&&!qa?Fe.launcher.callout:null;return r("div",{class:`${nr}-anchor`,"data-launcher-size":Fe.launcher.size,children:[O||H?r("div",{class:`${nr}-surface`,hidden:!O,children:br(Ae)}):null,Va?r(ll,{onToggle:pr,launcher:Fe.launcher,strings:Fe.strings,leaving:ve,edgeTab:qa}):null,Wa?r(cl,{callout:Wa,launcherPosition:Fe.position,strings:Fe.strings,closeLabel:Fe.strings.close,onDismiss:qe}):null]})}function Em(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Rm=120;async function Im(e,t,n){let o=[];for(let a of t)try{let{id:i,url:l}=await e.uploadFile(a.file);o.push({id:i,name:a.name,mediaType:a.mediaType,size:a.size,url:l})}catch(i){n(i)}return o}function or(e,t,n,o){let a={role:n,text:o};e.emit("message",a),t.onMessage?.(a)}var Am=V.scope("error-boundary"),rr=class extends ut{constructor(){super(...arguments);K(this,"state",{crashed:!1})}componentDidCatch(n,o){Am.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 Mm="1",Lm=60,Om=2e3,wc={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 Nm(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Dm(){return location.origin+location.pathname}function $m(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Cc(e,t){let n=Math.random(),o=0,a=0,i=new Set,l=(c,d)=>{let{tracking:u,publicKey:f,aiAgentDeploymentId:_,mode:g,themeMode:h}=t.getOptions();if(!u.enabled||Nm()||n>=u.sampleRate)return;let P=performance.now();if(P-o>6e4&&(o=P,a=0),++a>Lm)return;let m=new URLSearchParams;m.set("v",Mm),m.set("_ev",Lt),m.set("e",c),u.token&&m.set("tk",u.token),f&&m.set("pk",f),_&&m.set("dep",_),m.set("vid",t.getVisitorId());let b=t.getConversationId();b&&m.set("cid",b),m.set("url",Dm());let w=$m();w&&m.set("ref",w),m.set("sw",String(screen.width)),m.set("sh",String(screen.height)),m.set("vw",String(innerWidth)),m.set("vh",String(innerHeight)),m.set("dpr",String(devicePixelRatio)),m.set("lang",navigator.language);try{m.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(m.set("m",g),m.set("th",h),d)for(let[J,Y]of Object.entries(d))Y!==void 0&&m.set(J,String(Y));m.set("ts",String(Date.now()));let v=`${u.endpoint}?${m}`;if(v.length>Om)return;let k=new Image(1,1);i.add(k);let $=()=>i.delete(k);k.addEventListener("load",$,{once:!0}),k.addEventListener("error",$,{once:!0}),k.src=v},s=Object.keys(wc).map(c=>e.on(c,d=>l(c,wc[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function Tc(e){let{bus:t,host:n,appRoot:o,persistence:a,reportError:i}=e,l=e.initialRaw,s,c=Nt(l),d=!0,u=()=>{c=Nt(s?Hr(l,s):l)},f=()=>{Ni(n,sn(c.mode));let h=a.loadUserPrefs().themeMode;Di(n,h?{...c,themeMode:h}:c),d&&(_o(n,ar(c)),d=!1)},_=()=>{f(),to(eo(rr,{onError:i},eo(kc,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",h=>{h.config&&(h.config.storageVersion&&a.rememberStorageVersion(h.config.storageVersion),s=h.config,u(),_())});let g=Cc(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:_,setUserOptions:h=>{l=h,u(),_()},patchUserOptions:h=>{l={...l,...h},u(),_()},destroy:()=>g()}}function ar(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=$t(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=pn(e,Ut(),t.loadPanelOpen(),t.loadPanelSize());return So(e.mode,o,n)}var Fm=V.scope("hooks"),ir="*",Sa=new Set;function Ec(e,t,n){let o={widgetId:e,event:t,listener:n};return Sa.add(o),()=>{Sa.delete(o)}}function Bm(e,t,n){let o=[...Sa];for(let a of o)if(Hm(a.widgetId,e.widgetId)&&!(a.event!==ir&&a.event!==t))try{a.listener(e,t,n)}catch(i){Fm.warn("hook listener threw",{event:t,error:i})}}function Rc(e,t){let n=[];for(let o of zm)n.push(t.on(o,a=>{Bm(e,o,a)}));return()=>{for(let o of n)o()}}function Hm(e,t){return e===ir||e===t}var zm=["open","close","expand","fullscreen","resize","message","send","stop","clear","selectConversation","suggestion","toggleHistory","formSubmit","toolResult","toolDecision","messageFeedback","contentView","contentOpen","contentSearch","contentRead","contentLinkClick","attach","removeAttachment","voiceStart","voiceStop","voiceCancel","localeChange","themeChange","textSizeChange","soundToggle","sidebarToggle","calloutDismiss","error","handshake","visitorRebound","conversationRebound"];var ct=new Map;function Ic(e){e.debug!==void 0&&io(e.debug);let t=V.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=Nt(e),o=n.widgetId,a=ct.get(o);a&&(t.debug("destroy existing instance at slot",{widgetId:o}),a.destroy());let i=ar(n),l=n.iframe?Bi({position:sn(n.mode)},n.position,i,n.mode,e.target??null):co({position:sn(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new po,c=$t(o,n.storage,n.aiAgentDeploymentId),d=P=>{s.emit("error",P),u.getOptions().onError?.(P)},u=Tc({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});u.render();let f=l.hostElement,_=null,g=P=>{P.debug!==void 0&&io(P.debug),u.patchUserOptions(P)},h={widgetId:o,open:()=>an(f,"open"),close:()=>an(f,"close"),expand:()=>an(f,"expand"),openForm:P=>an(f,"openForm",P),on:(P,m)=>s.on(P,m),update:P=>{t.debug("update",{patch:P}),g(P)},setUserContext:P=>{t.debug("setUserContext",{keys:Object.keys(P)}),g({userContext:{...u.getUserOptions().userContext,...P}})},clearUserContext:()=>{t.debug("clearUserContext"),g({userContext:void 0})},setPageContext:P=>{t.debug("setPageContext",{keys:Object.keys(P)}),g({pageContext:{...u.getUserOptions().pageContext,...P}})},clearPageContext:()=>{t.debug("clearPageContext"),g({pageContext:void 0})},setDebug:P=>{io(P),t.info("debug level set",{level:Lr()})},debugLevel:()=>Lr(),onLog:P=>gi(P),destroy:()=>{t.info("destroy",{widgetId:o}),_?.(),u.destroy(),s.clear(),to(null,l.appRoot),l.destroy(),ct.get(o)===h&&ct.delete(o)}};return _=Rc(h,s),ct.set(o,h),h}function Um(e){let t=e.widgetId??"default",n=ct.get(t);return n?(n.update(e),n):Ic(e)}function qm(e){if(e!==void 0){ct.get(e)?.destroy();return}let t=[...ct.values()];for(let n of t)n.destroy()}function Vm(e="default"){return ct.get(e)??null}function Wm(){return[...ct.values()]}function Gm(e,t,n){return Ec(e,t,n)}var Km=Lt,jm=S;
|
|
41
|
+
`).trim(),H=!$&&e.status!=="error"&&!P.value&&j.length>0,He=O||H;return r("div",{class:`${Te}-bubble-row`,"data-role":e.role,"data-mid":e.serverMessageId??e.id,"data-testid":Ce(C.messageBubble,e.id),children:r("div",{class:`${Te}-bubble-col`,children:[r("div",{class:`${Te}-bubble`,children:[e.role==="operator"&&e.operatorInitials?r("span",{class:`${Te}-bubble-author`,children:e.operatorInitials}):null,r("div",{class:`${Te}-bubble-body`,children:[Q?r(qp,{label:t.loading}):h.map((ue,L)=>r(Fp,{part:ue,active:J,strings:t,showReasoning:o,showToolCalls:a,showSources:i,interactive:l&&(ue.kind!=="tool"||L>v.value),superseded:s,tool:c},zp(ue))),ae&&r(Up,{}),e.status==="error"&&e.errorText||P.value?r("div",{class:`${Te}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${Te}-error-retry`,onClick:d,"data-testid":C.messageRetry,children:t.errorRetry}):null]}):null]})]}),oe||He?r("div",{class:`${Te}-bubble-meta`,children:[oe?r("time",{class:`${Te}-bubble-time`,dateTime:oe.iso,title:oe.full,children:oe.short}):null,He?r("div",{class:`${Te}-bubble-actions`,children:[O&&e.serverMessageId?r(Ll,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:f}):null,H?r(Dp,{text:j,strings:t}):null]}):null]}):null]})})}function Dp({text:e,strings:t}){let[n,o]=R(!1),a=()=>{navigator.clipboard?.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)}).catch(()=>{})},i=n?t.copied:t.copy;return r("button",{type:"button",class:`${Te}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:a,"data-testid":C.messageCopy,children:n?r(St,{}):r(rl,{})})}function $p(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 Fp({part:e,active:t,strings:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l,superseded:s,tool:c}){switch(e.kind){case"step-start":return null;case"text":return r(Ko,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(Hp,{part:e,active:t,strings:n}):null;case"tool":return r(Bp,{part:e,strings:n,showToolCalls:a,interactive:l,superseded:s,tool:c});case"file":return e.mediaType.startsWith("image/")?r("img",{src:e.url,alt:"",loading:"lazy"}):r("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return i?r(Ol,{part:e,strings:n}):null}}function Bp({part:e,strings:t,showToolCalls:n,interactive:o,superseded:a,tool:i}){let l=ee(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(kl(e.toolName))return r(Fl,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit});if(l.value)return r(Nl,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(Hl,{part:e,strings:t}):null}function Hp({part:e,active:t,strings:n}){return r("details",{class:`${Te}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Te}-reasoning-summary`,children:r("span",{class:`${Te}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Te}-reasoning-body`,children:r(Ko,{textSig:e.textSig,doneSig:e.doneSig})})]})}function zp(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 Up(){return r("span",{class:`${Te}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function qp({label:e}){return r("span",{class:`${Te}-loading`,role:"status",children:[r("span",{class:`${Te}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Te}-loading-label`,children:e})]})}var Et=S.cssPrefix,Pa=120,Vp=350;function Ul({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,enableMessageFeedback:l,onFeedback:s,loading:c,idle:d,controlMode:u,tool:f,onRetry:_,form:g,formMarkers:h,onFillForm:P}){let m=F(null),b=ee(()=>e.value),[w,v]=R(!1),k=F(!1),$=F(!1),Q=F(!1),J=F(0),ae=()=>Q.current||performance.now()-J.current<Vp,oe=F(0),N=x=>{let q=x.scrollHeight-x.clientHeight>1;x.dataset.fadeTop=q&&x.scrollTop>1?"true":"false",x.dataset.fadeBottom=q&&x.scrollHeight-x.scrollTop-x.clientHeight>1?"true":"false"},O=x=>v(x.scrollHeight-x.scrollTop-x.clientHeight>Pa*2),j=x=>{oe.current=performance.now(),x.scrollTop=x.scrollHeight,N(x)},H=(x,q)=>{j(x);let ve=q,ye=0,Pe=()=>{j(x),--ve>0&&(ye=requestAnimationFrame(Pe))};return q>0&&(ye=requestAnimationFrame(Pe)),()=>cancelAnimationFrame(ye)},He=(x,q)=>{let ve,ye,Pe,ce=-1,Ye=()=>{ve.disconnect(),ye.disconnect(),clearTimeout(Pe)},Ne=()=>{if($.current||ae()||ce>=0&&x.scrollTop<ce-4)return Ye();j(x),ce=x.scrollTop};return ve=new ResizeObserver(Ne),ye=new MutationObserver(Ne),Ne(),ve.observe(x),ye.observe(x,{childList:!0,subtree:!0,characterData:!0}),Pe=setTimeout(Ye,q),Ye},ue=b.value[0]?.id;yt(()=>{let x=m.current;if(x&&b.value.length!==0&&(k.current=!0,!!b.value.some(q=>q.role==="user")))return He(x,300)},[ue]);let L=F(0);T(()=>{let x=m.current,q=b.value,ve=L.current;if(L.current=q.length,!x||!k.current)return;if(q.slice(ve).some(Pe=>Pe.role==="user"))return $.current=!1,H(x,3);if(!q.some(Pe=>Pe.role==="user")||$.current||ae())return;x.scrollHeight-x.scrollTop-x.clientHeight<Pa&&j(x)},[b.value.length]);let z=F(null);T(()=>{let x=m.current,q=b.value.at(-1),ve=z.current;if(z.current=q?.id??null,!!x&&k.current&&!(!q||q.id!==ve||q.status!=="streaming"))return $.current=!1,H(x,3)},[b.value]),T(()=>{let x=m.current;if(!x)return;let q=b.value.at(-1);if(!q||q.status!=="streaming"&&!b.value.some(Pe=>Pe.role==="user"))return;let ve=()=>{if($.current||ae())return;x.scrollHeight-x.scrollTop-x.clientHeight<Pa*2&&j(x)};if(q.status!=="streaming")return He(x,300);ve();let ye=new MutationObserver(ve);return ye.observe(x,{childList:!0,subtree:!0,characterData:!0}),()=>ye.disconnect()},[b.value]);let Z=g?.form.id,he=!!g&&(h??[]).some(x=>x.formId===g.form.id);yt(()=>{let x=m.current;!x||!Z||$.current||b.value.some(q=>q.role==="user")&&(he?x.querySelector(`[data-testid="${C.formGate}"]`)?.scrollIntoView({block:"nearest"}):j(x))},[Z,he]),T(()=>{let x=m.current;if(!x)return;let q=()=>{O(x),N(x),performance.now()-oe.current>150&&($.current=x.scrollHeight-x.scrollTop-x.clientHeight>8)},ve=()=>{$.current=!0},ye=dt=>{dt.deltaY<0&&ve()},Pe=0,ce=dt=>{Pe=dt.touches[0]?.clientY??0,Q.current=!0},Ye=dt=>{(dt.touches[0]?.clientY??0)>Pe+4&&ve()},Ne=()=>{Q.current=!1,J.current=performance.now()},Mn=()=>{Q.current=!0};return x.addEventListener("scroll",q,{passive:!0}),x.addEventListener("wheel",ye,{passive:!0}),x.addEventListener("touchstart",ce,{passive:!0}),x.addEventListener("touchmove",Ye,{passive:!0}),x.addEventListener("touchend",Ne,{passive:!0}),x.addEventListener("touchcancel",Ne,{passive:!0}),x.addEventListener("pointerdown",Mn,{passive:!0}),window.addEventListener("pointerup",Ne,{passive:!0}),window.addEventListener("pointercancel",Ne,{passive:!0}),O(x),()=>{x.removeEventListener("scroll",q),x.removeEventListener("wheel",ye),x.removeEventListener("touchstart",ce),x.removeEventListener("touchmove",Ye),x.removeEventListener("touchend",Ne),x.removeEventListener("touchcancel",Ne),x.removeEventListener("pointerdown",Mn),window.removeEventListener("pointerup",Ne),window.removeEventListener("pointercancel",Ne)}},[]);let Ge=()=>{let x=m.current;x&&($.current=!1,j(x))},Oe=[],je="",Re=b.value.at(-1)?.id,qe=[...h??[]].toSorted((x,q)=>(x.createdAt??1/0)-(q.createdAt??1/0)),Ae=x=>g&&x.formId===g.form.id?r(ca,{form:g.form,strings:t,onSubmit:g.onSubmit,onSkip:g.onSkip},`gate:${x.formId}`):r(Sl,{marker:x,strings:t,onFill:!g&&P?()=>P(x.formId):void 0},x.key),Xe=x=>{for(let q=qe[0];q?.createdAt!==void 0&&!(x!==void 0&&q.createdAt>x);q=qe[0])qe.shift(),Oe.push(Ae(q))};for(let x of b.value){if(x.role==="assistant"&&x.id!==Re&&st(x))continue;Xe(x.createdAt);let q=Wp(x.createdAt);q&&q!==je&&(Oe.push(r("div",{class:`${Et}-date-divider`,children:r("span",{class:`${Et}-date-pill`,title:Kp(x.createdAt),children:Gp(x.createdAt,t)})},`day:${q}`)),je=q),Oe.push(r(zl,{message:x,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:!!d&&x.id===Re,controlMode:u,superseded:x.id!==Re,tool:f,onRetry:d&&x.id===Re?_:void 0,enableMessageFeedback:l,onFeedback:s},x.id))}for(let x of qe)Oe.push(Ae(x));return r("div",{class:`${Et}-list-wrap`,children:[r("div",{ref:m,class:`${Et}-list ${Et}-list--fade`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[c&&b.value.length===0?r("div",{class:`${Et}-list-loading`,role:"status",children:t.conversationLoading}):null,Oe,g&&!he?r(ca,{form:g.form,strings:t,onSubmit:g.onSubmit,onSkip:g.onSkip}):null]}),w?r("button",{type:"button",class:`${Et}-jump`,onClick:Ge,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":C.scrollToBottom,children:r(kt,{})}):null]})}function Wp(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Kp(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Gp(e,t){let n=new Date(e),o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),a=Math.round((o(new Date)-o(n))/864e5);return a<=0?t.dateToday:a===1?t.dateYesterday:a<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var jp=["today","yesterday","lastWeek","older"];function Xp(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((ql(e)-ql(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function Vl(e,t){let n=new Map;for(let o of t){let a=Xp(e,o.lastMessageAt),i=n.get(a);i?i.push(o):n.set(a,[o])}return jp.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function ql(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Yp=W.scope("history"),Jp=3,Qp=6,Zp={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function em(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 Qo({transport:e,strings:t,locale:n,persistence:o,visitorId:a,onSelect:i,onNewConversation:l}){let s=S.cssPrefix,c=e.peekConversations({visitorId:a}),[d,u]=R(c?"loaded":"loading"),[f,_]=R(c?.conversations??[]);T(()=>{let m=!1;return e.listConversations({visitorId:a}).then(b=>{if(m)return;let w=b.conversations??[];_(w),u("loaded"),o.saveHistoryCount(w.length)}).catch(b=>{m||(Yp.warn("listConversations failed",{err:b}),u("error"))}),()=>{m=!0}},[e,a,o]);let g=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":C.sidebarNewConversation,children:[r(As,{}),t.newConversation]})}):null;if(d==="loading"){let m=Math.min(o.loadHistoryCount()??Jp,Qp);return r(se,{children:[r("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:r("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[r("div",{class:`${s}-history-heading`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),r("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,m)},(b,w)=>r("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[r("span",{class:`${s}-history-avatar ${s}-skeleton`}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),r("span",{class:`${s}-history-time`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),r("span",{class:`${s}-history-row`,children:r("span",{class:`${s}-history-preview`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},w))})]})}),g]})}if(d==="error"||f.length===0)return r(se,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),g]});let h=Date.now(),P=Vl(h,f);return r(se,{children:[r("div",{class:`${s}-history`,role:"list",children:P.map(m=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[Zp[m.bucket]]}),r("div",{class:`${s}-history-card`,children:m.conversations.map(b=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(b),"data-closed":b.canContinue?void 0:"true","data-unread":b.hasUnread?"true":void 0,"data-testid":Ce(C.historyItem,b.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(ta,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:b.title}),r("span",{class:`${s}-history-time`,children:em(b.lastMessageAt,h,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:b.preview??(b.canContinue?t.historyContinue:t.conversationClosed)}),b.hasUnread?r("span",{class:`${s}-history-dot`}):null]})]})]},b.conversationId))})]},m.bucket))}),g]})}var Wl=S.cssPrefix;function Kl({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${Wl}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${Wl}-suggestion`,onClick:()=>t(n),"data-testid":Ce(C.suggestion,o),children:n.label},n.id))})}var Ee=S.cssPrefix;function Gl(e){let{options:t,onClose:n}=e,o=t.strings,a=F(null);T(()=>{let c=a.current;if(!c)return;let d=Ho(c),u=f=>{f.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let i=e.composerApiRef,l=D(c=>{i.current?.attachFromDrop(c)},[i]),{visible:s}=qo({containerRef:a,onDrop:l});return Fo(a.current,t.mode==="modal"),r("div",{ref:a,class:`${Ee}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":C.panel,children:[r(xa,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),r(Sa,{poweredBy:e.options.poweredBy})]})}function xa(e){let{options:t,transport:n,feedback:o,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,controlMode:u,assignedOperatorInitials:f,operatorAvailable:_,operatorRequestEnabled:g,onRequestOperator:h,onCancelRequest:P,loadingMessages:m,messagesSig:b,agent:w,suggestions:v,initialWidgetSize:k,visitorId:$,onClose:Q,onBack:J,onClear:ae,onToggleHistory:oe,onSelectHistoryConversation:N,onNewConversation:O,onWidgetSizeChange:j,onSend:H,onStop:He,onSuggestion:ue,activeForm:L,formMarkers:z,onFormSubmit:Z,onFormSkip:he,onFormFill:Ge,tool:Oe,onRetry:je,onMessageFeedback:Re,containerEl:qe,dragOver:Ae,composerAttachApiRef:Xe}=e,x=t.strings,q;return L?q=null:c?q=r(se,{children:[u&&u!=="ai-agent"?r(om,{controlMode:u,operatorInitials:f,operatorAvailable:_,onCancelRequest:P,strings:x}):null,!d&&u==="ai-agent"&&r(Kl,{suggestions:v,onPick:ue}),r(hl,{options:t,transport:n,feedback:o,bus:a,isStreaming:d,operatorRequestEnabled:g,controlMode:u,onRequestOperator:h,onSend:H,onStop:He,attachApiRef:Xe})]}):q=r(nm,{label:x.conversationClosed,ctaLabel:x.startNewConversation,onNewConversation:ae}),r(se,{children:[s==="history"?r(tm,{strings:x,onBack:oe,onClose:Q,showClose:Bo(t.mode,l,t.actions)}):r("header",{class:`${Ee}-header`,"data-testid":C.panelHeader,children:[J?r("button",{type:"button",class:`${Ee}-icon-btn`,onClick:J,"aria-label":x.moduleBack,title:x.moduleBack,children:r(Pn,{})}):null,w?r(ml,{agent:w,strings:x}):r("h1",{children:x.panelTitle}),r(et,{panelProps:e,variant:"chat"})]}),s==="history"?r(Qo,{transport:n,strings:x,locale:t.locale,persistence:i,visitorId:$,onSelect:ve=>N(ve.conversationId),onNewConversation:O}):r(se,{children:[r(vl,{visible:Ae,strings:x}),r(Ul,{messagesSig:b,strings:x,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Re,loading:m,idle:!d,controlMode:u,tool:Oe,onRetry:je,form:L?{form:L,onSubmit:Z,onSkip:he}:null,formMarkers:z,onFillForm:Ge}),q,r(am,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r($o,{panelEl:qe,resize:t.size.resize,position:t.position,initialSize:k,onSizeChange:j,strings:x}):null]})}function tm({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Ee}-header`,children:[r("button",{type:"button",class:`${Ee}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(Pn,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Ee}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(Ze,{})}):null]})}function nm({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Ee}-readonly-banner`,role:"note",children:[r("span",{class:`${Ee}-readonly-label`,children:e}),r("button",{type:"button",class:`${Ee}-readonly-cta`,onClick:n,children:t})]})}function om({controlMode:e,operatorInitials:t,operatorAvailable:n,onCancelRequest:o,strings:a}){let i=rm(e,t,n,a);return r("div",{class:`${Ee}-operator-banner`,role:"status","data-mode":e,"data-testid":C.operatorBanner,children:[r("span",{class:`${Ee}-operator-pulse`,"aria-hidden":"true"}),r("span",{class:`${Ee}-operator-label`,children:i}),e==="awaiting_operator"&&o?r("button",{type:"button",class:`${Ee}-operator-cancel`,"data-testid":C.operatorCancelRequest,onClick:o,children:a.cancelOperatorRequest}):null]})}function rm(e,t,n,o){return e==="operator"?o.chattingWithOperator.replace("{operator}",t??""):n===!1?o.noOperatorAvailable:o.connectingOperator}function am({disclaimer:e}){return e?r("div",{class:`${Ee}-composer-footer`,children:r("div",{class:`${Ee}-disclaimer`,children:e})}):null}function Sa({poweredBy:e}){return e?r("div",{class:`${Ee}-poweredby-bar`,children:r(im,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function im({logoUrl:e,text:t,href:n}){let o=r(se,{children:[e?r("img",{class:`${Ee}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Ee}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Ee}-poweredby`,children:o})}function jl(e){let t=F(e);t.current=e;let n=F(null);return n.current??(n.current=sm(t)),n.current}function sm(e){let t=U(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,a=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(o(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,d)=>{if(t.value)return;let u=e.current;if(c==="manual"){let f=u.forms.list.find(_=>_.id===d);f&&(t.value={form:f,trigger:"manual"});return}for(let f of u.forms.byTrigger[c]??[]){let _=f.triggers.find(g=>g.kind===c);if(!(!_||!lm(_,u)||a(f)||!cm(f,u))){t.value={form:f,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:f,trigger:_}=u;f.frequency==="conversation"?n.add(o(f.id)):f.frequency!=="always"&&e.current.persistence.saveFormDone(f.id),e.current.onComplete(f,_,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(u=>u.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function lm(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function cm(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let a=t.userContext()??{};if(n.missingContext.some(i=>a[i]!==void 0&&a[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 Xl(e){let t=S.cssPrefix,{site:n,blocks:o,strings:a,collapsed:i}=e,l=o?.navigation??[],s=o?.linkCards??[],c=i?a.expandSidebar:a.collapseSidebar;return r("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":C.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(dm,{site:n}),r("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":C.sidebarToggle,children:r(_m,{collapsed:i})})]}),i?null:r(se,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(um,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(pm,{items:s})}):null,e.showConversations?r("div",{class:`${t}-sidebar-conversations`,children:r(Qo,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function dm({site:e}){let t=S.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return r("picture",{children:[e.logoDark?.url?r("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,r("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return r("div",{class:`${t}-sidebar-title`,children:e?.title??S.name})}function _m({collapsed:e}){return r("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?r("polyline",{points:"9 6 15 12 9 18"}):r("polyline",{points:"15 6 9 12 15 18"})})}function um({items:e}){let t=S.cssPrefix;return r("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>r("li",{children:r("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?r("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,r("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function pm({items:e}){let t=S.cssPrefix;return r("div",{class:`${t}-sidebar-cards`,children:e.map(n=>r("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[r("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?r("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var Yl=S.cssPrefix;function Jl(e){return r("main",{class:`${Yl}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(Xl,{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}),r("section",{class:`${Yl}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Ql=e=>Object.fromEntries(e.map(t=>[t,[]]));function Zl(e,t,n){let o=U({activeTab:e,stacks:Ql(t)});return{sig:o,switchTab(a){o.value.activeTab!==a&&(o.value={...o.value,activeTab:a},n?.(a))},push(a){let i=o.value,l=i.stacks[i.activeTab]??[];o.value={...i,stacks:{...i.stacks,[i.activeTab]:[...l,a]}}},pop(){let a=o.value,i=a.stacks[a.activeTab]??[];i.length!==0&&(o.value={...a,stacks:{...a.stacks,[a.activeTab]:i.slice(0,-1)}})},reset(a){o.value={activeTab:a,stacks:Ql(t)}}}}var ec=e=>e.stacks[e.activeTab]??[],tc=e=>ec(e).at(-1),nc=e=>ec(e).length===0;var oc={Icon:Sn};var gt=S.cssPrefix;function Zo({title:e,actions:t}){return r("header",{class:`${gt}-back-header`,"data-variant":"title",children:[r("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"}),r("h1",{class:`${gt}-back-title`,children:e}),t??r("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"})]})}function er({title:e,backLabel:t,onBack:n,actions:o,testid:a}){return r("header",{class:`${gt}-back-header`,"data-testid":a,children:[r("button",{type:"button",class:`${gt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:r(Pn,{})}),r("h1",{class:`${gt}-back-title`,children:e}),o??r("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"})]})}var Xt=S.cssPrefix;function rc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${Xt}-home-search`,onClick:t,"data-testid":C.homeSearch,children:[r("span",{class:`${Xt}-home-search-text`,children:e}),r("span",{class:`${Xt}-home-search-icon`,"aria-hidden":"true",children:r(oa,{})})]})}function ac({placeholder:e,value:t,onInput:n}){return r("div",{class:`${Xt}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${Xt}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":C.helpSearch}),r("span",{class:`${Xt}-home-search-icon`,"aria-hidden":"true",children:r(oa,{})})]})}var Tn=S.cssPrefix;function tr({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${Tn}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${Tn}-list-row-body`,children:[r("span",{class:`${Tn}-list-row-title`,children:e}),t?r("span",{class:`${Tn}-list-row-sub`,children:t}):null]}),r("span",{class:`${Tn}-list-row-chevron`,"aria-hidden":"true",children:r(Wt,{})})]})}var ic=S.cssPrefix;function We({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${ic}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${ic}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var Rt=S.cssPrefix,mm=W.scope("help"),fm=(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 gm(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 sc(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let a=0;for(let i of e){if(a=n.indexOf(i,a),a===-1)return 0;a+=1}return 1}function hm(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(sc(n,o.title)*2,sc(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,a)=>a.score-o.score).map(o=>o.item):[]}function lc({article:e,nav:t}){return r(tr,{title:e.title,subtitle:e.description,onClick:()=>fm(t,e),testid:Ce(C.helpArticle,e.id)})}function vm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,u]=R(t.errorGeneric),[f,_]=R([]),[g,h]=R(""),[P,m]=R(0);T(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(k=>{if(v)return;let $=k.items??[];_($),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:$.length})}).catch(k=>{v||(mm.warn("listContent (help) failed",{err:k}),u(Vt(k,t)),c("error"))}),()=>{v=!0}},[e,l,P,a]);let b=Le(()=>hm(f,g),[f,g]);T(()=>{let v=g.trim();if(!v)return;let k=setTimeout(()=>a.emit("contentSearch",{queryLength:v.length,hitCount:b.length}),600);return()=>clearTimeout(k)},[g,b,a]);function w(){return g.trim().length>0?b.length===0?r(We,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${Rt}-help-card`,children:b.map(v=>r(lc,{article:v,nav:o},v.id))}):s==="loading"?r(We,{message:t.helpLoading,strings:t}):s==="error"?r(We,{tone:"error",message:d,onRetry:()=>m(v=>v+1),strings:t}):f.length===0?r(We,{message:t.helpEmpty,strings:t}):gm(f).map(([v,k])=>r("section",{class:`${Rt}-help-group`,children:[v?r("h2",{class:`${Rt}-help-section-title`,children:v}):null,r("div",{class:`${Rt}-help-card`,children:k.map($=>r(lc,{article:$,nav:o},$.id))})]},v))}return r("div",{class:`${Rt}-module`,children:[r(Zo,{title:t.helpTitle,actions:r(et,{panelProps:i,variant:"plain"})}),r("div",{class:`${Rt}-module-pad`,children:r(ac,{placeholder:t.helpSearchPlaceholder,value:g,onInput:h})}),r("div",{class:`${Rt}-help-list`,children:w()})]})}var cc={Icon:xn,Root:e=>r(vm,{...e})};var dc=S.cssPrefix;function ka({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${dc}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${dc}-home-card`,"data-testid":n,children:t})}var _e=S.cssPrefix,_c=W.scope("home");function bm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Me(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 ym=(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{transport:t,strings:n,config:o,nav:a,bus:i,panelProps:l}=e,[s,c]=R(null),[d,u]=R([]),f=o.contentTags?.join(",");T(()=>{if(o.showRecentConversations===!1)return;let b=!1;return t.listConversations({limit:1}).then(w=>!b&&c(w.conversations?.[0]??null)).catch(w=>!b&&_c.warn("listConversations (home) failed",{err:w})),()=>{b=!0}},[t,o.showRecentConversations]),T(()=>{if(!o.contentTags?.length)return;let b=!1;return t.listContent({tags:o.contentTags,limit:6}).then(w=>{if(b)return;let v=w.items??[];u(v),i.emit("contentView",{section:"home",tags:f,count:v.length})}).catch(w=>!b&&_c.warn("listContent (home) failed",{err:w})),()=>{b=!0}},[t,f,i]);let _=bm(e),g=o.userAvatars??[],h=o.status,P=h?.text?Me(n,h.text):n.homeStatus,m=o.contentBlockTitle?Me(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${_e}-module ${_e}-home`,"data-testid":C.homeView,children:r("div",{class:`${_e}-home-scroll`,children:[r("div",{class:`${_e}-home-hero`,children:[r("div",{class:`${_e}-home-hero-top`,children:[o.brandName?r("span",{class:`${_e}-home-brand`,"data-testid":C.homeBrand,children:o.brandName}):r("span",{class:`${_e}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${_e}-home-hero-actions`,children:[g.length>0?r("div",{class:`${_e}-home-avatars`,children:g.map(b=>r("span",{class:`${_e}-home-avatar`,title:b.role?`${b.name} \xB7 ${b.role}`:b.name,children:b.avatar?r("img",{src:b.avatar,alt:"",loading:"lazy"}):r("span",{children:zo(b.name)})},b.name))}):null,r(et,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(se,{children:[r("h1",{class:`${_e}-home-greeting`,"data-testid":C.homeGreeting,children:_.title}),_.subtitle?r("p",{class:`${_e}-home-lead`,children:_.subtitle}):null]}):null]}),r("div",{class:`${_e}-home-cards`,children:[o.showSearchBar!==!1?r(rc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}):null,s?r(ka,{onClick:()=>a.selectConversation(s.conversationId),testid:C.homeRecent,children:r("div",{class:`${_e}-home-recent-row`,"data-unread":s.hasUnread?"true":void 0,children:[r("span",{class:`${_e}-home-recent-avatar`,"aria-hidden":"true",children:r(Sn,{})}),r("span",{class:`${_e}-home-recent-body`,children:[r("span",{class:`${_e}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${_e}-home-recent-preview`,children:s.preview}):null]}),s.hasUnread?r("span",{class:`${_e}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,h?r(ka,{onClick:h.url?()=>a.push({kind:"iframe",url:h.url,title:P}):void 0,children:r("div",{class:`${_e}-home-status`,"data-level":h.level??"operational",children:[r("span",{class:`${_e}-home-status-icon`,"aria-hidden":"true",children:r(Qs,{})}),r("span",{class:`${_e}-home-status-text`,children:P})]})}):null,d.length>0?r("section",{class:`${_e}-home-content`,children:[r("div",{class:`${_e}-home-content-title`,children:m}),r("div",{class:`${_e}-home-content-list`,children:d.map(b=>r(tr,{title:b.title,subtitle:b.description,onClick:()=>ym(a,b),testid:Ce(C.homeContentRow,b.id)},b.id))})]}):null]})]})})}var uc={Icon:Zs,Root:e=>r(Pm,{...e})};var ht=S.cssPrefix,xm=W.scope("news");function Sm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,u]=R(t.errorGeneric),[f,_]=R([]),[g,h]=R(0);T(()=>{let m=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(b=>{if(m)return;let w=b.items??[];_(w),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:w.length})}).catch(b=>{m||(xm.warn("listContent (news) failed",{err:b}),u(Vt(b,t)),c("error"))}),()=>{m=!0}},[e,l,g,a]);function P(){return s==="loading"?r(We,{message:t.newsLoading,strings:t}):s==="error"?r(We,{tone:"error",message:d,onRetry:()=>h(m=>m+1),strings:t}):f.length===0?r(We,{message:t.newsEmpty,strings:t}):r("div",{class:`${ht}-news-list`,children:f.map(m=>r("button",{type:"button",class:`${ht}-news-card`,onClick:()=>o.push({kind:"content",id:m.id,title:m.title}),"data-testid":Ce(C.newsItem,m.id),children:[m.image?r("img",{class:`${ht}-news-hero`,src:m.image,alt:"",loading:"lazy"}):null,r("span",{class:`${ht}-news-body`,children:[r("span",{class:`${ht}-news-title`,children:m.title}),m.description?r("span",{class:`${ht}-news-summary`,children:m.description}):null]})]},m.id))})}return r("div",{class:`${ht}-module`,children:[r(Zo,{title:t.newsTitle,actions:r(et,{panelProps:i,variant:"plain"})}),r("div",{class:`${ht}-module-scroll`,children:P()})]})}var pc={Icon:el,Root:e=>r(Sm,{...e})};var nr={chat:oc,home:uc,help:cc,news:pc};var En=S.cssPrefix;function mc({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:a}){return r("nav",{class:`${En}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=nr[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&o;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${En}-tab`,onClick:()=>a(i.id),"data-testid":Ce(C.tab,i.id),children:[r("span",{class:`${En}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${En}-tab-badge`,"data-testid":C.tabBadge,"aria-label":"Unread"}):null]}),r("span",{class:`${En}-tab-label`,children:Me(n,i.label)})]},i.id)})})}var fc=S.cssPrefix,km="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function gc({url:e,title:t,strings:n,onBack:o,actions:a}){return r("div",{class:`${fc}-module`,children:[r(er,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:a}),r("iframe",{class:`${fc}-content-frame`,src:e,title:t||"content",sandbox:km,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Rn=S.cssPrefix,wm=W.scope("content"),Cm=5e3;function hc({id:e,title:t,transport:n,strings:o,bus:a,onBack:i,actions:l}){let[s,c]=R(null),[d,u]=R(!1),[f,_]=R(0),g=D(()=>{u(!1),c(null),_(m=>m+1)},[]);T(()=>{let m=!1;return n.listContent({ids:[e],limit:1}).then(b=>{if(m)return;let w=b.items[0];w?(c(w),a.emit("contentOpen",{contentId:e,tags:w.tags?.length?w.tags.join(","):void 0})):u(!0)}).catch(b=>{m||(wm.warn("listContent (reader) failed",{err:b}),u(!0))}),()=>{m=!0}},[n,e,f,a]),T(()=>{if(!s)return;let m=setTimeout(()=>a.emit("contentRead",{contentId:e}),Cm);return()=>clearTimeout(m)},[s,e,a]);let h=D(m=>{let w=m.target?.closest?.("a")?.getAttribute("href")??"";w&&!w.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function P(){return d?r(We,{tone:"error",message:o.errorGeneric,onRetry:g,strings:o}):s===null?r(We,{message:o.contentLoading,strings:o}):r("article",{class:`${Rn}-content`,"data-testid":C.contentView,onClick:h,children:[s.image?r("img",{class:`${Rn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Rn}-content-subtitle`,children:s.description}):null,r(Ml,{text:s.content??""})]})}return r("div",{class:`${Rn}-module`,children:[r(er,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:C.backHeader}),r("div",{class:`${Rn}-module-scroll`,"data-testid":C.contentScroll,children:P()})]})}var or=S.cssPrefix;function vc({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=F(null),f=F(new Set);T(()=>{let O=u.current;if(!O)return;let j=Ho(O),H=He=>{He.key==="Escape"&&e.onClose?.()};return O.addEventListener("keydown",H),()=>{j(),O.removeEventListener("keydown",H)}},[e.onClose]);let _=e.composerApiRef,g=D(O=>{_.current?.attachFromDrop(O)},[_]),{visible:h}=qo({containerRef:u,onDrop:g});Fo(u.current,c.mode==="modal");let P=ee(()=>n.sig.value).value,m=tc(P),b=c.modules.byId[P.activeTab],w=m?.kind==="iframe"||m?.kind==="content",v=t.length>1&&(nc(P)||!w),k=F(null);T(()=>{if(w&&k.current===null)k.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!w&&k.current!==null){let O=k.current;k.current=null,s(O)}},[w]);let $={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:O=>{let j=t.find(H=>H.layout===O);j&&n.switchTab(j.id)},selectConversation:i,startNewConversation:l},Q=O=>({options:c,transport:e.transport,strings:d,config:O,visitorId:e.visitorId,nav:$,bus:o,panelProps:e}),J=r(et,{panelProps:e,variant:"plain"});b&&f.current.add(b.id);let ae=t.filter(O=>f.current.has(O.id)),oe=O=>{if(O.layout==="chat")return r(xa,{...e,containerEl:u.current,dragOver:h,composerAttachApiRef:_});let j=nr[O.layout].Root;return j?r(j,{...Q(O)}):null},N=()=>m?.kind==="iframe"?r(gc,{url:m.url,title:m.title,strings:d,onBack:n.pop,actions:J}):m?.kind==="content"?r(hc,{id:m.id,title:m.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:J}):null;return r("div",{ref:u,class:`${or}-panel ${or}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":C.messengerHome,children:[r("div",{class:`${or}-messenger-body`,children:[ae.map(O=>r("div",{class:`${or}-messenger-pane`,hidden:w||O.id!==b?.id,children:oe(O)},O.id)),N()]}),v?r(mc,{modules:t,activeTab:P.activeTab,strings:d,hasUnread:a,onSelect:n.switchTab}):null,r(Sa,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(b?.layout==="chat"&&!m)?r($o,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var In=S.cssPrefix;function bc({strings:e,onClose:t}){return r("div",{class:`${In}-panel ${In}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":C.modulesEmpty,children:[t?r("button",{type:"button",class:`${In}-icon-btn ${In}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(Ze,{})}):null,r("p",{class:`${In}-modules-empty-text`,children:e.modulesEmpty})]})}function yc({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[a,i]=R(()=>o?!1:t.loadCalloutDismissed(n));T(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=D(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:a,dismissCallout:l}}function Pc(e){let{transport:t}=e,n=Je("ai-agent"),o=Je(void 0),a=Je(void 0),i=D(d=>{n.value=d.controlMode,o.value=d.assignedOperatorInitials,d.operatorAvailable!==void 0&&(a.value=d.operatorAvailable)},[n,o,a]),l=D(d=>{d.type==="data-control-state"&&i(Qe(d.data))},[i]),s=D(async()=>{if(n.value!=="ai-agent")return;let d=await t.requestOperator();d&&i(Qe(d))},[t,n,i]),c=D(async()=>{if(n.value!=="awaiting_operator")return;let d=await t.cancelRequestOperator();d&&i(Qe(d))},[t,n,i]);return{controlModeSig:n,assignedOperatorInitialsSig:o,operatorAvailableSig:a,applyControlState:i,adoptControlStateChunk:l,requestOperator:s,cancelRequestOperator:c}}var Tm=W.scope("unread"),Em=300;function xc(e){let{transport:t,options:n,conversationIdSig:o,isChatActiveRef:a,applyControlState:i,activated:l,conversationReady:s}=e,c=Je(!1),d=F(new Set),u=F();T(()=>()=>clearTimeout(u.current),[]);let f=D(()=>{let m=a.current()?o.value:void 0;c.value=[...d.current].some(b=>b!==m)},[c,o,a]),_=D(()=>{n.modules.list.some(m=>m.layout==="chat")&&t.listConversations({limit:50}).then(m=>{d.current=new Set(m.conversations.filter(w=>w.hasUnread).map(w=>w.conversationId)),f();let b=m.conversations.find(w=>w.conversationId===o.value);b?.controlState&&i(Qe(b.controlState))}).catch(m=>Tm.debug("refreshUnread failed (non-fatal)",{err:m}))},[t,n.modules,f,o,i]),g=D(m=>{d.current.delete(m),f()},[f]),h=D(()=>{if(!a.current())return;let m=o.value;m&&(clearTimeout(u.current),u.current=setTimeout(()=>{g(m),t.markRead(m)},Em))},[t,o,g,a]),P=F(!1);return T(()=>{!l||!s||P.current||(P.current=!0,_())},[l,s,_]),T(()=>{if(!l)return;let m=()=>{document.visibilityState==="visible"&&_()};return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[l,_]),{hasUnreadSig:c,refreshUnread:_,clearUnread:g,markActiveConversationRead:h}}var An=W.scope("settings");function Sc(e){let{options:t,persistence:n,transport:o,feedback:a,hostElement:i,bus:l}=e,s=n.loadUserPrefs(),[c,d]=R(()=>s.locale??t.locale),[u,f]=R(()=>s.themeMode??t.themeMode),[_,g]=R(()=>s.textSize??t.textSize),h=D(k=>{n.patchUserPrefs(k),o.saveUserPrefs(n.loadUserPrefs()).catch($=>An.warn("saveUserPrefs failed",{err:$}))},[n,o]);T(()=>{s.soundMuted!==void 0&&a.setMuted(s.soundMuted)},[]),T(()=>{i.dataset.theme=u},[i,u,t]),T(()=>{i.dataset.textSize=_},[i,_,t]),T(()=>{let k=!0;return a.mutedSig.subscribe($=>{if(k){k=!1;return}h({soundMuted:$})})},[a,h]);let P=$t(c,t.availableLocales,t.defaultLocale);T(()=>{o.setLocale(P)},[o,P]),T(()=>{i.dir=ui(P)?"rtl":"ltr"},[i,P]),T(()=>{P!==c&&d(P)},[P,c]);let m=D(k=>{An.info("localeChange",{locale:k}),d(k),h({locale:k}),l.emit("localeChange",k)},[h,l]),b=D(k=>{An.info("themeChange",{mode:k}),f(k),i.dataset.theme=k,h({themeMode:k}),l.emit("themeChange",k)},[i,h,l]),w=D(k=>{An.info("textSizeChange",{size:k}),g(k),i.dataset.textSize=k,h({textSize:k}),l.emit("textSizeChange",k)},[i,h,l]),v=D(()=>{a.toggleMuted();let k=a.mutedSig.value;An.info("soundToggle",{muted:k}),l.emit("soundToggle",{muted:k})},[a,l]);return{activeLocale:c,activeThemeMode:u,activeTextSize:_,effectiveLocale:P,setActiveLocale:d,setActiveThemeMode:f,setActiveTextSize:g,patchAndSync:h,handleLocaleChange:m,handleThemeChange:b,handleTextSizeChange:w,handleSoundToggle:v}}var te=W.scope("app"),rr=S.cssPrefix,Rm=2500,Im=30;function kc(e,t){return bs({...e,text:Me(t,e.text)})}function Am(e){let t=e.partsSig.value.filter(n=>n.kind==="tool");return t.length>0&&t.every(n=>{let o=n.stateSig.value;return o==="output-available"||o==="output-error"||o==="output-denied"||o==="approval-responded"})}function wc(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function Cc({options:e,hostElement:t,bus:n}){let[o]=R(()=>Ft(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=R(()=>o.getVisitorId()),l=o.loadUserPrefs(),s=Je(o.loadConversationId()),c=Je([]),[d,u]=R(!1),[f,_]=R([]);function g(){let p=e.modules.list,y=new Set(p.map(M=>M.id)),A=o.loadActiveModule();return A&&y.has(A)?A:p[0]?.id??""}function h(){return e.modules.list.find(p=>p.layout==="chat")?.id}function P(){let p=h();return p?e.modules.list.length===1?!0:w.sig.value.activeTab===p:!1}let m=F(P);m.current=P;let b=F();if(!b.current){let p=e.modules.list.map(y=>y.id);b.current=Zl(g(),p,y=>o.saveActiveModule(y))}let w=b.current,[v,k]=R(!1),[$,Q]=R(null),[J,ae]=R(!1),oe=e.mode==="standalone"||e.mode==="inline",N=F(mn(e,qt(),o.loadPanelOpen(),o.loadPanelSize())),[O,j]=R(N.current.panelOpen),[H,He]=R(N.current.panelOpen),ue=F(H);ue.current=H;let L=F(!1),z=F(void 0);T(()=>{O&&He(!0)},[O]);let Z=F(!1),[he,Ge]=R(!1),{dismissed:Oe,dismissCallout:je}=yc({callout:e.launcher.callout,persistence:o}),Re=e.launcher.callout?.persistent??!0,qe=D(()=>{te.info("calloutDismiss"),n.emit("calloutDismiss",void 0),je()},[n,je]),[Ae,Xe]=R(N.current.panelSize),x=F(!1),[q,ve]=R("chat"),[ye,Pe]=R(!0),[ce,Ye]=R(!1),Ne=F(ce);Ne.current=ce;let[Mn,dt]=R(null),[Ln,Yt]=R([]),[Ca,Ta]=R(null),[On,Ea]=R(null),Nn=F(e.strings),cr=F(e);cr.current=e;let[Lc,Oc]=R(void 0),[Nc,Dc]=R(void 0),[$c,Fc]=R(()=>o.loadSidebarCollapsed()??!1),[dr,Bc]=R({}),[K]=R(()=>new Ro({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:ds({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[nt]=R(()=>new bn(c)),[ke]=R(()=>new Lo(e.sound,e.haptics)),{activeLocale:Dn,activeThemeMode:Ra,activeTextSize:Ia,effectiveLocale:It,setActiveLocale:Hc,setActiveThemeMode:zc,setActiveTextSize:Uc,patchAndSync:Aa,handleLocaleChange:qc,handleThemeChange:Vc,handleTextSizeChange:Wc,handleSoundToggle:Kc}=Sc({options:e,persistence:o,transport:K,feedback:ke,hostElement:t,bus:n}),{controlModeSig:_r,assignedOperatorInitialsSig:Gc,operatorAvailableSig:jc,applyControlState:$n,adoptControlStateChunk:Jt,requestOperator:Xc,cancelRequestOperator:Yc}=Pc({transport:K}),{hasUnreadSig:Jc,refreshUnread:Ma,clearUnread:La,markActiveConversationRead:Qc}=xc({transport:K,options:e,conversationIdSig:s,isChatActiveRef:m,applyControlState:$n,activated:H,conversationReady:v});T(()=>{ke.update(e.sound,e.haptics)},[ke,e.sound,e.haptics]),T(()=>()=>ke.destroy(),[ke]),T(()=>{x.current||!e.size.initialSize||(x.current=!0,!o.loadPanelSize()&&Xe(Xr(e.mode,e.size,qt())))},[e.mode,e.size,o]),T(()=>{if(!v||Z.current)return;Z.current=!0;let p=mn(e,qt(),o.loadPanelOpen(),o.loadPanelSize());j(p.panelOpen),Xe(p.panelSize)},[v,e,o]);let Oa=F(!1),Na=F(null);T(()=>{!v||Oa.current||(Oa.current=!0,w.reset(g()))},[v]);let Fn=D(p=>{!p||p.length===0||(c.value=p.map(y=>kc(y,Nn.current)))},[c]),ur=F(null),Bn=D(async p=>{try{let{formSubmissions:y}=await(p?K.bootstrap(p):ur.current??K.bootstrap()),A=new Map;return y.forEach((M,V)=>A.set(M.formId,V)),y.filter((M,V)=>!M.skipped||A.get(M.formId)===V).map((M,V)=>({key:`wire:${M.formId}:${M.createdAt??V}`,formId:M.formId,outcome:M.skipped?"skipped":"submitted",createdAt:Co(M.createdAt),values:M.values}))}catch(y){return te.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:y}),[]}},[K]),Qt=F(0),Hn=D((p,y)=>{let A=[...p.map(E=>E.createdAt),...y.map(E=>E.createdAt)].filter(E=>E!==void 0),M=(A.length?Math.min(...A):Date.now())-1;return[...(z.current?.messages??[]).map(E=>{let xe=kc(E,Nn.current);return xe.createdAt=M,xe}),...p]},[]),pr=D(async p=>{let y=Qt.current,A=()=>y!==Qt.current;u(!0);try{let[M,V]=await Promise.all([K.loadConversation(p),Bn()]);if(A())return;let E=Io(M.messages??[]);_(V);let xe=new Set(E.map(le=>le.serverMessageId).filter(le=>le!==void 0)),G=c.value.filter(le=>le.status==="streaming"&&!le.ephemeral&&!(le.serverMessageId!==void 0&&xe.has(le.serverMessageId)));if(c.value=[...Hn(E,V),...G],E.length){Pe(M.canContinue??!0),$n(Qe(M.controlState));let le=E.findLast(_t=>_t.role==="assistant"&&!_t.ephemeral);Yt(le?.suggestions??M.suggestions??[])}}catch(M){if(A())return;te.warn("loadThread failed; resetting conversationId",{err:M,conversationId:p}),s.value=void 0,o.saveConversationId(void 0)}finally{A()||u(!1)}},[K,Bn,c,s,o,Hn]),Zt=D(async({newConversation:p})=>{let y=++Qt.current,A=()=>y!==Qt.current,M=s.value,V=p||!M?ze():M;V!==M&&(s.value=V,o.saveConversationId(V));let E;try{E=await K.handshake({visitorId:a,conversationId:V,userPrefs:o.loadUserPrefs(),locale:Dn})}catch(G){if(A())return;n.emit("error",G),e.onError?.(G),p||k(!0);return}if(A())return;if(E.visitorId&&E.visitorId!==a&&(te.info("visitor rebound",{previous:a,current:E.visitorId,reason:E.rebind?.visitorId}),o.setVisitorId(E.visitorId),i(E.visitorId),n.emit("visitorRebound",{previous:a,current:E.visitorId,reason:E.rebind?.visitorId})),E.conversationId&&E.conversationId!==V&&(te.info("conversation rebound",{previous:V,current:E.conversationId,reason:E.rebind?.conversationId}),n.emit("conversationRebound",{previous:V,current:E.conversationId,reason:E.rebind?.conversationId})),E.agent&&dt(E.agent),$n(Qe(E.controlState)),e.mode==="page"&&(E.site&&ls(E.site)?Oc(E.site):E.site&&te.warn("invalid site config, using fallback",{site:E.site}),E.blocks&&cs(E.blocks)?Dc(E.blocks):E.blocks&&te.warn("invalid blocks config, using fallback",{blocks:E.blocks})),E.userPrefs&&!p&&(o.saveUserPrefs(E.userPrefs),E.userPrefs.locale&&Hc(E.userPrefs.locale),E.userPrefs.soundMuted!==void 0&&ke.setMuted(E.userPrefs.soundMuted),E.userPrefs.themeMode&&zc(E.userPrefs.themeMode),E.userPrefs.textSize&&Uc(E.userPrefs.textSize)),z.current=E.welcome,p||n.emit("handshake",E),E.welcome?.suggestions){let G=Nn.current;Yt(E.welcome.suggestions.map(le=>({...le,label:Me(G,le.label),...le.text===void 0?{}:{text:Me(G,le.text)}})))}!p&&M&&E.conversationId===M?ue.current?pr(M):L.current=!0:(s.value=E.conversationId,o.saveConversationId(E.conversationId),Fn(E.welcome?.messages)),p||k(!0)},[K,a,o,e,n,s,ke,Fn,pr,Dn]),en=JSON.stringify(e.userContext??null),Zc=JSON.stringify(e.pageContext??null),ed=JSON.stringify(dr);T(()=>{let p=Object.keys(dr).length?{...dr,...e.userContext}:e.userContext;K.setContext(p,Mm(e.pageContext))},[K,en,Zc,ed]);let td=D((p,y=[])=>Yt(p.suggestions??y),[]),zn=D(p=>{if(p.type!=="data-conversation-rebind")return!1;let y=p.data?.conversationId;if(y&&y!==s.value){let A=s.value;s.value=y,o.saveConversationId(y),K.primeIdentity(void 0,y),te.info("conversation rebound (in-stream)",{previous:A,current:y}),A&&n.emit("conversationRebound",{previous:A,current:y,reason:y})}return!0},[s,o,K,n]);T(()=>(K.primeIdentity(a,s.value),Zt({newConversation:!1}),()=>{Qt.current++}),[]),T(()=>{if(H&&(ur.current=K.bootstrap(),(async()=>{try{let p=await ur.current;Q(an((p??{forms:[]}).forms,It))}catch(p){te.debug("bootstrap failed \u2014 treating as no forms",{err:p})}finally{ae(!0)}})(),L.current)){L.current=!1;let p=s.value;p&&pr(p)}},[H]);let Un=F(null);T(()=>{if(!H)return;if(Un.current===null){Un.current=It;return}if(Un.current===It)return;Un.current=It;let p=!1;return K.bootstrap().then(y=>{p||Q(an((y??{forms:[]}).forms,It))}).catch(y=>te.debug("forms re-localize failed \u2014 keeping current copy",{err:y})),()=>{p=!0}},[H,It,K]);let Da=F(en);T(()=>{!v||Da.current===en||(Da.current=en,Zt({newConversation:!1}))},[en,v,Zt]),T(()=>{if(!H||!v||!s.value)return;let p=s.value,y=new AbortController,A=new bn(c);K.primeIdentity(a,p),te.debug("resume stream opened",{conversationId:p});let M=G=>{Jt(G);let le=c.value.length,_t=A.applyResume(G,Ne.current);if(c.value.length>le){let Wn=cr.current.modules.list.find(Kn=>Kn.layout==="chat")?.id;Wn&&w.switchTab(Wn)}_t?.role==="operator"&&(ke.play("messageReceived"),ar(n,cr.current,"operator",hn(_t)),!document.hidden&&m.current()&&K.markRead(p).catch(()=>{}))},V=async()=>{let G=await K.loadConversation(p).catch(()=>null);if(y.signal.aborted||!G?.messages?.length)return;let le=new Map(Io(G.messages).filter(De=>De.serverMessageId!==void 0).map(De=>[De.serverMessageId,De])),_t=c.value,Wn=new Set(_t.flatMap(De=>[De.serverMessageId,De.id].filter(on=>on!==void 0))),Kn=!1,md=_t.map(De=>{if(De.serverMessageId===void 0||!mt(De))return De;let on=le.get(De.serverMessageId);return on===void 0||mt(on)?De:(Kn=!0,on)}),ja=[...le.values()].filter(De=>!Wn.has(De.serverMessageId));(Kn||ja.length)&&(c.value=[...md,...ja])};ws({signal:y.signal,now:()=>performance.now(),sleep:G=>fn(G,y.signal),connect:G=>K.connectResumeStream({signal:y.signal,onChunk:M,onConnected:G}),backfill:()=>{V()}});let E=0,xe=setInterval(()=>{let G=c.value.at(-1);if(!(G!==void 0&&G.role!=="user"&&!G.ephemeral&&mt(G))){E=0;return}E++>=Im||V()},Rm);return()=>{y.abort(),clearInterval(xe),A.detach(),te.debug("resume stream closed",{conversationId:p})}},[H,v,s,s.value,a,K,Jt,c,n,ke,w]),yt(()=>{po(t,wo(e.mode,Ae,O))},[t,O,Ae,e.mode]),T(()=>{if(e.mode!=="modal"||!O)return;let p=y=>{y.composedPath().some(V=>V instanceof HTMLElement&&V.classList.contains(`${S.cssPrefix}-panel`))||j(!1)};return t.addEventListener("click",p),()=>t.removeEventListener("click",p)},[t,O,e.mode]),T(()=>{if(e.mode!=="drawer"||!O)return;let p=y=>{y.key==="Escape"&&j(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[O,e.mode]);let At=D(async(p,{continueExisting:y})=>{let A=s.value??ze();s.value||(s.value=A,o.saveConversationId(A));let M=ys(c.value,y),V=Jr({messages:M.map(Zr),conversationId:A,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});Ye(!0);let E=K.sendMessage(V);Ta(()=>E.cancel),Ea(()=>E.detach);try{for await(let G of E.iter)zn(G.chunk)||(Jt(G.chunk),nt.apply(G.chunk),G.chunk.type==="finish"&&G.chunk.canContinue===!1&&Pe(!1));let xe=p.status==="error";switch(xs(p,xe)){case"drop":c.value=c.value.filter(G=>G!==p);break;case"complete-operator-routed":p.status="complete",ke.play("messageReceived"),ar(n,e,"assistant",hn(p));break;case"error":{p.status="error",p.errorText=e.strings.errorGeneric,ke.play("error");let G=new Error(xe?"stream error chunk":"empty reply");n.emit("error",G),e.onError?.(G);break}case"complete":p.status="complete",ke.play("messageReceived"),ar(n,e,"assistant",hn(p)),td(p);break}}catch(xe){wc(xe)?mt(p)?c.value=c.value.filter(G=>G!==p):p.status="complete":(p.status="error",p.errorText=Vt(xe,e.strings),ke.play("error"),n.emit("error",xe),e.onError?.(xe))}finally{nt.detach(),Ye(!1),Ta(null),Ea(null),c.value=[...c.value],Qc()}},[K,nt,c,s,e,n,ke,o,a,zn]),qn=D((p,y)=>{if(ce)return;let A=c.value.at(-1),M=A?.partsSig.value.find(V=>V.kind==="tool"&&V.toolCallId===p);if(!A||!M){te.warn("decideTool: tool part not found",{toolCallId:p});return}y(M),A.partsSig.value=[...A.partsSig.value],Am(A)&&(A.status="streaming",c.value=[...c.value],nt.attach(A),At(A,{continueExisting:!0}))},[ce,c,nt,At]),$a=D((p,y)=>{te.info("toolResult",{toolCallId:p}),n.emit("toolResult",{toolCallId:p}),qn(p,A=>{A.outputSig.value=y,A.stateSig.value="output-available"})},[n,qn]),Fa=D((p,y,A)=>{te.info("toolDecision",{toolCallId:p,approved:y}),n.emit("toolDecision",{toolCallId:p,approved:y}),qn(p,M=>{let V=M.approvalSig.value?.id??p;M.approvalSig.value={id:V,approved:y,reason:A},M.stateSig.value="approval-responded"})},[n,qn]),Ba=D(p=>{if(ce)return;let y=c.value.at(-1),A=y?.partsSig.value.find(V=>V.kind==="tool"&&V.toolCallId===p);if(!y||!A)return;let M=A.approvalSig.value?.id??p;A.approvalSig.value={id:M},A.stateSig.value="approval-requested",y.partsSig.value=[...y.partsSig.value]},[ce,c]),nd=D((p,y)=>{te.info("messageFeedback",{messageId:p,value:y}),n.emit("messageFeedback",{messageId:p,value:y}),K.submitFeedback({messageId:p,value:y})},[n,K]),od=Le(()=>({humanInLoop:e.features.humanInLoop,onResult:$a,onDecision:Fa,onEdit:Ba}),[e.features.humanInLoop,$a,Fa,Ba]),rd=()=>c.value.reduce((p,y)=>p+(y.role==="user"?1:0),0),Mt=e.forms.list.length>0?e.forms:$??e.forms,me=jl({forms:Mt,persistence:o,userContext:()=>e.userContext,messageCount:rd,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>s.value,onComplete:(p,y,A,M)=>{te.info("formSubmit",{formId:p.id,trigger:y,skipped:M}),n.emit("formSubmit",{formId:p.id,values:A,skipped:M}),_(E=>{let G=E.find(le=>le.formId===p.id&&le.outcome==="skipped")?.createdAt??Date.now();return[...E.filter(le=>!(le.formId===p.id&&le.outcome==="skipped")),{key:`local:${p.id}:${G}`,formId:p.id,outcome:M?"skipped":"submitted",createdAt:G,...M?{}:{values:A}}]});let V=s.value??ze();s.value||(s.value=V,o.saveConversationId(V),K.primeIdentity(void 0,V)),!M&&p.mirrorToContext&&Bc(E=>({...E,...A})),K.submitForm({formId:p.id,conversationId:V,trigger:y,values:A,skipped:M})}}),ad=ee(()=>me.activeForm.value);T(()=>{me.refresh()},[Mt,me]);let Ha=e.pageContext?.area?String(e.pageContext.area):void 0,id=ee(()=>c.value.length);T(()=>{v&&J&&me.fire("pre-chat")},[v,J,me]),T(()=>{J&&!ye&&me.fire("conversation-closed")},[J,ye,me]),T(()=>{v&&J&&Ha&&me.fire("page-area")},[v,J,Ha,me]);let mr=Le(()=>{let p=Mt.list.flatMap(y=>y.triggers).filter(y=>y.kind==="idle").map(y=>Number(y.param));return p.length?Math.min(...p)*1e3:0},[Mt]);T(()=>{if(!mr||!O)return;let p=setTimeout(()=>me.fire("idle"),mr);return()=>clearTimeout(p)},[mr,O,me,id.value]);let za=D(async p=>{let y=s.value??ze();s.value||(s.value=y,o.saveConversationId(y));let A=Jr({messages:[Zr(p)],conversationId:y,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});try{for await(let M of K.sendMessage(A).iter)zn(M.chunk)||(Jt(M.chunk),M.chunk.type==="start"&&M.chunk.messageId&&M.chunk.messageMetadata?.senderRole==="visitor"&&(p.serverMessageId=M.chunk.messageId))}catch(M){if(wc(M))return;te.debug("operator-routed send failed (non-fatal)",{error:M}),n.emit("error",M instanceof Error?M:new Error(String(M))),e.onError?.(M instanceof Error?M:new Error(String(M)))}},[K,s,o,e,a,zn,Jt,n]),Ua=D(async(p,y)=>{let A=_r.value!=="ai-agent";if(te.info("send",{textLen:p.length,attachments:y.length,streaming:ce,routedToOperator:A}),ce&&!A)return;n.emit("send",{text:p,attachmentCount:y.length}),Ln.length>0&&Yt([]);let M=await Om(K,y,xe=>{te.warn("upload failed",{err:xe}),n.emit("error",xe),e.onError?.(xe)});ke.unlock(),ke.play("messageSent");let V=vs(p,M);if(ar(n,e,"user",p),A){c.value=[...c.value,V],za(V);return}let E=gn();c.value=[...c.value,V,E],nt.attach(E),await At(E,{continueExisting:!1}),me.fire("after-messages")},[ce,K,n,e,Ln.length,c,nt,At,za,me,_r]),sd=D(()=>{te.info("stop"),n.emit("stop",void 0),Ca?.()},[Ca,n]),ld=D(()=>{if(ce)return;let p=c.value,y=p.at(-1);if(!y||y.role!=="assistant"||y.status!=="error"&&!st(y))return;let A=gn();c.value=[...p.slice(0,-1),A],nt.attach(A),te.info("retry"),At(A,{continueExisting:!1})},[ce,c,nt,At]),tn=D(()=>{if(pl(e.mode,Ae)==="exit-fullscreen"){te.info("close \u2192 exit-fullscreen",{mode:e.mode}),Xe("normal"),n.emit("fullscreen",!1);return}te.info("close \u2192 panel closed",{mode:e.mode}),me.fire("panel-close"),j(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,Ae,me]),fr=D(()=>{te.info("open",{mode:e.mode}),ke.unlock(),Ge(!0),j(!0),o.savePanelOpen(!0),!Oe&&!Re&&qe(),setTimeout(()=>Ge(!1),Lm),Ma(),n.emit("open",void 0),e.onOpen?.()},[n,e,ke,o,Oe,Re,qe,Ma]),gr=D(()=>{if(!c.value.some(y=>y.role==="user")&&ye&&s.value){te.info("clear \u2192 reusing empty conversation",{conversationId:s.value}),c.value.length===0&&Fn(z.current?.messages);return}te.info("clear \u2192 new conversation",{wasStreaming:ce}),n.emit("clear",void 0),ce&&On?.(),Ht(()=>{c.value=[],s.value=void 0}),o.clearConversation(),Pe(!0),_([]),Zt({newConversation:!0})},[ce,On,c,s,o,Zt,n,ye,Fn]),hr=D(()=>{gr(),ve("chat");let p=e.modules.list.find(y=>y.layout==="chat")?.id;p&&w.switchTab(p)},[gr,w,e]),vr=D(()=>{let p=Ae==="expanded"?"normal":"expanded";te.info("expand",{from:Ae,expanded:p==="expanded"}),Xe(p),o.savePanelSize(p),n.emit("expand",p==="expanded")},[n,Ae,o]),br=D(()=>{let p=Ae==="fullscreen"?"normal":"fullscreen";te.info("fullscreen",{from:Ae,fullscreen:p==="fullscreen"}),Xe(p),o.savePanelSize(p),n.emit("fullscreen",p==="fullscreen")},[n,Ae,o]),cd=D(()=>{ve(p=>{let y=p==="history"?"chat":"history";return te.info("toggleHistory",{view:y}),n.emit("toggleHistory",{view:y}),y})},[n]),dd=D(()=>{Fc(p=>{let y=!p;return te.info("sidebarToggle",{collapsed:y}),o.saveSidebarCollapsed(y),n.emit("sidebarToggle",{collapsed:y}),y})},[o,n]),_d=D(p=>{te.info("resize",p),Aa({widgetSize:p}),n.emit("resize",p)},[Aa,n]),yr=D(async p=>{te.info("selectConversation",{conversationId:p,wasStreaming:ce}),n.emit("selectConversation",{conversationId:p}),ce&&On?.();try{let[y,A]=await Promise.all([K.loadConversation(p),Bn(p)]),M=Io(y.messages);Ht(()=>{c.value=Hn(M,A),s.value=y.conversationId}),_(A),o.saveConversationId(y.conversationId),K.primeIdentity(a,y.conversationId),y.agent&&dt(y.agent),Pe(y.canContinue),$n(Qe(y.controlState));let V=M.findLast(E=>E.role==="assistant"&&!E.ephemeral);Yt(V?.suggestions??y.suggestions??[]),ve("chat"),await K.markRead(p),La(p)}catch(y){n.emit("error",y),e.onError?.(y)}},[K,c,s,n,e,o,La,Bn,Hn,ce,On,a]),Vn=F(null),qa=D(p=>{typeof p=="string"&&(J?me.fire("manual",p):Vn.current=p)},[J,me]);T(()=>{!J||!Vn.current||(me.fire("manual",Vn.current),Vn.current=null)},[J,me]),T(()=>Ei(t,{open:fr,close:tn,expand:vr,fullscreen:br,openForm:qa}),[t,fr,tn,vr,br,qa]);let Fe=Le(()=>zr(e,Dn,Ra,Ia),[e,Dn,Ra,Ia]);Nn.current=Fe.strings;let ud=Le(()=>f.map(p=>{let y=Mt.list.find(A=>A.id===p.formId);return{...p,title:y?.title,form:y}}),[f,Mt]),Va={options:Fe,transport:K,feedback:ke,bus:n,persistence:o,composerApiRef:Na,view:q,canSend:ye,isStreaming:ce,controlMode:_r.value,assignedOperatorInitials:Gc.value,operatorAvailable:jc.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Xc,onCancelRequest:Yc,loadingMessages:d,messagesSig:c,agent:Mn,suggestions:Ln,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:tn,onClear:gr,onExpand:vr,onFullscreen:br,onSoundToggle:Kc,onToggleHistory:cd,onSelectHistoryConversation:yr,onNewConversation:hr,onLocaleChange:qc,onThemeChange:Vc,onTextSizeChange:Wc,onWidgetSizeChange:_d,onSend:Ua,onStop:sd,onSuggestion:p=>{let y=p.text??p.label;te.info("suggestion",{text:y,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:y}),e.autoSendSuggestions?Ua(y,[]):Na.current?.fill(y)},activeForm:ad.value?.form??null,formMarkers:ud,onFormSubmit:me.complete,onFormSkip:me.skip,onFormFill:p=>me.fire("manual",p),tool:od,onRetry:ld,onMessageFeedback:nd},pd=p=>{yr(p);let y=h();y&&w.switchTab(y)};if(!v)return null;let nn=Fe.modules.list,Pr=p=>{let y=kn("close",Fe.mode,p);return nn.length===0?r(bc,{strings:Fe.strings,onClose:y?tn:void 0}):nn.length===1&&nn[0]?.layout==="chat"?r(Gl,{...Va,panelSize:p}):r(vc,{panelProps:{...Va,panelSize:p,onClose:y?tn:void 0},enabledModules:nn,nav:w,bus:n,hasUnread:Jc.value,onSelectConversation:pd,onStartNewConversation:hr,onSetPanelSize:Xe})};if(e.mode==="page"){let p=A=>{yr(A.conversationId)},y=nn.some(A=>A.layout==="chat");return r("div",{class:`${rr}-anchor`,children:r(Jl,{site:Lc,blocks:Nc,transport:K,strings:Fe.strings,locale:Fe.locale,persistence:o,visitorId:a,showConversations:y,onSelectConversation:p,onNewConversation:hr,sidebarCollapsed:$c,onToggleSidebarCollapsed:dd,children:Pr("fullscreen")})})}if(oe){let p=e.mode==="standalone"?"fullscreen":Ae;return r("div",{class:`${rr}-anchor`,children:Pr(p)})}let Wa=e.mode==="drawer",Ka=!(e.mode==="modal")&&!e.launcher.hidden&&(!O||he),Ga=Ka&&!he&&!Oe&&!Wa?Fe.launcher.callout:null;return r("div",{class:`${rr}-anchor`,"data-launcher-size":Fe.launcher.size,children:[O||H?r("div",{class:`${rr}-surface`,hidden:!O,children:Pr(Ae)}):null,Ka?r(dl,{onToggle:fr,launcher:Fe.launcher,strings:Fe.strings,leaving:he,edgeTab:Wa}):null,Ga?r(_l,{callout:Ga,launcherPosition:Fe.position,strings:Fe.strings,closeLabel:Fe.strings.close,onDismiss:qe}):null]})}function Mm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Lm=120;async function Om(e,t,n){let o=[];for(let a of t)try{let{id:i,url:l}=await e.uploadFile(a.file);o.push({id:i,name:a.name,mediaType:a.mediaType,size:a.size,url:l})}catch(i){n(i)}return o}function ar(e,t,n,o){let a={role:n,text:o};e.emit("message",a),t.onMessage?.(a)}var Nm=W.scope("error-boundary"),ir=class extends pt{constructor(){super(...arguments);X(this,"state",{crashed:!1})}componentDidCatch(n,o){Nm.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 Dm="1",$m=60,Fm=2e3,Tc={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 Bm(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Hm(){return location.origin+location.pathname}function zm(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Ec(e,t){let n=Math.random(),o=0,a=0,i=new Set,l=(c,d)=>{let{tracking:u,publicKey:f,aiAgentDeploymentId:_,mode:g,themeMode:h}=t.getOptions();if(!u.enabled||Bm()||n>=u.sampleRate)return;let P=performance.now();if(P-o>6e4&&(o=P,a=0),++a>$m)return;let m=new URLSearchParams;m.set("v",Dm),m.set("_ev",Ot),m.set("e",c),u.token&&m.set("tk",u.token),f&&m.set("pk",f),_&&m.set("dep",_),m.set("vid",t.getVisitorId());let b=t.getConversationId();b&&m.set("cid",b),m.set("url",Hm());let w=zm();w&&m.set("ref",w),m.set("sw",String(screen.width)),m.set("sh",String(screen.height)),m.set("vw",String(innerWidth)),m.set("vh",String(innerHeight)),m.set("dpr",String(devicePixelRatio)),m.set("lang",navigator.language);try{m.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(m.set("m",g),m.set("th",h),d)for(let[Q,J]of Object.entries(d))J!==void 0&&m.set(Q,String(J));m.set("ts",String(Date.now()));let v=`${u.endpoint}?${m}`;if(v.length>Fm)return;let k=new Image(1,1);i.add(k);let $=()=>i.delete(k);k.addEventListener("load",$,{once:!0}),k.addEventListener("error",$,{once:!0}),k.src=v},s=Object.keys(Tc).map(c=>e.on(c,d=>l(c,Tc[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function Rc(e){let{bus:t,host:n,appRoot:o,persistence:a,reportError:i}=e,l=e.initialRaw,s,c=Dt(l),d=!0,u=()=>{c=Dt(s?Ur(l,s):l)},f=()=>{$i(n,ln(c.mode));let h=a.loadUserPrefs().themeMode;Fi(n,h?{...c,themeMode:h}:c),d&&(po(n,sr(c)),d=!1)},_=()=>{f(),oo(no(ir,{onError:i},no(Cc,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",h=>{h.config&&(h.config.storageVersion&&a.rememberStorageVersion(h.config.storageVersion),s=h.config,u(),_())});let g=Ec(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:_,setUserOptions:h=>{l=h,u(),_()},patchUserOptions:h=>{l={...l,...h},u(),_()},destroy:()=>g()}}function sr(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=Ft(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=mn(e,qt(),t.loadPanelOpen(),t.loadPanelSize());return wo(e.mode,o,n)}var Um=W.scope("hooks"),lr="*",wa=new Set;function Ic(e,t,n){let o={widgetId:e,event:t,listener:n};return wa.add(o),()=>{wa.delete(o)}}function qm(e,t,n){let o=[...wa];for(let a of o)if(Vm(a.widgetId,e.widgetId)&&!(a.event!==lr&&a.event!==t))try{a.listener(e,t,n)}catch(i){Um.warn("hook listener threw",{event:t,error:i})}}function Ac(e,t){let n=[];for(let o of Wm)n.push(t.on(o,a=>{qm(e,o,a)}));return()=>{for(let o of n)o()}}function Vm(e,t){return e===lr||e===t}var Wm=["open","close","expand","fullscreen","resize","message","send","stop","clear","selectConversation","suggestion","toggleHistory","formSubmit","toolResult","toolDecision","messageFeedback","contentView","contentOpen","contentSearch","contentRead","contentLinkClick","attach","removeAttachment","voiceStart","voiceStop","voiceCancel","localeChange","themeChange","textSizeChange","soundToggle","sidebarToggle","calloutDismiss","error","handshake","visitorRebound","conversationRebound"];var ct=new Map;function Mc(e){e.debug!==void 0&&lo(e.debug);let t=W.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=Dt(e),o=n.widgetId,a=ct.get(o);a&&(t.debug("destroy existing instance at slot",{widgetId:o}),a.destroy());let i=sr(n),l=n.iframe?zi({position:ln(n.mode)},n.position,i,n.mode,e.target??null):uo({position:ln(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new fo,c=Ft(o,n.storage,n.aiAgentDeploymentId),d=P=>{s.emit("error",P),u.getOptions().onError?.(P)},u=Rc({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});u.render();let f=l.hostElement,_=null,g=P=>{P.debug!==void 0&&lo(P.debug),u.patchUserOptions(P)},h={widgetId:o,open:()=>sn(f,"open"),close:()=>sn(f,"close"),expand:()=>sn(f,"expand"),openForm:P=>sn(f,"openForm",P),on:(P,m)=>s.on(P,m),update:P=>{t.debug("update",{patch:P}),g(P)},setUserContext:P=>{t.debug("setUserContext",{keys:Object.keys(P)}),g({userContext:{...u.getUserOptions().userContext,...P}})},clearUserContext:()=>{t.debug("clearUserContext"),g({userContext:void 0})},setPageContext:P=>{t.debug("setPageContext",{keys:Object.keys(P)}),g({pageContext:{...u.getUserOptions().pageContext,...P}})},clearPageContext:()=>{t.debug("clearPageContext"),g({pageContext:void 0})},setDebug:P=>{lo(P),t.info("debug level set",{level:Nr()})},debugLevel:()=>Nr(),onLog:P=>vi(P),destroy:()=>{t.info("destroy",{widgetId:o}),_?.(),u.destroy(),s.clear(),oo(null,l.appRoot),l.destroy(),ct.get(o)===h&&ct.delete(o)}};return _=Ac(h,s),ct.set(o,h),h}function Km(e){let t=e.widgetId??"default",n=ct.get(t);return n?(n.update(e),n):Mc(e)}function Gm(e){if(e!==void 0){ct.get(e)?.destroy();return}let t=[...ct.values()];for(let n of t)n.destroy()}function jm(e="default"){return ct.get(e)??null}function Xm(){return[...ct.values()]}function Ym(e,t,n){return Ic(e,t,n)}var Jm=Ot,Qm=S;
|
|
42
42
|
//# sourceMappingURL=elements.cjs.js.map
|