/* Minification failed. Returning unminified contents.
(103,48-53): run-time warning JS1028: Expected identifier or string: class
(128,53-58): run-time warning JS1028: Expected identifier or string: class
 */
(function (window, $) {
    'use strict';

    var Gap = window.Gap = window.Gap || {};
    Gap.navigateTo = navigateTo;

    function navigateTo(options) {
        if (!options) {
            return;
        };
        
        if (options.clickElement) {
            $(options.clickElement).on('click', function(event) {
                event.preventDefault();

                if (options.targetUrl) {
                    window.location.href = options.targetUrl;
                }
            });
        };
    };

})(window, jQuery);;(function (window, $) {
    'use strict';

    var Gap = window.Gap = window.Gap || {};
    Gap.scrollPage = scrollPage;

    function scrollPage(options) {
        if (!options) {
            return;
        };

        var settings = $.extend( {}, options );

        if (options.clickElement) {

            $(options.clickElement).on('click', function(event) {
                event.preventDefault();

                if (options.targetElement) {
                    document.querySelector(options.targetElement).scrollIntoView({ behavior: 'smooth' });
                }
            });
        };
    };

})(window, jQuery);;(function (window, $) {
    'use strict';

    var Gap = window.Gap = window.Gap || {};
    Gap.heroSlider = heroSlider;

    function heroSlider(options) {
        if (!options) {
            return;
        }

        var $heroCarousel = $(options.container);
        $heroCarousel.css('clear', 'both');

        if (options.bannerJsonUrl) {
            try {
                $.get(options.bannerJsonUrl)
                    .done(function (result) {
                        gotData(result);
                    })
                    .fail(function (error) {
                        return 'Unable to get data - ' + error;
                    });
            }
            catch (ex) {
                gotError(ex);
            }
        }

        function gotData(result) {
            if (result) {
                try {
                    loadSlick(result);
                }
                catch (ex) {
                    gotError('No data retrieved - ' + ex);
                }
            }
        }

        function gotError(ex) {
            if (appInsights) {
                appInsights.trackException(ex);
            }
        }

        function loadSlick(result) {
            if (typeof result === 'undefined')
                gotError('No data provided');

            if (!result.items || !result.items.length)
                gotError('No images in data provided');

            $.each(result.items, function (i, item) {

                var slide = $('<div></div>', { class: 'homepage-hero-slider-item' });
                $(slide).append(getSlideImg(item));

                $heroCarousel.append(slide);

            });

            $heroCarousel.slick({
                dots: false,
                arrows: false,
                infinite: true,
                slidesToShow: 1,
                autoplay: true,
                speed: 1000,
                autoplaySpeed: 4000,
                pauseOnHover: false,
                fade: true,
                cssEase: 'linear'
            });
        }

        function getSlideImg(item) {
            if (typeof item === 'undefined')
                return '';

            var imageContainer = $('<div></div>', { class: 'homepage-hero-slider-item-img' });
            var itemImage;

            if (!item.mainImage) {
                itemImage = [
                    '<span class="no-image">',
                    '<span>', portalScriptResources.No_Image, '</span>',
                    '<img src="/content/sr/images/blank-image-120x120.png" alt="', portalScriptResources.No_Image, '" />',
                    '</span>'
                ].join('');
            } else {
                var imageSrc = document.createElement("A");
                imageSrc.href = item.mainImage.url + item.mainImage.extension;

                $(imageContainer).attr('style', 'background-image: url(' + imageSrc.origin + imageSrc.pathname + ');');
                itemImage = '<img src="' + imageSrc.origin + imageSrc.pathname + '" alt="' + Gap.Common.UI.escapeHtml(item.title) + '" />';
            };

            $(imageContainer).append(itemImage);

            return imageContainer;
        }
    }
})(window, jQuery);;