import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{c as n,s as r}from"./emotion-styled.browser.esm.DmHEQgFq.js";import{$ as i}from"./protobuf.Cj15o6C6.js";import{t as a}from"./useEmotionTheme.tyjAwN1A.js";import{i as o}from"./ErrorElement.BlvlqstC.js";import{Jt as s,Ot as c}from"./index.D3kRk1xg.js";var l=e(t(),1);function u({element:e}){let{body:t,icon:u,duration:d}=e,f=a();(0,l.useEffect)(()=>{if(f.inSidebar)return;let e=i(d)?d===0?void 0:d*1e3:4e3,n=c.add({body:t,icon:u||void 0},{timeout:e});return()=>{c.close(n)}},[]);let p=n(s,{kind:o.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return n(r,{children:f.inSidebar&&p})}var d=(0,l.memo)(u);export{d as default};