// 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:{"url:widgets/Infographic/setting/dijitsSetting/_dijits/NumberIndicator/IconChooserPanel.html":'\x3cdiv\x3e\r\n\t\x3cdiv style\x3d"margin-top: 12px;" class\x3d"title title-box" title\x3d"${nls.icons}"\x3e${nls.icons}\x3c/div\x3e\r\n\t\x3cdiv style\x3d"margin-top: 14px;" class\x3d"marginLeft30 flex-Ttb"\x3e\r\n\t\t\x3cdiv class\x3d"styleDiv"\x3e\r\n\t\t\t\x3cdiv class\x3d"left-div label-div style-label" title\x3d"${nls.style}"\x3e${nls.style}\x3c/div\x3e\r\n\t\t\t\x3cdiv class\x3d"style-container"\x3e\r\n\t\t\t\t\x3cdiv class\x3d"style-content" data-dojo-attach-point\x3d"iconStyle1"\x3e\x3c/div\x3e\r\n\t\t\t\t\x3cdiv class\x3d"style-content" data-dojo-attach-point\x3d"iconStyle2"\x3e\x3c/div\x3e\r\n\t\t\t\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\r\n\t\t\x3cdiv class\x3d"placement" style\x3d"margin-top:17px;"\x3e\r\n\t\t\t\x3cdiv class\x3d"left-div label-div placement-label" title\x3d"${nls.placement}"\x3e${nls.placement}\x3c/div\x3e\r\n\t\t\t\x3cdiv class\x3d"right-div" data-dojo-attach-point\x3d"placement"\x3e\r\n\t\t\t\t\x3cdiv class\x3d"placeDiv text-center left"\x3e${nls.left}\x3c/div\x3e\r\n\t\t\t\t\x3cdiv class\x3d"placeDiv text-center replace mergeBorder"\x3e${nls.replace}\x3c/div\x3e\r\n\t\t\t\x3cdiv class\x3d"placeDiv text-center right mergeBorder"\x3e${nls.right}\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\r\n\t\t\x3cdiv style\x3d"margin-top: 14px;display: flex;"\x3e\r\n\t\t\t\x3cdiv class\x3d"left-div label-div color-label" title\x3d"${nls.color}"\x3e${nls.color}\x3c/div\x3e\r\n\t\t\t\x3cdiv class\x3d"right-div"\x3e\r\n\t\t\t\t\x3cdiv class\x3d"colorPicker" data-dojo-attach-point\x3d"colorPicker"\x3e\x3c/div\x3e\r\n\t\t\t\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dijit/_WidgetBase dojo/Evented dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./IconChooserPanel.html jimu/dijit/ColorPickerPopup dojo/_base/Color dijit/TooltipDialog dijit/popup dojo/_base/html dojo/_base/lang dojo/on dojo/query dojo/dom-style".split(" "),function(m,n,p,q,r,u,v,t,w,k,c,d,f,g,x){var y=m([n,q,r,p],{baseClass:"infographic-setting-number-icon-chooser-panel",templateString:u,nls:null,icons:"icon-up-svg icon-down-svg icon-stop-svg icon-star-svg icon-danger-svg icon-alarm-svg icon-right-svg icon-wrong-svg icon-like-svg icon-unlike-svg".split(" "),
iconInfo:null,postCreate:function(){this.inherited(arguments);this.DEFAULT_ICON={color:"#49B4CB",icon:"icon-up",placement:"left"};this.iconInfo=d.mixin(this.DEFAULT_ICON,this.iconInfo);this._init();this.setConfig(this.iconInfo);this._hasLoaded=!0},_init:function(){this._initIcons();this._initColorPicker();this._initEvent()},_initIcons:function(){this.icons.forEach(d.hitch(this,function(a,b){var e=c.toDom('\x3cdiv class\x3d"iconDiv '+a+'"\x3e\x3c/div\x3e');e.icon=a.replace("-svg","");5>b?c.place(e,
this.iconStyle1,"last"):c.place(e,this.iconStyle2,"last")}))},getIconColor:function(){if(this.iconInfo)return this.iconInfo.color},setIconColor:function(a){this.iconColorPicker.setColor(new t(a));this.iconColorPicker.picker.changeColor()},_onIconInfoChanged:function(){if(this._hasLoaded&&this.iconInfo){var a=d.clone(this.iconInfo);this.emit("change",a)}},_initColorPicker:function(){this.iconColorPicker=new v({appearance:{showTransparent:!1,showColorPalette:!0,showCoustom:!0,showCoustomRecord:!0}});
this.iconColorPicker.placeAt(this.colorPicker);this.iconColorPicker.startup();this.own(f(this.iconColorPicker,"change",d.hitch(this,function(a){this.iconInfo.color=a.toHex();this._onIconInfoChanged()})))},_handleStyleClick:function(a){a.stopPropagation();a=a.srcElement||a.target;if(a.icon)var b=a;else a.parentElement.icon&&(b=a.parentElement);b&&this._onIconSelected(b)},_initEvent:function(){this.own(f(this.iconStyle1,"click",d.hitch(this,this._handleStyleClick)));this.own(f(this.iconStyle2,"click",
d.hitch(this,this._handleStyleClick)));this.own(f(this.placement,"click",d.hitch(this,function(a){a.stopPropagation();a=a.srcElement||a.target;c.hasClass(a,"placeDiv")&&this._onPlacementSelected(a)})))},setConfig:function(a){a&&(this.iconInfo=a,this.iconInfo.color&&this.iconColorPicker.setColor(new t(this.iconInfo.color)),this.iconInfo.icon&&(a=g(".styleDiv ."+this.iconInfo.icon+"-svg")[0])&&this._onIconSelected(a),this.iconInfo.placement&&(a=g(".placement ."+this.iconInfo.placement)[0])&&this._onPlacementSelected(a))},
getConfig:function(){if(this.iconInfo&&this.iconInfo.icon&&this.iconInfo.placement)return this.iconInfo},_onIconSelected:function(a){g(".styleDiv .iconDiv").removeClass("iconSelected");c.addClass(a,"iconSelected");this.iconInfo.icon=a.icon;this._onIconInfoChanged()},_onPlacementSelected:function(a){var b;c.hasClass(a,"left")?b="left":c.hasClass(a,"replace")?b="replace":c.hasClass(a,"right")&&(b="right");g(".placement .placeDiv").removeClass("placeSelected");c.addClass(a,"placeSelected");this.iconInfo.placement=
b;this._onIconInfoChanged()}});return m([n,q,r,p],{baseClass:"infographic-setting-number-icon-chooser-popup",templateString:'\x3cdiv\x3e\x3cdiv class\x3d"icon" data-dojo-attach-point\x3d"iconPreview"\x3e\x3c/div\x3e\x3cdiv class\x3d"border-merge drop-down-arrow"\x3e\x3c/div\x3e\x3c/div\x3e',_isTooltipDialogOpened:!1,folderUrl:"",postCreate:function(){this.inherited(arguments);this.DEFAULT_ICON={color:"#49B4CB",icon:"icon-up",placement:"left"};this.config=d.mixin(this.DEFAULT_ICON,this.config);this._createTooltipDialog();
this.setConfig(this.config)},setConfig:function(a){if(this.config=a)this.iconChooser.setConfig(this.config),this._previewIcon(this.config)},getConfig:function(){return this.config=this.iconChooser.getConfig()},getIconColor:function(){return this.iconChooser.getIconColor()},setIconColor:function(a){this.iconChooser.setIconColor(a)},_setIconChooserUI:function(){this.getConfig();this.config&&this.iconChooser.setConfig(this.config)},_previewIcon:function(a){c.removeClass(this.iconPreview);c.addClass(this.iconPreview,
["iconPreview","indicator-icon",a.icon]);x.set(this.iconPreview,"color",a.color);this._onUpdate()},_onUpdate:function(){this.emit("change",this.getConfig())},_createTooltipDialog:function(){var a=c.create("div");this.tooltipDialog=new w({content:a});c.addClass(this.tooltipDialog.domNode,"infographic-setting-number-icon-chooser-popup-dialog");this.iconChooser=new y({nls:this.nls,iconInfo:this.config});this.iconChooser.placeAt(a);this.iconChooser.startup();this.own(f(this.domNode,"click",d.hitch(this,
function(b){b.stopPropagation();b.preventDefault();this._isTooltipDialogOpened?this._hideTooltipDialog():this._showTooltipDialog()})));this.own(f(document,"click",d.hitch(this,function(b){this._isPartOfPopup(b.srcElement||b.target)||this._hideTooltipDialog()})));this._initIconChooserEvent()},_initIconChooserEvent:function(){this.own(f(this.iconChooser,"change",d.hitch(this,function(a){this._previewIcon(a)})))},hideTooltipDialog:function(){this._hideTooltipDialog()},_showTooltipDialog:function(){k.open({parent:this.getParent(),
popup:this.tooltipDialog,around:this.domNode});this._isTooltipDialogOpened=!0;this._setIconChooserUI()},_hideTooltipDialog:function(){k.close(this.tooltipDialog);this._isTooltipDialogOpened=!1},destroy:function(){this.iconChooser&&(this.iconChooser.destroy(),this.iconChooser=null);this.tooltipDialog&&(this.tooltipDialog.destroy(),this.tooltipDialog=null);this.inherited(arguments)},_isPartOfPopup:function(a){var b=this.tooltipDialog.domNode;b=a===b||c.isDescendant(a,b);if(this.iconChooser&&this.iconChooser.iconColorPicker){var e=
this.iconChooser.iconColorPicker.getTooltipDialog().domNode;e=a===e||c.isDescendant(a,e)}var l=k.getTopPopup();if(l&&l.wrapper){var h=l.wrapper;h=a===h||c.isDescendant(a,h)}return b||e||h}})});