import{Ga as I,Ha as V,L as O,N as E,O as R,P as S,Q as j,a as B}from"./chunk-3CM4SKDO.js";import{Da as C,Fb as f,Fc as N,Gb as m,Gc as D,Oa as z,Ra as g,Wb as k,Yb as y,cc as _,dc as v,lc as T,nb as p,oa as c,rc as a,sa as r,sb as s,uc as M,ud as w,vc as P,wc as b,ya as d,yb as u,yd as l,za as h}from"./chunk-4BRW6LCZ.js";var x=["*"];function A(o,H){if(o&1){let t=T();_(0,"nz-icon",1),a("click",function(e){d(t);let i=M();return h(i.closeTag(e))}),v()}}var F=(()=>{class o{cdr=r(w);renderer=r(u);el=r(g).nativeElement;directionality=r(B);destroyRef=r(C);nzMode="default";nzColor;nzChecked=!1;nzBordered=!0;nzOnClose=new s;nzCheckedChange=new s;dir="ltr";isPresetColor=!1;updateCheckedStatus(){this.nzMode==="checkable"&&(this.nzChecked=!this.nzChecked,this.nzCheckedChange.emit(this.nzChecked))}closeTag(t){this.nzOnClose.emit(t),t.defaultPrevented||this.renderer.removeChild(this.renderer.parentNode(this.el),this.el)}clearPresetColor(){let t=new RegExp(`(ant-tag-(?:${[...R,...E].join("|")}))`,"g"),n=this.el.classList.toString(),e=[],i=t.exec(n);for(;i!==null;)e.push(i[1]),i=t.exec(n);this.el.classList.remove(...e)}setPresetColor(){this.clearPresetColor(),this.nzColor?this.isPresetColor=S(this.nzColor)||j(this.nzColor):this.isPresetColor=!1,this.isPresetColor&&this.el.classList.add(`ant-tag-${this.nzColor}`)}ngOnInit(){this.directionality.change?.pipe(O(this.destroyRef)).subscribe(t=>{this.dir=t,this.cdr.detectChanges()}),this.dir=this.directionality.value}ngOnChanges(t){let{nzColor:n}=t;n&&this.setPresetColor()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=f({type:o,selectors:[["nz-tag"]],hostAttrs:[1,"ant-tag"],hostVars:12,hostBindings:function(n,e){n&1&&a("click",function(){return e.updateCheckedStatus()}),n&2&&(N("background-color",e.isPresetColor?"":e.nzColor),D("ant-tag-has-color",e.nzColor&&!e.isPresetColor)("ant-tag-checkable",e.nzMode==="checkable")("ant-tag-checkable-checked",e.nzChecked)("ant-tag-rtl",e.dir==="rtl")("ant-tag-borderless",!e.nzBordered))},inputs:{nzMode:"nzMode",nzColor:"nzColor",nzChecked:[2,"nzChecked","nzChecked",l],nzBordered:[2,"nzBordered","nzBordered",l]},outputs:{nzOnClose:"nzOnClose",nzCheckedChange:"nzCheckedChange"},exportAs:["nzTag"],features:[z],ngContentSelectors:x,decls:2,vars:1,consts:[["nzType","close","tabindex","-1",1,"ant-tag-close-icon"],["nzType","close","tabindex","-1",1,"ant-tag-close-icon",3,"click"]],template:function(n,e){n&1&&(P(),b(0),k(1,A,1,0,"nz-icon",0)),n&2&&(p(),y(e.nzMode==="closeable"?1:-1))},dependencies:[V,I],encapsulation:2,changeDetection:0})}return o})(),te=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=m({type:o});static \u0275inj=c({imports:[F]})}return o})();export{F as a,te as b};
