// 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/ReportPlayer/templates/ReportPlayer.html":'\x3cdiv data-dojo-attach-point\x3d"mainNode" class\x3d"esriGEReportPlayer esriGENonSelectable esriGEReportPlayerFullScreen"\x3e\r\n\r\n    \x3cdiv data-dojo-attach-point\x3d"printBackgroundView" class\x3d"esriGEAbsoluteStretched"\x3e\x3c/div\x3e\r\n\r\n    \x3cdiv data-dojo-attach-point\x3d"normalViewDiv" class\x3d"reportPlayer_normalViewDiv"\x3e\r\n\r\n        \x3cdiv data-dojo-attach-point\x3d"playerHeader" class\x3d"reportPlayer_header"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"infographicsSelectDiv" class\x3d"reportPlayer_infographicsSelectDiv"\x3e\x3c/div\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"areaTitleDiv" class\x3d"reportPlayer_areaTitleDiv"\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"areaTitleInnerDiv" class\x3d"dijitInline reportPlayer_areaTitleInnerDiv TrimWithEllipses"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"areasSelectDiv" class\x3d"reportPlayer_areasSelectDiv"\x3e\x3c/div\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"zoomPageBlockDiv" class\x3d"reportPlayer_zoomSelectPageSelectBlock"\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"zoomSelectDiv" class\x3d"dijitInline reportPlayer_zoomSelectDiv"\x3e\x3c/div\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"pageSelectDiv" class\x3d"dijitInline reportPlayer_pageSelectDiv"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"commandButtonsContainer" class\x3d"reportPlayer_commandButtonsContainer"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n\r\n        \x3cdiv data-dojo-attach-point\x3d"printableDivContainer" class\x3d"reportPalyer_printableDivContainer"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"printableDiv" class\x3d"reportPalyer_printableDiv"\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"reportContainerDiv"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n\r\n        \x3cdiv class\x3d"reportPlayer_headerPageNavigator" data-dojo-attach-point\x3d"headerPageNavigator"\x3e\r\n            \x3cdiv class\x3d"reportPlayer_paginationArrowUp" data-dojo-attach-point\x3d"prevPageButton"\x3e\x3c/div\x3e\r\n            \x3cdiv class\x3d"reportPlayer_paginationArrowDown" data-dojo-attach-point\x3d"nextPageButton"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n\r\n    \x3c/div\x3e\r\n\r\n    \x3cdiv data-dojo-attach-point\x3d"errorViewDiv" class\x3d"esriGEReportPlayerErrorMessage"\x3e\r\n        ${nls.cantPlayReportError}\r\n    \x3c/div\x3e\r\n\x3c/div\x3e'}});
define("esri/dijit/geoenrichment/ReportPlayer/ReportPlayer","dojo/_base/declare dojo/_base/lang dojo/Deferred dojo/dom-class dojo/dom-style dojo/on dojo/when dojo/promise/all dojo/promise/Promise dijit/_WidgetBase dijit/_TemplatedMixin ./config ./playerSupports/_CommandSupport ./playerSupports/_KeyboardNavigationSupport ./playerSupports/_LogoSupport ./playerSupports/_MapSupport ./playerSupports/_PageNavigationSupport ./playerSupports/_PlayerAreaSelectSupport ./playerSupports/_PrintSupport ./playerSupports/_ReportContainersSwitcher ./playerSupports/_SmartLayoutSupport ./playerSupports/_ZoomSupport ./playerSupports/_HeaderArrangeSupport ./playerSupports/_WaitingSupport ./printing/PageOptionsDialog/PageOptionsDialog ./ReportPlayerViewModel ./PlayerResizeModes ./PlayerZoomBehaviors ./PlayerThemes ./ReportPlayerState ./core/layout/LayoutBuilder esri/dijit/geoenrichment/utils/DomUtil esri/dijit/geoenrichment/utils/async/AsyncQueue dojo/text!./templates/ReportPlayer.html dojo/i18n!../../../nls/jsapi ./_devConfig".split(" "),
function(p,d,q,g,l,P,f,Q,R,r,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,m,n,L,h,M,N,k,O){k=k.geoenrichment.dijit.ReportPlayer.ReportPlayer;return p([r,t,v,x,y,B,C,D,E,A,w,z,F,G],{templateString:N,nls:k,dataProvider:null,config:null,isSlidesView:!1,enableDataDrilling:!0,theme:m.DARK,allowKeyboardNavigation:!0,showAreaTitle:!0,renderMapsFromCalculators:!1,resizeMode:J.AUTO,listenToWindowResize:!0,printConfig:{subtitle:k.preparedByEsri,printDialogClass:H},defaultZoomBehavior:K.FIT_PAGE,showProgressBar:!0,_viewModel:null,
_initPromise:null,_reportData:null,_analysisAreaIndex:0,_disableAnimation:!1,postCreate:function(){this.inherited(arguments);this.config=d.mixin({},u,this.config);this._applyTheme();this._showError(!1);this._initProgressController()},startup:function(){this.inherited(arguments);!this._viewModel&&this._reportData&&(this._viewModel=new I,this._viewModel.layoutBuilder=(new this._getLayoutBuilder)(),this._initPromise=f(this._viewModel.layoutBuilder.initialize()))},_getLayoutBuilder:function(){return L},
_applyTheme:function(){g.remove(this.domNode,"playerThemeDark playerThemeLight");g.add(this.domNode,this.theme===m.DARK?"playerThemeDark":"playerThemeLight");this.areasSelect&&this.areasSelect.setTheme(this.theme);this.pageSelect&&this.pageSelect.setTheme(this.theme);this.zoomSelect&&this.zoomSelect.setTheme(this.theme)},playReport:function(a,c){if(this.isContentLoading())return this.isContentLoading();var b=this;this._showError(!1);this._progressController&&this._progressController.reset();return f(this._showWaiting(this.dataProvider.getReportData(a,
function(a){b._progressController&&b._progressController.setLoadDataProgress(a)})),function(a){return b.setReportData(a,c)},function(a){b._showError(a)})},_isDataBeingSetFlag:!1,setReportData:function(a,c){if(this.isContentLoading())return this.isContentLoading();var b=this;c=c||{};if(a){c.disableAnimation&&(this._disableAnimation=!0);this._isDataBeingSetFlag=!0;n.isChartAnimationSuspended=!0;this.onSetReportDataStart();var e=new q;this._progressController&&this._progressController.setNumAreas(a.analysisAreas.length);
if(1===a.analysisAreas.length)this._resetLoadedFlags(),this._resetMapBuilder(),this._setReportData(a).then(e.resolve,e.reject);else{var f=function(){0>d?e.resolve():b._setReportData(a,{analysisAreaIndex:d--,rerenderContent:!1}).then(function(){setTimeout(f,0)},e.reject)};!1!==c._resetLoadedContents&&(this._resetLoadedFlags(),this._resetMapBuilder());var d=a.analysisAreas.length-1;f()}this._progressController&&this._progressController.setLoadDataProgress(1);var g=e.promise.then(function(){return b._progressController&&
b._progressController.finalize()}).otherwise(function(a){b._showError(a)});this._showWaiting(g);return g.always(function(){b._isDataBeingSetFlag=!1;n.isChartAnimationSuspended=!1;b.onSetReportDataEnd();b._emitPendingResizedEvent();b.getCurrentReportContainer()&&(b.getCurrentReportContainer().notifyShown(),b.getCurrentReportContainer().getShownGrid&&b.getCurrentReportContainer().getShownGrid().notifyShown());b._progressController&&b._progressController.reset();if(c.waitUntilAllContentIsReady)return b.isContentLoading()})}this._showError(!0)},
refresh:function(a){return this.isContentLoading()?this.isContentLoading():this._reportData&&f(this.setReportData(this._reportData,{waitUntilAllContentIsReady:!(!a||!a.waitUntilAllContentIsReady),_resetLoadedContents:!(!a||!a.rerenderContent)}),function(){this.showPageAt(0);return this.resize()}.bind(this))},showAnalysisAreaAt:function(a,c){if(this.isContentLoading())return this.isContentLoading();var b=this._setReportData(this._reportData,{analysisAreaIndex:a,rerenderContent:!(!c||!c.rerenderContent)});
return c&&c.waitUntilAllContentIsReady?this.isContentLoading():b},_setReportData:function(a,c){var b=this;c=c||{};c.analysisAreaIndex=c.analysisAreaIndex||0;var e=!1!==c.rerenderContent;this._reportData=a;this._analysisAreaIndex=c.analysisAreaIndex;this._showError(!this._reportData);if(this._reportData)return this._updateMapPortalUrl(),this._setFallbackMapImageInfos(this._reportData.mapImageInfos),this.startup(),f(this._initPromise,function(){b._updateAreaSelect();b._configureViewModel();return f(b._setReportContainer(e),
function(a){return a&&b._doApplyTemplateJson(c)})})},_doApplyTemplateJson:function(a){var c=this,b=this.getCurrentReportContainer(),e=b.fromJson(this._reportData.templateJson,{waitUntilAllContentIsReady:!0,progressCallback:function(b){c._progressController&&c._progressController.setProgressForAreaAt(b,a.analysisAreaIndex)}}),d=b.getPagePromise?b.getPagePromise():e,b=b.getContentPromise?b.getContentPromise():e;this._registerContntainerLoadPromise(b);return f(d,function(){this._setCurrentContainerLoaded();
this.showPageAt(this._currentPageIndex);return this.resize()}.bind(this))},_loadQueue:null,isContentLoading:function(){return this._loadQueue&&this._loadQueue.getPromise()},_registerContntainerLoadPromise:function(a){var c=this;this._loadQueue||(this._loadQueue=new M({onStarted:function(){h.enableContentAbsolute(c.commandButtonsContainer,!1)},onFinished:function(){h.enableContentAbsolute(c.commandButtonsContainer,!0)}}));this._loadQueue.add(a)},getReportData:function(){return this._reportData},updateTemplateJson:function(a){this._reportData&&
a&&(this._reportData.templateJson=a)},getReportTitle:function(){return this._reportData&&this._reportData.reportTitle||""},getCurrentAnalysisAreaIndex:function(){return this._analysisAreaIndex},getCurrentAnalysisArea:function(){return this._reportData&&this._reportData.analysisAreas[this._analysisAreaIndex]},getAnalysisAreas:function(){return this._reportData&&this._reportData.analysisAreas},_configureViewModel:function(){var a=this;this._viewModel.setTheme(this._reportData.templateJson.theme);var c=
this._getCurrentAnalysisAreaConfiguration();this._viewModel.enableDataDrilling=this.enableDataDrilling;this._disableAnimation&&(this._viewModel.chartAnimationAllowed=!1);this._viewModel.setDynamicReportInfo({fieldData:c.fieldData,features:c.features,infographicOptions:this._reportData.infographicOptions,attachmentsStore:this._reportData.attachmentsStore,createMapFunc:d.hitch(this,this._createMap),reportType:this._reportData.reportType,isClassic:this._reportData.isClassic,isFixedDataMode:!this._reportData.config.geoenrichmentUrl,
geClient:this._reportData.geClient});this._viewModel.getDynamicImageFunc=d.hitch(this,this._getReportLogo);this._viewModel.enrichFieldData=function(b){return a.dataProvider.enrichFieldData(b,d.mixin({analysisAreas:[c.analysisArea],fieldData:c.fieldData},a._reportData.config))}},_getCurrentAnalysisAreaConfiguration:function(){this._reportData.infographicOptions&&this._reportData.infographicOptions.setCurrentAnalysisAreaIndex(this._analysisAreaIndex);this._reportData.attachmentsStore&&this._reportData.attachmentsStore.setCurrentAnalysisAreaIndex&&
this._reportData.attachmentsStore.setCurrentAnalysisAreaIndex(this._analysisAreaIndex);var a=d.mixin({},this._reportData.fieldData);a.areaData=[this._reportData.fieldData.areaData[this._analysisAreaIndex]];var c=this._reportData.analysisAreas[this._analysisAreaIndex];return{fieldData:a,analysisArea:c,features:[c.feature]}},getNumberOfPages:function(){return this.getCurrentReportContainer().getNumberOfPages()},notifyShown:function(){this._isDataBeingSetFlag||this.getCurrentReportContainer()&&this.getCurrentReportContainer().notifyShown()},
_showError:function(a){O.emulateErrors.playerError&&(a=!0);h[a?"hide":"show"](this.normalViewDiv);h[a?"show":"hide"](this.errorViewDiv);g[a?"add":"remove"](this.domNode,"esriGEReportPlayerError");a&&(l.set(this.errorViewDiv,"paddingTop",l.get(this.domNode,"height")/2-20+"px"),this._progressController&&this._progressController.reset(),console.log(a),this.onError(a))},setPrintMode:function(a){g[a?"add":"remove"](this.domNode,"esriGEReportPlayerInPrinting")},resize:function(){this._applyTheme();return this.inherited(arguments)},
_pendingResizeEvent:null,_emitResizedEvent:function(a){this._pendingResizeEvent={isPaginating:!!a};this._isDataBeingSetFlag||this._emitPendingResizedEvent()},_emitPendingResizedEvent:function(){this._pendingResizeEvent&&(this.onResized(this._pendingResizeEvent.isPaginating),this._pendingResizeEvent=null)},onSetReportDataStart:function(){},onSetReportDataEnd:function(){},onResized:function(a){},onError:function(a){}})});