';
html += '
';
diff --git a/src/public/js/modules/helpers.js b/src/public/js/modules/helpers.js
index 329c7397c..00c4a3df4 100644
--- a/src/public/js/modules/helpers.js
+++ b/src/public/js/modules/helpers.js
@@ -15,7 +15,7 @@
"use strict";
define(['jquery', 'underscore', 'moment', 'uikit', 'countup', 'waves', 'selectize','snackbar', 'async', 'nicescroll', 'easypiechart', 'chosen', 'velocity', 'formvalidator'],
-function($, _, moment, UIkit, CountUp, Waves, Selectize, SnackBar) {
+function($, _, moment, UIkit, CountUp, Waves, Selectize, Snackbar) {
var helpers = {};
@@ -29,6 +29,7 @@ function($, _, moment, UIkit, CountUp, Waves, Selectize, SnackBar) {
self.setupScrollers();
self.setupScrollers('.scrollable-dark');
self.setupScrollers('.wrapper');
+ self.setupScrollers('.uk-modal');
self.formvalidator();
self.pToolTip();
self.setupDonutchart();
@@ -119,7 +120,7 @@ function($, _, moment, UIkit, CountUp, Waves, Selectize, SnackBar) {
};
helpers.UI.showSnackbar_ = function(options) {
- SnackBar.show(options);
+ Snackbar.show(options);
};
helpers.UI.showSnackbar__ = function(text, error) {
@@ -130,14 +131,14 @@ function($, _, moment, UIkit, CountUp, Waves, Selectize, SnackBar) {
if (error)
actionText = '#FF4835';
- SnackBar.show({
+ Snackbar.show({
text: text,
actionTextColor: actionText
});
};
helpers.UI.closeSnackbar = function() {
- SnackBar.close();
+ Snackbar.close();
};
helpers.UI.inputs = function(parent) {
@@ -263,7 +264,8 @@ function($, _, moment, UIkit, CountUp, Waves, Selectize, SnackBar) {
// selectize plugins
if(typeof $.fn.selectize != 'undefined') {
Selectize.define('dropdown_after', function (options) {
- this.positionDropdown = (function () {
+ var self = this;
+ self.positionDropdown = (function () {
var $control = this.$control,
position = $control.position(),
position_left = position.left,
@@ -570,8 +572,7 @@ function($, _, moment, UIkit, CountUp, Waves, Selectize, SnackBar) {
self.hideDropDownScrolls();
self.resizeDataTables('.ticketList');
- self.resizeDataTables('.groupsList');
- self.resizeDataTables('.accountList');
+ self.resizeDataTables('.tagsList');
self.resizeScroller();
}, 100);
@@ -584,7 +585,7 @@ function($, _, moment, UIkit, CountUp, Waves, Selectize, SnackBar) {
var color = "#a9b1bf";
var colorBrd = "1px solid #fff";
- if (selector == '.scrollable-dark') {
+ if (selector == '.scrollable-dark' || selector == '.uk-modal') {
color = '#353e47';
colorBrd = "1px solid #000";
}
@@ -636,8 +637,7 @@ function($, _, moment, UIkit, CountUp, Waves, Selectize, SnackBar) {
self.hideDropDownScrolls();
self.resizeDataTables('.ticketList');
- self.resizeDataTables('.groupsList');
- self.resizeDataTables('.accountList');
+ self.resizeDataTables('.tagsList');
self.resizeScroller();
}, 100);
diff --git a/src/public/js/modules/navigation.js b/src/public/js/modules/navigation.js
index 51114a609..d409cf8ef 100644
--- a/src/public/js/modules/navigation.js
+++ b/src/public/js/modules/navigation.js
@@ -110,6 +110,12 @@ define(['jquery', 'modules/helpers', 'underscore', 'modules/socket'], function($
left += Number(leftExtraOffset);
left = left + 'px';
+ var hasNotice = false;
+ var $noticeFrame = $('.wrapper').find('#notice-banner');
+ if ($noticeFrame.length > 0) {
+ hasNotice = $noticeFrame.hasClass('uk-hidden') == false;
+ }
+
var topOffset = $(this).offset().top - $(window).scrollTop() - pageOffsetTop;
var top = $(this).outerHeight() + topOffset;
var topExtraOffset = $(drop).attr('data-top-offset');
@@ -117,6 +123,10 @@ define(['jquery', 'modules/helpers', 'underscore', 'modules/socket'], function($
topExtraOffset = 0;
}
top += Number(topExtraOffset);
+
+ if (hasNotice)
+ top += 30;
+
top = top + 'px';
var override = $(drop).attr('data-override');
diff --git a/src/public/js/modules/socket.io/logs.io.js b/src/public/js/modules/socket.io/logs.io.js
new file mode 100644
index 000000000..960f6e91d
--- /dev/null
+++ b/src/public/js/modules/socket.io/logs.io.js
@@ -0,0 +1,37 @@
+/**
+ . .o8 oooo
+ . o8 "888 `888
+.o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
+ 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
+ 888 888 888 888 888 888 888ooo888 `"Y88b. 888888.
+ 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b.
+ "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o
+ ========================================================================
+ Created: 07/22/2016
+ Author: Chris Brame
+
+ **/
+
+define('modules/socket.io/logs.io', [
+ 'jquery',
+ 'underscore',
+ 'moment',
+ 'modules/helpers',
+ 'history'
+
+], function($, _, moment, helpers) {
+ var logsIO = {};
+
+ logsIO.getLogData = function(socket) {
+ socket.on('logs:data', function(data) {
+ var $sLogs = $('#serverlogs');
+ if ($sLogs.length > 0) {
+ $sLogs.append(data);
+ $sLogs.scrollTop(99999999999999 * 999999999999999);
+ helpers.scrollToBottom($sLogs);
+ }
+ });
+ };
+
+ return logsIO;
+});
diff --git a/src/public/js/modules/socket.js b/src/public/js/modules/socket.js
index 2a6f956ef..48b0b8688 100644
--- a/src/public/js/modules/socket.js
+++ b/src/public/js/modules/socket.js
@@ -17,9 +17,16 @@ define('modules/socket', [
'modules/ui'
], function(chat, ui) {
- var sClient = {};
+ var socket = io.connect();
+ var sClient = {
+ socket: socket
+ };
+
+ ui.init(socket);
sClient.ui = ui;
- ui.init();
+
+ chat.init(socket);
+ sClient.chat = chat;
return sClient;
});
\ No newline at end of file
diff --git a/src/public/js/modules/ui.js b/src/public/js/modules/ui.js
index 420884ba0..08f4854ef 100644
--- a/src/public/js/modules/ui.js
+++ b/src/public/js/modules/ui.js
@@ -20,16 +20,17 @@ define('modules/ui', [
'modules/socket.io/messagesUI',
'modules/socket.io/noticeUI',
'modules/socket.io/ticketsUI',
+ 'modules/socket.io/logs.io',
'nicescroll',
'history'
-], function($, _, helpers, nav, msgUI, noticeUI, ticketsUI) {
+], function($, _, helpers, nav, msgUI, noticeUI, ticketsUI, logsIO) {
var socketUi = {},
- socket = io.connect();
+ socket;
- socketUi.socket = socket;
+ socketUi.init = function(sock) {
+ socketUi.socket = (socket = sock);
- socketUi.init = function() {
this.onReconnect();
this.onDisconnect();
this.updateUsers();
@@ -51,12 +52,16 @@ define('modules/ui', [
this.onTicketCreated();
this.onTicketDelete();
this.onUpdateTicketGrid();
+ this.onProfileImageUpdate();
this.updateMessagesFolder(socket);
this.updateSingleMessageItem(socket);
this.updateShowNotice(socket);
this.updateClearNotice(socket);
this.updateSubscribe(socket);
+
+ //Logs
+ this.updateServerLogs(socket);
};
socketUi.setMessageRead = function(messageId) {
@@ -91,10 +96,14 @@ define('modules/ui', [
socketUi.updateSubscribe = ticketsUI.updateSubscribe;
+ socketUi.updateServerLogs = logsIO.getLogData;
+ socketUi.fetchServerLogs = function() {
+ socket.emit('logs:fetch');
+ };
+
socketUi.onReconnect = function() {
socket.removeAllListeners('reconnect');
socket.on('reconnect', function() {
- //helpers.clearFlash();
helpers.UI.hideDisconnectedOverlay();
});
};
@@ -833,5 +842,15 @@ define('modules/ui', [
});
};
+ socketUi.onProfileImageUpdate = function() {
+ socket.removeAllListeners('trudesk:profileImageUpdate');
+ socket.on('trudesk:profileImageUpdate', function(data) {
+ var profileImage = $('#profileImage[data-userid="' + data.userid + '"]');
+ if (profileImage.length > 0) {
+ profileImage.attr('src', '/uploads/users/' + data.img + '?r=' + new Date().getTime());
+ }
+ });
+ };
+
return socketUi;
});
\ No newline at end of file
diff --git a/src/public/js/pages/accounts.js b/src/public/js/pages/accounts.js
index 9b1abd956..9f34a7f77 100644
--- a/src/public/js/pages/accounts.js
+++ b/src/public/js/pages/accounts.js
@@ -196,8 +196,8 @@ define('pages/accounts', [
html += '
';
html += '
';
diff --git a/src/public/js/pages/dashboard.js b/src/public/js/pages/dashboard.js
index 61e5246f8..310ac9eb8 100644
--- a/src/public/js/pages/dashboard.js
+++ b/src/public/js/pages/dashboard.js
@@ -55,56 +55,168 @@ define('pages/dashboard', [
function getData(timespan) {
$.ajax({
- url: '/api/v1/tickets/stats/' + timespan,
- method: 'GET',
- success: function (_data) {
- parms.data = MG.convert.date(_data.data, 'date');
- MG.data_graphic(parms);
-
- var tCount = _(_data.data).reduce(function (m, x) {
- return m + x.value;
- }, 0);
- var ticketCount = $('#ticketCount');
- var oldTicketCount = ticketCount.text() == '--' ? 0 : ticketCount.text();
- var totalTicketText = 'Total Tickets (last ' + timespan + 'd)';
- if (timespan == 0)
- totalTicketText = 'Total Tickets (lifetime)';
- ticketCount.parents('.tru-card-content').find('span.uk-text-small').text(totalTicketText);
- var theAnimation = new CountUp('ticketCount', oldTicketCount, tCount, 0, 1.5);
- theAnimation.start();
-
- var closedCount = Number(_data.closedCount);
- var closedPercent = Math.round((closedCount / tCount) * 100);
-
- var textComplete = $('#text_complete');
- var oldTextComplete = textComplete.text() == '--' ? 0 : textComplete.text();
- var completeAnimation = new CountUp('text_complete', oldTextComplete, closedPercent, 0, 1.5);
- completeAnimation.start();
-
- var pieComplete = $('#pie_complete');
- pieComplete.text(closedPercent + '/100');
- pieComplete.peity("donut", {
- height: 24,
- width: 24,
- fill: ["#29b955", "#ccc"]
- });
-
- var responseTime_text = $('#responseTime_text');
- var responseTime_graph = $('#responseTime_graph');
- var oldResponseTime = responseTime_text.text() == '--' ? 0 : responseTime_text.text();
- var responseTime = _data.ticketAvg;
- var responseTime_animation = new CountUp('responseTime_text', oldResponseTime, responseTime, 0, 1.5);
- responseTime_animation.start();
-
-
- var lastUpdated = $('#lastUpdated').find('span');
- lastUpdated.text(_data.lastUpdated);
- },
- error: function(err) {
- console.log('[trudesk:dashboard:getData] Error - ' + err.responseText);
- helpers.UI.showSnackbar(err.responseText, true);
- }
- });
+ url: '/api/v1/tickets/stats/' + timespan,
+ method: 'GET',
+ success: function (_data) {
+ var lastUpdated = $('#lastUpdated').find('span');
+ lastUpdated.text(_data.lastUpdated);
+ if (!_data.data)
+ return true;
+
+ parms.data = MG.convert.date(_data.data, 'date');
+ MG.data_graphic(parms);
+
+ var tCount = _(_data.data).reduce(function (m, x) {
+ return m + x.value;
+ }, 0);
+ var ticketCount = $('#ticketCount');
+ var oldTicketCount = ticketCount.text() == '--' ? 0 : ticketCount.text();
+ var totalTicketText = 'Total Tickets (last ' + timespan + 'd)';
+ if (timespan == 0)
+ totalTicketText = 'Total Tickets (lifetime)';
+ ticketCount.parents('.tru-card-content').find('span.uk-text-small').text(totalTicketText);
+ var theAnimation = new CountUp('ticketCount', oldTicketCount, tCount, 0, 1.5);
+ theAnimation.start();
+
+ var closedCount = Number(_data.closedCount);
+ var closedPercent = Math.round((closedCount / tCount) * 100);
+
+ var textComplete = $('#text_complete');
+ var oldTextComplete = textComplete.text() == '--' ? 0 : textComplete.text();
+ var completeAnimation = new CountUp('text_complete', oldTextComplete, closedPercent, 0, 1.5);
+ completeAnimation.start();
+
+ var pieComplete = $('#pie_complete');
+ pieComplete.text(closedPercent + '/100');
+ pieComplete.peity("donut", {
+ height: 24,
+ width: 24,
+ fill: ["#29b955", "#ccc"]
+ });
+
+ var responseTime_text = $('#responseTime_text');
+ var responseTime_graph = $('#responseTime_graph');
+ var oldResponseTime = responseTime_text.text() == '--' ? 0 : responseTime_text.text();
+ var responseTime = _data.ticketAvg;
+ var responseTime_animation = new CountUp('responseTime_text', oldResponseTime, responseTime, 0, 1.5);
+ responseTime_animation.start();
+ },
+ error: function(err) {
+ console.log('[trudesk:dashboard:getData] Error - ' + err.responseText);
+ helpers.UI.showSnackbar(err.responseText, true);
+ }
+ });
+
+ $.ajax({
+ url: '/api/v1/tickets/count/tags/' + timespan,
+ method: 'GET',
+ success: function(data) {
+ var arr = _.map(data.tags, function(v, key) {
+ return [key, v];
+ });
+
+ arr = _.first(arr, 10);
+
+ var colors = [
+ '#e74c3c',
+ '#3498db',
+ '#9b59b6',
+ '#34495e',
+ '#1abc9c',
+ '#2ecc71',
+ '#03A9F4',
+ '#00BCD4',
+ '#009688',
+ '#4CAF50',
+ '#FF5722',
+ '#CDDC39',
+ '#FFC107',
+ '#00E5FF',
+ '#E040FB',
+ '#607D8B'
+ ];
+
+ var c = _.object(_.map(arr, function(v,i) {
+ return v[0];
+ }), _.shuffle(colors));
+
+ c3.generate({
+ bindto: d3.select('#topTenTags'),
+ size: {
+ height: 200
+ },
+ data: {
+ columns: arr,
+ type: 'donut',
+ colors: c
+ },
+ donut: {
+ label: {
+ format: function (value, ratio, id) {
+ return '';
+ }
+ }
+ }
+ });
+ }
+ });
+
+
+
+ $.ajax({
+ url: '/api/v1/tickets/count/topgroups/' + timespan + '/5',
+ method: 'GET',
+ success: function(data) {
+
+ var arr = _.map(data.items, function(v, key) {
+ return [v.name, v.count];
+ });
+
+ var colors = [
+ '#e74c3c',
+ '#3498db',
+ '#9b59b6',
+ '#34495e',
+ '#1abc9c',
+ '#2ecc71',
+ '#03A9F4',
+ '#00BCD4',
+ '#009688',
+ '#4CAF50',
+ '#FF5722',
+ '#CDDC39',
+ '#FFC107',
+ '#00E5FF',
+ '#E040FB',
+ '#607D8B'
+ ];
+
+ colors = _.shuffle(colors);
+
+ var c = _.object(_.map(arr, function(v,i) {
+ return v[0];
+ }), colors);
+
+ c3.generate({
+ bindto: d3.select('#pieChart'),
+ size: {
+ height: 200
+ },
+ data: {
+ columns: arr,
+ type: 'pie',
+ colors: c
+ },
+ donut: {
+ label: {
+ format: function (value, ratio, id) {
+ return '';
+ }
+ }
+ }
+ });
+ }
+ });
}
});
};
diff --git a/src/public/js/pages/logs.js b/src/public/js/pages/logs.js
new file mode 100644
index 000000000..339bbf871
--- /dev/null
+++ b/src/public/js/pages/logs.js
@@ -0,0 +1,36 @@
+/**
+ . .o8 oooo
+ .o8 "888 `888
+ .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
+ 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
+ 888 888 888 888 888 888 888ooo888 `"Y88b. 888888.
+ 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b.
+ "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o
+ ========================================================================
+ Created: 02/10/2015
+ Author: Chris Brame
+
+ **/
+
+define('pages/logs', [
+ 'jquery',
+ 'modules/socket',
+ 'modules/helpers',
+ 'history'
+
+], function($, socket, helpers) {
+ var logsPage = {};
+
+ logsPage.init = function() {
+ $(document).ready(function() {
+ socket.ui.fetchServerLogs();
+ var $sLogs = $('#serverlogs');
+ if ($sLogs.length > 0)
+ $sLogs.scrollTop(99999999999999 * 999999999999999);
+ //helpers.setupScrollers('#serverlogs');
+ //helpers.scrollToBottom($('#serverlogs'));
+ });
+ };
+
+ return logsPage;
+});
\ No newline at end of file
diff --git a/src/public/js/pages/messages.js b/src/public/js/pages/messages.js
index 0a7d25625..fb7157bd8 100644
--- a/src/public/js/pages/messages.js
+++ b/src/public/js/pages/messages.js
@@ -15,10 +15,11 @@
define('pages/messages', [
'jquery',
'modules/helpers',
- 'modules/ui',
+ 'modules/socket',
'history'
-], function($, helpers, ui) {
+], function($, helpers, socketClient) {
+ var ui = socketClient.ui;
var messagesPage = {};
var refreshInterval = null;
diff --git a/src/public/js/pages/reports.js b/src/public/js/pages/reports.js
index 1d49658e0..060d49754 100644
--- a/src/public/js/pages/reports.js
+++ b/src/public/js/pages/reports.js
@@ -58,6 +58,11 @@ define('pages/reports', [
url: '/api/v1/tickets/stats/' + timespan,
method: 'GET',
success: function(_data) {
+ var lastUpdated = $('#lastUpdated').find('span');
+ lastUpdated.text(_data.lastUpdated);
+ if (!_data.data)
+ return true;
+
parms.data = MG.convert.date(_data.data, 'date');
MG.data_graphic(parms);
@@ -94,10 +99,6 @@ define('pages/reports', [
var responseTime_animation = new CountUp('responseTime_text', oldResponseTime, responseTime, 0, 1.5);
responseTime_animation.start();
-
- var lastUpdated = $('#lastUpdated').find('span');
- lastUpdated.text(_data.lastUpdated);
-
//QuickStats
var mostRequester = $('#mostRequester');
mostRequester.text(_data.mostRequester.name + ' (' + _data.mostRequester.value + ')');
@@ -107,7 +108,6 @@ define('pages/reports', [
mostAssignee.text(_data.mostAssignee.name + ' (' + _data.mostAssignee.value + ')');
var mostActiveTicket = $('#mostActiveTicket');
mostActiveTicket.attr('href', '/tickets/' + _data.mostActiveTicket.uid).text('T#' + _data.mostActiveTicket.uid);
-
}
})
.error(function(err) {
diff --git a/src/public/js/pages/reportsBreakdown.js b/src/public/js/pages/reportsBreakdown.js
index d6d9b0661..b5e0af0cd 100644
--- a/src/public/js/pages/reportsBreakdown.js
+++ b/src/public/js/pages/reportsBreakdown.js
@@ -57,6 +57,9 @@ define('pages/reportsBreakdown', [
url: '/api/v1/tickets/stats/group/' + group,
method: 'GET',
success: function(_data) {
+ if (!_data.data.graphData)
+ return;
+
parms.data = MG.convert.date(_data.data.graphData, 'date');
MG.data_graphic(parms);
@@ -171,137 +174,8 @@ define('pages/reportsBreakdown', [
.error(function(err) {
//console.log(err);
console.log('[trudesk:dashboard:getData] Error - ' + err.responseText);
- helpers.UI.showSnackbar(err.responseText, true);
+ helpers.UI.showSnackbar(JSON.parse(err.responseText).error, true);
});
-
-
- //$.ajax({
- // url: '/api/v1/tickets/count/tags',
- // method: 'GET',
- // success: function(data) {
- // var arr = _.map(data.tags, function(v, key) {
- // return [key, v];
- // });
- //
- // arr = _.first(arr, 10);
- //
- // var colors = [
- // '#e53935',
- // '#d81b60',
- // '#8e24aa',
- // '#1e88e5',
- // '#00897b',
- // '#43a047',
- // '#00acc1',
- // '#e65100',
- // '#6d4c41',
- // '#455a64'
- // ];
- //
- // var c = _.object(_.map(arr, function(v,i) {
- // return v[0];
- // }), colors);
- //
- // c3.generate({
- // bindto: d3.select('#topTenTags'),
- // size: {
- // height: 200
- // },
- // data: {
- // columns: arr,
- // type: 'donut',
- // colors: c
- // },
- // donut: {
- // label: {
- // format: function (value, ratio, id) {
- // return '';
- // }
- // }
- // }
- // });
- // }
- //});
- //
- //
- //
- //$.ajax({
- // url: '/api/v1/tickets/count/topgroups/5',
- // method: 'GET',
- // success: function(data) {
- //
- // var d = {
- // content: []
- // };
- //
- // var colors = [
- // '#e53935',
- // '#d81b60',
- // '#8e24aa',
- // '#1e88e5',
- // '#00897b',
- // '#43a047'
- // ];
- //
- // _.each(data.items, function(item) {
- // var obj = {};
- // obj.label = item.name;
- // obj.value = item.count;
- // var color = _.sample(colors);
- // colors = _.without(colors, color);
- //
- // obj.color = color;
- //
- // d.content.push(obj);
- // });
- //
- // $('#pieChart').find('svg').remove();
- //
- // new d3pie("pieChart", {
- // "size": {
- // "canvasHeight": 215,
- // "canvasWidth": 450,
- // "pieInnerRadius": "60%",
- // "pieOuterRadius": "68%"
- // },
- // "data": d,
- // "labels": {
- // "outer": {
- // "pieDistance": 15
- // },
- // "inner": {
- // "format": "value"
- // },
- // "mainLabel": {
- // "font": "roboto"
- // },
- // "percentage": {
- // "color": "#ffffff",
- // "font": "roboto",
- // "decimalPlaces": 0
- // },
- // "value": {
- // "color": "#ffffff",
- // "font": "roboto"
- // },
- // "lines": {
- // "enabled": true,
- // "color": "#78909c"
- // },
- // "truncation": {
- // "enabled": true
- // }
- // },
- // "effects": {
- // "pullOutSegmentOnClick": {
- // "effect": "linear",
- // "speed": 400,
- // "size": 3
- // }
- // }
- // });
- // }
- //});
}
});
};
diff --git a/src/public/js/pages/settings.js b/src/public/js/pages/settings.js
new file mode 100644
index 000000000..4ac34edd7
--- /dev/null
+++ b/src/public/js/pages/settings.js
@@ -0,0 +1,31 @@
+/**
+ . .o8 oooo
+ .o8 "888 `888
+ .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
+ 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
+ 888 888 888 888 888 888 888ooo888 `"Y88b. 888888.
+ 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b.
+ "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o
+ ========================================================================
+ Created: 04/07/2016
+ Author: Chris Brame
+
+ **/
+
+define('pages/settings', [
+ 'jquery',
+ 'underscore',
+ 'modules/helpers',
+ 'history'
+
+], function($, _, helpers) {
+ var settingsPage = {};
+
+ settingsPage.init = function() {
+ $(document).ready(function() {
+
+ });
+ };
+
+ return settingsPage;
+});
\ No newline at end of file
diff --git a/src/public/js/pages/singleTicket.js b/src/public/js/pages/singleTicket.js
index 6ec92afb6..e2ebe063b 100644
--- a/src/public/js/pages/singleTicket.js
+++ b/src/public/js/pages/singleTicket.js
@@ -15,10 +15,10 @@
define('pages/singleTicket', [
'jquery',
'underscore',
- 'modules/ui',
+ 'modules/socket',
'tomarkdown',
'modules/helpers'
-], function($, _, ui, md, helpers) {
+], function($, _, socketClient, md, helpers) {
var st = {};
st.init = function() {
$(document).ready(function() {
@@ -66,7 +66,7 @@ define('pages/singleTicket', [
var commentId = $($event.currentTarget).attr('data-commentId');
comment = '
' + comment + '
';
- ui.setCommentText(id, commentId, comment);
+ socketClient.ui.setCommentText(id, commentId, comment);
}
});
});
@@ -101,7 +101,7 @@ define('pages/singleTicket', [
url: '/api/v1/tickets/' + ticketId + '/attachments/remove/' + attachmentId,
type: 'DELETE',
success: function(res) {
- ui.refreshTicketAttachments(ticketId);
+ socketClient.ui.refreshTicketAttachments(ticketId);
},
error: function(err) {
var res = err.responseJSON;
@@ -121,7 +121,7 @@ define('pages/singleTicket', [
var ticketId = $('#__ticketId').html();
var commentId = self.attr('data-commentId');
if (commentId.length > 0 && ticketId.length > 0) {
- ui.removeComment(ticketId, commentId);
+ socketClient.ui.removeComment(ticketId, commentId);
}
}
diff --git a/src/public/js/pages/tags.js b/src/public/js/pages/tags.js
new file mode 100644
index 000000000..5e7461a59
--- /dev/null
+++ b/src/public/js/pages/tags.js
@@ -0,0 +1,55 @@
+/**
+ . .o8 oooo
+ .o8 "888 `888
+ .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
+ 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
+ 888 888 888 888 888 888 888ooo888 `"Y88b. 888888.
+ 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b.
+ "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o
+ ========================================================================
+ Created: 07/24/2016
+ Author: Chris Brame
+
+ **/
+
+define('pages/tags', [
+ 'jquery',
+ 'modules/helpers',
+ 'datatables',
+ 'dt_responsive',
+ 'dt_grouping',
+ 'dt_scroller',
+ 'history'
+
+], function($, helpers) {
+ var tagsPage = {};
+
+ tagsPage.init = function() {
+ $(document).ready(function() {
+ helpers.init();
+ var table = $('#tagsTable');
+ table.dataTable({
+ searching: false,
+ bLengthChange: false,
+ bPaginate: false,
+ bInfo: false,
+ bSort: false,
+ scrollY: '100%',
+ order: [[1, 'desc']],
+ columnDefs: [
+ {"width": "50px", "targets": 0},
+ {"width": "85%", "targets": 1},
+ {"width": "15%", "targets": 2}
+ ],
+ "oLanguage": {
+ "sEmptyTable": "No tags to display."
+ }
+ });
+
+ helpers.resizeDataTables('.tagsList');
+ helpers.resizeScroller();
+ });
+ };
+
+ return tagsPage;
+});
\ No newline at end of file
diff --git a/src/public/js/plugins/snackbar.js b/src/public/js/plugins/snackbar.js
index f9f57fd31..b12f7b6ab 100644
--- a/src/public/js/plugins/snackbar.js
+++ b/src/public/js/plugins/snackbar.js
@@ -1,35 +1,29 @@
/*!
- * SnackBar v0.1.0
+ * Snackbar v0.1.3
* http://polonel.com/Snackbar
*
* Copyright 2016 Chris Brame and other contributors
* Released under the MIT license
- * https://github.com/polonel/SnackBar/blob/master/LICENSE
+ * https://github.com/polonel/Snackbar/blob/master/LICENSE
*/
-(function (window, factory) {
+(function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
- define([], function () {
- return factory.apply(window);
+ define([], function() {
+ return (root.Snackbar = factory());
});
+ } else if(typeof module === 'object' && module.exports) {
+ module.exports = (root.Snackbar = factory());
+ } else {
+ root.Snackbar = factory();
}
- // Node.JS
- else if (typeof exports === 'object') {
- module.exports = factory.call(window);
- }
+}(this, function() {
+ var Snackbar = {};
- // Browser
- else {
- window.SnackBar = factory.call(window);
- }
-})(typeof global === 'object' ? global : this, function () {
- 'use strict';
-
- var SnackBar = SnackBar || {};
- SnackBar.current = null;
+ Snackbar.current = null;
var $defaults = {
text: 'Default Text',
@@ -37,7 +31,7 @@
width: 'auto',
- showActionButton: true,
+ showAction: true,
actionText: 'Dismiss',
actionTextColor: '#4caf50',
@@ -54,21 +48,21 @@
}
};
- SnackBar.show = function ($options) {
+ Snackbar.show = function ($options) {
var options = Extend(true, $defaults, $options);
- if (SnackBar.current) {
- SnackBar.current.style.opacity = 0;
+ if (Snackbar.current) {
+ Snackbar.current.style.opacity = 0;
setTimeout(function () {
var $parent = this.parentElement;
- if ($parent) // possible null if too many/fast SnackBars
+ if ($parent) // possible null if too many/fast Snackbars
$parent.removeChild(this);
- }.bind(SnackBar.current), 500);
+ }.bind(Snackbar.current), 500);
}
- SnackBar.snackbar = document.createElement('div');
- SnackBar.snackbar.className = 'snackbar-container ' + options.customClass;
- SnackBar.snackbar.style.width = options.width;
+ Snackbar.snackbar = document.createElement('div');
+ Snackbar.snackbar.className = 'snackbar-container ' + options.customClass;
+ Snackbar.snackbar.style.width = options.width;
var $p = document.createElement('p');
$p.style.margin = 0;
$p.style.padding = 0;
@@ -77,61 +71,62 @@
$p.style.fontWeight = 300;
$p.style.lineHeight = '1em';
$p.innerHTML = options.text;
- SnackBar.snackbar.appendChild($p);
- SnackBar.snackbar.style.background = options.backgroundColor;
- if (options.showActionButton) {
+ Snackbar.snackbar.appendChild($p);
+ Snackbar.snackbar.style.background = options.backgroundColor;
+ if (options.showAction) {
var actionButton = document.createElement('button');
actionButton.className = 'action';
actionButton.innerHTML = options.actionText;
actionButton.style.color = options.actionTextColor;
actionButton.addEventListener('click', function () {
- options.onActionClick(SnackBar.snackbar);
+ options.onActionClick(Snackbar.snackbar);
});
- SnackBar.snackbar.appendChild(actionButton);
+ Snackbar.snackbar.appendChild(actionButton);
}
setTimeout(function () {
- if (SnackBar.current === this) {
- SnackBar.current.style.opacity = 0;
+ if (Snackbar.current === this) {
+ Snackbar.current.style.opacity = 0;
}
- }.bind(SnackBar.snackbar), $defaults.duration);
+ }.bind(Snackbar.snackbar), options.duration);
- SnackBar.snackbar.addEventListener('transitionend', function (event, elapsed) {
- if (event.propertyName === 'opacity' && this.style.opacity === 0) {
+ Snackbar.snackbar.addEventListener('transitionend', function (event, elapsed) {
+ if (event.propertyName == 'opacity' && this.style.opacity == '0') {
this.parentElement.removeChild(this);
- if (SnackBar.current === this) {
- SnackBar.current = null;
+
+ if (Snackbar.current === this) {
+ Snackbar.current = null;
}
}
- }.bind(SnackBar.snackbar));
+ }.bind(Snackbar.snackbar));
- SnackBar.current = SnackBar.snackbar;
+ Snackbar.current = Snackbar.snackbar;
document.body.style.overflow = 'hidden';
- if (options.pos === 'top-left' || options.pos === 'top-center' || options.pos === 'top-right')
- SnackBar.snackbar.style.top = '-100px';
+ if (options.pos === 'top-left' || options.pos === 'top-center' || options.pos === 'top' || options.pos === 'top-right')
+ Snackbar.snackbar.style.top = '-100px';
- document.body.appendChild(SnackBar.snackbar);
- var $bottom = getComputedStyle(SnackBar.snackbar).bottom;
- var $top = getComputedStyle(SnackBar.snackbar).top;
- SnackBar.snackbar.style.opacity = 1;
- SnackBar.snackbar.className = 'snackbar-container ' + options.customClass + ' snackbar-pos ' + options.pos;
+ document.body.appendChild(Snackbar.snackbar);
+ var $bottom = getComputedStyle(Snackbar.snackbar).bottom;
+ var $top = getComputedStyle(Snackbar.snackbar).top;
+ Snackbar.snackbar.style.opacity = 1;
+ Snackbar.snackbar.className = 'snackbar-container ' + options.customClass + ' snackbar-pos ' + options.pos;
if (options.pos === 'top-left' || options.pos === 'top-right')
- SnackBar.snackbar.style.top = 0;
- else if (options.pos === 'top-center')
- SnackBar.snackbar.style.top = '25px';
- else if (options.pos === 'bottom-center')
- SnackBar.snackbar.style.bottom = '-25px';
+ Snackbar.snackbar.style.top = 0;
+ else if (options.pos === 'top-center' || options.pos === 'top')
+ Snackbar.snackbar.style.top = '25px';
+ else if (options.pos === 'bottom-center' || options.pos === 'bottom')
+ Snackbar.snackbar.style.bottom = '-25px';
setTimeout(function () {
document.body.style.overflow = 'auto';
}, 500);
};
- SnackBar.close = function () {
- if (SnackBar.current)
- SnackBar.current.style.opacity = 0;
+ Snackbar.close = function () {
+ if (Snackbar.current)
+ Snackbar.current.style.opacity = 0;
};
// Pure JS Extend
@@ -169,5 +164,5 @@
};
- return SnackBar;
-});
\ No newline at end of file
+ return Snackbar;
+}));
\ No newline at end of file
diff --git a/src/public/js/vendor/uikit/js/uikit_combined.min.js b/src/public/js/vendor/uikit/js/uikit_combined.min.js
index 0a0f77491..f3e613ef9 100644
--- a/src/public/js/vendor/uikit/js/uikit_combined.min.js
+++ b/src/public/js/vendor/uikit/js/uikit_combined.min.js
@@ -1,8 +1,8 @@
-!function(core){if("function"==typeof define&&define.amd&&define("uikit",function(){var uikit=window.UIkit||core(window,window.jQuery,window.document);return uikit.load=function(res,req,onload,config){var i,resources=res.split(","),load=[],base=(config.config&&config.config.uikit&&config.config.uikit.base?config.config.uikit.base:"").replace(/\/+$/g,"");if(!base)throw new Error("Please define base path to UIkit in the requirejs config.");for(i=0;i
0||global.navigator.pointerEnabled&&global.navigator.maxTouchPoints>0||!1,UI.support.mutationobserver=global.MutationObserver||global.WebKitMutationObserver||null,UI.Utils={},UI.Utils.isFullscreen=function(){return document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.fullscreenElement||!1},UI.Utils.str2json=function(str,notevil){try{return notevil?JSON.parse(str.replace(/([\$\w]+)\s*:/g,function(_,$1){return'"'+$1+'":'}).replace(/'([^']+)'/g,function(_,$1){return'"'+$1+'"'})):new Function("","var json = "+str+"; return JSON.parse(JSON.stringify(json));")()}catch(e){return!1}},UI.Utils.debounce=function(func,wait,immediate){var timeout;return function(){var context=this,args=arguments,later=function(){timeout=null,immediate||func.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&func.apply(context,args)}},UI.Utils.removeCssRules=function(selectorRegEx){var idx,idxs,stylesheet,_i,_j,_k,_len,_len1,_len2,_ref;selectorRegEx&&setTimeout(function(){try{for(_ref=document.styleSheets,_i=0,_len=_ref.length;_len>_i;_i++){for(stylesheet=_ref[_i],idxs=[],stylesheet.cssRules=stylesheet.cssRules,idx=_j=0,_len1=stylesheet.cssRules.length;_len1>_j;idx=++_j)stylesheet.cssRules[idx].type===CSSRule.STYLE_RULE&&selectorRegEx.test(stylesheet.cssRules[idx].selectorText)&&idxs.unshift(idx);for(_k=0,_len2=idxs.length;_len2>_k;_k++)stylesheet.deleteRule(idxs[_k])}}catch(_error){}},0)},UI.Utils.isInView=function(element,options){var $element=$(element);if(!$element.is(":visible"))return!1;var window_left=UI.$win.scrollLeft(),window_top=UI.$win.scrollTop(),offset=$element.offset(),left=offset.left,top=offset.top;return options=$.extend({topoffset:0,leftoffset:0},options),top+$element.height()>=window_top&&top-options.topoffset<=window_top+UI.$win.height()&&left+$element.width()>=window_left&&left-options.leftoffset<=window_left+UI.$win.width()?!0:!1},UI.Utils.checkDisplay=function(context,initanimation){var elements=UI.$("[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]",context||document);return context&&!elements.length&&(elements=$(context)),elements.trigger("display.uk.check"),initanimation&&("string"!=typeof initanimation&&(initanimation='[class*="uk-animation-"]'),elements.find(initanimation).each(function(){var ele=UI.$(this),cls=ele.attr("class"),anim=cls.match(/uk\-animation\-(.+)/);ele.removeClass(anim[0]).width(),ele.addClass(anim[0])})),elements},UI.Utils.options=function(string){if("string"!=$.type(string))return string;-1!=string.indexOf(":")&&"}"!=string.trim().substr(-1)&&(string="{"+string+"}");var start=string?string.indexOf("{"):-1,options={};if(-1!=start)try{options=UI.Utils.str2json(string.substr(start))}catch(e){}return options},UI.Utils.animate=function(element,cls){var d=$.Deferred();return element=UI.$(element),element.css("display","none").addClass(cls).one(UI.support.animation.end,function(){element.removeClass(cls),d.resolve()}),element.css("display",""),d.promise()},UI.Utils.uid=function(prefix){return(prefix||"id")+(new Date).getTime()+"RAND"+Math.ceil(1e5*Math.random())},UI.Utils.template=function(str,data){for(var toc,cmd,prop,fn,tokens=str.replace(/\n/g,"\\n").replace(/\{\{\{\s*(.+?)\s*\}\}\}/g,"{{!$1}}").split(/(\{\{\s*(.+?)\s*\}\})/g),i=0,output=[],openblocks=0;i /g, '>');}"].join("\n")),data?fn(data):fn},UI.Utils.events={},UI.Utils.events.click=UI.support.touch?"tap":"click",global.UIkit=UI,UI.fn=function(command,options){var args=arguments,cmd=command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i),component=cmd[1],method=cmd[2];return UI[component]?this.each(function(){var $this=$(this),data=$this.data(component);data||$this.data(component,data=UI[component](this,method?void 0:options)),method&&data[method].apply(data,Array.prototype.slice.call(args,1))}):($.error("UIkit component ["+component+"] does not exist."),this)},$.UIkit=UI,$.fn.uk=UI.fn,UI.langdirection="rtl"==UI.$html.attr("dir")?"right":"left",UI.components={},UI.component=function(name,def){var fn=function(element,options){var $this=this;return this.UIkit=UI,this.element=element?UI.$(element):null,this.options=$.extend(!0,{},this.defaults,options),this.plugins={},this.element&&this.element.data(name,this),this.init(),(this.options.plugins.length?this.options.plugins:Object.keys(fn.plugins)).forEach(function(plugin){fn.plugins[plugin].init&&(fn.plugins[plugin].init($this),$this.plugins[plugin]=!0)}),this.trigger("init.uk.component",[name,this]),this};return fn.plugins={},$.extend(!0,fn.prototype,{defaults:{plugins:[]},boot:function(){},init:function(){},on:function(a1,a2,a3){return UI.$(this.element||this).on(a1,a2,a3)},one:function(a1,a2,a3){return UI.$(this.element||this).one(a1,a2,a3)},off:function(evt){return UI.$(this.element||this).off(evt)},trigger:function(evt,params){return UI.$(this.element||this).trigger(evt,params)},find:function(selector){return UI.$(this.element?this.element:[]).find(selector)},proxy:function(obj,methods){var $this=this;methods.split(" ").forEach(function(method){$this[method]||($this[method]=function(){return obj[method].apply(obj,arguments)})})},mixin:function(obj,methods){var $this=this;methods.split(" ").forEach(function(method){$this[method]||($this[method]=obj[method].bind($this))})},option:function(){return 1==arguments.length?this.options[arguments[0]]||void 0:void(2==arguments.length&&(this.options[arguments[0]]=arguments[1]))}},def),this.components[name]=fn,this[name]=function(){var element,options;if(arguments.length)switch(arguments.length){case 1:"string"==typeof arguments[0]||arguments[0].nodeType||arguments[0]instanceof jQuery?element=$(arguments[0]):options=arguments[0];break;case 2:element=$(arguments[0]),options=arguments[1]}return element&&element.data(name)?element.data(name):new UI.components[name](element,options)},UI.domready&&UI.component.boot(name),fn},UI.plugin=function(component,name,def){this.components[component].plugins[name]=def},UI.component.boot=function(name){UI.components[name].prototype&&UI.components[name].prototype.boot&&!UI.components[name].booted&&(UI.components[name].prototype.boot.apply(UI,[]),UI.components[name].booted=!0)},UI.component.bootComponents=function(){for(var component in UI.components)UI.component.boot(component)},UI.domObservers=[],UI.domready=!1,UI.ready=function(fn){UI.domObservers.push(fn),UI.domready&&fn(document)},UI.on=function(a1,a2,a3){return a1&&a1.indexOf("ready.uk.dom")>-1&&UI.domready&&a2.apply(UI.$doc),UI.$doc.on(a1,a2,a3)},UI.one=function(a1,a2,a3){return a1&&a1.indexOf("ready.uk.dom")>-1&&UI.domready?(a2.apply(UI.$doc),UI.$doc):UI.$doc.one(a1,a2,a3)},UI.trigger=function(evt,params){return UI.$doc.trigger(evt,params)},UI.domObserve=function(selector,fn){UI.support.mutationobserver&&(fn=fn||function(){},UI.$(selector).each(function(){var element=this,$element=UI.$(element);if(!$element.data("observer"))try{var observer=new UI.support.mutationobserver(UI.Utils.debounce(function(mutations){fn.apply(element,[]),$element.trigger("changed.uk.dom")},50));observer.observe(element,{childList:!0,subtree:!0}),$element.data("observer",observer)}catch(e){}}))},UI.init=function(root){root=root||document,UI.domObservers.forEach(function(fn){fn(root)})},UI.on("domready.uk.dom",function(){UI.init(),UI.domready&&UI.Utils.checkDisplay()}),document.addEventListener("DOMContentLoaded",function(){var domReady=function(){UI.$body=UI.$("body"),UI.ready(function(context){UI.domObserve("[data-uk-observe]")}),UI.on("changed.uk.dom",function(e){UI.init(e.target),UI.Utils.checkDisplay(e.target)}),UI.trigger("beforeready.uk.dom"),UI.component.bootComponents(),requestAnimationFrame(function(){var memory={dir:{x:0,y:0},x:window.pageXOffset,y:window.pageYOffset},fn=function(){var wpxo=window.pageXOffset,wpyo=window.pageYOffset;(memory.x!=wpxo||memory.y!=wpyo)&&(wpxo!=memory.x?memory.dir.x=wpxo>memory.x?1:-1:memory.dir.x=0,wpyo!=memory.y?memory.dir.y=wpyo>memory.y?1:-1:memory.dir.y=0,memory.x=wpxo,memory.y=wpyo,UI.$doc.trigger("scrolling.uk.document",[{dir:{x:memory.dir.x,y:memory.dir.y},x:wpxo,y:wpyo}])),requestAnimationFrame(fn)};return UI.support.touch&&UI.$html.on("touchmove touchend MSPointerMove MSPointerUp pointermove pointerup",fn),(memory.x||memory.y)&&fn(),fn}()),UI.trigger("domready.uk.dom"),UI.support.touch&&navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&UI.$win.on("load orientationchange resize",UI.Utils.debounce(function(){var fn=function(){return $(".uk-height-viewport").css("height",window.innerHeight),fn};return fn()}(),100)),UI.trigger("afterready.uk.dom"),UI.domready=!0};return("complete"==document.readyState||"interactive"==document.readyState)&&setTimeout(domReady),domReady}()),UI.$html.addClass(UI.support.touch?"uk-touch":"uk-notouch"),UI.support.touch){var exclude,hoverset=!1,hovercls="uk-hover",selector=".uk-overlay, .uk-overlay-hover, .uk-overlay-toggle, .uk-animation-hover, .uk-has-hover";UI.$html.on("mouseenter touchstart MSPointerDown pointerdown",selector,function(){hoverset&&$("."+hovercls).removeClass(hovercls),hoverset=$(this).addClass(hovercls)}).on("mouseleave touchend MSPointerUp pointerup",function(e){exclude=$(e.target).parents(selector),hoverset&&hoverset.not(exclude).removeClass(hovercls)})}return UI}),function($){function swipeDirection(x1,x2,y1,y2){return Math.abs(x1-x2)>=Math.abs(y1-y2)?x1-x2>0?"Left":"Right":y1-y2>0?"Up":"Down"}function longTap(){longTapTimeout=null,touch.last&&(void 0!==touch.el&&touch.el.trigger("longTap"),touch={})}function cancelLongTap(){longTapTimeout&&clearTimeout(longTapTimeout),longTapTimeout=null}function cancelAll(){touchTimeout&&clearTimeout(touchTimeout),tapTimeout&&clearTimeout(tapTimeout),swipeTimeout&&clearTimeout(swipeTimeout),longTapTimeout&&clearTimeout(longTapTimeout),touchTimeout=tapTimeout=swipeTimeout=longTapTimeout=null,touch={}}function isPrimaryTouch(event){return event.pointerType==event.MSPOINTER_TYPE_TOUCH&&event.isPrimary}if(!$.fn.swipeLeft){var touchTimeout,tapTimeout,swipeTimeout,longTapTimeout,gesture,touch={},longTapDelay=750;$(function(){var now,delta,firstTouch,deltaX=0,deltaY=0;"MSGesture"in window&&(gesture=new MSGesture,gesture.target=document.body),$(document).on("MSGestureEnd gestureend",function(e){var swipeDirectionFromVelocity=e.originalEvent.velocityX>1?"Right":e.originalEvent.velocityX<-1?"Left":e.originalEvent.velocityY>1?"Down":e.originalEvent.velocityY<-1?"Up":null;swipeDirectionFromVelocity&&void 0!==touch.el&&(touch.el.trigger("swipe"),touch.el.trigger("swipe"+swipeDirectionFromVelocity))}).on("touchstart MSPointerDown pointerdown",function(e){("MSPointerDown"!=e.type||isPrimaryTouch(e.originalEvent))&&(firstTouch="MSPointerDown"==e.type||"pointerdown"==e.type?e:e.originalEvent.touches[0],now=Date.now(),delta=now-(touch.last||now),touch.el=$("tagName"in firstTouch.target?firstTouch.target:firstTouch.target.parentNode),touchTimeout&&clearTimeout(touchTimeout),touch.x1=firstTouch.pageX,touch.y1=firstTouch.pageY,delta>0&&250>=delta&&(touch.isDoubleTap=!0),touch.last=now,longTapTimeout=setTimeout(longTap,longTapDelay),!gesture||"MSPointerDown"!=e.type&&"pointerdown"!=e.type&&"touchstart"!=e.type||gesture.addPointer(e.originalEvent.pointerId))}).on("touchmove MSPointerMove pointermove",function(e){("MSPointerMove"!=e.type||isPrimaryTouch(e.originalEvent))&&(firstTouch="MSPointerMove"==e.type||"pointermove"==e.type?e:e.originalEvent.touches[0],cancelLongTap(),touch.x2=firstTouch.pageX,touch.y2=firstTouch.pageY,deltaX+=Math.abs(touch.x1-touch.x2),deltaY+=Math.abs(touch.y1-touch.y2))}).on("touchend MSPointerUp pointerup",function(e){("MSPointerUp"!=e.type||isPrimaryTouch(e.originalEvent))&&(cancelLongTap(),touch.x2&&Math.abs(touch.x1-touch.x2)>30||touch.y2&&Math.abs(touch.y1-touch.y2)>30?swipeTimeout=setTimeout(function(){void 0!==touch.el&&(touch.el.trigger("swipe"),touch.el.trigger("swipe"+swipeDirection(touch.x1,touch.x2,touch.y1,touch.y2))),touch={}},0):"last"in touch&&(isNaN(deltaX)||30>deltaX&&30>deltaY?tapTimeout=setTimeout(function(){var event=$.Event("tap");event.cancelTouch=cancelAll,void 0!==touch.el&&touch.el.trigger(event),touch.isDoubleTap?(void 0!==touch.el&&touch.el.trigger("doubleTap"),touch={}):touchTimeout=setTimeout(function(){touchTimeout=null,void 0!==touch.el&&touch.el.trigger("singleTap"),touch={}},250)},0):touch={},deltaX=deltaY=0))}).on("touchcancel MSPointerCancel",cancelAll),$(window).on("scroll",cancelAll)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(eventName){$.fn[eventName]=function(callback){return $(this).on(eventName,callback)}})}}(jQuery),function(UI){"use strict";var stacks=[];UI.component("stackMargin",{defaults:{cls:"uk-margin-small-top",rowfirst:!1},boot:function(){UI.ready(function(context){UI.$("[data-uk-margin]",context).each(function(){var ele=UI.$(this);ele.data("stackMargin")||UI.stackMargin(ele,UI.Utils.options(ele.attr("data-uk-margin")))})})},init:function(){var $this=this;UI.$win.on("resize orientationchange",function(){var fn=function(){$this.process()};return UI.$(function(){fn(),UI.$win.on("load",fn)}),UI.Utils.debounce(fn,20)}()),UI.$html.on("changed.uk.dom",function(e){$this.process()}),this.on("display.uk.check",function(e){this.element.is(":visible")&&this.process()}.bind(this)),stacks.push(this)},process:function(){var $this=this,columns=this.element.children();if(UI.Utils.stackMargin(columns,this.options),!this.options.rowfirst)return this;var pos_cache=columns.removeClass(this.options.rowfirst).filter(":visible").first().position();return pos_cache&&columns.each(function(){UI.$(this)[UI.$(this).position().left==pos_cache.left?"addClass":"removeClass"]($this.options.rowfirst)}),this}}),function(){var elements=[],check=function(ele){if(ele.is(":visible")){var width=ele.parent().width(),iwidth=ele.data("width"),ratio=width/iwidth,height=Math.floor(ratio*ele.data("height"));ele.css({height:iwidth>width?height:ele.data("height")})}};UI.component("responsiveElement",{defaults:{},boot:function(){UI.ready(function(context){UI.$("iframe.uk-responsive-width, [data-uk-responsive]",context).each(function(){var obj,ele=UI.$(this);ele.data("responsiveElement")||(obj=UI.responsiveElement(ele,{}))})})},init:function(){var ele=this.element;ele.attr("width")&&ele.attr("height")&&(ele.data({width:ele.attr("width"),height:ele.attr("height")}).on("display.uk.check",function(){check(ele)}),check(ele),elements.push(ele))}}),UI.$win.on("resize load",UI.Utils.debounce(function(){elements.forEach(function(ele){check(ele)})},15))}(),UI.Utils.stackMargin=function(elements,options){options=UI.$.extend({cls:"uk-margin-small-top"},options),options.cls=options.cls,elements=UI.$(elements).removeClass(options.cls);var skip=!1,firstvisible=elements.filter(":visible:first"),offset=firstvisible.length?firstvisible.position().top+firstvisible.outerHeight()-1:!1;offset!==!1&&1!=elements.length&&elements.each(function(){var column=UI.$(this);column.is(":visible")&&(skip?column.addClass(options.cls):column.position().top>=offset&&(skip=column.addClass(options.cls)))})},UI.Utils.matchHeights=function(elements,options){elements=UI.$(elements).css("min-height",""),options=UI.$.extend({row:!0},options);var matchHeights=function(group){if(!(group.length<2)){var max=0;group.each(function(){max=Math.max(max,UI.$(this).outerHeight())}).each(function(){var element=UI.$(this),height=max-("border-box"==element.css("box-sizing")?0:element.outerHeight()-element.height());element.css("min-height",height+"px")})}};options.row?(elements.first().width(),setTimeout(function(){var lastoffset=!1,group=[];elements.each(function(){var ele=UI.$(this),offset=ele.offset().top;offset!=lastoffset&&group.length&&(matchHeights(UI.$(group)),group=[],offset=ele.offset().top),group.push(ele),lastoffset=offset}),group.length&&matchHeights(UI.$(group))},0)):matchHeights(elements)},function(cacheSvgs){UI.Utils.inlineSvg=function(selector,root){UI.$(selector||'img[src$=".svg"]',root||document).each(function(){var img=UI.$(this),src=img.attr("src");if(!cacheSvgs[src]){var d=UI.$.Deferred();UI.$.get(src,{nc:Math.random()},function(data){d.resolve(UI.$(data).find("svg"))}),cacheSvgs[src]=d.promise()}cacheSvgs[src].then(function(svg){var $svg=UI.$(svg).clone();img.attr("id")&&$svg.attr("id",img.attr("id")),img.attr("class")&&$svg.attr("class",img.attr("class")),img.attr("style")&&$svg.attr("style",img.attr("style")),img.attr("width")&&($svg.attr("width",img.attr("width")),img.attr("height")||$svg.removeAttr("height")),img.attr("height")&&($svg.attr("height",img.attr("height")),img.attr("width")||$svg.removeAttr("width")),img.replaceWith($svg)})})},UI.ready(function(context){UI.Utils.inlineSvg("[data-uk-svg]",context)})}({})}(UIkit),function(UI){"use strict";function scrollToElement(ele,options){options=UI.$.extend({duration:1e3,transition:"easeOutExpo",offset:0,complete:function(){}},options);var target=ele.offset().top-options.offset,docheight=UI.$doc.height(),winheight=window.innerHeight;target+winheight>docheight&&(target=docheight-winheight),UI.$("html,body").stop().animate({scrollTop:target},options.duration,options.transition).promise().done(options.complete)}UI.component("smoothScroll",{boot:function(){UI.$html.on("click.smooth-scroll.uikit","[data-uk-smooth-scroll]",function(e){var ele=UI.$(this);if(!ele.data("smoothScroll")){UI.smoothScroll(ele,UI.Utils.options(ele.attr("data-uk-smooth-scroll")));ele.trigger("click")}return!1})},init:function(){var $this=this;this.on("click",function(e){e.preventDefault(),scrollToElement(UI.$(this.hash).length?UI.$(this.hash):UI.$("body"),$this.options)})}}),UI.Utils.scrollToElement=scrollToElement,UI.$.easing.easeOutExpo||(UI.$.easing.easeOutExpo=function(x,t,b,c,d){return t==d?b+c:c*(-Math.pow(2,-10*t/d)+1)+b})}(UIkit),function(UI){"use strict";var $win=UI.$win,$doc=UI.$doc,scrollspies=[],checkScrollSpy=function(){for(var i=0;i=scrollTop)return inviews[i]}();if(!target)return;$this.options.closest?(links.blur().closest(clsClosest).removeClass(clsActive),navitems=links.filter("a[href='#"+target.attr("id")+"']").closest(clsClosest).addClass(clsActive)):navitems=links.removeClass(clsActive).filter("a[href='#"+target.attr("id")+"']").addClass(clsActive),$this.element.trigger("inview.uk.scrollspynav",[target,navitems])}};this.options.smoothscroll&&UI.smoothScroll&&links.each(function(){UI.smoothScroll(this,$this.options.smoothscroll)}),fn(),this.element.data("scrollspynav",this),this.check=fn,scrollspynavs.push(this)}})}(UIkit),function(UI){"use strict";var toggles=[];UI.component("toggle",{defaults:{target:!1,cls:"uk-hidden",animation:!1,duration:200},boot:function(){UI.ready(function(context){UI.$("[data-uk-toggle]",context).each(function(){var ele=UI.$(this);if(!ele.data("toggle")){UI.toggle(ele,UI.Utils.options(ele.attr("data-uk-toggle")))}}),setTimeout(function(){toggles.forEach(function(toggle){toggle.getToggles()})},0)})},init:function(){var $this=this;this.aria=-1!==this.options.cls.indexOf("uk-hidden"),this.getToggles(),this.on("click",function(e){$this.element.is('a[href="#"]')&&e.preventDefault(),$this.toggle()}),toggles.push(this)},toggle:function(){if(this.totoggle.length){if(this.options.animation&&UI.support.animation){var $this=this,animations=this.options.animation.split(",");1==animations.length&&(animations[1]=animations[0]),animations[0]=animations[0].trim(),animations[1]=animations[1].trim(),this.totoggle.css("animation-duration",this.options.duration+"ms"),this.totoggle.each(function(){var ele=UI.$(this);ele.hasClass($this.options.cls)?(ele.toggleClass($this.options.cls),UI.Utils.animate(ele,animations[0]).then(function(){ele.css("animation-duration",""),UI.Utils.checkDisplay(ele)})):UI.Utils.animate(this,animations[1]+" uk-animation-reverse").then(function(){ele.toggleClass($this.options.cls).css("animation-duration",""),UI.Utils.checkDisplay(ele)})})}else this.totoggle.toggleClass(this.options.cls),UI.Utils.checkDisplay(this.totoggle);this.updateAria()}},getToggles:function(){this.totoggle=this.options.target?UI.$(this.options.target):[],this.updateAria()},updateAria:function(){this.aria&&this.totoggle.length&&this.totoggle.each(function(){UI.$(this).attr("aria-hidden",UI.$(this).hasClass("uk-hidden"))})}})}(UIkit),function(UI){"use strict";UI.component("alert",{defaults:{fade:!0,duration:200,trigger:".uk-alert-close"},boot:function(){UI.$html.on("click.alert.uikit","[data-uk-alert]",function(e){var ele=UI.$(this);if(!ele.data("alert")){var alert=UI.alert(ele,UI.Utils.options(ele.attr("data-uk-alert")));UI.$(e.target).is(alert.options.trigger)&&(e.preventDefault(),alert.close())}})},init:function(){var $this=this;this.on("click",this.options.trigger,function(e){e.preventDefault(),$this.close()})},close:function(){var element=this.trigger("close.uk.alert"),removeElement=function(){this.trigger("closed.uk.alert").remove()}.bind(this);this.options.fade?element.css("overflow","hidden").css("max-height",element.height()).animate({height:0,opacity:0,"padding-top":0,"padding-bottom":0,"margin-top":0,"margin-bottom":0},this.options.duration,removeElement):removeElement()}})}(UIkit),function(UI){"use strict";UI.component("buttonRadio",{defaults:{activeClass:"uk-active",target:".uk-button"},boot:function(){UI.$html.on("click.buttonradio.uikit","[data-uk-button-radio]",function(e){var ele=UI.$(this);if(!ele.data("buttonRadio")){var obj=UI.buttonRadio(ele,UI.Utils.options(ele.attr("data-uk-button-radio"))),target=UI.$(e.target);target.is(obj.options.target)&&target.trigger("click")}})},init:function(){var $this=this;this.find($this.options.target).attr("aria-checked","false").filter("."+$this.options.activeClass).attr("aria-checked","true"),this.on("click",this.options.target,function(e){var ele=UI.$(this);ele.is('a[href="#"]')&&e.preventDefault(),$this.find($this.options.target).not(ele).removeClass($this.options.activeClass).blur(),ele.addClass($this.options.activeClass),$this.find($this.options.target).not(ele).attr("aria-checked","false"),ele.attr("aria-checked","true"),$this.trigger("change.uk.button",[ele])})},getSelected:function(){return this.find("."+this.options.activeClass)}}),UI.component("buttonCheckbox",{defaults:{activeClass:"uk-active",target:".uk-button"},boot:function(){UI.$html.on("click.buttoncheckbox.uikit","[data-uk-button-checkbox]",function(e){var ele=UI.$(this);if(!ele.data("buttonCheckbox")){var obj=UI.buttonCheckbox(ele,UI.Utils.options(ele.attr("data-uk-button-checkbox"))),target=UI.$(e.target);target.is(obj.options.target)&&target.trigger("click")}})},init:function(){var $this=this;this.find($this.options.target).attr("aria-checked","false").filter("."+$this.options.activeClass).attr("aria-checked","true"),this.on("click",this.options.target,function(e){var ele=UI.$(this);ele.is('a[href="#"]')&&e.preventDefault(),ele.toggleClass($this.options.activeClass).blur(),ele.attr("aria-checked",ele.hasClass($this.options.activeClass)),$this.trigger("change.uk.button",[ele])})},getSelected:function(){return this.find("."+this.options.activeClass)}}),UI.component("button",{defaults:{},boot:function(){UI.$html.on("click.button.uikit","[data-uk-button]",function(e){var ele=UI.$(this);if(!ele.data("button")){UI.button(ele,UI.Utils.options(ele.attr("data-uk-button")));ele.trigger("click")}})},init:function(){var $this=this;this.element.attr("aria-pressed",this.element.hasClass("uk-active")),this.on("click",function(e){$this.element.is('a[href="#"]')&&e.preventDefault(),$this.toggle(),$this.trigger("change.uk.button",[$this.element.blur().hasClass("uk-active")])})},toggle:function(){this.element.toggleClass("uk-active"),this.element.attr("aria-pressed",this.element.hasClass("uk-active"))}})}(UIkit),function(UI){"use strict";function justify(ele,justifyTo,boundarywidth,offset){if(ele=UI.$(ele),justifyTo=UI.$(justifyTo),boundarywidth=boundarywidth||window.innerWidth,offset=offset||ele.offset(),justifyTo.length){var jwidth=justifyTo.outerWidth();if(ele.css("min-width",jwidth),"right"==UI.langdirection){var right1=boundarywidth-(justifyTo.offset().left+jwidth),right2=boundarywidth-(ele.offset().left+ele.outerWidth());ele.css("margin-right",right1-right2)}else ele.css("margin-left",justifyTo.offset().left-offset.left)}}var hoverIdle,active=!1,flips={x:{"bottom-left":"bottom-right","bottom-right":"bottom-left","bottom-center":"bottom-center","top-left":"top-right","top-right":"top-left","top-center":"top-center","left-top":"right-top","left-bottom":"right-bottom","left-center":"right-center","right-top":"left-top","right-bottom":"left-bottom","right-center":"left-center"},y:{"bottom-left":"top-left","bottom-right":"top-right","bottom-center":"top-center","top-left":"bottom-left","top-right":"bottom-right","top-center":"bottom-center","left-top":"left-bottom","left-bottom":"left-top","left-center":"left-center","right-top":"right-bottom","right-bottom":"right-top","right-center":"right-center"},xy:{"bottom-left":"top-right","bottom-right":"top-left","bottom-center":"top-center","top-left":"bottom-right","top-right":"bottom-left","top-center":"bottom-center",
-"left-top":"right-bottom","left-bottom":"right-top","left-center":"right-center","right-top":"left-bottom","right-bottom":"left-top","right-center":"left-center"}};UI.component("dropdown",{defaults:{mode:"hover",pos:"bottom-left",offset:0,remaintime:800,justify:!1,boundary:UI.$win,delay:0,dropdownSelector:".uk-dropdown,.uk-dropdown-blank",hoverDelayIdle:250,preventflip:!1},remainIdle:!1,boot:function(){var triggerevent=UI.support.touch?"click":"mouseenter";UI.$html.on(triggerevent+".dropdown.uikit","[data-uk-dropdown]",function(e){var ele=UI.$(this);if(!ele.data("dropdown")){var dropdown=UI.dropdown(ele,UI.Utils.options(ele.attr("data-uk-dropdown")));("click"==triggerevent||"mouseenter"==triggerevent&&"hover"==dropdown.options.mode)&&dropdown.element.trigger(triggerevent),dropdown.element.find(dropdown.options.dropdownSelector).length&&e.preventDefault()}})},init:function(){var $this=this;this.dropdown=this.find(this.options.dropdownSelector),this.offsetParent=this.dropdown.parents().filter(function(){return-1!==UI.$.inArray(UI.$(this).css("position"),["relative","fixed","absolute"])}).slice(0,1),this.centered=this.dropdown.hasClass("uk-dropdown-center"),this.justified=this.options.justify?UI.$(this.options.justify):!1,this.boundary=UI.$(this.options.boundary),this.boundary.length||(this.boundary=UI.$win),this.dropdown.hasClass("uk-dropdown-up")&&(this.options.pos="top-left"),this.dropdown.hasClass("uk-dropdown-flip")&&(this.options.pos=this.options.pos.replace("left","right")),this.dropdown.hasClass("uk-dropdown-center")&&(this.options.pos=this.options.pos.replace(/(left|right)/,"center")),this.element.attr("aria-haspopup","true"),this.element.attr("aria-expanded",this.element.hasClass("uk-open")),"click"==this.options.mode||UI.support.touch?this.on("click.uk.dropdown",function(e){var $target=UI.$(e.target);$target.parents($this.options.dropdownSelector).length||(($target.is("a[href='#']")||$target.parent().is("a[href='#']")||$this.dropdown.length&&!$this.dropdown.is(":visible"))&&e.preventDefault(),$target.blur()),$this.element.hasClass("uk-open")?(!$this.dropdown.find(e.target).length||$target.is(".uk-dropdown-close")||$target.parents(".uk-dropdown-close").length)&&$this.hide():$this.show()}):this.on("mouseenter",function(e){$this.trigger("pointerenter.uk.dropdown",[$this]),$this.remainIdle&&clearTimeout($this.remainIdle),hoverIdle&&clearTimeout(hoverIdle),active&&active==$this||(hoverIdle=active&&active!=$this?setTimeout(function(){hoverIdle=setTimeout($this.show.bind($this),$this.options.delay)},$this.options.hoverDelayIdle):setTimeout($this.show.bind($this),$this.options.delay))}).on("mouseleave",function(){hoverIdle&&clearTimeout(hoverIdle),$this.remainIdle=setTimeout(function(){active&&active==$this&&$this.hide()},$this.options.remaintime),$this.trigger("pointerleave.uk.dropdown",[$this])}).on("click",function(e){var $target=UI.$(e.target);return $this.remainIdle&&clearTimeout($this.remainIdle),active&&active==$this?void((!$this.dropdown.find(e.target).length||$target.is(".uk-dropdown-close")||$target.parents(".uk-dropdown-close").length)&&$this.hide()):(($target.is("a[href='#']")||$target.parent().is("a[href='#']"))&&e.preventDefault(),void $this.show())})},show:function(){UI.$html.off("click.outer.dropdown"),active&&active!=this&&active.hide(!0),hoverIdle&&clearTimeout(hoverIdle),this.trigger("beforeshow.uk.dropdown",[this]),this.checkDimensions(),this.element.addClass("uk-open"),this.element.attr("aria-expanded","true"),this.trigger("show.uk.dropdown",[this]),UI.Utils.checkDisplay(this.dropdown,!0),active=this,this.registerOuterClick()},hide:function(force){this.trigger("beforehide.uk.dropdown",[this,force]),this.element.removeClass("uk-open"),this.remainIdle&&clearTimeout(this.remainIdle),this.remainIdle=!1,this.element.attr("aria-expanded","false"),this.trigger("hide.uk.dropdown",[this,force]),active==this&&(active=!1)},registerOuterClick:function(){var $this=this;UI.$html.off("click.outer.dropdown"),setTimeout(function(){UI.$html.on("click.outer.dropdown",function(e){hoverIdle&&clearTimeout(hoverIdle);UI.$(e.target);active!=$this||$this.element.find(e.target).length||($this.hide(!0),UI.$html.off("click.outer.dropdown"))})},10)},checkDimensions:function(){if(this.dropdown.length){this.dropdown.removeClass("uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack").css({"top-left":"",left:"","margin-left":"","margin-right":""}),this.justified&&this.justified.length&&this.dropdown.css("min-width","");var pp,pos=UI.$.extend({},this.offsetParent.offset(),{width:this.offsetParent[0].offsetWidth,height:this.offsetParent[0].offsetHeight}),posoffset=this.options.offset,dropdown=this.dropdown,width=(dropdown.show().offset()||{left:0,top:0},dropdown.outerWidth()),height=dropdown.outerHeight(),boundarywidth=this.boundary.width(),dpos=(this.boundary[0]!==window&&this.boundary.offset()?this.boundary.offset():{top:0,left:0},this.options.pos),variants={"bottom-left":{top:0+pos.height+posoffset,left:0},"bottom-right":{top:0+pos.height+posoffset,left:0+pos.width-width},"bottom-center":{top:0+pos.height+posoffset,left:0+pos.width/2-width/2},"top-left":{top:0-height-posoffset,left:0},"top-right":{top:0-height-posoffset,left:0+pos.width-width},"top-center":{top:0-height-posoffset,left:0+pos.width/2-width/2},"left-top":{top:0,left:0-width-posoffset},"left-bottom":{top:0+pos.height-height,left:0-width-posoffset},"left-center":{top:0+pos.height/2-height/2,left:0-width-posoffset},"right-top":{top:0,left:0+pos.width+posoffset},"right-bottom":{top:0+pos.height-height,left:0+pos.width+posoffset},"right-center":{top:0+pos.height/2-height/2,left:0+pos.width+posoffset}},css={};if(pp=dpos.split("-"),css=variants[dpos]?variants[dpos]:variants["bottom-left"],this.justified&&this.justified.length)justify(dropdown.css({left:0}),this.justified,boundarywidth);else if(this.options.preventflip!==!0){var fdpos;switch(this.checkBoundary(pos.left+css.left,pos.top+css.top,width,height,boundarywidth)){case"x":"x"!==this.options.preventflip&&(fdpos=flips.x[dpos]||"right-top");break;case"y":"y"!==this.options.preventflip&&(fdpos=flips.y[dpos]||"top-left");break;case"xy":this.options.preventflip||(fdpos=flips.xy[dpos]||"right-bottom")}fdpos&&(pp=fdpos.split("-"),css=variants[fdpos]?variants[fdpos]:variants["bottom-left"],this.checkBoundary(pos.left+css.left,pos.top+css.top,width,height,boundarywidth)&&(pp=dpos.split("-"),css=variants[dpos]?variants[dpos]:variants["bottom-left"]))}width>boundarywidth&&(dropdown.addClass("uk-dropdown-stack"),this.trigger("stack.uk.dropdown",[this])),dropdown.css(css).css("display","").addClass("uk-dropdown-"+pp[0])}},checkBoundary:function(left,top,width,height,boundarywidth){var axis="";return(0>left||left-UI.$win.scrollLeft()+width>boundarywidth)&&(axis+="x"),(top-UI.$win.scrollTop()<0||top-UI.$win.scrollTop()+height>window.innerHeight)&&(axis+="y"),axis}}),UI.component("dropdownOverlay",{defaults:{justify:!1,cls:"",duration:200},boot:function(){UI.ready(function(context){UI.$("[data-uk-dropdown-overlay]",context).each(function(){var ele=UI.$(this);ele.data("dropdownOverlay")||UI.dropdownOverlay(ele,UI.Utils.options(ele.attr("data-uk-dropdown-overlay")))})})},init:function(){var $this=this;this.justified=this.options.justify?UI.$(this.options.justify):!1,this.overlay=this.element.find("uk-dropdown-overlay"),this.overlay.length||(this.overlay=UI.$('
').appendTo(this.element)),this.overlay.addClass(this.options.cls),this.on({"beforeshow.uk.dropdown":function(e,dropdown){$this.dropdown=dropdown,$this.justified&&$this.justified.length&&justify($this.overlay.css({display:"block","margin-left":"","margin-right":""}),$this.justified,$this.justified.outerWidth())},"show.uk.dropdown":function(e,dropdown){var h=$this.dropdown.dropdown.outerHeight(!0);$this.dropdown.element.removeClass("uk-open"),$this.overlay.stop().css("display","block").animate({height:h},$this.options.duration,function(){$this.dropdown.dropdown.css("visibility",""),$this.dropdown.element.addClass("uk-open"),UI.Utils.checkDisplay($this.dropdown.dropdown,!0)}),$this.pointerleave=!1},"hide.uk.dropdown":function(){$this.overlay.stop().animate({height:0},$this.options.duration)},"pointerenter.uk.dropdown":function(e,dropdown){clearTimeout($this.remainIdle)},"pointerleave.uk.dropdown":function(e,dropdown){$this.pointerleave=!0}}),this.overlay.on({mouseenter:function(){$this.remainIdle&&(clearTimeout($this.dropdown.remainIdle),clearTimeout($this.remainIdle))},mouseleave:function(){$this.pointerleave&&active&&($this.remainIdle=setTimeout(function(){active&&active.hide()},active.options.remaintime))}})}})}(UIkit),function(UI){"use strict";var grids=[];UI.component("gridMatchHeight",{defaults:{target:!1,row:!0,ignorestacked:!1},boot:function(){UI.ready(function(context){UI.$("[data-uk-grid-match]",context).each(function(){var obj,grid=UI.$(this);grid.data("gridMatchHeight")||(obj=UI.gridMatchHeight(grid,UI.Utils.options(grid.attr("data-uk-grid-match"))))})})},init:function(){var $this=this;this.columns=this.element.children(),this.elements=this.options.target?this.find(this.options.target):this.columns,this.columns.length&&(UI.$win.on("load resize orientationchange",function(){var fn=function(){$this.match()};return UI.$(function(){fn()}),UI.Utils.debounce(fn,50)}()),UI.$html.on("changed.uk.dom",function(e){$this.columns=$this.element.children(),$this.elements=$this.options.target?$this.find($this.options.target):$this.columns,$this.match()}),this.on("display.uk.check",function(e){this.element.is(":visible")&&this.match()}.bind(this)),grids.push(this))},match:function(){var firstvisible=this.columns.filter(":visible:first");if(firstvisible.length){var stacked=Math.ceil(100*parseFloat(firstvisible.css("width"))/parseFloat(firstvisible.parent().css("width")))>=100;return stacked&&!this.options.ignorestacked?this.revert():UI.Utils.matchHeights(this.elements,this.options),this}},revert:function(){return this.elements.css("min-height",""),this}}),UI.component("gridMargin",{defaults:{cls:"uk-grid-margin",rowfirst:"uk-row-first"},boot:function(){UI.ready(function(context){UI.$("[data-uk-grid-margin]",context).each(function(){var obj,grid=UI.$(this);grid.data("gridMargin")||(obj=UI.gridMargin(grid,UI.Utils.options(grid.attr("data-uk-grid-margin"))))})})},init:function(){UI.stackMargin(this.element,this.options)}})}(UIkit),function(UI){"use strict";function setContent(content,modal){return modal?("object"==typeof content?(content=content instanceof jQuery?content:UI.$(content),content.parent().length&&(modal.persist=content,modal.persist.data("modalPersistParent",content.parent()))):content="string"==typeof content||"number"==typeof content?UI.$("
").html(content):UI.$("
").html("UIkit.modal Error: Unsupported data type: "+typeof content),content.appendTo(modal.element.find(".uk-modal-dialog")),modal):void 0}var body,active=!1,activeCount=0,$html=UI.$html;UI.component("modal",{defaults:{keyboard:!0,bgclose:!0,minScrollHeight:150,center:!1,modal:!0},scrollable:!1,transition:!1,hasTransitioned:!0,init:function(){if(body||(body=UI.$("body")),this.element.length){var $this=this;this.paddingdir="padding-"+("left"==UI.langdirection?"right":"left"),this.dialog=this.find(".uk-modal-dialog"),this.active=!1,this.element.attr("aria-hidden",this.element.hasClass("uk-open")),this.on("click",".uk-modal-close",function(e){e.preventDefault(),$this.hide()}).on("click",function(e){var target=UI.$(e.target);target[0]==$this.element[0]&&$this.options.bgclose&&$this.hide()})}},toggle:function(){return this[this.isActive()?"hide":"show"]()},show:function(){if(this.element.length){var $this=this;if(!this.isActive())return this.options.modal&&active&&active.hide(!0),this.element.removeClass("uk-open").show(),this.resize(),this.options.modal&&(active=this),this.active=!0,activeCount++,UI.support.transition?(this.hasTransitioned=!1,this.element.one(UI.support.transition.end,function(){$this.hasTransitioned=!0}).addClass("uk-open")):this.element.addClass("uk-open"),$html.addClass("uk-modal-page").height(),this.element.attr("aria-hidden","false"),this.element.trigger("show.uk.modal"),UI.Utils.checkDisplay(this.dialog,!0),this}},hide:function(force){if(!force&&UI.support.transition&&this.hasTransitioned){var $this=this;this.one(UI.support.transition.end,function(){$this._hide()}).removeClass("uk-open")}else this._hide();return this},resize:function(){var bodywidth=body.width();if(this.scrollbarwidth=window.innerWidth-bodywidth,body.css(this.paddingdir,this.scrollbarwidth),this.element.css("overflow-y",this.scrollbarwidth?"scroll":"auto"),!this.updateScrollable()&&this.options.center){var dh=this.dialog.outerHeight(),pad=parseInt(this.dialog.css("margin-top"),10)+parseInt(this.dialog.css("margin-bottom"),10);dh+padoffset?20:offset)-dh;return scrollable.css({"max-height":h0?activeCount--:activeCount=0,this.element.hide().removeClass("uk-open"),this.element.attr("aria-hidden","true"),activeCount||($html.removeClass("uk-modal-page"),body.css(this.paddingdir,"")),active===this&&(active=!1),this.trigger("hide.uk.modal")},isActive:function(){return this.active}}),UI.component("modalTrigger",{boot:function(){UI.$html.on("click.modal.uikit","[data-uk-modal]",function(e){var ele=UI.$(this);if(ele.is("a")&&e.preventDefault(),!ele.data("modalTrigger")){var modal=UI.modalTrigger(ele,UI.Utils.options(ele.attr("data-uk-modal")));modal.show()}}),UI.$html.on("keydown.modal.uikit",function(e){active&&27===e.keyCode&&active.options.keyboard&&(e.preventDefault(),active.hide())}),UI.$win.on("resize orientationchange",UI.Utils.debounce(function(){active&&active.resize()},150))},init:function(){var $this=this;this.options=UI.$.extend({target:$this.element.is("a")?$this.element.attr("href"):!1},this.options),this.modal=UI.modal(this.options.target,this.options),this.on("click",function(e){e.preventDefault(),$this.show()}),this.proxy(this.modal,"show hide isActive")}}),UI.modal.dialog=function(content,options){var modal=UI.modal(UI.$(UI.modal.dialog.template).appendTo("body"),options);return modal.on("hide.uk.modal",function(){modal.persist&&(modal.persist.appendTo(modal.persist.data("modalPersistParent")),modal.persist=!1),modal.element.remove()}),setContent(content,modal),modal},UI.modal.dialog.template='',UI.modal.alert=function(content,options){options=UI.$.extend(!0,{bgclose:!1,keyboard:!1,modal:!1,labels:UI.modal.labels},options);var modal=UI.modal.dialog([''+String(content)+"
",'"].join(""),options);return modal.on("show.uk.modal",function(){setTimeout(function(){modal.element.find("button:first").focus()},50)}),modal.show()},UI.modal.confirm=function(content,onconfirm,oncancel){var options=arguments.length>1&&arguments[arguments.length-1]?arguments[arguments.length-1]:{};onconfirm=UI.$.isFunction(onconfirm)?onconfirm:function(){},oncancel=UI.$.isFunction(oncancel)?oncancel:function(){},options=UI.$.extend(!0,{bgclose:!1,keyboard:!1,modal:!1,labels:UI.modal.labels},UI.$.isFunction(options)?{}:options);var modal=UI.modal.dialog([''+String(content)+"
",'"].join(""),options);return modal.element.find(".js-modal-confirm, .js-modal-confirm-cancel").on("click",function(){UI.$(this).is(".js-modal-confirm")?onconfirm():oncancel(),modal.hide()}),modal.on("show.uk.modal",function(){setTimeout(function(){modal.element.find(".js-modal-confirm").focus()},50)}),modal.show()},UI.modal.prompt=function(text,value,onsubmit,options){onsubmit=UI.$.isFunction(onsubmit)?onsubmit:function(value){},options=UI.$.extend(!0,{bgclose:!1,keyboard:!1,modal:!1,labels:UI.modal.labels},options);var modal=UI.modal.dialog([text?''+String(text)+"
":"",'','"].join(""),options),input=modal.element.find("input[type='text']").val(value||"").on("keyup",function(e){13==e.keyCode&&modal.element.find(".js-modal-ok").trigger("click")});return modal.element.find(".js-modal-ok").on("click",function(){onsubmit(input.val())!==!1&&modal.hide()}),modal.on("show.uk.modal",function(){setTimeout(function(){input.focus()},50)}),modal.show()},UI.modal.blockUI=function(content,options){var modal=UI.modal.dialog([''+String(content||'
...
')+"
"].join(""),UI.$.extend({bgclose:!1,keyboard:!1,modal:!1},options));return modal.content=modal.element.find(".uk-modal-content:first"),modal.show()},UI.modal.labels={Ok:"Ok",Cancel:"Cancel"}}(UIkit),function(UI){"use strict";function getHeight(ele){var $ele=UI.$(ele),height="auto";if($ele.is(":visible"))height=$ele.outerHeight();else{var tmp={position:$ele.css("position"),visibility:$ele.css("visibility"),display:$ele.css("display")};height=$ele.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),$ele.css(tmp)}return height}UI.component("nav",{defaults:{toggle:">li.uk-parent > a[href='#']",lists:">li.uk-parent > ul",multiple:!1},boot:function(){UI.ready(function(context){UI.$("[data-uk-nav]",context).each(function(){var nav=UI.$(this);if(!nav.data("nav")){UI.nav(nav,UI.Utils.options(nav.attr("data-uk-nav")))}})})},init:function(){var $this=this;this.on("click.uk.nav",this.options.toggle,function(e){e.preventDefault();var ele=UI.$(this);$this.open(ele.parent()[0]==$this.element[0]?ele:ele.parent("li"))}),this.find(this.options.lists).each(function(){var $ele=UI.$(this),parent=$ele.parent(),active=parent.hasClass("uk-active");$ele.wrap('
'),parent.data("list-container",$ele.parent()[active?"removeClass":"addClass"]("uk-hidden")),parent.attr("aria-expanded",parent.hasClass("uk-open")),active&&$this.open(parent,!0)})},open:function(li,noanimation){var $this=this,element=this.element,$li=UI.$(li),$container=$li.data("list-container");this.options.multiple||element.children(".uk-open").not(li).each(function(){var ele=UI.$(this);ele.data("list-container")&&ele.data("list-container").stop().animate({height:0},function(){UI.$(this).parent().removeClass("uk-open").end().addClass("uk-hidden")})}),$li.toggleClass("uk-open"),$li.attr("aria-expanded",$li.hasClass("uk-open")),$container&&($li.hasClass("uk-open")&&$container.removeClass("uk-hidden"),noanimation?($container.stop().height($li.hasClass("uk-open")?"auto":0),$li.hasClass("uk-open")||$container.addClass("uk-hidden"),this.trigger("display.uk.check")):$container.stop().animate({height:$li.hasClass("uk-open")?getHeight($container.find("ul:first")):0},function(){$li.hasClass("uk-open")?$container.css("height",""):$container.addClass("uk-hidden"),$this.trigger("display.uk.check")}))}})}(UIkit),function(UI){"use strict";var scrollpos={x:window.scrollX,y:window.scrollY},$html=(UI.$win,UI.$doc,UI.$html),Offcanvas={show:function(element){if(element=UI.$(element),element.length){var $body=UI.$("body"),bar=element.find(".uk-offcanvas-bar:first"),rtl="right"==UI.langdirection,flip=bar.hasClass("uk-offcanvas-bar-flip")?-1:1,dir=flip*(rtl?-1:1),scrollbarwidth=window.innerWidth-$body.width();scrollpos={x:window.pageXOffset,y:window.pageYOffset},element.addClass("uk-active"),$body.css({width:window.innerWidth-scrollbarwidth,height:window.innerHeight}).addClass("uk-offcanvas-page"),$body.css(rtl?"margin-right":"margin-left",(rtl?-1:1)*(bar.outerWidth()*dir)).width(),$html.css("margin-top",-1*scrollpos.y),bar.addClass("uk-offcanvas-bar-show"),this._initElement(element),bar.trigger("show.uk.offcanvas",[element,bar]),element.attr("aria-hidden","false")}},hide:function(force){var $body=UI.$("body"),panel=UI.$(".uk-offcanvas.uk-active"),rtl="right"==UI.langdirection,bar=panel.find(".uk-offcanvas-bar:first"),finalize=function(){$body.removeClass("uk-offcanvas-page").css({width:"",height:"","margin-left":"","margin-right":""}),panel.removeClass("uk-active"),bar.removeClass("uk-offcanvas-bar-show"),$html.css("margin-top",""),window.scrollTo(scrollpos.x,scrollpos.y),bar.trigger("hide.uk.offcanvas",[panel,bar]),panel.attr("aria-hidden","true")};panel.length&&(UI.support.transition&&!force?($body.one(UI.support.transition.end,function(){finalize()}).css(rtl?"margin-right":"margin-left",""),setTimeout(function(){bar.removeClass("uk-offcanvas-bar-show")},0)):finalize())},_initElement:function(element){element.data("OffcanvasInit")||(element.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas",function(e){var target=UI.$(e.target);if(!e.type.match(/swipe/)&&!target.hasClass("uk-offcanvas-close")){if(target.hasClass("uk-offcanvas-bar"))return;if(target.parents(".uk-offcanvas-bar:first").length)return}e.stopImmediatePropagation(),Offcanvas.hide()}),element.on("click","a[href*='#']",function(e){var link=UI.$(this),href=link.attr("href");"#"!=href&&(UI.$doc.one("hide.uk.offcanvas",function(){var target;try{target=UI.$(link[0].hash)}catch(e){target=""}target.length||(target=UI.$('[name="'+link[0].hash.replace("#","")+'"]')),target.length&&UI.Utils.scrollToElement?UI.Utils.scrollToElement(target,UI.Utils.options(link.attr("data-uk-smooth-scroll")||"{}")):window.location.href=href}),Offcanvas.hide())}),element.data("OffcanvasInit",!0))}};UI.component("offcanvasTrigger",{boot:function(){$html.on("click.offcanvas.uikit","[data-uk-offcanvas]",function(e){e.preventDefault();var ele=UI.$(this);if(!ele.data("offcanvasTrigger")){UI.offcanvasTrigger(ele,UI.Utils.options(ele.attr("data-uk-offcanvas")));ele.trigger("click")}}),$html.on("keydown.uk.offcanvas",function(e){27===e.keyCode&&Offcanvas.hide()})},init:function(){var $this=this;this.options=UI.$.extend({target:$this.element.is("a")?$this.element.attr("href"):!1},this.options),this.on("click",function(e){e.preventDefault(),Offcanvas.show($this.options.target)})}}),UI.offcanvas=Offcanvas}(UIkit),function(UI){"use strict";function coreAnimation(cls,current,next){var release,d=UI.$.Deferred(),clsIn=cls,clsOut=cls;return next[0]===current[0]?(d.resolve(),d.promise()):("object"==typeof cls&&(clsIn=cls[0],clsOut=cls[1]||cls[0]),UI.$body.css("overflow-x","hidden"),release=function(){current&¤t.hide().removeClass("uk-active "+clsOut+" uk-animation-reverse"),next.addClass(clsIn).one(UI.support.animation.end,function(){next.removeClass(""+clsIn).css({opacity:"",display:""}),d.resolve(),UI.$body.css("overflow-x",""),current&¤t.css({opacity:"",display:""})}.bind(this)).show()},next.css("animation-duration",this.options.duration+"ms"),current&¤t.length?(current.css("animation-duration",this.options.duration+"ms"),current.css("display","none").addClass(clsOut+" uk-animation-reverse").one(UI.support.animation.end,function(){release()}.bind(this)).css("display","")):(next.addClass("uk-active"),release()),d.promise())}var Animations;UI.component("switcher",{defaults:{connect:!1,toggle:">*",active:0,animation:!1,duration:200,swiping:!0},animating:!1,boot:function(){UI.ready(function(context){UI.$("[data-uk-switcher]",context).each(function(){var switcher=UI.$(this);if(!switcher.data("switcher")){UI.switcher(switcher,UI.Utils.options(switcher.attr("data-uk-switcher")))}})})},init:function(){var $this=this;if(this.on("click.uk.switcher",this.options.toggle,function(e){e.preventDefault(),$this.show(this)}),this.options.connect){this.connect=UI.$(this.options.connect),this.connect.find(".uk-active").removeClass(".uk-active"),this.connect.length&&(this.connect.children().attr("aria-hidden","true"),this.connect.on("click","[data-uk-switcher-item]",function(e){e.preventDefault();var item=UI.$(this).attr("data-uk-switcher-item");if($this.index!=item)switch(item){case"next":case"previous":$this.show($this.index+("next"==item?1:-1));break;default:$this.show(parseInt(item,10))}}),this.options.swiping&&this.connect.on("swipeRight swipeLeft",function(e){e.preventDefault(),window.getSelection().toString()||$this.show($this.index+("swipeLeft"==e.type?1:-1))}));var toggles=this.find(this.options.toggle),active=toggles.filter(".uk-active");if(active.length)this.show(active,!1);else{if(this.options.active===!1)return;active=toggles.eq(this.options.active),this.show(active.length?active:toggles.eq(0),!1)}toggles.not(active).attr("aria-expanded","false"),active.attr("aria-expanded","true"),this.on("changed.uk.dom",function(){$this.connect=UI.$($this.options.connect)})}},show:function(tab,animate){if(!this.animating){if(isNaN(tab))tab=UI.$(tab);else{var toggles=this.find(this.options.toggle);tab=0>tab?toggles.length-1:tab,tab=toggles.eq(toggles[tab]?tab:0)}var $this=this,toggles=this.find(this.options.toggle),active=UI.$(tab),animation=Animations[this.options.animation]||function(current,next){if(!$this.options.animation)return Animations.none.apply($this);var anim=$this.options.animation.split(",");return 1==anim.length&&(anim[1]=anim[0]),anim[0]=anim[0].trim(),anim[1]=anim[1].trim(),coreAnimation.apply($this,[anim,current,next])};animate!==!1&&UI.support.animation||(animation=Animations.none),active.hasClass("uk-disabled")||(toggles.attr("aria-expanded","false"),active.attr("aria-expanded","true"),toggles.filter(".uk-active").removeClass("uk-active"),active.addClass("uk-active"),this.options.connect&&this.connect.length&&(this.index=this.find(this.options.toggle).index(active),-1==this.index&&(this.index=0),this.connect.each(function(){var container=UI.$(this),children=UI.$(container.children()),current=UI.$(children.filter(".uk-active")),next=UI.$(children.eq($this.index));$this.animating=!0,animation.apply($this,[current,next]).then(function(){current.removeClass("uk-active"),next.addClass("uk-active"),current.attr("aria-hidden","true"),next.attr("aria-hidden","false"),UI.Utils.checkDisplay(next,!0),$this.animating=!1})})),this.trigger("show.uk.switcher",[active]))}}}),Animations={none:function(){var d=UI.$.Deferred();return d.resolve(),d.promise()},fade:function(current,next){return coreAnimation.apply(this,["uk-animation-fade",current,next])},"slide-bottom":function(current,next){return coreAnimation.apply(this,["uk-animation-slide-bottom",current,next])},"slide-top":function(current,next){return coreAnimation.apply(this,["uk-animation-slide-top",current,next])},"slide-vertical":function(current,next,dir){var anim=["uk-animation-slide-top","uk-animation-slide-bottom"];return current&¤t.index()>next.index()&&anim.reverse(),coreAnimation.apply(this,[anim,current,next])},"slide-left":function(current,next){return coreAnimation.apply(this,["uk-animation-slide-left",current,next])},"slide-right":function(current,next){return coreAnimation.apply(this,["uk-animation-slide-right",current,next])},"slide-horizontal":function(current,next,dir){var anim=["uk-animation-slide-right","uk-animation-slide-left"];return current&¤t.index()>next.index()&&anim.reverse(),coreAnimation.apply(this,[anim,current,next])},scale:function(current,next){return coreAnimation.apply(this,["uk-animation-scale-up",current,next])}},UI.switcher.animations=Animations}(UIkit),function(UI){"use strict";UI.component("tab",{defaults:{target:">li:not(.uk-tab-responsive, .uk-disabled)",connect:!1,active:0,animation:!1,duration:200,swiping:!0},boot:function(){UI.ready(function(context){UI.$("[data-uk-tab]",context).each(function(){var tab=UI.$(this);if(!tab.data("tab")){UI.tab(tab,UI.Utils.options(tab.attr("data-uk-tab")))}})})},init:function(){var $this=this;this.current=!1,this.on("click.uk.tab",this.options.target,function(e){if(e.preventDefault(),!$this.switcher||!$this.switcher.animating){var current=$this.find($this.options.target).not(this);current.removeClass("uk-active").blur(),$this.trigger("change.uk.tab",[UI.$(this).addClass("uk-active"),$this.current]),$this.current=UI.$(this),$this.options.connect||(current.attr("aria-expanded","false"),UI.$(this).attr("aria-expanded","true"))}}),this.options.connect&&(this.connect=UI.$(this.options.connect)),this.responsivetab=UI.$(' ').append(''),this.responsivetab.dropdown=this.responsivetab.find(".uk-dropdown"),this.responsivetab.lst=this.responsivetab.dropdown.find("ul"),this.responsivetab.caption=this.responsivetab.find("a:first"),this.element.hasClass("uk-tab-bottom")&&this.responsivetab.dropdown.addClass("uk-dropdown-up"),this.responsivetab.lst.on("click.uk.tab","a",function(e){e.preventDefault(),e.stopPropagation();var link=UI.$(this);$this.element.children("li:not(.uk-tab-responsive)").eq(link.data("index")).trigger("click")}),this.on("show.uk.switcher change.uk.tab",function(e,tab){$this.responsivetab.caption.html(tab.text())}),this.element.append(this.responsivetab),this.options.connect&&(this.switcher=UI.switcher(this.element,{toggle:">li:not(.uk-tab-responsive)",connect:this.options.connect,active:this.options.active,animation:this.options.animation,duration:this.options.duration,swiping:this.options.swiping})),UI.dropdown(this.responsivetab,{mode:"click",preventflip:"y"}),$this.trigger("change.uk.tab",[this.element.find(this.options.target).not(".uk-tab-responsive").filter(".uk-active")]),this.check(),UI.$win.on("resize orientationchange",UI.Utils.debounce(function(){$this.element.is(":visible")&&$this.check()},100)),this.on("display.uk.check",function(){$this.element.is(":visible")&&$this.check()})},check:function(){var children=this.element.children("li:not(.uk-tab-responsive)").removeClass("uk-hidden");if(!children.length)return void this.responsivetab.addClass("uk-hidden");var item,link,clone,top=children.eq(0).offset().top+Math.ceil(children.eq(0).height()/2),doresponsive=!1;if(this.responsivetab.lst.empty(),children.each(function(){UI.$(this).offset().top>top&&(doresponsive=!0)}),doresponsive)for(var i=0;i-1?"&":"?","enablejsapi=1&api=1"].join(""))}},check:function(){this.element.css({width:"",height:""}),this.dimension={w:this.element.width(),h:this.element.height()},this.element.attr("width")&&!isNaN(this.element.attr("width"))&&(this.dimension.w=this.element.attr("width")),this.element.attr("height")&&!isNaN(this.element.attr("height"))&&(this.dimension.h=this.element.attr("height")),this.ratio=this.dimension.w/this.dimension.h;var width,height,w=this.parent.width(),h=this.parent.height();w/this.ratio
').parent(),$wrapper.attr("aria-expanded","false")),$toggle=$this.toggle.eq(index),$wrapper.data("toggle",$toggle),$wrapper.data("content",$content),$toggle.data("wrapper",$wrapper),$content.data("wrapper",$wrapper)}),this.element.trigger("update.uk.accordion",[this])}}),UI.accordion}),function(addon){var component;window.UIkit&&(component=addon(UIkit)),"function"==typeof define&&define.amd&&define("uikit-autocomplete",["uikit"],function(){return component||addon(UIkit)})}(function(UI){"use strict";var active;return UI.component("autocomplete",{defaults:{minLength:3,param:"search",method:"post",delay:300,loadingClass:"uk-loading",flipDropdown:!1,skipClass:"uk-skip",hoverClass:"uk-active",source:null,renderer:null,template:'
'},visible:!1,value:null,selected:null,boot:function(){UI.$html.on("focus.autocomplete.uikit","[data-uk-autocomplete]",function(e){var ele=UI.$(this);ele.data("autocomplete")||UI.autocomplete(ele,UI.Utils.options(ele.attr("data-uk-autocomplete")))}),UI.$html.on("click.autocomplete.uikit",function(e){active&&e.target!=active.input[0]&&active.hide()})},init:function(){var $this=this,select=!1,trigger=UI.Utils.debounce(function(e){return select?select=!1:void $this.handle()},this.options.delay);this.dropdown=this.find(".uk-dropdown"),this.template=this.find('script[type="text/autocomplete"]').html(),this.template=UI.Utils.template(this.template||this.options.template),this.input=this.find("input:first").attr("autocomplete","off"),this.dropdown.length||(this.dropdown=UI.$('
').appendTo(this.element)),this.options.flipDropdown&&this.dropdown.addClass("uk-dropdown-flip"),this.dropdown.attr("aria-expanded","false"),this.input.on({keydown:function(e){if(e&&e.which&&!e.shiftKey)switch(e.which){case 13:select=!0,$this.selected&&(e.preventDefault(),$this.select());break;case 38:e.preventDefault(),$this.pick("prev",!0);break;case 40:e.preventDefault(),$this.pick("next",!0);break;case 27:case 9:$this.hide()}},keyup:trigger}),this.dropdown.on("click",".uk-autocomplete-results > *",function(){$this.select()}),this.dropdown.on("mouseover",".uk-autocomplete-results > *",function(){$this.pick(UI.$(this))}),this.triggercomplete=trigger},handle:function(){var $this=this,old=this.value;return this.value=this.input.val(),this.value.length
index-1?items.length-1:index-1)}else selected=items["next"==item?"first":"last"]();selected=UI.$(selected)}}else selected=item;if(selected&&selected.length&&(this.selected=selected,items.removeClass(this.options.hoverClass),this.selected.addClass(this.options.hoverClass),scrollinview)){var top=selected.position().top,scrollTop=$this.dropdown.scrollTop(),dpheight=$this.dropdown.height();(top>dpheight||0>top)&&$this.dropdown.scrollTop(scrollTop+top)}},select:function(){if(this.selected){var data=this.selected.data();this.trigger("selectitem.uk.autocomplete",[data,this]),data.value&&this.input.val(data.value).trigger("change"),this.hide()}},show:function(){return this.visible?void 0:(this.visible=!0,this.element.addClass("uk-open"),active&&active!==this&&active.hide(),active=this,this.dropdown.attr("aria-expanded","true"),this)},hide:function(){return this.visible?(this.visible=!1,this.element.removeClass("uk-open"),active===this&&(active=!1),this.dropdown.attr("aria-expanded","false"),this):void 0},request:function(){var $this=this,release=function(data){data&&$this.render(data),$this.element.removeClass($this.options.loadingClass)};if(this.element.addClass(this.options.loadingClass),this.options.source){var source=this.options.source;switch(typeof this.options.source){case"function":this.options.source.apply(this,[release]);break;case"object":if(source.length){var items=[];source.forEach(function(item){item.value&&-1!=item.value.toLowerCase().indexOf($this.value.toLowerCase())&&items.push(item)}),release(items)}break;case"string":var params={};params[this.options.param]=this.value,UI.$.ajax({url:this.options.source,data:params,type:this.options.method,dataType:"json"}).done(function(json){release(json||[])});break;default:release(null)}}else this.element.removeClass($this.options.loadingClass)},render:function(data){return this.dropdown.empty(),this.selected=!1,this.options.renderer?this.options.renderer.apply(this,[data]):data&&data.length&&(this.dropdown.append(this.template({items:data})),this.show(),this.trigger("show.uk.autocomplete")),this}}),UI.autocomplete}),function(addon){var component;window.UIkit&&(component=addon(UIkit)),"function"==typeof define&&define.amd&&define("uikit-datepicker",["uikit"],function(){return component||addon(UIkit)})}(function(UI){"use strict";var dropdown,moment,active=!1;return UI.component("datepicker",{defaults:{mobile:!1,weekstart:1,i18n:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},format:"YYYY-MM-DD",offsettop:5,maxDate:!1,minDate:!1,pos:"auto",template:function(data,opts){var i,content="";if(content+='',content+='
',content+='
',UI.formSelect){var months,years,minYear,maxYear,currentyear=(new Date).getFullYear(),options=[];for(i=0;i
'+opts.i18n.months[i]+""):options.push(''+opts.i18n.months[i]+" ");for(months=''+opts.i18n.months[data.month]+''+options.join("")+" ",options=[],minYear=data.minDate?data.minDate.year():currentyear-50,maxYear=data.maxDate?data.maxDate.year():currentyear+20,i=minYear;maxYear>=i;i++)i==data.year?options.push(''+i+" "):options.push(''+i+" ");years=''+data.year+''+options.join("")+" ",content+=''+months+" "+years+"
"}else content+=''+opts.i18n.months[data.month]+" "+data.year+"
";for(content+=" ",content+='',content+="",i=0;i"+data.weekdays[i]+"");for(content+=" ",content+="",i=0;i";for(var d=0;d'+day.day.format("D")+" "}content+=""}return content+=" ",content+="
"}},boot:function(){UI.$win.on("resize orientationchange",function(){active&&active.hide()}),UI.$html.on("focus.datepicker.uikit","[data-uk-datepicker]",function(e){var ele=UI.$(this);ele.data("datepicker")||(e.preventDefault(),UI.datepicker(ele,UI.Utils.options(ele.attr("data-uk-datepicker"))),ele.trigger("focus"))}),UI.$html.on("click focus","*",function(e){var target=UI.$(e.target);!active||target[0]==dropdown[0]||target.data("datepicker")||target.parents(".uk-datepicker:first").length||active.hide()})},init:function(){if(!UI.support.touch||"date"!=this.element.attr("type")||this.options.mobile){var $this=this;this.current=this.element.val()?moment(this.element.val(),this.options.format):moment(),this.on("click focus",function(){active!==$this&&$this.pick(this.value?this.value:$this.options.minDate?$this.options.minDate:"")}).on("change",function(){$this.element.val()&&!moment($this.element.val(),$this.options.format).isValid()&&$this.element.val(moment().format($this.options.format))}),dropdown||(dropdown=UI.$('
'),dropdown.on("click",".uk-datepicker-next, .uk-datepicker-previous, [data-date]",function(e){e.stopPropagation(),e.preventDefault();var ele=UI.$(this);return ele.hasClass("uk-datepicker-date-disabled")?!1:void(ele.is("[data-date]")?(active.current=moment(ele.data("date")),active.element.val(active.current.format(active.options.format)).trigger("change"),active.hide()):active.add(ele.hasClass("uk-datepicker-next")?1:-1,"months"))}),dropdown.on("change",".update-picker-month, .update-picker-year",function(){var select=UI.$(this);active[select.is(".update-picker-year")?"setYear":"setMonth"](Number(select.val()))}),dropdown.appendTo("body"))}},pick:function(initdate){var offset=this.element.offset(),css={left:offset.left,right:""};this.current=isNaN(initdate)?moment(initdate,this.options.format):moment(),this.initdate=this.current.format("YYYY-MM-DD"),this.update(),"right"==UI.langdirection&&(css.right=window.innerWidth-(css.left+this.element.outerWidth()),css.left="");var posTop=offset.top-this.element.outerHeight()+this.element.height()-this.options.offsettop-dropdown.outerHeight(),posBottom=offset.top+this.element.outerHeight()+this.options.offsettop;css.top=posBottom,"top"==this.options.pos?css.top=posTop:"auto"==this.options.pos&&window.innerHeight-posBottom-dropdown.outerHeight()<0&&posTop>=0&&(css.top=posTop),dropdown.css(css).show(),this.trigger("show.uk.datepicker"),active=this},add:function(unit,value){this.current.add(unit,value),this.update()},setMonth:function(month){this.current.month(month),this.update()},setYear:function(year){this.current.year(year),this.update()},update:function(){var data=this.getRows(this.current.year(),this.current.month()),tpl=this.options.template(data,this.options);dropdown.html(tpl),this.trigger("update.uk.datepicker")},getRows:function(year,month){var opts=this.options,now=moment().format("YYYY-MM-DD"),days=[31,year%4===0&&year%100!==0||year%400===0?29:28,31,30,31,30,31,31,30,31,30,31][month],before=new Date(year,month,1,12).getDay(),data={month:month,year:year,weekdays:[],days:[],maxDate:!1,minDate:!1},row=[];opts.maxDate!==!1&&(data.maxDate=isNaN(opts.maxDate)?moment(opts.maxDate,opts.format):moment().add(opts.maxDate,"days")),opts.minDate!==!1&&(data.minDate=isNaN(opts.minDate)?moment(opts.minDate,opts.format):moment().add(opts.minDate-1,"days")),data.weekdays=function(){for(var i=0,arr=[];7>i;i++){for(var day=i+(opts.weekstart||0);day>=7;)day-=7;arr.push(opts.i18n.weekdays[day])}return arr}(),opts.weekstart&&opts.weekstart>0&&(before-=opts.weekstart,0>before&&(before+=7));for(var cells=days+before,after=cells;after>7;)after-=7;cells+=7-after;for(var day,isDisabled,isSelected,isToday,isInMonth,i=0,r=0;cells>i;i++)day=new Date(year,month,1+(i-before),12),isDisabled=data.minDate&&data.minDate>day||data.maxDate&&day>data.maxDate,isInMonth=!(before>i||i>=days+before),day=moment(day),isSelected=this.initdate==day.format("YYYY-MM-DD"),isToday=now==day.format("YYYY-MM-DD"),row.push({selected:isSelected,today:isToday,disabled:isDisabled,day:day,inmonth:isInMonth}),7===++r&&(data.days.push(row),row=[],r=0);return data},hide:function(){active&&active===this&&(dropdown.hide(),active=!1,this.trigger("hide.uk.datepicker"))}}),moment=function(undefined){function dfl(a,b,c){switch(arguments.length){case 2:return null!=a?a:b;case 3:return null!=a?a:null!=b?b:c;default:throw new Error("Implement me")}}function hasOwnProp(a,b){return hasOwnProperty.call(a,b)}function defaultParsingFlags(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function printMsg(msg){moment.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+msg)}function deprecate(msg,fn){var firstTime=!0;return extend(function(){return firstTime&&(printMsg(msg),firstTime=!1),fn.apply(this,arguments)},fn)}function deprecateSimple(name,msg){deprecations[name]||(printMsg(msg),deprecations[name]=!0)}function padToken(func,count){return function(a){return leftZeroFill(func.call(this,a),count)}}function ordinalizeToken(func,period){return function(a){return this.localeData().ordinal(func.call(this,a),period)}}function Locale(){}function Moment(config,skipOverflow){skipOverflow!==!1&&checkOverflow(config),copyConfig(this,config),this._d=new Date(+config._d)}function Duration(duration){var normalizedInput=normalizeObjectUnits(duration),years=normalizedInput.year||0,quarters=normalizedInput.quarter||0,months=normalizedInput.month||0,weeks=normalizedInput.week||0,days=normalizedInput.day||0,hours=normalizedInput.hour||0,minutes=normalizedInput.minute||0,seconds=normalizedInput.second||0,milliseconds=normalizedInput.millisecond||0;this._milliseconds=+milliseconds+1e3*seconds+6e4*minutes+36e5*hours,this._days=+days+7*weeks,this._months=+months+3*quarters+12*years,this._data={},this._locale=moment.localeData(),this._bubble()}function extend(a,b){for(var i in b)hasOwnProp(b,i)&&(a[i]=b[i]);return hasOwnProp(b,"toString")&&(a.toString=b.toString),hasOwnProp(b,"valueOf")&&(a.valueOf=b.valueOf),a}function copyConfig(to,from){var i,prop,val;if("undefined"!=typeof from._isAMomentObject&&(to._isAMomentObject=from._isAMomentObject),"undefined"!=typeof from._i&&(to._i=from._i),"undefined"!=typeof from._f&&(to._f=from._f),"undefined"!=typeof from._l&&(to._l=from._l),"undefined"!=typeof from._strict&&(to._strict=from._strict),"undefined"!=typeof from._tzm&&(to._tzm=from._tzm),"undefined"!=typeof from._isUTC&&(to._isUTC=from._isUTC),"undefined"!=typeof from._offset&&(to._offset=from._offset),"undefined"!=typeof from._pf&&(to._pf=from._pf),"undefined"!=typeof from._locale&&(to._locale=from._locale),momentProperties.length>0)for(i in momentProperties)prop=momentProperties[i],val=from[prop],"undefined"!=typeof val&&(to[prop]=val);return to}function absRound(number){return 0>number?Math.ceil(number):Math.floor(number)}function leftZeroFill(number,targetLength,forceSign){for(var output=""+Math.abs(number),sign=number>=0;output.lengthi;i++)(dontConvert&&array1[i]!==array2[i]||!dontConvert&&toInt(array1[i])!==toInt(array2[i]))&&diffs++;return diffs+lengthDiff}function normalizeUnits(units){if(units){var lowered=units.toLowerCase().replace(/(.)s$/,"$1");units=unitAliases[units]||camelFunctions[lowered]||lowered}return units}function normalizeObjectUnits(inputObject){var normalizedProp,prop,normalizedInput={};for(prop in inputObject)hasOwnProp(inputObject,prop)&&(normalizedProp=normalizeUnits(prop),normalizedProp&&(normalizedInput[normalizedProp]=inputObject[prop]));return normalizedInput}function makeList(field){var count,setter;if(0===field.indexOf("week"))count=7,setter="day";else{if(0!==field.indexOf("month"))return;count=12,setter="month"}moment[field]=function(format,index){var i,getter,method=moment._locale[field],results=[];if("number"==typeof format&&(index=format,format=undefined),getter=function(i){var m=moment().utc().set(setter,i);return method.call(moment._locale,m,format||"")},null!=index)return getter(index);for(i=0;count>i;i++)results.push(getter(i));return results}}function toInt(argumentForCoercion){var coercedNumber=+argumentForCoercion,value=0;return 0!==coercedNumber&&isFinite(coercedNumber)&&(value=coercedNumber>=0?Math.floor(coercedNumber):Math.ceil(coercedNumber)),value}function daysInMonth(year,month){return new Date(Date.UTC(year,month+1,0)).getUTCDate()}function weeksInYear(year,dow,doy){return weekOfYear(moment([year,11,31+dow-doy]),dow,doy).week}function daysInYear(year){return isLeapYear(year)?366:365}function isLeapYear(year){return year%4===0&&year%100!==0||year%400===0}function checkOverflow(m){var overflow;m._a&&-2===m._pf.overflow&&(overflow=m._a[MONTH]<0||m._a[MONTH]>11?MONTH:m._a[DATE]<1||m._a[DATE]>daysInMonth(m._a[YEAR],m._a[MONTH])?DATE:m._a[HOUR]<0||m._a[HOUR]>23?HOUR:m._a[MINUTE]<0||m._a[MINUTE]>59?MINUTE:m._a[SECOND]<0||m._a[SECOND]>59?SECOND:m._a[MILLISECOND]<0||m._a[MILLISECOND]>999?MILLISECOND:-1,m._pf._overflowDayOfYear&&(YEAR>overflow||overflow>DATE)&&(overflow=DATE),m._pf.overflow=overflow)}function isValid(m){return null==m._isValid&&(m._isValid=!isNaN(m._d.getTime())&&m._pf.overflow<0&&!m._pf.empty&&!m._pf.invalidMonth&&!m._pf.nullInput&&!m._pf.invalidFormat&&!m._pf.userInvalidated,m._strict&&(m._isValid=m._isValid&&0===m._pf.charsLeftOver&&0===m._pf.unusedTokens.length)),m._isValid}function normalizeLocale(key){return key?key.toLowerCase().replace("_","-"):key}function chooseLocale(names){for(var j,next,locale,split,i=0;i0;){if(locale=loadLocale(split.slice(0,j).join("-")))return locale;if(next&&next.length>=j&&compareArrays(split,next,!0)>=j-1)break;j--}i++}return null}function loadLocale(name){var oldLocale=null;if(!locales[name]&&hasModule)try{oldLocale=moment.locale(),require("./locale/"+name),moment.locale(oldLocale)}catch(e){}return locales[name]}function makeAs(input,model){return model._isUTC?moment(input).zone(model._offset||0):moment(input).local()}function removeFormattingTokens(input){return input.match(/\[[\s\S]/)?input.replace(/^\[|\]$/g,""):input.replace(/\\/g,"")}function makeFormatFunction(format){var i,length,array=format.match(formattingTokens);for(i=0,length=array.length;length>i;i++)formatTokenFunctions[array[i]]?array[i]=formatTokenFunctions[array[i]]:array[i]=removeFormattingTokens(array[i]);return function(mom){var output="";for(i=0;length>i;i++)output+=array[i]instanceof Function?array[i].call(mom,format):array[i];return output}}function formatMoment(m,format){return m.isValid()?(format=expandFormat(format,m.localeData()),formatFunctions[format]||(formatFunctions[format]=makeFormatFunction(format)),formatFunctions[format](m)):m.localeData().invalidDate()}function expandFormat(format,locale){function replaceLongDateFormatTokens(input){return locale.longDateFormat(input)||input}var i=5;for(localFormattingTokens.lastIndex=0;i>=0&&localFormattingTokens.test(format);)format=format.replace(localFormattingTokens,replaceLongDateFormatTokens),localFormattingTokens.lastIndex=0,i-=1;return format}function getParseRegexForToken(token,config){var a,strict=config._strict;switch(token){case"Q":return parseTokenOneDigit;case"DDDD":return parseTokenThreeDigits;case"YYYY":case"GGGG":case"gggg":return strict?parseTokenFourDigits:parseTokenOneToFourDigits;case"Y":case"G":case"g":return parseTokenSignedNumber;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return strict?parseTokenSixDigits:parseTokenOneToSixDigits;case"S":if(strict)return parseTokenOneDigit;case"SS":if(strict)return parseTokenTwoDigits;case"SSS":if(strict)return parseTokenThreeDigits;case"DDD":return parseTokenOneToThreeDigits;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return parseTokenWord;case"a":case"A":return config._locale._meridiemParse;case"X":return parseTokenTimestampMs;case"Z":case"ZZ":return parseTokenTimezone;case"T":return parseTokenT;case"SSSS":return parseTokenDigits;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return strict?parseTokenTwoDigits:parseTokenOneOrTwoDigits;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return parseTokenOneOrTwoDigits;case"Do":return parseTokenOrdinal;default:return a=new RegExp(regexpEscape(unescapeFormat(token.replace("\\","")),"i"))}}function timezoneMinutesFromString(string){string=string||"";var possibleTzMatches=string.match(parseTokenTimezone)||[],tzChunk=possibleTzMatches[possibleTzMatches.length-1]||[],parts=(tzChunk+"").match(parseTimezoneChunker)||["-",0,0],minutes=+(60*parts[1])+toInt(parts[2]);return"+"===parts[0]?-minutes:minutes}function addTimeToArrayFromToken(token,input,config){var a,datePartArray=config._a;switch(token){case"Q":null!=input&&(datePartArray[MONTH]=3*(toInt(input)-1));break;case"M":case"MM":null!=input&&(datePartArray[MONTH]=toInt(input)-1);break;case"MMM":case"MMMM":a=config._locale.monthsParse(input),null!=a?datePartArray[MONTH]=a:config._pf.invalidMonth=input;break;case"D":case"DD":null!=input&&(datePartArray[DATE]=toInt(input));break;case"Do":null!=input&&(datePartArray[DATE]=toInt(parseInt(input,10)));break;case"DDD":case"DDDD":null!=input&&(config._dayOfYear=toInt(input));break;case"YY":datePartArray[YEAR]=moment.parseTwoDigitYear(input);break;case"YYYY":case"YYYYY":case"YYYYYY":datePartArray[YEAR]=toInt(input);break;case"a":case"A":config._isPm=config._locale.isPM(input);break;case"H":case"HH":case"h":case"hh":datePartArray[HOUR]=toInt(input);break;case"m":case"mm":datePartArray[MINUTE]=toInt(input);break;case"s":case"ss":datePartArray[SECOND]=toInt(input);break;case"S":case"SS":case"SSS":case"SSSS":datePartArray[MILLISECOND]=toInt(1e3*("0."+input));break;case"X":config._d=new Date(1e3*parseFloat(input));break;case"Z":case"ZZ":config._useUTC=!0,config._tzm=timezoneMinutesFromString(input);break;case"dd":case"ddd":case"dddd":a=config._locale.weekdaysParse(input),null!=a?(config._w=config._w||{},config._w.d=a):config._pf.invalidWeekday=input;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":token=token.substr(0,1);case"gggg":case"GGGG":case"GGGGG":token=token.substr(0,2),input&&(config._w=config._w||{},config._w[token]=toInt(input));break;case"gg":case"GG":config._w=config._w||{},config._w[token]=moment.parseTwoDigitYear(input)}}function dayOfYearFromWeekInfo(config){var w,weekYear,week,weekday,dow,doy,temp;w=config._w,null!=w.GG||null!=w.W||null!=w.E?(dow=1,doy=4,weekYear=dfl(w.GG,config._a[YEAR],weekOfYear(moment(),1,4).year),week=dfl(w.W,1),weekday=dfl(w.E,1)):(dow=config._locale._week.dow,doy=config._locale._week.doy,weekYear=dfl(w.gg,config._a[YEAR],weekOfYear(moment(),dow,doy).year),week=dfl(w.w,1),null!=w.d?(weekday=w.d,dow>weekday&&++week):weekday=null!=w.e?w.e+dow:dow),temp=dayOfYearFromWeeks(weekYear,week,weekday,doy,dow),config._a[YEAR]=temp.year,config._dayOfYear=temp.dayOfYear}function dateFromConfig(config){var i,date,currentDate,yearToUse,input=[];if(!config._d){for(currentDate=currentDateArray(config),config._w&&null==config._a[DATE]&&null==config._a[MONTH]&&dayOfYearFromWeekInfo(config),config._dayOfYear&&(yearToUse=dfl(config._a[YEAR],currentDate[YEAR]),config._dayOfYear>daysInYear(yearToUse)&&(config._pf._overflowDayOfYear=!0),date=makeUTCDate(yearToUse,0,config._dayOfYear),config._a[MONTH]=date.getUTCMonth(),config._a[DATE]=date.getUTCDate()),i=0;3>i&&null==config._a[i];++i)config._a[i]=input[i]=currentDate[i];for(;7>i;i++)config._a[i]=input[i]=null==config._a[i]?2===i?1:0:config._a[i];config._d=(config._useUTC?makeUTCDate:makeDate).apply(null,input),null!=config._tzm&&config._d.setUTCMinutes(config._d.getUTCMinutes()+config._tzm)}}function dateFromObject(config){var normalizedInput;config._d||(normalizedInput=normalizeObjectUnits(config._i),config._a=[normalizedInput.year,normalizedInput.month,normalizedInput.day,normalizedInput.hour,normalizedInput.minute,normalizedInput.second,normalizedInput.millisecond],dateFromConfig(config))}function currentDateArray(config){var now=new Date;return config._useUTC?[now.getUTCFullYear(),now.getUTCMonth(),now.getUTCDate()]:[now.getFullYear(),now.getMonth(),now.getDate()]}function makeDateFromStringAndFormat(config){if(config._f===moment.ISO_8601)return void parseISO(config);config._a=[],config._pf.empty=!0;var i,parsedInput,tokens,token,skipped,string=""+config._i,stringLength=string.length,totalParsedInputLength=0;for(tokens=expandFormat(config._f,config._locale).match(formattingTokens)||[],i=0;i0&&config._pf.unusedInput.push(skipped),string=string.slice(string.indexOf(parsedInput)+parsedInput.length),totalParsedInputLength+=parsedInput.length),formatTokenFunctions[token]?(parsedInput?config._pf.empty=!1:config._pf.unusedTokens.push(token),addTimeToArrayFromToken(token,parsedInput,config)):config._strict&&!parsedInput&&config._pf.unusedTokens.push(token);config._pf.charsLeftOver=stringLength-totalParsedInputLength,string.length>0&&config._pf.unusedInput.push(string),config._isPm&&config._a[HOUR]<12&&(config._a[HOUR]+=12),config._isPm===!1&&12===config._a[HOUR]&&(config._a[HOUR]=0),dateFromConfig(config),checkOverflow(config)}function unescapeFormat(s){return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(matched,p1,p2,p3,p4){return p1||p2||p3||p4})}function regexpEscape(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function makeDateFromStringAndArray(config){var tempConfig,bestMoment,scoreToBeat,i,currentScore;if(0===config._f.length)return config._pf.invalidFormat=!0,void(config._d=new Date(NaN));for(i=0;icurrentScore)&&(scoreToBeat=currentScore,bestMoment=tempConfig));extend(config,bestMoment||tempConfig)}function parseISO(config){var i,l,string=config._i,match=isoRegex.exec(string);if(match){for(config._pf.iso=!0,i=0,l=isoDates.length;l>i;i++)if(isoDates[i][1].exec(string)){config._f=isoDates[i][0]+(match[6]||" ");break}for(i=0,l=isoTimes.length;l>i;i++)if(isoTimes[i][1].exec(string)){config._f+=isoTimes[i][0];break}string.match(parseTokenTimezone)&&(config._f+="Z"),makeDateFromStringAndFormat(config)}else config._isValid=!1}function makeDateFromString(config){parseISO(config),config._isValid===!1&&(delete config._isValid,
-moment.createFromInputFallback(config))}function map(arr,fn){var i,res=[];for(i=0;iy&&date.setFullYear(y),date}function makeUTCDate(y){var date=new Date(Date.UTC.apply(null,arguments));return 1970>y&&date.setUTCFullYear(y),date}function parseWeekday(input,locale){if("string"==typeof input)if(isNaN(input)){if(input=locale.weekdaysParse(input),"number"!=typeof input)return null}else input=parseInt(input,10);return input}function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture)}function relativeTime(posNegDuration,withoutSuffix,locale){var duration=moment.duration(posNegDuration).abs(),seconds=round(duration.as("s")),minutes=round(duration.as("m")),hours=round(duration.as("h")),days=round(duration.as("d")),months=round(duration.as("M")),years=round(duration.as("y")),args=seconds0,args[4]=locale,substituteTimeAgo.apply({},args)}function weekOfYear(mom,firstDayOfWeek,firstDayOfWeekOfYear){var adjustedMoment,end=firstDayOfWeekOfYear-firstDayOfWeek,daysToDayOfWeek=firstDayOfWeekOfYear-mom.day();return daysToDayOfWeek>end&&(daysToDayOfWeek-=7),end-7>daysToDayOfWeek&&(daysToDayOfWeek+=7),adjustedMoment=moment(mom).add(daysToDayOfWeek,"d"),{week:Math.ceil(adjustedMoment.dayOfYear()/7),year:adjustedMoment.year()}}function dayOfYearFromWeeks(year,week,weekday,firstDayOfWeekOfYear,firstDayOfWeek){var daysToAdd,dayOfYear,d=makeUTCDate(year,0,1).getUTCDay();return d=0===d?7:d,weekday=null!=weekday?weekday:firstDayOfWeek,daysToAdd=firstDayOfWeek-d+(d>firstDayOfWeekOfYear?7:0)-(firstDayOfWeek>d?7:0),dayOfYear=7*(week-1)+(weekday-firstDayOfWeek)+daysToAdd+1,{year:dayOfYear>0?year:year-1,dayOfYear:dayOfYear>0?dayOfYear:daysInYear(year-1)+dayOfYear}}function makeMoment(config){var input=config._i,format=config._f;return config._locale=config._locale||moment.localeData(config._l),null===input||format===undefined&&""===input?moment.invalid({nullInput:!0}):("string"==typeof input&&(config._i=input=config._locale.preparse(input)),moment.isMoment(input)?new Moment(input,!0):(format?isArray(format)?makeDateFromStringAndArray(config):makeDateFromStringAndFormat(config):makeDateFromInput(config),new Moment(config)))}function pickBy(fn,moments){var res,i;if(1===moments.length&&isArray(moments[0])&&(moments=moments[0]),!moments.length)return moment();for(res=moments[0],i=1;i=0?"+":"-";return sign+leftZeroFill(Math.abs(y),6)},gg:function(){return leftZeroFill(this.weekYear()%100,2)},gggg:function(){return leftZeroFill(this.weekYear(),4)},ggggg:function(){return leftZeroFill(this.weekYear(),5)},GG:function(){return leftZeroFill(this.isoWeekYear()%100,2)},GGGG:function(){return leftZeroFill(this.isoWeekYear(),4)},GGGGG:function(){return leftZeroFill(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return toInt(this.milliseconds()/100)},SS:function(){return leftZeroFill(toInt(this.milliseconds()/10),2)},SSS:function(){return leftZeroFill(this.milliseconds(),3)},SSSS:function(){return leftZeroFill(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+leftZeroFill(toInt(a/60),2)+":"+leftZeroFill(toInt(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+leftZeroFill(toInt(a/60),2)+leftZeroFill(toInt(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},deprecations={},lists=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];ordinalizeTokens.length;)i=ordinalizeTokens.pop(),formatTokenFunctions[i+"o"]=ordinalizeToken(formatTokenFunctions[i],i);for(;paddedTokens.length;)i=paddedTokens.pop(),formatTokenFunctions[i+i]=padToken(formatTokenFunctions[i],2);formatTokenFunctions.DDDD=padToken(formatTokenFunctions.DDD,3),extend(Locale.prototype,{set:function(config){var prop,i;for(i in config)prop=config[i],"function"==typeof prop?this[i]=prop:this["_"+i]=prop},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(m){return this._months[m.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(m){return this._monthsShort[m.month()]},monthsParse:function(monthName){var i,mom,regex;for(this._monthsParse||(this._monthsParse=[]),i=0;12>i;i++)if(this._monthsParse[i]||(mom=moment.utc([2e3,i]),regex="^"+this.months(mom,"")+"|^"+this.monthsShort(mom,""),this._monthsParse[i]=new RegExp(regex.replace(".",""),"i")),this._monthsParse[i].test(monthName))return i},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(m){return this._weekdays[m.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(m){return this._weekdaysShort[m.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(m){return this._weekdaysMin[m.day()]},weekdaysParse:function(weekdayName){var i,mom,regex;for(this._weekdaysParse||(this._weekdaysParse=[]),i=0;7>i;i++)if(this._weekdaysParse[i]||(mom=moment([2e3,1]).day(i),regex="^"+this.weekdays(mom,"")+"|^"+this.weekdaysShort(mom,"")+"|^"+this.weekdaysMin(mom,""),this._weekdaysParse[i]=new RegExp(regex.replace(".",""),"i")),this._weekdaysParse[i].test(weekdayName))return i},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(key){var output=this._longDateFormat[key];return!output&&this._longDateFormat[key.toUpperCase()]&&(output=this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(val){return val.slice(1)}),this._longDateFormat[key]=output),output},isPM:function(input){return"p"===(input+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(hours,minutes,isLower){return hours>11?isLower?"pm":"PM":isLower?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(key,mom){var output=this._calendar[key];return"function"==typeof output?output.apply(mom):output},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(number,withoutSuffix,string,isFuture){var output=this._relativeTime[string];return"function"==typeof output?output(number,withoutSuffix,string,isFuture):output.replace(/%d/i,number)},pastFuture:function(diff,output){var format=this._relativeTime[diff>0?"future":"past"];return"function"==typeof format?format(output):format.replace(/%s/i,output)},ordinal:function(number){return this._ordinal.replace("%d",number)},_ordinal:"%d",preparse:function(string){return string},postformat:function(string){return string},week:function(mom){return weekOfYear(mom,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),moment=function(input,format,locale,strict){var c;return"boolean"==typeof locale&&(strict=locale,locale=undefined),c={},c._isAMomentObject=!0,c._i=input,c._f=format,c._l=locale,c._strict=strict,c._isUTC=!1,c._pf=defaultParsingFlags(),makeMoment(c)},moment.suppressDeprecationWarnings=!1,moment.createFromInputFallback=deprecate("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(config){config._d=new Date(config._i)}),moment.min=function(){var args=[].slice.call(arguments,0);return pickBy("isBefore",args)},moment.max=function(){var args=[].slice.call(arguments,0);return pickBy("isAfter",args)},moment.utc=function(input,format,locale,strict){var c;return"boolean"==typeof locale&&(strict=locale,locale=undefined),c={},c._isAMomentObject=!0,c._useUTC=!0,c._isUTC=!0,c._l=locale,c._i=input,c._f=format,c._strict=strict,c._pf=defaultParsingFlags(),makeMoment(c).utc()},moment.unix=function(input){return moment(1e3*input)},moment.duration=function(input,key){var sign,ret,parseIso,diffRes,duration=input,match=null;return moment.isDuration(input)?duration={ms:input._milliseconds,d:input._days,M:input._months}:"number"==typeof input?(duration={},key?duration[key]=input:duration.milliseconds=input):(match=aspNetTimeSpanJsonRegex.exec(input))?(sign="-"===match[1]?-1:1,duration={y:0,d:toInt(match[DATE])*sign,h:toInt(match[HOUR])*sign,m:toInt(match[MINUTE])*sign,s:toInt(match[SECOND])*sign,ms:toInt(match[MILLISECOND])*sign}):(match=isoDurationRegex.exec(input))?(sign="-"===match[1]?-1:1,parseIso=function(inp){var res=inp&&parseFloat(inp.replace(",","."));return(isNaN(res)?0:res)*sign},duration={y:parseIso(match[2]),M:parseIso(match[3]),d:parseIso(match[4]),h:parseIso(match[5]),m:parseIso(match[6]),s:parseIso(match[7]),w:parseIso(match[8])}):"object"==typeof duration&&("from"in duration||"to"in duration)&&(diffRes=momentsDifference(moment(duration.from),moment(duration.to)),duration={},duration.ms=diffRes.milliseconds,duration.M=diffRes.months),ret=new Duration(duration),moment.isDuration(input)&&hasOwnProp(input,"_locale")&&(ret._locale=input._locale),ret},moment.version=VERSION,moment.defaultFormat=isoFormat,moment.ISO_8601=function(){},moment.momentProperties=momentProperties,moment.updateOffset=function(){},moment.relativeTimeThreshold=function(threshold,limit){return relativeTimeThresholds[threshold]===undefined?!1:limit===undefined?relativeTimeThresholds[threshold]:(relativeTimeThresholds[threshold]=limit,!0)},moment.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",function(key,value){return moment.locale(key,value)}),moment.locale=function(key,values){var data;return key&&(data="undefined"!=typeof values?moment.defineLocale(key,values):moment.localeData(key),data&&(moment.duration._locale=moment._locale=data)),moment._locale._abbr},moment.defineLocale=function(name,values){return null!==values?(values.abbr=name,locales[name]||(locales[name]=new Locale),locales[name].set(values),moment.locale(name),locales[name]):(delete locales[name],null)},moment.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",function(key){return moment.localeData(key)}),moment.localeData=function(key){var locale;if(key&&key._locale&&key._locale._abbr&&(key=key._locale._abbr),!key)return moment._locale;if(!isArray(key)){if(locale=loadLocale(key))return locale;key=[key]}return chooseLocale(key)},moment.isMoment=function(obj){return obj instanceof Moment||null!=obj&&hasOwnProp(obj,"_isAMomentObject")},moment.isDuration=function(obj){return obj instanceof Duration};for(i=lists.length-1;i>=0;--i)makeList(lists[i]);moment.normalizeUnits=function(units){return normalizeUnits(units)},moment.invalid=function(flags){var m=moment.utc(NaN);return null!=flags?extend(m._pf,flags):m._pf.userInvalidated=!0,m},moment.parseZone=function(){return moment.apply(null,arguments).parseZone()},moment.parseTwoDigitYear=function(input){return toInt(input)+(toInt(input)>68?1900:2e3)},extend(moment.fn=Moment.prototype,{clone:function(){return moment(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var m=moment(this).utc();return 00:!1},parsingFlags:function(){return extend({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(keepLocalTime){return this.zone(0,keepLocalTime)},local:function(keepLocalTime){return this._isUTC&&(this.zone(0,keepLocalTime),this._isUTC=!1,keepLocalTime&&this.add(this._dateTzOffset(),"m")),this},format:function(inputString){var output=formatMoment(this,inputString||moment.defaultFormat);return this.localeData().postformat(output)},add:createAdder(1,"add"),subtract:createAdder(-1,"subtract"),diff:function(input,units,asFloat){var diff,output,daysAdjust,that=makeAs(input,this),zoneDiff=6e4*(this.zone()-that.zone());return units=normalizeUnits(units),"year"===units||"month"===units?(diff=432e5*(this.daysInMonth()+that.daysInMonth()),output=12*(this.year()-that.year())+(this.month()-that.month()),daysAdjust=this-moment(this).startOf("month")-(that-moment(that).startOf("month")),daysAdjust-=6e4*(this.zone()-moment(this).startOf("month").zone()-(that.zone()-moment(that).startOf("month").zone())),output+=daysAdjust/diff,"year"===units&&(output/=12)):(diff=this-that,output="second"===units?diff/1e3:"minute"===units?diff/6e4:"hour"===units?diff/36e5:"day"===units?(diff-zoneDiff)/864e5:"week"===units?(diff-zoneDiff)/6048e5:diff),asFloat?output:absRound(output)},from:function(time,withoutSuffix){return moment.duration({to:this,from:time}).locale(this.locale()).humanize(!withoutSuffix)},fromNow:function(withoutSuffix){return this.from(moment(),withoutSuffix)},calendar:function(time){var now=time||moment(),sod=makeAs(now,this).startOf("day"),diff=this.diff(sod,"days",!0),format=-6>diff?"sameElse":-1>diff?"lastWeek":0>diff?"lastDay":1>diff?"sameDay":2>diff?"nextDay":7>diff?"nextWeek":"sameElse";return this.format(this.localeData().calendar(format,this))},isLeapYear:function(){return isLeapYear(this.year())},isDST:function(){return this.zone()+input):+this.clone().startOf(units)>+moment(input).startOf(units)},isBefore:function(input,units){return units=normalizeUnits("undefined"!=typeof units?units:"millisecond"),"millisecond"===units?(input=moment.isMoment(input)?input:moment(input),+input>+this):+this.clone().startOf(units)<+moment(input).startOf(units)},isSame:function(input,units){return units=normalizeUnits(units||"millisecond"),"millisecond"===units?(input=moment.isMoment(input)?input:moment(input),+this===+input):+this.clone().startOf(units)===+makeAs(input,this).startOf(units)},min:deprecate("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(other){return other=moment.apply(null,arguments),this>other?this:other}),max:deprecate("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(other){return other=moment.apply(null,arguments),other>this?this:other}),zone:function(input,keepLocalTime){var localAdjust,offset=this._offset||0;return null==input?this._isUTC?offset:this._dateTzOffset():("string"==typeof input&&(input=timezoneMinutesFromString(input)),Math.abs(input)<16&&(input=60*input),!this._isUTC&&keepLocalTime&&(localAdjust=this._dateTzOffset()),this._offset=input,this._isUTC=!0,null!=localAdjust&&this.subtract(localAdjust,"m"),offset!==input&&(!keepLocalTime||this._changeInProgress?addOrSubtractDurationFromMoment(this,moment.duration(offset-input,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,moment.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(input){return input=input?moment(input).zone():0,(this.zone()-input)%60===0},daysInMonth:function(){return daysInMonth(this.year(),this.month())},dayOfYear:function(input){var dayOfYear=round((moment(this).startOf("day")-moment(this).startOf("year"))/864e5)+1;return null==input?dayOfYear:this.add(input-dayOfYear,"d")},quarter:function(input){return null==input?Math.ceil((this.month()+1)/3):this.month(3*(input-1)+this.month()%3)},weekYear:function(input){var year=weekOfYear(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==input?year:this.add(input-year,"y")},isoWeekYear:function(input){var year=weekOfYear(this,1,4).year;return null==input?year:this.add(input-year,"y")},week:function(input){var week=this.localeData().week(this);return null==input?week:this.add(7*(input-week),"d")},isoWeek:function(input){var week=weekOfYear(this,1,4).week;return null==input?week:this.add(7*(input-week),"d")},weekday:function(input){var weekday=(this.day()+7-this.localeData()._week.dow)%7;return null==input?weekday:this.add(input-weekday,"d")},isoWeekday:function(input){return null==input?this.day()||7:this.day(this.day()%7?input:input-7)},isoWeeksInYear:function(){return weeksInYear(this.year(),1,4)},weeksInYear:function(){var weekInfo=this.localeData()._week;return weeksInYear(this.year(),weekInfo.dow,weekInfo.doy)},get:function(units){return units=normalizeUnits(units),this[units]()},set:function(units,value){return units=normalizeUnits(units),"function"==typeof this[units]&&this[units](value),this},locale:function(key){var newLocaleData;return key===undefined?this._locale._abbr:(newLocaleData=moment.localeData(key),null!=newLocaleData&&(this._locale=newLocaleData),this)},lang:deprecate("moment().lang() is deprecated. Use moment().localeData() instead.",function(key){return key===undefined?this.localeData():this.locale(key)}),localeData:function(){return this._locale},_dateTzOffset:function(){return 15*Math.round(this._d.getTimezoneOffset()/15)}}),moment.fn.millisecond=moment.fn.milliseconds=makeAccessor("Milliseconds",!1),moment.fn.second=moment.fn.seconds=makeAccessor("Seconds",!1),moment.fn.minute=moment.fn.minutes=makeAccessor("Minutes",!1),moment.fn.hour=moment.fn.hours=makeAccessor("Hours",!0),moment.fn.date=makeAccessor("Date",!0),moment.fn.dates=deprecate("dates accessor is deprecated. Use date instead.",makeAccessor("Date",!0)),moment.fn.year=makeAccessor("FullYear",!0),moment.fn.years=deprecate("years accessor is deprecated. Use year instead.",makeAccessor("FullYear",!0)),moment.fn.days=moment.fn.day,moment.fn.months=moment.fn.month,moment.fn.weeks=moment.fn.week,moment.fn.isoWeeks=moment.fn.isoWeek,moment.fn.quarters=moment.fn.quarter,moment.fn.toJSON=moment.fn.toISOString,extend(moment.duration.fn=Duration.prototype,{_bubble:function(){var seconds,minutes,hours,milliseconds=this._milliseconds,days=this._days,months=this._months,data=this._data,years=0;data.milliseconds=milliseconds%1e3,seconds=absRound(milliseconds/1e3),data.seconds=seconds%60,minutes=absRound(seconds/60),data.minutes=minutes%60,hours=absRound(minutes/60),data.hours=hours%24,days+=absRound(hours/24),years=absRound(daysToYears(days)),days-=absRound(yearsToDays(years)),months+=absRound(days/30),days%=30,years+=absRound(months/12),months%=12,data.days=days,data.months=months,data.years=years},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return absRound(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*toInt(this._months/12)},humanize:function(withSuffix){var output=relativeTime(this,!withSuffix,this.localeData());return withSuffix&&(output=this.localeData().pastFuture(+this,output)),this.localeData().postformat(output)},add:function(input,val){var dur=moment.duration(input,val);return this._milliseconds+=dur._milliseconds,this._days+=dur._days,this._months+=dur._months,this._bubble(),this},subtract:function(input,val){var dur=moment.duration(input,val);return this._milliseconds-=dur._milliseconds,this._days-=dur._days,this._months-=dur._months,this._bubble(),this},get:function(units){return units=normalizeUnits(units),this[units.toLowerCase()+"s"]()},as:function(units){var days,months;if(units=normalizeUnits(units),"month"===units||"year"===units)return days=this._days+this._milliseconds/864e5,months=this._months+12*daysToYears(days),"month"===units?months:months/12;switch(days=this._days+yearsToDays(this._months/12),units){case"week":return days/7+this._milliseconds/6048e5;case"day":return days+this._milliseconds/864e5;case"hour":return 24*days+this._milliseconds/36e5;case"minute":return 24*days*60+this._milliseconds/6e4;case"second":return 24*days*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(24*days*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+units)}},lang:moment.fn.lang,locale:moment.fn.locale,toIsoString:deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var years=Math.abs(this.years()),months=Math.abs(this.months()),days=Math.abs(this.days()),hours=Math.abs(this.hours()),minutes=Math.abs(this.minutes()),seconds=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(years?years+"Y":"")+(months?months+"M":"")+(days?days+"D":"")+(hours||minutes||seconds?"T":"")+(hours?hours+"H":"")+(minutes?minutes+"M":"")+(seconds?seconds+"S":""):"P0D"},localeData:function(){return this._locale}}),moment.duration.fn.toString=moment.duration.fn.toISOString;for(i in unitMillisecondFactors)hasOwnProp(unitMillisecondFactors,i)&&makeDurationGetter(i.toLowerCase());return moment.duration.fn.asMilliseconds=function(){return this.as("ms")},moment.duration.fn.asSeconds=function(){return this.as("s")},moment.duration.fn.asMinutes=function(){return this.as("m")},moment.duration.fn.asHours=function(){return this.as("h")},moment.duration.fn.asDays=function(){return this.as("d")},moment.duration.fn.asWeeks=function(){return this.as("weeks")},moment.duration.fn.asMonths=function(){return this.as("M")},moment.duration.fn.asYears=function(){return this.as("y")},moment.locale("en",{ordinal:function(number){var b=number%10,output=1===toInt(number%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return number+output}}),moment}.call(this),UI.Utils.moment=moment,UI.datepicker}),function(addon){var component;window.UIkit&&(component=addon(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-password",["uikit"],function(){return component||addon(UIkit)})}(function(UI){"use strict";return UI.component("formPassword",{defaults:{lblShow:"Show",lblHide:"Hide"},boot:function(){UI.$html.on("click.formpassword.uikit","[data-uk-form-password]",function(e){var ele=UI.$(this);ele.data("formPassword")||(e.preventDefault(),UI.formPassword(ele,UI.Utils.options(ele.attr("data-uk-form-password"))),ele.trigger("click"))})},init:function(){var $this=this;this.on("click",function(e){if(e.preventDefault(),$this.input.length){var type=$this.input.attr("type");$this.input.attr("type","text"==type?"password":"text"),$this.element.html($this.options["text"==type?"lblShow":"lblHide"])}}),this.input=this.element.next("input").length?this.element.next("input"):this.element.prev("input"),this.element.html(this.options[this.input.is("[type='password']")?"lblShow":"lblHide"]),this.element.data("formPassword",this)}}),UI.formPassword}),function(addon){var component;window.UIkit&&(component=addon(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-select",["uikit"],function(){return component||addon(UIkit)})}(function(UI){"use strict";return UI.component("formSelect",{defaults:{target:">span:first",activeClass:"uk-active"},boot:function(){UI.ready(function(context){UI.$("[data-uk-form-select]",context).each(function(){var ele=UI.$(this);ele.data("formSelect")||UI.formSelect(ele,UI.Utils.options(ele.attr("data-uk-form-select")))})})},init:function(){var $this=this;this.target=this.find(this.options.target),this.select=this.find("select"),this.select.on("change",function(){var select=$this.select[0],fn=function(){try{$this.target.text(select.options[select.selectedIndex].text)}catch(e){}return $this.element[$this.select.val()?"addClass":"removeClass"]($this.options.activeClass),fn};return fn()}()),this.element.data("formSelect",this)}}),UI.formSelect}),function(addon){var component;window.UIkit&&(component=addon(UIkit)),"function"==typeof define&&define.amd&&define("uikit-grid",["uikit"],function(){return component||addon(UIkit)})}(function(UI){"use strict";function getElementSize(ele){return _getSize(ele)}UI.component("grid",{defaults:{colwidth:"auto",animation:!0,duration:300,gutter:0,controls:!1,filter:!1},boot:function(){UI.ready(function(context){UI.$("[data-uk-grid]",context).each(function(){var ele=UI.$(this);ele.data("grid")||UI.grid(ele,UI.Utils.options(ele.attr("data-uk-grid")))})})},init:function(){var $this=this,gutter=String(this.options.gutter).trim().split(" ");this.gutterv=parseInt(gutter[0],10),this.gutterh=parseInt(gutter[1]||gutter[0],10),this.element.css({position:"relative"}),this.controls=null,this.options.controls&&(this.controls=UI.$(this.options.controls),
-this.controls.on("click","[data-uk-filter]",function(e){e.preventDefault(),$this.filter(UI.$(this).data("ukFilter"))}),this.controls.on("click","[data-uk-sort]",function(e){e.preventDefault();var cmd=UI.$(this).attr("data-uk-sort").split(":");$this.sort(cmd[0],cmd[1])})),UI.$win.on("load resize orientationchange",UI.Utils.debounce(function(){$this.currentfilter?$this.filter($this.currentfilter):this.updateLayout()}.bind(this),100)),this.on("display.uk.check",function(){$this.element.is(":visible")&&$this.updateLayout()}),UI.$html.on("changed.uk.dom",function(e){$this.updateLayout()}),this.options.filter!==!1?this.filter(this.options.filter):this.updateLayout()},_prepareElements:function(){var css,children=this.element.children(":not([data-grid-prepared])");children.length&&(css={position:"absolute","box-sizing":"border-box",width:"auto"==this.options.colwidth?"":this.options.colwidth},this.options.gutter&&(css["padding-left"]=this.gutterh,css["padding-bottom"]=this.gutterv,this.element.css("margin-left",-1*this.gutterh)),children.attr("data-grid-prepared","true").css(css))},updateLayout:function(elements){this._prepareElements(),elements=elements||this.element.children(":visible");var item,width,height,pos,i,z,max,size,children=elements,maxwidth=this.element.width()+2*this.gutterh+2,left=0,top=0,positions=[];this.trigger("beforeupdate.uk.grid",[children]),children.each(function(index){for(size=getElementSize(this),item=UI.$(this),width=size.outerWidth,height=size.outerHeight,left=0,top=0,i=0,max=positions.length;max>i;i++)pos=positions[i],left<=pos.aX&&(left=pos.aX),left+width>maxwidth&&(left=0),top<=pos.aY&&(top=pos.aY);positions.push({ele:item,top:top,left:left,width:width,height:height,aY:top+height,aX:left+width})});var posPrev,maxHeight=0;for(i=0,max=positions.length;max>i;i++){for(pos=positions[i],top=0,z=0;i>z;z++)posPrev=positions[z],pos.left-1&&(infilter=!0)})),elements[infilter?"visible":"hidden"].push(ele)}),elements.hidden=UI.$(elements.hidden).map(function(){return this[0]}),elements.visible=UI.$(elements.visible).map(function(){return this[0]}),elements.hidden.attr("aria-hidden","true").filter(":visible").fadeOut(this.options.duration),elements.visible.attr("aria-hidden","false").filter(":hidden").css("opacity",0).show(),$this.updateLayout(elements.visible),this.controls&&this.controls.length&&this.controls.find("[data-uk-filter]").removeClass("uk-active").filter('[data-uk-filter="'+filter+'"]').addClass("uk-active")},sort:function(by,order){order=order||1,"string"==typeof order&&(order="desc"==order.toLowerCase()?-1:1);var elements=this.element.children();elements.sort(function(a,b){return a=UI.$(a),b=UI.$(b),(b.data(by)||"")<(a.data(by)||"")?order:-1*order}).appendTo(this.element),this.updateLayout(elements.filter(":visible")),this.controls&&this.controls.length&&this.controls.find("[data-uk-sort]").removeClass("uk-active").filter('[data-uk-sort="'+by+":"+(-1==order?"desc":"asc")+'"]').addClass("uk-active")}});var _getSize=function(){function getStyleProperty(propName){if(propName){if("string"==typeof docElemStyle[propName])return propName;propName=propName.charAt(0).toUpperCase()+propName.slice(1);for(var prefixed,i=0,len=prefixes.length;len>i;i++)if(prefixed=prefixes[i]+propName,"string"==typeof docElemStyle[prefixed])return prefixed}}function getStyleSize(value){var num=parseFloat(value),isValid=-1===value.indexOf("%")&&!isNaN(num);return isValid&&num}function noop(){}function getZeroSize(){for(var size={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},i=0,len=measurements.length;len>i;i++){var measurement=measurements[i];size[measurement]=0}return size}function setup(){if(!isSetup){isSetup=!0;var getComputedStyle=window.getComputedStyle;if(getStyle=function(){var getStyleFn=getComputedStyle?function(elem){return getComputedStyle(elem,null)}:function(elem){return elem.currentStyle};return function(elem){var style=getStyleFn(elem);return style||logError("Style returned "+style+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),style}}(),boxSizingProp=getStyleProperty("boxSizing")){var div=document.createElement("div");div.style.width="200px",div.style.padding="1px 2px 3px 4px",div.style.borderStyle="solid",div.style.borderWidth="1px 2px 3px 4px",div.style[boxSizingProp]="border-box";var body=document.body||document.documentElement;body.appendChild(div);var style=getStyle(div);isBoxSizeOuter=200===getStyleSize(style.width),body.removeChild(div)}}}function getSize(elem){if(setup(),"string"==typeof elem&&(elem=document.querySelector(elem)),elem&&"object"==typeof elem&&elem.nodeType){var style=getStyle(elem);if("none"===style.display)return getZeroSize();var size={};size.width=elem.offsetWidth,size.height=elem.offsetHeight;for(var isBorderBox=size.isBorderBox=!(!boxSizingProp||!style[boxSizingProp]||"border-box"!==style[boxSizingProp]),i=0,len=measurements.length;len>i;i++){var measurement=measurements[i],value=style[measurement],num=parseFloat(value);size[measurement]=isNaN(num)?0:num}var paddingWidth=size.paddingLeft+size.paddingRight,paddingHeight=size.paddingTop+size.paddingBottom,marginWidth=size.marginLeft+size.marginRight,marginHeight=size.marginTop+size.marginBottom,borderWidth=size.borderLeftWidth+size.borderRightWidth,borderHeight=size.borderTopWidth+size.borderBottomWidth,isBorderBoxSizeOuter=isBorderBox&&isBoxSizeOuter,styleWidth=getStyleSize(style.width);styleWidth!==!1&&(size.width=styleWidth+(isBorderBoxSizeOuter?0:paddingWidth+borderWidth));var styleHeight=getStyleSize(style.height);return styleHeight!==!1&&(size.height=styleHeight+(isBorderBoxSizeOuter?0:paddingHeight+borderHeight)),size.innerWidth=size.width-(paddingWidth+borderWidth),size.innerHeight=size.height-(paddingHeight+borderHeight),size.outerWidth=size.width+marginWidth,size.outerHeight=size.height+marginHeight,size}}var getStyle,boxSizingProp,isBoxSizeOuter,prefixes="Webkit Moz ms Ms O".split(" "),docElemStyle=document.documentElement.style,logError="undefined"==typeof console?noop:function(message){console.error(message)},measurements=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],isSetup=!1;return getSize}()}),function(addon){var component;window.UIkit&&(component=addon(UIkit)),"function"==typeof define&&define.amd&&define("uikit-htmleditor",["uikit"],function(){return component||addon(UIkit)})}(function(UI){"use strict";var editors=[];return UI.component("htmleditor",{defaults:{iframe:!1,mode:"split",markdown:!1,autocomplete:!0,height:500,maxsplitsize:1e3,codemirror:{mode:"htmlmixed",lineWrapping:!0,dragDrop:!1,autoCloseTags:!0,matchTags:!0,autoCloseBrackets:!0,matchBrackets:!0,indentUnit:4,indentWithTabs:!1,tabSize:4,hintOptions:{completionSingle:!1}},toolbar:["bold","italic","strike","link","image","blockquote","listUl","listOl"],lblPreview:"Preview",lblCodeview:"HTML",lblMarkedview:"Markdown"},boot:function(){UI.ready(function(context){UI.$("textarea[data-uk-htmleditor]",context).each(function(){var editor=UI.$(this);editor.data("htmleditor")||UI.htmleditor(editor,UI.Utils.options(editor.attr("data-uk-htmleditor")))})})},init:function(){var $this=this,tpl=UI.components.htmleditor.template;this.CodeMirror=this.options.CodeMirror||CodeMirror,this.buttons={},tpl=tpl.replace(/\{:lblPreview}/g,this.options.lblPreview),tpl=tpl.replace(/\{:lblCodeview}/g,this.options.lblCodeview),this.htmleditor=UI.$(tpl),this.content=this.htmleditor.find(".uk-htmleditor-content"),this.toolbar=this.htmleditor.find(".uk-htmleditor-toolbar"),this.preview=this.htmleditor.find(".uk-htmleditor-preview").children().eq(0),this.code=this.htmleditor.find(".uk-htmleditor-code"),this.element.before(this.htmleditor).appendTo(this.code),this.editor=this.CodeMirror.fromTextArea(this.element[0],this.options.codemirror),this.editor.htmleditor=this,this.editor.on("change",UI.Utils.debounce(function(){$this.render()},150)),this.editor.on("change",function(){$this.editor.save(),$this.element.trigger("input")}),this.code.find(".CodeMirror").css("height",this.options.height),this.options.iframe?(this.iframe=UI.$(''),this.preview.append(this.iframe),this.iframe[0].contentWindow.document.open(),this.iframe[0].contentWindow.document.close(),this.preview.container=UI.$(this.iframe[0].contentWindow.document).find("body"),"string"==typeof this.options.iframe&&this.preview.container.parent().append(' ')):this.preview.container=this.preview,UI.$win.on("resize load",UI.Utils.debounce(function(){$this.fit()},200));var previewContainer=this.iframe?this.preview.container:$this.preview.parent(),codeContent=this.code.find(".CodeMirror-sizer"),codeScroll=this.code.find(".CodeMirror-scroll").on("scroll",UI.Utils.debounce(function(){if("tab"!=$this.htmleditor.attr("data-mode")){var codeHeight=codeContent.height()-codeScroll.height(),previewHeight=previewContainer[0].scrollHeight-($this.iframe?$this.iframe.height():previewContainer.height()),ratio=previewHeight/codeHeight,previewPosition=codeScroll.scrollTop()*ratio;previewContainer.scrollTop(previewPosition)}},10));this.htmleditor.on("click",".uk-htmleditor-button-code, .uk-htmleditor-button-preview",function(e){e.preventDefault(),"tab"==$this.htmleditor.attr("data-mode")&&($this.htmleditor.find(".uk-htmleditor-button-code, .uk-htmleditor-button-preview").removeClass("uk-active").filter(this).addClass("uk-active"),$this.activetab=UI.$(this).hasClass("uk-htmleditor-button-code")?"code":"preview",$this.htmleditor.attr("data-active-tab",$this.activetab),$this.editor.refresh())}),this.htmleditor.on("click","a[data-htmleditor-button]",function(){$this.code.is(":visible")&&$this.trigger("action."+UI.$(this).data("htmleditor-button"),[$this.editor])}),this.preview.parent().css("height",this.code.height()),this.options.autocomplete&&this.CodeMirror.showHint&&this.CodeMirror.hint&&this.CodeMirror.hint.html&&this.editor.on("inputRead",UI.Utils.debounce(function(){var doc=$this.editor.getDoc(),POS=doc.getCursor(),mode=$this.CodeMirror.innerMode($this.editor.getMode(),$this.editor.getTokenAt(POS).state).mode.name;if("xml"==mode){var cur=$this.editor.getCursor(),token=$this.editor.getTokenAt(cur);("<"==token.string.charAt(0)||"attribute"==token.type)&&$this.CodeMirror.showHint($this.editor,$this.CodeMirror.hint.html,{completeSingle:!1})}},100)),this.debouncedRedraw=UI.Utils.debounce(function(){$this.redraw()},5),this.on("init.uk.component",function(){$this.debouncedRedraw()}),this.element.attr("data-uk-check-display",1).on("display.uk.check",function(e){this.htmleditor.is(":visible")&&this.fit()}.bind(this)),editors.push(this)},addButton:function(name,button){this.buttons[name]=button},addButtons:function(buttons){UI.$.extend(this.buttons,buttons)},replaceInPreview:function(regexp,callback){function translateOffset(offset){var result=editor.getValue().substring(0,offset).split("\n");return{line:result.length-1,ch:result[result.length-1].length}}var editor=this.editor,results=[],value=editor.getValue(),offset=-1,index=0;return this.currentvalue=this.currentvalue.replace(regexp,function(){offset=value.indexOf(arguments[0],++offset);var match={matches:arguments,from:translateOffset(offset),to:translateOffset(offset+arguments[0].length),replace:function(value){editor.replaceRange(value,match.from,match.to)},inRange:function(cursor){return cursor.line===match.from.line&&cursor.line===match.to.line?cursor.ch>=match.from.ch&&cursor.ch=match.from.ch||cursor.line>match.from.line&&cursor.line'+$this.buttons[button].label+" ")}}),this.toolbar.html(bar.join("\n"))}},fit:function(){var mode=this.options.mode;"split"==mode&&this.htmleditor.width()','",'"," "].join(""),UI.plugin("htmleditor","base",{init:function(editor){function addAction(name,replace,mode){editor.on("action."+name,function(){"html"==editor.getCursorMode()&&editor["replaceLine"==mode?"replaceLine":"replaceSelection"](replace)})}editor.addButtons({fullscreen:{title:"Fullscreen",label:' '},bold:{title:"Bold",label:' '},italic:{title:"Italic",label:' '},strike:{title:"Strikethrough",label:' '},blockquote:{title:"Blockquote",label:' '},link:{title:"Link",label:' '},image:{title:"Image",label:' '},listUl:{title:"Unordered List",label:' '},listOl:{title:"Ordered List",label:' '}}),addAction("bold","$1 "),addAction("italic","$1 "),addAction("strike","$1"),addAction("blockquote","$1
","replaceLine"),addAction("link",'$1 '),addAction("image",' ');var listfn=function(){if("html"==editor.getCursorMode()){for(var cm=editor.editor,pos=cm.getDoc().getCursor(!0),posend=cm.getDoc().getCursor(!1),i=pos.line;i"+cm.getLine(i)+"",{line:i,ch:0},{line:i,ch:cm.getLine(i).length});cm.setCursor({line:posend.line,ch:cm.getLine(posend.line).length}),cm.focus()}};editor.on("action.listUl",function(){listfn()}),editor.on("action.listOl",function(){listfn()}),editor.htmleditor.on("click",'a[data-htmleditor-button="fullscreen"]',function(){editor.htmleditor.toggleClass("uk-htmleditor-fullscreen");var wrap=editor.editor.getWrapperElement();if(editor.htmleditor.hasClass("uk-htmleditor-fullscreen"))editor.editor.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:wrap.style.width,height:wrap.style.height},wrap.style.width="",wrap.style.height=editor.content.height()+"px",document.documentElement.style.overflow="hidden";else{document.documentElement.style.overflow="";var info=editor.editor.state.fullScreenRestore;wrap.style.width=info.width,wrap.style.height=info.height,window.scrollTo(info.scrollLeft,info.scrollTop)}setTimeout(function(){editor.fit(),UI.$win.trigger("resize")},50)}),editor.addShortcut(["Ctrl-S","Cmd-S"],function(){editor.element.trigger("htmleditor-save",[editor])}),editor.addShortcutAction("bold",["Ctrl-B","Cmd-B"])}}),UI.plugin("htmleditor","markdown",{init:function(editor){function enableMarkdown(){editor.editor.setOption("mode","gfm"),editor.htmleditor.find(".uk-htmleditor-button-code a").html(editor.options.lblMarkedview)}function addAction(name,replace,mode){editor.on("action."+name,function(){"markdown"==editor.getCursorMode()&&editor["replaceLine"==mode?"replaceLine":"replaceSelection"](replace)})}var parser=editor.options.mdparser||marked||null;parser&&(editor.options.markdown&&enableMarkdown(),addAction("bold","**$1**"),addAction("italic","*$1*"),addAction("strike","~~$1~~"),addAction("blockquote","> $1","replaceLine"),addAction("link","[$1](http://)"),addAction("image","![$1](http://)"),editor.on("action.listUl",function(){if("markdown"==editor.getCursorMode()){for(var cm=editor.editor,pos=cm.getDoc().getCursor(!0),posend=cm.getDoc().getCursor(!1),i=pos.line;i0){var matches,prevline=cm.getLine(pos.line-1);(matches=prevline.match(/^(\d+)\./))&&(prefix=Number(matches[1])+1)}for(var i=pos.line;i','"," "].join("")).appendTo("body"),modal.dialog=modal.find(".uk-modal-dialog:first"),modal.content=modal.find(".uk-lightbox-content:first"),modal.loader=modal.find(".uk-modal-spinner:first"),modal.closer=modal.find(".uk-close.uk-close-alt"),modal.modal=UI.modal(modal,{modal:!1}),modal.on("swipeRight swipeLeft",function(e){modal.lightbox["swipeLeft"==e.type?"next":"previous"]()}).on("click","[data-lightbox-previous], [data-lightbox-next]",function(e){e.preventDefault(),modal.lightbox[UI.$(this).is("[data-lightbox-next]")?"next":"previous"]()}),modal.on("hide.uk.modal",function(e){modal.content.html("")}),UI.$win.on("load resize orientationchange",UI.Utils.debounce(function(e){modal.is(":visible")&&!UI.Utils.isFullscreen()&&modal.lightbox.fitSize()}.bind(this),100)),modal.lightbox=lightbox,modal)}var modal,cache={};return UI.component("lightbox",{defaults:{group:!1,duration:400,keyboard:!0},index:0,items:!1,boot:function(){UI.$html.on("click","[data-uk-lightbox]",function(e){e.preventDefault();var link=UI.$(this);link.data("lightbox")||UI.lightbox(link,UI.Utils.options(link.attr("data-uk-lightbox"))),link.data("lightbox").show(link)}),UI.$doc.on("keyup",function(e){if(modal&&modal.is(":visible")&&modal.lightbox.options.keyboard)switch(e.preventDefault(),e.keyCode){case 37:modal.lightbox.previous();break;case 39:modal.lightbox.next()}})},init:function(){var siblings=[];if(this.index=0,this.siblings=[],this.element&&this.element.length){var domSiblings=this.options.group?UI.$(['[data-uk-lightbox*="'+this.options.group+'"]',"[data-uk-lightbox*='"+this.options.group+"']"].join(",")):this.element;domSiblings.each(function(){var ele=UI.$(this);siblings.push({source:ele.attr("href"),title:ele.attr("data-title")||ele.attr("title"),type:ele.attr("data-lightbox-type")||"auto",link:ele})}),this.index=domSiblings.index(this.element),this.siblings=siblings}else this.options.group&&this.options.group.length&&(this.siblings=this.options.group);this.trigger("lightbox-init",[this])},show:function(index){this.modal=getModal(this),this.modal.dialog.stop(),this.modal.content.stop();var data,item,$this=this,promise=UI.$.Deferred();index=index||0,"object"==typeof index&&this.siblings.forEach(function(s,idx){index[0]===s.link[0]&&(index=idx)}),0>index?index=this.siblings.length-index:this.siblings[index]||(index=0),item=this.siblings[index],data={lightbox:$this,source:item.source,type:item.type,index:index,promise:promise,title:item.title,item:item,meta:{content:"",width:null,height:null}},this.index=index,this.modal.content.empty(),this.modal.is(":visible")||(this.modal.content.css({width:"",height:""}).empty(),this.modal.modal.show()),this.modal.loader.removeClass("uk-hidden"),promise.promise().done(function(){$this.data=data,$this.fitSize(data)}).fail(function(){data.meta.content='