import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import o from"@babel/runtime/helpers/slicedToArray";import{jsx as n}from"react/jsx-runtime";import{useState as e,useEffect as i}from"react";import{v4 as c}from"uuid";import{Notifications as f}from"./Notifications.js";function u(r,t){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),o.push.apply(o,n)}return o}function a(t){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?u(Object(n),!0).forEach((function(o){r(t,o,n[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var s=3e3,p=function(){var r=e([]),u=o(r,2),s=u[0],p=u[1],m=function(r){p((function(o){return[].concat(t(o),[r])}))},b=function(r){p((function(t){return t.filter((function(t){return t.id!==r}))}))},l=function(r,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={info:"Info",error:"Error",warning:"Warning",success:"Success"},e=a({autoHideDuration:3e3,content:t||n[r]||"info",id:c(),variant:r},o);return m(e),e.id},O=function(r,t){return l("success",r,t)},w=function(r,t){return l("error",r,t)},y=function(r,t){return l("warning",r,t)},h=function(r,t){return l("info",r,t)},j=function(r,t){return l("info",r,t)};return i((function(){window[Symbol.for("notificationToasts")]={createNotification:m,removeNotification:b,showErrorNotification:w,showInfoNotification:h,showNeutralNotification:j,showSuccessNotification:O,showWarningNotification:y}}),[]),n(f,{notifications:s,removeNotification:b})};export{s as DEFAULT_AUTO_HIDE_DURATION,p as NotificationsContainer};
//# sourceMappingURL=NotificationsContainer.js.map
