text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See http://js.arcgis.com/3.15/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.
  
  //>>built
  define(["dojo/_base/lang","dojo/_base/array","./layerUtil"],function(f,e,g){return{isValid:function(a,b,c){var d=!1;-1!==b.dijitID.indexOf("MergeLayers")?d=this.mergeAvailable(a):-1!==b.dijitID.indexOf("ExtractData")?d=this.extractAvailable(a,c):-1!==b.dijitID.indexOf("GeocodeLocationsFromTable")?d=this.geocodeLocationsFromTable():(c=null,"requiredParam"in b&&(c=b.requiredParam),d=this.paramAvailable(a,b.analysisLayer,c));return d},geocodeLocationsFromTable:function(){var a=g.getTableInfos();return f.isArray(a)&&
  0<a.length},mergeAvailable:function(a){return e.some(a,function(b){return e.some(a,function(a){return a!==b&&a.geometryType===b.geometryType})})},extractAvailable:function(a,b){var c=b.getUser(),d=b.isPortal();e.forEach(a,function(a){var h="esri.layers.GeoRSSLayer"===a.declaredClass,e="esri.layers.CSVLayer"===a.declaredClass,f="esri.layers.FeatureLayer"===a.declaredClass,g="esri.layers.WFSLayer"===a.declaredClass;f&&!a.url||h||e||g?this._addExtractCapability(a):f&&(b.isAdmin()&&(d&&a.itemInfo&&a.itemInfo.itemControl&&
  "admin"===a.itemInfo.itemControl||!d&&a.url&&-1<a.url.indexOf("/"+c.orgId+"/"))?this._addExtractCapability(a):c&&a.itemInfo&&a.itemInfo.owner&&a.itemInfo.owner===c.username&&(!d&&a.url&&-1<a.url.indexOf("/"+c.orgId+"/")||d)&&this._addExtractCapability(a))},this);return e.some(a,function(a){return a.capabilities&&0<=a.capabilities.indexOf("Extract")})},_addExtractCapability:function(a){a.capabilities?-1===a.capabilities.indexOf("Extract")&&(a.capabilities+=",Extract"):a.capabilities="Extract";return!0},
  paramAvailable:function(a,b,c){var d,e=!1;d=b.geomTypes;b=this.findMatchedFeatureLayers(a,d);0<b.length&&(c?(d=c.geomTypes,a=this.findMatchedFeatureLayers(a,d),0<a.length&&(b.length!==a.length?e=!0:1<b.length?e=!0:b[0]!==a[0]&&(e=!0))):e=!0);return e},findMatchedFeatureLayers:function(a,b){var c=[];e.forEach(a,f.hitch(this,function(a){a&&(1===b.length?"*"!==b[0]&&b[0]!==a.geometryType||c.push(a.id):-1<b.indexOf(a.geometryType)&&c.push(a.id))}));return c}}});