define(["Ti/_/declare","Ti/_/UI/Widget","Ti/_/dom","Ti/_/css","Ti/_/style","Ti/_/lang","Ti/UI"],function(t,i,e,n,a,s,o){var u=require.on,h=a.set;return t("Ti.UI.Slider",i,{constructor:function(){var t,i,n=this,a=n._track=e.create("div",{className:"TiUISliderTrack"},n.domNode),s=n._thumb=e.create("div",{className:"TiUIElementGradient TiUISliderThumb"},n.domNode);u(n,"touchstart",function(e){t=e.x,i=n.value}),u(n,"touchmove",function(e){n.value=(e.x-t)*(n.max-n.min)/(a.offsetWidth-s.offsetWidth)+i}),u(n,"postlayout",n,"_updatePosition")},_constrainedUpdate:function(t){this.__values__.properties.value=this._constrainValue(t),this._updatePosition()},_constrainValue:function(t){return Math.min(s.val(this.maxRange,this.max),Math.max(s.val(this.minRange,this.min),t))},_updatePosition:function(){var t=this._thumb;this._thumbLocation=Math.round((this._track.offsetWidth-t.offsetWidth)*((this.value-this.min)/(this.max-this.min))),h(t,"transform","translateX("+this._thumbLocation+"px)")},_defaultWidth:o.FILL,_defaultHeight:o.SIZE,_setTouchEnabled:function(t){var e=t?"auto":"none";i.prototype._setTouchEnabled.call(this,t),h(this._track,"pointerEvents",e),h(this._thumb,"pointerEvents",e)},_getContentSize:function(){return{width:200,height:40}},properties:{enabled:{set:function(t,i){return t!==i&&(n.remove(this._thumb,["TiUIElementGradient","TiUISliderThumbDisabled"]),n.add(this._thumb,t?"TiUIElementGradient":"TiUISliderThumbDisabled"),this._setTouchEnabled(t)),t},value:!0},max:{set:function(t){return Math.max(this.min,t)},post:"_constrainedUpdate",value:1},maxRange:{set:function(t){return Math.min(this.max,t)},post:"_constrainedUpdate"},min:{set:function(t){return Math.min(this.max,t)},post:"_constrainedUpdate",value:0},minRange:{set:function(t){return Math.max(this.min,t)},post:"_constrainedUpdate"},value:{set:function(t){return this._constrainValue(t)},post:function(t,i){t!==i&&this.fireEvent("change",{value:t,thumbOffset:{x:0,y:0},thumbSize:{height:0,width:0}}),this._updatePosition()},value:0}}})});