!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={3081:(e,r,t)=>{t.d(r,{A:()=>s,o:()=>a});var o=t(2015);const n=(0,o.createContext)(null),a=()=>(0,o.useContext)(n),s=n},5097:(e,r,t)=>{t(1116),t(6842),t(9087),t(9558),t(2183)},2183:(e,r,t)=>{t(9558),t(5812),t(806);const o=require("browser-tabs-lock");var n=t.n(o);require("js-cookie");t(8041),t(9891),t(5097),t(8853);new(n())},9087:(e,r,t)=>{t.d(r,{clearSnackbarMessage:()=>s});t(2462),t(1116),t(806);var o=t(8041),n=t.n(o);t(9236),t(6842),t(9558),t(5097),t(2183),t(3209);n().escapeQuerySpace=!1;const a=e=>r=>({type:e,payload:r}),s=(a("RESET_LOADING"),a("START_LOADING"),a("STOP_LOADING"),()=>e=>{e(a("CLEAR_SNACKBAR_MESSAGE")({}))})},3209:(e,r,t)=>{t.d(r,{UE:()=>o});const o=2e3},8853:()=>{require("spark-md5"),require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto)},9558:(e,r,t)=>{t.d(r,{empty:()=>o});t(5812),t(8041);const o=e=>null==e||("string"==typeof e?0===e.trim().length:Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length)},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8177:e=>{e.exports=require("@mui/icons-material/CheckCircle")},1519:e=>{e.exports=require("@mui/icons-material/Error")},8619:e=>{e.exports=require("@mui/material")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9891:e=>{e.exports=require("idtoken-verifier")},5812:e=>{e.exports=require("moment-timezone")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")},806:e=>{e.exports=require("superagent/lib/client")},9236:e=>{e.exports=require("sweetalert2")},8041:e=>{e.exports=require("urijs")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};t.r(o),t.d(o,{default:()=>x,useSnackbarMessage:()=>m.o});var n=t(2015),a=t.n(n);const s=require("react-redux");var i=t(9825),c=t.n(i),u=t(8619),p=t(8177),l=t.n(p),d=t(1519),y=t.n(d),m=t(3081),b=t(3209),f=t(9558),g=t(9087);const h=({children:e,snackbarMessage:r,clearSnackbarMessage:t})=>{const[o,s]=(0,n.useState)(!1),[i,c]=(0,n.useState)({}),p=e=>c({html:e,type:"success"}),d=e=>c({html:e,type:"warning"}),g=(0,n.useMemo)((()=>({successMessage:p,errorMessage:d})),[]),h=()=>{c({}),t()},x=()=>{s(!1),setTimeout(h,b.UE)};return(0,n.useEffect)((()=>{(0,f.empty)(i.html)?s(!1):s(!0)}),[i]),(0,n.useEffect)((()=>{(0,f.empty)(null==r?void 0:r.html)||c(r)}),[r]),a().createElement(m.A.Provider,{value:g},a().createElement(u.Snackbar,{open:o,onClose:x,anchorOrigin:{vertical:"top",horizontal:"center"},autoHideDuration:b.UE},a().createElement(u.Alert,{onClose:x,severity:i.type,variant:"filled",sx:{width:"100%",backgroundColor:`${i.type}.light`},iconMapping:{success:a().createElement(l(),{fontSize:"inherit"}),error:a().createElement(y(),{fontSize:"inherit"})}},a().createElement(u.Typography,{variant:"body1",component:"div",dangerouslySetInnerHTML:{__html:i.html}}))),e)};h.propTypes={children:c().node,snackbarMessage:c().object};const x=(0,s.connect)((({baseState:e})=>({snackbarMessage:e.snackbarMessage})),{clearSnackbarMessage:g.clearSnackbarMessage})(h);return o})()));
//# sourceMappingURL=snackbar-notification.js.map