"use strict";var S=Object.create;var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var w=Object.getPrototypeOf;var M=Object.prototype.hasOwnProperty;var d=(t,e)=>a(t,"name",{value:e,configurable:true});var N=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:true})};var p=(t,e,r,l)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of B(e))if(!M.call(t,o)&&o!==r)a(t,o,{get:()=>e[o],enumerable:!(l=g(e,o))||l.enumerable})}return t};var i=(t,e,r)=>(r=t!=null?S(w(t)):{},p(e||!t||!t.__esModule?a(r,"default",{value:t,enumerable:true}):r,t));var P=t=>p(a({},"__esModule",{value:true}),t);var v={};N(v,{default:()=>R});module.exports=P(v);var s=require("react/jsx-runtime");var m=require("react");var n=require("react-intl");var f=i(require("react-jss"));var u=i(require("../../ui/button"));var y=require("../../ui/headline");var E=i(require("./styles"));const c=(0,n.defineMessages)({headline:{id:"app.errorHandler.headline",defaultMessage:"Something went wrong."},action:{id:"app.errorHandler.action",defaultMessage:"Reload"}});class h extends m.Component{constructor(e){super(e);this.state={hasError:false}}componentDidCatch(){this.setState({hasError:true})}render(){const{classes:e,intl:r}=this.props;if(this.state.hasError){return(0,s.jsxs)("div",{className:e.component,children:[(0,s.jsx)(y.H1,{className:e.title,children:r.formatMessage(c.headline)}),(0,s.jsx)(u.default,{label:r.formatMessage(c.action),buttonType:"inverted",onClick:()=>window.location.reload()})]})}return this.props.children}}d(h,"ErrorBoundary");var R=(0,f.default)(E.default,{injectTheme:true})((0,n.injectIntl)(h));
