/**
* @desc 无缝轮播
* @author: Demigodliu
* @date: 2020/06/27 15:15
**/
"use strict";(function(){$.fn.extend({carousel:function a(d){var c=this;d=$.extend($.fn.carousel.defaults,d);d.width=+d.width;d.height=+d.height;d.speed=+d.speed;d.needPrevAndNextBtnGroup=!!d.needPrevAndNextBtnGroup;d.needPagination=!!d.needPagination;var h=d,k=h.width,f=h.height,r=h.speed,j=h.needPrevAndNextBtnGroup,v=h.needPagination;c.css({width:k,height:f});c.find(".swiper-item").css({width:k});var e=null;var m=false;var o={init:function q(){this.cloneItem();this.initBoxAndItem();this.initButtonGroup();this.initPagination()},cloneItem:function s(){var w=c.find(".swiper-item:not(:first-child)").clone().addClass("cloned");var x=c.find(".swiper-item:not(:last-child)").clone().addClass("cloned");c.find(".swiper-wrapper").prepend(w).append(x)},initBoxAndItem:function t(){var z=this;var x=$(".swiper-item");x.not(".cloned").eq(0).addClass("active");var w=$(".active").index();var y=x.length;c.find(".swiper-wrapper").css({"width":y*k,"transform":"translate3d(".concat(-parseInt(w)*k,"px, 0, 0)")});setTimeout(function(){z.transitionToggle(true)},100);o.autoPlay()},initButtonGroup:function u(){if(j){$(".swiper-container").append('\n
\n ');$(".swiper-btn-group_prev").unbind("click").bind("click",this.prev);$(".swiper-btn-group_next").unbind("click").bind("click",this.next)}},prev:function g(){clearTimeout(m);m=setTimeout(function(){clearInterval(e);var A=o,F=c.find(".swiper-item"),B=F.length,x=c.find(".active"),y=x.index(),E=c.find(".swiper-wrapper"),z=$(".swiper-pagination-item"),D=$(".swiper-pagination-item_active"),w=D.index();var C=(B+2)/3;if(y!==1){x.removeClass("active").prev().addClass("active");E.css("transform","translate3d(-".concat(k*--y,"px, 0px, 0px)"))}else{A.transitionToggle(false);x.removeClass("active");F.not(".cloned").eq(2).addClass("active");var G=c.find(".active").index();E.css("transform","translate3d(-".concat(k*G,"px, 0px, 0px)"));setTimeout(function(){A.transitionToggle(true);A.prev()},100);return false}if(!w){z.removeClass("swiper-pagination-item_active").eq(C-1).addClass("swiper-pagination-item_active")}else{D.removeClass("swiper-pagination-item_active").prev().addClass("swiper-pagination-item_active")}A.autoPlay()},100)},next:function i(){clearTimeout(m);m=setTimeout(function(){clearInterval(e);var A=o,F=c.find(".swiper-item"),B=F.length,x=c.find(".active"),y=x.index(),E=c.find(".swiper-wrapper"),z=$(".swiper-pagination-item"),D=$(".swiper-pagination-item_active"),w=D.index();var C=(B+2)/3;if(y!==B-2){x.removeClass("active").next().addClass("active");E.css("transform","translate3d(-".concat(k*++y,"px, 0px, 0px)"))}else{A.transitionToggle(false);x.removeClass("active");F.not(".cloned").eq(C-3).addClass("active");var G=c.find(".active").index();E.css("transform","translate3d(-".concat(k*G,"px, 0px, 0px)"));setTimeout(function(){A.transitionToggle(true);A.next()},100);return false}if(w!==C-1){D.removeClass("swiper-pagination-item_active").next().addClass("swiper-pagination-item_active")}else{z.removeClass("swiper-pagination-item_active").eq(0).addClass("swiper-pagination-item_active")}A.autoPlay()},100)},initPagination:function b(){if(v){$(".swiper-container").append('');var y=$(".swiper-item").not(".cloned").length;var x="";for(var w=0;w