PageSourceSearch

https://landing-assets.pics.io/js/main.js

js pics.io collected 2026-09-24 08:29:30 UTC 113,647 bytes, 2,383 lines download raw bytes

1jQuery(function () {
2	initPage();
3	initFixedHeader();
4	initPopups();
5	initMobileNav();
6	initMobileLang();
7	initFillForms();
8	initDiff();
9	initTouchNav();
10	initFaq();
11	initLogosSlider();
12	initAwardsSlider();
13	initClientReviewSlider();
14	initWebsitesSlider();
15	initSliderSection();
16	initTestimonialSlider();
17	initHowItWorksSlider();
18	initLinkedinTestimonialSlider();
19	initScrollDown();
20	initClientTestimonials();
21	if (window.grecaptcha) initCheckCaptcha();
22});
23
24// Does not use passive listeners to improve scrolling performance (Lighthouse Report)
25jQuery.event.special.touchstart = {
26	setup: function( _, ns, handle ) {
27		this.addEventListener('touchstart', handle, { passive: !ns.includes('noPreventDefault') });
28	}
29};
30jQuery.event.special.touchmove = {
31	setup: function( _, ns, handle ) {
32		this.addEventListener('touchmove', handle, { passive: !ns.includes('noPreventDefault') });
33	}
34};
35jQuery.event.special.wheel = {
36	setup: function( _, ns, handle ){
37		this.addEventListener('wheel', handle, { passive: true });
38	}
39};
40jQuery.event.special.mousewheel = {
41	setup: function( _, ns, handle ){
42		this.addEventListener('mousewheel', handle, { passive: true });
43	}
44};
45
46function sendSentry(sentryError, data) {
47	if (window.sentrySend) {
48		window.sentrySend(sentryError, data);
49	}
50}
51
52let isCaptchaChecked = false;
53let shouldUseCaptcha = true; // to enable captcha set true
54let shouldValidateCaptcha = true;
55
56(function ($) {
57	$.each(['show', 'hide'], function (i, ev) {
58		let el = $.fn[ev];
59		$.fn[ev] = function () {
60			this.trigger(ev);
61			return el.apply(this, arguments);
62		};
63	});
64})(jQuery);
65
66$(document).ready(function(){
67	let intercomOpener = $('.intercom-opener-fade');
68	intercomOpener.hide();
69	setTimeout(function () {
70		intercomOpener.fadeIn();
71	}, 5000);
72});
73
74function initCheckCaptcha() {
75	if (!shouldUseCaptcha) return;
76
77	let submitButtons = $('.signupForm .btn-primary');
78
79	function disableSubmitButtons() {
80		if (submitButtons) {
81			submitButtons.each(function() {
82				$(this).attr('disabled', true);
83			});
84		}
85	}
86
87	function enableSubmitButtons() {
88		if (submitButtons) {
89			submitButtons.each(function() {
90				$(this).attr('disabled', false);
91			});
92		}
93	}
94
95	disableSubmitButtons();
96
97	function insertCaptchaCode(captchaContainer, score, action) {
98		let Numb1, Numb2;
99		Numb1 = (Math.ceil(Math.random() * 10)-1).toString();
100		Numb2 = (Math.ceil(Math.random() * 10)-1).toString();
101		let question = `${Numb1} + ${Numb2}`;
102		let answer = Number(Numb1) + Number(Numb2);
103		let template = `<div class='popup__input-holder captcha'>
104                            <input type='text' class='popup__input' placeholder="" id='inputCode' />
105                            <label class='popup__label'>Solve the following question: ${question}</label>
106                            <input type='number' name='captcha' hidden value=${answer} />
107                            <div class="error__block">Error</div>
108                               </div>`;
109		captchaContainer.html('');
110		captchaContainer.html(template);
111	}
112
113	grecaptcha.ready(function() {
114		grecaptcha.execute('6LfCzvcUAAAAALTVHKbjKuGhLXuR_WDss2imdO8a', { action: 'marketplace' }).then(function(token) {
115			$.ajax({
116				method: 'POST',
117				url: `${window.location.origin}/users/checkCaptcha`,
118				async: true,
119				cache: false,
120				crossDomain: true,
121				contentType: 'application/json',
122				data: JSON.stringify({
123					token: token
124				}),
125				success: (result) => {
126					let { score, action } = result;
127					isCaptchaChecked = true;
128					enableSubmitButtons();
129
130					if (score <= 0.5) {
131						shouldValidateCaptcha = true;
132						let captchaContainers = $('.captchaContainer');
133						captchaContainers.each(function() {
134							let captchaContainer = $(this);
135
136							if (captchaContainer) {
137								insertCaptchaCode(captchaContainer, score, action);
138							}
139						});
140					} else {
141						shouldValidateCaptcha = false;
142					}
143				},
144				error: (error) => {
145					isCaptchaChecked = true;
146					shouldValidateCaptcha = false;
147					enableSubmitButtons();
148					console.log('error: ', error);
149				},
150				xhrFields: {
151					withCredentials: true
152				}
153			});
154		});
155	});
156}
157
158// DO NOT CHANGE THE CODE BELOW
159function trackingCapterraListener() {
160	let capterra_vkey = '695e0d2361aeaa522560b62c8b643ca4',
161		capterra_vid = '2093457',
162		capterra_prefix = (('https:' == document.location.protocol) ? 'https://ct.capterra.com' : 'http://ct.capterra.com');
163	const currentScript = document.currentScript || document.querySelector('script[nonce]');
164	const nonce = currentScript?.nonce || currentScript?.getAttribute('nonce');
165	let ct = document.createElement('script');
166	ct.type = 'text/javascript';
167	ct.setAttribute("nonce",nonce)
168	ct.async = true;
169	ct.src = capterra_prefix + '/capterra_tracker.js?vid=' + capterra_vid + '&vkey=' + capterra_vkey;
170
171	let s = document.getElementsByTagName('script')[0];
172	s.parentNode.insertBefore(ct, s);
173}
174
175function setCookie(name, value, days) {
176	days = days || 30;
177	let date = new Date(new Date().getTime() + days * 24 * 60 * 60 * 1000);
178	document.cookie = encodeURIComponent(name) + ' = ' + encodeURIComponent(value) + '; path=/; expires=' + date.toUTCString();
179}
180
181function isEmpty(obj) {
182	for(let key in obj) {
183		if(obj.hasOwnProperty(key))
184			return false;
185	}
186	return true;
187}
188
189const setLocalStorage = (key, value) => {
190	try {
191		if (typeof window !== "undefined" && window.localStorage) {
192			window.localStorage.setItem(key, JSON.stringify(value));
193		}
194	} catch (e) {
195		console.warn("localStorage set error:", e);
196	}
197};
198
199const getLocalStorage = (key, fallback = null) => {
200	try {
201		if (typeof window !== "undefined" && window.localStorage) {
202			const data = window.localStorage.getItem(key);
203			return data ? JSON.parse(data) : fallback;
204		}
205	} catch (e) {
206		console.warn("localStorage get error:", e);
207	}
208	return fallback;
209};
210
211const UTM_KEYS = ['utm_campaign', 'utm_source', 'utm_medium', 'utm_term', 'utm_content'];
212
213function initPage() {
214	const url = new URL(window.location.href);
215	const searchParams = url.searchParams;
216
217	setCurrenCopyrightYear();
218
219	this.shop = searchParams.get('shop');
220	this.emailValue = url.searchParams.get('email');
221	this.nameValue = url.searchParams.get('name');
222
223	// Collect utm data from query and set them into localStorage if they exist
224	UTM_KEYS.forEach(key => {
225		const value = searchParams.get(key);
226		if (value) {
227			setLocalStorage(`picsio.${key}`, value);
228		}
229	});
230
231	const referrer = document.referrer || 'direct';
232
233	//params that will be updated in localStorage every new landing
234	setLocalStorage('picsio.landings_signup_source',  `${url.origin}${url.pathname}`);
235	setLocalStorage('picsio.landings_last_referrer',  referrer);
236
237	//Save the first visit, if it hasn't been done yet, they should only be recorded on the first visit
238	if (!getLocalStorage('picsio.landings_first_referrer')) setLocalStorage('picsio.landings_first_referrer', referrer);
239	if (!getLocalStorage('picsio.landings_first_page_seen')) setLocalStorage('picsio.landings_first_page_seen', url.href);
240	if (!getLocalStorage('picsio.landings_first_visit')) setLocalStorage('picsio.landings_first_visit', Date.now());
241
242	const lastPageSeen = getLastPageSeen(url);
243
244	//save last page seen
245	if (lastPageSeen) {
246		setLocalStorage('picsio.landings_last_page_seen', lastPageSeen);
247	}
248}
249
250function getLastPageSeen(url) {
251	const excludedPaths = [
252		'book-a-demo',
253		'smart-file-organizer',
254		'dam-quick-start',
255		'free-digital-asset-management-blueprints',
256		'metadata-playbook',
257		'g-workspace-maximizer',
258		'ai-pricing-in-dam',
259	];
260
261	if (excludedPaths.some(path => url.pathname.includes(path))) {
262		return '';
263	}
264
265	return `${url.origin}${url.pathname}`;
266}
267
268function setCurrenCopyrightYear() {
269	let copyright = $('.copyrightCurrentYear')[0];
270
271	if (copyright) {
272		$('.copyrightCurrentYear').html(new Date().getFullYear());
273	}
274}
275
276function hasCustomCookie(startsWith = 'picsio.') {
277	return document.cookie.split("; ").some(cookie =>
278		decodeURIComponent(cookie.split("=")[0]).startsWith(startsWith)
279	);
280}
281
282function updateCookies(days = 180, cookieStartsName = 'picsio.') {
283	const cookies = document.cookie.split("; ");
284	for (let cookie of cookies) {
285		let [cookieName, cookieValue] = cookie.split("=");
286		if (decodeURIComponent(cookieName).startsWith(cookieStartsName)) {
287			setCookie(cookieName, decodeURIComponent(cookieValue), days);
288		}
289	}
290}
291
292function setCookieData(utmData = {}) {
293	const url = new URL(window.location.href);
294
295	// UTM-data
296	UTM_KEYS.forEach(key => {
297		if (utmData[key]) {
298			setCookie(`picsio.${key}`, utmData[key], 180);
299		}
300	});
301
302	// First values
303	if (!getCookie('picsio.landings_first_referrer')) setCookie('picsio.landings_first_referrer', getLocalStorage('picsio.landings_first_referrer',''), 180);
304	if (!getCookie('picsio.first_page_seen')) setCookie('picsio.first_page_seen', getLocalStorage('picsio.landings_first_page_seen',''), 180);
305	if (!getCookie('picsio.first_visit')) setCookie('picsio.first_visit', getLocalStorage('picsio.landings_first_visit',''), 180);
306
307	// Last values
308	setCookie('picsio.signup_source', `${url.origin}${url.pathname}`, 180);
309	setCookie('picsio.last_referrer', getLocalStorage('picsio.landings_last_referrer',''), 180);
310	setCookie('picsio.last_page_seen', getLocalStorage('picsio.landings_last_page_seen',''), 180);
311
312	updateCookies();
313}
314
315function generateTrackingData() {
316	const url = new URL(window.location.href);
317
318	const utmData = {};
319
320	UTM_KEYS.forEach(key => {
321		const fromStorage = getLocalStorage(`picsio.${key}`);
322		const fromUrl = url.searchParams.get(key);
323		const value = fromStorage || fromUrl;
324		if (value) utmData[key] = value;
325	});
326
327	const trackingData = {
328		last_page_seen: getLocalStorage('picsio.landings_last_page_seen') || `${url.origin}${url.pathname}${url.search}`,
329		signup_source: `${url.origin}${url.pathname}`,
330		last_referrer: getLocalStorage('picsio.landings_last_referrer') || document.referrer || 'direct',
331		first_visit: getLocalStorage('picsio.landings_first_visit',''),
332		first_page_seen: getLocalStorage('picsio.landings_first_page_seen',''),
333		landings_first_referrer: getLocalStorage('picsio.landings_first_referrer',''),
334		...utmData
335	};
336
337	setCookieData(utmData);
338
339	return trackingData;
340}
341
342function hideOnClickOutside(selector) {
343	const outsideClickListener = (event) => {
344		if (!$(event.target).closest(selector).length) {
345			if ($(selector).is(':visible')) {
346				$(selector).hide();
347				removeClickListener();
348			}
349		}
350	};
351
352	const removeClickListener = () => {
353		document.removeEventListener('click', outsideClickListener);
354	};
355
356	document.addEventListener('click', outsideClickListener);
357}
358
359function initClientTestimonials() {
360	let openers = $('.logos .client-logo');
361
362	openers.each(function() {
363		let opener = $(this);
364
365		opener.on('click', function(e) {
366			if (window.location.pathname !== '/customers') {
367				window.open('/customers', '_blank');
368			}
369		});
370	});
371}
372
373function initScrollDown() {
374	let btnScrollDown = document.querySelector('.scroll-down');
375
376	function scrollDown() {
377		let windowCoords = document.documentElement.clientHeight;
378		(function scroll() {
379			if (window.pageYOffset < windowCoords) {
380				window.scrollBy(0, 10);
381				setTimeout(scroll, 0);
382			}
383			if (window.pageYOffset > windowCoords) {
384				window.scrollTo(0, windowCoords);
385			}
386		})();
387	}
388
389	if (btnScrollDown) {
390		btnScrollDown.addEventListener('click', scrollDown);
391	}
392}
393
394// handle dropdowns on mobile devices
395function initTouchNav() {
396	jQuery('.nav').each(function() {
397		new TouchNav({
398			navBlock: this
399		});
400	});
401}
402
403function getCookie(name) {
404	let matches = document.cookie.match(
405		new RegExp(
406			'(?:^|; )' +
407				name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') +
408				'=([^;]*)'
409		)
410	);
411	return matches ? decodeURIComponent(matches[1]) : undefined;
412}
413
414// Fixed header
415function initFixedHeader() {
416	// Hide Header on on scroll down
417	let didScroll;
418	let lastScrollTop = 0;
419	let delta = 5;
420	let header = $('.header');
421	let headerHeight = header.outerHeight();
422
423	$(window).scroll(function(){
424		didScroll = true;
425	});
426
427	setInterval(function() {
428		if (didScroll) {
429			hasScrolled();
430			didScroll = false;
431		}
432	}, 250);
433
434	function hasScrolled() {
435		let scrollTop = $(this).scrollTop();
436
437		// Make sure they scroll more than delta
438		if(Math.abs(lastScrollTop - scrollTop) <= delta)
439			return;
440
441		// If they scrolled down and are past the navbar, add class .nav-up.
442		// This is necessary so you never see what is "behind" the navbar.
443		if (scrollTop > lastScrollTop && scrollTop > headerHeight){
444			// Scroll Down
445			header.removeClass('scroll-down').addClass('scroll-up');
446		} else {
447			// Scroll Up
448			if(scrollTop + $(window).height() < $(document).height()) {
449				header.removeClass('scroll-up').addClass('scroll-down');
450			}
451		}
452
453		lastScrollTop = scrollTop;
454	}
455}
456
457// Popups
458function initPopups() {
459	let attribute;
460
461	let mouseDownTarget;
462	let mouseUpTarget;
463
464	let loginOpener = $('[data-popup-opener="login"]');
465	let signupOpener = $('[data-popup-opener="signup"]');
466	let contactOpener = $('[data-popup-opener="enterprise"]');
467	let cookiesOpener = $('[data-popup-opener="cookies"]');
468	let tryFreeOpener = $('[data-popup-opener="try-free"]');
469	let popupCloser = $('[data-popup-closer="close-popup"]');
470	// let popupAllowAll = $('[data-popup-allow-all="allow-all"]');
471	// let popupAllowSelected = $('[data-popup-allow-selected="allow-selected"]');
472
473	loginOpener.on('click', openPopup);
474	signupOpener.on('click', openPopup);
475	contactOpener.on('click', openPopup);
476	cookiesOpener.on('click', openPopup);
477	tryFreeOpener.on('click', openPopup);
478
479
480	$('.popupholder').on('mousedown', e => {
481		mouseDownTarget = e.target;
482	});
483
484	$('.popupholder').on('mouseup', e => {
485		mouseUpTarget = e.target;
486	});
487
488	$('.popupholder').on('click', closePopup);
489	// popupAllowAll.on('click', allowCookies);
490	// popupAllowSelected.on('click', allowSelectCookies);
491	popupCloser.on('click', closePopup);
492
493	function openPopup(e) {
494		e.preventDefault();
495		let self = $(this);
496		attribute = self.attr('data-popup-opener') || e;
497
498		// hide already opened popups
499		if ($('[data-popup]:visible').length > 0) {
500			$('[data-popup]').fadeOut();
501		}
502
503		$('[data-popup="' + attribute + '"]')
504			.fadeIn()
505			.find('.popup__input-holder')
506			.removeClass('error');
507		if (e.target.dataset.popupOpener === 'login') {
508			$('html').addClass('is-opened')
509				.find('#login-email')
510				.focus();
511		} else if ((e.target.dataset.popupOpener === 'signup')) {
512			$('html').addClass('is-opened')
513				.find('#signup-email')
514				.focus();
515		} else if ((e.target.dataset.popupOpener === 'enterprise')) {
516			$('html').addClass('is-opened')
517				.find('#enterprise-name')
518				.focus();
519		} else if ((e.target.dataset.popupOpener === 'try-free')) {
520			$('html').addClass('is-opened')
521				.find('#request-trial-name')
522				.focus();
523			sessionStorage.setItem('REQUEST_TRIAL', 'true');
524		}
525	}
526
527	function closePopup(e) {
528		e.stopPropagation();
529		if (e.target === e.currentTarget && mouseDownTarget === mouseUpTarget) {
530			$(this)
531				.closest('[data-popup]')
532				.fadeOut();
533			setTimeout(function() {
534				$('html').removeClass('is-opened');
535			}, 500);
536		}
537	}
538
539	// handler login with google and AAD
540	$('[data-login="google"]').on('click', function() {
541		const defaultDomains = ['toriut.com', 'stage.toriut.com', 'pics.io', 'stage.pics.io', 'picsio.local', 'localhost'];
542		const isCustomDomain = !defaultDomains.includes(window.location.hostname);
543		generateTrackingData();
544
545		let _url = '/auth/google';
546		if (isCustomDomain) _url = `${window.Picsio?.baseUrl || 'https://pics.io'}/auth/google`;
547
548		window.open(_url);
549	});
550	$('[data-login="microsoft"]').on('click', function () {
551		const defaultDomains = ['toriut.com', 'stage.toriut.com', 'pics.io', 'stage.pics.io', 'picsio.local', 'localhost'];
552		const isCustomDomain = !defaultDomains.includes(window.location.hostname);
553		generateTrackingData();
554
555		let _url = '/auth/azure';
556		if (isCustomDomain) _url = `${window.Picsio?.baseUrl || 'https://pics.io'}/auth/azure`;
557
558		window.open(_url);
559	});
560
561	//handler reset password
562	$('[data-reset="reset-pass"]').on('click', function() {
563		let email = $(this)
564			.closest('form')
565			.find('input[name="email"]')
566			.val();
567		window.open('/forgot?email=' + encodeURIComponent(email), '_blank');
568	});
569}
570
571// Mobile navigation
572function initMobileNav() {
573	let navOpener = $('[data-nav-opener="nav-opener"]');
574
575	function toggleMenu() {
576		let body = $('body');
577		let activeClass = 'nav-active';
578		const activeLangClass = 'lang-active';
579		if (body.hasClass(activeLangClass)) {
580			body.removeClass(activeLangClass);
581			return
582		}
583
584		if (body.hasClass(activeClass)) {
585			body.removeClass(activeClass);
586		} else {
587			body.addClass(activeClass);
588		}
589	}
590
591	navOpener.on('click', toggleMenu);
592}
593
594// Mobile select language
595function initMobileLang() {
596	let langOpener = $('[data-lang-opener="lang-opener"]');
597
598	function openLanguageMenu() {
599		let body = $('body');
600		body.addClass('lang-active');
601	}
602
603	if (window.innerWidth <= 1023) {
604		langOpener.on('click', openLanguageMenu);
605	}
606}
607
608//calendly
609function launchCalendlyFlow(name, email) {
610	const baseUrl = 'https://calendly.com/d/crq7-k8f-c6r/pics-io-demo-meeting';
611	const currentParams = new URLSearchParams(window.location.search);
612	const calendlyUrl = new URL(baseUrl);
613
614	if (name) calendlyUrl.searchParams.set('name', name);
615	if (email) calendlyUrl.searchParams.set('email', email);
616
617	for (const [key, value] of currentParams.entries()) {
618		if (key.startsWith('utm_')) {
619			calendlyUrl.searchParams.set(key, value);
620		}
621	}
622
623	window.location.href = calendlyUrl.toString();
624}
625
626
627// Fill forms
628function initFillForms() {
629	const defaultDomains = ['toriut.com', 'stage.toriut.com', 'pics.io', 'stage.pics.io', 'picsio.local', 'localhost'];
630	const isCustomDomain = !defaultDomains.includes(window.location.hostname);
631
632	function isValidEmailAddress(emailAddress) {
633		let pattern = new RegExp(
634			/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i
635		);
636		console.log(emailAddress, pattern.test(emailAddress));
637		return pattern.test(emailAddress);
638	}
639
640	function getFormattedFieldValue($input, field) {
641		if (!$input || typeof $input.val !== 'function') {
642			return '';
643		}
644		const rawVal = $input.val();
645		const value = typeof rawVal === 'string' ? rawVal : '';
646
647		switch (field) {
648			case 'email':
649				return value.toLowerCase().trim();
650			case 'name':
651			case 'password':
652			case 'CompanyName':
653			case 'companyName':
654			case 'CompanyPhone':
655			case 'companyPhone':
656			case 'from':
657			case 'to':
658			case 'size':
659			case 'tel':
660				return value.trim();
661			case 'captcha':
662			case 'resetToken':
663			case 'middle-name':
664			case 'department':
665				return value;
666			default:
667				return '';
668		}
669	}
670
671	function getFormValues($form, fields) {
672		const form = {};
673		fields.forEach((field) => {
674			const $input = $form.find('[name="' + field + '"]');
675			form[field] = getFormattedFieldValue($input, field);
676		});
677
678		return form;
679	}
680
681	const defaultFieldValidations = {
682		name: (value) => {
683			if (!value) {
684				if (language === 'de') {
685					return 'Bitte geben Sie Ihren Namen ein';
686				}
687				return 'Please enter your name';
688			}
689			return null;
690		},
691		email: (value) => {
692			if (!value) {
693				if (language === 'de') {
694					return 'Bitte geben Sie Ihre E-Mail ein';
695				}
696				return 'Please enter your email';
697			} else if (!isValidEmailAddress(value)) {
698				if (language === 'de') {
699					return 'Ungültige E-Mail Adresse';
700				}
701				return 'Wrong email format';
702			} else if (value.length > 128) {
703				if (language === 'de') {
704					return 'E-Mail ist zu lang';
705				}
706				return 'Email is too long';
707			}
708			return null;
709		},
710		tel:(value) => {
711			if (!value) return null;
712			const sanitizedValue = value.replace(/[^\d+]/g, '');
713			const phonePattern = /^[+]?[0-9]+$/;
714			const valueCount = sanitizedValue.replace(/\D/g, '').length;
715
716			if (valueCount < 5 && sanitizedValue) {
717				if (language === 'de') {
718					return 'Telefonnummer ist zu kurz';
719				}
720				return 'Phone number is too short';
721			} else if (valueCount > 20 && sanitizedValue) {
722				if (language === 'de') {
723					return 'Telefonnummer ist zu lang';
724				}
725				return 'Phone number is too long';
726			}else if (!phonePattern.test(value)) {
727				if (language === 'de') {
728					return 'Ungültige Telefonnummer';
729				}
730				return 'Invalid phone number';
731			}
732		},
733		password: (value) => {
734			if (!value) {
735				if (language === 'de') {
736					return 'Bitte geben Sie Ihr Passwort ein';
737				}
738				return 'Please enter your password';
739			}
740			return null;
741		},
742		CompanyName: (value) => {
743			if (!value) {
744				if (language === 'de') {
745					return 'Bitte geben Sie Ihren Firmennamen ein';
746				}
747				return 'Please enter your company name';
748			}
749			return null;
750		},
751	};
752
753	function formValidation($form, values, fieldValidations) {
754		const validations = fieldValidations || defaultFieldValidations;
755		let valid = true;
756
757		for (let field in values) {
758			const value = values[field];
759			const validation = validations[field];
760			const message = validation ? validation(value) : '';
761			const inputId = '[name="' + field + '"]';
762
763			if (message) {
764				valid = false;
765
766				$form
767					.find(inputId)
768					.val(value)
769					.closest('div')
770					.addClass('error')
771					.find('.error__block')
772					.text(message);
773			} else {
774				$form
775					.find(inputId)
776					.val(value)
777					.closest('div')
778					.removeClass('error')
779					.find('.error__block')
780					.text('');
781			}
782		}
783
784		return valid;
785	}
786
787	function toggleSubmitDisable($form) {
788		const submitBtn = $form.find('button[type="submit"]');
789
790		submitBtn.prop('disabled', !submitBtn.prop('disabled'));
791	}
792
793	function showFormError($form, msg, err, options) {
794		let defaultErrorText = 'You probably made a mistake';
795		if (language === 'de') {
796			defaultErrorText = 'Sie haben wahrscheinlich einen Fehler gemacht';
797		}
798
799		if (err && err.status === 429) {
800			$form.addClass('formWarning');
801		} else {
802			$form.addClass('formError');
803		}
804
805        if (options?.elementsToHidden) {
806			options.elementsToHidden.each(function() {
807				$(this).addClass('hidden');
808			});
809		}
810
811		$form.find('.hLoginForm').text(msg || defaultErrorText);
812		const errorBox = document.querySelector('.requestDemoForm__errorBox');
813		if (errorBox) {
814			errorBox.querySelector('.hLoginForm').textContent = msg || defaultErrorText;
815			errorBox.style.display = 'flex';
816		}
817	}
818
819	function hideFormError($form, options) {
820		if (options?.elementsToHidden) {
821			options.elementsToHidden.each(function () {
822				$(this).removeClass('hidden');
823			});
824		}
825		$form.removeClass('formError');
826		$form.removeClass('formWarning');
827		$form.find('.hLoginForm').text('');
828
829		const errorBox = document.querySelector('.requestDemoForm__errorBox');
830		if (errorBox) {
831			errorBox.querySelector('.hLoginForm').textContent = '';
832			errorBox.style.display = 'none';
833		}
834	}
835
836	function parseError(err) {
837		let message = 'Something went wrong';
838		if (language === 'de') {
839			message = 'Etwas ist schief gelaufen';
840		}
841
842		if (err.status === 429) {
843			message = 'You\'ve reached the request limit. Please wait a moment before trying again.';
844			if (language === 'de') {
845			message = 'Sie haben das Anfragelimit erreicht. Bitte warten Sie einen Moment, bevor Sie es erneut versuchen.';
846		}
847		}
848
849		if (err.errors && err.errors.length) {
850			message = err.errors[0]._id;
851		} else if (err.error && typeof err.error === 'string') {
852			message = err.error;
853		} else if (typeof err === 'string') {
854			message = err;
855		}
856		return message;
857	}
858
859	function logError(logString, err, data) {
860		const sentryError = new Error(logString);
861
862		sendSentry(sentryError, {
863			error: err,
864			data: data,
865		});
866	}
867
868	function resetForm($form) {
869		$form[0].reset();
870	}
871
872	function closeForm($form) {
873		const closer = $form
874			.closest('[data-popup]')
875			.find('[data-popup-closer]');
876
877		closer.trigger('click');
878	}
879
880	function getURl(path) {
881		return window.location.origin + path;
882	}
883
884	function handleFormSubmit(e, url, fields, onSuccess, onError, options, ajaxOptions) {
885		e.preventDefault();
886
887		const $self = $(this);
888		const dataValues = $self.data();
889		const form = getFormValues($self, fields);
890		const valid = formValidation($self, form);
891		let isChecked = true;
892
893		if (options && options.checkbox) {
894			const agreeLabel = $self.find('.agree-checkbox');
895			const agreeCheckbox = $self.find('input[type="checkbox"]');
896			isChecked = agreeCheckbox.is(':checked');
897
898			const toggleCheckbox = () => {
899				if (!agreeCheckbox.is(':checked')) {
900					agreeLabel.addClass('isError');
901				} else {
902					agreeLabel.removeClass('isError');
903				}
904			};
905			toggleCheckbox();
906
907			agreeCheckbox.on('click', toggleCheckbox);
908		}
909
910		if (!valid || !isChecked) {
911			return;
912		}
913
914		const data = (options && options.parseData) ? options.parseData($self, form, dataValues) : form;
915
916		toggleSubmitDisable($self);
917
918		function handleError(err) {
919			const message = (options && options.parseError) ? options.parseError(err) : parseError(err);
920
921			if (onError) onError(err, data);
922			if (options && options.loggerId) logError(options.loggerId, err, data);
923
924			showFormError($self, message, err, options);
925			toggleSubmitDisable($self);
926		}
927		function handleSuccess(res) {
928			if (res.errors) {
929				return handleError(res);
930			}
931			if (onSuccess) {
932				if (!onSuccess(res, data)) { // if you pass onSuccess, it's must return true to proceed
933					return;
934				}
935			}
936			if (options && options.resetAfterSuccess) resetForm($self);
937			if (options && options.closeAfterSuccess) closeForm($self);
938
939			hideFormError($self, options);
940			toggleSubmitDisable($self);
941		}
942
943		$.ajax({
944			type: 'POST',
945			url: url,
946			contentType: 'application/json',
947			data: JSON.stringify(data),
948			success: handleSuccess,
949			error: handleError,
950			async: true,
951			cache: false,
952			crossDomain: (ajaxOptions && ajaxOptions.crossDomain) || false,
953			xhrFields: {
954				withCredentials: (ajaxOptions && ajaxOptions.withCredentials) || false,
955			},
956		});
957	}
958
959	function getReferer() {
960		try {
961			const match = window.location.search.match(/referer=([^&]*)/);
962			return match ? decodeURIComponent(match[1]) : '';
963		} catch {
964			return '';
965		}
966	}
967
968	function getRedirectToken() {
969		try {
970			const match = window.location.search.match(/redirectToken=([^&]*)/);
971			return match ? match[1] : '';
972		} catch {
973			return '';
974		}
975	}
976
977	//loginform submit
978	$('.loginForm').on('submit', function(e) {
979		e.preventDefault();
980
981		let signinBtn = e.currentTarget.querySelector('button.btn-primary');
982
983		signinBtn.disabled = true;
984
985		let self = $(this)[0];
986		const fields = ['email', 'password'];
987		const form = getFormValues($(this), fields);
988		const valid = formValidation($(this), form);
989
990		let showError = function(msg, form) {
991			signinBtn.disabled = false;
992			form.classList.add('formError');
993			form.querySelector('.hLoginForm').innerText =
994				msg || 'You probably made a mistake';
995		};
996
997		function getReferer () {
998			try {
999				return window.location.search.includes('referer=') ? window.location.search.replace(/(.+%22)(.+)(%22.*)/, '$2') : '';
1000			} catch (error) {
1001				return '';
1002			}
1003		}
1004
1005		function login(email, password, success, failed) {
1006			let _url = window.location.origin + '/users/signin';
1007
1008			if (isCustomDomain) _url = `${window.location.origin}/customDomains/signin`;
1009
1010			let user = {
1011				email: email,
1012				password: password,
1013				refererUrl: getReferer(),
1014				redirectToken: getRedirectToken()
1015			};
1016
1017			let onErrorHandler = function(err) {
1018				console.log('signup error:', JSON.stringify(err, 2, null));
1019				sendSentry(new Error('Login form error: Something went wrong'), { error: (err && err._id) ? err._id : err, data: user.email });
1020				signinBtn.disabled = false;
1021				if (failed) {
1022					let errorMessage = 'Something went wrong';
1023
1024					if (language === 'de') {
1025						errorMessage = 'Etwas ist schief gelaufen';
1026					}
1027					failed({
1028						error: errorMessage
1029					});
1030				}
1031			};
1032
1033			let onLoadHandler = function(e) {
1034				if (e.errors) {
1035					if (failed) {
1036						failed(e.errors);
1037					}
1038					console.info('e.errors:', JSON.stringify(e.errors, 2, null));
1039					if (e.errors._id === 'Too many requests, please try again later') {
1040						sendSentry(new Error('Login form: Too many requests'), { error: e.errors, data: user.email });
1041					} else if (e.errors._id !== 'The login/password is incorrect') {
1042						sendSentry(new Error('Login form error'), { error: e.errors, data: user.email });
1043					}
1044				} else if (e.user) {
1045					if (success) success(e.user, e.redirectTo || '/', e.customDomainToken);
1046				} else {
1047					sendSentry(new Error('Login form error: Something went wrong'), { error: e, data: user.email });
1048					if (failed) {
1049
1050						let errorMessage = 'Something went wrong';
1051
1052					 	if (language === 'de') {
1053					 		errorMessage = 'Etwas ist schief gelaufen';
1054					 	}
1055					 	failed({
1056					 		error: errorMessage
1057					 	});
1058					}
1059				}
1060			};
1061
1062			$.ajax({
1063				method: 'POST',
1064				url: _url,
1065				async: true,
1066				cache: false,
1067				crossDomain: true,
1068				contentType: 'application/json',
1069				data: JSON.stringify(user),
1070				success: onLoadHandler,
1071				error: onErrorHandler,
1072				xhrFields: {
1073					withCredentials: true
1074				}
1075			});
1076		}
1077
1078		if (!valid) {
1079			signinBtn.disabled = false;
1080			return;
1081		}
1082
1083		// NOTE: TODO: We use User model here. No need to link backbone model on login page but session mechanism
1084		// will be implemented later https://github.com/TopTechPhoto/picsio/issues/2177
1085		login(
1086			form.email,
1087			form.password,
1088			function(user, redirectTo, customDomainToken) {
1089				if (user.access) {
1090					let redirectUrl = redirectTo;
1091					const linkedinPixel = new Image(1, 1);
1092					const linkedinPixelId = 47008;
1093					const linkedinEvent = 1058060;
1094					linkedinPixel.src = `https://dc.ads.linkedin.com/collect/?pid=${linkedinPixelId}&conversionId=${linkedinEvent}&fmt=gif`;
1095					document.querySelector('body').appendChild(linkedinPixel);
1096
1097					if (window.twttr) {
1098						twttr.conversion.trackPid('o1zte', { tw_sale_amount: 0, tw_order_quantity: 0 });
1099					}
1100
1101					if (window.qp) {
1102						qp('track', 'GenerateLead');
1103					}
1104
1105					const pathname = window.location.pathname;
1106
1107					if (pathname && pathname === '/search') {
1108						if (redirectUrl !== '/') {
1109							redirectUrl = `${redirectUrl}${pathname}${window.location.search || ''}`;
1110						} else {
1111							redirectUrl = `${pathname}${window.location.search || ''}`;
1112						}
1113					}
1114
1115					if (customDomainToken) {
1116						const divider = window.location.search ? '&': '?';
1117						redirectUrl = `${redirectUrl}${divider}customDomainToken=${customDomainToken}`;
1118					}
1119
1120					window.location = redirectUrl;
1121				} else {
1122					let errorMessage = 'User access to Pics.io is blocked';
1123					if (language === 'de') {
1124						errorMessage = 'Der Benutzerzugang zu Pics.io ist blockiert';
1125					}
1126					showError(errorMessage, 4000);
1127				}
1128			},
1129			function(error) {
1130				console.log('login error: ', (error && error._id) ? error._id : error);
1131				if (error && error._id === 'This user already authenticated') {
1132					let errorMessage = 'This user is already authorized. Redirecting to Pics.io app...';
1133					if (language === 'de') {
1134						errorMessage = 'Dieser Benutzer ist bereits autorisiert. Weiterleitung zur Pics.io-App...';
1135					}
1136					showError(errorMessage, self);
1137					window.location = '/';
1138					return;
1139				}
1140				if (error && error._id === 'Too many requests, please try again later') {
1141					let errorMessage = 'Too many requests, please try again later';
1142					if (language === 'de') {
1143						errorMessage = 'Zu viele Anfragen, bitte versuchen Sie es später noc
1143h einmal';
1144					}
1145					showError(errorMessage, self);
1146					return;
1147				}
1148				if (error && error._id === 'This authorization option is disabled by team policy') {
1149					let errorMessage = 'This authorization option is disabled by team policy';
1150					if (language === 'de') {
1151						errorMessage = 'Diese Autorisierungsoption ist in den Teameinstellungen deaktiviert';
1152					}
1153					showError(errorMessage, self);
1154					return;
1155				}
1156				let loginError = 'Login or password is invalid';
1157				if (language === 'de') {
1158						loginError = 'Login oder Passwort ist ungültig';
1159				}
1160				// The login failed. Check error to see why.
1161				showError(loginError, self);
1162			}
1163		);
1164	});
1165
1166	// Signup form
1167	$('.signupForm').on('submit', function(e) {
1168		e.preventDefault();
1169		if (shouldUseCaptcha && window.grecaptcha && !isCaptchaChecked) return;
1170
1171		let signupBtn = e.currentTarget.querySelector('button.btn-primary');
1172
1173		signupBtn.disabled = true;
1174
1175		let self = $(this)[0],
1176			name = $(this)
1177				.find('[name="email"]')
1178				.val()
1179				.split('@')[0];
1180
1181		const fields = ['email', 'password', 'resetToken'];
1182		if (shouldValidateCaptcha) {
1183			fields.push('captcha');
1184		}
1185
1186		const form = getFormValues($(this), fields);
1187		const fieldValidations = Object.assign(
1188			{},
1189			defaultFieldValidations,
1190			{
1191				password: (value) => {
1192					if (!value) {
1193						if (language === 'de') {
1194							return 'Bitte geben Sie Ihr Passwort ein';
1195						}
1196						return 'Please enter your password';
1197					}
1198					if (value.length < 8) {
1199						if (language === 'de') {
1200							return 'Das Passwort muss mindestens 8 Zeichen lang sein';
1201						}
1202						return 'Password needs to be at least 8 characters long';
1203					}
1204					if (value.length > 128) {
1205						if (language === 'de') {
1206							return 'Das Passwort kann bis zu 128 Zeichen enthalten';
1207						}
1208						return 'Password can contain up to 128 characters';
1209					}
1210					return null;
1211				},
1212				captcha: () => {
1213					if (!shouldValidateCaptcha) return true;
1214
1215					let captchaContainer = $(this);
1216					let answer = captchaContainer.find('[type="number"]').val();
1217					let code = captchaContainer.find('#inputCode').val();
1218					if (answer !== code) {
1219						if (language === 'de') {
1220							return 'Bitte geben Sie den korrekten Captha-Wert ein';
1221						}
1222						return 'Please enter correct captha value';
1223					}
1224
1225					return null;
1226				},
1227			}
1228		);
1229		const valid = formValidation($(this), form, fieldValidations);
1230		form.name = name;
1231
1232		let showError = function (msg) {
1233			let defaultErrorMessage = 'Something went wrong';
1234			if (language === 'de') {
1235				defaultErrorMessage = 'Etwas ist schief gelaufen';
1236			}
1237			signupBtn.disabled = false;
1238			self.classList.add('formError');
1239			self.querySelector('.hLoginForm').innerHTML =
1240				msg || defaultErrorMessage;
1241		};
1242
1243		function signup(form, success, failed, resetToken) {
1244			let _url = `${window.location.origin}/signup`;
1245
1246			if (isCustomDomain) _url = `${window.location.origin}/customDomains/signup`;
1247
1248			let user = {
1249				email: form.email,
1250				displayName: form.displayName || '',
1251				password: form.password,
1252				utmTracking:generateTrackingData()
1253			};
1254			if (resetToken) {
1255				user.resetToken = resetToken;
1256			}
1257
1258			let onErrorHandler = function(e) {
1259				signupBtn.disabled = false;
1260				console.log('signup error: ', e);
1261				if (e.errors && e.errors[0] && e.errors[0]._id.startsWith('User with this email already exists')) {
1262					sendSentry(new Error('Signup form error: User already exists'), { error: e.errors[0], data: user.email });
1263				} else {
1264					sendSentry(new Error('Signup form error'), { error: e, data: user.email });
1265				}
1266				if (e.errors && e.errors[0]._id) {
1267					if (failed) failed(e.errors[0]._id);
1268				} else {
1269					if (failed) {
1270						let messageError = 'Something went wrong';
1271						if (language === 'de') {
1272							messageError = 'Etwas ist schief gelaufen';
1273						}
1274						failed({
1275							error: messageError
1276						});
1277					}
1278				}
1279			};
1280
1281			let onLoadHandler = function(e) {
1282				if (e.errors && e.errors[0]._id) {
1283					console.info('signup errors: ', e.errors);
1284					if (failed) {
1285						if (e.errors[0]._id.startsWith("The email or password can't be used")) {
1286							if (language === 'de') {
1287								failed(`Die E-Mail oder das Passwort können nicht verwendet werden. Möchten Sie Ihr <a href="/forgot?email=${user.email}">Passwort zurücksetzen</a>?`);
1288							} else {
1289								failed(`The email or password can't be used. Do you want to <a href="/forgot?email=${user.email}">reset password</a>?`);
1290							}
1291
1292						} else {
1293							failed(e.errors[0]._id);
1294						}
1295					}
1296					sendSentry(new Error('Signup form error'), { error: e.errors[0], data: user.email });
1297				} else if (e.user) {
1298					dataLayer.push({ 'event': 'registrationComplete', 'userId': e.user._id });
1299					trackingCapterraListener();
1300					if (success) {
1301						success(e.user, e.redirectTo, e.customDomainToken);
1302					}
1303				} else {
1304					sendSentry(new Error('Signup form error: Something went wrong'), { error: e, data: user.email });
1305					if (failed) {
1306						let messageError = 'Something went wrong';
1307						if (language === 'de') {
1308							messageError = 'Etwas ist schief gelaufen';
1309						}
1310						failed({
1311							error: messageError
1312						});
1313					}
1314				}
1315			};
1316
1317			$.ajax({
1318				method: 'POST',
1319				url: _url,
1320				async: true,
1321				cache: false,
1322				crossDomain: true,
1323				contentType: 'application/json',
1324				data: JSON.stringify({
1325					user: user,
1326					refererUrl: getReferer(),
1327					redirectToken: getRedirectToken(),
1328					shop: this.shop,
1329					originalUrl: `${window.location.host}${window.location.pathname}`
1330				}),
1331				success: onLoadHandler,
1332				error: onErrorHandler,
1333				xhrFields: {
1334					withCredentials: true
1335				}
1336			});
1337		}
1338
1339		if (!valid) {
1340			signupBtn.disabled = false;
1341			return;
1342		}
1343
1344		signup(
1345			form,
1346			function(user, redirectUrl = '/', customDomainToken) {
1347				if (user.access) {
1348					const linkedinPixel = new Image(1, 1);
1349					const linkedinPixelId = 47008;
1350					const linkedinEvent = 1058068;
1351					linkedinPixel.src = `https://dc.ads.linkedin.com/collect/?pid=${linkedinPixelId}&conversionId=${linkedinEvent}&fmt=gif`;
1352					document.querySelector('body').appendChild(linkedinPixel);
1353
1354					if (window.twttr) {
1355						twttr.conversion.trackPid('o1zor', { tw_sale_amount: 0, tw_order_quantity: 0 });
1356					}
1357
1358					if (window.qp) {
1359						qp('track', 'CompleteRegistration');
1360					}
1361
1362					if (customDomainToken) {
1363						redirectUrl = `${redirectUrl}?customDomainToken=${customDomainToken}`;
1364					}
1365
1366					window.location = redirectUrl;
1367				} else {
1368					let errorMessage = 'User access to Pics.io is blocked';
1369					if (language === 'de') {
1370						errorMessage = 'Der Benutzerzugang zu Pics.io ist blockiert';
1371					}
1372					showError(errorMessage, 4000);
1373				}
1374			},
1375			function(error) {
1376				// The login failed. Check error to see why.
1377				error = typeof error === 'string' ? error : error.error;
1378				let defaultErrorMessage = 'Something went wrong';
1379				if (language === 'de') {
1380					defaultErrorMessage = 'Etwas ist schief gelaufen';
1381				}
1382				showError(error || defaultErrorMessage, self);
1383			},
1384			form.resetToken
1385		);
1386	});
1387
1388	// Request Enterprise form (Contact form), pricing page
1389	$('.contactForm').on('submit', function(e) {
1390		const url = getURl('/contact/enterprise');
1391		const fields = ['name', 'email', 'CompanyName', 'tel', 'middle-name', 'department'];
1392		const options = {
1393			parseData: ($form, values) => {
1394				const data = {
1395					email: values.email,
1396					displayName: values.name,
1397					companyName: values.CompanyName,
1398					middleName: values?.['middle-name'],
1399					department: values?.department,
1400					...generateTrackingData(),
1401				};
1402				if (values.tel) {
1403					data.phone = values.tel;
1404				}
1405				return data;
1406			},
1407			loggerId: 'Contact form error',
1408			resetAfterSuccess: true,
1409			closeAfterSuccess: true,
1410			parseError: (err) => {
1411				if (err.status === 429) {
1412					return language === 'de' ? 'Vielen Dank für Ihre Anfrage! Wir haben bereits Ihre Informationen, unser Team wird Sie bald kontaktieren!' : 'Thank you for your request! We already have your information, our team will c
1412ontact you soon!';
1413				}
1414				return  language === 'de' ? 'Etwas ist schief gelaufen' : 'Something went wrong';
1415			}
1416		};
1417		function onSuccess() {
1418			let succesMessage = 'Thanks, we\'ll get in touch with you';
1419			if (language === 'de') {
1420				succesMessage = 'Danke, wir setzen uns mit Ihnen in Verbindung.';
1421			}
1422			alert('Thanks, we\'ll get in touch with you');
1423
1424			return true;
1425		}
1426
1427		handleFormSubmit.call(this, e, url, fields, onSuccess, null, options);
1428	});
1429
1430	// 'Get this e-book' form, metadata-playbook page
1431	$('.getTaxonomy').on('submit', function (e) {
1432		const elementsToHidden = $('.taxonomy-form-description');
1433		const url = window.location.origin + '/contact/ebook';
1434		const fields = ['name', 'email'];
1435		const options = {
1436			parseData: ($form, values, dataValues) => {
1437				return {
1438					email: values.email,
1439					displayName: values.name,
1440					data: {...dataValues,...generateTrackingData()},
1441				};
1442			},
1443			checkbox: true,
1444			loggerId: 'Get e-book form error',
1445			resetAfterSuccess: true,
1446			elementsToHidden,
1447			parseError: (err) => {
1448				if (err.status === 429) {
1449					return err?.responseText || 'Too many requests, please try again later';
1450				}
1451				return  err?.statusText || 'Something went wrong';
1452			}
1453		};
1454		function onSuccess(res, data) {
1455			let eventName = 'getEbook';
1456			let thanksText = 'Thanks for requesting our E-book! It will be sent to you shortly.';
1457			if (language === 'de') {
1458				thanksText = 'Vielen Dank, dass Sie unser E-Book angefordert haben! Es wird Ihnen in Kürze zugesandt.';
1459			}
1460
1461			if (data.data.bookName === 'smart-file-organizer') {
1462				eventName = 'getSmartFileOrganizer';
1463			} else if (data.data.bookName === 'dam-quick-start') {
1464				eventName = 'getDamQuickStart';
1465				thanksText = 'Thanks for requesting our Guide! It will be sent to you shortly.';
1466				if (language === 'de') {
1467					thanksText = 'Vielen Dank, dass Sie unseren Leitfaden angefordert haben! Er wird Ihnen in Kürze zugesandt.';
1468				}
1469			} else if (data.data.bookName === 'playbook-for-business') {
1470				eventName = 'playbookForBusiness';
1471				thanksText = 'Thanks for requesting our Metadata Playbook! It will be sent to you shortly.';
1472				if (language === 'de') {
1473					thanksText = 'Vielen Dank, dass Sie unser Metadata Playbook angefordert haben! Es wird Ihnen in Kürze zugesandt.';
1474				}
1475			} else if (data.data.bookName === 'ai-pricing-in-DAM-Ebook') {
1476				thanksText = 'Thanks for requesting our AI Pricing in DAM! It will be sent to you shortly.';
1477				if (language === 'de') {
1478					thanksText = 'Vielen Dank, dass Sie unser AI Pricing in DAM angefordert haben! Es wird Ihnen in Kürze zugesandt.';
1479				}
1480			} else if (data.data.bookName === 'g-suite-maximizer') { // @TODO: remove latter
1481				eventName = 'getGSuiteMaximizer';
1482			} else if (data.data.bookName === 'g-workspace-maximizer') {
1483				eventName = 'getGoogleWorkspaceMaximizer';
1484			} else if (data.data.bookName === 'dam-benefits-report') {
1485				eventName = 'getDamBenefitsReport';
1486				thanksText = 'Thanks for requesting our research.';
1487				if (language === 'de') {
1488					thanksText = 'Vielen Dank, dass Sie unsere Recherche angefordert haben.';
1489				}
1490			} else if (data.data.bookName === 'free-dam-blueprints') {
1491				eventName = 'getDamBlueprints';
1492				thanksText = 'Thanks for requesting our DAM Blueprints! It will be sent to you shortly.';
1493				if (language === 'de') {
1494					thanksText = 'Vielen Dank, dass Sie unsere DAM Blueprints angefordert haben! Sie werden Ihnen in Kürze zugesandt.';
1495				}
1496			}
1497
1498			dataLayer.push({ 'event': eventName });
1499			trackingCapterraListener();
1500			alert(thanksText);
1501
1502			return true;
1503		}
1504
1505		handleFormSubmit.call(this, e, url, fields, onSuccess, null, options);
1506	});
1507
1508	// 'Request demo' form
1509	let requestDemoForm = jQuery('.requestDemo');
1510	let emailDemoInput = requestDemoForm.find('[name="email"]');
1511	let nameDemoInput = requestDemoForm.find('[name="name"]');
1512	let withoutAgreeCheckbox = jQuery('[data-checkbox="false"]').length
1513	console.log(" initFillForms withoutAgreeCheckbox:", withoutAgreeCheckbox)
1514
1515	if (this.emailValue) {
1516		emailDemoInput.val(this.emailValue);
1517	}
1518	if (this.nameValue) {
1519		nameDemoInput.val(this.nameValue);
1520	}
1521
1522	requestDemoForm.on('submit', function(e) {
1523		console.log(" requestDemoForm.on e:", e)
1524		const discount = this.dataset?.discount
1525
1526		let url =  getURl('/contact/demo');
1527		if (window.location.hostname.includes('toriut.com')) {
1528			url += '?source=pim';
1529			if (sessionStorage.getItem('REQUEST_TRIAL')) {
1530				url += '&trial=true';
1531			}
1532		}
1533		const fields = ['name', 'email', 'tel', 'middle-name', 'department'];
1534		const options = {
1535			parseData: ($form, values) => {
1536				const data = {
1537					email: values.email,
1538					displayName: values.name,
1539					discount: discount ?? '',
1540					department: values?.department || '',
1541					middleName: values?.['middle-name'] || '',
1542					...generateTrackingData(),
1543				};
1544				if (values.tel) {
1545					data.phone = values.tel;
1546				}
1547				return data;
1548			},
1549			checkbox: withoutAgreeCheckbox ? false : true,
1550			loggerId: 'Request demo form error',
1551			resetAfterSuccess: true,
1552			parseError: (err) => {
1553				if (err.status === 429) {
1554					return language === 'de' ? 'Vielen Dank für Ihre Anfrage! Wir haben bereits Ihre Informationen, unser Team wird Sie bald kontaktieren!' : 'Thank you for your request! We already have your information, our team will c
1554ontact you soon!';
1555				}
1556				return  language === 'de' ? 'Etwas ist schief gelaufen' : 'Something went wrong';
1557			}
1558		};
1559
1560		function onSuccess(res) {
1561			const form = getFormValues(requestDemoForm, fields);
1562
1563			dataLayer.push({ 'event': 'bookDemo' });
1564			trackingCapterraListener();
1565			let successMessage = 'Thanks for your Demo Call Request! Our expert will contact you shortly.';
1566			if (language === 'de') {
1567				successMessage = 'Vielen Dank für Ihre Anfrage für einen Demo-Anruf! Unser Experte wird Sie in Kürze kontaktieren.';
1568			}
1569			alert(successMessage);
1570
1571			if (res.redirectTo) {
1572				window.location.href = new URL(res.redirectTo, window.location.origin).toString();
1573				sessionStorage.removeItem('REQUEST_TRIAL');
1574
1575				return true;
1576			}
1577
1578			if (window.location.hostname.includes('pics.io') && !res.redirectTo) {
1579				launchCalendlyFlow(form.name, form.email);
1580			}
1581
1582			sessionStorage.removeItem('REQUEST_TRIAL');
1583			return true;
1584		}
1585
1586		handleFormSubmit.call(this, e, url, fields, onSuccess, null, options);
1587	});
1588
1589	// 'Request get a quote' form
1590	let requestQuoteForm = jQuery('.quoteForm');
1591	let emailQuoteInput = requestQuoteForm.find('[name="email"]');
1592	let nameQuoteInput = requestQuoteForm.find('[name="name"]');
1593	if (this.emailValue) {
1594		emailQuoteInput.val(this.emailValue);
1595	}
1596	if (this.nameValue) {
1597		nameQuoteInput.val(this.nameValue);
1598	}
1599	requestQuoteForm.on('submit', function(e) {
1600		const url = getURl('/contact/quote');
1601		const fields = ['name', 'email', 'tel', 'from', 'to', 'size'];
1602		const options = {
1603			parseData: ($form, values) => {
1604				const data = {
1605					email: values.email,
1606					displayName: values.name,
1607					from: values.from,
1608					to: values.to,
1609					size: values.size,
1610					...generateTrackingData(),
1611				};
1612				if (values.tel) {
1613					data.phone = values.tel;
1614				}
1615				return data;
1616			},
1617			loggerId: 'Request get a quote form error',
1618			resetAfterSuccess: true,
1619		};
1620		function onSuccess() {
1621			dataLayer.push({ 'event': 'GetQuoteAssistedMigration' });
1622			trackingCapterraListener();
1623			let successMessage = 'Thanks for your request for a assisted data migration quote! Our expert will contact you shortly.';
1624			if (language === 'de') {
1625				successMessage = 'Vielen Dank für Ihre Anfrage nach einem Angebot für eine unterstützte Datenmigration! Unser Experte wird Sie in Kürze kontaktieren.';
1626			}
1627			alert(successMessage);
1628
1629			return true;
1630		}
1631
1632		handleFormSubmit.call(this, e, url, fields, onSuccess, null, options);
1633	});
1634}
1635
1636
1637
1638
1639// Diff
1640function initDiff() {
1641	let diffContainer = document.querySelector('.diffContainer');
1642
1643	function VersionControlDiff() {
1644		diffContainer.addEventListener('mouseenter', mouseEnter);
1645
1646		let div = document.querySelector('.mainDiffImg');
1647		let left = diffContainer.getBoundingClientRect().left;
1648		let right = diffContainer.getBoundingClientRect().right;
1649
1650		function mouseEnter(e) {
1651			div.style.width =
1652				(e.pageX < left ? left : e.pageX > right ? right : e.pageX) -
1653				left +
1654				'px';
1655			diffContainer.addEventListener('mousemove', mouseMove);
1656			diffContainer.addEventListener('mouseleave', mouseLeave);
1657		}
1658
1659		function mouseMove(e) {
1660			div.style.width =
1661				(e.pageX < left ? left : e.pageX > right ? right : e.pageX) -
1662				left +
1663				'px';
1664		}
1665
1666		function mouseLeave() {
1667			diffContainer.addEventListener('mousemove', mouseMove);
1668			diffContainer.addEventListener('mouseleave', mouseLeave);
1669		}
1670	}
1671
1672	if (diffContainer) VersionControlDiff();
1673}
1674
1675
1676// navigation accesibility module
1677function TouchNav(opt) {
1678	this.options = {
1679		hoverClass: 'hover',
1680		backButton: 'backBtnForMobile',
1681		menuItems: 'li',
1682		menuOpener: 'a',
1683		menuDrop: 'ul',
1684		navBlock: null,
1685		destroy: null
1686	};
1687	for (let p in opt) {
1688		if (opt.hasOwnProperty(p)) {
1689			this.options[p] = opt[p];
1690		}
1691	}
1692	this.init();
1693}
1694
1695
1696TouchNav.isActiveOn = function (elem) {
1697	return elem && elem.touchNavActive;
1698};
1699
1700
1701TouchNav.prototype = {
1702	init: function () {
1703		if (typeof this.options.navBlock === 'string') {
1704			this.menu = document.getElementById(this.options.navBlock);
1705		} else if (typeof this.options.navBlock === 'object') {
1706			this.menu = this.options.navBlock;
1707		}
1708		if (this.menu) {
1709			this.hanldeEvents();
1710		}
1711	},
1712	hanldeEvents: function () {
1713		// attach event handlers
1714		let self = this;
1715		this.menuItems = lib.queryElementsBySelector(this.options.menuItems, this.menu);
1716
1717		let initMenuItem = function (item) {
1718			if (!self.options.destroy) {
1719				if(window.innerWidth >= 1024) {
1720					jQuery(item).bind('mouseenter', function () {
1721						if (!self.touchFlag) {
1722							self.currentItem = item;
1723							self.mouseoverHandler();
1724						}
1725					});
1726					jQuery(item).bind('mouseleave', function () {
1727						if (!self.touchFlag) {
1728							self.currentItem = item;
1729							self.mouseoutHandler();
1730						}
1731					});
1732					item.touchNavActive = true;
1733				} else {
1734					jQuery(item).bind('click', function () {
1735							self.currentItem = item;
1736							self.mouseoverHandler();
1737					});
1738				}
1739
1740
1741			} else {
1742				if(window.innerWidth > 1024) {
1743					jQuery(item).unbind('mouseenter');
1744					jQuery(item).unbind('mouseleave');
1745					item.touchNavActive = false;
1746				} else {
1747					jQuery(item).unbind('click');
1748				}
1749			}
1750		};
1751
1752		let initBackItem = function (item) {
1753			jQuery(item).bind('click', function (e) {
1754				e.stopPropagation()
1755				item.closest('ul').parentNode.classList.remove(self.options.hoverClass);
1756			});
1757		}
1758
1759		// addd handlers for all menu items
1760		for (let i = 0; i < this.menuItems.length; i++) {
1761			if (self.menuItems[i].className.includes(this.options.backButton)) {
1762				initBackItem(self.menuItems[i]);
1763			} else {
1764				initMenuItem(self.menuItems[i]);
1765			}
1766		}
1767	},
1768	mousedownHandler: function (e) {
1769		if (this.touchFlag) {
1770			e.preventDefault();
1771			this.touchFlag = false;
1772			this.preventCurrentClick = false;
1773		}
1774	},
1775	mouseoverHandler: function () {
1776		lib.addClass(this.currentItem, this.options.hoverClass);
1777	},
1778	mouseoutHandler: function () {
1779		lib.removeClass(this.currentItem, this.options.hoverClass);
1780	},
1781	hideActiveDropdown: function () {
1782		for (let i = 0; i < this.menuItems.length; i++) {
1783			if (lib.hasClass(this.menuItems[i], this.options.hoverClass)) {
1784				lib.removeClass(this.menuItems[i], this.options.hoverClass);
1785			}
1786		}
1787		this.activeParent = null;
1788	}
1789};
1790
1791let passiveSupported = false;
1792
1793try {
1794	let options = Object.defineProperty({}, 'passive', {
1795		get: function() {
1796			passiveSupported = true;
1797		}
1798	});
1799
1800	window.addEventListener('test', null, options);
1801} catch(err) {
1802	console.log('passive not supported');
1803}
1804
1805/*
1806 * Utility module
1807 */
1808lib = {
1809	hasClass: function(el,cls) {
1810		return el && el.className ? el.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')) : false;
1811	},
1812	addClass: function(el,cls) {
1813		if (el && !this.hasClass(el,cls)) el.className += ' '+cls;
1814	},
1815	removeClass: function(el,cls) {
1816		if (el && this.hasClass(el,cls)) {el.className=el.className.replace(new RegExp('(\\s|^)'+cls+'(\\s|$)'),' ');}
1817	},
1818	extend: function(obj) {
1819		for(let i = 1; i < arguments.length; i++) {
1820			for(let p in arguments[i]) {
1821				if(arguments[i].hasOwnProperty(p)) {
1822					obj[p] = arguments[i][p];
1823				}
1824			}
1825		}
1826		return obj;
1827	},
1828	each: function(obj, callback) {
1829		let property, len;
1830		if(typeof obj.length === 'number') {
1831			for(property = 0, len = obj.length; property < len; property++) {
1832				if(callback.call(obj[property], property, obj[property]) === false) {
1833					break;
1834				}
1835			}
1836		} else {
1837			for(property in obj) {
1838				if(obj.hasOwnProperty(property)) {
1839					if(callback.call(obj[property], property, obj[property]) === false) {
1840						break;
1841					}
1842				}
1843			}
1844		}
1845	},
1846	event: (function() {
1847		let fixEvent = function(e) {
1848			e = e || window.event;
1849			if(e.isFixed) return e; else e.isFixed = true;
1850			if(!e.target) e.target = e.srcElement;
1851			e.preventDefault = e.preventDefault || function() {this.returnValue = false;};
1852			e.stopPropagation = e.stopPropagation || function() {this.cancelBubble = true;};
1853			return e;
1854		};
1855		return {
1856			add: function(elem, event, handler) {
1857				if(!elem.events) {
1858					elem.events = {};
1859					elem.handle = function(e) {
1860						let ret, handlers = elem.events[e.type];
1861						e = fixEvent(e);
1862						for(let i = 0, len = handlers.length; i < len; i++) {
1863							if(handlers[i]) {
1864								ret = handlers[i].call(elem, e);
1865								if(ret === false) {
1866									e.preventDefault();
1867									e.stopPropagation();
1868								}
1869							}
1870						}
1871					};
1872				}
1873				if(!elem.events[event]) {
1874					elem.events[event] = [];
1875					if(elem.addEventListener) elem.addEventListener(event, elem.handle, passiveSupported
1876						? { passive: true } : false);
1877					else if(elem.attachEvent) elem.attachEvent('on'+event, elem.handle);
1878				}
1879				elem.events[event].push(handler);
1880			},
1881			remove: function(elem, event, handler) {
1882				let handlers = elem.events[event];
1883				for(let i = handlers.length - 1; i >= 0; i--) {
1884					if(handlers[i] === handler) {
1885						handlers.splice(i,1);
1886					}
1887				}
1888				if(!handlers.length) {
1889					delete elem.events[event];
1890					if(elem.removeEventListener) elem.removeEventListener(event, elem.handle, false);
1891					else if(elem.detachEvent) elem.detachEvent('on'+event, elem.handle);
1892				}
1893			}
1894		};
1895	}()),
1896	queryElementsBySelector: function(selector, scope) {
1897		scope = scope || document;
1898		if(!selector) return [];
1899		if(selector === '>*') return scope.children;
1900		if(typeof document.querySelectorAll === 'function') {
1901			return scope.querySelectorAll(selector);
1902		}
1903		let selectors = selector.split(',');
1904		let resultList = [];
1905		for(let s = 0; s < selectors.length; s++) {
1906			let currentContext = [scope || document];
1907			let tokens = selectors[s].replace(/^\s+/,'').replace(/\s+$/,'')
1908				.split(' ');
1909			for (let i = 0; i < tokens.length; i++) {
1910				let token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');
1911				let bits;
1912				let tagName;
1913				if (token.indexOf('#') > -1) {
1914					bits = token.split('#');
1915					tagName = bits[0];
1916					let id = bits[1];
1917					let element = document.getElementById(id);
1918					if (element && tagName && element.nodeName.toLowerCase() != tagName) {
1919						return [];
1920					}
1921					currentContext = element ? [element] : [];
1922					continue;
1923				}
1924				if (token.indexOf('.') > -1) {
1925					bits = token.split('.');
1926					tagName = bits[0] || '*';
1927					let className = bits[1];
1928					let found = [];
1929					let foundCount = 0;
1930					for (let h = 0; h < currentContext.length; h++) {
1931						let elements;
1932						if (tagName == '*') {
1933							elements = currentContext[h].getElementsByTagName('*');
1934						} else {
1935							elements = currentContext[h].getElementsByTagName(tagName);
1936						}
1937						for (let j = 0; j < elements.length; j++) {
1938							found[foundCount++] = elements[j];
1939						}
1940					}
1941					currentContext = [];
1942					let currentContextIndex = 0;
1943					for (let k = 0; k < found.length; k++) {
1944						if (found[k].className && found[k].className.match(new RegExp('(\\s|^)'+className+'(\\s|$)'))) {
1945							currentContext[currentContextIndex++] = found[k];
1946						}
1947					}
1948					continue;
1949				}
1950				if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
1951					tagName = RegExp.$1 || '*';
1952					let attrName = RegExp.$2;
1953					let attrOperator = RegExp.$3;
1954					let attrValue = RegExp.$4;
1955					if(attrName.toLowerCase() == 'for' && this.browser.msie && this.browser.version < 8) {
1956						attrName = 'htmlFor';
1957					}
1958					let found = [], foundCount = 0;
1959					for (let h = 0; h < currentContext.length; h++) {
1960						let elements;
1961						if (tagName == '*') {
1962							elements = currentContext[h].getElementsByTagName('*');
1963						} else {
1964							elements = currentContext[h].getElementsByTagName(tagName);
1965						}
1966						for (let j = 0; elements[j]; j++) {
1967							found[foundCount++] = elements[j];
1968						}
1969					}
1970					currentContext = [];
1971					let currentContextIndex = 0, checkFunction;
1972					switch (attrOperator) {
1973						case '=': checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); }; break;
1974						case '~': checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('(\\s|^)'+attrValue+'(\\s|$)'))); }; break;
1975						case '|': checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); }; break;
1976						case '^': checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); }; break;
1977						case '$': checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); }; break;
1978						case '*': checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); }; break;
1979						default : checkFunction = function(e) { return e.getAttribute(attrName); };
1980					}
1981					currentContext = [];
1982					currentContextIndex = 0;
1983					for (let k = 0; k < found.length; k++) {
1984						if (checkFunction(found[k])) {
1985							currentContext[currentContextIndex++] = found[k];
1986						}
1987					}
1988					continue;
1989				}
1990				tagName = token;
1991				let found = [], foundCount = 0;
1992				for (let h = 0; h < currentContext.length; h++) {
1993					let elements = currentContext[h].getElementsByTagName(tagName);
1994					for (let j = 0; j < elements.length; j++) {
1995						found[foundCount++] = elements[j];
1996					}
1997				}
1998				currentContext = found;
1999			}
2000			resultList = [].concat(resultList,currentContext);
2001		}
2002		return resultList;
2003	},
2004	trim: function (str) {
2005		return str.replace(/^\s+/, '').replace(/\s+$/, '');
2006	},
2007	bind: function(f, scope, forceArgs){
2008		return function() {return f.apply(scope, typeof forceArgs !== 'undefined' ? [forceArgs] : arguments);};
2009	}
2010};
2011
2012function initFaq() {
2013	let faq = $('.faq');
2014	let questions = faq.find('.question');
2015
2016	questions.each(function() {
2017		let question = $(this);
2018		let opener = question.find('.question-title');
2019
2020		opener.on('click', function() {
2021			question.toggleClass('is-active');
2022		});
2023	});
2024}
2025
2026function initLogosSlider() {
2027	$('.logos').owlCarousel({
2028		margin: 0,
2029		autoWidth: true,
2030		nav: true,
2031		dots: false,
2032		slideBy: 1,
2033		responsive: {
2034			0: {
2035				items: 1,
2036				autoWidth: false,
2037			},
2038			480: {
2039				autoWidth: true,
2040				items: 2
2041			}
2042		}
2043	});
2044}
2045
2046function initAwardsSlider() {
2047	$('.awards').owlCarousel({
2048		margin: 10,
2049		autoWidth: true,
2050		nav: true,
2051		dots: false,
2052		slideBy: 1
2053	});
2054}
2055
2056function initClientReviewSlider() {
2057	$('.client-review').owlCarousel({
2058		margin: 0,
2059		items: 1,
2060		loop: true,
2061		nav: true,
2062		dots: false,
2063		autoplay: false,
2064		navText:["<div class='prev-slide'>&#10229;</div>","<div class='next-slide'>&#10230;</div>"],
2065		autoplayTimeout: 6000,
2066		autoplayHoverPause: true
2067	});
2068}
2069
2070
2071
2072function initWebsitesSlider() {
2073	$('.websites').owlCarousel({
2074		margin: 0,
2075		loop: true,
2076		items: 1,
2077		nav: true,
2078		dots: false,
2079		autoplay: true,
2080		autoplayTimeout: 6000,
2081		autoplayHoverPause: true,
2082		// lazyLoad: true
2083	});
2084}
2085
2086function initSliderSection() {
2087	$('.slider-section').owlCarousel({
2088		margin: 0,
2089		items: 1,
2090		nav: true,
2091		dots: false,
2092		autoplay: true,
2093		autoplayTimeout: 6000,
2094		autoplayHoverPause: true,
2095	});
2096}
2097
2098function initTestimonialSlider() {
2099	$('.testimonialSlider').owlCarousel({
2100		margin: 0,
2101		items: 1,
2102		loop: true,
2103		nav: true,
2104		dots: true,
2105		autoplay: false,
2106		autoplayTimeout: 6000,
2107		autoplayHoverPause: true
2108	});
2109}
2110
2111function initLinkedinTestimonialSlider() {
2112	$('.linkedinTestimonialSlider').owlCarousel({
2113		margin: 0,
2114		items: 1,
2115		// loop: true,
2116		nav: true,
2117		dots: false,
2118		autoplay: false,
2119		navText:["<div class='prev-slide'>&#10229;</div>","<div class='next-slide'>&#10230;</div>"],
2120		autoplayTimeout: 6000,
2121		autoplayHoverPause: true
2122	});
2123}
2124
2125document.addEventListener("click", function (event) {
2126	if (event.target.matches(".linkedin-nav-prev")) {
2127		const owlSliderPrevButton = document.querySelector(".linkedinTestimonialSlider .owl-prev");
2128		if (owlSliderPrevButton) $(owlSliderPrevButton).click();
2129	}
2130
2131	if (event.target.matches(".linkedin-nav-next")) {
2132		const owlSliderNextButton = document.querySelector(".linkedinTestimonialSlider .owl-next");
2133		if (owlSliderNextButton) $(owlSliderNextButton).click();
2134	}
2135});
2136
2137// Slick sliders
2138function initHowItWorksSlider() {
2139	const thisIshowItWorksLanding = document.querySelector('.howItWorks');
2140	const thisIsExternalLinks = document.querySelector('.externalLinks');
2141
2142	if (thisIshowItWorksLanding || thisIsExternalLinks) {
2143		window.addEventListener('orientationchange', function () {
2144			let originalBodyStyle = getComputedStyle(document.body).getPropertyValue('display');
2145			document.body.style.display='none';
2146			setTimeout(function () {
2147				document.body.style.display = originalBodyStyle;
2148			}, 10);
2149		});
2150
2151		let sliders
2152
2153		if (thisIshowItWorksLanding) {
2154			sliders = {
2155			1: { nav: '#slider_0', slider: '#sliderImage_0' },
2156			2: { nav: '#slider_1', slider: '#sliderImage_1' },
2157			3: { nav: '#slider_2', slider: '#sliderImage_2' }
2158		};
2159		}
2160
2161		if (thisIsExternalLinks) {
2162			sliders = {
2163			1: { nav: '#slider_0', slider: '#sliderImage_0' },
2164		};
2165		}
2166
2167		$.each(sliders, function (key) {
2168			let index = key - 1;
2169			let time = 10;
2170			let $bar,
2171				isPause,
2172				tick,
2173				percentTime;
2174
2175			$(this.slider).slick({
2176				asNavFor: this.nav,
2177				focusOnSelect: true,
2178				slidesToShow: 1,
2179				slidesToScroll: 1,
vendor: 14,640 bytes, lines 2180-2341
2180				arrows: false,
2181				fade: true,
2182			});
2183
2184			$(this.nav).slick({
2185				asNavFor: this.slider,
2186				dots: false,
2187				focusOnSelect: true,
2188				slidesToShow: 4,
2189				slidesToScroll: 1,
2190				autoplay: true,
2191				autoplaySpeed: 500,
2192			});
2193
2194			$bar = $('.progress_' + index);
2195
2196			$('#slider_' + index).on({
2197				mouseenter: function () {
2198					resetProgressbar();
2199				},
2200				mouseleave: function () {
2201					startProgressbar();
2202				}
2203			});
2204
2205			$('#sliderImage_' + index).on({
2206				mouseenter: function () {
2207					resetProgressbar();
2208				},
2209				mouseleave: function () {
2210					startProgressbar();
2211				}
2212			});
2213
2214			function startProgressbar() {
2215				resetProgressbar();
2216				percentTime = 0;
2217				isPause = false;
2218				tick = setInterval(interval, 10);
2219			}
2220
2221			function interval() {
2222				if (isPause === false) {
2223					percentTime += 1 / (time + 0.1);
2224					$bar.css({
2225						width: percentTime + '%',
2226					});
2227					if (percentTime >= 100) {
2228						$('#sliderImage_' + index).slick('slickNext');
2229						$('#slider_' + index).slick('slickNext');
2230						startProgressbar();
2231					}
2232				}
2233			}
2234
2235			function resetProgressbar() {
2236				$bar.css({
2237					width: 0 + '%'
2238				});
2239				clearTimeout(tick);
2240			}
2241
2242			startProgressbar();
2243
2244		});
2245
2246		$('.slick-slider-mobile').slick({
2247			dots: true,
2248			arrows: false,
2249			infinite: true,
2250			speed: 300,
2251			slidesToShow: 3,
2252			slidesToScroll: 3,
2253			responsive: [
2254				{
2255					breakpoint: 1023,
2256					settings: {
2257						slidesToShow: 2,
2258						slidesToScroll: 2,
2259					}
2260				},
2261				{
2262					breakpoint: 768,
2263					settings: {
2264						slidesToShow: 1,
2265						slidesToScroll: 1
2266					}
2267				}
2268			]
2269		});
2270	}
2271}
2272
2273const pricingSummaryBlocks = {
2274	1: { summary: '.basicFunctional', functional: '.innerBlocksFunctional' },
2275	2: { summary: '.teamAndLibrary', functional: '.innerBlocksTeamAndLibrary' },
2276	3: { summary: '.sharingAndCollaboration', functional: '.innerBlocksSharingAndCollaboration' },
2277	4: { summary: '.storageSyncronization', functional: '.innerBlocksStorageSyncronization' },
2278	5: { summary: '.analytics', functional: '.innerBlocksAnalytics' },
2279	6: { summary: '.metadataManagement', functional: '.innerMetadataManagement' },
2280	7: { summary: '.support', functional: '.innerSupport' },
2281	8: { summary: '.thirdPartyService', functional: '.innerThirdPartyService' },
2282
2283};
2284
2285$.each(pricingSummaryBlocks, function (key, item) {
2286	$(item.summary).click(function(){
2287		$(item.functional).slideToggle(300);
2288		$(item.summary).toggleClass('rotate');
2289	});
2290});
2291
2292
2293// plan switcher
2294const plansList = {
2295	1: { mountly: '.microPlanMountly', yearly: '.microPlanYearly' },
2296	2: { mountly: '.smallPlanMountly', yearly: '.smallPlanYearly' },
2297	3: { mountly: '.mediumPlanMountly', yearly: '.mediumPlanYearly' },
2298
2299};
2300
2301$.each(plansList, function (key, item) {
2302	$('.switch--vertical').click(function () {
2303		$(item.mountly).toggle(0);
2304		$(item.yearly).toggle(0);
2305	});
2306});
2307
2308// video button analytics
2309$(document).ready(function () {
2310	const videoPopupWrapper = $('.video-popup-wrapper');
2311
2312	if (videoPopupWrapper.length) {
2313		const popupOpener = $('[data-ui="video-popup-opener"]');
2314		const popup = $('.video-popup');
2315		const iframe = $('.video');
2316		let videosrc = iframe.data('src');
2317
2318		if (popup) {
2319			videoPopupWrapper[0].addEventListener('click', function () {
2320				videoPopupWrapper.removeClass('active');
2321				iframe.removeAttr('src');
2322			});
2323		}
2324
2325		if (popupOpener) {
2326			popupOpener[0].addEventListener('click', function () {
2327				if (iframe.attr('src') === undefined) {
2328					iframe.attr('src', videosrc);
2329				}
2330				videoPopupWrapper.addClass('active');
2331			});
2332		}
2333	}
2334});
2335
2336/**
2337 * Owl Carousel v2.3.4
2338 * Copyright 2013-2018 David Deutsch
2339 * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
2340 */
2341!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:["width","items","settings"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,"padding-left":a||"","padding-right":a||""};this.$stage.css(c)}},{filter:["width","items","settings"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;c<d;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(a("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(".owl-item");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var a,b,c;a=this.$element.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b<c;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)<Math.abs(d.y)&&this.is("valid")||(b.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},e.prototype.onDragMove=function(a){var b=null,c=null,d=null,e=this.difference(this._drag.pointer,this.pointer(a)),f=this.difference(this._drag.stage.start,e);this.is("dragging")&&(a.preventDefault(),this.settings.loop?(b=this.coordinates(this.minimum()),c=this.coordinates(this.maximum()+1)-b,f.x=((f.x-b)%c+c)%c+b):(b=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),c=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),d=this.settings.pullDrag?-1*e.x/5:0,f.x=Math.max(Math.min(f.x,b+d),c+d)),this._drag.stage.current=f,this.animate(f.x))},e.prototype.onDragEnd=function(b){var d=this.difference(this._drag.pointer,this.pointer(b)),e=this._drag.stage.current,f="lef
vendor: 21,017 bytes, line 2341
2341t";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return"left"===c&&b>i-f&&b<i+f?e=a:"right"===c&&b>i-g-f&&b<i-g+f?e=a+1:this.op(b,"<",i)&&this.op(b,">",h[a+1]!==d?h[a+1]:i-g)&&(e="left"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,">",h[this.minimum()])?e=b=this.minimum():this.op(b,"<",h[this.maximum()])&&(e=b=this.maximum())),e},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){(a=this.normalize(a))!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>d););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2==0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.isVisible()&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){(a=this.normalize(a,!0))!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),!1!==this.settings.responsive&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a<c;case">":return d?a<c:a>c;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type)){var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);for(c.lazyLoadEager>0&&(e+=c.lazyLoadEager,c.loop&&(g-=c.lazyLoadEager,e++));f++<e;)this.load(h/2+this._core.relative(g)),h&&a.each(this._core.clones(this._core.relative(g)),i),g++}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1,lazyLoadEager:0},e.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(".owl-lazy");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src")||f.attr("data-srcset");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):f.is("source")?f.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("srcset",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(c){this._core=c,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"===a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var d=this;a(b).on("load",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.settings.lazyLoad,e=this._core.$stage.children().toArray().slice(b,c),f=[],g=0;a.each(e,function(b,c){f.push(a(c).height())}),g=Math.max.apply(null,f),g<=1&&d&&this._previousHeight&&(g=this._previousHeight),this._previousHeight=g,this._core.$stage.parent().height(g).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?"width:"+c.width+"px;height:"+c.height+"px;":"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(c){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?a("<div/>",{class:"owl-video-tn "+j,srcType:c}):a("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+c+")"}),b.after(d),b.after(e)};if(b.wrap(a("<div/>",{class:"owl-video-wrapper",style:g})),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),c=a('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>'),c.attr("height",h),c.attr("width",g),"youtube"===f.type?c.attr("src","//www.youtube.com/embed/"+f.id+"?autoplay=1&rel=0&v="+f.id):"vimeo"===f.type?c.attr("src","//player.vimeo.com/video/"+f.id+"?autoplay=1"):"vzaar"===f.type&&c.attr("src","//view.vzaar.com/"+f.id+"/player?autoplay=true"),a(c).wrap('<div class="owl-video-frame" />').insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,
2342 
vendor: 12,177 bytes, line 2342
2342animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['<span aria-label="Previous">&#x2039;</span>','<span aria-label="Next">&#x203a;</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a('<button role="button">').addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d,e;e=this._core.settings;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)"$relative"===b&&e.navContainer?this._controls[b].html(""):this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;a<e;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):b<0&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){if(g[b]!==d)return e=!c||b,!1}),e}function f(a){return e(a,!0)}var g=a("<support>").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);
2342
2343
2344/**
2345 * A lightweight youtube embed. Still should feel the same to the user, just MUCH faster to initialize and paint.
2346 *
2347 * Thx to these as the inspiration
2348 *   https://storage.googleapis.com/amp-vs-non-amp/youtube-lazy.html
2349 *   https://autoplay-youtube-player.glitch.me/
2350 *
2351 * Once built it, I also found these:
2352 *   https://github.com/ampproject/amphtml/blob/master/extensions/amp-youtube (👍👍)
2353 *   https://github.com/Daugilas/lazyYT
2354 *   https://github.com/vb/lazyframe
2355 */
2356 class LiteYTEmbed extends HTMLElement{connectedCallback(){this.videoId=this.getAttribute("videoid");let e=this.querySelector(".lty-playbtn");if(this.playLabel=e&&e.textContent.trim()||this.getAttribute("playlabel")||"Play",this.style.backgroundImage||(this.posterUrl=`https://i.ytimg.com/vi/${this.videoId}/hqdefault.jpg`,LiteYTEmbed.addPrefetch("preload",this.posterUrl,"image"),this.style.backgroundImage=`url("${this.posterUrl}")`),e||((e=document.createElement("button")).type="button",e.classList.add("lty-playbtn"),this.append(e)),!e.textContent){const t=document.createElement("span");t.className="lyt-visually-hidden",t.textContent=this.playLabel,e.append(t)}this.addEventListener("pointerover",LiteYTEmbed.warmConnections,{once:!0}),this.addEventListener("click",e=>this.addIframe())}static addPrefetch(e,t,i){const a=document.createElement("link");a.rel=e,a.href=t,i&&(a.as=i),document.head.append(a)}static warmConnections(){LiteYTEmbed.preconnected||(LiteYTEmbed.addPrefetch("preconnect","https://www.youtube-nocookie.com"),LiteYTEmbed.addPrefetch("preconnect","https://www.google.com"),LiteYTEmbed.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),LiteYTEmbed.addPrefetch("preconnect","https://static.doubleclick.net"),LiteYTEmbed.preconnected=!0)}addIframe(){const e=new URLSearchParams(this.getAttribute("params")||[]);e.append("autoplay","1");const t=document.createElement("iframe");t.width=560,t.height=315,t.title=this.playLabel,t.allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",t.allowFullscreen=!0,t.src=`https://www.youtube-nocookie.com/embed/${encodeURIComponent(this.videoId)}?${e.toString()}`,this.append(t),this.classList.add("lyt-activated"),this.querySelector("iframe").focus()}}customElements.define("lite-youtube",LiteYTEmbed);
2357
2358// Set up an event when a visitor stays on the website for 60 seconds
2359const loadPageTimeStamp = Date.now();
2360const prevSessionTimer = window.localStorage.getItem('SESSION_TIMER');
2361let currentSessionTimer = 60000;
2362
2363if (prevSessionTimer) {
2364	currentSessionTimer = currentSessionTimer - Number(prevSessionTimer);
2365}
2366
2367function unloadSessionHandler () {
2368	window.localStorage.setItem('SESSION_TIMER', JSON.stringify(Date.now() - loadPageTimeStamp + Number(prevSessionTimer)));
2369}
2370
2371function sessionHandler () {
2372	window.localStorage.removeItem('SESSION_TIMER');
2373	window.removeEventListener('pagehide', unloadSessionHandler);
2374}
2375
2376setTimeout(() => {
2377	const evt = new Event('60SecondSession');
2378	window.dispatchEvent(evt);
2379	window.dataLayer.push({ event: '60SecondSession'});
2380}, currentSessionTimer);
2381
2382window.addEventListener('60SecondSession', sessionHandler);
2383window.addEventListener('pagehide', unloadSessionHandler);

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.