import{Ya as y,q as P}from"./chunk-AWFGQCOU.js";import{Y as O,aa as I,ya as M}from"./chunk-UNUNR43V.js";import{Ab as g,Ac as p,Bc as x,Cc as k,Ea as b,Fb as h,Sb as m,Tb as s,Vb as l,cc as a,dc as r,ec as _,gd as w,mb as o,oc as f,pc as d,qc as v,rb as c,rc as C}from"./chunk-AO7NUUXN.js";var D=["*"];function V(t,u){if(t&1&&(a(0,"div",5),p(1),r()),t&2){let e=d();l("short",e.shortHeader),o(),x(e.header)}}function R(t,u){if(t&1&&(a(0,"div",6),p(1),r()),t&2){let e=d();l("short",e.shortSubtext),s("ngClass",e.externalSubtextClass),o(),k(" ",e.subtext," ")}}function T(t,u){if(t&1&&_(0,"wk-radio",7),t&2){let e=d();s("value",e.value)("selectedValue",e.selectedValue)("disabled",e.isDisabled)}}var L=(()=>{class t{set selectedValue(e){e!=null&&(this._selectedValue=e)}get isDisabled(){return this.disabled||this._isDisabled}get selectedValue(){return(this.control?.value||this._selectedValue)??""}get checked(){return this.value===this.selectedValue||this.control?.value&&this.value===this.control.value}get control(){return this._ngControl?.control}constructor(e,i){this._cdr=e,this._ngControl=i,this.shortHeader=!0,this.shortSubtext=!0,this.enableRadio=!0,this.disabled=!1,this.changed=new b,this._isDisabled=!1,this._selectedValue="",this._ngControl&&(this._ngControl.valueAccessor=this)}ngOnInit(){this.control&&this.control.valueChanges.subscribe(()=>{this._cdr.markForCheck()})}writeValue(e){this.selectedValue=e,this._onChange?.(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._isDisabled=e,this._cdr.detectChanges()}selectRadio(){this.isDisabled||(this._onTouched?.(),this._onChange?.(this.value),this.changed.emit(this.value))}static{this.\u0275fac=function(i){return new(i||t)(c(w),c(P,10))}}static{this.\u0275cmp=g({type:t,selectors:[["tis-option-item"]],inputs:{value:"value",header:"header",subtext:"subtext",shortHeader:"shortHeader",shortSubtext:"shortSubtext",externalSubtextClass:"externalSubtextClass",enableRadio:"enableRadio",selectedValue:"selectedValue",disabled:"disabled",token:"token"},outputs:{changed:"changed"},ngContentSelectors:D,decls:6,vars:8,consts:[["tabindex","0","role","radio",1,"option",3,"click","keydown.enter"],[1,"content"],["class","header",3,"short",4,"ngIf"],["class","subtext",3,"short","ngClass",4,"ngIf"],["tabIndex","-1","class","radio",3,"value","selectedValue","disabled",4,"ngIf"],[1,"header"],[1,"subtext",3,"ngClass"],["tabIndex","-1",1,"radio",3,"value","selectedValue","disabled"]],template:function(i,n){i&1&&(v(),a(0,"div",0),f("click",function(){return n.selectRadio()})("keydown.enter",function(){return n.selectRadio()}),a(1,"div",1),h(2,V,2,3,"div",2)(3,R,2,4,"div",3),C(4),r(),h(5,T,1,3,"wk-radio",4),r()),i&2&&(l("disabled",n.isDisabled)("open",n.checked),m("data-token",n.token),o(2),s("ngIf",n.header),o(),s("ngIf",n.subtext),o(2),s("ngIf",n.enableRadio))},dependencies:[M,O,I,y],styles:["[_nghost-%COMP%]{width:100%;display:block;height:fit-content;margin-bottom:var(--space-vertical-xxs)}.option[_ngcontent-%COMP%]{width:100%;padding:10px 8px;border-radius:var(--radius-medium);display:flex;flex-wrap:nowrap;gap:var(--space-horizontal-snudge);align-items:center;justify-content:space-between;cursor:pointer;transition:background-color .2s}.option[_ngcontent-%COMP%]   .radio[_ngcontent-%COMP%]{flex-shrink:0;padding-top:0;padding-bottom:0}.option[_ngcontent-%COMP%]:focus{background:var(--list-item-bg-focused);outline:none}.option[_ngcontent-%COMP%]:hover, .option.open[_ngcontent-%COMP%]{background:var(--list-item-bg-hover)}.option.disabled[_ngcontent-%COMP%]{cursor:default;background:transparent;color:var(--list-item-color-disabled)}.option.disabled[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%], .option.disabled[_ngcontent-%COMP%]   .subtext[_ngcontent-%COMP%]{color:var(--list-item-color-disabled)}.content[_ngcontent-%COMP%]{width:100%}.header[_ngcontent-%COMP%]{font:var(--font-body-1);color:var(--list-item-color)}.header.short[_ngcontent-%COMP%]{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;word-break:break-word}.subtext[_ngcontent-%COMP%]{font:var(--font-caption-1)}.subtext.short[_ngcontent-%COMP%]{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;word-break:break-word}"],changeDetection:0})}}return t})();export{L as a};
