import{Qr as e}from"./src-BOCweS1p.js";import{r as t}from"./lib-MoKmYgcO.js";import{r as n}from"./skill-utils-9ttn5Q5l.js";var r=t({label:{id:`composer.pluginMention.browserUse.label`,defaultMessage:`Browser`,description:`Short display label for the Browser plugin in mention chips, mention menus, and settings.`},restrictedAvailabilityDescription:{id:`settings.browserPlugin.restrictedAvailabilityDescription`,defaultMessage:`Disabled by your organization or unavailable in your region`,description:`Description shown when the Browser or Google Chrome plugin is unavailable because access is restricted.`}});function i(e){let t=e.interface?.shortDescription;if(t!=null&&t.trim().length>0)return t;let{short_description:n,shortDescription:r}=e;return n??r??e.description}var a=`computer-use`,o=`app://`,s=`agent://`,c=`mcp-resource://`,l=`plugin://`,u=`subagent://`,d=t({computerUse:{id:`composer.pluginMention.computerUse.label`,defaultMessage:`Computer`,description:`Short display label for the Computer Use plugin in mention chips and mention menus.`}});function f(e){let t=e.toLowerCase().replace(/[^a-z0-9]/g,`-`).replace(/^-+|-+$/g,``);return t===``?`app`:t}function p(e){return`${o}${e}`}function m(e){return`${s}${e}`}function h(e){return`${u}${e}`}function g(e){return`${l}${e.trim()}`}function _({resourceUri:e,server:t}){return`${c}${encodeURIComponent(t)}/${encodeURIComponent(e)}`}function v(e){return e.startsWith(o)}function y(e){return e.startsWith(s)}function b(e){return e.startsWith(u)}function x(e){return e.startsWith(l)}function S(e){if(!e.startsWith(c))return null;let t=e.slice(15),n=t.indexOf(`/`);if(n===-1)return null;try{let e=decodeURIComponent(t.slice(0,n)),r=decodeURIComponent(t.slice(n+1));return e.length===0||r.length===0?null:{resourceUri:r,server:e}}catch{return null}}function C(t){if(!y(t))return null;let n=t.slice(8).trim();return n.length===0?null:e(n)}function w(e){if(!b(e))return null;let t=e.slice(11).trim();return t.length===0?null:t}function T(e){return v(e)?`app`:x(e)?`plugin`:`skill`}function E({href:e,label:t}){return y(e)||b(e)?`agent`:x(e)?`plugin`:S(e)==null?v(e)?`app`:t.trim().startsWith(`$`)?`skill`:`text`:`mcp-resource`}function D(e){let t=e.trim();return(t.startsWith(`$[`)||t.startsWith(`@[`))&&t.endsWith(`]`)?t.slice(2,-1):t.startsWith(`$`)||t.startsWith(`@`)?t.slice(1):t}function O(e){return{name:e.name,displayName:n(e),path:e.path,description:i(e),iconSmall:e.interface?.iconSmall??``}}function k(e){return{name:f(e.name),displayName:e.name,path:p(e.id),description:e.description??``,iconSmall:e.logoUrl??e.logoUrlDark??``}}function A(e,t=I()){let n=e.plugin.name,r=e.displayName??n,i=n;return n===`browser`?(r=t.browserUse,i=r):n===`computer-use`&&(r=t.computerUse,i=r),{name:i,displayName:r,path:g(e.plugin.id),description:e.description??``,iconSmall:j(e),brandColor:L(e.plugin.interface)}}function j(e){return e.composerIconPath??e.logoPath??``}function M(e){return{kind:`skill`,...O(e)}}function N(e){return{kind:`app`,...k(e)}}function P(e,t){return{kind:`plugin`,...A(e,t)}}function F(e){return{browserUse:e.formatMessage(r.label),computerUse:e.formatMessage(d.computerUse)}}function I(){return{browserUse:r.label.defaultMessage,computerUse:d.computerUse.defaultMessage}}function L(e){let t=e?.brandColor;if(!(t==null||t.length===0))return t}function R({conversationId:e,displayName:t}){let n=B(t);return{kind:`agent`,name:n.toLowerCase(),displayName:n,conversationId:e,path:m(e)}}function z(e){return{kind:`agent`,name:e.roleName,displayName:e.roleName,path:h(e.roleName)}}function B(e){let t=e.trim();return t.startsWith(`@`)?t.slice(1).trim():t}export{b as C,r as D,i as E,v as S,a as T,F as _,C as a,w as b,k as c,N as d,P as f,j as g,D as h,z as i,A as l,T as m,R as n,S as o,M as p,p as r,_ as s,f as t,O as u,g as v,x as w,y as x,E as y};
//# sourceMappingURL=mention-item-C-utQkFh.js.map