"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.matchLinkAtInlineStart = matchLinkAtInlineStart;
function matchLinkAtInlineStart(inlineToken) {
    if (inlineToken.type !== 'inline' || !inlineToken.children?.length) {
        return null;
    }
    const { children: tokens } = inlineToken;
    if (tokens[0].type !== 'link_open') {
        return null;
    }
    for (let i = 0; i < tokens.length; i++) {
        const token = tokens[i];
        if (token.type === 'link_close') {
            return {
                openToken: tokens[0],
                closeToken: token,
                closeTokenIndex: i,
            };
        }
    }
    return null;
}
//# sourceMappingURL=utils.js.map
