PageSourceSearch

https://support.fun-edu.fr/static/assets/ErrorBoundary.wLU3a_Rc.js

js fun-edu.fr collected 2026-10-09 21:49:04 UTC 4,440 bytes, 7 lines download raw bytes

1import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{C as t,_ as n,v as r}from"./vendor-styled.CPAQsgEG.js";import{T as i}from"./vendor-react.CnZgHyx2.js";import{S as a,x as o}from"./mobx.esm.Bs8JcUWa.js";import{r as s}from"./mobxreact.esm.DzF_OtlD.js";import{t as c}from"./PageTitle.D2LCXPxE.js";import{t as l}from"./env.DFiVzB6Q.js";import{t as u}from"./Logger.C6-32kb5.js";import{n as d,t as f}from"./decorate.Doz1ketW.js";import{s as p}from"./styles.BBEhzDMw.js";import{p as m}from"./stores.BA4expXM.js";import{n as h}from"./Storage.C2MhRdeh.js";import{t as g}from"./isCloudHosted.B1QgjRS0.js";import{t as _}from"./useTranslation.CG4f-P7H.js";import{t as v}from"./lazyWithRetry.D84iQdAl.js";import{t as y}from"./Trans.CaXUW8nP.js";import{t as b}from"./UrlHelper.DURW8yRD.js";import{t as x}from"./Button.C9Impu3D.js";import{t as S}from"./CenteredContent.BDn3k9Ux.js";import{t as C}from"./Heading.D5MFWTUt.js";import{t as w}from"./Text.By9Dwp3H.js";import{t as T}from"./Flex.BxdWPQQ-.js";var E=e(t());n();var D=i(),O=`error-boundary-tracking`,k=300*1e3,A=class extends E.Component{constructor(e){super(e),this.error=void 0,this.showDetail
1s=!1,this.isRepeatedError=!1,this.checkForPreviousErrors=()=>{try{let e=h.get(O);if(!e)return;let t=JSON.parse(e),n=Date.now()-k,r=t.filter(e=>e>n);this.isRepeatedError=r.length>0}catch(e){u.warn(`Failed to parse stored errors for error boundary`,{err:e})}},this.trackError=()=>{try{let e=h.get(O),t=e?JSON.parse(e):[],n=Date.now()-k,r=[...t.filter(e=>e>n),Date.now()];h.set(O,JSON.stringify(r)),this.isRepeatedError=r.length>1}catch(e){u.warn(`Failed to track error in error boundary`,{err:e})}},this.handleReload=()=>{window.location.reload()},this.handleShowDetails=()=>{this.showDetails=!0},this.handleReportBug=()=>{window.open(g?b.contact:b.github)},this.handleClearCache=async()=>{await m(),h.clear(),window.location.reload()},o(this)}componentDidMount(){this.checkForPreviousErrors()}componentDidCatch(e){if(this.error=e,this.trackError(),this.props.reloadOnChunkMissing&&v(e)&&!this.isRepeatedError){window.location.reload();return}u.error(`ErrorBoundary`,e)}render(){let{t:e,component:t=S,showTitle:n}=this.props;if(this.error){let r=this.error,i=!!l.SENTRY_DSN&&g;return v(r)?(0,D.jsxs)(t,{children:[n&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(c,{title:e(`Module failed to load`)}),(0,D.jsx)(C,{children:(0,D.jsx)(y,{children:`Loading Failed`})})]}),(0,D.jsx)(w,{as:`p`,type:`secondary`,children:(0,D.jsx)(y,{children:`Sorry, part of the application failed to load. This may be because it was updated since you opened the tab or because of a failed network request. Please try reloading.`})}),(0,D.jsx)(`p`,{children:(0,D.jsx)(x,{onClick:this.handleReload,children:e(`Reload`)})})]}):(0,D.jsxs)(t,{children:[n&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(c,{title:e(`Something Unexpected Happened`)}),(0,D.jsx)(C,{children:(0,D.jsx)(y,{children:`Something Unexpected Happened`})})]}),this.isRepeatedError?(0,D.jsx)(w,{as:`p`,type:`secondary`,children:(0,D.jsx)(y,{children:`An error has occurred multiple times recently. If it continues please try clearing the cache or using a different browser.`})}):(0,D.jsx)(w,{as:`p`,type:`secondary`,children:(0,D.jsx)(y,{defaults:`Sorry, an unrecoverable error occurred{{notified}}. Please try reloading the page, it may have been a temporary glitch.`,values:{notified:i?` – ${e(`our engineers have been notified`)}`:void 0}})}
1),this.showDetails&&(0,D.jsx)(j,{children:r.stack}),(0,D.jsxs)(T,{gap:8,wrap:!0,children:[this.isRepeatedError&&(0,D.jsx)(x,{onClick:this.handleClearCache,children:(0,D.jsx)(y,{children:`Clear cache + reload`})}),(0,D.jsx)(x,{onClick:this.handleReload,neutral:this.isRepeatedError,children:e(`Reload`)}),this.showDetails?(0,D.jsx)(x,{onClick:this.handleReportBug,neutral:!0,children:(0,D.jsx)(y,{children:`Report a bug`})}):(0,D.jsxs)(x,{onClick:this.handleShowDetails,neutral:!0,children:[(0,D.jsx)(y,{children:`Show detail`}),`…`]})]})]})}return this.props.children}};f([a,d(`design:type`,Object)],A.prototype,`error`,void 0),f([a,d(`design:type`,Object)],A.prototype,`showDetails`,void 0),f([a,d(`design:type`,Object)],A.prototype,`isRepeatedError`,void 0),A=f([s,d(`design:paramtypes`,[Object])],A);var j=r.pre`
2  background: ${p(`backgroundSecondary`)};
3  padding: 16px;
4  border-radius: 4px;
5  font-size: 12px;
6  white-space: pre-wrap;
7`;function M(e){let{t}=_();return(0,D.jsx)(A,{t,...e})}export{M as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.