var e=/<details(\s+open)?>([\s\S]*?)<\/details>/gi,t=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,n=/(^|\n)(>[ \t]*)\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]([ \t]*(?=\n|$))/gi,r=/<!--[\s\S]*?-->/g,i=/^\s*<summary>([\s\S]*?)<\/summary>\s*([\s\S]*)$/i,a=/<[^>]+>/g,o=`@@CODEX_FENCED_CODE_BLOCK_`;function s(e){let n=[];return f(u(e.replace(t,e=>{let t=`${o}${n.length}@@`;return n.push(e),t})),n)}function c(e){return e.replace(/\s+/g,` `).trim()}function l(e){return c(e.replace(a,` `))}function u(t){return t.replace(r,``).replace(n,(e,t,n,r)=>`${t}${n}**${d(r)}**`).replace(e,(e,t,n)=>{let r=n.match(i);if(r==null)return e;let a=l(r[1]??``);if(a.length===0)return e;let o=(r[2]??``).trim(),s=[`summary=${JSON.stringify(a)}`];return t!=null&&s.push(`open="true"`),`:::github-details{${s.join(` `)}}\n${o}\n:::`}).replace(/\n{3,}/g,`

`)}function d(e){let t=e.toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function f(e,t){return e.replace(/@@CODEX_FENCED_CODE_BLOCK_(\d+)@@/g,(e,n)=>t[Number(n)]??e)}export{s as t};
//# sourceMappingURL=github-details-DtT5ngGc.js.map