UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

5 lines (4 loc) • 29.6 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{mi as t,pi as n}from"./_4____________________________.js";import{AN as r,Dp as i,GN as a,JN as o,ON as s,Op as c,Sw as l,Tp as u,XM as d,_m as f,dT as p,dm as m,fN as h,fT as g,fm as _,kp as v,ml as y,mm as b,pN as x,pl as S,qN as C,wp as w,xw as T}from"./_2_____________________________.js";import{Di as E,Oi as D}from"./deferred-ui-support-DZEPWjAk.js";import{B as O,C as k,F as A,J as j,O as M,Rt as N,T as P,U as F,_ as ee,a as te,d as I,f as L,g as R,j as z,k as ne,l as B,m as V,o as H,p as U,s as W,t as re,u as G,x as K}from"./_6____________________.js";import{f as ie,p as ae}from"./_5_________________________.js";import{n as oe,t as se}from"./channel-picker-BMxuIkk_.js";import{n as ce,t as le}from"./provider-presentation-K1_wXrAZ.js";var q,J;function ue(){return(ue=e((()=>{t(),q={modelSetup:{discovery:{title:`Available models`,description:`Find saved accounts or set up a local model for {agent}. This changes only this agent’s model, not the defaults for other agents.`,useForAgent:`Test & use for this agent`,connectForAgent:`Add account for this agent`,connectProvider:`Add account`,returnToModels:`Back to Models`,otherSoftware:`Other detected software`},heading:`Set up a model`,intro:`OpenClaw finds saved accounts and local models on the computer running OpenClaw. Choose one to begin; nothing is selected, tested, installed, or saved automatically.`,loading:`Loading models…`,testing:`Asking the selected model for a quick reply…`,retry:`Retry`,checkAgain:`Check again`,recovery:{unknown:`The previous activation is unresolved. Check again refreshes the current setup without repeating it. If a model is available, you can verify and use it.`,wait:`The previous setup attempt may still be running. Check again can refresh its result. If no model appears, check again after {time} to choose a provider.`,useCurrent:`Verify & use selected model`},verify:{title:`Selected model`,button:`Check model`,retry:`Try again`,checkAgain:`Check again`,checkingButton:`Checking…`,checking:`Asking {modelRef} for a quick reply…`,ready:`Ready`,readyIn:`Ready · {latencyMs} ms`,providerUnavailable:`{provider} isn’t responding.`},access:{adminRequired:`You need admin access to set up models.`,gatewayTooOld:`Update the Gateway to set up models.`},candidates:{title:`Available models`,recommended:`Recommended`,credentialsReady:`Account ready`,detected:`Detected`,testAndUse:`Test & use`,retry:`Retry test`,testingButton:`Testing…`},nativeDiscovery:{title:`Find existing sessions`,body:`Show sessions from installed agents on the computer running OpenClaw in OpenClaw. This doesn’t import or copy them.`,enable:`Show existing sessions`,decline:`Leave unchecked to keep these sessions hidden when you add an account. Existing installations aren’t changed.`},nativeModels:{title:`Use an installed agent`,body:`Choose a model from an installed agent. It keeps its own sign-in and tools. Use saves your choice without running the setup test.`,choose:`Choose a model`,use:`Use`,saving:`Saving…`,loading:`Loading installed agents…`,empty:`No models from installed agents yet. Check the installed app, then open the picker again.`,unconfirmed:`Availability not confirmed`},empty:{title:`Recommended installs`,intro:`Install an agent or local model service, then check again.`},signIn:{title:`Set up and verify a model`,description:`Setup asks the model for a reply. To save an account first, choose Add account.`,verify:`Set up & verify`,install:`Review & install`,custom:`Set up endpoint`,more:`More sign-in options`},prepare:{title:`Run a model locally`,intro:`Use a local model service or set up a private GGUF model on the computer running OpenClaw.`,ollamaButton:`Check & set up`,ollamaLabel:`Ollama`,ollamaHint:`Use Ollama on the computer running OpenClaw to set up a model that supports tools`,llamaCppLabel:`llama.cpp`,providerNotReady:`Couldn’t find a usable local model from {provider}. Review the setup result, then try again.`},manual:{title:`Connect with an API key or token`,provider:`Provider and access method`,selectProvider:`Select a provider`,selectProviderHint:`Choose where this credential comes from`,accessValue:`API key or token`,accessValueFor:`{provider} API key or token`,accessValuePlaceholder:`Paste an API key or token`,connectAndVerify:`Connect & verify`,verifyHint:`OpenClaw verifies a real model reply before marking the connection ready.`,required:`Choose a provider and enter an API key or token.`},success:{title:`Model verified`,body:`{modelRef} replied. You can start chatting now.`,activeModel:`Active model`,latency:`Verified in {latencyMs} ms`,openChat:`Start chatting`,continueSetup:`Continue setup`,stayHere:`Stay in settings`,configuredModel:`Configured model`},utility:{role:`Setup & utility`,hint:`Helps set up OpenClaw and handles lightweight tasks. Other sessions need a primary model.`,useSetup:`Use for setup`,useUtility:`Use as utility`,ready:`Setup & utility model ready`,configured:`Setup & utility model`,verified:`{modelRef} replied. This model is ready for setup and lightweight tasks.`,model:`Utility model`,choosePrimary:`Choose a primary model below for other sessions. Your setup agent stays available.`,primaryReady:`This model handles setup and lightweight tasks. Other sessions use your primary model.`,openAssistant:`Open setup agent`,repair:`Recheck & repair`},failure:{rateLimit:`Rate limited`,billing:`Billing problem`,timeout:`Timed out`,format:`Invalid response`,unavailable:`Unavailable`,unknown:`Couldn’t check model`},failureGuidance:{rateLimit:`Wait for the provider limit to reset, then retry.`,billing:`Restore provider billing or quota, then retry.`,timeout:`The model didn’t reply in time. Try again or choose a faster model.`,unavailable:`Make sure the provider service is running and reachable, then retry.`,format:`Check that the endpoint provides a compatible model, then try again.`,unknown:`Review the account details, then try again.`},errors:{requestFailed:`Couldn’t set up the model. Try again.`,activationFailed:`Couldn’t use the model. Try again.`},wizard:{dialogLabel:`Provider sign-in`,prepareDialogLabel:`Local model setup`,title:`Sign in with a provider`,connected:`Account added`,prepareTitle:`Set up a local model`,starting:`Starting provider sign-in…`,prepareStarting:`Starting local model setup…`,checking:`Checking your model setup…`,working:`Working…`,continue:`Continue`,submit:`Submit`,openSignIn:`Open sign-in`,copy:`Copy`,copyCode:`Copy code`,copyLink:`Copy link`,manualEntry:`Use manual entry`,browserInstructions:`Complete sign-in in your browser, then return here.`,waiting:`Waiting for sign-in…`,signInTitle:`Continue in your browser`,deviceCodeTitle:`Enter this code in your browser`,signInPage:`The sign-in page`,browserOpened:`{provider} is open in a new tab. Approve access there. This window updates by itself.`,browserOpenedContinue:`{provider} is open in a new tab. Approve access there, then choose Continue.`,deviceCodeOpened:`{provider} is open in a new tab. Make sure it shows the same code before you approve.`,deviceCodeEnter:`Enter this code on the provider’s sign-in page.`,waitingForProvider:`Waiting for {provider}…`,reopenSignIn:`Reopen browser tab`,tryAgain:`Try again`,tabDidNotOpen:`Tab didn’t open?`,copySignInLink:`Copy sign-in link`,stillWaiting:`Still waiting. If you already approved, the tab may have opened in another browser or profile. Try again from here.`,deviceCodeExpired:`This code expired. No account was added. Close this window and sign in again.`,cancelSignIn:`Cancel sign-in`,deviceCodeWarning:`Continue only if you started this sign-in. If someone sent you this code, cancel.`,expires:`Expires in {count} minutes`,expiresSoon:`Expires in less than a minute`,cancelled:`Sign-in canceled`,finishingStep:`Setup is finishing the current step. You can cancel when it finishes.`,cancelFailed:`Couldn’t confirm cancellation. Try again. {error}`,sessionExpired:`This setup may have finished. Close this dialog and choose Check again to review it.`,gatewayNotResponding:`Couldn’t finish setup. Check that the Gateway is running, then try again.`,gatewayReconnecting:`Disconnected. Waiting to reconnect…`,notComplete:`You’re signed in, but model setup isn’t complete yet.`},providerConnected:`{provider} is ready`}},J=Object.assign(()=>{let{candidates:e,failure:t,failureGuidance:r,...i}=q.modelSetup;Object.assign(n.modelSetup,i),Object.assign(n.modelSetup.candidates,e),Object.assign(n.modelSetup.failure,t),Object.assign(n.modelSetup.failureGuidance,r)},{catalog:q})})))()}function de(e){let t,n=A(()=>e.value),r=()=>o(e.revealed?`configForm.hideValue`:`configForm.revealValue`),i=n=>{t&&(t.textContent=e.revealed?``:me(n.value),t.style.transform=`translateX(${-n.scrollLeft}px)`)};var a=fe(),s=a.firstChild,c=s.firstChild,l=s.nextSibling,u=l.nextSibling;return V(()=>e=>{t=e},c),I(c,(()=>{var t=L(()=>!!e.revealed);return()=>t()?``:me(n())})()),l.addEventListener(`scroll`,e=>i(e.currentTarget)),l.addEventListener(`focus`,e=>i(e.currentTarget)),l.addEventListener(`change`,e=>i(e.currentTarget)),l._$$input=t=>{i(t.currentTarget),e.onInput(t.currentTarget.value)},u._$$click=()=>e.onToggle(),I(u,z(h,{get name(){return e.revealed?`eyeOff`:`eye`}})),B(()=>({e:String(e.revealed),t:e.revealed,a:e.id,o:e.revealed?`text`:`password`,i:e.placeholder??``,n:n(),s:e.disabled,h:e.invalid?`true`:void 0,r:e.describedBy,d:e.label,l:r(),u:e.id,c:e.revealed?`true`:`false`,w:e.revealed?`eye-off`:`eye`,m:e.disabled}),({e,t,a:n,o:r,i,n:o,s:c,h:d,r:f,d:p,l:m,u:h,c:g,w:_,m:v},y)=>{e!==y?.e&&R(a,`data-revealed`,e),t!==y?.t&&R(s,`hidden`,t),n!==y?.a&&R(l,`id`,n),r!==y?.o&&R(l,`type`,r),i!==y?.i&&R(l,`placeholder`,i),ee(l,`value`,o),c!==y?.s&&R(l,`disabled`,c),d!==y?.h&&R(l,`aria-invalid`,d),f!==y?.r&&R(l,`aria-describedby`,f),p!==y?.d&&R(l,`aria-label`,p),m!==y?.l&&R(u,`aria-label`,m),h!==y?.u&&R(u,`aria-controls`,h),g!==y?.c&&R(u,`aria-pressed`,g),_!==y?.w&&R(u,`data-sensitive-icon`,_),v!==y?.m&&R(u,`disabled`,v)}),a}var fe,pe,me;function he(){return(he=e((()=>{G(),F(),a(),x(),d(),fe=K(`<span class=oc-sensitive-input data-sensitive-input data-sensitive-mask-ready=true><span class=oc-sensitive-mask aria-hidden=true data-sensitive-mask><span data-sensitive-mask-text></span></span><input class=input name=wizard-text autocomplete=off spellcheck=false data-sensitive-value><button type=button class=oc-sensitive-toggle>`),pe=new Intl.Segmenter(void 0,{granularity:`grapheme`}),me=e=>`*`.repeat(Array.from(pe.segment(e)).length),W([`input`,`click`])})))()}function ge(e){let t;var n=ye(),r=n.firstChild;return n._$$click=n=>void S(n,e.value,e.label,{label:t}),V(()=>e=>t=e,r),I(r,()=>e.label),B(()=>U(e.class),(e,t)=>{H(n,e,t)}),n}function _e(e){let t=()=>e.brandId&&f(e.brandId)?e.brandId:void 0;var n=xe(),r=n.firstChild,i=r.nextSibling;return I(n,z(M,{get when(){return e.waiting},get children(){return be()}}),r),I(n,()=>e.icon??z(M,{get when(){return t()},get fallback(){return z(m,{get label(){return e.providerLabel||e.brandId||`?`},class:`wizard-sign-in__icon`})},children:e=>z(le,{get provider(){return e()},class:`wizard-sign-in__icon`})}),i),B(()=>!!e.waiting,e=>{n.classList.toggle(`wizard-sign-in__badge--waiting`,e)}),n}function ve(e){let t=A(()=>e.step.deviceCode),n=()=>e.providerLabel||o(`modelSetup.wizard.signInPage`),[r,a]=O(!1);c(()=>a(!0),()=>De);let l=A(()=>e.step.deviceCode?.expiresInMinutes),u=A(()=>{let e=l();return e===void 0?void 0:Date.now()+e*6e4}),[d,f]=O(Date.now());i(()=>f(Date.now()),()=>u()===void 0?void 0:Oe);let m=()=>{let e=u();return e===void 0?void 0:Math.ceil((e-d())/6e4)},h=()=>(m()??1)<=0,g=()=>e.waiting&&r()&&!t(),_=()=>{if(!e.waiting&&e.step.message)return s(e.step.message);let r=t();return r?e.step.externalUrl?o(`modelSetup.wizard.deviceCodeOpened`,{provider:n()}):r.message??o(`modelSetup.wizard.deviceCodeEnter`):o(e.waiting?`modelSetup.wizard.browserOpened`:`modelSetup.wizard.browserOpenedContinue`,{provider:n()})},v=()=>e.waiting?g()?o(`modelSetup.wizard.stillWaiting`):e.step.progressMessage??(e.providerLabel?o(`modelSetup.wizard.waitingForProvider`,{provider:e.providerLabel}):o(`modelSetup.wizard.waiting`)):``;var y=Ce(),b=y.firstChild,x=b.nextSibling,S=x.nextSibling,C=S.nextSibling,w=C.nextSibling,T=w.nextSibling,E=T.nextSibling,D=E.nextSibling,k=D.nextSibling;return I(y,z(_e,{get icon(){return e.icon},get brandId(){return e.brandId},get providerLabel(){return e.providerLabel},get waiting(){return L(()=>!!e.waiting)()?!h():e.waiting}}),b),I(b,()=>o(t()?`modelSetup.wizard.deviceCodeTitle`:`modelSetup.wizard.signInTitle`)),I(x,_),I(S,v),I(y,z(M,{get when(){return g()},get children(){return z(p,{tone:`warning`,class:`wizard-sign-in__callout`,role:`none`,get children(){return o(`modelSetup.wizard.stillWaiting`)}})}}),C),I(y,z(M,{get when(){return h()},get children(){return z(p,{tone:`warning`,class:`wizard-sign-in__callout`,role:`alert`,get children(){return o(`modelSetup.wizard.deviceCodeExpired`)}})}}),w),I(y,z(M,{get when(){return L(()=>!h())()&&t()},children:e=>(()=>{var t=we(),n=t.firstChild;return I(n,()=>e().code),I(t,z(ge,{get value(){return e().code},get label(){return o(`modelSetup.wizard.copyCode`)},class:`btn btn--sm`}),null),t})()}),T),I(y,z(M,{get when(){return L(()=>!h())()&&e.step.externalUrl},children:n=>(()=>{var r=Ee(),i=r.firstChild,a=N();return V(()=>t=>e.onAutofocusRef?.(t),i),I(i,()=>o(g()?`modelSetup.wizard.tryAgain`:`modelSetup.wizard.reopenSignIn`)),I(r,z(M,{get when(){return!t()},get children(){var e=Te(),t=e.firstChild,r=t.nextSibling;return I(e,()=>o(`modelSetup.wizard.tabDidNotOpen`),t),I(e,z(ge,{get value(){return n()},get label(){return o(`modelSetup.wizard.copySignInLink`)},class:`wizard-sign-in__link`}),r),e}}),null),B(()=>({e:!!g(),t:n()}),({e,t},n)=>{e!==n?.e&&i.classList.toggle(`primary`,e),t!==n?.t&&R(i,`href`,t),te(i,a)}),r})()}),E),I(y,z(M,{get when(){return L(()=>!h())()&&(m()??1/0)<=ke},get children(){var e=Se();return I(e,(()=>{var e=L(()=>(m()??0)>1);return()=>e()?o(`modelSetup.wizard.expires`,{count:String(m())}):o(`modelSetup.wizard.expiresSoon`)})()),e}}),D),I(y,z(M,{get when(){return t()},get children(){var e=Se();return I(e,()=>o(`modelSetup.wizard.deviceCodeWarning`)),e}}),k),y}var ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke;function Ae(){return(Ae=e((()=>{G(),F(),r(),a(),ce(),v(),y(),b(),g(),_(),ye=K(`<button type=button><span data-copy-label>`),be=K(`<span class=wizard-sign-in__ring aria-hidden=true>`),xe=K(`<div class=wizard-sign-in__badge><!><!>`),Se=K(`<p class=wizard-sign-in__note>`),Ce=K(`<div class=wizard-sign-in><h2 class=wizard-sign-in__title></h2><p class=wizard-sign-in__lead></p><span class=sr-only role=status aria-live=polite></span><!><!><!><!><!><!>`),we=K(`<div class=wizard-sign-in__code><code class=wizard-step__sign-in-code>`),Te=K(`<p class=wizard-sign-in__fallback> <!>`),Ee=K(`<div class=wizard-sign-in__actions><a class="btn wizard-step__external-link"autofocus data-link-reader-external target=_blank rel=noreferrer>`),De=45e3,Oe=15e3,ke=5,W([`click`])})))()}function Y(e,t){return`${e.presentation===`channels`?`channels-wizard`:`wizard-step`}__${t}`}function je(e){let t=()=>o(`modelSetup.wizard.continue`);var n=Ue(),r=n.firstChild,i=r.nextSibling.nextSibling;return I(r,t),I(i,()=>e.statusLabel),B(()=>t(),e=>{R(n,`aria-label`,e)}),n}function X(e){return z(M,{get when(){return e.step.message},get children(){var t=We();return I(t,z(M,{get when(){return e.presentation===`model-setup`},get fallback(){return[` `,L(()=>s(e.step.message)),` `]},get children(){return z(k,{get each(){return s(e.step.message).split(` `)},keyed:!1,children:(e,t)=>(()=>{var n=Ge();return I(n,e),B(()=>U(t===0?void 0:`muted`),(e,t)=>{H(n,e,t)}),n})()})}})),B(()=>U(Y(e,`message`)),(e,n)=>{H(t,e,n)}),t}})}function Me(e){return z(M,{get when(){return e.channels},get fallback(){var t=Xe(),n=t.firstChild;return I(n,()=>e.option.label),I(t,z(M,{get when(){return e.option.hint},get children(){var t=Ye();return I(t,()=>e.option.hint),t}}),null),t},get children(){return[(()=>{var t=Ke();return I(t,()=>e.option.label),t})(),z(M,{get when(){return e.option.hint},get children(){var t=qe();return I(t,()=>e.option.hint),t}}),z(M,{get when(){return e.selected},get children(){var e=Je();return I(e,z(h,{name:`check`})),e}})]}})}function Z(e){return z(M,{get when(){return e.step.externalUrl||e.step.deviceCode},get children(){return z(M,{get when(){return e.presentation===`model-setup`},get fallback(){return z(Ne,e)},get children(){return z(ve,{get step(){return e.step},get waiting(){return e.waiting},get icon(){return e.signInIcon},get brandId(){return e.brandId},get providerLabel(){return e.providerLabel},get onAutofocusRef(){return e.onAutofocusRef}})}})}})}function Ne(e){let t=A(()=>e.step.deviceCode),n=()=>o(t()?`modelSetup.wizard.copyCode`:`modelSetup.wizard.copyLink`),r=A(()=>t()?.code??e.step.externalUrl);var i=et(),a=i.firstChild,s=a.nextSibling,c=s.firstChild,l=c.nextSibling,u=s.nextSibling,d=u.nextSibling,f=d.nextSibling;return I(a,()=>t()?.message??o(`modelSetup.wizard.browserInstructions`)),I(i,z(M,{get when(){return t()},children:e=>(()=>{var t=tt();return I(t,()=>e().code),t})()}),s),I(s,z(M,{get when(){return e.step.externalUrl},get children(){var t=Ze(),n=N();return V(()=>t=>e.onAutofocusRef?.(t),t),I(t,()=>o(`modelSetup.wizard.openSignIn`)),B(()=>e.step.externalUrl,e=>{R(t,`href`,e),te(t,n)}),t}}),c),I(s,z(M,{get when(){return r()},keyed:!0,children:e=>{let t;var r=nt(),i=r.firstChild;return r._$$click=r=>void S(r,e,n(),{label:t}),V(()=>e=>t=e,i),I(i,n),r}}),l),I(u,()=>o(`modelSetup.wizard.waiting`)),I(i,z(M,{get when(){return t()?.expiresInMinutes},get children(){var e=Qe();return I(e,()=>o(`modelSetup.wizard.expires`,{count:String(t()?.expiresInMinutes)})),e}}),d),I(i,z(M,{get when(){return t()},get children(){var e=$e();return I(e,()=>o(`modelSetup.wizard.deviceCodeWarning`)),e}}),f),i}function Q(e){return z(re,{get component(){return e.modal?`openclaw-modal-actions`:`div`},get class(){return e.class},get children(){return e.children}})}function $(e){let t=()=>e.answerLabel??e.label;var n=rt();n._$$click=()=>e.onClick?.(),V(()=>t=>e.onAutofocusRef?.(t),n),I(n,t),B(()=>({e:e.onClick?`button`:`submit`,t:e.presentation===`model-setup`,a:e.busy||e.disabled}),({e,t,a:r},i)=>{e!==i?.e&&R(n,`type`,e),t!==i?.t&&R(n,`autofocus`,t),r!==i?.a&&R(n,`disabled`,r)});let r=n;return z(M,{get when(){return e.presentation===`channels`},get fallback(){return z(M,{get when(){return L(()=>e.presentation===`model-setup`)()&&!e.externalAuthInput||e.leadingAction},fallback:r,get children(){return z(Q,{get modal(){return L(()=>e.presentation===`model-setup`)()&&!e.externalAuthInput},class:`wizard-step__actions wizard-step__actions--split`,get children(){return[L(()=>e.leadingAction),r]}})}})},get children(){var n=it();return n._$owner=N(),I(n,z(M,{get when(){return e.busy},fallback:r,get children(){return z(je,{get statusLabel(){return e.busyLabel??t()}})}})),n}})}function Pe(e){let t=A(()=>typeof e.value==`string`?e.value:``),n=()=>e.presentation===`model-setup`,r;ie(()=>e.busy,{requested:(e,t)=>!e&&t===!0,focus:()=>{let e=r?.elements.namedItem(`wizard-text`);document.activeElement===document.body&&e instanceof HTMLInputElement&&e.focus({preventScroll:!0})}});var i=ot(),a=i.firstChild,c=a.nextSibling,u=c.nextSibling,d=u.nextSibling;return i.addEventListener(`submit`,n=>{n.preventDefault();let r=n.currentTarget.elements.namedItem(`wizard-text`);e.onAnswer(e.presentation===`channels`&&r instanceof HTMLInputElement?r.value:t())}),V(()=>e=>{r=e},i),I(i,z(M,{get when(){return e.step.message},get children(){var t=at(),n=t.firstChild;return I(n,()=>s(e.step.message)),B(()=>({e:U(Y(e,`message`)),t:e.inputId}),({e,t:r},i)=>{H(t,e,i?.e),r!==i?.t&&R(n,`for`,r)}),t}}),a),I(i,z(M,{get when(){return!e.externalAuthInput},get children(){return z(Z,j(e,{waiting:!1}))}}),c),I(i,z(M,{get when(){return L(()=>!!e.step.sensitive)()?e.onToggleSensitiveVisibility:e.step.sensitive},get fallback(){var r=st();return r._$$input=t=>e.presentation!==`channels`&&e.onValueChange(t.currentTarget.value),V(()=>[l(t),t=>{n()&&e.onAutofocusRef?.(t)}],r),B(()=>({e:e.inputId,t:e.step.sensitive?`password`:`text`,a:e.step.sensitive?`off`:`on`,o:e.step.placeholder??``,i:n(),n:e.busy,s:e.validationErrorId?`true`:void 0,h:e.validationErrorId,r:e.step.message?void 0:e.step.title||o(`chat.questions.answer`)}),({e,t,a:n,o:i,i:a,n:o,s,h:c,r:l},u)=>{e!==u?.e&&R(r,`id`,e),t!==u?.t&&R(r,`type`,t),n!==u?.a&&R(r,`autocomplete`,n),i!==u?.o&&R(r,`placeholder`,i),a!==u?.i&&R(r,`autofocus`,a),o!==u?.n&&R(r,`disabled`,o),s!==u?.s&&R(r,`aria-invalid`,s),c!==u?.h&&R(r,`aria-describedby`,c),l!==u?.r&&R(r,`aria-label`,l)}),r},get children(){return z(de,{get id(){return e.inputId},get value(){return t()},get revealed(){return e.sensitiveRevealed===!0},get placeholder(){return e.step.placeholder},get disabled(){return e.busy},get invalid(){return!!e.validationErrorId},get describedBy(){return e.validationErrorId},get label(){return L(()=>!!e.step.message)()?void 0:e.step.title||o(`chat.questions.answer`)},get onInput(){return e.onValueChange},onToggle:()=>e.onToggleSensitiveVisibility?.()})}}),u),I(i,z($,j(e,{get leadingAction(){return L(()=>!!e.externalAuthInput)()?void 0:e.leadingAction},get label(){return o(`modelSetup.wizard.submit`)}})),d),i}function Fe(e){return z(M,{get when(){return e.externalAuthInput},get fallback(){return z(Pe,e)},get children(){return[z(Z,j(e,{waiting:!0})),(()=>{var t=ct(),n=t.firstChild;return I(n,()=>o(`modelSetup.wizard.manualEntry`)),I(t,z(Pe,e),null),t})(),z(Q,{get modal(){return e.presentation===`model-setup`},class:`wizard-step__actions wizard-step__actions--split`,get children(){return e.leadingAction}})]}})}function Ie(e){let t=()=>e.step.message||e.step.title||o(`chat.questions.answer`),n=A(()=>e.presentation===`channels`&&e.channelSelect&&e.options.every(e=>typeof e.value==`string`)),r=()=>e.presentation===`channels`||e.presentation===`model-setup`&&e.options.length>2,[i,a]=O(),s=()=>{let t=i();return t?.step===e.step.id?t.value:e.value},c=()=>e.options.findIndex(e=>Object.is(e.value,s())),l={get label(){return t()},get value(){let t=c();return t<0?null:n()?String(e.options[t]?.value):String(t)},get options(){return e.options.map((e,t)=>({value:n()?String(e.value):String(t),label:e.label,description:e.hint,kind:n()?`channel`:`neutral`}))},get disabled(){return e.busy},get invalid(){return!!e.validationErrorId},get describedBy(){return e.validationErrorId},onChange:t=>{let i=n()?t:e.options[Number(t)]?.value;r()?a({step:e.step.id,value:i}):e.onAnswer(i)}};return z(M,{get when(){return L(()=>e.presentation!==`channels`)()&&e.options.length<=2},get fallback(){return[z(M,{get when(){return n()},get fallback(){return z(w,{params:l})},get children(){return z(se,l)}}),z(M,{get when(){return r()},get children(){return z($,j(e,{get label(){return o(`modelSetup.wizard.continue`)},get disabled(){return c()<0},onClick:()=>e.onAnswer(s())}))}})]},get children(){var n=lt(),r=n.firstChild,i=r.nextSibling;return I(n,z(M,{get when(){return e.presentation===`model-setup`},get children(){return e.leadingAction}}),r),I(n,z(k,{get each(){return e.options},keyed:!1,children:(t,n)=>(()=>{var r=ut();return r._$$click=()=>e.onAnswer(t().value),V(()=>t=>e.onAutofocusRef?.(t),r),I(r,z(Me,{get option(){return t()}})),B(()=>({e:U(n===0?`btn primary`:`btn`),t:e.presentation===`model-setup`&&n===0,a:e.busy}),({e,t,a:n},i)=>{H(r,e,i?.e),t!==i?.t&&R(r,`autofocus`,t),n!==i?.a&&R(r,`disabled`,n)}),r})()}),i),B(()=>({e:!!(e.presentation===`model-setup`&&e.leadingAction),t:t(),a:e.validationErrorId}),({e,t,a:r},i)=>{e!==i?.e&&n.classList.toggle(`wizard-step__actions--split`,e),t!==i?.t&&R(n,`aria-label`,t),r!==i?.a&&R(n,`aria-describedby`,r)}),n}})}function Le(e){let t=()=>Array.isArray(e.value)?e.value:[];return[(()=>{var n=dt();return I(n,z(k,{get each(){return e.options},keyed:!1,children:n=>z(M,{get when(){return e.presentation===`channels`},get fallback(){var r=pt(),i=r.firstChild,a=i.nextSibling;return I(r,z(E,{get checked(){return t().some(e=>Object.is(e,n().value))},get disabled(){return e.busy},get"aria-invalid"(){return e.validationErrorId?`true`:void 0},get"aria-describedby"(){return e.validationErrorId},onChange:r=>e.onValueChange(r.currentTarget.checked?[...t(),n().value]:t().filter(e=>!Object.is(e,n().value)))}),i),I(r,z(Me,{get option(){return n()}}),a),r},get children(){var r=ft();return r._$$click=()=>e.onValueChange(n().value),I(r,z(Me,{get option(){return n()},channels:!0,get selected(){return t().some(e=>Object.is(e,n().value))}})),B(()=>({e:e.busy,t:t().some(e=>Object.is(e,n().value))?`true`:`false`,a:e.validationErrorId?`true`:void 0,o:e.validationErrorId}),({e,t,a:n,o:i},a)=>{e!==a?.e&&R(r,`disabled`,e),t!==a?.t&&R(r,`aria-pressed`,t),n!==a?.a&&R(r,`aria-invalid`,n),i!==a?.o&&R(r,`aria-describedby`,i)}),r}})})),B(()=>({e:U(Y(e,`options`)),t:e.step.message||e.step.title||o(`chat.questions.answer`),a:e.validationErrorId}),({e,t,a:r},i)=>{H(n,e,i?.e),t!==i?.t&&R(n,`aria-label`,t),r!==i?.a&&R(n,`aria-describedby`,r)}),n})(),z($,j(e,{get label(){return o(`modelSetup.wizard.continue`)},onClick:()=>e.onAnswer(e.presentation===`channels`?[...t()]:t())}))]}function Re(e){let t=A(()=>e.step.options??[]);return[z(X,e),z(M,{get when(){return e.step.type===`multiselect`},get fallback(){return[z(Ie,j(e,{get options(){return t()}})),L(()=>L(()=>e.presentation===`channels`||e.presentation===`model-setup`)()?void 0:e.leadingAction)]},get children(){return z(Le,j(e,{get options(){return t()}}))}})]}function ze(e){return[z(X,e),z(Q,{get modal(){return e.presentation===`channels`||e.presentation===`model-setup`},get class(){return[Y(e,e.presentation===`channels`?`footer`:`actions`),{"wizard-step__actions--split":e.presentation!==`channels`&&!!e.leadingAction}]},get children(){return[z(M,{get when(){return e.presentation!==`channels`},get children(){return e.leadingAction}}),z(M,{get when(){return L(()=>e.presentation===`channels`)()&&e.busy},get fallback(){return z(k,{each:[!1,!0],children:t=>(()=>{var n=ut();return n._$$click=()=>e.onAnswer(t),I(n,()=>t?e.confirmAffirmativeLabel??o(`common.yes`):o(`common.no`)),B(()=>({e:U(t?`btn primary`:`btn`),t:e.busy}),({e,t},r)=>{H(n,e,r?.e),t!==r?.t&&R(n,`disabled`,t)}),n})()})},get children(){return z(je,{get statusLabel(){return e.busyLabel??o(`common.loading`)}})}})]}})]}function Be(e){return[z(M,{get when(){return e.presentation!==`model-setup`||!(e.step.externalUrl||e.step.deviceCode)},get children(){return z(X,e)}}),z(Z,j(e,{waiting:!1})),z($,j(e,{get label(){return o(`modelSetup.wizard.continue`)},onClick:()=>e.onAnswer(void 0)}))]}function Ve(e){return[z(M,{get when(){return L(()=>!e.step.externalUrl)()&&!e.step.deviceCode},get children(){var t=mt();return t.firstChild,I(t,z(X,e),null),t}}),z(Z,j(e,{waiting:!0})),z(M,{get when(){return e.leadingAction},get children(){return z(Q,{get modal(){return e.presentation===`model-setup`},class:`wizard-step__actions wizard-step__actions--split`,get children(){return e.leadingAction}})}})]}function He(e){return z(ne,{get children(){return[z(P,{get when(){return e.step.type===`text`},get children(){return z(M,{get when(){return e.step.id},keyed:!0,children:t=>z(Fe,e)})}}),z(P,{get when(){return e.step.type===`select`||e.step.type===`multiselect`},get children(){return z(Re,e)}}),z(P,{get when(){return e.step.type===`confirm`},get children(){return z(ze,e)}}),z(P,{get when(){return e.step.type===`progress`},get children(){return L(()=>e.step.executor===`gateway`)()?z(Ve,e):z(Be,e)}}),z(P,{get when(){return e.step.type===`note`},get children(){return L(()=>!!(e.busy&&(e.step.externalUrl||e.step.deviceCode)))()?z(Ve,e):z(Be,e)}}),z(P,{get when(){return e.step.type===`action`},get children(){return z(Be,e)}})]}})}var Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt;function ht(){return(ht=e((()=>{G(),F(),ue(),r(),a(),T(),ae(),y(),u(),he(),oe(),D(),x(),Ae(),Ue=K(`<button type=button class="btn primary"disabled aria-busy=true><span class=btn__label></span><span class=btn__spinner aria-hidden=true></span><span class=sr-only role=status aria-live=polite>`),We=K(`<div>`),Ge=K(`<p>`),Ke=K(`<span class=channels-wizard__option-label>`),qe=K(`<span class=channels-wizard__option-hint>`),Je=K(`<span class=channels-wizard__option-check aria-hidden=true>`),Ye=K(`<small>`),Xe=K(`<span><strong>`),Ze=K(`<a class="btn primary wizard-step__external-link"data-link-reader-external target=_blank rel=noreferrer>`),Qe=K(`<div class=muted>`),$e=K(`<p class=muted>`),et=K(`<div class=wizard-step__sign-in><p class=muted></p><div class=wizard-step__actions><!><!></div><div class=muted role=status aria-live=polite></div><!><!>`),tt=K(`<code class=wizard-step__sign-in-code>`),nt=K(`<button type=button class=btn><span data-copy-label>`),rt=K(`<button class="btn primary">`),it=K(`<openclaw-modal-actions class=channels-wizard__footer>`,1),at=K(`<div><label>`),ot=K(`<form class=wizard-step__form><!><!><!><!>`),st=K(`<input class=input name=wizard-text>`),ct=K(`<details class=wizard-step__manual-entry><summary class=muted>`),lt=K(`<div class=wizard-step__actions role=group><!><!>`),ut=K(`<button type=button>`),dt=K(`<div role=group>`),ft=K(`<button type=button class=channels-wizard__option>`),pt=K(`<label class=wizard-step__option><!><!>`),mt=K(`<div class=wizard-step__progress role=status aria-live=polite><span class=wizard-step__spinner aria-hidden=true>`),C(J),W([`click`,`input`])})))()}export{J as a,ue as i,He as n,ht as r,je as t};