var p=Object.defineProperty;var h=(s,t,r)=>t in s?p(s,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[t]=r;var n=(s,t,r)=>h(s,typeof t!="symbol"?t+"":t,r);import{j as e}from"./client-wT6vtYO_.js";import{i as b,r as c}from"./index-BdTwX--g.js";import{c as x}from"./index-DizoKcfL.js";import{H as g}from"./Helmet-BPcSXOin.js";import{L as _}from"./short_number-w3W5phxu.js";import{B as d}from"./index-Vm54jmCX.js";import{C as f}from"./column-B4vwzadM.js";import{G as j}from"./gif-BEAwuIaI.js";import{M as o}from"./message-UFwkQlnu.js";class y extends c.PureComponent{constructor(){super(...arguments);n(this,"state",{copied:!1});n(this,"handleClick",()=>{const{value:r}=this.props;navigator.clipboard.writeText(r),this.setState({copied:!0}),this.timeout=setTimeout(()=>this.setState({copied:!1}),700)})}componentWillUnmount(){this.timeout&&clearTimeout(this.timeout)}render(){const{children:r}=this.props,{copied:i}=this.state;return e.jsx(d,{onClick:this.handleClick,className:i?"copied":"copyable",children:i?e.jsx(o,{id:"copypaste.copied",defaultMessage:"Copied"}):r})}}class u extends c.PureComponent{constructor(){super(...arguments);n(this,"handleRetry",()=>{const{onRetry:r}=this.props;r&&r()})}render(){const{errorType:r,multiColumn:i,stacktrace:m}=this.props;let a,l;switch(r){case"routing":a=e.jsx(o,{id:"bundle_column_error.routing.title",defaultMessage:"404"}),l=e.jsx(o,{id:"bundle_column_error.routing.body",defaultMessage:"The requested page could not be found. Are you sure the URL in the address bar is correct?"});break;case"network":a=e.jsx(o,{id:"bundle_column_error.network.title",defaultMessage:"Network error"}),l=e.jsx(o,{id:"bundle_column_error.network.body",defaultMessage:"There was an error when trying to load this page. This could be due to a temporary problem with your internet connection or this server."});break;case"error":a=e.jsx(o,{id:"bundle_column_error.error.title",defaultMessage:"Oh, no!"}),l=e.jsx(o,{id:"bundle_column_error.error.body",defaultMessage:"The requested page could not be rendered. It could be due to a bug in our code, or a browser compatibility issue."});break}return e.jsxs(f,{bindToDocument:!i,children:[e.jsxs("div",{className:"error-column",children:[e.jsx(j,{src:"/oops.gif",staticSrc:"/oops.png",className:"error-column__image"}),e.jsxs("div",{className:"error-column__message",children:[e.jsx("h1",{children:a}),e.jsx("p",{children:l}),e.jsxs("div",{className:"error-column__message__actions",children:[r==="network"&&e.jsx(d,{onClick:this.handleRetry,children:e.jsx(o,{id:"bundle_column_error.retry",defaultMessage:"Try again"})}),r==="error"&&e.jsx(y,{value:m,children:e.jsx(o,{id:"bundle_column_error.copy_stacktrace",defaultMessage:"Copy error report"})}),e.jsx(_,{to:"/",className:x("button",{"button-tertiary":r!=="routing"}),children:e.jsx(o,{id:"bundle_column_error.return",defaultMessage:"Go back home"})})]})]})]}),e.jsx(g,{children:e.jsx("meta",{name:"robots",content:"noindex"})})]})}}n(u,"defaultProps",{errorType:"routing"});const G=b(u);export{G as B}; //# sourceMappingURL=bundle_column_error-CiTXo_qV.js.map