import{r as i}from"./index-CgQG7qql.js";function c(s,o,u){const r=i.useRef(null),a=i.useRef(!1);return i.useMemo(()=>{let e,n;try{e=o(s)}catch(t){n=t?.message||"Parse error",e={data:null,file:void 0}}if(e.data!=null)return r.current=e.data,a.current=!1,e.data;if(!n)return r.current;if(r.current&&!a.current){a.current=!0;const t=e.file||"data file";u?.({type:"parseError",severity:"warning",message:['<viewer-notification type="parseError">',`${t} is broken: ${n}`,"","The viewer is showing stale content. Please read the file and fix the syntax error.","</viewer-notification>"].join(`
`),summary:`${t} broken after edit`})}return r.current},[s,o,u])}export{c as u};
