@ngx-gallery/core
Version:
Angular gallery directive that hooks the lightbox with the images automatically.
2 lines • 46.3 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/animations"),require("@angular/common/http"),require("@angular/platform-browser"),require("@angular/common"),require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@ngx-gallery/core",["exports","@angular/animations","@angular/common/http","@angular/platform-browser","@angular/common","@angular/core","rxjs","rxjs/operators"],e):e((t["ngx-gallery"]=t["ngx-gallery"]||{},t["ngx-gallery"].core={}),t.ng.animations,t.ng.common.http,t.ng.platformBrowser,t.ng.common,t.ng.core,t.rxjs,t.rxjs.operators)}(this,function(t,e,i,n,r,o,a,s){"use strict";var l=function(){return(l=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function c(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(n=o.next()).done;)a.push(n.value)}catch(s){r={error:s}}finally{try{n&&!n.done&&(i=o["return"])&&i.call(o)}finally{if(r)throw r.error}}return a}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t}var g={INITIALIZED:"initialized",ITEMS_CHANGED:"itemsChanged",INDEX_CHANGED:"indexChanged",PLAY:"play",STOP:"stop"},h={Cover:"cover",Contain:"contain"},u={Preload:"preload",Lazy:"lazy",Default:"default"},d={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},m={Top:"top",Bottom:"bottom"},f={Top:"top",Bottom:"bottom"},y={Free:"free",Strict:"strict"},b={Horizontal:"horizontal",Vertical:"vertical"},v={Image:"image",Video:"video",Youtube:"youtube",Iframe:"iframe"},I={action:g.INITIALIZED,isPlaying:!1,hasNext:!1,hasPrev:!1,currIndex:0,items:[]},x={nav:!0,loop:!0,zoomOut:0,dots:!1,thumb:!0,dotsSize:30,counter:!0,gestures:!0,autoPlay:!1,thumbWidth:120,thumbHeight:90,panSensitivity:25,disableThumb:!1,playerInterval:3e3,imageSize:h.Contain,thumbMode:y.Strict,dotsPosition:m.Bottom,counterPosition:f.Top,thumbPosition:d.Bottom,loadingStrategy:u.Default,slidingDirection:b.Horizontal,navIcon:'<?xml version="1.0" encoding="UTF-8"?><svg width="512px" height="512px" enable-background="new 0 0 240.823 240.823" version="1.1" viewBox="0 0 240.823 240.823" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m183.19 111.82l-108.3-108.26c-4.752-4.74-12.451-4.74-17.215 0-4.752 4.74-4.752 12.439 0 17.179l99.707 99.671-99.695 99.671c-4.752 4.74-4.752 12.439 0 17.191 4.752 4.74 12.463 4.74 17.215 0l108.3-108.26c4.68-4.691 4.68-12.511-0.012-17.19z" fill="#fff"/></svg>',loadingIcon:'<?xml version="1.0" encoding="UTF-8"?><svg stroke="#fff" viewBox="0 0 44 44" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke-width="2"><circle cx="22" cy="22" r="1"><animate attributeName="r" begin="0s" calcMode="spline" dur="1.8s" keySplines="0.165, 0.84, 0.44, 1" keyTimes="0; 1" repeatCount="indefinite" values="1; 20"/><animate attributeName="stroke-opacity" begin="0s" calcMode="spline" dur="1.8s" keySplines="0.3, 0.61, 0.355, 1" keyTimes="0; 1" repeatCount="indefinite" values="1; 0"/></circle><circle cx="22" cy="22" r="1"><animate attributeName="r" begin="-0.9s" calcMode="spline" dur="1.8s" keySplines="0.165, 0.84, 0.44, 1" keyTimes="0; 1" repeatCount="indefinite" values="1; 20"/><animate attributeName="stroke-opacity" begin="-0.9s" calcMode="spline" dur="1.8s" keySplines="0.3, 0.61, 0.355, 1" keyTimes="0; 1" repeatCount="indefinite" values="1; 0"/></circle></g></svg>'},C=function(t){this.data=t,this.type=v.Image},_=function(t){this.data=t,this.type=v.Video},S=function(t){this.data=t,this.type=v.Iframe},w=function(t){this.data={src:"//youtube.com/embed/"+t.src+"?wmode=transparent",thumb:t.thumb?t.thumb:"//img.youtube.com/vi/"+t.src+"/default.jpg"},this.type=v.Youtube},P=function(e){return s.filter(function(t){return-1<e.indexOf(t.action)})},E=function(){function t(t,e){this.deleteInstance=e,this.itemClick=new a.Subject,this.thumbClick=new a.Subject,this.error=new a.Subject,this._state=new a.BehaviorSubject(I),this._config=new a.BehaviorSubject(t),this.state=this._state.asObservable(),this.config=this._config.asObservable()}return Object.defineProperty(t.prototype,"initialized",{get:function(){return this.state.pipe(P([g.INITIALIZED]))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemsChanged",{get:function(){return this.state.pipe(P([g.ITEMS_CHANGED]))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"indexChanged",{get:function(){return this.state.pipe(P([g.INDEX_CHANGED]))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"playingChanged",{get:function(){return this.state.pipe(P([g.PLAY,g.STOP]))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"playerActions",{get:function(){return this.state.pipe(P([g.PLAY,g.STOP,g.INDEX_CHANGED]))},enumerable:!0,configurable:!0}),t.prototype.activatePlayer=function(){var e=this;return this.playerActions.pipe(s.switchMap(function(t){return t.isPlaying?a.of({}).pipe(s.delay(e._config.value.playerInterval),s.tap(function(){return e.next()})):a.EMPTY}))},t.prototype.setState=function(t){this._state.next(l({},this._state.value,t))},t.prototype.setConfig=function(t){this._config.next(l({},this._config.value,t))},t.prototype.add=function(t,e){var i=p(this._state.value.items,[t]);this.setState({action:g.ITEMS_CHANGED,items:i,hasNext:1<i.length,currIndex:e?i.length-1:this._state.value.currIndex})},t.prototype.addImage=function(t,e){this.add(new C(t),e)},t.prototype.addVideo=function(t,e){this.add(new _(t),e)},t.prototype.addIframe=function(t,e){this.add(new S(t),e)},t.prototype.addYoutube=function(t,e){this.add(new w(t),e)},t.prototype.remove=function(t){var e=p(this._state.value.items.slice(0,t),this._state.value.items.slice(t+1,this._state.value.items.length));this.setState({action:g.ITEMS_CHANGED,items:e,hasNext:1<e.length,hasPrev:0<t})},t.prototype.load=function(t){t&&this.setState({action:g.ITEMS_CHANGED,items:t,hasNext:1<t.length,hasPrev:!1})},t.prototype.set=function(t){t!==this._state.value.currIndex&&this.setState({action:g.INDEX_CHANGED,currIndex:t,hasNext:t<this._state.value.items.length-1,hasPrev:0<t})},t.prototype.next=function(){this._state.value.hasNext?this.set(this._state.value.currIndex+1):this._config.value.loop&&this.set(0)},t.prototype.prev=function(){this._state.value.hasPrev?this.set(this._state.value.currIndex-1):this._config.value.loop&&this.set(this._state.value.items.length-1)},t.prototype.play=function(t){t&&this.setConfig({playerInterval:t}),this.setState({action:g.PLAY,isPlaying:!0})},t.prototype.stop=function(){this.setState({action:g.STOP,isPlaying:!1})},t.prototype.reset=function(){this.setState(I)},t.prototype.destroy=function(){this._state.complete(),this._config.complete(),this.itemClick.complete(),this.thumbClick.complete(),this.deleteInstance()},t}(),O=new o.InjectionToken("galleryConfig"),k=function(){function t(t){this._instances=new Map,this.config=t?l({},x,t):x}return t.prototype.ref=function(t,e){if(void 0===t&&(t="root"),this._instances.has(t)){var i=this._instances.get(t);return e&&i.setConfig(l({},this.config,e)),i}return this._instances.set(t,new E(l({},this.config,e),this.deleteInstance(t))).get(t)},t.prototype.destroyAll=function(){this._instances.forEach(function(t){return t.destroy()})},t.prototype.resetAll=function(){this._instances.forEach(function(t){return t.reset()})},t.prototype.deleteInstance=function(t){var e=this;return function(){e._instances.has(t)&&e._instances["delete"](t)}},t.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:o.Optional},{type:o.Inject,args:[O]}]}]},t.ngInjectableDef=o.defineInjectable({factory:function(){return new t(o.inject(O,8))},token:t,providedIn:"root"}),t}(),T=function(){function t(t){this._gallery=t,this.nav=this._gallery.config.nav,this.dots=this._gallery.config.dots,this.loop=this._gallery.config.loop,this.thumb=this._gallery.config.thumb,this.zoomOut=this._gallery.config.zoomOut,this.counter=this._gallery.config.counter,this.dotsSize=this._gallery.config.dotsSize,this.autoPlay=this._gallery.config.autoPlay,this.gestures=this._gallery.config.gestures,this.thumbWidth=this._gallery.config.thumbWidth,this.thumbHeight=this._gallery.config.thumbHeight,this.disableThumb=this._gallery.config.disableThumb,this.panSensitivity=this._gallery.config.panSensitivity,this.playerInterval=this._gallery.config.playerInterval,this.itemTemplate=this._gallery.config.itemTemplate,this.thumbTemplate=this._gallery.config.thumbTemplate,this.thumbMode=this._gallery.config.thumbMode,this.imageSize=this._gallery.config.imageSize,this.dotsPosition=this._gallery.config.dotsPosition,this.counterPosition=this._gallery.config.counterPosition,this.slidingDirection=this._gallery.config.slidingDirection,this.loadingStrategy=this._gallery.config.loadingStrategy,this.thumbPosition=this._gallery.config.thumbPosition,this.destroyRef=!0,this.skipInitConfig=!1,this.itemClick=new o.EventEmitter,this.thumbClick=new o.EventEmitter,this.playingChange=new o.EventEmitter,this.indexChange=new o.EventEmitter,this.itemsChange=new o.EventEmitter,this.error=new o.EventEmitter,this._itemClick$=a.Subscription.EMPTY,this._thumbClick$=a.Subscription.EMPTY,this._itemChange$=a.Subscription.EMPTY,this._indexChange$=a.Subscription.EMPTY,this._playingChange$=a.Subscription.EMPTY,this._playerListener$=a.Subscription.EMPTY}return t.prototype.getConfig=function(){return{nav:this.nav,dots:this.dots,loop:this.loop,thumb:this.thumb,zoomOut:this.zoomOut,counter:this.counter,autoPlay:this.autoPlay,gestures:this.gestures,dotsSize:this.dotsSize,imageSize:this.imageSize,thumbMode:this.thumbMode,thumbWidth:this.thumbWidth,thumbHeight:this.thumbHeight,disableThumb:this.disableThumb,dotsPosition:this.dotsPosition,itemTemplate:this.itemTemplate,thumbTemplate:this.thumbTemplate,thumbPosition:this.thumbPosition,panSensitivity:this.panSensitivity,playerInterval:this.playerInterval,counterPosition:this.counterPosition,loadingStrategy:this.loadingStrategy,slidingDirection:this.slidingDirection}},t.prototype.onAction=function(t){switch(t){case"next":this.galleryRef.next();break;case"prev":this.galleryRef.prev();break;default:this.galleryRef.set(t)}},t.prototype.ngOnChanges=function(t){this.galleryRef&&(this.galleryRef.setConfig(this.getConfig()),t.items&&t.items.currentValue!==t.items.previousValue&&this.load(this.items))},t.prototype.ngOnInit=function(){var e=this;this.skipInitConfig?this.galleryRef=this._gallery.ref(this.id):this.galleryRef=this._gallery.ref(this.id,this.getConfig()),this.load(this.items),this._playerListener$=this.galleryRef.activatePlayer().subscribe(),this.indexChange.observers.length&&(this._indexChange$=this.galleryRef.indexChanged.subscribe(function(t){return e.indexChange.emit(t)})),this.itemsChange.observers.length&&(this._itemChange$=this.galleryRef.itemsChanged.subscribe(function(t){return e.itemsChange.emit(t)})),this.playingChange.observers.length&&(this._playingChange$=this.galleryRef.playingChanged.subscribe(function(t){return e.playingChange.emit(t)})),this.autoPlay&&this.play()},t.prototype.ngOnDestroy=function(){this._itemClick$.unsubscribe(),this._thumbClick$.unsubscribe(),this._itemChange$.unsubscribe(),this._indexChange$.unsubscribe(),this._playingChange$.unsubscribe(),this._playerListener$.unsubscribe(),this.destroyRef&&this.galleryRef.destroy()},t.prototype.onItemClick=function(t){this.itemClick.emit(t),this.galleryRef.itemClick.next(t)},t.prototype.onThumbClick=function(t){this.galleryRef.set(t),this.thumbClick.emit(t),this.galleryRef.thumbClick.next(t)},t.prototype.onError=function(t){this.error.emit(t),this.galleryRef.error.next(t)},t.prototype.load=function(t){this.galleryRef.load(t)},t.prototype.add=function(t,e){this.galleryRef.add(t,e)},t.prototype.addImage=function(t,e){this.add(new C(t),e)},t.prototype.addVideo=function(t,e){this.add(new _(t),e)},t.prototype.addIframe=function(t,e){this.add(new S(t),e)},t.prototype.addYoutube=function(t,e){this.add(new w(t),e)},t.prototype.remove=function(t){this.galleryRef.remove(t)},t.prototype.next=function(){this.galleryRef.next()},t.prototype.prev=function(){this.galleryRef.prev()},t.prototype.set=function(t){this.galleryRef.set(t)},t.prototype.reset=function(){this.galleryRef.reset()},t.prototype.play=function(t){this.galleryRef.play(t)},t.prototype.stop=function(){this.galleryRef.stop()},t.decorators=[{type:o.Component,args:[{selector:"gallery",changeDetection:o.ChangeDetectionStrategy.OnPush,template:'\n <gallery-core [state]="galleryRef.state | async"\n [config]="galleryRef.config | async"\n (action)="onAction($event)"\n (itemClick)="onItemClick($event)"\n (thumbClick)="onThumbClick($event)"\n (error)="onError($event)"></gallery-core>\n <ng-content></ng-content>\n ',styles:['::ng-deep gallery-core[dotsPosition=top] gallery-dots{top:0}::ng-deep gallery-core[dotsPosition=bottom] gallery-dots{bottom:0}::ng-deep gallery-dots{margin:7px;position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}::ng-deep .g-dot{cursor:pointer;z-index:20}::ng-deep .g-dot:hover .g-dot-inner{opacity:1}::ng-deep .g-dot-active .g-dot-inner{opacity:1;-webkit-transform:scale(1.5)!important;transform:scale(1.5)!important}::ng-deep .g-dot-inner{background-color:#fff;opacity:.6;width:30%;height:30%;border-radius:50%;box-shadow:0 0 1px #000;transition:.2s}::ng-deep .g-dot,::ng-deep .g-dot-inner,::ng-deep gallery-dots{display:flex;justify-content:center;align-items:center}::ng-deep .g-nav-next,::ng-deep .g-nav-prev{position:absolute;top:50%;width:30px;height:40px;cursor:pointer;z-index:999}::ng-deep .g-nav-next{right:.5em;-webkit-transform:translateY(-50%) perspective(1px);transform:translateY(-50%) perspective(1px)}::ng-deep .g-nav-prev{left:.5em;-webkit-transform:translateY(-50%) perspective(1px) scale(-1,-1);transform:translateY(-50%) perspective(1px) scale(-1,-1)}@media only screen and (max-width:480px){::ng-deep .g-nav-next{right:.2em}::ng-deep .g-nav-prev{left:.2em}}::ng-deep .g-items-container{height:100%}::ng-deep .g-slider{position:absolute;transition:transform .4s cubic-bezier(.5,0,.5,1);transition:transform .4s cubic-bezier(.5,0,.5,1),-webkit-transform .4s cubic-bezier(.5,0,.5,1)}::ng-deep gallery-core[slidingDirection=horizontal] .g-slider{flex-direction:row}::ng-deep gallery-core[slidingDirection=vertical] .g-slider{flex-direction:column}::ng-deep gallery-thumbs{display:block;z-index:1;overflow:unset}::ng-deep .g-thumbs-container{position:relative;z-index:206;width:100%;height:100%;left:0;top:0;display:flex;overflow:unset}::ng-deep gallery-core[disableThumb=true] gallery-thumb{cursor:default}::ng-deep gallery-core[thumbPosition=bottom] gallery-thumbs .g-slider,::ng-deep gallery-core[thumbPosition=top] gallery-thumbs .g-slider{flex-direction:row;top:0;left:50%}::ng-deep gallery-core[thumbPosition=bottom] gallery-thumb,::ng-deep gallery-core[thumbPosition=top] gallery-thumb{padding:1px 0 1px 1px}::ng-deep gallery-core[thumbPosition=left] gallery-thumbs .g-slider,::ng-deep gallery-core[thumbPosition=right] gallery-thumbs .g-slider{flex-direction:column;top:50%;left:0}::ng-deep gallery-core[thumbPosition=left] gallery-thumb,::ng-deep gallery-core[thumbPosition=right] gallery-thumb{padding:0 1px 1px}::ng-deep gallery-core[thumbPosition=top]{flex-direction:column}::ng-deep gallery-core[thumbPosition=left]{flex-direction:row}::ng-deep gallery-core[thumbPosition=right]{flex-direction:row-reverse}::ng-deep gallery-core[thumbPosition=bottom]{flex-direction:column-reverse}::ng-deep gallery-thumb.g-active-thumb .g-thumb-loading{background-color:#464646}::ng-deep .g-thumb-loading{position:relative;overflow:hidden;height:100%;background-color:#262626}::ng-deep .g-thumb-loading::before{content:"";position:absolute;top:0;right:0;bottom:0;left:50%;z-index:1;width:500%;margin-left:-250%;-webkit-animation:.8s linear infinite phAnimation;animation:.8s linear infinite phAnimation;background:linear-gradient(to right,rgba(255,255,255,0) 46%,rgba(255,255,255,.35) 50%,rgba(255,255,255,0) 54%) 50% 50%}@-webkit-keyframes phAnimation{0%{-webkit-transform:translate3d(-30%,0,0);transform:translate3d(-30%,0,0)}100%{-webkit-transform:translate3d(30%,0,0);transform:translate3d(30%,0,0)}}@keyframes phAnimation{0%{-webkit-transform:translate3d(-30%,0,0);transform:translate3d(-30%,0,0)}100%{-webkit-transform:translate3d(30%,0,0);transform:translate3d(30%,0,0)}}::ng-deep gallery-core[counterPosition=top] .g-counter{top:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}::ng-deep gallery-core[counterPosition=bottom] .g-counter{bottom:0;border-top-left-radius:4px;border-top-right-radius:4px}::ng-deep .g-counter{z-index:50;position:absolute;left:50%;-webkit-transform:translateX(-50%) perspective(1px);transform:translateX(-50%) perspective(1px);font-size:12px;padding:4px 10px;color:#fff;background-color:rgba(0,0,0,.5)}::ng-deep gallery[gallerize] gallery-item{cursor:pointer}::ng-deep gallery-item,::ng-deep gallery-thumb{position:relative;height:100%;width:100%;display:block;overflow:hidden}::ng-deep gallery-item h2,::ng-deep gallery-item h4,::ng-deep gallery-thumb h2,::ng-deep gallery-thumb h4{color:coral;margin:0}::ng-deep gallery-item h2,::ng-deep gallery-thumb h2{font-size:3.5em;margin-bottom:.3em}::ng-deep gallery-item h4,::ng-deep gallery-thumb h4{font-size:1.6em}::ng-deep gallery-item{z-index:10}::ng-deep gallery-item iframe,::ng-deep gallery-item video{position:absolute;width:100%;height:100%}::ng-deep gallery-thumb{opacity:.5;cursor:pointer;transition:opacity .3s cubic-bezier(.5,0,.5,1)}::ng-deep gallery-thumb.g-active-thumb{opacity:1}::ng-deep .g-image-item{background-position:center center;background-repeat:no-repeat;background-size:cover;width:100%;height:100%}::ng-deep .g-image-error-message,::ng-deep .g-template{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;color:#fff;display:flex;align-items:center;justify-content:center;flex-direction:column}::ng-deep .g-loading{position:absolute;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);left:50%;top:50%;width:80px;height:80px}::ng-deep gallery-core[imageSize=contain] gallery-slider .g-image-item{background-size:contain}::ng-deep gallery-image{display:flex;justify-content:center;align-items:center;height:100%}::ng-deep gallery{position:relative;z-index:1;overflow:hidden;display:block;height:500px;background-color:#000}::ng-deep gallery *{box-sizing:border-box}::ng-deep gallery,::ng-deep gallery-core{position:relative;overflow:hidden}::ng-deep .g-box,::ng-deep .g-slider,::ng-deep gallery-core{display:flex;height:100%;width:100%}::ng-deep gallery[fluid]{-webkit-transform:translateX(-50vw);transform:translateX(-50vw);width:100vw;left:50%}::ng-deep gallery[fluid][fluid=false]{-webkit-transform:none;transform:none;width:initial;left:initial}::ng-deep .g-no-transition{transition:unset!important}::ng-deep .g-box,::ng-deep gallery-slider{overflow:hidden;position:relative;display:flex;flex-direction:column;flex:1;order:1;height:100%}::ng-deep .g-btn-close svg,::ng-deep gallery-nav svg{width:100%;height:100%;-webkit-filter:drop-shadow(0 0 1px #000);filter:drop-shadow(0 0 1px #000);transition:opacity .2s linear;opacity:.6}::ng-deep .g-btn-close svg:hover,::ng-deep gallery-nav svg:hover{opacity:1}']}]}],t.ctorParameters=function(){return[{type:k}]},t.propDecorators={id:[{type:o.Input}],items:[{type:o.Input}],nav:[{type:o.Input}],dots:[{type:o.Input}],loop:[{type:o.Input}],thumb:[{type:o.Input}],zoomOut:[{type:o.Input}],counter:[{type:o.Input}],dotsSize:[{type:o.Input}],autoPlay:[{type:o.Input}],gestures:[{type:o.Input}],thumbWidth:[{type:o.Input}],thumbHeight:[{type:o.Input}],disableThumb:[{type:o.Input}],panSensitivity:[{type:o.Input}],playerInterval:[{type:o.Input}],itemTemplate:[{type:o.Input}],thumbTemplate:[{type:o.Input}],thumbMode:[{type:o.Input}],imageSize:[{type:o.Input}],dotsPosition:[{type:o.Input}],counterPosition:[{type:o.Input}],slidingDirection:[{type:o.Input}],loadingStrategy:[{type:o.Input}],thumbPosition:[{type:o.Input}],destroyRef:[{type:o.Input}],skipInitConfig:[{type:o.Input}],itemClick:[{type:o.Output}],thumbClick:[{type:o.Output}],playingChange:[{type:o.Output}],indexChange:[{type:o.Output}],itemsChange:[{type:o.Output}],error:[{type:o.Output}]},t}(),D=function(){function t(t){this._sanitizer=t}return Object.defineProperty(t.prototype,"pauseVideo",{set:function(t){var e=this.iframe.nativeElement;if(t){var i=e.src;e.src=i}},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this.iframeSrc=this._sanitizer.bypassSecurityTrustResourceUrl(this.src)},t.decorators=[{type:o.Component,args:[{selector:"gallery-iframe",changeDetection:o.ChangeDetectionStrategy.OnPush,template:'\n <iframe #iframe\n frameborder="0"\n allowfullscreen\n [src]="iframeSrc">\n </iframe>\n '}]}],t.ctorParameters=function(){return[{type:n.DomSanitizer}]},t.propDecorators={src:[{type:o.Input}],pauseVideo:[{type:o.Input,args:["pause"]}],iframe:[{type:o.ViewChild,args:["iframe"]}]},t}(),z=function(){function t(t){this._sanitizer=t,this._state=new a.BehaviorSubject("loading"),this.state=this._state.asObservable(),this.progress=0,this.error=new o.EventEmitter}return Object.defineProperty(t.prototype,"imageLoadSuccess",{get:function(){return!!this.imageUrl},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageLoadFailed",{get:function(){return!!this.loadError},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this.loadingIcon&&(this.loaderTemplate=this._sanitizer.bypassSecurityTrustHtml(this.loadingIcon)),this.loadingError&&(this.errorTemplate=this._sanitizer.bypassSecurityTrustHtml(this.loadingError))},t.prototype.ngOnDestroy=function(){this._state.complete()},t.prototype.onProgress=function(t){var e=t.loaded,i=t.total;this.progress=100*e/i},t.prototype.onLoaded=function(t){this.imageUrl=this._sanitizer.bypassSecurityTrustStyle("url("+t+")"),this._state.next("success")},t.prototype.onError=function(t){this.loadError=t,this._state.next("failed"),this.error.emit(t)},t.decorators=[{type:o.Component,args:[{selector:"gallery-image",changeDetection:o.ChangeDetectionStrategy.OnPush,animations:[e.trigger("fadeIn",[e.transition(":enter",[e.style({opacity:0}),e.animate("300ms ease-in",e.style({opacity:1}))])])],template:'\n <ng-container [lazyImage]="src"\n (progress)="onProgress($event)"\n (loaded)="onLoaded($event)"\n (error)="onError($event)"\n [ngSwitch]="state | async">\n\n <div *ngSwitchCase="\'success\'"\n @fadeIn\n class="g-image-item"\n [style.backgroundImage]="imageUrl">\n </div>\n\n <div *ngSwitchCase="\'failed\'"\n class="g-image-error-message">\n <div *ngIf="errorTemplate; else defaultError"\n [innerHTML]="errorTemplate"></div>\n <ng-template #defaultError>\n <ng-container *ngIf="isThumbnail; else isLarge">\n <h4>⚠</h4>\n </ng-container>\n <ng-template #isLarge>\n <h2>⚠</h2>\n <p>Unable to load the image!</p>\n </ng-template>\n </ng-template>\n </div>\n\n <ng-container *ngSwitchCase="\'loading\'">\n <div *ngIf="loaderTemplate; else defaultLoader"\n class="g-loading"\n [innerHTML]="loaderTemplate">\n </div>\n <ng-template #defaultLoader>\n <div *ngIf="isThumbnail" class="g-thumb-loading"></div>\n </ng-template>\n </ng-container>\n </ng-container>\n '}]}],t.ctorParameters=function(){return[{type:n.DomSanitizer}]},t.propDecorators={isThumbnail:[{type:o.Input}],src:[{type:o.Input}],loadingIcon:[{type:o.Input}],loadingError:[{type:o.Input}],error:[{type:o.Output}],imageLoadSuccess:[{type:o.HostBinding,args:["class.g-image-loaded"]}],imageLoadFailed:[{type:o.HostBinding,args:["class.g-image-error"]}]},t}(),H=function(){function t(){this.error=new o.EventEmitter}return Object.defineProperty(t.prototype,"pauseVideo",{set:function(t){var e=this.video.nativeElement;t&&!e.paused&&e.pause()},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this.src instanceof Array?this.videoSources=p(this.src):this.videoSources=[{url:this.src}]},t.decorators=[{type:o.Component,args:[{selector:"gallery-video",changeDetection:o.ChangeDetectionStrategy.OnPush,template:'\n <video #video controls poster="{{poster}}" (error)="error.emit($event)">\n <source *ngFor="let src of videoSources" src="{{src?.url}}" type="{{src?.type}}"/>\n </video>\n '}]}],t.propDecorators={src:[{type:o.Input}],poster:[{type:o.Input}],pauseVideo:[{type:o.Input,args:["pause"]}],error:[{type:o.Output}],video:[{type:o.ViewChild,args:["video"]}]},t}(),R=function(){function t(t){this._sanitizer=t,this.action=new o.EventEmitter}return t.prototype.ngOnInit=function(){this.navIcon=this._sanitizer.bypassSecurityTrustHtml(this.config.navIcon)},t.decorators=[{type:o.Component,args:[{selector:"gallery-nav",changeDetection:o.ChangeDetectionStrategy.OnPush,template:'\n <i *ngIf="config.loop || state.hasPrev"\n class="g-nav-prev"\n aria-label="Previous"\n (tapClick)="action.emit(\'prev\')"\n [innerHtml]="navIcon"></i>\n\n <i *ngIf="config.loop || state.hasNext"\n class="g-nav-next"\n aria-label="Next"\n (tapClick)="action.emit(\'next\')"\n [innerHtml]="navIcon"></i>\n '}]}],t.ctorParameters=function(){return[{type:n.DomSanitizer}]},t.propDecorators={state:[{type:o.Input}],config:[{type:o.Input}],action:[{type:o.Output}]},t}(),$=function(){function t(){this.action=new o.EventEmitter,this.itemClick=new o.EventEmitter,this.thumbClick=new o.EventEmitter,this.error=new o.EventEmitter}return Object.defineProperty(t.prototype,"thumbPosition",{get:function(){return this.config.thumbPosition},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"slidingDirection",{get:function(){return this.config.slidingDirection},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disableThumb",{get:function(){return this.config.disableThumb},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageSize",{get:function(){return this.config.imageSize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dotsPosition",{get:function(){return this.config.dotsPosition},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"counterPosition",{get:function(){return this.config.counterPosition},enumerable:!0,configurable:!0}),t.decorators=[{type:o.Component,args:[{selector:"gallery-core",changeDetection:o.ChangeDetectionStrategy.OnPush,template:'\n <gallery-thumbs *ngIf="config.thumb"\n [state]="state"\n [config]="config"\n (action)="action.emit($event)"\n (thumbClick)="thumbClick.emit($event)">\n </gallery-thumbs>\n <div class="g-box">\n <gallery-slider [state]="state"\n [config]="config"\n (action)="action.emit($event)"\n (itemClick)="itemClick.emit($event)"\n (error)="error.emit($event)">\n\n <gallery-nav *ngIf="config.nav && state.items.length > 1"\n [state]="state"\n [config]="config"\n (action)="action.emit($event)">\n </gallery-nav>\n\n </gallery-slider>\n\n <gallery-dots *ngIf="config.dots"\n [state]="state"\n [config]="config"\n (action)="action.emit($event)">\n </gallery-dots>\n\n <gallery-counter *ngIf="config.counter"\n [state]="state">\n </gallery-counter>\n </div>\n '}]}],t.propDecorators={state:[{type:o.Input}],config:[{type:o.Input}],action:[{type:o.Output}],itemClick:[{type:o.Output}],thumbClick:[{type:o.Output}],error:[{type:o.Output}],thumbPosition:[{type:o.HostBinding,args:["attr.thumbPosition"]}],slidingDirection:[{type:o.HostBinding,args:["attr.slidingDirection"]}],disableThumb:[{type:o.HostBinding,args:["attr.disableThumb"]}],imageSize:[{type:o.HostBinding,args:["attr.imageSize"]}],dotsPosition:[{type:o.HostBinding,args:["attr.dotsPosition"]}],counterPosition:[{type:o.HostBinding,args:["attr.counterPosition"]}]},t}(),M=function(){function t(){this.action=new o.EventEmitter}return t.decorators=[{type:o.Component,args:[{selector:"gallery-dots",changeDetection:o.ChangeDetectionStrategy.OnPush,template:'\n <div class="g-dot"\n *ngFor="let item of state.items; let i = index"\n [class.g-dot-active]="i === state.currIndex"\n [style.width.px]="config?.dotsSize"\n [style.height.px]="config?.dotsSize"\n (tapClick)="action.emit(i)">\n <div class="g-dot-inner"></div>\n </div>\n '}]}],t.propDecorators={state:[{type:o.Input}],config:[{type:o.Input}],action:[{type:o.Output}]},t}(),L=function(){function t(t,e){var i=this;this._el=t,this._zone=e,this._slidingWorker$=new a.BehaviorSubject({value:0,active:!1}),this._freeModeCurrentOffset=0,this.action=new o.EventEmitter,this.thumbClick=new o.EventEmitter,this.error=new o.EventEmitter,this.sliderState$=this._slidingWorker$.pipe(s.map(function(t){return{style:i.getSliderStyles(t),active:t.active}}))}return t.prototype.ngOnChanges=function(){this.updateSlider({value:0,active:!1}),this._freeModeCurrentOffset=0},t.prototype.ngOnInit=function(){var e=this;if(this.config.gestures&&!this.config.disableThumb&&"undefined"!=typeof Hammer){var t=void 0;switch(this.config.thumbPosition){case d.Right:case d.Left:t=Hammer.DIRECTION_VERTICAL;break;case d.Top:case d.Bottom:t=Hammer.DIRECTION_HORIZONTAL}this._hammer=new Hammer(this._el.nativeElement),this._hammer.get("pan").set({direction:t}),this._zone.runOutsideAngular(function(){switch(e.config.thumbMode){case y.Strict:e._hammer.on("pan",function(t){return e.strictMode(t)});break;case y.Free:e._hammer.on("pan",function(t){return e.freeMode(t)})}})}},t.prototype.ngOnDestroy=function(){this._hammer&&this._hammer.destroy()},t.prototype.strictMode=function(t){switch(this.config.thumbPosition){case d.Right:case d.Left:this.updateSlider({value:t.deltaY,active:!0}),t.isFinal&&(this.updateSlider({value:0,active:!1}),this.verticalPan(t));break;case d.Top:case d.Bottom:this.updateSlider({value:t.deltaX,active:!0}),t.isFinal&&(this.updateSlider({value:0,active:!1}),this.horizontalPan(t))}},t.prototype.freeMode=function(t){switch(this.config.thumbPosition){case d.Right:case d.Left:this.updateSlider({value:this._freeModeCurrentOffset+t.deltaY,active:!0}),t.isFinal&&(this.minFreeScrollExceeded(t.deltaY,this.config.thumbWidth,this.config.thumbHeight)?this._freeModeCurrentOffset=-(this.state.items.length-1-this.state.currIndex)*this.config.thumbHeight:this.maxFreeScrollExceeded(t.deltaY,this.config.thumbHeight,this.config.thumbWidth)?this._freeModeCurrentOffset=this.state.currIndex*this.config.thumbHeight:this._freeModeCurrentOffset+=t.deltaY,this.updateSlider({value:this._freeModeCurrentOffset,active:!1}));break;case d.Top:case d.Bottom:this.updateSlider({value:this._freeModeCurrentOffset+t.deltaX,active:!0}),t.isFinal&&(this.minFreeScrollExceeded(t.deltaX,this.config.thumbHeight,this.config.thumbWidth)?this._freeModeCurrentOffset=-(this.state.items.length-1-this.state.currIndex)*this.config.thumbWidth:this.maxFreeScrollExceeded(t.deltaX,this.config.thumbWidth,this.config.thumbHeight)?this._freeModeCurrentOffset=this.state.currIndex*this.config.thumbWidth:this._freeModeCurrentOffset+=t.deltaX,this.updateSlider({value:this._freeModeCurrentOffset,active:!1}))}},t.prototype.minFreeScrollExceeded=function(t,e,i){return-(this._freeModeCurrentOffset+t-e/2)>(this.state.items.length-this.state.currIndex)*i},t.prototype.maxFreeScrollExceeded=function(t,e,i){return this._freeModeCurrentOffset+t>this.state.currIndex*e+i/2},t.prototype.getSliderStyles=function(t){switch(this.config.thumbPosition){case d.Top:case d.Bottom:return this.width="100%",this.height=this.config.thumbHeight+"px",{transform:"translate3d("+(-this.state.currIndex*this.config.thumbWidth-(this.config.thumbWidth/2-t.value))+"px, 0, 0)",width:this.state.items.length*this.config.thumbWidth+"px",height:"100%"};case d.Left:case d.Right:return this.width=this.config.thumbWidth+"px",this.height="100%",{transform:"translate3d(0, "+(-this.state.currIndex*this.config.thumbHeight-(this.config.thumbHeight/2-t.value))+"px, 0)",width:"100%",height:this.state.items.length*this.config.thumbHeight+"px"}}},t.prototype.verticalPan=function(t){t.direction&Hammer.DIRECTION_UP&&t.offsetDirection&Hammer.DIRECTION_VERTICAL&&(.3<t.velocityY?this.prev():t.velocityY<-.3?this.next():t.deltaY/2<=-this.config.thumbHeight*this.state.items.length/this.config.panSensitivity?this.next():t.deltaY/2>=this.config.thumbHeight*this.state.items.length/this.config.panSensitivity?this.prev():this.action.emit(this.state.currIndex))},t.prototype.horizontalPan=function(t){t.direction&Hammer.DIRECTION_HORIZONTAL&&t.offsetDirection&Hammer.DIRECTION_HORIZONTAL&&(.3<t.velocityX?this.prev():t.velocityX<-.3?this.next():t.deltaX/2<=-this.config.thumbWidth*this.state.items.length/this.config.panSensitivity?this.next():t.deltaX/2>=this.config.thumbWidth*this.state.items.length/this.config.panSensitivity?this.prev():this.action.emit(this.state.currIndex))},t.prototype.next=function(){this.action.emit("next")},t.prototype.prev=function(){this.action.emit("prev")},t.prototype.updateSlider=function(t){var e=l({},this._slidingWorker$.value,t);this._slidingWorker$.next(e)},t.decorators=[{type:o.Component,args:[{selector:"gallery-thumbs",changeDetection:o.ChangeDetectionStrategy.OnPush,template:'\n <div *ngIf="sliderState$ | async; let sliderState"\n class="g-thumbs-container">\n <div class="g-slider"\n [class.g-no-transition]="sliderState.active"\n [ngStyle]="sliderState.style">\n\n <gallery-thumb *ngFor="let item of state.items;let i = index"\n [type]="item.type"\n [config]="config"\n [data]="item.data"\n [currIndex]="state.currIndex"\n [index]="i"\n [tapClickDisabled]="config.disableThumb"\n (tapClick)="thumbClick.emit(i)"\n (error)="error.emit({itemIndex: i, error: $event})"></gallery-thumb>\n </div>\n </div>\n '}]}],t.ctorParameters=function(){return[{type:o.ElementRef},{type:o.NgZone}]},t.propDecorators={state:[{type:o.Input}],config:[{type:o.Input}],action:[{type:o.Output}],thumbClick:[{type:o.Output}],error:[{type:o.Output}],height:[{type:o.HostBinding,args:["style.height"]}],width:[{type:o.HostBinding,args:["style.width"]}]},t}(),j=function(){function t(t,e,i){var n=this;this._el=t,this._zone=e,this.platform=i,this._slidingWorker$=new a.BehaviorSubject({value:0,active:!1}),this.action=new o.EventEmitter,this.itemClick=new o.EventEmitter,this.error=new o.EventEmitter,this.sliderState$=this._slidingWorker$.pipe(s.map(function(t){return{style:n.getSliderStyles(t),active:t.active}}))}return Object.defineProperty(t.prototype,"zoom",{get:function(){return{transform:"perspective(50px) translate3d(0, 0, "+-this.config.zoomOut+"px)"}},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(){this.updateSlider({value:0,active:!1})},t.prototype.ngOnInit=function(){var e=this;if(this.config.gestures&&"undefined"!=typeof Hammer){var t=this.config.slidingDirection===b.Horizontal?Hammer.DIRECTION_HORIZONTAL:Hammer.DIRECTION_VERTICAL;this._hammer=new Hammer(this._el.nativeElement),this._hammer.get("pan").set({direction:t}),this._zone.runOutsideAngular(function(){e._hammer.on("pan",function(t){switch(e.config.slidingDirection){case b.Horizontal:e.updateSlider({value:t.deltaX,active:!0}),t.isFinal&&(e.updateSlider({value:0,active:!1}),e.horizontalPan(t));break;case b.Vertical:e.updateSlider({value:t.deltaY,active:!0}),t.isFinal&&(e.updateSlider({value:0,active:!1}),e.verticalPan(t))}})})}r.isPlatformBrowser(this.platform)&&(this._resizeSub$=a.fromEvent(window,"resize").pipe(s.debounceTime(200),s.tap(function(){return e.updateSlider(e._slidingWorker$.value)})).subscribe()),setTimeout(function(){return e.updateSlider({value:0,active:!1})})},t.prototype.ngOnDestroy=function(){this._hammer&&this._hammer.destroy(),this._resizeSub$&&this._resizeSub$.unsubscribe(),this._slidingWorker$.complete()},t.prototype.getSliderStyles=function(t){switch(this.config.slidingDirection){case b.Horizontal:return{transform:"translate3d("+(-this.state.currIndex*this._el.nativeElement.offsetWidth+t.value)+"px, 0, 0)",width:"calc(100% * "+this.state.items.length+")",height:"100%"};case b.Vertical:return{transform:"translate3d(0, "+(-this.state.currIndex*this._el.nativeElement.offsetHeight+t.value)+"px, 0)",width:"100%",height:"calc(100% * "+this.state.items.length+")"}}},t.prototype.verticalPan=function(t){t.direction&Hammer.DIRECTION_UP&&t.offsetDirection&Hammer.DIRECTION_VERTICAL&&(.3<t.velocityY?this.prev():t.velocityY<-.3?this.next():t.deltaY/2<=-this._el.nativeElement.offsetHeight*this.state.items.length/this.config.panSensitivity?this.next():t.deltaY/2>=this._el.nativeElement.offsetHeight*this.state.items.length/this.config.panSensitivity?this.prev():this.action.emit(this.state.currIndex))},t.prototype.horizontalPan=function(t){t.direction&Hammer.DIRECTION_HORIZONTAL&&t.offsetDirection&Hammer.DIRECTION_HORIZONTAL&&(.3<t.velocityX?this.prev():t.velocityX<-.3?this.next():t.deltaX/2<=-this._el.nativeElement.offsetWidth*this.state.items.length/this.config.panSensitivity?this.next():t.deltaX/2>=this._el.nativeElement.offsetWidth*this.state.items.length/this.config.panSensitivity?this.prev():this.action.emit(this.state.currIndex))},t.prototype.next=function(){this.action.emit("next")},t.prototype.prev=function(){this.action.emit("prev")},t.prototype.updateSlider=function(t){var e=l({},this._slidingWorker$.value,t);this._slidingWorker$.next(e)},t.decorators=[{type:o.Component,args:[{selector:"gallery-slider",changeDetection:o.ChangeDetectionStrategy.OnPush,template:'\n <div *ngIf="sliderState$ | async; let sliderState"\n class="g-items-container"\n [ngStyle]="zoom">\n\n <div class="g-slider"\n [class.g-no-transition]="sliderState.active"\n [ngStyle]="sliderState.style">\n\n <gallery-item *ngFor="let item of state.items; let i = index"\n [type]="item.type"\n [config]="config"\n [data]="item.data"\n [currIndex]="state.currIndex"\n [index]="i"\n (tapClick)="itemClick.emit(i)"\n (error)="error.emit({itemIndex: i, error: $event})">\n </gallery-item>\n\n </div>\n </div>\n <ng-content></ng-content>\n '}]}],t.ctorParameters=function(){return[{type:o.ElementRef},{type:o.NgZone},{type:Object,decorators:[{type:o.Inject,args:[o.PLATFORM_ID]}]}]},t.propDecorators={state:[{type:o.Input}],config:[{type:o.Input}],action:[{type:o.Output}],itemClick:[{type:o.Output}],error:[{type:o.Output}]},t}(),N=function(){function t(){}return t.decorators=[{type:o.Component,args:[{selector:"gallery-counter",changeDetection:o.ChangeDetectionStrategy.OnPush,template:"\n <div class=\"g-counter\">{{(state.currIndex + 1) + '/' + state.items.length}}</div>\n "}]}],t.propDecorators={state:[{type:o.Input}]},t}(),A=function(){function t(){this.Types=v,this.error=new o.EventEmitter}return Object.defineProperty(t.prototype,"isActive",{get:function(){return this.index===this.currIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"load",{get:function(){switch(this.config.loadingStrategy){case u.Preload:return!0;case u.Lazy:return this.currIndex===this.index;default:return this.currIndex===this.index||this.currIndex===this.index-1||this.currIndex===this.index+1}},enumerable:!0,configurable:!0}),t.decorators=[{type:o.Component,args:[{selector:"gallery-item",changeDetection:o.ChangeDetectionStrategy.OnPush,template:'\n <ng-container *ngIf="load" [ngSwitch]="type">\n\n <ng-container *ngSwitchCase="Types.Image">\n\n <gallery-image [src]="data.src"\n [loadingIcon]="config.loadingIcon"\n [loadingError]="config.loadingError"\n (error)="error.emit($event)"></gallery-image>\n\n <div class="g-template g-item-template">\n <ng-container *ngTemplateOutlet="config.itemTemplate;\n context: { index: this.index, currIndex: this.currIndex, type: this.type, data: this.data }">\n </ng-container>\n </div>\n\n </ng-container>\n\n <gallery-video *ngSwitchCase="Types.Video"\n [src]="data.src"\n [poster]="data.poster"\n [pause]="currIndex !== index"\n (error)="error.emit($event)"></gallery-video>\n\n <gallery-iframe *ngSwitchCase="Types.Youtube"\n [src]="data.src"\n [pause]="currIndex !== index"></gallery-iframe>\n\n <gallery-iframe *ngSwitchCase="Types.Iframe"\n [src]="data.src"></gallery-iframe>\n\n <ng-container *ngSwitchDefault>\n\n <div class="g-template g-item-template">\n <ng-container *ngTemplateOutlet="config.itemTemplate;\n context: { index: this.index, currIndex: this.currIndex, type: this.type, data: this.data }">\n </ng-container>\n </div>\n\n </ng-container>\n\n </ng-container>\n '}]}],t.propDecorators={config:[{type:o.Input}],index:[{type:o.Input}],currIndex:[{type:o.Input}],type:[{type:o.Input}],data:[{type:o.Input}],error:[{type:o.Output}],isActive:[{type:o.HostBinding,args:["class.g-active-item"]}]},t}(),Y=function(){function t(){this.error=new o.EventEmitter}return Object.defineProperty(t.prototype,"isActive",{get:function(){return this.index===this.currIndex},enumerable:!0,configurable:!0}),t.decorators=[{type:o.Component,args:[{selector:"gallery-thumb",changeDetection:o.ChangeDetectionStrategy.OnPush,template:'\n <gallery-image [src]="data.thumb" \n mode="indeterminate"\n [isThumbnail]="true" \n [loadingIcon]="config.thumbLoadingIcon"\n [loadingError]="config.thumbLoadingError "\n (error)="error.emit($event)"></gallery-image>\n\n <div *ngIf="config.thumbTemplate" class="g-template g-thumb-template">\n <ng-container\n *ngTemplateOutlet="config.thumbTemplate; context: { index: this.index, type: this.type, data: this.data }">\n </ng-container>\n </div>\n '}]}],t.propDecorators={config:[{type:o.Input}],index:[{type:o.Input}],currIndex:[{type:o.Input}],type:[{type:o.Input}],data:[{type:o.Input}],error:[{type:o.Output}],isActive:[{type:o.HostBinding,args:["class.g-active-thumb"]}]},t}(),W=function(){function t(t){var e=this;this.document=t,this._imageLoader$=new a.Subject,this._loaderSub$=a.Subscription.EMPTY,this.loaded=new o.EventEmitter,this.error=new o.EventEmitter,this._loaderSub$=this._imageLoader$.pipe(s.switchMap(function(t){return e.nativeLoader(t)})).subscribe()}return t.prototype.ngOnChanges=function(t){t.src&&t.src.previousValue!==t.src.currentValue&&this.loadImage(this.src)},t.prototype.ngOnDestroy=function(){this._loaderSub$.unsubscribe(),this._imageLoader$.complete()},t.prototype.loadImage=function(t){this._imageLoader$.next(t)},t.prototype.nativeLoader=function(t){var e=this,i=this.document.createElement("img");i.src=t;var n=a.fromEvent(i,"load").pipe(s.tap(function(){return e.loaded.emit(t)})),r=a.fromEvent(i,"error").pipe(s.tap(function(){return e.error.emit(new Error("[lazyImage]: The image "+t+" did not load"))}));return a.zip(n,r)},t.decorators=[{type:o.Directive,args:[{selector:"[lazyImage]"}]}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:o.Inject,args:[r.DOCUMENT]}]}]},t.propDecorators={src:[{type:o.Input,args:["lazyImage"]}],loaded:[{type:o.Output}],error:[{type:o.Output}]},t}(),B=function(){function t(t){this._el=t,this.clickListener=a.Subscription.EMPTY,this.tapClick=new o.EventEmitter}return t.prototype.ngOnInit=function(){this.activateClickEvent()},t.prototype.activateClickEvent=function(){var t=this;"undefined"!=typeof Hammer?(this._hammer=new Hammer(this._el.nativeElement),this._hammer.on("tap",function(){t.tapClickDisabled||t.tapClick.emit(null)})):this.clickListener=a.fromEvent(this._el.nativeElement,"click").pipe(s.filter(function(){return!t.tapClickDisabled}),s.tap(function(){return t.tapClick.emit(null)})).subscribe()},t.prototype.ngOnDestroy=function(){this._hammer&&this._hammer.destroy(),this.clickListener.unsubscribe()},t.decorators=[{type:o.Directive,args:[{selector:"[tapClick]"}]}],t.ctorParameters=function(){return[{type:o.ElementRef}]},t.propDecorators={tapClickDisabled:[{type:o.Input}],tapClick:[{type:o.Output}]},t}(),V=function(){function e(){}return e.withConfig=function(t){return{ngModule:e,providers:[{provide:O,useValue:t}]}},e.decorators=[{type:o.NgModule,args:[{imports:[r.CommonModule,i.HttpClientModule],declarations:[T,R,M,$,j,N,L,Y,A,z,H,D,W,B],exports:[T,W,B]}]}],e}();t.Gallery=k,t.GalleryRef=E,t.GalleryComponent=T,t.ImageItem=C,t.VideoItem=_,t.IframeItem=S,t.YoutubeItem=w,t.GalleryIframeComponent=D,t.GalleryImageComponent=z,t.GalleryVideoComponent=H,t.GALLERY_CONFIG=O,t.GalleryAction=g,t.ImageSize=h,t.LoadingStrategy=u,t.ThumbnailsPosition=d,t.ImageLoaderMode={Determinate:"determinate",Indeterminate:"indeterminate"},t.DotsPosition=m,t.CounterPosition=f,t.ThumbnailsMode=y,t.SlidingDirection=b,t.GalleryItemType=v,t.GalleryModule=V,t.ɵc=$,t.ɵe=N,t.ɵb=M,t.ɵh=A,t.ɵa=R,t.ɵd=j,t.ɵg=Y,t.ɵf=L,t.ɵi=W,t.ɵj=B,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ngx-gallery-core.umd.min.js.map