const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./board-view-DX4lsdQG.js","./control-ui-core-Br5DB0Zj.js","./rolldown-runtime-DkW27tQK.js","./control-ui-foundation-CeFMP1Ly.js","./control-ui-core-pH6nakZ-.js","./lit-runtime-BEtFSUCp.js","./control-ui-core-DGVkFhVB.js","./gateway-runtime-DUNO4Mi1.js","./control-ui-core-C8H8-RSs.css","./control-ui-boot-Cdpgu1Gm.js","./control-ui-boot-wpHCbPL9.js","./control-ui-boot-gfE6fZcA.js","./config-runtime-C4gfjhZc.js","./control-ui-boot-CKTkvwFZ.js","./control-ui-boot-BPFwXC8p.js","./control-ui-boot-DdPrPuw0.js","./control-ui-boot-9_2QGLIL.js","./control-ui-boot-J-x6DHHT.js","./control-ui-boot-B1lcIXow.js","./control-ui-boot-Clhp68JE.js","./control-ui-boot-D1DWJlBr.js","./control-ui-boot-CQvujP8f.js","./control-ui-boot-BW_XZcbY.js","./control-ui-boot-__AsqpzJ.css","./markdown-runtime-BcrsAQtF.js","./board-view-DEfofU9J.js","./board-view-Cufc5TOV.css"])))=>i.map(i=>d[i]); import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{Nr as t,Pr as n,er as r}from"./control-ui-foundation-CeFMP1Ly.js";import{fl as i,ml as a}from"./control-ui-core-pH6nakZ-.js";import{G as o,J as s,W as c,Z as l,at as u,rt as d}from"./lit-runtime-BEtFSUCp.js";import{Nt as f,Pt as p}from"./control-ui-core-DGVkFhVB.js";import{Ht as m,Lt as h,Rt as g,qt as _}from"./control-ui-core-Br5DB0Zj.js";import{Do as v,Mo as y,Oo as b,jo as x,ko as S}from"./control-ui-boot-Cdpgu1Gm.js";function C(){return f(`openclaw-board-view`,()=>t(()=>import(`./board-view-DX4lsdQG.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]),import.meta.url))}var w;function T(){return(T=e((()=>{c(),l(),p(),g(),m(),y(),a(),n(),w=class extends i{constructor(...e){super(...e),this.sessionKey=``,this.client=null,this.connected=!1,this.canMutate=!1,this.canGrant=!1,this.provider=null,this.expanded=!1,this.activeTabId=``,this.lease=null,this.unsubscribeSnapshot=null,this.expansionInitialized=!1}updated(){C().catch(()=>void 0),this.synchronizeProvider()}disconnectedCallback(){this.releaseProvider(),super.disconnectedCallback()}synchronizeProvider(){let e=this.sessionKey.trim(),t=this.client;if(!e||!t){this.releaseProvider();return}let n=S(e);if(this.lease?.client===t&&this.lease.sessionKey===n){this.lease.update(t,this.connected,{canPinWidgets:!1,canPinMcpApps:!1,canMutate:this.canMutate,canGrant:this.canGrant});return}this.releaseProvider(),this.expansionInitialized=!1,this.activeTabId=``;let r=v(n,t,this.connected,!1,!1,this.canMutate,this.canGrant);this.lease={...r,client:t,sessionKey:n},this.provider=r.provider,this.unsubscribeSnapshot=r.provider.snapshot$.subscribe(()=>{this.reconcileSnapshot(r.provider),this.requestUpdate()}),this.reconcileSnapshot(r.provider),this.requestUpdate()}releaseProvider(){this.unsubscribeSnapshot?.(),this.unsubscribeSnapshot=null,this.lease?.release(),this.lease=null,this.provider=null}reconcileSnapshot(e){let t=e.snapshot$.value,n=t.tabs[0]?.tabId??``;t.tabs.some(e=>e.tabId===this.activeTabId)||(this.activeTabId=n),!this.expansionInitialized&&x(e)&&(this.expansionInitialized=!0,this.expanded=b(t))}render(){let e=this.provider,t=e?.snapshot$.value,n=!!(t&&b(t)),r=e?{appViewGeneration:e.appViewGeneration,applyOps:t=>e.applyOps(t),grant:(t,n)=>e.grant(t,n),selectTab:e=>{this.activeTabId=e},frameLoadFailed:t=>e.refreshWidgetFrame(t),widgetAppView:(t,n)=>e.widgetAppView(t,n),refreshWidgetAppView:(t,n)=>e.refreshWidgetAppView(t,n)}:null;return s`
${n&&e&&t&&r?s` e.widgetFrameUrl(t,n)} .callbacks=${r} .sessions=${[]} .canMutate=${this.canMutate} .canGrant=${this.canGrant} > `:s`

${_(`workboard.dashboardEmpty`)}

`}
${!this.expanded&&this.expansionInitialized&&!n?s`

${_(`workboard.dashboardEmpty`)}

`:o}
`}},r([u({attribute:!1})],w.prototype,`sessionKey`,void 0),r([u({attribute:!1})],w.prototype,`client`,void 0),r([u({attribute:!1})],w.prototype,`connected`,void 0),r([u({attribute:!1})],w.prototype,`canMutate`,void 0),r([u({attribute:!1})],w.prototype,`canGrant`,void 0),r([d()],w.prototype,`provider`,void 0),r([d()],w.prototype,`expanded`,void 0),r([d()],w.prototype,`activeTabId`,void 0),customElements.get(`openclaw-workboard-card-dashboard`)||customElements.define(`openclaw-workboard-card-dashboard`,w)})))()}T(); //# sourceMappingURL=workboard-card-dashboard-DaEhM7sA.js.map