AdfRichUIPeer.createPeerClass(AdfDhtmlEditableValuePeer,"AdfDhtmlInputNumberSliderBasePeer",!1);
AdfDhtmlInputNumberSliderBasePeer.InitSubclass=function(){AdfObject.ensureClassInitialization(AdfRichInputNumberSlider);AdfRichUIPeer.addComponentPropertyGetters(this,AdfUIEditableValue.SUBMITTED_VALUE,AdfRichInputNumberSlider.LABEL);AdfRichUIPeer.addComponentPropertyChanges(this,AdfRichInputNumberSlider.LABEL);AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfUIInputEvent.CLICK_EVENT_TYPE);this._BAR_ELEMENT_ID_ATTR_NAME="_barElementId";this._DECREASE_BUTCON_ID_ATTR_NAME=
"_decreaseButconID";this._INCREASE_BUTCON_ID_ATTR_NAME="_increaseButconID";this._THUMB_VALUE_ID_ATTR_NAME="_thumbValue";this._THUMB_ELEMENT_ID_ATTR_NAME="_thumbElement";this._THUMB_VALUE_LINE_ID_ATTR_NAME="_thumbValueLine";this._SLIDER_TICKS_CONTAINER_ID_ATTR_NAME="_sliderTicksContainer";this._DRAG_ELEMENT_ID_ATTR_NAME="_dragElement";this._THUMB_VALUE2_ID_ATTR_NAME="_thumbValue2";this._THUMB_ELEMENT2_ID_ATTR_NAME="_thumbElement2";this._THUMB_VALUE2_LINE_ID_ATTR_NAME="_thumbValueLine2";this._RANGE_ID_ATTR_NAME=
"_range";this._CURRENT_POSITION=this._OLD_VALUE=null;this._DRAG_RECOGNIZER=new AdfInputNumberSliderDragRecognizer;this._DEPRESSED_STYLE_CLASS="p_AFDepressed";this._PLAYING_STYLE_CLASS="p_AFPlaying"};AdfDhtmlInputNumberSliderBasePeer.prototype.needsResizeNotify=function(a){return!0};AdfDhtmlInputNumberSliderBasePeer.prototype.ResizeNotify=function(a,b,d,e){a=this.getDomElement();b=this.getComponent();this._initBarElement(b,a)};AdfDhtmlInputNumberSliderBasePeer.prototype.init=function(){};
AdfDhtmlInputNumberSliderBasePeer.prototype.getValue=function(){var a=this.getComponent(),b=a.getValue();null==b&&(b=a.getProperty(AdfUIValue.VALUE));var d=this.isRanged();!b&&d&&(b=new AdfRangeValue(a.getMinimum(),a.getMaximum()));return b};AdfDhtmlInputNumberSliderBasePeer.prototype.isRanged=function(){return!1};
AdfDhtmlInputNumberSliderBasePeer.prototype.InitDomElement=function(a,b){AdfDhtmlInputNumberSliderBasePeer.superclass.InitDomElement.call(this,a,b);var d=a.getClientId(),e=AdfRichUIPeer.CreateSubId(d,"bar"),d=AdfAgent.AGENT;null!=d.getElementById(e)&&(b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._BAR_ELEMENT_ID_ATTR_NAME,e),this._initBarElement(a,b));d.disableUserSelect(b);e=this._addDepressedCallback;e||(e=this._addDepressedCallback=this.createCallback(this._addDepressed));var f=this._removeDepressedCallback;
f||(f=this._removeDepressedCallback=this.createCallback(this._removeDepressed));var g=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._INCREASE_BUTCON_ID_ATTR_NAME,b),h=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._DECREASE_BUTCON_ID_ATTR_NAME,b);g&&(d.addBubbleEventListener(g,"mousedown",e),d.addBubbleEventListener(g,"mouseup",f),d.addBubbleEventListener(g,"mouseout",f));h&&(d.addBubbleEventListener(h,"mousedown",e),d.addBubbleEventListener(h,"mouseup",f),d.addBubbleEventListener(h,
"mouseout",f))};
AdfDhtmlInputNumberSliderBasePeer.prototype.ComponentRemoved=function(a){a=AdfAgent.AGENT;var b=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._INCREASE_BUTCON_ID_ATTR_NAME),d=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._DECREASE_BUTCON_ID_ATTR_NAME),e=this._addDepressedCallback,f=this._removeDepressedCallback;e&&(b&&a.removeBubbleEventListener(b,"mousedown",e),d&&a.removeBubbleEventListener(d,"mousedown",e));f&&(b&&(a.removeBubbleEventListener(b,"mouseup",
f),a.removeBubbleEventListener(b,"mouseout",f)),d&&(a.removeBubbleEventListener(d,"mouseup",f),a.removeBubbleEventListener(d,"mouseout",f)));if(a=this._animationTimer)AdfPage.PAGE.cancelTimer(a),delete this._animationTimer};
AdfDhtmlInputNumberSliderBasePeer.prototype.HandleComponentKeyDown=function(a){var b=a.getKeyCode(),d=a.getCurrentTarget(),e=a.getNativeEvent(),e=AdfAgent.AGENT.getEventTarget(e),f=this.getValue(),g,h=d.getMinimumIncrement(),k=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT_ID_ATTR_NAME);0>=h&&(h=d.getMinorIncrement(),0>=h&&(h=d.getMajorIncrement()));AdfPage.PAGE.getLocaleContext().isRightToLeft()&&"vertical"!=d.getOrientation()&&b!=AdfKeyStroke.ENTER_KEY&&(h*=-1);
this.isRanged()?(g=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT2_ID_ATTR_NAME),b==AdfKeyStroke.END_KEY&&null!=d.getMaximum()?e==k?(e=new AdfRangeValue(f.getMaximum(),d.getMaximum()),this._setComponentValue(e,d)):e==g&&(e=new AdfRangeValue(d.getMaximum(),f.getMinimum()),this._setComponentValue(e,d)):b==AdfKeyStroke.HOME_KEY&&null!=d.getMinimum()?e==k?(e=new AdfRangeValue(d.getMinimum(),f.getMaximum()),this._setComponentValue(e,d)):e==g&&(e=new AdfRangeValue(d.getMinimum(),
f.getMinimum()),this._setComponentValue(e,d)):b!=AdfKeyStroke.ARROWLEFT_KEY&&b!=AdfKeyStroke.ARROWDOWN_KEY||e!=k?b!=AdfKeyStroke.ARROWLEFT_KEY&&b!=AdfKeyStroke.ARROWDOWN_KEY||e!=g?b!=AdfKeyStroke.ARROWRIGHT_KEY&&b!=AdfKeyStroke.ARROWUP_KEY||e!=k?b!=AdfKeyStroke.ARROWRIGHT_KEY&&b!=AdfKeyStroke.ARROWUP_KEY||e!=g?b==AdfKeyStroke.ENTER_KEY&&e==this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._INCREASE_BUTCON_ID_ATTR_NAME)?this._deltaComponentValue(h):b==AdfKeyStroke.ENTER_KEY&&e==this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._DECREASE_BUTCON_ID_ATTR_NAME)&&
this._deltaComponentValue(-h):(e=new AdfRangeValue(f.getMinimum(),f.getMaximum()+h),this._setComponentValue(e,d)):(e=new AdfRangeValue(f.getMinimum()+h,f.getMaximum()),this._setComponentValue(e,d)):(e=new AdfRangeValue(f.getMinimum(),f.getMaximum()-h),this._setComponentValue(e,d)):(e=new AdfRangeValue(f.getMinimum()-h,f.getMaximum()),this._setComponentValue(e,d))):b==AdfKeyStroke.END_KEY&&null!=d.getMaximum()?this._setComponentValue(d.getMaximum(),d):b==AdfKeyStroke.HOME_KEY&&null!=d.getMinimum()?
this._setComponentValue(d.getMinimum(),d):b!=AdfKeyStroke.ARROWLEFT_KEY&&b!=AdfKeyStroke.ARROWDOWN_KEY||e!=k?b!=AdfKeyStroke.ARROWRIGHT_KEY&&b!=AdfKeyStroke.ARROWUP_KEY||e!=k?b==AdfKeyStroke.ENTER_KEY&&e==this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._INCREASE_BUTCON_ID_ATTR_NAME)?this._deltaComponentValue(h):b==AdfKeyStroke.ENTER_KEY&&e==this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._DECREASE_BUTCON_ID_ATTR_NAME)&&this._deltaComponentValue(-h):this._deltaComponentValue(h):
this._deltaComponentValue(-h);this._skipDomEventForUpAndDown(b,a)};
AdfDhtmlInputNumberSliderBasePeer.prototype.SetDisplayValue=function(a,b,d){if(this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._BAR_ELEMENT_ID_ATTR_NAME,b)){var e=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT_ID_ATTR_NAME,b),f;this.isRanged()&&(f=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT2_ID_ATTR_NAME,b));var g=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_VALUE_ID_ATTR_NAME,b),h=
"vertical"==a.getOrientation(),k=this.isRanged(),l=.5*e[h?"offsetHeight":"offsetWidth"],m=a.getConverter();labelTextElement=this.isRanged()?AdfDhtmlInputNumberSliderBasePeer._getLabelTextElement(b,this.GetInputRangeSliderLabelStyleClass()):AdfDhtmlInputNumberSliderBasePeer._getLabelTextElement(b,this.GetInputNumberSliderLabelStyleClass());null!=labelTextElement&&(f?labelTextElement.setAttribute("id",f.id+"labelId"):labelTextElement.setAttribute("id",e.id+"labelId"),labelledById=labelTextElement.id,
e.setAttribute("aria-labelledby",labelledById));m instanceof AdfMissingConverter&&(m=null);var n,q,r;q=a.getMaximum();var t=a.getMinimum(),u=AdfAgent.AGENT.getPlatform()==AdfAgent.WEBKIT_PLATFORM;u&&(e.style["outline-width"]="0px");if(k)n=d.getMaximum(),n>q&&(n=q),q=d.getMinimum(),q<t&&(q=t),m?(d=m.getAsString(q,null),r=m.getAsString(n,null)):(d=q,r=n),this.UpdateDisabledButtonStyles(q,n,a,b);else{if(""==d)d=m?m.getAsString(a.getMinimum(),null):a.getMinimum()+"";else{var v;v=m?m.getAsObject(d,null):
d;v=parseFloat(v.toString());var w=v<t;v>q&&(d=m?m.getAsString(q,null):q+"");w&&(d=m?m.getAsString(t,null):t+"")}q=d;m&&(q=m.getAsObject(q,null));this.UpdateDisabledButtonStyles(q,q,a,b)}t=this._value2offset(a,b,q)-l;v=AdfPage.PAGE.getLocaleContext().isRightToLeft();e.style[h?"bottom":v?"right":"left"]=t+"px";e.title=d;g.innerHTML=d;e.setAttribute("aria-valuenow",d.toString());k&&(e.setAttribute("aria-valuetext",AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_inputRangeSlider.TIP_START_RANGE")),
g=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_VALUE2_ID_ATTR_NAME,b),w=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._RANGE_ID_ATTR_NAME,b),null!=labelTextElement&&(labelTextElement.setAttribute("id",f.id+"labelId"),labelledById=labelTextElement.id,f.setAttribute("aria-labelledby",labelledById)),w.style[h?"bottom":v?"right":"left"]=t+l+"px",b=this._value2offset(a,b,n)-l,f.style[h?"bottom":v?"right":"left"]=b+"px",u&&(f.style["outline-width"]="0px"),
f.title=r,g.innerHTML=r,f.setAttribute("aria-valuenow",r.toString()),f.setAttribute("aria-valuetext",AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_inputRangeSlider.TIP_END_RANGE")),w.style[h?"height":"width"]=b-t+"px");a=AdfRichUIPeer.CreateSubId(a.getClientId(),"hiddendata");a=AdfAgent.AGENT.getElementsByName(a)[0];null!=a&&(a.value=k?n+","+q:m?d:q);u&&((k=this._redrawThumbTimerId)&&AdfPage.PAGE.cancelTimer(k),this._redrawThumbTimerId=AdfPage.PAGE.scheduleTimer(this,this._redrawThumbOutlines,
[e,f],50))}};AdfDhtmlInputNumberSliderBasePeer.prototype._redrawThumbOutlines=function(a){a[0].style["outline-width"]="";a[1]&&(a[1].style["outline-width"]="");delete this._redrawThumbTimerId};
AdfDhtmlInputNumberSliderBasePeer.prototype.GetSubmittedValue=function(a,b){AdfAssert.assertDomElement(b);if(a.getReadOnly())return AdfDhtmlEditableValuePeer.getContentNode(a,b).innerHTML;var d=AdfRichUIPeer.CreateSubId(a.getClientId(),"hiddendata"),e=AdfAgent.AGENT.getElementsByName(d)[0],d=null;e&&(d=e.value,this.isRanged()&&(e=e.value.split(","),2==e.length&&(d=new AdfRangeValue(1*e[0],1*e[1]))));return d};
AdfDhtmlInputNumberSliderBasePeer.prototype.HandleComponentClick=function(a){var b=this.getComponent();if(!a.isRightButtonPressed()&&!b.getDisabled()){var d=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._BAR_ELEMENT_ID_ATTR_NAME),e=a.getNativeEvent(),f=AdfAgent.AGENT,g=f.getEventTarget(e);"LABEL"==f.getNodeName(g)?this.focus(b):f.isEventInElement(e,d)&&(this.isRanged()&&f.isEventInElement(e,this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._RANGE_ID_ATTR_NAME))||
this._handleSingleClickPositioning(a))}};
AdfDhtmlInputNumberSliderBasePeer.prototype._handleComponentMouseDownOrTouchStart=function(a,b){var d=a.getNativeEvent(),e=this.getComponent(),f=AdfAgent.getAgent(),g=e.getMinimumIncrement(),h=AdfAgent.AGENT.getPlatform()==AdfAgent.WEBKIT_PLATFORM;0>=g&&(g=e.getMinorIncrement(),0>=g&&(g=e.getMajorIncrement()));if(1===a.getButtons()&&!e.getDisabled()){var k=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._BAR_ELEMENT_ID_ATTR_NAME),l=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT_ID_ATTR_NAME),l=
AdfAgent.AGENT.isEventInElement(d,l),m=this.getDomElement(),n=!1,q=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._INCREASE_BUTCON_ID_ATTR_NAME),r=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._DECREASE_BUTCON_ID_ATTR_NAME),t=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._PLAY_BUTCON_ID_ATTR_NAME);this.isRanged()&&(thumbElement2=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT2_ID_ATTR_NAME),n=AdfAgent.AGENT.isEventInElement(d,
thumbElement2));l||n?(l?m.setAttribute(AdfDhtmlInputNumberSliderBasePeer._DRAG_ELEMENT_ID_ATTR_NAME,m.getAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT_ID_ATTR_NAME)):m.setAttribute(AdfDhtmlInputNumberSliderBasePeer._DRAG_ELEMENT_ID_ATTR_NAME,m.getAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT2_ID_ATTR_NAME)),b&&AdfAgent.AGENT.eatEvent(a.getNativeEvent()),AdfPage.PAGE.startDrag(d,this.createCallback(this._handleDragPositioning),this.createCallback(this._finishDrag))):f.isEventInElement(d,
k)?this.isRanged()&&f.isEventInElement(d,this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._RANGE_ID_ATTR_NAME))?(AdfDhtmlInputNumberSliderBasePeer._CURRENT_POSITION=this._getValueFromMousePos(e,d),b&&AdfAgent.AGENT.eatEvent(a.getNativeEvent()),AdfPage.PAGE.startDrag(d,this.createCallback(this._handleDragRangePosition),this.createCallback(this._finishDrag)),m.setAttribute(AdfDhtmlInputNumberSliderBasePeer._DRAG_ELEMENT_ID_ATTR_NAME,"RANGE"),AdfDhtmlInputNumberSliderBasePeer._OLD_VALUE=
this.getValue()):b||a.cancel():f.isEventInElement(d,r)?(this._deltaComponentValue(-1*g),h&&r.focus()):f.isEventInElement(d,q)?(this._deltaComponentValue(g),h&&q.focus()):t&&f.isEventInElement(d,t)?AdfDomUtils.containsCSSClassName(t,AdfRichUIPeer.DISABLED_STYLECLASS)||(AdfDomUtils.containsCSSClassName(m,AdfDhtmlInputNumberSliderBasePeer._PLAYING_STYLE_CLASS)?this._stopAnimation(e,m):this._startAnimation(e,m,g)):b||a.cancel()}};
AdfDhtmlInputNumberSliderBasePeer.prototype.LazyInitialize=function(a,b){AdfDhtmlInputNumberSliderBasePeer.superclass.LazyInitialize.call(this,a,b);this._createClientSideValidator(a,b)};AdfDhtmlInputNumberSliderBasePeer.prototype.GetInlineEditor=function(a){return AdfDhtmlSimpleLabelEditor.getInlineEditor()};AdfDhtmlInputNumberSliderBasePeer.prototype.getDefaultDragRecognizer=function(a){return AdfDhtmlInputNumberSliderBasePeer._DRAG_RECOGNIZER};
AdfDhtmlInputNumberSliderBasePeer.prototype._skipDomEventForUpAndDown=function(a,b){a!=AdfKeyStroke.ARROWDOWN_KEY&&a!=AdfKeyStroke.ARROWUP_KEY&&a!=AdfKeyStroke.HOME_KEY&&a!=AdfKeyStroke.END_KEY&&a!=AdfKeyStroke.ARROWLEFT_KEY&&a!=AdfKeyStroke.ARROWRIGHT_KEY||b.cancel()};
AdfDhtmlInputNumberSliderBasePeer.prototype._createClientSideValidator=function(a,b){AdfAssert.assertDomElement(b);var d=a.getMinimum(),e=a.getMaximum();void 0!==AdfPage.PAGE.getDomWindow().TrRangeValidator&&(d=new TrRangeValidator(e,d,null),a.addValidator(d))};AdfDhtmlInputNumberSliderBasePeer.prototype._handleSingleClickPositioning=function(a){if(!this.isRanged()){var b=a.getCurrentTarget();a=a.getNativeEvent();a=this._getValueFromMousePos(b,a);this._setComponentValue(a,b)}};
AdfDhtmlInputNumberSliderBasePeer.prototype._handleDragRangePosition=function(a,b,d){b=this.getComponent();a=this._getValueFromMousePos(b,a);d=b.getMinimum();var e=b.getMaximum(),f=AdfDhtmlInputNumberSliderBasePeer._OLD_VALUE.getMinimum(),g=AdfDhtmlInputNumberSliderBasePeer._OLD_VALUE.getMaximum(),h=a-AdfDhtmlInputNumberSliderBasePeer._CURRENT_POSITION;f+h<d&&(h=d-f);g+h>e&&(h=e-g);d=new AdfRangeValue(this._constrainValue(f+h,b),this._constrainValue(g+h,b));d.getMinimum()!=AdfDhtmlInputNumberSliderBasePeer._OLD_VALUE.getMinimum()&&
d.getMaximum()!=AdfDhtmlInputNumberSliderBasePeer._OLD_VALUE.getMaximum()&&(AdfDhtmlInputNumberSliderBasePeer._OLD_VALUE=d,this.SetDisplayValue(b,this.getDomElement(),d),AdfDhtmlInputNumberSliderBasePeer._CURRENT_POSITION=a)};
AdfDhtmlInputNumberSliderBasePeer.prototype._finishDrag=function(a,b,d){b=this.getComponent();d=this.isRanged();var e=this.getDomElement(),f=e.getAttribute(AdfDhtmlInputNumberSliderBasePeer._DRAG_ELEMENT_ID_ATTR_NAME);if(!b.getDisabled()&&"EMPTY"!=f){a=this._getValueFromMousePos(b,a);var g=this.getValue();"RANGE"==f?(a=new AdfRangeValue(this._constrainValue(AdfDhtmlInputNumberSliderBasePeer._OLD_VALUE.getMinimum(),b),this._constrainValue(AdfDhtmlInputNumberSliderBasePeer._OLD_VALUE.getMaximum(),b)),
AdfDhtmlInputNumberSliderBasePeer._OLD_VALUE=null,AdfDhtmlInputNumberSliderBasePeer._CURRENT_POSITION=null):d&&(a=e.getAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT_ID_ATTR_NAME)==f?new AdfRangeValue(a,g.getMaximum()):new AdfRangeValue(g.getMinimum(),a));e.setAttribute(AdfDhtmlInputNumberSliderBasePeer._DRAG_ELEMENT_ID_ATTR_NAME,"EMPTY");this._setComponentValue(a,b)}};
AdfDhtmlInputNumberSliderBasePeer.prototype._handleDragPositioning=function(a,b,d){b=this.getComponent();a=this._getValueFromMousePos(b,a);a=this._constrainValue(a,b);this.isRanged()?(d=this.getValue(),a=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._DRAG_ELEMENT_ID_ATTR_NAME)==this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT_ID_ATTR_NAME)?new AdfRangeValue(a,d.getMaximum()):new AdfRangeValue(d.getMinimum(),a)):(d=b.getConverter(),d instanceof AdfMissingConverter&&
(d=null),d&&(a=d.getAsString(a,null)));this.SetDisplayValue(b,this.getDomElement(),a)};AdfDhtmlInputNumberSliderBasePeer.prototype._getValueFromMousePos=function(a,b){var d="vertical"==a.getOrientation(),e=AdfAgent.getAgent(),f=e.getMousePosition(b),g=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._BAR_ELEMENT_ID_ATTR_NAME);d?(d=e.getElementTop(g)+g.offsetHeight,f=d-f.y):(d=e.getElementLeft(g),f=f.x-d);return this._offset2value(a,f)};
AdfDhtmlInputNumberSliderBasePeer.prototype._value2offset=function(a,b,d){var e="vertical"==a.getOrientation(),f=a.getMinimum();a=a.getMaximum();var g=0;b=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._BAR_ELEMENT_ID_ATTR_NAME,b);a>f&&(g=(d-f)/(a-f));return e?g*b.offsetHeight:g*b.offsetWidth};
AdfDhtmlInputNumberSliderBasePeer.prototype._offset2value=function(a,b){var d="vertical"==a.getOrientation(),e=a.getMinimum(),f=a.getMaximum(),g=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._BAR_ELEMENT_ID_ATTR_NAME),g=d?b/g.offsetHeight:b/g.offsetWidth;return AdfPage.PAGE.getLocaleContext().isRightToLeft()&&!d?f-g*(f-e):g*(f-e)+e};
AdfDhtmlInputNumberSliderBasePeer.prototype._deltaComponentValue=function(a){var b=this.getComponent(),d=this.getValue();a=this.isRanged()?new AdfRangeValue(d.getMinimum()+a,d.getMaximum()+a):a+1*d;this._setComponentValue(a,b)};
AdfDhtmlInputNumberSliderBasePeer.prototype._setComponentValue=function(a,b){if(!b.getDisabled())if(this.isRanged())a.getMinimum()>a.getMaximum()&&(a.getMinimum()==this.getValue().getMinimum()?a.setMaximum(a.getMinimum()):a.setMinimum(a.getMaximum())),this.Validate(b,this._constrainValue(a,b));else{var d=b.getConverter();d instanceof AdfMissingConverter&&(d=null);var e=this._constrainValue(a,b),d=d?d.getAsString(e,null):""+e;this.Validate(b,d)}};
AdfDhtmlInputNumberSliderBasePeer.prototype.UpdateDisabledButtonStyles=function(a,b,d,e){var f=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._INCREASE_BUTCON_ID_ATTR_NAME,e),g=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._DECREASE_BUTCON_ID_ATTR_NAME,e);b==d.getMinimum()?AdfDomUtils.addCSSClassName(g,AdfRichUIPeer.DISABLED_STYLECLASS):(AdfDomUtils.removeCSSClassName(g,AdfRichUIPeer.DISABLED_STYLECLASS),a==d.getMaximum()?AdfDomUtils.addCSSClassName(f,AdfRichUIPeer.DISABLED_STYLECLASS):
AdfDomUtils.removeCSSClassName(f,AdfRichUIPeer.DISABLED_STYLECLASS));(a=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._PLAY_BUTCON_ID_ATTR_NAME,e))&&(b==d.getMaximum()?AdfDomUtils.addCSSClassName(a,AdfRichUIPeer.DISABLED_STYLECLASS):AdfDomUtils.removeCSSClassName(a,AdfRichUIPeer.DISABLED_STYLECLASS))};
AdfDhtmlInputNumberSliderBasePeer.prototype._constrainValue=function(a,b){var d=b.getMinimum(),e=b.getMaximum();if(a<=d)return d;if(a>=e)return e;var f=b.getMinimumIncrement();0>=f&&(f=b.getMinorIncrement(),0>=f&&(f=b.getMajorIncrement()));a+=(0<a?.5:-.5)*f;a-=a%f;return a<d?d:a>e?e:a};AdfDhtmlInputNumberSliderBasePeer.prototype._getElementByRootAttribute=function(a,b){var d;d=void 0===b?this.getDomElement().getAttribute(a):b.getAttribute(a);return AdfAgent.AGENT.getElementById(d)};
AdfDhtmlInputNumberSliderBasePeer.prototype._fixPrecision=function(a){a=new Number(a);var b=""+a;-1==b.indexOf("e")&&-1!=b.indexOf(".")&&(a=a.toPrecision(13),a=parseFloat(""+a));return a};
AdfDhtmlInputNumberSliderBasePeer.prototype._initBarElement=function(a,b){var d="vertical"==a.getOrientation(),e=a.getClientId();if(this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._BAR_ELEMENT_ID_ATTR_NAME,b)){b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT_ID_ATTR_NAME,AdfRichUIPeer.CreateSubId(e,"thumb"));b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._DECREASE_BUTCON_ID_ATTR_NAME,AdfRichUIPeer.CreateSubId(e,"decrease"));b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._INCREASE_BUTCON_ID_ATTR_NAME,
AdfRichUIPeer.CreateSubId(e,"increase"));b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._PLAY_BUTCON_ID_ATTR_NAME,AdfRichUIPeer.CreateSubId(e,"play"));b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_VALUE_ID_ATTR_NAME,AdfRichUIPeer.CreateSubId(e,"thumbValue"));b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._DRAG_ELEMENT_ID_ATTR_NAME,"EMPTY");b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_VALUE_LINE_ID_ATTR_NAME,AdfRichUIPeer.CreateSubId(e,"thumbValueLine"));var f=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_VALUE_LINE_ID_ATTR_NAME,
b);if(this.isRanged()){b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._RANGE_ID_ATTR_NAME,AdfRichUIPeer.CreateSubId(e,"range"));b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT2_ID_ATTR_NAME,AdfRichUIPeer.CreateSubId(e,"thumb2"));b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_VALUE2_ID_ATTR_NAME,AdfRichUIPeer.CreateSubId(e,"thumbValue2"));b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_VALUE2_LINE_ID_ATTR_NAME,AdfRichUIPeer.CreateSubId(e,"thumbValueLine2"));var g=
this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_VALUE2_LINE_ID_ATTR_NAME,b)}b.setAttribute(AdfDhtmlInputNumberSliderBasePeer._SLIDER_TICKS_CONTAINER_ID_ATTR_NAME,AdfRichUIPeer.CreateSubId(e,"sliderTicks"));var h=this._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._SLIDER_TICKS_CONTAINER_ID_ATTR_NAME,b);this._sliderTickValues=[];for(var h=h.getElementsByTagName("div"),k=0;k<h.length;k++){var l=h[k];1==l.nodeType&&this._sliderTickValues.push(l)}if(d){d=f.offsetWidth-
2;for(index in this._sliderTickValues)h=this._sliderTickValues[index],h.offsetWidth>d&&(d=h.offsetWidth);d+=2;f.style.width=d+"px";this.isRanged()&&(g.style.width=d+"px")}var e=AdfRichUIPeer.CreateSubId(e,"hiddendata"),e=AdfAgent.getAgent().getElementsByName(e)[0],m;this.isRanged()?null!=e&&(m=e.value.split(","),2!=m.length?(m=(a.getMaximum()-a.getMinimum())/4,m=new AdfRangeValue(this._constrainValue(a.getMinimum()+m,a),this._constrainValue(a.getMaximum()-m,a))):m=new AdfRangeValue(1*m[0],1*m[1])):
m=e.value;this.SetDisplayValue(a,b,m)}};AdfDhtmlInputNumberSliderBasePeer.prototype._addDepressed=function(a){a=AdfAgent.AGENT.getEventTarget(a);AdfDomUtils.addCSSClassName(a,AdfDhtmlInputNumberSliderBasePeer._DEPRESSED_STYLE_CLASS)};AdfDhtmlInputNumberSliderBasePeer.prototype._removeDepressed=function(a){a=AdfAgent.AGENT.getEventTarget(a);AdfDomUtils.removeCSSClassName(a,AdfDhtmlInputNumberSliderBasePeer._DEPRESSED_STYLE_CLASS)};
AdfDhtmlInputNumberSliderBasePeer.prototype._startAnimation=function(a,b,d){AdfDomUtils.addCSSClassName(b,AdfDhtmlInputNumberSliderBasePeer._PLAYING_STYLE_CLASS);this._animationTimer=AdfPage.PAGE.scheduleTimer(this,this._animationHandler,d,a.getAnimationInterval())};AdfDhtmlInputNumberSliderBasePeer.prototype._stopAnimation=function(a,b){var d=this._animationTimer;AdfDomUtils.removeCSSClassName(b,AdfDhtmlInputNumberSliderBasePeer._PLAYING_STYLE_CLASS);d&&(AdfPage.PAGE.cancelTimer(d),delete this._animationTimer)};
AdfDhtmlInputNumberSliderBasePeer.prototype._animationHandler=function(a){delete this._animationTimer;var b=this.getComponent();if(b){var d=b.getMaximum(),e=this.getValue(),f=this.getDomElement();this.isRanged()&&(e=e.getMaximum());e<d?("EMPTY"==f.getAttribute(AdfDhtmlInputNumberSliderBasePeer._DRAG_ELEMENT_ID_ATTR_NAME)&&this._deltaComponentValue(a),this._animationTimer=AdfPage.PAGE.scheduleTimer(this,this._animationHandler,a,b.getAnimationInterval())):AdfDomUtils.removeCSSClassName(f,AdfDhtmlInputNumberSliderBasePeer._PLAYING_STYLE_CLASS)}};
function AdfInputNumberSliderDragRecognizer(){this.Init()}AdfDhtmlInputNumberSliderBasePeer._getLabelTextElement=function(a,b){for(var d=AdfPage.PAGE.getLookAndFeel().getStyleClass(b),e=a.getElementsByTagName("LABEL"),f=e.length,g=0;g<f;g++){var h=e[g];if(null!=h&&h.className==d)return h}return null};AdfObject.createSubclass(AdfInputNumberSliderDragRecognizer,AdfDragRecognizer);
AdfInputNumberSliderDragRecognizer.prototype.prepDrag=function(a,b,d){AdfAssert.assertPrototype(b,AdfDragSource);AdfAssert.assertPrototype(d,AdfUIInputEvent);if(AdfAgent.AGENT.isDragPrepEvent(d)){var e=b.getComponent(),f=e.getPeer();f.bind(e);var e=f._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT_ID_ATTR_NAME),g=null,h=null;f.isRanged()&&(g=f._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._THUMB_ELEMENT2_ID_ATTR_NAME),h=f._getElementByRootAttribute(AdfDhtmlInputNumberSliderBasePeer._RANGE_ID_ATTR_NAME));
f=d.getNativeEventTarget();if(!(AdfDomUtils.isAncestorOrSelf(e,f)||g&&AdfDomUtils.isAncestorOrSelf(g,f)||h&&AdfDomUtils.isAncestorOrSelf(h,f)))return AdfInputNumberSliderDragRecognizer.superclass.prepDrag.apply(this,arguments)}return null};AdfDhtmlInputNumberSliderBasePeer.prototype.GetInputRangeSliderLabelStyleClass=function(){return"af_inputRangeSlider_label-text"};AdfDhtmlInputNumberSliderBasePeer.prototype.GetInputNumberSliderLabelStyleClass=function(){return"af_inputNumberSlider_label-text"};