text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  var Parse5utils = /** @class */ (function () {
      function Parse5utils() {
          this.namespaceURI = 'http://www.w3.org/1999/xhtml';
      }
      Parse5utils.prototype.append = function (parent, node) {
          node.parentNode = parent;
          parent.childNodes.push(node);
          return node;
      };
      Parse5utils.prototype.setText = function (node, text) {
          node.childNodes = [];
          this.append(node, this.createTextNode(text || ''));
          return node;
      };
      Parse5utils.prototype.createTextNode = function (text) {
          return {
              nodeName: '#text',
              value: text
          };
      };
      Parse5utils.prototype.createNode = function (tagName) {
          return {
              nodeName: tagName,
              tagName: tagName,
              attrs: [],
              namespaceURI: this.namespaceURI,
              childNodes: []
          };
      };
      Parse5utils.prototype.replaceNode = function (original, node) {
          var children = original.parentNode.childNodes;
          var index = children.indexOf(original);
          if (!index) {
              return;
          }
          node.parentNode = original.parentNode;
          children.splice(index, 1, node);
          return node;
      };
      return Parse5utils;
  }());
  exports.Parse5utils = Parse5utils;
  exports.parse5Utils = new Parse5utils();
  //# sourceMappingURL=parse5utils.js.map