var Gw=I.ea(Ew,"AdfDhtmlSelectManyChoicePeer");m("AdfDhtmlSelectManyChoicePeer",Gw);
Gw.C=function(){I.hc(this,AdfUIEditableValue.SUBMITTED_VALUE,AdfUISelectMany.rt,AdfRichSelectManyChoice.LABEL);I.sb(this,AdfRichSelectManyChoice.LABEL);I.ra(this,D.wb,D.Bd,D.Rg,D.Bc,D.gh);q.b.S()==q.ia&&I.ra(this,D.Oc,D.Nd);this.nA="drop";this.Mf="pop";this.LE="popWrap";this.xga="sp";this.y1a="lazy";this.$c="_afrSelectManyPopupPanel";this.aj="_afrItemValue";this.C7a="_adfTrueVal";this.Iw="p_AFHighlighted";this.Mj="p_AFSelected";this.g0a="fetchWrap";this.f0a="fetchPop";this.h0a="fetchSp";this.Gw="_afrSelectManyFetchingPopupPanel";
this.ifa="contentLoaded";this.mCa="noContent";this.jfa="fetching"};m("AdfDhtmlSelectManyChoicePeer.InitSubclass",Gw.C);Gw.prototype.jq=function(){return!0};r.a("AdfDhtmlSelectManyChoicePeer.prototype.needsFocusTargetStyleClass",{jq:Gw.prototype.jq});
Gw.prototype.Fa=function(a){var b=a.getSource(),d=this.i();a=a.X();var d=O.da(b,d),e=a==Hw(b),f=Hw(b);d.disabled||!e&&a!=d||(f.parentNode.parentNode.setAttribute("aria-expanded","true"),this.Za(b,Gw.Gw)?this.Jb(b,Gw.Gw):this.Za(b,Gw.$c)?(this.Jb(b,Gw.$c),f.parentNode.parentNode.setAttribute("aria-expanded","false"),this.Vm(b)):(a=this.eB(),a==Gw.mCa?(this.BX(Gw.jfa),(new eh(b,eh.rk)).F(),this.Moa(b)):a!=Gw.jfa&&this.MB(b)))};r.a("AdfDhtmlSelectManyChoicePeer.prototype.HandleComponentMouseDown",{Fa:Gw.prototype.Fa});
Gw.prototype.Ac=function(a){var b=a.getSource(),d=this.i();a=a.X();d=O.da(b,d);a=a==Hw(b);!d.disabled&&a&&(this.Za(b,Gw.$c)||a&&d.focus())};r.a("AdfDhtmlSelectManyChoicePeer.prototype.HandleComponentMouseUp",{Ac:Gw.prototype.Ac});Gw.prototype.Ta=function(a){Gw.h.Ta.call(this,a);a=a.getSource();var b=this.i();a=O.da(a,b);C.w(a,Gw.Mj)};r.a("AdfDhtmlSelectManyChoicePeer.prototype.HandleComponentFocus",{Ta:Gw.prototype.Ta});
Gw.prototype.Lb=function(a){a=a.getSource();var b=this.i();a=O.da(a,b);C.O(a,Gw.Mj)};r.a("AdfDhtmlSelectManyChoicePeer.prototype.HandleComponentBlur",{Lb:Gw.prototype.Lb});
Gw.prototype.M=function(a){Gw.h.M.call(this,a);var b=this.f(),d=this.i(),e=O.da(b,d);if(!e.disabled){var f=a.X();if("INPUT"!=q.b.Na(f))if((f=C.pa(f))&&(f=C.pa(f)),f&&"INPUT"==q.b.Na(f)&&"checkbox"==f.type)f.disabled||(f.focus(),f.click());else return;if("checkbox"==f.type){var g=f.getAttribute("id"),h=Iw(this,b,d);f!=h&&(Jw(f,h),g||a.U().shiftKey&&this.kK(b,d,f,h));g&&(d=this.i(),this.uK(b,d,f.checked));a=this.Wa(b,f);this.Ba(b,e,a)}}};
r.a("AdfDhtmlSelectManyChoicePeer.prototype.HandleComponentClick",{M:Gw.prototype.M});Gw.prototype.Yb=function(a){this.Il(a)};r.a("AdfDhtmlSelectManyChoicePeer.prototype.HandleComponentKeyPress",{Yb:Gw.prototype.Yb});
Gw.prototype.ma=function(a){this.Il(a);var b=a.X();if("INPUT"==b.tagName){var d=a.U(),e=q.b.na(d),f=a.getSource();if(e==w.Ih)this.Za(f,Gw.$c)?this.Jb(f,Gw.$c):this.Za(f,Gw.Gw)&&this.Jb(f,Gw.Gw);else if("text"==b.type)(e==w.Ra||e==w.Ra&&d.altKey)&&this.Fa(a);else if("checkbox"==b.type)switch(b=this.i(),e){case w.jb:if(a=Iw(this,f,b))d=this.Wa(f,a),this.Ba(f,O.da(f,b),d);this.Jb(f,Gw.Gw);this.Jb(f,Gw.$c);break;case w.tf:this.Jb(f,Gw.Gw);this.Jb(f,Gw.$c);this.Vm(f);f=O.da(f,b);d.shiftKey?J.ni(f):J.be(f);
a.cancel();break;case w.GQ:d.ctrlKey&&(this.uK(f,b,!0),d=this.Wa(f,b),this.Ba(f,O.da(f,b),d),a.cancel());break;case w.ab:case w.Ra:var g=Iw(this,f,b);(e=e==w.ab?this.FD(f,b,g,d.shiftKey):this.Go(f,b,g))&&e!=g&&(Jw(e,g),d.shiftKey&&(g.checked=!0,e.checked=!0,d=this.Wa(f,e),this.Ba(f,O.da(f,b),d)),e.focus());a.cancel();break;case w.Yi:case w.Eo:d.shiftKey&&(a=Iw(this,f,b),e=e==w.Yi?this.Go(f,b,null):this.FD(f,b,null,!0),this.kK(f,b,a,e),d=this.Wa(f,e),this.Ba(f,O.da(f,b),d),Jw(e,a),e.focus())}}};
r.a("AdfDhtmlSelectManyChoicePeer.prototype.HandleComponentKeyDown",{ma:Gw.prototype.ma});Gw.prototype.Zb=function(a,b){Gw.h.Zb.call(this,a,b);if(this.eB()==Gw.jfa){var d=this.f(),e=O.da(d,a);if(e=this.kd(d,e)){for(var f=0;f<e.length;f++)this.xi(e[f]);e=this.Iq(d);null!=e&&this.xi(e)}this.BX(Gw.ifa);this.Jb(d,Gw.Gw);this.MB(d)}};r.a("AdfDhtmlSelectManyChoicePeer.prototype.ReplaceDomElement",{Zb:Gw.prototype.Zb});Gw.prototype.ct=function(a){a=I.j(a.g(),Gw.Mf);return q.b.getElementById(a)};
r.a("AdfDhtmlSelectManyChoicePeer.prototype.GetSelectItemsParentDomElement",{ct:Gw.prototype.ct});
Gw.prototype.Ba=function(a,b,d){u.u(b);u.Mb(d);var e=this.kd(a,b);if(e){for(var f=!0,g=null,h=0,l=0;l<e.length;l++){var n=e[l],t=E.indexOf(d,n.value);n.checked=0<=t;this.xi(n);n.checked?(n=n.getAttribute(Gw.C7a),h++,g=null==g?n:g+("; "+n)):n.disabled||(f=!1)}d=this.Iq(a);null!=d&&(d.checked!=f&&(d.checked=f),this.xi(d));f&&1<h&&(g=A.c.H().Z("af_selectManyChoice.LABEL_TIP_SELECT_ALL"));a=O.da(a,b);null===g&&(g="");a.value=g;a.title=g}};r.a("AdfDhtmlSelectManyChoicePeer.prototype.SetDisplayValue",{Ba:Gw.prototype.Ba});
Gw.prototype.Wa=function(a,b){if(this.eB()!=Gw.ifa){u.u(b);var d=A.c.H().Z("af_selectManyChoice.LABEL_TIP_SELECT_ALL");if(O.da(a,b).value==d)return null}return Gw.h.Wa(a,b)};r.a("AdfDhtmlSelectManyChoicePeer.prototype.GetSubmittedValue",{Wa:Gw.prototype.Wa});Gw.prototype.ob=function(a,b,d){d==Gw.$c?(d=I.j(a.g(),Gw.LE),d=q.b.getElementById(d),d.appendChild(b),b=this.i(),b=this.Wa(a,b),this.cc(a,b)):d==Gw.Gw&&(d=I.j(a.g(),Gw.g0a),d=q.b.getElementById(d),d.appendChild(b))};
r.a("AdfDhtmlSelectManyChoicePeer.prototype.PopupClosed",{ob:Gw.prototype.ob});Gw.prototype.Xd=function(a,b){var d=O.da(a,b);return A.c.Ka().La()&&q.b.S()==q.ia?d:d.parentNode};r.a("AdfDhtmlSelectManyChoicePeer.prototype.GetNoteWindowAlignmentNode",{Xd:Gw.prototype.Xd});Gw.prototype.Oa=function(){return gi.jd()};r.a("AdfDhtmlSelectManyChoicePeer.prototype.GetInlineEditor",{Oa:Gw.prototype.Oa});
Gw.prototype.G=function(a,b){Gw.h.G.call(this,a,b);var d=O.da(a,b);if(d=this.kd(a,d)){for(var e=0;e<d.length;e++)this.xi(d[e]);d=this.Iq(a);null!=d&&this.xi(d)}};r.a("AdfDhtmlSelectManyChoicePeer.prototype.InitDomElement",{G:Gw.prototype.G});k=Gw.prototype;
k.MB=function(a){r.bb(AdfRichPopup);var b=a.g(),d=this.i();Kw(a,b,d,Gw.xga);var e=Iw(this,a,d),f=this.Iq(a);e!=f&&e&&C.sa(e.parentNode.parentNode,Gw.Iw)&&C.O(e.parentNode.parentNode,Gw.Iw);(e=f?f:Iw(this,a,d))&&!C.sa(e.parentNode.parentNode,Gw.Iw)&&C.w(e.parentNode.parentNode,Gw.Iw);b=I.j(b,Gw.Mf);b=q.b.getElementById(b);b.parentNode.removeChild(b);this.He(a,b,this.Y4(a,!0),Gw.$c)};
k.Moa=function(a){r.bb(AdfRichPopup);var b=a.g(),d=this.i();Kw(a,b,d,Gw.h0a);b=I.j(b,Gw.f0a);b=q.b.getElementById(b);b.parentNode.removeChild(b);this.He(a,b,this.Y4(a,!1),Gw.Gw)};function Kw(a,b,d,e){b=I.j(b,e);b=q.b.getElementById(b);a=O.da(a,d);b.style.width=a.parentNode.offsetWidth-7+"px"}k.Y4=function(a,b){var d={type:"menu"};d[AdfRichPopup.Ed]=AdfRichPopup.qf;d[AdfRichPopup.Jf]=O.zD(a);d.autodismiss="autodismissMenu";d.focus=b;return d};
function Hw(a){a=I.j(a.g(),Gw.nA);return q.b.getElementById(a)}function Iw(a,b,d){var e=a.Iq(b);a=a.kd(b,d);b=null;if(a)for(d=0;d<a.length;d++)if(cb=a[d],b||cb.disabled||(b=cb),C.sa(cb.parentNode.parentNode,Gw.Iw)){e=cb;break}null==e&&(e=b);return e}
function Jw(a,b){b&&C.sa(b.parentNode.parentNode,Gw.Iw)&&(C.O(b.parentNode.parentNode,Gw.Iw),b.parentNode.parentNode.removeAttribute("aria-selected"));a&&!C.sa(a.parentNode.parentNode,Gw.Iw)&&(C.w(a.parentNode.parentNode,Gw.Iw),a.parentNode.parentNode.setAttribute("aria-selected","true"))}k.eB=function(){var a=this.f();if(null==a.Ax){var b=I.j(a.g(),Gw.y1a),b=q.b.getElementById(b);a.Ax=null!=b?Gw.mCa:Gw.ifa}return a.Ax};k.BX=function(a){this.f().Ax=a};