// 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/core/templates/InfographicsPage.html":'\x3cdiv class\x3d"esriGEReportPlayer_infographicsPage"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d\'paginationDiv\' class\x3d"esriGEReportPlayer_reportContainerGrid reportContainerPreviewMode"\x3e\x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d\'emptyPlaceholderDiv\' class\x3d"infographicsPage_emptyPlaceholder esriGEAbsoluteStretched esriGEHidden"\x3e${nls.noInfographicsToShow}\x3c/div\x3e\r\n\x3c/div\x3e'}});
define("esri/dijit/geoenrichment/ReportPlayer/core/infographics/InfographicsPage","dojo/_base/declare dojo/_base/lang dojo/Deferred dojo/dom-class dojo/dom-construct dojo/dom-style dojo/on dojox/uuid/generateRandomUuid dijit/_WidgetBase dijit/_TemplatedMixin esri/dijit/geoenrichment/Pagination esri/dijit/geoenrichment/utils/DomUtil esri/dijit/geoenrichment/ReportPlayer/core/supportClasses/ViewModes ../supportClasses/templateJsonUtils/query/TemplateJsonQueryUtil dojo/text!../templates/InfographicsPage.html dojo/i18n!../../../../../nls/jsapi".split(" "),
function(n,f,p,x,h,e,y,q,r,t,u,k,v,l,w,g){function m(a){if(a&&a.children)for(;a.children.length;)a.removeChild(a.children[0])}g=g.geoenrichment.dijit.ReportPlayer.ReportPlayer;return n([r,t],{templateString:w,nls:g,viewModel:null,themeContext:null,theme:null,parentWidget:null,keepPagePosition:!0,pagination:null,_sections:null,postCreate:function(){this.inherited(arguments);this._sections=[];this._createPagination()},_createPagination:function(){var a=this;this.pagination=(new u({createItemContainer:f.hitch(this,
this._createItemContainer),updateItemContainer:f.hitch(this,this._updateItemContainer),onNodePreDestroy:m,onNodePlaced:f.hitch(this,this._onNodePlaced),scrollAnimation:"slide",cyclicPagination:!0,onPageChanged:function(){a.onPageIndexChanged(a.getCurrentPageIndex())}})).placeAt(this.paginationDiv);this.own(this.pagination);this.pagination.set("items",[]);this.pagination.startup()},_createItemContainer:function(){return h.create("div",{"class":"infographicPage_infographicRoot"})},_sectionsHash:null,
_getSectionByJson:function(a){if(!this.viewModel.dynamicReportInfo)return null;this._sectionsHash=this._sectionsHash||{};a._id||(a._id=q());return this._sectionsHash[a._id]},_putSectionToHash:function(a,d){this._sectionsHash&&(this._sectionsHash[d._id]=a)},_updateItemContainer:function(a,d){this._createSectionNode(a,d)},_createSectionNode:function(a,d){if(a&&a.parentNode){m(a);h.empty(a);var b=this._getSectionByJson(d);if(b&&b.domNode)b.placeAt(a),k.isNodeInLayout(a)&&this._onNodePlaced(a,d);else{b&&
b.destroy();b={"class":"adjustableGrid_inCellSection"};b.json=d;b.viewModel=this.viewModel;b.themeContext=this.themeContext;b.theme=this.theme;b.parentWidget=this;b.initialWidth=e.get(a,"width");b.hasFixedLayout=!1;b=this.viewModel.layoutBuilder.createElement("section",b,a);this._sections.push(b);b.setViewMode(v.PREVIEW_VALUES);var c=l.getParentBox(d);(b.__parentBox=c)?(b.setResizedHeight(c.h),b.setWidth(c.w),e.set(a,{width:c.w+"px",height:c.h+"px"})):(b.setResizedHeight(e.get(a,"height"),{resizeContentProportionally:!0}),
b.setWidth(e.get(a,"width"),{resizeContentProportionally:!0}));this._putSectionToHash(b,d)}(c=l.getParentStyle(d))&&c.backgroundColor&&(a.style.backgroundColor=c.backgroundColor);return b}},_currentSection:null,_onNodePlaced:function(a,d){var b=this._getSectionByJson(d);this._isAutoResizeMode&&(b&&b.notifyShown(),this._currentSection=b,this._resizePaginationToFitSelectedElement(a))},getCurrentSectionBox:function(){return this._currentSection&&this._currentSection.__parentBox},getCurrentPageIndex:function(){return this.pagination.get("currentPage")},
setCurrentPageIndex:function(a){this.pagination.set("currentPage",a)},showNextPage:function(){this.pagination.set("currentPage","next")},showPreviousPage:function(){this.pagination.set("currentPage","prev")},_prevPageState:null,getNumItems:function(){return this.pagination.items.length},setItems:function(a){return this._setItems(a)},_setItems:function(a,d){function b(){c._resizeContent();e.resolve()}var c=this,e=new p,f=c._prevPageState===d&&c.keepPagePosition,g=c.pagination.get("currentPage");c._destroySections();
c.pagination.set("items",a);c._prevPageState=d;k[a.length?"hide":"show"](c.emptyPlaceholderDiv);f?(c._resizeContent(),c.pagination.set("currentPage",Math.max(g,0)),setTimeout(b,100)):b();return e.promise},setHeight:function(a){e.set(this.domNode,"height",a+"px")},_width:0,_height:0,_isAutoResizeMode:!0,_isResizing:!1,_pendingResizeNode:null,resize:function(a,d){this._width=a;this._height=d;this._resizeContent()},_checkAutoResizeMode:function(){this._isAutoResizeMode=0===this._width&&0===this._height},
_resizeContent:function(){this._checkAutoResizeMode();this._isResizing=!0;this._pendingResizeNode=null;this._isAutoResizeMode?(e.set(this.domNode,{width:"auto",height:"auto"}),e.set(this.paginationDiv,{width:"500px",height:"250px"}),this.pagination.resize(),e.set(this.paginationDiv,{width:"auto",height:"auto"})):(e.set(this.domNode,{width:this._width+"px",height:this._height+"px"}),e.set(this.paginationDiv,{width:this._width+"px",height:this._height+"px"}),this.pagination.resize());this._isResizing=
!1;if(this._pendingResizeNode&&this._isAutoResizeMode)this._resizePaginationToFitSelectedElement(this._pendingResizeNode);else this.onResized()},_resizePaginationToFitSelectedElement:function(a){this._isResizing?this._pendingResizeNode=a:(this._pendingResizeNode=null,e.set(this.paginationDiv,{width:e.get(a,"width")+200+"px",height:e.get(a,"height")+80+"px"}),this.onResized(!0))},notifyShown:function(){},onPageIndexChanged:function(a){},onResized:function(a){},_destroySections:function(){this._sections.forEach(function(a){a.destroy()});
this._sections.length=0},destroy:function(){this._destroySections();this.inherited(arguments)}})});