import{o as t}from"./rolldown-runtime-iuO8RvI4.js";import{fn as o,vn as n}from"./vendor-all-0-fRSUBfCr.js";import{Mi as r,ki as s}from"./vendor-frame-CwiylG4Y.js";import{Nm as i,Th as e}from"./shared-1-3-6x7RKF.js";import{r as a}from"./shared-6-Cf_fMhRZ.js";import{rn as m}from"./vendor-all-2-BJdkbLSj.js";var l=t(r()),f=s(),u=o({text:n().min(1),buttonText:n().min(1).optional(),buttonHref:n().min(1).optional()});function c(t,o){const n=i({id:t,intl:o});return"string"==typeof n&&n.trim()?n:t}function d({content:t,enabled:o,onDismiss:n,onAction:r}){const s=m(),i=(0,l.useCallback)(()=>{r()},[r]);if(!o)return null;const d=u.safeParse(t);if(!d.success)return null;const{text:p,buttonText:v,buttonHref:b}=d.data,j=void 0!==b&&/^https?:\/\//i.test(b),h=void 0!==v&&void 0!==b?{children:c(v,s),href:j?b:e(b),onLinkClick:i}:void 0;return(0,f.jsx)(a,{message:c(p,s),button:h,onDismiss:n})}export{d as MessageBanner};