"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("clsx"),r=require("react-transition-group"),n=require("@prom-ui/core/Portal");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var c=i(e),a=o(t);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}function p(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var d={root:"L79vP",content:"iYzO5","root_position_top-center":"dpKTy","root_position_bottom-center":"i5-KH","root_position_top-left":"IWQhD","root_position_top-right":"eg0lI","root_position_bottom-left":"kn1Ep","root_position_bottom-right":"pH0zF",enterActive:"mFMbv",exitActive:"Lga9O",enter:"a7Z-S",exit:"_4JiHm"},b=["isOpen","onClose","onOpened","onClosed","children","className","style","position","zIndex","padding","autoCloseDelay","isRenderPortal"],y=c.forwardRef((function(e,t){var o=e.isOpen,i=e.onClose,u=e.onOpened,s=e.onClosed,y=e.children,O=e.className,v=e.style,m=e.position,g=void 0===m?"bottom-center":m,j=e.zIndex,P=void 0===j?5e3:j,_=e.padding,h=void 0===_?"12px 16px":_,E=e.autoCloseDelay,x=void 0===E?2e3:E,w=e.isRenderPortal,S=void 0===w||w,k=p(e,b),D=c.useRef(void 0),C=g?d["root_position_".concat(g)]:void 0,N=function(){clearTimeout(D.current)},q=function(){N(),x>0&&(D.current=setTimeout((function(){"function"==typeof i&&i()}),x))},z=function(){N()},I=function(){"function"==typeof u&&u(),q()};return c.useEffect((function(){return o&&I(),function(){z()}}),[]),c.createElement(r.CSSTransition,{in:o,timeout:125,classNames:d,unmountOnExit:!0,onEntered:I,onExit:z,onExited:s},c.createElement(n.Portal,{isActive:S},c.createElement("div",f({className:a.default(d.root,C),ref:t,style:{zIndex:P},role:"presentation","data-testid":"snackbar","data-qaid":"snackbar"},k),c.createElement("div",{className:a.default(d.content,O),style:l({padding:h},v),role:"alert",onMouseEnter:N,onMouseLeave:q},y))))}));y.displayName="SnackBar",exports.SnackBar=y,require("./style.production.css");
