import{p as e,H as t,c as i,h as c,t as s}from"./p-CHfEnK-2.js";import{d as a}from"./p-DxZayX2R.js";import{d as l}from"./p-B5hDbbCP.js";const h=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ifxChipItemSelect=i(this,"ifxChipItemSelect",5)}get chipItem(){return this}ifxChipItemSelect;value=void 0;chipState={emitIfxChipItemSelect:!0,variant:"multi",size:"large"};selected=!1;updateItemSelection(e){if("single"===this.chipState.variant){const t=e.target;this.chipItem!==t&&this.chipItem.parentElement===t.parentElement&&(this.selected=!1)}}validateSelected(e,t){e!==t&&(this.chipState.emitIfxChipItemSelect?this.emitIfxChipItemSelectEvent():this.chipState.emitIfxChipItemSelect=!0)}getItemLabel(){return this.chipItem.innerText}toggleItemSelection(){this.selected=!this.selected}emitIfxChipItemSelectEvent(e=!0){this.ifxChipItemSelect.emit({emitIfxChange:e,key:this.chipState.key,label:this.getItemLabel(),selected:this.selected,value:this.value})}handleItemClick(){this.toggleItemSelection()}handleItemKeyDown(e){"Enter"!==e.code&&"Space"!==e.code||this.toggleItemSelection()}handleSelectedState(){this.selected&&this.emitIfxChipItemSelectEvent(!1)}componentWillLoad(){this.handleSelectedState()}render(){return c("div",{key:"981d58d270509d5cfebcd7eb6ae670d05fae9d6e",class:`chip-item chip-item--${this.chipState.size} \n                    chip-item--${"single"===(this.selected&&this.chipState.variant)?"selected":""}`,tabIndex:0,onClick:()=>{this.handleItemClick()},onKeyDown:e=>{this.handleItemKeyDown(e)},role:"option","aria-selected":this.selected.toString()},"multi"===this.chipState.variant&&c("ifx-checkbox",{key:"e731be959fbf3c07c6c45097b668b32fcbbedaca",checked:this.selected,tabIndex:-1,size:"s"}),c("div",{key:"b87fa6a5c3099e1a8ad566f25e793fa8836cd883",class:"chip-item__label"}," ",c("slot",{key:"20a4dd0e12f940907a7da4a742bc39c66306d01a"})," "),c("div",{key:"413f5dbeeea4d0b05b6e57611e0cf83846b1c292",class:"chip-item__selected-indicator"},c("ifx-icon",{key:"c040b07c497de6213ce35ba655e6fcb5d490c16a",icon:"check-16"}," ")))}static get watchers(){return{selected:[{validateSelected:0}]}}static get style(){return'.chip-item{display:flex;align-items:center;gap:8px;padding:8px 16px;user-select:none;transition:all 100ms ease;transition-property:background, color}.chip-item:hover{cursor:pointer;background-color:#EEEDED}.chip-item:active{background-color:#BFBBBB}.chip-item:focus{outline:2px solid #0A8276}.chip-item.chip-item--large{font:400 1rem/1.5rem "Source Sans 3"}.chip-item.chip-item--small{font:400 0.875rem/1.25rem "Source Sans 3"}.chip-item.chip-item--selected{color:#0A8276}.chip-item.chip-item--selected .chip-item__selected-indicator{display:block}.chip-item__selected-indicator{display:none;margin-left:auto}'}},[769,"ifx-chip-item",{value:[1],chipState:[16],selected:[1540]},[[16,"ifxChipItemSelect","updateItemSelection"]],{selected:[{validateSelected:0}]}]);function o(){"undefined"!=typeof customElements&&["ifx-chip-item","ifx-checkbox","ifx-icon"].forEach((e=>{switch(e){case"ifx-chip-item":customElements.get(s(e))||customElements.define(s(e),h);break;case"ifx-checkbox":customElements.get(s(e))||a();break;case"ifx-icon":customElements.get(s(e))||l()}}))}export{h as C,o as d}