import{r as o,j as a}from"./vendor-react-Dp9pL_Wn.js";import{a as r}from"./cd27d5348-ivimUdOU.js";import{o as t,e as i,s as e,n as s,b as n}from"./vendor-zod-DIcz3Rbr.js";import{a6 as c,o as m,D as p,a7 as d}from"./c4b350ac1-KLFM4jkb.js";import{u as l,e as j,C as u}from"./vendor-ant-cds-DvTmcYA1.js";import{m as v}from"./vendor-motion-D7Z1qgzM.js";import"./ca8998c31-P9hjFFxa.js";import"./c62933a29-Bny4k5NF.js";import"./cdabaac79-3sBTRaya.js";import"./ca4e68303-2GEI1XEE.js";import"./ce5824dc6-DCrxq2nV.js";import"./c5decd681-BZUxtT_J.js";import"./ca9bd5d1a-BwvQdQH8.js";import"./c1f96d614-CNpmgQ8l.js";import"./c393cb7f5-HUvLXarC.js";import"./ccca85712-CxU_jF8g.js";import"./c0f96d0e0-DGUPaEDS.js";import"./vendor-base-ui-CdQU4JQh.js";import"./vendor-radix-D3USJ4lr.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-intl-BDR1NhN_.js";import"./vendor-zustand-CI9omAwJ.js";import"./vendor-icons-BBStP_8q.js";import"./vendor-lodash-CIro4mst.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-DgCRID2b.js";import"./vendor-luxon-Y8l99kBI.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-growthbook-C66YtMMX.js";import"./vendor-virtual-DRz8lJfQ.js";const f=t({title:e(),body:e(),imageUrl:e().optional(),imageUrlDark:e().optional(),pictogramName:e().optional(),pictogramAnimated:n().optional(),pictogramSize:i(["sm","md","lg"]).optional().catch(void 0),pictogramBackground:i(["alpha-1","surface-0","surface-1","surface-2","surface-3"]).optional().catch(void 0),imageFit:i(["cover","contain"]).optional(),imageHeight:s().optional().catch(void 0),cardWidth:s().optional().catch(void 0),buttonText:e(),buttonHref:e(),ctaType:i(["href","cowork-upsell"]).optional()}),g=o.memo(({content:t,enabled:i,onDismiss:e,onAction:s})=>{const n=f.safeParse(t),g=l(50),b=j(),h=n.success?n.data.buttonHref:"",k=/^https?:\/\//i.test(h),x=k?h:c(h),C=o.useCallback(o=>{k&&(o.preventDefault(),m({href:x})),s()},[s,k,x]),y=o.useCallback(()=>{},[]),D=o.useCallback(o=>{o.preventDefault(),o.stopPropagation(),e()},[e]);if(!i||!n.success)return null;const w={...n.data,imageUrl:"dark"===b&&n.data.imageUrlDark?n.data.imageUrlDark:n.data.imageUrl};return a.jsx(v.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"fixed bottom-10 right-10",style:{zIndex:g},children:a.jsx(u,{children:a.jsx(p,{href:x,webBehavior:k?"new-tab":"navigate",desktopBehavior:k?"open-in-browser":"navigate",rel:"noreferrer",onClick:C,className:"block cursor-pointer",children:a.jsx(r,{content:w,onCtaClick:y,onDismiss:D,ImageComponent:d})})})})});g.displayName="CoworkNudgeV1";export{g as CoworkNudgeV1};
