"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../../devlop@1.1.0/node_modules/devlop/lib/default.cjs.js"),s=require("../../../../micromark-util-normalize-identifier@2.0.1/node_modules/micromark-util-normalize-identifier/index.cjs.js");u.peek=v;function F(){this.buffer()}function b(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function d(){this.buffer()}function k(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function x(e){const n=this.resume(),t=this.stack[this.stack.length-1];a.ok(t.type==="footnoteReference"),t.identifier=s.normalizeIdentifier(this.sliceSerialize(e)).toLowerCase(),t.label=n}function D(e){this.exit(e)}function S(e){const n=this.resume(),t=this.stack[this.stack.length-1];a.ok(t.type==="footnoteDefinition"),t.identifier=s.normalizeIdentifier(this.sliceSerialize(e)).toLowerCase(),t.label=n}function C(e){this.exit(e)}function v(){return"["}function u(e,n,t,r){const l=t.createTracker(r);let o=l.move("[^");const c=t.enter("footnoteReference"),i=t.enter("reference");return o+=l.move(t.safe(t.associationId(e),{after:"]",before:o})),i(),c(),o+=l.move("]"),o}function p(){return{enter:{gfmFootnoteCallString:F,gfmFootnoteCall:b,gfmFootnoteDefinitionLabelString:d,gfmFootnoteDefinition:k},exit:{gfmFootnoteCallString:x,gfmFootnoteCall:D,gfmFootnoteDefinitionLabelString:S,gfmFootnoteDefinition:C}}}function L(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:u},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,l,o,c){const i=o.createTracker(c);let f=i.move("[^");const g=o.enter("footnoteDefinition"),h=o.enter("label");return f+=i.move(o.safe(o.associationId(r),{before:f,after:"]"})),h(),f+=i.move("]:"),r.children&&r.children.length>0&&(i.shift(4),f+=i.move((n?`
`:" ")+o.indentLines(o.containerFlow(r,i.current()),n?m:w))),g(),f}}function w(e,n,t){return n===0?e:m(e,n,t)}function m(e,n,t){return(t?"":"    ")+e}exports.gfmFootnoteFromMarkdown=p;exports.gfmFootnoteToMarkdown=L;
//# sourceMappingURL=index.cjs.js.map
