2015-12-01 19:37:14 +00:00
// Ion.RangeSlider | version 2.1.2 | https://github.com/IonDen/ion.rangeSlider
; ( function ( f , r , h , t , v ) { var u = 0 , p = function ( ) { var a = t . userAgent , b = /msie\s\d+/i ; return 0 < a . search ( b ) && ( a = b . exec ( a ) . toString ( ) , a = a . split ( " " ) [ 1 ] , 9 > a ) ? ( f ( "html" ) . addClass ( "lt-ie9" ) , ! 0 ) : ! 1 } ( ) ; Function . prototype . bind || ( Function . prototype . bind = function ( a ) { var b = this , d = [ ] . slice ; if ( "function" != typeof b ) throw new TypeError ; var c = d . call ( arguments , 1 ) , e = function ( ) { if ( this instanceof e ) { var g = function ( ) { } ; g . prototype = b . prototype ; var g = new g , l = b . apply ( g , c . concat ( d . call ( arguments ) ) ) ; return Object ( l ) === l ? l : g } return b . apply ( a ,
c . concat ( d . call ( arguments ) ) ) } ; return e } ) ; Array . prototype . indexOf || ( Array . prototype . indexOf = function ( a , b ) { var d ; if ( null == this ) throw new TypeError ( '"this" is null or not defined' ) ; var c = Object ( this ) , e = c . length >>> 0 ; if ( 0 === e ) return - 1 ; d = + b || 0 ; Infinity === Math . abs ( d ) && ( d = 0 ) ; if ( d >= e ) return - 1 ; for ( d = Math . max ( 0 <= d ? d : e - Math . abs ( d ) , 0 ) ; d < e ; ) { if ( d in c && c [ d ] === a ) return d ; d ++ } return - 1 } ) ; var q = function ( a , b , d ) { this . VERSION = "2.1.2" ; this . input = a ; this . plugin _count = d ; this . old _to = this . old _from = this . update _tm = this . calc _count =
this . current _plugin = 0 ; this . raf _id = this . old _min _interval = null ; this . is _update = this . is _key = this . no _diapason = this . force _redraw = this . dragging = ! 1 ; this . is _start = ! 0 ; this . is _click = this . is _resize = this . is _active = this . is _finish = ! 1 ; this . $cache = { win : f ( h ) , body : f ( r . body ) , input : f ( a ) , cont : null , rs : null , min : null , max : null , from : null , to : null , single : null , bar : null , line : null , s _single : null , s _from : null , s _to : null , shad _single : null , shad _from : null , shad _to : null , edge : null , grid : null , grid _labels : [ ] } ; this . coords = { x _gap : 0 , x _pointer : 0 ,
w _rs : 0 , w _rs _old : 0 , w _handle : 0 , p _gap : 0 , p _gap _left : 0 , p _gap _right : 0 , p _step : 0 , p _pointer : 0 , p _handle : 0 , p _single _fake : 0 , p _single _real : 0 , p _from _fake : 0 , p _from _real : 0 , p _to _fake : 0 , p _to _real : 0 , p _bar _x : 0 , p _bar _w : 0 , grid _gap : 0 , big _num : 0 , big : [ ] , big _w : [ ] , big _p : [ ] , big _x : [ ] } ; this . labels = { w _min : 0 , w _max : 0 , w _from : 0 , w _to : 0 , w _single : 0 , p _min : 0 , p _max : 0 , p _from _fake : 0 , p _from _left : 0 , p _to _fake : 0 , p _to _left : 0 , p _single _fake : 0 , p _single _left : 0 } ; var c = this . $cache . input ; a = c . prop ( "value" ) ; var e ; d = { type : "single" , min : 10 , max : 100 , from : null ,
to : null , step : 1 , min _interval : 0 , max _interval : 0 , drag _interval : ! 1 , values : [ ] , p _values : [ ] , from _fixed : ! 1 , from _min : null , from _max : null , from _shadow : ! 1 , to _fixed : ! 1 , to _min : null , to _max : null , to _shadow : ! 1 , prettify _enabled : ! 0 , prettify _separator : " " , prettify : null , force _edges : ! 1 , keyboard : ! 1 , keyboard _step : 5 , grid : ! 1 , grid _margin : ! 0 , grid _num : 4 , grid _snap : ! 1 , hide _min _max : ! 1 , hide _from _to : ! 1 , prefix : "" , postfix : "" , max _postfix : "" , decorate _both : ! 0 , values _separator : " \u2014 " , input _values _separator : ";" , disable : ! 1 , onStart : null ,
onChange : null , onFinish : null , onUpdate : null } ; c = { type : c . data ( "type" ) , min : c . data ( "min" ) , max : c . data ( "max" ) , from : c . data ( "from" ) , to : c . data ( "to" ) , step : c . data ( "step" ) , min _interval : c . data ( "minInterval" ) , max _interval : c . data ( "maxInterval" ) , drag _interval : c . data ( "dragInterval" ) , values : c . data ( "values" ) , from _fixed : c . data ( "fromFixed" ) , from _min : c . data ( "fromMin" ) , from _max : c . data ( "fromMax" ) , from _shadow : c . data ( "fromShadow" ) , to _fixed : c . data ( "toFixed" ) , to _min : c . data ( "toMin" ) , to _max : c . data ( "toMax" ) , to _shadow : c . data ( "toShadow" ) ,
prettify _enabled : c . data ( "prettifyEnabled" ) , prettify _separator : c . data ( "prettifySeparator" ) , force _edges : c . data ( "forceEdges" ) , keyboard : c . data ( "keyboard" ) , keyboard _step : c . data ( "keyboardStep" ) , grid : c . data ( "grid" ) , grid _margin : c . data ( "gridMargin" ) , grid _num : c . data ( "gridNum" ) , grid _snap : c . data ( "gridSnap" ) , hide _min _max : c . data ( "hideMinMax" ) , hide _from _to : c . data ( "hideFromTo" ) , prefix : c . data ( "prefix" ) , postfix : c . data ( "postfix" ) , max _postfix : c . data ( "maxPostfix" ) , decorate _both : c . data ( "decorateBoth" ) , values _separator : c . data ( "valuesSeparator" ) ,
input _values _separator : c . data ( "inputValuesSeparator" ) , disable : c . data ( "disable" ) } ; c . values = c . values && c . values . split ( "," ) ; for ( e in c ) c . hasOwnProperty ( e ) && ( c [ e ] || 0 === c [ e ] || delete c [ e ] ) ; a && ( a = a . split ( c . input _values _separator || b . input _values _separator || ";" ) , a [ 0 ] && a [ 0 ] == + a [ 0 ] && ( a [ 0 ] = + a [ 0 ] ) , a [ 1 ] && a [ 1 ] == + a [ 1 ] && ( a [ 1 ] = + a [ 1 ] ) , b && b . values && b . values . length ? ( d . from = a [ 0 ] && b . values . indexOf ( a [ 0 ] ) , d . to = a [ 1 ] && b . values . indexOf ( a [ 1 ] ) ) : ( d . from = a [ 0 ] && + a [ 0 ] , d . to = a [ 1 ] && + a [ 1 ] ) ) ; f . extend ( d , b ) ; f . extend ( d , c ) ; this . options = d ; this . validate ( ) ;
this . result = { input : this . $cache . input , slider : null , min : this . options . min , max : this . options . max , from : this . options . from , from _percent : 0 , from _value : null , to : this . options . to , to _percent : 0 , to _value : null } ; this . init ( ) } ; q . prototype = { init : function ( a ) { this . no _diapason = ! 1 ; this . coords . p _step = this . convertToPercent ( this . options . step , ! 0 ) ; this . target = "base" ; this . toggleInput ( ) ; this . append ( ) ; this . setMinMax ( ) ; a ? ( this . force _redraw = ! 0 , this . calc ( ! 0 ) , this . callOnUpdate ( ) ) : ( this . force _redraw = ! 0 , this . calc ( ! 0 ) , this . callOnStart ( ) ) ;
this . updateScene ( ) } , append : function ( ) { this . $cache . input . before ( '<span class="irs js-irs-' + this . plugin _count + '"></span>' ) ; this . $cache . input . prop ( "readonly" , ! 0 ) ; this . $cache . cont = this . $cache . input . prev ( ) ; this . result . slider = this . $cache . cont ; this . $cache . cont . html ( '<span class="irs"><span class="irs-line" tabindex="-1"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min">0</span><span class="irs-max">1</span><span class="irs-from">0</span><span class="irs-to">0</span><span class="irs-single">0</span></span><span class="irs-grid"></span><span class="irs-bar"></span>' ) ;
this . $cache . rs = this . $cache . cont . find ( ".irs" ) ; this . $cache . min = this . $cache . cont . find ( ".irs-min" ) ; this . $cache . max = this . $cache . cont . find ( ".irs-max" ) ; this . $cache . from = this . $cache . cont . find ( ".irs-from" ) ; this . $cache . to = this . $cache . cont . find ( ".irs-to" ) ; this . $cache . single = this . $cache . cont . find ( ".irs-single" ) ; this . $cache . bar = this . $cache . cont . find ( ".irs-bar" ) ; this . $cache . line = this . $cache . cont . find ( ".irs-line" ) ; this . $cache . grid = this . $cache . cont . find ( ".irs-grid" ) ; "single" === this . options . type ? ( this . $cache . cont . append ( '<span class="irs-bar-edge"></span><span class="irs-shadow shadow-single"></span><span class="irs-slider single"></span>' ) ,
this . $cache . edge = this . $cache . cont . find ( ".irs-bar-edge" ) , this . $cache . s _single = this . $cache . cont . find ( ".single" ) , this . $cache . from [ 0 ] . style . visibility = "hidden" , this . $cache . to [ 0 ] . style . visibility = "hidden" , this . $cache . shad _single = this . $cache . cont . find ( ".shadow-single" ) ) : ( this . $cache . cont . append ( '<span class="irs-shadow shadow-from"></span><span class="irs-shadow shadow-to"></span><span class="irs-slider from"></span><span class="irs-slider to"></span>' ) , this . $cache . s _from = this . $cache . cont . find ( ".from" ) ,
this . $cache . s _to = this . $cache . cont . find ( ".to" ) , this . $cache . shad _from = this . $cache . cont . find ( ".shadow-from" ) , this . $cache . shad _to = this . $cache . cont . find ( ".shadow-to" ) , this . setTopHandler ( ) ) ; this . options . hide _from _to && ( this . $cache . from [ 0 ] . style . display = "none" , this . $cache . to [ 0 ] . style . display = "none" , this . $cache . single [ 0 ] . style . display = "none" ) ; this . appendGrid ( ) ; this . options . disable ? ( this . appendDisableMask ( ) , this . $cache . input [ 0 ] . disabled = ! 0 ) : ( this . $cache . cont . removeClass ( "irs-disabled" ) , this . $cache . input [ 0 ] . disabled =
! 1 , this . bindEvents ( ) ) ; this . options . drag _interval && ( this . $cache . bar [ 0 ] . style . cursor = "ew-resize" ) } , setTopHandler : function ( ) { var a = this . options . max , b = this . options . to ; this . options . from > this . options . min && b === a ? this . $cache . s _from . addClass ( "type_last" ) : b < a && this . $cache . s _to . addClass ( "type_last" ) } , changeLevel : function ( a ) { switch ( a ) { case "single" : this . coords . p _gap = this . toFixed ( this . coords . p _pointer - this . coords . p _single _fake ) ; break ; case "from" : this . coords . p _gap = this . toFixed ( this . coords . p _pointer - this . coords . p _from _fake ) ;
this . $cache . s _from . addClass ( "state_hover" ) ; this . $cache . s _from . addClass ( "type_last" ) ; this . $cache . s _to . removeClass ( "type_last" ) ; break ; case "to" : this . coords . p _gap = this . toFixed ( this . coords . p _pointer - this . coords . p _to _fake ) ; this . $cache . s _to . addClass ( "state_hover" ) ; this . $cache . s _to . addClass ( "type_last" ) ; this . $cache . s _from . removeClass ( "type_last" ) ; break ; case "both" : this . coords . p _gap _left = this . toFixed ( this . coords . p _pointer - this . coords . p _from _fake ) , this . coords . p _gap _right = this . toFixed ( this . coords . p _to _fake -
this . coords . p _pointer ) , this . $cache . s _to . removeClass ( "type_last" ) , this . $cache . s _from . removeClass ( "type_last" ) } } , appendDisableMask : function ( ) { this . $cache . cont . append ( '<span class="irs-disable-mask"></span>' ) ; this . $cache . cont . addClass ( "irs-disabled" ) } , remove : function ( ) { this . $cache . cont . remove ( ) ; this . $cache . cont = null ; this . $cache . line . off ( "keydown.irs_" + this . plugin _count ) ; this . $cache . body . off ( "touchmove.irs_" + this . plugin _count ) ; this . $cache . body . off ( "mousemove.irs_" + this . plugin _count ) ; this . $cache . win . off ( "touchend.irs_" +
this . plugin _count ) ; this . $cache . win . off ( "mouseup.irs_" + this . plugin _count ) ; p && ( this . $cache . body . off ( "mouseup.irs_" + this . plugin _count ) , this . $cache . body . off ( "mouseleave.irs_" + this . plugin _count ) ) ; this . $cache . grid _labels = [ ] ; this . coords . big = [ ] ; this . coords . big _w = [ ] ; this . coords . big _p = [ ] ; this . coords . big _x = [ ] ; cancelAnimationFrame ( this . raf _id ) } , bindEvents : function ( ) { if ( ! this . no _diapason ) { this . $cache . body . on ( "touchmove.irs_" + this . plugin _count , this . pointerMove . bind ( this ) ) ; this . $cache . body . on ( "mousemove.irs_" + this . plugin _count ,
this . pointerMove . bind ( this ) ) ; this . $cache . win . on ( "touchend.irs_" + this . plugin _count , this . pointerUp . bind ( this ) ) ; this . $cache . win . on ( "mouseup.irs_" + this . plugin _count , this . pointerUp . bind ( this ) ) ; this . $cache . line . on ( "touchstart.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) ; this . $cache . line . on ( "mousedown.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) ; this . options . drag _interval && "double" === this . options . type ? ( this . $cache . bar . on ( "touchstart.irs_" + this . plugin _count , this . pointerDown . bind ( this ,
"both" ) ) , this . $cache . bar . on ( "mousedown.irs_" + this . plugin _count , this . pointerDown . bind ( this , "both" ) ) ) : ( this . $cache . bar . on ( "touchstart.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) , this . $cache . bar . on ( "mousedown.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) ) ; "single" === this . options . type ? ( this . $cache . single . on ( "touchstart.irs_" + this . plugin _count , this . pointerDown . bind ( this , "single" ) ) , this . $cache . s _single . on ( "touchstart.irs_" + this . plugin _count , this . pointerDown . bind ( this , "single" ) ) ,
this . $cache . shad _single . on ( "touchstart.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) , this . $cache . single . on ( "mousedown.irs_" + this . plugin _count , this . pointerDown . bind ( this , "single" ) ) , this . $cache . s _single . on ( "mousedown.irs_" + this . plugin _count , this . pointerDown . bind ( this , "single" ) ) , this . $cache . edge . on ( "mousedown.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) , this . $cache . shad _single . on ( "mousedown.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) ) : ( this . $cache . single . on ( "touchstart.irs_" +
this . plugin _count , this . pointerDown . bind ( this , null ) ) , this . $cache . single . on ( "mousedown.irs_" + this . plugin _count , this . pointerDown . bind ( this , null ) ) , this . $cache . from . on ( "touchstart.irs_" + this . plugin _count , this . pointerDown . bind ( this , "from" ) ) , this . $cache . s _from . on ( "touchstart.irs_" + this . plugin _count , this . pointerDown . bind ( this , "from" ) ) , this . $cache . to . on ( "touchstart.irs_" + this . plugin _count , this . pointerDown . bind ( this , "to" ) ) , this . $cache . s _to . on ( "touchstart.irs_" + this . plugin _count , this . pointerDown . bind ( this , "to" ) ) ,
this . $cache . shad _from . on ( "touchstart.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) , this . $cache . shad _to . on ( "touchstart.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) , this . $cache . from . on ( "mousedown.irs_" + this . plugin _count , this . pointerDown . bind ( this , "from" ) ) , this . $cache . s _from . on ( "mousedown.irs_" + this . plugin _count , this . pointerDown . bind ( this , "from" ) ) , this . $cache . to . on ( "mousedown.irs_" + this . plugin _count , this . pointerDown . bind ( this , "to" ) ) , this . $cache . s _to . on ( "mousedown.irs_" +
this . plugin _count , this . pointerDown . bind ( this , "to" ) ) , this . $cache . shad _from . on ( "mousedown.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) , this . $cache . shad _to . on ( "mousedown.irs_" + this . plugin _count , this . pointerClick . bind ( this , "click" ) ) ) ; if ( this . options . keyboard ) this . $cache . line . on ( "keydown.irs_" + this . plugin _count , this . key . bind ( this , "keyboard" ) ) ; p && ( this . $cache . body . on ( "mouseup.irs_" + this . plugin _count , this . pointerUp . bind ( this ) ) , this . $cache . body . on ( "mouseleave.irs_" + this . plugin _count , this . pointerUp . bind ( this ) ) ) } } ,
pointerMove : function ( a ) { this . dragging && ( this . coords . x _pointer = ( a . pageX || a . originalEvent . touches && a . originalEvent . touches [ 0 ] . pageX ) - this . coords . x _gap , this . calc ( ) ) } , pointerUp : function ( a ) { if ( this . current _plugin === this . plugin _count && this . is _active ) { this . is _active = ! 1 ; this . $cache . cont . find ( ".state_hover" ) . removeClass ( "state_hover" ) ; this . force _redraw = ! 0 ; p && f ( "*" ) . prop ( "unselectable" , ! 1 ) ; this . updateScene ( ) ; this . restoreOriginalMinInterval ( ) ; if ( f . contains ( this . $cache . cont [ 0 ] , a . target ) || this . dragging ) this . is _finish =
! 0 , this . callOnFinish ( ) ; this . dragging = ! 1 } } , pointerDown : function ( a , b ) { b . preventDefault ( ) ; var d = b . pageX || b . originalEvent . touches && b . originalEvent . touches [ 0 ] . pageX ; 2 !== b . button && ( "both" === a && this . setTempMinInterval ( ) , a || ( a = this . target ) , this . current _plugin = this . plugin _count , this . target = a , this . dragging = this . is _active = ! 0 , this . coords . x _gap = this . $cache . rs . offset ( ) . left , this . coords . x _pointer = d - this . coords . x _gap , this . calcPointerPercent ( ) , this . changeLevel ( a ) , p && f ( "*" ) . prop ( "unselectable" , ! 0 ) , this . $cache . line . trigger ( "focus" ) ,
this . updateScene ( ) ) } , pointerClick : function ( a , b ) { b . preventDefault ( ) ; var d = b . pageX || b . originalEvent . touches && b . originalEvent . touches [ 0 ] . pageX ; 2 !== b . button && ( this . current _plugin = this . plugin _count , this . target = a , this . is _click = ! 0 , this . coords . x _gap = this . $cache . rs . offset ( ) . left , this . coords . x _pointer = + ( d - this . coords . x _gap ) . toFixed ( ) , this . force _redraw = ! 0 , this . calc ( ) , this . $cache . line . trigger ( "focus" ) ) } , key : function ( a , b ) { if ( ! ( this . current _plugin !== this . plugin _count || b . altKey || b . ctrlKey || b . shiftKey || b . metaKey ) ) { switch ( b . which ) { case 83 : case 65 : case 40 : case 37 : b . preventDefault ( ) ;
this . moveByKey ( ! 1 ) ; break ; case 87 : case 68 : case 38 : case 39 : b . preventDefault ( ) , this . moveByKey ( ! 0 ) } return ! 0 } } , moveByKey : function ( a ) { var b = this . coords . p _pointer , b = a ? b + this . options . keyboard _step : b - this . options . keyboard _step ; this . coords . x _pointer = this . toFixed ( this . coords . w _rs / 100 * b ) ; this . is _key = ! 0 ; this . calc ( ) } , setMinMax : function ( ) { this . options && ( this . options . hide _min _max ? ( this . $cache . min [ 0 ] . style . display = "none" , this . $cache . max [ 0 ] . style . display = "none" ) : ( this . options . values . length ? ( this . $cache . min . html ( this . decorate ( this . options . p _values [ this . options . min ] ) ) ,
this . $cache . max . html ( this . decorate ( this . options . p _values [ this . options . max ] ) ) ) : ( this . $cache . min . html ( this . decorate ( this . _prettify ( this . options . min ) , this . options . min ) ) , this . $cache . max . html ( this . decorate ( this . _prettify ( this . options . max ) , this . options . max ) ) ) , this . labels . w _min = this . $cache . min . outerWidth ( ! 1 ) , this . labels . w _max = this . $cache . max . outerWidth ( ! 1 ) ) ) } , setTempMinInterval : function ( ) { var a = this . result . to - this . result . from ; null === this . old _min _interval && ( this . old _min _interval = this . options . min _interval ) ;
this . options . min _interval = a } , restoreOriginalMinInterval : function ( ) { null !== this . old _min _interval && ( this . options . min _interval = this . old _min _interval , this . old _min _interval = null ) } , calc : function ( a ) { if ( this . options ) { this . calc _count ++ ; if ( 10 === this . calc _count || a ) this . calc _count = 0 , this . coords . w _rs = this . $cache . rs . outerWidth ( ! 1 ) , this . calcHandlePercent ( ) ; if ( this . coords . w _rs ) { this . calcPointerPercent ( ) ; a = this . getHandleX ( ) ; "click" === this . target && ( this . coords . p _gap = this . coords . p _handle / 2 , a = this . getHandleX ( ) , this . target =
this . options . drag _interval ? "both_one" : this . chooseHandle ( a ) ) ; switch ( this . target ) { case "base" : var b = ( this . options . max - this . options . min ) / 100 ; a = ( this . result . from - this . options . min ) / b ; b = ( this . result . to - this . options . min ) / b ; this . coords . p _single _real = this . toFixed ( a ) ; this . coords . p _from _real = this . toFixed ( a ) ; this . coords . p _to _real = this . toFixed ( b ) ; this . coords . p _single _real = this . checkDiapason ( this . coords . p _single _real , this . options . from _min , this . options . from _max ) ; this . coords . p _from _real = this . checkDiapason ( this . coords . p _from _real ,
this . options . from _min , this . options . from _max ) ; this . coords . p _to _real = this . checkDiapason ( this . coords . p _to _real , this . options . to _min , this . options . to _max ) ; this . coords . p _single _fake = this . convertToFakePercent ( this . coords . p _single _real ) ; this . coords . p _from _fake = this . convertToFakePercent ( this . coords . p _from _real ) ; this . coords . p _to _fake = this . convertToFakePercent ( this . coords . p _to _real ) ; this . target = null ; break ; case "single" : if ( this . options . from _fixed ) break ; this . coords . p _single _real = this . convertToRealPercent ( a ) ; this . coords . p _single _real =
this . calcWithStep ( this . coords . p _single _real ) ; this . coords . p _single _real = this . checkDiapason ( this . coords . p _single _real , this . options . from _min , this . options . from _max ) ; this . coords . p _single _fake = this . convertToFakePercent ( this . coords . p _single _real ) ; break ; case "from" : if ( this . options . from _fixed ) break ; this . coords . p _from _real = this . convertToRealPercent ( a ) ; this . coords . p _from _real = this . calcWithStep ( this . coords . p _from _real ) ; this . coords . p _from _real > this . coords . p _to _real && ( this . coords . p _from _real = this . coords . p _to _real ) ;
this . coords . p _from _real = this . checkDiapason ( this . coords . p _from _real , this . options . from _min , this . options . from _max ) ; this . coords . p _from _real = this . checkMinInterval ( this . coords . p _from _real , this . coords . p _to _real , "from" ) ; this . coords . p _from _real = this . checkMaxInterval ( this . coords . p _from _real , this . coords . p _to _real , "from" ) ; this . coords . p _from _fake = this . convertToFakePercent ( this . coords . p _from _real ) ; break ; case "to" : if ( this . options . to _fixed ) break ; this . coords . p _to _real = this . convertToRealPercent ( a ) ; this . coords . p _to _real =
this . calcWithStep ( this . coords . p _to _real ) ; this . coords . p _to _real < this . coords . p _from _real && ( this . coords . p _to _real = this . coords . p _from _real ) ; this . coords . p _to _real = this . checkDiapason ( this . coords . p _to _real , this . options . to _min , this . options . to _max ) ; this . coords . p _to _real = this . checkMinInterval ( this . coords . p _to _real , this . coords . p _from _real , "to" ) ; this . coords . p _to _real = this . checkMaxInterval ( this . coords . p _to _real , this . coords . p _from _real , "to" ) ; this . coords . p _to _fake = this . convertToFakePercent ( this . coords . p _to _real ) ;
break ; case "both" : if ( this . options . from _fixed || this . options . to _fixed ) break ; a = this . toFixed ( a + . 1 * this . coords . p _handle ) ; this . coords . p _from _real = this . convertToRealPercent ( a ) - this . coords . p _gap _left ; this . coords . p _from _real = this . calcWithStep ( this . coords . p _from _real ) ; this . coords . p _from _real = this . checkDiapason ( this . coords . p _from _real , this . options . from _min , this . options . from _max ) ; this . coords . p _from _real = this . checkMinInterval ( this . coords . p _from _real , this . coords . p _to _real , "from" ) ; this . coords . p _from _fake = this . convertToFakePercent ( this . coords . p _from _real ) ;
this . coords . p _to _real = this . convertToRealPercent ( a ) + this . coords . p _gap _right ; this . coords . p _to _real = this . calcWithStep ( this . coords . p _to _real ) ; this . coords . p _to _real = this . checkDiapason ( this . coords . p _to _real , this . options . to _min , this . options . to _max ) ; this . coords . p _to _real = this . checkMinInterval ( this . coords . p _to _real , this . coords . p _from _real , "to" ) ; this . coords . p _to _fake = this . convertToFakePercent ( this . coords . p _to _real ) ; break ; case "both_one" : if ( this . options . from _fixed || this . options . to _fixed ) break ; var d = this . convertToRealPercent ( a ) ;
a = this . result . to _percent - this . result . from _percent ; var c = a / 2 , b = d - c , d = d + c ; 0 > b && ( b = 0 , d = b + a ) ; 100 < d && ( d = 100 , b = d - a ) ; this . coords . p _from _real = this . calcWithStep ( b ) ; this . coords . p _from _real = this . checkDiapason ( this . coords . p _from _real , this . options . from _min , this . options . from _max ) ; this . coords . p _from _fake = this . convertToFakePercent ( this . coords . p _from _real ) ; this . coords . p _to _real = this . calcWithStep ( d ) ; this . coords . p _to _real = this . checkDiapason ( this . coords . p _to _real , this . options . to _min , this . options . to _max ) ; this . coords . p _to _fake =
this . convertToFakePercent ( this . coords . p _to _real ) } "single" === this . options . type ? ( this . coords . p _bar _x = this . coords . p _handle / 2 , this . coords . p _bar _w = this . coords . p _single _fake , this . result . from _percent = this . coords . p _single _real , this . result . from = this . convertToValue ( this . coords . p _single _real ) , this . options . values . length && ( this . result . from _value = this . options . values [ this . result . from ] ) ) : ( this . coords . p _bar _x = this . toFixed ( this . coords . p _from _fake + this . coords . p _handle / 2 ) , this . coords . p _bar _w = this . toFixed ( this . coords . p _to _fake -
this . coords . p _from _fake ) , this . result . from _percent = this . coords . p _from _real , this . result . from = this . convertToValue ( this . coords . p _from _real ) , this . result . to _percent = this . coords . p _to _real , this . result . to = this . convertToValue ( this . coords . p _to _real ) , this . options . values . length && ( this . result . from _value = this . options . values [ this . result . from ] , this . result . to _value = this . options . values [ this . result . to ] ) ) ; this . calcMinMax ( ) ; this . calcLabels ( ) } } } , calcPointerPercent : function ( ) { this . coords . w _rs ? ( 0 > this . coords . x _pointer || isNaN ( this . coords . x _pointer ) ?
this . coords . x _pointer = 0 : this . coords . x _pointer > this . coords . w _rs && ( this . coords . x _pointer = this . coords . w _rs ) , this . coords . p _pointer = this . toFixed ( this . coords . x _pointer / this . coords . w _rs * 100 ) ) : this . coords . p _pointer = 0 } , convertToRealPercent : function ( a ) { return a / ( 100 - this . coords . p _handle ) * 100 } , convertToFakePercent : function ( a ) { return a / 100 * ( 100 - this . coords . p _handle ) } , getHandleX : function ( ) { var a = 100 - this . coords . p _handle , b = this . toFixed ( this . coords . p _pointer - this . coords . p _gap ) ; 0 > b ? b = 0 : b > a && ( b = a ) ; return b } , calcHandlePercent : function ( ) { this . coords . w _handle =
"single" === this . options . type ? this . $cache . s _single . outerWidth ( ! 1 ) : this . $cache . s _from . outerWidth ( ! 1 ) ; this . coords . p _handle = this . toFixed ( this . coords . w _handle / this . coords . w _rs * 100 ) } , chooseHandle : function ( a ) { return "single" === this . options . type ? "single" : a >= this . coords . p _from _real + ( this . coords . p _to _real - this . coords . p _from _real ) / 2 ? this . options . to _fixed ? "from" : "to" : this . options . from _fixed ? "to" : "from" } , calcMinMax : function ( ) { this . coords . w _rs && ( this . labels . p _min = this . labels . w _min / this . coords . w _rs * 100 , this . labels . p _max =
this . labels . w _max / this . coords . w _rs * 100 ) } , calcLabels : function ( ) { this . coords . w _rs && ! this . options . hide _from _to && ( "single" === this . options . type ? ( this . labels . w _single = this . $cache . single . outerWidth ( ! 1 ) , this . labels . p _single _fake = this . labels . w _single / this . coords . w _rs * 100 , this . labels . p _single _left = this . coords . p _single _fake + this . coords . p _handle / 2 - this . labels . p _single _fake / 2 ) : ( this . labels . w _from = this . $cache . from . outerWidth ( ! 1 ) , this . labels . p _from _fake = this . labels . w _from / this . coords . w _rs * 100 , this . labels . p _from _left =
this . coords . p _from _fake + this . coords . p _handle / 2 - this . labels . p _from _fake / 2 , this . labels . p _from _left = this . toFixed ( this . labels . p _from _left ) , this . labels . p _from _left = this . checkEdges ( this . labels . p _from _left , this . labels . p _from _fake ) , this . labels . w _to = this . $cache . to . outerWidth ( ! 1 ) , this . labels . p _to _fake = this . labels . w _to / this . coords . w _rs * 100 , this . labels . p _to _left = this . coords . p _to _fake + this . coords . p _handle / 2 - this . labels . p _to _fake / 2 , this . labels . p _to _left = this . toFixed ( this . labels . p _to _left ) , this . labels . p _to _left =
this . checkEdges ( this . labels . p _to _left , this . labels . p _to _fake ) , this . labels . w _single = this . $cache . single . outerWidth ( ! 1 ) , this . labels . p _single _fake = this . labels . w _single / this . coords . w _rs * 100 , this . labels . p _single _left = ( this . labels . p _from _left + this . labels . p _to _left + this . labels . p _to _fake ) / 2 - this . labels . p _single _fake / 2 , this . labels . p _single _left = this . toFixed ( this . labels . p _single _left ) ) , this . labels . p _single _left = this . checkEdges ( this . labels . p _single _left , this . labels . p _single _fake ) ) } , updateScene : function ( ) { this . raf _id &&
( cancelAnimationFrame ( this . raf _id ) , this . raf _id = null ) ; clearTimeout ( this . update _tm ) ; this . update _tm = null ; this . options && ( this . drawHandles ( ) , this . is _active ? this . raf _id = requestAnimationFrame ( this . updateScene . bind ( this ) ) : this . update _tm = setTimeout ( this . updateScene . bind ( this ) , 300 ) ) } , drawHandles : function ( ) { this . coords . w _rs = this . $cache . rs . outerWidth ( ! 1 ) ; if ( this . coords . w _rs ) { this . coords . w _rs !== this . coords . w _rs _old && ( this . target = "base" , this . is _resize = ! 0 ) ; if ( this . coords . w _rs !== this . coords . w _rs _old || this . force _redraw ) this . setMinMax ( ) ,
this . calc ( ! 0 ) , this . drawLabels ( ) , this . options . grid && ( this . calcGridMargin ( ) , this . calcGridLabels ( ) ) , this . force _redraw = ! 0 , this . coords . w _rs _old = this . coords . w _rs , this . drawShadow ( ) ; if ( this . coords . w _rs && ( this . dragging || this . force _redraw || this . is _key ) ) { if ( this . old _from !== this . result . from || this . old _to !== this . result . to || this . force _redraw || this . is _key ) { this . drawLabels ( ) ; this . $cache . bar [ 0 ] . style . left = this . coords . p _bar _x + "%" ; this . $cache . bar [ 0 ] . style . width = this . coords . p _bar _w + "%" ; if ( "single" === this . options . type ) this . $cache . s _single [ 0 ] . style . left =
this . coords . p _single _fake + "%" , this . $cache . single [ 0 ] . style . left = this . labels . p _single _left + "%" , this . options . values . length ? this . $cache . input . prop ( "value" , this . result . from _value ) : this . $cache . input . prop ( "value" , this . result . from ) , this . $cache . input . data ( "from" , this . result . from ) ; else { this . $cache . s _from [ 0 ] . style . left = this . coords . p _from _fake + "%" ; this . $cache . s _to [ 0 ] . style . left = this . coords . p _to _fake + "%" ; if ( this . old _from !== this . result . from || this . force _redraw ) this . $cache . from [ 0 ] . style . left = this . labels . p _from _left +
"%" ; if ( this . old _to !== this . result . to || this . force _redraw ) this . $cache . to [ 0 ] . style . left = this . labels . p _to _left + "%" ; this . $cache . single [ 0 ] . style . left = this . labels . p _single _left + "%" ; this . options . values . length ? this . $cache . input . prop ( "value" , this . result . from _value + this . options . input _values _separator + this . result . to _value ) : this . $cache . input . prop ( "value" , this . result . from + this . options . input _values _separator + this . result . to ) ; this . $cache . input . data ( "from" , this . result . from ) ; this . $cache . input . data ( "to" , this . result . to ) } this . old _from ===
this . result . from && this . old _to === this . result . to || this . is _start || this . $cache . input . trigger ( "change" ) ; this . old _from = this . result . from ; this . old _to = this . result . to ; this . is _resize || this . is _update || this . is _start || this . is _finish || this . callOnChange ( ) ; if ( this . is _key || this . is _click ) this . is _click = this . is _key = ! 1 , this . callOnFinish ( ) ; this . is _finish = this . is _resize = this . is _update = ! 1 } this . force _redraw = this . is _click = this . is _key = this . is _start = ! 1 } } } , drawLabels : function ( ) { if ( this . options ) { var a = this . options . values . length ,
b = this . options . p _values , d ; if ( ! this . options . hide _from _to ) if ( "single" === this . options . type ) a = a ? this . decorate ( b [ this . result . from ] ) : this . decorate ( this . _prettify ( this . result . from ) , this . result . from ) , this . $cache . single . html ( a ) , this . calcLabels ( ) , this . $cache . min [ 0 ] . style . visibility = this . labels . p _single _left < this . labels . p _min + 1 ? "hidden" : "visible" , this . $cache . max [ 0 ] . style . visibility = this . labels . p _single _left + this . labels . p _single _fake > 100 - this . labels . p _max - 1 ? "hidden" : "visible" ; else { a ? ( this . options . decorate _both ?
( a = this . decorate ( b [ this . result . from ] ) , a += this . options . values _separator , a += this . decorate ( b [ this . result . to ] ) ) : a = this . decorate ( b [ this . result . from ] + this . options . values _separator + b [ this . result . to ] ) , d = this . decorate ( b [ this . result . from ] ) , b = this . decorate ( b [ this . result . to ] ) ) : ( this . options . decorate _both ? ( a = this . decorate ( this . _prettify ( this . result . from ) , this . result . from ) , a += this . options . values _separator , a += this . decorate ( this . _prettify ( this . result . to ) , this . result . to ) ) : a = this . decorate ( this . _prettify ( this . result . from ) +
this . options . values _separator + this . _prettify ( this . result . to ) , this . result . to ) , d = this . decorate ( this . _prettify ( this . result . from ) , this . result . from ) , b = this . decorate ( this . _prettify ( this . result . to ) , this . result . to ) ) ; this . $cache . single . html ( a ) ; this . $cache . from . html ( d ) ; this . $cache . to . html ( b ) ; this . calcLabels ( ) ; b = Math . min ( this . labels . p _single _left , this . labels . p _from _left ) ; a = this . labels . p _single _left + this . labels . p _single _fake ; d = this . labels . p _to _left + this . labels . p _to _fake ; var c = Math . max ( a , d ) ; this . labels . p _from _left +
this . labels . p _from _fake >= this . labels . p _to _left ? ( this . $cache . from [ 0 ] . style . visibility = "hidden" , this . $cache . to [ 0 ] . style . visibility = "hidden" , this . $cache . single [ 0 ] . style . visibility = "visible" , this . result . from === this . result . to ? ( "from" === this . target ? this . $cache . from [ 0 ] . style . visibility = "visible" : "to" === this . target && ( this . $cache . to [ 0 ] . style . visibility = "visible" ) , this . $cache . single [ 0 ] . style . visibility = "hidden" , c = d ) : ( this . $cache . from [ 0 ] . style . visibility = "hidden" , this . $cache . to [ 0 ] . style . visibility = "hidden" ,
this . $cache . single [ 0 ] . style . visibility = "visible" , c = Math . max ( a , d ) ) ) : ( this . $cache . from [ 0 ] . style . visibility = "visible" , this . $cache . to [ 0 ] . style . visibility = "visible" , this . $cache . single [ 0 ] . style . visibility = "hidden" ) ; this . $cache . min [ 0 ] . style . visibility = b < this . labels . p _min + 1 ? "hidden" : "visible" ; this . $cache . max [ 0 ] . style . visibility = c > 100 - this . labels . p _max - 1 ? "hidden" : "visible" } } } , drawShadow : function ( ) { var a = this . options , b = this . $cache , d = "number" === typeof a . from _min && ! isNaN ( a . from _min ) , c = "number" === typeof a . from _max &&
! isNaN ( a . from _max ) , e = "number" === typeof a . to _min && ! isNaN ( a . to _min ) , g = "number" === typeof a . to _max && ! isNaN ( a . to _max ) ; "single" === a . type ? a . from _shadow && ( d || c ) ? ( d = this . convertToPercent ( d ? a . from _min : a . min ) , c = this . convertToPercent ( c ? a . from _max : a . max ) - d , d = this . toFixed ( d - this . coords . p _handle / 100 * d ) , c = this . toFixed ( c - this . coords . p _handle / 100 * c ) , d += this . coords . p _handle / 2 , b . shad _single [ 0 ] . style . display = "block" , b . shad _single [ 0 ] . style . left = d + "%" , b . shad _single [ 0 ] . style . width = c + "%" ) : b . shad _single [ 0 ] . style . display = "none" :
( a . from _shadow && ( d || c ) ? ( d = this . convertToPercent ( d ? a . from _min : a . min ) , c = this . convertToPercent ( c ? a . from _max : a . max ) - d , d = this . toFixed ( d - this . coords . p _handle / 100 * d ) , c = this . toFixed ( c - this . coords . p _handle / 100 * c ) , d += this . coords . p _handle / 2 , b . shad _from [ 0 ] . style . display = "block" , b . shad _from [ 0 ] . style . left = d + "%" , b . shad _from [ 0 ] . style . width = c + "%" ) : b . shad _from [ 0 ] . style . display = "none" , a . to _shadow && ( e || g ) ? ( e = this . convertToPercent ( e ? a . to _min : a . min ) , a = this . convertToPercent ( g ? a . to _max : a . max ) - e , e = this . toFixed ( e - this . coords . p _handle /
100 * e ) , a = this . toFixed ( a - this . coords . p _handle / 100 * a ) , e += this . coords . p _handle / 2 , b . shad _to [ 0 ] . style . display = "block" , b . shad _to [ 0 ] . style . left = e + "%" , b . shad _to [ 0 ] . style . width = a + "%" ) : b . shad _to [ 0 ] . style . display = "none" ) } , callOnStart : function ( ) { if ( this . options . onStart && "function" === typeof this . options . onStart ) this . options . onStart ( this . result ) } , callOnChange : function ( ) { if ( this . options . onChange && "function" === typeof this . options . onChange ) this . options . onChange ( this . result ) } , callOnFinish : function ( ) { if ( this . options . onFinish &&
"function" === typeof this . options . onFinish ) this . options . onFinish ( this . result ) } , callOnUpdate : function ( ) { if ( this . options . onUpdate && "function" === typeof this . options . onUpdate ) this . options . onUpdate ( this . result ) } , toggleInput : function ( ) { this . $cache . input . toggleClass ( "irs-hidden-input" ) } , convertToPercent : function ( a , b ) { var d = this . options . max - this . options . min ; return d ? this . toFixed ( ( b ? a : a - this . options . min ) / ( d / 100 ) ) : ( this . no _diapason = ! 0 , 0 ) } , convertToValue : function ( a ) { var b = this . options . min , d = this . options . max ,
c = b . toString ( ) . split ( "." ) [ 1 ] , e = d . toString ( ) . split ( "." ) [ 1 ] , g , l , k = 0 , f = 0 ; if ( 0 === a ) return this . options . min ; if ( 100 === a ) return this . options . max ; c && ( k = g = c . length ) ; e && ( k = l = e . length ) ; g && l && ( k = g >= l ? g : l ) ; 0 > b && ( f = Math . abs ( b ) , b = + ( b + f ) . toFixed ( k ) , d = + ( d + f ) . toFixed ( k ) ) ; a = ( d - b ) / 100 * a + b ; ( b = this . options . step . toString ( ) . split ( "." ) [ 1 ] ) ? a = + a . toFixed ( b . length ) : ( a /= this . options . step , a *= this . options . step , a = + a . toFixed ( 0 ) ) ; f && ( a -= f ) ; f = b ? + a . toFixed ( b . length ) : this . toFixed ( a ) ; f < this . options . min ? f = this . options . min : f > this . options . max &&
( f = this . options . max ) ; return f } , calcWithStep : function ( a ) { var b = Math . round ( a / this . coords . p _step ) * this . coords . p _step ; 100 < b && ( b = 100 ) ; 100 === a && ( b = 100 ) ; return this . toFixed ( b ) } , checkMinInterval : function ( a , b , d ) { var c = this . options ; if ( ! c . min _interval ) return a ; a = this . convertToValue ( a ) ; b = this . convertToValue ( b ) ; "from" === d ? b - a < c . min _interval && ( a = b - c . min _interval ) : a - b < c . min _interval && ( a = b + c . min _interval ) ; return this . convertToPercent ( a ) } , checkMaxInterval : function ( a , b , d ) { var c = this . options ; if ( ! c . max _interval ) return a ;
a = this . convertToValue ( a ) ; b = this . convertToValue ( b ) ; "from" === d ? b - a > c . max _interval && ( a = b - c . max _interval ) : a - b > c . max _interval && ( a = b + c . max _interval ) ; return this . convertToPercent ( a ) } , checkDiapason : function ( a , b , d ) { a = this . convertToValue ( a ) ; var c = this . options ; "number" !== typeof b && ( b = c . min ) ; "number" !== typeof d && ( d = c . max ) ; a < b && ( a = b ) ; a > d && ( a = d ) ; return this . convertToPercent ( a ) } , toFixed : function ( a ) { a = a . toFixed ( 9 ) ; return + a } , _prettify : function ( a ) { return this . options . prettify _enabled ? this . options . prettify && "function" ===
typeof this . options . prettify ? this . options . prettify ( a ) : this . prettify ( a ) : a } , prettify : function ( a ) { return a . toString ( ) . replace ( /(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g , "$1" + this . options . prettify _separator ) } , checkEdges : function ( a , b ) { if ( ! this . options . force _edges ) return this . toFixed ( a ) ; 0 > a ? a = 0 : a > 100 - b && ( a = 100 - b ) ; return this . toFixed ( a ) } , validate : function ( ) { var a = this . options , b = this . result , d = a . values , c = d . length , e , g ; "string" === typeof a . min && ( a . min = + a . min ) ; "string" === typeof a . max && ( a . max = + a . max ) ; "string" === typeof a . from &&
( a . from = + a . from ) ; "string" === typeof a . to && ( a . to = + a . to ) ; "string" === typeof a . step && ( a . step = + a . step ) ; "string" === typeof a . from _min && ( a . from _min = + a . from _min ) ; "string" === typeof a . from _max && ( a . from _max = + a . from _max ) ; "string" === typeof a . to _min && ( a . to _min = + a . to _min ) ; "string" === typeof a . to _max && ( a . to _max = + a . to _max ) ; "string" === typeof a . keyboard _step && ( a . keyboard _step = + a . keyboard _step ) ; "string" === typeof a . grid _num && ( a . grid _num = + a . grid _num ) ; a . max < a . min && ( a . max = a . min ) ; if ( c ) for ( a . p _values = [ ] , a . min = 0 , a . max = c - 1 , a . step =
1 , a . grid _num = a . max , a . grid _snap = ! 0 , g = 0 ; g < c ; g ++ ) e = + d [ g ] , isNaN ( e ) ? e = d [ g ] : ( d [ g ] = e , e = this . _prettify ( e ) ) , a . p _values . push ( e ) ; if ( "number" !== typeof a . from || isNaN ( a . from ) ) a . from = a . min ; if ( "number" !== typeof a . to || isNaN ( a . from ) ) a . to = a . max ; if ( "single" === a . type ) a . from < a . min && ( a . from = a . min ) , a . from > a . max && ( a . from = a . max ) ; else { if ( a . from < a . min || a . from > a . max ) a . from = a . min ; if ( a . to > a . max || a . to < a . min ) a . to = a . max ; a . from > a . to && ( a . from = a . to ) } if ( "number" !== typeof a . step || isNaN ( a . step ) || ! a . step || 0 > a . step ) a . step = 1 ; if ( "number" !==
typeof a . keyboard _step || isNaN ( a . keyboard _step ) || ! a . keyboard _step || 0 > a . keyboard _step ) a . keyboard _step = 5 ; "number" === typeof a . from _min && a . from < a . from _min && ( a . from = a . from _min ) ; "number" === typeof a . from _max && a . from > a . from _max && ( a . from = a . from _max ) ; "number" === typeof a . to _min && a . to < a . to _min && ( a . to = a . to _min ) ; "number" === typeof a . to _max && a . from > a . to _max && ( a . to = a . to _max ) ; if ( b ) { b . min !== a . min && ( b . min = a . min ) ; b . max !== a . max && ( b . max = a . max ) ; if ( b . from < b . min || b . from > b . max ) b . from = a . from ; if ( b . to < b . min || b . to > b . max ) b . to = a . to } if ( "number" !==
typeof a . min _interval || isNaN ( a . min _interval ) || ! a . min _interval || 0 > a . min _interval ) a . min _interval = 0 ; if ( "number" !== typeof a . max _interval || isNaN ( a . max _interval ) || ! a . max _interval || 0 > a . max _interval ) a . max _interval = 0 ; a . min _interval && a . min _interval > a . max - a . min && ( a . min _interval = a . max - a . min ) ; a . max _interval && a . max _interval > a . max - a . min && ( a . max _interval = a . max - a . min ) } , decorate : function ( a , b ) { var d = "" , c = this . options ; c . prefix && ( d += c . prefix ) ; d += a ; c . max _postfix && ( c . values . length && a === c . p _values [ c . max ] ? ( d += c . max _postfix ,
c . postfix && ( d += " " ) ) : b === c . max && ( d += c . max _postfix , c . postfix && ( d += " " ) ) ) ; c . postfix && ( d += c . postfix ) ; return d } , updateFrom : function ( ) { this . result . from = this . options . from ; this . result . from _percent = this . convertToPercent ( this . result . from ) ; this . options . values && ( this . result . from _value = this . options . values [ this . result . from ] ) } , updateTo : function ( ) { this . result . to = this . options . to ; this . result . to _percent = this . convertToPercent ( this . result . to ) ; this . options . values && ( this . result . to _value = this . options . values [ this . result . to ] ) } ,
updateResult : function ( ) { this . result . min = this . options . min ; this . result . max = this . options . max ; this . updateFrom ( ) ; this . updateTo ( ) } , appendGrid : function ( ) { if ( this . options . grid ) { var a = this . options , b , d ; b = a . max - a . min ; var c = a . grid _num , e = 0 , g = 0 , f = 4 , k , h , m = 0 , n = "" ; this . calcGridMargin ( ) ; a . grid _snap ? ( c = b / a . step , e = this . toFixed ( a . step / ( b / 100 ) ) ) : e = this . toFixed ( 100 / c ) ; 4 < c && ( f = 3 ) ; 7 < c && ( f = 2 ) ; 14 < c && ( f = 1 ) ; 28 < c && ( f = 0 ) ; for ( b = 0 ; b < c + 1 ; b ++ ) { k = f ; g = this . toFixed ( e * b ) ; 100 < g && ( g = 100 , k -= 2 , 0 > k && ( k = 0 ) ) ; this . coords . big [ b ] = g ; h = ( g - e * ( b - 1 ) ) /
( k + 1 ) ; for ( d = 1 ; d <= k && 0 !== g ; d ++ ) m = this . toFixed ( g - h * d ) , n += '<span class="irs-grid-pol small" style="left: ' + m + '%"></span>' ; n += '<span class="irs-grid-pol" style="left: ' + g + '%"></span>' ; m = this . convertToValue ( g ) ; m = a . values . length ? a . p _values [ m ] : this . _prettify ( m ) ; n += '<span class="irs-grid-text js-grid-text-' + b + '" style="left: ' + g + '%">' + m + "</span>" } this . coords . big _num = Math . ceil ( c + 1 ) ; this . $cache . cont . addClass ( "irs-with-grid" ) ; this . $cache . grid . html ( n ) ; this . cacheGridLabels ( ) } } , cacheGridLabels : function ( ) { var a ,
b , d = this . coords . big _num ; for ( b = 0 ; b < d ; b ++ ) a = this . $cache . grid . find ( ".js-grid-text-" + b ) , this . $cache . grid _labels . push ( a ) ; this . calcGridLabels ( ) } , calcGridLabels : function ( ) { var a , b ; b = [ ] ; var d = [ ] , c = this . coords . big _num ; for ( a = 0 ; a < c ; a ++ ) this . coords . big _w [ a ] = this . $cache . grid _labels [ a ] . outerWidth ( ! 1 ) , this . coords . big _p [ a ] = this . toFixed ( this . coords . big _w [ a ] / this . coords . w _rs * 100 ) , this . coords . big _x [ a ] = this . toFixed ( this . coords . big _p [ a ] / 2 ) , b [ a ] = this . toFixed ( this . coords . big [ a ] - this . coords . big _x [ a ] ) , d [ a ] = this . toFixed ( b [ a ] +
this . coords . big _p [ a ] ) ; this . options . force _edges && ( b [ 0 ] < - this . coords . grid _gap && ( b [ 0 ] = - this . coords . grid _gap , d [ 0 ] = this . toFixed ( b [ 0 ] + this . coords . big _p [ 0 ] ) , this . coords . big _x [ 0 ] = this . coords . grid _gap ) , d [ c - 1 ] > 100 + this . coords . grid _gap && ( d [ c - 1 ] = 100 + this . coords . grid _gap , b [ c - 1 ] = this . toFixed ( d [ c - 1 ] - this . coords . big _p [ c - 1 ] ) , this . coords . big _x [ c - 1 ] = this . toFixed ( this . coords . big _p [ c - 1 ] - this . coords . grid _gap ) ) ) ; this . calcGridCollision ( 2 , b , d ) ; this . calcGridCollision ( 4 , b , d ) ; for ( a = 0 ; a < c ; a ++ ) b = this . $cache . grid _labels [ a ] [ 0 ] ,
b . style . marginLeft = - this . coords . big _x [ a ] + "%" } , calcGridCollision : function ( a , b , d ) { var c , e , g , f = this . coords . big _num ; for ( c = 0 ; c < f ; c += a ) { e = c + a / 2 ; if ( e >= f ) break ; g = this . $cache . grid _labels [ e ] [ 0 ] ; g . style . visibility = d [ c ] <= b [ e ] ? "visible" : "hidden" } } , calcGridMargin : function ( ) { this . options . grid _margin && ( this . coords . w _rs = this . $cache . rs . outerWidth ( ! 1 ) , this . coords . w _rs && ( this . coords . w _handle = "single" === this . options . type ? this . $cache . s _single . outerWidth ( ! 1 ) : this . $cache . s _from . outerWidth ( ! 1 ) , this . coords . p _handle = this . toFixed ( this . coords . w _handle /
this . coords . w _rs * 100 ) , this . coords . grid _gap = this . toFixed ( this . coords . p _handle / 2 - . 1 ) , this . $cache . grid [ 0 ] . style . width = this . toFixed ( 100 - this . coords . p _handle ) + "%" , this . $cache . grid [ 0 ] . style . left = this . coords . grid _gap + "%" ) ) } , update : function ( a ) { this . input && ( this . is _update = ! 0 , this . options . from = this . result . from , this . options . to = this . result . to , this . options = f . extend ( this . options , a ) , this . validate ( ) , this . updateResult ( a ) , this . toggleInput ( ) , this . remove ( ) , this . init ( ! 0 ) ) } , reset : function ( ) { this . input && ( this . updateResult ( ) ,
this . update ( ) ) } , destroy : function ( ) { this . input && ( this . toggleInput ( ) , this . $cache . input . prop ( "readonly" , ! 1 ) , f . data ( this . input , "ionRangeSlider" , null ) , this . remove ( ) , this . options = this . input = null ) } } ; f . fn . ionRangeSlider = function ( a ) { return this . each ( function ( ) { f . data ( this , "ionRangeSlider" ) || f . data ( this , "ionRangeSlider" , new q ( this , a , u ++ ) ) } ) } ; ( function ( ) { for ( var a = 0 , b = [ "ms" , "moz" , "webkit" , "o" ] , d = 0 ; d < b . length && ! h . requestAnimationFrame ; ++ d ) h . requestAnimationFrame = h [ b [ d ] + "RequestAnimationFrame" ] , h . cancelAnimationFrame =
h [ b [ d ] + "CancelAnimationFrame" ] || h [ b [ d ] + "CancelRequestAnimationFrame" ] ; h . requestAnimationFrame || ( h . requestAnimationFrame = function ( b , d ) { var g = ( new Date ) . getTime ( ) , f = Math . max ( 0 , 16 - ( g - a ) ) , k = h . setTimeout ( function ( ) { b ( g + f ) } , f ) ; a = g + f ; return k } ) ; h . cancelAnimationFrame || ( h . cancelAnimationFrame = function ( a ) { clearTimeout ( a ) } ) } ) ( ) } ) ( jQuery , document , window , navigator ) ;