"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializerTokens = void 0;
const placeholder_1 = require("../../../../utils/placeholder.js");
const const_1 = require("./const.js");
exports.serializerTokens = {
    [const_1.CheckboxNode.Checkbox]: (state, node) => {
        state.renderInline(node);
        state.closeBlock(node);
    },
    [const_1.CheckboxNode.Input]: (state, node) => {
        const checked = node.attrs[const_1.CheckboxAttr.Checked] === 'true';
        state.write(`[${checked ? 'X' : ' '}] `);
    },
    [const_1.CheckboxNode.Label]: (state, node, _, idx) => {
        if ((!node.content.size || node.textContent.trim().length === 0) && idx !== 0) {
            state.write((0, placeholder_1.getPlaceholderContent)(node));
            return;
        }
        if (!idx) {
            state.write('[ ] ');
        }
        state.renderInline(node);
    },
};
//# sourceMappingURL=serializer.js.map
