'use strict';

var _commonjsHelpers = require('../../../_virtual/_commonjsHelpers.js');
var XMLDTDElement = require('../../../_virtual/XMLDTDElement.js');
var XMLNode = require('./XMLNode.js');
var NodeType = require('./NodeType.js');

var hasRequiredXMLDTDElement;

function requireXMLDTDElement () {
	if (hasRequiredXMLDTDElement) return XMLDTDElement.__module.exports;
	hasRequiredXMLDTDElement = 1;
	// Generated by CoffeeScript 1.12.7
	(function() {
	  var NodeType$1, XMLNode$1,
	    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
	    hasProp = {}.hasOwnProperty;

	  XMLNode$1 = XMLNode.__require();

	  NodeType$1 = NodeType.__require();

	  XMLDTDElement.__module.exports = (function(superClass) {
	    extend(XMLDTDElement, superClass);

	    function XMLDTDElement(parent, name, value) {
	      XMLDTDElement.__super__.constructor.call(this, parent);
	      if (name == null) {
	        throw new Error("Missing DTD element name. " + this.debugInfo());
	      }
	      if (!value) {
	        value = '(#PCDATA)';
	      }
	      if (Array.isArray(value)) {
	        value = '(' + value.join(',') + ')';
	      }
	      this.name = this.stringify.name(name);
	      this.type = NodeType$1.ElementDeclaration;
	      this.value = this.stringify.dtdElementValue(value);
	    }

	    XMLDTDElement.prototype.toString = function(options) {
	      return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
	    };

	    return XMLDTDElement;

	  })(XMLNode$1);

	}).call(_commonjsHelpers.commonjsGlobal);
	return XMLDTDElement.__module.exports;
}

exports.__require = requireXMLDTDElement;
