
kerio.waw.shared.x_17 = kerio.waw.shared.x_17 || {};

kerio.waw.shared.x_17.x_f9 = function(x_1j, x_2v){
x_2v.x_5z = x_2v.x_5z || [];
x_2v.x_5p = x_2v.x_o; x_2v.x_5v = x_2v.x_5v || {};
var x_5v = x_2v.x_5v;
x_5v.x_83 = x_fa.x_b0('x_fb');
x_5v.x_5w = x_5v.x_5w || {}; x_2v.x_6h.x_fc = {x_2e: this.x_fd};
x_2v.x_fe = (true === x_2v.x_ff) ? this.x_fg : this.x_fh;
kerio.waw.shared.x_17.x_f9.superclass.constructor.call(this, x_1j, x_2v);
};
kerio.lib.x_36(kerio.waw.shared.x_17.x_f9, kerio.adm.x_17.x_3c, {


x_fd: function(x_28) {
var x_3l = x_fi.x_fj(this);
var x_fk = x_28.x_fl;
var x_47 = x_28.x_47;
if (0 <= x_fk) { x_3l.x_fm(x_47, x_fk);
}
else { x_3l.x_fn(x_47, true);
}
},

x_fg: function() {
var x_3l = x_fi.x_fj(this);
var x_3v = x_3l.x_3v;
var x_x = kerio.lib.x_x;
var x_3w = (1 === x_3v.x_46)
? x_x('Are you sure you want to remove the selected item?', 'list')
: x_x('Are you sure you want to remove all the selected items?', 'list', { x_fo: x_3v.x_46 });
kerio.lib.x_4b(x_x('Confirm Action', 'common'), x_3w, x_3l.x_fh, x_3l);
}, 
x_fh: function(x_6v) {
var x_3l = x_fi.x_fj(this);
if ('no' === x_6v) {
return;
}
x_3l.x_70();
}});

kerio.waw.shared.x_17.x_fp = function (x_1j, x_2v) {
var
x_fq,
x_fr,
x_fs,
x_ft,
x_fu,
x_fv,
x_fw,
x_fx,
x_fy,
x_41, x_42,
x_7s,
x_fz,
x_60,
x_5o,
x_2w,
x_5v = {},
x_4u,
x_g0 = [],
x_g1 = false,
x_g2 = false,
x_5x = x_2v.x_5x,
x_g3 = x_2v.x_g3,
x_x = kerio.lib.x_x,
x_o = x_2v.x_o,
x_g4,
x_g5,
x_g6,
x_2z,
x_g7, x_g8,
x_g9,
x_2y;
this.x_ga = x_1j;
x_2w = this.x_ga + '_';
if (x_2v.x_61) {
this.x_gb = x_2v.x_61;
}


x_fq = function (x_1o, x_47) {
var
x_cy, x_gc;
x_1o = x_47.validTimeRange; x_gc = x_1o.name;
if ('' === x_gc) {
return {x_47: ''};
}
if (x_1o.invalid) {
x_cy = 'grpHeader timeRangeIcon invalid';
} else {
x_cy = 'grpHeader timeRangeIcon';
}
return {
x_47: x_gc,
x_cy: x_cy
};
};
x_fr = function(x_1o, x_47) {
x_47.users = kerio.lib.x_9m(x_1o.users); return {x_47: ''}; };
x_fs = function (x_1o, x_47) {
return {
x_47: ''
};
};if (!x_2v.x_gd) {
x_g4 = function() {
kerio.waw.status.x_14.x_15(true);
}; } else {
x_g4 = x_2v.x_g4;
}

x_ft = {		x_1f: 'x_1q',
x_7s: 'enabled',
x_9t: x_g4
};x_fu = {		x_1f: 'x_gc',
x_93: 127,
x_ge: true,
x_b6: {
x_b7: false
},
x_9t: x_g4
};x_fv = {	x_1f: 'x_9u',
x_a5: 'x_a6',
x_a7: 'x_1j',
x_5z: [], 
x_gf: function(x_9d, x_ax, x_1o) {
var
x_47 = x_9d.x_gg().x_eo;
x_ax.x_gh.x_2h();
x_ax.x_gh.x_gi(x_47.validAddressGroup);
},
x_gj: function(x_9d, x_ax, x_1o) {
var
x_47 = x_9d.x_gg().x_eo,
x_gk = x_ax.x_gh.x_2t();
if (x_47.validAddressGroup.id === x_gk.id) {
return; }
x_47.validAddressGroup = x_gk;
x_9d.x_gl(x_47);
}
};x_fw = {	x_1f: 'x_9u',
x_a5: 'x_a6',
x_a7: 'x_1j',
x_5z: [], 
x_gf: function(x_9d, x_ax, x_1o) {
var
x_47 = x_9d.x_gg().x_eo;
x_ax.x_gh.x_2h();
x_ax.x_gh.x_gi(x_47.validTimeRange);
},

x_gj: function(x_9d, x_ax, x_1o) {
var
x_47 = x_9d.x_gg().x_eo,
x_gk = x_ax.x_gh.x_2t();
if (x_47.validTimeRange.id === x_gk.id) {
return; }
x_47.validTimeRange = x_gk;
x_9d.x_gl(x_47);
}
};x_fx = {	x_1f: 'x_1q',
x_7s: 'logEnabled',
x_9t: x_g4
};
x_fy = {
id: 					{	x_7s: 'id',
x_7t: true
},
description:			{	x_7s: 'description',
x_7t: true
},
name: 					{	x_7s: 'name',
x_23: x_x('Name', 'common'),
x_1u: 210,
x_ed: [ x_ft, x_fu ]
},
validAddressGroup: 		{	x_7s: 'validAddressGroup',
x_7t: true
},
validAddressGroupEditor:{	x_7s: 'validAddressEditor',
x_23: x_x('Source', 'ruleList'),
x_1m: true,
x_7u: kerio.waw.shared.x_3e.x_8q.x_gm,
x_ed: x_fv,
x_1u: 140
},
validTimeRange: 		{	x_7s: 'validTimeRange',
x_7t: true
},
validTimeRangeEditor: 	{	x_7s: 'validTimeRangeEditor',
x_23: x_x('Valid Time', 'ruleList'),
x_7u: x_fq,
x_ed: x_fw,
x_1u: 115
},
userCondition: 			{	x_7s: 'userCondition',
x_1m: true, x_gn: true,
x_7u: x_fr
},
users: 					{	x_7s: 'users',
x_23: x_x('Users', 'common'),
x_1u: 120,
x_go: kerio.waw.shared.x_3e.x_8q.x_gp
},
logEnabled: 			{	x_7s: 'logEnabled',
x_23: x_x('Log', 'common'),
x_7u: x_fs,
x_ed: x_fx,
x_1u: 40
},
color: 					{	x_7s: 'color',
x_7t  : true
},
enabled: 				{	x_7s: 'enabled',
x_7t  : true
},
inactive: 				{	x_7s: 'inactive',
x_7t  : true
}
};
for (x_41 in x_5x) {
if ('string' === typeof x_41) {
x_fy[x_41] = x_5x[x_41];
}
}

if (x_2v.x_gq) {
x_5v.x_64 = {
x_1f: 'x_gr',
x_2v: new kerio.lib.x_37(x_2w + 'x_gs', x_2v.x_gq)
};
}
if (x_o){
if (x_2v.x_gt) {
x_5v.x_5w = {
x_1f: 'x_gr',
x_1e: x_2v.x_gt,
x_4c: x_fi.x_gu
};
}
else {
x_5v.x_5w = {
x_1f: 'x_cr' };
}
} else {
x_4u = x_fa.x_b0('x_gv');
x_g5 = ['x_56', 'x_gw', 'x_4n'];
x_2z = x_4u.x_1e;
x_g8 = x_2z.length;
for (x_41 = 0, x_42 = x_g5.length; x_41 < x_42; x_41++) {
x_g9 = x_g5[x_41];
for (x_g7 = 0; x_g7 < x_g8; x_g7++) {
x_2y = x_2z[x_g7];
if (x_g9 === x_2z[x_g7].x_1j) {
x_2y.x_24 = false;
break;
}
}
}
if (x_2v.x_gd) {
x_4u.x_1f = 'x_gr';
}
if (x_2v.x_gt) {
x_4u.x_1e = x_4u.x_1e.concat(x_2v.x_gt);
}
x_5v.x_5w = x_4u;
x_5v.x_83 = x_fa.x_b0('x_fb');
if (x_2v.x_gd) {
x_5v.x_83.x_1p = x_5v.x_83.x_1p + ' tabPageInside';
}
}
x_42 = x_g3.length;
for (x_41 = 0; x_41 < x_42; x_41++) {
x_7s = x_g3[x_41];
x_g0.push(x_fy[x_7s]);
if ('validAddressGroupEditor' === x_7s) {
x_g1 = true;
}
if ('validTimeRangeEditor' === x_7s) {
x_g2 = true;
}
}
x_fz = {
x_1p: 'userList',
x_gx: {
x_a2: {
x_gc: ''
},
x_gy: {
x_gc: x_x('Some rules are inefficient as they refer to non-existing objects (see greyed rule rows).', 'policyList'),
x_cy: 'ruleInactive'
}
},
x_gz: 'x_a2'
};
if (x_2v.x_h0) {
for (x_41 in x_2v.x_h0) {
if ('string' === typeof x_41) {
x_fz.x_gx[x_41] = x_2v.x_h0[x_41];
}
}
}
x_60 = new kerio.lib.x_h1(x_2w + 'x_60', x_fz);

x_5o = {
x_5q: false,
x_o: x_o,
x_h2: true,
x_1p: 'policyGrid',

x_h3: function(x_eo) {
var
x_1p;
x_1p = ((true === x_eo.inactive) ? 'ruleInactive ' : '') + x_fa.x_h4[x_eo.color];
if (x_eo.x_h5) {
x_1p += (('' !== x_1p) ? ' ' : '') + 'ruleDefault';
}
return x_1p;
},

x_h6: function(x_3l, x_7s, x_1o, x_eo) {
if (x_3l.x_h7) {
return false; }
if (x_3l.x_h8) {
return x_3l.x_h8(x_7s, x_eo);
}
return !x_eo.x_h5;
},
x_5x: {
x_d2: false,
x_1e: x_g0
},
x_5v: x_5v,
x_60: x_60,

x_61: function(x_3l, x_eo, x_7s) {
if (x_3l.x_h7 && 'users' !== x_7s) {
return; }
if (x_eo.x_h5) {
return; }
if ('users' !== x_7s) {
if (this.x_gb) {
this.x_gb(x_3l, x_eo, x_7s);
}
return;
}
x_fi.x_3f();
kerio.lib.x_5l.x_5m({
x_5g: 'ruleUsersEditor',
x_n: ('x_h9' === this.x_ha) ? 'x_hb' : 'x_hc',
x_28: {
x_47: x_eo,
x_5d: x_3l
}
});
},
x_2d: function(x_3l) {
x_3l.x_hd();
x_3l.x_he();
x_3l.x_hf();

x_3l.x_hg();
if ("x_h9" !== this.x_ha) {
x_fi.x_3j();
}
} };if (!x_2v.x_gd) {
x_5o.x_65 = {
x_68: 'rules',
x_67: false,
x_hh: (false === x_2v.x_hh ? false : true),
x_66: {
method: 'get',
object: x_2v.x_hi
}
};
}
kerio.waw.shared.x_17.x_fp.superclass.constructor.call(this, x_1j, x_5o);
if (this.x_5v.x_5w && this.x_5v.x_5w.x_1e) {
x_g5 = ['x_hj', 'x_hk', 'x_hl', 'x_hm', 'x_hn',
'x_ho', 'x_hp', 'x_hq', 'x_hr'];
x_2z = this.x_5v.x_5w.x_1e;
for (x_41 = 0, x_42 = x_g5.length; x_41 < x_42; x_41++) {
x_g9 = x_g5[x_41];
x_g6 = x_2z[x_g9];
if (x_g6) {
x_g6._kx.x_24 = false;
x_g6._kx.x_hs = x_g6;
x_g6._kx.x_32 = this.x_5v.x_5w;
}
}
}
this.x_ht = true;
this.x_27({
x_hu: x_g1,
x_hv: x_g2,
x_hw: x_2v.x_hw,
x_hx: x_2v.x_hy,
x_h7: x_o,
x_hz: x_2v.x_hi,
x_ha: x_2v.x_n,
x_i0: x_2v.x_i1,
x_i2: x_2v.x_i3,
x_i4: x_2v.x_gd,
x_i5: x_g4,
x_h8: x_2v.x_h6,
x_i6: x_2v.x_i7,
x_i8: x_2v.x_i9
});
};kerio.lib.x_36(kerio.waw.shared.x_17.x_fp, kerio.adm.x_17.x_3c, {

x_2d: function() {
var
x_14 = kerio.waw.status.x_14;
if (!this.x_i4) {
x_14.x_ia(this.x_o ? undefined : this.x_5v.x_5w,
{x_74: this.x_he, x_2q: this});
}
x_14.x_15(false);
this.x_6y();
if (this.x_hu) {
x_fi.x_ib({
x_ic: 'x_id',
x_9u: this.x_ie('validAddressEditor')
}).x_4y();
}
if (this.x_hv) {
x_fi.x_ib({
x_ic: 'x_if',
x_9u: this.x_ie('validTimeRangeEditor')
}).x_4y();
}
},

x_ig: function() {
var
x_3v = this.x_3v,
x_b3 = x_3v.x_40[0];
this.x_ih(kerio.lib.x_9m(x_b3.x_47), x_b3.x_fl + 1, true);
if (this.x_i4) {
this.x_i5();
} else {
kerio.waw.status.x_14.x_15(true);
}
},
x_3k: function() {
this.x_70();
if (this.x_i4) {
this.x_i5();
} else {
kerio.waw.status.x_14.x_15(true);
}
this.x_he();
},
x_ii: function(x_ij) {
this.x_ik(x_ij, 'name');
if (this.x_i4) {
this.x_i5();
} else {
kerio.waw.status.x_14.x_15(true);
}
},
x_hf: function() {
var
x_il = x_fa.x_b0(this.x_hw),
x_x = kerio.lib.x_x;
x_il.x_h5 = true;
x_il.name = ("x_h9" !== this.x_ha) ? x_x('Block other traffic', 'ruleList') : x_x('Allow other traffic', 'ruleList');
x_il.description = x_x('Any other traffic is denied/dropped.', 'ruleList');
x_il.action = x_r.x_im.x_in;
x_il.color = x_r.x_io.x_ip;
if (this.x_hx) {
delete this.x_hx.name; x_fi.x_iq(this.x_hx, x_il);
}
this.x_fn(x_il, true);
},
x_ir: function(x_47) {
if (('' !== x_47.validTimeRange.id) && x_47.validTimeRange.invalid) {
return true;
}
if (this.x_i0) {
return this.x_i0(x_47);
}
return false;
},
x_hd: function() {
var
x_is = this.x_7i(),
x_41, x_42;
for (x_41 = 0, x_42 = x_is.length; x_41 < x_42; x_41++) {
x_is[x_41].inactive = this.x_ir(x_is[x_41]);
}
}, 
x_it: function(x_47) {
return x_47.inactive;
}, 
x_he: function() {
var
x_iu = 'x_a2',
x_is,
x_iv;

if (this.x_i2) {
x_iv = this.x_i2();
}
if (x_iv) {
x_iu = x_iv;
} else {

x_is = this.x_iw(this.x_it);
if (x_is) {
x_iu = 'x_gy';
}
}
this.x_60.x_ix(x_iu);
}, 
x_gl: function(x_il) {
this.x_i5();
if (x_il.inactive) {
x_il.inactive = this.x_ir(x_il);
}
this.x_he();
}, 
x_iy: function() {
if (this.x_iz()) {
return false;
}
this.x_j0.defer(1,this);
}, 
x_iz: function() {
var
x_47 = this.x_7i(),
x_41, x_42;
for (x_41 = 0, x_42 = x_47.length; x_41 < x_42; x_41++) {
if (-1 === x_fa.x_j1.indexOf(x_47[x_41].action)) {
x_fi.x_j2(
kerio.lib.x_x('Please set the action for rule "%1"!', 'list',
{
x_49: [x_47[x_41].name] }
) ); return true; } } return false;
},
x_j0: function() {
var
x_47 = this.x_7i(),
x_j3,
x_41, x_42,
x_j4,
x_j5,
x_f4;
for (x_41 = 0, x_42 = x_47.length; x_41 < x_42; x_41++) {
x_j3 = x_47[x_41];
delete x_j3.users; }
if (this.x_i6) {
this.x_i6(x_47);
}
if (this.x_i8) {
x_j5 = this.x_i8(x_47);
x_f4 = {
x_da: x_j5,
x_2q: this,
x_2e: this.x_j6
};
x_fi.x_db(x_f4);
} else {
x_47 = this.x_j7(x_47);
x_j4 = {
x_28: {
object: this.x_hz,
method: 'set',
params: kerio.lib.x_6r({
rules: x_47
})
},
x_2e: this.x_j6,
x_2q: this
};
kerio.lib.x_6t.x_6u(x_j4);
}
}, 
x_j7: function(x_47) {
var
x_42;
x_42 = x_47.length - 1;
if (x_47[x_42].x_h5) {
x_47.splice(x_42, 1);
}
return x_47;
},
x_j6: function(x_6v) {
if (!x_6v.x_6x) {
kerio.waw.shared.x_3e.x_3j(); return;
}
if ('x_j8' === this.x_ha) {
this.x_2c();
}
else {
this.x_6y();
}
kerio.waw.status.x_14.x_15(false);
}});