import { BaseXform } from "../base-xform.js";
/**
 * Xform for individual page break (brk element)
 * Used by both RowBreaksXform and ColBreaksXform
 */
class PageBreaksXform extends BaseXform {
    get tag() {
        return "brk";
    }
    render(xmlStream, model) {
        xmlStream.leafNode("brk", model);
    }
    parseOpen(node) {
        if (node.name === "brk") {
            const { id, max, man, min } = node.attributes;
            this.model = {
                id: +id,
                max: +max,
                man: +man
            };
            if (min !== undefined) {
                this.model.min = +min;
            }
            return true;
        }
        return false;
    }
    parseText() { }
    parseClose() {
        return false;
    }
}
export { PageBreaksXform };
