// 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/geoenrichment/ReportPlayer/dataProviders/supportClasses/attachments/WebMapAttachmentStore","dojo/_base/declare dojo/when esri/dijit/geoenrichment/ReportPlayer/dataProviders/supportClasses/attachments/AttributesUtil esri/dijit/geoenrichment/utils/requests/UniversalClient esri/dijit/geoenrichment/utils/ImageUtil ./AttachmentsUtil".split(" "),function(d,c,e,f,g,h){var k={_cache:{},getThumbnail:function(a,b){this._cache[a.url]||(this._cache[a.url]=this._getDataURL(a,b));return this._cache[a.url]},
_getDataURL:function(a,b){return 0===a.url.indexOf("data:")?a.url:b.send(a.url,{content:{handleAs:"json"}}).then(function(b){return b&&b.Attachment&&g.base64DataToDataURL(b.Attachment,a.contentType)}).otherwise(function(){return null})}};return d(null,{_client:null,_attachmentInfos:null,_feature:null,constructor:function(a,b){this._feature=a;this._attachmentInfos=b;this._client=new f;this._client.useCommonAuth=!0},initialize:function(){return c(this._attachmentInfos||this._tryGetAttachmentInfos()).always(function(){return!!this._attachmentInfos}.bind(this))},
_tryGetAttachmentInfos:function(){return c(h.getFeatureAttachmentInfos(this._feature),function(a){this._attachmentInfos=a}.bind(this))},getAttachments:function(){var a=this;return this._attachmentInfos?this._attachmentInfos.map(function(b){return{getThumbnail:function(){return k.getThumbnail(b,a._client)},getAttachmentUrl:function(){return b.url}}}):[]},getAttributes:function(){var a=this._feature.infoTemplate;return a?e.composeAttributesFromFieldInfos(a.info.fieldInfos,this._feature.attributes):
[]},getNotes:function(){return[]}})});