import"./DsnmJJEf.js";import{o as S,s as q}from"./DP6lo9Eo.js";import{b as z,G as A,p as B,v as U,g as r,u as C,j as D,f as x,m as E,s as c,c as _,r as d,t as j,h as g,a as H}from"./DaF1Dxyz.js";import{i as J}from"./DBNwVM39.js";import{g as K,c as N,e as O}from"./M_R3-ht0.js";import{r as Q,s as h,a as V,c as W}from"./IFJnBvGa.js";import{i as X,j as Y}from"./CWmDRfqq.js";import{p as v}from"./qWzGFQ66.js";function Z(p,e,i){e()(i())}var $=x('<div class="h-2 w-2 rounded-full bg-blue-500"></div>'),ee=x('<div class="relative"><input class="absolute inset-y-0 w-4 appearance-none" type="radio"/> <label class="flex items-center"><div><!></div> </label></div>'),ae=x('<!> <div class="mb-2 flex gap-2" role="radiogroup"></div>',1);function ne(p,e){const i=A();B(e,!0);const k=[];let a=v(e,"value",15),y=v(e,"disabled",3,!1),w=v(e,"unsetIfInvalid",3,!1),L=v(e,"onUpdate",3,()=>{}),n=C(()=>e.options.map(l=>typeof l=="string"?{label:l,value:l}:l));U(()=>{w()&&(r(n).some(l=>l.value===a())||a(e.default??(r(n)[0]?.value||"")))}),S(()=>{e.urlParam!==void 0&&a(K(e.urlParam)??a())}),U(()=>{e.urlParam!==void 0&&(a(),D().then(()=>N(e.urlParam,a())))});var I=ae(),P=E(I);X(P,{get labelId(){return i},get label(){return e.label},get helpText(){return e.helpText}});var f=c(P,2);O(f,21,()=>r(n),l=>l.value,(l,t)=>{var m=ee(),s=_(m);Q(s),s.__change=[Z,L,a];var R,o=c(s,2),u=_(o),T=_(u);{var F=b=>{var M=$();g(b,M)};J(T,b=>{a()===r(t).value&&b(F)})}d(u);var G=c(u);d(o),d(m),j(()=>{h(s,"id","radio-"+r(t).value),s.disabled=y(),R!==(R=r(t).value)&&(s.value=(s.__value=r(t).value)??""),h(o,"for","radio-"+r(t).value),V(u,1,W(["me-2 flex h-4 w-4 items-center justify-center rounded-full border-2",!y()&&a()===r(t).value?"border-blue-500":"border-gray-400 dark:border-gray-600"])),q(G,` ${r(t).label??""}`)}),Y(k,[],s,()=>(r(t).value,a()),a),g(l,m)}),d(f),j(()=>h(f,"aria-labelledby",i)),g(p,I),H()}z(["change"]);export{ne as R};
