// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
require({cache:{"url:esri/dijit/geoenrichment/templates/ImageNavigator.html":'\x3cdiv class\x3d"esriGEImageNavigator esriGENonSelectable"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"singleImageView"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"imageContainerOuter" class\x3d"imageNavigator_imageContainerOuter"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"imageContainer" class\x3d"imageNavigator_imageContainer"\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"imagePaginationDiv" class\x3d"esriGEAbsoluteStretched"\x3e\x3c/div\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"imageNoteContainerDiv" class\x3d"imageNavigator_imageNoteContainerDiv"\x3e\r\n                    \x3cdiv data-dojo-attach-point\x3d"imageNoteLabel" class\x3d"imageNavigator_imageNoteLabel"\x3e\x3c/div\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"prevImageButton" class\x3d"imageNavigator_prevImageButton esriGEImageNavigatorPaginationLeftButton"\x3e\x3c/div\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"nextImageButton" class\x3d"imageNavigator_nextImageButton esriGEImageNavigatorPaginationRightButton"\x3e\x3c/div\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"thumbnailListDiv" class\x3d"imageNavigator_thumbnailContainerDiv"\x3e\x3c/div\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"navigatorLabel" class\x3d"imageNavigator_navigatorLabel"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"noImagePlaceHolder" class\x3d"imageNavigator_noImagePlaceHolder"\x3e\r\n            \x3cdiv class\x3d"imageNavigator_noImagePlaceHolderImage noImage"\x3e\x3c/div\x3e\r\n            \x3cdiv class\x3d"imageNavigator_noImagePlaceHolderLabel"\x3e${nls.noImage}\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"showAllImagesButton" class\x3d"imageNavigator_showAllImagesButton"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"allImagesView" class\x3d"imageNavigator_allImagesView"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"allImagesListDiv"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e\r\n'}});
define("esri/dijit/geoenrichment/ImageNavigator","dojo/_base/declare dojo/on dojo/when dojo/string dojo/dom-class dojo/dom-construct dojo/dom-style dijit/_WidgetBase dijit/_TemplatedMixin ./Pagination ./FlowList ./utils/DomUtil ./utils/WaitingUtil ./ReportPlayer/core/annotations/annotationUtils/CircularMaskUtil dojo/text!./templates/ImageNavigator.html dojo/i18n!../../nls/jsapi".split(" "),function(m,k,l,q,g,f,e,r,t,u,v,b,n,w,x,h){function p(a,d,c){c=c||{};n.showProgress(d);return l(a.getThumbnail(),
function(a){n.removeProgress(d);if(a){var b=f.create("div",{"class":"imageNode esriGEAbsoluteStretched"},d);b.style.backgroundImage="url("+a+")";c.useCircularMask?setTimeout(function(){w.setCircularMask(c.useCircularMask,b,a)},0):c.scaleToCover&&(b.style.backgroundSize="cover")}else c.pagination?b=f.create("div",{"class":"thumbnailIsUnavailable",innerHTML:h.previewNotAvailable},d):(b=f.create("div",{"class":"imageNode esriGEAbsoluteStretched noImage"},d),b.style.backgroundImage="")})}h=h.geoenrichment.dijit.ReportPlayer.ImageNavigator;
var y=m(null,{createPresentation:function(a,d,c,b){c=f.create("div",{"class":"imageThumbnailListItemRoot"},c);p(a,c);this.selectPresentation(c,d);return c},selectPresentation:function(a,d){g[d?"add":"remove"](a,"imageThumbnailListItemRootSelected")}});return m([r,t],{templateString:x,nls:h,showNotes:!0,showThumbnails:!1,showNavigationLabel:!1,enableAllImagesButton:!0,pagination:null,thumbnailList:null,allImagesList:null,postCreate:function(){this.inherited(arguments);this._initPagination();this._initThumbnailsList();
this._updateUI();b.hide(this.noImagePlaceHolder);this._addImageListeners();this._setViewMode("singleImage")},_initThumbnailsList:function(){this.showThumbnails&&(this.thumbnailList=this._createAllImagesList(this.thumbnailListDiv))},_initAllImagesList:function(){this.allImagesList||(this.allImagesList=this._createAllImagesList(this.allImagesListDiv,"esriGEAbsoluteStretched"));this.allImagesList.setItems(this._images,!0);this.allImagesList.setSelectedIndex(this._imageIndex)},_createAllImagesList:function(a,
d){var c=this,b=(new v({"class":"imageThumbnailList "+(d||""),items:[],itemRenderer:new y,onChange:function(){c._imageIndex=b.items.indexOf(b.selectedItem);c._setViewMode("singleImage");c._showImage()}})).placeAt(a);this.own(b);return b},_initPagination:function(){var a=this;this.pagination=(new u({createItemContainer:function(){var b=f.create("div",{"class":"imageNavigator_imagePaginationRoot"});0<a._containerHeight&&e.set(b,"height",a._containerHeight+"px");k(b,"click",function(){a._onImageClicked(b)});
return b},updateItemContainer:function(b,c){f.empty(b);a.onContentLoadingStart();l(p(c,b,{useCircularMask:a._useCircularMask,scaleToCover:a._scaleToCover,pagination:!0}),function(){a.onContentLoadingEnd()})},scrollAnimation:"slide",autoCenter:"$stretch:1,1"})).placeAt(this.imagePaginationDiv);this.own(this.pagination);this.pagination.set("items",[]);this.pagination.startup()},_onImageClicked:function(a){a=this._getCurrentImage();l(a&&a.getAttachmentUrl&&a.getAttachmentUrl(),function(a){a&&window.open(a,
"_blank")})},_updateUI:function(){b[this.showNotes?"show":"hide"](this.imageNoteContainerDiv);b[this.showThumbnails?"show":"hide"](this.thumbnailListDiv);b[this.showNavigationLabel?"show":"hide"](this.navigatorLabel)},_imageIndex:0,_addImageListeners:function(){var a=this;k(this.prevImageButton,"click",function(){0!=a._imageIndex&&(a._imageIndex--,a._showImage())});k(this.nextImageButton,"click",function(){a._imageIndex!=a._images.length-1&&(a._imageIndex++,a._showImage())});this.enableAllImagesButton&&
k(this.showAllImagesButton,"click",function(){a._setViewMode("allImages")})},_updateImageButtons:function(){g[0<this._imageIndex?"remove":"add"](this.prevImageButton,"esriGEImageNavigatorPaginationLeftButtonDisabled");g[this._imageIndex<this._images.length-1?"remove":"add"](this.nextImageButton,"esriGEImageNavigatorPaginationRightButtonDisabled")},_getCurrentImage:function(){return this._images[this._imageIndex]},_showImage:function(){var a=this._getCurrentImage();a?(b.show(this.imageContainerOuter),
b.hide(this.noImagePlaceHolder),this.pagination.resize(),this.pagination.set("currentPage",this._imageIndex),this.thumbnailList&&this.thumbnailList.setSelectedIndex(this._imageIndex)):(b.hide(this.imageContainerOuter),b.show(this.noImagePlaceHolder));g[a?"remove":"add"](this.domNode,"hasNoImages");this._updateImageButtons();this._updateNavigatorLabel();this._showNote()},_updateNavigatorLabel:function(){this.navigatorLabel.innerHTML=q.substitute(h.paginationLabel,{n:this._imageIndex+1,m:this._images.length})},
_showNote:function(){var a=this._getCurrentImage();this.imageNoteLabel.innerHTML=a&&a.description||"";e.set(this.imageNoteContainerDiv,"visibility",this.imageNoteLabel.innerHTML?"visible":"hidden")},_attachmentStore:null,_useCircularMask:null,_scaleToCover:null,update:function(a,b){this._attachmentStore=a||this._attachmentStore;this._updateWithAdditionalParameters(b);this._updateUI();this._imageIndex=0;var c=this;return l(this._attachmentStore&&this._attachmentStore.getAttachments(),function(a){c._images=
a||[];c.pagination.set("items",c._images);c._showImage();c.thumbnailList&&(c.thumbnailList.setItems(c._images),c.thumbnailList.setSelectedIndex(c._imageIndex));c._height&&c.setHeight(c._height)})},_updateWithAdditionalParameters:function(a){a=a||{};this._useCircularMask=a.useCircularMask;g[a.alwaysShowCaptions?"add":"remove"](this.domNode,"fixedCaptions");this._scaleToCover=a.scaleToCover},_mode:null,_setViewMode:function(a){b.hide([this.singleImageView,this.allImagesView]);"singleImage"==a?b.show(this.singleImageView):
(b.show(this.allImagesView),this._initAllImagesList());this._mode=a},getImageIndex:function(){return this._imageIndex},setImageIndex:function(a){this._imageIndex=a;this._showImage()},_height:0,_containerHeight:0,setHeight:function(a){this._height=a;this._containerHeight=a-(this.showThumbnails?50:0);e.set(this.imageContainer,"height",this._containerHeight+"px");e.set(this.noImagePlaceHolder,"paddingTop",(a-e.get(this.noImagePlaceHolder,"height"))/2+"px");a=(this._containerHeight-e.get(this.prevImageButton,
"height"))/2;e.set(this.prevImageButton,"top",a+"px");e.set(this.nextImageButton,"top",a+"px");this.pagination.resize()},onContentLoadingStart:function(){},onContentLoadingEnd:function(){}})});