import{j as r,A as d,m as f}from"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f5.js";import{r as s}from"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f.js";import{a as u}from"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f22.js";import{u as x}from"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f4.js";import{o as g}from"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f66.js";import{u as b}from"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f46.js";import{I as i,A as y,X as h,j as N,T as v}from"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f6.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f8.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f23.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f3.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f7.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f9.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f10.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f2.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f20.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f45.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f47.js";import"./v_7_4_3_35_4ab187d4-286d-4a55-8ea4-8375ea3c1d1f11.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};
