// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.7/esri/copyright.txt for details. //>>built define("require exports ../core/tsSupport/extendsHelper ../core/tsSupport/decorateHelper dojo/Deferred dojo/when dojo/_base/lang dojo/promise/all ../core/typescript ../geometry/support/jsonUtils ./FeatureActionFeatures ./core/errorMessages ./core/ExtensionBase ./core/messageHandler".split(" "),function(v,w,p,k,e,f,q,l,m,r,t,d,u,g){return function(n){function c(){var a=n.call(this)||this;a.mapWidgetProxy=null;a.mapWidgetId=null;a.dataSourceProxies=null;a.hasFeatureActions=!1;a.hasDefaultFeatureAction= !1;a.featureActionFeatures=null;a.dataSourceConfigs=null;return a}p(c,n);c.prototype._initializeResponseReceived=function(a){var b=this;a&&"object"===typeof a||(new e).reject(Error(d.invalidArguments));return this.inherited(arguments).then(function(){b.hasFeatureActions=a.supportFeatureActions;b.hasDefaultFeatureAction=a.supportDefaultFeatureAction;var h=f(b._setupMapWidgetProxy()),c=f(b._setupDataSourceProxies()),d=f(b._setupFeatureActionFeatures());return l([h,c,d])})};c.prototype._setupDataSourceProxies= function(){var a=this;this.dataSourceConfigs||(this.dataSourceConfigs=[]);if(0!==this.dataSourceConfigs.length){var b=[];this.dataSourceConfigs.forEach(function(h){b.push(a.getDataSourceProxy(h.dataSourceId))});return l(b).then(function(b){a.dataSourceProxies=b})}};c.prototype._setupMapWidgetProxy=function(){var a=this;if(this.mapWidgetId)return this.getMapWidgetProxy(this.mapWidgetId).then(function(b){a.mapWidgetProxy=b})};c.prototype._setupFeatureActionFeatures=function(){var a=this;if(this.hasFeatureActions&& 0!==this.dataSourceConfigs.length){var b=this.dataSourceConfigs[0].dataSourceId;if(this.featureActionFeatures)this.featureActionFeatures.dataSourceProxy.id!==b&&(this.featureActionFeatures=null);else return this.getDataSourceProxy(b).then(function(b){a.featureActionFeatures=new t(b)})}else this.featureActionFeatures=null};c.prototype._messageReceived=function(a){switch(a.functionName.toLowerCase()){case "datasourceexpired":case "datasourceupdated":this._dataSourceExpired(a.args.dataSourceId);break; case "drawcomplete":this._drawComplete(a.args)}};c.prototype._dataSourceExpired=function(a){var b=this;this.getDataSourceProxy(a).then(function(a){var c=b.getDataSourceConfig(a);b.dataSourceExpired(a,c);b.emit("data-source-expired",{dataSourceProxy:a,dataSourceConfig:c})})};c.prototype.dataSourceExpired=function(a,b){};c.prototype.getDataSourceConfig=function(a){if(!this._isHostInitialized())throw Error(d.hostNotReady);var b=a;"object"===typeof a&&(b=a.id);for(a=0;a