PageSourceSearch

https://hackread.com/wp-content/themes/newsblock/assets/js/scripts.js?ver=2.0.0

js hackread.com collected 2026-09-24 08:42:17 UTC 57,703 bytes, 1,946 lines download raw bytes

1/******/ (function(modules) { // webpackBootstrap
2/******/ 	// The module cache
3/******/ 	var installedModules = {};
4/******/
5/******/ 	// The require function
6/******/ 	function __webpack_require__(moduleId) {
7/******/
8/******/ 		// Check if module is in cache
9/******/ 		if(installedModules[moduleId]) {
10/******/ 			return installedModules[moduleId].exports;
11/******/ 		}
12/******/ 		// Create a new module (and put it into the cache)
13/******/ 		var module = installedModules[moduleId] = {
14/******/ 			i: moduleId,
15/******/ 			l: false,
16/******/ 			exports: {}
17/******/ 		};
18/******/
19/******/ 		// Execute the module function
20/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ 		// Flag the module as loaded
23/******/ 		module.l = true;
24/******/
25/******/ 		// Return the exports of the module
26/******/ 		return module.exports;
27/******/ 	}
28/******/
29/******/
30/******/ 	// expose the modules object (__webpack_modules__)
31/******/ 	__webpack_require__.m = modules;
32/******/
33/******/ 	// expose the module cache
34/******/ 	__webpack_require__.c = installedModules;
35/******/
36/******/ 	// define getter function for harmony exports
37/******/ 	__webpack_require__.d = function(exports, name, getter) {
38/******/ 		if(!__webpack_require__.o(exports, name)) {
39/******/ 			Object.defineProperty(exports, name, {
40/******/ 				configurable: false,
41/******/ 				enumerable: true,
42/******/ 				get: getter
43/******/ 			});
44/******/ 		}
45/******/ 	};
46/******/
47/******/ 	// getDefaultExport function for compatibility with non-harmony modules
48/******/ 	__webpack_require__.n = function(module) {
49/******/ 		var getter = module && module.__esModule ?
50/******/ 			function getDefault() { return module['default']; } :
51/******/ 			function getModuleExports() { return module; };
52/******/ 		__webpack_require__.d(getter, 'a', getter);
53/******/ 		return getter;
54/******/ 	};
55/******/
56/******/ 	// Object.prototype.hasOwnProperty.call
57/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58/******/
59/******/ 	// __webpack_public_path__
60/******/ 	__webpack_require__.p = "";
61/******/
62/******/ 	// Load entry module and return exports
63/******/ 	return __webpack_require__(__webpack_require__.s = 1);
64/******/ })
65/************************************************************************/
66/******/ ([
67/* 0 */
68/***/ (function(module, exports, __webpack_require__) {
69
70"use strict";
71
72
73Object.defineProperty(exports, "__esModule", {
74	value: true
75});
76// Create csco object.
77var csco = {
78	addAction: function addAction(x, y, z) {
79		return;
80	}
81};
82
83if ('undefined' !== typeof wp && 'undefined' !== typeof wp.hooks) {
84	csco.addAction = wp.hooks.addAction;
85}
86
87/**
88 * Window size
89 */
90var $ = jQuery;
91var $window = $(window);
92var $doc = $(document);
93var $body = $('body');
94
95var wndW = 0;
96var wndH = 0;
97var docH = 0;
98
99function csGetWndSize() {
100	exports.wndW = wndW = $window.width();
101	exports.wndH = wndH = $window.height();
102	exports.docH = docH = $doc.height();
103}
104
105$window.on('resize load orientationchange', csGetWndSize);
106
107csGetWndSize();
108
109/**
110 * Throttle scroll
111 * thanks: https://jsfiddle.net/mariusc23/s6mLJ/31/
112 */
113var csHideOnScrollList = [];
114
115var csDidScroll = void 0;
116var csLastST = 0;
117
118$window.on('scroll load resize orientationchange', function () {
119	if (csHideOnScrollList.length) {
120		csDidScroll = true;
121	}
122});
123
124function csHasScrolled() {
125	var ST = $window.scrollTop();
126
127	var type = null;
128
129	if (ST > csLastST) {
130		type = 'down';
131	} else if (ST < csLastST) {
132		type = 'up';
133	} else {
134		type = 'none';
135	}
136
137	if (ST === 0) {
138		type = 'start';
139	} else if (ST >= docH - wndH) {
140		type = 'end';
141	}
142
143	csHideOnScrollList.forEach(function (item) {
144		if (typeof item === 'function') {
145			item(type, ST, csLastST, $window);
146		}
147	});
148
149	csLastST = ST;
150}
151
152setInterval(function () {
153	if (csDidScroll) {
154		csDidScroll = false;
155		window.requestAnimationFrame(csHasScrolled);
156	}
157}, 250);
158
159function csThrottleScroll(callback) {
160	csHideOnScrollList.push(callback);
161}
162
163/**
164 * In Viewport checker
165 */
166$.fn.isInViewport = function () {
167	var elementTop = $(this).offset().top;
168	var elementBottom = elementTop + $(this).outerHeight();
169
170	var viewportTop = $(window).scrollTop();
171	var viewportBottom = viewportTop + $(window).height();
172
173	return elementBottom > viewportTop && elementTop < viewportBottom;
174};
175
176/**
177 * Cookies
178 */
179function csGetCookie(name) {
180	var matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"));
181	return matches ? decodeURIComponent(matches[1]) : undefined;
182}
183
184function csSetCookie(name, value) {
185	var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
186
187
188	props = {
189		path: '/'
190	};
191
192	if (props.expires instanceof Date) {
193		props.expires = props.expires.toUTCString();
194	}
195
196	var updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
197
198	for (var optionKey in props) {
199		updatedCookie += "; " + optionKey;
200		var optionValue = props[optionKey];
201		if (optionValue !== true) {
202			updatedCookie += "=" + optionValue;
203		}
204	}
205
206	document.cookie = updatedCookie;
207}
208
209exports.$ = $;
210exports.$window = $window;
211exports.$doc = $doc;
212exports.$body = $body;
213exports.csco = csco;
214exports.wndW = wndW;
215exports.wndH = wndH;
216exports.docH = docH;
217exports.csThrottleScroll = csThrottleScroll;
218exports.csGetCookie = csGetCookie;
219exports.csSetCookie = csSetCookie;
220
221/***/ }),
222/* 1 */
223/***/ (function(module, exports, __webpack_require__) {
224
225__webpack_require__(2);
226__webpack_require__(3);
227__webpack_require__(4);
228__webpack_require__(5);
229__webpack_require__(6);
230__webpack_require__(7);
231__webpack_require__(8);
232__webpack_require__(9);
233__webpack_require__(10);
234__webpack_require__(11);
235__webpack_require__(12);
236__webpack_require__(13);
237__webpack_require__(14);
238__webpack_require__(15);
239module.exports = __webpack_require__(16);
240
241
242/***/ }),
243/* 2 */
244/***/ (function(module, exports, __webpack_require__) {
245
246"use strict";
247
248
249var _utility = __webpack_require__(0);
250
251(function () {
252	(0, _utility.$)(document).on('click', '.cs-entry__comments-show button', function (e) {
253		(0, _utility.$)('.cs-entry__comments-collapse').show();
254		(0, _utility.$)('.cs-entry__comments-show').remove();
255	});
256})(); /** ----------------------------------------------------------------------------
257       * Comments Dropdown */
258
259/***/ }),
260/* 3 */
261/***/ (function(module, exports, __webpack_require__) {
262
263"use strict";
264
265
266var _utility = __webpack_require__(0);
267
268(function () {
269	var ticking = false;
270
271	var update = function update() {
272
273		// Sidebar.
274		// -----------------------------------.
275		(0, _utility.$)('.cs-site-primary').each(function () {
276
277			var content = (0, _utility.$)(this).find('.entry-content');
278			var sidebar = (0, _utility.$)(this).find('.cs-entry__metabar-inner');
279
280			// Vars offset.
281			var offsetTop = 20;
282			var offsetBottom = -20;
283
284			// Search elements.
285			var elements = [];
286
287			elements.push('> .alignfull');
288			elements.push('> .alignwide');
289
290			var layouts = (0, _utility.$)(content).find(elements.join(','));
291
292			if (0 === sidebar.length) {
293				return;
294			}
295			if (0 === layouts.length) {
296				return;
297			}
298
299			var disabled = false;
300
301			// Get sidebar values.
302			var sidebarTop = (0, _utility.$)(sidebar).offset().top;
303			var sidebarHeight = (0, _utility.$)(sidebar).outerHeight(true);
304
305			for (var i = 0; i < (0, _utility.$)(layouts).length; ++i) {
306				if ('none' === (0, _utility.$)(layouts[i]).css('transform')) {
307					continue;
308				}
309
310				// Get layout values.
311				var layoutTop = (0, _utility.$)(layouts[i]).offset().top;
312				var layoutHeight = (0, _utility.$)(layouts[i]).outerHeight(true);
313
314				// Calc points.
315				var pointTop = layoutTop - offsetTop;
316				var pointBottom = layoutTop + layoutHeight + offsetBottom;
317
318				// Detect sidebar location.
319				if (sidebarTop + sidebarHeight >= pointTop && sidebarTop <= pointBottom) {
320					disabled = true;
321				}
322			}
323
324			if (disabled) {
325				(0, _utility.$)(sidebar).css('opacity', '0');
326			} else {
327				(0, _utility.$)(sidebar).css('opacity', '1');
328			}
329		});
330
331		// Ticking.
332		ticking = false;
333	};
334
335	var requestTick = function requestTick() {
336		if (!ticking) {
337			window.requestAnimationFrame(update);
338			ticking = true;
339		}
340	};
341
342	var onProcess = function onProcess() {
343		requestTick();
344	};
345
346	(0, _utility.$)(window).on('scroll', onProcess);
347	(0, _utility.$)(window).on('resize', onProcess);
348	(0, _utility.$)(window).on('image-load', onProcess);
349	(0, _utility.$)(window).on('post-load', onProcess);
350})(); /** ----------------------------------------------------------------------------
351       * Detect Aligment */
352
353/***/ }),
354/* 4 */
355/***/ (function(module, exports, __webpack_require__) {
356
357"use strict";
358
359
360var _utility = __webpack_require__(0);
361
362(function () {
363
364	var $entryType = (0, _utility.$)('.cnvs-block-posts-layout-tile-type-2 .cs-entry__outer, .cnvs-block-posts-layout-tile-type-3 .cs-entry__outer'),
365	    isHovered = false;
366
367	function process(el) {
368		var currentWidth = _utility.$window.width(),
369		    maxWidth = 1020,
370		    $el = null;
371
372		if (el) {
373			$el = (0, _utility.$)(el);
374		} else {
375			$el = $entryType;
376		}
377
378		if (currentWidth < maxWidth) {
379			$entryType.attr('data-scheme', 'inverse');
380		} else {
381			$entryType.removeAttr('data-scheme');
382
383			if (isHovered) {
384				$el.attr('data-scheme', 'inverse');
385			} else {
386				$entryType.removeAttr('data-scheme');
387			}
388		}
389	}
390
391	$entryType.hover(function () {
392		isHovered = true;
393		process(this);
394	}, function () {
395		isHovered = false;
396		process(this);
397	});
398
399	_utility.$window.resize(function () {
400		process();
401	});
402
403	process();
404})(); /** ----------------------------------------------------------------------------
405       * Comments Dropdown */
406
407/***/ }),
408/* 5 */
409/***/ (function(module, exports, __webpack_require__) {
410
411"use strict";
412
413
414var _utility = __webpack_require__(0);
415
416var largeHoverBlock = (0, _utility.$)('.cnvs-block-posts-layout-large-type-8 .cs-layout-large__col, .cnvs-block-posts-layout-large-type-9 .cs-layout-large__col'); /** ----------------------------------------------------------------------------
417                                                                                                                                                                    * Comments Dropdown */
418
419(function () {
420	largeHoverBlock.hover(function () {
421
422		(0, _utility.$)(this).addClass('active').siblings().removeClass('active').closest('.cs-layout-large__wrap').find('.cs-overlay-background').removeClass('active').eq((0, _utility.$)(this).index()).addClass('active');
423	}, function () {
424
425		(0, _utility.$)(this).closest('.cs-layout-large__wrap').find('.cs-overlay-background').removeClass('active').eq((0, _utility.$)(this).index()).addClass('active');
426	});
427})();
428
429/***/ }),
430/* 6 */
431/***/ (function(module, exports, __webpack_require__) {
432
433"use strict";
434
435
436var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /**
437                                                                                                                                                                                                                                                                               * AJAX Load More.
438                                                                                                                                                                                                                                                                               *
439                                                                                                                                                                                                                                                                               * Contains functions for AJAX Load More.
440                                                                                                                                                                                                                                                                               */
441
442var _utility = __webpack_require__(0);
443
444if ('undefined' === typeof window.load_more_query) {
445	window.load_more_query = [];
446}
447
448/**
449 * Get next posts
450 */
451function csco_ajax_get_posts(object) {
452	var container = (0, _utility.$)(object).closest('.cs-posts-area');
453
454	var settings = (0, _utility.$)(object).data('settings');
455	var page = (0, _utility.$)(object).data('page');
456
457	(0, _utility.$)(object).data('loading', true);
458
459	// Set button text to Load More.
460	(0, _utility.$)(object).text(settings.translation.loading);
461
462	var data = {
463		action: 'csco_ajax_load_more',
464		page: page,
465		posts_per_page: settings.posts_per_page,
466		query_data: settings.query_data,
467		attributes: settings.attributes,
468		options: settings.options,
469		_ajax_nonce: settings.nonce
470	};
471
472	if (settings.hasOwnProperty('current_lang') && settings.current_lang) {
473		data.current_lang = settings.current_lang;
474	}
475	if (settings.hasOwnProperty('current_locale') && settings.current_locale) {
476		data.current_locale = settings.current_locale;
477	}
478
479	// Request Url.
480	var csco_pagination_url;
481
482	if ('ajax_restapi' === settings.type) {
483		csco_pagination_url = settings.rest_url;
484	} else {
485		csco_pagination_url = settings.url;
486	}
487
488	// Send Request.
489	_utility.$.post(csco_pagination_url, data, function (res) {
490		if (res.success) {
491
492			// Get the posts.
493			var data = (0, _utility.$)(res.data.content);
494
495			// Check if there're any posts.
496			if (data.length) {
497
498				data.imagesLoaded(function () {
499
500					// Append new posts to list, standard and grid archives.
501					(0, _utility.$)(container).find('.cs-posts-area__main').append(data);
502
503					// WP Post Load trigger.
504					(0, _utility.$)(document.body).trigger('post-load');
505
506					// Reinit Facebook widgets.
507					if ((0, _utility.$)('#fb-root').length && 'object' === (typeof FB === 'undefined' ? 'undefined' : _typeof(FB))) {
508						FB.XFBML.parse();
509					}
510
511					// Set button text to Load More.
512					(0, _utility.$)(object).text(settings.translation.load_more);
513
514					// Increment a page.
515					page = page + 1;
516
517					(0, _utility.$)(object).data('page', page);
518
519					// Set the loading state.
520					(0, _utility.$)(object).data('loading', false);
521				});
522			}
523
524			// Remove Button on Posts End.
525			if (res.data.posts_end || !data.length) {
526
527				// Remove Load More button.
528				(0, _utility.$)(object).remove();
529			}
530		} else {
531			// console.log(res);
532		}
533	}).fail(function (xhr, textStatus, e) {
534		// console.log(xhr.responseText);
535	});
536}
537
538/**
539 * Initialization Load More
540 */
541function csco_load_more_init(infinite) {
542	(0, _utility.$)('.cs-posts-area').each(function () {
543
544		if ((0, _utility.$)(this).data('init')) {
545			return false;
546		}
547
548		var csco_ajax_settings;
549
550		if (typeof csco_ajax_pagination !== 'undefined') {
551			csco_ajax_settings = csco_ajax_pagination;
552		}
553
554		var archive_data = (0, _utility.$)(this).data('posts-area');
555
556		if (archive_data) {
557			csco_ajax_settings = JSON.parse(window.atob(archive_data));
558		}
559
560		if (csco_ajax_settings) {
561
562			if (!infinite && csco_ajax_settings.infinite_load) {
563				return false;
564			}
565
566			// Add load more button.
567			(0, _utility.$)(this).append('<div class="cs-posts-area__pagination"><button class="cs-load-more">' + csco_ajax_settings.translation.load_more + '</button></div>');
568
569			// Set load more settings.
570			(0, _utility.$)(this).find('.cs-load-more').data('settings', csco_ajax_settings);
571			(0, _utility.$)(this).find('.cs-load-more').data('page', 2);
572			(0, _utility.$)(this).find('.cs-load-more').data('loading', false);
573			(0, _utility.$)(this).find('.cs-load-more').data('scrollHandling', {
574				allow: _utility.$.parseJSON(csco_ajax_settings.infinite_load),
575				delay: 400
576			});
577		}
578
579		(0, _utility.$)(this).data('init', true);
580	});
581}
582
583csco_load_more_init(true);
584
585_utility.csco.addAction('canvas.components.serverSideRender.onChange', 'posts-init-loadmore', function (props) {
586	if ('canvas/posts' === props.block) {
587		csco_load_more_init(false);
588	}
589});
590
591// On Scroll Event.
592(0, _utility.$)(window).scroll(function () {
593
594	(0, _utility.$)('.cs-posts-area .cs-load-more').each(function () {
595
596		var loading = (0, _utility.$)(this).data('loading');
597		var scrollHandling = (0, _utility.$)(this).data('scrollHandling');
598
599		if ('undefined' === typeof scrollHandling) {
600			return;
601		}
602
603		if ((0, _utility.$)(this).length && !loading && scrollHandling.allow) {
604
605			scrollHandling.allow = false;
606
607			(0, _utility.$)(this).data('scrollHandling', scrollHandling);
608
609			var object = this;
610
611			setTimeout(function () {
612				var scrollHandling = (0, _utility.$)(object).data('scrollHandling');
613
614				if ('undefined' === typeof scrollHandling) {
615					return;
616				}
617
618				scrollHandling.allow = true;
619
620				(0, _utility.$)(object).data('scrollHandling', scrollHandling);
621			}, scrollHandling.delay);
622
623			var offset = (0, _utility.$)(this).offset().top - (0, _utility.$)(window).scrollTop();
624			if (4000 > offset) {
625				csco_ajax_get_posts(this);
626			}
627		}
628	});
629});
630
631// On Click Event.
632(0, _utility.$)('body').on('click', '.cs-load-more', function () {
633	var loading = (0, _utility.$)(this).data('loading');
634
635	if (!loading) {
636		csco_ajax_get_posts(this);
637	}
638});
639
640/***/ }),
641/* 7 */
642/***/ (function(module, exports, __webpack_require__) {
643
644"use strict";
645
646
647var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /**
648                                                                                                                                                                                                                                                                               * AJAX Auto Load Next Post.
649                                                                                                                                                                                                                                                                               *
650                                                                                                                                                                                                                                                                               * Contains functions for AJAX Auto Load Next Post.
651                                                                                                                                                                                                                                                                               */
652
653var _utility = __webpack_require__(0);
654
655/**
656 * Check if Load Nextpost is defined by the wp_localize_script
657 */
658if (typeof csco_ajax_nextpost !== 'undefined') {
659
660	var objNextparent = (0, _utility.$)('.cs-site-primary > .cs-site-content'),
661	    objNextsect = '.cs-nextpost-section',
662	    objNextpost = null,
663	    currentNTitle = document.title,
664	    currentNLink = window.location.href,
665	    loadingNextpost = false,
666	    scrollNextpost = {
667		allow: true,
668		reallow: function reallow() {
669			scrollNextpost.allow = true;
670		},
671		delay: 400 //(milliseconds) adjust to the highest acceptable value
672	};
673
674	// Init.
675	if (csco_ajax_nextpost.next_post) {
676		(0, _utility.$)(objNextparent).after('<div class="cs-nextpost-inner"></div>');
677
678		objNextpost = (0, _utility.$)('.cs-nextpost-inner');
679	}
680}
681
682/**
683 * Get next post
684 */
685function csco_ajax_get_nextpost() {
686	loadingNextpost = true;
687
688	// Set class loading.
689	var data = {
690		action: 'csco_ajax_load_nextpost',
691		not_in: csco_ajax_nextpost.not_in,
692		current_user: csco_ajax_nextpost.current_user,
693		nonce: csco_ajax_nextpost.nonce,
694		next_post: csco_ajax_nextpost.next_post
695	};
696
697	if (csco_ajax_nextpost.hasOwnProperty('current_lang') && csco_ajax_nextpost.current_lang) {
698		data.current_lang = csco_ajax_nextpost.current_lang;
699	}
700	if (csco_ajax_nextpost.hasOwnProperty('current_locale') && csco_ajax_nextpost.current_locale) {
701		data.current_locale = csco_ajax_nextpost.current_locale;
702	}
703
704	// Request Url.
705	var csco_ajax_nextpost_url;
706	if ('ajax_restapi' === csco_ajax_nextpost.type) {
707		csco_ajax_nextpost_url = csco_ajax_nextpost.rest_url;
708	} else {
709		csco_ajax_nextpost_url = csco_ajax_nextpost.url;
710	}
711
712	// Send Request.
713	_utility.$.post(csco_ajax_nextpost_url, data, function (res) {
714
715		csco_ajax_nextpost.next_post = false;
716
717		if (res.success) {
718
719			// Get the posts.
720			var data = (0, _utility.$)(res.data.content);
721
722			// Check if there're any posts.
723			if (data.length) {
724				// Set the loading state.
725				loadingNextpost = false;
726
727				// Set not_in.
728				csco_ajax_nextpost.not_in = res.data.not_in;
729
730				// Set next data.
731				csco_ajax_nextpost.next_post = res.data.next_post;
732
733				// Remove loader.
734				(0, _utility.$)(objNextpost).siblings('.cs-nextpost-loading').remove();
735
736				// Append new post.
737				(0, _utility.$)(objNextpost).append(data);
738
739				// Reinit facebook.
740				if ((0, _utility.$)('#fb-root').length && 'object' === (typeof FB === 'undefined' ? 'undefined' : _typeof(FB))) {
741					FB.XFBML.parse();
742				}
743
744				(0, _utility.$)(document.body).trigger('post-load');
745			}
746		} else {
747			// console.log(res);
748		}
749	}).fail(function (xhr, textStatus, e) {
750		// console.log(xhr.responseText);
751	});
752}
753
754/**
755 * Check if Load Nextpost is defined by the wp_localize_script
756 */
757if (typeof csco_ajax_nextpost !== 'undefined') {
758
759	// On Scroll Event.
760	(0, _utility.$)(window).scroll(function () {
761		var scrollTop = (0, _utility.$)(window).scrollTop();
762
763		// Init nextpost.
764		if (csco_ajax_nextpost.next_post) {
765
766			if (objNextpost.length && !loadingNextpost && scrollNextpost.allow) {
767				scrollNextpost.allow = false;
768				setTimeout(scrollNextpost.reallow, scrollNextpost.delay);
769				// Calc current offset.
770				var offset = objNextpost.offset().top + objNextpost.innerHeight() - scrollTop;
771				// Load nextpost.
772				if (4000 > offset) {
773					(0, _utility.$)(objNextpost).after('<div class="cs-nextpost-loading"></div>');
774
775					csco_ajax_get_nextpost();
776				}
777			}
778		}
779
780		// Reset browser data link.
781		var objFirst = (0, _utility.$)(objNextsect).first();
782
783		if (objFirst.length) {
784			var firstTop = (0, _utility.$)(objFirst).offset().top;
785			// If there has been a change.
786			if (scrollTop < firstTop && window.location.href !== currentNLink) {
787				document.title = currentNTitle;
788				window.history.pushState(null, currentNTitle, currentNLink);
789			}
790		}
791
792		// Set browser data link.
793		(0, _utility.$)(objNextsect).each(function (index, elem) {
794
795			var elemTop = (0, _utility.$)(elem).offset().top;
796			var elemHeight = (0, _utility.$)(elem).innerHeight();
797
798			if (scrollTop > elemTop && scrollTop < elemTop + elemHeight) {
799				// If there has been a change.
800				if (window.location.href !== (0, _utility.$)(elem).data('url')) {
801					// New title.
802					document.title = (0, _utility.$)(elem).data('title');
803					// New link.
804					window.history.pushState(null, (0, _utility.$)(elem).data('title'), (0, _utility.$)(elem).data('url'));
805					// Google Analytics.
806					if (typeof gtag === 'function' && _typeof(window.gaData) === 'object') {
807
808						var trackingId = Object.keys(window.gaData)[0];
809						if (trackingId) {
810							gtag('config', trackingId, {
811								'page_title': (0, _utility.$)(elem).data('title'),
812								'page_location': (0, _utility.$)(elem).data('url')
813							});
814
815							gtag('event', 'page_view', { 'send_to': trackingId });
816						}
817					}
818				}
819			}
820		});
821	});
822}
823
824/***/ }),
825/* 8 */
826/***/ (function(module, exports, __webpack_require__) {
827
828"use strict";
829
830
831var _utility = __webpack_require__(0);
832
833(function () {
834	/*
835  * Load Mega Menu Posts
836  */
837	function cscoLoadMenuPosts(menuItem) {
838		var dataTerm = menuItem.children('a').data('term'),
839		    dataPosts = menuItem.children('a').data('posts'),
840		    dataNumberposts = menuItem.children('a').data('numberposts'),
841		    menuContainer,
842		    postsContainer;
843
844		// Containers.
845		if (menuItem.hasClass('cs-mega-menu-term')) {
846			menuContainer = menuItem;
847			postsContainer = menuContainer.find('.cs-mm__posts');
848		}
849
850		if (menuItem.hasClass('cs-mega-menu-posts')) {
851			menuContainer = menuItem;
852			postsContainer = menuContainer.find('.cs-mm__posts');
853		}
854
855		if (menuItem.hasClass('cs-mega-menu-child-term')) {
856			menuContainer = menuItem.closest('.sub-menu');
857			postsContainer = menuContainer.find('.cs-mm__posts[data-term="' + dataTerm + '"]');
858		}
859
860		// Check Menu Container.
861		if (!menuContainer || typeof menuContainer === 'undefined') {
862			return false;
863		}
864
865		// Check Container.
866		if (!postsContainer || typeof postsContainer === 'undefined') {
867			return false;
868		}
869
870		// Set Active.
871		menuContainer.find('.menu-item, .cs-mm__posts').removeClass('cs-active-item');
872
873		menuItem.addClass('cs-active-item');
874
875		if (postsContainer) {
876			postsContainer.addClass('cs-active-item');
877		}
878
879		// Check Loading.
880		if (menuItem.hasClass('cs-mm-loading') || menuItem.hasClass('loaded')) {
881			return false;
882		}
883
884		// Create Data.
885		var data = {
886			'term': dataTerm,
887			'posts': dataPosts,
888			'per_page': dataNumberposts
889		};
890
891		if (csco_mega_menu.hasOwnProperty('current_lang') && csco_mega_menu.current_lang) {
892			data.current_lang = csco_mega_menu.current_lang;
893		}
894		if (csco_mega_menu.hasOwnProperty('current_locale') && csco_mega_menu.current_locale) {
895			data.current_locale = csco_mega_menu.current_locale;
896		}
897
898		if ('undefined' === typeof csco_mega_menu) {
899			return;
900		}
901
902		// Get Results.
903		_utility.$.ajax({
904			url: csco_mega_menu.rest_url,
905			type: 'GET',
906			data: data,
907			global: false,
908			async: true,
909			beforeSend: function beforeSend() {
910				menuItem.addClass('cs-mm-loading');
911				postsContainer.addClass('cs-mm-loading');
912			},
913			success: function success(res) {
914				if (res.status && 'success' === res.status) {
915
916					// Set the loaded state.
917					menuItem.addClass('loaded');
918					postsContainer.addClass('loaded');
919
920					// Check if there're any posts.
921					if (res.content && res.content.length) {
922
923						(0, _utility.$)(res.content).imagesLoaded(function () {
924
925							// Append Data.
926							postsContainer.html(res.content);
927						});
928					}
929				}
930			},
931			complete: function complete() {
932				// Set the loading state.
933				menuItem.removeClass('cs-mm-loading');
934				postsContainer.removeClass('cs-mm-loading');
935			}
936		});
937	}
938
939	/*
940  * Get First Tab
941  */
942	function cscoGetFirstTab(container) {
943
944		var firstTab = false;
945
946		container.find('.cs-mega-menu-child').each(function (index, el) {
947			if ((0, _utility.$)(el).hasClass('cs-mega-menu-child')) {
948				firstTab = (0, _utility.$)(el);
949				return false;
950			}
951		});
952
953		return firstTab;
954	}
955
956	/*
957  * Menu on document ready
958  */
959	(0, _utility.$)(document).ready(function () {
960
961		/*
962   * Get Menu Posts on Hover
963   */
964		(0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-posts').on('mouseenter', function () {
965			cscoLoadMenuPosts((0, _utility.$)(this));
966		});
967		(0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-term').on('mouseenter', function () {
968			cscoLoadMenuPosts((0, _utility.$)(this));
969		});
970		(0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-child').on('mouseenter', function () {
971			cscoLoadMenuPosts((0, _utility.$)(this));
972		});
973
974		/*
975   * Load First Tab on Mega Menu Hover
976   */
977		(0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-terms').on('mouseenter', function () {
978			var tab = cscoGetFirstTab((0, _utility.$)(this));
979
980			if (tab) {
981				cscoLoadMenuPosts(tab);
982			}
983		});
984	});
985
986	/*
987  * Load First Tab on Navbar Ready.
988  */
989	(0, _utility.$)(document, '.cs-header__nav').ready(function () {
990		var tab = false;
991
992		// Autoload First Tab.
993		(0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-terms').each(function (index, el) {
994			tab = cscoGetFirstTab((0, _utility.$)(this));
995
996			if (tab) {
997				cscoLoadMenuPosts(tab);
998			}
999		});
1000
1001		// Autoload Posts.
1002		(0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-posts').each(function (index, el) {
1003			cscoLoadMenuPosts((0, _utility.$)(this));
1004		});
1005
1006		// Autoload Term.
1007		(0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-term').each(function (index, el) {
1008			cscoLoadMenuPosts((0, _utility.$)(this));
1009		});
1010	});
1011})(); /** ----------------------------------------------------------------------------
1012       * Mega Menu */
1013
1014/***/ }),
1015/* 9 */
1016/***/ (function(module, exports, __webpack_require__) {
1017
1018"use strict";
1019
1020
1021var _utility = __webpack_require__(0);
1022
1023var cscoNavigation = {}; /** ----------------------------------------------------------------------------
1024                          * Navigation */
1025
1026(function () {
1027	var $this;
1028	cscoNavigation = {
1029		/** Initialize */
1030		init: function init(e) {
1031			if ((0, _utility.$)('body').hasClass('wp-admin')) {
1032				return;
1033			}
1034			$this = cscoNavigation;
1035			// Init events.
1036			$this.events(e);
1037		},
1038		/** Events */
1039		events: function events(e) {
1040			// DOM Load
1041			window.addEventListener('load', function (e) {
1042				$this.smartLevels(e);
1043				$this.adaptTablet(e);
1044				$this.stickyScroll(e);
1045			});
1046			// Resize
1047			window.addEventListener('resize', function (e) {
1048				$this.smartLevels(e);
1049				$this.adaptTablet(e);
1050				$this.stickyScroll(e);
1051			});
1052		},
1053		/** Smart multi-Level menu */
1054		smartLevels: function smartLevels(e) {
1055			var windowWidth = _utility.$window.width();
1056			// Reset Calc.
1057			(0, _utility.$)('.cs-header__nav-inner li').removeClass('cs-sm__level');
1058			(0, _utility.$)('.cs-header__nav-inner li').removeClass('cs-sm-position-left cs-sm-position-right');
1059			(0, _utility.$)('.cs-header__nav-inner li .sub-menu').removeClass('cs-mm__position-init');
1060			// Set Settings.
1061			(0, _utility.$)('.cs-header__nav-inner > li.menu-item').not('.cs-mm').each(function (index, parent) {
1062				var position = 'cs-sm-position-right'; //right
1063				var objPrevWidth = 0;
1064				(0, _utility.$)(parent).find('.sub-menu').each(function (index, el) {
1065					// Reset child levels.
1066					(0, _utility.$)(el).parent().next('li').addClass('cs-sm__level');
1067					if ((0, _utility.$)(el).parent().hasClass('cs-sm__level')) {
1068						(0, _utility.$)(el).parent().removeClass('cs-mm-level');
1069						position = 'cs-sm-position-right'; //right
1070						objPrevWidth = 0;
1071					}
1072					// Find out position items.
1073					var offset = (0, _utility.$)(el).offset();
1074					var objOffset = offset.left;
1075					if ('cs-sm-position-right' === position && (0, _utility.$)(el).outerWidth() + objOffset > windowWidth) {
1076						position = 'cs-sm-position-left';
1077					}
1078					if ('cs-sm-position-left' === position && objOffset - ((0, _utility.$)(el).outerWidth() + objPrevWidth) < 0) {
1079						position = 'cs-sm-position-right'; //right
1080					}
1081					objPrevWidth = (0, _utility.$)(el).outerWidth();
1082					(0, _utility.$)(el).addClass('cs-sm-position-init').parent().addClass(position);
1083				});
1084			});
1085		},
1086		/** Adapting nav bar for tablet */
1087		adaptTablet: function adaptTablet(e) {
1088			// Click outside.
1089			(0, _utility.$)(document).on('touchstart', function (e) {
1090				if (!(0, _utility.$)(e.target).closest('.cs-header__nav-inner').length) {
1091					(0, _utility.$)('.cs-header__nav-inner .menu-item-has-children').removeClass('submenu-visible');
1092				} else {
1093					(0, _utility.$)(e.target).parents('.menu-item').siblings().find('.menu-item').removeClass('submenu-visible');
1094					(0, _utility.$)(e.target).parents('.menu-item').siblings().closest('.menu-item').removeClass('submenu-visible');
1095				}
1096			});
1097			(0, _utility.$)('.cs-header__nav-inner .menu-item-has-children').each(function (e) {
1098				// Reset class.
1099				(0, _utility.$)(this).removeClass('submenu-visible');
1100				// Remove expanded.
1101				(0, _utility.$)(this).find('> a > .expanded').remove();
1102				// Add a caret.
1103				if ('ontouchstart' in document.documentElement) {
1104					(0, _utility.$)(this).find('> a').append('<span class="expanded"></span>');
1105				}
1106				// Check touch device.
1107				(0, _utility.$)(this).addClass('ontouchstart' in document.documentElement ? 'touch-device' : '');
1108				(0, _utility.$)('> a .expanded', this).on('touchstart', function (e) {
1109					e.preventDefault();
1110					(0, _utility.$)(this).closest('.menu-item-has-children').toggleClass('submenu-visible');
1111				});
1112				if ('#' === (0, _utility.$)('> a', this).attr('href')) {
1113					(0, _utility.$)('> a', this).on('touchstart', function (e) {
1114						e.preventDefault();
1115						if (!(0, _utility.$)(e.target).hasClass('expanded')) {
1116							(0, _utility.$)(this).closest('.menu-item-has-children').toggleClass('submenu-visible');
1117						}
1118					});
1119				}
1120			});
1121		},
1122		/** Make nav bar sticky */
1123		stickyScroll: function stickyScroll(e) {
1124			// Get css variables
1125			var headerLargeHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-initial-height')),
1126			    headerCompactHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height'));
1127			//Get header elements
1128			var headerStick = (0, _utility.$)('.cs-navbar-sticky-enabled .cs-header'),
1129			    headerBefore = (0, _utility.$)('.cs-header-before'),
1130			    headerStretch = (0, _utility.$)('.cs-header-stretch'),
1131			    headerStretchInaccuracy = headerStretch.length > 0 ? 10 : 0,
1132			    headerStickHeight = (0, _utility.$)('.cs-navbar-sticky-enabled .cs-header-stretch'),
1133			    wpAdminBar = (0, _utility.$)('#wpadminbar'),
1134			    headerSearch = (0, _utility.$)('.cs-search'),
1135			    offCanvas = (0, _utility.$)('.cs-offcanvas');
1136			//Comb out the heights
1137			var headerDelta = headerStickHeight.length > 0 ? headerLargeHeight - headerCompactHeight : 0,
1138			    wpAdminBarHeight = wpAdminBar.length > 0 ? wpAdminBar.outerHeight() : 0,
1139			    smartStart = headerBefore.length > 0 ? headerBefore.offset().top : headerStick.length > 0 ? headerStick.offset().top + wpAdminBarHeight : wpAdminBarHeight;
1140			//Set values to hide
1141			var scrollPoint = 200,
1142			    scrollPrev = 200,
1143			    scrollUpAmount = 0,
1144			    windowWidth = _utility.$window.width();
1145			(0, _utility.$)(window).scroll(function () {
1146				var scrolled = (0, _utility.$)(window).scrollTop(),
1147				    headerStickPosition = headerStick.length > 0 ? headerStick.offset().top : 0;
1148				if (scrolled > smartStart + headerDelta + scrollPoint + headerStretchInaccuracy && scrolled > scrollPrev) {
1149					headerStick.addClass('cs-scroll-active');
1150					headerSearch.slideUp();
1151					(0, _utility.$)(document).trigger('sticky-nav-hide');
1152				} else {
1153					if (scrollUpAmount >= scrollPoint || scrolled === 0) {
1154						headerStick.removeClass('cs-scroll-active');
1155						(0, _utility.$)(document).trigger('sticky-nav-visible');
1156					}
1157				}
1158				if (headerStickHeight.length > 0) {
1159					if (headerStickPosition <= scrolled + wpAdminBarHeight && scrolled > smartStart + headerDelta) {
1160						headerStick.addClass('cs-scroll-sticky');
1161						(0, _utility.$)(document).trigger('stretch-nav-to-small');
1162					} else {
1163						if (scrolled <= smartStart) {
1164							headerStick.removeClass('cs-scroll-sticky');
1165							(0, _utility.$)(document).trigger('stretch-nav-to-big');
1166						}
1167					}
1168				} else {
1169					if (headerStickPosition <= scrolled + wpAdminBarHeight && scrolled + wpAdminBarHeight > smartStart) {
1170						headerStick.addClass('cs-scroll-sticky');
1171						if (headerStretch.length > 0) {
1172							(0, _utility.$)(document).trigger('stretch-nav-to-small');
1173						}
1174					} else {
1175						headerStick.removeClass('cs-scroll-sticky');
1176						if (headerStretch.length > 0) {
1177							(0, _utility.$)(document).trigger('stretch-nav-to-big');
1178						}
1179					}
1180				}
1181				if (scrolled < scrollPrev) {
1182					scrollUpAmount += scrollPrev - scrolled;
1183				} else {
1184					scrollUpAmount = 0;
1185				}
1186				if (wpAdminBar.length > 0 && _utility.wndW <= 600 && scrolled >= wpAdminBarHeight) {
1187					offCanvas.addClass('cs-offcanvas_scrolled');
1188				} else {
1189					offCanvas.removeClass('cs-offcanvas_scrolled');
1190				}
1191				scrollPrev = scrolled;
1192			});
1193		}
1194	};
1195})();
1196// Initialize.
1197cscoNavigation.init();
1198
1199/***/ }),
1200/* 10 */
1201/***/ (function(module, exports, __webpack_require__) {
1202
1203"use strict";
1204
1205
1206var _utility = __webpack_require__(0);
1207
1208(function () {
1209	(0, _utility.$)('.cs-header__offcanvas-toggle, .cs-site-overlay, .cs-offcanvas__toggle').on('click', function (e) {
1210		e.preventDefault();
1211
1212		// Transition.
1213		if (!_utility.$body.hasClass('cs-offcanvas-active')) {
1214			_utility.$body.addClass('cs-offcanvas-transition');
1215		} else {
1216			setTimeout(function () {
1217				_utility.$body.removeClass('cs-offcanvas-transition');
1218			}, 400);
1219		}
1220
1221		// Toogle offcanvas.
1222		_utility.$body.toggleClass('cs-offcanvas-active');
1223	});
1224})(); /** ----------------------------------------------------------------------------
1225       * Offcanvas */
1226
1227/***/ }),
1228/* 11 */
1229/***/ (function(module, exports, __webpack_require__) {
1230
1231"use strict";
1232
1233
1234var _utility = __webpack_require__(0);
1235
1236(function () {
1237	/**
1238  * Add max-width & max-height to <iframe> elements, depending on their width & height props.
1239  */
1240	function initResponsiveEmbeds() {
1241		var proportion, parentWidth;
1242
1243		// Loop iframe elements.
1244		(0, _utility.$)('.entry-content').find('iframe').each(function (index, iframe) {
1245			// Don't handle if the parent automatically resizes itself.
1246			if ((0, _utility.$)(iframe).closest('div').is('[data-video-start], [data-video-end]')) {
1247				return;
1248			}
1249			// Only continue if the iframe has a width & height defined.
1250			if (iframe.width && iframe.height) {
1251				// Calculate the proportion/ratio based on the width & height.
1252				proportion = parseFloat(iframe.width) / parseFloat(iframe.height);
1253				// Get the parent element's width.
1254				parentWidth = parseFloat(window.getComputedStyle(iframe.parentElement, null).width.replace('px', ''));
1255				// Set the max-width & height.
1256				iframe.style.maxWidth = '100%';
1257				iframe.style.maxHeight = Math.round(parentWidth / proportion).toString() + 'px';
1258			}
1259		});
1260	}
1261
1262	// Document ready.
1263	_utility.$doc.ready(function () {
1264		initResponsiveEmbeds();
1265	});
1266
1267	// Post load.
1268	_utility.$body.on('post-load', function () {
1269		initResponsiveEmbeds();
1270	});
1271
1272	// Document resize.
1273	_utility.$window.on('resize', function () {
1274		initResponsiveEmbeds();
1275	});
1276
1277	// Run on initial load.
1278	initResponsiveEmbeds();
1279})(); /** ----------------------------------------------------------------------------
1280       * Responsive Embeds */
1281
1282/***/ }),
1283/* 12 */
1284/***/ (function(module, exports, __webpack_require__) {
1285
1286"use strict";
1287
1288
1289var _utility = __webpack_require__(0);
1290
1291var cscoDarkMode = {}; /** ----------------------------------------------------------------------------
1292                        * Color Scheme Toogle */
1293
1294(function () {
1295	var $this;
1296
1297	cscoDarkMode = {
1298
1299		/** Initialize */
1300		init: function init(e) {
1301			$this = cscoDarkMode;
1302
1303			// Init events.
1304			$this.events(e);
1305		},
1306
1307		/** Events */
1308		events: function events(e) {
1309			if ((0, _utility.$)('body').hasClass('wp-admin')) {
1310				return;
1311			}
1312
1313			// Window Load
1314			window.addEventListener('load', function (e) {
1315				$this.loadMode(e);
1316			});
1317
1318			// Switch
1319			(0, _utility.$)(document).on('click', '.cs-site-scheme-toggle', function (e) {
1320				$this.changeMode(e);
1321			});
1322		},
1323
1324		/** Detect Color Scheme */
1325		detectColorScheme: function detectColorScheme(color) {
1326			var level = 190;
1327
1328			// Set alpha channel.
1329			var alpha = 1;
1330
1331			var rgba = [255, 255, 255];
1332
1333			var color_rgba = false;
1334
1335			// Trim color.
1336			color = color.trim();
1337
1338			// If HEX format.
1339			if ('#' === color[0]) {
1340				// Remove '#' from start.
1341				color = color.replace('#', '').trim();
1342
1343				if (3 === color.length) {
1344					color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2];
1345				}
1346
1347				rgba[0] = parseInt(color.substr(0, 2), 16);
1348				rgba[1] = parseInt(color.substr(2, 2), 16);
1349				rgba[2] = parseInt(color.substr(4, 2), 16);
1350			} else if (color_rgba = color.replace(/\s/g, '').match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i)) {
1351				// Convert RGB or RGBA.
1352				rgba[0] = parseInt(color_rgba[1]);
1353				rgba[1] = parseInt(color_rgba[2]);
1354				rgba[2] = parseInt(color_rgba[3]);
1355
1356				if (color_rgba[4] !== undefined) {
1357					alpha = parseFloat(color_rgba[4]);
1358				}
1359			}
1360
1361			// Apply alpha channel.
1362			rgba.forEach(function myFunction(channel, key, stack) {
1363				stack[key] = String(channel + Math.ceil((255 - channel) * (1 - alpha))).padStart(2, '0');
1364			});
1365
1366			// Set default scheme.
1367			var scheme = 'default';
1368
1369			// Get brightness.
1370			var brightness = (rgba[0] * 299 + rgba[1] * 587 + rgba[2] * 114) / 1000;
1371
1372			// If color gray.
1373			if (rgba[0] === rgba[1] && rgba[1] === rgba[2]) {
1374				if (brightness < level) {
1375					scheme = 'dark';
1376				}
1377			} else {
1378				if (brightness < level) {
1379					scheme = 'inverse';
1380				}
1381			}
1382
1383			return scheme;
1384		},
1385
1386		/** Set Individual Scheme */
1387		setIndividualScheme: function setIndividualScheme() {
1388			var list = {
1389				'body': '--cs-color-site-background',
1390				'.cs-topbar': '--cs-color-topbar-background',
1391				'.cs-header': '--cs-color-header-background',
1392				'.cs-header__nav-inner .sub-menu': '--cs-color-submenu-background',
1393				'.cs-header__multi-column-container': '--cs-color-submenu-background',
1394				'.cs-header__widgets': '--cs-color-submenu-background',
1395				'.cs-offcanvas__header': '--cs-color-header-background',
1396				'.cs-search': '--cs-color-search-background',
1397				'.cs-footer': '--cs-color-footer-background'
1398			};
1399
1400			for (var key in list) {
1401				if ((0, _utility.$)(key).length <= 0) {
1402					continue;
1403				}
1404
1405				/* jshint ignore:start */
1406				(0, _utility.$)(key).each(function (index, element) {
1407					var color = window.getComputedStyle((0, _utility.$)(element)[0]).getPropertyValue(list[key]);
1408
1409					var scheme = $this.detectColorScheme(color);
1410
1411					(0, _utility.$)(element).attr('data-scheme', scheme);
1412				});
1413				/* jshint ignore:end */
1414			}
1415		},
1416
1417		/** Load Mode */
1418		loadMode: function loadMode(e) {
1419
1420			if ('false' === csLocalize.darkMode) {
1421				return;
1422			}
1423
1424			if ('dark' === (0, _utility.csGetCookie)('_color_schema') && 'dark' !== _utility.$body.attr('site-data-scheme')) {
1425
1426				$this.changeScheme('dark', false);
1427
1428				// Detect color scheme on device.
1429			} else if (window.matchMedia && -1 === document.cookie.indexOf('_color_schema=')) {
1430				var systemSchema = 'default';
1431
1432				if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
1433					systemSchema = 'dark';
1434				}
1435
1436				(0, _utility.csSetCookie)('_color_system_schema', systemSchema, { expires: 2592000 });
1437
1438				$this.changeScheme(systemSchema, false);
1439			}
1440		},
1441
1442		/** Change Mode */
1443		changeMode: function changeMode(e) {
1444			if ('dark' === _utility.$body.attr('site-data-scheme')) {
1445				$this.changeScheme('default', true);
1446			} else {
1447				$this.changeScheme('dark', true);
1448			}
1449		},
1450
1451		/** Change Scheme */
1452		changeScheme: function changeScheme(scheme, cookie) {
1453			_utility.$body.addClass('cs-scheme-toggled');
1454
1455			_utility.$body.attr('site-data-scheme', scheme);
1456
1457			$this.setIndividualScheme();
1458
1459			if (cookie) {
1460				(0, _utility.csSetCookie)('_color_schema', scheme, { expires: 2592000 });
1461				(0, _utility.csSetCookie)('_color_system_schema', null, { expires: 2592000 });
1462			}
1463
1464			setTimeout(function () {
1465				_utility.$body.removeClass('cs-scheme-toggled');
1466			}, 100);
1467		}
1468	};
1469})();
1470
1471// Initialize.
1472cscoDarkMode.init();
1473
1474/***/ }),
1475/* 13 */
1476/***/ (function(module, exports, __webpack_require__) {
1477
1478"use strict";
1479
1480
1481var _utility = __webpack_require__(0);
1482
1483(function () {
1484	var focusSearchTimeout = void 0;
1485
1486	(0, _utility.$)('.cs-header__search-toggle').click(function (e) {
1487		if (!(0, _utility.$)('.cs-search').is(":visible")) {
1488			focusSearchTimeout = setTimeout(function () {
1489				(0, _utility.$)('.cs-search .cs-search__input').focus();
1490			}, 300);
1491		} else {
1492			clearTimeout(focusSearchTimeout);
1493		}
1494		(0, _utility.$)('.cs-search').stop().slideToggle();
1495		e.preventDefault();
1496	});
1497
1498	(0, _utility.$)('.cs-search__close').click(function (e) {
1499		(0, _utility.$)('.cs-search').slideUp();
1500		e.preventDefault();
1501		clearTimeout(focusSearchTimeout);
1502	});
1503})(); /** ----------------------------------------------------------------------------
1504       * Search Dropdown */
1505
1506/***/ }),
1507/* 14 */
1508/***/ (function(module, exports, __webpack_require__) {
1509
1510"use strict";
1511
1512
1513var _utility = __webpack_require__(0);
1514
1515(function () {
1516	var stickyElementsSmart = [],
1517	    stickyElements = [];
1518
1519	stickyElementsSmart.push('.cs-navbar-smart-enabled .cs-entry__metabar-inner');
1520	stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled.cs-stick-to-top .cs-sidebar__inner');
1521	stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled.cs-stick-last .cs-sidebar__inner .widget:last-child');
1522
1523	stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled .cnvs-block-section-sidebar-sticky-top .cnvs-block-section-sidebar-inner');
1524	stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled .cnvs-block-section-sidebar-sticky-top-last-block .cnvs-block-section-sidebar-inner > :last-child');
1525
1526	stickyElements.push('.cs-navbar-sticky-enabled .cs-entry__metabar-inner');
1527	stickyElements.push('.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled.cs-stick-to-top .cs-sidebar__inner');
1528	stickyElements.push('.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled.cs-stick-last .cs-sidebar__inner .widget:last-child');
1529
1530	stickyElements.push('.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled .cnvs-block-section-sidebar-sticky-top .cnvs-block-section-sidebar-inner');
1531	stickyElements.push('.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled .cnvs-block-section-sidebar-sticky-top-last-block .cnvs-block-section-sidebar-inner > :last-child');
1532
1533	_utility.$doc.ready(function () {
1534
1535		var headerStick = (0, _utility.$)('.cs-header'),
1536		    wpAdminBar = (0, _utility.$)('#wpadminbar'),
1537		    headerStickHeight = headerStick.outerHeight(),
1538		    wpAdminBarHeight = wpAdminBar.outerHeight(),
1539		    headerStretch = (0, _utility.$)('.cs-header-stretch'),
1540		    headerStretchHeight = headerStretch.outerHeight(),
1541		    allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20,
1542		    windowWidth = (0, _utility.$)(window).width();
1543
1544		// Sticky sidebar for mozilla.
1545		if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
1546			stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-stick-to-bottom .cs-sidebar__inner');
1547			stickyElements.push('.cs-sticky-sidebar-enabled.cs-stick-to-bottom .cs-sidebar__inner');
1548
1549			stickyElementsSmart.push('.cnvs-block-section-sidebar-sticky-bottom .cnvs-block-section-sidebar-inner');
1550			stickyElements.push('.cnvs-block-section-sidebar-sticky-bottom .cnvs-block-section-sidebar-inner');
1551		}
1552
1553		// Join elements.
1554		stickyElementsSmart = stickyElementsSmart.join(',');
1555		stickyElements = stickyElements.join(',');
1556
1557		// Sticky nav visible.
1558		_utility.$doc.on('sticky-nav-visible', function () {
1559
1560			headerStickHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height'));
1561
1562			if (headerStretchHeight) {
1563				allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20;
1564			} else {
1565				allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20;
1566			}
1567
1568			(0, _utility.$)(stickyElementsSmart).css('top', allHeight + 'px');
1569		});
1570
1571		// Sticky nav hide.
1572		_utility.$doc.on('sticky-nav-hide', function () {
1573
1574			headerStickHeight = 0;
1575
1576			allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20;
1577			(0, _utility.$)(stickyElementsSmart).css('top', allHeight + 'px');
1578		});
1579
1580		_utility.$doc.on('stretch-nav-to-small', function () {
1581
1582			headerStretchHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height'));
1583
1584			if (headerStretchHeight) {
1585				allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20;
1586			} else {
1587				allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20;
1588			}
1589
1590			if (headerStretch.hasClass("cs-scroll-sticky") && !headerStretch.hasClass("cs-scroll-active")) {
1591				(0, _utility.$)(stickyElementsSmart).css('top', allHeight + 'px');
1592			}
1593		});
1594
1595		_utility.$doc.on('stretch-nav-to-big', function () {
1596
1597			headerStretchHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-initial-height'));
1598		});
1599
1600		// Add top style
1601		if (_utility.$body.hasClass('cs-navbar-smart-enabled') && windowWidth >= 1020) {
1602
1603			if (headerStretchHeight) {
1604				allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20;
1605			} else {
1606				allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20;
1607			}
1608
1609			(0, _utility.$)(stickyElementsSmart).css('top', allHeight + 'px');
1610		} else if (_utility.$body.hasClass('cs-navbar-sticky-enabled') && windowWidth >= 1020) {
1611
1612			if (headerStretchHeight) {
1613				allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20;
1614			} else {
1615				allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20;
1616			}
1617
1618			(0, _utility.$)(stickyElements).css('top', allHeight + 'px');
1619		}
1620
1621		// Remove top style rafter resize
1622		_utility.$window.resize(function () {
1623			var windowWidthResize = _utility.$window.width();
1624
1625			if (windowWidthResize < 1020) {
1626				(0, _utility.$)(stickyElements).removeAttr('style');
1627				(0, _utility.$)(stickyElementsSmart).removeAttr('style');
1628			}
1629		});
1630	});
1631})(); /** ----------------------------------------------------------------------------
1632       * Sticky Sidebar */
1633
1634/***/ }),
1635/* 15 */
1636/***/ (function(module, exports, __webpack_require__) {
1637
1638"use strict";
1639
1640
1641var _utility = __webpack_require__(0);
1642
1643(function () {
1644	var initAPI = false;
1645	var process = false;
1646	var contex = [];
1647	var players = [];
1648	var attrs = [];
1649
1650	// Create deferred object
1651	var YTdeferred = _utility.$.Deferred();
1652	window.onYouTubePlayerAPIReady = function () {
1653		// Resolve when youtube callback is called
1654		// passing YT as a parameter.
1655		YTdeferred.resolve(window.YT);
1656	};
1657
1658	// Embedding youtube iframe api.
1659	function embedYoutubeAPI() {
1660		var tag = document.createElement('script');
1661		tag.src = 'https://www.youtube.com/iframe_api';
1662
1663		var firstScriptTag = document.getElementsByTagName('script')[0];
1664		firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
1665	}
1666
1667	// Video rescale.
1668	function rescaleVideoBackground() {
1669		(0, _utility.$)('.cs-video-init').each(function () {
1670			var w = (0, _utility.$)(this).parent().width();
1671			var h = (0, _utility.$)(this).parent().height();
1672
1673			var hideControl = 400;
1674
1675			var id = (0, _utility.$)(this).attr('data-uid');
1676
1677			if (w / h > 16 / 9) {
1678				players[id].setSize(w, w / 16 * 9 + hideControl);
1679			} else {
1680				players[id].setSize(h / 9 * 16, h + hideControl);
1681			}
1682		});
1683	}
1684
1685	// Init video background.
1686	function initVideoBackground() {
1687		if ((0, _utility.$)('body').hasClass('wp-admin')) {
1688			return;
1689		}
1690
1691		if (process) {
1692			return;
1693		}
1694
1695		process = true;
1696
1697		// Smart init API.
1698		if (!initAPI) {
1699			var elements = (0, _utility.$)('.cs-video-wrapper[data-video-id]');
1700
1701			if (elements.length) {
1702				embedYoutubeAPI();
1703
1704				initAPI = true;
1705			}
1706		}
1707
1708		if (!initAPI) {
1709			process = false;
1710
1711			return;
1712		}
1713
1714		// Whenever youtube callback was called = deferred resolved
1715		// your custom function will be executed with YT as an argument.
1716		YTdeferred.done(function (YT) {
1717			(0, _utility.$)('.cs-video-inner').each(function () {
1718
1719				// The state.
1720				var isInit = (0, _utility.$)(this).hasClass('cs-video-init');
1721
1722				var id = null;
1723
1724				// Generate unique ID.
1725				if (!isInit) {
1726					id = Math.random().toString(36).substr(2, 9);
1727				} else {
1728					id = (0, _utility.$)(this).attr('data-uid');
1729				}
1730
1731				// Create contex.
1732				contex[id] = this;
1733
1734				// The actived.
1735				var isActive = (0, _utility.$)(contex[id]).hasClass('active');
1736
1737				// The monitor.
1738				var isInView = (0, _utility.$)(contex[id]).isInViewport();
1739
1740				// Initialization.
1741				if (isInView && !isInit) {
1742
1743					// Add init class.
1744					(0, _utility.$)(contex[id]).addClass('cs-video-init');
1745
1746					// Add unique ID.
1747					(0, _utility.$)(contex[id]).attr('data-uid', id);
1748
1749					// Get video attrs.
1750					var videoID = (0, _utility.$)(contex[id]).parent().data('video-id');
1751					var videoStart = (0, _utility.$)(contex[id]).parent().data('video-start');
1752					var videoEnd = (0, _utility.$)(contex[id]).parent().data('video-end');
1753
1754					// Check video id.
1755					if (typeof videoID === 'undefined' || !videoID) {
1756						return;
1757					}
1758
1759					// Video attrs.
1760					attrs[id] = {
1761						'videoId': videoID,
1762						'startSeconds': videoStart,
1763						'endSeconds': videoEnd,
1764						'suggestedQuality': 'hd720'
1765					};
1766
1767					// Creating a player.
1768					players[id] = new YT.Player(contex[id], {
1769						playerVars: {
1770							autoplay: 0,
1771							autohide: 1,
1772							modestbranding: 1,
1773							rel: 0,
1774							showinfo: 0,
1775							controls: 0,
1776							disablekb: 1,
1777							enablejsapi: 0,
1778							iv_load_policy: 3,
1779							playsinline: 1,
1780							loop: 1
1781						},
1782						events: {
1783							'onReady': function onReady() {
1784								players[id].loadVideoById(attrs[id]);
1785								players[id].mute();
1786							},
1787							'onStateChange': function onStateChange(e) {
1788								if (e.data === 1) {
1789									(0, _utility.$)(contex[id]).parents('.cs-overlay, .cs-video-wrap').addClass('cs-video-bg-init');
1790									(0, _utility.$)(contex[id]).addClass('active');
1791								} else if (e.data === 0) {
1792									players[id].seekTo(attrs[id].startSeconds);
1793								}
1794							}
1795						}
1796					});
1797					rescaleVideoBackground();
1798				}
1799
1800				// Pause and play.
1801				var control = (0, _utility.$)(contex[id]).parents('.cs-overlay, .cs-video-wrap').find('.cs-player-state');
1802
1803				if (isActive && isInit && !(0, _utility.$)(control).hasClass('cs-player-upause')) {
1804
1805					if (isInView && (0, _utility.$)(control).hasClass('cs-player-play')) {
1806						// Change icon.
1807						(0, _utility.$)(control).removeClass('cs-player-play').addClass('cs-player-pause');
1808						// Pause video.
1809						players[id].playVideo();
1810					}
1811
1812					if (!isInView && (0, _utility.$)(control).hasClass('cs-player-pause')) {
1813						// Change icon.
1814						(0, _utility.$)(control).removeClass('cs-player-pause').addClass('cs-player-play');
1815						// Pause video.
1816						players[id].pauseVideo();
1817					}
1818				}
1819			});
1820		});
1821
1822		process = false;
1823	}
1824
1825	// State Control.
1826	_utility.$doc.on('click', '.cs-player-state', function () {
1827		var container = (0, _utility.$)(this).parents('.cs-overlay, .cs-video-wrap').find('.cs-video-inner');
1828
1829		var id = (0, _utility.$)(container).attr('data-uid');
1830
1831		(0, _utility.$)(this).toggleClass('cs-player-pause cs-player-play');
1832
1833		if ((0, _utility.$)(this).hasClass('cs-player-pause')) {
1834			(0, _utility.$)(this).removeClass('cs-player-upause');
1835			players[id].playVideo();
1836		} else {
1837			(0, _utility.$)(this).addClass('cs-player-upause');
1838			players[id].pauseVideo();
1839		}
1840	});
1841
1842	// Stop Control.
1843	_utility.$doc.on('click', '.cs-player-stop', function () {
1844		var container = (0, _utility.$)(this).parents('.cs-overlay, .cs-video-wrap').find('.cs-video-inner');
1845
1846		var id = (0, _utility.$)(container).attr('data-uid');
1847
1848		(0, _utility.$)(this).siblings('.cs-player-state').removeClass('cs-player-pause').addClass('cs-player-play');
1849
1850		(0, _utility.$)(this).siblings('.cs-player-state').addClass('cs-player-upause');
1851
1852		players[id].pauseVideo();
1853	});
1854
1855	// Volume Control.
1856	_utility.$doc.on('click', '.cs-player-volume', function () {
1857		var container = (0, _utility.$)(this).parents('.cs-overlay, .cs-video-wrap').find('.cs-video-inner');
1858
1859		var id = (0, _utility.$)(container).attr('data-uid');
1860
1861		(0, _utility.$)(this).toggleClass('cs-player-mute cs-player-unmute');
1862
1863		if ((0, _utility.$)(this).hasClass('cs-player-unmute')) {
1864			players[id].unMute();
1865		} else {
1866			players[id].mute();
1867		}
1868	});
1869
1870	// Document scroll.
1871	_utility.$window.on('load scroll resize scrollstop', function () {
1872		initVideoBackground();
1873	});
1874
1875	// Document ready.
1876	_utility.$doc.ready(function () {
1877		initVideoBackground();
1878	});
1879
1880	// Post load.
1881	_utility.$body.on('post-load', function () {
1882		initVideoBackground();
1883	});
1884
1885	// Document resize.
1886	_utility.$window.on('resize', function () {
1887		rescaleVideoBackground();
1888	});
1889
1890	// Init.
1891	initVideoBackground();
1892})(); /** ----------------------------------------------------------------------------
1893       * Video Background */
1894
1895/***/ }),
1896/* 16 */
1897/***/ (function(module, exports, __webpack_require__) {
1898
1899"use strict";
1900
1901
1902var _utility = __webpack_require__(0);
1903
1904(function () {
1905	_utility.$.fn.responsiveNav = function () {
1906		this.removeClass('menu-item-expanded');
1907		if (this.prev().hasClass('submenu-visible')) {
1908			this.prev().removeClass('submenu-visible').slideUp(350);
1909			this.parent().removeClass('menu-item-expanded');
1910		} else {
1911			this.parent().parent().find('.menu-item .sub-menu').removeClass('submenu-visible').slideUp(350);
1912			this.parent().parent().find('.menu-item-expanded').removeClass('menu-item-expanded');
1913			this.prev().toggleClass('submenu-visible').hide().slideToggle(350);
1914			this.parent().toggleClass('menu-item-expanded');
1915		}
1916	};
1917
1918	//
1919	// Navigation Menu Widget
1920	//
1921	(0, _utility.$)(document).ready(function (e) {
1922		(0, _utility.$)('.widget_nav_menu .menu-item-has-children').each(function (e) {
1923
1924			// Add a caret.
1925			(0, _utility.$)(this).append('<span></span>');
1926
1927			// Fire responsiveNav() when clicking a caret.
1928			(0, _utility.$)('> span', this).on('click', function (e) {
1929				e.preventDefault();
1930				(0, _utility.$)(this).responsiveNav();
1931			});
1932
1933			// Fire responsiveNav() when clicking a parent item with # href attribute.
1934			if ('#' === (0, _utility.$)('> a', this).attr('href')) {
1935				(0, _utility.$)('> a', this).on('click', function (e) {
1936					e.preventDefault();
1937					(0, _utility.$)(this).next().next().responsiveNav();
1938				});
1939			}
1940		});
1941	});
1942})(); /** ----------------------------------------------------------------------------
1943       * Widget Nav Menu */
1944
1945/***/ })
1946/******/ ]);

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.