"use client";
import{b as d}from"./chunk-3CFS53KS.js";import{a as s,b as u}from"./chunk-OS26ANJQ.js";import{e as f}from"./chunk-CLTGASR6.js";import{a as c,m as n}from"./chunk-3CHPBNY2.js";import{s as t}from"./chunk-KEPQUAOX.js";import{forwardRef as B,useCallback as E,useEffect as w,useState as I}from"react";import{faClose as N}from"@fortawesome/free-solid-svg-icons";import{FontAwesomeIcon as W}from"@fortawesome/react-fontawesome";import C from"clsx";var k=c("EulToast",["root","alert","compact"]),T=o=>f("EulToast",{alert:["alert"],compact:["compact"],root:[o.variant,"root"]}),a=k;import{css as v}from"@emotion/react";var x=n(t)(({theme:o})=>v`
    position: fixed;
    top: ${o.spacing(4)};
    right: ${o.spacing(4)};
    z-index: ${o.zIndex.modal};
    display: flex;
    flex-direction: column;
    gap: ${o.spacing(1)};
    align-items: flex-end;
    width: ${o.spacing(75)};

    .${a.alert} {
      background: ${o.palette.background[400]};
    }

    &.${a.compact} {
      .${s.title}, .${s.description}, .${s.action} {
        font-size: ${o.spacing(3)};
      }
    }
  `);import{jsx as r,jsxs as F}from"react/jsx-runtime";var e=B(({alert:o,className:g,dismiss:$,duration:P=3e3,onDismiss:l,variant:y},S)=>{let p=T({variant:y}),[b,i]=I(!0),m=E(()=>{i(!1),l?.()},[i,l]);return w(()=>{setTimeout(()=>{m()},P)},[]),b?F(x,{className:C(g,p.root),ref:S,children:[$?r(d,{onClick:m,size:"small",startIcon:r(W,{icon:N}),variant:"ghost"}):null,r(t,{className:C(p.alert),children:r(u,{...o})})]}):null});e.defaultProps={variant:"normal"};e.displayName="Toast";var A=e;export{a,A as b};
