import{theme as e}from"../../../theme/dist/esm/index.js";import*as o from"react";import{toast as t}from"./toast.class.js";import{ColorModeContext as r}from"../../../color-mode/dist/esm/color-mode-provider.js";import{useChakra as s}from"../../../system/dist/esm/hooks.js";import{Alert as l,AlertIcon as i,AlertTitle as d,AlertDescription as m}from"../../../alert/dist/esm/alert.js";import{ThemeProvider as a}from"../../../system/dist/esm/providers.js";import{isFunction as n}from"../../../utils/dist/esm/assertion.js";import{chakra as c}from"../../../system/dist/esm/system.js";import{CloseButton as p}from"../../../close-button/dist/esm/close-button.js";import{noop as u}from"../../../utils/dist/esm/function.js";function f(){return(f=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}var g=e=>{var{status:t,variant:r,id:s,title:a,isClosable:n,onClose:u,description:f}=e;return o.createElement(l,{status:t,variant:r,id:s,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},o.createElement(i,null),o.createElement(c.div,{flex:"1",maxWidth:"100%"},a&&o.createElement(d,null,a),f&&o.createElement(m,{display:"block"},f)),n&&o.createElement(p,{size:"sm",onClick:u,position:"absolute",insetEnd:1,top:1}))},v={theme:e,colorMode:"light",toggleColorMode:u,setColorMode:u,defaultOptions:{duration:5e3,position:"bottom",variant:"solid"}};function M(e){var{theme:s=v.theme,colorMode:l=v.colorMode,toggleColorMode:i=v.toggleColorMode,setColorMode:d=v.setColorMode,defaultOptions:m=v.defaultOptions}=void 0===e?v:e,c=(e,t)=>o.createElement(a,{theme:s},o.createElement(r.Provider,{value:{colorMode:l,setColorMode:d,toggleColorMode:i}},n(t.render)?t.render(e):o.createElement(g,f({},e,t)))),p=e=>{var o=f({},m,e);return t.notify((e=>c(e,o)),o)};return p.close=t.close,p.closeAll=t.closeAll,p.update=(e,o)=>{if(e){var r=f({},m,o);t.update(e,f({},r,{message:e=>c(e,r)}))}},p.isActive=t.isActive,p}function h(e){var{theme:t,setColorMode:r,toggleColorMode:l,colorMode:i}=s();return o.useMemo((()=>M({theme:t,colorMode:i,setColorMode:r,toggleColorMode:l,defaultOptions:e})),[t,r,l,i,e])}export default h;export{M as createStandaloneToast,v as defaultStandaloneParam,h as useToast};
//# sourceMappingURL=use-toast.js.map
