// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
require({cache:{"jimu/dijit/ColorPickerPopup":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dojo/_base/lang dojo/_base/html dojo/on dojo/_base/Color dijit/TooltipDialog dijit/popup jimu/dijit/ColorPalette jimu/utils".split(" "),function(m,k,r,d,f,e,g,h,l,p,n){return m([k,r],{baseClass:"jimu-color-pickerPopup",declaredClass:"jimu.dijit.ColorPickerPopup",templateString:'\x3cdiv class\x3d"jimu-color-picker"\x3e\x3c/div\x3e',_isTooltipDialogOpened:!1,color:null,showLabel:!1,
around:null,_ENABLE:!0,recordUID:"",postCreate:function(){this.inherited(arguments);this._createTooltipDialog(this.domNode);this._hideTooltipDialog()},destroy:function(){l.close(this.tooltipDialog);this.picker.destroy();this.tooltipDialog.destroy();this.inherited(arguments)},enable:function(){this._ENABLE=!0;f.removeClass(this.domNode,"disable")},disable:function(){this._ENABLE=!1;f.addClass(this.domNode,"disable")},isPartOfPopup:function(a){var b=this.tooltipDialog.domNode;return a===b||f.isDescendant(a,
b)},hideTooltipDialog:function(){this._hideTooltipDialog()},showTooltipDialog:function(){this._showTooltipDialog()},initUI:function(){this.picker.initUI()},isOpen:function(){return this._isTooltipDialogOpened},_showTooltipDialog:function(){l.open({parent:this.getParent(),popup:this.tooltipDialog,around:this.around?this.around:this.domNode,orient:this.orient});this._isTooltipDialogOpened=!0},_hideTooltipDialog:function(){l.hide(this.tooltipDialog);this._isTooltipDialogOpened=!1},_createTooltipDialog:function(){var a=
f.create("div");this.tooltipDialog=new h({content:a});f.addClass(this.tooltipDialog.domNode,"jimu-color-picker-popup-dialog");var b=new p({appearance:{showTransparent:!1,showColorPalette:!0,showCoustom:!0,showColorPickerOK:!0,showColorPickerApply:!0,showCoustomRecord:!0,closeDialogWhenChange:!0},recordUID:this.recordUID,onChange:d.hitch(this,function(c){c&&(c=new g(c),this.setColor(c),this.onChange(c))})});b.placeAt(a);b.startup();this.own(e(b,"close",d.hitch(this,function(){this._hideTooltipDialog()})));
this.own(e(b,"change-style",d.hitch(this,function(){this._hideTooltipDialog();this._showTooltipDialog()})));this.own(e(this.domNode,"click",d.hitch(this,function(c){c.stopPropagation();c.preventDefault();this._isTooltipDialogOpened?this._hideTooltipDialog():!1!==this._ENABLE&&this._showTooltipDialog()})));this.own(e(document,"click",d.hitch(this,function(c){this.isPartOfPopup(c.srcElement||c.target)||this._hideTooltipDialog()})));this.picker=b},setColor:function(a){if(a instanceof g){null===this.color&&
!0===this.showLabel&&this._changeLabel(a);var b=a.toHex();this.color=a;f.setStyle(this.domNode,"backgroundColor",b);this.picker&&(this.picker.refreshRecords(),this.picker.setColor(b,!1,!0));this.showLabel&&this._changeLabel(this.color)}},getColor:function(){return this.color},_changeLabel:function(a){f.empty(this.domNode);f.create("span",{innerHTML:a.toHex(),className:"color-label",style:{color:n.invertColor(a.toHex())}},this.domNode)},onChange:function(a){a&&this.showLabel&&this._changeLabel(a)},
changeColor:function(){this.picker&&this.picker.changeColor();this.showLabel&&this._changeLabel(this.color)},setTitle:function(a){this.domNode.title=a},getTooltipDialog:function(){return this.tooltipDialog||null}})})},"themes/DashboardTheme/widgets/Header/setting/SharedThemeChooserPopup":function(){define("dojo/Evented dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/_base/lang dojo/_base/html dojo/on dijit/TooltipDialog dojo/text!./SharedThemeChooserPopup.html dijit/popup".split(" "),
function(m,k,r,d,f,e,g,h,l,p,n){return k([r,d,f,m],{declaredClass:"shared-theme-chooser-popup",templateString:p,_DISAPPEAR_TIMER:null,_isTooltipDialogOpened:!1,placeAt:null,isPortalSupported:null,ACTION:null,postMixInProperties:function(){this.inherited(arguments);this.nls=e.mixin(this.nls,builderNls);this.ACTION={ORG:"org",SHARED:"shared",CUSTOM:"custom"}},postCreate:function(){this.inherited(arguments);this._createTooltipDialog();this.isPortalSupported||g.addClass(this.orgItem,"no-support");this.own(h(this.orgItem,
"click",e.hitch(this,function(a){a.stopPropagation();a.preventDefault();this.isPortalSupported&&this.orgClickHanlder(a)})));this.own(h(this.sharedItem,"click",e.hitch(this,function(a){a.stopPropagation();a.preventDefault();this.sharedClickHanlder(a)})));this.own(h(this.customItem,"click",e.hitch(this,function(a){a.stopPropagation();a.preventDefault();this.customClickHanlder(a)})));this._hideTooltipDialog()},destroy:function(){n.close(this.tooltipDialog);this.tooltipDialog.destroy();this.inherited(arguments)},
hideTooltipDialog:function(){this._hideTooltipDialog()},showTooltipDialog:function(){this._showTooltipDialog()},getTooltipDialog:function(){return this.tooltipDialog&&this.tooltipDialog.domNode?this.tooltipDialog:null},_showTooltipDialog:function(){!0!==this._isTooltipDialogOpened&&(n.open({parent:this.placeAt||this.getParent(),popup:this.tooltipDialog,around:this.around}),this._isTooltipDialogOpened=!0,this.emit("showPopup"))},_hideTooltipDialog:function(){n.close(this.tooltipDialog);this._isTooltipDialogOpened=
!1},_createTooltipDialog:function(){this.tooltipDialog=new l({content:this.domNode});g.addClass(this.tooltipDialog.domNode,"shared-theme-chooser-popup-container");var a=this.getTooltipDialog();this.own(h(a.domNode,"mouseover",e.hitch(this,function(b){this.showPopup(b)})));this.own(h(a.domNode,"mouseleave",e.hitch(this,function(b){this.hidePopup(b)})))},orgClickHanlder:function(a){this.emit("btnClick",this.ACTION.ORG,a)},sharedClickHanlder:function(a){this.emit("btnClick",this.ACTION.SHARED,a)},customClickHanlder:function(a){this.emit("btnClick",
this.ACTION.CUSTOM,a)},setChecked:function(a){g.removeClass(this.orgCheck,"check");g.removeClass(this.sharedCheck,"check");g.removeClass(this.customCheck,"check");a===this.ACTION.ORG&&this.isPortalSupported&&g.addClass(this.orgCheck,"check");a===this.ACTION.SHARED&&g.addClass(this.sharedCheck,"check");a===this.ACTION.CUSTOM&&g.addClass(this.customCheck,"check")},showPopup:function(a){a&&(a.stopPropagation(),a.preventDefault());this._clearDisappearTimer();!1===this._isTooltipDialogOpened&&(this.showTooltipDialog(),
this._isTooltipDialogOpened=!0)},hidePopup:function(a){a&&(a.stopPropagation(),a.preventDefault());this.hideTooltipDialog();this._isTooltipDialogOpened=!1},_clearDisappearTimer:function(){this._miniModeTimer&&clearTimeout(this._miniModeTimer)}})})},"themes/DashboardTheme/widgets/Header/setting/_build-generate_module":function(){define(["dojo/text!./Setting.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:themes/DashboardTheme/widgets/Header/setting/SharedThemeChooserPopup.html":'\x3cdiv class\x3d"shared-theme-chooser-popup"\x3e\r\n  \x3cdiv class\x3d"btns-container"\x3e\r\n    \x3cdiv class\x3d"btn-itmes" data-dojo-attach-point\x3d"orgItem"\x3e\r\n      \x3cdiv class\x3d"btns jimu-float-leading" data-dojo-attach-point\x3d"org"\x3e${nls.sharedTheme}\x3c/div\x3e\r\n      \x3cdiv class\x3d"jimu-float-trailing disabled" data-dojo-attach-point\x3d"orgCheck"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"btn-itmes" data-dojo-attach-point\x3d"sharedItem"\x3e\r\n      \x3cdiv class\x3d"btns jimu-float-leading" data-dojo-attach-point\x3d"shared"\x3e${nls.themeColor}\x3c/div\x3e\r\n      \x3cdiv class\x3d"jimu-float-trailing " data-dojo-attach-point\x3d"sharedCheck"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"btn-itmes" data-dojo-attach-point\x3d"customItem"\x3e\r\n      \x3cdiv class\x3d"btns jimu-float-leading" data-dojo-attach-point\x3d"custom"\x3e${nls.custom}\x3c/div\x3e\r\n      \x3cdiv class\x3d"jimu-float-trailing " data-dojo-attach-point\x3d"customCheck"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:themes/DashboardTheme/widgets/Header/setting/Setting.html":'\x3cdiv style\x3d"width:100%;"\x3e\r\n  \x3cdiv class\x3d"title"\x3e\r\n    ${nls.setStyle}\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"jimu-color-btn" data-dojo-attach-point\x3d"colorPicker"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',"url:themes/DashboardTheme/widgets/Header/setting/css/style.css":".dashboard-header-setting {display: flex; align-items: center;}.dashboard-header-setting .jimu-color-btn {margin: 0 20px; width: 100px; height: 36px; border: 1px solid lightgray; display: flex; align-items: center; justify-content: center; cursor: pointer;}.dashboard-header-setting .jimu-color-btn:hover {border: 2px solid #24B5CC;}",
"*now":function(m){m(['dojo/i18n!*preload*themes/DashboardTheme/widgets/Header/setting/nls/Setting*["ar","bs","ca","cs","da","de","en","el","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nb","nl","pl","pt-br","pt-pt","ro","ru","sk","sl","sr","sv","th","tr","zh-cn","uk","vi","zh-hk","zh-tw","ROOT"]'])},"*noref":1}});
define("dojo/_base/declare dojo/on dojo/_base/array dojo/_base/lang dojo/_base/html dojo/_base/Color dijit/_WidgetsInTemplateMixin jimu/BaseWidgetSetting jimu/utils jimu/portalUtils jimu/dijit/ColorPickerPopup ./SharedThemeChooserPopup".split(" "),function(m,k,r,d,f,e,g,h,l,p,n,a){return m([h,g],{baseClass:"dashboard-header-setting",darkColor:"#444444",lightColor:"#EEEEEE",startup:function(){this.inherited(arguments);this._createTooltipDialog();if(this.config.mode){if("org"===this.config.mode)this.popup.setChecked(this.popup.ACTION.ORG),
this._getOrgColor().then(d.hitch(this,function(q){this._changeLabel(new e(q))}));else if("custom"===this.config.mode)this.popup.setChecked(this.popup.ACTION.CUSTOM),this._changeLabel(new e(this.config.color));else{this.popup.setChecked(this.popup.ACTION.SHARED);var b=this._getThemeColor();this._changeLabel(new e(b))}this.colorPickerPopup.setColor(new e(this.config.color))}else{var c=d.getObject("theme.customStyles.mainBackgroundColor",!1,this.appConfig);c?this._getOrgColor().then(d.hitch(this,function(q){q===
c?(this.popup.setChecked(this.popup.ACTION.ORG),this._getOrgColor().then(d.hitch(this,function(t){this._changeLabel(new e(t))}))):(this.popup.setChecked(this.popup.ACTION.CUSTOM),this._changeLabel(new e(c)))})):(this.popup.setChecked(this.popup.ACTION.SHARED),b=this._getThemeColor(),this._changeLabel(new e(b)))}this.own(k(this.domNode,"mouseenter",d.hitch(this,function(){this.colorPickerPopup.isOpen()||this.popup.showPopup()})));this.own(k(this.domNode,"mouseleave",d.hitch(this,function(){this.colorPickerPopup.isOpen()||
this.popup.hidePopup()})))},_createTooltipDialog:function(){var b=d.getObject("theme.sharedTheme",!1,this.appConfig);this.popup=new a({placeAt:this.getParent(),nls:this.nls,around:this.colorPicker,isPortalSupported:b&&b.isPortalSupport});this.own(k(this.popup,"btnClick",d.hitch(this,function(c,q){c===this.popup.ACTION.ORG?this.showOrgThemeColor():c===this.popup.ACTION.SHARED?this.showSharedThemeColor():c===this.popup.ACTION.CUSTOM&&this.showCustomColor(q)})));this.colorPickerPopup=new n({showColorPickerOK:!0,
showLabel:!1,recordUID:this.recordUID,around:this.domNode});this.colorPickerPopup.placeAt(this.getParent());this.colorPickerPopup.startup();this.own(k(this.colorPickerPopup,"change",d.hitch(this,function(c){this.config.color=c;this.config.mode="custom";this._changeLabel(c);this.popup.setChecked(this.popup.ACTION.CUSTOM);this.popup.hideTooltipDialog()})))},_changeLabel:function(b){f.empty(this.colorPicker);this.colorPicker.style.background=b.toHex();f.create("span",{innerHTML:l.sanitizeHTML(b.toHex()),
className:"color-label",style:{color:l.invertColor(b.toHex())}},this.colorPicker)},_getOrgColor:function(){return p.getPortal(this.appConfig.portalUrl).loadSelfInfo().then(d.hitch(this,function(b){if(b&&b.portalProperties&&b.portalProperties.sharedTheme&&b.portalProperties.sharedTheme.header)return b.portalProperties.sharedTheme.header.background}),d.hitch(this,function(b){console.error(b)}))},_getThemeColor:function(){return"light"!==d.getObject("theme.styles",!1,this.appConfig)[0]?this.darkColor:
this.lightColor},showOrgThemeColor:function(){this.config.mode="org";f.empty(this.colorPicker);this.colorPicker.style.background="transparent";this.popup.setChecked(this.popup.ACTION.ORG);this.popup.hideTooltipDialog();this._getOrgColor().then(d.hitch(this,function(b){this._changeLabel(new e(b))}))},showSharedThemeColor:function(){this.config.mode="theme";f.empty(this.colorPicker);this.colorPicker.style.background="transparent";this.popup.setChecked(this.popup.ACTION.SHARED);this.popup.hideTooltipDialog();
var b=this._getThemeColor();this._changeLabel(new e(b))},showCustomColor:function(b){this.config.mode="custom";b&&(b.stopPropagation(),b.preventDefault());this.popup.hidePopup();this.colorPickerPopup.showTooltipDialog();this.colorPickerPopup.initUI()},destroy:function(){this.colorPickerPopup&&this.colorPickerPopup.picker.destroy();this.popup&&this.popup.destroy();this.inherited(arguments)},setConfig:function(b){this.config=b||{}},getConfig:function(){return this.config}})});