// 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/SectionDynamicSettings.html":'\x3cdiv class\x3d"esriGEReportPlayer_sectionDynamicSettings"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d\'viewOptionsDiv\' class\x3d"esriGERow15 esriGESpaceBeforeBig"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"toggleViewButton" class\x3d"dijitInline esriGELink"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d\'toggleStateOptionsDiv\' class\x3d"esriGERow15 esriGESpaceBeforeBig"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"toggleStateOptionsToggleDiv" class\x3d"dijitInline"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d\'sortingListDiv\'\x3e\x3c/div\x3e\r\n\x3c/div\x3e'}});
define("esri/dijit/geoenrichment/ReportPlayer/core/sections/supportClasses/SectionDynamicSettingsBuilder","dojo/_base/declare dojo/on dojo/dom-construct dojo/dom-style dijit/_WidgetBase dijit/_TemplatedMixin esri/dijit/geoenrichment/FlowList esri/dijit/geoenrichment/DataBrowser/VariableToggle esri/dijit/geoenrichment/DataBrowser/VariableUtil esri/dijit/geoenrichment/utils/DomUtil esri/dijit/geoenrichment/utils/MouseUtil esri/dijit/geoenrichment/utils/PopupUtil esri/dijit/geoenrichment/ReportPlayer/core/charts/chartUtils/ChartTypes esri/dijit/geoenrichment/ReportPlayer/core/charts/chartUtils/ChartSorting dojo/text!../../templates/SectionDynamicSettings.html dojo/i18n!../../../../../../nls/jsapi".split(" "),
function(f,g,l,q,r,t,m,u,z,h,v,n,p,k,w,d){d=d.geoenrichment.dijit.ReportPlayer.ReportPlayer;var x=f(m.itemRenderers.DefaultItemRenderer,{createLabelNode:!0,createImageAfterLabel:!0,_createImageNode:function(a,b){return l.create("div",{"class":"esriGESpaceBeforeBig dijitInline"},b)}}),y=f([r,t],{templateString:w,calcStateToggle:null,sortingList:null,_isChartShownFlag:!0,setViewOptions:function(a){var b=this;h[a?"show":"hide"](this.viewOptionsDiv);g(this.toggleViewButton,"click",function(){b._isChartShownFlag=
!b._isChartShownFlag;b._updateControlsForView();b[b._isChartShownFlag?"onShowChart":"onShowTable"]()});this._updateControlsForView()},_updateControlsForView:function(){this.toggleViewButton.innerHTML=this._isChartShownFlag?d.viewTable:d.viewChart;h.enableContentAbsolute(this.sortingListDiv,this._isChartShownFlag)},onShowTable:function(){},onShowChart:function(){},setToggleCalcStateOptions:function(a){var b=this;h[a?"show":"hide"](this.toggleStateOptionsDiv);a&&(this.calcStateToggle=new u(a,this.toggleStateOptionsToggleDiv),
this.own(this.calcStateToggle),this.calcStateToggle.stopMouseEventPropagation=!1,this.calcStateToggle.set("value",a.value),g(this.calcStateToggle,"change",function(){b.onCalcStateChanged(b.calcStateToggle.getStateName())}))},onCalcStateChanged:function(a){},setSortingOptions:function(a,b){var c=this;this.sortingList||(this.sortingList=(new m({"class":"sectionDynamicSettings_sortingList",itemRenderer:new x,onChange:function(){c.onSort(c.sortingList.get("value"))}})).placeAt(this.sortingListDiv),this.own(this.sortingList));
this.sortingList.setItems(a);this.sortingList.set("value",b)},onSort:function(a){},setVisualState:function(a){a&&(a=a.stackElements[0]&&a.stackElements[0].cells&&a.stackElements[0].cells[0])&&(this._isChartShownFlag=!a.isTableView,a.sorting&&this.sortingList.set("value",a.sorting),this._updateControlsForView())}});return f(null,{settingsButtonClass:null,_section:null,_settingsWidget:null,constructor:function(a){this._section=a;this._createSettings()},_provideSettings:function(){var a=[],b=this._section.getChartJson();
if(b&&b.type===p.GAUGE)return null;var c=b&&!!b.seriesItems.length,e=this._section.calculationStatesGroup;this._provideOptionsForSorting(b,a);a.length||(a=null);return c||a||e?{canViewTable:c,group:e,sortingOptions:a,sorting:b.visualProperties.sorting}:null},_provideOptionsForSorting:function(a,b){a&&1===a.seriesItems.length&&p.isSortingEnabled(a.type)&&(b.push({label:d.noSorting,imageClass:"",value:k.NONE}),b.push({label:d.sortAscending,imageClass:"upButton",value:k.ASC}),b.push({label:d.sortDescending,
imageClass:"downButton",value:k.DESC}))},_provideOptionsForComparisonLevels:function(a,b){},_createSettings:function(){function a(){d||(d=!0,n.makePopup(function(){function a(){n.close(c._settingsWidget)}c._settingsWidget||(c._settingsWidget=new y({onSort:function(b){a();c._section.sortChart(b)},onShowTable:function(){a();c._section.chartToTable()},onShowChart:function(){a();c._section.tableToChart()},onCalcStateChanged:function(b){a();c._section.setChartCalculationState(b)}}),c._section.own(c._settingsWidget),
c._settingsWidget.setSortingOptions(e.sortingOptions,e.sorting),c._settingsWidget.setViewOptions(e.canViewTable),c._settingsWidget.setToggleCalcStateOptions(e.group),c._settingsWidget.setVisualState(c._section.getVisualState()));return c._settingsWidget}(),c._section,f,{orient:["before","below"]}))}function b(b){q.set(f,"visibility",b?"visible":"hidden");b&&a()}var c=this,e=this._provideSettings();if(e){var d=!1,f=l.create("div",{"class":"sectionDynamicSettings_settingsButton"},this._section.domNode);
this.settingsButtonClass&&domClass.add(f,this.settingsButtonClass);b(!1);this._section.own(g(document.body,"mousemove",function(){b(v.isMouseOver(c._section.domNode))}))}},setVisualState:function(a){this._settingsWidget&&this._settingsWidget.setVisualState(a)}})});