theme-lib
Version:
This is a simple example Angular Library published to npm.
1 lines • 265 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("@angular/forms"),require("@angular/router"),require("@angular/cdk/a11y"),require("@angular/cdk/portal"),require("@angular/cdk/overlay"),require("@angular/cdk/platform"),require("@angular/cdk/bidi"),require("@angular/animations"),require("@angular/platform-browser"),require("intersection-observer")):"function"==typeof define&&define.amd?define("theme-lib",["exports","@angular/core","rxjs","rxjs/operators","@angular/common","@angular/forms","@angular/router","@angular/cdk/a11y","@angular/cdk/portal","@angular/cdk/overlay","@angular/cdk/platform","@angular/cdk/bidi","@angular/animations","@angular/platform-browser","intersection-observer"],t):t(e["theme-lib"]={},e.ng.core,e.rxjs,e.rxjs.operators,e.ng.common,e.ng.forms,e.ng.router,e.ng.cdk.a11y,e.ng.cdk.portal,e.ng.cdk.overlay,e.ng.cdk.platform,e.ng.cdk.bidi,e.ng.animations,e.ng.platformBrowser)}(this,function(e,l,h,f,g,i,n,t,r,s,o,a,c,p){"use strict";var u=new l.InjectionToken("Nebular Theme Options"),d=new l.InjectionToken("Nebular Media Breakpoints"),y=new l.InjectionToken("Nebular Built-in JS Themes"),m=new l.InjectionToken("Nebular JS Themes"),b=new l.InjectionToken("Window"),v=new l.InjectionToken("Document"),S=function(e,t){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function I(e,t){function n(){this.constructor=e}S(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var C=function(){return(C=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function w(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function O(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(n=i["return"])&&n.call(i)}finally{if(o)throw o.error}}return s}function T(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(O(arguments[t]));return e}var x,P=function(){function n(){}return n.shade=function(e,t){return n.mix("#000000",e,t)},n.tint=function(e,t){return n.mix("#ffffff",e,t)},n.mix=function(e,t,n){for(var r=function(e){return parseInt(e,16)},o="#",i=1;i<7;i+=2){var s=r(e.substr(i,2)),a=r(t.substr(i,2));o+=("0"+Math.floor(a+n/100*(s-a)).toString(16)).slice(-2)}return o},n.hexToRgbA=function(e,t){var n;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(e))return 3===(n=e.substring(1).split("")).length&&(n=[n[0],n[0],n[1],n[1],n[2],n[2]]),"rgba("+[(n="0x"+n.join(""))>>16&255,n>>8&255,255&n].join(",")+","+t+")";throw new Error("Bad Hex")},n}(),E="#8a7fff",k="#40dc7e",D="#4ca6ff",A="#ffa100",M="#ff4c6a",j={name:"default",variables:{fontMain:'"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSecondary:'"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',bg:"#ffffff",fg:"#a4abb3",fgHeading:"#2a2a2a",fgText:"#3b3b3b",fgHighlight:"#41d974",layoutBg:"#ebeff5",separator:"#ebeef2",primary:E,success:k,info:D,warning:A,danger:M,primaryLight:P.tint(E,15),successLight:P.tint(k,15),infoLight:P.tint(D,15),warningLight:P.tint(A,15),dangerLight:P.tint(M,15)}},R="#7659ff",_="#00d977",N="#0088ff",B="#ffa100",V="#ff386a",H={name:"cosmic",base:"default",variables:{bg:"#3d3780",fg:"#a1a1e5",fgHeading:"#ffffff",fgText:"#d1d1ff",fgHighlight:"#00f9a6",layoutBg:"#2f296b",separator:"#342e73",primary:R,success:_,info:N,warning:B,danger:V,primaryLight:P.tint(R,20),successLight:P.tint(_,20),infoLight:P.tint(N,20),warningLight:P.tint(B,20),dangerLight:P.tint(V,20)}},L="#73a1ff",z="#5dcfe3",F="#ba7fec",U="#ffa36b",W="#ff6b83",$={name:"corporate",base:"default",variables:{fg:"#f1f5f8",bg:"#ffffff",fgHeading:"#181818",fgText:"#4b4b4b",fgHighlight:"#a4abb3",layoutBg:"#f1f5f8",separator:"#cdd5dc",primary:L,success:z,info:F,warning:U,danger:W,primaryLight:P.tint(L,15),successLight:P.tint(z,15),infoLight:P.tint(F,15),warningLight:P.tint(U,15),dangerLight:P.tint(W,15)}},G=[j,H,$],Y=function(){function e(e,t){void 0===t&&(t=[]);var n=this;this.themes={},this.combineByNames(t,e).forEach(function(e){n.register(e,e.name,e.base)})}return e.prototype.register=function(e,t,n){var r=this.has(n)?this.get(n):{};this.themes[t]=this.mergeDeep({},r,e)},e.prototype.has=function(e){return!!this.themes[e]},e.prototype.get=function(e){if(!this.themes[e])throw Error("NbThemeConfig: no theme '"+e+"' found registered.");return JSON.parse(JSON.stringify(this.themes[e]))},e.prototype.combineByNames=function(e,r){var o=this;if(e){var i=[];return e.forEach(function(t){var e=r.find(function(e){return e.name===t.name})||{},n=o.mergeDeep({},e,t);i.push(n)}),r.forEach(function(t){i.find(function(e){return e.name===t.name})||i.push(t)}),i}return r},e.prototype.isObject=function(e){return e&&"object"==typeof e&&!Array.isArray(e)},e.prototype.mergeDeep=function(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(!r.length)return e;var i=r.shift();if(this.isObject(e)&&this.isObject(i))for(var s in i)this.isObject(i[s])?(e[s]||Object.assign(e,((t={})[s]={},t)),this.mergeDeep(e[s],i[s])):Object.assign(e,((n={})[s]=i[s],n));return this.mergeDeep.apply(this,T([e],r))},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:Array,decorators:[{type:l.Inject,args:[y]}]},{type:Array,decorators:[{type:l.Inject,args:[m]}]}]},e}(),Z=[{name:"xs",width:0},{name:"is",width:400},{name:"sm",width:576},{name:"md",width:768},{name:"lg",width:992},{name:"xl",width:1200},{name:"xxl",width:1400},{name:"xxxl",width:1600}],X=function(){function e(e){this.breakpoints=e,this.breakpointsMap=this.breakpoints.reduce(function(e,t){return e[t.name]=t.width,e},{})}return e.prototype.getByWidth=function(r){var e={name:"unknown",width:r},o=this.getBreakpoints();return o.find(function(e,t){var n=o[t+1];return r>=e.width&&(!n||r<n.width)})||e},e.prototype.getByName=function(t){var e={name:"unknown",width:NaN};return this.getBreakpoints().find(function(e){return t===e.name})||e},e.prototype.getBreakpoints=function(){return this.breakpoints},e.prototype.getBreakpointsMap=function(){return this.breakpointsMap},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:l.Inject,args:[d]}]}]},e}(),q=function(){function e(e,t,n){this.options=e,this.breakpointService=t,this.jsThemesRegistry=n,this.themeChanges$=new h.ReplaySubject(1),this.appendLayoutClass$=new h.Subject,this.removeLayoutClass$=new h.Subject,this.changeWindowWidth$=new h.ReplaySubject(2),e&&e.name&&this.changeTheme(e.name)}return e.prototype.changeTheme=function(e){this.themeChanges$.next({name:e,previous:this.currentTheme}),this.currentTheme=e},e.prototype.changeWindowWidth=function(e){this.changeWindowWidth$.next(e)},e.prototype.getJsTheme=function(){var t=this;return this.onThemeChange().pipe(f.map(function(e){return t.jsThemesRegistry.get(e.name)}))},e.prototype.onMediaQueryChange=function(){var o=this;return this.changeWindowWidth$.pipe(f.startWith(undefined),f.pairwise(),f.map(function(e){var t=O(e,2),n=t[0],r=t[1];return[o.breakpointService.getByWidth(n),o.breakpointService.getByWidth(r)]}),f.filter(function(e){var t=O(e,2),n=t[0],r=t[1];return n.name!==r.name}),f.distinctUntilChanged(null,function(e){return e[0].name+e[1].name}),f.share())},e.prototype.onThemeChange=function(){return this.themeChanges$.pipe(f.share())},e.prototype.appendLayoutClass=function(e){this.appendLayoutClass$.next(e)},e.prototype.onAppendLayoutClass=function(){return this.appendLayoutClass$.pipe(f.share())},e.prototype.removeLayoutClass=function(e){this.removeLayoutClass$.next(e)},e.prototype.onRemoveLayoutClass=function(){return this.removeLayoutClass$.pipe(f.share())},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:l.Inject,args:[u]}]},{type:X},{type:Y}]},e}(),K=function(){function e(e){this.document=e,this.loaders=[],this.selector="nb-global-spinner"}return e.prototype.registerLoader=function(e){this.loaders.push(e)},e.prototype.clear=function(){this.loaders=[]},e.prototype.load=function(){this.showSpinner(),this.executeAll()},e.prototype.executeAll=function(t){var n=this;void 0===t&&(t=function(){}),Promise.all(this.loaders).then(function(e){n.hideSpinner(),t.call(null,e)})["catch"](function(e){console.error(e)})},e.prototype.showSpinner=function(){var e=this.getSpinnerElement();e&&(e.style.display="block")},e.prototype.hideSpinner=function(){var e=this.getSpinnerElement();e&&(e.style.display="none")},e.prototype.getSpinnerElement=function(){return this.document.getElementById(this.selector)},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:l.Inject,args:[v]}]}]},e}(),Q={LTR:"ltr",RTL:"rtl"},J=new l.InjectionToken("Layout direction"),ee=function(){function e(e){void 0===e&&(e=Q.LTR),this.direction=e,this.$directionChange=new h.ReplaySubject(1),this.setDirection(e)}return e.prototype.isLtr=function(){return this.direction===Q.LTR},e.prototype.isRtl=function(){return this.direction===Q.RTL},e.prototype.getDirection=function(){return this.direction},e.prototype.setDirection=function(e){this.direction=e,this.$directionChange.next(e)},e.prototype.onDirectionChange=function(){return this.$directionChange.pipe(f.share())},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:l.Optional},{type:l.Inject,args:[J]}]}]},e}(),te=function(){function e(){this.scrollPositionReq$=new h.Subject,this.manualScroll$=new h.Subject,this.scroll$=new h.Subject}return e.prototype.getPosition=function(){var n=this;return h.Observable.create(function(e){var t=new h.Subject;return t.subscribe(e),n.scrollPositionReq$.next({listener:t}),function(){return t.complete()}})},e.prototype.scrollTo=function(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this.manualScroll$.next({x:e,y:t})},e.prototype.onScroll=function(){return this.scroll$.pipe(f.share())},e.prototype.onManualScroll=function(){return this.manualScroll$.pipe(f.share())},e.prototype.onGetPosition=function(){return this.scrollPositionReq$},e.prototype.fireScrollChange=function(e){this.scroll$.next(e)},e.decorators=[{type:l.Injectable}],e}(),ne=function(){function e(){this.contentDimensionsReq$=new h.Subject}return e.prototype.getDimensions=function(){var n=this;return h.Observable.create(function(e){var t=new h.Subject;return t.subscribe(e),n.contentDimensionsReq$.next({listener:t}),function(){return t.complete()}})},e.prototype.onGetDimensions=function(){return this.contentDimensionsReq$},e.decorators=[{type:l.Injectable}],e}(),re=function(){function e(){}return e.decorators=[{type:l.NgModule,args:[{exports:[g.CommonModule,i.FormsModule,n.RouterModule]}]}],e}(),oe=function(s){function e(e,t,n,r,o){var i=s.call(this,e,t,n,r,o)||this;return i.element=e,i.checker=t,i.ngZone=n,i.document=r,i.savePreviouslyFocusedElement(),i}return I(e,s),e.prototype.restoreFocus=function(){this.previouslyFocusedElement.focus(),this.destroy()},e.prototype.blurPreviouslyFocusedElement=function(){this.previouslyFocusedElement.blur()},e.prototype.savePreviouslyFocusedElement=function(){this.previouslyFocusedElement=this.document.activeElement},e}(t.FocusTrap),ie=function(o){function e(e,t,n){var r=o.call(this,e,t,n)||this;return r.checker=e,r.ngZone=t,r.document=n,r}return I(e,o),e.prototype.create=function(e,t){return new oe(e,this.checker,this.ngZone,this.document,t)},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:t.InteractivityChecker},{type:l.NgZone},{type:undefined,decorators:[{type:l.Inject,args:[v]}]}]},e}(t.FocusTrapFactory),se=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[ie]}},e.decorators=[{type:l.NgModule,args:[{}]}],e}(),ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),t.decorators=[{type:l.Directive,args:[{selector:"[nbPortal]"}]}],t}(r.CdkPortal),ce=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),t.decorators=[{type:l.Directive,args:[{selector:"[nbPortalOutlet]"}]}],t}(r.CdkPortalOutlet),le=function(i){function e(e,t,n,r){var o=i.call(this,e,t,n)||this;return o.cfr=r,o}return I(e,i),e}(r.ComponentPortal),pe=function(i){function e(e,t,n,r){var o=i.call(this,e,t,n,r)||this;return o.outletElement=e,o.componentFactoryResolver=t,o.appRef=n,o.defaultInjector=r,o}return I(e,i),e.prototype.attachComponentPortal=function(e){var t,n=this,r=(e.cfr||this.componentFactoryResolver).resolveComponentFactory(e.component);return e.viewContainerRef?(t=e.viewContainerRef.createComponent(r,e.viewContainerRef.length,e.injector||e.viewContainerRef.parentInjector),this.setDisposeFn(function(){return t.destroy()})):(t=r.create(e.injector||this.defaultInjector),this.appRef.attachView(t.hostView),this.setDisposeFn(function(){n.appRef.detachView(t.hostView),t.destroy()})),this.outletElement.appendChild(this.getComponentRootNode(t)),t},e.prototype.getComponentRootNode=function(e){return e.hostView.rootNodes[0]},e}(r.DomPortalOutlet),ue=function(p){function n(e,t,n,r,o,i,s,a,c){var l=p.call(this,e,t,n,r,o,i,s,a,c)||this;return l.scrollStrategies=e,l.overlayContainer=t,l.componentFactoryResolver=n,l.positionBuilder=r,l.keyboardDispatcher=o,l.injector=i,l.ngZone=s,l.document=a,l.directionality=c,l}return I(n,p),n.prototype.create=function(e){var t=this.createHostElement(),n=this.createPaneElement(t),r=this.createPortalOutlet(n),o=new s.OverlayConfig(e);return o.direction=o.direction||this.directionality.value,new s.OverlayRef(r,t,n,o,this.ngZone,this.keyboardDispatcher,this.document)},n.prototype.createPaneElement=function(e){var t=this.document.createElement("div");return t.id="cdk-overlay-"+n.nextUniqueId++,t.classList.add("cdk-overlay-pane"),e.appendChild(t),t},n.prototype.createHostElement=function(){var e=this.document.createElement("div");return this.overlayContainer.getContainerElement().appendChild(e),e},n.prototype.createPortalOutlet=function(e){return this.appRef||(this.appRef=this.injector.get(l.ApplicationRef)),new pe(e,this.componentFactoryResolver,this.appRef,this.injector)},n.nextUniqueId=0,n.decorators=[{type:l.Injectable}],n.ctorParameters=function(){return[{type:s.ScrollStrategyOptions},{type:s.OverlayContainer},{type:l.ComponentFactoryResolver},{type:s.OverlayPositionBuilder},{type:s.OverlayKeyboardDispatcher},{type:l.Injector},{type:l.NgZone},{type:undefined,decorators:[{type:l.Inject,args:[v]}]},{type:a.Directionality}]},n}(s.Overlay),de=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),t.decorators=[{type:l.Injectable}],t}(o.Platform),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),t.decorators=[{type:l.Injectable}],t}(s.OverlayPositionBuilder),fe=function(r){function e(e,t,n){return r.call(this,e,t,n)||this}return I(e,r),e}(r.TemplatePortal),ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(g.DOCUMENT))},token:t,providedIn:"root"}),t}(s.OverlayContainer),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),t}(s.FlexibleConnectedPositionStrategy),me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),t}(r.PortalInjector),be=[s.OverlayModule,r.PortalModule],ve=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[ue,de,he]}},e.decorators=[{type:l.NgModule,args:[{imports:T(be),exports:T(be,[ae,ce]),declarations:[ae,ce]}]}],e}(),Se=function(i){function e(e,t,n,r){var o=i.call(this,e,t)||this;return o.ruler=n,o.scroll=r,o}return I(e,i),e.prototype.getViewportSize=function(){var t;return this.ruler.getDimensions().pipe(f.map(function(e){return{width:e.clientWidth,height:e.clientHeight}})).subscribe(function(e){return t=e}),t},e.prototype.getViewportScrollPosition=function(){var t;return this.scroll.getPosition().pipe(f.map(function(e){return{top:e.y,left:e.x}})).subscribe(function(e){return t=e}),t},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:de},{type:l.NgZone},{type:ne},{type:te}]},e}(s.ViewportRuler),Ie={TOP_START:"top-start",TOP_END:"top-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end"},Ce={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"},we=function(){function e(e){this.layoutDirection=e}return e.prototype.toLogicalPosition=function(e){return Object.values(Ie).includes(e)?e:this.layoutDirection.isLtr()?this.toLogicalPositionWhenLtr(e):this.toLogicalPositionWhenRtl(e)},e.prototype.toPhysicalPosition=function(e){return Object.values(Ce).includes(e)?e:this.layoutDirection.isLtr()?this.toPhysicalPositionWhenLtr(e):this.toPhysicalPositionWhenRtl(e)},e.prototype.isTopPosition=function(e){var t=this.toLogicalPosition(e);return t===Ie.TOP_END||t===Ie.TOP_START},e.prototype.isRightPosition=function(e){var t=this.toPhysicalPosition(e);return t===Ce.TOP_RIGHT||t===Ce.BOTTOM_RIGHT},e.prototype.toLogicalPositionWhenLtr=function(e){switch(e){case Ce.TOP_RIGHT:return Ie.TOP_END;case Ce.TOP_LEFT:return Ie.TOP_START;case Ce.BOTTOM_RIGHT:return Ie.BOTTOM_END;case Ce.BOTTOM_LEFT:return Ie.BOTTOM_START}},e.prototype.toLogicalPositionWhenRtl=function(e){switch(e){case Ce.TOP_RIGHT:return Ie.TOP_START;case Ce.TOP_LEFT:return Ie.TOP_END;case Ce.BOTTOM_RIGHT:return Ie.BOTTOM_START;case Ce.BOTTOM_LEFT:return Ie.BOTTOM_END}},e.prototype.toPhysicalPositionWhenLtr=function(e){switch(e){case Ie.TOP_START:return Ce.TOP_LEFT;case Ie.TOP_END:return Ce.TOP_RIGHT;case Ie.BOTTOM_START:return Ce.BOTTOM_LEFT;case Ie.BOTTOM_END:return Ce.BOTTOM_RIGHT}},e.prototype.toPhysicalPositionWhenRtl=function(e){switch(e){case Ie.TOP_START:return Ce.TOP_RIGHT;case Ie.TOP_END:return Ce.TOP_LEFT;case Ie.BOTTOM_START:return Ce.BOTTOM_RIGHT;case Ie.BOTTOM_END:return Ce.BOTTOM_LEFT}},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:ee}]},e}(),Oe="noop",Te="clockwise",xe="counterclockwise",Pe="vertical",Ee="horizontal",ke="top",De="bottom",Ae="left",Me="right",je="start",Re="end",_e=((x={})[Me]=function(e){return{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:e}},x[De]=function(e){return{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top",offsetY:e}},x[Ae]=function(e){return{originX:"start",originY:"center",overlayX:"end",overlayY:"center",offsetX:-e}},x[ke]=function(e){return{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom",offsetY:-e}},x),Ne=[ke,Ae,De,Me],Be=[ke,De,Ae,Me],Ve=[ke,Me,De,Ae],He=[De,ke],Le=[je,Re];var ze=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._offset=15,e.positionChange=e.positionChanges.pipe(f.map(function(e){return e.connectionPair}),f.map(function(t){return e.appliedPositions.find(function(e){return function n(e,t){return e.originX===t.originX&&e.originY===t.originY&&e.overlayX===t.overlayX&&e.overlayY===t.overlayY}(e.connectedPosition,t)}).key})),e}return I(e,t),e.prototype.attach=function(e){this.applyPositions(),t.prototype.attach.call(this,e)},e.prototype.apply=function(){this.applyPositions(),t.prototype.apply.call(this)},e.prototype.position=function(e){return this._position=e,this},e.prototype.adjustment=function(e){return this._adjustment=e,this},e.prototype.offset=function(e){return this._offset=e,this},e.prototype.applyPositions=function(){var e=this.createPositions();this.persistChosenPositions(e),this.withPositions(this.appliedPositions.map(function(e){return e.connectedPosition}))},e.prototype.createPositions=function(){var t=this;switch(this._adjustment){case Oe:return Be.filter(function(e){return t._position===e});case Te:return this.reorderPreferredPositions(Ve);case xe:return this.reorderPreferredPositions(Ne);case Ee:return this.reorderPreferredPositions(Le);case Pe:return this.reorderPreferredPositions(He)}},e.prototype.persistChosenPositions=function(e){var t=this;this.appliedPositions=e.map(function(e){return{key:e,connectedPosition:_e[e](t._offset)}})},e.prototype.reorderPreferredPositions=function(e){var t=e.slice(),n=e.indexOf(this._position),r=t.splice(n);return r.concat.apply(r,T(t))},e}(ye),Fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),t.prototype.position=function(e){switch(e){case Ie.TOP_START:return this.top().left();case Ie.TOP_END:return this.top().right();case Ie.BOTTOM_START:return this.bottom().left();case Ie.BOTTOM_END:return this.bottom().right()}},t}(s.GlobalPositionStrategy),Ue=function(){function e(e,t,n,r){this.document=e,this.viewportRuler=t,this.platform=n,this.positionBuilder=r}return e.prototype.global=function(){return new Fe},e.prototype.connectedTo=function(e){return new ze(e,this.viewportRuler,this.document,this.platform).withFlexibleDimensions(!1).withPush(!1)},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:l.Inject,args:[v]}]},{type:Se},{type:de},{type:he}]},e}(),We=function(){function e(){}return Object.defineProperty(e.prototype,"top",{get:function(){return this.position===ke},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.position===Me},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.position===De},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){return this.position===Ae},enumerable:!0,configurable:!0}),e.propDecorators={position:[{type:l.Input}],top:[{type:l.HostBinding,args:["class.nb-overlay-top"]}],right:[{type:l.HostBinding,args:["class.nb-overlay-right"]}],bottom:[{type:l.HostBinding,args:["class.nb-overlay-bottom"]}],left:[{type:l.HostBinding,args:["class.nb-overlay-left"]}]},e}(),$e=function(){function e(e,t){this.vcr=e,this.injector=t}return Object.defineProperty(e.prototype,"isStringContent",{get:function(){return!!this.content},enumerable:!0,configurable:!0}),e.prototype.attachComponentPortal=function(e){var t=e.cfr.resolveComponentFactory(e.component),n=this.createChildInjector(e.cfr);return this.vcr.createComponent(t,null,n)},e.prototype.attachTemplatePortal=function(e){return this.vcr.createEmbeddedView(e.templateRef,e.context)},e.prototype.attachStringContent=function(e){this.content=e},e.prototype.createChildInjector=function(e){return new me(this.injector,new WeakMap([[l.ComponentFactoryResolver,e]]))},e.decorators=[{type:l.Component,args:[{selector:"nb-overlay-container",template:'\n <div *ngIf="isStringContent" class="primitive-overlay">{{ content }}</div>\n '}]}],e.ctorParameters=function(){return[{type:l.ViewContainerRef},{type:l.Injector}]},e}();function Ge(e,t){return Object.assign(e.instance,t),e.changeDetectorRef.detectChanges(),e}function Ye(e,t,n,r){var o=e.attach(new le(t,null,null,r));return Ge(o,n),o}var Ze=function(){function e(e,t){this.overlay=e,this.layoutDirection=t}return Object.defineProperty(e.prototype,"scrollStrategies",{get:function(){return this.overlay.scrollStrategies},enumerable:!0,configurable:!0}),e.prototype.create=function(e){var t=this.overlay.create(e);return this.layoutDirection.onDirectionChange().subscribe(function(e){return t.setDirection(e)}),t},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:ue},{type:ee}]},e}(),Xe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),t.prototype.setContainer=function(e){this.container=e},t.prototype.clearContainer=function(){this.container=null,this._containerElement=null},t.prototype._createContainer=function(){var e=this._document.createElement("div");e.classList.add("cdk-overlay-container"),this.container.appendChild(e),this._containerElement=e},t.decorators=[{type:l.Injectable}],t}(ge),qe=function(o){function e(e,t,n){var r=o.call(this,e,t)||this;return r.scrollService=n,r}return I(e,o),e.prototype.scrolled=function(e){return this.scrollService.onScroll()},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:l.NgZone},{type:de},{type:te}]},e}(s.ScrollDispatcher),Ke=function(n){function e(e,t){return n.call(this,e,t)||this}return I(e,n),e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:Se},{type:undefined,decorators:[{type:l.Inject,args:[v]}]}]},e}(s.BlockScrollStrategy),Qe=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[Se,Xe,Ke,{provide:s.OverlayContainer,useExisting:Xe},{provide:s.ScrollDispatcher,useClass:qe}]}},e.decorators=[{type:l.NgModule,args:[{}]}],e}(),Je=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:T([Ue,Ze,we],ve.forRoot().providers,Qe.forRoot().providers,se.forRoot().providers)}},e.decorators=[{type:l.NgModule,args:[{imports:[ve,re],declarations:[$e],exports:[ve,Qe,$e]}]}],e}(),et="click",tt="hover",nt="hint",rt="focus",ot=function(){function e(e,t,n){this.document=e,this.host=t,this.container=n}return e.prototype.isNotOnHostOrContainer=function(e){return!this.isOnHost(e)&&!this.isOnContainer(e)},e.prototype.isOnHostOrContainer=function(e){return this.isOnHost(e)||this.isOnContainer(e)},e.prototype.isOnHost=function(e){var t=e.target;return this.host.contains(t)},e.prototype.isOnContainer=function(e){var t=e.target;return this.container()&&this.container().location.nativeElement.contains(t)},e}(),it=function(e){function t(){var o=null!==e&&e.apply(this,arguments)||this;return o.click$=h.fromEvent(o.document,"click").pipe(f.map(function(e){return[!o.container()&&o.isOnHost(e),e]}),f.share()),o.show$=o.click$.pipe(f.filter(function(e){return O(e,1)[0]}),f.map(function(e){return O(e,2)[1]})),o.hide$=o.click$.pipe(f.filter(function(e){var t=O(e,2),n=t[0],r=t[1];return!n&&!o.isOnContainer(r)}),f.map(function(e){return O(e,2)[1]})),o}return I(t,e),t}(ot),st=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.show$=h.fromEvent(t.host,"mouseenter").pipe(f.filter(function(){return!t.container()}),f.delay(100),f.takeUntil(h.fromEvent(t.host,"mouseleave")),f.repeat()),t.hide$=h.fromEvent(t.host,"mouseleave").pipe(f.switchMap(function(){return h.fromEvent(t.document,"mousemove").pipe(f.debounceTime(100),f.takeWhile(function(){return!!t.container()}),f.filter(function(e){return t.isNotOnHostOrContainer(e)}))})),t}return I(t,e),t}(ot),at=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.show$=h.fromEvent(e.host,"mouseenter").pipe(f.delay(100),f.takeUntil(h.fromEvent(e.host,"mouseleave")),f.repeat()),e.hide$=h.fromEvent(e.host,"mouseleave"),e}return I(e,t),e}(ot),ct=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.focusOut$=h.fromEvent(t.host,"focusout").pipe(f.switchMap(function(){return h.fromEvent(t.document,"focusin").pipe(f.takeWhile(function(){return!!t.container()}),f.filter(function(e){return t.isNotOnHostOrContainer(e)}))})),t.clickIn$=h.fromEvent(t.host,"click").pipe(f.filter(function(){return!t.container()})),t.clickOut$=h.fromEvent(t.document,"click").pipe(f.filter(function(){return!!t.container()}),f.filter(function(e){return t.isNotOnHostOrContainer(e)})),t.tabKeyPress$=h.fromEvent(t.document,"keydown").pipe(f.filter(function(e){return 9===e.keyCode}),f.filter(function(){return!!t.container()})),t.show$=h.merge(h.fromEvent(t.host,"focusin"),t.clickIn$).pipe(f.filter(function(){return!t.container()}),f.debounceTime(100),f.takeUntil(h.fromEvent(t.host,"focusout")),f.repeat()),t.hide$=h.merge(t.focusOut$,t.tabKeyPress$,t.clickOut$),t}return I(t,e),t}(ot),lt=function(){function e(){}return e.prototype.document=function(e){return this._document=e,this},e.prototype.trigger=function(e){return this._trigger=e,this},e.prototype.host=function(e){return this._host=e,this},e.prototype.container=function(e){return this._container=e,this},e.prototype.build=function(){switch(this._trigger){case et:return new it(this._document,this._host,this._container);case nt:return new at(this._document,this._host,this._container);case tt:return new st(this._document,this._host,this._container);case rt:return new ct(this._document,this._host,this._container);default:throw new Error("Trigger have to be provided")}},e}();function pt(){return window}var ut=function(){function o(){}return o.forRoot=function(e,t,n,r){return void 0===e&&(e={name:"default"}),{ngModule:o,providers:T([{provide:u,useValue:e||{}},{provide:y,useValue:G},{provide:m,useValue:t||[]},{provide:d,useValue:n||Z},{provide:b,useFactory:pt},{provide:v,useExisting:g.DOCUMENT},Y,q,X,K,{provide:J,useValue:r||Q.LTR},ee,te,ne],Je.forRoot().providers)}},o.decorators=[{type:l.NgModule,args:[{imports:[g.CommonModule],exports:[]}]}],o}(),dt=function(){function e(){}return e.decorators=[{type:l.Component,args:[{selector:"nb-card-header",template:"<ng-content></ng-content>"}]}],e}(),ht=function(){function e(){}return e.decorators=[{type:l.Component,args:[{selector:"nb-card-body",template:"<ng-content></ng-content>"}]}],e}(),ft=function(){function e(){}return e.decorators=[{type:l.Component,args:[{selector:"nb-card-footer",template:"<ng-content></ng-content>"}]}],e}(),gt=function(){function e(){}return Object.defineProperty(e.prototype,"xxsmall",{get:function(){return this.size===e.SIZE_XXSMALL},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"xsmall",{get:function(){return this.size===e.SIZE_XSMALL},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"small",{get:function(){return this.size===e.SIZE_SMALL},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"medium",{get:function(){return this.size===e.SIZE_MEDIUM},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"large",{get:function(){return this.size===e.SIZE_LARGE},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"xlarge",{get:function(){return this.size===e.SIZE_XLARGE},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"xxlarge",{get:function(){return this.size===e.SIZE_XXLARGE},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this.status===e.STATUS_ACTIVE},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.status===e.STATUS_DISABLED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"primary",{get:function(){return this.status===e.STATUS_PRIMARY},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"info",{get:function(){return this.status===e.STATUS_INFO},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"success",{get:function(){return this.status===e.STATUS_SUCCESS},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"warning",{get:function(){return this.status===e.STATUS_WARNING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"danger",{get:function(){return this.status===e.STATUS_DANGER},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasAccent",{get:function(){return this.accent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"primaryAccent",{get:function(){return this.accent===e.ACCENT_PRIMARY},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"infoAccent",{get:function(){return this.accent===e.ACCENT_INFO},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"successAccent",{get:function(){return this.accent===e.ACCENT_SUCCESS},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"warningAccent",{get:function(){return this.accent===e.ACCENT_WARNING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dangerAccent",{get:function(){return this.accent===e.ACCENT_DANGER},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeAccent",{get:function(){return this.accent===e.ACCENT_ACTIVE},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledAccent",{get:function(){return this.accent===e.ACCENT_DISABLED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"setSize",{set:function(e){this.size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"setStatus",{set:function(e){this.status=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"setAccent",{set:function(e){this.accent=e},enumerable:!0,configurable:!0}),e.SIZE_XXSMALL="xxsmall",e.SIZE_XSMALL="xsmall",e.SIZE_SMALL="small",e.SIZE_MEDIUM="medium",e.SIZE_LARGE="large",e.SIZE_XLARGE="xlarge",e.SIZE_XXLARGE="xxlarge",e.STATUS_ACTIVE="active",e.STATUS_DISABLED="disabled",e.STATUS_PRIMARY="primary",e.STATUS_INFO="info",e.STATUS_SUCCESS="success",e.STATUS_WARNING="warning",e.STATUS_DANGER="danger",e.ACCENT_ACTIVE="active",e.ACCENT_DISABLED="disabled",e.ACCENT_PRIMARY="primary",e.ACCENT_INFO="info",e.ACCENT_SUCCESS="success",e.ACCENT_WARNING="warning",e.ACCENT_DANGER="danger",e.decorators=[{type:l.Component,args:[{selector:"nb-card",template:'\n <ng-content select="nb-card-header"></ng-content>\n <ng-content select="nb-card-body"></ng-content>\n <ng-content></ng-content>\n <ng-content select="nb-card-footer"></ng-content>\n ',styles:[":host{display:flex;flex-direction:column}"]}]}],e.propDecorators={xxsmall:[{type:l.HostBinding,args:["class.xxsmall-card"]}],xsmall:[{type:l.HostBinding,args:["class.xsmall-card"]}],small:[{type:l.HostBinding,args:["class.small-card"]}],medium:[{type:l.HostBinding,args:["class.medium-card"]}],large:[{type:l.HostBinding,args:["class.large-card"]}],xlarge:[{type:l.HostBinding,args:["class.xlarge-card"]}],xxlarge:[{type:l.HostBinding,args:["class.xxlarge-card"]}],active:[{type:l.HostBinding,args:["class.active-card"]}],disabled:[{type:l.HostBinding,args:["class.disabled-card"]}],primary:[{type:l.HostBinding,args:["class.primary-card"]}],info:[{type:l.HostBinding,args:["class.info-card"]}],success:[{type:l.HostBinding,args:["class.success-card"]}],warning:[{type:l.HostBinding,args:["class.warning-card"]}],danger:[{type:l.HostBinding,args:["class.danger-card"]}],hasAccent:[{type:l.HostBinding,args:["class.accent"]}],primaryAccent:[{type:l.HostBinding,args:["class.accent-primary"]}],infoAccent:[{type:l.HostBinding,args:["class.accent-info"]}],successAccent:[{type:l.HostBinding,args:["class.accent-success"]}],warningAccent:[{type:l.HostBinding,args:["class.accent-warning"]}],dangerAccent:[{type:l.HostBinding,args:["class.accent-danger"]}],activeAccent:[{type:l.HostBinding,args:["class.accent-active"]}],disabledAccent:[{type:l.HostBinding,args:["class.accent-disabled"]}],setSize:[{type:l.Input,args:["size"]}],setStatus:[{type:l.Input,args:["status"]}],setAccent:[{type:l.Input,args:["accent"]}]},e}(),yt=function(){function e(){this.revealed=!1,this.showToggleButton=!0}return e.prototype.toggle=function(){this.revealed=!this.revealed},e.decorators=[{type:l.Component,args:[{selector:"nb-reveal-card",template:'\n <ng-content select="nb-card-front"></ng-content>\n <div class="second-card-container">\n <ng-content select="nb-card-back"></ng-content>\n </div>\n <a *ngIf="showToggleButton" class="reveal-button" (click)="toggle()">\n <i class="nb-arrow-dropdown" aria-hidden="true"></i>\n </a>\n ',styles:[":host{display:block;position:relative;overflow:hidden}:host.revealed .second-card-container{top:0;transition:none}:host.revealed .second-card-container /deep/ nb-card-back{top:0}:host.revealed .reveal-button{-webkit-transform:none;transform:none}:host /deep/ nb-card-front{display:block;height:100%}:host .second-card-container{position:absolute;top:100%;right:0;left:0;overflow:hidden;transition:top .5s}:host .second-card-container /deep/ nb-card-back{position:absolute;left:0;top:100%;width:100%;transition:top .5s}:host .reveal-button{cursor:pointer;position:absolute;right:0;bottom:0;-webkit-transform:rotate(180deg);transform:rotate(180deg);transition:transform .3s;transition:transform .3s,-webkit-transform .3s}"]}]}],e.propDecorators={revealed:[{type:l.Input},{type:l.HostBinding,args:["class.revealed"]}],showToggleButton:[{type:l.Input}]},e}(),mt=function(){function e(){this.flipped=!1,this.showToggleButton=!0}return e.prototype.toggle=function(){this.flipped=!this.flipped},e.decorators=[{type:l.Component,args:[{selector:"nb-flip-card",template:'\n <div class="flipcard-body">\n <div class="front-container">\n <ng-content select="nb-card-front"></ng-content>\n <a *ngIf="showToggleButton" class="flip-button" (click)="toggle()">\n <i class="nb-arrow-dropleft" aria-hidden="true"></i>\n </a>\n </div>\n <div class="back-container">\n <ng-content select="nb-card-back"></ng-content>\n <a *ngIf="showToggleButton" class="flip-button" (click)="toggle()">\n <i class="nb-arrow-dropleft" aria-hidden="true"></i>\n </a>\n </div>\n </div>\n ',styles:[":host{display:block;-webkit-perspective:1200px;perspective:1200px;position:relative}:host-context(.flipped) .flipcard-body{-webkit-transform:rotateY(-180deg);transform:rotateY(-180deg)}:host-context(.flipped) .flipcard-body .front-container{opacity:0;transition:opacity .25s;-webkit-backface-visibility:hidden;backface-visibility:hidden}:host-context(.flipped) .flipcard-body .front-container .flip-button{opacity:0;z-index:-1}:host-context(.flipped) .flipcard-body .back-container{-webkit-backface-visibility:visible;backface-visibility:visible}.flipcard-body{display:flex;transition:transform .5s;transition:transform .5s,-webkit-transform .5s;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.flipcard-body .back-container,.flipcard-body .front-container{flex:1}.flipcard-body .back-container .flip-button,.flipcard-body .front-container .flip-button{cursor:pointer;position:absolute;right:0;bottom:0;opacity:1;transition:opacity .15s}.flipcard-body .front-container{-webkit-backface-visibility:visible;backface-visibility:visible;transition:opacity .2s}.flipcard-body .back-container{-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}"]}]}],e.propDecorators={flipped:[{type:l.Input},{type:l.HostBinding,args:["class.flipped"]}],showToggleButton:[{type:l.Input}]},e}(),bt=function(){function e(){}return e.decorators=[{type:l.Component,args:[{selector:"nb-card-front",template:'<ng-content select="nb-card"></ng-content>'}]}],e}(),vt=function(){function e(){}return e.decorators=[{type:l.Component,args:[{selector:"nb-card-back",template:'<ng-content select="nb-card"></ng-content>'}]}],e}(),St=[gt,ht,ft,dt,yt,mt,bt,vt],It=function(){function e(){}return e.decorators=[{type:l.NgModule,args:[{imports:[re],declarations:T(St),exports:T(St)}]}],e}(),Ct=function(){function e(){this.DAYS_IN_WEEK=7}return e.prototype.setLocale=function(e){this.locale=e},e.prototype.isBetween=function(e,t,n){return 0<this.compareDates(e,t)&&this.compareDates(e,n)<0},e.prototype.isSameDaySafe=function(e,t){return e&&t&&this.isSameDay(e,t)},e.prototype.isSameMonthSafe=function(e,t){return e&&t&&this.isSameMonth(e,t)},e.prototype.isSameYearSafe=function(e,t){return e&&t&&this.isSameYear(e,t)},e}(),wt=function(e,o,i){return void 0===i&&(i=0),e.reduce(function(e,t,n){var r=Math.floor((n+i)/o);return e[r]||(e[r]=[]),e[r].push(t),e},[])},Ot=function(e,t){void 0===t&&(t=function(e){return e});for(var n=[],r=0;r<e;r++)n.push(t(r));return n},Tt=function(){function e(e){this.dateService=e}return e.prototype.createDaysGrid=function(e,t){void 0===t&&(t=!0);var n=this.createDates(e);return this.withBoundingMonths(n,e,t)},e.prototype.createDates=function(e){var t=this.createDateRangeForMonth(e),n=this.getStartOfWeekDayDiff(e);return wt(t,this.dateService.DAYS_IN_WEEK,n)},e.prototype.withBoundingMonths=function(e,t,n){var r=e;return this.isShouldAddPrevBoundingMonth(r)&&(r=this.addPrevBoundingMonth(r,t,n)),this.isShouldAddNextBoundingMonth(r)&&(r=this.addNextBoundingMonth(r,t,n)),r},e.prototype.addPrevBoundingMonth=function(e,t,n){var r=e.shift(),o=this.dateService.DAYS_IN_WEEK-r.length;return r.unshift.apply(r,T(this.createPrevBoundingDays(t,n,o))),T([r],e)},e.prototype.addNextBoundingMonth=function(e,t,n){var r=e.pop(),o=this.dateService.DAYS_IN_WEEK-r.length;return r.push.apply(r,T(this.createNextBoundingDays(t,n,o))),T(e,[r])},e.prototype.createPrevBoundingDays=function(e,t,n){var r=this.dateService.addMonth(e,-1),o=this.dateService.getNumberOfDaysInMonth(r);return this.createDateRangeForMonth(r).slice(o-n).map(function(e){return t?e:null})},e.prototype.createNextBoundingDays=function(e,t,n){var r=this.dateService.addMonth(e,1);return this.createDateRangeForMonth(r).slice(0,n).map(function(e){return t?e:null})},e.prototype.getStartOfWeekDayDiff=function(e){var t=this.dateService.getMonthStart(e);return this.getWeekStartDiff(t)},e.prototype.getWeekStartDiff=function(e){return(7-this.dateService.getFirstDayOfWeek()+this.dateService.getDayOfWeek(e))%7},e.prototype.isShouldAddPrevBoundingMonth=function(e){return e[0].length<this.dateService.DAYS_IN_WEEK},e.prototype.isShouldAddNextBoundingMonth=function(e){return e[e.length-1].length<this.dateService.DAYS_IN_WEEK},e.prototype.createDateRangeForMonth=function(r){var o=this,e=this.dateService.getNumberOfDaysInMonth(r);return Ot(e,function(e){var t=o.dateService.getYear(r),n=o.dateService.getMonth(r);return o.dateService.createDate(t,n,e+1)})},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:Ct}]},e}(),xt=function(n){function e(e){var t=n.call(this)||this;return t.setLocale(e),t}return I(e,n),e.prototype.setLocale=function(e){n.prototype.setLocale.call(this,e),this.datePipe=new g.DatePipe(e)},e.prototype.isValidDateString=function(e,t){return!isNaN(this.parse(e,t).getTime())},e.prototype.today=function(){return new Date},e.prototype.getDate=function(e){return e.getDate()},e.prototype.getMonth=function(e){return e.getMonth()},e.prototype.getYear=function(e){return e.getFullYear()},e.prototype.getDayOfWeek=function(e){return e.getDay()},e.prototype.getFirstDayOfWeek=function(){return g.getLocaleFirstDayOfWeek(this.locale)},e.prototype.getMonthName=function(e,t){void 0===t&&(t=g.TranslationWidth.Abbreviated);var n=e.getMonth();return this.getMonthNameByIndex(n,t)},e.prototype.getMonthNameByIndex=function(e,t){return void 0===t&&(t=g.TranslationWidth.Abbreviated),g.getLocaleMonthNames(this.locale,g.FormStyle.Format,t)[e]},e.prototype.getDayOfWeekNames=function(){return g.getLocaleDayNames(this.locale,g.FormStyle.Format,g.TranslationWidth.Short)},e.prototype.format=function(e,t){return this.datePipe.transform(e,t)},e.prototype.parse=function(e,t){return new Date(Date.parse(e))},e.prototype.addDay=function(e,t){return this.createDate(e.getFullYear(),e.getMonth(),e.getDate()+t)},e.prototype.addMonth=function(e,t){return this.createDate(e.getFullYear(),e.getMonth()+t,e.getDate())},e.prototype.addYear=function(e,t){return this.createDate(e.getFullYear()+t,e.getMonth(),e.getDate())},e.prototype.clone=function(e){return new Date(e.getTime())},e.prototype.compareDates=function(e,t){return e.getTime()-t.getTime()},e.prototype.createDate=function(e,t,n){var r=new Date(e,t,n);return 0<=e&&e<100&&r.setFullYear(r.getFullYear()-1900),r},e.prototype.getMonthEnd=function(e){return this.createDate(e.getFullYear(),e.getMonth()+1,0)},e.prototype.getMonthStart=function(e){return this.createDate(e.getFullYear(),e.getMonth(),1)},e.prototype.getNumberOfDaysInMonth=function(e){return this.getMonthEnd(e).getDate()},e.prototype.getYearEnd=function(e){return this.createDate(e.getFullYear(),11,31)},e.prototype.getYearStart=function(e){return this.createDate(e.getFullYear(),0,1)},e.prototype.isSameDay=function(e,t){return this.isSameMonth(e,t)&&e.getDate()===t.getDate()},e.prototype.isSameMonth=function(e,t){return this.isSameYear(e,t)&&e.getMonth()===t.getMonth()},e.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},e.decorators=[{type:l.Injectable}],e.ctorParameters=function(){return[{type:String,decorators:[{type:l.Inject,args:[l.LOCALE_ID]}]}]},e}(Ct),Pt=function(){function e(e,t){this.directionService=e,this.dateService=t,this.navigateToday=new l.EventEmitter,this.date=this.dateService.today()}return Object.defineProperty(e.prototype,"isRtl",{get:function(){return this.directionService.isRtl()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLtr",{get:function(){return this.directionService.isLtr()},enumerable:!0,configurable:!0}),e.decorators=[{type:l.Component,args:[{selector:"nb-calendar-header",template:'\n <div class="header">\n <span class="title" (click)="navigateToday.emit()">\n {{ date | date: \'mediumDate\' }}\n <i [ngClass]="{ \'nb-arrow-dropright\': isLtr, \'nb-arrow-dropleft\': isRtl }"></i>\n </span>\n <span class="sub-title">Today</span>\n </div>\n '}]}],e.ctorParameters=function(){return[{type:ee},{type:Ct}]},e.propDecorators={date:[{type:l.Input}],navigateToday:[{type:l.Output}]},e}(),Et=function(){function e(e){this.dateService=e,this.select=new l.EventEmitter(!0)}return Object.defineProperty(e.prototype,"today",{get:function(){return this.dateService.isSameDaySafe(this.date,this.dateService.today())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"boundingMonth",{get:function(){return!this.dateService.isSameMonthSafe(this.date,this.visibleDate)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this.dateService.isSameDaySafe(this.date,this.selectedValue)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return!this.date},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.smallerThanMin()||this.greaterThanMax()||this.dontFitFilter()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"day",{get:function(){return this.date&&this.dateService.getDate(this.date)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(){this.disabled||this.empty||this.select.emit(this.date)},e.prototype.smallerThanMin=function(){return this.date&&this.min&&this.dateService.compareDates(this.date,this.min)<0},e.prototype.greaterThanMax=function(){return this.date&&this.max&&0<this.dateService.compareDates(this.date,this.max)},e.prototype.dontFitFilter=function(){return this.date&&this.filter&&!this.filter(this.date)},e.decorators=[{type:l.Component,args:[{selector:"nb-calendar-day-cell",template:"{{ day }}",changeDetection:l.ChangeDetectionStrategy.OnPush,host:{"class":"day-cell"}}]}],e.ctorParameters=function(){return[{type:Ct}]},e.propDecorators={date:[{type:l.Input}],selectedValue:[{type:l.Input}],visibleDate:[{type:l.Input}],min:[{type:l.Input}],max:[{type:l.Input}],filter:[{type:l.Input}],select:[{type:l.Output}],today:[{type:l.HostBinding,args:["class.today"]}],boundingMonth:[{type:l.HostBinding,args:["class.bounding-month"]}],selected:[{type:l.HostBinding,args:["class.selected"]}],empty:[{type:l.HostBinding,args:["class.empty"]}],disabled:[{type:l.HostBinding,args:["class.disabled"]}],onClick:[{type:l.HostListener,args:["click"]}]},e}(),kt={YEAR:"year",MONTH:"month",DATE:"date"},Dt={MEDIUM:"medium",LARGE:"large"},At=function(){function e(e){this.dateService=e,this.select=new l.EventEmitter(!0)}return Object.defineProperty(e.prototype,"selected",{get:function(){return this.dateService.isSameYearSafe(this.date,this.selectedValue)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"today",{get:function(){return this.dateService.isSameYearSafe(this.date,this.dateService.today())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.smallerThanMin()||this.greaterThanMax()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"year",{get:function(){return this.dateService.getYear(this.date)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(){this.disabled||this.select.emit(this.date)},e.prototype.smallerThanMin=function(){return this.date&&this.min&&this.dateService.compareDates(this.yearEnd(),this.min)<0},e.prototype.greaterThanMax=function(){return this.date&&this.max&&0<this.dateService.compareDates(this.yearStart(),this.max)},e.prototype.yearStart=function(){return this.dateService.getYearStart(this.date)},e.prototype.yearEnd=function(){return this.dateService.getYearEnd(this.date)},e.decorators=[{type:l.Component,args:[{selector:"nb-calendar-year-cell",template:"{{ year }}",changeDetection:l.ChangeDetectionStrategy.OnPush,host:{"class":"year-cell"}}]}],e.ctorParameters=function(){return[{type:Ct}]},e.propDecorators={date:[{type:l.Input}],min:[{type:l.Input}],max:[{type:l.Input}],selectedValue:[{type:l.Input}],select:[{type:l.Output}],selected:[{type:l.HostBinding,args:["class.selected"]}],today:[{type:l.HostBinding,args:["class.today"]}],disabled:[{type:l.HostBinding,args:["class.disabled"]}],onClick:[{type:l.HostListener,args:["click"]}]},e}(),Mt=function(){function e(e){this.dateService=e,this.cellComponent=At,this.size=Dt.MEDIUM,this.yearChange=new l.EventEmitter}return Object.defineProperty(e.prototype,"_cellComponent",{set:function(e){e&&(this.cellComponent=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"medium",{get:function(){return this.size===Dt.MEDIUM},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"large",{get:function(){return this.size===Dt.LARGE},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){this.initYears()},e.prototype.initYears=function(){var t=this,e=this.dateService.getYear(this.ye