import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{Rt as t,bn as n,er as r,zt as i}from"./control-ui-foundation-CeFMP1Ly.js";import{Bi as a,Gi as o,Hi as s,Ji as c,Ki as l,Ri as u,Ui as ee,Vi as te,dc as ne,dr as re,fl as ie,fr as ae,fs as d,ml as oe,ms as f,pr as se,ps as p,qi as ce,uc as le,vr as ue,yr as de,zi as fe}from"./control-ui-core-pH6nakZ-.js";import{G as m,J as h,W as g,Z as pe,at as me,c as he,h as _,m as ge,rt as v,u as _e}from"./lit-runtime-BEtFSUCp.js";import{$t as ve,Jt as ye,Kn as be,Tt as xe,Ut as Se,en as Ce,m as we,p as Te,qn as Ee,wt as De,zn as Oe}from"./control-ui-core-DGVkFhVB.js";import{Ht as y,Lt as b,Nt as ke,Qt as Ae,Rt as je,Zt as Me,kt as Ne,qt as x}from"./control-ui-core-Br5DB0Zj.js";import{F as Pe,I as S,In as Fe,L as C,Ln as Ie,z as w}from"./control-ui-boot-wpHCbPL9.js";import{Ca as Le,at as Re,bn as T,ct as ze,dt as Be,ft as Ve,it as He,lt as Ue,mn as We,on as Ge,ot as Ke,rt as qe,st as Je,un as Ye,ut as Xe,vn as E,wa as Ze,yn as Qe}from"./control-ui-boot-Cdpgu1Gm.js";import{G as $e,K as et}from"./control-ui-boot-D1DWJlBr.js";import{a as D,c as tt,i as O,n as nt,o as rt,r as it,s as at,t as ot}from"./presentation-B6OSZPWo.js";import{n as st,t as ct}from"./settings-workspace-Bo4nqRhI.js";import{n as lt,t as ut}from"./gateway-page-controller-bzyUg03c.js";import{n as dt,t as ft}from"./plugins-hub-header-2-MSECVZ.js";var k;function A(){return(A=e((()=>{k=[`channels`,`providers`,`tools`,`contracts`,`hooks`,`mcpServers`,`cliCommands`,`cliBackends`,`skills`,`dangerousConfigFlags`]})))()}function pt(e,t){return Object.keys(e).every(e=>t.includes(e))}function mt(e){let r=n(e);if(!r||!pt(r,k))return;let i={};for(let e of k){let n=r[e];if(n!==void 0){if(!Array.isArray(n)||!n.every(t))return;i[e]=n}}return i}function ht(e){let r=n(e);if(!r||r.capabilityConsentCode!==`PLUGIN_CAPABILITY_CONSENT_REQUIRED`||!pt(r,[`capabilityConsentCode`,`pluginId`,`reviewToken`,`widened`,`acceptedAt`])||!t(r.pluginId)||!t(r.reviewToken)||r.acceptedAt!==void 0&&!t(r.acceptedAt))return;let i=r.widened===void 0?void 0:mt(r.widened);if(!(r.widened!==void 0&&!i))return{capabilityConsentCode:gt,pluginId:r.pluginId,reviewToken:r.reviewToken,...i?{widened:i}:{},...r.acceptedAt===void 0?{}:{acceptedAt:r.acceptedAt}}}var gt;function _t(){return(_t=e((()=>{A(),gt=`PLUGIN_CAPABILITY_CONSENT_REQUIRED`})))()}function vt(e){let t=n(e);if(!t)return;let r=i(t.ruleId),a=i(t.message),o=t.severity;if(!r||!a||o!==`info`&&o!==`warn`&&o!==`critical`)return;let s=i(t.file),c=i(t.evidence),l=t.line;if(!(t.file!==void 0&&!s||t.evidence!==void 0&&!c||l!==void 0&&(typeof l!=`number`||!Number.isSafeInteger(l)||l<=0)))return{ruleId:r,severity:o,message:a,...s?{file:s}:{},...l===void 0?{}:{line:l},...c?{evidence:c}:{}}}function yt(e){let t=n(e);if(!t)return;let r=i(t.targetName),a=i(t.reason),o=t.targetType,s=t.requestMode;if(t.installPolicyCode!==`install_policy_warning_acknowledgement_required`||!r||!a||o!==`skill`&&o!==`plugin`||s!==`install`&&s!==`update`)return;let c;if(t.findings!==void 0){if(!Array.isArray(t.findings))return;c=[];for(let e of t.findings){let t=vt(e);if(!t)return;c.push(t)}}return{installPolicyCode:bt,targetName:r,targetType:o,requestMode:s,reason:a,...c?{findings:c}:{}}}var bt;function xt(){return(xt=e((()=>{bt=`install_policy_warning_acknowledgement_required`})))()}function St(e,t){return e.request(`plugins.inspect`,{pluginId:t})}function Ct(e){if(e instanceof ve)return ht(e.details)}function j(){return(j=e((()=>{_t(),Ce()})))()}function wt(e){let t=e.source===`official`?e.pluginId:e.packageName;return Ze({title:x(`pluginsPage.installConfirmTitle`,{name:t}),message:x(`pluginsPage.installConfirmMessage`),confirmLabel:x(`pluginsPage.install`)})}function Tt(e){return Ze({title:x(`pluginsPage.removeConfirmTitle`,{name:e}),message:x(`pluginsPage.removeConfirmMessage`),confirmLabel:x(`pluginsPage.remove`),danger:!0})}function M(){return(M=e((()=>{Le(),y()})))()}function Et(e){if(e instanceof ve)return yt(e.details)}function Dt(){return(Dt=e((()=>{xt(),Ce()})))()}var N,P;function Ot(){return(Ot=e((()=>{Ae(),N={pluginConsent:{widenedTitle:`What changed`,widenedDescription:`New since your last acceptance.`,previouslyAccepted:`Previously accepted {date}.`,declaredTitle:`Declared capabilities`,declaredDescription:`From the plugin manifest. OpenClaw validates the plugin against these declarations when it loads.`,declaredEmpty:`No channels, providers, or tools declared in the manifest.`,contracts:`Contracts`,hooks:`Hooks`,runtimeHooks:`Code plugins may register hooks at runtime; their hook names are not declared in the manifest.`,mcpServers:`MCP servers`,cliCommands:`CLI commands`,cliBackends:`CLI backends`,skills:`Skills`,dangerousFlags:`Dangerous config flags`,grantsTitle:`Your grants`,grantsDescription:`Set per plugin in plugins.entries.{id}. Hooks outside these grants are blocked at load.`,promptInjection:`Prompt injection`,conversationAccess:`Conversation access`,allowed:`Allowed`,blocked:`Blocked`,on:`On`,off:`Off`,grantDefault:`(default)`,grantConfigured:`(set in config)`,externalAccessHint:`Off by default for external plugins.`,modelOverrides:`Model overrides`,subagentModelOverrides:`Subagent model overrides`,modelOverride:`Model override: {value}`,allowedModels:`Allowed models: {models}`,allowedCompletionModels:`Completion models: {models}`,authProfileOverride:`Auth profile override: {value}`,agentIdOverride:`Agent ID override: {value}`,noOverrides:`No overrides configured`,loading:`Loading capability details…`,fallback:`Capability details must be available before you can approve this plugin.`,verifiedClean:`Verified clean`,reviewRecommended:`Review recommended`,reviewRequired:`Review required`,trustBlocked:`Blocked`,scanDate:`Scanned {date}`,integrity:`Integrity`,sha256:`SHA-256`,commit:`Commit`,pinnedArtifact:`Pinned to the exact installed artifact.`,sourceClawHub:`ClawHub`,sourceNpm:`npm`,sourceGit:`Git`,sourcePath:`Local path`,sourceArchive:`Archive`,sourceMarketplace:`Marketplace`,community:`Community`,enableNamed:`Enable {name}`}},P=Object.assign(()=>{Me.pluginConsent=N.pluginConsent},{catalog:N})})))()}function F(e,t,n,r,i=`plugins-tile`){let a=D(e);if(a)return h` `;if(n)return h` `;let[o,s]=at(e),c=tt(t);return h``}function I(e,t,n=!1){return h` `}function kt(e){return h`${e.join(`, `)}`}function At(e,t=!1){return k.flatMap(n=>{let r=e[n];return r?.length&&(t||n!==`dangerousConfigFlags`)?[I(x(Bt[n]),kt(r),t)]:[]})}function jt(e){let t=At(e);return h` `}function Mt(e){if(!e.widened)return m;let t=At(e.widened,!0);return t.length===0?m:h` `}function Nt(e,t,n){return`${x(e.effective?t:n)} ${x(e.configured===void 0?`pluginConsent.grantDefault`:`pluginConsent.grantConfigured`)}`}function L(e,t){return t===void 0?void 0:x(e,{value:x(t?`pluginConsent.allowed`:`pluginConsent.blocked`)})}function Pt(e){return[L(`pluginConsent.modelOverride`,e.allowModelOverride),e.allowedModels?.length?x(`pluginConsent.allowedModels`,{models:e.allowedModels.join(`, `)}):void 0,`allowedCompletionModels`in e&&e.allowedCompletionModels?.length?x(`pluginConsent.allowedCompletionModels`,{models:e.allowedCompletionModels.join(`, `)}):void 0,`allowAuthProfileOverride`in e?L(`pluginConsent.authProfileOverride`,e.allowAuthProfileOverride):void 0,`allowAgentIdOverride`in e?L(`pluginConsent.agentIdOverride`,e.allowAgentIdOverride):void 0].filter(Boolean).join(` · `)||x(`pluginConsent.noOverrides`)}function Ft(e,t){let n=e.hooks.allowConversationAccess;return h` `}function R(e,t){if(t)return x(`pluginsPage.official`);let n=e&&Object.hasOwn(z,e)?z[e]:void 0;return n?x(n):e??(t===!1?x(`pluginConsent.community`):null)}function It(e){return e===`source-linked`?x(`pluginsPage.verifiedSource`):e}function Lt(e){if(!e)return m;let t=e.integrityKind===`sha256`?x(`pluginConsent.sha256`):e.integrityKind===`git-commit`?x(`pluginConsent.commit`):x(`pluginConsent.integrity`);return h` ${e.integrity?h``:m} `}function Rt(e){if(!e)return m;let t=x(e.disposition===`clean`?`pluginConsent.verifiedClean`:e.disposition===`review-recommended`?`pluginConsent.reviewRecommended`:e.disposition===`review-required`?`pluginConsent.reviewRequired`:`pluginConsent.trustBlocked`),n=e.disposition===`clean`?`ok`:e.disposition===`blocked`?`danger`:`warn`;return h` `}function zt(e){let{consent:t,inspection:n}=e,r=t.details,i=n?.plugin,a=t.fallback,o=n?.source?.packageName??(t.intent.kind===`install`&&t.intent.request.source===`clawhub`?t.intent.request.packageName:null),s=t.pluginId??o??a?.name??`plugin`,c=i?.name??a?.name??s,l=i?.version??a?.version,u=[R(i?.origin,a?.official),o].filter(Boolean).join(` · `),ee=t.intent.kind===`install`?e.busy?x(`pluginsPage.installing`):x(`pluginsPage.installNamed`,{name:c}):e.busy?x(`pluginsPage.working`):x(`pluginConsent.enableNamed`,{name:c});return h` `}var Bt,Vt,z;function Ht(){return(Ht=e((()=>{g(),A(),je(),ke(),Ge(),y(),Ot(),O(),P(),Bt={channels:`pluginsPage.categoryChannels`,providers:`pluginsPage.categoryProviders`,tools:`pluginsPage.categoryTools`,contracts:`pluginConsent.contracts`,hooks:`pluginConsent.hooks`,mcpServers:`pluginConsent.mcpServers`,cliCommands:`pluginConsent.cliCommands`,cliBackends:`pluginConsent.cliBackends`,skills:`pluginConsent.skills`,dangerousConfigFlags:`pluginConsent.dangerousFlags`},Vt={bundled:`pluginsPage.included`,"official-catalog":`pluginsPage.official`,clawhub:`pluginConsent.sourceClawHub`,npm:`pluginConsent.sourceNpm`,git:`pluginConsent.sourceGit`,path:`pluginConsent.sourcePath`,archive:`pluginConsent.sourceArchive`,marketplace:`pluginConsent.sourceMarketplace`},z={bundled:`pluginsPage.included`,global:`pluginsPage.global`,workspace:`pluginsPage.workspace`,config:`pluginsPage.config`,official:`pluginsPage.official`}})))()}function Ut(e){switch(e){case`info`:return x(`pluginsPage.policyReviewSeverityInfo`);case`warn`:return x(`pluginsPage.policyReviewSeverityWarn`);case`critical`:return x(`pluginsPage.policyReviewSeverityCritical`)}return e}function Wt(e){switch(e){case`all`:return x(`pluginsPage.filterAll`);case`enabled`:return x(`pluginsPage.enabled`);case`disabled`:return x(`pluginsPage.disabled`);case`issues`:return x(`pluginsPage.filterIssues`);default:return e}}function Gt(e){switch(e){case`work`:return x(`pluginsPage.connectorGroupWork`);case`dev`:return x(`pluginsPage.connectorGroupDev`);case`home`:return x(`pluginsPage.connectorGroupHome`);case`life`:return x(`pluginsPage.connectorGroupLife`);default:return e}}function B(e){return`plugin:${e}`}function Kt(e){return`clawhub:${e}`}function V(e,t,n){return o(t,e.result?.plugins??[],n)}function H(e,t){return t?!!e.busy[t]:!1}function qt(e){return`connector:${e}`}function U(e){return e.trim().toLocaleLowerCase()}function W(e,t){let n=U(t);return!n||[e.name,e.id,e.packageName,e.description,e.origin,e.category,...e.kind??[]].some(e=>e?.toLocaleLowerCase().includes(n))}function Jt(e,t){let n=U(t);return!n||[e.id,e.name,x(e.descriptionKey)].some(e=>e.toLocaleLowerCase().includes(n))}function G(e){return e.toSorted((e,t)=>{let n=Number(!!t.featured)-Number(!!e.featured);if(n!==0)return n;if(e.featured&&t.featured){let n=e.featuredAt,r=t.featuredAt;if(n!==void 0||r!==void 0){if(n===void 0)return 1;if(r===void 0)return-1;if(n!==r)return r-n}}return(e.order??2**53-1)-(t.order??2**53-1)||e.name.localeCompare(t.name)})}function Yt(e,t=``,n=`all`){return G(e.filter(e=>{if(!e.installed||!W(e,t))return!1;switch(n){case`enabled`:return e.enabled&&e.state!==`error`;case`disabled`:return!e.enabled&&e.state!==`error`;case`issues`:return e.state===`error`;default:return!0}}))}function Xt(e){let t=new Map;for(let n of e){let e=n.category??`other`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=e=>{let t=it.indexOf(e);return t===-1?it.length:t};return[...t.entries()].map(([e,t])=>({category:e,label:rt(e),plugins:t})).toSorted((e,t)=>n(e.category)-n(t.category))}function Zt(e,t=``){let n=G(e.filter(e=>e.featured&&W(e,t))),r=new Set(n.map(e=>e.id));return{featured:n,official:G(e.filter(e=>!r.has(e.id)&&e.origin===`official`&&!e.installed&&W(e,t))),connectors:nt.filter(e=>Jt(e,t))}}function Qt(e){switch(e.state){case`enabled`:return x(`pluginsPage.enabled`);case`disabled`:return x(`pluginsPage.disabled`);case`error`:return x(`pluginsPage.needsAttention`);case`not-installed`:return x(`pluginsPage.available`);default:return e.state}}function $t(e){let t=e.state===`enabled`?`ok`:e.state===`error`?`danger`:`muted`;return T({kind:t,label:Qt(e)})}function en(e){return e.state===`error`?$t(e):m}function tn(e,t,n){n&&e.onInstall(t,n)}function K(e){let t=e.filter(e=>e!==m&&e!==``);return t.length===0?m:h` ${t.map((e,t)=>h`${t>0?h``:m}${e}`)} `}function q(e,t,n,r,i){let a=t?e:i??e,o=t??(i?r.messages[i]:void 0);if(!o)return m;if(o.installPolicyWarning){let{details:e,request:t}=o.installPolicyWarning,s=e.findings??[],c=s.length===0?x(`pluginsPage.policyReviewBodyReason`,{reason:p(e.reason)}):x(`pluginsPage.policyReviewBodyKnown`,{count:String(s.length)});return h` `}let s=o.kind===`error`?`alert`:`status`;return h`
${o.text}
`}function nn(e){return!!e.target?.closest(`button, a, input, label, form, summary, .plugins-policy-review, [role='menu']`)}function rn(e,t,n){let r=!n.enabled;return h` `}function an(e,t,n,r){return h` `}function J(e,t,n,r,i){return e.messages[i]?.installPolicyWarning?m:h` `}function on(e,t,n,r){if(!e.installed){let r=e.install;return r?J(t,n,e.name,r,V(t,r)):h`${x(`pluginsPage.unavailable`)}`}return h` ${rn(t,n,{enabled:e.enabled,onToggle:n=>t.onSetEnabled(e.id,n,r)})} ${e.removable?an(t,n,e.name,()=>t.onUninstall(e.id,r)):m} `}function sn(e){let t=(e.result?.plugins??[]).filter(e=>e.installed),n=t.filter(e=>e.state===`error`).length,r=t.filter(e=>e.enabled&&e.state!==`error`).length,i={all:t.length,enabled:r,disabled:t.length-r-n,issues:n};return Qe({value:e.installedFilter,ariaLabel:x(`pluginsPage.filterLabel`),options:Z.map(e=>({value:e,label:h`${Wt(e)} ${i[e]}`})),onChange:t=>e.onFilterChange(t)})}function cn(e){return h`

${e.onShowDetails?h` `:e.content}

`}function Y(e,t,n=!1){let r=B(e.id),i=e.install?V(t,e.install):void 0,a=t.busy[r]||H(t,i);return h`
{nn(n)||t.onShowDetails(e.id)}} > ${F(e.id,e.name,t.iconUrls[e.id],()=>t.onIconError(e.id))}
${cn({name:e.name,content:h` ${e.name} ${e.version?h`v${e.version}`:m} `,onShowDetails:()=>t.onShowDetails(e.id)})} ${e.description||x(`pluginsPage.optionalCapability`)} ${K([e.origin?R(e.origin):m,n&&e.packageName?h`${e.packageName}`:m])}
${e.installed?en(e):m} ${on(e,t,a,r)}
${e.error?h``:m} ${q(r,t.messages[r],a,t,i)}
`}function ln(e){let t=U(e.query),n=e.mcpServers?.filter(e=>!t||e.name.toLocaleLowerCase().includes(t)||e.target.toLocaleLowerCase().includes(t));if(t&&n&&n.length===0)return m;let r=n?n.length===0?Ye(x(`pluginsPage.mcpEmpty`)):_(n,e=>e.name,t=>un(t,e)):h`
${x(`pluginsPage.loading`)}
`;return E({title:x(`pluginsPage.mcpServersGroup`),...n?{count:n.length}:{},description:x(`pluginsPage.mcpHint`),actions:h` ${x(`pluginsPage.mcpSettingsLink`)} `},h` ${e.mcpFormOpen?Ve({busy:e.mcpBusy,disabled:!e.canMutate,blockedReason:e.mutationBlockedReason,onSubmit:e.onMcpAdd,onCancel:()=>e.onMcpFormToggle(!1)}):m} ${e.mcpMessage?h`
${e.mcpMessage.text}
`:m} ${r} `)}function un(e,t){return h`
${F(e.name,e.name)}

${e.name}

${e.target||x(`mcpServers.missingTransport`)} ${K([x(`pluginsPage.mcp`),e.transport,e.auth===`oauth`?x(`pluginsPage.oauth`):m])}
${rn(t,t.mcpBusy,{enabled:e.enabled,onToggle:n=>t.onMcpToggle(e.name,n)})} ${an(t,t.mcpBusy,e.name,()=>t.onMcpRemove(e.name))}
`}function dn(e){let t=Xt(Yt(e.result?.plugins??[],e.query,e.installedFilter)),n=!!(e.query||e.installedFilter!==`all`);return h` ${t.length===0?X(x(n?`pluginsPage.noInstalledMatchTitle`:`pluginsPage.noInstalledTitle`),x(n?`pluginsPage.noMatchBody`:`pluginsPage.noInstalledBody`),n?`curious`:`sleepy`):t.map(t=>E({title:t.label,count:t.plugins.length},_(t.plugins,e=>e.id,t=>Y(t,e,!0))))} ${ln(e)} `}function fn(e,t){let n=qt(e.id),r=!!t.busy[n],i=e.action.kind===`mcp`,a=i&&!!t.mcpServers?.some(t=>e.action.kind===`mcp`&&t.name===e.action.mcp.serverName);return h`
${F(e.id,e.name)}

${e.name}

${x(e.descriptionKey)} ${K(i?[x(`pluginsPage.mcp`),x(`pluginsPage.connectorMcpNote`)]:[x(`pluginsPage.connectorClawHubNote`)])}
${i?a?T({kind:`ok`,label:x(`pluginsPage.connectorAdded`)}):h` `:h` `}
${q(n,t.messages[n],r,t)}
`}function pn(e,t){return t.length===0?m:E({title:e,count:t.length},t)}function mn(e,t){return t.find(t=>t.installed&&(t.id===e.package.runtimeId||t.packageName===e.package.name||t.install?.source===`clawhub`&&t.install.packageName===e.package.name))}function hn(e,t){let n=e.package,r=mn(e,t.result?.plugins??[]),i=Kt(n.name),a={source:`clawhub`,packageName:n.name},o=V(t,a,n.runtimeId),s=t.busy[i]||H(t,o),c=n.runtimeId??n.name;return h`
{r&&!nn(e)&&t.onShowDetails(r.id)}} > ${F(c,n.displayName)}
${cn({name:n.displayName,content:h` ${n.displayName} ${n.latestVersion?h`v${n.latestVersion}`:m} `,onShowDetails:r?()=>t.onShowDetails(r.id):void 0})} ${n.summary||n.name} ${K([n.isOfficial?x(`pluginsPage.official`):m,n.verificationTier?It(n.verificationTier):m,typeof n.downloads==`number`?h` ${Sn.format(n.downloads)} `:m,n.family===`bundle-plugin`?x(`pluginsPage.bundlePlugin`):x(`pluginsPage.codePlugin`)])}
${r?h`${en(r)}${on(r,t,s,i)}`:J(t,s,n.displayName,a,o)}
${q(i,t.messages[i],s,t,o)}
`}function gn(e){let t=e.query.trim();if(t.length<2)return m;let n;return n=e.searchLoading||!e.searchResults&&!e.searchError?h`
${x(`pluginsPage.searching`)}
`:e.searchError?h``:e.searchResults&&e.searchResults.length===0?h`${Ye(x(`pluginsPage.noClawHubResultsBody`,{query:t}))}`:h` ${_(e.searchResults??[],e=>e.package.name,t=>hn(t,e))} `,E({title:x(`pluginsPage.fromClawHub`),...e.searchResults?{count:e.searchResults.length}:{},actions:h` ${x(`pluginsPage.browseClawHub`)} `},n)}function _n(e){let t=Zt(e.result?.plugins??[],e.query),n=t.featured.map(t=>Y(t,e)),r=t.official.map(t=>Y(t,e)),i=gn(e);return!n.length&&!r.length&&!t.connectors.length?h` ${i===m?X(x(`pluginsPage.noDiscoverMatchTitle`),x(`pluginsPage.noMatchBody`),`curious`):m} ${i} `:h` ${pn(x(`pluginsPage.featuredGroup`),n)} ${pn(x(`pluginsPage.officialGroup`),r)} ${vn(t.connectors,e)} ${i} `}function vn(e,t){if(e.length===0)return m;let n=ot.map(t=>({group:t,entries:e.filter(e=>e.group===t)})).filter(e=>e.entries.length>0);return E({title:x(`pluginsPage.connectorsGroup`),count:e.length,description:x(`pluginsPage.connectorsHint`)},n.map(e=>h`

${Gt(e.group)}

${e.entries.map(e=>fn(e,t))} `))}function yn(e){let t=e.detailPluginId?e.result?.plugins.find(t=>t.id===e.detailPluginId):void 0;if(!t)return m;let n=B(t.id),r=t.install?V(e,t.install):void 0,i=e.busy[n]||H(e,r);return h` e.onShowDetails(null)} >
${F(t.id,t.name,e.iconUrls[t.id],()=>e.onIconError(t.id),`plugins-cover`)}

${t.name}

${t.version?h`v${t.version}`:m} ${$t(t)}

${t.description||x(`pluginsPage.optionalCapability`)}

${t.installed?h` `:t.install?J(e,i,t.name,t.install,V(e,t.install)):m} ${t.removable?h` `:m}
${t.error?h``:m} ${q(n,e.messages[n],i,e,r)}
${t.origin?I(x(`pluginsPage.detailOrigin`),R(t.origin)):m} ${t.category?I(x(`pluginsPage.detailCategory`),rt(t.category)):m} ${t.packageName?I(x(`pluginsPage.detailPackage`),h`${t.packageName}`):m} ${I(x(`pluginsPage.detailPluginId`),h`${t.id}`)}
${t.installed?h`

${x(`pluginsPage.capabilities`)}

${e.detailInspectionError?h``:e.detailInspection?h` ${jt(e.detailInspection.declared)} ${Ft(e.detailInspection.grants,e.detailInspection.plugin.origin)} `:h``}
`:m}
`}function X(e,t,n){return h`
${n?h``:h``}

${e}

${t}

`}function bn(e){switch(e.activeTab){case`installed`:return dn(e);case`discover`:return _n(e);default:return e.activeTab}}function xn(e){let t=!!e.result,n=e.loading&&!t?`loading`:e.error&&!t?`error`:!e.connected&&!t?`offline`:`content`;return We(h`
e.onQueryChange(t.currentTarget.value)} /> ${e.activeTab===`installed`&&n===`content`?sn(e):m}
${e.mutationBlockedReason?h`
${e.mutationBlockedReason}
`:m} ${e.error?h``:m} ${e.pageNotice?h`
${e.pageNotice.text}
`:m} ${n===`loading`?h`
${x(`pluginsPage.loading`)}
`:n===`error`?m:n===`offline`?X(x(`pluginsPage.offlineTitle`),x(`pluginsPage.offlineBody`)):bn(e)}
${yn(e)} ${e.consent?zt({consent:e.consent,inspection:e.consentInspection,loading:e.consentInspectionLoading,error:e.consentInspectionError,iconUrl:e.consent.pluginId?e.iconUrls[e.consent.pluginId]:void 0,canMutate:e.canMutate,mutationBlockedReason:e.mutationBlockedReason,busy:!!e.busy[e.consent.intent.kind===`install`?e.consent.intent.installIdentity:e.consent.intent.rowKey],onCancel:e.onCancelConsent,onConfirm:e.onConfirmConsent,onRetry:e.onRetryConsentInspection}):m} `,{wide:!0})}var Z,Sn;function Q(){return(Q=e((()=>{g(),he(),ge(),je(),Be(),ke(),Ne(),Ge(),y(),se(),f(),s(),Ht(),O(),Z=[`all`,`enabled`,`disabled`,`issues`],Sn=new Intl.NumberFormat(void 0,{notation:`compact`,maximumFractionDigits:1})})))()}function Cn(e,t,n){let r=t.restartRequired?`pluginsPage.${e}Restart`:`pluginsPage.${e}Success`,i=`warnings`in t?t.warnings??[]:[];return{kind:`success`,text:[x(r,{name:t.plugin.name}),...i.map(e=>p(e)),n?x(`pluginsPage.configRefreshFailed`,{error:n}):null].filter(Boolean).join(` `)}}var wn;function Tn(){return(Tn=e((()=>{y(),f(),j(),s(),Dt(),M(),Q(),wn=class{constructor(e){this.host=e,this.consent=null,this.inspection=null,this.inspectionLoading=!1,this.inspectionError=null,this.mutationToken=0,this.mutationTokens=new Map,this.confirmedInstallScopes=new Map}reset(){this.close(),this.mutationTokens.clear(),this.confirmedInstallScopes.clear()}async runMutation(e,t,n,r={},i=t=>{this.host.setMessage(e,{kind:`error`,text:d(t)})}){let a=this.host.gateway.capture();if(!a||!this.host.canMutate()||this.host.isBusy(e)||r.confirm&&(!await r.confirm()||!this.host.gateway.isCurrent(a)||!this.host.canMutate()||this.host.isBusy(e)))return;this.host.clearPageNotice();let o=++this.mutationToken;this.mutationTokens.set(e,o);let s=()=>this.host.gateway.isCurrent(a)&&this.mutationTokens.get(e)===o,c=()=>s()&&this.mutationToken===o;this.host.setBusy(e,!0),r.preserveMessageWhilePending||this.host.setMessage(e,null);try{let e=await l(this.host.getContext().runtimeConfig,a.client,t,{canDispatch:()=>s()&&this.host.canMutate()});s()&&await n(e.value,e.refreshError,a.client,s,c)}catch(e){s()&&i(e,a)}finally{this.mutationTokens.get(e)===o&&(this.mutationTokens.delete(e),this.host.setBusy(e,!1))}}open(e,t,n){if(!this.host.canMutate())return;let r=this.host.getResult()?.plugins.find(e=>e.id===t);this.host.closeDetails(),this.inspection=null,this.inspectionError=null,this.inspectionLoading=!0,this.consent={intent:e,pluginId:t,fallback:{name:r?.name??t,...r?.version?{version:r.version}:{},...r?.origin===`official`?{official:!0}:{}},...n?{details:n}:{}},this.host.requestUpdate(),this.inspect()}close(){this.consent=null,this.inspection=null,this.inspectionLoading=!1,this.inspectionError=null,this.host.requestUpdate()}async inspect(){let e=this.consent,t=this.host.gateway.capture();if(!(!e?.pluginId||!t)){this.inspectionLoading=!0,this.inspectionError=null,this.host.requestUpdate();try{let n=await St(t.client,e.pluginId);this.host.gateway.isCurrent(t)&&this.consent===e&&(this.inspection=n)}catch(n){this.host.gateway.isCurrent(t)&&this.consent===e&&(this.inspectionError=d(n))}finally{this.host.gateway.isCurrent(t)&&this.consent===e&&(this.inspectionLoading=!1,this.host.requestUpdate())}}}confirm(){let e=this.consent?.intent,t=this.inspection?.reviewToken;!e||this.inspectionLoading||this.inspectionError||!t||(this.close(),e.kind===`install`?this.install({...e.request,acknowledgeCapabilities:{reviewToken:t}},e.installIdentity):this.updateEnabled(e.pluginId,!0,e.rowKey,{acknowledgeCapabilities:{reviewToken:t}}))}async install(e,t){let n=this.confirmedInstallScopes.get(t);this.confirmedInstallScopes.delete(t);let r=(e.acknowledgeInstallPolicyWarning===!0||e.acknowledgeCapabilities!==void 0)&&n&&this.host.gateway.isCurrent(n);await this.runMutation(t,t=>ee(t,e),async(e,n,r)=>{let i=B(e.plugin.id);this.host.applyMutationResult(e),i!==t&&this.host.setMessage(t,null),this.host.setMessage(i,Cn(`installed`,e,n)),await this.host.refreshCatalogAfterMutation(r)},{confirm:r?void 0:()=>wt(e),preserveMessageWhilePending:e.acknowledgeInstallPolicyWarning===!0},(n,r)=>{let i=Ct(n);if(i){this.confirmedInstallScopes.set(t,r),this.open({kind:`install`,request:e,installIdentity:t},i.pluginId,i);return}let a=Et(n);if(a){this.confirmedInstallScopes.set(t,r),this.host.setMessage(t,{kind:`warning`,text:a.reason,installPolicyWarning:{details:a,request:e}});return}this.host.setMessage(t,{kind:`error`,text:d(n)})})}async updateEnabled(e,t,n=B(e),r={}){await this.runMutation(n,n=>ce(n,e,t,r),async(e,r,i,a)=>{this.host.applyMutationResult(e),this.host.setMessage(n,Cn(t?`enabled`:`disabled`,e,r)),await this.host.refreshCatalogAfterMutation(i),a()&&!e.restartRequired&&this.host.getContext().gateway.connect()},{},r=>{let i=Ct(r);if(t&&i){this.open({kind:`enable`,pluginId:e,rowKey:n},i.pluginId,i);return}this.host.setMessage(n,{kind:`error`,text:d(r)})})}}})))()}var En;function Dn(){return(Dn=e((()=>{Pe(),Oe(),y(),le(),Je(),f(),de(),Q(),En=class{constructor(e){this.host=e,this.servers=null,this.message=null,this.busy=!1,this.formOpen=!1,this.configTask=new S(e.element,{autoRun:!1,args:()=>[this.host.gateway.connected?this.host.gateway.client:null,this.host.getContext()?.runtimeConfig??null],task:async([e,t])=>!e||!t?C:(await t.refresh(),t.state.lastError),onComplete:()=>{this.syncServers()},onError:()=>{this.syncServers()}}),this.subscriptions=new ue(e.element).effect(()=>this.host.getContext()?.runtimeConfig,e=>(this.syncServers(),e.subscribe(()=>this.syncServers())))}get refreshError(){let e=this.configTask.status===w.ERROR?d(this.configTask.error):this.configTask.status===w.COMPLETE?this.configTask.value:null;return e?x(`pluginsPage.configRefreshFailed`,{error:e}):null}get viewState(){return{mcpSettingsHref:Ee(`mcp`,this.host.getContext()?.basePath??``),mcpServers:this.servers,mcpMessage:this.message,mcpBusy:this.busy,mcpFormOpen:this.formOpen,onAddConnector:e=>void this.addConnector(e),onMcpToggle:(e,t)=>void this.toggleServer(e,t),onMcpRemove:e=>void this.removeServer(e),onMcpFormToggle:e=>{this.formOpen=e,e&&(this.message=null),this.host.element.requestUpdate()},onMcpAdd:e=>void this.addServer(e)}}disconnect(){this.subscriptions.clear()}invalidate(){this.configTask.run([null,this.host.getContext().runtimeConfig])}syncServers(){let e=this.host.getContext()?.runtimeConfig.state.configSnapshot;this.servers=Xe(ne(e)),this.host.element.requestUpdate()}resetMessage(){this.message=null,this.host.element.requestUpdate()}resetBusy(){this.busy=!1,this.host.element.requestUpdate()}ensureLoaded(e){e&&this.host.getContext()?.runtimeConfig.ensureLoaded().then(()=>this.syncServers())}pageError(e){let t=[e,this.refreshError].filter(e=>!!e);return t.length>0?t.join(` `):null}async refreshPage(e){await Promise.all([e(),this.refresh()])}async refresh(){let e=this.host.gateway.client;if(!e||!this.host.gateway.connected)return;let t=this.host.getContext().runtimeConfig;await this.configTask.run([e,t])}async addServer(e){let t=e.name.trim();if(!qe.test(t)){this.message={kind:`error`,text:x(`mcpServers.nameInvalid`)},this.host.element.requestUpdate();return}let n=ze(e.target,e.transport);if(!n){this.message={kind:`error`,text:x(`mcpServers.targetInvalid`)},this.host.element.requestUpdate();return}await this.mutateServers({buildPatch:e=>He(e,t,n),note:`plugins: add MCP server ${t}`,successText:x(`mcpServers.addedSuccess`,{name:t})})&&(this.formOpen=!1,this.host.element.requestUpdate())}async toggleServer(e,t){await this.mutateServers({buildPatch:n=>Ke(n,e,t),note:`plugins: ${t?`enable`:`disable`} MCP server ${e}`,successText:x(t?`mcpServers.enabledSuccess`:`mcpServers.disabledSuccess`,{name:e})})}async removeServer(e){await this.mutateServers({buildPatch:t=>Re(t,e),note:`plugins: remove MCP server ${e}`,successText:x(`mcpServers.removedSuccess`,{name:e})})}async addConnector(e){if(e.action.kind!==`mcp`)return;let t=e.action.mcp,n=qt(e.id),r=t.followUp===`oauth`?x(`pluginsPage.connectorAddedOauth`,{name:e.name,command:`openclaw mcp login ${t.serverName}`}):t.followUp===`endpoint`?x(`pluginsPage.connectorAddedEndpoint`,{name:e.name}):x(`pluginsPage.connectorAddedReady`,{name:e.name});await this.mutateServers({buildPatch:e=>He(e,t.serverName,structuredClone(t.config)),note:`plugins: add MCP connector ${t.serverName}`,successText:r,busyKey:n})&&(this.host.setRowMessage(n,{kind:`success`,text:r}),this.message=null,this.host.element.requestUpdate())}async mutateServers(e){if(!this.host.canMutate()||this.busy)return!1;let t=this.host.getContext().runtimeConfig;this.busy=!0,e.busyKey&&(this.host.setRowBusy(e.busyKey,!0),this.host.setRowMessage(e.busyKey,null)),this.message=null,this.host.element.requestUpdate();let n=t=>(e.busyKey?this.host.setRowMessage(e.busyKey,{kind:`error`,text:t}):(this.message={kind:`error`,text:t},this.host.element.requestUpdate()),!1);try{let r=await Ue(t,{buildPatch:e.buildPatch,note:e.note});return r.ok?(this.syncServers(),this.message={kind:`success`,text:e.successText},this.host.element.requestUpdate(),!0):n(r.error)}catch(e){return n(d(e))}finally{this.busy=!1,this.host.element.requestUpdate(),e.busyKey&&this.host.setRowBusy(e.busyKey,!1)}}}})))()}function On(e,t){if(!e)return e;let n=e.plugins.findIndex(e=>e.id===t.id),r=[...e.plugins];return n>=0?r[n]=t:r.push(t),{...e,plugins:r}}var $;function kn(){return(kn=e((()=>{Ie(),Pe(),g(),pe(),Oe(),we(),De(),ye(),ct(),y(),f(),j(),s(),lt(),oe(),et(),M(),Tn(),ft(),Dn(),O(),fe(),Q(),$=class extends ie{constructor(...e){super(...e),this.result=null,this.error=null,this.activeTab=`installed`,this.query=``,this.installedFilter=`all`,this.debouncedSearchQuery=``,this.busy={},this.messages={},this.detail=null,this.iconUrls={},this.pageNotice=null,this.routeDataConsumed=!1,this.normalizedLocation=``,this.searchTimer=null,this.iconMisses=new Set,this.iconRequests=new Map,this.iconAuthCandidates=[],this.gateway=new ut(this,{getGateway:()=>this.context?.gateway,onIdentityChange:()=>{this.result=null,this.error=null,this.messages={},this.pageNotice=null,this.mcpController.resetMessage()},invalidateRequests:e=>this.invalidateRequests(e.snapshot.phase!==`connected`||!e.snapshot.client),onSnapshot:e=>this.handleGatewaySnapshot(e)}),this.consentController=new wn({gateway:this.gateway,getContext:()=>this.context,getResult:()=>this.result,canMutate:()=>this.canMutate(),isBusy:e=>!!this.busy[e],setBusy:(e,t)=>this.setBusy(e,t),setMessage:(e,t)=>this.setMessage(e,t),clearPageNotice:()=>{this.pageNotice=null},closeDetails:()=>{this.detail=null},applyMutationResult:e=>this.applyMutationResult(e),refreshCatalogAfterMutation:e=>this.refreshCatalogAfterMutation(e),requestUpdate:()=>this.requestUpdate()}),this.catalogTask=new S(this,{autoRun:!1,args:()=>[this.gateway.connected?this.gateway.client:null],task:([e],{signal:t})=>e?e.request(`plugins.list`,{},{signal:t}):C,onComplete:e=>{this.replaceResult(e)},onError:e=>{this.error=d(e)}}),this.mcpController=new En({element:this,gateway:this.gateway,getContext:()=>this.context,canMutate:()=>this.canMutate(),setRowBusy:(e,t)=>this.setBusy(e,t),setRowMessage:(e,t)=>this.setMessage(e,t)}),this.searchTask=new S(this,{args:()=>[this.gateway.connected&&this.activeTab===`discover`?this.gateway.client:null,this.debouncedSearchQuery],task:async([e,t],{signal:n})=>!e||t.length<2?C:(await e.request(`plugins.search`,{query:t,limit:20},{signal:n})).results}),this.handleDocumentKeydown=e=>{if(!document.querySelector(`.shell-nav[aria-modal='true']`)&&e.key===`Escape`){if(this.consentController.consent){this.consentController.close(),e.stopPropagation();return}this.detail&&(this.detail=null,e.stopPropagation())}}}willUpdate(e){e.has(`routeData`)&&(this.applyRouteData(),this.syncCanonicalLocation())}connectedCallback(){super.connectedCallback(),document.addEventListener(`keydown`,this.handleDocumentKeydown,!0),this.syncCanonicalLocation()}disconnectedCallback(){document.removeEventListener(`keydown`,this.handleDocumentKeydown,!0),this.mcpController.disconnect(),this.clearSearchTimer(),this.resetPluginIcons(),super.disconnectedCallback()}handleGatewaySnapshot(e){let t=e.snapshot,n=xe({hello:t.hello,settings:{token:this.context.gateway.connection.token},password:this.context.gateway.connection.password}),r=n.length!==this.iconAuthCandidates.length||n.some((e,t)=>e!==this.iconAuthCandidates[t]);this.iconAuthCandidates=n;let i=!e.initial&&(e.identityChanged||e.connectionChanged||r)&&t.phase===`connected`&&this.routeDataConsumed;!e.initial&&r&&!e.identityChanged&&!e.connectionChanged&&(this.gateway.invalidate(),this.invalidateRequests(t.phase!==`connected`||!t.client)),!e.initial&&(e.identityChanged||e.connectionChanged||r)&&(this.resetPluginIcons(),this.busy={},this.mcpController.resetBusy(),this.debouncedSearchQuery=``),i?this.mcpController.refreshPage(()=>this.refreshCatalog()):this.ensureInitialData(),this.mcpController.ensureLoaded(t.phase===`connected`),!e.initial&&(e.identityChanged||e.connectionChanged||r)&&t.phase===`connected`&&this.activeTab===`discover`&&this.scheduleSearch()}applyRouteData(){let e=this.routeData;if(this.routeDataConsumed=!0,!e){this.ensureInitialData();return}let t=a(e.location,this.context.basePath);if(t!==this.activeTab&&this.changeTab(t),!this.gateway.isRouteDataCurrent(e)){this.ensureInitialData();return}this.replaceResult(e.result),this.error=e.error,this.ensureInitialData()}syncCanonicalLocation(){let e=this.context,t=this.routeData?.location;if(!e||!t)return;let n=u(t,e.basePath);if(!n){this.normalizedLocation=``;return}let r=`${t.pathname}${t.search}${t.hash}`;this.normalizedLocation!==r&&(this.normalizedLocation=r,e.replace(`plugins`,n))}invalidateRequests(e=!0){this.clearSearchTimer(),this.debouncedSearchQuery=``,e&&this.catalogTask.run([null]),this.mcpController.invalidate(),this.searchTask.run([null,``]),this.detail=null,this.consentController.reset()}replaceResult(e,t=!1){t?this.reconcilePluginIcons(e):this.resetPluginIcons(),this.result=e,this.syncPluginIcons()}reconcilePluginIcons(e){let t=new Set((e?.plugins??[]).filter(e=>e.hasIcon&&!D(e.id)).map(e=>e.id)),n={...this.iconUrls},r=!1;for(let[e,i]of Object.entries(n))t.has(e)||(URL.revokeObjectURL(i),delete n[e],r=!0);r&&(this.iconUrls=n);for(let[e,n]of this.iconRequests)t.has(e)||(clearTimeout(n.timeout),n.controller.abort(),this.iconRequests.delete(e));for(let e of this.iconMisses)t.has(e)||this.iconMisses.delete(e)}resetPluginIcons(){for(let e of this.iconRequests.values())clearTimeout(e.timeout),e.controller.abort();for(let e of Object.values(this.iconUrls))URL.revokeObjectURL(e);this.iconRequests.clear(),this.iconMisses.clear(),this.iconUrls={}}syncPluginIcons(){for(let e of this.result?.plugins??[])!e.hasIcon||D(e.id)||this.iconUrls[e.id]||this.iconMisses.has(e.id)||this.iconRequests.has(e.id)||this.fetchPluginIcon(e.id)}fetchPluginIcon(e){let t=new AbortController,n=setTimeout(()=>t.abort(new DOMException(`plugin icon fetch timed out`,`TimeoutError`)),1e4),r={controller:t,timeout:n};this.iconRequests.set(e,r),$e({pluginId:e,resourceBasePath:this.context.resourceBasePath,gatewayUrl:this.context.gateway.connection.gatewayUrl,auth:{hello:this.context.gateway.snapshot.hello,settings:{token:this.context.gateway.connection.token},password:this.context.gateway.connection.password},signal:t.signal}).then(t=>{if(this.iconRequests.get(e)!==r||!this.isConnected){t&&URL.revokeObjectURL(t);return}t?this.iconUrls={...this.iconUrls,[e]:t}:this.iconMisses.add(e)}).catch(()=>{this.iconRequests.get(e)===r&&this.iconMisses.add(e)}).finally(()=>{clearTimeout(n),this.iconRequests.get(e)===r&&this.iconRequests.delete(e)})}handlePluginIconError(e){this.invalidatePluginIcon(e),this.iconMisses.add(e)}invalidatePluginIcon(e){let t=this.iconRequests.get(e);t&&(clearTimeout(t.timeout),t.controller.abort(),this.iconRequests.delete(e));let n=this.iconUrls[e];n&&URL.revokeObjectURL(n);let r={...this.iconUrls};delete r[e],this.iconUrls=r,this.iconMisses.delete(e)}clearSearchTimer(){this.searchTimer&&=(clearTimeout(this.searchTimer),null)}get loading(){return this.gateway.connected&&this.catalogTask.status===w.PENDING}get searchResults(){return this.searchTask.status===w.COMPLETE&&this.debouncedSearchQuery===this.query.trim()?this.searchTask.value??null:null}get searchLoading(){return this.activeTab===`discover`&&this.debouncedSearchQuery.length>=2&&this.searchTask.status===w.PENDING}get searchError(){return this.searchTask.status===w.ERROR&&this.debouncedSearchQuery===this.query.trim()?d(this.searchTask.error):null}ensureInitialData(){!this.gateway.connected||!this.gateway.client||this.loading||this.result||this.error||this.routeData&&!this.routeDataConsumed||this.refreshCatalog()}async refreshCatalog(){let e=this.gateway.client;!e||!this.gateway.connected||(this.error=null,await this.catalogTask.run([e]))}selectHubTab(e){if(e===`installed`||e===`discover`){this.changeTab(e),this.context.navigate(`plugins`,{pathname:be(e,this.context.basePath)});return}this.context.navigate(e===`skills`?`skills`:`skill-workshop`)}changeTab(e){this.activeTab=e,this.clearSearchTimer(),this.debouncedSearchQuery=``,this.searchTask.run([null,``]),e===`discover`&&this.scheduleSearch()}changeQuery(e){this.query=e,this.clearSearchTimer(),this.debouncedSearchQuery=``,this.searchTask.run([null,``]),this.activeTab===`discover`&&this.scheduleSearch()}openClawHubSearch(e){this.query=e,this.changeTab(`discover`)}scheduleSearch(){let e=this.query.trim();e.length<2||!this.gateway.connected||!this.gateway.client||(this.searchTimer=setTimeout(()=>{this.searchTimer=null,this.searchClawHub(e)},300))}async searchClawHub(e){let t=this.gateway.client;!t||!this.gateway.connected||e.length<2||(this.debouncedSearchQuery=e,await this.searchTask.run([t,e]))}mutationBlockedReason(){if(!this.gateway.connected)return x(`pluginsPage.connectToChange`);let e=this.context.gateway.snapshot.hello?.auth??null;return Se(e)?this.result&&!this.result.mutationAllowed?x(`pluginsPage.changesDisabled`):null:x(`pluginsPage.adminRequired`)}canMutate(){return!!this.result?.mutationAllowed&&this.mutationBlockedReason()===null}setBusy(e,t){let n={...this.busy};t?n[e]=!0:delete n[e],this.busy=n}setMessage(e,t){let n={...this.messages};t?n[e]=t:delete n[e],this.messages=n}applyMutationResult(e){this.invalidatePluginIcon(e.plugin.id),this.replaceResult(On(this.result,e.plugin),!0)}async refreshCatalogAfterMutation(e){this.error=null,await this.catalogTask.run([e])}async showDetails(e){let t=e?{pluginId:e,inspection:null,error:null}:null;this.detail=t;let n=e?this.result?.plugins.find(t=>t.id===e):void 0;if(!n?.installed||!t)return;let r=this.gateway.capture();if(r)try{let e=await St(r.client,n.id);this.gateway.isCurrent(r)&&this.detail===t&&(this.detail={...t,inspection:e})}catch(e){this.gateway.isCurrent(r)&&this.detail===t&&(this.detail={...t,error:d(e)})}}updateEnabled(e,t,n){return this.consentController.updateEnabled(e,t,n)}async uninstall(e,t){let n=this.result?.plugins.find(t=>t.id===e)?.name??e;await this.consentController.runMutation(t,t=>c(t,e),async(e,t,n,r,i)=>{i()&&(this.pageNotice={kind:`success`,text:[x(`pluginsPage.removedRestart`,{name:e.pluginId}),...(e.warnings??[]).map(e=>p(e)),t?x(`pluginsPage.configRefreshFailed`,{error:t}):null].filter(Boolean).join(` `)}),await this.refreshCatalogAfterMutation(n)},{confirm:()=>Tt(n)})}render(){let e=this.mutationBlockedReason();return h` ${dt({active:this.activeTab,onSelect:e=>this.selectHubTab(e)})} ${st(h` ${xn({connected:this.gateway.connected,loading:this.loading,result:this.result,error:this.mcpController.pageError(this.error),activeTab:this.activeTab,query:this.query,installedFilter:this.installedFilter,searchResults:this.searchResults,searchLoading:this.searchLoading,searchError:this.searchError,busy:this.busy,messages:this.messages,detailPluginId:this.detail?.pluginId??null,detailInspection:this.detail?.inspection??null,detailInspectionError:this.detail?.error??null,consent:this.consentController.consent,consentInspection:this.consentController.inspection,consentInspectionLoading:this.consentController.inspectionLoading,consentInspectionError:this.consentController.inspectionError,iconUrls:this.iconUrls,canMutate:this.canMutate(),mutationBlockedReason:e,pageNotice:this.pageNotice,...this.mcpController.viewState,onQueryChange:e=>this.changeQuery(e),onFilterChange:e=>{this.installedFilter=e},onRefresh:()=>void this.mcpController.refreshPage(()=>this.refreshCatalog()),onIconError:e=>this.handlePluginIconError(e),onShowDetails:e=>void this.showDetails(e),onSetEnabled:(e,t,n)=>void this.updateEnabled(e,t,n),onInstall:(e,t)=>void this.consentController.install(e,t),onCancelConsent:()=>this.consentController.close(),onConfirmConsent:()=>this.consentController.confirm(),onRetryConsentInspection:()=>void this.consentController.inspect(),onDismissMessage:e=>this.setMessage(e,null),onUninstall:(e,t)=>void this.uninstall(e,t),onSearchClawHub:e=>this.openClawHubSearch(e)})} `)} `}},r([Fe({context:Te,subscribe:!0})],$.prototype,`context`,void 0),r([me({attribute:!1})],$.prototype,`routeData`,void 0),r([v()],$.prototype,`result`,void 0),r([v()],$.prototype,`error`,void 0),r([v()],$.prototype,`activeTab`,void 0),r([v()],$.prototype,`query`,void 0),r([v()],$.prototype,`installedFilter`,void 0),r([v()],$.prototype,`debouncedSearchQuery`,void 0),r([v()],$.prototype,`busy`,void 0),r([v()],$.prototype,`messages`,void 0),r([v()],$.prototype,`detail`,void 0),r([v()],$.prototype,`iconUrls`,void 0),r([v()],$.prototype,`pageNotice`,void 0),customElements.get(`openclaw-plugins-page`)||customElements.define(`openclaw-plugins-page`,$)})))()}kn(); //# sourceMappingURL=plugins-page-BxDMYkHC.js.map