-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathchunk-2AMPNA6K.js
More file actions
1 lines (1 loc) · 8.01 KB
/
chunk-2AMPNA6K.js
File metadata and controls
1 lines (1 loc) · 8.01 KB
1
import{Ad as ie,Eb as te,Gb as ne,Hd as se,Nd as oe,Od as ae,Sa as q,Ta as J,Za as Q,ob as X,qa as Z,yb as Y,zb as ee}from"./chunk-OIF5WC2R.js";import{$b as j,Aa as w,Bb as v,Bd as S,Db as z,F as D,Fb as R,Gc as V,Hc as W,Ib as P,Ic as K,Jc as _,Ma as g,N,Xb as b,Zb as L,ac as k,ad as $,bc as H,cc as m,dc as p,ec as h,fc as r,g as d,ha as E,hb as O,jc as U,kc as B,ma as a,mc as G,nb as l,sc as y,ta as A,ua as x,vc as T,ya as F,zb as C}from"./chunk-PPIYYLX2.js";import{a as c,b as M}from"./chunk-H4BOUERG.js";var re=(t,o)=>({$implicit:t,data:o});function ce(t,o){t&1&&r(0,"nz-icon",3)}function le(t,o){t&1&&r(0,"nz-icon",4)}function me(t,o){t&1&&r(0,"nz-icon",5)}function pe(t,o){t&1&&r(0,"nz-icon",6)}function de(t,o){t&1&&r(0,"nz-icon",7)}function he(t,o){if(t&1&&(U(0),r(1,"span",9),B()),t&2){let e=T();l(),m("innerHTML",e.instance.content,O)}}function ue(t,o){if(t&1){let e=G();p(0,"nz-message",2),y("destroyed",function(i){A(e);let s=T();return x(s.remove(i.id,i.userAction))}),h()}if(t&2){let e=o.$implicit;m("instance",e)}}var fe=0,I=class{container;nzSingletonService=a(Q);injector=a(F);remove(o){this.container&&(o?this.container.remove(o):this.container.removeAll())}getInstanceId(){return`${this.componentPrefix}-${fe++}`}withContainer(o){let e=this.nzSingletonService.getSingletonWithKey(this.componentPrefix);if(e)return e;let n=ae(this.injector,{hasBackdrop:!1,scrollStrategy:se(),positionStrategy:oe(this.injector)}),i=new ie(o,null,this.injector),s=n.attach(i),f=n.hostElement;return f.style.zIndex="1010",e||(this.container=e=s.instance,this.nzSingletonService.registerSingletonWithKey(this.componentPrefix,e),this.container.afterAllInstancesRemoved.subscribe(()=>{this.container=void 0,this.nzSingletonService.unregisterSingletonWithKey(this.componentPrefix),n.dispose()})),e}},ge=(()=>{class t{config;instances=[];_afterAllInstancesRemoved=new d;afterAllInstancesRemoved=this._afterAllInstancesRemoved.asObservable();cdr=a(S);nzConfigService=a(q);constructor(){this.subscribeConfigChange()}create(e){let n=this.onCreate(e);return this.instances.length>=this.config.nzMaxStack&&(this.instances=this.instances.slice(1)),this.instances=[...this.instances,n],this.readyInstances(),n}remove(e,n=!1){this.instances.map((i,s)=>({index:s,instance:i})).filter(({instance:i})=>i.messageId===e).forEach(({index:i,instance:s})=>{this.instances.splice(i,1),this.instances=[...this.instances],this.onRemove(s,n),this.readyInstances()}),this.instances.length||this.onAllInstancesRemoved()}removeAll(){this.instances.forEach(e=>this.onRemove(e,!1)),this.instances=[],this.readyInstances(),this.onAllInstancesRemoved()}onCreate(e){return e.options=this.mergeOptions(e.options),e.onClose=new d,e}onRemove(e,n){e.onClose.next(n),e.onClose.complete()}onAllInstancesRemoved(){this._afterAllInstancesRemoved.next(),this._afterAllInstancesRemoved.complete()}readyInstances(){this.cdr.detectChanges()}mergeOptions(e){let{nzDuration:n,nzAnimate:i,nzPauseOnHover:s}=this.config;return c({nzDuration:n,nzAnimate:i,nzPauseOnHover:s},e)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=v({type:t})}return t})(),Ce=(()=>{class t{cdr=a(S);destroyRef=a(w);animationStateChanged=new d;options;autoClose;closeTimer;userAction=!1;eraseTimer;eraseTimingStart;eraseTTL;constructor(){this.destroyRef.onDestroy(()=>{this.autoClose&&this.clearEraseTimeout(),this.animationStateChanged.complete()})}ngOnInit(){this.options=this.instance.options,this.options.nzAnimate&&(this.instance.state="enter",this.animationStateChanged.pipe(D(e=>e.phaseName==="done"&&e.toState==="leave"),N(1)).subscribe(()=>{clearTimeout(this.closeTimer),this.destroyed.next({id:this.instance.messageId,userAction:this.userAction})})),this.autoClose=this.options.nzDuration>0,this.autoClose&&(this.initErase(),this.startEraseTimeout())}onEnter(){this.autoClose&&this.options.nzPauseOnHover&&(this.clearEraseTimeout(),this.updateTTL())}onLeave(){this.autoClose&&this.options.nzPauseOnHover&&this.startEraseTimeout()}destroy(e=!1){this.userAction=e,this.options.nzAnimate?(this.instance.state="leave",this.cdr.detectChanges(),this.closeTimer=setTimeout(()=>{this.closeTimer=void 0,this.destroyed.next({id:this.instance.messageId,userAction:e})},200)):this.destroyed.next({id:this.instance.messageId,userAction:e})}initErase(){this.eraseTTL=this.options.nzDuration,this.eraseTimingStart=Date.now()}updateTTL(){this.autoClose&&(this.eraseTTL-=Date.now()-this.eraseTimingStart)}startEraseTimeout(){this.eraseTTL>0?(this.clearEraseTimeout(),this.eraseTimer=setTimeout(()=>this.destroy(),this.eraseTTL),this.eraseTimingStart=Date.now()):this.destroy()}clearEraseTimeout(){this.eraseTimer!==null&&(clearTimeout(this.eraseTimer),this.eraseTimer=void 0)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=v({type:t})}return t})(),ve=(()=>{class t extends Ce{instance;destroyed=new P;index;static \u0275fac=(()=>{let e;return function(i){return(e||(e=g(t)))(i||t)}})();static \u0275cmp=C({type:t,selectors:[["nz-message"]],inputs:{instance:"instance"},outputs:{destroyed:"destroyed"},exportAs:["nzMessage"],features:[z],decls:9,vars:13,consts:[[1,"ant-message-notice",3,"mouseenter","mouseleave"],[1,"ant-message-notice-content"],[1,"ant-message-custom-content"],["nzType","check-circle"],["nzType","info-circle"],["nzType","exclamation-circle"],["nzType","close-circle"],["nzType","loading"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[3,"innerHTML"]],template:function(n,i){if(n&1&&(p(0,"div",0),y("@moveUpMotion.done",function(f){return i.animationStateChanged.next(f)})("mouseenter",function(){return i.onEnter()})("mouseleave",function(){return i.onLeave()}),p(1,"div",1)(2,"div",2),b(3,ce,1,0,"nz-icon",3)(4,le,1,0,"nz-icon",4)(5,me,1,0,"nz-icon",5)(6,pe,1,0,"nz-icon",6)(7,de,1,0,"nz-icon",7),R(8,he,2,1,"ng-container",8),h()()()),n&2){let s;K(i.instance.options==null?null:i.instance.options.nzStyle),_(i.instance.options==null?null:i.instance.options.nzClass),m("@moveUpMotion",i.instance.state),l(2),_("ant-message-"+i.instance.type),l(),L((s=i.instance.type)==="success"?3:s==="info"?4:s==="warning"?5:s==="error"?6:s==="loading"?7:-1),l(5),m("nzStringTemplateOutlet",i.instance.content)("nzStringTemplateOutletContext",$(10,re,i,i.instance.options==null?null:i.instance.options.nzData))}},dependencies:[ne,te,ee,Y],encapsulation:2,data:{animation:[X]},changeDetection:0})}return t})(),u="message",ze={nzAnimate:!0,nzDuration:3e3,nzMaxStack:7,nzPauseOnHover:!0,nzTop:24,nzDirection:"ltr"},ye=(()=>{class t extends ge{dir=this.nzConfigService.getConfigForComponent(u)?.nzDirection||"ltr";top;constructor(){super(),this.updateConfig()}subscribeConfigChange(){J(u,()=>{this.updateConfig(),this.dir=this.nzConfigService.getConfigForComponent(u)?.nzDirection||this.dir})}updateConfig(){this.config=c(c(c({},ze),this.config),this.nzConfigService.getConfigForComponent(u)),this.top=Z(this.config.nzTop),this.cdr.markForCheck()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=C({type:t,selectors:[["nz-message-container"]],exportAs:["nzMessageContainer"],features:[z],decls:3,vars:4,consts:[[1,"ant-message"],[3,"instance"],[3,"destroyed","instance"]],template:function(n,i){n&1&&(p(0,"div",0),k(1,ue,1,1,"nz-message",1,j),h()),n&2&&(V("top",i.top),W("ant-message-rtl",i.dir==="rtl"),l(),H(i.instances))},dependencies:[ve],encapsulation:2,changeDetection:0})}return t})(),Be=(()=>{class t extends I{componentPrefix="message-";success(e,n){return this.createInstance({type:"success",content:e},n)}error(e,n){return this.createInstance({type:"error",content:e},n)}info(e,n){return this.createInstance({type:"info",content:e},n)}warning(e,n){return this.createInstance({type:"warning",content:e},n)}loading(e,n){return this.createInstance({type:"loading",content:e},n)}create(e,n,i){return this.createInstance({type:e,content:n},i)}createInstance(e,n){return this.container=this.withContainer(ye),this.container.create(M(c({},e),{createdAt:new Date,messageId:this.getInstanceId(),options:n}))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=g(t)))(i||t)}})();static \u0275prov=E({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{I as a,ge as b,Ce as c,Be as d};