import{P as n,R as c}from"./zod-H_cgTO0M.js";var s=n({detail:c()}),o=n({error:c()});function i(r){if(!r)return"Unknown error";if(r instanceof Error){let e=s.safeParse(r.cause);return e.success?e.data.detail:u(r.message)}if(typeof r=="object"){let e=s.safeParse(r);if(e.success)return e.data.detail;let t=o.safeParse(r);if(t.success)return t.data.error}try{return JSON.stringify(r)}catch{return String(r)}}function u(r){let e=l(r);if(!e)return r;let t=s.safeParse(e);if(t.success)return t.data.detail;let a=o.safeParse(e);return a.success?a.data.error:r}function l(r){try{return JSON.parse(r)}catch{return r}}var f=class extends Error{constructor(r="The cell containing this UI element has not been run yet. Please run the cell first."){super(r),this.name="CellNotInitializedError"}},d=class extends Error{constructor(r="Not yet connected to a kernel."){super(r),this.name="NoKernelConnectedError"}};export{d as n,i as r,f as t};
