import{j as r,A as d,m as f}from"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d65.js";import{r as s}from"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d6.js";import{a as u}from"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d622.js";import{u as x}from"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d64.js";import{o as g}from"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d667.js";import{u as b}from"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d647.js";import{I as i,A as y,X as h,j as N,T as v}from"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d66.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d68.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d623.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d63.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d62.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d67.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d69.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d610.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d620.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d646.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d648.js";import"./v_7_4_3_26_c99b3fd5-4d99-426a-8862-d508d2f3e0d611.js";function q(){const l=x(e=>e.language),{inbox:o,setViews:n}=u(b(e=>({inbox:e.inbox.active,setViews:e.setViews})));if(!o)return null;const t=s.useMemo(()=>{let e="var(--primaria)",a=i;switch(o.type){case"ALERT":e="var(--primaria)",a=v;break;case"PROMOTION":e="var(--secundaria)",a=N;break;default:e="var(--primaria)",a=i;break}return{Icon:a,color:e,style:{backgroundColor:`color-mix(in srgb, ${e}, transparent 90%)`,borderColor:`color-mix(in srgb, ${e}, transparent 80%)`,color:`color-mix(in srgb, ${e}, black 40%)`},buttonStyle:{backgroundColor:e,color:"#ffffff",borderColor:e}}},[o.type]),c=s.useMemo(()=>o.statement.replace(/_(.*?)_/g,'<span class="italic font-medium opacity-90">$1</span>').replace(/\*(.*?)\*/g,'<strong class="font-bold opacity-100">$1</strong>').replace(/\n/g,"<br>"),[o.statement]),m=()=>{o.redirect==="EXTERNAL"?window.open(o.link,"_blank"):g(o.whatsapp,o.menssage)},p=e=>{e.stopPropagation(),n("inbox",o.id)};return r.jsx("div",{className:"bg-gray-200 dark:bg-neutral-800 w-full py-2 px-3",children:r.jsx(d,{mode:"wait",children:r.jsx(f.div,{initial:{opacity:0,y:-10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.3,type:"spring",stiffness:200},className:"relative w-full border flex flex-col overflow-hidden",children:r.jsxs("div",{className:"flex p-3 gap-3 items-start",children:[r.jsx("div",{className:"flex-shrink-0 pt-0.5",children:r.jsx(t.Icon,{size:20,style:{color:t.color},className:"animate-pulse"})}),r.jsxs("div",{className:"flex-1 flex flex-col gap-2 min-w-0",children:[r.jsx("div",{className:"text-sm leading-snug",dangerouslySetInnerHTML:{__html:c}}),o.redirect!=="NONE"&&r.jsxs("button",{onClick:m,className:"self-start text-xs font-semibold px-3 py-1.5 rounded-md border flex items-center gap-1 mt-1 cursor-pointer transition-all hover:scale-105 active:scale-95",style:t.buttonStyle,children:[o.btnName||l.cliqueAqui,r.jsx(y,{size:12})]})]}),r.jsx("button",{onClick:p,className:"flex-shrink-0 -mt-1 -mr-1 p-1.5 opacity-50 hover:opacity-100 transition-opacity cursor-pointer",style:{color:t.color},children:r.jsx(h,{size:16})})]})},o.id)})})}export{q as default};
