import{__exports as t}from"../../../_virtual/Portal.js";import e from"react";import{r as o}from"../../react-dom/index.js";import{p as r}from"../../prop-types/index.js";import"./utils.js";import{__exports as n}from"../../../_virtual/utils.js";!function(t){function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(e),f=a(o),c=a(r),l=n;function a(t){return t&&t.__esModule?t:{default:t}}function p(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var o,r=y(t);if(e){var n=y(this).constructor;o=Reflect.construct(r,arguments,n)}else o=r.apply(this,arguments);return function(t,e){if(e&&("object"===u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,o)}}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}var b={children:c.default.node.isRequired,node:c.default.any},m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(u,t);var e,o,r,n=d(u);function u(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),n.apply(this,arguments)}return e=u,(o=[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return l.canUseDOM?(this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),f.default.createPortal(this.props.children,this.props.node||this.defaultNode)):null}}])&&p(e.prototype,o),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(i.default.Component);m.propTypes=b;var h=m;t.default=h}(t);
//# sourceMappingURL=Portal.js.map
