import*as s from"react";import{ErrorDetails as a}from"./app/Error/ErrorDetails";import{telemetry as n}from"./app/telemetry/index.js";class p extends s.Component{constructor(r){super(r),this.state={error:void 0}}componentDidCatch(r,c){const{name:e,message:t}=r,o={name:e,message:t,stack:c.componentStack??void 0};this.setState({error:o}),n.sendClientErrorMessage([{object:"client",message:`${e}: ${t}`,url:location.href}]),n.sendError(o,"ReactErrorBoundary"),process.env.NODE_ENV!=="production"&&console.log(r)}render(){return this.state.error&&process.env.NODE_ENV!=="production"?s.createElement(a,{error:this.state.error}):this.props.children}}export{p as ErrorBoundary};
