import{u as e}from"./devlop-Cl3hj7Sz.js";import{j as r}from"./react-DnjLh4X0.js";import{u as o}from"./unified-CINQ6UsI.js";import{r as n}from"./remark-parse-DY0gzotZ.js";import{r as t}from"./remark-rehype-Bba-wcVv.js";import{V as s}from"./vfile--i-Ck3pP.js";import{v as l}from"./unist-util-visit-BGZk_7Z4.js";import{t as i}from"./hast-util-to-jsx-runtime-BlXklvGH.js";import{u as a}from"./html-url-attributes-BA_i5Yxb.js";const m="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",d=[],p={allowDangerousHtml:!0},u=/^(https?|ircs?|mailto|xmpp)$/i,c=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function f(u){const f=function(e){const r=e.rehypePlugins||d,s=e.remarkPlugins||d,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...p}:p,i=o().use(n).use(s).use(t,l).use(r);return i}(u),w=function(e){const r=e.children||"",o=new s;"string"==typeof r&&(o.value=r);return o}(u);return function(o,n){const t=n.allowedElements,s=n.allowElement,d=n.components,p=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,w=n.urlTransform||g;for(const r of c)Object.hasOwn(n,r.from)&&e("Unexpected `"+r.from+"` prop, "+(r.to?"use `"+r.to+"` instead":"remove it")+" (see <"+m+"#"+r.id+"> for more info)");return l(o,h),i(o,{Fragment:r.Fragment,components:d,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function h(e,r,o){if("raw"===e.type&&o&&"number"==typeof r)return u?o.children.splice(r,1):o.children[r]={type:"text",value:e.value},r;if("element"===e.type){let r;for(r in a)if(Object.hasOwn(a,r)&&Object.hasOwn(e.properties,r)){const o=e.properties[r],n=a[r];(null===n||n.includes(e.tagName))&&(e.properties[r]=w(String(o||""),r,e))}}if("element"===e.type){let n=t?!t.includes(e.tagName):!!p&&p.includes(e.tagName);if(!n&&s&&"number"==typeof r&&(n=!s(e,r,o)),n&&o&&"number"==typeof r)return f&&e.children?o.children.splice(r,1,...e.children):o.children.splice(r,1),r}}}(f.runSync(f.parse(w),w),u)}function g(e){const r=e.indexOf(":"),o=e.indexOf("?"),n=e.indexOf("#"),t=e.indexOf("/");return-1===r||-1!==t&&r>t||-1!==o&&r>o||-1!==n&&r>n||u.test(e.slice(0,r))?e:""}export{f as M};
