{"version":3,"sources":["main.min.js"],"names":["jQuery","$"],"mappings":"AAAAA,OAAO,SAASC","file":"main.min.js","sourcesContent":["jQuery(function($) {\n // Set Image for different devices\n function _set_image(selector, photo, photo_tablet, photo_phone) {\n var _screen = $(document).width();\n\n if (_screen < 768) {\n if (photo_phone && photo_phone.length > 0) {\n $(selector).attr('src', photo_phone);\n }\n } else if (_screen < 981 && _screen > 767) {\n if (photo_tablet && photo_tablet.length > 0) {\n $(selector).attr('src', photo_tablet);\n }\n } else {\n $(selector).attr('src', photo);\n }\n }\n\n var swapped_img_parent = $('.dtq-swapped-img-selector');\n\n if (swapped_img_parent.length > 0) {\n swapped_img_parent.each(function() {\n var swapped_img = $(this).find('.dtq-swapped-img'),\n img_schema = swapped_img.data('schema');\n\n if (img_schema && typeof img_schema === 'object') {\n var photo = img_schema['desktop'],\n photo_hover = img_schema['hover'],\n photo_tablet = img_schema['tablet'],\n photo_phone = img_schema['phone'];\n\n if (photo_hover && photo_hover.length > 0) {\n $(this).on('hover', function() {\n $(swapped_img).attr('src', photo_hover);\n $(swapped_img).addClass('dtq-img-hovered');\n });\n\n $(this).on('mouseleave', function() {\n _set_image(\n swapped_img,\n photo,\n photo_tablet,\n photo_phone\n );\n $(swapped_img).removeClass('dtq-img-hovered');\n });\n }\n\n _set_image(swapped_img, photo, photo_tablet, photo_phone);\n\n if (\n (photo_tablet && photo_tablet.length > 0) ||\n (photo_tablet && photo_phone.length > 0)\n ) {\n $(window).on('resize', function() {\n _set_image(\n swapped_img,\n photo,\n photo_tablet,\n photo_phone\n );\n });\n }\n }\n });\n }\n\n var ba_img_lightbox = $('.dtq-lightbox');\n if (ba_img_lightbox) {\n try {\n ba_img_lightbox.magnificPopup({\n type: 'image',\n mainClass: 'mfp-with-zoom',\n gallery: { enabled: false },\n zoom: {\n enabled: true,\n duration: 300,\n easing: 'ease-in-out',\n },\n });\n } catch (e) {\n return;\n }\n }\n\n var ba_carousel = $('.dtq-carousel');\n\n if (ba_carousel) {\n var _pre_settings = {\n edgeFriction: 0.35,\n useTransform: true,\n touchThreshold: 600,\n };\n ba_carousel.each(function() {\n var _user_settings = $(this).data('settings');\n var _settings = Object.assign(_pre_settings, _user_settings);\n $(this).slick(_settings);\n });\n }\n\n // Popup.\n window.baPopup = function($popup, settings) {\n var self = this,\n $window = $(window),\n $document = $(document),\n isAnimation = false,\n isOpen = false,\n popupSettings = settings;\n\n self.init = function() {\n self.initOpenEvent();\n self.initCloseEvent();\n };\n\n self.initOpenEvent = function() {\n switch (popupSettings['open-trigger']) {\n case 'page-load':\n self.pageLoadEvent(popupSettings['page-load-delay']);\n break;\n case 'scroll-trigger':\n self.scrollPageEvent(popupSettings['scrolled-to']);\n break;\n case 'try-exit-trigger':\n self.tryExitEvent();\n break;\n\n case 'custom-selector':\n self.onCustomSelector(popupSettings['custom-selector']);\n break;\n }\n };\n\n self.initCloseEvent = function() {\n $popup.on('click', '.dtq-popup-close-button', function(event) {\n var target = event.currentTarget;\n\n self.hidePopup();\n });\n\n $popup.on('click', '.dtq-popup-overlay', function(event) {\n var target = event.currentTarget;\n self.hidePopup();\n });\n };\n\n self.scrollPageEvent = function(scrollingValue) {\n var scrolledValue = +scrollingValue || 0;\n $window\n .on(\n 'scroll.brainScrollEvent resize.brainResizeEvent',\n function() {\n var $window = $(window),\n windowHeight = $window.height(),\n documentHeight = $(document).height(),\n scrolledHeight = documentHeight - windowHeight,\n scrolledProgress =\n Math.max(\n 0,\n Math.min(\n 1,\n $window.scrollTop() / scrolledHeight\n )\n ) * 100;\n\n if (scrolledProgress >= scrolledValue) {\n $window.off(\n 'scroll.brainScrollEvent resize.brainResizeEvent'\n );\n self.showPopup();\n }\n }\n )\n .trigger('scroll.brainResizeEvent');\n };\n\n self.tryExitEvent = function() {\n var pageY = 0;\n\n $(document).on('mouseleave', 'body', function(event) {\n pageY = event.pageY - $window.scrollTop();\n\n if (0 > pageY && $popup.hasClass('dtq-popup-hide-state')) {\n self.showPopup();\n }\n });\n };\n\n self.pageLoadEvent = function(openDelay) {\n var delay = +openDelay || 0;\n delay = delay * 1000;\n $(window).on('load', function() {\n setTimeout(function() {\n self.showPopup();\n }, delay);\n });\n };\n\n self.onCustomSelector = function(selector) {\n var $selector = $(selector);\n\n if ($selector[0]) {\n $selector.on('click', function(event) {\n event.preventDefault();\n\n self.showPopup();\n });\n }\n };\n\n self.showPopup = function() {\n var animeOverlay = null,\n animeContainer = null,\n animeOverlaySettings = jQuery.extend(\n {\n targets: $('.dtq-popup-overlay', $popup)[0],\n },\n self.avaliableEffects['fade']['show']\n ),\n animeContainerSettings = jQuery.extend(\n {\n targets: $('.dtq-popup-container', $popup)[0],\n begin: function(anime) {\n isAnimation = true;\n },\n complete: function(anime) {\n isAnimation = false;\n isOpen = true;\n },\n },\n self.avaliableEffects[popupSettings['animation']]['show']\n );\n\n animeOverlay = anime(animeOverlaySettings);\n $popup.toggleClass('dtq-popup-hide-state dtq-popup-show-state');\n animeContainer = anime(animeContainerSettings);\n };\n\n self.hidePopup = function() {\n var animeOverlay = null,\n animeContainer = null,\n animeOverlaySettings = jQuery.extend(\n {\n targets: $('.dtq-popup-overlay', $popup)[0],\n },\n self.avaliableEffects['fade']['hide']\n ),\n animeContainerSettings = jQuery.extend(\n {\n targets: $('.dtq-popup-container', $popup)[0],\n\n begin: function(anime) {\n isAnimation = true;\n },\n\n complete: function(anime) {\n isAnimation = false;\n isOpen = false;\n $popup.toggleClass(\n 'dtq-popup-show-state dtq-popup-hide-state'\n );\n },\n },\n self.avaliableEffects[popupSettings['animation']]['hide']\n );\n\n if (isAnimation) {\n return false;\n }\n\n if ($popup.hasClass('dtq-popup-show-state')) {\n animeOverlay = anime(animeOverlaySettings);\n animeContainer = anime(animeContainerSettings);\n }\n };\n\n self.avaliableEffects = {\n fade: {\n show: {\n opacity: {\n value: [0, 1],\n duration: 600,\n easing: 'easeOutQuart',\n },\n },\n hide: {\n easing: 'easeOutQuart',\n opacity: {\n value: [1, 0],\n easing: 'easeOutQuart',\n duration: 400,\n },\n },\n },\n\n 'zoom-in': {\n show: {\n duration: 500,\n easing: 'easeOutQuart',\n opacity: {\n value: [0, 1],\n },\n scale: {\n value: [0.75, 1],\n },\n },\n hide: {\n duration: 400,\n easing: 'easeOutQuart',\n opacity: {\n value: [1, 0],\n },\n scale: {\n value: [1, 0.75],\n },\n },\n },\n\n 'zoom-out': {\n show: {\n duration: 500,\n easing: 'easeOutQuart',\n opacity: {\n value: [0, 1],\n },\n scale: {\n value: [1.25, 1],\n },\n },\n hide: {\n duration: 400,\n easing: 'easeOutQuart',\n opacity: {\n value: [1, 0],\n },\n scale: {\n value: [1, 1.25],\n },\n },\n },\n\n rotate: {\n show: {\n duration: 500,\n easing: 'easeOutQuart',\n opacity: {\n value: [0, 1],\n },\n scale: {\n value: [0.75, 1],\n },\n rotate: {\n value: [-65, 0],\n },\n },\n hide: {\n duration: 400,\n easing: 'easeOutQuart',\n opacity: {\n value: [1, 0],\n },\n scale: {\n value: [1, 0.9],\n },\n },\n },\n\n 'move-up': {\n show: {\n duration: 500,\n easing: 'easeOutExpo',\n opacity: {\n value: [0, 1],\n },\n translateY: {\n value: [50, 1],\n },\n },\n hide: {\n duration: 400,\n easing: 'easeOutQuart',\n opacity: {\n value: [1, 0],\n },\n translateY: {\n value: [1, 50],\n },\n },\n },\n\n 'flip-x': {\n show: {\n duration: 500,\n easing: 'easeOutExpo',\n opacity: {\n value: [0, 1],\n },\n rotateX: {\n value: [65, 0],\n },\n },\n hide: {\n duration: 400,\n easing: 'easeOutQuart',\n opacity: {\n value: [1, 0],\n },\n },\n },\n\n 'flip-y': {\n show: {\n duration: 500,\n easing: 'easeOutExpo',\n opacity: {\n value: [0, 1],\n },\n rotateY: {\n value: [65, 0],\n },\n },\n hide: {\n duration: 400,\n easing: 'easeOutQuart',\n opacity: {\n value: [1, 0],\n },\n },\n },\n\n 'bounce-in': {\n show: {\n opacity: {\n value: [0, 1],\n duration: 500,\n easing: 'easeOutQuart',\n },\n scale: {\n value: [0.2, 1],\n duration: 800,\n elasticity: function(el, i, l) {\n return 400 + i * 200;\n },\n },\n },\n hide: {\n duration: 400,\n easing: 'easeOutQuart',\n opacity: {\n value: [1, 0],\n },\n scale: {\n value: [1, 0.8],\n },\n },\n },\n\n 'bounce-out': {\n show: {\n opacity: {\n value: [0, 1],\n duration: 500,\n easing: 'easeOutQuart',\n },\n scale: {\n value: [1.8, 1],\n duration: 800,\n elasticity: function(el, i, l) {\n return 400 + i * 200;\n },\n },\n },\n hide: {\n duration: 400,\n easing: 'easeOutQuart',\n opacity: {\n value: [1, 0],\n },\n scale: {\n value: [1, 1.5],\n },\n },\n },\n\n 'slide-in-up': {\n show: {\n opacity: {\n value: [0, 1],\n duration: 400,\n easing: 'easeOutQuart',\n },\n translateY: {\n value: ['100vh', 0],\n duration: 750,\n easing: 'easeOutQuart',\n },\n },\n hide: {\n duration: 400,\n easing: 'easeInQuart',\n opacity: {\n value: [1, 0],\n },\n translateY: {\n value: [0, '100vh'],\n },\n },\n },\n\n 'slide-in-right': {\n show: {\n opacity: {\n value: [0, 1],\n duration: 400,\n easing: 'easeOutQuart',\n },\n translateX: {\n value: ['100vw', 0],\n duration: 750,\n easing: 'easeOutQuart',\n },\n },\n hide: {\n duration: 400,\n easing: 'easeInQuart',\n opacity: {\n value: [1, 0],\n },\n translateX: {\n value: [0, '100vw'],\n },\n },\n },\n\n 'slide-in-down': {\n show: {\n opacity: {\n value: [0, 1],\n duration: 400,\n easing: 'easeOutQuart',\n },\n translateY: {\n value: ['-100vh', 0],\n duration: 750,\n easing: 'easeOutQuart',\n },\n },\n hide: {\n duration: 400,\n easing: 'easeInQuart',\n opacity: {\n value: [1, 0],\n },\n translateY: {\n value: [0, '-100vh'],\n },\n },\n },\n\n 'slide-in-left': {\n show: {\n opacity: {\n value: [0, 1],\n duration: 400,\n easing: 'easeOutQuart',\n },\n translateX: {\n value: ['-100vw', 0],\n duration: 750,\n easing: 'easeOutQuart',\n },\n },\n hide: {\n duration: 400,\n easing: 'easeInQuart',\n opacity: {\n value: [1, 0],\n },\n translateX: {\n value: [0, '-100vw'],\n },\n },\n },\n };\n };\n});\n"]}