import r from"@babel/runtime/helpers/objectWithoutProperties";import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/assertThisInitialized";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import c from"@babel/runtime/helpers/getPrototypeOf";import a from"@babel/runtime/helpers/defineProperty";import{Component as p}from"react";import s from"prop-types";import{getRollbarFromContext as l,Context as u}from"@rollbar/react";import f from"./DevCenterAppErrorView/DevCenterAppErrorView.js";import{jsx as m}from"react/jsx-runtime";var h=["ErrorView","children"];function b(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,o)}return t}function y(r){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(r){return!1}}();return function(){var t,o=c(r);if(e){var n=c(this).constructor;t=Reflect.construct(o,arguments,n)}else t=o.apply(this,arguments);return i(this,t)}}var v=function(i){n(s,p);var c=y(s);function s(){var r;e(this,s);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return r=c.call.apply(c,[this].concat(n)),a(o(r),"state",{hasInternalError:!1}),r}return t(s,[{key:"componentDidCatch",value:function(r){var e,t;this.setState({hasInternalError:!0}),console.error(r),null===(e=(t=this.props).onError)||void 0===e||e.call(t,r);var o=l(this.context||{});o&&o.options.accessToken&&o.error(r)}},{key:"render",value:function(){if(!this.state.hasInternalError)return this.props.children;var e=this.props,t=e.ErrorView;e.children;var o=r(e,h);return m(t,function(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?b(Object(t),!0).forEach((function(e){a(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):b(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}({},o))}}],[{key:"getDerivedStateFromError",value:function(){return{hasInternalError:!0}}}]),s}();v.propTypes={children:s.node.isRequired,ErrorView:s.elementType},v.defaultProps={ErrorView:f},v.contextType=u;var O=v;export{O as default};
//# sourceMappingURL=ErrorBoundary.js.map
