"use strict";var S=Object.create;var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var R=Object.getPrototypeOf;var w=Object.prototype.hasOwnProperty;var d=(r,e)=>a(r,"name",{value:e,configurable:true});var M=(r,e)=>{for(var t in e)a(r,t,{get:e[t],enumerable:true})};var p=(r,e,t,l)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of B(e))if(!w.call(r,o)&&o!==t)a(r,o,{get:()=>e[o],enumerable:!(l=g(e,o))||l.enumerable})}return r};var i=(r,e,t)=>(t=r!=null?S(R(r)):{},p(e||!r||!r.__esModule?a(t,"default",{value:r,enumerable:true}):t,r));var N=r=>p(a({},"__esModule",{value:true}),r);var v={};M(v,{default:()=>P});module.exports=N(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(e,t){console.error("ErrorBoundary caught:",e);console.error("Component stack:",t.componentStack);this.setState({hasError:true})}render(){const{classes:e,intl:t}=this.props;if(this.state.hasError){return(0,s.jsxs)("div",{className:e.component,children:[(0,s.jsx)(y.H1,{className:e.title,children:t.formatMessage(c.headline)}),(0,s.jsx)(u.default,{label:t.formatMessage(c.action),buttonType:"inverted",onClick:()=>window.location.reload()})]})}return this.props.children}}d(h,"ErrorBoundary");var P=(0,f.default)(E.default,{injectTheme:true})((0,n.injectIntl)(h));
