import{d as ee,e as ce,fa as ne,i as ie,j as ae,na as pe}from"./chunk-QH7CG3K4.js";import{Ha as Y,Ia as y,Ja as Z,La as re}from"./chunk-5YPL7P3G.js";import{D as W,K as X,m as U,p as G,t as J}from"./chunk-HJI5FNS6.js";import{$c as Q,Ac as x,Bb as p,Bc as I,Bd as L,Dc as u,Hc as d,Ic as r,Ja as M,Jc as O,Ka as s,Kc as R,La as l,Ld as q,Oa as C,Rb as S,Rc as w,Sb as D,Sd as H,Tc as T,Ua as b,Uc as k,Vb as F,Xb as m,Yc as B,_c as N,jc as _,kc as c,kd as K,lc as j,nc as z,oc as f,ta as $,ua as E,wb as P,xc as h,yc as g,za as V,zc as A}from"./chunk-XJKQ67XR.js";import{e as oe}from"./chunk-SZAW6ZBW.js";function me(e,a){if(e&1){let i=u();h(0,"img",4),d("error",function(t){s(i);let o=r();return l(o.imageError(t))}),g()}if(e&2){let i=r();c("src",i.image,P)("alt",i.alt)}}function _e(e,a){if(e&1&&A(0,"span",6),e&2){let i=r(2);f(i.icon),c("ngClass","p-chip-icon"),_("data-pc-section","icon")}}function he(e,a){if(e&1&&m(0,_e,1,4,"span",5),e&2){let i=r();c("ngIf",i.icon)}}function ge(e,a){if(e&1&&(h(0,"div",7),N(1),g()),e&2){let i=r();_("data-pc-section","label"),p(),Q(i.label)}}function fe(e,a){if(e&1){let i=u();h(0,"span",11),d("click",function(t){s(i);let o=r(3);return l(o.close(t))})("keydown",function(t){s(i);let o=r(3);return l(o.onKeydown(t))}),g()}if(e&2){let i=r(3);f(i.removeIcon),c("ngClass","p-chip-remove-icon"),_("data-pc-section","removeicon")("aria-label",i.removeAriaLabel)}}function ue(e,a){if(e&1){let i=u();h(0,"TimesCircleIcon",12),d("click",function(t){s(i);let o=r(3);return l(o.close(t))})("keydown",function(t){s(i);let o=r(3);return l(o.onKeydown(t))}),g()}if(e&2){let i=r(3);f("p-chip-remove-icon"),_("data-pc-section","removeicon")("aria-label",i.removeAriaLabel)}}function de(e,a){if(e&1&&(x(0),m(1,fe,1,5,"span",9)(2,ue,1,4,"TimesCircleIcon",10),I()),e&2){let i=r(2);p(),c("ngIf",i.removeIcon),p(),c("ngIf",!i.removeIcon)}}function ve(e,a){}function ye(e,a){e&1&&m(0,ve,0,0,"ng-template")}function Ce(e,a){if(e&1){let i=u();h(0,"span",13),d("click",function(t){s(i);let o=r(2);return l(o.close(t))})("keydown",function(t){s(i);let o=r(2);return l(o.onKeydown(t))}),m(1,ye,1,0,null,14),g()}if(e&2){let i=r(2);_("data-pc-section","removeicon")("aria-label",i.removeAriaLabel),p(),c("ngTemplateOutlet",i.removeIconTemplate||i._removeIconTemplate)}}function be(e,a){if(e&1&&(x(0),m(1,de,3,2,"ng-container",3)(2,Ce,2,3,"span",8),I()),e&2){let i=r();p(),c("ngIf",!i.removeIconTemplate&&!i._removeIconTemplate),p(),c("ngIf",i.removeIconTemplate||i._removeIconTemplate)}}var se,le,xe,Ie,te,we,Ke,Te=oe(()=>{X();X();H();H();re();ae();pe();ce();se=["removeicon"],le=["*"];xe=({dt:e})=>`
.p-chip {
    display: inline-flex;
    align-items: center;
    background: ${e("chip.background")};
    color: ${e("chip.color")};
    border-radius: ${e("chip.border.radius")};
    padding: ${e("chip.padding.y")} ${e("chip.padding.x")};
    gap: ${e("chip.gap")};
}

.p-chip-icon {
    color: ${e("chip.icon.color")};
    font-size: ${e("chip.icon.font.size")};
    width: ${e("chip.icon.size")};
    height: ${e("chip.icon.size")};
}

.p-chip-image {
    border-radius: 50%;
    width: ${e("chip.image.width")};
    height: ${e("chip.image.height")};
    margin-left: calc(-1 * ${e("chip.padding.y")});
}

.p-chip:has(.p-chip-remove-icon) {
    padding-inline-end: ${e("chip.padding.y")};
}

.p-chip:has(.p-chip-image) {
    padding-top: calc(${e("chip.padding.y")} / 2);
    padding-bottom: calc(${e("chip.padding.y")} / 2);
}

.p-chip-remove-icon {
    cursor: pointer;
    font-size: ${e("chip.remove.icon.font.size")};
    width: ${e("chip.remove.icon.size")};
    height: ${e("chip.remove.icon.size")};
    color: ${e("chip.remove.icon.color")};
    border-radius: 50%;
    transition: outline-color ${e("chip.transition.duration")}, box-shadow ${e("chip.transition.duration")};
    outline-color: transparent;
}

.p-chip-remove-icon:focus-visible {
    box-shadow: ${e("chip.remove.icon.focus.ring.shadow")};
    outline: ${e("chip.remove.icon.focus.ring.width")} ${e("chip.remove.icon.focus.ring.style")} ${e("chip.remove.icon.focus.ring.color")};
    outline-offset: ${e("chip.remove.icon.focus.ring.offset")};
}
`,Ie={root:"p-chip p-component",image:"p-chip-image",icon:"p-chip-icon",label:"p-chip-label",removeIcon:"p-chip-remove-icon"},te=(()=>{class e extends ee{name="chip";theme=xe;classes=Ie;static \u0275fac=(()=>{let i;return function(t){return(i||(i=C(e)))(t||e)}})();static \u0275prov=$({token:e,factory:e.\u0275fac})}return e})(),we=(()=>{class e extends ie{label;icon;image;alt;style;styleClass;removable=!1;removeIcon;onRemove=new b;onImageError=new b;visible=!0;get removeAriaLabel(){return this.config.getTranslation(Z.ARIA).removeLabel}get chipProps(){return this._chipProps}set chipProps(i){this._chipProps=i,i&&typeof i=="object"&&Object.entries(i).forEach(([n,t])=>this[`_${n}`]!==t&&(this[`_${n}`]=t))}_chipProps;_componentStyle=V(te);removeIconTemplate;templates;_removeIconTemplate;ngAfterContentInit(){this.templates.forEach(i=>{switch(i.getType()){case"removeicon":this._removeIconTemplate=i.template;break;default:this._removeIconTemplate=i.template;break}})}ngOnChanges(i){if(super.ngOnChanges(i),i.chipProps&&i.chipProps.currentValue){let{currentValue:n}=i.chipProps;n.label!==void 0&&(this.label=n.label),n.icon!==void 0&&(this.icon=n.icon),n.image!==void 0&&(this.image=n.image),n.alt!==void 0&&(this.alt=n.alt),n.style!==void 0&&(this.style=n.style),n.styleClass!==void 0&&(this.styleClass=n.styleClass),n.removable!==void 0&&(this.removable=n.removable),n.removeIcon!==void 0&&(this.removeIcon=n.removeIcon)}}containerClass(){let i="p-chip p-component";return this.styleClass&&(i+=` ${this.styleClass}`),i}close(i){this.visible=!1,this.onRemove.emit(i)}onKeydown(i){(i.key==="Enter"||i.key==="Backspace")&&this.close(i)}imageError(i){this.onImageError.emit(i)}static \u0275fac=(()=>{let i;return function(t){return(i||(i=C(e)))(t||e)}})();static \u0275cmp=S({type:e,selectors:[["p-chip"]],contentQueries:function(n,t,o){if(n&1&&(w(o,se,4),w(o,Y,4)),n&2){let v;T(v=k())&&(t.removeIconTemplate=v.first),T(v=k())&&(t.templates=v)}},hostVars:9,hostBindings:function(n,t){n&2&&(_("data-pc-name","chip")("aria-label",t.label)("data-pc-section","root"),z(t.style),f(t.containerClass()),j("display",!t.visible&&"none"))},inputs:{label:"label",icon:"icon",image:"image",alt:"alt",style:"style",styleClass:"styleClass",removable:[2,"removable","removable",q],removeIcon:"removeIcon",chipProps:"chipProps"},outputs:{onRemove:"onRemove",onImageError:"onImageError"},features:[K([te]),F,M],ngContentSelectors:le,decls:6,vars:4,consts:[["iconTemplate",""],["class","p-chip-image",3,"src","alt","error",4,"ngIf","ngIfElse"],["class","p-chip-label",4,"ngIf"],[4,"ngIf"],[1,"p-chip-image",3,"error","src","alt"],[3,"class","ngClass",4,"ngIf"],[3,"ngClass"],[1,"p-chip-label"],["tabindex","0","class","p-chip-remove-icon","role","button",3,"click","keydown",4,"ngIf"],["tabindex","0","role","button",3,"class","ngClass","click","keydown",4,"ngIf"],["tabindex","0","role","button",3,"class","click","keydown",4,"ngIf"],["tabindex","0","role","button",3,"click","keydown","ngClass"],["tabindex","0","role","button",3,"click","keydown"],["tabindex","0","role","button",1,"p-chip-remove-icon",3,"click","keydown"],[4,"ngTemplateOutlet"]],template:function(n,t){if(n&1&&(O(),R(0),m(1,me,1,2,"img",1)(2,he,1,1,"ng-template",null,0,L)(4,ge,2,2,"div",2)(5,be,3,2,"ng-container",3)),n&2){let o=B(3);p(),c("ngIf",t.image)("ngIfElse",o),p(3),c("ngIf",t.label),p(),c("ngIf",t.removable)}},dependencies:[W,U,G,J,ne,y],encapsulation:2,changeDetection:0})}return e})(),Ke=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=D({type:e});static \u0275inj=E({imports:[we,y,y]})}return e})()});export{we as a,Ke as b,Te as c};
