"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.videoType = void 0;
exports.serializeNodeToString = serializeNodeToString;
exports.createViewStub = createViewStub;
const schema_1 = require("../../../../utils/schema.js");
const const_1 = require("./const.js");
exports.videoType = (0, schema_1.nodeTypeFactory)(const_1.videoNodeName);
function serializeNodeToString(node) {
    const service = node.attrs[const_1.VideoAttr.Service];
    const videoId = node.attrs[const_1.VideoAttr.VideoID];
    return `@[${service}](${videoId})`;
}
function createViewStub(node) {
    const elem = document.createElement('span');
    elem.setAttribute(const_1.VideoAttr.Service, node.attrs[const_1.VideoAttr.Service]);
    elem.setAttribute(const_1.VideoAttr.VideoID, node.attrs[const_1.VideoAttr.VideoID]);
    elem.contentEditable = 'false';
    elem.textContent = serializeNodeToString(node);
    return elem;
}
//# sourceMappingURL=utils.js.map
