openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
34 lines • 3.08 kB
JavaScript
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{R as t,wr as n,z as r}from"./control-ui-foundation-Cydpkyqa.js";import{Bn as i,Sc as a,yc as o,zn as s}from"./control-ui-core-Rwzhj6nO.js";import{$ as c,K as l,X as u,at as d,q as f,st as p}from"./lit-runtime-CV_MH99K.js";import{_ as m,g as h}from"./control-ui-core-YphAl4aM.js";import{Rt as g,Yt as _,en as v}from"./control-ui-core-vvcQQV2m.js";import{n as y,t as b}from"./control-ui-disabled-2SNbmzuV.js";var x;function S(){return(S=e((()=>{r(),l(),c(),m(),_(),a(),i(),b(),g(),x=class extends o{constructor(){super(),this.open=!1,this.reloading=!1,this.reloadError=``,this.close=()=>this.dispatchEvent(new Event(`modal-cancel`,{bubbles:!0,composed:!0})),new s(this).watch(()=>this.runtime,(e,t)=>e.subscribe(t))}render(){let e=this.runtime;if(!this.open||!e)return f;let t=e.registrations(`replacements`),n=[...new Set(t.map(e=>e.value.surface))];return u`<openclaw-modal-dialog .label=${v(`pluginUi.customize`)}>
<section class="card">
<h2>${v(`pluginUi.customize`)}</h2>
<p>${v(`pluginUi.selectionScope`)}</p>
${n.map(n=>u`<label class="field"
><span>${v(`pluginUi.surface.${n}`)}</span>
<select
@change=${t=>e.selectReplacement(n,t.target.value||null)}
>
<option value="" .selected=${!e.selectedReplacement(n)}>
${v(`pluginUi.builtin`)}
</option>
${t.filter(e=>e.value.surface===n).map(t=>u`<option
value=${t.key}
.selected=${e.selectedReplacement(n)?.key===t.key}
>
${t.value.label} (${t.pluginId})
</option>`)}
</select></label
>`)}
${e.errors.map(e=>{let t=y(this.context,e.pluginId,this.close);return t?u`<section role="status"><strong>${e.pluginId}</strong>${t}</section>`:u`<p role="alert"><strong>${e.pluginId}</strong>: ${e.message}</p>`})}
${this.reloadError?u`<p role="alert">${this.reloadError}</p>`:f}
${e.canReload?u`<button
class="btn"
?disabled=${this.reloading}
@click=${async()=>{this.reloading=!0,this.reloadError=``;try{await e.reload()}catch(e){this.reloadError=e instanceof Error?e.message:String(e)}finally{this.reloading=!1}}}
>
${v(`pluginUi.reload`)}
</button>`:f}
<button class="btn" @click=${()=>void e.refresh()}>${v(`common.retry`)}</button>
<button class="btn" @click=${this.close}>${v(`common.close`)}</button>
</section>
</openclaw-modal-dialog>`}},n([t({context:h,subscribe:!0})],x.prototype,`context`,void 0),n([p({attribute:!1})],x.prototype,`runtime`,void 0),n([p({type:Boolean})],x.prototype,`open`,void 0),n([d()],x.prototype,`reloading`,void 0),n([d()],x.prototype,`reloadError`,void 0),customElements.get(`openclaw-plugin-manager-dialog`)||customElements.define(`openclaw-plugin-manager-dialog`,x)})))()}S();
//# sourceMappingURL=control-ui-manager-dialog-CPhcc-S-.js.map