!function(){function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var a,n,r=[],o=!0,c=!1;try{for(i=i.call(t);!(o=(a=i.next()).done)&&(r.push(a.value),!e||r.length!==e);o=!0);}catch(u){c=!0,n=u}finally{try{o||null==i.return||i.return()}finally{if(c)throw n}}return r}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i1&&void 0!==arguments[1]?arguments[1]:0,a=e*D.value;t.loop||(a=Math.min(a,-B.value));var n=i-a;return t.loop||(n=d(n,B.value,0)),n},W=function(e){var i=e.pace,a=void 0===i?0:i,r=e.offset,o=void 0===r?0:r,c=e.emitChange;if(!(X.value<=1)){var u=h.active,l=function(e){var i=h.active;return e?t.loop?d(i+e,-1,X.value):d(i+e,0,P.value):i}(a),v=Q(l,o);if(t.loop){if(O[0]&&v!==B.value){var s=v0;O[X.value-1].setOffset(f?-R.value:0)}}h.active=l,h.offset=v,c&&l!==u&&n("change",U.value)}},Z=function(){h.swiping=!0,h.active<=-1?W({pace:X.value}):h.active>=X.value&&W({pace:-X.value})},$=function(){Z(),T.reset(),M((function(){h.swiping=!1,W({pace:1,emitChange:!0})}))},q=function(){return clearTimeout(i)},F=function e(){q(),t.autoplay>0&&X.value>1&&(i=setTimeout((function(){$(),e()}),+t.autoplay))},J=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:+t.initialSwipe;if(p.value){var i=function(){var i,a;if(!s(p)){var n={width:p.value.offsetWidth,height:p.value.offsetHeight};h.rect=n,h.width=+(null!=(i=t.width)?i:n.width),h.height=+(null!=(a=t.height)?a:n.height)}X.value&&(e=Math.min(X.value-1,e)),h.active=e,h.swiping=!0,h.offset=Q(e),O.forEach((function(t){t.setOffset(0)})),F()};s(p)?A().then(i):i()}},K=function(){return J(h.active)},N=function(e){t.touchable&&(T.start(e),a=Date.now(),q(),Z())},V=function(e){t.touchable&&h.swiping&&(T.move(e),G.value&&(f(e,t.stopPropagation),W({offset:H.value})))},tt=function(){if(t.touchable&&h.swiping){var e=Date.now()-a,i=H.value/e;if((Math.abs(i)>.25||Math.abs(H.value)>D.value/2)&&G.value){var n=t.vertical?T.offsetY.value:T.offsetX.value,r=0;r=t.loop?n>0?H.value>0?-1:1:0:-Math[H.value>0?"ceil":"floor"](H.value/D.value),W({pace:r,emitChange:!0})}else H.value&&W({pace:0});h.swiping=!1,F()}},et=function(e,i){var a=i===U.value,n=a?{backgroundColor:t.indicatorColor}:void 0;return C("i",{style:n,class:j("indicator",{active:a})},null)};return c({prev:function(){Z(),T.reset(),M((function(){h.swiping=!1,W({pace:-1,emitChange:!0})}))},next:$,state:h,resize:K,swipeTo:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z(),T.reset(),M((function(){var a;a=t.loop&&e===X.value?0===h.active?0:e:e%X.value,i.immediate?M((function(){h.swiping=!1})):h.swiping=!1,W({pace:a-h.active,emitChange:!0})}))}}),Y({size:D,props:t,count:X,activeIndicator:U}),b((function(){return t.initialSwipe}),(function(t){return J(+t)})),b(X,(function(){return J(h.active)})),b((function(){return t.autoplay}),F),b([u,l],K),b(_(),(function(t){"visible"===t?F():q()})),x(J),k((function(){return J(h.active)})),v((function(){return J(h.active)})),z(q),S(q),function(){var e;return C("div",{ref:p,class:j()},[C("div",{style:L.value,class:j("track",{vertical:t.vertical}),onTouchstart:N,onTouchmove:V,onTouchend:tt,onTouchcancel:tt},[null==(e=r.default)?void 0:e.call(r)]),r.indicator?r.indicator({active:U.value,total:X.value}):t.showIndicators&&X.value>1?C("div",{class:j("indicators",{vertical:t.vertical})},[Array(X.value).fill("").map(et)]):void 0])}}}),D=(e("S",p(X)),t(i("swipe-item"),2)),H=D[0],B=D[1],P=h({name:H,setup:function(t,e){var i,a=e.slots,n=g({offset:0,inited:!1,mounted:!1}),r=T(E),o=r.parent,u=r.index;if(o){var l=y((function(){var t={},e=o.props.vertical;return o.size.value&&(t[e?"height":"width"]="".concat(o.size.value,"px")),n.offset&&(t.transform="translate".concat(e?"Y":"X","(").concat(n.offset,"px)")),t})),v=y((function(){var t=o.props,e=t.loop;if(!t.lazyRender||i)return!0;if(!n.mounted)return!1;var a=o.activeIndicator.value,r=o.count.value-1,c=0===a&&e?r:a-1,l=a===r&&e?0:a+1;return i=u.value===a||u.value===c||u.value===l}));return x((function(){A((function(){n.mounted=!0}))})),c({setOffset:function(t){n.offset=t}}),function(){var t;return C("div",{class:B(),style:l.value},[v.value?null==(t=a.default)?void 0:t.call(a):null])}}}});e("a",p(P))}}}))}();