// 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
define("require dojo dijit dojo/_base/declare dijit/_editor/_Plugin dijit/form/DropDownButton".split(" "),function(h,e,k,l,m,n){e.experimental("dijit.editor.plugins.EditorBackgroundColor");var g=l("dijit.editor.plugins.EditorBackgroundColor",m,{buttonClass:n,colorPicker:"jimu/dijit/ColorPalette",useDefaultCommand:!1,_initButton:function(){this.command="editorBackgroundColor";this.hackCommand="hiliteColor";this.inherited(arguments);var b="";this.params.custom&&this.params.custom.recordUID&&(b=this.params.custom.recordUID);
var a=this;this.button.set("iconClass",this.iconClassPrefix+" "+this.iconClassPrefix+"HiliteColor");this.button.set("title",this.getLabel(this.hackCommand));this.button.loadDropDown=function(d){function c(f){a.button.dropDown=new f({dir:a.editor.dir,ownerDocument:a.editor.ownerDocument,value:a.value,appearance:{showTransparent:!0,showColorPalette:!0,showCoustom:!0,showColorPickerOK:!0,showColorPickerApply:!1,showCoustomRecord:!0},recordUID:b,onChange:function(p){a.editor.execCommand("useCSS",!1);
a.editor.execCommand("styleWithCSS",!0);a.editor.execCommand(a.hackCommand,p)},onExecute:function(){a.editor.execCommand(a.hackCommand,this.get("value"))},onClose:function(){a.button.closeDropDown()}});d()}"string"===typeof a.colorPicker?h([a.colorPicker],c):c(a.colorPicker)}},updateState:function(){var b=this.editor,a=this.hackCommand;if(b&&b.isLoaded&&a.length){if(this.button){var d=this.get("disabled");this.button.set("disabled",d);if(d)return;try{var c=b.queryCommandValue(a)||""}catch(f){c=""}}""===
c?c="#000000":"transparent"===c&&(c="rgba(0, 0, 0, 0)");this.value=c;(b=this.button.dropDown)&&b.getColor&&c!==b.getColor()&&(b.refreshRecords(),b.setColor(c))}}});e.subscribe(k._scopeName+".Editor.getPlugin",null,function(b){if(!b.plugin)switch(b.args.name){case "editorBackgroundColor":b.plugin=new g}});return g});