'use strict';

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

var hasRequiredXMLDTDNotation;

function requireXMLDTDNotation () {
	if (hasRequiredXMLDTDNotation) return XMLDTDNotation.__module.exports;
	hasRequiredXMLDTDNotation = 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();

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

	    function XMLDTDNotation(parent, name, value) {
	      XMLDTDNotation.__super__.constructor.call(this, parent);
	      if (name == null) {
	        throw new Error("Missing DTD notation name. " + this.debugInfo(name));
	      }
	      if (!value.pubID && !value.sysID) {
	        throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name));
	      }
	      this.name = this.stringify.name(name);
	      this.type = NodeType$1.NotationDeclaration;
	      if (value.pubID != null) {
	        this.pubID = this.stringify.dtdPubID(value.pubID);
	      }
	      if (value.sysID != null) {
	        this.sysID = this.stringify.dtdSysID(value.sysID);
	      }
	    }

	    Object.defineProperty(XMLDTDNotation.prototype, 'publicId', {
	      get: function() {
	        return this.pubID;
	      }
	    });

	    Object.defineProperty(XMLDTDNotation.prototype, 'systemId', {
	      get: function() {
	        return this.sysID;
	      }
	    });

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

	    return XMLDTDNotation;

	  })(XMLNode$1);

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

exports.__require = requireXMLDTDNotation;
