'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _index = require('../index.js');

var _index2 = _interopRequireDefault(_index);

var _xlink = require('../format/xlink.js');

var _xlink2 = _interopRequireDefault(_xlink);

var _xml = require('../format/xml.js');

var _xml2 = _interopRequireDefault(_xml);

var _xsd = require('../format/xsd.js');

var _xsd2 = _interopRequireDefault(_xsd);

var _xml3 = require('../xml.js');

var _xml4 = _interopRequireDefault(_xml3);

function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : { default: obj };
}

/**
 * @classdesc
 * Format for reading WMS capabilities data
 *
 * @constructor
 * @extends {ol.format.XML}
 * @api
 */
var _ol_format_WMSCapabilities_ = function () {

    _xml2.default.call(this);

    /**
     * @type {string|undefined}
     */
    this.version = undefined;
};

_index2.default.inherits(_ol_format_WMSCapabilities_, _xml2.default);

/**
 * Read a WMS capabilities document.
 *
 * @function
 * @param {Document|Node|string} source The XML source.
 * @return {Object} An object representing the WMS capabilities.
 * @api
 */
_ol_format_WMSCapabilities_.prototype.read;

/**
 * @inheritDoc
 */
_ol_format_WMSCapabilities_.prototype.readFromDocument = function (doc) {
    for (var n = doc.firstChild; n; n = n.nextSibling) {
        if (n.nodeType == Node.ELEMENT_NODE) {
            return this.readFromNode(n);
        }
    }
    return null;
};

/**
 * @inheritDoc
 */
_ol_format_WMSCapabilities_.prototype.readFromNode = function (node) {
    this.version = node.getAttribute('version').trim();
    var wmsCapabilityObject = _xml4.default.pushParseAndPop({
        'version': this.version
    }, _ol_format_WMSCapabilities_.PARSERS_, node, []);
    return wmsCapabilityObject ? wmsCapabilityObject : null;
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} Attribution object.
 */
_ol_format_WMSCapabilities_.readAttribution_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.ATTRIBUTION_PARSERS_, node, objectStack);
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object} Bounding box object.
 */
_ol_format_WMSCapabilities_.readBoundingBox_ = function (node, objectStack) {
    var extent = [_xsd2.default.readDecimalString(node.getAttribute('minx')), _xsd2.default.readDecimalString(node.getAttribute('miny')), _xsd2.default.readDecimalString(node.getAttribute('maxx')), _xsd2.default.readDecimalString(node.getAttribute('maxy'))];

    var resolutions = [_xsd2.default.readDecimalString(node.getAttribute('resx')), _xsd2.default.readDecimalString(node.getAttribute('resy'))];

    return {
        'crs': node.getAttribute('CRS'),
        'extent': extent,
        'res': resolutions
    };
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {ol.Extent|undefined} Bounding box object.
 */
_ol_format_WMSCapabilities_.readEXGeographicBoundingBox_ = function (node, objectStack) {
    var geographicBoundingBox = _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_, node, objectStack);
    if (!geographicBoundingBox) {
        return undefined;
    }
    var westBoundLongitude = /** @type {number|undefined} */
    geographicBoundingBox['westBoundLongitude'];
    var southBoundLatitude = /** @type {number|undefined} */
    geographicBoundingBox['southBoundLatitude'];
    var eastBoundLongitude = /** @type {number|undefined} */
    geographicBoundingBox['eastBoundLongitude'];
    var northBoundLatitude = /** @type {number|undefined} */
    geographicBoundingBox['northBoundLatitude'];
    if (westBoundLongitude === undefined || southBoundLatitude === undefined || eastBoundLongitude === undefined || northBoundLatitude === undefined) {
        return undefined;
    }
    return [westBoundLongitude, southBoundLatitude, eastBoundLongitude, northBoundLatitude];
};

/**
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @private
 * @return {Object|undefined} Capability object.
 */
_ol_format_WMSCapabilities_.readCapability_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.CAPABILITY_PARSERS_, node, objectStack);
};

/**
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @private
 * @return {Object|undefined} Service object.
 */
_ol_format_WMSCapabilities_.readService_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.SERVICE_PARSERS_, node, objectStack);
};

/**
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @private
 * @return {Object|undefined} Contact information object.
 */
_ol_format_WMSCapabilities_.readContactInformation_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.CONTACT_INFORMATION_PARSERS_, node, objectStack);
};

/**
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @private
 * @return {Object|undefined} Contact person object.
 */
_ol_format_WMSCapabilities_.readContactPersonPrimary_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.CONTACT_PERSON_PARSERS_, node, objectStack);
};

/**
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @private
 * @return {Object|undefined} Contact address object.
 */
_ol_format_WMSCapabilities_.readContactAddress_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.CONTACT_ADDRESS_PARSERS_, node, objectStack);
};

/**
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @private
 * @return {Array.<string>|undefined} Format array.
 */
_ol_format_WMSCapabilities_.readException_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop([], _ol_format_WMSCapabilities_.EXCEPTION_PARSERS_, node, objectStack);
};

/**
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @private
 * @return {Object|undefined} Layer object.
 */
_ol_format_WMSCapabilities_.readCapabilityLayer_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.LAYER_PARSERS_, node, objectStack);
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} Layer object.
 */
_ol_format_WMSCapabilities_.readLayer_ = function (node, objectStack) {
    var parentLayerObject = /**  @type {Object.<string,*>} */
    objectStack[objectStack.length - 1];

    var layerObject = _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.LAYER_PARSERS_, node, objectStack);

    if (!layerObject) {
        return undefined;
    }
    var queryable = _xsd2.default.readBooleanString(node.getAttribute('queryable'));
    if (queryable === undefined) {
        queryable = parentLayerObject['queryable'];
    }
    layerObject['queryable'] = queryable !== undefined ? queryable : false;

    var cascaded = _xsd2.default.readNonNegativeIntegerString(node.getAttribute('cascaded'));
    if (cascaded === undefined) {
        cascaded = parentLayerObject['cascaded'];
    }
    layerObject['cascaded'] = cascaded;

    var opaque = _xsd2.default.readBooleanString(node.getAttribute('opaque'));
    if (opaque === undefined) {
        opaque = parentLayerObject['opaque'];
    }
    layerObject['opaque'] = opaque !== undefined ? opaque : false;

    var noSubsets = _xsd2.default.readBooleanString(node.getAttribute('noSubsets'));
    if (noSubsets === undefined) {
        noSubsets = parentLayerObject['noSubsets'];
    }
    layerObject['noSubsets'] = noSubsets !== undefined ? noSubsets : false;

    var fixedWidth = _xsd2.default.readDecimalString(node.getAttribute('fixedWidth'));
    if (!fixedWidth) {
        fixedWidth = parentLayerObject['fixedWidth'];
    }
    layerObject['fixedWidth'] = fixedWidth;

    var fixedHeight = _xsd2.default.readDecimalString(node.getAttribute('fixedHeight'));
    if (!fixedHeight) {
        fixedHeight = parentLayerObject['fixedHeight'];
    }
    layerObject['fixedHeight'] = fixedHeight;

    // See 7.2.4.8
    var addKeys = ['Style', 'CRS', 'AuthorityURL'];
    addKeys.forEach(function (key) {
        if (key in parentLayerObject) {
            var childValue = layerObject[key] || [];
            layerObject[key] = childValue.concat(parentLayerObject[key]);
        }
    });

    var replaceKeys = ['EX_GeographicBoundingBox', 'BoundingBox', 'Dimension', 'Attribution', 'MinScaleDenominator', 'MaxScaleDenominator'];
    replaceKeys.forEach(function (key) {
        if (!(key in layerObject)) {
            var parentValue = parentLayerObject[key];
            layerObject[key] = parentValue;
        }
    });

    return layerObject;
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object} Dimension object.
 */
_ol_format_WMSCapabilities_.readDimension_ = function (node, objectStack) {
    var dimensionObject = {
        'name': node.getAttribute('name'),
        'units': node.getAttribute('units'),
        'unitSymbol': node.getAttribute('unitSymbol'),
        'default': node.getAttribute('default'),
        'multipleValues': _xsd2.default.readBooleanString(node.getAttribute('multipleValues')),
        'nearestValue': _xsd2.default.readBooleanString(node.getAttribute('nearestValue')),
        'current': _xsd2.default.readBooleanString(node.getAttribute('current')),
        'values': _xsd2.default.readString(node)
    };
    return dimensionObject;
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} Online resource object.
 */
_ol_format_WMSCapabilities_.readFormatOnlineresource_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.FORMAT_ONLINERESOURCE_PARSERS_, node, objectStack);
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} Request object.
 */
_ol_format_WMSCapabilities_.readRequest_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.REQUEST_PARSERS_, node, objectStack);
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} DCP type object.
 */
_ol_format_WMSCapabilities_.readDCPType_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.DCPTYPE_PARSERS_, node, objectStack);
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} HTTP object.
 */
_ol_format_WMSCapabilities_.readHTTP_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.HTTP_PARSERS_, node, objectStack);
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} Operation type object.
 */
_ol_format_WMSCapabilities_.readOperationType_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.OPERATIONTYPE_PARSERS_, node, objectStack);
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} Online resource object.
 */
_ol_format_WMSCapabilities_.readSizedFormatOnlineresource_ = function (node, objectStack) {
    var formatOnlineresource = _ol_format_WMSCapabilities_.readFormatOnlineresource_(node, objectStack);
    if (formatOnlineresource) {
        var size = [_xsd2.default.readNonNegativeIntegerString(node.getAttribute('width')), _xsd2.default.readNonNegativeIntegerString(node.getAttribute('height'))];
        formatOnlineresource['size'] = size;
        return formatOnlineresource;
    }
    return undefined;
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} Authority URL object.
 */
_ol_format_WMSCapabilities_.readAuthorityURL_ = function (node, objectStack) {
    var authorityObject = _ol_format_WMSCapabilities_.readFormatOnlineresource_(node, objectStack);
    if (authorityObject) {
        authorityObject['name'] = node.getAttribute('name');
        return authorityObject;
    }
    return undefined;
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} Metadata URL object.
 */
_ol_format_WMSCapabilities_.readMetadataURL_ = function (node, objectStack) {
    var metadataObject = _ol_format_WMSCapabilities_.readFormatOnlineresource_(node, objectStack);
    if (metadataObject) {
        metadataObject['type'] = node.getAttribute('type');
        return metadataObject;
    }
    return undefined;
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Object|undefined} Style object.
 */
_ol_format_WMSCapabilities_.readStyle_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop({}, _ol_format_WMSCapabilities_.STYLE_PARSERS_, node, objectStack);
};

/**
 * @private
 * @param {Node} node Node.
 * @param {Array.<*>} objectStack Object stack.
 * @return {Array.<string>|undefined} Keyword list.
 */
_ol_format_WMSCapabilities_.readKeywordList_ = function (node, objectStack) {
    return _xml4.default.pushParseAndPop([], _ol_format_WMSCapabilities_.KEYWORDLIST_PARSERS_, node, objectStack);
};

/**
 * @const
 * @private
 * @type {Array.<string>}
 */
_ol_format_WMSCapabilities_.NAMESPACE_URIS_ = [null, 'http://www.opengis.net/wms'];

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Service': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readService_),
    'Capability': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readCapability_)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.CAPABILITY_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Request': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readRequest_),
    'Exception': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readException_),
    'Layer': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readCapabilityLayer_)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.SERVICE_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Name': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'Title': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'Abstract': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'KeywordList': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readKeywordList_),
    'OnlineResource': _xml4.default.makeObjectPropertySetter(_xlink2.default.readHref),
    'ContactInformation': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readContactInformation_),
    'Fees': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'AccessConstraints': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'LayerLimit': _xml4.default.makeObjectPropertySetter(_xsd2.default.readNonNegativeInteger),
    'MaxWidth': _xml4.default.makeObjectPropertySetter(_xsd2.default.readNonNegativeInteger),
    'MaxHeight': _xml4.default.makeObjectPropertySetter(_xsd2.default.readNonNegativeInteger)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.CONTACT_INFORMATION_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'ContactPersonPrimary': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readContactPersonPrimary_),
    'ContactPosition': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'ContactAddress': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readContactAddress_),
    'ContactVoiceTelephone': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'ContactFacsimileTelephone': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'ContactElectronicMailAddress': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.CONTACT_PERSON_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'ContactPerson': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'ContactOrganization': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.CONTACT_ADDRESS_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'AddressType': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'Address': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'City': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'StateOrProvince': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'PostCode': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'Country': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.EXCEPTION_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Format': _xml4.default.makeArrayPusher(_xsd2.default.readString)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.LAYER_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Name': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'Title': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'Abstract': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'KeywordList': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readKeywordList_),
    'CRS': _xml4.default.makeObjectPropertyPusher(_xsd2.default.readString),
    'EX_GeographicBoundingBox': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readEXGeographicBoundingBox_),
    'BoundingBox': _xml4.default.makeObjectPropertyPusher(_ol_format_WMSCapabilities_.readBoundingBox_),
    'Dimension': _xml4.default.makeObjectPropertyPusher(_ol_format_WMSCapabilities_.readDimension_),
    'Attribution': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readAttribution_),
    'AuthorityURL': _xml4.default.makeObjectPropertyPusher(_ol_format_WMSCapabilities_.readAuthorityURL_),
    'Identifier': _xml4.default.makeObjectPropertyPusher(_xsd2.default.readString),
    'MetadataURL': _xml4.default.makeObjectPropertyPusher(_ol_format_WMSCapabilities_.readMetadataURL_),
    'DataURL': _xml4.default.makeObjectPropertyPusher(_ol_format_WMSCapabilities_.readFormatOnlineresource_),
    'FeatureListURL': _xml4.default.makeObjectPropertyPusher(_ol_format_WMSCapabilities_.readFormatOnlineresource_),
    'Style': _xml4.default.makeObjectPropertyPusher(_ol_format_WMSCapabilities_.readStyle_),
    'MinScaleDenominator': _xml4.default.makeObjectPropertySetter(_xsd2.default.readDecimal),
    'MaxScaleDenominator': _xml4.default.makeObjectPropertySetter(_xsd2.default.readDecimal),
    'Layer': _xml4.default.makeObjectPropertyPusher(_ol_format_WMSCapabilities_.readLayer_)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.ATTRIBUTION_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Title': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'OnlineResource': _xml4.default.makeObjectPropertySetter(_xlink2.default.readHref),
    'LogoURL': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readSizedFormatOnlineresource_)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'westBoundLongitude': _xml4.default.makeObjectPropertySetter(_xsd2.default.readDecimal),
    'eastBoundLongitude': _xml4.default.makeObjectPropertySetter(_xsd2.default.readDecimal),
    'southBoundLatitude': _xml4.default.makeObjectPropertySetter(_xsd2.default.readDecimal),
    'northBoundLatitude': _xml4.default.makeObjectPropertySetter(_xsd2.default.readDecimal)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.REQUEST_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'GetCapabilities': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readOperationType_),
    'GetMap': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readOperationType_),
    'GetFeatureInfo': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readOperationType_)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.OPERATIONTYPE_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Format': _xml4.default.makeObjectPropertyPusher(_xsd2.default.readString),
    'DCPType': _xml4.default.makeObjectPropertyPusher(_ol_format_WMSCapabilities_.readDCPType_)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.DCPTYPE_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'HTTP': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readHTTP_)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.HTTP_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Get': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readFormatOnlineresource_),
    'Post': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readFormatOnlineresource_)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.STYLE_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Name': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'Title': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'Abstract': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'LegendURL': _xml4.default.makeObjectPropertyPusher(_ol_format_WMSCapabilities_.readSizedFormatOnlineresource_),
    'StyleSheetURL': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readFormatOnlineresource_),
    'StyleURL': _xml4.default.makeObjectPropertySetter(_ol_format_WMSCapabilities_.readFormatOnlineresource_)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.FORMAT_ONLINERESOURCE_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Format': _xml4.default.makeObjectPropertySetter(_xsd2.default.readString),
    'OnlineResource': _xml4.default.makeObjectPropertySetter(_xlink2.default.readHref)
});

/**
 * @const
 * @type {Object.<string, Object.<string, ol.XmlParser>>}
 * @private
 */
_ol_format_WMSCapabilities_.KEYWORDLIST_PARSERS_ = _xml4.default.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
    'Keyword': _xml4.default.makeArrayPusher(_xsd2.default.readString)
});
exports.default = _ol_format_WMSCapabilities_;
module.exports = exports['default'];