/*! (c) gotoAndPlay | All rights reserved */
(window["webpackJsonpapplication"] = window["webpackJsonpapplication"] || []).push([["module-1"],{

/***/ "./node_modules/moment/locale sync recursive ^\\.\\/.*$":
/*!**************************************************!*\
  !*** ./node_modules/moment/locale sync ^\.\/.*$ ***!
  \**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

var map = {
	"./af": "./node_modules/moment/locale/af.js",
	"./af.js": "./node_modules/moment/locale/af.js",
	"./ar": "./node_modules/moment/locale/ar.js",
	"./ar-dz": "./node_modules/moment/locale/ar-dz.js",
	"./ar-dz.js": "./node_modules/moment/locale/ar-dz.js",
	"./ar-kw": "./node_modules/moment/locale/ar-kw.js",
	"./ar-kw.js": "./node_modules/moment/locale/ar-kw.js",
	"./ar-ly": "./node_modules/moment/locale/ar-ly.js",
	"./ar-ly.js": "./node_modules/moment/locale/ar-ly.js",
	"./ar-ma": "./node_modules/moment/locale/ar-ma.js",
	"./ar-ma.js": "./node_modules/moment/locale/ar-ma.js",
	"./ar-sa": "./node_modules/moment/locale/ar-sa.js",
	"./ar-sa.js": "./node_modules/moment/locale/ar-sa.js",
	"./ar-tn": "./node_modules/moment/locale/ar-tn.js",
	"./ar-tn.js": "./node_modules/moment/locale/ar-tn.js",
	"./ar.js": "./node_modules/moment/locale/ar.js",
	"./az": "./node_modules/moment/locale/az.js",
	"./az.js": "./node_modules/moment/locale/az.js",
	"./be": "./node_modules/moment/locale/be.js",
	"./be.js": "./node_modules/moment/locale/be.js",
	"./bg": "./node_modules/moment/locale/bg.js",
	"./bg.js": "./node_modules/moment/locale/bg.js",
	"./bm": "./node_modules/moment/locale/bm.js",
	"./bm.js": "./node_modules/moment/locale/bm.js",
	"./bn": "./node_modules/moment/locale/bn.js",
	"./bn.js": "./node_modules/moment/locale/bn.js",
	"./bo": "./node_modules/moment/locale/bo.js",
	"./bo.js": "./node_modules/moment/locale/bo.js",
	"./br": "./node_modules/moment/locale/br.js",
	"./br.js": "./node_modules/moment/locale/br.js",
	"./bs": "./node_modules/moment/locale/bs.js",
	"./bs.js": "./node_modules/moment/locale/bs.js",
	"./ca": "./node_modules/moment/locale/ca.js",
	"./ca.js": "./node_modules/moment/locale/ca.js",
	"./cs": "./node_modules/moment/locale/cs.js",
	"./cs.js": "./node_modules/moment/locale/cs.js",
	"./cv": "./node_modules/moment/locale/cv.js",
	"./cv.js": "./node_modules/moment/locale/cv.js",
	"./cy": "./node_modules/moment/locale/cy.js",
	"./cy.js": "./node_modules/moment/locale/cy.js",
	"./da": "./node_modules/moment/locale/da.js",
	"./da.js": "./node_modules/moment/locale/da.js",
	"./de": "./node_modules/moment/locale/de.js",
	"./de-at": "./node_modules/moment/locale/de-at.js",
	"./de-at.js": "./node_modules/moment/locale/de-at.js",
	"./de-ch": "./node_modules/moment/locale/de-ch.js",
	"./de-ch.js": "./node_modules/moment/locale/de-ch.js",
	"./de.js": "./node_modules/moment/locale/de.js",
	"./dv": "./node_modules/moment/locale/dv.js",
	"./dv.js": "./node_modules/moment/locale/dv.js",
	"./el": "./node_modules/moment/locale/el.js",
	"./el.js": "./node_modules/moment/locale/el.js",
	"./en-SG": "./node_modules/moment/locale/en-SG.js",
	"./en-SG.js": "./node_modules/moment/locale/en-SG.js",
	"./en-au": "./node_modules/moment/locale/en-au.js",
	"./en-au.js": "./node_modules/moment/locale/en-au.js",
	"./en-ca": "./node_modules/moment/locale/en-ca.js",
	"./en-ca.js": "./node_modules/moment/locale/en-ca.js",
	"./en-gb": "./node_modules/moment/locale/en-gb.js",
	"./en-gb.js": "./node_modules/moment/locale/en-gb.js",
	"./en-ie": "./node_modules/moment/locale/en-ie.js",
	"./en-ie.js": "./node_modules/moment/locale/en-ie.js",
	"./en-il": "./node_modules/moment/locale/en-il.js",
	"./en-il.js": "./node_modules/moment/locale/en-il.js",
	"./en-nz": "./node_modules/moment/locale/en-nz.js",
	"./en-nz.js": "./node_modules/moment/locale/en-nz.js",
	"./eo": "./node_modules/moment/locale/eo.js",
	"./eo.js": "./node_modules/moment/locale/eo.js",
	"./es": "./node_modules/moment/locale/es.js",
	"./es-do": "./node_modules/moment/locale/es-do.js",
	"./es-do.js": "./node_modules/moment/locale/es-do.js",
	"./es-us": "./node_modules/moment/locale/es-us.js",
	"./es-us.js": "./node_modules/moment/locale/es-us.js",
	"./es.js": "./node_modules/moment/locale/es.js",
	"./et": "./node_modules/moment/locale/et.js",
	"./et.js": "./node_modules/moment/locale/et.js",
	"./eu": "./node_modules/moment/locale/eu.js",
	"./eu.js": "./node_modules/moment/locale/eu.js",
	"./fa": "./node_modules/moment/locale/fa.js",
	"./fa.js": "./node_modules/moment/locale/fa.js",
	"./fi": "./node_modules/moment/locale/fi.js",
	"./fi.js": "./node_modules/moment/locale/fi.js",
	"./fo": "./node_modules/moment/locale/fo.js",
	"./fo.js": "./node_modules/moment/locale/fo.js",
	"./fr": "./node_modules/moment/locale/fr.js",
	"./fr-ca": "./node_modules/moment/locale/fr-ca.js",
	"./fr-ca.js": "./node_modules/moment/locale/fr-ca.js",
	"./fr-ch": "./node_modules/moment/locale/fr-ch.js",
	"./fr-ch.js": "./node_modules/moment/locale/fr-ch.js",
	"./fr.js": "./node_modules/moment/locale/fr.js",
	"./fy": "./node_modules/moment/locale/fy.js",
	"./fy.js": "./node_modules/moment/locale/fy.js",
	"./ga": "./node_modules/moment/locale/ga.js",
	"./ga.js": "./node_modules/moment/locale/ga.js",
	"./gd": "./node_modules/moment/locale/gd.js",
	"./gd.js": "./node_modules/moment/locale/gd.js",
	"./gl": "./node_modules/moment/locale/gl.js",
	"./gl.js": "./node_modules/moment/locale/gl.js",
	"./gom-latn": "./node_modules/moment/locale/gom-latn.js",
	"./gom-latn.js": "./node_modules/moment/locale/gom-latn.js",
	"./gu": "./node_modules/moment/locale/gu.js",
	"./gu.js": "./node_modules/moment/locale/gu.js",
	"./he": "./node_modules/moment/locale/he.js",
	"./he.js": "./node_modules/moment/locale/he.js",
	"./hi": "./node_modules/moment/locale/hi.js",
	"./hi.js": "./node_modules/moment/locale/hi.js",
	"./hr": "./node_modules/moment/locale/hr.js",
	"./hr.js": "./node_modules/moment/locale/hr.js",
	"./hu": "./node_modules/moment/locale/hu.js",
	"./hu.js": "./node_modules/moment/locale/hu.js",
	"./hy-am": "./node_modules/moment/locale/hy-am.js",
	"./hy-am.js": "./node_modules/moment/locale/hy-am.js",
	"./id": "./node_modules/moment/locale/id.js",
	"./id.js": "./node_modules/moment/locale/id.js",
	"./is": "./node_modules/moment/locale/is.js",
	"./is.js": "./node_modules/moment/locale/is.js",
	"./it": "./node_modules/moment/locale/it.js",
	"./it-ch": "./node_modules/moment/locale/it-ch.js",
	"./it-ch.js": "./node_modules/moment/locale/it-ch.js",
	"./it.js": "./node_modules/moment/locale/it.js",
	"./ja": "./node_modules/moment/locale/ja.js",
	"./ja.js": "./node_modules/moment/locale/ja.js",
	"./jv": "./node_modules/moment/locale/jv.js",
	"./jv.js": "./node_modules/moment/locale/jv.js",
	"./ka": "./node_modules/moment/locale/ka.js",
	"./ka.js": "./node_modules/moment/locale/ka.js",
	"./kk": "./node_modules/moment/locale/kk.js",
	"./kk.js": "./node_modules/moment/locale/kk.js",
	"./km": "./node_modules/moment/locale/km.js",
	"./km.js": "./node_modules/moment/locale/km.js",
	"./kn": "./node_modules/moment/locale/kn.js",
	"./kn.js": "./node_modules/moment/locale/kn.js",
	"./ko": "./node_modules/moment/locale/ko.js",
	"./ko.js": "./node_modules/moment/locale/ko.js",
	"./ku": "./node_modules/moment/locale/ku.js",
	"./ku.js": "./node_modules/moment/locale/ku.js",
	"./ky": "./node_modules/moment/locale/ky.js",
	"./ky.js": "./node_modules/moment/locale/ky.js",
	"./lb": "./node_modules/moment/locale/lb.js",
	"./lb.js": "./node_modules/moment/locale/lb.js",
	"./lo": "./node_modules/moment/locale/lo.js",
	"./lo.js": "./node_modules/moment/locale/lo.js",
	"./lt": "./node_modules/moment/locale/lt.js",
	"./lt.js": "./node_modules/moment/locale/lt.js",
	"./lv": "./node_modules/moment/locale/lv.js",
	"./lv.js": "./node_modules/moment/locale/lv.js",
	"./me": "./node_modules/moment/locale/me.js",
	"./me.js": "./node_modules/moment/locale/me.js",
	"./mi": "./node_modules/moment/locale/mi.js",
	"./mi.js": "./node_modules/moment/locale/mi.js",
	"./mk": "./node_modules/moment/locale/mk.js",
	"./mk.js": "./node_modules/moment/locale/mk.js",
	"./ml": "./node_modules/moment/locale/ml.js",
	"./ml.js": "./node_modules/moment/locale/ml.js",
	"./mn": "./node_modules/moment/locale/mn.js",
	"./mn.js": "./node_modules/moment/locale/mn.js",
	"./mr": "./node_modules/moment/locale/mr.js",
	"./mr.js": "./node_modules/moment/locale/mr.js",
	"./ms": "./node_modules/moment/locale/ms.js",
	"./ms-my": "./node_modules/moment/locale/ms-my.js",
	"./ms-my.js": "./node_modules/moment/locale/ms-my.js",
	"./ms.js": "./node_modules/moment/locale/ms.js",
	"./mt": "./node_modules/moment/locale/mt.js",
	"./mt.js": "./node_modules/moment/locale/mt.js",
	"./my": "./node_modules/moment/locale/my.js",
	"./my.js": "./node_modules/moment/locale/my.js",
	"./nb": "./node_modules/moment/locale/nb.js",
	"./nb.js": "./node_modules/moment/locale/nb.js",
	"./ne": "./node_modules/moment/locale/ne.js",
	"./ne.js": "./node_modules/moment/locale/ne.js",
	"./nl": "./node_modules/moment/locale/nl.js",
	"./nl-be": "./node_modules/moment/locale/nl-be.js",
	"./nl-be.js": "./node_modules/moment/locale/nl-be.js",
	"./nl.js": "./node_modules/moment/locale/nl.js",
	"./nn": "./node_modules/moment/locale/nn.js",
	"./nn.js": "./node_modules/moment/locale/nn.js",
	"./pa-in": "./node_modules/moment/locale/pa-in.js",
	"./pa-in.js": "./node_modules/moment/locale/pa-in.js",
	"./pl": "./node_modules/moment/locale/pl.js",
	"./pl.js": "./node_modules/moment/locale/pl.js",
	"./pt": "./node_modules/moment/locale/pt.js",
	"./pt-br": "./node_modules/moment/locale/pt-br.js",
	"./pt-br.js": "./node_modules/moment/locale/pt-br.js",
	"./pt.js": "./node_modules/moment/locale/pt.js",
	"./ro": "./node_modules/moment/locale/ro.js",
	"./ro.js": "./node_modules/moment/locale/ro.js",
	"./ru": "./node_modules/moment/locale/ru.js",
	"./ru.js": "./node_modules/moment/locale/ru.js",
	"./sd": "./node_modules/moment/locale/sd.js",
	"./sd.js": "./node_modules/moment/locale/sd.js",
	"./se": "./node_modules/moment/locale/se.js",
	"./se.js": "./node_modules/moment/locale/se.js",
	"./si": "./node_modules/moment/locale/si.js",
	"./si.js": "./node_modules/moment/locale/si.js",
	"./sk": "./node_modules/moment/locale/sk.js",
	"./sk.js": "./node_modules/moment/locale/sk.js",
	"./sl": "./node_modules/moment/locale/sl.js",
	"./sl.js": "./node_modules/moment/locale/sl.js",
	"./sq": "./node_modules/moment/locale/sq.js",
	"./sq.js": "./node_modules/moment/locale/sq.js",
	"./sr": "./node_modules/moment/locale/sr.js",
	"./sr-cyrl": "./node_modules/moment/locale/sr-cyrl.js",
	"./sr-cyrl.js": "./node_modules/moment/locale/sr-cyrl.js",
	"./sr.js": "./node_modules/moment/locale/sr.js",
	"./ss": "./node_modules/moment/locale/ss.js",
	"./ss.js": "./node_modules/moment/locale/ss.js",
	"./sv": "./node_modules/moment/locale/sv.js",
	"./sv.js": "./node_modules/moment/locale/sv.js",
	"./sw": "./node_modules/moment/locale/sw.js",
	"./sw.js": "./node_modules/moment/locale/sw.js",
	"./ta": "./node_modules/moment/locale/ta.js",
	"./ta.js": "./node_modules/moment/locale/ta.js",
	"./te": "./node_modules/moment/locale/te.js",
	"./te.js": "./node_modules/moment/locale/te.js",
	"./tet": "./node_modules/moment/locale/tet.js",
	"./tet.js": "./node_modules/moment/locale/tet.js",
	"./tg": "./node_modules/moment/locale/tg.js",
	"./tg.js": "./node_modules/moment/locale/tg.js",
	"./th": "./node_modules/moment/locale/th.js",
	"./th.js": "./node_modules/moment/locale/th.js",
	"./tl-ph": "./node_modules/moment/locale/tl-ph.js",
	"./tl-ph.js": "./node_modules/moment/locale/tl-ph.js",
	"./tlh": "./node_modules/moment/locale/tlh.js",
	"./tlh.js": "./node_modules/moment/locale/tlh.js",
	"./tr": "./node_modules/moment/locale/tr.js",
	"./tr.js": "./node_modules/moment/locale/tr.js",
	"./tzl": "./node_modules/moment/locale/tzl.js",
	"./tzl.js": "./node_modules/moment/locale/tzl.js",
	"./tzm": "./node_modules/moment/locale/tzm.js",
	"./tzm-latn": "./node_modules/moment/locale/tzm-latn.js",
	"./tzm-latn.js": "./node_modules/moment/locale/tzm-latn.js",
	"./tzm.js": "./node_modules/moment/locale/tzm.js",
	"./ug-cn": "./node_modules/moment/locale/ug-cn.js",
	"./ug-cn.js": "./node_modules/moment/locale/ug-cn.js",
	"./uk": "./node_modules/moment/locale/uk.js",
	"./uk.js": "./node_modules/moment/locale/uk.js",
	"./ur": "./node_modules/moment/locale/ur.js",
	"./ur.js": "./node_modules/moment/locale/ur.js",
	"./uz": "./node_modules/moment/locale/uz.js",
	"./uz-latn": "./node_modules/moment/locale/uz-latn.js",
	"./uz-latn.js": "./node_modules/moment/locale/uz-latn.js",
	"./uz.js": "./node_modules/moment/locale/uz.js",
	"./vi": "./node_modules/moment/locale/vi.js",
	"./vi.js": "./node_modules/moment/locale/vi.js",
	"./x-pseudo": "./node_modules/moment/locale/x-pseudo.js",
	"./x-pseudo.js": "./node_modules/moment/locale/x-pseudo.js",
	"./yo": "./node_modules/moment/locale/yo.js",
	"./yo.js": "./node_modules/moment/locale/yo.js",
	"./zh-cn": "./node_modules/moment/locale/zh-cn.js",
	"./zh-cn.js": "./node_modules/moment/locale/zh-cn.js",
	"./zh-hk": "./node_modules/moment/locale/zh-hk.js",
	"./zh-hk.js": "./node_modules/moment/locale/zh-hk.js",
	"./zh-tw": "./node_modules/moment/locale/zh-tw.js",
	"./zh-tw.js": "./node_modules/moment/locale/zh-tw.js"
};


function webpackContext(req) {
	var id = webpackContextResolve(req);
	return __webpack_require__(id);
}
function webpackContextResolve(req) {
	if(!__webpack_require__.o(map, req)) {
		var e = new Error("Cannot find module '" + req + "'");
		e.code = 'MODULE_NOT_FOUND';
		throw e;
	}
	return map[req];
}
webpackContext.keys = function webpackContextKeys() {
	return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = "./node_modules/moment/locale sync recursive ^\\.\\/.*$";

/***/ }),

/***/ "./src/data/banned-user.js":
/*!*********************************!*\
  !*** ./src/data/banned-user.js ***!
  \*********************************/
/*! exports provided: BannedUser */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BannedUser", function() { return BannedUser; });
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__);


class BannedUser
{
	constructor(name, zone)
	{
		this.DATE_FORMAT = 'DD/MM/YYYY HH:mm';

	    this.name = name;
		this.zone = zone;
	}

	static fromSFSArray(sfsa)
	{
		let bu = new BannedUser(sfsa.getUtfString(0), sfsa.getUtfString(1));

		bu.mode = sfsa.getUtfString(2);
		bu.reason = sfsa.getUtfString(3);
		bu.adminName = sfsa.getUtfString(4);
		bu.ipAddress = sfsa.getUtfString(5);
		bu.banTimeMillis = sfsa.getLong(6);
		bu.banDurationMillis = sfsa.getLong(7);
		bu.expirationDate = bu._getExpirationDate();
		bu.banDate = bu._getBanDate();

		return bu;
	}

	_getExpirationDate()
	{
		const expireOn = moment__WEBPACK_IMPORTED_MODULE_0__(this.banTimeMillis + this.banDurationMillis);

		if (expireOn.year() >= moment__WEBPACK_IMPORTED_MODULE_0__().year() + 100)
			return 'Never';
		else
			return expireOn.format(this.DATE_FORMAT);
	}

	_getBanDate()
	{
		return moment__WEBPACK_IMPORTED_MODULE_0__(this.banTimeMillis).format(this.DATE_FORMAT);
	}
}


/***/ }),

/***/ "./src/modules/ban-manager.js":
/*!************************************!*\
  !*** ./src/modules/ban-manager.js ***!
  \************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BanManager; });
/* harmony import */ var _base_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-module */ "./src/modules/base-module.js");
/* harmony import */ var _data_banned_user__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../data/banned-user */ "./src/data/banned-user.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var clipboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! clipboard */ "./node_modules/clipboard/dist/clipboard.js");
/* harmony import */ var clipboard__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(clipboard__WEBPACK_IMPORTED_MODULE_3__);





class BanManager extends _base_module__WEBPACK_IMPORTED_MODULE_0__["BaseModule"]
{
	constructor()
	{
	    super('banManager');

		// Outgoing requests
		this.REQ_GET_ZONES = 'getZones';
		this.REQ_GET_USERNAMES = 'getUNames';
		this.REQ_GET_IPADDRESSES = 'getIPs';
		this.REQ_REMOVE_USERNAMES = 'removeUNames';
		this.REQ_REMOVE_IPADDRESSES = 'removeIPs';
		this.REQ_BAN = 'ban';

		// Incoming responses
		this.RESP_ZONES = 'zones';
		this.RESP_USERNAMES = 'uNames';
		this.RESP_IPADDRESSES = 'IPs';
	}

	//------------------------------------
	// COMMON MODULE INTERFACE METHODS
	// This members are used by the main controller
	// to communicate with the module's controller.
	//------------------------------------

	initialize(idData, shellController)
	{
		// Call super method
		super.initialize(idData, shellController);

		// Initialize scrolling tabs
		$('#bnm-tabNavigator > #tabs').scrollingTabs({
			bootstrapVersion: 4,
			scrollToTabEdge: true,
			enableSwiping: true,
			disableScrollArrowsOnFullyScrolled: true,
			cssClassLeftArrow: 'fa fa-chevron-left',
			cssClassRightArrow: 'fa fa-chevron-right'
		});

		// Initialize zone filter dropdown
		this._zonesDD = $('#bnm-zonesDD').kendoDropDownList({
			change: $.proxy(this._onZoneChange, this)
		}).data('kendoDropDownList');

		// Initialize ban button
		$('#bnm-showBanModalBt').on('click', $.proxy(this._onShowBanModalClick, this));

		// Initialize banned IPs grid
		this._ipGrid = $('#bnm-ipGrid').kendoGrid({
			scrollable: true,
            sortable: true,
			//resizable: true,
			selectable: 'multiple',
			allowCopy: true,
            columns:
            [
				{
	                field: 'ipAddress',
	                width: 150,
					title: 'IP Address',
	            },
	            {
	                field: 'banDate',
	                width: 120,
	                title: 'Date',
					format: '{0:dd/MM/yyyy HH:mm}',
					type: 'dateTime'
	            },
	            {
	                field: 'expirationDate',
	                width: 120,
	                title: 'Expiration',
					format: '{0:dd/MM/yyyy HH:mm}',
					type: 'dateTime'
	            },
				{
	                field: 'reason',
	                width: 250,
					title: 'Reason',
	            },
				{
	                field: 'adminName',
	                width: 150,
					title: 'Banned By',
	            },
			],
			noRecords: {
				template: 'No banned IP addresses.'
			},
			change: $.proxy(this._onIpGridSelectionChange, this),
			dataSource: []
        }).data('kendoGrid');

		// Initialize banned usernames grid
		this._namesGrid = $('#bnm-namesGrid').kendoGrid({
			scrollable: true,
            sortable: true,
			//resizable: true,
			selectable: 'multiple',
			allowCopy: true,
            columns:
            [
				{
	                field: 'name',
	                width: 150,
					title: 'Username',
	            },
				{
	                field: 'banDate',
	                width: 120,
	                title: 'Date',
					format: '{0:dd/MM/yyyy HH:mm}',
					type: 'dateTime'
	            },
	            {
	                field: 'expirationDate',
	                width: 120,
	                title: 'Expiration',
					format: '{0:dd/MM/yyyy HH:mm}',
					type: 'dateTime'
	            },
				{
	                field: 'reason',
	                width: 250,
					title: 'Reason',
	            },
				{
	                field: 'adminName',
	                width: 150,
					title: 'Banned By',
	            },
			],
			noRecords: {
				template: 'No banned usernames.'
			},
			change: $.proxy(this._onNamesGridSelectionChange, this),
			dataSource: []
        }).data('kendoGrid');

		// Initialize context menus
		$("#bnm-namesGridContextMenu").kendoContextMenu({
            target: '#bnm-namesGrid',
            filter: 'td',
            select: function (e) {
                var cell = e.target;
                var row = $(cell).parent()[0];
                var grid = $('#bnm-namesGrid').data('kendoGrid');
                var itemId = e.item.id;

                var cellText = cell.innerText;

                if (itemId === 'bnm-namesGridCopyText') {
                    new clipboard__WEBPACK_IMPORTED_MODULE_3___default.a('#bnm-namesGridCopyText', {
                        text: function (trigger) {
                            return cellText;
                        }
                    });
                };
            }
        });

		$("#bnm-ipGridContextMenu").kendoContextMenu({
            target: '#bnm-ipGrid',
            filter: 'td',
            select: function (e) {
                var cell = e.target;
                var row = $(cell).parent()[0];
                var grid = $('#bnm-ipGrid').data('kendoGrid');
                var itemId = e.item.id;

                var cellText = cell.innerText;

                if (itemId === 'bnm-ipGridCopyText') {
                    new clipboard__WEBPACK_IMPORTED_MODULE_3___default.a('#bnm-ipGridCopyText', {
                        text: function (trigger) {
                            return cellText;
                        }
                    });
                };
            }
        });

		// Initialize refresh and remove buttons
		$('#bnm-refreshNamesBt').on('click', $.proxy(this._onRefreshNamesClick, this));
		$('#bnm-removeNameBt').on('click', $.proxy(this._onRemoveNamesClick, this));
		$('#bnm-removeAllNamesBt').on('click', $.proxy(this._onRemoveAllNamesClick, this));
		$('#bnm-refreshIpBt').on('click', $.proxy(this._onRefreshIpClick, this));
		$('#bnm-removeIpBt').on('click', $.proxy(this._onRemoveIpClick, this));
		$('#bnm-removeAllIpBt').on('click', $.proxy(this._onRemoveAllIpClick, this));

		// Configure ban panel
		$('#bnm-banModal').modal({
			backdrop: 'static',
			keyboard: false,
			show: false,
		});

		// Add listener for ban panel hide
		$('#bnm-banModal').on('hidden.bs.modal', $.proxy(this._onBanModalHidden, this));

		// Initialize kendo validation on folder name form
		this._banValidator = $('#bnm-banForm').kendoValidator({}).data('kendoValidator');

		// Add listener to Ban button click
		$('#bnm-banBt').on('click', $.proxy(this._onBanClick, this));

		// Init ban delay numeric stepper
		this._banDelayIn = $('#bnm-modalDelayNS').kendoNumericTextBox({
		    min: 0,
		    step: 1,
		    format: '#'
		}).data('kendoNumericTextBox');

		// Init ban expiration date picker
		this._banExpDateIn = $('#bnm-expirationDP').kendoDatePicker({
			value: this._tomorrow,
			min: this._tomorrow,
			footer: false,
			format: 'dd/MM/yyyy'
		}).data('kendoDatePicker');

		// Disable manual date input
		$('#bnm-expirationDP').attr('readonly','readonly');

		// Init ban expiration hours/minutes inputs
		this._banExpHourIn = $('#bnm-modalExpHoursNS').kendoNumericTextBox({
		    min: 0,
			max: 99,
		    step: 1,
		    format: '#'
		}).data('kendoNumericTextBox');

		this._banExpMinIn = $('#bnm-modalExpMinsNS').kendoNumericTextBox({
		    min: 0,
			max: 59,
		    step: 1,
		    format: '#'
		}).data('kendoNumericTextBox');

		//-------------------------------------

		// Load zones list
		this.sendExtensionRequest(this.REQ_GET_ZONES);

		// Load banned IP addresses
		// Note: we don't load the banned usernames automatically because a zone must be selected
		this._getBannedIPs();
	}

	destroy()
	{
		// Call super method
		super.destroy();

		// Destroy scrolling tabs
		$('#bnm-tabNavigator #tabs').scrollingTabs('destroy');

		// Remove click listeners
		$('#bnm-showBanModalBt').off('click');
		$('#bnm-refreshNamesBt').off('click');
		$('#bnm-removeNameBt').off('click');
		$('#bnm-removeAllNamesBt').off('click');
		$('#bnm-refreshIpBt').off('click');
		$('#bnm-removeIpBt').off('click');
		$('#bnm-removeAllIpBt').off('click');
		$('#bnm-banBt').off('click');

		// Hide ban panel
		$('#bnm-banModal').modal('hide');

		// Remove room creation panel listener
		$('#bnm-banModal').off('hidden.bs.modal');
	}

	onExtensionCommand(command, data)
	{
		// Data received
		if (command == this.RESP_ZONES)
		{
			let zones = data.getUtfStringArray('zones');

			// If we have 1 zone only, we will select it immediately
			const selectFirstZone = zones.length == 1;

			// Sort zones list
			zones.sort(function (a, b) {
				return a.localeCompare(b);
			});

			// Add "none" zone
			zones.unshift('[none]');

			// Set zone dropdown datasource
			this._zonesDD.setDataSource(zones);

			if (selectFirstZone)
			{
				this._zonesDD.select(1);
				this._getBannedUsernames();
			}
			else
				this._zonesDD.select(0);
		}

		else if (command == this.RESP_USERNAMES)
		{
			// Substitute grid's data source, retaining current sorting
			let currSort = this._namesGrid.dataSource.sort();

			let ds = new kendo.data.DataSource({
				schema: {
					model: {
						fields: {
							expirationDate: {
								type: 'dateTime',
								parse: function (e) {
									return moment__WEBPACK_IMPORTED_MODULE_2__(e, 'DD/MM/YYYY HH:mm').toDate();
								}
							},
							banDate: {
								type: 'dateTime',
								parse: function (e) {
									return moment__WEBPACK_IMPORTED_MODULE_2__(e, 'DD/MM/YYYY HH:mm').toDate();
								}
							}
						}
					}
				},
				sort: currSort, // FIXME Expected sorting doesn't seem to be applied
				data: this._generateBannedEntries(data.getSFSArray('uNames'))
			});

			// Assign data source to grid
			this._namesGrid.setDataSource(ds);

			// Enable remove all button
			$('#bnm-removeAllNamesBt').attr('disabled', ds.total() == 0)
		}
		else if (command == this.RESP_IPADDRESSES)
		{
			// Substitute grid's data source, retaining current sorting (FIX)
			let currSort = this._ipGrid.dataSource.sort();

			let ds = new kendo.data.DataSource({
				schema: {
					model: {
						fields: {
							expirationDate: {
								type: 'dateTime',
								parse: function (e) {
									return moment__WEBPACK_IMPORTED_MODULE_2__(e, 'DD/MM/YYYY HH:mm').toDate();
								}
							},
							banDate: {
								type: 'dateTime',
								parse: function (e) {
									return moment__WEBPACK_IMPORTED_MODULE_2__(e, 'DD/MM/YYYY HH:mm').toDate();
								}
							}
						}
					}
				},
				sort: currSort, // FIXME Expected sorting doesn't seem to be applied
				data: this._generateBannedEntries(data.getSFSArray('IPs'))
			});

			// Assign data source to grid
			this._ipGrid.setDataSource(ds);

			// Enable remove all button
			$('#bnm-removeAllIpBt').attr('disabled', ds.total() == 0)
		}
	}

	//---------------------------------
	// UI EVENT LISTENERS
	//---------------------------------

	_onShowBanModalClick()
	{
		// Display zone name
		$('#bnm-modalZoneLb').text(this._zonesDD.value())

		// Display ban panel
		$('#bnm-banModal').modal('show');

		// Focus name field
		$('#bnm-modalNameIn').focus();
	}

	_onBanModalHidden(e)
	{
		// Reset validator
		this._banValidator.hideMessages();

		// The method above doesn't remove the k-invalid classes and aria-invalid="true" attributes from inputs
		// Let's do it manually
		$('#bnm-banForm .k-invalid').removeClass('k-invalid');
		$('#bnm-banForm [aria-invalid="true"]').removeAttr('aria-invalid');

		// Reset ban form
		$('#bnm-modalNameIn').val('');
		$('#bnm-modalReasonIn').val('');
		$('#bnm-modalMessageIn').val('');

		this._banDelayIn.value(5);

		$('input[name="expiration"]').removeAttr('checked');
		$('#bnm-expirationRB0').prop('checked', true);

		this._banExpHourIn.value(1);
		this._banExpMinIn.value(0);

		this._banExpDateIn.min(this._tomorrow);
		this._banExpDateIn.value(this._tomorrow);
	}

	_onBanClick()
	{
		if (this._banValidator.validate())
		{
			// Retrieve ban details
			let params = new SFS2X.SFSObject();

			params.putUtfString('zone', this._zonesDD.value());
			params.putUtfString('name', $('#bnm-modalNameIn').val());
			params.putUtfString('msg', $('#bnm-modalMessageIn').val());
			params.putInt('delay', this._banDelayIn.value() != null ? this._banDelayIn.value() : 0);
			params.putUtfString('reason', $('#bnm-modalReasonIn').val());

			const exp = $('input[name="expiration"]:checked').val();
			let duration = -1;

			if (exp == 'after')
			{
				const hours = this._banExpHourIn.value() != null ? this._banExpHourIn.value() : 0;
				const minutes = this._banExpMinIn.value() != null ? this._banExpMinIn.value() : 0;

				duration = (hours * 60) + minutes;

				if (duration <= 0)
					duration = 1;
			}
			else if (exp == 'on')
			{
				const onDate = moment__WEBPACK_IMPORTED_MODULE_2__(this._banExpDateIn.value());
				const now = moment__WEBPACK_IMPORTED_MODULE_2__();

				duration = onDate.startOf('day').diff(now.startOf('minute'), 'minutes');

				if (duration <= 0)
					duration = 1;
			}

			params.putInt('durMins', duration);

			// Send ban request to server
			this.sendExtensionRequest(this.REQ_BAN, params);

			// Refresh list
			this._getBannedUsernames();

			// Focus username field
			$('#bnm-modalNameIn').focus();
			$('#bnm-modalNameIn').select();
		}
	}

	_onZoneChange()
	{
		$('#bnm-namesButtons').attr('disabled', this._zonesDD.select() == 0);
		$('#bnm-showBanModalBt').attr('disabled', this._zonesDD.select() == 0);

		this._getBannedUsernames();
	}

	_onNamesGridSelectionChange()
	{
		// Enable/disable remove button
		const selectedRows = this._namesGrid.select();
		$('#bnm-removeNameBt').attr('disabled', selectedRows.length == 0);
	}

	_onIpGridSelectionChange()
	{
		// Enable/disable remove button
		const selectedRows = this._ipGrid.select();
		$('#bnm-removeIpBt').attr('disabled', selectedRows.length == 0);
	}

	_onRefreshNamesClick()
	{
		this._getBannedUsernames();
	}

	_onRemoveNamesClick()
	{
		this.shellCtrl.showConfirmWarning(`Are you sure you want to remove the banning for the selected username${this._ipGrid.select().length > 1 ? 's' : ''}?`, $.proxy(this._onRemoveNamesConfirm, this));
	}

	_onRemoveNamesConfirm()
	{
		let selectedRows = this._namesGrid.select();
		let usernames = [];

		for (let i = 0; i < selectedRows.length; i++)
		{
			let dataItem = this._namesGrid.dataItem(selectedRows[i]);
			usernames.push(dataItem.name);
		}

		this._requestBannedUsersRemoval(usernames, this._zonesDD.value());
	}

	_onRemoveAllNamesClick()
	{
		this.shellCtrl.showConfirmWarning(`Are you sure you want to remove all banned usernames?`, $.proxy(this._onRemovAllNamesConfirm, this));
	}

	_onRemovAllNamesConfirm()
	{
		this._requestBannedUsersRemoval(null, this._zonesDD.value());
	}

	_onRefreshIpClick()
	{
		this._getBannedIPs();
	}

	_onRemoveIpClick()
	{
		this.shellCtrl.showConfirmWarning(`Are you sure you want to remove the banning for the selected IP address${this._ipGrid.select().length > 1 ? 'es' : ''}?`, $.proxy(this._onRemoveIpConfirm, this));
	}

	_onRemoveIpConfirm()
	{
		let selectedRows = this._ipGrid.select();
		let ipAddresses = [];

		for (let i = 0; i < selectedRows.length; i++)
		{
			let dataItem = this._ipGrid.dataItem(selectedRows[i]);
			ipAddresses.push(dataItem.ipAddress);
		}

		this._requestBannedIPsRemoval(ipAddresses);
	}

	_onRemoveAllIpClick()
	{
		this.shellCtrl.showConfirmWarning(`Are you sure you want to remove all banned IP addresses?`, $.proxy(this._onRemovAllIpConfirm, this));
	}

	_onRemovAllIpConfirm()
	{
		this._requestBannedIPsRemoval(null);
	}

	//------------------------------------
	// PRIVATE METHODS
	//------------------------------------

	_getBannedIPs()
	{
		// Remove selection
		this._ipGrid.clearSelection();

		// Clear banned IPs table
		this._ipGrid.setDataSource([]);

		// Send request to extension
		this.sendExtensionRequest(this.REQ_GET_IPADDRESSES);
	}

	_getBannedUsernames()
	{
		// Remove selection
		this._namesGrid.clearSelection();

		// Clear banned IPs table
		this._namesGrid.setDataSource([]);

		if (this._zonesDD.select() > 0)
		{
			// Get zone ID
			let params = new SFS2X.SFSObject();
			params.putUtfString('zone', this._zonesDD.value());

			// Send request to extension
			this.sendExtensionRequest(this.REQ_GET_USERNAMES, params);
		}
	}

	_generateBannedEntries(banData)
	{
		let bannedEntries = [];

		for (let i = 0; i < banData.size(); i++)
		{
			const bu = _data_banned_user__WEBPACK_IMPORTED_MODULE_1__["BannedUser"].fromSFSArray(banData.getSFSArray(i));
			bannedEntries.push(bu);
		}

		return bannedEntries;
	}

	_requestBannedUsersRemoval(usernames, zone)
	{
		// If the usernames array is null, server will remove all banned usernames
		let params = new SFS2X.SFSObject();
		params.putUtfString('zone', zone);

		if (usernames == null)
			params.putNull('uNames');
		else
			params.putUtfStringArray('uNames', usernames);

		this.sendExtensionRequest(this.REQ_REMOVE_USERNAMES, params);
	}

	_requestBannedIPsRemoval(ipAddresses)
	{
		// If the usernames array is null, server will remove all banned usernames
		let params = new SFS2X.SFSObject();

		if (ipAddresses == null)
			params.putNull('IPs');
		else
			params.putUtfStringArray('IPs', ipAddresses);

		this.sendExtensionRequest(this.REQ_REMOVE_IPADDRESSES, params);
	}

	//---------------------------------
	// PRIVATE GETTERS
	//---------------------------------

	get _tomorrow()
	{
		let tomorrow = moment__WEBPACK_IMPORTED_MODULE_2__().add(1, 'd');
		return tomorrow.toDate();
	}
}

/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "jquery")))

/***/ })

}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64, 