jQuery(function($) {ServicesModuleInitialize();});function ServicesModuleInitialize() {$( document ).on( 's123.page.ready', function( event ) {var $section = $('section.s123-module-services');$section.each(function( index ) {var $sectionThis = $(this);var categories = new ModuleLayoutCategories({$items :  $sectionThis.find('.services-category'),$categoriesContainer : $sectionThis.find('.categories-panel'),$filterButton : $sectionThis.find('.items-responsive-filter'),$categories : $sectionThis.find('.items-categories-container li')});if ( $sectionThis.hasClass('layout-10') ) {$sectionThis.find('.service-item-description').each(function() {const $paragraph = $(this);const lineHeight = parseFloat($paragraph.css('font-size')) * 1.5;const maxLines = 4;const actualHeight = $paragraph.height();const numberOfLines = actualHeight / lineHeight;if (numberOfLines > maxLines) {$paragraph.addClass('show-more');$paragraph.attr('data-rel', 'tooltip');$paragraph.css('height', lineHeight * maxLines);$paragraph.on('click', function() {var _this = $(this);bootbox.alert({title: _this.data('title'),message: _this.html(),backdrop: true});});}});}
ServicesModuleMobileViewCarouselInit($sectionThis);});});}
function ServicesModuleMobileViewCarouselInit( $section ) {let sectionID = $section.get(0).id.replace('section-','');let $sectionItemsContainer = $section.find('.service-grid');let mobileViewTypeNUM = $section.data('mobile-view-type');ServicesModuleMobileViewCarouselInitResizeHandler();if ( $sectionItemsContainer.hasClass('slick-initialized') ) {$sectionItemsContainer.css('visibility','none');$sectionItemsContainer.slick('unslick');$sectionItemsContainer.parent().find('.custom-arrow-container').remove();}
if ( findBootstrapEnvironment() != 'xs' || mobileViewTypeNUM != '2' ) {$sectionItemsContainer.css('visibility','visible');return;}
$sectionItemsContainer.on('init', function(event) {$sectionItemsContainer.css('visibility','visible');});$sectionItemsContainer.slick({dots: false,infinite: true,vertical: false,verticalSwiping: false,slidesToShow: 1,slidesToScroll: 1,adaptiveHeight: true,swipeToSlide: true,rtl: $('html').attr('dir') === 'rtl' ? true : false,centerMode: true,centerPadding: '8%',arrows: false});function ServicesModuleMobileViewCarouselInitResizeHandler() {$(window).off('resize.ServicesModuleMobileViewCarouselInit').on('resize.ServicesModuleMobileViewCarouselInit', function( event ) {clearTimeout(window.ServicesModuleMobileViewCarouselInit_Delay);window.ServicesModuleMobileViewCarouselInit_Delay = setTimeout( function() {var $sections = $('section.s123-module-services');$sections.each(function( index ) {ServicesModuleMobileViewCarouselInit($(this));});},50);});}}
jQuery(function($) {TestimonialsModuleInitialize_Layout1_Layout8_Layout9();});function TestimonialsModuleInitialize_Layout1_Layout8_Layout9() {$( document ).on( "s123.page.ready", function( event ) {var $sections = $('.s123-module-testimonials.layout-1, .s123-module-testimonials.layout-8, .s123-module-testimonials.layout-9');$sections.each(function( index ) {var $s = $(this);var $carousel = $s.find('[data-ride="carousel"]');var layout_customize = $s.find('.layout-customize').length > 0 ? tryParseJSON($s.find('.layout-customize').val()) : '';var testimonialsInterval = 10000;if ( layout_customize != '' ) {testimonialsInterval = layout_customize.testimonialsInterval * 1000;}
$carousel.carousel({interval: isMobileDevice.any() ? false : testimonialsInterval});$carousel.find('.carousel-control.left').click(function() {$carousel.carousel('prev');});$carousel.find('.carousel-control.right').click(function() {$carousel.carousel('next');});$carousel.find('.carousel-indicators li').click(function(){$carousel.carousel($(this).data('slide-to'));});});});$( document ).on( "s123.page.load", function( event ) {setTestimonialsHeight();});if ( IsWizard() ) {$(document).on('wizard.preview.device.changed', function( event ) {setTestimonialsHeight();});}
function setTestimonialsHeight() {var $sections = $('.s123-module-testimonials.layout-1, .s123-module-testimonials.layout-8, .s123-module-testimonials.layout-9');$sections.each(function( index ) {var $s = $(this);var $carousel = $s.find('[data-ride="carousel"]');$carousel.find('.item, .testimonial-image').css({ minHeight: '' });if ( !IsIE11() ) {var selector = $s.hasClass('layout-8') && findBootstrapEnvironment() !== 'xs' ? '.testimonial-image' : '.item';$carousel.find(selector).css({minHeight: Math.max.apply(Math, $carousel.find('.item').map(function() { return $(this).outerHeight(); }))});}});}}
jQuery(function($) {TestimonialsModuleInitialize_Layouts();});function TestimonialsModuleInitialize_Layouts() {$( document ).on( "s123.page.ready", function( event ) {var $sections = $('.s123-module-testimonials');$sections.each(function( index ) {var $s = $(this);var $categories = $s.find('.testimonials-category');var categories = new ModuleLayoutCategories({$items :  $s.find('.testimonials-category'),$categoriesContainer : $s.find('.categories-panel'),$filterButton : $s.find('.items-responsive-filter'),$categories : $s.find('.items-categories-container li')});});});}
jQuery(function($) {TestimonialsModuleInitialize_Layout12();});function TestimonialsModuleInitialize_Layout12() {$( document ).on( "s123.page.ready", function( event ) {var $sections = $('.s123-module-testimonials.layout-12');$sections.each(function( index ) {var $s = $(this);var $categories = $s.find('.testimonials-category');var categories = new ModuleLayoutCategories({$items :  $s.find('.testimonials-category'),$categoriesContainer : $s.find('.categories-panel'),$filterButton : $s.find('.items-responsive-filter'),$categories : $s.find('.items-categories-container li')});var $carousel = $($s.find('.testimonials-continuous-slider').get(0));var slidesToShow = whatScreen.any() == 'mobile' ? 1 : 3;$(window).on('resize', function() {if (whatScreen.any() == 'mobile') {slidesToShow = 1;} else {slidesToShow = 3;}
$carousel.slick('destroy');testimonialsLayout12Slick($carousel,slidesToShow);});if ( !$carousel.hasClass('slick-initialized') ) {testimonialsLayout12Slick($carousel,slidesToShow);}
$s.on('module_layout_categories.show', function (event, category) {$carousel.slick('destroy');$carousel = $s.find('.testimonials-category[data-categories-filter="'+category+'"] .testimonials-continuous-slider');if ( !$carousel.hasClass('slick-initialized') ) {testimonialsLayout12Slick($carousel,slidesToShow);}});});});}
function testimonialsLayout12Slick( $carousel, slidesToShow ) {$carousel.slick({slidesToShow: slidesToShow,  // number of slides to show at once
slidesToScroll: 1,  // number of slides to scroll at once
autoplay: true,infinite: true,speed: 8000,  // speed of the transition, play with this value to achieve desired effect
autoplaySpeed: 0,  // no delay between auto-play transitions
cssEase: 'linear',  // this gives the linear movement between slides
arrows: false,  // optional: disable arrows
pauseOnHover: true,  // optional: prevent pause when hover
draggable: false,centerMode: false,rtl: $('html').attr('dir') == 'rtl' ? true : false,adaptiveHeight: true});}
jQuery(function($) {TwitterTweetsModuleInitialize();});function TwitterTweetsModuleInitialize() {$( document ).on( 's123.page.ready', function( event ) {var $section = $('section.s123-module-twitter-tweets');$section.each(function( index ) {var $sectionThis = $(this);$sectionThis.find('.tweet-settings').each(function(){const $settings = $(this);const settings = tryParseJSON($settings.val());if ( !settings ) return;$settings.replaceWith(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${settings.theme}"><a href="${settings.tweetURL}">${settings.title}</a></blockquote><script class="twitter-tweet-script" async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>`);});});});}
