pac-slider
Version:

3 lines (2 loc) • 37.6 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/router")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/router"],e):e(t["pac-slider"]={},t.ng.core,t.ng.common,t.ng.router)}(this,function(t,e,n,i){"use strict";var r=function(){return function(t){this.viewContainerRef=t}}();r.decorators=[{type:e.Directive,args:[{selector:"[slideZone]"}]}],r.ctorParameters=function(){return[{type:e.ViewContainerRef}]};var s=function(){function t(t,e){this.el=t,this.renderer=e}return t.prototype.slide=function(t,e){void 0===e&&(e=null),this.renderer.addClass(this.el.nativeElement,"delay"),this.renderer.setStyle(this.el.nativeElement,"transform","translate3d("+t+"px, 0, 0)")},t.prototype.stabilizes=function(t){this.renderer.removeClass(this.el.nativeElement,"delay"),this.renderer.setStyle(this.el.nativeElement,"transform","translate3d("+t+"px, 0, 0)")},t}();s.decorators=[{type:e.Component,args:[{selector:"pac-carousel-slide",template:'\n <ng-container *ngIf="!route ">\n <a [href]="link?link:\'#\'">\n <img [src]="src" draggable="false">\n </a>\n </ng-container>\n\n <ng-container *ngIf="route">\n <a [routerLink]="route">\n <img [src]="src" draggable="false">\n </a>\n </ng-container>\n <div class="image-overlay"></div>\n ',styles:["\n :host {\n min-width: 100%;\n width: 100%;\n height: 100%;\n display: inline-table;\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n text-transform: uppercase;\n position: relative;\n cursor: pointer;\n -ms-flex-align: end;\n -webkit-box-align: end;\n align-items: flex-end;\n -ms-flex-line-pack: end;\n align-content: flex-end; }\n :host.delay {\n -webkit-transition: transform .7s ease-in-out;\n -webkit-transition: -webkit-transform .7s ease-in-out;\n transition: -webkit-transform .7s ease-in-out;\n transition: transform .7s ease-in-out;\n transition: transform .7s ease-in-out, -webkit-transform .7s ease-in-out; }\n :host img {\n width: 100%; }\n :host .image-overlay {\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0; }\n "]}]}],s.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2}]},s.propDecorators={src:[{type:e.Input}],link:[{type:e.Input}],route:[{type:e.Input}]};var o="available",a=function(){function t(t){this.componentFactoryResolver=t,this.autoPlay=!0,this.time=4,this.slides=[],this.carouselSlides=[],this.x=0,this.startX=0,this.state=o,this.lastOffset=0,this.index=0}return t.prototype.ngAfterContentInit=function(){var t=this;this.initialWindowWidth=window.innerWidth,this.viewContainerRef=this.slideZone.viewContainerRef,this.lastOffset-=this.sliderContainer.nativeElement.getBoundingClientRect().width;var e=this.createComponent(this.slides[this.slides.length-1]);this.carouselSlides.push(e),this.slides.forEach(function(e,n){if(n!=t.slides.length-1){var i=t.createComponent(e);t.carouselSlides.push(i)}}),this.autoPlay&&(this.interval=setInterval(function(){t.pause||t.slideForward()},1e3*this.time))},t.prototype.createComponent=function(t){var e=this.componentFactoryResolver.resolveComponentFactory(s),n=this.viewContainerRef.createComponent(e);return n.instance.src=t.src,n.instance.route=t.route,n.instance.link=t.link,n.instance.stabilizes(this.lastOffset),n.instance},t.prototype.ngOnDestroy=function(){this.interval&&clearInterval(this.interval)},t.prototype.addSlideData=function(t){this.slides.push(t)},t.prototype.removeSlide=function(t){},t.prototype.onResize=function(t){var e=this;this.lastOffset=0-this.sliderContainer.nativeElement.getBoundingClientRect().width,this.carouselSlides.forEach(function(t){t.stabilizes(e.lastOffset)})},t.prototype.pauseAutoPlay=function(){this.pause=!0},t.prototype.startAutoPlay=function(){this.pause=!1},t.prototype.onPanStart=function(t){t.preventDefault(),this.startX=this.x},t.prototype.onPan=function(t){var e=this;t.preventDefault(),this.x=this.startX+t.deltaX,this.state===o&&this.carouselSlides.forEach(function(t){t.stabilizes(e.lastOffset+e.x)})},t.prototype.onPanEnd=function(){var t=100*Math.abs(this.x)/this.sliderContainer.nativeElement.getBoundingClientRect().width;t=Math.abs(100-t),this.x<0?this.slideForward(t):this.slideBack(t),this.x=0},t.prototype.slideBack=function(t){var e=this;void 0===t&&(t=null),this.state===o&&(this.state="idle",this.lastOffset+=this.sliderContainer.nativeElement.getBoundingClientRect().width,this.carouselSlides.forEach(function(n){n.slide(e.lastOffset,t)}),setTimeout(function(){var t=e.viewContainerRef.get(e.carouselSlides.length-1);e.viewContainerRef.move(t,0),e.lastOffset-=e.sliderContainer.nativeElement.getBoundingClientRect().width,e.carouselSlides.forEach(function(t){t.stabilizes(e.lastOffset)}),e.state=o,e.index--,e.index<0&&(e.index=e.slides.length-1)},720),setTimeout(function(){e.pause=!1},1e3*this.time))},t.prototype.slideForward=function(t){var e=this;void 0===t&&(t=null),this.state===o&&(this.state="idle",this.lastOffset-=this.sliderContainer.nativeElement.getBoundingClientRect().width,this.carouselSlides.forEach(function(n){n.slide(e.lastOffset,t)}),setTimeout(function(){var t=e.viewContainerRef.get(0);e.viewContainerRef.move(t,e.carouselSlides.length-1),e.lastOffset=0-e.sliderContainer.nativeElement.getBoundingClientRect().width,e.carouselSlides.forEach(function(t){t.stabilizes(e.lastOffset)}),e.state=o,e.index++,e.index>e.slides.length-1&&(e.index=0)},720))},t.prototype.slideToIndex=function(t){var e=this;t>this.index?(console.log("Index:"),console.log(t),console.log("This index:"),console.log(this.index),this.state===o&&(this.state="idle",this.lastOffset-=this.sliderContainer.nativeElement.getBoundingClientRect().width,this.carouselSlides.forEach(function(t){t.slide(e.lastOffset)}),setTimeout(function(){var t=e.viewContainerRef.get(e.index);e.viewContainerRef.move(t,e.carouselSlides.length-1),e.lastOffset=0-e.sliderContainer.nativeElement.getBoundingClientRect().width,e.carouselSlides.forEach(function(t){t.stabilizes(e.lastOffset)}),e.state=o,e.index++,e.index>e.slides.length-1&&(e.index=0)},720))):t<this.index&&(console.log("Index:"),console.log(t),console.log("This index:"),console.log(this.index),this.state===o&&(this.state="idle",this.lastOffset+=this.sliderContainer.nativeElement.getBoundingClientRect().width,this.carouselSlides.forEach(function(t){t.slide(e.lastOffset)}),setTimeout(function(){var t=e.viewContainerRef.get(e.carouselSlides.length-1);e.viewContainerRef.move(t,0),e.lastOffset-=e.sliderContainer.nativeElement.getBoundingClientRect().width,e.carouselSlides.forEach(function(t){t.stabilizes(e.lastOffset)}),e.state=o,e.index--,e.index<0&&(e.index=e.slides.length-1)},720),setTimeout(function(){e.pause=!1},1e3*this.time)))},t}();a.decorators=[{type:e.Component,args:[{selector:"pac-slider",template:'\n <div class="carousel-container" #sliderContainer>\n\n \x3c!-- Left Arrow Container --\x3e\n <div class="arrow left-arrow"\n (click)="slideBack()"\n (mouseenter)="pauseAutoPlay()">\n <div class="arrow-wrapper">\n <div id="left-arrow"></div>\n </div>\n </div>\n\n \x3c!-- Slider Zone --\x3e\n <div class="slides-zone" #slidesZone>\n <ng-content></ng-content>\n <div class="images-container"\n (mouseenter)="pauseAutoPlay()"\n (mouseleave)="startAutoPlay()"\n (panstart)="onPanStart($event)"\n (panmove)="onPan($event)"\n (panend)="onPanEnd()"\n #slideImg>\n <ng-template slideZone>\n\n </ng-template>\n </div>\n </div>\n\n \x3c!-- Dots Container --\x3e\n <div class="dots-container">\n <ul (mouseenter)="pauseAutoPlay()"\n (mouseleave)="startAutoPlay()">\n <li *ngFor="let dot of slides;let i = index;"\n (click)="slideToIndex(i)"\n [ngClass]="{selected: i == index}">\n </li>\n </ul>\n </div>\n\n \x3c!-- Right Arrow Container --\x3e\n <div class="arrow right-arrow"\n (click)="slideForward()"\n (mouseenter)="pauseAutoPlay()">\n <div class="arrow-wrapper">\n <div id="right-arrow"></div>\n </div>\n </div>\n\n </div>\n ',styles:["\n .carousel-container {\n width: 100%;\n max-height: 100vh;\n overflow: hidden;\n position: relative; }\n .carousel-container .images-container {\n width: 100%;\n display: -ms-flexbox;\n display: -webkit-box;\n display: flex;\n -ms-flex: 1;\n -webkit-box-flex: 1;\n flex: 1;\n -ms-flex-align: center;\n -webkit-box-align: center;\n align-items: center;\n -ms-flex-pack: start;\n -webkit-box-pack: start;\n justify-content: flex-start;\n -webkit-transition: all 300ms cubic-bezier(0.35, 0, 0.25, 1);\n transition: all 300ms cubic-bezier(0.35, 0, 0.25, 1); }\n .carousel-container .arrow {\n z-index: 2;\n position: absolute;\n top: 0;\n height: 100%;\n width: 6%;\n min-width: 60px;\n display: -ms-flexbox;\n display: -webkit-box;\n display: flex;\n -ms-flex-direction: row;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n flex-direction: row;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n -ms-flex-pack: center;\n -webkit-box-pack: center;\n justify-content: center;\n -ms-flex-line-pack: stretch;\n align-content: stretch;\n -ms-flex-align: center;\n -webkit-box-align: center;\n align-items: center; }\n .carousel-container .arrow .arrow-wrapper {\n position: relative;\n width: 20px;\n height: 20px;\n -ms-flex-order: 0;\n -webkit-box-ordinal-group: 1;\n order: 0;\n -ms-flex: 0 1 auto;\n -webkit-box-flex: 0;\n flex: 0 1 auto;\n -webkit-align-self: auto;\n -ms-flex-item-align: auto;\n align-self: auto; }\n .carousel-container .arrow .arrow-wrapper #right-arrow {\n position: absolute;\n height: 20px;\n width: 20px;\n /* IE 9 */\n -webkit-transform: rotate(45deg);\n /* Chrome, Safari, Opera */\n transform: rotate(45deg);\n border-right: 2px solid #ffffff;\n border-top: 2px solid #ffffff; }\n .carousel-container .arrow .arrow-wrapper #left-arrow {\n position: absolute;\n height: 20px;\n width: 20px;\n /* IE 9 */\n -webkit-transform: rotate(45deg);\n /* Chrome, Safari, Opera */\n transform: rotate(45deg);\n border-left: 2px solid #ffffff;\n border-bottom: 2px solid #ffffff; }\n .carousel-container .arrow.left-arrow {\n left: 0;\n cursor: pointer; }\n .carousel-container .arrow.right-arrow {\n right: 0;\n cursor: pointer; }\n .carousel-container .dots-container {\n z-index: 2;\n position: absolute;\n bottom: 0;\n height: 10%;\n width: 100%;\n display: -ms-flexbox;\n display: -webkit-box;\n display: flex;\n -ms-flex-direction: row;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n flex-direction: row;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n -ms-flex-pack: center;\n -webkit-box-pack: center;\n justify-content: center;\n -ms-flex-line-pack: stretch;\n align-content: stretch;\n -ms-flex-align: center;\n -webkit-box-align: center;\n align-items: center; }\n .carousel-container .dots-container ul {\n list-style-type: none;\n margin: 0;\n padding: 0;\n overflow: hidden; }\n .carousel-container .dots-container ul li {\n cursor: pointer;\n height: 10px;\n width: 10px;\n background: #fff;\n border-radius: 100%;\n margin: 5px;\n display: inline-table;\n opacity: .5; }\n .carousel-container .dots-container ul li.selected {\n opacity: 1; }\n "]}]}],a.ctorParameters=function(){return[{type:e.ComponentFactoryResolver}]},a.propDecorators={autoPlay:[{type:e.Input}],time:[{type:e.Input}],slidesZone:[{type:e.ViewChild,args:["slidesZone"]}],sliderContainer:[{type:e.ViewChild,args:["sliderContainer"]}],slideZone:[{type:e.ViewChild,args:[r]}],onResize:[{type:e.HostListener,args:["window:resize",["$event"]]}]};var l=function(){function t(t){this.parent=t,t.addSlideData(this)}return t.prototype.ngOnInit=function(){},t.prototype.ngOnDestroy=function(){this.parent.removeSlide(this)},t}();l.decorators=[{type:e.Component,args:[{selector:"pac-item",template:"\n\n ",styles:["\n\n "]}]}],l.ctorParameters=function(){return[{type:a}]},l.propDecorators={src:[{type:e.Input}],link:[{type:e.Input}],route:[{type:e.Input}]};!function(t,e){e={exports:{}},t(e,e.exports),e.exports}(function(t){!function(e,n,i,r){function s(t,e,n){return setTimeout(u(t,n),e)}function o(t,e,n){return!!Array.isArray(t)&&(a(t,n[e],n),!0)}function a(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==r)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function l(t,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=e.console&&(e.console.warn||e.console.log);return s&&s.call(e.console,r,i),t.apply(this,arguments)}}function c(t,e,n){var i,r=e.prototype;(i=t.prototype=Object.create(r)).constructor=t,i._super=r,n&&ht(i,n)}function u(t,e){return function(){return t.apply(e,arguments)}}function h(t,e){return typeof t==ft?t.apply(e?e[0]||r:r,e):t}function p(t,e){return t===r?e:t}function d(t,e,n){a(g(e),function(e){t.addEventListener(e,n,!1)})}function f(t,e,n){a(g(e),function(e){t.removeEventListener(e,n,!1)})}function m(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function v(t,e){return t.indexOf(e)>-1}function g(t){return t.trim().split(/\s+/g)}function y(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}function w(t){return Array.prototype.slice.call(t,0)}function x(t,e,n){for(var i=[],r=[],s=0;s<t.length;){var o=e?t[s][e]:t[s];y(r,o)<0&&i.push(t[s]),r[s]=o,s++}return n&&(i=e?i.sort(function(t,n){return t[e]>n[e]}):i.sort()),i}function T(t,e){for(var n,i,s=e[0].toUpperCase()+e.slice(1),o=0;o<pt.length;){if(n=pt[o],(i=n?n+s:e)in t)return i;o++}return r}function b(){return xt++}function E(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}function C(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){h(t.options.enable,[t])&&n.handler(e)},this.init()}function S(t){var e=t.options.inputClass;return new(e||(bt?H:Et?L:Tt?B:X))(t,I)}function I(t,e,n){var i=n.pointers.length,r=n.changedPointers.length,s=e&St&&i-r==0,o=e&(Pt|kt)&&i-r==0;n.isFirst=!!s,n.isFinal=!!o,s&&(t.session={}),n.eventType=e,P(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function P(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=A(e)),r>1&&!n.firstMultiple?n.firstMultiple=A(e):1===r&&(n.firstMultiple=!1);var s=n.firstInput,o=n.firstMultiple,a=o?o.center:s.center,l=e.center=O(i);e.timeStamp=gt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=M(a,l),e.distance=_(a,l),k(n,e),e.offsetDirection=z(e.deltaX,e.deltaY);var c=D(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=vt(c.x)>vt(c.y)?c.x:c.y,e.scale=o?F(o.pointers,i):1,e.rotation=o?N(o.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,R(n,e);var u=t.element;m(e.srcEvent.target,u)&&(u=e.srcEvent.target),e.target=u}function k(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},s=t.prevInput||{};e.eventType!==St&&s.eventType!==Pt||(r=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}function R(t,e){var n,i,s,o,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=kt&&(l>Ct||a.velocity===r)){var c=e.deltaX-a.deltaX,u=e.deltaY-a.deltaY,h=D(l,c,u);i=h.x,s=h.y,n=vt(h.x)>vt(h.y)?h.x:h.y,o=z(c,u),t.lastInterval=e}else n=a.velocity,i=a.velocityX,s=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=i,e.velocityY=s,e.direction=o}function A(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:mt(t.pointers[n].clientX),clientY:mt(t.pointers[n].clientY)},n++;return{timeStamp:gt(),pointers:e,center:O(e),deltaX:t.deltaX,deltaY:t.deltaY}}function O(t){var e=t.length;if(1===e)return{x:mt(t[0].clientX),y:mt(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:mt(n/e),y:mt(i/e)}}function D(t,e,n){return{x:e/t||0,y:n/t||0}}function z(t,e){return t===e?Rt:vt(t)>=vt(e)?t<0?At:Ot:e<0?Dt:zt}function _(t,e,n){n||(n=Ft);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function M(t,e,n){n||(n=Ft);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function N(t,e){return M(e[1],e[0],Xt)+M(t[1],t[0],Xt)}function F(t,e){return _(e[0],e[1],Xt)/_(t[0],t[1],Xt)}function X(){this.evEl=Yt,this.evWin=Wt,this.pressed=!1,C.apply(this,arguments)}function H(){this.evEl=Bt,this.evWin=Vt,C.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Y(){this.evTarget=Ut,this.evWin=Zt,this.started=!1,C.apply(this,arguments)}function W(t,e){var n=w(t.touches),i=w(t.changedTouches);return e&(Pt|kt)&&(n=x(n.concat(i),"identifier",!0)),[n,i]}function L(){this.evTarget=$t,this.targetIds={},C.apply(this,arguments)}function q(t,e){var n=w(t.touches),i=this.targetIds;if(e&(St|It)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,s,o=w(t.changedTouches),a=[],l=this.target;if(s=n.filter(function(t){return m(t.target,l)}),e===St)for(r=0;r<s.length;)i[s[r].identifier]=!0,r++;for(r=0;r<o.length;)i[o[r].identifier]&&a.push(o[r]),e&(Pt|kt)&&delete i[o[r].identifier],r++;return a.length?[x(s.concat(a),"identifier",!0),a]:void 0}function B(){C.apply(this,arguments);var t=u(this.handler,this);this.touch=new L(this.manager,t),this.mouse=new X(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function V(t,e){t&St?(this.primaryTouch=e.changedPointers[0].identifier,j.call(this,e)):t&(Pt|kt)&&j.call(this,e)}function j(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var i=this.lastTouches;setTimeout(function(){var t=i.indexOf(n);t>-1&&i.splice(t,1)},Kt)}}function U(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],s=Math.abs(e-r.x),o=Math.abs(n-r.y);if(s<=Jt&&o<=Jt)return!0}return!1}function Z(t,e){this.manager=t,this.set(e)}function G(t){if(v(t,ie))return ie;var e=v(t,re),n=v(t,se);return e&&n?ie:e||n?e?re:se:v(t,ne)?ne:ee}function $(t){this.options=ht({},this.defaults,t||{}),this.id=b(),this.manager=null,this.options.enable=p(this.options.enable,!0),this.state=ae,this.simultaneous={},this.requireFail=[]}function K(t){return t&pe?"cancel":t&ue?"end":t&ce?"move":t&le?"start":""}function J(t){return t==zt?"down":t==Dt?"up":t==At?"left":t==Ot?"right":""}function Q(t,e){var n=e.manager;return n?n.get(t):t}function tt(){$.apply(this,arguments)}function et(){tt.apply(this,arguments),this.pX=null,this.pY=null}function nt(){tt.apply(this,arguments)}function it(){$.apply(this,arguments),this._timer=null,this._input=null}function rt(){tt.apply(this,arguments)}function st(){tt.apply(this,arguments)}function ot(){$.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function at(t,e){return e=e||{},e.recognizers=p(e.recognizers,at.defaults.preset),new lt(t,e)}function lt(t,e){this.options=ht({},at.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=S(this),this.touchAction=new Z(this,this.options.touchAction),ct(this,!0),a(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function ct(t,e){var n=t.element;if(n.style){var i;a(t.options.cssProps,function(r,s){i=T(n.style,s),e?(t.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={})}}function ut(t,e){var i=n.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}var ht,pt=["","webkit","Moz","MS","ms","o"],dt=n.createElement("div"),ft="function",mt=Math.round,vt=Math.abs,gt=Date.now;ht="function"!=typeof Object.assign?function(t){if(t===r||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==r&&null!==i)for(var s in i)i.hasOwnProperty(s)&&(e[s]=i[s])}return e}:Object.assign;var yt=l(function(t,e,n){for(var i=Object.keys(e),s=0;s<i.length;)(!n||n&&t[i[s]]===r)&&(t[i[s]]=e[i[s]]),s++;return t},"extend","Use `assign`."),wt=l(function(t,e){return yt(t,e,!0)},"merge","Use `assign`."),xt=1,Tt="ontouchstart"in e,bt=T(e,"PointerEvent")!==r,Et=Tt&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),Ct=25,St=1,It=2,Pt=4,kt=8,Rt=1,At=2,Ot=4,Dt=8,zt=16,_t=At|Ot,Mt=Dt|zt,Nt=_t|Mt,Ft=["x","y"],Xt=["clientX","clientY"];C.prototype={handler:function(){},init:function(){this.evEl&&d(this.element,this.evEl,this.domHandler),this.evTarget&&d(this.target,this.evTarget,this.domHandler),this.evWin&&d(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&f(this.element,this.evEl,this.domHandler),this.evTarget&&f(this.target,this.evTarget,this.domHandler),this.evWin&&f(E(this.element),this.evWin,this.domHandler)}};var Ht={mousedown:St,mousemove:It,mouseup:Pt},Yt="mousedown",Wt="mousemove mouseup";c(X,C,{handler:function(t){var e=Ht[t.type];e&St&&0===t.button&&(this.pressed=!0),e&It&&1!==t.which&&(e=Pt),this.pressed&&(e&Pt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var Lt={pointerdown:St,pointermove:It,pointerup:Pt,pointercancel:kt,pointerout:kt},qt={2:"touch",3:"pen",4:"mouse",5:"kinect"},Bt="pointerdown",Vt="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Bt="MSPointerDown",Vt="MSPointerMove MSPointerUp MSPointerCancel"),c(H,C,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=Lt[i],s=qt[t.pointerType]||t.pointerType,o="touch"==s,a=y(e,t.pointerId,"pointerId");r&St&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):r&(Pt|kt)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),n&&e.splice(a,1))}});var jt={touchstart:St,touchmove:It,touchend:Pt,touchcancel:kt},Ut="touchstart",Zt="touchstart touchmove touchend touchcancel";c(Y,C,{handler:function(t){var e=jt[t.type];if(e===St&&(this.started=!0),this.started){var n=W.call(this,t,e);e&(Pt|kt)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var Gt={touchstart:St,touchmove:It,touchend:Pt,touchcancel:kt},$t="touchstart touchmove touchend touchcancel";c(L,C,{handler:function(t){var e=Gt[t.type],n=q.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}});var Kt=2500,Jt=25;c(B,C,{handler:function(t,e,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)V.call(this,e,n);else if(r&&U.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Qt=T(dt.style,"touchAction"),te=Qt!==r,ee="auto",ne="manipulation",ie="none",re="pan-x",se="pan-y",oe=function(){if(!te)return!1;var t={},n=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){t[i]=!n||e.CSS.supports("touch-action",i)}),t}();Z.prototype={set:function(t){"compute"==t&&(t=this.compute()),te&&this.manager.element.style&&oe[t]&&(this.manager.element.style[Qt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return a(this.manager.recognizers,function(e){h(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),G(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,r=v(i,ie)&&!oe[ie],s=v(i,se)&&!oe[se],o=v(i,re)&&!oe[re];if(r){var a=1===t.pointers.length,l=t.distance<2,c=t.deltaTime<250;if(a&&l&&c)return}if(!o||!s)return r||s&&n&_t||o&&n&Mt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var ae=1,le=2,ce=4,ue=8,he=ue,pe=16;$.prototype={defaults:{},set:function(t){return ht(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(o(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=Q(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return o(t,"dropRecognizeWith",this)?this:(t=Q(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(o(t,"requireFailure",this))return this;var e=this.requireFail;return t=Q(t,this),-1===y(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(o(t,"dropRequireFailure",this))return this;t=Q(t,this);var e=y(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,i=this.state;i<ue&&e(n.options.event+K(i)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),i>=ue&&e(n.options.event+K(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|ae)))return!1;t++}return!0},recognize:function(t){var e=ht({},t);if(!h(this.options.enable,[this,e]))return this.reset(),void(this.state=32);this.state&(he|pe|32)&&(this.state=ae),this.state=this.process(e),this.state&(le|ce|ue|pe)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},c(tt,$,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,i=e&(le|ce),r=this.attrTest(t);return i&&(n&kt||!r)?e|pe:i||r?n&Pt?e|ue:e&le?e|ce:le:32}}),c(et,tt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Nt},getTouchAction:function(){var t=this.options.direction,e=[];return t&_t&&e.push(se),t&Mt&&e.push(re),e},directionTest:function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,s=t.deltaX,o=t.deltaY;return r&e.direction||(e.direction&_t?(r=0===s?Rt:s<0?At:Ot,n=s!=this.pX,i=Math.abs(t.deltaX)):(r=0===o?Rt:o<0?Dt:zt,n=o!=this.pY,i=Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},attrTest:function(t){return tt.prototype.attrTest.call(this,t)&&(this.state&le||!(this.state&le)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=J(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),c(nt,tt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ie]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&le)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),c(it,$,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ee]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!i||!n||t.eventType&(Pt|kt)&&!r)this.reset();else if(t.eventType&St)this.reset(),this._timer=s(function(){this.state=he,this.tryEmit()},e.time,this);else if(t.eventType&Pt)return he;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===he&&(t&&t.eventType&Pt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=gt(),this.manager.emit(this.options.event,this._input)))}}),c(rt,tt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ie]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&le)}}),c(st,tt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:_t|Mt,pointers:1},getTouchAction:function(){return et.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(_t|Mt)?e=t.overallVelocity:n&_t?e=t.overallVelocityX:n&Mt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&vt(e)>this.options.velocity&&t.eventType&Pt},emit:function(t){var e=J(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),c(ot,$,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ne]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&St&&0===this.count)return this.failTimeout();if(i&&r&&n){if(t.eventType!=Pt)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||_(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=s(function(){this.state=he,this.tryEmit()},e.interval,this),le):he}return 32},failTimeout:function(){return this._timer=s(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==he&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),at.VERSION="2.0.7",at.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[rt,{enable:!1}],[nt,{enable:!1},["rotate"]],[st,{direction:_t}],[et,{direction:_t},["swipe"]],[ot],[ot,{event:"doubletap",taps:2},["tap"]],[it]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};lt.prototype={set:function(t){return ht(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var n,i=this.recognizers,r=e.curRecognizer;(!r||r&&r.state&he)&&(r=e.curRecognizer=null);for(var s=0;s<i.length;)n=i[s],2===e.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(t),!r&&n.state&(le|ce|ue)&&(r=e.curRecognizer=n),s++}},get:function(t){if(t instanceof $)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(o(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(o(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=y(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==r&&e!==r){var n=this.handlers;return a(g(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this}},off:function(t,e){if(t!==r){var n=this.handlers;return a(g(t),function(t){e?n[t]&&n[t].splice(y(n[t],e),1):delete n[t]}),this}},emit:function(t,e){this.options.domEvents&&ut(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var i=0;i<n.length;)n[i](e),i++}},destroy:function(){this.element&&ct(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ht(at,{INPUT_START:St,INPUT_MOVE:It,INPUT_END:Pt,INPUT_CANCEL:kt,STATE_POSSIBLE:ae,STATE_BEGAN:le,STATE_CHANGED:ce,STATE_ENDED:ue,STATE_RECOGNIZED:he,STATE_CANCELLED:pe,STATE_FAILED:32,DIRECTION_NONE:Rt,DIRECTION_LEFT:At,DIRECTION_RIGHT:Ot,DIRECTION_UP:Dt,DIRECTION_DOWN:zt,DIRECTION_HORIZONTAL:_t,DIRECTION_VERTICAL:Mt,DIRECTION_ALL:Nt,Manager:lt,Input:C,TouchAction:Z,TouchInput:L,MouseInput:X,PointerEventInput:H,TouchMouseInput:B,SingleTouchInput:Y,Recognizer:$,AttrRecognizer:tt,Tap:ot,Pan:et,Swipe:st,Pinch:nt,Rotate:rt,Press:it,on:d,off:f,each:a,merge:wt,extend:yt,assign:ht,inherit:c,bindFn:u,prefixed:T}),(void 0!==e?e:"undefined"!=typeof self?self:{}).Hammer=at,"function"==typeof r&&r.amd?r(function(){return at}):t.exports?t.exports=at:e.Hammer=at}(window,document)});!function(){var t=window.MutationObserver||window.WebKitMutationObserver,e="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch;if(!(document.documentElement.style["touch-action"]!==undefined||document.documentElement.style["-ms-touch-action"])&&e&&t){window.Hammer=window.Hammer||{};var n=/touch-action[:][\s]*(none)[^;'"]*/,i=/touch-action[:][\s]*(manipulation)[^;'"]*/,r=/touch-action/,s=/(iP(ad|hone|od))/.test(navigator.userAgent)&&("indexedDB"in window||!!window.performance);window.Hammer.time={getTouchAction:function(t){return this.checkStyleString(t.getAttribute("style"))},checkStyleString:function(t){return r.test(t)?n.test(t)?"none":!i.test(t)||"manipulation":undefined},shouldHammer:function(t){var e=t.target.hasParent;return!(!e||s&&!(Date.now()-t.target.lastStart<125))&&e},touchHandler:function(t){var e=this.shouldHammer(t);if("none"===e)this.dropHammer(t);else if("manipulation"===e){var n=t.target.getBoundingClientRect();!(n.top!==this.pos.top||n.left!==this.pos.left)&&this.dropHammer(t)}this.scrolled=!1,delete t.target.lastStart,delete t.target.hasParent},dropHammer:function(t){"touchend"===t.type&&(t.target.focus(),setTimeout(function(){t.target.click()},0)),t.preventDefault()},touchStart:function(t){this.pos=t.target.getBoundingClientRect(),t.target.hasParent=this.hasParent(t.target),s&&t.target.hasParent&&(t.target.lastStart=Date.now())},styleWatcher:function(t){t.forEach(this.styleUpdater,this)},styleUpdater:function(t){if(t.target.updateNext)t.target.updateNext=!1;else{var e=this.getTouchAction(t.target);e?"none"!==e&&(t.target.hadTouchNone=!1):!e&&(t.oldValue&&this.checkStyleString(t.oldValue)||t.target.hadTouchNone)&&(t.target.hadTouchNone=!0,t.target.updateNext=!1,t.target.setAttribute("style",t.target.getAttribute("style")+" touch-action: none;"))}},hasParent:function(t){for(var e,n=t;n&&n.parentNode;n=n.parentNode)if(e=this.getTouchAction(n))return e;return!1},installStartEvents:function(){document.addEventListener("touchstart",this.touchStart.bind(this)),document.addEventListener("mousedown",this.touchStart.bind(this))},installEndEvents:function(){document.addEventListener("touchend",this.touchHandler.bind(this),!0),document.addEventListener("mouseup",this.touchHandler.bind(this),!0)},installObserver:function(){this.observer=new t(this.styleWatcher.bind(this)).observe(document,{subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["style"]})},install:function(){this.installEndEvents(),this.installStartEvents(),this.installObserver()}},window.Hammer.time.install()}}();var c=function(){return function(){}}();c.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.RouterModule],declarations:[a,l,s,r],entryComponents:[s],exports:[a,l]}]}],c.ctorParameters=function(){return[]},t.PacSliderModule=c,t.ɵc=l,t.ɵd=s,t.ɵa=a,t.ɵb=r,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=pac-slider.umd.min.js.map