// 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/Swipe/MultSelector/MultSelector.html":'\x3cdiv class\x3d"mult-selector"\x3e\r\n\t\x3cselect data-dojo-type\x3d"dojox/form/CheckedMultiSelect" multiple\x3d"true" dropDown\x3d"true"\r\n\t\tdata-dojo-attach-point\x3d"selector"\x3e\x3c/select\x3e\r\n\x3c/div\x3e'}});
define("dojo/Evented dojo/_base/declare dojo/_base/lang dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/on jimu/utils dojo/_base/html ./a11y/MultSelector dojo/text!./MultSelector.html jimu/dijit/CheckBox dijit/form/Select dojox/form/CheckedMultiSelect dijit/form/ValidationTextBox xstyle/css!dojox/form/resources/CheckedMultiSelect.css".split(" "),function(h,l,m,n,p,q,r,t,f,u,v){h=l([n,p,q,h],{templateString:v,_LAST_VALUEL:"",postCreate:function(){this.inherited(arguments)},
startup:function(){this.inherited(arguments);this.a11y_initEvents();this.own(r(this.selector,"change",m.hitch(this,function(a){this._updateMultSelectorLabel(this._getOptionsLabelsByValues(a));this._LAST_VALUEL&&(this.selector.dropDownButton.toggleDropDown(),this.selector.dropDownButton.toggleDropDown());this._LAST_VALUEL.toString()!==a.toString()&&(this.selector.dropDownButton.dropDown.lastFocusedChild&&this.selector.dropDownButton.dropDown.lastFocusedChild.domNode&&this.selector.dropDownButton.dropDown.lastFocusedChild.domNode.focus(),
this.emit("change",a),this._LAST_VALUEL=a)})))},initOptions:function(a,b){this.disable();this._initMultSelectorLabel();var c=null;b&&(c=this.selector.getOptions());this.selector.removeOption(this.selector.getOptions());for(var d=[],e=0,k=a.length;e<k;e++){var g=a[e];this.selector.addOption(g);this._hasOptionMultSelected(g,b?c:a)&&d.push(g.value)}this.selector.set("value",d);this._updateMultSelectorLabel(this._getOptionsLabelsByValues(d));this.enable()},setOptions:function(a){this.selector.set("options",
a)},getOptions:function(){return this.selector.get("options")},reset:function(){this.selector.set("options",[{value:"",label:""}]);this.selector.reset()},setValue:function(a){this.setConfig(a)},setConfig:function(a){this._setMultSelectorEmpty();this.selector.set("value",a)},getConfig:function(){return this.selector.getValue()},disable:function(){this.selector.set("disabled",!0);this._DISABLED=!0},enable:function(){this.selector.set("disabled",!1);this._DISABLED=!1},_initMultSelectorLabel:function(){this.selector.labelDiv&&
(f.empty(this.selector.labelDiv),f.destroy(this.selector.labelDiv),this.selector.labelDiv=null);this.a11y_initSelectorLabel();this.selector.labelDiv=f.create("div",{"class":"dijitReset dijitInline dijitButtonText multselector-label-container",tabindex:"-1"},this.selector.dropDownButton._buttonNode,"first");f.addClass(this.selector.labelDiv,"label-max-height");f.addClass(this.selector.dropDownMenu.domNode,"mult-selector-dropdown-max-height");this._updateMultSelectorLabel([this.nls.defaultLayerHolder])},
_setMultSelectorEmpty:function(){this.selector.set("value",[]);this._updateMultSelectorLabel([this.nls.defaultLayerHolder])},_updateMultSelectorLabel:function(a){f.empty(this.selector.labelDiv);a&&0!==a.length||this._setMultSelectorEmpty();for(var b=0,c=a.length;b<c;b++)f.create("div",{"class":"dijitReset dijitButtonText multselector-label",innerHTML:t.sanitizeHTML(a[b])},this.selector.labelDiv)},_getOptionsLabelsByValues:function(a){for(var b=this.getOptions(),c=[],d=0,e=b.length;d<e;d++)for(var k=
b[d],g=0,w=a.length;g<w;g++)k.value===a[g]&&c.push(k.label);return c},_hasOptionMultSelected:function(a,b){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(e.value===a.value&&!0===e.selected)return!0}return!1}});h.extend(u);return h});