Anvil/assets/DocsRenderer-NNNQARDV-da1d578f.js
André Jaenisch 067c8025e5
Updates
2024-03-17 16:16:24 +01:00

1 line
1.6 KiB
JavaScript

import{_ as h}from"./iframe-789b48c8.js";import{e as d,R as o,r as a,f as E,A as R,H as x,D as y}from"./index-b25fe04d.js";import"../sb-preview/runtime.js";import"./_commonjsHelpers-725317a4.js";import"./index-11d98b33.js";import"./index-a04a29e8.js";import"./index-356e4a49.js";var c={},m=d;c.createRoot=m.createRoot,c.hydrateRoot=m.hydrateRoot;var n=new Map,D=({callback:e,children:t})=>{let r=a.useRef();return a.useLayoutEffect(()=>{r.current!==e&&(r.current=e,e())},[e]),t},_=async(e,t)=>{let r=await v(t);return new Promise(s=>{r.render(o.createElement(D,{callback:()=>s(null)},e))})},f=(e,t)=>{let r=n.get(e);r&&(r.unmount(),n.delete(e))},v=async e=>{let t=n.get(e);return t||(t=c.createRoot(e),n.set(e,t)),t},w={code:E,a:R,...x},g=class extends a.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){let{showException:t}=this.props;t(e)}render(){let{hasError:e}=this.state,{children:t}=this.props;return e?null:o.createElement(o.Fragment,null,t)}},S=class{constructor(){this.render=async(e,t,r)=>{let s={...w,...t==null?void 0:t.components},u=y;return new Promise((i,p)=>{h(()=>import("./index-e855ba23.js"),["./index-e855ba23.js","./index-ad1d5b63.js","./index-b25fe04d.js","./iframe-789b48c8.js","./_commonjsHelpers-725317a4.js","./index-11d98b33.js","./index-a04a29e8.js","./index-356e4a49.js"],import.meta.url).then(({MDXProvider:l})=>_(o.createElement(g,{showException:p,key:Math.random()},o.createElement(l,{components:s},o.createElement(u,{context:e,docsParameter:t}))),r)).then(()=>i())})},this.unmount=e=>{f(e)}}};export{S as DocsRenderer,w as defaultComponents};