import{a as t,e}from"./ca9c256b9-7brFE8T2.js";import{r as o}from"./vendor--leCAzSo.js";import{w as i,x as s}from"./index-DZuQva-j.js";import"./c723dd3dd-58n3MxoB.js";import"./c57c2877c-dpgWZiV5.js";import"./cb5cdda9a-CSfiLIa6.js";import"./c51e217b4-KUwQQl_W.js";import"./tree-sitter-BFuuT2ac.js";const a=o.memo(({content:a,enabled:c,onDismiss:r,onAction:n})=>{const p=a,m=i(t=>t.setChatTooltip),d=i(t=>t.clearChatTooltip),l=s(),f=t(),h=o.useCallback(()=>{if(!p.ctaAction)return;const{type:t,value:o}=p.ctaAction;if("model"===t)l(o);else if("href"===t){o.startsWith("http://")||o.startsWith("https://")?e({href:o,desktopBehavior:"open-in-browser"}):f.push(o)}n({actionType:t,actionValue:o}),d(!0)},[p.ctaAction,l,f,n,d]);return o.useEffect(()=>{if(c)return m(p.type,p.nuxText,{badgeText:p.nuxBadgeText,cta:p.ctaAction?{text:p.ctaAction.text,onClick:h}:void 0,onDismiss:r}),()=>{d(!0)};d(!0)},[c,p,m,d,h,r]),null});a.displayName="ChatTooltipV1";export{a as ChatTooltipV1};
