<commit_before>/*
     _ _      _       _
 ___| (_) ___| | __  (_)___
/ __| | |/ __| |/ /  | / __|
\__ \ | | (__|   < _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
                   |__/

  Author: <NAME>
 Website: http://kenwheeler.github.io
    Docs: http://kenwheeler.github.io/slick
    Repo: http://github.com/kenwheeler/slick
  Issues: http://github.com/kenwheeler/slick/issues

 */

/* global window, document, define, jQuery, setInterval, clearInterval */

(function (factory) {
    'use strict';
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], factory);
    } else {
        factory(jQuery);
    }

}(function ($) {
    'use strict';
    var Slick = window.Slick || {};

    Slick = (function () {

        function Slick(element, settings) {

            var _ = this, responsiveSettings, breakpoint;

            _.defaults = {
                accessibility: true,
                arrows: true,
                autoplay: false,
                autoplaySpeed: 3000,
                centerMode: false,
                centerPadding: 50,
                cssEase: 'ease',
                dots: false,
                draggable: true,
                easing: 'linear',
                fade: false,
                infinite: true,
                lazyLoad: 'ondemand',
                onBeforeChange: null,
                onAfterChange: null,
                pauseOnHover: true,
                placeholders: true,
                responsive: null,
                slide: 'div',
                slidesToShow: 1,
                slidesToScroll: 1,
                speed: 300,
                swipe: true,
                touchMove: true,
                touchThreshold: 5,
                vertical: false
            };

            _.initials = {
                animating : false,
                autoPlayTimer : null,
                currentSlide : 0,
                currentLeft : null,
                direction : 1,
                dots : null,
                listWidth : null,
                listHeight : null,
                loadIndex : 0,
                nextArrow : null,
                prevArrow : null,
                slideCount : null,
                slideWidth : null,
                slideTrack : null,
                slides : null,
                sliding : false,
                slideOffset : 0,
                placeholderOffset : 0,
                swipeLeft : null,
                list : null,
                touchObject : {},
                transformsEnabled : false
            };

            $.extend(_, _.initials);

            _.activeBreakpoint = null;
            _.animType = null;
            _.animProp = null;
            _.breakpoints = [];
            _.breakpointSettings = [];
            _.paused = false;
            _.positionProp = null;
            _.slider = $(element);
            _.slidesCache = null;
            _.cssTransitions = false;
            _.windowWidth = 0;
            _.windowTimer = null;

            _.options = $.extend({}, _.defaults, settings);

            _.originalSettings = _.options;
            responsiveSettings = _.options.responsive ||
                null;

            if (responsiveSettings && responsiveSettings.length > -1) {
                for (breakpoint in responsiveSettings) {
                    if (responsiveSettings.hasOwnProperty(breakpoint)) {
                        _.breakpoints.push(responsiveSettings[
                            breakpoint].breakpoint);
                        _.breakpointSettings[responsiveSettings[
                            breakpoint].breakpoint] =
                            responsiveSettings[breakpoint].settings;
                    }
                }
                _.breakpoints.sort(function (a, b) {
                    return b - a;
                });
            }

            _.autoPlay = $.proxy(_.autoPlay,
                _);
            _.autoPlayClear = $.proxy(_.autoPlayClear,
                _);
            _.changeSlide = $.proxy(_.changeSlide,
                _);
            _.setPosition = $.proxy(_.setPosition,
                _);
            _.swipeHandler = $.proxy(_.swipeHandler,
                _);
            _.dragHandler = $.proxy(_.dragHandler,
                _);
            _.keyHandler = $.proxy(_.keyHandler,
                _);
            _.autoPlayIterator = $.proxy(_.autoPlayIterator,
                _);

            _.init();

        }

        return Slick;

    }());

    Slick.prototype.addSlide = function (markup, index, addBefore) {

        var _ = this,
            slideTrackChildren;

        if (typeof(index) === "boolean") {
            addBefore = index;
            index = null;
        }

        _.unload();

        slideTrackChildren = _.slideTrack.children(this.options.slide);

        if (typeof(index) === "number") {
            if (index === 0 && $(slideTrackChildren).length === 0) {
                $(markup).appendTo(_.slideTrack);
            } else if (index < 0 || (index >= $(slideTrackChildren).length && $(slideTrackChildren).length !== 0) ) {
                _.reinit();
                return false;
            } else if (addBefore) {
                $(markup).insertBefore($(slideTrackChildren.get(index)));
            } else {
                $(markup).insertAfter($(slideTrackChildren.get(index)));
            }
        } else {
            if (addBefore === true) {
                $(markup).prependTo(_.slideTrack);
            } else {
                $(markup).appendTo(_.slideTrack);
            }
        }

        _.slides = _.slideTrack.children(this.options.slide);

        _.slideTrack.children(this.options.slide).remove();

        _.slideTrack.append(_.slides);

        _.reinit();

    };

    Slick.prototype.animateSlide = function (targetLeft,
        callback) {

        var animProps = {}, _ = this;

        if (_.transformsEnabled === false) {
            if (_.options.vertical === false) {
                _.slideTrack.animate({
                    left: targetLeft
                }, _.options.speed,_.options.easing, callback);
            } else {
                _.slideTrack.animate({
                    top: targetLeft
                }, _.options.speed,_.options.easing, callback);
            }

        } else {

            if(_.cssTransitions === false) {

                $({
                    animStart: _.currentLeft
                }).animate({
                    animStart: targetLeft
                }, {
                    duration: _.options.speed,
                    easing: _.options.easing,
                    step: function (now) {
                        if (_.options.vertical === false) {
                            animProps[_.animType] = "translate(" +
                                now + "px, 0px)";
                            _.slideTrack.css(animProps);
                        } else {
                            animProps[_.animType] = "translate(0px," +
                                now + "px,0px)";
                            _.slideTrack.css(animProps);
                        }
                    },
                    complete: function () {
                        if (callback) {
                            callback.call();
                        }
                    }
                });

            } else {

                _.applyTransition();

                if (_.options.vertical === false) {
                    animProps[_.animType] = "translate3d(" + targetLeft + "px, 0px, 0px)";
                } else {
                    animProps[_.animType] = "translate3d(0px," + targetLeft + "px, 0px)";
                }
                _.slideTrack.css(animProps);

                if(callback) {
                    setTimeout(function(){

                    _.disableTransition();

                    callback.call();
                    }, _.options.speed);
                }

            }

        }

    };

    Slick.prototype.applyTransition = function (slide) {

        var _ = this, transition,origin;

        transition = 'all ' + _.options.speed + 'ms ' + _.options.cssEase;
        if (_.options.vertical === false) {
            origin = (_.listWidth / 2) + ' 50%';
        } else {
            origin = '';
        }

        if (_.options.fade === false) {
            _.slideTrack.css({
                transition: transition,
                transformOrigin: origin
            });
        } else {
            $(_.slides.get(slide)).css({
                transition: transition
            });
        }

    };

    Slick.prototype.autoPlay = function () {

        var _ = this;

        if (_.autoPlayTimer) {
            clearInterval(_.autoPlayTimer);
        }

        if(_.slideCount > _.options.slidesToShow && _.paused !== true) {
            _.autoPlayTimer = setInterval(_.autoPlayIterator,
                _.options.autoplaySpeed);
        }

    };

    Slick.prototype.autoPlayClear = function () {

        var _ = this;

        if (_.autoPlayTimer) {
            clearInterval(_.autoPlayTimer);
        }

    };

    Slick.prototype.autoPlayIterator = function () {

        var _ = this;

        if (_.options.infinite === false) {

            if (_.direction === 1) {

                if ((_.currentSlide + 1) === _.slideCount -
                    1) {
                    _.direction = 0;
                }

                _.slideHandler(_.currentSlide + _.options
                    .slidesToScroll);

            } else {

                if ((_.currentSlide - 1 === 0)) {

                    _.direction = 1;

                }

                _.slideHandler(_.currentSlide - _.options
                    .slidesToScroll);

            }

        } else {

            _.slideHandler(_.currentSlide + _.options.slidesToScroll);

        }

    };

    Slick.prototype.buildArrows = function () {

        var _ = this;

        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {

            _.prevArrow = $(
                '<button type="button" tabIndex="-1">Previous</button>').appendTo(
                _.slider).addClass('slick-prev');
            _.nextArrow = $(
                '<button type="button" tabIndex="-1">Next</button>').appendTo(
                _.slider).addClass('slick-next');

            if (_.options.infinite !== true) {
                _.prevArrow.addClass('slick-disabled');
            }

        }

    };

    Slick.prototype.buildDots = function () {

        var _ = this, i, dotString;

        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {

            dotString = '<ul class="slick-dots">';

            for (i = 1; i <= _.slideCount; i += 1) {

                dotString += '<li><a href="javascript:void(0)" tabIndex="-1">' + i +
                    '</a></li>';
                if (_.options.placeholders === false && i +
                _.options.slidesToShow - (_.options.slidesToScroll - 1) > _.slideCount) {
                    break;
                }
            }

            dotString += "</ul>";

            _.dots = $(dotString).appendTo(
                _.slider);

            if (_.options.slidesToScroll > 1) {
                _.dots.find('li').hide();
                i = 0;
                while (i < _.slideCount) {
                    $(_.dots.find('li').get(i)).show();
                    i = i + _.options.slidesToScroll;
                }
            }

            _.dots.find('li').first().addClass(
                'slick-active');

        }

    };

    Slick.prototype.buildOut = function () {

        var _ = this;

        _.slides = _.slider.children(_.options.slide +
            ':not(.slick-cloned)').addClass(
            'slick-slide');
        _.slideCount = _.slides.length;
        _.slidesCache = _.slides;

        _.slider.addClass("slick-slider");

        _.slideTrack = (_.slideCount === 0) ?
            $('<div class="slick-track"/>').appendTo(_.slider) :
            _.slides.wrapAll('<div class="slick-track"/>').parent();

        _.list = _.slideTrack.wrap(
            '<div class="slick-list"/>').parent();
        _.slideTrack.css('opacity', 0);

        if(_.options.accessibility === true) {
            _.list.prop('tabIndex',0);
        }

        if(_.options.centerMode === true) {
            _.options.infinite = true;
            _.options.slidesToScroll = 1;
            if(_.options.slidesToShow % 2 === 0) {
                _.options.slidesToShow = 3;
            }
        }

        $('img[data-lazy]',_.slider).not('[src]').addClass('slick-loading');

        _.setupPlaceholders();

        _.setupInfinite();

        _.buildArrows();

        _.buildDots();

        _.setSlideClasses(0);

        if (_.options.draggable === true) {
            _.list.addClass('draggable');
        }

    };

    Slick.prototype.checkResponsive = function () {

        var _ = this, breakpoint, targetBreakpoint;

        if (_.originalSettings.responsive && _.originalSettings
            .responsive.length > -1 && _.originalSettings.responsive !== null) {

            targetBreakpoint = null;

            for (breakpoint in _.breakpoints) {
                if (_.breakpoints.hasOwnProperty(breakpoint)) {
                    if ($(window).width() < _.breakpoints[
                        breakpoint]) {
                        targetBreakpoint = _.breakpoints[
                            breakpoint];
                    }
                }
            }

            if (targetBreakpoint !== null) {
                if (_.activeBreakpoint !== null) {
                    if (targetBreakpoint !== _.activeBreakpoint) {
                        _.activeBreakpoint =
                            targetBreakpoint;
                        _.options = $.extend({}, _.defaults,
                            _.breakpointSettings[
                                targetBreakpoint]);
                            _.refresh();
                    }
                } else {
                    _.activeBreakpoint = targetBreakpoint;
                    _.options = $.extend({}, _.defaults,
                        _.breakpointSettings[
                            targetBreakpoint]);
                        _.refresh();
                }
            } else {
                if (_.activeBreakpoint !== null) {
                    _.activeBreakpoint = null;
                    _.options = $.extend({}, _.defaults,
                        _.originalSettings);
                        _.refresh();
                }
            }

        }

    };

    Slick.prototype.changeSlide = function (event) {

        var _ = this;

        switch (event.data.message) {

        case 'previous':
            _.slideHandler(_.currentSlide - _.options
                .slidesToScroll);
            break;

        case 'next':
            _.slideHandler(_.currentSlide + _.options
            .slidesToScroll);
            break;

        case 'index':
            _.slideHandler($(event.target).parent().index());
            break;

        default:
            return false;
        }

    };

    Slick.prototype.destroy = function () {

        var _ = this;

        _.autoPlayClear();

        _.touchObject = {};

        $('.slick-cloned', _.slider).remove();
        $('.slick-placeholder', _.slider).remove();
        if (_.dots) {
            _.dots.remove();
        }
        if (_.prevArrow) {
            _.prevArrow.remove();
            _.nextArrow.remove();
        }
        _.slides.unwrap().unwrap();
        _.slides.removeClass(
            'slick-slide slick-active slick-visible').removeAttr('style');
        _.slider.removeClass('slick-slider');
        _.slider.removeClass('slick-initialized');

    };

    Slick.prototype.disableTransition = function (slide) {

        var _ = this;

        if (_.options.fade === false) {
            _.slideTrack.css({
                transition: '',
                transformOrigin: ''
            });
        } else {
            $(_.slides.get(slide)).css({
                transition: ''
            });
        }

    };

    Slick.prototype.fadeSlide = function (slideIndex, callback) {

        var _ = this;

        if(_.cssTransitions === false) {

            $(_.slides.get(slideIndex)).css({zIndex: 1000});

            $(_.slides.get(slideIndex)).animate({
                opacity: 1
            }, _.options.speed,_.options.easing, callback);

        } else {

            _.applyTransition(slideIndex);

            $(_.slides.get(slideIndex)).css({
                opacity: 1,
                zIndex: 1000
            });

            if(callback) {
                setTimeout(function(){

                _.disableTransition(slideIndex);

                callback.call();
                }, _.options.speed);
            }

        }

    };

    Slick.prototype.filterSlides = function (filter) {

        var _ = this;

        if(filter !== null) {

            _.unload();

            _.slideTrack.children(this.options.slide).remove();

            _.slidesCache.filter(filter).appendTo(_.slideTrack);

            _.reinit();

        }

    };

    Slick.prototype.init = function () {

        var _ = this;

        if (!$(_.slider).hasClass('slick-initialized')) {

            $(_.slider).addClass('slick-initialized');
            _.buildOut();
            _.setProps();
            _.startLoad();
            _.loadSlider();
            _.initializeEvents();
            _.checkResponsive();
        }

    };

    Slick.prototype.initArrowEvents = function () {

        var _ = this;

        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
            _.prevArrow.on('click.slick', {
                message: 'previous'
            }, _.changeSlide);
            _.nextArrow.on('click.slick', {
                message: 'next'
            }, _.changeSlide);
        }

    };

    Slick.prototype.initDotEvents = function () {

        var _ = this;

        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
            $('li a', _.dots).on('click.slick', {
                message: 'index'
            }, _.changeSlide);
        }

    };

    Slick.prototype.initializeEvents = function () {

        var _ = this;

        _.initArrowEvents();

        _.initDotEvents();

        if (_.options.swipe === true) {
            _.list.on('touchstart.slick', {
                action: 'start',
                kind: 'touch'
            }, _.swipeHandler);
            _.list.on('touchmove.slick', {
                action: 'move',
                kind: 'touch'
            }, _.swipeHandler);
            _.list.on('touchend.slick', {
                action: 'end',
                kind: 'touch'
            }, _.swipeHandler);
            _.list.on('touchcancel.slick', {
                action: 'end',
                kind: 'touch'
            }, _.swipeHandler);
        }

        if (_.options.draggable === true) {
            _.list.on('mousedown.slick', {
                action: 'start',
                kind: 'drag'
            }, _.swipeHandler);
            _.list.on('mousemove.slick', {
                action: 'move',
                kind: 'drag'
            }, _.swipeHandler);
            _.list.on('mouseup.slick', {
                action: 'end',
                kind: 'drag'
            }, _.swipeHandler);
            _.list.on('mouseleave.slick', {
                action: 'end',
                kind: 'drag'
            }, _.swipeHandler);
        }

        if (_.options.pauseOnHover === true && _.options.autoplay === true) {
            _.list.on('mouseenter.slick', _.autoPlayClear);
            _.list.on('mouseleave.slick', _.autoPlay);
        }

        _.list.on('keydown.slick', _.keyHandler);

        $(window).on('orientationchange.slick', function(){
            _.checkResponsive();
            _.setPosition();
        });

        $(window).resize(function () {
                if ($(window).width !== _.windowWidth) {
                    clearTimeout(_.windowDelay);
                    _.windowDelay = window.setTimeout(function () {
                        _.windowWidth = $(window).width();
                        _.checkResponsive();
                        _.setPosition();
                    }, 50);
                }
        });

        $(window).on('load.slick', _.setPosition);

    };

    Slick.prototype.initUI = function () {

        var _ = this;

        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {

            _.prevArrow.show();
            _.nextArrow.show();

        }

        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {

            _.dots.show();

        }

        if (_.options.autoplay === true) {

            _.autoPlay();

        }
<commit_msg>Clean up window bindings on destroy<commit_after>/*
     _ _      _       _
 ___| (_) ___| | __  (_)___
/ __| | |/ __| |/ /  | / __|
\__ \ | | (__|   < _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
                   |__/

  Author: <NAME>
 Website: http://kenwheeler.github.io
    Docs: http://kenwheeler.github.io/slick
    Repo: http://github.com/kenwheeler/slick
  Issues: http://github.com/kenwheeler/slick/issues

 */

/* global window, document, define, jQuery, setInterval, clearInterval */

(function (factory) {
    'use strict';
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], factory);
    } else {
        factory(jQuery);
    }

}(function ($) {
    'use strict';
    var Slick = window.Slick || {};

    Slick = (function () {
        var instanceUid = 0;

        function Slick(element, settings) {

            var _ = this, responsiveSettings, breakpoint;

            _.defaults = {
                accessibility: true,
                arrows: true,
                autoplay: false,
                autoplaySpeed: 3000,
                centerMode: false,
                centerPadding: 50,
                cssEase: 'ease',
                dots: false,
                draggable: true,
                easing: 'linear',
                fade: false,
                infinite: true,
                lazyLoad: 'ondemand',
                onBeforeChange: null,
                onAfterChange: null,
                pauseOnHover: true,
                placeholders: true,
                responsive: null,
                slide: 'div',
                slidesToShow: 1,
                slidesToScroll: 1,
                speed: 300,
                swipe: true,
                touchMove: true,
                touchThreshold: 5,
                vertical: false
            };

            _.initials = {
                animating : false,
                autoPlayTimer : null,
                currentSlide : 0,
                currentLeft : null,
                direction : 1,
                dots : null,
                listWidth : null,
                listHeight : null,
                loadIndex : 0,
                nextArrow : null,
                prevArrow : null,
                slideCount : null,
                slideWidth : null,
                slideTrack : null,
                slides : null,
                sliding : false,
                slideOffset : 0,
                placeholderOffset : 0,
                swipeLeft : null,
                list : null,
                touchObject : {},
                transformsEnabled : false
            };

            $.extend(_, _.initials);

            _.activeBreakpoint = null;
            _.animType = null;
            _.animProp = null;
            _.breakpoints = [];
            _.breakpointSettings = [];
            _.paused = false;
            _.positionProp = null;
            _.slider = $(element);
            _.slidesCache = null;
            _.cssTransitions = false;
            _.windowWidth = 0;
            _.windowTimer = null;

            _.options = $.extend({}, _.defaults, settings);

            _.originalSettings = _.options;
            responsiveSettings = _.options.responsive ||
                null;

            if (responsiveSettings && responsiveSettings.length > -1) {
                for (breakpoint in responsiveSettings) {
                    if (responsiveSettings.hasOwnProperty(breakpoint)) {
                        _.breakpoints.push(responsiveSettings[
                            breakpoint].breakpoint);
                        _.breakpointSettings[responsiveSettings[
                            breakpoint].breakpoint] =
                            responsiveSettings[breakpoint].settings;
                    }
                }
                _.breakpoints.sort(function (a, b) {
                    return b - a;
                });
            }

            _.autoPlay = $.proxy(_.autoPlay,
                _);
            _.autoPlayClear = $.proxy(_.autoPlayClear,
                _);
            _.changeSlide = $.proxy(_.changeSlide,
                _);
            _.setPosition = $.proxy(_.setPosition,
                _);
            _.swipeHandler = $.proxy(_.swipeHandler,
                _);
            _.dragHandler = $.proxy(_.dragHandler,
                _);
            _.keyHandler = $.proxy(_.keyHandler,
                _);
            _.autoPlayIterator = $.proxy(_.autoPlayIterator,
                _);

            _.instanceUid = instanceUid++;
            _.init();

        }

        return Slick;

    }());

    Slick.prototype.addSlide = function (markup, index, addBefore) {

        var _ = this,
            slideTrackChildren;

        if (typeof(index) === "boolean") {
            addBefore = index;
            index = null;
        }

        _.unload();

        slideTrackChildren = _.slideTrack.children(this.options.slide);

        if (typeof(index) === "number") {
            if (index === 0 && $(slideTrackChildren).length === 0) {
                $(markup).appendTo(_.slideTrack);
            } else if (index < 0 || (index >= $(slideTrackChildren).length && $(slideTrackChildren).length !== 0) ) {
                _.reinit();
                return false;
            } else if (addBefore) {
                $(markup).insertBefore($(slideTrackChildren.get(index)));
            } else {
                $(markup).insertAfter($(slideTrackChildren.get(index)));
            }
        } else {
            if (addBefore === true) {
                $(markup).prependTo(_.slideTrack);
            } else {
                $(markup).appendTo(_.slideTrack);
            }
        }

        _.slides = _.slideTrack.children(this.options.slide);

        _.slideTrack.children(this.options.slide).remove();

        _.slideTrack.append(_.slides);

        _.reinit();

    };

    Slick.prototype.animateSlide = function (targetLeft,
        callback) {

        var animProps = {}, _ = this;

        if (_.transformsEnabled === false) {
            if (_.options.vertical === false) {
                _.slideTrack.animate({
                    left: targetLeft
                }, _.options.speed,_.options.easing, callback);
            } else {
                _.slideTrack.animate({
                    top: targetLeft
                }, _.options.speed,_.options.easing, callback);
            }

        } else {

            if(_.cssTransitions === false) {

                $({
                    animStart: _.currentLeft
                }).animate({
                    animStart: targetLeft
                }, {
                    duration: _.options.speed,
                    easing: _.options.easing,
                    step: function (now) {
                        if (_.options.vertical === false) {
                            animProps[_.animType] = "translate(" +
                                now + "px, 0px)";
                            _.slideTrack.css(animProps);
                        } else {
                            animProps[_.animType] = "translate(0px," +
                                now + "px,0px)";
                            _.slideTrack.css(animProps);
                        }
                    },
                    complete: function () {
                        if (callback) {
                            callback.call();
                        }
                    }
                });

            } else {

                _.applyTransition();

                if (_.options.vertical === false) {
                    animProps[_.animType] = "translate3d(" + targetLeft + "px, 0px, 0px)";
                } else {
                    animProps[_.animType] = "translate3d(0px," + targetLeft + "px, 0px)";
                }
                _.slideTrack.css(animProps);

                if(callback) {
                    setTimeout(function(){

                    _.disableTransition();

                    callback.call();
                    }, _.options.speed);
                }

            }

        }

    };

    Slick.prototype.applyTransition = function (slide) {

        var _ = this, transition,origin;

        transition = 'all ' + _.options.speed + 'ms ' + _.options.cssEase;
        if (_.options.vertical === false) {
            origin = (_.listWidth / 2) + ' 50%';
        } else {
            origin = '';
        }

        if (_.options.fade === false) {
            _.slideTrack.css({
                transition: transition,
                transformOrigin: origin
            });
        } else {
            $(_.slides.get(slide)).css({
                transition: transition
            });
        }

    };

    Slick.prototype.autoPlay = function () {

        var _ = this;

        if (_.autoPlayTimer) {
            clearInterval(_.autoPlayTimer);
        }

        if(_.slideCount > _.options.slidesToShow && _.paused !== true) {
            _.autoPlayTimer = setInterval(_.autoPlayIterator,
                _.options.autoplaySpeed);
        }

    };

    Slick.prototype.autoPlayClear = function () {

        var _ = this;

        if (_.autoPlayTimer) {
            clearInterval(_.autoPlayTimer);
        }

    };

    Slick.prototype.autoPlayIterator = function () {

        var _ = this;

        if (_.options.infinite === false) {

            if (_.direction === 1) {

                if ((_.currentSlide + 1) === _.slideCount -
                    1) {
                    _.direction = 0;
                }

                _.slideHandler(_.currentSlide + _.options
                    .slidesToScroll);

            } else {

                if ((_.currentSlide - 1 === 0)) {

                    _.direction = 1;

                }

                _.slideHandler(_.currentSlide - _.options
                    .slidesToScroll);

            }

        } else {

            _.slideHandler(_.currentSlide + _.options.slidesToScroll);

        }

    };

    Slick.prototype.buildArrows = function () {

        var _ = this;

        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {

            _.prevArrow = $(
                '<button type="button" tabIndex="-1">Previous</button>').appendTo(
                _.slider).addClass('slick-prev');
            _.nextArrow = $(
                '<button type="button" tabIndex="-1">Next</button>').appendTo(
                _.slider).addClass('slick-next');

            if (_.options.infinite !== true) {
                _.prevArrow.addClass('slick-disabled');
            }

        }

    };

    Slick.prototype.buildDots = function () {

        var _ = this, i, dotString;

        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {

            dotString = '<ul class="slick-dots">';

            for (i = 1; i <= _.slideCount; i += 1) {

                dotString += '<li><a href="javascript:void(0)" tabIndex="-1">' + i +
                    '</a></li>';
                if (_.options.placeholders === false && i +
                _.options.slidesToShow - (_.options.slidesToScroll - 1) > _.slideCount) {
                    break;
                }
            }

            dotString += "</ul>";

            _.dots = $(dotString).appendTo(
                _.slider);

            if (_.options.slidesToScroll > 1) {
                _.dots.find('li').hide();
                i = 0;
                while (i < _.slideCount) {
                    $(_.dots.find('li').get(i)).show();
                    i = i + _.options.slidesToScroll;
                }
            }

            _.dots.find('li').first().addClass(
                'slick-active');

        }

    };

    Slick.prototype.buildOut = function () {

        var _ = this;

        _.slides = _.slider.children(_.options.slide +
            ':not(.slick-cloned)').addClass(
            'slick-slide');
        _.slideCount = _.slides.length;
        _.slidesCache = _.slides;

        _.slider.addClass("slick-slider");

        _.slideTrack = (_.slideCount === 0) ?
            $('<div class="slick-track"/>').appendTo(_.slider) :
            _.slides.wrapAll('<div class="slick-track"/>').parent();

        _.list = _.slideTrack.wrap(
            '<div class="slick-list"/>').parent();
        _.slideTrack.css('opacity', 0);

        if(_.options.accessibility === true) {
            _.list.prop('tabIndex',0);
        }

        if(_.options.centerMode === true) {
            _.options.infinite = true;
            _.options.slidesToScroll = 1;
            if(_.options.slidesToShow % 2 === 0) {
                _.options.slidesToShow = 3;
            }
        }

        $('img[data-lazy]',_.slider).not('[src]').addClass('slick-loading');

        _.setupPlaceholders();

        _.setupInfinite();

        _.buildArrows();

        _.buildDots();

        _.setSlideClasses(0);

        if (_.options.draggable === true) {
            _.list.addClass('draggable');
        }

    };

    Slick.prototype.checkResponsive = function () {

        var _ = this, breakpoint, targetBreakpoint;

        if (_.originalSettings.responsive && _.originalSettings
            .responsive.length > -1 && _.originalSettings.responsive !== null) {

            targetBreakpoint = null;

            for (breakpoint in _.breakpoints) {
                if (_.breakpoints.hasOwnProperty(breakpoint)) {
                    if ($(window).width() < _.breakpoints[
                        breakpoint]) {
                        targetBreakpoint = _.breakpoints[
                            breakpoint];
                    }
                }
            }

            if (targetBreakpoint !== null) {
                if (_.activeBreakpoint !== null) {
                    if (targetBreakpoint !== _.activeBreakpoint) {
                        _.activeBreakpoint =
                            targetBreakpoint;
                        _.options = $.extend({}, _.defaults,
                            _.breakpointSettings[
                                targetBreakpoint]);
                            _.refresh();
                    }
                } else {
                    _.activeBreakpoint = targetBreakpoint;
                    _.options = $.extend({}, _.defaults,
                        _.breakpointSettings[
                            targetBreakpoint]);
                        _.refresh();
                }
            } else {
                if (_.activeBreakpoint !== null) {
                    _.activeBreakpoint = null;
                    _.options = $.extend({}, _.defaults,
                        _.originalSettings);
                        _.refresh();
                }
            }

        }

    };

    Slick.prototype.changeSlide = function (event) {

        var _ = this;

        switch (event.data.message) {

        case 'previous':
            _.slideHandler(_.currentSlide - _.options
                .slidesToScroll);
            break;

        case 'next':
            _.slideHandler(_.currentSlide + _.options
            .slidesToScroll);
            break;

        case 'index':
            _.slideHandler($(event.target).parent().index());
            break;

        default:
            return false;
        }

    };

    Slick.prototype.destroy = function () {

        var _ = this;

        _.autoPlayClear();

        _.touchObject = {};

        $('.slick-cloned', _.slider).remove();
        $('.slick-placeholder', _.slider).remove();
        if (_.dots) {
            _.dots.remove();
        }
        if (_.prevArrow) {
            _.prevArrow.remove();
            _.nextArrow.remove();
        }
        _.slides.unwrap().unwrap();
        _.slides.removeClass(
            'slick-slide slick-active slick-visible').removeAttr('style');
        _.slider.removeClass('slick-slider');
        _.slider.removeClass('slick-initialized');

        _.list.off('.slick');
        $(window).off('.slick'+_.instanceUid);
    };

    Slick.prototype.disableTransition = function (slide) {

        var _ = this;

        if (_.options.fade === false) {
            _.slideTrack.css({
                transition: '',
                transformOrigin: ''
            });
        } else {
            $(_.slides.get(slide)).css({
                transition: ''
            });
        }

    };

    Slick.prototype.fadeSlide = function (slideIndex, callback) {

        var _ = this;

        if(_.cssTransitions === false) {

            $(_.slides.get(slideIndex)).css({zIndex: 1000});

            $(_.slides.get(slideIndex)).animate({
                opacity: 1
            }, _.options.speed,_.options.easing, callback);

        } else {

            _.applyTransition(slideIndex);

            $(_.slides.get(slideIndex)).css({
                opacity: 1,
                zIndex: 1000
            });

            if(callback) {
                setTimeout(function(){

                _.disableTransition(slideIndex);

                callback.call();
                }, _.options.speed);
            }

        }

    };

    Slick.prototype.filterSlides = function (filter) {

        var _ = this;

        if(filter !== null) {

            _.unload();

            _.slideTrack.children(this.options.slide).remove();

            _.slidesCache.filter(filter).appendTo(_.slideTrack);

            _.reinit();

        }

    };

    Slick.prototype.init = function () {

        var _ = this;

        if (!$(_.slider).hasClass('slick-initialized')) {

            $(_.slider).addClass('slick-initialized');
            _.buildOut();
            _.setProps();
            _.startLoad();
            _.loadSlider();
            _.initializeEvents();
            _.checkResponsive();
        }

    };

    Slick.prototype.initArrowEvents = function () {

        var _ = this;

        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
            _.prevArrow.on('click.slick', {
                message: 'previous'
            }, _.changeSlide);
            _.nextArrow.on('click.slick', {
                message: 'next'
            }, _.changeSlide);
        }

    };

    Slick.prototype.initDotEvents = function () {

        var _ = this;

        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
            $('li a', _.dots).on('click.slick', {
                message: 'index'
            }, _.changeSlide);
        }

    };

    Slick.prototype.initializeEvents = function () {

        var _ = this;

        _.initArrowEvents();

        _.initDotEvents();

        if (_.options.swipe === true) {
            _.list.on('touchstart.slick', {
                action: 'start',
                kind: 'touch'
            }, _.swipeHandler);
            _.list.on('touchmove.slick', {
                action: 'move',
                kind: 'touch'
            }, _.swipeHandler);
            _.list.on('touchend.slick', {
                action: 'end',
                kind: 'touch'
            }, _.swipeHandler);
            _.list.on('touchcancel.slick', {
                action: 'end',
                kind: 'touch'
            }, _.swipeHandler);
        }

        if (_.options.draggable === true) {
            _.list.on('mousedown.slick', {
                action: 'start',
                kind: 'drag'
            }, _.swipeHandler);
            _.list.on('mousemove.slick', {
                action: 'move',
                kind: 'drag'
            }, _.swipeHandler);
            _.list.on('mouseup.slick', {
                action: 'end',
                kind: 'drag'
            }, _.swipeHandler);
            _.list.on('mouseleave.slick', {
                action: 'end',
                kind: 'drag'
            }, _.swipeHandler);
        }

        if (_.options.pauseOnHover === true && _.options.autoplay === true) {
            _.list.on('mouseenter.slick', _.autoPlayClear);
            _.list.on('mouseleave.slick', _.autoPlay);
        }

        _.list.on('keydown.slick', _.keyHandler);

        $(window).on('orientationchange.slick.slick'+_.instanceUid, function(){
            _.checkResponsive();
            _.setPosition();
        });

        $(window).on('resize.slick.slick'+_.instanceUid, function () {
            if ($(window).width !== _.windowWidth) {
                clearTimeout(_.windowDelay);
                _.windowDelay = window.setTimeout(function () {
                    _.windowWidth = $(window).width();
                    _.checkResponsive();
                    _.setPosition();
                }, 50);
            }
        });

		$(window).on('load.slick.slick'+_.instanceUid, _.setPosition);
    };

    Slick.prototype.initUI = function () {

        var _ = this;

        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {

            _.prevArrow.show();
            _.nextArrow.show();

        }

        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {

            _.dots.show();

        }

        if (_.options.autoplay === true) {

            _.autoPlay();

        }

{'fraction_non_alphanumeric': 0.1313607775871927, 'fraction_numerical': 0.003454354869449209, 'mean_word_length': 1.1937287692709695, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4773714', 'n_tokens_mistral': 11448, 'n_tokens_neox': 10501, 'n_words': 1795}