"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../../../longest-streak@3.1.0/node_modules/longest-streak/index.cjs.js"),v=require("../util/format-code-as-indented.cjs.js"),g=require("../util/check-fence.cjs.js");function x(n,d,e,f){const i=g.checkFence(e),t=n.value||"",a=i==="`"?"GraveAccent":"Tilde";if(v.formatCodeAsIndented(n,e)){const o=e.enter("codeIndented"),m=e.indentLines(t,b);return o(),m}const c=e.createTracker(f),u=i.repeat(Math.max(l.longestStreak(t,i)+1,3)),s=e.enter("codeFenced");let r=c.move(u);if(n.lang){const o=e.enter(`codeFencedLang${a}`);r+=c.move(e.safe(n.lang,{before:r,after:" ",encode:["`"],...c.current()})),o()}if(n.lang&&n.meta){const o=e.enter(`codeFencedMeta${a}`);r+=c.move(" "),r+=c.move(e.safe(n.meta,{before:r,after:`
`,encode:["`"],...c.current()})),o()}return r+=c.move(`
`),t&&(r+=c.move(t+`
`)),r+=c.move(u),s(),r}function b(n,d,e){return(e?"":"    ")+n}exports.code=x;
//# sourceMappingURL=code.cjs.js.map
