openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
12 lines • 1.46 kB
JavaScript
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{Ii as t}from"./control-ui-foundation-Cydpkyqa.js";import{As as n,cs as r,os as i,ss as a}from"./control-ui-core-Rwzhj6nO.js";import{K as o,X as s,q as c}from"./lit-runtime-CV_MH99K.js";import{Gt as l,Wt as u,Yt as d,en as f}from"./control-ui-core-vvcQQV2m.js";import{D as p}from"./control-ui-boot-new-Bj2SAUyl.js";function m(e){let n=e.selectedId??e.selection.state.scopeId??``,i=n?t(n):``,o=e.allowAll!==!1,l=n=>e.agents.some(e=>e.kind===`system`&&t(e.id)===n),d=a(e.agents);if(d.length<=1)return c;let p=new Map(d.map(e=>{let n=t(e.id);return[n,n===e.id?e:{...e,id:n}]}));for(let n of e.additionalAgentIds??[]){if(!n.trim())continue;let e=t(n);!l(e)&&!p.has(e)&&p.set(e,{id:e})}i&&!l(i)&&!p.has(i)&&p.set(i,{id:i});let m=[...p.values()].toSorted((e,t)=>r(e).localeCompare(r(t))),h=l(i)?o?``:m[0]?.id??``:i,g=[...o?[{value:``,label:f(`agentScope.allAgents`),icon:u.users}]:[],...m.map(e=>({value:e.id,label:r(e),agent:e}))];return s`
<div class="agent-scope-control">
<openclaw-agent-select
.options=${g}
.value=${h}
.accessibleLabel=${f(`agentScope.label`)}
.menuLabel=${f(`agentScope.label`)}
.onSelect=${t=>o?e.selection.setScope(t||null):e.selection.set(t||null)}
></openclaw-agent-select>
</div>
`}function h(){return(h=e((()=>{o(),d(),i(),n(),p(),l()})))()}export{m as n,h as t};
//# sourceMappingURL=agent-scope-control-6x2VZZ2e.js.map