3.js 8.3 KB

1
  1. (window.webpackJsonpNVIV=window.webpackJsonpNVIV||[]).push([[3],{1866:function(e,t,n){"use strict";n.r(t),n.d(t,"AddPipe",(function(){return f})),n.d(t,"CalendarPipe",(function(){return a})),n.d(t,"DateFormatPipe",(function(){return s})),n.d(t,"DifferencePipe",(function(){return d})),n.d(t,"DurationPipe",(function(){return h})),n.d(t,"FromUnixPipe",(function(){return y})),n.d(t,"ParsePipe",(function(){return T})),n.d(t,"MomentModule",(function(){return C})),n.d(t,"SubtractPipe",(function(){return S})),n.d(t,"TimeAgoPipe",(function(){return x})),n.d(t,"UtcPipe",(function(){return A})),n.d(t,"FromUtcPipe",(function(){return w})),n.d(t,"LocalTimePipe",(function(){return M})),n.d(t,"LocalePipe",(function(){return D})),n.d(t,"ParseZonePipe",(function(){return I})),n.d(t,"IsBeforePipe",(function(){return b})),n.d(t,"IsAfterPipe",(function(){return v})),n.d(t,"NGX_MOMENT_OPTIONS",(function(){return l}));var r=n(0),i=n(1685),o=n(1),u=i,f=function(){function e(){}return e.prototype.transform=function(e,t,n){if(void 0===t||"number"==typeof t&&void 0===n)throw new Error("AddPipe: missing required arguments");return u(e).add(t,n)},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amAdd",type:e,pure:!0}),e}(),c=i,a=function(){function e(t,n){var r=this;this.cdRef=t,this.ngZone=n,e.initTimer(n),e.refs++,this.midnightSub=e.midnight.subscribe((function(){r.ngZone.run((function(){return r.cdRef.markForCheck()}))}))}return e.prototype.transform=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=null,o=null,u=0,f=t.length;u<f;u++)null!==t[u]&&("object"!=typeof t[u]||Object(i.isMoment)(t[u])?o=c(t[u]):r=t[u]);return c(e).calendar(o,r)},e.prototype.ngOnDestroy=function(){e.refs>0&&e.refs--,0===e.refs&&e.removeTimer(),this.midnightSub.unsubscribe()},e.initTimer=function(t){if(!e.midnight&&(e.midnight=new r.EventEmitter,"undefined"!=typeof window)){var n=e._getMillisecondsUntilUpdate();e.timer=t.runOutsideAngular((function(){return window.setTimeout((function(){e.midnight.emit(new Date),e.removeTimer(),e.initTimer(t)}),n)}))}},e.removeTimer=function(){e.timer&&(window.clearTimeout(e.timer),e.timer=null,e.midnight=null)},e._getMillisecondsUntilUpdate=function(){var e=c();return c().startOf("day").add(1,"days").valueOf()-e.valueOf()+1e3},e.refs=0,e.timer=null,e.midnight=null,e.ctorParameters=function(){return[{type:r.ChangeDetectorRef},{type:r.NgZone}]},e.ɵfac=function(t){return new(t||e)(r["ɵɵinjectPipeChangeDetectorRef"](),r["ɵɵdirectiveInject"](r.NgZone))},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amCalendar",type:e,pure:!1}),e}(),p=i,s=function(){function e(){}return e.prototype.transform=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e?p(e).format(t[0]):""},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amDateFormat",type:e,pure:!0}),e}(),m=i,d=function(){function e(){}return e.prototype.transform=function(e,t,n,r){var i=m(e),o=null!==t?m(t):m();return i.diff(o,n,r)},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amDifference",type:e,pure:!0}),e}(),l=new r.InjectionToken("NGX_MOMENT_OPTIONS"),h=function(){function e(e){this.allowedUnits=["ss","s","m","h","d","M"],this._applyOptions(e)}return e.prototype.transform=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(void 0===t||1!==t.length)throw new Error("DurationPipe: missing required time unit argument");return Object(i.duration)(e,t[0]).humanize()},e.prototype._applyOptions=function(e){var t=this;e&&(e.relativeTimeThresholdOptions&&Object.keys(e.relativeTimeThresholdOptions).filter((function(e){return-1!==t.allowedUnits.indexOf(e)})).forEach((function(t){Object(i.relativeTimeThreshold)(t,e.relativeTimeThresholdOptions[t])})))},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[l]}]}]},e.ɵfac=function(t){return new(t||e)(r["ɵɵdirectiveInject"](l,8))},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amDuration",type:e,pure:!0}),e}(),y=function(){function e(){}return e.prototype.transform=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"string"==typeof e&&(e=+e),Object(i.unix)(e)},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amFromUnix",type:e,pure:!0}),e}(),g=i,T=function(){function e(){}return e.prototype.transform=function(e,t){return g(e,t)},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amParse",type:e,pure:!0}),e}(),w=function(){function e(){}return e.prototype.transform=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return t?Object(i.utc)(e,t):Object(i.utc)(e)},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amFromUtc",type:e,pure:!0}),e}(),P=i,v=function(){function e(){}return e.prototype.transform=function(e,t,n){return P(e).isAfter(P(t),n)},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amIsAfter",type:e,pure:!0}),e}(),O=i,b=function(){function e(){}return e.prototype.transform=function(e,t,n){return O(e).isBefore(O(t),n)},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amIsBefore",type:e,pure:!0}),e}(),j=i,M=function(){function e(){}return e.prototype.transform=function(e){return j(e).local()},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amLocal",type:e,pure:!0}),e}(),U=i,D=function(){function e(){}return e.prototype.transform=function(e,t){return U(e).locale(t)},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amLocale",type:e,pure:!0}),e}(),I=function(){function e(){}return e.prototype.transform=function(e){return Object(i.parseZone)(e)},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amParseZone",type:e,pure:!0}),e}(),N=i,S=function(){function e(){}return e.prototype.transform=function(e,t,n){if(void 0===t||"number"==typeof t&&void 0===n)throw new Error("SubtractPipe: missing required arguments");return N(e).subtract(t,n)},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amSubtract",type:e,pure:!0}),e}(),Z=i,x=function(){function e(e,t){this.cdRef=e,this.ngZone=t}return e.prototype.format=function(e){return e.from(Z(),this.lastOmitSuffix)},e.prototype.transform=function(e,t,n){return this.hasChanged(e,t)?(this.lastTime=this.getTime(e),this.lastValue=e,this.lastOmitSuffix=t,this.lastLocale=this.getLocale(e),this.formatFn=n||this.format.bind(this),this.removeTimer(),this.createTimer(),this.lastText=this.formatFn(Z(e))):this.createTimer(),this.lastText},e.prototype.ngOnDestroy=function(){this.removeTimer()},e.prototype.createTimer=function(){var e=this;if(!this.currentTimer){var t=Z(this.lastValue),n=1e3*this.getSecondsUntilUpdate(t);this.currentTimer=this.ngZone.runOutsideAngular((function(){return"undefined"!=typeof window?window.setTimeout((function(){e.lastText=e.formatFn(Z(e.lastValue)),e.currentTimer=null,e.ngZone.run((function(){return e.cdRef.markForCheck()}))}),n):null}))}},e.prototype.removeTimer=function(){this.currentTimer&&(window.clearTimeout(this.currentTimer),this.currentTimer=null)},e.prototype.getSecondsUntilUpdate=function(e){var t=Math.abs(Z().diff(e,"minute"));return t<1?1:t<60?30:t<180?300:3600},e.prototype.hasChanged=function(e,t){return this.getTime(e)!==this.lastTime||this.getLocale(e)!==this.lastLocale||t!==this.lastOmitSuffix},e.prototype.getTime=function(e){return Object(i.isDate)(e)?e.getTime():Object(i.isMoment)(e)?e.valueOf():Z(e).valueOf()},e.prototype.getLocale=function(e){return Object(i.isMoment)(e)?e.locale():Object(i.locale)()},e.ctorParameters=function(){return[{type:r.ChangeDetectorRef},{type:r.NgZone}]},e.ɵfac=function(t){return new(t||e)(r["ɵɵinjectPipeChangeDetectorRef"](),r["ɵɵdirectiveInject"](r.NgZone))},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amTimeAgo",type:e,pure:!1}),e}(),F=i,A=function(){function e(){}return e.prototype.transform=function(e){return F(e).utc()},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=r["ɵɵdefinePipe"]({name:"amUtc",type:e,pure:!0}),e}(),C=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[{provide:l,useValue:Object(o.a)({},t)}]}},e.ɵmod=r["ɵɵdefineNgModule"]({type:e}),e.ɵinj=r["ɵɵdefineInjector"]({factory:function(t){return new(t||e)}}),("undefined"==typeof ngJitMode||ngJitMode)&&r["ɵɵsetNgModuleScope"](e,{declarations:[f,a,s,d,h,y,T,S,x,A,w,M,D,I,b,v],exports:[f,a,s,d,h,y,T,S,x,A,w,M,D,I,b,v]}),e}()}}]);