openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.92 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{BC as t,CC as n,KC as r,SC as i,UC as a,ay as o,cy as s,dj as c,ej as l,mj as u,nj as d,qC as f,xC as p}from"./control-ui-boot-shared-DFTSUQQ0.js";import{B as m,F as h,K as g,O as _,U as v,d as y,g as b,j as x,l as S,m as C,u as w,v as T,x as E}from"./solid-runtime-C416s-HC.js";import{n as D,t as O}from"./control-ui-disabled.solid-CwKLkbuO.js";function k(e){let n=d(),a=n?.plugins?s(n.plugins):void 0,[o,c]=m(!1),[l,f]=m(160),v=g(r),w=()=>o()&&e.presented!==!1&&v(),E;p(()=>[E],([e])=>c(e?.isIntersecting===!0),{rootMargin:`400px 0px`}),i(()=>[E],([e])=>{w()&&e&&e.contentRect.height>0&&f(e.contentRect.height)});let D=()=>e.block.pluginId+`/`+e.block.viewId+`@`+e.block.version,k=h(()=>{let t=a?.read();return t?.isLoading(e.block.pluginId)?`loading`:t?.registrations(`inlineViews`).some(e=>e.key===D())?`ok`:`unavailable`}),M=()=>(()=>{var t=A(),r=t.firstChild,i=r.nextSibling;return y(r,()=>a?.read().inlineViewLabel(D())??e.block.viewId),y(i,()=>u(k()===`loading`?`pluginUi.inlineLoading`:`pluginUi.inlineUnavailable`)),y(t,x(O,{context:n,get pluginId(){return e.block.pluginId}}),null),t})();var N=j();return C(()=>e=>{E=e},N),y(N,x(_,{get when(){return w()},get children(){return x(_,{get when(){return k()===`ok`},get fallback(){return M()},get children(){return x(t,{kind:`inlineViews`,get contributionKey(){return D()},get props(){return{payload:e.block.payload,toolCallId:e.block.toolCallId,toolName:e.block.toolName,sessionKey:e.sessionKey,agentId:e.agentId}},fallback:M})}})}})),S(()=>({e:e.block.toolCallId,t:w()?void 0:l()+`px`}),({e,t},n)=>{e!==n?.e&&b(N,`data-plugin-inline-view`,e),t!==n?.t&&T(N,`min-height`,t)}),N}var A,j;function M(){return(M=e((()=>{w(),v(),l(),c(),n(),o(),f(),D(),a(),A=E(`<div class=card role=status><strong></strong><p class=muted>`),j=E(`<div class=chat-plugin-inline-view>`)})))()}M();export{k as PluginInlineView};