(function framework7ComponentLoader(t,e){void 0===e&&(e=!0);var a=document,s=(window,t.$),o=(t.Template7,t.utils),i=(t.device,t.support,t.Class,t.Modal,t.ConstructorMethods,t.ModalMethods,{init:function(){var t,e,o,i,r,n,l,d,p,b,u,v,f,h,c,g,m,x,w,C,T=this;var M=!!T.support.passiveListener&&{passive:!1,capture:!1};s(a).on(T.touchEvents.start,".list.sortable .sortable-handler",function(a){e=!1,t=!0,o="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY,r=s(this).parent("li"),f=r.index(),l=r.parents(".sortable");var i=r.parents(".list-group");i.length&&i.parents(l).length&&(l=i),n=l.children("ul").children("li"),T.panel&&(T.panel.allowOpen=!1),T.swipeout&&(T.swipeout.allow=!1)},M),T.on("touchmove:active",function(a){if(t&&r){var f="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY;if(!e){h=r.parents(".page"),c=r.parents(".page-content");var T=parseInt(c.css("padding-top"),10),M=parseInt(c.css("padding-bottom"),10);C=c[0].scrollTop,m=h.offset().top+T,g=h.height()-T-M,r.addClass("sorting"),l.addClass("sortable-sorting"),x=r[0].offsetTop,p=r[0].offsetTop,b=r.parent().height()-x-r.height(),d=r[0].offsetHeight,w=r.offset().top}e=!0,a.preventDefault(),a.f7PreventSwipePanel=!0,i=f-o;var I=c[0].scrollTop-C,L=Math.min(Math.max(i+I,-p),b);r.transform("translate3d(0,"+L+"px,0)");var y,E=!0;i+I+44<-p&&(E=!1),i+I-44>b&&(E=!1),v=void 0,u=void 0,E&&(w+i+d+44>m+g&&(y=w+i+d+44-(m+g)),w+i<m+44&&(y=w+i-m-44),y&&(c[0].scrollTop+=y)),n.each(function(t,e){var a=s(e);if(a[0]!==r[0]){var o=a[0].offsetTop,i=a.height(),n=x+L;n>=o-i/2&&r.index()<a.index()?(a.transform("translate3d(0, "+-d+"px,0)"),u=a,v=void 0):n<=o+i/2&&r.index()>a.index()?(a.transform("translate3d(0, "+d+"px,0)"),u=void 0,v||(v=a)):a.transform("translate3d(0, 0%,0)")}})}}),T.on("touchend:passive",function(){if(!t||!e)return e=!1,void((t=!1)&&!e&&(T.panel&&(T.panel.allowOpen=!0),T.swipeout&&(T.swipeout.allow=!0)));var a;if(T.panel&&(T.panel.allowOpen=!0),T.swipeout&&(T.swipeout.allow=!0),n.transform(""),r.removeClass("sorting"),l.removeClass("sortable-sorting"),u?a=u.index():v&&(a=v.index()),T.params.sortable.moveElements&&(u&&r.insertAfter(u),v&&r.insertBefore(v)),(u||v)&&l.hasClass("virtual-list")){void 0===(f=r[0].f7VirtualListIndex)&&(f=r.attr("data-virtual-list-index")),v?void 0===(a=v[0].f7VirtualListIndex)&&(a=v.attr("data-virtual-list-index")):void 0===(a=u[0].f7VirtualListIndex)&&(a=u.attr("data-virtual-list-index")),a=null!==a?parseInt(a,10):void 0;var s=l[0].f7VirtualList;s&&s.moveItem(f,a)}void 0===a||Number.isNaN(a)||a===f||(r.trigger("sortable:sort",{from:f,to:a}),T.emit("sortableSort",r[0],{from:f,to:a})),v=void 0,u=void 0,t=!1,e=!1})},enable:function(t){void 0===t&&(t=".list.sortable");var e=s(t);0!==e.length&&(e.addClass("sortable-enabled"),e.trigger("sortable:enable"),this.emit("sortableEnable",e[0]))},disable:function(t){void 0===t&&(t=".list.sortable");var e=s(t);0!==e.length&&(e.removeClass("sortable-enabled"),e.trigger("sortable:disable"),this.emit("sortableDisable",e[0]))},toggle:function(t){void 0===t&&(t=".list.sortable");var e=s(t);0!==e.length&&(e.hasClass("sortable-enabled")?this.sortable.disable(e):this.sortable.enable(e))}}),r={name:"sortable",params:{sortable:{moveElements:!0}},create:function(){o.extend(this,{sortable:{init:i.init.bind(this),enable:i.enable.bind(this),disable:i.disable.bind(this),toggle:i.toggle.bind(this)}})},on:{init:function(){this.params.sortable&&this.sortable.init()}},clicks:{".sortable-enable":function(t,e){void 0===e&&(e={});this.sortable.enable(e.sortable)},".sortable-disable":function(t,e){void 0===e&&(e={});this.sortable.disable(e.sortable)},".sortable-toggle":function(t,e){void 0===e&&(e={});this.sortable.toggle(e.sortable)}}};if(e){if(t.prototype.modules&&t.prototype.modules[r.name])return;t.use(r),t.instance&&(t.instance.useModuleParams(r,t.instance.params),t.instance.useModule(r))}return r}(Framework7, typeof Framework7AutoInstallComponent === 'undefined' ? undefined : Framework7AutoInstallComponent))
