1import{o as e}from"./chunk.DuxOD-Sk.js";import{r as t}from"./emotion-is-prop-valid.esm.DV_OErv-.js";import{a as n}from"./isLength.DwwZub7z.js";import{C as r,E as i,w as a}from"./getColors.DUygtxH4.js";import{a as o,c as s,d as c,f as l,l as u,p as d,u as f}from"./ErrorElement.BPchO-rz.js";var p=e(t()),m=e(n());a();function h(e){"@babel/helpers - typeof";return h=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},h(e)}var g=[`onClose`,`children`,`key`];function _(e,t){return b(e)||y(e,t)||E(e,t)||v()}function v(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function b(e){if(Array.isArray(e))return e}function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x.apply(this,arguments)}function S(e,t){if(e==null)return{};var n=C(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function C(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function w(e){return O(e)||D(e)||E(e)||T()}function T(){throw TypeError(`Invalid attempt to spread non-iterable instance. 3In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E(e,t){if(e){if(typeof e==`string`)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k(e,t)}}function D(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function O(e){if(Array.isArray(e))return k(e)}function k(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?A(Object(n),!0).forEach(function(t){H(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function M(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function P(e,t,n){return t&&N(e.prototype,t),n&&N(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function F(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&I(e,t)}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}function L(e){var t=B();return function(){var n=V(e),r;if(t){var i=V(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return R(this,r)}}function R(e,t){if(t&&(h(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return z(e)}function z(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function B(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}
3function V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},V(e)}function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var U,W=function(e){F(n,e);var t=L(n);function n(e){var r;return M(this,n),r=t.call(this,e),H(z(r),`state`,{isMounted:!1,toasts:[]}),H(z(r),`dismissHandlers`,{}),H(z(r),`toastId`,0),H(z(r),`getToastProps`,function(e){var t=r.props,n=t.autoFocus,i=t.autoHideDuration,a=t.closeable,o=e.key||`toast-${r.toastId++}`;return j(j({autoFocus:n,autoHideDuration:i,closeable:a},e),{},{key:o})}),H(z(r),`show`,function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(r.state.toasts.map(function(e){return e.key}).includes(e.key))return r.update(e.key,e),e.key;var t=r.getToastProps(e);return r.setState(function(e){var n=e.toasts;return{toasts:[].concat(w(n),[t])}}),t.key}),H(z(r),`update`,function(e,t){r.setState(function(n){return{toasts:n.toasts.map(function(n){return n.key===e?j(j(j({},n),r.getToastProps(j({autoHideDuration:n.autoHideDuration},t))),{},{key:e},r.props.resetAutoHideTimerOnUpdate?{__updated:(+n.__updated||0)+1}:{}):n})}})}),H(z(r),`dismiss`,function(e){r.dismissHandlers[e]&&r.dismissHandlers[e]()}),H(z(r),`clearAll`,function(){Object.keys(r.dismissHandlers).forEach(function(e){r.dismissHandlers[e]()})}),H(z(r),`clear`,function(e){e===void 0?r.clearAll():r.dismiss(e)}),H(z(r),`internalOnClose`,function(e){delete r.dismissHandlers[e],r.setState(function(t){return{toasts:t.toasts.filter(function(t){return t.key!==e})}})}),H(z(r),`getOnCloseHandler`,function(e,t){return function(){r.internalOnClose(e),typeof t==`function`&&t()}}),H(z(r),`renderToast`,function(e){var t=e.onClose,n=e.children,a=e.key,c=S(e,g),l=r.props.overrides,d=l.ToastBody,m=l.ToastCloseIcon,h=l.ToastInnerContainer,_=i(i({Body:s,CloseIcon:u,InnerContainer:f},{Body:d||{},CloseIcon:m||{},InnerContainer:h||{}}),e.overrides);return p.createElement(o,x({},c,{overrides:_,key:a,onClose:r.getOnCloseHandler(a,t)}),function(e){var t=e.dismiss;return r.dismissHandlers[a]=t,n})}),H(z(r),`getSharedProps`,function(){return{$placement:r.props.placement}}),U=z(r),r}return P(n,[{key:`componentDidMount`,value:function(){this.setState({isMounted:!0})}},{key:`render`,value:function(){for(var e=this.getSharedProps(),t=this.props.overrides.Root,n=_(r(t,c),2),i=n[0],a=n[1],o=this.state.toasts.length,s=[],l=o-1;l>=0;l--)s.push(this.renderToast(this.state.toasts[l]));var u=p.createElement(i,x({"data-baseweb":`toaster`},e,a),s);return this.state.isMounted?p.createElement(p.Fragment,null,this.props.usePortal&&typeof document<`u`&&document.body?m.createPortal(u,document.body):u,this.props.children):p.createElement(p.Fragment,null,this.props.children)}}]),n}(p.Component);H(W,`defaultProps`,{autoFocus:!1,autoHideDuration:0,children:null,closeable:!0,overrides:{},placement:d.top,resetAutoHideTimerOnUpdate:!0,usePortal:!0});var G={getRef:function(){return U},show:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRef();if(n)return n.show(j(j({},t),{},{children:e}))},info:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.show(e,j(j({},t),{},{kind:l.info}))},positive:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.show(e,j(j({},t),{},{kind:l.positive}))},warning:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.show(e,j(j({},t),{},{kind:l.warning}))},negative:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.show(e,j(j({},t),{},{kind:l.negative}))},update:function(e,t){var n=this.getRef();n&&n.update(e,t)},clear:function(e){var t=this.getRef();t&&t.clear(e)}};export{G as n,W as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.