@helpai/elements 0.59.2 → 0.59.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configurator.mjs +10 -10
- package/elements-web-component.esm.js +17 -17
- package/elements-web-component.esm.js.map +3 -3
- package/elements.cjs.js +17 -17
- package/elements.cjs.js.map +3 -3
- package/elements.esm.js +17 -17
- package/elements.esm.js.map +3 -3
- package/elements.js +17 -17
- package/elements.js.map +3 -3
- package/index.d.ts +7 -7
- package/index.mjs +14 -15
- package/package.json +1 -1
- package/schema.d.ts +34 -34
- package/schema.json +30 -34
- package/schema.mjs +10 -10
- package/web-component.mjs +14 -15
package/elements.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";var HelpAI=(()=>{var Pr=Object.defineProperty;var Rd=Object.getOwnPropertyDescriptor;var Id=Object.getOwnPropertyNames;var Ld=Object.prototype.hasOwnProperty;var Md=(e,t,n)=>t in e?Pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Nd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Id(t))!Ld.call(e,a)&&a!==n&&Pr(e,a,{get:()=>t[a],enumerable:!(o=Rd(t,a))||o.enumerable});return e};var Dd=e=>Nd(Pr({},"__esModule",{value:!0}),e);var X=(e,t,n)=>Md(e,typeof t!="symbol"?t+"":t,n);var Xm={};var x={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 ai={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",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"},Od={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",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"},$d={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",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"},Fd={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",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"},Hd={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",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"},Bd={en:ai,fr:Od,ar:$d,es:Fd,he:Hd};function Kn(e,t){let n=ii(e),o=jn(t),a=n==="en"?{}:Bd[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...ai,...a,...l,...i}}function ii(e){return(e.split("-")[0]??"en").toLowerCase()}var zd=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function si(e){return zd.has(ii(e))}function Ae(e,t){return e[t]??t}function jn(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function li(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function ci(e,t){let{translations:n,defaultLocale:o,...a}=e,i=li(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function di(e,t){let{translations:n,defaultLocale:o,...a}=e,i=li(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(g=>[g.value,g]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(g=>{let _=u.get(g.value);return _?{...g,label:_.label??g.label,description:_.description??g.description}:g})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var kr=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{}}},Xn=new kr;var Cr=["off","error","warn","info","debug","trace"],Tr=x.cssPrefix,_i=`${Tr}.debug`,Ud=`__${x.global}_DEBUG__`,qd=`${Tr}-debug`,Yn=2,Sr=null;function Wd(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(qd);if(e!==null){let t=wr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(_i);if(e){let t=wr(e);if(t>=0)return t}}catch{}return window[Ud]?4:2}function wr(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=Cr.indexOf(e);if(t>=0)return t}return-1}function Jn(e){let t=wr(e);if(!(t<0)){Yn=t;try{window.localStorage?.setItem(_i,Cr[t])}catch{}}}function _n(){return Cr[Yn]}Yn=Wd();function ui(e){let t=`[${Tr}:${e}]`,n=(o,a,i)=>(l,s)=>{if(!(Yn<o)&&(s===void 0?console[a](t,l):console[a](t,l,s),Sr))try{Sr({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=>ui(`${e}:${o}`)}}var q=ui("core");function un(e){Sr=e}var bt=q.scope("context"),Vd=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),pi=50,Er=1024,Gd=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Ar(e){return mi(e,"userContext",!0)}function Rr(e){return mi(e,"pageContext",!1)}function mi(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){bt.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(Vd.has(i)){bt.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=pi){bt.warn(`${t} truncated at ${pi} keys \u2014 dropped "${i}"`);continue}let s=Kd(t,i,l);s!==void 0&&(o[i]=s,a++)}return n&&typeof o.email=="string"&&!Gd.test(o.email)&&(bt.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function Kd(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){bt.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Er?(bt.warn(`truncated ${e}.${t} to ${Er} chars`),o.slice(0,Er)):o}bt.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var Qn={maxBytes:10485760,maxCount:10,accept:"*/*"},Zn={files:!0,voice:"local",humanInLoop:!0},fi={list:[],byTrigger:{}},Ir={enabled:!0,sampleRate:1},eo={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Ht={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},gi={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"]},Lr={enabled:!0,volume:.3,events:void 0},hi={enabled:!0,events:void 0},vi=[{label:"tabConversations",layout:"chat"}],bi={showSearchBar:!0};function _t(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}=jd(t.theme),u=n.mode??"floating",g=Xd(a.defaultLocale),_=a.availableLocales??[a.locale??g],f=Bt(a.locale??g,_,g),m=(t.baseUrl??x.defaultBaseUrl).replace(/\/$/,""),P=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:P,dataApiBaseUrl:v,userContext:Ar(t.userContext),pageContext:Rr(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,scrollFade:o.scrollFade??!0,enableMessageFeedback:o.enableMessageFeedback??!0,features:{files:t.features?.files??Zn.files,voice:t.features?.voice??Zn.voice,humanInLoop:t.features?.humanInLoop??Zn.humanInLoop,tools:t.features?.tools},forms:pn(t.forms,f),endpoints:{upload:t.endpoints?.upload??eo.upload,transcribe:t.endpoints?.transcribe??eo.transcribe,submitForm:t.endpoints?.submitForm??eo.submitForm},attachments:{accept:t.composer?.attachments?.accept??Qn.accept,maxBytes:t.composer?.attachments?.maxBytes??Qn.maxBytes,maxCount:t.composer?.attachments?.maxCount??Qn.maxCount},locale:f,defaultLocale:g,availableLocales:_,startMinimized:o.startMinimized??!0,actions:Yd(u,s.actions),size:n.size??{},launcher:r_(t.launcher),sound:Jd(i.sound),haptics:Qd(i.haptics),strings:Kn(f,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:e_(l.poweredBy),composer:t_(t.composer),modules:n_(t.modules),tracking:Zd(t.tracking,v),storage:t.storage??Xn,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function jd(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function Xd(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function Bt(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function Yd(e,t){return t??gi[e]}function Jd(e){return{enabled:e?.enabled??Lr.enabled,volume:e?.volume??Lr.volume,events:e?.events}}function Qd(e){return{enabled:e?.enabled??hi.enabled,events:e?.events}}function Zd(e,t){let n=e?.sampleRate??Ir.sampleRate;return{enabled:e?.enabled??Ir.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 e_(e){let n={...{text:`Powered by ${x.displayName}`,href:x.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function t_(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function n_(e){let t=e===void 0?vi: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.showGreeting??!0,c.showSearchBar=i.showSearchBar??bi.showSearchBar,c.showRecentConversations=i.showRecentConversations??!0,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 pn(e,t){var i;if(!e?.length)return fi;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=di(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(o_).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 o_(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 r_(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??Ht.variant,size:e?.size??Ht.size,label:e?.label??Ht.label,icon:e?.icon??Ht.icon,hidden:e?.hidden??Ht.hidden,callout:t}}function Mr(e,t,n,o){let a=Bt(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=Kn(a,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var a_=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Nr(e,t){if(!t)return e;let n={...e};for(let i of a_){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]=yi(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=yi(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=i_(s,l)),n.i18n=i}return n}function yi(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 i_(e,t){if(!e)return t;if(!t)return e;let n=jn(e),o=jn(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 s_=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],nt=e=>e!=="false",Pi=e=>e.split(",").map(t=>t.trim()).filter(Boolean),ki=[["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]],Si=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",nt]],wi=[["width","width"],["height","height"]],Ci=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",nt],["show-reasoning","showReasoning",nt],["show-tool-calls","showToolCalls",nt],["show-sources","showSources",nt],["scroll-fade","scrollFade",nt],["enable-message-feedback","enableMessageFeedback",nt]],Ti=[["locale","locale"]],l_=new Set(s_),c_=e=>Pi(e).filter(t=>l_.has(t)),Ei=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",nt]],Ai=[["features-files","files",nt],["features-voice","voice",e=>e],["features-tools","tools",Pi]],Ri=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Ii=[["user-id","id"],["user-email","email"],["user-name","name"]],Li=[["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"],__=[ki,Si,wi,Ci,Ti,Ei,Ai,Ri,Ii,Li],u_=new Set(["iframe","start-minimized"]),Dr=[...__.flatMap(e=>e.map(([t])=>t).filter(t=>!u_.has(t))),...d_];function to(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,P]of ki){let v=n(f);v!==void 0&&(t[m]=P?P(v):v)}let o=yt(n,Si),a=yt(n,wi);(o||a)&&(t.presentation={...o,...a?{size:a}:{}});let i=yt(n,Ci);i&&(t.behavior=i);let l=yt(n,Ti);l&&(t.i18n=l);let s=m_(e,n);s&&(t.launcher=s);let c=yt(n,Ai);c&&(t.features=c);let d=yt(n,Ri);d&&(t.endpoints=d);let u=xi(n,Ii,"user-context");u&&(t.userContext=u);let g=xi(n,Li,"page-context");g&&(t.pageContext=g);let _=n("actions");return _!==void 0&&(t.header={actions:c_(_)}),t}function Or(e){return e?to(t=>e[p_(t)]??null):{}}function p_(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function yt(e,t){let n={};for(let[o,a,i]of t){let l=e(o);l!==void 0&&(n[a]=i?i(l):l)}return Object.keys(n).length>0?n:null}function xi(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let a={},i=e(n);if(i)try{let s=JSON.parse(i);s&&typeof s=="object"&&!Array.isArray(s)&&(a=s)}catch{}let l={...a,...o};return Object.keys(l).length>0?l:null}function m_(e,t){let n=yt(t,Ei)??{},o=e("launcher-label");o!==null&&(n.label=o);let a=t("callout-text");if(a){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:a,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var lo,ee,$i,zr,ut,Mi,Fi,Hi,$r,oo,mn,Bi,Ur,Fr,Hr,f_,ao={},io=[],g_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,co=Array.isArray;function ot(e,t){for(var n in t)e[n]=t[n];return e}function qr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function _o(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?lo.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 ro(e,l,o,a,null)}function ro(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??++$i,__i:-1,__u:0};return a==null&&ee.vnode!=null&&ee.vnode(i),i}function ie(e){return e.children}function pt(e,t){this.props=e,this.context=t}function zt(e,t){if(t==null)return e.__?zt(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"?zt(e):null}function h_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],a=[],i=ot({},t);i.__v=t.__v+1,ee.vnode&&ee.vnode(i),Wr(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??zt(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,Wi(o,i,a),t.__e=t.__=null,i.__e!=n&&zi(i)}}function zi(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}),zi(e)}function Ni(e){(!e.__d&&(e.__d=!0)&&ut.push(e)&&!so.__r++||Mi!=ee.debounceRendering)&&((Mi=ee.debounceRendering)||Fi)(so)}function so(){try{for(var e,t=1;ut.length;)ut.length>t&&ut.sort(Hi),e=ut.shift(),t=ut.length,h_(e)}finally{ut.length=so.__r=0}}function Ui(e,t,n,o,a,i,l,s,c,d,u){var g,_,f,m,P,v,y,C=o&&o.__k||io,b=t.length;for(c=v_(n,t,C,c,b),g=0;g<b;g++)(f=n.__k[g])!=null&&(_=f.__i!=-1&&C[f.__i]||ao,f.__i=g,v=Wr(e,f,_,a,i,l,s,c,d,u),m=f.__e,f.ref&&_.ref!=f.ref&&(_.ref&&Vr(_.ref,null,f),u.push(f.ref,f.__c||m,f)),P==null&&m!=null&&(P=m),(y=!!(4&f.__u))||_.__k===f.__k?(c=qi(f,c,e,y),y&&_.__e&&(_.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=P,c}function v_(e,t,n,o,a){var i,l,s,c,d,u=n.length,g=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]=ro(null,l,null,null,null):co(l)?l=e.__k[i]=ro(ie,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=ro(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=b_(l,n,c,g))!=-1&&(g--,(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(g)for(i=0;i<u;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=zt(s)),Gi(s,s));return o}function qi(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=qi(a[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=zt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function b_(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 Di(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||g_.test(t)?n:n+"px"}function no(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||Di(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Di(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Bi,"$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[mn]=o[mn]:(n[mn]=Ur,e.addEventListener(t,i?Hr:Fr,i)):e.removeEventListener(t,i?Hr:Fr,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 Oi(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[oo]==null)t[oo]=Ur++;else if(t[oo]<n[mn])return;return n(ee.event?ee.event(t):t)}}}function Wr(e,t,n,o,a,i,l,s,c,d){var u,g,_,f,m,P,v,y,C,b,T,H,Z,Y,oe,G,I=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(u=ee.__b)&&u(t);e:if(typeof I=="function"){g=l.length;try{if(C=t.props,b=I.prototype&&I.prototype.render,T=(u=I.contextType)&&o[u.__c],H=u?T?T.props.value:u.__:o,n.__c?y=(_=t.__c=n.__c).__=_.__E:(b?t.__c=_=new I(C,H):(t.__c=_=new pt(C,H),_.constructor=I,_.render=x_),T&&T.sub(_),_.state||(_.state={}),_.__n=o,f=_.__d=!0,_.__h=[],_._sb=[]),b&&_.__s==null&&(_.__s=_.state),b&&I.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=ot({},_.__s)),ot(_.__s,I.getDerivedStateFromProps(C,_.__s))),m=_.props,P=_.state,_.__v=t,f)b&&I.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),b&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(b&&I.getDerivedStateFromProps==null&&C!==m&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(C,H),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(C,_.__s,H)===!1){t.__v!=n.__v&&(_.props=C,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(D){D&&(D.__=t)}),io.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(C,_.__s,H),b&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(m,P,v)})}if(_.context=H,_.props=C,_.__P=e,_.__e=!1,Z=ee.__r,Y=0,b)_.state=_.__s,_.__d=!1,Z&&Z(t),u=_.render(_.props,_.state,_.context),io.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,Z&&Z(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++Y<25);_.state=_.__s,_.getChildContext!=null&&(o=ot(ot({},o),_.getChildContext())),b&&!f&&_.getSnapshotBeforeUpdate!=null&&(v=_.getSnapshotBeforeUpdate(m,P)),oe=u!=null&&u.type===ie&&u.key==null?Vi(u.props.children):u,s=Ui(e,co(oe)?oe:[oe],t,n,o,a,i,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),y&&(_.__E=_.__=null)}catch(D){if(l.length=g,t.__v=null,c||i!=null)if(D.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(G=i.length;G--;)qr(i[G]);Br(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),D.then||Br(t);ee.__e(D,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=y_(n.__e,t,n,o,a,i,l,c,d);return(u=ee.diffed)&&u(t),128&t.__u?void 0:s}function Br(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Br))}function Wi(e,t,n){for(var o=0;o<n.length;o++)Vr(n[o],n[++o],n[++o]);ee.__c&&ee.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){ee.__e(i,a.__v)}})}function Vi(e){return typeof e!="object"||e==null||e.__b>0?e:co(e)?e.map(Vi):e.constructor!==void 0?null:ot({},e)}function y_(e,t,n,o,a,i,l,s,c){var d,u,g,_,f,m,P,v=n.props||ao,y=t.props,C=t.type;if(C=="svg"?a="http://www.w3.org/2000/svg":C=="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((f=i[d])&&"setAttribute"in f==!!C&&(C?f.localName==C:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(y);e=document.createElementNS(a,C,y.is&&y),s&&(ee.__m&&ee.__m(t,i),s=!1),i=null}if(C==null)v===y||s&&e.data==y||(e.data=y);else{if(i=C=="textarea"&&y.defaultValue!=null?null:i&&lo.call(e.childNodes),!s&&i!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?g=f:d=="children"||d in y||d=="value"&&"defaultValue"in y||d=="checked"&&"defaultChecked"in y||no(e,d,null,f,a);for(d in y)f=y[d],d=="children"?_=f:d=="dangerouslySetInnerHTML"?u=f:d=="value"?m=f:d=="checked"?P=f:s&&typeof f!="function"||v[d]===f||no(e,d,f,v[d],a);if(u)s||g&&(u.__html==g.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(g&&(e.innerHTML=""),Ui(t.type=="template"?e.content:e,co(_)?_:[_],t,n,o,C=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,l,i?i[0]:n.__k&&zt(n,0),s,c),i!=null)for(d=i.length;d--;)qr(i[d]);s&&C!="textarea"||(d="value",C=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||C=="progress"&&!m||C=="option"&&m!=v[d])&&no(e,d,m,v[d],a),d="checked",P!=null&&P!=e[d]&&no(e,d,P,v[d],a))}return e}function Vr(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){ee.__e(a,n)}}function Gi(e,t,n){var o,a;if(ee.unmount&&ee.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Vr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){ee.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&Gi(o[a],t,n||typeof e.type!="function");n||qr(e.__e),e.__c=e.__=e.__e=void 0}function x_(e,t,n){return this.constructor(e,n)}function Ut(e,t,n){var o,a,i,l;t==document&&(t=document.documentElement),ee.__&&ee.__(e,t),a=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],Wr(t,e=(!o&&n||t).__k=_o(ie,null,[e]),a||ao,ao,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?lo.call(t.childNodes):null,i,!o&&n?n:a?a.__e:t.firstChild,o,l),Wi(i,e,l),e.props.children=null}lo=io.slice,ee={__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}},$i=0,zr=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),Ni(this))},pt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ni(this))},pt.prototype.render=ie,ut=[],Fi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hi=function(e,t){return e.__v.__b-t.__v.__b},so.__r=0,$r=Math.random().toString(8),oo="__d"+$r,mn="__a"+$r,Bi=/(PointerCapture)$|Capture$/i,Ur=0,Fr=Oi(!1),Hr=Oi(!0),f_=0;var qt="0.59.2";function Ki(e){return`${x.cssPrefix}:${e}`}function fn(e,t,n){e.dispatchEvent(new CustomEvent(Ki(t),{detail:n}))}function ji(e,t){let o=Object.entries(t).map(([a,i])=>{let l=Ki(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 qe(){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,P_(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 P_(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 xt=q.scope("persistence");function mt(e,t=Xn,n){let o=n?`${e}.${n}`:e,a=`${x.cssPrefix}.storageVersion`,i=t.get(a)??void 0,l=i?`.v${i}`:"",s=`${x.cssPrefix}.${o}${l}`,c=`${x.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,g=`${s}.panelOpen`,_=`${s}.panelSize`,f=`${s}.calloutDismissed`,m=`${s}.sidebarCollapsed`,P=`${s}.activeModule`,v=`${s}.historyCount`,y=`${s}.formsDone`,C={getVisitorId(){let b=t.get(c);if(b)return b;let T=qe();return t.set(c,T),T},setVisitorId(b){xt.debug("setVisitorId (rebind)",{id:b,scope:o}),t.set(c,b)},loadConversationId(){return t.get(d)??void 0},saveConversationId(b){xt.trace("saveConversationId",{id:b,scope:o}),b?t.set(d,b):t.remove(d)},loadUserPrefs(){let b=t.get(u);if(!b)return{};try{let T=JSON.parse(b);return Xi(T)?T:{}}catch(T){return xt.warn("loadUserPrefs parse failed",{error:T}),{}}},saveUserPrefs(b){try{t.set(u,JSON.stringify(b))}catch(T){xt.warn("saveUserPrefs serialise failed",{error:T})}},patchUserPrefs(b){let T=C.loadUserPrefs();C.saveUserPrefs({...T,...b})},loadPanelOpen(){let b=t.get(g);return b==="1"?!0:b==="0"?!1:null},savePanelOpen(b){t.set(g,b?"1":"0")},loadPanelSize(){let b=t.get(_);return b==="normal"||b==="expanded"||b==="fullscreen"?b:null},savePanelSize(b){t.set(_,b)},loadCalloutDismissed(b){if(!b)return!1;let T=t.get(f);return!!T&&T===b},saveCalloutDismissed(b){b?t.set(f,b):t.remove(f)},loadSidebarCollapsed(){let b=t.get(m);return b==="1"?!0:b==="0"?!1:null},saveSidebarCollapsed(b){t.set(m,b?"1":"0")},loadActiveModule(){return t.get(P)||null},saveActiveModule(b){t.set(P,b)},loadHistoryCount(){let b=t.get(v);if(!b)return null;let T=Number.parseInt(b,10);return Number.isFinite(T)&&T>=0?T:null},saveHistoryCount(b){t.set(v,String(b))},loadFormsDone(){let b=t.get(y);if(!b)return{};try{let T=JSON.parse(b);return Xi(T)?T:{}}catch(T){return xt.warn("loadFormsDone parse failed",{error:T}),{}}},saveFormDone(b){try{let T=C.loadFormsDone();T[b]=Date.now(),t.set(y,JSON.stringify(T))}catch(T){xt.warn("saveFormDone serialise failed",{error:T})}},rememberStorageVersion(b){b&&b!==t.get(a)&&(xt.debug("rememberStorageVersion (force-reset on next load)",{version:b}),t.set(a,b))},clearConversation(){t.remove(d)}};return C}function Xi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Yi=`: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__-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__-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-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);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__-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)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
|
|
2
|
-
`;var
|
|
3
|
-
`;var Qi=`.__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);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);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);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-end-start-radius:5px}.__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)}.__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);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)}.__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);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);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)}.__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__-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)}.__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);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)}.__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)}.__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)}.__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);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__-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)}.__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)}.__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-options-toggle{display:inline-flex;align-self:flex-start;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,E_).replaceAll("__BRAND_ACCENT_TEXT__",R_).replaceAll("__BRAND_ACCENT__",A_).replaceAll("__BRAND_RADIUS__",I_).replaceAll("__BRAND_FONT__",L_);var M_=q.scope("mount"),ts=new WeakMap,ns={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 os(e,t){e.style.cssText=ns[t]}function Pt(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Wt(e={}){let t=e.position??"flow";M_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${x.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",x.id),o.style.cssText=ns[t];let a=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!N_(a,i)){let s=i.createElement("style");s.textContent=Gr,a.appendChild(s)}let l=document.createElement("div");return l.className=`${x.cssPrefix}-app`,a.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:a}}function N_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=ts.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(Gr),ts.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function D_(e,t){let n=x.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)}function O_(e,t){e.dataset.theme=t}function $_(e,t){let n=x.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 F_(e,t){e.dataset.position=t}function uo(e,t){e.dataset.mode=t}function rs(e,t){O_(e,t.themeMode),D_(e,t.themeOverrides),F_(e,t.position),$_(e,t.size)}var H_=q.scope("iframe"),B_='<!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 ss(e,t,n="closed",o="floating",a=null){H_.debug("createIframeMount",{position:t,initialMode:n,layoutMode:o,hasTarget:!!a});let i=document.createElement("iframe");i.title=`${x.name} chat`,i.setAttribute("allow","microphone; clipboard-write"),is(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(B_),s.close();let c=Wt({...e,target:s.body}),d=new MutationObserver(()=>{is(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 po="border:0;background:transparent;z-index:2147483647;pointer-events:auto;",as={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 is(e,t,n,o){if(n==="fullscreen"||o==="standalone"){e.style.cssText=`${po}position:fixed;inset:0;width:100vw;height:100vh;`;return}if(o==="inline"){e.style.cssText=`${po}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=`${po}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}=as[n]??as.open;e.style.cssText=`${po}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var Vt=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 Gt,me,Kr,ls,gn=0,hs=[],ge=ee,cs=ge.__b,ds=ge.__r,_s=ge.diffed,us=ge.__c,ps=ge.unmount,ms=ge.__;function mo(e,t){ge.__h&&ge.__h(me,e,gn||t),gn=0;var n=me.__H||(me.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function E(e){return gn=1,z_(bs,e)}function z_(e,t,n){var o=mo(Gt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):bs(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=me,!me.__f)){var a=function(s,c,d){if(!o.__c.__H)return!0;var u=!1,g=o.__c.props!==s;if(o.__c.__H.__.some(function(f){if(f.__N){u=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(g=!0)}}),i){var _=i.call(this,s,c,d);return u?_||g:_}return!u||g};me.__f=!0;var i=me.shouldComponentUpdate,l=me.componentWillUpdate;me.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)},me.shouldComponentUpdate=a}return o.__N||o.__}function A(e,t){var n=mo(Gt++,3);!ge.__s&&Xr(n.__H,t)&&(n.__=e,n.u=t,me.__H.__h.push(n))}function kt(e,t){var n=mo(Gt++,4);!ge.__s&&Xr(n.__H,t)&&(n.__=e,n.u=t,me.__h.push(n))}function N(e){return gn=5,Re(function(){return{current:e}},[])}function Re(e,t){var n=mo(Gt++,7);return Xr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function $(e,t){return gn=8,Re(function(){return e},t)}function fs(){for(var e;e=hs.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(jr),t.__h.some(vs),t.__h=[]}catch(n){t.__h=[],ge.__e(n,e.__v)}}}ge.__b=function(e){me=null,cs&&cs(e)},ge.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ms&&ms(e,t)},ge.__r=function(e){ds&&ds(e),Gt=0;var t=(me=e.__c).__H;t&&(Kr===me?(t.__h=[],me.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.length&&fs(),Gt=0)),Kr=me},ge.diffed=function(e){_s&&_s(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(hs.push(t)!==1&&ls===ge.requestAnimationFrame||((ls=ge.requestAnimationFrame)||U_)(fs)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Kr=me=null},ge.__c=function(e,t){t.some(function(n){try{n.__h.some(jr),n.__h=n.__h.filter(function(o){return!o.__||vs(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],ge.__e(o,n.__v)}}),us&&us(e,t)},ge.unmount=function(e){ps&&ps(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{jr(o)}catch(a){t=a}}),n.__H=void 0,t&&ge.__e(t,n.__v))};var gs=typeof requestAnimationFrame=="function";function U_(e){var t,n=function(){clearTimeout(o),gs&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);gs&&(t=requestAnimationFrame(n))}function jr(e){var t=me,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),me=t}function vs(e){var t=me;e.__c=e.__(),me=t}function Xr(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function bs(e,t){return typeof t=="function"?t(e):t}var q_=Symbol.for("preact-signals");function vo(){if(rt>1)rt--;else{var e,t=!1;for((function(){var a=go;for(go=void 0;a!==void 0;)a.S.v===a.v&&(a.S.i=a.i),a=a.o})();hn!==void 0;){var n=hn;for(hn=void 0,fo++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ps(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=o}}if(fo=0,rt--,t)throw e}}function Kt(e){if(rt>0)return e();Yr=++W_,rt++;try{return e()}finally{vo()}}var de=void 0;function vn(e){var t=de;de=void 0;try{return e()}finally{de=t}}var ys,hn=void 0,rt=0,fo=0,W_=0,Yr=0,go=void 0,ho=0;function xs(e){if(de!==void 0){var t=e.n;if(t===void 0||t.t!==de)return t={i:0,S:e,p:de.s,n:void 0,t:de,e:void 0,x:void 0,r:t},de.s!==void 0&&(de.s.n=t),de.s=t,e.n=t,32&de.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=de.s,t.n=void 0,de.s.n=t,de.s=t),t}}function xe(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}xe.prototype.brand=q_;xe.prototype.h=function(){return!0};xe.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:vn(function(){var o;(o=t.W)==null||o.call(t)}))};xe.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&&vn(function(){var a;(a=t.Z)==null||a.call(t)}))}};xe.prototype.subscribe=function(e){var t=this;return at(function(){var n=t.value;vn(function(){return e(n)})},{name:"sub"})};xe.prototype.valueOf=function(){return this.value};xe.prototype.toString=function(){return this.value+""};xe.prototype.toJSON=function(){return this.value};xe.prototype.peek=function(){var e=this;return vn(function(){return e.value})};Object.defineProperty(xe.prototype,"value",{get:function(){var e=xs(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(fo>100)throw new Error("Cycle detected");(function(n){rt!==0&&fo===0&&n.l!==Yr&&(n.l=Yr,go={S:n,v:n.v,i:n.i,o:go})})(this),this.v=e,this.i++,ho++,rt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{vo()}}}});function z(e,t){return new xe(e,t)}function Ps(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ks(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ss(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function St(e,t){xe.call(this,void 0,t),this.x=e,this.s=void 0,this.g=ho-1,this.f=4}St.prototype=new xe;St.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ho))return!0;if(this.g=ho,this.f|=1,this.i>0&&!Ps(this))return this.f&=-2,!0;var e=de;try{ks(this),de=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 de=e,Ss(this),this.f&=-2,!0};St.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)}xe.prototype.S.call(this,e)};St.prototype.U=function(e){if(this.t!==void 0&&(xe.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)}};St.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(St.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=xs(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function bn(e,t){return new St(e,t)}function ws(e){var t=e.m;if(e.m=void 0,typeof t=="function"){rt++;var n=de;de=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Jr(e),o}finally{de=n,vo()}}}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,ws(e)}function V_(e){if(de!==this)throw new Error("Out-of-order effect");Ss(this),de=e,this.f&=-2,8&this.f&&Jr(this),vo()}function jt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,ys&&ys.push(this)}jt.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()}};jt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ws(this),ks(this),rt++;var e=de;return de=this,V_.bind(this,e)};jt.prototype.N=function(){2&this.f||(this.f|=2,this.u=hn,hn=this)};jt.prototype.d=function(){this.f|=8,1&this.f||Jr(this)};jt.prototype.dispose=function(){this.d()};function at(e,t){var n=new jt(e,t);try{n.c()}catch(a){throw n.d(),a}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Cs,xo,bo,G_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Ts=[];at(function(){Cs=this.N})();function Xt(e,t){ee[e]=t.bind(null,ee[e]||function(){})}function yo(e){if(bo){var t=bo;bo=void 0,t()}bo=e&&e.S()}function Es(e){var t=this,n=e.data,o=yn(n);o.value=n;var a=Re(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=bn(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),u=bn(function(){return!Array.isArray(d.value)&&!zr(d.value)}),g=at(function(){if(this.N=As,u.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),_=t.__$u.d;return t.__$u.d=function(){g(),_.call(this)},[u,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}Es.displayName="ReactiveTextNode";Object.defineProperties(xe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Es},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Xt("__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 xe&&(n||(t.__np=n={}),n[a]=i,o[a]=i.peek())}}e(t)});Xt("__r",function(e,t){if(e(t),t.type!==ie){yo();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(a,i){var l;return at(function(){l=this},{name:i}),l.c=a,l})(function(){var a;G_&&((a=n.y)==null||a.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),xo=o,yo(n)}});Xt("__e",function(e,t,n,o){yo(),xo=void 0,e(t,n,o)});Xt("diffed",function(e,t){yo(),xo=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,a=t.props;if(o){var i=n.U;if(i)for(var l in i){var s=i[l];s!==void 0&&!(l in o)&&(s.d(),i[l]=void 0)}else i={},n.U=i;for(var c in o){var d=i[c],u=o[c];d===void 0?(d=K_(n,c,u,a),i[c]=d):d.o(u,a)}}}e(t)});function K_(e,t,n,o){var a=t in e&&e.ownerSVGElement===void 0,i=z(n);return{o:function(l,s){i.value=l,o=s},d:at(function(){this.N=As;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))})}}Xt("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)});Xt("__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 yn(e,t){return Re(function(){return z(e,t)},[])}function J(e,t){var n=N(e);return n.current=e,xo.__$f|=4,Re(function(){return bn(function(){return n.current()},t)},[])}var j_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function X_(){Kt(function(){for(var e;e=Ts.shift();)Cs.call(e)})}function As(){Ts.push(this)===1&&(ee.requestAnimationFrame||j_)(X_)}function Rs(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Is(e){return Rs(e)}function Ls(e){return!(!Rs(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function Po(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 Y_=900;function Qr(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;if(o==="expanded"||o==="fullscreen"||o==="normal")return o;if(o==="auto"){let a=t.autoSizeBreakpoint??Y_;return n>=a?"expanded":"normal"}return"normal"}function xn(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:Qr(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function Yt(){return typeof window>"u"?0:window.innerWidth}var J_="x-public-key",Q_="x-ai-agent-deployment-id";function Ms(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[Q_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??J_]=e.publicKey),t}}}var We=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 Ns=q.scope("parser");async function*Zr(e,t){if(!e.ok){let a=await e.text().catch(()=>"");throw new We(`server responded ${e.status}: ${a.slice(0,200)}`,"server",e.status)}if(!e.body)throw new We("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();if(s){let c=Ds(s);c&&(yield c)}return}o+=i;let l;for(;(l=o.indexOf(`
|
|
1
|
+
"use strict";var HelpAI=(()=>{var xr=Object.defineProperty;var Rd=Object.getOwnPropertyDescriptor;var Ad=Object.getOwnPropertyNames;var Id=Object.prototype.hasOwnProperty;var Ld=(e,t,n)=>t in e?xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Md=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!Id.call(e,a)&&a!==n&&xr(e,a,{get:()=>t[a],enumerable:!(o=Rd(t,a))||o.enumerable});return e};var Nd=e=>Md(xr({},"__esModule",{value:!0}),e);var X=(e,t,n)=>Ld(e,typeof t!="symbol"?t+"":t,n);var jm={};var x={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 ai={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",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"},Dd={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",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"},Od={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",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"},$d={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",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"},Fd={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",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"},Hd={en:ai,fr:Dd,ar:Od,es:$d,he:Fd};function Kn(e,t){let n=ii(e),o=jn(t),a=n==="en"?{}:Hd[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...ai,...a,...l,...i}}function ii(e){return(e.split("-")[0]??"en").toLowerCase()}var Bd=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function si(e){return Bd.has(ii(e))}function Re(e,t){return e[t]??t}function jn(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function li(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function ci(e,t){let{translations:n,defaultLocale:o,...a}=e,i=li(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function di(e,t){let{translations:n,defaultLocale:o,...a}=e,i=li(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(g=>[g.value,g]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(g=>{let _=u.get(g.value);return _?{...g,label:_.label??g.label,description:_.description??g.description}:g})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var Pr=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{}}},Xn=new Pr;var wr=["off","error","warn","info","debug","trace"],Cr=x.cssPrefix,_i=`${Cr}.debug`,zd=`__${x.global}_DEBUG__`,Ud=`${Cr}-debug`,Yn=2,kr=null;function qd(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Ud);if(e!==null){let t=Sr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(_i);if(e){let t=Sr(e);if(t>=0)return t}}catch{}return window[zd]?4:2}function Sr(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=wr.indexOf(e);if(t>=0)return t}return-1}function Jn(e){let t=Sr(e);if(!(t<0)){Yn=t;try{window.localStorage?.setItem(_i,wr[t])}catch{}}}function _n(){return wr[Yn]}Yn=qd();function ui(e){let t=`[${Cr}:${e}]`,n=(o,a,i)=>(l,s)=>{if(!(Yn<o)&&(s===void 0?console[a](t,l):console[a](t,l,s),kr))try{kr({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=>ui(`${e}:${o}`)}}var q=ui("core");function un(e){kr=e}var bt=q.scope("context"),Wd=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),pi=50,Tr=1024,Vd=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Er(e){return mi(e,"userContext",!0)}function Rr(e){return mi(e,"pageContext",!1)}function mi(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){bt.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(Wd.has(i)){bt.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=pi){bt.warn(`${t} truncated at ${pi} keys \u2014 dropped "${i}"`);continue}let s=Gd(t,i,l);s!==void 0&&(o[i]=s,a++)}return n&&typeof o.email=="string"&&!Vd.test(o.email)&&(bt.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function Gd(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){bt.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Tr?(bt.warn(`truncated ${e}.${t} to ${Tr} chars`),o.slice(0,Tr)):o}bt.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var Qn={maxBytes:10485760,maxCount:10,accept:"*/*"},Ar={files:!0,voice:"local",disableHumanInLoop:!1},fi={list:[],byTrigger:{}},Ir={enabled:!0,sampleRate:1},Zn={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Ht={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},gi={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"]},Lr={enabled:!0,volume:.3,events:void 0},hi={enabled:!0,events:void 0},vi=[{label:"tabConversations",layout:"chat"}];function _t(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}=Kd(t.theme),u=n.mode??"floating",g=jd(a.defaultLocale),_=a.availableLocales??[a.locale??g],f=Bt(a.locale??g,_,g),m=(t.baseUrl??x.defaultBaseUrl).replace(/\/$/,""),P=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:P,dataApiBaseUrl:v,userContext:Er(t.userContext),pageContext:Rr(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,scrollFade:o.scrollFade??!0,enableMessageFeedback:!(o.disableMessageFeedback??!1),features:{files:t.features?.files??Ar.files,voice:t.features?.voice??Ar.voice,disableHumanInLoop:t.features?.disableHumanInLoop??!1,tools:t.features?.tools},forms:pn(t.forms,f),endpoints:{upload:t.endpoints?.upload??Zn.upload,transcribe:t.endpoints?.transcribe??Zn.transcribe,submitForm:t.endpoints?.submitForm??Zn.submitForm},attachments:{accept:t.composer?.attachments?.accept??Qn.accept,maxBytes:t.composer?.attachments?.maxBytes??Qn.maxBytes,maxCount:t.composer?.attachments?.maxCount??Qn.maxCount},locale:f,defaultLocale:g,availableLocales:_,startMinimized:o.startMinimized??!0,actions:Xd(u,s.actions),size:n.size??{},launcher:o_(t.launcher),sound:Yd(i.sound),haptics:Jd(i.haptics),strings:Kn(f,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:Zd(l.poweredBy),composer:e_(t.composer),modules:t_(t.modules),tracking:Qd(t.tracking,v),storage:t.storage??Xn,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Kd(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function jd(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function Bt(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function Xd(e,t){return t??gi[e]}function Yd(e){return{enabled:e?.enabled??Lr.enabled,volume:e?.volume??Lr.volume,events:e?.events}}function Jd(e){return{enabled:e?.enabled??hi.enabled,events:e?.events}}function Qd(e,t){let n=e?.sampleRate??Ir.sampleRate;return{enabled:e?.enabled??Ir.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 Zd(e){let n={...{text:`Powered by ${x.displayName}`,href:x.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function e_(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function t_(e){let t=e===void 0?vi: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.hideGreeting=i.hideGreeting??!1,c.hideSearchBar=i.hideSearchBar??!1,c.hideRecentConversations=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 pn(e,t){var i;if(!e?.length)return fi;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=di(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(n_).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 n_(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 o_(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??Ht.variant,size:e?.size??Ht.size,label:e?.label??Ht.label,icon:e?.icon??Ht.icon,hidden:e?.hidden??Ht.hidden,callout:t}}function Mr(e,t,n,o){let a=Bt(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=Kn(a,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var r_=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Nr(e,t){if(!t)return e;let n={...e};for(let i of r_){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]=bi(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=bi(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=a_(s,l)),n.i18n=i}return n}function bi(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 a_(e,t){if(!e)return t;if(!t)return e;let n=jn(e),o=jn(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 i_=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],nt=e=>e!=="false",xi=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Pi=[["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]],ki=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",nt]],Si=[["width","width"],["height","height"]],wi=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",nt],["show-reasoning","showReasoning",nt],["show-tool-calls","showToolCalls",nt],["show-sources","showSources",nt],["scroll-fade","scrollFade",nt],["disable-message-feedback","disableMessageFeedback",nt]],Ci=[["locale","locale"]],s_=new Set(i_),l_=e=>xi(e).filter(t=>s_.has(t)),Ti=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",nt]],Ei=[["features-files","files",nt],["features-voice","voice",e=>e],["features-tools","tools",xi]],Ri=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Ai=[["user-id","id"],["user-email","email"],["user-name","name"]],Ii=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],c_=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],d_=[Pi,ki,Si,wi,Ci,Ti,Ei,Ri,Ai,Ii],__=new Set(["iframe","start-minimized"]),Dr=[...d_.flatMap(e=>e.map(([t])=>t).filter(t=>!__.has(t))),...c_];function eo(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,P]of Pi){let v=n(f);v!==void 0&&(t[m]=P?P(v):v)}let o=yt(n,ki),a=yt(n,Si);(o||a)&&(t.presentation={...o,...a?{size:a}:{}});let i=yt(n,wi);i&&(t.behavior=i);let l=yt(n,Ci);l&&(t.i18n=l);let s=p_(e,n);s&&(t.launcher=s);let c=yt(n,Ei);c&&(t.features=c);let d=yt(n,Ri);d&&(t.endpoints=d);let u=yi(n,Ai,"user-context");u&&(t.userContext=u);let g=yi(n,Ii,"page-context");g&&(t.pageContext=g);let _=n("actions");return _!==void 0&&(t.header={actions:l_(_)}),t}function Or(e){return e?eo(t=>e[u_(t)]??null):{}}function u_(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function yt(e,t){let n={};for(let[o,a,i]of t){let l=e(o);l!==void 0&&(n[a]=i?i(l):l)}return Object.keys(n).length>0?n:null}function yi(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let a={},i=e(n);if(i)try{let s=JSON.parse(i);s&&typeof s=="object"&&!Array.isArray(s)&&(a=s)}catch{}let l={...a,...o};return Object.keys(l).length>0?l:null}function p_(e,t){let n=yt(t,Ti)??{},o=e("launcher-label");o!==null&&(n.label=o);let a=t("callout-text");if(a){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:a,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var so,ee,Oi,zr,ut,Li,$i,Fi,$r,no,mn,Hi,Ur,Fr,Hr,m_,ro={},ao=[],f_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,lo=Array.isArray;function ot(e,t){for(var n in t)e[n]=t[n];return e}function qr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function co(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?so.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 oo(e,l,o,a,null)}function oo(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??++Oi,__i:-1,__u:0};return a==null&&ee.vnode!=null&&ee.vnode(i),i}function ie(e){return e.children}function pt(e,t){this.props=e,this.context=t}function zt(e,t){if(t==null)return e.__?zt(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"?zt(e):null}function g_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],a=[],i=ot({},t);i.__v=t.__v+1,ee.vnode&&ee.vnode(i),Wr(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??zt(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,qi(o,i,a),t.__e=t.__=null,i.__e!=n&&Bi(i)}}function Bi(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}),Bi(e)}function Mi(e){(!e.__d&&(e.__d=!0)&&ut.push(e)&&!io.__r++||Li!=ee.debounceRendering)&&((Li=ee.debounceRendering)||$i)(io)}function io(){try{for(var e,t=1;ut.length;)ut.length>t&&ut.sort(Fi),e=ut.shift(),t=ut.length,g_(e)}finally{ut.length=io.__r=0}}function zi(e,t,n,o,a,i,l,s,c,d,u){var g,_,f,m,P,v,y,C=o&&o.__k||ao,b=t.length;for(c=h_(n,t,C,c,b),g=0;g<b;g++)(f=n.__k[g])!=null&&(_=f.__i!=-1&&C[f.__i]||ro,f.__i=g,v=Wr(e,f,_,a,i,l,s,c,d,u),m=f.__e,f.ref&&_.ref!=f.ref&&(_.ref&&Vr(_.ref,null,f),u.push(f.ref,f.__c||m,f)),P==null&&m!=null&&(P=m),(y=!!(4&f.__u))||_.__k===f.__k?(c=Ui(f,c,e,y),y&&_.__e&&(_.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=P,c}function h_(e,t,n,o,a){var i,l,s,c,d,u=n.length,g=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]=oo(null,l,null,null,null):lo(l)?l=e.__k[i]=oo(ie,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=oo(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=v_(l,n,c,g))!=-1&&(g--,(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(g)for(i=0;i<u;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=zt(s)),Vi(s,s));return o}function Ui(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=Ui(a[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=zt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function v_(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 Ni(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||f_.test(t)?n:n+"px"}function to(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||Ni(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Ni(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Hi,"$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[mn]=o[mn]:(n[mn]=Ur,e.addEventListener(t,i?Hr:Fr,i)):e.removeEventListener(t,i?Hr:Fr,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 Di(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[no]==null)t[no]=Ur++;else if(t[no]<n[mn])return;return n(ee.event?ee.event(t):t)}}}function Wr(e,t,n,o,a,i,l,s,c,d){var u,g,_,f,m,P,v,y,C,b,T,H,Z,Y,oe,G,I=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(u=ee.__b)&&u(t);e:if(typeof I=="function"){g=l.length;try{if(C=t.props,b=I.prototype&&I.prototype.render,T=(u=I.contextType)&&o[u.__c],H=u?T?T.props.value:u.__:o,n.__c?y=(_=t.__c=n.__c).__=_.__E:(b?t.__c=_=new I(C,H):(t.__c=_=new pt(C,H),_.constructor=I,_.render=y_),T&&T.sub(_),_.state||(_.state={}),_.__n=o,f=_.__d=!0,_.__h=[],_._sb=[]),b&&_.__s==null&&(_.__s=_.state),b&&I.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=ot({},_.__s)),ot(_.__s,I.getDerivedStateFromProps(C,_.__s))),m=_.props,P=_.state,_.__v=t,f)b&&I.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),b&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(b&&I.getDerivedStateFromProps==null&&C!==m&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(C,H),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(C,_.__s,H)===!1){t.__v!=n.__v&&(_.props=C,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(D){D&&(D.__=t)}),ao.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(C,_.__s,H),b&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(m,P,v)})}if(_.context=H,_.props=C,_.__P=e,_.__e=!1,Z=ee.__r,Y=0,b)_.state=_.__s,_.__d=!1,Z&&Z(t),u=_.render(_.props,_.state,_.context),ao.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,Z&&Z(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++Y<25);_.state=_.__s,_.getChildContext!=null&&(o=ot(ot({},o),_.getChildContext())),b&&!f&&_.getSnapshotBeforeUpdate!=null&&(v=_.getSnapshotBeforeUpdate(m,P)),oe=u!=null&&u.type===ie&&u.key==null?Wi(u.props.children):u,s=zi(e,lo(oe)?oe:[oe],t,n,o,a,i,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),y&&(_.__E=_.__=null)}catch(D){if(l.length=g,t.__v=null,c||i!=null)if(D.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(G=i.length;G--;)qr(i[G]);Br(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),D.then||Br(t);ee.__e(D,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=b_(n.__e,t,n,o,a,i,l,c,d);return(u=ee.diffed)&&u(t),128&t.__u?void 0:s}function Br(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Br))}function qi(e,t,n){for(var o=0;o<n.length;o++)Vr(n[o],n[++o],n[++o]);ee.__c&&ee.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){ee.__e(i,a.__v)}})}function Wi(e){return typeof e!="object"||e==null||e.__b>0?e:lo(e)?e.map(Wi):e.constructor!==void 0?null:ot({},e)}function b_(e,t,n,o,a,i,l,s,c){var d,u,g,_,f,m,P,v=n.props||ro,y=t.props,C=t.type;if(C=="svg"?a="http://www.w3.org/2000/svg":C=="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((f=i[d])&&"setAttribute"in f==!!C&&(C?f.localName==C:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(y);e=document.createElementNS(a,C,y.is&&y),s&&(ee.__m&&ee.__m(t,i),s=!1),i=null}if(C==null)v===y||s&&e.data==y||(e.data=y);else{if(i=C=="textarea"&&y.defaultValue!=null?null:i&&so.call(e.childNodes),!s&&i!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?g=f:d=="children"||d in y||d=="value"&&"defaultValue"in y||d=="checked"&&"defaultChecked"in y||to(e,d,null,f,a);for(d in y)f=y[d],d=="children"?_=f:d=="dangerouslySetInnerHTML"?u=f:d=="value"?m=f:d=="checked"?P=f:s&&typeof f!="function"||v[d]===f||to(e,d,f,v[d],a);if(u)s||g&&(u.__html==g.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(g&&(e.innerHTML=""),zi(t.type=="template"?e.content:e,lo(_)?_:[_],t,n,o,C=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,l,i?i[0]:n.__k&&zt(n,0),s,c),i!=null)for(d=i.length;d--;)qr(i[d]);s&&C!="textarea"||(d="value",C=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||C=="progress"&&!m||C=="option"&&m!=v[d])&&to(e,d,m,v[d],a),d="checked",P!=null&&P!=e[d]&&to(e,d,P,v[d],a))}return e}function Vr(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){ee.__e(a,n)}}function Vi(e,t,n){var o,a;if(ee.unmount&&ee.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Vr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){ee.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&Vi(o[a],t,n||typeof e.type!="function");n||qr(e.__e),e.__c=e.__=e.__e=void 0}function y_(e,t,n){return this.constructor(e,n)}function Ut(e,t,n){var o,a,i,l;t==document&&(t=document.documentElement),ee.__&&ee.__(e,t),a=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],Wr(t,e=(!o&&n||t).__k=co(ie,null,[e]),a||ro,ro,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?so.call(t.childNodes):null,i,!o&&n?n:a?a.__e:t.firstChild,o,l),qi(i,e,l),e.props.children=null}so=ao.slice,ee={__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}},Oi=0,zr=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),Mi(this))},pt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Mi(this))},pt.prototype.render=ie,ut=[],$i=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Fi=function(e,t){return e.__v.__b-t.__v.__b},io.__r=0,$r=Math.random().toString(8),no="__d"+$r,mn="__a"+$r,Hi=/(PointerCapture)$|Capture$/i,Ur=0,Fr=Di(!1),Hr=Di(!0),m_=0;var qt="0.59.3";function Gi(e){return`${x.cssPrefix}:${e}`}function fn(e,t,n){e.dispatchEvent(new CustomEvent(Gi(t),{detail:n}))}function Ki(e,t){let o=Object.entries(t).map(([a,i])=>{let l=Gi(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 qe(){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,x_(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 x_(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 xt=q.scope("persistence");function mt(e,t=Xn,n){let o=n?`${e}.${n}`:e,a=`${x.cssPrefix}.storageVersion`,i=t.get(a)??void 0,l=i?`.v${i}`:"",s=`${x.cssPrefix}.${o}${l}`,c=`${x.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,g=`${s}.panelOpen`,_=`${s}.panelSize`,f=`${s}.calloutDismissed`,m=`${s}.sidebarCollapsed`,P=`${s}.activeModule`,v=`${s}.historyCount`,y=`${s}.formsDone`,C={getVisitorId(){let b=t.get(c);if(b)return b;let T=qe();return t.set(c,T),T},setVisitorId(b){xt.debug("setVisitorId (rebind)",{id:b,scope:o}),t.set(c,b)},loadConversationId(){return t.get(d)??void 0},saveConversationId(b){xt.trace("saveConversationId",{id:b,scope:o}),b?t.set(d,b):t.remove(d)},loadUserPrefs(){let b=t.get(u);if(!b)return{};try{let T=JSON.parse(b);return ji(T)?T:{}}catch(T){return xt.warn("loadUserPrefs parse failed",{error:T}),{}}},saveUserPrefs(b){try{t.set(u,JSON.stringify(b))}catch(T){xt.warn("saveUserPrefs serialise failed",{error:T})}},patchUserPrefs(b){let T=C.loadUserPrefs();C.saveUserPrefs({...T,...b})},loadPanelOpen(){let b=t.get(g);return b==="1"?!0:b==="0"?!1:null},savePanelOpen(b){t.set(g,b?"1":"0")},loadPanelSize(){let b=t.get(_);return b==="normal"||b==="expanded"||b==="fullscreen"?b:null},savePanelSize(b){t.set(_,b)},loadCalloutDismissed(b){if(!b)return!1;let T=t.get(f);return!!T&&T===b},saveCalloutDismissed(b){b?t.set(f,b):t.remove(f)},loadSidebarCollapsed(){let b=t.get(m);return b==="1"?!0:b==="0"?!1:null},saveSidebarCollapsed(b){t.set(m,b?"1":"0")},loadActiveModule(){return t.get(P)||null},saveActiveModule(b){t.set(P,b)},loadHistoryCount(){let b=t.get(v);if(!b)return null;let T=Number.parseInt(b,10);return Number.isFinite(T)&&T>=0?T:null},saveHistoryCount(b){t.set(v,String(b))},loadFormsDone(){let b=t.get(y);if(!b)return{};try{let T=JSON.parse(b);return ji(T)?T:{}}catch(T){return xt.warn("loadFormsDone parse failed",{error:T}),{}}},saveFormDone(b){try{let T=C.loadFormsDone();T[b]=Date.now(),t.set(y,JSON.stringify(T))}catch(T){xt.warn("saveFormDone serialise failed",{error:T})}},rememberStorageVersion(b){b&&b!==t.get(a)&&(xt.debug("rememberStorageVersion (force-reset on next load)",{version:b}),t.set(a,b))},clearConversation(){t.remove(d)}};return C}function ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Xi=`: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__-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__-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-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);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__-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)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
|
|
2
|
+
`;var Yi=`*,*: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);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 Ji=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);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);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);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-end-start-radius:5px}.__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)}.__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);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)}.__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);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);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)}.__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__-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)}.__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);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)}.__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)}.__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)}.__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);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__-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)}.__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)}.__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-options-toggle{display:inline-flex;align-self:flex-start;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 Qi=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
|
|
5
|
+
`;var Zi=`: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 T_="helpai",E_="#5B5BD6",R_="#FFFFFF",A_="12px",I_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",Gr=[Xi,Yi,Ji,Qi,Zi].join(`
|
|
7
|
+
`).replace(/__P__/g,T_).replaceAll("__BRAND_ACCENT_TEXT__",R_).replaceAll("__BRAND_ACCENT__",E_).replaceAll("__BRAND_RADIUS__",A_).replaceAll("__BRAND_FONT__",I_);var L_=q.scope("mount"),es=new WeakMap,ts={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 ns(e,t){e.style.cssText=ts[t]}function Pt(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Wt(e={}){let t=e.position??"flow";L_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${x.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",x.id),o.style.cssText=ts[t];let a=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!M_(a,i)){let s=i.createElement("style");s.textContent=Gr,a.appendChild(s)}let l=document.createElement("div");return l.className=`${x.cssPrefix}-app`,a.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:a}}function M_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=es.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(Gr),es.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function N_(e,t){let n=x.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)}function D_(e,t){e.dataset.theme=t}function O_(e,t){let n=x.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 $_(e,t){e.dataset.position=t}function _o(e,t){e.dataset.mode=t}function os(e,t){D_(e,t.themeMode),N_(e,t.themeOverrides),$_(e,t.position),O_(e,t.size)}var F_=q.scope("iframe"),H_='<!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 is(e,t,n="closed",o="floating",a=null){F_.debug("createIframeMount",{position:t,initialMode:n,layoutMode:o,hasTarget:!!a});let i=document.createElement("iframe");i.title=`${x.name} chat`,i.setAttribute("allow","microphone; clipboard-write"),as(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(H_),s.close();let c=Wt({...e,target:s.body}),d=new MutationObserver(()=>{as(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;",rs={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 as(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}=rs[n]??rs.open;e.style.cssText=`${uo}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var Vt=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 Gt,me,Kr,ss,gn=0,gs=[],ge=ee,ls=ge.__b,cs=ge.__r,ds=ge.diffed,_s=ge.__c,us=ge.unmount,ps=ge.__;function po(e,t){ge.__h&&ge.__h(me,e,gn||t),gn=0;var n=me.__H||(me.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function E(e){return gn=1,B_(vs,e)}function B_(e,t,n){var o=po(Gt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):vs(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=me,!me.__f)){var a=function(s,c,d){if(!o.__c.__H)return!0;var u=!1,g=o.__c.props!==s;if(o.__c.__H.__.some(function(f){if(f.__N){u=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(g=!0)}}),i){var _=i.call(this,s,c,d);return u?_||g:_}return!u||g};me.__f=!0;var i=me.shouldComponentUpdate,l=me.componentWillUpdate;me.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)},me.shouldComponentUpdate=a}return o.__N||o.__}function R(e,t){var n=po(Gt++,3);!ge.__s&&Xr(n.__H,t)&&(n.__=e,n.u=t,me.__H.__h.push(n))}function kt(e,t){var n=po(Gt++,4);!ge.__s&&Xr(n.__H,t)&&(n.__=e,n.u=t,me.__h.push(n))}function N(e){return gn=5,Ae(function(){return{current:e}},[])}function Ae(e,t){var n=po(Gt++,7);return Xr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function $(e,t){return gn=8,Ae(function(){return e},t)}function ms(){for(var e;e=gs.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(jr),t.__h.some(hs),t.__h=[]}catch(n){t.__h=[],ge.__e(n,e.__v)}}}ge.__b=function(e){me=null,ls&&ls(e)},ge.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ps&&ps(e,t)},ge.__r=function(e){cs&&cs(e),Gt=0;var t=(me=e.__c).__H;t&&(Kr===me?(t.__h=[],me.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.length&&ms(),Gt=0)),Kr=me},ge.diffed=function(e){ds&&ds(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(gs.push(t)!==1&&ss===ge.requestAnimationFrame||((ss=ge.requestAnimationFrame)||z_)(ms)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Kr=me=null},ge.__c=function(e,t){t.some(function(n){try{n.__h.some(jr),n.__h=n.__h.filter(function(o){return!o.__||hs(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],ge.__e(o,n.__v)}}),_s&&_s(e,t)},ge.unmount=function(e){us&&us(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{jr(o)}catch(a){t=a}}),n.__H=void 0,t&&ge.__e(t,n.__v))};var fs=typeof requestAnimationFrame=="function";function z_(e){var t,n=function(){clearTimeout(o),fs&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);fs&&(t=requestAnimationFrame(n))}function jr(e){var t=me,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),me=t}function hs(e){var t=me;e.__c=e.__(),me=t}function Xr(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function vs(e,t){return typeof t=="function"?t(e):t}var U_=Symbol.for("preact-signals");function ho(){if(rt>1)rt--;else{var e,t=!1;for((function(){var a=fo;for(fo=void 0;a!==void 0;)a.S.v===a.v&&(a.S.i=a.i),a=a.o})();hn!==void 0;){var n=hn;for(hn=void 0,mo++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&xs(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=o}}if(mo=0,rt--,t)throw e}}function Kt(e){if(rt>0)return e();Yr=++q_,rt++;try{return e()}finally{ho()}}var de=void 0;function vn(e){var t=de;de=void 0;try{return e()}finally{de=t}}var bs,hn=void 0,rt=0,mo=0,q_=0,Yr=0,fo=void 0,go=0;function ys(e){if(de!==void 0){var t=e.n;if(t===void 0||t.t!==de)return t={i:0,S:e,p:de.s,n:void 0,t:de,e:void 0,x:void 0,r:t},de.s!==void 0&&(de.s.n=t),de.s=t,e.n=t,32&de.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=de.s,t.n=void 0,de.s.n=t,de.s=t),t}}function xe(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}xe.prototype.brand=U_;xe.prototype.h=function(){return!0};xe.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:vn(function(){var o;(o=t.W)==null||o.call(t)}))};xe.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&&vn(function(){var a;(a=t.Z)==null||a.call(t)}))}};xe.prototype.subscribe=function(e){var t=this;return at(function(){var n=t.value;vn(function(){return e(n)})},{name:"sub"})};xe.prototype.valueOf=function(){return this.value};xe.prototype.toString=function(){return this.value+""};xe.prototype.toJSON=function(){return this.value};xe.prototype.peek=function(){var e=this;return vn(function(){return e.value})};Object.defineProperty(xe.prototype,"value",{get:function(){var e=ys(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(mo>100)throw new Error("Cycle detected");(function(n){rt!==0&&mo===0&&n.l!==Yr&&(n.l=Yr,fo={S:n,v:n.v,i:n.i,o:fo})})(this),this.v=e,this.i++,go++,rt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{ho()}}}});function z(e,t){return new xe(e,t)}function xs(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 Ps(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 ks(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 St(e,t){xe.call(this,void 0,t),this.x=e,this.s=void 0,this.g=go-1,this.f=4}St.prototype=new xe;St.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===go))return!0;if(this.g=go,this.f|=1,this.i>0&&!xs(this))return this.f&=-2,!0;var e=de;try{Ps(this),de=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 de=e,ks(this),this.f&=-2,!0};St.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)}xe.prototype.S.call(this,e)};St.prototype.U=function(e){if(this.t!==void 0&&(xe.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)}};St.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(St.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=ys(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function bn(e,t){return new St(e,t)}function Ss(e){var t=e.m;if(e.m=void 0,typeof t=="function"){rt++;var n=de;de=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Jr(e),o}finally{de=n,ho()}}}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,Ss(e)}function W_(e){if(de!==this)throw new Error("Out-of-order effect");ks(this),de=e,this.f&=-2,8&this.f&&Jr(this),ho()}function jt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,bs&&bs.push(this)}jt.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()}};jt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ss(this),Ps(this),rt++;var e=de;return de=this,W_.bind(this,e)};jt.prototype.N=function(){2&this.f||(this.f|=2,this.u=hn,hn=this)};jt.prototype.d=function(){this.f|=8,1&this.f||Jr(this)};jt.prototype.dispose=function(){this.d()};function at(e,t){var n=new jt(e,t);try{n.c()}catch(a){throw n.d(),a}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var ws,yo,vo,V_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Cs=[];at(function(){ws=this.N})();function Xt(e,t){ee[e]=t.bind(null,ee[e]||function(){})}function bo(e){if(vo){var t=vo;vo=void 0,t()}vo=e&&e.S()}function Ts(e){var t=this,n=e.data,o=yn(n);o.value=n;var a=Ae(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=bn(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),u=bn(function(){return!Array.isArray(d.value)&&!zr(d.value)}),g=at(function(){if(this.N=Es,u.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),_=t.__$u.d;return t.__$u.d=function(){g(),_.call(this)},[u,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}Ts.displayName="ReactiveTextNode";Object.defineProperties(xe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ts},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Xt("__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 xe&&(n||(t.__np=n={}),n[a]=i,o[a]=i.peek())}}e(t)});Xt("__r",function(e,t){if(e(t),t.type!==ie){bo();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(a,i){var l;return at(function(){l=this},{name:i}),l.c=a,l})(function(){var a;V_&&((a=n.y)==null||a.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),yo=o,bo(n)}});Xt("__e",function(e,t,n,o){bo(),yo=void 0,e(t,n,o)});Xt("diffed",function(e,t){bo(),yo=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,a=t.props;if(o){var i=n.U;if(i)for(var l in i){var s=i[l];s!==void 0&&!(l in o)&&(s.d(),i[l]=void 0)}else i={},n.U=i;for(var c in o){var d=i[c],u=o[c];d===void 0?(d=G_(n,c,u,a),i[c]=d):d.o(u,a)}}}e(t)});function G_(e,t,n,o){var a=t in e&&e.ownerSVGElement===void 0,i=z(n);return{o:function(l,s){i.value=l,o=s},d:at(function(){this.N=Es;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))})}}Xt("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)});Xt("__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 yn(e,t){return Ae(function(){return z(e,t)},[])}function J(e,t){var n=N(e);return n.current=e,yo.__$f|=4,Ae(function(){return bn(function(){return n.current()},t)},[])}var K_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function j_(){Kt(function(){for(var e;e=Cs.shift();)ws.call(e)})}function Es(){Cs.push(this)===1&&(ee.requestAnimationFrame||K_)(j_)}function Rs(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function As(e){return Rs(e)}function Is(e){return!(!Rs(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function xo(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var X_=900;function Qr(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;if(o==="expanded"||o==="fullscreen"||o==="normal")return o;if(o==="auto"){let a=t.autoSizeBreakpoint??X_;return n>=a?"expanded":"normal"}return"normal"}function xn(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:Qr(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function Yt(){return typeof window>"u"?0:window.innerWidth}var Y_="x-public-key",J_="x-ai-agent-deployment-id";function Ls(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[J_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??Y_]=e.publicKey),t}}}var We=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 Ms=q.scope("parser");async function*Zr(e,t){if(!e.ok){let a=await e.text().catch(()=>"");throw new We(`server responded ${e.status}: ${a.slice(0,200)}`,"server",e.status)}if(!e.body)throw new We("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();if(s){let c=Ns(s);c&&(yield c)}return}o+=i;let l;for(;(l=o.indexOf(`
|
|
8
8
|
|
|
9
|
-
`))!==-1;){let s=o.slice(0,l);o=o.slice(l+2);let c=
|
|
9
|
+
`))!==-1;){let s=o.slice(0,l);o=o.slice(l+2);let c=Ns(s);c&&(yield c)}}}finally{n.releaseLock()}}function Ns(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||t==="[DONE]")return null;try{let o=JSON.parse(t);return Ns.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return Ns.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function Z_(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 Os=e=>e&&Object.keys(e).length>0?e:void 0;function $s(e,t){let n=Os(e),o=Os(t);if(!n&&!o)return;let a={};return n&&(a.user=n),o&&(a.page=o),Z_(JSON.stringify(a))}function ko(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function eu(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Fs(e){return e.startsWith("tool-")?e.slice(5):e}var He={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",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Hs="context";function So(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 Bs(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:ou(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(nu).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function tu(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function nu(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function ou(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"&&tu(n)){let o={type:eu(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 Q=q.scope("transport"),zs=3,Vs=400,ru=5e3,au=6e4,Us=1e4,qs=3,iu=new Set([408,425,429,500,502,503,504]);function Ws(e){return Vs*2**e+Math.floor(Math.random()*250)}function su(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}function lu(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||n.role!=="assistant")continue;let o=n.parts.find(a=>a.type==="data-suggestions");return o?.type==="data-suggestions"?So(o.data):void 0}}function ea(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 wo=class{constructor(t){X(this,"opts",t);X(this,"visitorId");X(this,"conversationId");X(this,"resumeStatus");X(this,"userContext");X(this,"pageContext");X(this,"locale");X(this,"conversationsCache",new Map);X(this,"contentCache",new Map)}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:qt};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[Hs]=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){Q.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(He.handshake,t,"handshake");return Q.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),du(n)||Q.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){Q.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 Q.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){Q.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${cu(n)}`),o.append("mimeType",n);let a=await this.postForm(this.transcribePath,o,"transcribe");return Q.debug("transcribe \u2190",{textLen:a.text.length}),a}conversationsKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){let n=this.conversationsCache.get(this.conversationsKey(t));if(n?.value&&Date.now()-n.at<Us)return n.value}listConversations(t={}){let n=this.conversationsKey(t),o=this.conversationsCache.get(n);if(o&&Date.now()-o.at<Us)return Q.debug("listConversations \u2192 cache",t),o.result;let a={at:Date.now(),result:this.fetchConversations(t).then(i=>(a.value=i,i)).catch(i=>{throw this.conversationsCache.delete(n),i})};return this.conversationsCache.set(n,a),a.result}async fetchConversations(t){let n=new URL(this.url(He.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),Q.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 Q.debug("listConversations \u2190",{count:a.length,nextCursor:o.nextCursor}),{conversations:a.map(i=>({conversationId:i.conversationId,title:i.title,lastMessageAt:i.lastMessageAt,preview:i.preview,canContinue:i.canContinue,hasUnread:i.hasUnread})),nextCursor:o.nextCursor}}async loadConversation(t){let n=new URL(this.url(He.listMessages));n.searchParams.set("conversationId",t),Q.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),a=o.messages??[];return Q.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:a.length,hasSuggestions:!!o.suggestions}),{conversationId:o.conversationId,canContinue:o.canContinue??!0,messages:a,agent:o.agent,suggestions:lu(a)??o.suggestions}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),Q.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(He.markRead,{conversationId:t},"markRead")}catch(n){Q.debug("markRead failed (non-fatal)",{err:n})}}}listContent(t={}){let n=`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`,o=this.contentCache.get(n);if(o&&Date.now()-o.at<au)return Q.debug("listContent \u2192 cache",t),o.result;let a=this.fetchContent(t).catch(i=>{throw this.contentCache.delete(n),i});return this.contentCache.set(n,{at:Date.now(),result:a}),a}async fetchContent(t){let n=new URL(this.dataUrl(He.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));Q.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),a=(o.items??[]).map(i=>ci(i,this.locale));return Q.debug("listContent \u2190",{count:a.length,total:o.pagination?.total}),{...o,items:a}}async bootstrap(t){let n=new URL(this.dataUrl(He.bootstrap));t&&n.searchParams.set("conversationId",t),Q.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),a=o.forms??[],i=o.formSubmissions??[];return Q.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){Q.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(He.updateSettings,{userPrefs:t},"saveUserPrefs");return Q.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??He.submitForm}async submitForm(t){Q.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){Q.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){Q.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(He.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){Q.debug("submitFeedback failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),Q.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()}}resumeStream(){let t=new AbortController,n=new Set;this.resumeStatus=void 0;let o=this.resumeStreamGen(t,n,!0),a=()=>t.abort();return{iter:o,cancel:a,detach:a}}async*runStream(t,n,o){(yield*this.drain(this.openMessageStream(t,n.signal),o,n))||(yield*this.resumeStreamGen(n,o,!1))}async*resumeStreamGen(t,n,o){for(let a=1;a<=zs&&!t.signal.aborted;a++){if((!o||a>1)&&(await ea(Vs*a,t.signal),t.signal.aborted))return;let i;try{i=await this.fetchImpl(this.resumeUrl(n.size),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(c){if(t.signal.aborted)return;Q.debug("resume fetch failed \u2014 retrying",{attempt:a,err:c});continue}if(i.status===204||!i.ok){Q.debug("resume \u2192 no in-flight stream",{status:i.status});return}if(!(i.headers.get("content-type")??"").includes("text/event-stream")){let c=await i.json().then(d=>d.status).catch(()=>{});if(Q.debug("resume \u2192 no live stream (status response)",{status:c,attempt:a}),c==="pending"&&a<zs)continue;this.resumeStatus=c==="needs-generation"?"needs-generation":"completed";return}this.resumeStatus="live";let s=n.size;if(yield*this.drain(Zr(i,t.signal),n,t))return;if(n.size===s){Q.debug("resume \u2192 stream closed with no new events; nothing to resume");return}}if(!t.signal.aborted)throw new We("stream incomplete after resume attempts","server")}async*drain(t,n,o){let a=!1,i;try{for await(let l of t){if(o.signal.aborted)return!0;if(l.eventId){if(n.has(l.eventId))continue;n.add(l.eventId)}yield l,(l.chunk.type==="finish"||l.chunk.type==="error")&&(a=!0,i??(i=setTimeout(()=>o.abort(),ru)))}}catch(l){if(o.signal.aborted)return!0;if(l instanceof We&&l.status!==void 0)throw l;Q.debug("stream segment dropped",{err:l})}finally{i&&clearTimeout(i)}return a}cancelStream(t,n){t.signal.aborted||(Q.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(He.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>Q.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(He.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*Zr(o,n)}resumeUrl(t){let n=new URL(this.withEnvelopeQuery(He.streamResume));return n.searchParams.set("resumeAt",String(t)),n.toString()}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>=qs)throw new We(`${n} failed: network error`,"network",void 0,c);Q.debug("request network error \u2014 retrying",{label:n,attempt:o}),await ea(Ws(o));continue}if(l.ok||!iu.has(l.status)||o>=qs)return l;let s=su(l.headers)??Ws(o);Q.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await ea(s)}}async assertOk(t,n){if(!t.ok)throw new We(`${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 cu(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 du(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:z(e),doneSig:z(!0)}]:[];return{id:qe(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:z(n)}}function Pn(){return{id:qe(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:z([])}}function Ks(e){let t=qe();return _u({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function _u(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:z(e.parts.map(gu))}}function uu(e){let t=e.parts.map((n,o)=>n.type==="text"?{kind:"text",id:`${e.id}-t${o}`,textSig:z(n.text),doneSig:z(!0)}:n.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${o}`,textSig:z(n.text),doneSig:z(n.state!=="streaming")}:n.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${o}`}:n.type==="file"?{kind:"file",url:n.url,mediaType:n.mediaType}:n.type==="source-url"?{kind:"source",sourceId:n.sourceId,url:n.url,title:n.title}:n.type==="source-document"?{kind:"source",sourceId:n.sourceId,title:n.title,filename:n.filename,mediaType:n.mediaType}:n.type==="data-suggestions"?null:n.type.startsWith("tool-")?{kind:"tool",toolCallId:n.toolCallId,toolName:Fs(n.type),inputPartialSig:z(""),inputSig:z(n.input),outputSig:z(n.output),errorSig:z(n.errorText),stateSig:z(n.state),approvalSig:z(n.approval)}:null).filter(n=>n!==null);return{id:e.id,role:e.role,serverMessageId:e.id,createdAt:ko(e.createdAt)??Date.now(),status:e.status==="failed"?"error":"complete",canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:z(t)}}var pu=new Set(["completed","failed","canceled"]);function mu(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 fu(e){return e.role==="assistant"&&e.status!=null&&!pu.has(e.status)&&mu(e)}function na(e){return e.filter(t=>!fu(t)).map(uu)}function js(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(hu)}}function Co(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function To(e){return Co(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function it(e){return e.role==="assistant"&&e.status!=="streaming"&&To(e)}function Xs(e){return e.canceled===!0&&it(e)}function gu(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:z(e.text),doneSig:z(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:z(e.inputPartial),inputSig:z(e.input),outputSig:z(e.output),errorSig:z(e.error),stateSig:z(e.state),approvalSig:z(e.approval)}:e}function hu(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 Ys=q.scope("reducer"),Eo=class{constructor(t){X(this,"messagesSig",t);X(this,"active",null);X(this,"openTextParts",new Map);X(this,"partSeq",0)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.openTextParts.clear()}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:z(""),doneSig:z(!1)};return this.openTextParts.set(a,l),kn(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":t.messageId&&(n.serverMessageId=t.messageId);return;case"finish-step":this.openTextParts.clear();return;case"start-step":kn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":Ys.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Ys.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":vu(n,t);return;case"file":kn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":Js(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":Js(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":return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function wt(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:z(""),inputSig:z(void 0),outputSig:z(void 0),errorSig:z(void 0),stateSig:z("input-streaming"),approvalSig:z(void 0)};return kn(e,a),a}function kn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function Js(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||kn(e,t)}function vu(e,t){switch(t.type){case"tool-input-start":wt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=wt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=wt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=wt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=wt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=wt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=wt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}var Qs=q.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){Qs.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=>(Qs.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var Zs={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},el={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,Ro=0;function bu(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function yu(){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=`__${x.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 tl(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(bu())try{navigator.vibrate(e);return}catch{}if(ft||(ft=yu()),!!ft)try{ft.label.click()}catch{}}}function nl(){Ro++;let e=!1;return()=>{e||(e=!0,Ro=Math.max(0,Ro-1),Ro===0&&ft&&(ft.input.remove(),ft.label.remove(),ft=null))}}var xu=q.scope("feedback"),Pu=100,Io=class{constructor(t,n){X(this,"mutedSig",z(!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=nl(),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<Pu}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>xu.warn("audio play failed",{err:a,url:n}));return}let o=el[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?Zs[t]:n;tl(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 Ct(e,t){return e instanceof We&&e.status===429?t.errorRateLimited:t.errorGeneric}var ku=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:--ku,__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 ee.vnode&&ee.vnode(d),d}var F={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Sn=`${x.cssPrefix}-icon-dir`,oa=()=>r("svg",{...F,"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"})}),Qe=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),ol=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),rl=()=>r("svg",{...F,class:Sn,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),al=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),il=()=>r("svg",{...F,class:Sn,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),Jt=()=>r("svg",{...F,class:Sn,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),sl=()=>r("svg",{...F,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),ll=()=>r("svg",{...F,"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"})}),cl=()=>r("svg",{...F,"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"})]}),dl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),_l=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),ul=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),pl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),ml=()=>r("svg",{...F,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),fl=()=>r("svg",{...F,"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"})]}),gl=()=>r("svg",{...F,"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"})}),hl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),vl=()=>r("svg",{...F,"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"})]}),bl=()=>r("svg",{...F,class:Sn,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),Tt=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),yl=()=>r("svg",{...F,"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"})]}),xl=()=>r("svg",{...F,"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"})]}),wn=()=>r("svg",{...F,class:Sn,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Pl=()=>r("svg",{...F,"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"})]}),Et=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),kl=()=>r("svg",{...F,"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"})]}),Su=()=>r("svg",{...F,"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"})]}),ra=()=>r("svg",{...F,"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"})}),Cn=()=>r("svg",{...F,"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"})]}),wu=()=>r("svg",{...F,"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"})]}),Cu=()=>r("svg",{...F,"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"})]}),Tu=()=>r("svg",{...F,"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"})]}),Eu=()=>r("svg",{...F,"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"})]}),aa=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),Sl=()=>r("svg",{...F,"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"})]}),wl=()=>r("svg",{...F,"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"})]}),Cl=()=>r("svg",{...F,"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"})]}),Tn=()=>r("svg",{...F,"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",{...F,"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",{...F,"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"})}),Al=()=>r("svg",{...F,"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"})]}),Au=()=>r("svg",{...F,"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"})]}),Ru=()=>r("svg",{...F,"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"})]}),Iu=()=>r("svg",{...F,"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"})]}),Lu=()=>r("svg",{...F,"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",{...F,"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"})]}),Il=()=>r("svg",{...F,"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"})]}),Ll=()=>r("svg",{...F,"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"})]}),Ml=()=>r("svg",{...F,"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"})]}),Nl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),Lo=()=>r("svg",{...F,"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"})]}),Mo=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),Dl={chat:oa,message:ra,bubbles:Tn,spark:Su,wand:wu,bot:Cu,help:Cn,lifebuoy:Eu,headset:Tu,search:Au,sparkles:Ru,concierge:Iu,wave:Lu};var M=x.cssPrefix,S={launcher:`${M}-launcher`,callout:`${M}-callout`,calloutDismiss:`${M}-callout-dismiss`,panel:`${M}-panel`,panelHeader:`${M}-panel-header`,resizeGrip:`${M}-resize-grip`,scrollToBottom:`${M}-scroll-to-bottom`,actionHistory:`${M}-action-history`,actionClose:`${M}-action-close`,langSegment:`${M}-lang-segment`,composer:`${M}-composer`,composerInput:`${M}-composer-input`,composerSend:`${M}-composer-send`,composerStop:`${M}-composer-stop`,composerAttach:`${M}-composer-attach`,composerFileInput:`${M}-composer-file-input`,composerVoice:`${M}-composer-voice`,attachmentChip:`${M}-attachment-chip`,attachmentRemove:`${M}-attachment-remove`,suggestion:`${M}-suggestion`,messageBubble:`${M}-message`,messageRetry:`${M}-message-retry`,messageFeedback:`${M}-message-feedback`,feedbackUp:`${M}-feedback-up`,feedbackDown:`${M}-feedback-down`,messageCopy:`${M}-message-copy`,historyPane:`${M}-history-pane`,historyBack:`${M}-history-back`,historyItem:`${M}-history-item`,sidebar:`${M}-sidebar`,sidebarToggle:`${M}-sidebar-toggle`,sidebarNewConversation:`${M}-sidebar-new-conversation`,sidebarItem:`${M}-sidebar-item`,messengerHome:`${M}-messenger-home`,modulesEmpty:`${M}-modules-empty`,tab:`${M}-tab`,tabBadge:`${M}-tab-badge`,homeView:`${M}-home-view`,homeGreeting:`${M}-home-greeting`,homeBrand:`${M}-home-brand`,backHeader:`${M}-back-header`,contentView:`${M}-content-view`,contentScroll:`${M}-content-scroll`,homeSearch:`${M}-home-search`,helpSearch:`${M}-help-search`,homeRecent:`${M}-home-recent`,homeContentRow:`${M}-home-content-row`,helpArticle:`${M}-help-article`,newsItem:`${M}-news-item`,formGate:`${M}-form-gate`,formDone:`${M}-form-done`,formDoneToggle:`${M}-form-done-toggle`,formAnswers:`${M}-form-answers`,formFill:`${M}-form-fill`,formSubmit:`${M}-form-submit`,formSkip:`${M}-form-skip`,formField:`${M}-form-field`,toolAskQuestions:`${M}-tool-ask-questions`,toolInputSubmit:`${M}-tool-input-submit`,toolInputSkip:`${M}-tool-input-skip`,toolApproval:`${M}-tool-approval`,toolApprove:`${M}-tool-approve`,toolReject:`${M}-tool-reject`,toolEdit:`${M}-tool-edit`,toolDecision:`${M}-tool-decision`,toolAskSummary:`${M}-ask-questions-summary`,toolAskOptions:`${M}-ask-questions-options-toggle`,toolCall:`${M}-tool-call`,source:`${M}-source`};function Pe(e,t){return`${e}-${t}`}var No=x.cssPrefix;function Ol({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:a}){let i=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${No}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":S.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Mu(t.icon),i?r("span",{class:`${No}-fab-label`,children:Ae(n,t.label??"")}):null]})}function Mu(e){let t=Dl[e];return t?r(t,{}):r(Nu,{source:e})}function Nu({source:e}){return r("span",{ref:t=>{t&&Du(t,e)},"aria-hidden":"true"})}function Du(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]=E(!1);return A(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),A(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?r("div",{class:`${No}-callout`,role:"status","data-shape":e.shape,"data-position":Ou(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":S.callout,children:[r("span",{children:Ae(n,e.text)}),r("button",{type:"button",class:`${No}-callout-close`,onClick:a,"aria-label":o,title:o,"data-testid":S.calloutDismiss,children:r(Qe,{})})]}):null}function Ou(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function Do({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:a,strings:i}){let l=x.cssPrefix,s=N(null);if(A(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(m.setProperty(`--${l}-widget-w`,`${o.width}px`),m.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"}`,g=m=>{if(!e)return;let P=m.currentTarget,v=e.getBoundingClientRect();s.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:v.width,startH:v.height,dirX:d?-1:1,dirY:c?1:-1},P.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},_=m=>{let P=s.current;if(!P||m.pointerId!==P.pointerId||!e)return;let v=(m.clientX-P.startX)*P.dirX,y=(m.clientY-P.startY)*P.dirY;e.style.setProperty(`--${l}-widget-w`,`${P.startW+v}px`),e.style.setProperty(`--${l}-widget-h`,`${P.startH+y}px`)},f=m=>{let P=s.current;if(!P||m.pointerId!==P.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let v=e.getBoundingClientRect();a({width:Math.round(v.width),height:Math.round(v.height)}),s.current=null};return r("div",{class:u,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:g,onPointerMove:_,onPointerUp:f,onPointerCancel:f,"data-testid":S.resizeGrip,children:r(ml,{})})}var At=x.cssPrefix,$u=`.${At}-header, .${At}-back-header, .${At}-home-hero`,Fu='button, a, input, textarea, select, [role="tab"], [contenteditable]',Fl=56;function Oo(e,t){A(()=>{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($u)||d.closest(Fu))return;let u=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${At}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${At}-modal-dy`)),maxX:(window.innerWidth+u.width)/2-Fl,maxY:(window.innerHeight+u.height)/2-Fl},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(`--${At}-modal-dx`,`${d}px`),e.style.setProperty(`--${At}-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 En(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 En("close",e,t)?n.includes("close"):!1}function Hl(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Hu='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(Hu)].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 Ho(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var ia=x.cssPrefix;function Bl({agent:e,strings:t}){let n=e.status??"online",o=Ae(t,e.name),a=e.title?Ae(t,e.title):null;return r("div",{class:`${ia}-agent`,children:[r("div",{class:`${ia}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:Ho(o)})}),r("div",{class:`${ia}-agent-meta`,children:[r("strong",{children:o}),a?r("span",{children:a}):null]})]})}var zl=q.scope("attachments");function Bo(e,t,n){let o=zu(e),a=[],i=[],l=Wu(n.accept),s=t.reduce((d,u)=>d+u.size,0),c=t.length;for(let d of o){let u=Bu(d,c,s,n,l);if(u){i.push({file:d,reason:u});continue}a.push(qu(d)),s+=d.size,c+=1}return(a.length||i.length)&&zl.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function sa(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){zl.debug("revokeObjectURL failed",{error:t})}}function Bu(e,t,n,o,a){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Vu(e,a)?null:"mime"}function zu(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Uu(t)).filter(t=>t!==null):[]}function Uu(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function qu(e){return{file:e,id:qe(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Wu(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 Vu(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 An=x.cssPrefix;function Ul({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${An}-attachment-chip`,title:e.name,"data-testid":Pe(S.attachmentChip,e.id),children:[n?r("img",{class:`${An}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${An}-attachment-thumb`,"aria-hidden":"true",children:r(kl,{})}),r("span",{class:`${An}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${An}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":Pe(S.attachmentRemove,e.id),children:r(Qe,{})})]})}var la={isSupported:!1,start:()=>{},stop:()=>{}};function ca(e,t,n){return e==="disabled"?la:e==="server"?Xu(n):Gu(t)}function Gu(e){let t=Ku();if(!t)return la;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 g=s.results[u];g&&(c+=g[0].transcript,g.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 Ku(){let e=globalThis;return e.SpeechRecognition??e.webkitSpeechRecognition}var ju=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Xu(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return la;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=Yu();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 Yu(){for(let e of ju)if(MediaRecorder.isTypeSupported(e))return e}var Be=x.cssPrefix,Rt=q.scope("composer");function Qt(e){return e.reduce((t,n)=>t+n.size,0)}var Ju={arrowUp:al,paperPlane:rl,send:il,chevron:Jt};function ql({options:e,transport:t,feedback:n,bus:o,isStreaming:a,onSend:i,onStop:l,attachApiRef:s}){let c=e.strings,[d,u]=E(""),[g,_]=E([]),[f,m]=E(!1),P=N(null),v=N(null),y=e.features.files,C=e.features.voice,[b,T]=E(()=>ca(C,e.locale,(w,K)=>t.transcribe(w,K)));A(()=>{f||C==="disabled"||T(ca(C,e.locale,(w,K)=>t.transcribe(w,K)))},[e.locale,C,t,f]),A(()=>{let w=P.current;if(!w)return;let K=w.getRootNode(),te="activeElement"in K?K.activeElement:null;te&&w.closest(`.${Be}-panel`)?.contains(te)||w.focus({preventScroll:!0})},[]),A(()=>{let w=P.current;if(w){if(d.length===0){w.style.height="";return}w.style.height="auto",w.style.height=`${Math.min(Math.max(w.scrollHeight,40),160)}px`}},[d]);let H=N(g);H.current=g,A(()=>()=>H.current.forEach(sa),[]),A(()=>{if(s)return s.current={attachFromDrop:w=>{let K=Bo(w,H.current,e.attachments);K.accepted.length!==0&&(Rt.info("attach (drop)",{count:K.accepted.length,totalBytes:Qt(K.accepted)}),o.emit("attach",{count:K.accepted.length,totalBytes:Qt(K.accepted)}),_(te=>[...te,...K.accepted]))}},()=>{s.current&&(s.current=null)}},[s,e.attachments]),A(()=>{let w=P.current;if(!w)return;let K=w.closest(`.${Be}-panel`);if(!K)return;let te=he=>{let _e=he.clipboardData;if(!_e)return;let Me=he.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(Me&&Me!==w)return;if(y){let Ne=Bo(_e.items,H.current,e.attachments);if(Ne.accepted.length>0){he.preventDefault(),Rt.info("attach (paste)",{count:Ne.accepted.length,totalBytes:Qt(Ne.accepted)}),o.emit("attach",{count:Ne.accepted.length,totalBytes:Qt(Ne.accepted)}),_(ue=>[...ue,...Ne.accepted]);return}}if(Me===w)return;let ve=_e.getData("text/plain");ve&&(he.preventDefault(),u(Ne=>Ne+ve),w.focus())};return K.addEventListener("paste",te),()=>K.removeEventListener("paste",te)},[y,e.attachments,Be]);let Z=()=>{let w=d.trim();!w&&g.length===0||a||(i(w,g),u(""),_([]))},Y=w=>{w.key!=="Enter"||w.shiftKey||w.isComposing||(w.preventDefault(),a?l():Z())},oe=w=>{let K=w.target,te=Bo(K.files,g,e.attachments);te.accepted.length>0&&(Rt.info("attach (file picker)",{count:te.accepted.length,totalBytes:Qt(te.accepted)}),o.emit("attach",{count:te.accepted.length,totalBytes:Qt(te.accepted)}),_(he=>[...he,...te.accepted])),K.value=""},G=w=>{Rt.info("removeAttachment",{id:w}),o.emit("removeAttachment",{id:w}),_(K=>{let te=K.find(he=>he.id===w);return te&&sa(te),K.filter(he=>he.id!==w)})},I=N(null),D=()=>{if(b.isSupported){if(f){let w=I.current?Date.now()-I.current:0;Rt.info("voiceStop",{durationMs:w}),o.emit("voiceStop",{durationMs:w}),b.stop(),m(!1),n.play("voiceStop"),I.current=null;return}I.current=Date.now(),Rt.info("voiceStart"),o.emit("voiceStart",void 0),m(!0),n.play("voiceStart"),b.start((w,K)=>u(te=>K?`${te}${w} `:te),()=>{if(m(!1),I.current){let w=Date.now()-I.current;Rt.debug("voiceStop (auto)",{durationMs:w}),o.emit("voiceStop",{durationMs:w}),I.current=null}})}},B=Ju[e.composer.sendButton.icon];return r("div",{class:`${Be}-composer`,"data-testid":S.composer,children:[g.length>0?r("div",{class:`${Be}-attachments`,children:g.map(w=>r(Ul,{attachment:w,onRemove:()=>G(w.id)},w.id))}):null,r("div",{class:`${Be}-composer-row`,children:[r("div",{class:`${Be}-composer-actions`,children:[y?r("button",{type:"button",class:`${Be}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":c.attach,"data-testid":S.composerAttach,children:r(ll,{})}):null,b.isSupported?r("button",{type:"button",class:`${Be}-icon-btn`,onClick:D,"aria-label":f?c.micStop:c.micStart,"aria-pressed":f,"data-recording":f?"true":void 0,"data-testid":S.composerVoice,children:r(cl,{})}):null]}),r("textarea",{ref:P,class:`${Be}-textarea`,rows:1,value:d,placeholder:c.composerPlaceholder,onInput:w=>u(w.target.value),onKeyDown:Y,"aria-label":c.composerPlaceholder,"data-testid":S.composerInput}),a?r("button",{type:"button",class:`${Be}-send`,onClick:l,"aria-label":c.stop,"data-testid":S.composerStop,children:r(sl,{})}):r("button",{type:"button",class:`${Be}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:Z,disabled:!d.trim()&&g.length===0,"aria-label":c.send,"data-testid":S.composerSend,children:r(B,{})})]}),r("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:oe,class:`${Be}-sr-only`,"data-testid":S.composerFileInput})]})}var Qu=x.cssPrefix;function Wl({visible:e,strings:t}){return e?r("div",{class:`${Qu}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function zo({containerRef:e,onDrop:t}){let[n,o]=E(!1);return A(()=>{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 Vl({itemCount:e,initialFocusIndex:t}){let[n,o]=E(!1),a=N(null),i=N(null),[l,s]=E(-1),c=$(()=>{o(!1),s(-1),a.current?.focus()},[]),d=$(()=>o(_=>!_),[]);A(()=>{if(!n)return;let _=f=>{let m=i.current,P=a.current;if(!m||!P)return;let v=f.composedPath();v.includes(m)||v.includes(P)||(o(!1),s(-1))};return document.addEventListener("click",_,!0),()=>document.removeEventListener("click",_,!0)},[n]),A(()=>{if(!n||e===0)return;let _=t?.()??0,f=_<0||_>=e?0:_;s(f)},[n,e,t]),A(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let u=$(_=>{(_.key==="ArrowDown"||_.key==="Enter"||_.key===" ")&&(_.preventDefault(),o(!0))},[]),g=$(_=>{if(e!==0)switch(_.key){case"Escape":_.preventDefault(),c();return;case"ArrowDown":_.preventDefault(),s(f=>(f+1)%e);return;case"ArrowUp":_.preventDefault(),s(f=>(f-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:g}}function Gl({items:e,triggerLabel:t}){let n=x.cssPrefix,o=Vl({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)),g=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")g=(u+1)%d.length;else if(s.key==="ArrowLeft")g=(u-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[g].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(fl,{})}),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":`${S.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(Tt,{})}):null]},s.id))}):null]})}var da=x.cssPrefix;function Zu(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 ep={normal:"large",large:"small",small:"normal"};function tp(e){return e==="light"?r(Tl,{}):e==="dark"?r(El,{}):r(Al,{})}function np(e){return(e.split("-")[0]??e).toUpperCase()}function Ze({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:g,onThemeChange:_,onTextSizeChange:f}=e,m=n.strings,P=n.mode,v=t==="chat",y=J(()=>a.mutedSig.value).value,C=new Set(n.actions),b=w=>C.has(w),T=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,H=w=>T?!1:En(w,P,o),Z=n.themeMode,Y={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},oe=n.textSize,G={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},I=[];if(v&&b("clear")&&I.push({id:"clear",icon:r(Pl,{}),label:m.newConversation,onSelect:l}),b("expand")&&H("expand")){let w=o==="expanded";I.push({id:"expand",icon:w?r(_l,{}):r(dl,{}),label:w?m.collapse:m.expand,type:"switch",on:w,onSelect:s})}if(b("fullscreen")&&H("fullscreen")){let w=o==="fullscreen";I.push({id:"fullscreen",icon:w?r(pl,{}):r(ul,{}),label:w?m.exitFullscreen:m.fullscreen,type:"switch",on:w,onSelect:c})}v&&b("sound")&&I.push({id:"sound",icon:y?r(hl,{}):r(gl,{}),label:y?m.soundOff:m.soundOn,type:"switch",on:!y,onSelect:d}),b("theme")&&I.push({id:"theme",icon:tp(Z),label:`${m.theme}: ${Y[Z]}`,onSelect:()=>_(Zu(Z)),keepOpen:!0}),b("textSize")&&I.push({id:"textSize",icon:r(vl,{}),label:`${m.textSize}: ${G[oe]}`,onSelect:()=>f(ep[oe]),keepOpen:!0}),b("language")&&n.availableLocales.length>1&&I.push({id:"language",icon:r(xl,{}),label:m.language,segments:n.availableLocales.map(w=>({value:w,label:np(w),lang:w})),value:n.locale,onSelectValue:g});let D=!!i&&$o(P,o,n.actions),B=v&&b("history");return r("div",{class:`${da}-header-actions`,children:[B?r("button",{type:"button",class:`${da}-icon-btn`,onClick:u,"aria-label":m.history,title:m.history,"data-testid":S.actionHistory,children:r(yl,{})}):null,I.length>0?r(Gl,{items:I,triggerLabel:m.moreActions}):null,D?r("button",{type:"button",class:`${da}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":S.actionClose,children:r(Qe,{})}):null]})}var op=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,rp=/^https?:\/\/[^\s.]+\.[^\s]+$/i,ap=/^[+]?[\d\s().-]{6,}$/;function Zt(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function ip(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function sp(e,t,n){let o=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=ip(t);return o&&l===0?n.formRequired:l===0?void 0:a?.minSelections!=null&&l<a.minSelections?Zt(n.formChooseAtLeast,{min:a.minSelections}):a?.maxSelections!=null&&l>a.maxSelections?Zt(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(!op.test(i))return n.formInvalidEmail;break;case"url":if(!rp.test(i))return n.formInvalidUrl;break;case"tel":if(!ap.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 Zt(n.formNumberTooSmall,{min:a.min});if(a?.max!=null&&l>a.max)return Zt(n.formNumberTooLarge,{max:a.max});break}default:break}if(a?.minLength!=null&&i.length<a.minLength)return Zt(n.formTooShort,{min:a.minLength});if(a?.maxLength!=null&&i.length>a.maxLength)return Zt(n.formTooLong,{max:a.maxLength});if(a?.pattern)try{if(!new RegExp(a.pattern).test(i))return n.formPatternMismatch}catch{}}function Kl(e,t,n){let o={};for(let a of e){let i=sp(a,t[a.name],n);i&&(o[a.name]=i)}return o}function jl(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 le=x.cssPrefix,Uo="__other__";function Rn({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,initialValues:d,hideActions:u,fieldTypeLabels:g,rootTestId:_,submitTestId:f,skipTestId:m}){let[P,v]=E(()=>({..._p(e),...d})),[y,C]=E({}),[b,T]=E({}),H=I=>{b[I]&&T(D=>({...D,[I]:""}))},Z=(I,D)=>{v(B=>({...B,[I]:D})),H(I)},Y=(I,D)=>{C(B=>({...B,[I]:D})),H(I)},oe=I=>{if(I.preventDefault(),c)return;let D=up(e,P,y),B=Kl(e,D,t);if(Object.keys(B).length>0){T(B);return}o(jl(D))},G=I=>{!s||I.key!=="Enter"||I.shiftKey||I.isComposing||I.target?.tagName==="TEXTAREA"&&oe(I)};return r("form",{class:`${le}-form`,onSubmit:oe,onKeyDown:G,"data-testid":_,noValidate:!0,children:[e.map(I=>r(lp,{field:I,value:P[I.name],otherText:y[I.name]??"",error:b[I.name],disabled:c,typeLabel:g?.[I.name],strings:t,onChange:D=>Z(I.name,D),onOtherChange:D=>Y(I.name,D)},I.name)),u?null:r("div",{class:`${le}-form-actions`,children:[l?r("span",{class:`${le}-form-hint`,children:l}):null,a&&i?r("button",{type:"button",class:`${le}-form-skip`,onClick:i,disabled:c,"data-testid":m,children:a}):null,r("button",{type:"submit",class:`${le}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function lp({field:e,value:t,otherText:n,error:o,disabled:a,typeLabel:i,strings:l,onChange:s,onOtherChange:c}){let d=Pe(S.formField,e.name),u=cp({field:e,value:t,otherText:n,disabled:a,strings:l,onChange:s,onOtherChange:c,fieldTid:d});return r("label",{class:`${le}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[r("span",{class:`${le}-field-head`,children:[r("span",{class:`${le}-field-label`,children:[e.label,e.required??!0?r("span",{class:`${le}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?r("span",{class:`${le}-field-type`,children:i}):null]}),u,e.validationHint&&!o?r("span",{class:`${le}-field-hint`,children:e.validationHint}):null,o?r("span",{class:`${le}-field-error`,role:"alert",children:o}):null]})}function cp(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:`${le}-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:`${le}-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:`${le}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(g=>r("label",{class:`${le}-choice`,children:[r("input",{type:"radio",name:`${le}-${t.name}`,checked:d===g.value,disabled:a,onChange:()=>l(g.value)}),r("span",{children:g.label??g.value})]},g.value)),t.allowOther?r("label",{class:`${le}-choice`,children:[r("input",{type:"radio",name:`${le}-${t.name}`,checked:d===Uo,disabled:a,onChange:()=>l(Uo)}),r("span",{children:i.formOther})]}):null,u?r("input",{class:`${le}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:g=>s(g.target.value)}):null]})}case"checkbox":return r("label",{class:`${le}-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:[],g=(_,f)=>l(f?[...u,_]:u.filter(m=>m!==_));return r("div",{class:`${le}-field-choices`,"data-testid":c,children:[(t.options??[]).map(_=>r("label",{class:`${le}-choice`,children:[r("input",{type:"checkbox",checked:u.includes(_.value),disabled:a,onChange:f=>g(_.value,f.target.checked)}),r("span",{children:_.label??_.value})]},_.value)),t.allowOther||(t.options??[]).length===0?r("textarea",{class:`${le}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:_=>s(_.target.value)}):null]})}default:return r("input",{class:`${le}-field-input`,type:dp(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c})}}function dp(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function _p(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 up(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 et=x.cssPrefix;function _a({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${et}-form-gate`,"data-testid":S.formGate,children:[e.title?r("h3",{class:`${et}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${et}-form-gate-desc`,children:e.description}):null,r(Rn,{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:S.formSubmit,skipTestId:S.formSkip})]})}function Xl({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",a=o?t.formSkipped:t.formSubmitted,i=e.title?r(ie,{children:[r("span",{children:e.title}),r("span",{class:`${et}-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:`${et}-form-done`,"data-outcome":e.outcome,"data-testid":S.formDone,children:[r("summary",{class:`${et}-form-done-summary`,"data-testid":S.formDoneToggle,children:[r(Tt,{}),i,r(Jt,{})]}),r("dl",{class:`${et}-form-answers`,"data-testid":S.formAnswers,children:Object.entries(s).map(([d,u])=>r("div",{class:`${et}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:u})]},d))})]})}return r("div",{class:`${et}-form-done`,"data-outcome":e.outcome,"data-testid":S.formDone,role:"status",children:[o?r(bl,{}):r(Tt,{}),i,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${et}-form-done-fill`,"data-testid":S.formFill,onClick:n,children:t.formFillOut}):null]})}function Yl(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var ma=1,Ql=2,Zl=4,ec=8,tc=16;function pp(e){switch(e){case ma:return"href";case Ql:return"src";case Zl:return"class";case ec:return"checked";case tc:return"start"}}var mp=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}},fp=mp;var Jl=24;function ga(e){let t=new Uint32Array(Jl);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(Jl),indent:"",indent_len:0,table_state:0}}function nc(e){e.pending.length>0&&Ce(e,`
|
|
12
|
-
`)}function ne(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 fe(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 re(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&fe(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function
|
|
13
|
-
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){fe(e),st(e),e.pending=n;continue}It(e,e.blockquote_idx),st(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" ":
|
|
14
|
-
`:if(e.hr_chars<3)break;
|
|
15
|
-
`:{
|
|
11
|
+
${a}`:a;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(!t||t==="[DONE]")return null;try{let o=JSON.parse(t);return Ms.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return Ms.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function Q_(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 Os(e,t){let n=Ds(e),o=Ds(t);if(!n&&!o)return;let a={};return n&&(a.user=n),o&&(a.page=o),Q_(JSON.stringify(a))}function Po(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Z_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function $s(e){return e.startsWith("tool-")?e.slice(5):e}var He={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",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Fs="context";function ko(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 Hs(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:nu(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(tu).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function eu(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function tu(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function nu(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"&&eu(n)){let o={type:Z_(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 Q=q.scope("transport"),Bs=3,Ws=400,ou=5e3,ru=6e4,zs=1e4,Us=3,au=new Set([408,425,429,500,502,503,504]);function qs(e){return Ws*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}function su(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||n.role!=="assistant")continue;let o=n.parts.find(a=>a.type==="data-suggestions");return o?.type==="data-suggestions"?ko(o.data):void 0}}function ea(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 So=class{constructor(t){X(this,"opts",t);X(this,"visitorId");X(this,"conversationId");X(this,"resumeStatus");X(this,"userContext");X(this,"pageContext");X(this,"locale");X(this,"conversationsCache",new Map);X(this,"contentCache",new Map)}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:qt};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Os(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){Q.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(He.handshake,t,"handshake");return Q.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),cu(n)||Q.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){Q.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 Q.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){Q.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${lu(n)}`),o.append("mimeType",n);let a=await this.postForm(this.transcribePath,o,"transcribe");return Q.debug("transcribe \u2190",{textLen:a.text.length}),a}conversationsKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){let n=this.conversationsCache.get(this.conversationsKey(t));if(n?.value&&Date.now()-n.at<zs)return n.value}listConversations(t={}){let n=this.conversationsKey(t),o=this.conversationsCache.get(n);if(o&&Date.now()-o.at<zs)return Q.debug("listConversations \u2192 cache",t),o.result;let a={at:Date.now(),result:this.fetchConversations(t).then(i=>(a.value=i,i)).catch(i=>{throw this.conversationsCache.delete(n),i})};return this.conversationsCache.set(n,a),a.result}async fetchConversations(t){let n=new URL(this.url(He.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),Q.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 Q.debug("listConversations \u2190",{count:a.length,nextCursor:o.nextCursor}),{conversations:a.map(i=>({conversationId:i.conversationId,title:i.title,lastMessageAt:i.lastMessageAt,preview:i.preview,canContinue:i.canContinue,hasUnread:i.hasUnread})),nextCursor:o.nextCursor}}async loadConversation(t){let n=new URL(this.url(He.listMessages));n.searchParams.set("conversationId",t),Q.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),a=o.messages??[];return Q.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:a.length,hasSuggestions:!!o.suggestions}),{conversationId:o.conversationId,canContinue:o.canContinue??!0,messages:a,agent:o.agent,suggestions:su(a)??o.suggestions}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),Q.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(He.markRead,{conversationId:t},"markRead")}catch(n){Q.debug("markRead failed (non-fatal)",{err:n})}}}listContent(t={}){let n=`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`,o=this.contentCache.get(n);if(o&&Date.now()-o.at<ru)return Q.debug("listContent \u2192 cache",t),o.result;let a=this.fetchContent(t).catch(i=>{throw this.contentCache.delete(n),i});return this.contentCache.set(n,{at:Date.now(),result:a}),a}async fetchContent(t){let n=new URL(this.dataUrl(He.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));Q.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),a=(o.items??[]).map(i=>ci(i,this.locale));return Q.debug("listContent \u2190",{count:a.length,total:o.pagination?.total}),{...o,items:a}}async bootstrap(t){let n=new URL(this.dataUrl(He.bootstrap));t&&n.searchParams.set("conversationId",t),Q.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),a=o.forms??[],i=o.formSubmissions??[];return Q.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){Q.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(He.updateSettings,{userPrefs:t},"saveUserPrefs");return Q.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??He.submitForm}async submitForm(t){Q.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){Q.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){Q.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(He.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){Q.debug("submitFeedback failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),Q.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()}}resumeStream(){let t=new AbortController,n=new Set;this.resumeStatus=void 0;let o=this.resumeStreamGen(t,n,!0),a=()=>t.abort();return{iter:o,cancel:a,detach:a}}async*runStream(t,n,o){(yield*this.drain(this.openMessageStream(t,n.signal),o,n))||(yield*this.resumeStreamGen(n,o,!1))}async*resumeStreamGen(t,n,o){for(let a=1;a<=Bs&&!t.signal.aborted;a++){if((!o||a>1)&&(await ea(Ws*a,t.signal),t.signal.aborted))return;let i;try{i=await this.fetchImpl(this.resumeUrl(n.size),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(c){if(t.signal.aborted)return;Q.debug("resume fetch failed \u2014 retrying",{attempt:a,err:c});continue}if(i.status===204||!i.ok){Q.debug("resume \u2192 no in-flight stream",{status:i.status});return}if(!(i.headers.get("content-type")??"").includes("text/event-stream")){let c=await i.json().then(d=>d.status).catch(()=>{});if(Q.debug("resume \u2192 no live stream (status response)",{status:c,attempt:a}),c==="pending"&&a<Bs)continue;this.resumeStatus=c==="needs-generation"?"needs-generation":"completed";return}this.resumeStatus="live";let s=n.size;if(yield*this.drain(Zr(i,t.signal),n,t))return;if(n.size===s){Q.debug("resume \u2192 stream closed with no new events; nothing to resume");return}}if(!t.signal.aborted)throw new We("stream incomplete after resume attempts","server")}async*drain(t,n,o){let a=!1,i;try{for await(let l of t){if(o.signal.aborted)return!0;if(l.eventId){if(n.has(l.eventId))continue;n.add(l.eventId)}yield l,(l.chunk.type==="finish"||l.chunk.type==="error")&&(a=!0,i??(i=setTimeout(()=>o.abort(),ou)))}}catch(l){if(o.signal.aborted)return!0;if(l instanceof We&&l.status!==void 0)throw l;Q.debug("stream segment dropped",{err:l})}finally{i&&clearTimeout(i)}return a}cancelStream(t,n){t.signal.aborted||(Q.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(He.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>Q.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(He.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*Zr(o,n)}resumeUrl(t){let n=new URL(this.withEnvelopeQuery(He.streamResume));return n.searchParams.set("resumeAt",String(t)),n.toString()}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>=Us)throw new We(`${n} failed: network error`,"network",void 0,c);Q.debug("request network error \u2014 retrying",{label:n,attempt:o}),await ea(qs(o));continue}if(l.ok||!au.has(l.status)||o>=Us)return l;let s=iu(l.headers)??qs(o);Q.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await ea(s)}}async assertOk(t,n){if(!t.ok)throw new We(`${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 lu(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 cu(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:z(e),doneSig:z(!0)}]:[];return{id:qe(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:z(n)}}function Pn(){return{id:qe(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:z([])}}function Gs(e){let t=qe();return du({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function du(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:z(e.parts.map(fu))}}function _u(e){let t=e.parts.map((n,o)=>n.type==="text"?{kind:"text",id:`${e.id}-t${o}`,textSig:z(n.text),doneSig:z(!0)}:n.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${o}`,textSig:z(n.text),doneSig:z(n.state!=="streaming")}:n.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${o}`}:n.type==="file"?{kind:"file",url:n.url,mediaType:n.mediaType}:n.type==="source-url"?{kind:"source",sourceId:n.sourceId,url:n.url,title:n.title}:n.type==="source-document"?{kind:"source",sourceId:n.sourceId,title:n.title,filename:n.filename,mediaType:n.mediaType}:n.type==="data-suggestions"?null:n.type.startsWith("tool-")?{kind:"tool",toolCallId:n.toolCallId,toolName:$s(n.type),inputPartialSig:z(""),inputSig:z(n.input),outputSig:z(n.output),errorSig:z(n.errorText),stateSig:z(n.state),approvalSig:z(n.approval)}:null).filter(n=>n!==null);return{id:e.id,role:e.role,serverMessageId:e.id,createdAt:Po(e.createdAt)??Date.now(),status:e.status==="failed"?"error":"complete",canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:z(t)}}var uu=new Set(["completed","failed","canceled"]);function pu(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 mu(e){return e.role==="assistant"&&e.status!=null&&!uu.has(e.status)&&pu(e)}function na(e){return e.filter(t=>!mu(t)).map(_u)}function Ks(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(gu)}}function wo(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function Co(e){return wo(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function it(e){return e.role==="assistant"&&e.status!=="streaming"&&Co(e)}function js(e){return e.canceled===!0&&it(e)}function fu(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:z(e.text),doneSig:z(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:z(e.inputPartial),inputSig:z(e.input),outputSig:z(e.output),errorSig:z(e.error),stateSig:z(e.state),approvalSig:z(e.approval)}:e}function gu(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 Xs=q.scope("reducer"),To=class{constructor(t){X(this,"messagesSig",t);X(this,"active",null);X(this,"openTextParts",new Map);X(this,"partSeq",0)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.openTextParts.clear()}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:z(""),doneSig:z(!1)};return this.openTextParts.set(a,l),kn(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":t.messageId&&(n.serverMessageId=t.messageId);return;case"finish-step":this.openTextParts.clear();return;case"start-step":kn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":Xs.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Xs.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":hu(n,t);return;case"file":kn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":Ys(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":Ys(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":return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function wt(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:z(""),inputSig:z(void 0),outputSig:z(void 0),errorSig:z(void 0),stateSig:z("input-streaming"),approvalSig:z(void 0)};return kn(e,a),a}function kn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function Ys(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||kn(e,t)}function hu(e,t){switch(t.type){case"tool-input-start":wt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=wt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=wt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=wt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=wt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=wt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=wt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}var Js=q.scope("feedback:audio"),Eo=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){Js.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=>(Js.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var Qs={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},Zs={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,Ro=0;function vu(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function bu(){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=`__${x.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 el(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(vu())try{navigator.vibrate(e);return}catch{}if(ft||(ft=bu()),!!ft)try{ft.label.click()}catch{}}}function tl(){Ro++;let e=!1;return()=>{e||(e=!0,Ro=Math.max(0,Ro-1),Ro===0&&ft&&(ft.input.remove(),ft.label.remove(),ft=null))}}var yu=q.scope("feedback"),xu=100,Ao=class{constructor(t,n){X(this,"mutedSig",z(!1));X(this,"audio",new Eo);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=tl(),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<xu}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>yu.warn("audio play failed",{err:a,url:n}));return}let o=Zs[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?Qs[t]:n;el(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 Ct(e,t){return e instanceof We&&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 ee.vnode&&ee.vnode(d),d}var F={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Sn=`${x.cssPrefix}-icon-dir`,oa=()=>r("svg",{...F,"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"})}),Qe=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),nl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),ol=()=>r("svg",{...F,class:Sn,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),rl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),al=()=>r("svg",{...F,class:Sn,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),Jt=()=>r("svg",{...F,class:Sn,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),il=()=>r("svg",{...F,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),sl=()=>r("svg",{...F,"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"})}),ll=()=>r("svg",{...F,"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"})]}),cl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),dl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),_l=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),ul=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),pl=()=>r("svg",{...F,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),ml=()=>r("svg",{...F,"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"})]}),fl=()=>r("svg",{...F,"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"})}),gl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),hl=()=>r("svg",{...F,"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"})]}),vl=()=>r("svg",{...F,class:Sn,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),Tt=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),bl=()=>r("svg",{...F,"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"})]}),yl=()=>r("svg",{...F,"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"})]}),wn=()=>r("svg",{...F,class:Sn,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),xl=()=>r("svg",{...F,"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"})]}),Et=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),Pl=()=>r("svg",{...F,"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"})]}),ku=()=>r("svg",{...F,"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"})]}),ra=()=>r("svg",{...F,"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"})}),Cn=()=>r("svg",{...F,"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",{...F,"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"})]}),wu=()=>r("svg",{...F,"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"})]}),Cu=()=>r("svg",{...F,"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"})]}),Tu=()=>r("svg",{...F,"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"})]}),aa=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),kl=()=>r("svg",{...F,"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"})]}),Sl=()=>r("svg",{...F,"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"})]}),wl=()=>r("svg",{...F,"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"})]}),Tn=()=>r("svg",{...F,"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"})]}),Cl=()=>r("svg",{...F,"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"})]}),Tl=()=>r("svg",{...F,"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"})}),El=()=>r("svg",{...F,"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"})]}),Eu=()=>r("svg",{...F,"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"})]}),Ru=()=>r("svg",{...F,"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"})]}),Au=()=>r("svg",{...F,"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"})]}),Iu=()=>r("svg",{...F,"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",{...F,"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",{...F,"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",{...F,"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"})]}),Ll=()=>r("svg",{...F,"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"})]}),Ml=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),Io=()=>r("svg",{...F,"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",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),Nl={chat:oa,message:ra,bubbles:Tn,spark:ku,wand:Su,bot:wu,help:Cn,lifebuoy:Tu,headset:Cu,search:Eu,sparkles:Ru,concierge:Au,wave:Iu};var M=x.cssPrefix,S={launcher:`${M}-launcher`,callout:`${M}-callout`,calloutDismiss:`${M}-callout-dismiss`,panel:`${M}-panel`,panelHeader:`${M}-panel-header`,resizeGrip:`${M}-resize-grip`,scrollToBottom:`${M}-scroll-to-bottom`,actionHistory:`${M}-action-history`,actionClose:`${M}-action-close`,langSegment:`${M}-lang-segment`,composer:`${M}-composer`,composerInput:`${M}-composer-input`,composerSend:`${M}-composer-send`,composerStop:`${M}-composer-stop`,composerAttach:`${M}-composer-attach`,composerFileInput:`${M}-composer-file-input`,composerVoice:`${M}-composer-voice`,attachmentChip:`${M}-attachment-chip`,attachmentRemove:`${M}-attachment-remove`,suggestion:`${M}-suggestion`,messageBubble:`${M}-message`,messageRetry:`${M}-message-retry`,messageFeedback:`${M}-message-feedback`,feedbackUp:`${M}-feedback-up`,feedbackDown:`${M}-feedback-down`,messageCopy:`${M}-message-copy`,historyPane:`${M}-history-pane`,historyBack:`${M}-history-back`,historyItem:`${M}-history-item`,sidebar:`${M}-sidebar`,sidebarToggle:`${M}-sidebar-toggle`,sidebarNewConversation:`${M}-sidebar-new-conversation`,sidebarItem:`${M}-sidebar-item`,messengerHome:`${M}-messenger-home`,modulesEmpty:`${M}-modules-empty`,tab:`${M}-tab`,tabBadge:`${M}-tab-badge`,homeView:`${M}-home-view`,homeGreeting:`${M}-home-greeting`,homeBrand:`${M}-home-brand`,backHeader:`${M}-back-header`,contentView:`${M}-content-view`,contentScroll:`${M}-content-scroll`,homeSearch:`${M}-home-search`,helpSearch:`${M}-help-search`,homeRecent:`${M}-home-recent`,homeContentRow:`${M}-home-content-row`,helpArticle:`${M}-help-article`,newsItem:`${M}-news-item`,formGate:`${M}-form-gate`,formDone:`${M}-form-done`,formDoneToggle:`${M}-form-done-toggle`,formAnswers:`${M}-form-answers`,formFill:`${M}-form-fill`,formSubmit:`${M}-form-submit`,formSkip:`${M}-form-skip`,formField:`${M}-form-field`,toolAskQuestions:`${M}-tool-ask-questions`,toolInputSubmit:`${M}-tool-input-submit`,toolInputSkip:`${M}-tool-input-skip`,toolApproval:`${M}-tool-approval`,toolApprove:`${M}-tool-approve`,toolReject:`${M}-tool-reject`,toolEdit:`${M}-tool-edit`,toolDecision:`${M}-tool-decision`,toolAskSummary:`${M}-ask-questions-summary`,toolAskOptions:`${M}-ask-questions-options-toggle`,toolCall:`${M}-tool-call`,source:`${M}-source`};function Pe(e,t){return`${e}-${t}`}var Mo=x.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:`${Mo}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":S.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Lu(t.icon),i?r("span",{class:`${Mo}-fab-label`,children:Re(n,t.label??"")}):null]})}function Lu(e){let t=Nl[e];return t?r(t,{}):r(Mu,{source:e})}function Mu({source:e}){return r("span",{ref:t=>{t&&Nu(t,e)},"aria-hidden":"true"})}function Nu(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 Ol({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:a}){let[i,l]=E(!1);return R(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),R(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?r("div",{class:`${Mo}-callout`,role:"status","data-shape":e.shape,"data-position":Du(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":S.callout,children:[r("span",{children:Re(n,e.text)}),r("button",{type:"button",class:`${Mo}-callout-close`,onClick:a,"aria-label":o,title:o,"data-testid":S.calloutDismiss,children:r(Qe,{})})]}):null}function Du(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=x.cssPrefix,s=N(null);if(R(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(m.setProperty(`--${l}-widget-w`,`${o.width}px`),m.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"}`,g=m=>{if(!e)return;let P=m.currentTarget,v=e.getBoundingClientRect();s.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:v.width,startH:v.height,dirX:d?-1:1,dirY:c?1:-1},P.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},_=m=>{let P=s.current;if(!P||m.pointerId!==P.pointerId||!e)return;let v=(m.clientX-P.startX)*P.dirX,y=(m.clientY-P.startY)*P.dirY;e.style.setProperty(`--${l}-widget-w`,`${P.startW+v}px`),e.style.setProperty(`--${l}-widget-h`,`${P.startH+y}px`)},f=m=>{let P=s.current;if(!P||m.pointerId!==P.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let v=e.getBoundingClientRect();a({width:Math.round(v.width),height:Math.round(v.height)}),s.current=null};return r("div",{class:u,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:g,onPointerMove:_,onPointerUp:f,onPointerCancel:f,"data-testid":S.resizeGrip,children:r(pl,{})})}var Rt=x.cssPrefix,Ou=`.${Rt}-header, .${Rt}-back-header, .${Rt}-home-hero`,$u='button, a, input, textarea, select, [role="tab"], [contenteditable]',$l=56;function Do(e,t){R(()=>{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($u))return;let u=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Rt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Rt}-modal-dy`)),maxX:(window.innerWidth+u.width)/2-$l,maxY:(window.innerHeight+u.height)/2-$l},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(`--${Rt}-modal-dx`,`${d}px`),e.style.setProperty(`--${Rt}-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 En(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 Oo(e,t,n){return En("close",e,t)?n.includes("close"):!1}function Fl(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Fu='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function $o(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(Fu)].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 Fo(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var ia=x.cssPrefix;function Hl({agent:e,strings:t}){let n=e.status??"online",o=Re(t,e.name),a=e.title?Re(t,e.title):null;return r("div",{class:`${ia}-agent`,children:[r("div",{class:`${ia}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:Fo(o)})}),r("div",{class:`${ia}-agent-meta`,children:[r("strong",{children:o}),a?r("span",{children:a}):null]})]})}var Bl=q.scope("attachments");function Ho(e,t,n){let o=Bu(e),a=[],i=[],l=qu(n.accept),s=t.reduce((d,u)=>d+u.size,0),c=t.length;for(let d of o){let u=Hu(d,c,s,n,l);if(u){i.push({file:d,reason:u});continue}a.push(Uu(d)),s+=d.size,c+=1}return(a.length||i.length)&&Bl.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function sa(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Bl.debug("revokeObjectURL failed",{error:t})}}function Hu(e,t,n,o,a){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Wu(e,a)?null:"mime"}function Bu(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:zu(t)).filter(t=>t!==null):[]}function zu(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Uu(e){return{file:e,id:qe(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function qu(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 Wu(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 Rn=x.cssPrefix;function zl({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${Rn}-attachment-chip`,title:e.name,"data-testid":Pe(S.attachmentChip,e.id),children:[n?r("img",{class:`${Rn}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${Rn}-attachment-thumb`,"aria-hidden":"true",children:r(Pl,{})}),r("span",{class:`${Rn}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${Rn}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":Pe(S.attachmentRemove,e.id),children:r(Qe,{})})]})}var la={isSupported:!1,start:()=>{},stop:()=>{}};function ca(e,t,n){return e==="disabled"?la:e==="server"?ju(n):Vu(t)}function Vu(e){let t=Gu();if(!t)return la;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 g=s.results[u];g&&(c+=g[0].transcript,g.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 Gu(){let e=globalThis;return e.SpeechRecognition??e.webkitSpeechRecognition}var Ku=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function ju(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return la;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=Xu();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 Xu(){for(let e of Ku)if(MediaRecorder.isTypeSupported(e))return e}var Be=x.cssPrefix,At=q.scope("composer");function Qt(e){return e.reduce((t,n)=>t+n.size,0)}var Yu={arrowUp:rl,paperPlane:ol,send:al,chevron:Jt};function Ul({options:e,transport:t,feedback:n,bus:o,isStreaming:a,onSend:i,onStop:l,attachApiRef:s}){let c=e.strings,[d,u]=E(""),[g,_]=E([]),[f,m]=E(!1),P=N(null),v=N(null),y=e.features.files,C=e.features.voice,[b,T]=E(()=>ca(C,e.locale,(w,K)=>t.transcribe(w,K)));R(()=>{f||C==="disabled"||T(ca(C,e.locale,(w,K)=>t.transcribe(w,K)))},[e.locale,C,t,f]),R(()=>{let w=P.current;if(!w)return;let K=w.getRootNode(),te="activeElement"in K?K.activeElement:null;te&&w.closest(`.${Be}-panel`)?.contains(te)||w.focus({preventScroll:!0})},[]),R(()=>{let w=P.current;if(w){if(d.length===0){w.style.height="";return}w.style.height="auto",w.style.height=`${Math.min(Math.max(w.scrollHeight,40),160)}px`}},[d]);let H=N(g);H.current=g,R(()=>()=>H.current.forEach(sa),[]),R(()=>{if(s)return s.current={attachFromDrop:w=>{let K=Ho(w,H.current,e.attachments);K.accepted.length!==0&&(At.info("attach (drop)",{count:K.accepted.length,totalBytes:Qt(K.accepted)}),o.emit("attach",{count:K.accepted.length,totalBytes:Qt(K.accepted)}),_(te=>[...te,...K.accepted]))}},()=>{s.current&&(s.current=null)}},[s,e.attachments]),R(()=>{let w=P.current;if(!w)return;let K=w.closest(`.${Be}-panel`);if(!K)return;let te=he=>{let _e=he.clipboardData;if(!_e)return;let Me=he.target?.closest?.("input, textarea, [contenteditable]:not([contenteditable='false'])");if(Me&&Me!==w)return;if(y){let Ne=Ho(_e.items,H.current,e.attachments);if(Ne.accepted.length>0){he.preventDefault(),At.info("attach (paste)",{count:Ne.accepted.length,totalBytes:Qt(Ne.accepted)}),o.emit("attach",{count:Ne.accepted.length,totalBytes:Qt(Ne.accepted)}),_(ue=>[...ue,...Ne.accepted]);return}}if(Me===w)return;let ve=_e.getData("text/plain");ve&&(he.preventDefault(),u(Ne=>Ne+ve),w.focus())};return K.addEventListener("paste",te),()=>K.removeEventListener("paste",te)},[y,e.attachments,Be]);let Z=()=>{let w=d.trim();!w&&g.length===0||a||(i(w,g),u(""),_([]))},Y=w=>{w.key!=="Enter"||w.shiftKey||w.isComposing||(w.preventDefault(),a?l():Z())},oe=w=>{let K=w.target,te=Ho(K.files,g,e.attachments);te.accepted.length>0&&(At.info("attach (file picker)",{count:te.accepted.length,totalBytes:Qt(te.accepted)}),o.emit("attach",{count:te.accepted.length,totalBytes:Qt(te.accepted)}),_(he=>[...he,...te.accepted])),K.value=""},G=w=>{At.info("removeAttachment",{id:w}),o.emit("removeAttachment",{id:w}),_(K=>{let te=K.find(he=>he.id===w);return te&&sa(te),K.filter(he=>he.id!==w)})},I=N(null),D=()=>{if(b.isSupported){if(f){let w=I.current?Date.now()-I.current:0;At.info("voiceStop",{durationMs:w}),o.emit("voiceStop",{durationMs:w}),b.stop(),m(!1),n.play("voiceStop"),I.current=null;return}I.current=Date.now(),At.info("voiceStart"),o.emit("voiceStart",void 0),m(!0),n.play("voiceStart"),b.start((w,K)=>u(te=>K?`${te}${w} `:te),()=>{if(m(!1),I.current){let w=Date.now()-I.current;At.debug("voiceStop (auto)",{durationMs:w}),o.emit("voiceStop",{durationMs:w}),I.current=null}})}},B=Yu[e.composer.sendButton.icon];return r("div",{class:`${Be}-composer`,"data-testid":S.composer,children:[g.length>0?r("div",{class:`${Be}-attachments`,children:g.map(w=>r(zl,{attachment:w,onRemove:()=>G(w.id)},w.id))}):null,r("div",{class:`${Be}-composer-row`,children:[r("div",{class:`${Be}-composer-actions`,children:[y?r("button",{type:"button",class:`${Be}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":c.attach,"data-testid":S.composerAttach,children:r(sl,{})}):null,b.isSupported?r("button",{type:"button",class:`${Be}-icon-btn`,onClick:D,"aria-label":f?c.micStop:c.micStart,"aria-pressed":f,"data-recording":f?"true":void 0,"data-testid":S.composerVoice,children:r(ll,{})}):null]}),r("textarea",{ref:P,class:`${Be}-textarea`,rows:1,value:d,placeholder:c.composerPlaceholder,onInput:w=>u(w.target.value),onKeyDown:Y,"aria-label":c.composerPlaceholder,"data-testid":S.composerInput}),a?r("button",{type:"button",class:`${Be}-send`,onClick:l,"aria-label":c.stop,"data-testid":S.composerStop,children:r(il,{})}):r("button",{type:"button",class:`${Be}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:Z,disabled:!d.trim()&&g.length===0,"aria-label":c.send,"data-testid":S.composerSend,children:r(B,{})})]}),r("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:oe,class:`${Be}-sr-only`,"data-testid":S.composerFileInput})]})}var Ju=x.cssPrefix;function ql({visible:e,strings:t}){return e?r("div",{class:`${Ju}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function Bo({containerRef:e,onDrop:t}){let[n,o]=E(!1);return R(()=>{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 Wl({itemCount:e,initialFocusIndex:t}){let[n,o]=E(!1),a=N(null),i=N(null),[l,s]=E(-1),c=$(()=>{o(!1),s(-1),a.current?.focus()},[]),d=$(()=>o(_=>!_),[]);R(()=>{if(!n)return;let _=f=>{let m=i.current,P=a.current;if(!m||!P)return;let v=f.composedPath();v.includes(m)||v.includes(P)||(o(!1),s(-1))};return document.addEventListener("click",_,!0),()=>document.removeEventListener("click",_,!0)},[n]),R(()=>{if(!n||e===0)return;let _=t?.()??0,f=_<0||_>=e?0:_;s(f)},[n,e,t]),R(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let u=$(_=>{(_.key==="ArrowDown"||_.key==="Enter"||_.key===" ")&&(_.preventDefault(),o(!0))},[]),g=$(_=>{if(e!==0)switch(_.key){case"Escape":_.preventDefault(),c();return;case"ArrowDown":_.preventDefault(),s(f=>(f+1)%e);return;case"ArrowUp":_.preventDefault(),s(f=>(f-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:g}}function Vl({items:e,triggerLabel:t}){let n=x.cssPrefix,o=Wl({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)),g=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")g=(u+1)%d.length;else if(s.key==="ArrowLeft")g=(u-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[g].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(ml,{})}),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":`${S.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(Tt,{})}):null]},s.id))}):null]})}var da=x.cssPrefix;function Qu(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 Zu={normal:"large",large:"small",small:"normal"};function ep(e){return e==="light"?r(Cl,{}):e==="dark"?r(Tl,{}):r(El,{})}function tp(e){return(e.split("-")[0]??e).toUpperCase()}function Ze({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:g,onThemeChange:_,onTextSizeChange:f}=e,m=n.strings,P=n.mode,v=t==="chat",y=J(()=>a.mutedSig.value).value,C=new Set(n.actions),b=w=>C.has(w),T=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,H=w=>T?!1:En(w,P,o),Z=n.themeMode,Y={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},oe=n.textSize,G={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},I=[];if(v&&b("clear")&&I.push({id:"clear",icon:r(xl,{}),label:m.newConversation,onSelect:l}),b("expand")&&H("expand")){let w=o==="expanded";I.push({id:"expand",icon:w?r(dl,{}):r(cl,{}),label:w?m.collapse:m.expand,type:"switch",on:w,onSelect:s})}if(b("fullscreen")&&H("fullscreen")){let w=o==="fullscreen";I.push({id:"fullscreen",icon:w?r(ul,{}):r(_l,{}),label:w?m.exitFullscreen:m.fullscreen,type:"switch",on:w,onSelect:c})}v&&b("sound")&&I.push({id:"sound",icon:y?r(gl,{}):r(fl,{}),label:y?m.soundOff:m.soundOn,type:"switch",on:!y,onSelect:d}),b("theme")&&I.push({id:"theme",icon:ep(Z),label:`${m.theme}: ${Y[Z]}`,onSelect:()=>_(Qu(Z)),keepOpen:!0}),b("textSize")&&I.push({id:"textSize",icon:r(hl,{}),label:`${m.textSize}: ${G[oe]}`,onSelect:()=>f(Zu[oe]),keepOpen:!0}),b("language")&&n.availableLocales.length>1&&I.push({id:"language",icon:r(yl,{}),label:m.language,segments:n.availableLocales.map(w=>({value:w,label:tp(w),lang:w})),value:n.locale,onSelectValue:g});let D=!!i&&Oo(P,o,n.actions),B=v&&b("history");return r("div",{class:`${da}-header-actions`,children:[B?r("button",{type:"button",class:`${da}-icon-btn`,onClick:u,"aria-label":m.history,title:m.history,"data-testid":S.actionHistory,children:r(bl,{})}):null,I.length>0?r(Vl,{items:I,triggerLabel:m.moreActions}):null,D?r("button",{type:"button",class:`${da}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":S.actionClose,children:r(Qe,{})}):null]})}var np=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,op=/^https?:\/\/[^\s.]+\.[^\s]+$/i,rp=/^[+]?[\d\s().-]{6,}$/;function Zt(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function ap(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function ip(e,t,n){let o=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=ap(t);return o&&l===0?n.formRequired:l===0?void 0:a?.minSelections!=null&&l<a.minSelections?Zt(n.formChooseAtLeast,{min:a.minSelections}):a?.maxSelections!=null&&l>a.maxSelections?Zt(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(!np.test(i))return n.formInvalidEmail;break;case"url":if(!op.test(i))return n.formInvalidUrl;break;case"tel":if(!rp.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 Zt(n.formNumberTooSmall,{min:a.min});if(a?.max!=null&&l>a.max)return Zt(n.formNumberTooLarge,{max:a.max});break}default:break}if(a?.minLength!=null&&i.length<a.minLength)return Zt(n.formTooShort,{min:a.minLength});if(a?.maxLength!=null&&i.length>a.maxLength)return Zt(n.formTooLong,{max:a.maxLength});if(a?.pattern)try{if(!new RegExp(a.pattern).test(i))return n.formPatternMismatch}catch{}}function Gl(e,t,n){let o={};for(let a of e){let i=ip(a,t[a.name],n);i&&(o[a.name]=i)}return o}function Kl(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 le=x.cssPrefix,zo="__other__";function An({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,initialValues:d,hideActions:u,fieldTypeLabels:g,rootTestId:_,submitTestId:f,skipTestId:m}){let[P,v]=E(()=>({...dp(e),...d})),[y,C]=E({}),[b,T]=E({}),H=I=>{b[I]&&T(D=>({...D,[I]:""}))},Z=(I,D)=>{v(B=>({...B,[I]:D})),H(I)},Y=(I,D)=>{C(B=>({...B,[I]:D})),H(I)},oe=I=>{if(I.preventDefault(),c)return;let D=_p(e,P,y),B=Gl(e,D,t);if(Object.keys(B).length>0){T(B);return}o(Kl(D))},G=I=>{!s||I.key!=="Enter"||I.shiftKey||I.isComposing||I.target?.tagName==="TEXTAREA"&&oe(I)};return r("form",{class:`${le}-form`,onSubmit:oe,onKeyDown:G,"data-testid":_,noValidate:!0,children:[e.map(I=>r(sp,{field:I,value:P[I.name],otherText:y[I.name]??"",error:b[I.name],disabled:c,typeLabel:g?.[I.name],strings:t,onChange:D=>Z(I.name,D),onOtherChange:D=>Y(I.name,D)},I.name)),u?null:r("div",{class:`${le}-form-actions`,children:[l?r("span",{class:`${le}-form-hint`,children:l}):null,a&&i?r("button",{type:"button",class:`${le}-form-skip`,onClick:i,disabled:c,"data-testid":m,children:a}):null,r("button",{type:"submit",class:`${le}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function sp({field:e,value:t,otherText:n,error:o,disabled:a,typeLabel:i,strings:l,onChange:s,onOtherChange:c}){let d=Pe(S.formField,e.name),u=lp({field:e,value:t,otherText:n,disabled:a,strings:l,onChange:s,onOtherChange:c,fieldTid:d});return r("label",{class:`${le}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[r("span",{class:`${le}-field-head`,children:[r("span",{class:`${le}-field-label`,children:[e.label,e.required??!0?r("span",{class:`${le}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?r("span",{class:`${le}-field-type`,children:i}):null]}),u,e.validationHint&&!o?r("span",{class:`${le}-field-hint`,children:e.validationHint}):null,o?r("span",{class:`${le}-field-error`,role:"alert",children:o}):null]})}function lp(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:`${le}-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:`${le}-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===zo;return r("div",{class:`${le}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(g=>r("label",{class:`${le}-choice`,children:[r("input",{type:"radio",name:`${le}-${t.name}`,checked:d===g.value,disabled:a,onChange:()=>l(g.value)}),r("span",{children:g.label??g.value})]},g.value)),t.allowOther?r("label",{class:`${le}-choice`,children:[r("input",{type:"radio",name:`${le}-${t.name}`,checked:d===zo,disabled:a,onChange:()=>l(zo)}),r("span",{children:i.formOther})]}):null,u?r("input",{class:`${le}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:g=>s(g.target.value)}):null]})}case"checkbox":return r("label",{class:`${le}-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:[],g=(_,f)=>l(f?[...u,_]:u.filter(m=>m!==_));return r("div",{class:`${le}-field-choices`,"data-testid":c,children:[(t.options??[]).map(_=>r("label",{class:`${le}-choice`,children:[r("input",{type:"checkbox",checked:u.includes(_.value),disabled:a,onChange:f=>g(_.value,f.target.checked)}),r("span",{children:_.label??_.value})]},_.value)),t.allowOther||(t.options??[]).length===0?r("textarea",{class:`${le}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:_=>s(_.target.value)}):null]})}default:return r("input",{class:`${le}-field-input`,type:cp(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c})}}function cp(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function dp(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 _p(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]===zo)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 et=x.cssPrefix;function _a({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${et}-form-gate`,"data-testid":S.formGate,children:[e.title?r("h3",{class:`${et}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${et}-form-gate-desc`,children:e.description}):null,r(An,{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:S.formSubmit,skipTestId:S.formSkip})]})}function jl({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",a=o?t.formSkipped:t.formSubmitted,i=e.title?r(ie,{children:[r("span",{children:e.title}),r("span",{class:`${et}-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:`${et}-form-done`,"data-outcome":e.outcome,"data-testid":S.formDone,children:[r("summary",{class:`${et}-form-done-summary`,"data-testid":S.formDoneToggle,children:[r(Tt,{}),i,r(Jt,{})]}),r("dl",{class:`${et}-form-answers`,"data-testid":S.formAnswers,children:Object.entries(s).map(([d,u])=>r("div",{class:`${et}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:u})]},d))})]})}return r("div",{class:`${et}-form-done`,"data-outcome":e.outcome,"data-testid":S.formDone,role:"status",children:[o?r(vl,{}):r(Tt,{}),i,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${et}-form-done-fill`,"data-testid":S.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 ma=1,Jl=2,Ql=4,Zl=8,ec=16;function up(e){switch(e){case ma:return"href";case Jl:return"src";case Ql:return"class";case Zl:return"checked";case ec:return"start"}}var pp=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}},mp=pp;var Yl=24;function ga(e){let t=new Uint32Array(Yl);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(Yl),indent:"",indent_len:0,table_state:0}}function tc(e){e.pending.length>0&&Ce(e,`
|
|
12
|
+
`)}function ne(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 fe(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 re(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&fe(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function fp(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function It(e,t){for(e.fence_start=0;e.len>t;)fe(e)}function Uo(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;)fe(e);return t}function ua(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?(It(e,e.blockquote_idx),re(e,t),!0):(It(e,n),!1):(It(e,o),re(e,t),!0)}function pa(e,t){re(e,25),e.spaces[e.len]=e.indent_len+t,st(e),e.token=103}function st(e){e.indent="",e.indent_len=0,e.pending=""}function fa(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 gp(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 hp(e){return fa(e)||gp(e)}function Ce(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=Uo(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],a>0&&Ce(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){fe(e),st(e),e.pending=n;continue}It(e,e.blockquote_idx),st(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" ":Uo(e,e.indent_len),re(e,mp(e.pending.length)),st(e);continue}break;case">":{let i=fp(e,20,e.blockquote_idx+1);i===-1?(It(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,re(e,20)):e.blockquote_idx=i,st(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;Uo(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),st(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){ua(e,23),pa(e,2),Ce(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):(re(e,2),st(e),e.fence_start=0,Ce(e,o));continue;case`
|
|
15
|
+
`:{Uo(e,e.indent_len),re(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,Ql,e.pending.slice(e.fence_start)),st(e),e.token=101;continue}default:e.pending=o;continue}case"+":if(n!==" ")break;ua(e,23),pa(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;ua(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,ec,e.pending.slice(0,-1)),pa(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||fa(i)){e.pending=o;continue}}break;case"|":It(e,e.blockquote_idx),re(e,27),re(e,28),e.pending="",Ce(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,re(e,9)}else re(e,2);st(e),Ce(e,a);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=o;continue;case`
|
|
16
16
|
`:e.table_state=2,e.pending="";continue;default:fe(e),e.table_state=0;break}else switch(e.pending){case"|":re(e,28),e.pending="",Ce(e,n);continue;case`
|
|
17
17
|
`:fe(e),e.pending="",e.table_state=0,Ce(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":re(e,29),fe(e),e.pending="",Ce(e,n);continue;case`
|
|
18
18
|
`:fe(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Ce(e,n);continue;default:re(e,29),Ce(e,n);continue}break;case 29:if(e.pending==="|"){ne(e),fe(e),e.pending="",Ce(e,n);continue}break;case 9:switch(o){case`
|
|
@@ -28,15 +28,15 @@ ${a}`:a;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(!t||t==="[DONE]")
|
|
|
28
28
|
`:e.pending=o;continue;default:e.pending.length!==0?(ne(e),fe(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=o;continue;case`
|
|
29
29
|
`:if(o.length===e.fence_start+e.fence_end+1){ne(e),fe(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
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]===" ")?(ne(e),fe(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,ne(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,
|
|
32
|
-
`?(ne(e),re(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Ce(e,n));continue;case 30:if(o==="\\]"||o==="$$"){ne(e),fe(e),e.pending="";continue}break;case 31:if(o==="\\)"||e.pending[0]==="$"){ne(e),fe(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:o==="http://"||o==="https://"?(ne(e),re(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],Ce(e,n));continue;case 17:case 19:if(e.pending==="]"){ne(e),n==="("?e.pending=o:(fe(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?ma:
|
|
31
|
+
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,ne(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,Zl,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Ce(e,o);continue;case 14:case 15:{let i="*",l=12;if(e.token===15&&(i="_",l=13),i===e.pending){if(ne(e),i===n){fe(e),e.pending="";continue}re(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:(ne(e),re(e,l),e.pending=""):(ne(e),fe(e),e.pending=n);continue;case i+i:let s=e.token;ne(e),fe(e),fe(e),i!==n?(re(e,s),e.pending=n):e.pending="";continue}break}case 16:if(o==="~~"){ne(e),fe(e),e.pending="";continue}break;case 105:n===`
|
|
32
|
+
`?(ne(e),re(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Ce(e,n));continue;case 30:if(o==="\\]"||o==="$$"){ne(e),fe(e),e.pending="";continue}break;case 31:if(o==="\\)"||e.pending[0]==="$"){ne(e),fe(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:o==="http://"||o==="https://"?(ne(e),re(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],Ce(e,n));continue;case 17:case 19:if(e.pending==="]"){ne(e),n==="("?e.pending=o:(fe(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?ma:Jl,l=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,l),fe(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
|
|
33
33
|
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,ma,e.pending),ne(e),fe(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===">"){ne(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),Ce(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":ne(e),re(e,31),e.pending="";continue;case"[":e.token=105,e.pending=o;continue;case`
|
|
34
34
|
`:e.pending=n;continue;default:let a=n.charCodeAt(0);e.pending="",e.text+=fa(a)||a>=65&&a<=90||a>=97&&a<=122?o:n;continue}case`
|
|
35
35
|
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:ne(e),It(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:ne(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){ne(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,ne(e),re(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
37
|
`){ne(e),re(e,a),e.pending=n;continue}}else{if(l===n){ne(e),re(e,i),re(e,a),e.pending="";continue}if(n!==" "&&n!==`
|
|
38
38
|
`){ne(e),re(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
|
-
`){ne(e),re(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(vp(n.charCodeAt(0)))break;ne(e),re(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){ne(e),re(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){ne(e),re(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}ne(e)}function ha(e){return{add_token:bp,end_token:yp,add_text:xp,set_attr:Pp,data:{nodes:[e,,,,,],index:0}}}function bp(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 yp(e){e.index-=1}function xp(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Pp(e,t,n){e.nodes[e.index].setAttribute(pp(t),n)}function Wo({textSig:e,doneSig:t}){let n=N(null);return kt(()=>{let o=n.current;if(!o)return;o.classList.add(`${x.cssPrefix}-md`);let a=ha(o),i=ga(a),l=0,s=at(()=>{let u=e.value,g=t.value;u.length<l&&(o.replaceChildren(),a=ha(o),i=ga(a),l=0);let _=u.slice(l);_&&Ce(i,_),l=u.length,g&&nc(i)}),c=new MutationObserver(u=>{for(let g of u)for(let _ of g.addedNodes){if(!(_ instanceof HTMLElement))continue;let f=_.matches?.("a")?[_]:[..._.querySelectorAll?.("a")??[]];for(let m of f)oc(m)}});c.observe(o,{childList:!0,subtree:!0});for(let u of o.querySelectorAll("a"))oc(u);let d=u=>{let g=u.target?.closest?.("a");if(!g||!(g instanceof HTMLAnchorElement))return;let _=g.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 rc({text:e}){let t=Re(()=>z(e),[e]),n=Re(()=>z(!0),[]);return r(Wo,{textSig:t,doneSig:n})}function oc(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 Vo=x.cssPrefix;function ac({messageId:e,initial:t,strings:n,onFeedback:o}){let[a,i]=E(t),l=s=>{let c=a===s?null:s;i(c),o(e,c)};return r("div",{class:`${Vo}-feedback`,role:"group","data-testid":S.messageFeedback,children:[r("button",{type:"button",class:`${Vo}-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":S.feedbackUp,children:r(Il,{})}),r("button",{type:"button",class:`${Vo}-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":S.feedbackDown,children:r(Ll,{})}),r("span",{class:`${Vo}-sr-only`,role:"status","aria-live":"polite",children:a?n.feedbackThanks:""})]})}var en=x.cssPrefix;function ic({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${en}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":S.source,children:[r("span",{class:`${en}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${en}-source-label`,children:n})]}):r("span",{class:`${en}-source`,"data-testid":S.source,children:[r("span",{class:`${en}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${en}-source-label`,children:n})]})}var Ve=x.cssPrefix;function ba(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 ya({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 Sp(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 wp({status:e}){return e==="denied"||e==="error"||e==="superseded"?r(Mo,{}):e==="completed"||e==="responded"?r(Lo,{}):r(Nl,{})}function Cp(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 Tp({state:e,approval:t,strings:n,superseded:o}){let a=Sp(e,t),i=o&&(a==="awaiting"||a==="running")?"superseded":a;return r(ya,{status:i,icon:r(wp,{status:i}),label:Cp(i,n)})}function Ep({name:e,state:t,approval:n,strings:o,superseded:a}){return r(ie,{children:[r("span",{class:`${Ve}-toolui-name-pill`,children:[r(Ml,{}),r("span",{class:`${Ve}-toolui-name-text`,children:e})]}),r(Tp,{state:t,approval:n,strings:o,superseded:a}),r("span",{class:`${Ve}-toolui-chevron`,children:r(Et,{})})]})}function Ko({part:e,strings:t,testid:n,superseded:o}){let a=J(()=>e.inputSig.value),i=J(()=>e.outputSig.value),l=J(()=>e.errorSig.value),s=J(()=>e.stateSig.value),c=J(()=>e.approvalSig.value);return r("details",{class:`${Ve}-toolui ${Ve}-toolui-collapsible`,"data-testid":n,children:[r("summary",{class:`${Ve}-toolui-head`,children:r(Ep,{name:ba(e.toolName),state:s.value,approval:c.value,strings:t,superseded:o})}),r(va,{label:t.toolParameters,value:a.value}),i.value!==void 0?r(va,{label:t.toolResult,value:i.value}):null,l.value?r(va,{label:t.statusError,value:l.value,error:!0}):null]})}function va({label:e,value:t,error:n}){let o=n?String(t??""):jo(xa(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 xa(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 ze=x.cssPrefix;function sc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=J(()=>e.approvalSig.value),s=J(()=>e.stateSig.value),c=ba(e.toolName),d=l.value?.approved,{terminal:u,responded:g,decided:_}=Go(s.value,l.value),f=g&&n&&!u,m=o&&!_,P=e.toolCallId;return r("div",{class:`${ze}-toolui-group`,"data-testid":_?S.toolDecision:S.toolApproval,children:[r(Ko,{part:e,strings:t,superseded:m}),m||u?null:r("div",{class:`${ze}-toolui ${ze}-toolui-body`,children:[g?r(ie,{children:[r("p",{class:`${ze}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",d?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),f?r("p",{class:`${ze}-toolui-subtle`,children:t.approvalEditHint}):null,!f&&!u?r("p",{class:`${ze}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(ie,{children:[r("p",{class:`${ze}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",c)}),r("p",{class:`${ze}-toolui-subtle`,children:t.approvalBody})]}),!_&&!o?r("div",{class:`${ze}-toolui-actions`,children:[r("button",{type:"button",class:`${ze}-form-skip`,onClick:()=>a(P,!1),"data-testid":S.toolReject,children:t.reject}),r("button",{type:"button",class:`${ze}-form-submit`,onClick:()=>a(P,!0),"data-testid":S.toolApprove,children:t.approve})]}):null,f?r("div",{class:`${ze}-toolui-actions`,children:r("button",{type:"button",class:`${ze}-form-skip`,onClick:()=>i(P),"data-testid":S.toolEdit,children:t.edit})}):null]})]})}var Ap=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function lc(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(Rp).filter(a=>a!==null);return{intro:Xo(t.intro),questions:o}}function Rp(e,t){if(!e||typeof e!="object")return null;let n=e,o=Ap.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 Ip(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 Pa(e,t,n){return e.questions.map(o=>{let a=Ip(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 be=x.cssPrefix,Lp={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function cc(e,t){let n={};for(let o of e)n[o.key]=t[Lp[o.type]];return n}function dc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=J(()=>e.stateSig.value).value,s=J(()=>e.approvalSig.value).value,c=J(()=>lc(e.inputSig.value)).value,{terminal:d,decided:u}=Go(l,s),g=u&&s?.approved===!0,_=!u&&!o,f=!_&&!g,m=g&&n&&!d,P=c.questions,[v,y]=E(null),b=v??(_||g),[T,H]=E(!1),Z=P.length>1?oa:Cn,Y=_?t.inputRequired:t.inputBadge,oe=_?r(Mp,{req:c,strings:t,resolve:(G,I)=>a(e.toolCallId,I,G)}):T?r(Rn,{fields:Pa(c,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:cc(P,t),initialValues:g?Fp(P,s?.reason):void 0}):r(Np,{questions:P,answers:g?$p(s?.reason):{},strings:t});return r("details",{class:`${be}-toolui ${be}-toolui-collapsible${o?` ${be}-toolui-stale`:""}`,open:b,onToggle:G=>{let I=G.currentTarget.open;I!==b&&y(I)},"data-testid":_?S.toolAskQuestions:S.toolDecision,children:[r("summary",{class:`${be}-toolui-head`,children:[r("span",{class:`${be}-toolui-q-pill`,children:[r(Z,{}),Y]}),r("span",{class:`${be}-toolui-head-end`,children:[_?null:r(ya,{status:f?"superseded":"completed",icon:f?r(Mo,{}):r(Lo,{}),label:f?t.inputSkipped:t.inputAnswered}),r("span",{class:`${be}-toolui-chevron`,children:r(Et,{})})]})]}),r("div",{class:`${be}-toolui-collapse-body`,children:[c.intro?r("div",{class:`${be}-toolui-desc`,children:c.intro}):null,oe,_?null:r("button",{type:"button",class:`${be}-toolui-options-toggle`,onClick:()=>H(G=>!G),"data-testid":S.toolAskOptions,children:[r("span",{class:`${be}-toolui-options-chevron${T?` ${be}-open`:""}`,children:r(Et,{})}),T?t.hideOptions:t.showOptions]}),m?r("div",{class:`${be}-toolui-actions`,children:r("button",{type:"button",class:`${be}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":S.toolEdit,children:t.edit})}):null]})]})}function Mp({req:e,strings:t,resolve:n}){let o=Pa(e,t.confirmYes,t.confirmNo),a=e.questions.length===1&&e.questions[0]?.type==="text";return r(Rn,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:a?t.inputSubmitHint:void 0,onSubmit:i=>n(Op(e.questions,i),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:a,fieldTypeLabels:cc(e.questions,t),submitTestId:S.toolInputSubmit,skipTestId:S.toolInputSkip})}function Np({questions:e,answers:t,strings:n}){return r("div",{class:`${be}-toolui-summary`,"data-testid":S.toolAskSummary,children:e.map(o=>r("div",{class:`${be}-field`,children:[r("span",{class:`${be}-field-head`,children:r("span",{class:`${be}-field-label`,children:[o.question,o.required?r("span",{class:`${be}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),r("p",{class:`${be}-toolui-answer`,children:Dp(o,t[o.key],n)||"\u2014"})]},o.key))})}function Dp(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Op(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 _c(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 $p(e){let t=_c(e),n={};for(let[o,a]of Object.entries(t))n[o]=Array.isArray(a)?a.join(", "):a;return n}function Fp(e,t){let n=_c(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 uc({part:e,strings:t}){let n=J(()=>e.inputSig.value),o=J(()=>e.outputSig.value),a=J(()=>e.errorSig.value);return J(()=>!!jo(n.value)||!!a.value||!!jo(xa(o.value))).value?r(Ko,{part:e,strings:t,testid:S.toolCall}):null}var Ee=x.cssPrefix;function pc({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:g}){let f=J(()=>e.partsSig.value).value,m=J(()=>it(e)),P=J(()=>Xs(e)),v=J(()=>e.partsSig.value.some(B=>B.kind==="text"&&B.textSig.value.length>0)),y=J(()=>o&&e.partsSig.value.some(B=>B.kind==="reasoning")),C=J(()=>{let B=e.partsSig.value,w=-1;for(let K=0;K<B.length;K++){let te=B[K]?.kind;(te==="text"||te==="file"||te==="source")&&(w=K)}return w}),b=e.role==="assistant"&&e.status==="streaming",T=n==="buffered"&&b,H=b&&!v.value,Z=b&&!T&&!(y.value&&H);if(P.value)return null;let Y=Bp(e.createdAt),oe=u&&!!g&&!!e.serverMessageId&&e.role==="assistant"&&!b&&e.status!=="error"&&!m.value,G=f.filter(B=>B.kind==="text").map(B=>B.textSig.value).join(`
|
|
39
|
+
`){ne(e),re(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(hp(n.charCodeAt(0)))break;ne(e),re(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){ne(e),re(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){ne(e),re(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}ne(e)}function ha(e){return{add_token:vp,end_token:bp,add_text:yp,set_attr:xp,data:{nodes:[e,,,,,],index:0}}}function vp(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 bp(e){e.index-=1}function yp(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function xp(e,t,n){e.nodes[e.index].setAttribute(up(t),n)}function qo({textSig:e,doneSig:t}){let n=N(null);return kt(()=>{let o=n.current;if(!o)return;o.classList.add(`${x.cssPrefix}-md`);let a=ha(o),i=ga(a),l=0,s=at(()=>{let u=e.value,g=t.value;u.length<l&&(o.replaceChildren(),a=ha(o),i=ga(a),l=0);let _=u.slice(l);_&&Ce(i,_),l=u.length,g&&tc(i)}),c=new MutationObserver(u=>{for(let g of u)for(let _ of g.addedNodes){if(!(_ instanceof HTMLElement))continue;let f=_.matches?.("a")?[_]:[..._.querySelectorAll?.("a")??[]];for(let m of f)nc(m)}});c.observe(o,{childList:!0,subtree:!0});for(let u of o.querySelectorAll("a"))nc(u);let d=u=>{let g=u.target?.closest?.("a");if(!g||!(g instanceof HTMLAnchorElement))return;let _=g.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 oc({text:e}){let t=Ae(()=>z(e),[e]),n=Ae(()=>z(!0),[]);return r(qo,{textSig:t,doneSig:n})}function nc(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=x.cssPrefix;function rc({messageId:e,initial:t,strings:n,onFeedback:o}){let[a,i]=E(t),l=s=>{let c=a===s?null:s;i(c),o(e,c)};return r("div",{class:`${Wo}-feedback`,role:"group","data-testid":S.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":S.feedbackUp,children:r(Al,{})}),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":S.feedbackDown,children:r(Il,{})}),r("span",{class:`${Wo}-sr-only`,role:"status","aria-live":"polite",children:a?n.feedbackThanks:""})]})}var en=x.cssPrefix;function ac({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${en}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":S.source,children:[r("span",{class:`${en}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${en}-source-label`,children:n})]}):r("span",{class:`${en}-source`,"data-testid":S.source,children:[r("span",{class:`${en}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${en}-source-label`,children:n})]})}var Ve=x.cssPrefix;function ba(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function Vo(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 ya({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 kp(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 Sp({status:e}){return e==="denied"||e==="error"||e==="superseded"?r(Lo,{}):e==="completed"||e==="responded"?r(Io,{}):r(Ml,{})}function wp(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 Cp({state:e,approval:t,strings:n,superseded:o}){let a=kp(e,t),i=o&&(a==="awaiting"||a==="running")?"superseded":a;return r(ya,{status:i,icon:r(Sp,{status:i}),label:wp(i,n)})}function Tp({name:e,state:t,approval:n,strings:o,superseded:a}){return r(ie,{children:[r("span",{class:`${Ve}-toolui-name-pill`,children:[r(Ll,{}),r("span",{class:`${Ve}-toolui-name-text`,children:e})]}),r(Cp,{state:t,approval:n,strings:o,superseded:a}),r("span",{class:`${Ve}-toolui-chevron`,children:r(Et,{})})]})}function Go({part:e,strings:t,testid:n,superseded:o}){let a=J(()=>e.inputSig.value),i=J(()=>e.outputSig.value),l=J(()=>e.errorSig.value),s=J(()=>e.stateSig.value),c=J(()=>e.approvalSig.value);return r("details",{class:`${Ve}-toolui ${Ve}-toolui-collapsible`,"data-testid":n,children:[r("summary",{class:`${Ve}-toolui-head`,children:r(Tp,{name:ba(e.toolName),state:s.value,approval:c.value,strings:t,superseded:o})}),r(va,{label:t.toolParameters,value:a.value}),i.value!==void 0?r(va,{label:t.toolResult,value:i.value}):null,l.value?r(va,{label:t.statusError,value:l.value,error:!0}):null]})}function va({label:e,value:t,error:n}){let o=n?String(t??""):Ko(xa(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 xa(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Ko(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 ze=x.cssPrefix;function ic({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=J(()=>e.approvalSig.value),s=J(()=>e.stateSig.value),c=ba(e.toolName),d=l.value?.approved,{terminal:u,responded:g,decided:_}=Vo(s.value,l.value),f=g&&n&&!u,m=o&&!_,P=e.toolCallId;return r("div",{class:`${ze}-toolui-group`,"data-testid":_?S.toolDecision:S.toolApproval,children:[r(Go,{part:e,strings:t,superseded:m}),m||u?null:r("div",{class:`${ze}-toolui ${ze}-toolui-body`,children:[g?r(ie,{children:[r("p",{class:`${ze}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",d?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),f?r("p",{class:`${ze}-toolui-subtle`,children:t.approvalEditHint}):null,!f&&!u?r("p",{class:`${ze}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(ie,{children:[r("p",{class:`${ze}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",c)}),r("p",{class:`${ze}-toolui-subtle`,children:t.approvalBody})]}),!_&&!o?r("div",{class:`${ze}-toolui-actions`,children:[r("button",{type:"button",class:`${ze}-form-skip`,onClick:()=>a(P,!1),"data-testid":S.toolReject,children:t.reject}),r("button",{type:"button",class:`${ze}-form-submit`,onClick:()=>a(P,!0),"data-testid":S.toolApprove,children:t.approve})]}):null,f?r("div",{class:`${ze}-toolui-actions`,children:r("button",{type:"button",class:`${ze}-form-skip`,onClick:()=>i(P),"data-testid":S.toolEdit,children:t.edit})}):null]})]})}var Ep=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function sc(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(Rp).filter(a=>a!==null);return{intro:jo(t.intro),questions:o}}function Rp(e,t){if(!e||typeof e!="object")return null;let n=e,o=Ep.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 Ap(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 Pa(e,t,n){return e.questions.map(o=>{let a=Ap(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 be=x.cssPrefix,Ip={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function lc(e,t){let n={};for(let o of e)n[o.key]=t[Ip[o.type]];return n}function cc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=J(()=>e.stateSig.value).value,s=J(()=>e.approvalSig.value).value,c=J(()=>sc(e.inputSig.value)).value,{terminal:d,decided:u}=Vo(l,s),g=u&&s?.approved===!0,_=!u&&!o,f=!_&&!g,m=g&&n&&!d,P=c.questions,[v,y]=E(null),b=v??(_||g),[T,H]=E(!1),Z=P.length>1?oa:Cn,Y=_?t.inputRequired:t.inputBadge,oe=_?r(Lp,{req:c,strings:t,resolve:(G,I)=>a(e.toolCallId,I,G)}):T?r(An,{fields:Pa(c,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:lc(P,t),initialValues:g?$p(P,s?.reason):void 0}):r(Mp,{questions:P,answers:g?Op(s?.reason):{},strings:t});return r("details",{class:`${be}-toolui ${be}-toolui-collapsible${o?` ${be}-toolui-stale`:""}`,open:b,onToggle:G=>{let I=G.currentTarget.open;I!==b&&y(I)},"data-testid":_?S.toolAskQuestions:S.toolDecision,children:[r("summary",{class:`${be}-toolui-head`,children:[r("span",{class:`${be}-toolui-q-pill`,children:[r(Z,{}),Y]}),r("span",{class:`${be}-toolui-head-end`,children:[_?null:r(ya,{status:f?"superseded":"completed",icon:f?r(Lo,{}):r(Io,{}),label:f?t.inputSkipped:t.inputAnswered}),r("span",{class:`${be}-toolui-chevron`,children:r(Et,{})})]})]}),r("div",{class:`${be}-toolui-collapse-body`,children:[c.intro?r("div",{class:`${be}-toolui-desc`,children:c.intro}):null,oe,_?null:r("button",{type:"button",class:`${be}-toolui-options-toggle`,onClick:()=>H(G=>!G),"data-testid":S.toolAskOptions,children:[r("span",{class:`${be}-toolui-options-chevron${T?` ${be}-open`:""}`,children:r(Et,{})}),T?t.hideOptions:t.showOptions]}),m?r("div",{class:`${be}-toolui-actions`,children:r("button",{type:"button",class:`${be}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":S.toolEdit,children:t.edit})}):null]})]})}function Lp({req:e,strings:t,resolve:n}){let o=Pa(e,t.confirmYes,t.confirmNo),a=e.questions.length===1&&e.questions[0]?.type==="text";return r(An,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:a?t.inputSubmitHint:void 0,onSubmit:i=>n(Dp(e.questions,i),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:a,fieldTypeLabels:lc(e.questions,t),submitTestId:S.toolInputSubmit,skipTestId:S.toolInputSkip})}function Mp({questions:e,answers:t,strings:n}){return r("div",{class:`${be}-toolui-summary`,"data-testid":S.toolAskSummary,children:e.map(o=>r("div",{class:`${be}-field`,children:[r("span",{class:`${be}-field-head`,children:r("span",{class:`${be}-field-label`,children:[o.question,o.required?r("span",{class:`${be}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),r("p",{class:`${be}-toolui-answer`,children:Np(o,t[o.key],n)||"\u2014"})]},o.key))})}function Np(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function Dp(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 dc(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=dc(e),n={};for(let[o,a]of Object.entries(t))n[o]=Array.isArray(a)?a.join(", "):a;return n}function $p(e,t){let n=dc(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 _c({part:e,strings:t}){let n=J(()=>e.inputSig.value),o=J(()=>e.outputSig.value),a=J(()=>e.errorSig.value);return J(()=>!!Ko(n.value)||!!a.value||!!Ko(xa(o.value))).value?r(Go,{part:e,strings:t,testid:S.toolCall}):null}var Ee=x.cssPrefix;function uc({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:g}){let f=J(()=>e.partsSig.value).value,m=J(()=>it(e)),P=J(()=>js(e)),v=J(()=>e.partsSig.value.some(B=>B.kind==="text"&&B.textSig.value.length>0)),y=J(()=>o&&e.partsSig.value.some(B=>B.kind==="reasoning")),C=J(()=>{let B=e.partsSig.value,w=-1;for(let K=0;K<B.length;K++){let te=B[K]?.kind;(te==="text"||te==="file"||te==="source")&&(w=K)}return w}),b=e.role==="assistant"&&e.status==="streaming",T=n==="buffered"&&b,H=b&&!v.value,Z=b&&!T&&!(y.value&&H);if(P.value)return null;let Y=Hp(e.createdAt),oe=u&&!!g&&!!e.serverMessageId&&e.role==="assistant"&&!b&&e.status!=="error"&&!m.value,G=f.filter(B=>B.kind==="text").map(B=>B.textSig.value).join(`
|
|
40
40
|
|
|
41
|
-
`).trim(),I=!b&&e.status!=="error"&&!m.value&&G.length>0,D=oe||I;return r("div",{class:`${Ee}-bubble-row`,"data-role":e.role,"data-mid":e.serverMessageId??e.id,"data-testid":Pe(S.messageBubble,e.id),children:r("div",{class:`${Ee}-bubble-col`,children:[r("div",{class:`${Ee}-bubble`,children:[T?r(Gp,{label:t.loading}):f.map((B,w)=>r(zp,{part:B,active:H,strings:t,showReasoning:o,showToolCalls:a,showSources:i,interactive:l&&(B.kind!=="tool"||w>C.value),superseded:s,tool:c},Wp(B))),Z&&r(Vp,{}),e.status==="error"&&e.errorText||m.value?r("div",{class:`${Ee}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${Ee}-error-retry`,onClick:d,"data-testid":S.messageRetry,children:t.errorRetry}):null]}):null]}),Y||D?r("div",{class:`${Ee}-bubble-meta`,children:[Y?r("time",{class:`${Ee}-bubble-time`,dateTime:Y.iso,title:Y.full,children:Y.short}):null,D?r("div",{class:`${Ee}-bubble-actions`,children:[oe&&e.serverMessageId?r(ac,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:g}):null,I?r(Hp,{text:G,strings:t}):null]}):null]}):null]})})}function Hp({text:e,strings:t}){let[n,o]=E(!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:`${Ee}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:a,"data-testid":S.messageCopy,children:n?r(Tt,{}):r(Rl,{})})}function Bp(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 zp({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(Wo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(qp,{part:e,active:t,strings:n}):null;case"tool":return r(Up,{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(ic,{part:e,strings:n}):null}}function Up({part:e,strings:t,showToolCalls:n,interactive:o,superseded:a,tool:i}){let l=J(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(Yl(e.toolName))return r(dc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit});if(l.value)return r(sc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(uc,{part:e,strings:t}):null}function qp({part:e,active:t,strings:n}){return r("details",{class:`${Ee}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Ee}-reasoning-summary`,children:r("span",{class:`${Ee}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Ee}-reasoning-body`,children:r(Wo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Wp(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 Vp(){return r("span",{class:`${Ee}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function Gp({label:e}){return r("span",{class:`${Ee}-loading`,role:"status",children:[r("span",{class:`${Ee}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Ee}-loading-label`,children:e})]})}var Lt=x.cssPrefix,ka=120,Kp=350;function mc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,scrollFade:l,enableMessageFeedback:s,onFeedback:c,loading:d,idle:u,tool:g,onRetry:_,form:f,formMarkers:m,onFillForm:P}){let v=N(null),y=J(()=>e.value),[C,b]=E(!1),T=N(!1),H=N(!1),Z=N(!1),Y=N(0),oe=()=>Z.current||performance.now()-Y.current<Kp,G=N(0),I=k=>{if(!l)return;let U=k.scrollHeight-k.clientHeight>1;k.dataset.fadeTop=U&&k.scrollTop>1?"true":"false",k.dataset.fadeBottom=U&&k.scrollHeight-k.scrollTop-k.clientHeight>1?"true":"false"},D=k=>b(k.scrollHeight-k.scrollTop-k.clientHeight>ka*2),B=k=>{G.current=performance.now(),k.scrollTop=k.scrollHeight,I(k)},w=(k,U)=>{B(k);let ke=U,Se=0,ae=()=>{B(k),--ke>0&&(Se=requestAnimationFrame(ae))};return U>0&&(Se=requestAnimationFrame(ae)),()=>cancelAnimationFrame(Se)},K=(k,U)=>{let ke,Se,ae,$e=-1,Ye=()=>{ke.disconnect(),Se.disconnect(),clearTimeout(ae)},De=()=>{if(H.current||oe()||$e>=0&&k.scrollTop<$e-4)return Ye();B(k),$e=k.scrollTop};return ke=new ResizeObserver(De),Se=new MutationObserver(De),De(),ke.observe(k),Se.observe(k,{childList:!0,subtree:!0,characterData:!0}),ae=setTimeout(Ye,U),Ye},te=y.value[0]?.id;kt(()=>{let k=v.current;if(k&&y.value.length!==0&&(T.current=!0,!!y.value.some(U=>U.role==="user")))return K(k,300)},[te]);let he=N(0);A(()=>{let k=v.current,U=y.value,ke=he.current;if(he.current=U.length,!k||!T.current)return;if(U.slice(ke).some(ae=>ae.role==="user"))return H.current=!1,w(k,3);if(!U.some(ae=>ae.role==="user")||H.current||oe())return;k.scrollHeight-k.scrollTop-k.clientHeight<ka&&B(k)},[y.value.length]);let _e=N(null);A(()=>{let k=v.current,U=y.value.at(-1),ke=_e.current;if(_e.current=U?.id??null,!!k&&T.current&&!(!U||U.id!==ke||U.status!=="streaming"))return H.current=!1,w(k,3)},[y.value]),A(()=>{let k=v.current;if(!k)return;let U=y.value.at(-1);if(!U||U.status!=="streaming"&&!y.value.some(ae=>ae.role==="user"))return;let ke=()=>{if(H.current||oe())return;k.scrollHeight-k.scrollTop-k.clientHeight<ka*2&&B(k)};if(U.status!=="streaming")return K(k,300);ke();let Se=new MutationObserver(ke);return Se.observe(k,{childList:!0,subtree:!0,characterData:!0}),()=>Se.disconnect()},[y.value]);let Me=f?.form.id,ve=!!f&&(m??[]).some(k=>k.formId===f.form.id);kt(()=>{let k=v.current;!k||!Me||H.current||y.value.some(U=>U.role==="user")&&(ve?k.querySelector(`[data-testid="${S.formGate}"]`)?.scrollIntoView({block:"nearest"}):B(k))},[Me,ve]),A(()=>{let k=v.current;if(!k)return;let U=()=>{D(k),I(k),performance.now()-G.current>150&&(H.current=k.scrollHeight-k.scrollTop-k.clientHeight>8)},ke=()=>{H.current=!0},Se=je=>{je.deltaY<0&&ke()},ae=0,$e=je=>{ae=je.touches[0]?.clientY??0,Z.current=!0},Ye=je=>{(je.touches[0]?.clientY??0)>ae+4&&ke()},De=()=>{Z.current=!1,Y.current=performance.now()},Dt=()=>{Z.current=!0};return k.addEventListener("scroll",U,{passive:!0}),k.addEventListener("wheel",Se,{passive:!0}),k.addEventListener("touchstart",$e,{passive:!0}),k.addEventListener("touchmove",Ye,{passive:!0}),k.addEventListener("touchend",De,{passive:!0}),k.addEventListener("touchcancel",De,{passive:!0}),k.addEventListener("pointerdown",Dt,{passive:!0}),window.addEventListener("pointerup",De,{passive:!0}),window.addEventListener("pointercancel",De,{passive:!0}),D(k),()=>{k.removeEventListener("scroll",U),k.removeEventListener("wheel",Se),k.removeEventListener("touchstart",$e),k.removeEventListener("touchmove",Ye),k.removeEventListener("touchend",De),k.removeEventListener("touchcancel",De),k.removeEventListener("pointerdown",Dt),window.removeEventListener("pointerup",De),window.removeEventListener("pointercancel",De)}},[]);let Ne=()=>{let k=v.current;k&&(H.current=!1,B(k))},ue=[],Ke="",Xe=y.value.at(-1)?.id,vt=[...m??[]].toSorted((k,U)=>(k.createdAt??1/0)-(U.createdAt??1/0)),Nt=k=>f&&k.formId===f.form.id?r(_a,{form:f.form,strings:t,onSubmit:f.onSubmit,onSkip:f.onSkip},`gate:${k.formId}`):r(Xl,{marker:k,strings:t,onFill:!f&&P?()=>P(k.formId):void 0},k.key),Dn=k=>{for(let U=vt[0];U?.createdAt!==void 0&&!(k!==void 0&&U.createdAt>k);U=vt[0])vt.shift(),ue.push(Nt(U))};for(let k of y.value){if(k.role==="assistant"&&k.id!==Xe&&it(k))continue;Dn(k.createdAt);let U=jp(k.createdAt);U&&U!==Ke&&(ue.push(r("div",{class:`${Lt}-date-divider`,children:r("span",{class:`${Lt}-date-pill`,title:Xp(k.createdAt),children:Yp(k.createdAt,t)})},`day:${U}`)),Ke=U),ue.push(r(pc,{message:k,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:!!u&&k.id===Xe,superseded:k.id!==Xe,tool:g,onRetry:u&&k.id===Xe?_:void 0,enableMessageFeedback:s,onFeedback:c},k.id))}for(let k of vt)ue.push(Nt(k));return r("div",{class:`${Lt}-list-wrap`,children:[r("div",{ref:v,class:`${Lt}-list${l?` ${Lt}-list--fade`:""}`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[d&&y.value.length===0?r("div",{class:`${Lt}-list-loading`,role:"status",children:t.conversationLoading}):null,ue,f&&!ve?r(_a,{form:f.form,strings:t,onSubmit:f.onSubmit,onSkip:f.onSkip}):null]}),C?r("button",{type:"button",class:`${Lt}-jump`,onClick:Ne,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":S.scrollToBottom,children:r(Et,{})}):null]})}function jp(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Xp(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Yp(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 Qp(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((fc(e)-fc(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function gc(e,t){let n=new Map;for(let o of t){let a=Qp(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 fc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Zp=q.scope("history"),em=3,tm=6,nm={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function om(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=x.cssPrefix,c=e.peekConversations({visitorId:a}),[d,u]=E(c?"loaded":"loading"),[g,_]=E(c?.conversations??[]);A(()=>{let v=!1;return e.listConversations({visitorId:a}).then(y=>{if(v)return;let C=y.conversations??[];_(C),u("loaded"),o.saveHistoryCount(C.length)}).catch(y=>{v||(Zp.warn("listConversations failed",{err:y}),u("error"))}),()=>{v=!0}},[e,a,o]);let f=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":S.sidebarNewConversation,children:[r(ol,{}),t.newConversation]})}):null;if(d==="loading"){let v=Math.min(o.loadHistoryCount()??em,tm);return r(ie,{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,v)},(y,C)=>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`})})})]})]},C))})]})}),f]})}if(d==="error"||g.length===0)return r(ie,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let m=Date.now(),P=gc(m,g);return r(ie,{children:[r("div",{class:`${s}-history`,role:"list",children:P.map(v=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[nm[v.bucket]]}),r("div",{class:`${s}-history-card`,children:v.conversations.map(y=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(y),"data-closed":y.canContinue?void 0:"true","data-unread":y.hasUnread?"true":void 0,"data-testid":Pe(S.historyItem,y.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(ra,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:y.title}),r("span",{class:`${s}-history-time`,children:om(y.lastMessageAt,m,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:y.preview??(y.canContinue?t.historyContinue:t.conversationClosed)}),y.hasUnread?r("span",{class:`${s}-history-dot`}):null]})]})]},y.conversationId))})]},v.bucket))}),f]})}var hc=x.cssPrefix;function vc({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${hc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${hc}-suggestion`,onClick:()=>t(n),"data-testid":Pe(S.suggestion,o),children:n.label},n.id))})}var Le=x.cssPrefix;function bc(e){let{options:t,onClose:n}=e,o=t.strings,a=N(null);A(()=>{let c=a.current;if(!c)return;let d=Fo(c),u=g=>{g.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let i=N(null),l=$(c=>{i.current?.attachFromDrop(c)},[]),{visible:s}=zo({containerRef:a,onDrop:l});return Oo(a.current,t.mode==="modal"),r("div",{ref:a,class:`${Le}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":S.panel,children:[r(Sa,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),r(wa,{poweredBy:e.options.poweredBy})]})}function Sa(e){let{options:t,transport:n,feedback:o,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,loadingMessages:u,messagesSig:g,agent:_,suggestions:f,initialWidgetSize:m,visitorId:P,onClose:v,onBack:y,onClear:C,onToggleHistory:b,onSelectHistoryConversation:T,onNewConversation:H,onWidgetSizeChange:Z,onSend:Y,onStop:oe,onSuggestion:G,activeForm:I,formMarkers:D,onFormSubmit:B,onFormSkip:w,onFormFill:K,tool:te,onRetry:he,onMessageFeedback:_e,containerEl:Me,dragOver:ve,composerAttachApiRef:Ne}=e,ue=t.strings,Ke;return I?Ke=null:c?Ke=r(ie,{children:[r(vc,{suggestions:f,onPick:G}),r(ql,{options:t,transport:n,feedback:o,bus:a,isStreaming:d,onSend:Y,onStop:oe,attachApiRef:Ne})]}):Ke=r(am,{label:ue.conversationClosed,ctaLabel:ue.startNewConversation,onNewConversation:C}),r(ie,{children:[s==="history"?r(rm,{strings:ue,onBack:b,onClose:v,showClose:$o(t.mode,l,t.actions)}):r("header",{class:`${Le}-header`,"data-testid":S.panelHeader,children:[y?r("button",{type:"button",class:`${Le}-icon-btn`,onClick:y,"aria-label":ue.moduleBack,title:ue.moduleBack,children:r(wn,{})}):null,_?r(Bl,{agent:_,strings:ue}):r("h1",{children:ue.panelTitle}),r(Ze,{panelProps:e,variant:"chat"})]}),s==="history"?r(Yo,{transport:n,strings:ue,locale:t.locale,persistence:i,visitorId:P,onSelect:Xe=>T(Xe.conversationId),onNewConversation:H}):r(ie,{children:[r(Wl,{visible:ve,strings:ue}),r(mc,{messagesSig:g,strings:ue,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,scrollFade:t.scrollFade,enableMessageFeedback:t.enableMessageFeedback,onFeedback:_e,loading:u,idle:!d,tool:te,onRetry:he,form:I?{form:I,onSubmit:B,onSkip:w}:null,formMarkers:D,onFillForm:K}),Ke,r(im,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(Do,{panelEl:Me,resize:t.size.resize,position:t.position,initialSize:m,onSizeChange:Z,strings:ue}):null]})}function rm({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Le}-header`,children:[r("button",{type:"button",class:`${Le}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(wn,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Le}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(Qe,{})}):null]})}function am({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Le}-readonly-banner`,role:"note",children:[r("span",{class:`${Le}-readonly-label`,children:e}),r("button",{type:"button",class:`${Le}-readonly-cta`,onClick:n,children:t})]})}function im({disclaimer:e}){return e?r("div",{class:`${Le}-composer-footer`,children:r("div",{class:`${Le}-disclaimer`,children:e})}):null}function wa({poweredBy:e}){return e?r("div",{class:`${Le}-poweredby-bar`,children:r(sm,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function sm({logoUrl:e,text:t,href:n}){let o=r(ie,{children:[e?r("img",{class:`${Le}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Le}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Le}-poweredby`,children:o})}function yc(e){let t=N(e);t.current=e;let n=N(null);return n.current??(n.current=lm(t)),n.current}function lm(e){let t=z(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 g=u.forms.list.find(_=>_.id===d);g&&(t.value={form:g,trigger:"manual"});return}for(let g of u.forms.byTrigger[c]??[]){let _=g.triggers.find(f=>f.kind===c);if(!(!_||!cm(_,u)||a(g)||!dm(g,u))){t.value={form:g,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:g,trigger:_}=u;g.frequency==="conversation"?n.add(o(g.id)):g.frequency!=="always"&&e.current.persistence.saveFormDone(g.id),e.current.onComplete(g,_,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 cm(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function dm(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 xc(e){let t=x.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":S.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(_m,{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":S.sidebarToggle,children:r(um,{collapsed:i})})]}),i?null:r(ie,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(pm,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(mm,{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 _m({site:e}){let t=x.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??x.name})}function um({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 pm({items:e}){let t=x.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 mm({items:e}){let t=x.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 Pc=x.cssPrefix;function kc(e){return r("main",{class:`${Pc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(xc,{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:`${Pc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Sc=e=>Object.fromEntries(e.map(t=>[t,[]]));function wc(e,t,n){let o=z({activeTab:e,stacks:Sc(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:Sc(t)}}}}var Cc=e=>e.stacks[e.activeTab]??[],Tc=e=>Cc(e).at(-1),Ec=e=>Cc(e).length===0;var Ac={Icon:Tn};var gt=x.cssPrefix;function Jo({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 Qo({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(wn,{})}),r("h1",{class:`${gt}-back-title`,children:e}),o??r("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"})]})}var tn=x.cssPrefix;function Rc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${tn}-home-search`,onClick:t,"data-testid":S.homeSearch,children:[r("span",{class:`${tn}-home-search-text`,children:e}),r("span",{class:`${tn}-home-search-icon`,"aria-hidden":"true",children:r(aa,{})})]})}function Ic({placeholder:e,value:t,onInput:n}){return r("div",{class:`${tn}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${tn}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":S.helpSearch}),r("span",{class:`${tn}-home-search-icon`,"aria-hidden":"true",children:r(aa,{})})]})}var In=x.cssPrefix;function Zo({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${In}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${In}-list-row-body`,children:[r("span",{class:`${In}-list-row-title`,children:e}),t?r("span",{class:`${In}-list-row-sub`,children:t}):null]}),r("span",{class:`${In}-list-row-chevron`,"aria-hidden":"true",children:r(Jt,{})})]})}var Lc=x.cssPrefix;function Ge({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${Lc}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${Lc}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var Mt=x.cssPrefix,fm=q.scope("help"),gm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function hm(e){let 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 Mc(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 vm(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(Mc(n,o.title)*2,Mc(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,a)=>a.score-o.score).map(o=>o.item):[]}function Nc({article:e,nav:t}){return r(Zo,{title:e.title,subtitle:e.description,onClick:()=>gm(t,e),testid:Pe(S.helpArticle,e.id)})}function bm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=E("loading"),[d,u]=E(t.errorGeneric),[g,_]=E([]),[f,m]=E(""),[P,v]=E(0);A(()=>{let b=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(T=>{if(b)return;let H=T.items??[];_(H),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:H.length})}).catch(T=>{b||(fm.warn("listContent (help) failed",{err:T}),u(Ct(T,t)),c("error"))}),()=>{b=!0}},[e,l,P,a]);let y=Re(()=>vm(g,f),[g,f]);A(()=>{let b=f.trim();if(!b)return;let T=setTimeout(()=>a.emit("contentSearch",{queryLength:b.length,hitCount:y.length}),600);return()=>clearTimeout(T)},[f,y,a]);function C(){return f.trim().length>0?y.length===0?r(Ge,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${Mt}-help-card`,children:y.map(b=>r(Nc,{article:b,nav:o},b.id))}):s==="loading"?r(Ge,{message:t.helpLoading,strings:t}):s==="error"?r(Ge,{tone:"error",message:d,onRetry:()=>v(b=>b+1),strings:t}):g.length===0?r(Ge,{message:t.helpEmpty,strings:t}):hm(g).map(([b,T])=>r("section",{class:`${Mt}-help-group`,children:[b?r("h2",{class:`${Mt}-help-section-title`,children:b}):null,r("div",{class:`${Mt}-help-card`,children:T.map(H=>r(Nc,{article:H,nav:o},H.id))})]},b))}return r("div",{class:`${Mt}-module`,children:[r(Jo,{title:t.helpTitle,actions:r(Ze,{panelProps:i,variant:"plain"})}),r("div",{class:`${Mt}-module-pad`,children:r(Ic,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),r("div",{class:`${Mt}-help-list`,children:C()})]})}var Dc={Icon:Cn,Root:e=>r(bm,{...e})};var Oc=x.cssPrefix;function Ca({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${Oc}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${Oc}-home-card`,"data-testid":n,children:t})}var ce=x.cssPrefix,$c=q.scope("home");function ym(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ae(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 xm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function Pm(e){let{transport:t,strings:n,config:o,nav:a,bus:i,panelProps:l}=e,[s,c]=E(null),[d,u]=E([]),g=o.contentTags?.join(",");A(()=>{if(!o.showRecentConversations)return;let y=!1;return t.listConversations({limit:1}).then(C=>!y&&c(C.conversations?.[0]??null)).catch(C=>!y&&$c.warn("listConversations (home) failed",{err:C})),()=>{y=!0}},[t,o.showRecentConversations]),A(()=>{if(!o.contentTags?.length)return;let y=!1;return t.listContent({tags:o.contentTags,limit:6}).then(C=>{if(y)return;let b=C.items??[];u(b),i.emit("contentView",{section:"home",tags:g,count:b.length})}).catch(C=>!y&&$c.warn("listContent (home) failed",{err:C})),()=>{y=!0}},[t,g,i]);let _=ym(e),f=o.userAvatars??[],m=o.status,P=m?.text?Ae(n,m.text):n.homeStatus,v=o.contentBlockTitle?Ae(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${ce}-module ${ce}-home`,"data-testid":S.homeView,children:r("div",{class:`${ce}-home-scroll`,children:[r("div",{class:`${ce}-home-hero`,children:[r("div",{class:`${ce}-home-hero-top`,children:[o.brandName?r("span",{class:`${ce}-home-brand`,"data-testid":S.homeBrand,children:o.brandName}):r("span",{class:`${ce}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${ce}-home-hero-actions`,children:[f.length>0?r("div",{class:`${ce}-home-avatars`,children:f.map(y=>r("span",{class:`${ce}-home-avatar`,title:y.role?`${y.name} \xB7 ${y.role}`:y.name,children:y.avatar?r("img",{src:y.avatar,alt:"",loading:"lazy"}):r("span",{children:Ho(y.name)})},y.name))}):null,r(Ze,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(ie,{children:[r("h1",{class:`${ce}-home-greeting`,"data-testid":S.homeGreeting,children:_.title}),_.subtitle?r("p",{class:`${ce}-home-lead`,children:_.subtitle}):null]}):null]}),r("div",{class:`${ce}-home-cards`,children:[o.showSearchBar!==!1?r(Rc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}):null,s?r(Ca,{onClick:()=>a.selectConversation(s.conversationId),testid:S.homeRecent,children:r("div",{class:`${ce}-home-recent-row`,"data-unread":s.hasUnread?"true":void 0,children:[r("span",{class:`${ce}-home-recent-avatar`,"aria-hidden":"true",children:r(Tn,{})}),r("span",{class:`${ce}-home-recent-body`,children:[r("span",{class:`${ce}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${ce}-home-recent-preview`,children:s.preview}):null]}),s.hasUnread?r("span",{class:`${ce}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,m?r(Ca,{onClick:m.url?()=>a.push({kind:"iframe",url:m.url,title:P}):void 0,children:r("div",{class:`${ce}-home-status`,"data-level":m.level??"operational",children:[r("span",{class:`${ce}-home-status-icon`,"aria-hidden":"true",children:r(Sl,{})}),r("span",{class:`${ce}-home-status-text`,children:P})]})}):null,d.length>0?r("section",{class:`${ce}-home-content`,children:[r("div",{class:`${ce}-home-content-title`,children:v}),r("div",{class:`${ce}-home-content-list`,children:d.map(y=>r(Zo,{title:y.title,subtitle:y.description,onClick:()=>xm(a,y),testid:Pe(S.homeContentRow,y.id)},y.id))})]}):null]})]})})}var Fc={Icon:wl,Root:e=>r(Pm,{...e})};var ht=x.cssPrefix,km=q.scope("news");function Sm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=E("loading"),[d,u]=E(t.errorGeneric),[g,_]=E([]),[f,m]=E(0);A(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(y=>{if(v)return;let C=y.items??[];_(C),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:C.length})}).catch(y=>{v||(km.warn("listContent (news) failed",{err:y}),u(Ct(y,t)),c("error"))}),()=>{v=!0}},[e,l,f,a]);function P(){return s==="loading"?r(Ge,{message:t.newsLoading,strings:t}):s==="error"?r(Ge,{tone:"error",message:d,onRetry:()=>m(v=>v+1),strings:t}):g.length===0?r(Ge,{message:t.newsEmpty,strings:t}):r("div",{class:`${ht}-news-list`,children:g.map(v=>r("button",{type:"button",class:`${ht}-news-card`,onClick:()=>o.push({kind:"content",id:v.id,title:v.title}),"data-testid":Pe(S.newsItem,v.id),children:[v.image?r("img",{class:`${ht}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,r("span",{class:`${ht}-news-body`,children:[r("span",{class:`${ht}-news-title`,children:v.title}),v.description?r("span",{class:`${ht}-news-summary`,children:v.description}):null]})]},v.id))})}return r("div",{class:`${ht}-module`,children:[r(Jo,{title:t.newsTitle,actions:r(Ze,{panelProps:i,variant:"plain"})}),r("div",{class:`${ht}-module-scroll`,children:P()})]})}var Hc={Icon:Cl,Root:e=>r(Sm,{...e})};var er={chat:Ac,home:Fc,help:Dc,news:Hc};var Ln=x.cssPrefix;function Bc({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:a}){return r("nav",{class:`${Ln}-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:`${Ln}-tab`,onClick:()=>a(i.id),"data-testid":Pe(S.tab,i.id),children:[r("span",{class:`${Ln}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${Ln}-tab-badge`,"data-testid":S.tabBadge,"aria-label":"Unread"}):null]}),r("span",{class:`${Ln}-tab-label`,children:Ae(n,i.label)})]},i.id)})})}var zc=x.cssPrefix,wm="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function Uc({url:e,title:t,strings:n,onBack:o,actions:a}){return r("div",{class:`${zc}-module`,children:[r(Qo,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:a}),r("iframe",{class:`${zc}-content-frame`,src:e,title:t||"content",sandbox:wm,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Mn=x.cssPrefix,Cm=q.scope("content"),Tm=5e3;function qc({id:e,title:t,transport:n,strings:o,bus:a,onBack:i,actions:l}){let[s,c]=E(null),[d,u]=E(!1),[g,_]=E(0),f=$(()=>{u(!1),c(null),_(v=>v+1)},[]);A(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(y=>{if(v)return;let C=y.items[0];C?(c(C),a.emit("contentOpen",{contentId:e,tags:C.tags?.length?C.tags.join(","):void 0})):u(!0)}).catch(y=>{v||(Cm.warn("listContent (reader) failed",{err:y}),u(!0))}),()=>{v=!0}},[n,e,g,a]),A(()=>{if(!s)return;let v=setTimeout(()=>a.emit("contentRead",{contentId:e}),Tm);return()=>clearTimeout(v)},[s,e,a]);let m=$(v=>{let C=v.target?.closest?.("a")?.getAttribute("href")??"";C&&!C.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function P(){return d?r(Ge,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):s===null?r(Ge,{message:o.contentLoading,strings:o}):r("article",{class:`${Mn}-content`,"data-testid":S.contentView,onClick:m,children:[s.image?r("img",{class:`${Mn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Mn}-content-subtitle`,children:s.description}):null,r(rc,{text:s.content??""})]})}return r("div",{class:`${Mn}-module`,children:[r(Qo,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:S.backHeader}),r("div",{class:`${Mn}-module-scroll`,"data-testid":S.contentScroll,children:P()})]})}var tr=x.cssPrefix;function Wc({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=N(null),g=N(new Set);A(()=>{let D=u.current;if(!D)return;let B=Fo(D),w=K=>{K.key==="Escape"&&e.onClose?.()};return D.addEventListener("keydown",w),()=>{B(),D.removeEventListener("keydown",w)}},[e.onClose]);let _=N(null),f=$(D=>{_.current?.attachFromDrop(D)},[]),{visible:m}=zo({containerRef:u,onDrop:f});Oo(u.current,c.mode==="modal");let P=J(()=>n.sig.value).value,v=Tc(P),y=c.modules.byId[P.activeTab],C=v?.kind==="iframe"||v?.kind==="content",b=t.length>1&&(Ec(P)||!C),T=N(null);A(()=>{if(C&&T.current===null)T.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!C&&T.current!==null){let D=T.current;T.current=null,s(D)}},[C]);let H={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:D=>{let B=t.find(w=>w.layout===D);B&&n.switchTab(B.id)},selectConversation:i,startNewConversation:l},Z=D=>({options:c,transport:e.transport,strings:d,config:D,visitorId:e.visitorId,nav:H,bus:o,panelProps:e}),Y=r(Ze,{panelProps:e,variant:"plain"});y&&g.current.add(y.id);let oe=t.filter(D=>g.current.has(D.id)),G=D=>{if(D.layout==="chat")return r(Sa,{...e,containerEl:u.current,dragOver:m,composerAttachApiRef:_});let B=er[D.layout].Root;return B?r(B,{...Z(D)}):null},I=()=>v?.kind==="iframe"?r(Uc,{url:v.url,title:v.title,strings:d,onBack:n.pop,actions:Y}):v?.kind==="content"?r(qc,{id:v.id,title:v.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":S.messengerHome,children:[r("div",{class:`${tr}-messenger-body`,children:[oe.map(D=>r("div",{class:`${tr}-messenger-pane`,hidden:C||D.id!==y?.id,children:G(D)},D.id)),I()]}),b?r(Bc,{modules:t,activeTab:P.activeTab,strings:d,hasUnread:a,onSelect:n.switchTab}):null,r(wa,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(y?.layout==="chat"&&!v)?r(Do,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var Nn=x.cssPrefix;function Vc({strings:e,onClose:t}){return r("div",{class:`${Nn}-panel ${Nn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":S.modulesEmpty,children:[t?r("button",{type:"button",class:`${Nn}-icon-btn ${Nn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(Qe,{})}):null,r("p",{class:`${Nn}-modules-empty-text`,children:e.modulesEmpty})]})}function Gc({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[a,i]=E(()=>o?!1:t.loadCalloutDismissed(n));A(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=$(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:a,dismissCallout:l}}var V=q.scope("app"),nr=x.cssPrefix;function Kc(e,t){return Ks({...e,text:Ae(t,e.text)})}function Em(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 jc(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function Xc({options:e,hostElement:t,bus:n}){let[o]=E(()=>mt(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=E(()=>o.getVisitorId()),l=o.loadUserPrefs(),[s,c]=E(()=>l.locale??e.locale),[d,u]=E(()=>l.themeMode??e.themeMode),[g,_]=E(()=>l.textSize??e.textSize),f=yn(o.loadConversationId()),m=yn([]),P=yn(!1),[v,y]=E(!1),[C,b]=E([]);function T(){let p=e.modules.list,h=new Set(p.map(O=>O.id)),R=o.loadActiveModule();return R&&h.has(R)?R:p[0]?.id??""}function H(){return e.modules.list.find(p=>p.layout==="chat")?.id}let Z=N();if(!Z.current){let p=e.modules.list.map(h=>h.id);Z.current=wc(T(),p,h=>o.saveActiveModule(h))}let Y=Z.current,oe=N(void 0);oe.current=H();let[G,I]=E(!1),[D,B]=E(null),[w,K]=E(!1),te=e.mode==="standalone"||e.mode==="inline",he=N(xn(e,Yt(),o.loadPanelOpen(),o.loadPanelSize())),[_e,Me]=E(he.current.panelOpen),[ve,Ne]=E(he.current.panelOpen),ue=N(ve);ue.current=ve;let Ke=N(!1),Xe=N(void 0);A(()=>{_e&&Ne(!0)},[_e]);let vt=N(!1),[Nt,Dn]=E(!1),{dismissed:k,dismissCallout:U}=Gc({callout:e.launcher.callout,persistence:o}),ke=e.launcher.callout?.persistent??!0,Se=$(()=>{V.info("calloutDismiss"),n.emit("calloutDismiss",void 0),U()},[n,U]),[ae,$e]=E(he.current.panelSize),Ye=N(!1),[De,Dt]=E("chat"),[je,Ot]=E(!0),[we,On]=E(!1),[rd,Fa]=E(null),[sr,nn]=E([]),[Ha,$n]=E(null),[Fn,Hn]=E(null),Bn=N(e.strings),[ad,id]=E(void 0),[sd,ld]=E(void 0),[cd,dd]=E(()=>o.loadSidebarCollapsed()??!1),[lr,_d]=E({}),[j]=E(()=>new wo({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Ms({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[Ie]=E(()=>new Eo(m)),[se]=E(()=>new Io(e.sound,e.haptics)),Je=$(p=>{o.patchUserPrefs(p),j.saveUserPrefs(o.loadUserPrefs()).catch(h=>{V.warn("saveUserPrefs failed",{err:h})})},[o,j]);A(()=>{l.soundMuted!==void 0&&se.setMuted(l.soundMuted)},[]),A(()=>{t.dataset.theme=d},[t,d,e]),A(()=>{t.dataset.textSize=g},[t,g,e]),A(()=>{se.update(e.sound,e.haptics)},[se,e.sound,e.haptics]),A(()=>()=>se.destroy(),[se]),A(()=>{let p=!0;return se.mutedSig.subscribe(h=>{if(p){p=!1;return}Je({soundMuted:h})})},[se,Je]),A(()=>{Ye.current||!e.size.initialSize||(Ye.current=!0,!o.loadPanelSize()&&$e(Qr(e.mode,e.size,Yt())))},[e.mode,e.size,o]),A(()=>{if(!G||vt.current)return;vt.current=!0;let p=xn(e,Yt(),o.loadPanelOpen(),o.loadPanelSize());Me(p.panelOpen),$e(p.panelSize)},[G,e,o]);let Ba=N(!1),za=N(!1),on=N(null),cr=N(null),dr=N(!1);A(()=>{if(!(!G||Ba.current)){if(Ba.current=!0,za.current){let p=oe.current;p&&Y.switchTab(p);return}Y.reset(T())}},[G]);let zn=$(p=>{!p||p.length===0||(m.value=p.map(h=>Kc(h,Bn.current)))},[m]),_r=N(null),Un=$(async p=>{try{let{formSubmissions:h}=await(p?j.bootstrap(p):_r.current??j.bootstrap()),R=new Map;return h.forEach((O,W)=>R.set(O.formId,W)),h.filter((O,W)=>!O.skipped||R.get(O.formId)===W).map((O,W)=>({key:`wire:${O.formId}:${O.createdAt??W}`,formId:O.formId,outcome:O.skipped?"skipped":"submitted",createdAt:ko(O.createdAt),values:O.values}))}catch(h){return V.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:h}),[]}},[j]),rn=N(0),an=$((p,h)=>{let R=[...p.map(L=>L.createdAt),...h.map(L=>L.createdAt)].filter(L=>L!==void 0),O=(R.length?Math.min(...R):Date.now())-1;return[...(Xe.current?.messages??[]).map(L=>{let Te=Kc(L,Bn.current);return Te.createdAt=O,Te}),...p]},[]),ur=$(async p=>{let h=rn.current,R=()=>h!==rn.current;y(!0);try{let[O,W]=await Promise.all([j.loadConversation(p),Un()]);if(R())return;let L=na(O.messages??[]);b(W);let Te=on.current?[on.current]:[];L.length||Te.length?(m.value=[...an(L,W),...Te],Ot(O.canContinue??!0),nn(O.suggestions??[])):m.value=an([],W),j.resumeStatus==="needs-generation"&&cr.current?.()}catch(O){if(R())return;V.warn("loadThread failed; resetting conversationId",{err:O,conversationId:p}),f.value=void 0,o.saveConversationId(void 0)}finally{R()||y(!1)}},[j,Un,m,f,o,an]),sn=$(async({newConversation:p})=>{let h=++rn.current,R=()=>h!==rn.current,O=f.value,W=p||!O?qe():O;W!==O&&(f.value=W,o.saveConversationId(W));let L;try{L=await j.handshake({visitorId:a,conversationId:W,userPrefs:o.loadUserPrefs(),locale:s})}catch(Ue){if(R())return;n.emit("error",Ue),e.onError?.(Ue),p||I(!0);return}if(R())return;if(L.visitorId&&L.visitorId!==a&&(V.info("visitor rebound",{previous:a,current:L.visitorId,reason:L.rebind?.visitorId}),o.setVisitorId(L.visitorId),i(L.visitorId),n.emit("visitorRebound",{previous:a,current:L.visitorId,reason:L.rebind?.visitorId})),L.conversationId&&L.conversationId!==W&&(V.info("conversation rebound",{previous:W,current:L.conversationId,reason:L.rebind?.conversationId}),n.emit("conversationRebound",{previous:W,current:L.conversationId,reason:L.rebind?.conversationId})),L.agent&&Fa(L.agent),e.mode==="page"&&(L.site&&Is(L.site)?id(L.site):L.site&&V.warn("invalid site config, using fallback",{site:L.site}),L.blocks&&Ls(L.blocks)?ld(L.blocks):L.blocks&&V.warn("invalid blocks config, using fallback",{blocks:L.blocks})),L.userPrefs&&!p&&(o.saveUserPrefs(L.userPrefs),L.userPrefs.locale&&c(L.userPrefs.locale),L.userPrefs.soundMuted!==void 0&&se.setMuted(L.userPrefs.soundMuted),L.userPrefs.themeMode&&u(L.userPrefs.themeMode),L.userPrefs.textSize&&_(L.userPrefs.textSize)),Xe.current=L.welcome,p||n.emit("handshake",L),L.welcome?.suggestions){let Ue=Bn.current;nn(L.welcome.suggestions.map(ye=>({...ye,label:Ae(Ue,ye.label),...ye.text===void 0?{}:{text:Ae(Ue,ye.text)}})))}!p&&O&&L.conversationId===O?ue.current?ur(O):Ke.current=!0:(f.value=L.conversationId,o.saveConversationId(L.conversationId),zn(L.welcome?.messages)),p||I(!0)},[j,a,o,e,n,f,se,zn,ur,s]),ln=JSON.stringify(e.userContext??null),ud=JSON.stringify(e.pageContext??null),pd=JSON.stringify(lr);A(()=>{let p=Object.keys(lr).length?{...lr,...e.userContext}:e.userContext;j.setContext(p,Am(e.pageContext))},[j,ln,ud,pd]);let Fe=Bt(s,e.availableLocales,e.defaultLocale);A(()=>{j.setLocale(Fe)},[j,Fe]),A(()=>{t.dir=si(Fe)?"rtl":"ltr"},[t,Fe]),A(()=>{Fe!==s&&c(Fe)},[Fe,s]);let $t=N(null),Ua=$(p=>p.type!=="data-suggestions"?!1:($t.current=So(p.data),!0),[]),qa=$(()=>{$t.current&&(nn($t.current),$t.current=null)},[]),qn=$(p=>{if(p.type!=="data-conversation-rebind")return!1;let h=p.data?.conversationId;if(h&&h!==f.value){let R=f.value;f.value=h,o.saveConversationId(h),j.primeIdentity(void 0,h),V.info("conversation rebound (in-stream)",{previous:R,current:h}),R&&n.emit("conversationRebound",{previous:R,current:h,reason:h})}return!0},[f,o,j,n]),Wa=$(async p=>{let h=null;$t.current=null;try{for await(let R of p.iter)if(!(qn(R.chunk)||Ua(R.chunk))){if(!h){h=Pn(),on.current=h,Ie.attach(h),m.value=[...m.value,h],On(!0),$n(()=>p.cancel),Hn(()=>p.detach),za.current=!0;let O=oe.current;O&&Y.switchTab(O),V.info("resumed in-flight reply on mount")}Ie.apply(R.chunk),R.chunk.type==="finish"&&R.chunk.canContinue===!1&&Ot(!1)}h&&(h.status==="error"||it(h)?(h.status="error",h.errorText=e.strings.errorGeneric,se.play("error")):(h.status="complete",se.play("messageReceived"),Ta(n,e,"assistant",Co(h)),qa()))}catch(R){h&&(jc(R)?To(h)?m.value=m.value.filter(O=>O!==h):h.status="complete":(h.status="error",h.errorText=Ct(R,e.strings),se.play("error"))),V.debug("resume ended without completing",{err:R})}finally{on.current=null,h&&(Ie.detach(),On(!1),$n(null),Hn(null),m.value=[...m.value])}},[Ie,m,se,n,e,Y,qn]),Va=N(null),pr=$(async()=>{let p=j.resumeStream();Va.current=p,await Wa(p),j.resumeStatus==="needs-generation"&&cr.current?.()},[j,Wa]);A(()=>{let p=f.value;return p&&j.primeIdentity(a,p),sn({newConversation:!1}),()=>{rn.current++,Va.current?.cancel()}},[]),A(()=>{ve&&(_r.current=j.bootstrap(),(async()=>{try{let p=await _r.current;B(pn((p??{forms:[]}).forms,Fe))}catch(p){V.debug("bootstrap failed \u2014 treating as no forms",{err:p})}finally{K(!0)}})(),(async()=>{let p=[];if(Ke.current){Ke.current=!1;let h=f.value;h&&p.push(ur(h))}f.value&&p.push(pr()),p.length!==0&&await Promise.allSettled(p)})())},[ve]);let Wn=N(null);A(()=>{if(!ve)return;if(Wn.current===null){Wn.current=Fe;return}if(Wn.current===Fe)return;Wn.current=Fe;let p=!1;return j.bootstrap().then(h=>{p||B(pn((h??{forms:[]}).forms,Fe))}).catch(h=>V.debug("forms re-localize failed \u2014 keeping current copy",{err:h})),()=>{p=!0}},[ve,Fe,j]);let Ga=N(ln);A(()=>{!G||Ga.current===ln||(Ga.current=ln,sn({newConversation:!1}))},[ln,G,sn]),kt(()=>{uo(t,Po(e.mode,ae,_e))},[t,_e,ae,e.mode]),A(()=>{if(e.mode!=="modal"||!_e)return;let p=h=>{h.composedPath().some(W=>W instanceof HTMLElement&&W.classList.contains(`${x.cssPrefix}-panel`))||Me(!1)};return t.addEventListener("click",p),()=>t.removeEventListener("click",p)},[t,_e,e.mode]),A(()=>{if(e.mode!=="drawer"||!_e)return;let p=h=>{h.key==="Escape"&&Me(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[_e,e.mode]);let ct=$(async(p,{continueExisting:h})=>{let R=f.value??qe();f.value||(f.value=R,o.saveConversationId(R));let O=(h?m.value:m.value.slice(0,-1)).filter(Te=>!Te.ephemeral),W=Bs({messages:O.map(js),conversationId:R,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});On(!0),$t.current=null;let L=j.sendMessage(W);$n(()=>L.cancel),Hn(()=>L.detach);try{for await(let ye of L.iter)qn(ye.chunk)||Ua(ye.chunk)||(Ie.apply(ye.chunk),ye.chunk.type==="finish"&&ye.chunk.canContinue===!1&&Ot(!1));let Te=p.status==="error",Ue=it(p);if(Te||Ue){p.status="error",p.errorText=e.strings.errorGeneric,se.play("error");let ye=new Error(Te?"stream error chunk":"empty reply");n.emit("error",ye),e.onError?.(ye)}else p.status="complete",se.play("messageReceived"),Ta(n,e,"assistant",Co(p)),qa()}catch(Te){jc(Te)?To(p)?m.value=m.value.filter(Ue=>Ue!==p):p.status="complete":(p.status="error",p.errorText=Ct(Te,e.strings),se.play("error"),n.emit("error",Te),e.onError?.(Te))}finally{Ie.detach(),On(!1),$n(null),Hn(null),m.value=[...m.value]}},[j,Ie,m,f,e,n,se,o,a,qn]),Ka=$(()=>{if(we||dr.current||on.current||m.value.findLast(R=>!R.ephemeral)?.role!=="user")return;dr.current=!0,V.info("regenerating dangling user turn (needs-generation)");let h=Pn();m.value=[...m.value,h],Ie.attach(h),ct(h,{continueExisting:!1}).finally(()=>{dr.current=!1})},[we,m,Ie,ct]);A(()=>{cr.current=Ka},[Ka]);let Vn=$((p,h)=>{if(we)return;let R=m.value.at(-1),O=R?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===p);if(!R||!O){V.warn("decideTool: tool part not found",{toolCallId:p});return}h(O),R.partsSig.value=[...R.partsSig.value],Em(R)&&(R.status="streaming",m.value=[...m.value],Ie.attach(R),ct(R,{continueExisting:!0}))},[we,m,Ie,ct]),ja=$((p,h)=>{V.info("toolResult",{toolCallId:p}),n.emit("toolResult",{toolCallId:p}),Vn(p,R=>{R.outputSig.value=h,R.stateSig.value="output-available"})},[n,Vn]),Xa=$((p,h,R)=>{V.info("toolDecision",{toolCallId:p,approved:h}),n.emit("toolDecision",{toolCallId:p,approved:h}),Vn(p,O=>{let W=O.approvalSig.value?.id??p;O.approvalSig.value={id:W,approved:h,reason:R},O.stateSig.value="approval-responded"})},[n,Vn]),Ya=$(p=>{if(we)return;let h=m.value.at(-1),R=h?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===p);if(!h||!R)return;let O=R.approvalSig.value?.id??p;R.approvalSig.value={id:O},R.stateSig.value="approval-requested",h.partsSig.value=[...h.partsSig.value]},[we,m]),md=$((p,h)=>{V.info("messageFeedback",{messageId:p,value:h}),n.emit("messageFeedback",{messageId:p,value:h}),j.submitFeedback({messageId:p,value:h})},[n,j]),fd=Re(()=>({humanInLoop:e.features.humanInLoop,onResult:ja,onDecision:Xa,onEdit:Ya}),[e.features.humanInLoop,ja,Xa,Ya]),gd=()=>m.value.reduce((p,h)=>p+(h.role==="user"?1:0),0),Ft=e.forms.list.length>0?e.forms:D??e.forms,pe=yc({forms:Ft,persistence:o,userContext:()=>e.userContext,messageCount:gd,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>f.value,onComplete:(p,h,R,O)=>{V.info("formSubmit",{formId:p.id,trigger:h,skipped:O}),n.emit("formSubmit",{formId:p.id,values:R,skipped:O}),b(L=>{let Ue=L.find(ye=>ye.formId===p.id&&ye.outcome==="skipped")?.createdAt??Date.now();return[...L.filter(ye=>!(ye.formId===p.id&&ye.outcome==="skipped")),{key:`local:${p.id}:${Ue}`,formId:p.id,outcome:O?"skipped":"submitted",createdAt:Ue,...O?{}:{values:R}}]});let W=f.value??qe();f.value||(f.value=W,o.saveConversationId(W),j.primeIdentity(void 0,W)),!O&&p.mirrorToContext&&_d(L=>({...L,...R})),j.submitForm({formId:p.id,conversationId:W,trigger:h,values:R,skipped:O})}}),hd=J(()=>pe.activeForm.value);A(()=>{pe.refresh()},[Ft,pe]);let Ja=e.pageContext?.area?String(e.pageContext.area):void 0,vd=J(()=>m.value.length);A(()=>{G&&w&&pe.fire("pre-chat")},[G,w,pe]),A(()=>{w&&!je&&pe.fire("conversation-closed")},[w,je,pe]),A(()=>{G&&w&&Ja&&pe.fire("page-area")},[G,w,Ja,pe]);let mr=Re(()=>{let p=Ft.list.flatMap(h=>h.triggers).filter(h=>h.kind==="idle").map(h=>Number(h.param));return p.length?Math.min(...p)*1e3:0},[Ft]);A(()=>{if(!mr||!_e)return;let p=setTimeout(()=>pe.fire("idle"),mr);return()=>clearTimeout(p)},[mr,_e,pe,vd.value]);let Qa=$(async(p,h)=>{if(V.info("send",{textLen:p.length,attachments:h.length,streaming:we}),we)return;n.emit("send",{text:p,attachmentCount:h.length}),sr.length>0&&nn([]);let R=await Im(j,h,L=>{V.warn("upload failed",{err:L}),n.emit("error",L),e.onError?.(L)});se.unlock(),se.play("messageSent");let O=Gs(p,R),W=Pn();m.value=[...m.value,O,W],Ie.attach(W),Ta(n,e,"user",p),await ct(W,{continueExisting:!1}),pe.fire("after-messages")},[we,j,n,e,sr.length,m,Ie,ct,pe]),bd=$(()=>{V.info("stop"),n.emit("stop",void 0),Ha?.()},[Ha,n]),yd=$(()=>{if(we)return;let p=m.value,h=p.at(-1);if(!h||h.role!=="assistant"||h.status!=="error"&&!it(h))return;let R=Pn();m.value=[...p.slice(0,-1),R],Ie.attach(R),V.info("retry"),ct(R,{continueExisting:!1})},[we,m,Ie,ct]),xd=$(()=>{se.toggleMuted();let p=se.mutedSig.value;V.info("soundToggle",{muted:p}),n.emit("soundToggle",{muted:p})},[se,n]),cn=$(()=>{if(Hl(e.mode,ae)==="exit-fullscreen"){V.info("close \u2192 exit-fullscreen",{mode:e.mode}),$e("normal"),n.emit("fullscreen",!1);return}V.info("close \u2192 panel closed",{mode:e.mode}),pe.fire("panel-close"),Me(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,ae,pe]),dt=$(()=>{e.modules.list.some(p=>p.layout==="chat")&&j.listConversations({limit:50}).then(p=>{P.value=p.conversations.some(h=>h.hasUnread)}).catch(p=>V.debug("refreshUnread failed (non-fatal)",{err:p}))},[j,e.modules,P]),Za=N(!1);A(()=>{!ve||!G||Za.current||(Za.current=!0,dt())},[ve,G,dt]),A(()=>{if(!ve)return;let p=()=>{document.visibilityState==="visible"&&dt()};return document.addEventListener("visibilitychange",p),()=>document.removeEventListener("visibilitychange",p)},[ve,dt]);let fr=$(()=>{V.info("open",{mode:e.mode}),se.unlock(),Dn(!0),Me(!0),o.savePanelOpen(!0),!k&&!ke&&Se(),setTimeout(()=>Dn(!1),Rm),dt(),n.emit("open",void 0),e.onOpen?.()},[n,e,se,o,k,ke,Se,dt]),gr=$(()=>{if(!m.value.some(h=>h.role==="user")&&je&&f.value){V.info("clear \u2192 reusing empty conversation",{conversationId:f.value}),m.value.length===0&&zn(Xe.current?.messages);return}V.info("clear \u2192 new conversation",{wasStreaming:we}),n.emit("clear",void 0),we&&Fn?.(),Kt(()=>{m.value=[],f.value=void 0}),o.clearConversation(),Ot(!0),b([]),sn({newConversation:!0})},[we,Fn,m,f,o,sn,n,je,zn]),hr=$(()=>{gr(),Dt("chat");let p=e.modules.list.find(h=>h.layout==="chat")?.id;p&&Y.switchTab(p)},[gr,Y,e]),vr=$(()=>{let p=ae==="expanded"?"normal":"expanded";V.info("expand",{from:ae,expanded:p==="expanded"}),$e(p),o.savePanelSize(p),n.emit("expand",p==="expanded")},[n,ae,o]),br=$(()=>{let p=ae==="fullscreen"?"normal":"fullscreen";V.info("fullscreen",{from:ae,fullscreen:p==="fullscreen"}),$e(p),o.savePanelSize(p),n.emit("fullscreen",p==="fullscreen")},[n,ae,o]),Pd=$(()=>{Dt(p=>{let h=p==="history"?"chat":"history";return V.info("toggleHistory",{view:h}),n.emit("toggleHistory",{view:h}),h})},[n]),kd=$(p=>{V.info("localeChange",{locale:p}),c(p),Je({locale:p}),n.emit("localeChange",p)},[Je,n]),Sd=$(p=>{V.info("themeChange",{mode:p}),u(p),t.dataset.theme=p,Je({themeMode:p}),n.emit("themeChange",p)},[t,Je,n]),wd=$(p=>{V.info("textSizeChange",{size:p}),_(p),t.dataset.textSize=p,Je({textSize:p}),n.emit("textSizeChange",p)},[t,Je,n]),Cd=$(()=>{dd(p=>{let h=!p;return V.info("sidebarToggle",{collapsed:h}),o.saveSidebarCollapsed(h),n.emit("sidebarToggle",{collapsed:h}),h})},[o,n]),Td=$(p=>{V.info("resize",p),Je({widgetSize:p}),n.emit("resize",p)},[Je,n]),yr=$(async p=>{V.info("selectConversation",{conversationId:p,wasStreaming:we}),n.emit("selectConversation",{conversationId:p}),we&&Fn?.();try{let[h,R]=await Promise.all([j.loadConversation(p),Un(p)]),O=na(h.messages);Kt(()=>{m.value=an(O,R),f.value=h.conversationId}),b(R),o.saveConversationId(h.conversationId),j.primeIdentity(a,h.conversationId),h.agent&&Fa(h.agent),Ot(h.canContinue),nn(h.suggestions??[]),Dt("chat"),pr(),await j.markRead(p),dt()}catch(h){n.emit("error",h),e.onError?.(h)}},[j,m,f,n,e,o,dt,Un,an,we,Fn,a,pr]),Gn=N(null),ei=$(p=>{typeof p=="string"&&(w?pe.fire("manual",p):Gn.current=p)},[w,pe]);A(()=>{!w||!Gn.current||(pe.fire("manual",Gn.current),Gn.current=null)},[w,pe]),A(()=>ji(t,{open:fr,close:cn,expand:vr,fullscreen:br,openForm:ei}),[t,fr,cn,vr,br,ei]);let Oe=Re(()=>Mr(e,s,d,g),[e,s,d,g]);Bn.current=Oe.strings;let Ed=Re(()=>C.map(p=>{let h=Ft.list.find(R=>R.id===p.formId);return{...p,title:h?.title,form:h}}),[C,Ft]),ti={options:Oe,transport:j,feedback:se,bus:n,persistence:o,view:De,canSend:je,isStreaming:we,loadingMessages:v,messagesSig:m,agent:rd,suggestions:sr,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:cn,onClear:gr,onExpand:vr,onFullscreen:br,onSoundToggle:xd,onToggleHistory:Pd,onSelectHistoryConversation:yr,onNewConversation:hr,onLocaleChange:kd,onThemeChange:Sd,onTextSizeChange:wd,onWidgetSizeChange:Td,onSend:Qa,onStop:bd,onSuggestion:p=>{let h=p.text??p.label;V.info("suggestion",{text:h}),n.emit("suggestion",{text:h}),Qa(h,[])},activeForm:hd.value?.form??null,formMarkers:Ed,onFormSubmit:pe.complete,onFormSkip:pe.skip,onFormFill:p=>pe.fire("manual",p),tool:fd,onRetry:yd,onMessageFeedback:md},Ad=p=>{yr(p);let h=H();h&&Y.switchTab(h)};if(!G)return null;let dn=Oe.modules.list,xr=p=>{let h=En("close",Oe.mode,p);return dn.length===0?r(Vc,{strings:Oe.strings,onClose:h?cn:void 0}):dn.length===1&&dn[0]?.layout==="chat"?r(bc,{...ti,panelSize:p}):r(Wc,{panelProps:{...ti,panelSize:p,onClose:h?cn:void 0},enabledModules:dn,nav:Y,bus:n,hasUnread:P.value,onSelectConversation:Ad,onStartNewConversation:hr,onSetPanelSize:$e})};if(e.mode==="page"){let p=R=>{yr(R.conversationId)},h=dn.some(R=>R.layout==="chat");return r("div",{class:`${nr}-anchor`,children:r(kc,{site:ad,blocks:sd,transport:j,strings:Oe.strings,locale:Oe.locale,persistence:o,visitorId:a,showConversations:h,onSelectConversation:p,onNewConversation:hr,sidebarCollapsed:cd,onToggleSidebarCollapsed:Cd,children:xr("fullscreen")})})}if(te){let p=e.mode==="standalone"?"fullscreen":ae;return r("div",{class:`${nr}-anchor`,children:xr(p)})}let ni=e.mode==="drawer",oi=!(e.mode==="modal")&&!e.launcher.hidden&&(!_e||Nt),ri=oi&&!Nt&&!k&&!ni?Oe.launcher.callout:null;return r("div",{class:`${nr}-anchor`,"data-launcher-size":Oe.launcher.size,children:[_e||ve?r("div",{class:`${nr}-surface`,hidden:!_e,children:xr(ae)}):null,oi?r(Ol,{onToggle:fr,launcher:Oe.launcher,strings:Oe.strings,leaving:Nt,edgeTab:ni}):null,ri?r($l,{callout:ri,launcherPosition:Oe.position,strings:Oe.strings,closeLabel:Oe.strings.close,onDismiss:Se}):null]})}function Am(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 Ta(e,t,n,o){let a={role:n,text:o};e.emit("message",a),t.onMessage?.(a)}var Lm=q.scope("error-boundary"),or=class extends pt{constructor(){super(...arguments);X(this,"state",{crashed:!1})}componentDidCatch(n,o){Lm.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",Nm=60,Dm=2e3,Yc={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 Om(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function $m(){return location.origin+location.pathname}function Fm(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Jc(e,t){let n=Math.random(),o=0,a=0,i=new Set,l=(c,d)=>{let{tracking:u,publicKey:g,aiAgentDeploymentId:_,mode:f,themeMode:m}=t.getOptions();if(!u.enabled||Om()||n>=u.sampleRate)return;let P=performance.now();if(P-o>6e4&&(o=P,a=0),++a>Nm)return;let v=new URLSearchParams;v.set("v",Mm),v.set("_ev",qt),v.set("e",c),u.token&&v.set("tk",u.token),g&&v.set("pk",g),_&&v.set("dep",_),v.set("vid",t.getVisitorId());let y=t.getConversationId();y&&v.set("cid",y),v.set("url",$m());let C=Fm();C&&v.set("ref",C),v.set("sw",String(screen.width)),v.set("sh",String(screen.height)),v.set("vw",String(innerWidth)),v.set("vh",String(innerHeight)),v.set("dpr",String(devicePixelRatio)),v.set("lang",navigator.language);try{v.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(v.set("m",f),v.set("th",m),d)for(let[Z,Y]of Object.entries(d))Y!==void 0&&v.set(Z,String(Y));v.set("ts",String(Date.now()));let b=`${u.endpoint}?${v}`;if(b.length>Dm)return;let T=new Image(1,1);i.add(T);let H=()=>i.delete(T);T.addEventListener("load",H,{once:!0}),T.addEventListener("error",H,{once:!0}),T.src=b},s=Object.keys(Yc).map(c=>e.on(c,d=>l(c,Yc[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function rr(e){let{bus:t,host:n,appRoot:o,persistence:a,reportError:i}=e,l=e.initialRaw,s,c=_t(l),d=!0,u=()=>{c=_t(s?Nr(l,s):l)},g=()=>{os(n,Pt(c.mode));let m=a.loadUserPrefs().themeMode;rs(n,m?{...c,themeMode:m}:c),d&&(uo(n,Ea(c)),d=!1)},_=()=>{g(),Ut(_o(or,{onError:i},_o(Xc,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&a.rememberStorageVersion(m.config.storageVersion),s=m.config,u(),_())});let f=Jc(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:_,setUserOptions:m=>{l=m,u(),_()},patchUserOptions:m=>{l={...l,...m},u(),_()},destroy:()=>f()}}function Ea(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=mt(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=xn(e,Yt(),t.loadPanelOpen(),t.loadPanelSize());return Po(e.mode,o,n)}var Hm=q.scope("hooks"),Ra="*",Aa=new Set;function Ia(e,t,n){let o={widgetId:e,event:t,listener:n};return Aa.add(o),()=>{Aa.delete(o)}}function Bm(e,t,n){let o=[...Aa];for(let a of o)if(zm(a.widgetId,e.widgetId)&&!(a.event!==Ra&&a.event!==t))try{a.listener(e,t,n)}catch(i){Hm.warn("hook listener threw",{event:t,error:i})}}function Qc(e,t){let n=[];for(let o of Um)n.push(t.on(o,a=>{Bm(e,o,a)}));return()=>{for(let o of n)o()}}function La(e){if(Array.isArray(e))for(let t of e){let n=qm(t);n&&Ia(n.widgetId,n.event,n.listener)}}function zm(e,t){return e===Ra||e===t}var Um=["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"];function qm(e){let t,n,o;if(Array.isArray(e))[t,n,o]=e;else if(e&&typeof e=="object")({widgetId:t,event:n,listener:o}=e);else return null;return typeof t!="string"||typeof n!="string"||typeof o!="function"?null:{widgetId:t,event:n,listener:o}}var lt=new Map;function ar(e){e.debug!==void 0&&Jn(e.debug);let t=q.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=_t(e),o=n.widgetId,a=lt.get(o);a&&(t.debug("destroy existing instance at slot",{widgetId:o}),a.destroy());let i=Ea(n),l=n.iframe?ss({position:Pt(n.mode)},n.position,i,n.mode,e.target??null):Wt({position:Pt(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new Vt,c=mt(o,n.storage,n.aiAgentDeploymentId),d=P=>{s.emit("error",P),u.getOptions().onError?.(P)},u=rr({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});u.render();let g=l.hostElement,_=null,f=P=>{P.debug!==void 0&&Jn(P.debug),u.patchUserOptions(P)},m={widgetId:o,open:()=>fn(g,"open"),close:()=>fn(g,"close"),expand:()=>fn(g,"expand"),openForm:P=>fn(g,"openForm",P),on:(P,v)=>s.on(P,v),update:P=>{t.debug("update",{patch:P}),f(P)},setUserContext:P=>{t.debug("setUserContext",{keys:Object.keys(P)}),f({userContext:{...u.getUserOptions().userContext,...P}})},clearUserContext:()=>{t.debug("clearUserContext"),f({userContext:void 0})},setPageContext:P=>{t.debug("setPageContext",{keys:Object.keys(P)}),f({pageContext:{...u.getUserOptions().pageContext,...P}})},clearPageContext:()=>{t.debug("clearPageContext"),f({pageContext:void 0})},setDebug:P=>{Jn(P),t.info("debug level set",{level:_n()})},debugLevel:()=>_n(),onLog:P=>un(P),destroy:()=>{t.info("destroy",{widgetId:o}),_?.(),u.destroy(),s.clear(),Ut(null,l.appRoot),l.destroy(),lt.get(o)===m&<.delete(o)}};return _=Qc(m,s),lt.set(o,m),m}function ir(e){let t=e.widgetId??"default",n=lt.get(t);return n?(n.update(e),n):ar(e)}function Ma(e){if(e!==void 0){lt.get(e)?.destroy();return}let t=[...lt.values()];for(let n of t)n.destroy()}function tt(e="default"){return lt.get(e)??null}function Zc(){return[...lt.values()]}function Na(e,t,n){return Ia(e,t,n)}var ed=qt;var Da=class extends HTMLElement{constructor(){super(...arguments);X(this,"bus",new Vt);X(this,"mountResult",null);X(this,"runtime",null)}static get observedAttributes(){return Dr}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Ut(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=to(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let o=_t(n);this.mountResult||(this.mountResult=Wt({existingHost:this,position:Pt(o.mode)}));let a=mt(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=rr({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:a,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},td=!1;function Oa(){if(td||typeof customElements>"u")return;let e=x.tagName;customElements.get(e)||customElements.define(e,Da),td=!0}typeof customElements<"u"&&Oa();var nd=q.scope("iife"),$a={close:()=>tt()?.close(),destroy:()=>Ma(),expand:()=>tt()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Na(e,t,n):void 0,init:e=>ir(e),mount:e=>ar(e),on:(e,t)=>tt()?.on(e,t),onLog:e=>un(e),open:()=>tt()?.open(),setDebug:e=>tt()?.setDebug(e),update:e=>tt()?.update(e)};function od(e,...t){let n=$a[e];if(!n){nd.warn("unknown command",{command:e});return}return n(...t)}function Wm(){let e=((n,...o)=>od(n,...o));e.init=ir,e.mount=ar,e.destroy=Ma,e.getInstance=tt,e.getAllInstances=Zc,e.version=ed,e.hook=Na,e.debugLevel=()=>_n(),e.onLog=un;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys($a))t.has(n)||(e[n]=(...o)=>$a[n](...o));return e}function Vm(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[a,...i]=o;if(typeof a=="string")try{od(a,...i)}catch(l){nd.warn("queued command failed",{command:a,error:l})}}}function Gm(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)La([o]);return t(...n)},e}function Km(){let e=document.scripts;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.src.includes("elements"))return n}return null}function jm(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[x.global],t=Wm();globalThis[x.global]=t,Oa();let n=`${x.global}Hooks`,o=globalThis[n];if(La(o),globalThis[n]=Gm(),Vm(e),tt())return;let a=document.currentScript??Km(),i=Or(a?.dataset);if(!i.publicKey)return;let l=()=>{tt()||ir(i)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}jm();return Dd(Xm);})();
|
|
41
|
+
`).trim(),I=!b&&e.status!=="error"&&!m.value&&G.length>0,D=oe||I;return r("div",{class:`${Ee}-bubble-row`,"data-role":e.role,"data-mid":e.serverMessageId??e.id,"data-testid":Pe(S.messageBubble,e.id),children:r("div",{class:`${Ee}-bubble-col`,children:[r("div",{class:`${Ee}-bubble`,children:[T?r(Vp,{label:t.loading}):f.map((B,w)=>r(Bp,{part:B,active:H,strings:t,showReasoning:o,showToolCalls:a,showSources:i,interactive:l&&(B.kind!=="tool"||w>C.value),superseded:s,tool:c},qp(B))),Z&&r(Wp,{}),e.status==="error"&&e.errorText||m.value?r("div",{class:`${Ee}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${Ee}-error-retry`,onClick:d,"data-testid":S.messageRetry,children:t.errorRetry}):null]}):null]}),Y||D?r("div",{class:`${Ee}-bubble-meta`,children:[Y?r("time",{class:`${Ee}-bubble-time`,dateTime:Y.iso,title:Y.full,children:Y.short}):null,D?r("div",{class:`${Ee}-bubble-actions`,children:[oe&&e.serverMessageId?r(rc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:g}):null,I?r(Fp,{text:G,strings:t}):null]}):null]}):null]})})}function Fp({text:e,strings:t}){let[n,o]=E(!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:`${Ee}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:a,"data-testid":S.messageCopy,children:n?r(Tt,{}):r(Rl,{})})}function Hp(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 Bp({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(qo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(Up,{part:e,active:t,strings:n}):null;case"tool":return r(zp,{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(ac,{part:e,strings:n}):null}}function zp({part:e,strings:t,showToolCalls:n,interactive:o,superseded:a,tool:i}){let l=J(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(Xl(e.toolName))return r(cc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit});if(l.value)return r(ic,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(_c,{part:e,strings:t}):null}function Up({part:e,active:t,strings:n}){return r("details",{class:`${Ee}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Ee}-reasoning-summary`,children:r("span",{class:`${Ee}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Ee}-reasoning-body`,children:r(qo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function qp(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 Wp(){return r("span",{class:`${Ee}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function Vp({label:e}){return r("span",{class:`${Ee}-loading`,role:"status",children:[r("span",{class:`${Ee}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Ee}-loading-label`,children:e})]})}var Lt=x.cssPrefix,ka=120,Gp=350;function pc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,scrollFade:l,enableMessageFeedback:s,onFeedback:c,loading:d,idle:u,tool:g,onRetry:_,form:f,formMarkers:m,onFillForm:P}){let v=N(null),y=J(()=>e.value),[C,b]=E(!1),T=N(!1),H=N(!1),Z=N(!1),Y=N(0),oe=()=>Z.current||performance.now()-Y.current<Gp,G=N(0),I=k=>{if(!l)return;let U=k.scrollHeight-k.clientHeight>1;k.dataset.fadeTop=U&&k.scrollTop>1?"true":"false",k.dataset.fadeBottom=U&&k.scrollHeight-k.scrollTop-k.clientHeight>1?"true":"false"},D=k=>b(k.scrollHeight-k.scrollTop-k.clientHeight>ka*2),B=k=>{G.current=performance.now(),k.scrollTop=k.scrollHeight,I(k)},w=(k,U)=>{B(k);let ke=U,Se=0,ae=()=>{B(k),--ke>0&&(Se=requestAnimationFrame(ae))};return U>0&&(Se=requestAnimationFrame(ae)),()=>cancelAnimationFrame(Se)},K=(k,U)=>{let ke,Se,ae,$e=-1,Ye=()=>{ke.disconnect(),Se.disconnect(),clearTimeout(ae)},De=()=>{if(H.current||oe()||$e>=0&&k.scrollTop<$e-4)return Ye();B(k),$e=k.scrollTop};return ke=new ResizeObserver(De),Se=new MutationObserver(De),De(),ke.observe(k),Se.observe(k,{childList:!0,subtree:!0,characterData:!0}),ae=setTimeout(Ye,U),Ye},te=y.value[0]?.id;kt(()=>{let k=v.current;if(k&&y.value.length!==0&&(T.current=!0,!!y.value.some(U=>U.role==="user")))return K(k,300)},[te]);let he=N(0);R(()=>{let k=v.current,U=y.value,ke=he.current;if(he.current=U.length,!k||!T.current)return;if(U.slice(ke).some(ae=>ae.role==="user"))return H.current=!1,w(k,3);if(!U.some(ae=>ae.role==="user")||H.current||oe())return;k.scrollHeight-k.scrollTop-k.clientHeight<ka&&B(k)},[y.value.length]);let _e=N(null);R(()=>{let k=v.current,U=y.value.at(-1),ke=_e.current;if(_e.current=U?.id??null,!!k&&T.current&&!(!U||U.id!==ke||U.status!=="streaming"))return H.current=!1,w(k,3)},[y.value]),R(()=>{let k=v.current;if(!k)return;let U=y.value.at(-1);if(!U||U.status!=="streaming"&&!y.value.some(ae=>ae.role==="user"))return;let ke=()=>{if(H.current||oe())return;k.scrollHeight-k.scrollTop-k.clientHeight<ka*2&&B(k)};if(U.status!=="streaming")return K(k,300);ke();let Se=new MutationObserver(ke);return Se.observe(k,{childList:!0,subtree:!0,characterData:!0}),()=>Se.disconnect()},[y.value]);let Me=f?.form.id,ve=!!f&&(m??[]).some(k=>k.formId===f.form.id);kt(()=>{let k=v.current;!k||!Me||H.current||y.value.some(U=>U.role==="user")&&(ve?k.querySelector(`[data-testid="${S.formGate}"]`)?.scrollIntoView({block:"nearest"}):B(k))},[Me,ve]),R(()=>{let k=v.current;if(!k)return;let U=()=>{D(k),I(k),performance.now()-G.current>150&&(H.current=k.scrollHeight-k.scrollTop-k.clientHeight>8)},ke=()=>{H.current=!0},Se=je=>{je.deltaY<0&&ke()},ae=0,$e=je=>{ae=je.touches[0]?.clientY??0,Z.current=!0},Ye=je=>{(je.touches[0]?.clientY??0)>ae+4&&ke()},De=()=>{Z.current=!1,Y.current=performance.now()},Dt=()=>{Z.current=!0};return k.addEventListener("scroll",U,{passive:!0}),k.addEventListener("wheel",Se,{passive:!0}),k.addEventListener("touchstart",$e,{passive:!0}),k.addEventListener("touchmove",Ye,{passive:!0}),k.addEventListener("touchend",De,{passive:!0}),k.addEventListener("touchcancel",De,{passive:!0}),k.addEventListener("pointerdown",Dt,{passive:!0}),window.addEventListener("pointerup",De,{passive:!0}),window.addEventListener("pointercancel",De,{passive:!0}),D(k),()=>{k.removeEventListener("scroll",U),k.removeEventListener("wheel",Se),k.removeEventListener("touchstart",$e),k.removeEventListener("touchmove",Ye),k.removeEventListener("touchend",De),k.removeEventListener("touchcancel",De),k.removeEventListener("pointerdown",Dt),window.removeEventListener("pointerup",De),window.removeEventListener("pointercancel",De)}},[]);let Ne=()=>{let k=v.current;k&&(H.current=!1,B(k))},ue=[],Ke="",Xe=y.value.at(-1)?.id,vt=[...m??[]].toSorted((k,U)=>(k.createdAt??1/0)-(U.createdAt??1/0)),Nt=k=>f&&k.formId===f.form.id?r(_a,{form:f.form,strings:t,onSubmit:f.onSubmit,onSkip:f.onSkip},`gate:${k.formId}`):r(jl,{marker:k,strings:t,onFill:!f&&P?()=>P(k.formId):void 0},k.key),Dn=k=>{for(let U=vt[0];U?.createdAt!==void 0&&!(k!==void 0&&U.createdAt>k);U=vt[0])vt.shift(),ue.push(Nt(U))};for(let k of y.value){if(k.role==="assistant"&&k.id!==Xe&&it(k))continue;Dn(k.createdAt);let U=Kp(k.createdAt);U&&U!==Ke&&(ue.push(r("div",{class:`${Lt}-date-divider`,children:r("span",{class:`${Lt}-date-pill`,title:jp(k.createdAt),children:Xp(k.createdAt,t)})},`day:${U}`)),Ke=U),ue.push(r(uc,{message:k,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:!!u&&k.id===Xe,superseded:k.id!==Xe,tool:g,onRetry:u&&k.id===Xe?_:void 0,enableMessageFeedback:s,onFeedback:c},k.id))}for(let k of vt)ue.push(Nt(k));return r("div",{class:`${Lt}-list-wrap`,children:[r("div",{ref:v,class:`${Lt}-list${l?` ${Lt}-list--fade`:""}`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[d&&y.value.length===0?r("div",{class:`${Lt}-list-loading`,role:"status",children:t.conversationLoading}):null,ue,f&&!ve?r(_a,{form:f.form,strings:t,onSubmit:f.onSubmit,onSkip:f.onSkip}):null]}),C?r("button",{type:"button",class:`${Lt}-jump`,onClick:Ne,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":S.scrollToBottom,children:r(Et,{})}):null]})}function Kp(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function jp(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Xp(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 Yp=["today","yesterday","lastWeek","older"];function Jp(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((mc(e)-mc(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function fc(e,t){let n=new Map;for(let o of t){let a=Jp(e,o.lastMessageAt),i=n.get(a);i?i.push(o):n.set(a,[o])}return Yp.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function mc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Qp=q.scope("history"),Zp=3,em=6,tm={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function nm(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 Xo({transport:e,strings:t,locale:n,persistence:o,visitorId:a,onSelect:i,onNewConversation:l}){let s=x.cssPrefix,c=e.peekConversations({visitorId:a}),[d,u]=E(c?"loaded":"loading"),[g,_]=E(c?.conversations??[]);R(()=>{let v=!1;return e.listConversations({visitorId:a}).then(y=>{if(v)return;let C=y.conversations??[];_(C),u("loaded"),o.saveHistoryCount(C.length)}).catch(y=>{v||(Qp.warn("listConversations failed",{err:y}),u("error"))}),()=>{v=!0}},[e,a,o]);let f=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":S.sidebarNewConversation,children:[r(nl,{}),t.newConversation]})}):null;if(d==="loading"){let v=Math.min(o.loadHistoryCount()??Zp,em);return r(ie,{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,v)},(y,C)=>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`})})})]})]},C))})]})}),f]})}if(d==="error"||g.length===0)return r(ie,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let m=Date.now(),P=fc(m,g);return r(ie,{children:[r("div",{class:`${s}-history`,role:"list",children:P.map(v=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[tm[v.bucket]]}),r("div",{class:`${s}-history-card`,children:v.conversations.map(y=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(y),"data-closed":y.canContinue?void 0:"true","data-unread":y.hasUnread?"true":void 0,"data-testid":Pe(S.historyItem,y.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(ra,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:y.title}),r("span",{class:`${s}-history-time`,children:nm(y.lastMessageAt,m,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:y.preview??(y.canContinue?t.historyContinue:t.conversationClosed)}),y.hasUnread?r("span",{class:`${s}-history-dot`}):null]})]})]},y.conversationId))})]},v.bucket))}),f]})}var gc=x.cssPrefix;function hc({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${gc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${gc}-suggestion`,onClick:()=>t(n),"data-testid":Pe(S.suggestion,o),children:n.label},n.id))})}var Le=x.cssPrefix;function vc(e){let{options:t,onClose:n}=e,o=t.strings,a=N(null);R(()=>{let c=a.current;if(!c)return;let d=$o(c),u=g=>{g.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let i=N(null),l=$(c=>{i.current?.attachFromDrop(c)},[]),{visible:s}=Bo({containerRef:a,onDrop:l});return Do(a.current,t.mode==="modal"),r("div",{ref:a,class:`${Le}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":S.panel,children:[r(Sa,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),r(wa,{poweredBy:e.options.poweredBy})]})}function Sa(e){let{options:t,transport:n,feedback:o,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,loadingMessages:u,messagesSig:g,agent:_,suggestions:f,initialWidgetSize:m,visitorId:P,onClose:v,onBack:y,onClear:C,onToggleHistory:b,onSelectHistoryConversation:T,onNewConversation:H,onWidgetSizeChange:Z,onSend:Y,onStop:oe,onSuggestion:G,activeForm:I,formMarkers:D,onFormSubmit:B,onFormSkip:w,onFormFill:K,tool:te,onRetry:he,onMessageFeedback:_e,containerEl:Me,dragOver:ve,composerAttachApiRef:Ne}=e,ue=t.strings,Ke;return I?Ke=null:c?Ke=r(ie,{children:[r(hc,{suggestions:f,onPick:G}),r(Ul,{options:t,transport:n,feedback:o,bus:a,isStreaming:d,onSend:Y,onStop:oe,attachApiRef:Ne})]}):Ke=r(rm,{label:ue.conversationClosed,ctaLabel:ue.startNewConversation,onNewConversation:C}),r(ie,{children:[s==="history"?r(om,{strings:ue,onBack:b,onClose:v,showClose:Oo(t.mode,l,t.actions)}):r("header",{class:`${Le}-header`,"data-testid":S.panelHeader,children:[y?r("button",{type:"button",class:`${Le}-icon-btn`,onClick:y,"aria-label":ue.moduleBack,title:ue.moduleBack,children:r(wn,{})}):null,_?r(Hl,{agent:_,strings:ue}):r("h1",{children:ue.panelTitle}),r(Ze,{panelProps:e,variant:"chat"})]}),s==="history"?r(Xo,{transport:n,strings:ue,locale:t.locale,persistence:i,visitorId:P,onSelect:Xe=>T(Xe.conversationId),onNewConversation:H}):r(ie,{children:[r(ql,{visible:ve,strings:ue}),r(pc,{messagesSig:g,strings:ue,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,scrollFade:t.scrollFade,enableMessageFeedback:t.enableMessageFeedback,onFeedback:_e,loading:u,idle:!d,tool:te,onRetry:he,form:I?{form:I,onSubmit:B,onSkip:w}:null,formMarkers:D,onFillForm:K}),Ke,r(am,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(No,{panelEl:Me,resize:t.size.resize,position:t.position,initialSize:m,onSizeChange:Z,strings:ue}):null]})}function om({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Le}-header`,children:[r("button",{type:"button",class:`${Le}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(wn,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Le}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(Qe,{})}):null]})}function rm({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Le}-readonly-banner`,role:"note",children:[r("span",{class:`${Le}-readonly-label`,children:e}),r("button",{type:"button",class:`${Le}-readonly-cta`,onClick:n,children:t})]})}function am({disclaimer:e}){return e?r("div",{class:`${Le}-composer-footer`,children:r("div",{class:`${Le}-disclaimer`,children:e})}):null}function wa({poweredBy:e}){return e?r("div",{class:`${Le}-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(ie,{children:[e?r("img",{class:`${Le}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Le}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Le}-poweredby`,children:o})}function bc(e){let t=N(e);t.current=e;let n=N(null);return n.current??(n.current=sm(t)),n.current}function sm(e){let t=z(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 g=u.forms.list.find(_=>_.id===d);g&&(t.value={form:g,trigger:"manual"});return}for(let g of u.forms.byTrigger[c]??[]){let _=g.triggers.find(f=>f.kind===c);if(!(!_||!lm(_,u)||a(g)||!cm(g,u))){t.value={form:g,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:g,trigger:_}=u;g.frequency==="conversation"?n.add(o(g.id)):g.frequency!=="always"&&e.current.persistence.saveFormDone(g.id),e.current.onComplete(g,_,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 yc(e){let t=x.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":S.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":S.sidebarToggle,children:r(_m,{collapsed:i})})]}),i?null:r(ie,{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(Xo,{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=x.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??x.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=x.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=x.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 xc=x.cssPrefix;function Pc(e){return r("main",{class:`${xc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(yc,{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:`${xc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var kc=e=>Object.fromEntries(e.map(t=>[t,[]]));function Sc(e,t,n){let o=z({activeTab:e,stacks:kc(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:kc(t)}}}}var wc=e=>e.stacks[e.activeTab]??[],Cc=e=>wc(e).at(-1),Tc=e=>wc(e).length===0;var Ec={Icon:Tn};var gt=x.cssPrefix;function Yo({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 Jo({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(wn,{})}),r("h1",{class:`${gt}-back-title`,children:e}),o??r("span",{class:`${gt}-back-spacer`,"aria-hidden":"true"})]})}var tn=x.cssPrefix;function Rc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${tn}-home-search`,onClick:t,"data-testid":S.homeSearch,children:[r("span",{class:`${tn}-home-search-text`,children:e}),r("span",{class:`${tn}-home-search-icon`,"aria-hidden":"true",children:r(aa,{})})]})}function Ac({placeholder:e,value:t,onInput:n}){return r("div",{class:`${tn}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${tn}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":S.helpSearch}),r("span",{class:`${tn}-home-search-icon`,"aria-hidden":"true",children:r(aa,{})})]})}var In=x.cssPrefix;function Qo({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${In}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${In}-list-row-body`,children:[r("span",{class:`${In}-list-row-title`,children:e}),t?r("span",{class:`${In}-list-row-sub`,children:t}):null]}),r("span",{class:`${In}-list-row-chevron`,"aria-hidden":"true",children:r(Jt,{})})]})}var Ic=x.cssPrefix;function Ge({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 Mt=x.cssPrefix,mm=q.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 Lc(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(Lc(n,o.title)*2,Lc(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,a)=>a.score-o.score).map(o=>o.item):[]}function Mc({article:e,nav:t}){return r(Qo,{title:e.title,subtitle:e.description,onClick:()=>fm(t,e),testid:Pe(S.helpArticle,e.id)})}function vm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=E("loading"),[d,u]=E(t.errorGeneric),[g,_]=E([]),[f,m]=E(""),[P,v]=E(0);R(()=>{let b=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(T=>{if(b)return;let H=T.items??[];_(H),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:H.length})}).catch(T=>{b||(mm.warn("listContent (help) failed",{err:T}),u(Ct(T,t)),c("error"))}),()=>{b=!0}},[e,l,P,a]);let y=Ae(()=>hm(g,f),[g,f]);R(()=>{let b=f.trim();if(!b)return;let T=setTimeout(()=>a.emit("contentSearch",{queryLength:b.length,hitCount:y.length}),600);return()=>clearTimeout(T)},[f,y,a]);function C(){return f.trim().length>0?y.length===0?r(Ge,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${Mt}-help-card`,children:y.map(b=>r(Mc,{article:b,nav:o},b.id))}):s==="loading"?r(Ge,{message:t.helpLoading,strings:t}):s==="error"?r(Ge,{tone:"error",message:d,onRetry:()=>v(b=>b+1),strings:t}):g.length===0?r(Ge,{message:t.helpEmpty,strings:t}):gm(g).map(([b,T])=>r("section",{class:`${Mt}-help-group`,children:[b?r("h2",{class:`${Mt}-help-section-title`,children:b}):null,r("div",{class:`${Mt}-help-card`,children:T.map(H=>r(Mc,{article:H,nav:o},H.id))})]},b))}return r("div",{class:`${Mt}-module`,children:[r(Yo,{title:t.helpTitle,actions:r(Ze,{panelProps:i,variant:"plain"})}),r("div",{class:`${Mt}-module-pad`,children:r(Ac,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),r("div",{class:`${Mt}-help-list`,children:C()})]})}var Nc={Icon:Cn,Root:e=>r(vm,{...e})};var Dc=x.cssPrefix;function Ca({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 ce=x.cssPrefix,Oc=q.scope("home");function bm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Re(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 xm(e){let{transport:t,strings:n,config:o,nav:a,bus:i,panelProps:l}=e,[s,c]=E(null),[d,u]=E([]),g=o.contentTags?.join(",");R(()=>{if(o.hideRecentConversations)return;let y=!1;return t.listConversations({limit:1}).then(C=>!y&&c(C.conversations?.[0]??null)).catch(C=>!y&&Oc.warn("listConversations (home) failed",{err:C})),()=>{y=!0}},[t,o.hideRecentConversations]),R(()=>{if(!o.contentTags?.length)return;let y=!1;return t.listContent({tags:o.contentTags,limit:6}).then(C=>{if(y)return;let b=C.items??[];u(b),i.emit("contentView",{section:"home",tags:g,count:b.length})}).catch(C=>!y&&Oc.warn("listContent (home) failed",{err:C})),()=>{y=!0}},[t,g,i]);let _=bm(e),f=o.userAvatars??[],m=o.status,P=m?.text?Re(n,m.text):n.homeStatus,v=o.contentBlockTitle?Re(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${ce}-module ${ce}-home`,"data-testid":S.homeView,children:r("div",{class:`${ce}-home-scroll`,children:[r("div",{class:`${ce}-home-hero`,children:[r("div",{class:`${ce}-home-hero-top`,children:[o.brandName?r("span",{class:`${ce}-home-brand`,"data-testid":S.homeBrand,children:o.brandName}):r("span",{class:`${ce}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${ce}-home-hero-actions`,children:[f.length>0?r("div",{class:`${ce}-home-avatars`,children:f.map(y=>r("span",{class:`${ce}-home-avatar`,title:y.role?`${y.name} \xB7 ${y.role}`:y.name,children:y.avatar?r("img",{src:y.avatar,alt:"",loading:"lazy"}):r("span",{children:Fo(y.name)})},y.name))}):null,r(Ze,{panelProps:l,variant:"plain"})]})]}),o.hideGreeting?null:r(ie,{children:[r("h1",{class:`${ce}-home-greeting`,"data-testid":S.homeGreeting,children:_.title}),_.subtitle?r("p",{class:`${ce}-home-lead`,children:_.subtitle}):null]})]}),r("div",{class:`${ce}-home-cards`,children:[o.hideSearchBar?null:r(Rc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}),s?r(Ca,{onClick:()=>a.selectConversation(s.conversationId),testid:S.homeRecent,children:r("div",{class:`${ce}-home-recent-row`,"data-unread":s.hasUnread?"true":void 0,children:[r("span",{class:`${ce}-home-recent-avatar`,"aria-hidden":"true",children:r(Tn,{})}),r("span",{class:`${ce}-home-recent-body`,children:[r("span",{class:`${ce}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${ce}-home-recent-preview`,children:s.preview}):null]}),s.hasUnread?r("span",{class:`${ce}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,m?r(Ca,{onClick:m.url?()=>a.push({kind:"iframe",url:m.url,title:P}):void 0,children:r("div",{class:`${ce}-home-status`,"data-level":m.level??"operational",children:[r("span",{class:`${ce}-home-status-icon`,"aria-hidden":"true",children:r(kl,{})}),r("span",{class:`${ce}-home-status-text`,children:P})]})}):null,d.length>0?r("section",{class:`${ce}-home-content`,children:[r("div",{class:`${ce}-home-content-title`,children:v}),r("div",{class:`${ce}-home-content-list`,children:d.map(y=>r(Qo,{title:y.title,subtitle:y.description,onClick:()=>ym(a,y),testid:Pe(S.homeContentRow,y.id)},y.id))})]}):null]})]})})}var $c={Icon:Sl,Root:e=>r(xm,{...e})};var ht=x.cssPrefix,Pm=q.scope("news");function km({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=E("loading"),[d,u]=E(t.errorGeneric),[g,_]=E([]),[f,m]=E(0);R(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(y=>{if(v)return;let C=y.items??[];_(C),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:C.length})}).catch(y=>{v||(Pm.warn("listContent (news) failed",{err:y}),u(Ct(y,t)),c("error"))}),()=>{v=!0}},[e,l,f,a]);function P(){return s==="loading"?r(Ge,{message:t.newsLoading,strings:t}):s==="error"?r(Ge,{tone:"error",message:d,onRetry:()=>m(v=>v+1),strings:t}):g.length===0?r(Ge,{message:t.newsEmpty,strings:t}):r("div",{class:`${ht}-news-list`,children:g.map(v=>r("button",{type:"button",class:`${ht}-news-card`,onClick:()=>o.push({kind:"content",id:v.id,title:v.title}),"data-testid":Pe(S.newsItem,v.id),children:[v.image?r("img",{class:`${ht}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,r("span",{class:`${ht}-news-body`,children:[r("span",{class:`${ht}-news-title`,children:v.title}),v.description?r("span",{class:`${ht}-news-summary`,children:v.description}):null]})]},v.id))})}return r("div",{class:`${ht}-module`,children:[r(Yo,{title:t.newsTitle,actions:r(Ze,{panelProps:i,variant:"plain"})}),r("div",{class:`${ht}-module-scroll`,children:P()})]})}var Fc={Icon:wl,Root:e=>r(km,{...e})};var Zo={chat:Ec,home:$c,help:Nc,news:Fc};var Ln=x.cssPrefix;function Hc({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:a}){return r("nav",{class:`${Ln}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=Zo[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&o;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${Ln}-tab`,onClick:()=>a(i.id),"data-testid":Pe(S.tab,i.id),children:[r("span",{class:`${Ln}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${Ln}-tab-badge`,"data-testid":S.tabBadge,"aria-label":"Unread"}):null]}),r("span",{class:`${Ln}-tab-label`,children:Re(n,i.label)})]},i.id)})})}var Bc=x.cssPrefix,Sm="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function zc({url:e,title:t,strings:n,onBack:o,actions:a}){return r("div",{class:`${Bc}-module`,children:[r(Jo,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:a}),r("iframe",{class:`${Bc}-content-frame`,src:e,title:t||"content",sandbox:Sm,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Mn=x.cssPrefix,wm=q.scope("content"),Cm=5e3;function Uc({id:e,title:t,transport:n,strings:o,bus:a,onBack:i,actions:l}){let[s,c]=E(null),[d,u]=E(!1),[g,_]=E(0),f=$(()=>{u(!1),c(null),_(v=>v+1)},[]);R(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(y=>{if(v)return;let C=y.items[0];C?(c(C),a.emit("contentOpen",{contentId:e,tags:C.tags?.length?C.tags.join(","):void 0})):u(!0)}).catch(y=>{v||(wm.warn("listContent (reader) failed",{err:y}),u(!0))}),()=>{v=!0}},[n,e,g,a]),R(()=>{if(!s)return;let v=setTimeout(()=>a.emit("contentRead",{contentId:e}),Cm);return()=>clearTimeout(v)},[s,e,a]);let m=$(v=>{let C=v.target?.closest?.("a")?.getAttribute("href")??"";C&&!C.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function P(){return d?r(Ge,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):s===null?r(Ge,{message:o.contentLoading,strings:o}):r("article",{class:`${Mn}-content`,"data-testid":S.contentView,onClick:m,children:[s.image?r("img",{class:`${Mn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Mn}-content-subtitle`,children:s.description}):null,r(oc,{text:s.content??""})]})}return r("div",{class:`${Mn}-module`,children:[r(Jo,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:S.backHeader}),r("div",{class:`${Mn}-module-scroll`,"data-testid":S.contentScroll,children:P()})]})}var er=x.cssPrefix;function qc({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=N(null),g=N(new Set);R(()=>{let D=u.current;if(!D)return;let B=$o(D),w=K=>{K.key==="Escape"&&e.onClose?.()};return D.addEventListener("keydown",w),()=>{B(),D.removeEventListener("keydown",w)}},[e.onClose]);let _=N(null),f=$(D=>{_.current?.attachFromDrop(D)},[]),{visible:m}=Bo({containerRef:u,onDrop:f});Do(u.current,c.mode==="modal");let P=J(()=>n.sig.value).value,v=Cc(P),y=c.modules.byId[P.activeTab],C=v?.kind==="iframe"||v?.kind==="content",b=t.length>1&&(Tc(P)||!C),T=N(null);R(()=>{if(C&&T.current===null)T.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!C&&T.current!==null){let D=T.current;T.current=null,s(D)}},[C]);let H={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:D=>{let B=t.find(w=>w.layout===D);B&&n.switchTab(B.id)},selectConversation:i,startNewConversation:l},Z=D=>({options:c,transport:e.transport,strings:d,config:D,visitorId:e.visitorId,nav:H,bus:o,panelProps:e}),Y=r(Ze,{panelProps:e,variant:"plain"});y&&g.current.add(y.id);let oe=t.filter(D=>g.current.has(D.id)),G=D=>{if(D.layout==="chat")return r(Sa,{...e,containerEl:u.current,dragOver:m,composerAttachApiRef:_});let B=Zo[D.layout].Root;return B?r(B,{...Z(D)}):null},I=()=>v?.kind==="iframe"?r(zc,{url:v.url,title:v.title,strings:d,onBack:n.pop,actions:Y}):v?.kind==="content"?r(Uc,{id:v.id,title:v.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:Y}):null;return r("div",{ref:u,class:`${er}-panel ${er}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":S.messengerHome,children:[r("div",{class:`${er}-messenger-body`,children:[oe.map(D=>r("div",{class:`${er}-messenger-pane`,hidden:C||D.id!==y?.id,children:G(D)},D.id)),I()]}),b?r(Hc,{modules:t,activeTab:P.activeTab,strings:d,hasUnread:a,onSelect:n.switchTab}):null,r(wa,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(y?.layout==="chat"&&!v)?r(No,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var Nn=x.cssPrefix;function Wc({strings:e,onClose:t}){return r("div",{class:`${Nn}-panel ${Nn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":S.modulesEmpty,children:[t?r("button",{type:"button",class:`${Nn}-icon-btn ${Nn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(Qe,{})}):null,r("p",{class:`${Nn}-modules-empty-text`,children:e.modulesEmpty})]})}function Vc({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[a,i]=E(()=>o?!1:t.loadCalloutDismissed(n));R(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=$(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:a,dismissCallout:l}}var V=q.scope("app"),tr=x.cssPrefix;function Gc(e,t){return Gs({...e,text:Re(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 Kc(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function jc({options:e,hostElement:t,bus:n}){let[o]=E(()=>mt(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=E(()=>o.getVisitorId()),l=o.loadUserPrefs(),[s,c]=E(()=>l.locale??e.locale),[d,u]=E(()=>l.themeMode??e.themeMode),[g,_]=E(()=>l.textSize??e.textSize),f=yn(o.loadConversationId()),m=yn([]),P=yn(!1),[v,y]=E(!1),[C,b]=E([]);function T(){let p=e.modules.list,h=new Set(p.map(O=>O.id)),A=o.loadActiveModule();return A&&h.has(A)?A:p[0]?.id??""}function H(){return e.modules.list.find(p=>p.layout==="chat")?.id}let Z=N();if(!Z.current){let p=e.modules.list.map(h=>h.id);Z.current=Sc(T(),p,h=>o.saveActiveModule(h))}let Y=Z.current,oe=N(void 0);oe.current=H();let[G,I]=E(!1),[D,B]=E(null),[w,K]=E(!1),te=e.mode==="standalone"||e.mode==="inline",he=N(xn(e,Yt(),o.loadPanelOpen(),o.loadPanelSize())),[_e,Me]=E(he.current.panelOpen),[ve,Ne]=E(he.current.panelOpen),ue=N(ve);ue.current=ve;let Ke=N(!1),Xe=N(void 0);R(()=>{_e&&Ne(!0)},[_e]);let vt=N(!1),[Nt,Dn]=E(!1),{dismissed:k,dismissCallout:U}=Vc({callout:e.launcher.callout,persistence:o}),ke=e.launcher.callout?.persistent??!0,Se=$(()=>{V.info("calloutDismiss"),n.emit("calloutDismiss",void 0),U()},[n,U]),[ae,$e]=E(he.current.panelSize),Ye=N(!1),[De,Dt]=E("chat"),[je,Ot]=E(!0),[we,On]=E(!1),[od,Fa]=E(null),[ir,nn]=E([]),[Ha,$n]=E(null),[Fn,Hn]=E(null),Bn=N(e.strings),[rd,ad]=E(void 0),[id,sd]=E(void 0),[ld,cd]=E(()=>o.loadSidebarCollapsed()??!1),[sr,dd]=E({}),[j]=E(()=>new So({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Ls({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[Ie]=E(()=>new To(m)),[se]=E(()=>new Ao(e.sound,e.haptics)),Je=$(p=>{o.patchUserPrefs(p),j.saveUserPrefs(o.loadUserPrefs()).catch(h=>{V.warn("saveUserPrefs failed",{err:h})})},[o,j]);R(()=>{l.soundMuted!==void 0&&se.setMuted(l.soundMuted)},[]),R(()=>{t.dataset.theme=d},[t,d,e]),R(()=>{t.dataset.textSize=g},[t,g,e]),R(()=>{se.update(e.sound,e.haptics)},[se,e.sound,e.haptics]),R(()=>()=>se.destroy(),[se]),R(()=>{let p=!0;return se.mutedSig.subscribe(h=>{if(p){p=!1;return}Je({soundMuted:h})})},[se,Je]),R(()=>{Ye.current||!e.size.initialSize||(Ye.current=!0,!o.loadPanelSize()&&$e(Qr(e.mode,e.size,Yt())))},[e.mode,e.size,o]),R(()=>{if(!G||vt.current)return;vt.current=!0;let p=xn(e,Yt(),o.loadPanelOpen(),o.loadPanelSize());Me(p.panelOpen),$e(p.panelSize)},[G,e,o]);let Ba=N(!1),za=N(!1),on=N(null),lr=N(null),cr=N(!1);R(()=>{if(!(!G||Ba.current)){if(Ba.current=!0,za.current){let p=oe.current;p&&Y.switchTab(p);return}Y.reset(T())}},[G]);let zn=$(p=>{!p||p.length===0||(m.value=p.map(h=>Gc(h,Bn.current)))},[m]),dr=N(null),Un=$(async p=>{try{let{formSubmissions:h}=await(p?j.bootstrap(p):dr.current??j.bootstrap()),A=new Map;return h.forEach((O,W)=>A.set(O.formId,W)),h.filter((O,W)=>!O.skipped||A.get(O.formId)===W).map((O,W)=>({key:`wire:${O.formId}:${O.createdAt??W}`,formId:O.formId,outcome:O.skipped?"skipped":"submitted",createdAt:Po(O.createdAt),values:O.values}))}catch(h){return V.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:h}),[]}},[j]),rn=N(0),an=$((p,h)=>{let A=[...p.map(L=>L.createdAt),...h.map(L=>L.createdAt)].filter(L=>L!==void 0),O=(A.length?Math.min(...A):Date.now())-1;return[...(Xe.current?.messages??[]).map(L=>{let Te=Gc(L,Bn.current);return Te.createdAt=O,Te}),...p]},[]),_r=$(async p=>{let h=rn.current,A=()=>h!==rn.current;y(!0);try{let[O,W]=await Promise.all([j.loadConversation(p),Un()]);if(A())return;let L=na(O.messages??[]);b(W);let Te=on.current?[on.current]:[];L.length||Te.length?(m.value=[...an(L,W),...Te],Ot(O.canContinue??!0),nn(O.suggestions??[])):m.value=an([],W),j.resumeStatus==="needs-generation"&&lr.current?.()}catch(O){if(A())return;V.warn("loadThread failed; resetting conversationId",{err:O,conversationId:p}),f.value=void 0,o.saveConversationId(void 0)}finally{A()||y(!1)}},[j,Un,m,f,o,an]),sn=$(async({newConversation:p})=>{let h=++rn.current,A=()=>h!==rn.current,O=f.value,W=p||!O?qe():O;W!==O&&(f.value=W,o.saveConversationId(W));let L;try{L=await j.handshake({visitorId:a,conversationId:W,userPrefs:o.loadUserPrefs(),locale:s})}catch(Ue){if(A())return;n.emit("error",Ue),e.onError?.(Ue),p||I(!0);return}if(A())return;if(L.visitorId&&L.visitorId!==a&&(V.info("visitor rebound",{previous:a,current:L.visitorId,reason:L.rebind?.visitorId}),o.setVisitorId(L.visitorId),i(L.visitorId),n.emit("visitorRebound",{previous:a,current:L.visitorId,reason:L.rebind?.visitorId})),L.conversationId&&L.conversationId!==W&&(V.info("conversation rebound",{previous:W,current:L.conversationId,reason:L.rebind?.conversationId}),n.emit("conversationRebound",{previous:W,current:L.conversationId,reason:L.rebind?.conversationId})),L.agent&&Fa(L.agent),e.mode==="page"&&(L.site&&As(L.site)?ad(L.site):L.site&&V.warn("invalid site config, using fallback",{site:L.site}),L.blocks&&Is(L.blocks)?sd(L.blocks):L.blocks&&V.warn("invalid blocks config, using fallback",{blocks:L.blocks})),L.userPrefs&&!p&&(o.saveUserPrefs(L.userPrefs),L.userPrefs.locale&&c(L.userPrefs.locale),L.userPrefs.soundMuted!==void 0&&se.setMuted(L.userPrefs.soundMuted),L.userPrefs.themeMode&&u(L.userPrefs.themeMode),L.userPrefs.textSize&&_(L.userPrefs.textSize)),Xe.current=L.welcome,p||n.emit("handshake",L),L.welcome?.suggestions){let Ue=Bn.current;nn(L.welcome.suggestions.map(ye=>({...ye,label:Re(Ue,ye.label),...ye.text===void 0?{}:{text:Re(Ue,ye.text)}})))}!p&&O&&L.conversationId===O?ue.current?_r(O):Ke.current=!0:(f.value=L.conversationId,o.saveConversationId(L.conversationId),zn(L.welcome?.messages)),p||I(!0)},[j,a,o,e,n,f,se,zn,_r,s]),ln=JSON.stringify(e.userContext??null),_d=JSON.stringify(e.pageContext??null),ud=JSON.stringify(sr);R(()=>{let p=Object.keys(sr).length?{...sr,...e.userContext}:e.userContext;j.setContext(p,Em(e.pageContext))},[j,ln,_d,ud]);let Fe=Bt(s,e.availableLocales,e.defaultLocale);R(()=>{j.setLocale(Fe)},[j,Fe]),R(()=>{t.dir=si(Fe)?"rtl":"ltr"},[t,Fe]),R(()=>{Fe!==s&&c(Fe)},[Fe,s]);let $t=N(null),Ua=$(p=>p.type!=="data-suggestions"?!1:($t.current=ko(p.data),!0),[]),qa=$(()=>{$t.current&&(nn($t.current),$t.current=null)},[]),qn=$(p=>{if(p.type!=="data-conversation-rebind")return!1;let h=p.data?.conversationId;if(h&&h!==f.value){let A=f.value;f.value=h,o.saveConversationId(h),j.primeIdentity(void 0,h),V.info("conversation rebound (in-stream)",{previous:A,current:h}),A&&n.emit("conversationRebound",{previous:A,current:h,reason:h})}return!0},[f,o,j,n]),Wa=$(async p=>{let h=null;$t.current=null;try{for await(let A of p.iter)if(!(qn(A.chunk)||Ua(A.chunk))){if(!h){h=Pn(),on.current=h,Ie.attach(h),m.value=[...m.value,h],On(!0),$n(()=>p.cancel),Hn(()=>p.detach),za.current=!0;let O=oe.current;O&&Y.switchTab(O),V.info("resumed in-flight reply on mount")}Ie.apply(A.chunk),A.chunk.type==="finish"&&A.chunk.canContinue===!1&&Ot(!1)}h&&(h.status==="error"||it(h)?(h.status="error",h.errorText=e.strings.errorGeneric,se.play("error")):(h.status="complete",se.play("messageReceived"),Ta(n,e,"assistant",wo(h)),qa()))}catch(A){h&&(Kc(A)?Co(h)?m.value=m.value.filter(O=>O!==h):h.status="complete":(h.status="error",h.errorText=Ct(A,e.strings),se.play("error"))),V.debug("resume ended without completing",{err:A})}finally{on.current=null,h&&(Ie.detach(),On(!1),$n(null),Hn(null),m.value=[...m.value])}},[Ie,m,se,n,e,Y,qn]),Va=N(null),ur=$(async()=>{let p=j.resumeStream();Va.current=p,await Wa(p),j.resumeStatus==="needs-generation"&&lr.current?.()},[j,Wa]);R(()=>{let p=f.value;return p&&j.primeIdentity(a,p),sn({newConversation:!1}),()=>{rn.current++,Va.current?.cancel()}},[]),R(()=>{ve&&(dr.current=j.bootstrap(),(async()=>{try{let p=await dr.current;B(pn((p??{forms:[]}).forms,Fe))}catch(p){V.debug("bootstrap failed \u2014 treating as no forms",{err:p})}finally{K(!0)}})(),(async()=>{let p=[];if(Ke.current){Ke.current=!1;let h=f.value;h&&p.push(_r(h))}f.value&&p.push(ur()),p.length!==0&&await Promise.allSettled(p)})())},[ve]);let Wn=N(null);R(()=>{if(!ve)return;if(Wn.current===null){Wn.current=Fe;return}if(Wn.current===Fe)return;Wn.current=Fe;let p=!1;return j.bootstrap().then(h=>{p||B(pn((h??{forms:[]}).forms,Fe))}).catch(h=>V.debug("forms re-localize failed \u2014 keeping current copy",{err:h})),()=>{p=!0}},[ve,Fe,j]);let Ga=N(ln);R(()=>{!G||Ga.current===ln||(Ga.current=ln,sn({newConversation:!1}))},[ln,G,sn]),kt(()=>{_o(t,xo(e.mode,ae,_e))},[t,_e,ae,e.mode]),R(()=>{if(e.mode!=="modal"||!_e)return;let p=h=>{h.composedPath().some(W=>W instanceof HTMLElement&&W.classList.contains(`${x.cssPrefix}-panel`))||Me(!1)};return t.addEventListener("click",p),()=>t.removeEventListener("click",p)},[t,_e,e.mode]),R(()=>{if(e.mode!=="drawer"||!_e)return;let p=h=>{h.key==="Escape"&&Me(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[_e,e.mode]);let ct=$(async(p,{continueExisting:h})=>{let A=f.value??qe();f.value||(f.value=A,o.saveConversationId(A));let O=(h?m.value:m.value.slice(0,-1)).filter(Te=>!Te.ephemeral),W=Hs({messages:O.map(Ks),conversationId:A,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});On(!0),$t.current=null;let L=j.sendMessage(W);$n(()=>L.cancel),Hn(()=>L.detach);try{for await(let ye of L.iter)qn(ye.chunk)||Ua(ye.chunk)||(Ie.apply(ye.chunk),ye.chunk.type==="finish"&&ye.chunk.canContinue===!1&&Ot(!1));let Te=p.status==="error",Ue=it(p);if(Te||Ue){p.status="error",p.errorText=e.strings.errorGeneric,se.play("error");let ye=new Error(Te?"stream error chunk":"empty reply");n.emit("error",ye),e.onError?.(ye)}else p.status="complete",se.play("messageReceived"),Ta(n,e,"assistant",wo(p)),qa()}catch(Te){Kc(Te)?Co(p)?m.value=m.value.filter(Ue=>Ue!==p):p.status="complete":(p.status="error",p.errorText=Ct(Te,e.strings),se.play("error"),n.emit("error",Te),e.onError?.(Te))}finally{Ie.detach(),On(!1),$n(null),Hn(null),m.value=[...m.value]}},[j,Ie,m,f,e,n,se,o,a,qn]),Ka=$(()=>{if(we||cr.current||on.current||m.value.findLast(A=>!A.ephemeral)?.role!=="user")return;cr.current=!0,V.info("regenerating dangling user turn (needs-generation)");let h=Pn();m.value=[...m.value,h],Ie.attach(h),ct(h,{continueExisting:!1}).finally(()=>{cr.current=!1})},[we,m,Ie,ct]);R(()=>{lr.current=Ka},[Ka]);let Vn=$((p,h)=>{if(we)return;let A=m.value.at(-1),O=A?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===p);if(!A||!O){V.warn("decideTool: tool part not found",{toolCallId:p});return}h(O),A.partsSig.value=[...A.partsSig.value],Tm(A)&&(A.status="streaming",m.value=[...m.value],Ie.attach(A),ct(A,{continueExisting:!0}))},[we,m,Ie,ct]),ja=$((p,h)=>{V.info("toolResult",{toolCallId:p}),n.emit("toolResult",{toolCallId:p}),Vn(p,A=>{A.outputSig.value=h,A.stateSig.value="output-available"})},[n,Vn]),Xa=$((p,h,A)=>{V.info("toolDecision",{toolCallId:p,approved:h}),n.emit("toolDecision",{toolCallId:p,approved:h}),Vn(p,O=>{let W=O.approvalSig.value?.id??p;O.approvalSig.value={id:W,approved:h,reason:A},O.stateSig.value="approval-responded"})},[n,Vn]),Ya=$(p=>{if(we)return;let h=m.value.at(-1),A=h?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===p);if(!h||!A)return;let O=A.approvalSig.value?.id??p;A.approvalSig.value={id:O},A.stateSig.value="approval-requested",h.partsSig.value=[...h.partsSig.value]},[we,m]),pd=$((p,h)=>{V.info("messageFeedback",{messageId:p,value:h}),n.emit("messageFeedback",{messageId:p,value:h}),j.submitFeedback({messageId:p,value:h})},[n,j]),md=Ae(()=>({humanInLoop:!e.features.disableHumanInLoop,onResult:ja,onDecision:Xa,onEdit:Ya}),[e.features.disableHumanInLoop,ja,Xa,Ya]),fd=()=>m.value.reduce((p,h)=>p+(h.role==="user"?1:0),0),Ft=e.forms.list.length>0?e.forms:D??e.forms,pe=bc({forms:Ft,persistence:o,userContext:()=>e.userContext,messageCount:fd,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>f.value,onComplete:(p,h,A,O)=>{V.info("formSubmit",{formId:p.id,trigger:h,skipped:O}),n.emit("formSubmit",{formId:p.id,values:A,skipped:O}),b(L=>{let Ue=L.find(ye=>ye.formId===p.id&&ye.outcome==="skipped")?.createdAt??Date.now();return[...L.filter(ye=>!(ye.formId===p.id&&ye.outcome==="skipped")),{key:`local:${p.id}:${Ue}`,formId:p.id,outcome:O?"skipped":"submitted",createdAt:Ue,...O?{}:{values:A}}]});let W=f.value??qe();f.value||(f.value=W,o.saveConversationId(W),j.primeIdentity(void 0,W)),!O&&p.mirrorToContext&&dd(L=>({...L,...A})),j.submitForm({formId:p.id,conversationId:W,trigger:h,values:A,skipped:O})}}),gd=J(()=>pe.activeForm.value);R(()=>{pe.refresh()},[Ft,pe]);let Ja=e.pageContext?.area?String(e.pageContext.area):void 0,hd=J(()=>m.value.length);R(()=>{G&&w&&pe.fire("pre-chat")},[G,w,pe]),R(()=>{w&&!je&&pe.fire("conversation-closed")},[w,je,pe]),R(()=>{G&&w&&Ja&&pe.fire("page-area")},[G,w,Ja,pe]);let pr=Ae(()=>{let p=Ft.list.flatMap(h=>h.triggers).filter(h=>h.kind==="idle").map(h=>Number(h.param));return p.length?Math.min(...p)*1e3:0},[Ft]);R(()=>{if(!pr||!_e)return;let p=setTimeout(()=>pe.fire("idle"),pr);return()=>clearTimeout(p)},[pr,_e,pe,hd.value]);let Qa=$(async(p,h)=>{if(V.info("send",{textLen:p.length,attachments:h.length,streaming:we}),we)return;n.emit("send",{text:p,attachmentCount:h.length}),ir.length>0&&nn([]);let A=await Am(j,h,L=>{V.warn("upload failed",{err:L}),n.emit("error",L),e.onError?.(L)});se.unlock(),se.play("messageSent");let O=Vs(p,A),W=Pn();m.value=[...m.value,O,W],Ie.attach(W),Ta(n,e,"user",p),await ct(W,{continueExisting:!1}),pe.fire("after-messages")},[we,j,n,e,ir.length,m,Ie,ct,pe]),vd=$(()=>{V.info("stop"),n.emit("stop",void 0),Ha?.()},[Ha,n]),bd=$(()=>{if(we)return;let p=m.value,h=p.at(-1);if(!h||h.role!=="assistant"||h.status!=="error"&&!it(h))return;let A=Pn();m.value=[...p.slice(0,-1),A],Ie.attach(A),V.info("retry"),ct(A,{continueExisting:!1})},[we,m,Ie,ct]),yd=$(()=>{se.toggleMuted();let p=se.mutedSig.value;V.info("soundToggle",{muted:p}),n.emit("soundToggle",{muted:p})},[se,n]),cn=$(()=>{if(Fl(e.mode,ae)==="exit-fullscreen"){V.info("close \u2192 exit-fullscreen",{mode:e.mode}),$e("normal"),n.emit("fullscreen",!1);return}V.info("close \u2192 panel closed",{mode:e.mode}),pe.fire("panel-close"),Me(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,ae,pe]),dt=$(()=>{e.modules.list.some(p=>p.layout==="chat")&&j.listConversations({limit:50}).then(p=>{P.value=p.conversations.some(h=>h.hasUnread)}).catch(p=>V.debug("refreshUnread failed (non-fatal)",{err:p}))},[j,e.modules,P]),Za=N(!1);R(()=>{!ve||!G||Za.current||(Za.current=!0,dt())},[ve,G,dt]),R(()=>{if(!ve)return;let p=()=>{document.visibilityState==="visible"&&dt()};return document.addEventListener("visibilitychange",p),()=>document.removeEventListener("visibilitychange",p)},[ve,dt]);let mr=$(()=>{V.info("open",{mode:e.mode}),se.unlock(),Dn(!0),Me(!0),o.savePanelOpen(!0),!k&&!ke&&Se(),setTimeout(()=>Dn(!1),Rm),dt(),n.emit("open",void 0),e.onOpen?.()},[n,e,se,o,k,ke,Se,dt]),fr=$(()=>{if(!m.value.some(h=>h.role==="user")&&je&&f.value){V.info("clear \u2192 reusing empty conversation",{conversationId:f.value}),m.value.length===0&&zn(Xe.current?.messages);return}V.info("clear \u2192 new conversation",{wasStreaming:we}),n.emit("clear",void 0),we&&Fn?.(),Kt(()=>{m.value=[],f.value=void 0}),o.clearConversation(),Ot(!0),b([]),sn({newConversation:!0})},[we,Fn,m,f,o,sn,n,je,zn]),gr=$(()=>{fr(),Dt("chat");let p=e.modules.list.find(h=>h.layout==="chat")?.id;p&&Y.switchTab(p)},[fr,Y,e]),hr=$(()=>{let p=ae==="expanded"?"normal":"expanded";V.info("expand",{from:ae,expanded:p==="expanded"}),$e(p),o.savePanelSize(p),n.emit("expand",p==="expanded")},[n,ae,o]),vr=$(()=>{let p=ae==="fullscreen"?"normal":"fullscreen";V.info("fullscreen",{from:ae,fullscreen:p==="fullscreen"}),$e(p),o.savePanelSize(p),n.emit("fullscreen",p==="fullscreen")},[n,ae,o]),xd=$(()=>{Dt(p=>{let h=p==="history"?"chat":"history";return V.info("toggleHistory",{view:h}),n.emit("toggleHistory",{view:h}),h})},[n]),Pd=$(p=>{V.info("localeChange",{locale:p}),c(p),Je({locale:p}),n.emit("localeChange",p)},[Je,n]),kd=$(p=>{V.info("themeChange",{mode:p}),u(p),t.dataset.theme=p,Je({themeMode:p}),n.emit("themeChange",p)},[t,Je,n]),Sd=$(p=>{V.info("textSizeChange",{size:p}),_(p),t.dataset.textSize=p,Je({textSize:p}),n.emit("textSizeChange",p)},[t,Je,n]),wd=$(()=>{cd(p=>{let h=!p;return V.info("sidebarToggle",{collapsed:h}),o.saveSidebarCollapsed(h),n.emit("sidebarToggle",{collapsed:h}),h})},[o,n]),Cd=$(p=>{V.info("resize",p),Je({widgetSize:p}),n.emit("resize",p)},[Je,n]),br=$(async p=>{V.info("selectConversation",{conversationId:p,wasStreaming:we}),n.emit("selectConversation",{conversationId:p}),we&&Fn?.();try{let[h,A]=await Promise.all([j.loadConversation(p),Un(p)]),O=na(h.messages);Kt(()=>{m.value=an(O,A),f.value=h.conversationId}),b(A),o.saveConversationId(h.conversationId),j.primeIdentity(a,h.conversationId),h.agent&&Fa(h.agent),Ot(h.canContinue),nn(h.suggestions??[]),Dt("chat"),ur(),await j.markRead(p),dt()}catch(h){n.emit("error",h),e.onError?.(h)}},[j,m,f,n,e,o,dt,Un,an,we,Fn,a,ur]),Gn=N(null),ei=$(p=>{typeof p=="string"&&(w?pe.fire("manual",p):Gn.current=p)},[w,pe]);R(()=>{!w||!Gn.current||(pe.fire("manual",Gn.current),Gn.current=null)},[w,pe]),R(()=>Ki(t,{open:mr,close:cn,expand:hr,fullscreen:vr,openForm:ei}),[t,mr,cn,hr,vr,ei]);let Oe=Ae(()=>Mr(e,s,d,g),[e,s,d,g]);Bn.current=Oe.strings;let Td=Ae(()=>C.map(p=>{let h=Ft.list.find(A=>A.id===p.formId);return{...p,title:h?.title,form:h}}),[C,Ft]),ti={options:Oe,transport:j,feedback:se,bus:n,persistence:o,view:De,canSend:je,isStreaming:we,loadingMessages:v,messagesSig:m,agent:od,suggestions:ir,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:cn,onClear:fr,onExpand:hr,onFullscreen:vr,onSoundToggle:yd,onToggleHistory:xd,onSelectHistoryConversation:br,onNewConversation:gr,onLocaleChange:Pd,onThemeChange:kd,onTextSizeChange:Sd,onWidgetSizeChange:Cd,onSend:Qa,onStop:vd,onSuggestion:p=>{let h=p.text??p.label;V.info("suggestion",{text:h}),n.emit("suggestion",{text:h}),Qa(h,[])},activeForm:gd.value?.form??null,formMarkers:Td,onFormSubmit:pe.complete,onFormSkip:pe.skip,onFormFill:p=>pe.fire("manual",p),tool:md,onRetry:bd,onMessageFeedback:pd},Ed=p=>{br(p);let h=H();h&&Y.switchTab(h)};if(!G)return null;let dn=Oe.modules.list,yr=p=>{let h=En("close",Oe.mode,p);return dn.length===0?r(Wc,{strings:Oe.strings,onClose:h?cn:void 0}):dn.length===1&&dn[0]?.layout==="chat"?r(vc,{...ti,panelSize:p}):r(qc,{panelProps:{...ti,panelSize:p,onClose:h?cn:void 0},enabledModules:dn,nav:Y,bus:n,hasUnread:P.value,onSelectConversation:Ed,onStartNewConversation:gr,onSetPanelSize:$e})};if(e.mode==="page"){let p=A=>{br(A.conversationId)},h=dn.some(A=>A.layout==="chat");return r("div",{class:`${tr}-anchor`,children:r(Pc,{site:rd,blocks:id,transport:j,strings:Oe.strings,locale:Oe.locale,persistence:o,visitorId:a,showConversations:h,onSelectConversation:p,onNewConversation:gr,sidebarCollapsed:ld,onToggleSidebarCollapsed:wd,children:yr("fullscreen")})})}if(te){let p=e.mode==="standalone"?"fullscreen":ae;return r("div",{class:`${tr}-anchor`,children:yr(p)})}let ni=e.mode==="drawer",oi=!(e.mode==="modal")&&!e.launcher.hidden&&(!_e||Nt),ri=oi&&!Nt&&!k&&!ni?Oe.launcher.callout:null;return r("div",{class:`${tr}-anchor`,"data-launcher-size":Oe.launcher.size,children:[_e||ve?r("div",{class:`${tr}-surface`,hidden:!_e,children:yr(ae)}):null,oi?r(Dl,{onToggle:mr,launcher:Oe.launcher,strings:Oe.strings,leaving:Nt,edgeTab:ni}):null,ri?r(Ol,{callout:ri,launcherPosition:Oe.position,strings:Oe.strings,closeLabel:Oe.strings.close,onDismiss:Se}):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 Am(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 Ta(e,t,n,o){let a={role:n,text:o};e.emit("message",a),t.onMessage?.(a)}var Im=q.scope("error-boundary"),nr=class extends pt{constructor(){super(...arguments);X(this,"state",{crashed:!1})}componentDidCatch(n,o){Im.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 Lm="1",Mm=60,Nm=2e3,Xc={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 Dm(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Om(){return location.origin+location.pathname}function $m(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Yc(e,t){let n=Math.random(),o=0,a=0,i=new Set,l=(c,d)=>{let{tracking:u,publicKey:g,aiAgentDeploymentId:_,mode:f,themeMode:m}=t.getOptions();if(!u.enabled||Dm()||n>=u.sampleRate)return;let P=performance.now();if(P-o>6e4&&(o=P,a=0),++a>Mm)return;let v=new URLSearchParams;v.set("v",Lm),v.set("_ev",qt),v.set("e",c),u.token&&v.set("tk",u.token),g&&v.set("pk",g),_&&v.set("dep",_),v.set("vid",t.getVisitorId());let y=t.getConversationId();y&&v.set("cid",y),v.set("url",Om());let C=$m();C&&v.set("ref",C),v.set("sw",String(screen.width)),v.set("sh",String(screen.height)),v.set("vw",String(innerWidth)),v.set("vh",String(innerHeight)),v.set("dpr",String(devicePixelRatio)),v.set("lang",navigator.language);try{v.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(v.set("m",f),v.set("th",m),d)for(let[Z,Y]of Object.entries(d))Y!==void 0&&v.set(Z,String(Y));v.set("ts",String(Date.now()));let b=`${u.endpoint}?${v}`;if(b.length>Nm)return;let T=new Image(1,1);i.add(T);let H=()=>i.delete(T);T.addEventListener("load",H,{once:!0}),T.addEventListener("error",H,{once:!0}),T.src=b},s=Object.keys(Xc).map(c=>e.on(c,d=>l(c,Xc[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function or(e){let{bus:t,host:n,appRoot:o,persistence:a,reportError:i}=e,l=e.initialRaw,s,c=_t(l),d=!0,u=()=>{c=_t(s?Nr(l,s):l)},g=()=>{ns(n,Pt(c.mode));let m=a.loadUserPrefs().themeMode;os(n,m?{...c,themeMode:m}:c),d&&(_o(n,Ea(c)),d=!1)},_=()=>{g(),Ut(co(nr,{onError:i},co(jc,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&a.rememberStorageVersion(m.config.storageVersion),s=m.config,u(),_())});let f=Yc(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:_,setUserOptions:m=>{l=m,u(),_()},patchUserOptions:m=>{l={...l,...m},u(),_()},destroy:()=>f()}}function Ea(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=mt(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=xn(e,Yt(),t.loadPanelOpen(),t.loadPanelSize());return xo(e.mode,o,n)}var Fm=q.scope("hooks"),Aa="*",Ra=new Set;function Ia(e,t,n){let o={widgetId:e,event:t,listener:n};return Ra.add(o),()=>{Ra.delete(o)}}function Hm(e,t,n){let o=[...Ra];for(let a of o)if(Bm(a.widgetId,e.widgetId)&&!(a.event!==Aa&&a.event!==t))try{a.listener(e,t,n)}catch(i){Fm.warn("hook listener threw",{event:t,error:i})}}function Jc(e,t){let n=[];for(let o of zm)n.push(t.on(o,a=>{Hm(e,o,a)}));return()=>{for(let o of n)o()}}function La(e){if(Array.isArray(e))for(let t of e){let n=Um(t);n&&Ia(n.widgetId,n.event,n.listener)}}function Bm(e,t){return e===Aa||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"];function Um(e){let t,n,o;if(Array.isArray(e))[t,n,o]=e;else if(e&&typeof e=="object")({widgetId:t,event:n,listener:o}=e);else return null;return typeof t!="string"||typeof n!="string"||typeof o!="function"?null:{widgetId:t,event:n,listener:o}}var lt=new Map;function rr(e){e.debug!==void 0&&Jn(e.debug);let t=q.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=_t(e),o=n.widgetId,a=lt.get(o);a&&(t.debug("destroy existing instance at slot",{widgetId:o}),a.destroy());let i=Ea(n),l=n.iframe?is({position:Pt(n.mode)},n.position,i,n.mode,e.target??null):Wt({position:Pt(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new Vt,c=mt(o,n.storage,n.aiAgentDeploymentId),d=P=>{s.emit("error",P),u.getOptions().onError?.(P)},u=or({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});u.render();let g=l.hostElement,_=null,f=P=>{P.debug!==void 0&&Jn(P.debug),u.patchUserOptions(P)},m={widgetId:o,open:()=>fn(g,"open"),close:()=>fn(g,"close"),expand:()=>fn(g,"expand"),openForm:P=>fn(g,"openForm",P),on:(P,v)=>s.on(P,v),update:P=>{t.debug("update",{patch:P}),f(P)},setUserContext:P=>{t.debug("setUserContext",{keys:Object.keys(P)}),f({userContext:{...u.getUserOptions().userContext,...P}})},clearUserContext:()=>{t.debug("clearUserContext"),f({userContext:void 0})},setPageContext:P=>{t.debug("setPageContext",{keys:Object.keys(P)}),f({pageContext:{...u.getUserOptions().pageContext,...P}})},clearPageContext:()=>{t.debug("clearPageContext"),f({pageContext:void 0})},setDebug:P=>{Jn(P),t.info("debug level set",{level:_n()})},debugLevel:()=>_n(),onLog:P=>un(P),destroy:()=>{t.info("destroy",{widgetId:o}),_?.(),u.destroy(),s.clear(),Ut(null,l.appRoot),l.destroy(),lt.get(o)===m&<.delete(o)}};return _=Jc(m,s),lt.set(o,m),m}function ar(e){let t=e.widgetId??"default",n=lt.get(t);return n?(n.update(e),n):rr(e)}function Ma(e){if(e!==void 0){lt.get(e)?.destroy();return}let t=[...lt.values()];for(let n of t)n.destroy()}function tt(e="default"){return lt.get(e)??null}function Qc(){return[...lt.values()]}function Na(e,t,n){return Ia(e,t,n)}var Zc=qt;var Da=class extends HTMLElement{constructor(){super(...arguments);X(this,"bus",new Vt);X(this,"mountResult",null);X(this,"runtime",null)}static get observedAttributes(){return Dr}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Ut(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=eo(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let o=_t(n);this.mountResult||(this.mountResult=Wt({existingHost:this,position:Pt(o.mode)}));let a=mt(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=or({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:a,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},ed=!1;function Oa(){if(ed||typeof customElements>"u")return;let e=x.tagName;customElements.get(e)||customElements.define(e,Da),ed=!0}typeof customElements<"u"&&Oa();var td=q.scope("iife"),$a={close:()=>tt()?.close(),destroy:()=>Ma(),expand:()=>tt()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Na(e,t,n):void 0,init:e=>ar(e),mount:e=>rr(e),on:(e,t)=>tt()?.on(e,t),onLog:e=>un(e),open:()=>tt()?.open(),setDebug:e=>tt()?.setDebug(e),update:e=>tt()?.update(e)};function nd(e,...t){let n=$a[e];if(!n){td.warn("unknown command",{command:e});return}return n(...t)}function qm(){let e=((n,...o)=>nd(n,...o));e.init=ar,e.mount=rr,e.destroy=Ma,e.getInstance=tt,e.getAllInstances=Qc,e.version=Zc,e.hook=Na,e.debugLevel=()=>_n(),e.onLog=un;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys($a))t.has(n)||(e[n]=(...o)=>$a[n](...o));return e}function Wm(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[a,...i]=o;if(typeof a=="string")try{nd(a,...i)}catch(l){td.warn("queued command failed",{command:a,error:l})}}}function Vm(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)La([o]);return t(...n)},e}function Gm(){let e=document.scripts;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.src.includes("elements"))return n}return null}function Km(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[x.global],t=qm();globalThis[x.global]=t,Oa();let n=`${x.global}Hooks`,o=globalThis[n];if(La(o),globalThis[n]=Vm(),Wm(e),tt())return;let a=document.currentScript??Gm(),i=Or(a?.dataset);if(!i.publicKey)return;let l=()=>{tt()||ar(i)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}Km();return Nd(jm);})();
|
|
42
42
|
//# sourceMappingURL=elements.js.map
|