PageSourceSearch

https://www.townofempire.org/assets/theme/global/js/jquery.selectbox-0.2.js?v=1549045112

js townofempire.org collected 2026-10-07 14:56:49 UTC 47,427 bytes, 682 lines download raw bytes

1/*!
2 * jQuery Selectbox plugin 0.2
3 *
4 * Copyright 2011-2012, Dimitar Ivanov (http://www.bulgaria-web-developers.com/projects/javascript/selectbox/)
5 * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
6 * 
7 * Date: Tue Jul 17 19:58:36 2012 +0300
8 * Updated for two fixes by wmlabs :: 
9 * PLUGIN CODE : p8lwhv0
10 * 1. fixed ios issues
11 * 2. fixed multi options attribute select remains selected
12 * 3. fixed hide_duplicate_option // added this functionlity // udated on jan21st 2015
13 * 4. fixed hide_duplicate_option // --------FIX------------ // udated on feb18 2015
14 *    #bg2015f18_p8lwhv0  value not changing in navtive dropdown, created problemsn in safari and chrome browser, wordpress intregration :: projects solved 'keystone'
15 * 5. #bg2015m10_p8lwhv0 // dropdown should open upwards if no space at bottom
16   6. #bg2015m15_p8lwhv0 // selected value via keyboard not reflecting
17   7. #bg2015a8_p8lwhv0 // its fix of bug #bg2015m10_p8lwhv0, problem when scroll appears its calculates wrong offset
18   8. #bg2015a27_b1_p8lwhv0 //  focus issue when user select the value
19   9. #bg2015a27_b2_p8lwhv0 //  added  country flag option read
20  10. #bg2015m1_p8lwhv0 //  slideUp is good and slide Down is jerking
21  11. #bg2015m1_p8lwhv0 // country map with no default text
22  11. #bg2015m2_b1_p8lwhv0 // width 100%;
23  13. #bg2015m2_b2_p8lwhv0 // countryflag default selected options with flag or text
24  14. #bg2015m2_b3_p8lwhv0 // removeing default selected
25  15. #bg2015m20_p8lwhv0 // enable closing of popup on ipad and ios
26  16. #bg2015m20_b2_p8lwhv0 // foucs on selecting value
27  17. #bg2015m21_p8lwhv0 // tab validation was fired, when no value was changed at first time
28
29 */
30;(function($,undefined){
31	var PROP_NAME = 'selectbox',
32		FALSE = false,
33		removedDefault = false,
34		TRUE = true;
35	/**
36	 * Selectbox manager.
37	 * Use the singleton instance of this class, $.selectbox, to interact with the select box.
38	 * Settings for (groups of) select boxes are maintained in an instance object,
39	 * allowing multiple different settings on the same page
40	 */
41	function Selectbox() {
42		this._state = [];
43		this._defaults = { // Global defaults for all the select box instances
44			classHolder: "sbHolder",
45			classHolderDisabled: "sbHolderDisabled",
46			classSelector: "sbSelector",
47			classOptions: "sbOptions",
48			classGroup: "sbGroup",
49			classSub: "sbSub",
50			classDisabled: "sbDisabled",
51			classToggleOpen: "sbToggleOpen",
52			classToggle: "sbToggle",
53			classFocus: "sbFocus",
54			hide_duplicate_option : false,
55			removeDefault_option_onselect :false,
56			countryflagDefault_txt:false,
57			useCustomscroll:false,
58			customScrollminHeight:120,
59			speed: 200,
60			addcountryflag:false,
61			effect: "slide", // "slide" or "fade"
62			onChange: null, //Define a callback function when the selectbox is changed
63			onOpen: null, //Define a callback function when the selectbox is open
64			onClose: null //Define a callback function when the selectbox is closed
65		};
66	}
67	
68	$.extend(Selectbox.prototype, {
69		/**
70		 * Is the first field in a jQuery collection open as a selectbox
71		 * 
72		 * @param {Object} target
73		 * @return {Boolean}
74		 */
75		_isOpenSelectbox: function (target) {
76			if (!target) {
77				return FALSE;
78			}
79			var inst = this._getInst(target);
80			return inst.isOpen;
81		},
82		/**
83		 * Is the first field in a jQuery collection disabled as a selectbox
84		 * 
85		 * @param {HTMLElement} target
86		 * @return {Boolean}
87		 */
88		_isDisabledSelectbox: function (target) {
89			if (!target) {
90				return FALSE;
91			}
92			var inst = this._getInst(target);
93			return inst.isDisabled;
94		},
95		/**
96		 * Attach the select box to a jQuery selection.
97		 * 
98		 * @param {HTMLElement} target
99		 * @param {Object} settings
100		 */
101		_attachSelectbox: function (target, settings) {
102			if (this._getInst(target)) {
103				return FALSE;
104			}
105			var $target = $(target),
106				self = this,
107				inst = self._newInst($target),
108				sbHolder, sbSelector, sbToggle, sbOptions,
109				s = FALSE, optGroup = $target.find("optgroup"), opts = $target.find("option"), olen = opts.length;
110				
111			$target.attr("sb", inst.uid);
112				
113			$.extend(inst.settings, self._defaults, settings);
114			self._state[inst.uid] = FALSE;
115			$target.focus(function(){
116			//$target.next().addClass('focused');
117			},function(){
118			//$target.next().removeClass('focused');	
119			});
120			
121			$target.hide();
122			
123			
124			function closeOthers() {
125				var key, sel,
126					uid = this.attr("id").split("_")[1];
127				for (key in self._state) {
128					if (key !== uid) {
129						if (self._state.hasOwnProperty(key)) {
130							sel = $("select[sb='" + key + "']")[0];
131							if (sel) {
132								self._closeSelectbox(sel);
133							}
134						}
135					}
136				}
137			}
138			
139			sbHolder = $("<div>", {
140				"id": "sbHolder_" + inst.uid,
141				"class": inst.settings.classHolder,
142				"tabindex": $target.attr("tabindex"),
143				"width":'auto'
144			}).focus(function(){if(!sbHolder.hasClass('focused'))sbHolder.addClass('focused')}).blur(function(){ sbHolder.removeClass('focused')});
145			
146			sbSelector = $("<div>", {
147				"id": "sbSelector_" + inst.uid,
148				"href": "#",
149				"class": inst.settings.classSelector,
150				"click": function (e) {
151					e.preventDefault();
152					closeOthers.apply($(this), []);
153					var uid = $(this).attr("id").split("_")[1];
154					if (self._state[uid]) {
155						self._closeSelectbox(target);
156					} else {
157						self._openSelectbox(target);
158					}
159				},
160				"tabindex":"-1"
161			});
162			
163			sbToggle = $("<div>", {
164				"id": "sbToggle_" + inst.uid,
165				"href": "#",
166				"class": inst.settings.classToggle,
167				"click": function (e) {
168					e.preventDefault();
169					closeOthers.apply($(this), []);
170					var uid = $(this).attr("id").split("_")[1];
171					if (self._state[uid]) {
172						self._closeSelectbox(target);
173					} else {
174						self._openSelectbox(target);
175					}
176				},
177				"tabindex":"-1"
178			});
179			sbToggle.appendTo(sbHolder);
180
181			sbOptions = $("<ul>", {
182				"id": "sbOptions_" + inst.uid,
183				"class": inst.settings.classOptions,
184				"css": {
185					"display": "none",
186					"width":"100%"
187				}
188			});
189			
190			$target.children().each(function(i) {
191				var that = $(this), li, config = {};
192				if (that.is("option")) {
193					getOptions(that);
194				} else if (that.is("optgroup")) {
195					li = $("<li>");
196					$("<span>", {
197						"text": that.attr("label")
198					}).addClass(inst.settings.classGroup).appendTo(li);
199					li.appendTo(sbOptions);
200					if (that.is(":disabled")) {
201						config.disabled = true;
202					}
203					config.sub = true;
204					getOptions(that.find("option"), config);
205				}
206			});
207			
208			if(inst.settings.addcountryflag && !inst.settings.display_default_Countryflag){
209				sbOptions.find('li').each(function(i){
210					if(i>0){
211					var imgpath = $(opts[i]).attr("data-img-src");
212					$(this).prepend("<img src="+imgpath+">");
213					}
214				});
215			}else if(inst.settings.addcountryflag && inst.settings.display_default_Countryflag){
216					sbOptions.find('li').each(function(i){
217					
218						var imgpath = $(opts[i]).attr("data-img-src");
219						
220						if($(opts[i]).attr("data-img-src")) {
221							$(this).prepend("<img src="+imgpath+">");
222						}else{
223							$(this).remove();
224							}
225	
226						
227						
228					});
229				
230				//var uid = $this.data("uid");
231				//console.log(sbOptions.find('li').eq(0).html());
232				sbSelector.html(sbOptions.find('li').eq(0).html());
233				
234				
235			}
236			
237			
238			function getOptions () {
239				var sub = arguments[1] && arguments[1].sub ? true : false,
240					disabled = arguments[1] && arguments[1].disabled ? true : false;
241					arguments[0].each(function (i) {
242					var that = $(this),
243						li = $("<li>"),
244						child;
245					if (that.is(":selected")) {
246						sbSelector.text(that.text());
247						s = TRUE;
248					}
249					if (i === olen - 1) {
250						li.addClass("last");
251					}
252					if (!that.is(":disabled") && !disabled) {
253						child = $("<a>", {
254							"href": "#" + that.val(),
255							"rel": that.val()
256						}).text(that.text()).bind("click.sb", function (e) {
257							if (e && e.preventDefault) {
258								e.preventDefault();
259							}
260							var t = sbToggle,
261							 	$this = $(this),
262								uid = t.attr("id").split("_")[1];
263							//self._changeSelectbox(target, $this.attr("rel"), $this.text());
264							self._changeSelectbox(target, $this.attr("rel"), $this.closest('li').html());
265							self._closeSelectbox(target);
266						}).bind("mouseover.sb", function () {
267							var $this = $(this);
268							$this.parent().siblings().find("a").removeClass(inst.settings.classFocus);
269							$this.addClass(inst.settings.classFocus);
270						}).bind("mouseout.sb", function () {
271							$(this).removeClass(inst.settings.classFocus);
272						});
273						if (sub) {
274							child.addClass(inst.settings.classSub);
275						}
276						if (that.is(":selected")) {
277							child.addClass(inst.settings.classFocus);
278						}
279						child.appendTo(li);
280					} else {
281						child = $("<span>", {
282							"text": that.text()
283						}).addClass(inst.settings.classDisabled);
284						if (sub) {
285							child.addClass(inst.settings.classSub);
286						}
287						child.appendTo(li);
288					}
289					li.appendTo(sbOptions);
290				});
291			}
292			
293			if (!s) {
294				sbSelector.text(opts.first().text());
295			}
296
297			$.data(target, PROP_NAME, inst);
298			
299			sbHolder.data("uid", inst.uid).bind("keydown.sb", function (e) {
300				var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0,
301					$this = $(this),
302					uid = $this.data("uid"),
303					inst = $this.siblings("select[sb='"+uid+"']").data(PROP_NAME),
304					trgt = $this.siblings(["select[sb='", uid, "']"].join("")).get(0),
305					$f = $this.find("ul").find("a." + inst.settings.classFocus);
306				var $next;
307				switch (key) {
308					case 37: //Arrow Left
309					case 38: //Arrow Up
310						if ($f.length > 0) {
311							
312							$("a", $this).removeClass(inst.settings.classFocus);
313							$next = $f.parent().prevAll("li:has(a)").eq(0).find("a");
314							if ($next.length > 0) {
315								$(target)[0].selectedIndex = $next.closest('li').index();
316								$next.addClass(inst.settings.classFocus).focus();
317								//$("#sbSelector_" + uid).text($next.text());
318								$("#sbSelector_" + uid).html($next.closest('li').html());
319								//console.log($next.closest('li').html());
320								//self._changeSelectbox(trgt, $f.attr("rel"), $next.closest('li').html());
321                                inst.input.trigger('change');
322							}
323						}
324						break;
325					case 39: //Arrow Right
326					case 40: //Arrow Down
327						
328						$("a", $this).removeClass(inst.settings.classFocus);
329						if ($f.length > 0) {
330							$next = $f.parent().nextAll("li:has(a)").eq(0).find("a");
331						} else {
332							$next = $this.find("ul").find("a").eq(0);
333						}
334						if ($next.length > 0) {
335							$(target)[0].selectedIndex = $next.closest('li').index();
336							$next.addClass(inst.settings.classFocus).focus();
337							//$("#sbSelector_" + uid).text($next.text());
338							$("#sbSelector_" + uid).html($next.closest('li').html());
339							//console.log($next.closest('li').html());
340							//self._changeSelectbox(trgt, $f.attr("rel"),$next.closest('li').html());
341                             inst.input.trigger('change');
342						}
343						break;				
344					case 13: //Enter
345						if ($f.length > 0) {
346							self._changeSelectbox(trgt, $f.attr("rel"), $f.closest('li').html());
347							//self._changeSelectbox(trgt, $f.attr("rel"), $f.closest('li').html());
348						}
349						self._closeSelectbox(trgt);
350						break;
351					case 9: //Tab
352						if (trgt) {
353							var inst = self._getInst(trgt);
354							var $next = $f.parent().prevAll("li:has(a)").eq(0).find("a");
355							if (inst/* && inst.isOpen*/) {
356								if ($f.length > 0) {
357									
358                                    $("#sbSelector_" + uid).html($next.closest('li').html());
359									//self._changeSelectbox(trgt, $f.attr("rel"), $f.closest('li').html());
360									//self._changeSelectbox(trgt, $f.attr("rel"), $f.closest('li').html());
361								}
362								self._closeSelectbox(trgt);
363							}
364						}
365						var i = parseInt($this.attr("tabindex"), 10);
366						if (!e.shiftKey) {
367							i++;
368						} else {
369							i--;
370						}
371						$("*[tabindex='" + i + "']").focus();
372						break;
373					case 27: //Escape
374						self._closeSelectbox(trgt);
375						break;
376				}
377				e.stopPropagation();
378				return false;
379			}).delegate("a", "mouseover", function (e) {
380				$(this).addClass(inst.settings.classFocus);
381			}).delegate("a", "mouseout", function (e) {
382				$(this).removeClass(inst.settings.classFocus);	
383			});
384			
385			sbSelector.appendTo(sbHolder);
386			sbOptions.appendTo(sbHolder);			
387			sbHolder.insertAfter($target);
388			
389			$("html").on('mousedown, touchstart', function(e) {
390				e.stopPropagation();          
391				$("select").selectbox('close'); 
392			});
393            sbHolder.on('touchstart',function(e) {
394            e.stopPropagation();
395            });
396            
397			$([".", inst.settings.classHolder, ", .", inst.settings.classSelector].join("")).mousedown(function(e) {    
398				e.stopPropagation();
399			});
400		},
401		/**
402		 * Remove the selectbox functionality completely. This will return the element back to its pre-init state.
403		 * 
404		 * @param {HTMLElement} target
405		 */
406		_detachSelectbox: function (target) {
407			var inst = this._getInst(target);
408			if (!inst) {
409				return FALSE;
410			}
411			$("#sbHolder_" + inst.uid).remove();
412			$.data(target, PROP_NAME, null);
413			$(target).show();			
414		},
415		/**
416		 * Change selected attribute of the selectbox.
417		 * 
418		 * @param {HTMLElement} target
419		 * @param {String} value
420		 * @param {String} text
421		 */
422		_changeSelectbox: function (target, value, text) {
423			var onChange,
424				inst = this._getInst(target);
425			if (inst) {
426				onChange = this._get(inst, 'onChange');
427				//$("#sbSelector_" + inst.uid).text(text);
428				
429				 $("#sbSelector_" + inst.uid).html(text);
430			}
431			
432			if(inst.settings.addcountryflag){
433				//$("#sbHolder_" + inst.uid).find('li').eq(0).hide();
434			}else{
435				value = value.replace(/\'/g, "\\'");
436				
437				}
438			
439			if(inst.settings.removeDefault_option_onselect && !removedDefault){
440				$("#sbOptions_" + inst.uid).find('li').eq(0).remove();
441				removedDefault = true;
442			}	
443			
444			
445			
446            //$(target).find("option").removeAttr("selected");
447            $(target).find("option").attr("selected", FALSE);
448            $(target).find("option[value='" + value + "']").attr("selected", TRUE);
449            $(target)[0].selectedIndex = $(target).find("option[value='" + value + "']").index();
450			$("#sbHolder_" + inst.uid).addClass('focused').focus();
451			//$(target).focus();
452			//$(target).find("option[value='" + value + "']").attr("selected", TRUE);
453			if (inst && onChange) {
454				onChange.apply((inst.input ? inst.input[0] : null), [value, inst]);
455			} else if (inst && inst.input) {
456				inst.input.trigger('change');
457			}
458		},
459		/**
460		 * Enable the selectbox.
461		 * 
462		 * @param {HTMLElement} target
463		 */
464		_enableSelectbox: function (target) {
465			var inst = this._getInst(target);
466			if (!inst || !inst.isDisabled) {
467				return FALSE;
468			}
469			$("#sbHolder_" + inst.uid).removeClass(inst.settings.classHolderDisabled);
470			inst.isDisabled = FALSE;
471			$.data(target, PROP_NAME, inst);
472		},
473		/**
474		 * Disable the selectbox.
475		 * 
476		 * @param {HTMLElement} target
477		 */
478		_disableSelectbox: function (target) {
479			var inst = this._getInst(target);
480			if (!inst || inst.isDisabled) {
481				return FALSE;
482			}
483			$("#sbHolder_" + inst.uid).addClass(inst.settings.classHolderDisabled);
484			inst.isDisabled = TRUE;
485			$.data(target, PROP_NAME, inst);
486		},
487		/**
488		 * Get or set any selectbox option. If no value is specified, will act as a getter.
489		 * 
490		 * @param {HTMLElement} target
491		 * @param {String} name
492		 * @param {Object} value
493		 */
494		_optionSelectbox: function (target, name, value) {
495			var inst = this._getInst(target);
496			if (!inst) {
497				return FALSE;
498			}
499			//TODO check name
500			inst[name] = value;
501			$.data(target, PROP_NAME, inst);
502		},
503		/**
504		 * Call up attached selectbox
505		 * 
506		 * @param {HTMLElement} target
507		 */
508		_openSelectbox: function (target) {
509			var inst = this._getInst(target);
510			//if (!inst || this._state[inst.uid] || inst.isDisabled) {
511			if (!inst || inst.isOpen || inst.isDisabled) {
512				return;
513			}
514			var	el = $("#sbOptions_" + inst.uid),
515				viewportHeight = parseInt($(window).height(), 10),
516				offset = $("#sbHolder_" + inst.uid).offset(),
517				scrollTop = $(window).scrollTop(),
518				height = el.prev().outerHeight()+3,
519				diff = viewportHeight - (offset.top - scrollTop) - height / 2,
520				onOpen = this._get(inst, 'onOpen');
521				var liLength = height *$("#sbOptions_" + inst.uid +" li" ).length;
522				
523				
524			if($("#sbOptions_" + inst.uid).parent().offset().top +liLength -$(window).scrollTop() -liLength+inst.settings.customScrollminHeight >= $(window).height()){
525				
526				el.css({
527					   	   "bottom": height + "px",
528							"maxHeight": (liLength) + "px",
529							"top":''
530					   });
531					   
532				}else{	
533				
534				el.css({
535					"top": (height-3) + "px",
536					"maxHeight": (diff - height) + "px",
537					"bottom":''
538				});
539					
540			}
541
542			
543			
544			setTimeout(function(){
545				inst.settings.effect === "fade" ? el.fadeIn(inst.settings.speed,function(){
546					bindScroll()
547					}) : el.slideDown(inst.settings.speed,function(){
548					bindScroll();
549					
550					});
551				},50)
552				
553			function bindScroll(){//need this options as structure
554				if($('.mCSB_container').length<=0 && inst.settings.useCustomscroll ){
555						$("#sbOptions_" + inst.uid).mCustomScrollbar({
556								axis:"y"
557						});
558					}
559			}	
560			
561			$("#sbToggle_" + inst.uid).addClass(inst.settings.classToggleOpen);
562			this._state[inst.uid] = TRUE;
563			inst.isOpen = TRUE;
564			if (onOpen) {
565				onOpen.apply((inst.input ? inst.input[0] : null), [inst]);
566			}
567			$.data(target, PROP_NAME, inst);
568			$("#sbOptions_" + inst.uid).find('li').removeAttr('style');
569			if(inst.settings.hide_duplicate_option){
570				var textsel = $("#sbSelector_" + inst.uid).text()
571				$("#sbOptions_" + inst.uid+" li a").each(function(){
572					
573						if(textsel == $(this).text()){
574						$(this).closest('li').hide();
575						}else{
576							$(this).closest('li').show();
577					}
578					});
579				
580			}
581			
582			
583			
584			
585		},
586		/**
587		 * Close opened selectbox
588		 * 
589		 * @param {HTMLElement} target
590		 */
591		_closeSelectbox: function (target) {
592			var inst = this._getInst(target);
593			//if (!inst || !this._state[inst.uid]) {
594			if (!inst || !inst.isOpen) {
595				return;
596			}
597			var onClose = this._get(inst, 'onClose');
598			inst.settings.effect === "fade" ? $("#sbOptions_" + inst.uid).fadeOut(inst.settings.speed) : $("#sbOptions_" + inst.uid).slideUp(inst.settings.speed);
599			$("#sbToggle_" + inst.uid).removeClass(inst.settings.classToggleOpen);
600			this._state[inst.uid] = FALSE;
601			inst.isOpen = FALSE;
602			if (onClose) {
603				onClose.apply((inst.input ? inst.input[0] : null), [inst]);
604			}
605			$.data(target, PROP_NAME, inst);
606			if($('.mCSB_container').length>0 && inst.settings.useCustomscroll){
607				$("#sbOptions_" + inst.uid).mCustomScrollbar("destroy");
608			}
609			
610		},
611		/**
612		 * Create a new instance object
613		 * 
614		 * @param {HTMLElement} target
615		 * @return {Object}
616		 */
617		_newInst: function(target) {
618			var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1');
619			return {
620				id: id, 
621				input: target, 
622				uid: Math.floor(Math.random() * 99999999),
623				isOpen: FALSE,
624				isDisabled: FALSE,
625				settings: {}
626			}; 
627		},
628		/**
629		 * Retrieve the instance data for the target control.
630		 * 
631		 * @param {HTMLElement} target
632		 * @return {Object} - the associated instance data
633		 * @throws error if a jQuery problem getting data
634		 */
635		_getInst: function(target) {
636			try {
637				return $.data(target, PROP_NAME);
638			}
639			catch (err) {
640				throw 'Missing instance data for this selectbox';
641			}
642		},
643		/**
644		 * Get a setting value, defaulting if necessary
645		 * 
646		 * @param {Object} inst
647		 * @param {String} name
648		 * @return {Mixed}
649		 */
650		_get: function(inst, name) {
651			return inst.settings[name] !== undefined ? inst.settings[name] : this._defaults[name];
652		}
653	});
654
655	/**
656	 * Invoke the selectbox functionality.
657	 * 
658	 * @param {Object|String} options
659	 * @return {Object}
660	 */
661	$.fn.selectbox = function (options) {
662		var otherArgs = Array.prototype.slice.call(arguments, 1);
663		if (typeof options == 'string' && options == 'isDisabled') {
664			return $.selectbox['_' + options + 'Selectbox'].apply($.selectbox, [this[0]].concat(otherArgs));
665		}
666		if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') {
667			return $.selectbox['_' + options + 'Selectbox'].apply($.selectbox, [this[0]].concat(otherArgs));
668		}
669		return this.each(function() {
670			typeof options == 'string' ?
671				$.selectbox['_' + options + 'Selectbox'].apply($.selectbox, [this].concat(otherArgs)) :
672				$.selectbox._attachSelectbox(this, options);
673		});
674	};
675	$.selectbox = new Selectbox(); // singleton instance
676	$.selectbox.version = "0.2";
677})(jQuery);
678
679/*mousewheel*/
680;(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1
680),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
681/*custom scrollbar*/
682;(function(c){var b={init:function(e){var f={set_width:false,set_height:false,horizontalScroll:false,scrollInertia:950,mouseWheel:true,mouseWheelPixels:"auto",autoDraggerLength:true,autoHideScrollbar:false,alwaysShowScrollbar:false,snapAmount:null,snapOffset:0,scrollButtons:{enable:false,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:true,updateOnContentResize:false,autoExpandHorizontalScroll:false,autoScrollOnFocus:true,normalizeMouseWheelDelta:false},contentTouchScroll:true,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},e=c.extend(true,f,e);return this.each(function(){var m=c(this);if(e.set_width){m.css("width",e.set_width)}if(e.set_height){m.css("height",e.set_height)}if(!c(document).data("mCustomScrollbar-index")){c(document).data("mCustomScrollbar-index","1")}else{var t=parseInt(c(document).data("mCustomScrollbar-index"));c(document).data("mCustomScrollbar-index",t+1)}m.wrapInner("<div class='mCustomScrollBox mCS-"+e.theme+"' id='mCSB_"+c(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+c(document).data("mCustomScrollbar-index"));var g=m.children(".mCustomScrollBox");if(e.horizontalScroll){g.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");var k=g.children(".mCSB_h_wrapper");k.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({width:k.children().outerWidth(),position:"relative"}).unwrap()}else{g.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />")}var o=g.children(".mCSB_container");if(c.support.touch){o.addClass("mCS_touch")}o.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' style='position:relative;'></div></div><div class='mCSB_draggerRail'></div></div></div>");var l=g.children(".mCSB_scrollTools"),h=l.children(".mCSB_draggerContainer"),q=h.children(".mCSB_dragger");if(e.horizontalScroll){q.data("minDraggerWidth",q.width())}else{q.data("minDraggerHeight",q.height())}if(e.scrollButtons.enable){if(e.horizontalScroll){l.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;'></a>")}else{l.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;'></a>")}}g.bind("scroll",function(){if(!m.is(".mCS_disabled")){g.scrollTop(0).scrollLeft(0)}});m.data({mCS_Init:true,mCustomScrollbarIndex:c(document).data("mCustomScrollbar-index"),horizontalScroll:e.horizontalScroll,scrollInertia:e.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:e.mouseWheel,mouseWheelPixels:e.mouseWheelPixels,autoDraggerLength:e.autoDraggerLength,autoHideScrollbar:e.autoHideScrollbar,alwaysShowScrollbar:e.alwaysShowScrollbar,snapAmount:e.snapAmount,snapOffset:e.snapOffset,scrollButtons_enable:e.scrollButtons.enable,scrollButtons_scrollType:e.scrollButtons.scrollType,scrollButtons_scrollSpeed:e.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:e.scrollButtons.scrollAmount,autoExpandHorizontalScroll:e.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:e.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:e.advanced.normalizeMouseWheelDelta,contentTouchScroll:e.contentTouchScroll,onScrollStart_Callback:e.callbacks.onScrollStart,onScroll_Callback:e.callbacks.onScroll,onTotalScroll_Callback:e.callbacks.onTotalScroll,onTotalScrollBack_Callback:e.callbacks.onTotalScrollBack,onTotalScroll_Offset:e.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:e.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:e.callbacks.whileScrolling,bindEvent_scrollbar_drag:false,bindEvent_content_touch:false,bindEvent_scrollbar_click:false,bindEvent_mousewheel:false,bindEvent_buttonsContinuous_y:false,bindEvent_buttonsContinuous_x:false,bindEvent_buttonsPixels_y:false,bindEvent_buttonsPixels_x:false,bindEvent_focusin:false,bindEvent_autoHideScrollbar:false,mCSB_buttonScrollRight:false,mCSB_buttonScrollLeft:false,mCSB_buttonScrollDown:false,mCSB_buttonScrollUp:false});if(e.horizontalScroll){if(m.css("max-width")!=="none"){if(!e.advanced.updateOnContentResize){e.advanced.updateOnContentResize=true}}}else{if(m.css("max-height")!=="none"){var s=false,r=parseInt(m.css("max-height"));if(m.css("max-height").indexOf("%")>=0){s=r,r=m.parent().height()*s/100}m.css("overflow","hidden");g.css("max-height",r)}}m.mCustomScrollbar("update");if(e.advanced.updateOnBrowserResize){var i,j=c(window).width(),u=c(window).height();c(window).bind("resize."+m.data("mCustomScrollbarIndex"),function(){if(i){clearTimeout(i)}i=setTimeout(function(){if(!m.is(".mCS_disabled")&&!m.is(".mCS_destroyed")){var w=c(window).width(),v=c(window).height();if(j!==w||u!==v){if(m.css("max-height")!=="none"&&s){g.css("max-height",m.parent().height()*s/100)}m.mCustomScrollbar("update");j=w;u=v}}},150)})}if(e.advanced.updateOnContentResize){var p;if(e.horizontalScroll){var n=o.outerWidth()}else{var n=o.outerHeight()}p=setInterval(function(){if(e.horizontalScroll){if(e.advanced.autoExpandHorizontalScroll){o.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:o.outerWidth(),position:"relative"}).unwrap()}var v=o.outerWidth()}else{var v=o.outerHeight()}if(v!=n){m.mCustomScrollbar("update");n=v}},300)}})},update:function(){var n=c(this),k=n.children(".mCustomScrollBox"),q=k.children(".mCSB_container");q.removeClass("mCS_no_scrollbar");n.removeClass("mCS_disabled mCS_destroyed");k.scrollTop(0).scrollLeft(0);var y=k.children(".mCSB_scrollTools"),o=y.children(".mCSB_draggerContainer"),m=o.children(".mCSB_dragger");if(n.data("horizontalScroll")){var A=y.children(".mCSB_buttonLeft"),t=y.children(".mCSB_buttonRight"),f=k.width();if(n.data("autoExpandHorizontalScroll")){q.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:q.outerWidth(),position:"relative"}).unwrap()}var z=q.outerWidth()}else{var w=y.children(".mCSB_buttonUp"),g=y.children(".mCSB_buttonDown"),r=k.height(),i=q.outerHeight()}if(i>r&&!n.data("horizontalScroll")){y.css("display","block");var s=o.height();if(n.data("autoDraggerLength")){var u=Math.round(r/i*s),l=m.data("minDraggerHeight");if(u<=l){m.css({height:l})}else{if(u>=s-10){var p=s-10;m.css({height:p})}else{m.css({height:u})}}m.children(".mCSB_dragger_bar").css({"line-height":m.height()+"px"})}var B=m.height(),x=(i-r)/(s-B);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().top);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{if(z>f&&n.data("horizontalScroll")){y.css("display","block");var h=o.width();if(n.data("autoDraggerLength")){var j=Math.round(f/z*h),C=m.data("minDraggerWidth");if(j<=C){m.css({width:C})}else{if(j>=h-10){var e=h-10;m.css({width:e})}else{m.css({width:j})}}}var v=m.width(),x=(z-f)/(h-v);
682n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().left);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{k.unbind("mousewheel focusin");if(n.data("horizontalScroll")){m.add(q).css("left",0)}else{m.add(q).css("top",0)}if(n.data("alwaysShowScrollbar")){if(!n.data("horizontalScroll")){m.css({height:o.height()})}else{if(n.data("horizontalScroll")){m.css({width:o.width()})}}}else{y.css("display","none");q.addClass("mCS_no_scrollbar")}n.data({bindEvent_mousewheel:false,bindEvent_focusin:false})}}},scrolling:function(i,q,n,k,A,f,D,w){var l=c(this);if(!l.data("bindEvent_scrollbar_drag")){var o,p,C,z,e;if(c.support.pointer){C="pointerdown";z="pointermove";e="pointerup"}else{if(c.support.msPointer){C="MSPointerDown";z="MSPointerMove";e="MSPointerUp"}}if(c.support.pointer||c.support.msPointer){k.bind(C,function(K){K.preventDefault();l.data({on_drag:true});k.addClass("mCSB_dragger_onDrag");var J=c(this),M=J.offset(),I=K.originalEvent.pageX-M.left,L=K.originalEvent.pageY-M.top;if(I<J.width()&&I>0&&L<J.height()&&L>0){o=L;p=I}});c(document).bind(z+"."+l.data("mCustomScrollbarIndex"),function(K){K.preventDefault();if(l.data("on_drag")){var J=k,M=J.offset(),I=K.originalEvent.pageX-M.left,L=K.originalEvent.pageY-M.top;G(o,p,L,I)}}).bind(e+"."+l.data("mCustomScrollbarIndex"),function(x){l.data({on_drag:false});k.removeClass("mCSB_dragger_onDrag")})}else{k.bind("mousedown touchstart",function(K){K.preventDefault();K.stopImmediatePropagation();var J=c(this),N=J.offset(),I,M;if(K.type==="touchstart"){var L=K.originalEvent.touches[0]||K.originalEvent.changedTouches[0];I=L.pageX-N.left;M=L.pageY-N.top}else{l.data({on_drag:true});k.addClass("mCSB_dragger_onDrag");I=K.pageX-N.left;M=K.pageY-N.top}if(I<J.width()&&I>0&&M<J.height()&&M>0){o=M;p=I}}).bind("touchmove",function(K){K.preventDefault();K.stopImmediatePropagation();var N=K.originalEvent.touches[0]||K.originalEvent.changedTouches[0],J=c(this),M=J.offset(),I=N.pageX-M.left,L=N.pageY-M.top;G(o,p,L,I)});c(document).bind("mousemove."+l.data("mCustomScrollbarIndex"),function(K){if(l.data("on_drag")){var J=k,M=J.offset(),I=K.pageX-M.left,L=K.pageY-M.top;G(o,p,L,I)}}).bind("mouseup."+l.data("mCustomScrollbarIndex"),function(x){l.data({on_drag:false});k.removeClass("mCSB_dragger_onDrag")})}l.data({bindEvent_scrollbar_drag:true})}function G(J,K,L,I){if(l.data("horizontalScroll")){l.mCustomScrollbar("scrollTo",(k.position().left-(K))+I,{moveDragger:true,trigger:"internal"})}else{l.mCustomScrollbar("scrollTo",(k.position().top-(J))+L,{moveDragger:true,trigger:"internal"})}}if(c.support.touch&&l.data("contentTouchScroll")){if(!l.data("bindEvent_content_touch")){var m,E,s,t,v,F,H;q.bind("touchstart",function(x){x.stopImmediatePropagation();m=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];E=c(this);s=E.offset();v=m.pageX-s.left;t=m.pageY-s.top;F=t;H=v});q.bind("touchmove",function(x){x.preventDefault();x.stopImmediatePropagation();m=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];E=c(this).parent();s=E.offset();v=m.pageX-s.left;t=m.pageY-s.top;if(l.data("horizontalScroll")){l.mCustomScrollbar("scrollTo",H-v,{trigger:"internal"})}else{l.mCustomScrollbar("scrollTo",F-t,{trigger:"internal"})}})}}if(!l.data("bindEvent_scrollbar_click")){n.bind("click",function(I){var x=(I.pageY-n.offset().top)*l.data("scrollAmount"),y=c(I.target);if(l.data("horizontalScroll")){x=(I.pageX-n.offset().left)*l.data("scrollAmount")}if(y.hasClass("mCSB_draggerContainer")||y.hasClass("mCSB_draggerRail")){l.mCustomScrollbar("scrollTo",x,{trigger:"internal",scrollEasing:"draggerRailEase"})}});l.data({bindEvent_scrollbar_click:true})}if(l.data("mouseWheel")){if(!l.data("bindEvent_mousewheel")){i.bind("mousewheel",function(K,M){var J,I=l.data("mouseWheelPixels"),x=Math.abs(q.position().top),L=k.position().top,y=n.height()-k.height();if(l.data("normalizeMouseWheelDelta")){if(M<0){M=-1}else{M=1}}if(I==="auto"){I=100+Math.round(l.data("scrollAmount")/2)}if(l.data("horizontalScroll")){L=k.position().left;y=n.width()-k.width();x=Math.abs(q.position().left)}if((M>0&&L!==0)||(M<0&&L!==y)){K.preventDefault();K.stopImmediatePropagation()}J=x-(M*I);l.mCustomScrollbar("scrollTo",J,{trigger:"internal"})});l.data({bindEvent_mousewheel:true})}}if(l.data("scrollButtons_enable")){if(l.data("scrollButtons_scrollType")==="pixels"){if(l.data("horizontalScroll")){w.add(D).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",j,h);l.data({bindEvent_buttonsContinuous_x:false});if(!l.data("bindEvent_buttonsPixels_x")){w.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().left)+l.data("scrollButtons_scrollAmount"))});D.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().left)-l.data("scrollButtons_scrollAmount"))});l.data({bindEvent_buttonsPixels_x:true})}}else{f.add(A).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",j,h);l.data({bindEvent_buttonsContinuous_y:false});if(!l.data("bindEvent_buttonsPixels_y")){f.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().top)+l.data("scrollButtons_scrollAmount"))});A.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().top)-l.data("scrollButtons_scrollAmount"))});l.data({bindEvent_buttonsPixels_y:true})}}function r(x){if(!k.data("preventAction")){k.data("preventAction",true);l.mCustomScrollbar("scrollTo",x,{trigger:"internal"})}}}else{if(l.data("horizontalScroll")){w.add(D).unbind("click");l.data({bindEvent_buttonsPixels_x:false});if(!l.data("bindEvent_buttonsContinuous_x")){w.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollRight:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().left)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var j=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollRight"))};w.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",j
682);D.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollLeft:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().left)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var h=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollLeft"))};D.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",h);l.data({bindEvent_buttonsContinuous_x:true})}}else{f.add(A).unbind("click");l.data({bindEvent_buttonsPixels_y:false});if(!l.data("bindEvent_buttonsContinuous_y")){f.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollDown:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().top)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var u=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollDown"))};f.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",u);A.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollUp:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().top)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var g=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollUp"))};A.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",g);l.data({bindEvent_buttonsContinuous_y:true})}}function B(){var x=l.data("scrollButtons_scrollSpeed");if(l.data("scrollButtons_scrollSpeed")==="auto"){x=Math.round((l.data("scrollInertia")+100)/40)}return x}}}if(l.data("autoScrollOnFocus")){if(!l.data("bindEvent_focusin")){i.bind("focusin",function(){i.scrollTop(0).scrollLeft(0);var x=c(document.activeElement);if(x.is("input,textarea,select,button,a[tabindex],area,object")){var J=q.position().top,y=x.position().top,I=i.height()-x.outerHeight();if(l.data("horizontalScroll")){J=q.position().left;y=x.position().left;I=i.width()-x.outerWidth()}if(J+y<0||J+y>I){l.mCustomScrollbar("scrollTo",y,{trigger:"internal"})}}});l.data({bindEvent_focusin:true})}}if(l.data("autoHideScrollbar")&&!l.data("alwaysShowScrollbar")){if(!l.data("bindEvent_autoHideScrollbar")){i.bind("mouseenter",function(x){i.addClass("mCS-mouse-over");d.showScrollbar.call(i.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(x){i.removeClass("mCS-mouse-over");if(x.type==="mouseleave"){d.hideScrollbar.call(i.children(".mCSB_scrollTools"))}});l.data({bindEvent_autoHideScrollbar:true})}}},scrollTo:function(e,f){var i=c(this),o={moveDragger:false,trigger:"external",callbacks:true,scrollInertia:i.data("scrollInertia"),scrollEasing:i.data("scrollEasing")},f=c.extend(o,f),p,g=i.children(".mCustomScrollBox"),k=g.children(".mCSB_container"),r=g.children(".mCSB_scrollTools"),j=r.children(".mCSB_draggerContainer"),h=j.children(".mCSB_dragger"),t=draggerSpeed=f.scrollInertia,q,s,m,l;if(!k.hasClass("mCS_no_scrollbar")){i.data({mCS_trigger:f.trigger});if(i.data("mCS_Init")){f.callbacks=false}if(e||e===0){if(typeof(e)==="number"){if(f.moveDragger){p=e;if(i.data("horizontalScroll")){e=h.position().left*i.data("scrollAmount")}else{e=h.position().top*i.data("scrollAmount")}draggerSpeed=0}else{p=e/i.data("scrollAmount")}}else{if(typeof(e)==="string"){var v;if(e==="top"){v=0}else{if(e==="bottom"&&!i.data("horizontalScroll")){v=k.outerHeight()-g.height()}else{if(e==="left"){v=0}else{if(e==="right"&&i.data("horizontalScroll")){v=k.outerWidth()-g.width()}else{if(e==="first"){v=i.find(".mCSB_container").find(":first")}else{if(e==="last"){v=i.find(".mCSB_container").find(":last")}else{v=i.find(e)}}}}}}if(v.length===1){if(i.data("horizontalScroll")){e=v.position().left}else{e=v.position().top}p=e/i.data("scrollAmount")}else{p=e=v}}}if(i.data("horizontalScroll")){if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.width()-k.outerWidth()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollLeft"));if(!s){q=true}}else{if(p>=j.width()-h.width()){p=j.width()-h.width();e=g.width()-k.outerWidth();clearInterval(i.data("mCSB_buttonScrollRight"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"left",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"left",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");
682if(q||(s&&k.position().left>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().left<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}else{if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.height()-k.outerHeight()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollUp"));if(!s){q=true}}else{if(p>=j.height()-h.height()){p=j.height()-h.height();e=g.height()-k.outerHeight();clearInterval(i.data("mCSB_buttonScrollDown"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"top",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"top",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().top>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().top<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}if(i.data("mCS_Init")){i.data({mCS_Init:false})}}}function u(w){if(i.data("mCustomScrollbarIndex")){this.mcs={top:k.position().top,left:k.position().left,draggerTop:h.position().top,draggerLeft:h.position().left,topPct:Math.round((100*Math.abs(k.position().top))/Math.abs(k.outerHeight()-g.height())),leftPct:Math.round((100*Math.abs(k.position().left))/Math.abs(k.outerWidth()-g.width()))};switch(w){case"onScrollStart":i.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call(i,this.mcs);break;case"whileScrolling":i.data("whileScrolling_Callback").call(i,this.mcs);break;case"onScroll":i.data("onScroll_Callback").call(i,this.mcs);break;case"onTotalScrollBack":i.data("onTotalScrollBack_Callback").call(i,this.mcs);break;case"onTotalScroll":i.data("onTotalScroll_Callback").call(i,this.mcs);break}}}},stop:function(){var g=c(this),e=g.children().children(".mCSB_container"),f=g.children().children().children().children(".mCSB_dragger");d.mTweenAxisStop.call(this,e[0]);d.mTweenAxisStop.call(this,f[0])},disable:function(e){var j=c(this),f=j.children(".mCustomScrollBox"),h=f.children(".mCSB_container"),g=f.children(".mCSB_scrollTools"),i=g.children().children(".mCSB_dragger");f.unbind("mousewheel focusin mouseenter mouseleave touchend");h.unbind("touchstart touchmove");
682if(e){if(j.data("horizontalScroll")){i.add(h).css("left",0)}else{i.add(h).css("top",0)}}g.css("display","none");h.addClass("mCS_no_scrollbar");j.data({bindEvent_mousewheel:false,bindEvent_focusin:false,bindEvent_content_touch:false,bindEvent_autoHideScrollbar:false}).addClass("mCS_disabled")},destroy:function(){var e=c(this);e.removeClass("mCustomScrollbar _mCS_"+e.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();c(document).unbind("mousemove."+e.data("mCustomScrollbarIndex")+" mouseup."+e.data("mCustomScrollbarIndex")+" MSPointerMove."+e.data("mCustomScrollbarIndex")+" MSPointerUp."+e.data("mCustomScrollbarIndex"));c(window).unbind("resize."+e.data("mCustomScrollbarIndex"))}},d={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(g,i,h,f,o,y){var y=y||{},v=y.onStart||function(){},p=y.onUpdate||function(){},w=y.onComplete||function(){};var n=t(),l,j=0,r=g.offsetTop,s=g.style;if(i==="left"){r=g.offsetLeft}var m=h-r;q();e();function t(){if(window.performance&&window.performance.now){return window.performance.now()}else{if(window.performance&&window.performance.webkitNow){return window.performance.webkitNow()}else{if(Date.now){return Date.now()}else{return new Date().getTime()}}}}function x(){if(!j){v.call()}j=t()-n;u();if(j>=g._time){g._time=(j>g._time)?j+l-(j-g._time):j+l-1;if(g._time<j+1){g._time=j+1}}if(g._time<f){g._id=_request(x)}else{w.call()}}function u(){if(f>0){g.currVal=k(g._time,r,m,f,o);s[i]=Math.round(g.currVal)+"px"}else{s[i]=h+"px"}p.call()}function e(){l=1000/60;g._time=j+l;_request=(!window.requestAnimationFrame)?function(z){u();return setTimeout(z,0.01)}:window.requestAnimationFrame;g._id=_request(x)}function q(){if(g._id==null){return}if(!window.requestAnimationFrame){clearTimeout(g._id)}else{window.cancelAnimationFrame(g._id)}g._id=null}function k(B,A,F,E,C){switch(C){case"linear":return F*B/E+A;break;case"easeOutQuad":B/=E;return -F*B*(B-2)+A;break;case"easeInOutQuad":B/=E/2;if(B<1){return F/2*B*B+A}B--;return -F/2*(B*(B-2)-1)+A;break;case"easeOutCubic":B/=E;B--;return F*(B*B*B+1)+A;break;case"easeOutQuart":B/=E;B--;return -F*(B*B*B*B-1)+A;break;case"easeOutQuint":B/=E;B--;return F*(B*B*B*B*B+1)+A;break;case"easeOutCirc":B/=E;B--;return F*Math.sqrt(1-B*B)+A;break;case"easeOutSine":return F*Math.sin(B/E*(Math.PI/2))+A;break;case"easeOutExpo":return F*(-Math.pow(2,-10*B/E)+1)+A;break;case"mcsEaseOut":var D=(B/=E)*B,z=D*B;return A+F*(0.499999999999997*z*D+-2.5*D*D+5.5*z+-6.5*D+4*B);break;case"draggerRailEase":B/=E/2;if(B<1){return F/2*B*B*B+A}B-=2;return F/2*(B*B*B+2)+A;break}}},mTweenAxisStop:function(e){if(e._id==null){return}if(!window.requestAnimationFrame){clearTimeout(e._id)}else{window.cancelAnimationFrame(e._id)}e._id=null},rafPolyfill:function(){var f=["ms","moz","webkit","o"],e=f.length;while(--e>-1&&!window.requestAnimationFrame){window.requestAnimationFrame=window[f[e]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[f[e]+"CancelAnimationFrame"]||window[f[e]+"CancelRequestAnimationFrame"]}}};d.rafPolyfill.call();c.support.touch=!!("ontouchstart" in window);c.support.pointer=window.navigator.pointerEnabled;c.support.msPointer=window.navigator.msPointerEnabled;var a=("https:"==document.location.protocol)?"https:":"http:";
682c.event.special.mousewheel||document.write('<script src="'+a+'//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js"><\/script>');c.fn.mCustomScrollbar=function(e){if(b[e]){return b[e].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof e==="object"||!e){return b.init.apply(this,arguments)}else{c.error("Method "+e+" does not exist")}}}})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.