// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/metadata/base/xml/XmlInterrogator","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ./XmlFlattener ./xmlUtil ../../../../kernel".split(" "),function(m,n,k,p,q,r,t){m=m(null,{constructor:function(b){n.mixin(this,b)},interrogate:function(b,g){var a=(new q).flatten(b),h=a.prefixesByUri,e=a.valuesByPath,d={};k.forEach(g,function(c){var b=c.interrogationRules;if(b&&0!==b.length){var l=r.makeGxeUrisByPrefix(c.getNamespaces());c=c.key;var g=b.length,a=0,f=!1;k.forEach(b,function(d){var c=
d.path;c&&(c=this._transformPath(h,l,c),(d=this._evaluateMatch(e,c,d))?a++:b.must&&(f=!0))},this);!f&&0<a&&(d[c]={nRules:g,nRulesMatched:a})}},this);var f=null,l=0;k.forEach(g,function(b){var c=b.key,a=null;c in d&&(a=d[c],null===f?(f=b,l=a.nRulesMatched):a.nRulesMatched>l&&a.nRules===a.nRulesMatched&&(f=b,l=a.nRulesMatched))});return f},_evaluateMatch:function(b,g,a){var h=!1,e=null;"undefined"!==typeof a.value&&(e=a.value);if(g in b){if(null===e)return!0;b=b[g];h=k.some(b,function(b){return e===
b})}return h},_transformPath:function(b,g,a){var h=[],e,d,f;k.forEach(a.split("/"),function(a){var c=-1!==a.indexOf("@");e=a.replace("@","").split(":");2===e.length?(d=null,(f=g[e[0]])&&(d=b[f]),d?(c&&(d="@"+d),h.push(d+":"+e[1])):h.push(a)):h.push(a)});return h.join("/")}});p("extend-esri")&&n.setObject("dijit.metadata.base.xml.XmlInterrogator",m,t);return m});