var i=Object.defineProperty;var n=(s,r,e)=>r in s?i(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e;var o=(s,r,e)=>n(s,typeof r!="symbol"?r+"":r,e);import{R as c,j as t}from"./vendor-react-DrAK5R0M.js";import{L as l}from"./index-7eqLqzhB.js";import{x as m,ae as d}from"./vendor-icons-Cu2Ube6F.js";class f extends c.Component{constructor(){super(...arguments);o(this,"state",{hasError:!1,error:null});o(this,"handleRetry",()=>{this.setState({hasError:!1,error:null})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,a){console.error("[EditorErrorBoundary] Caught render error:",e,a.componentStack)}render(){var a;if(!this.state.hasError)return this.props.children;const e=this.props.label??"section";return t.jsxs("div",{className:"rounded-xl border border-destructive/30 bg-destructive/8 p-4 flex items-start gap-3 text-sm",children:[t.jsx(m,{className:"w-4 h-4 text-destructive shrink-0 mt-0.5"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("p",{className:"font-medium text-destructive mb-0.5",children:["Something went wrong in this ",e]}),t.jsx("p",{className:"text-muted-foreground text-xs mb-2",children:"Your other changes are safe. Click Retry to attempt recovery."}),((a=this.state.error)==null?void 0:a.message)&&t.jsx("p",{className:"text-xs font-mono text-destructive/80 truncate",children:this.state.error.message})]}),t.jsxs(l,{variant:"ghost",size:"sm",className:"shrink-0 text-destructive hover:bg-destructive/10 h-7 px-2",onClick:this.handleRetry,children:[t.jsx(d,{className:"w-3 h-3 mr-1"}),"Retry"]})]})}}export{f as E};
