import{b as t,d as o}from"./c6eedc03a-C8LSdtro.js";import{r as e}from"./vendor-react-AXa6hZO5.js";import{B as r,D as i}from"./index-D35RxkWr.js";import"./vendor-intl-BdADXLLt.js";import"./vendor-lodash-D-zrMTUO.js";import"./vendor-zod-1gcJXWab.js";import"./vendor-zustand-CcZsBpBq.js";import"./vendor-icons-DsiQAprm.js";import"./vendor-motion-DGh7M6mr.js";import"./vendor-radix-jAWPQP1f.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-router-B4CxQ1po.js";import"./vendor-query-B8PP3rYl.js";import"./vendor-growthbook-XJcBFzji.js";import"./c365fd3fe-Dmpsm876.js";import"./c70a3d12b-BI7Bbafv.js";import"./vendor-luxon-Y8l99kBI.js";import"./tree-sitter-BFuuT2ac.js";const s=e.memo(({content:s,enabled:n,onDismiss:a,onAction:p})=>{const d=s,c=r(t=>t.setChatTooltip),m=r(t=>t.clearChatTooltip),j=i(),l=t(),v=e.useCallback(()=>{if(!d.ctaAction)return;const{type:t,value:e}=d.ctaAction;if("model"===t)j(e);else if("href"===t){e.startsWith("http://")||e.startsWith("https://")?o({href:e,desktopBehavior:"open-in-browser"}):l.push(e)}p({actionType:t,actionValue:e}),m(!0)},[d.ctaAction,j,l,p,m]);return e.useEffect(()=>{if(n)return c(d.type,d.nuxText,{badgeText:d.nuxBadgeText,cta:d.ctaAction?{text:d.ctaAction.text,onClick:v}:void 0,onDismiss:a}),()=>{m(!0)};m(!0)},[n,d,c,m,v,a]),null});s.displayName="ChatTooltipV1";export{s as ChatTooltipV1};
