import{B as J,a as j,c as z,g as B,m as q,p as U}from"./chunk-4CAF5TCV.js";import{Ab as v,Ac as W,Bb as r,Cb as P,Cc as k,Db as N,Ga as a,Jg as K,Nc as X,Ob as R,Pb as V,Qa as O,Qb as L,Ra as A,Tb as x,Ub as F,Vb as y,Wb as $,X as I,Xa as m,Yb as G,Zb as H,aa as h,cb as w,db as c,ga as s,ha as u,ib as D,kb as C,lb as f,mb as p,nb as d,nc as T,sa as _,sb as S,wb as E,xb as b,yb as M}from"./chunk-WVVK4EBY.js";import{i as g}from"./chunk-LV2JZWXA.js";var Y=["*"],Z=i=>({"label-secondary":i}),ee=(i,n)=>({"btn-group":i,"btn-group-vertical":n}),Q=(i,n)=>n.id;function te(i,n){if(i&1&&(p(0,"label",5),R(1),d()),i&2){let e=r();c("for",e.inputId())("ngClass",G(3,Z,e.labelSecondary())),a(),V(e.label());}}function ie(i,n){if(i&1){let e=S();p(0,"input",6),y("ngModelChange",function(o){s(e);let l=r(2);return F(l.value,o)||(l.value=o),u(o);}),v("ngModelChange",function(){s(e);let o=r(2);return u(o.update());}),d(),p(1,"label",7),E(2,0),d();}if(i&2){let e=n.$implicit,t=r(2);c("name",t.inputId())("id",t.getRadioId(e))("value",e.id),x("ngModel",t.value),a(),c("for",t.getRadioId(e)),w("data-label",e.label),a(),b(e.label),M(2);}}function ne(i,n){if(i&1&&(p(0,"div",4),C(1,ie,3,7,null,null,Q),d()),i&2){let e=r();c("ngClass",H(1,ee,!e.isInMobileView(),e.isInMobileView())),a(),f(e.items());}}function oe(i,n){if(i&1&&(p(0,"div",12),R(1),d()),i&2){let e=r().$implicit;a(),L(" ",e.description," ");}}function ae(i,n){if(i&1){let e=S();p(0,"div",8)(1,"input",9),y("ngModelChange",function(o){s(e);let l=r(2);return F(l.value,o)||(l.value=o),u(o);}),v("ngModelChange",function(){s(e);let o=r(2);return u(o.update());}),d(),p(2,"label",10),E(3,1),d(),m(4,oe,2,1,"div",11),d();}if(i&2){let e=n.$implicit,t=r(2);a(),c("name",t.inputId())("id",t.getRadioId(e))("value",e.id),x("ngModel",t.value),a(),c("for",t.getRadioId(e)),a(),b(e.label),M(3),a(),c("ngIf",e.description);}}function re(i,n){if(i&1&&C(0,ae,5,7,"div",8,Q),i&2){let e=r();f(e.items());}}var ge=(()=>{let n=class n{items=_.required();inputId=_.required();label=_();isGroup=_(!1,{transform:T});labelSecondary=_(!1,{transform:T});screenService=h(K);value=O("");disabled=!1;wroteValue;propagateChange=t=>{};writeValue(t){this.value.set(t);}registerOnChange(t){this.propagateChange=t;}registerOnTouched(){}setDisabledState(t){this.disabled=t;}update(){this.propagateChange(this.value());}getRadioId(t){return this.inputId()+"-"+t.id;}isInMobileView(){return this.screenService.isInMobileView();}};g(n,"\u0275fac",function(o){return new(o||n)();}),g(n,"\u0275cmp",A({type:n,selectors:[["my-select-radio"]],inputs:{items:[1,"items"],inputId:[1,"inputId"],label:[1,"label"],isGroup:[1,"isGroup"],labelSecondary:[1,"labelSecondary"],value:[1,"value"]},outputs:{value:"valueChange"},features:[$([{provide:j,useExisting:I(()=>n),multi:!0}])],ngContentSelectors:Y,decls:5,vars:2,consts:()=>{let t;t="\n          "+"\uFFFD0\uFFFD"+"\n        ";let o;return o="\n          "+"\uFFFD0\uFFFD"+"\n        ",[t,o,["role","radiogroup"],[3,"for","ngClass",4,"ngIf"],["role","group",3,"ngClass"],[3,"for","ngClass"],["type","radio","autocomplete","off",1,"btn-check",3,"ngModelChange","name","id","value","ngModel"],[1,"btn","btn-outline-primary",3,"for"],[1,"peertube-radio-container"],["type","radio","autocomplete","off",3,"ngModelChange","name","id","value","ngModel"],[3,"for"],["class","form-group-description",4,"ngIf"],[1,"form-group-description"]];},template:function(o,l){o&1&&(P(),p(0,"div",2),m(1,te,2,5,"label",3),N(2),m(3,ne,3,4,"div",4)(4,re,2,0),d()),o&2&&(a(),c("ngIf",l.label()),a(2),D(l.isGroup()?3:4));},dependencies:[J,z,U,B,q,X,W,k],styles:[`label[_ngcontent-%COMP%]{display:block}label.label-secondary[_ngcontent-%COMP%]{font-size:1rem;font-weight:400;color:var(--fg)}.peertube-radio-container[_ngcontent-%COMP%]{margin-bottom:.25rem}.peertube-radio-container[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{margin-bottom:0}.btn-outline-primary[_ngcontent-%COMP%]:after{display:block;content:attr(data-label);font-weight:700;height:0;overflow:hidden;visibility:hidden}.btn-check[_ngcontent-%COMP%]:checked + .btn-outline-primary[_ngcontent-%COMP%]{font-weight:700;letter-spacing:0}
/*# sourceMappingURL=select-radio.component-OICWESBV.css.map */`]}));let i=n;return i;})();export{ge as a};/**i18n:b046b42d3b2db5c4a6153f28081b96130c38e9218feb7118271ff63b274934c4*///# sourceMappingURL=chunk-AUYLWMFE.js.map