import{S as A,i as D,s as F,f as w,m as S,h as I,b as m,t as j,c as d,d as k,l as L,j as K,e as g,q as v,u as C,v as y,w as B,x as G,o as M,A as O,K as p,C as z,I as H,L as J,M as N,F as P,E as Q}from"./index.35088c78.js";import{s as q}from"./styles.bc3c1b88.js";import{B as R}from"./BlockTitle.4e24ec96.js";import{B as U}from"./Block.8bbb0afe.js";import{S as V}from"./StatusTracker.1a97f223.js";function E(a,e,t){const l=a.slice();return l[9]=e[t],l[11]=t,l}function W(a){let e;return{c(){e=I(a[4])},m(t,l){d(t,e,l)},p(t,l){l&16&&K(e,t[4])},d(t){t&&g(e)}}}function T(a){let e,t,l,f,i,o=a[9]+"",n,u,h,s;function _(){return a[7](a[9])}return{c(){e=w("label"),t=w("input"),f=S(),i=w("span"),n=I(o),t.disabled=a[3],t.checked=l=a[0].includes(a[9]),m(t,"type","checkbox"),m(t,"name","test"),m(t,"class","gr-check-radio gr-checkbox"),m(i,"class","ml-2"),m(e,"class",u="flex items-center text-gray-700 text-sm space-x-2 border py-1.5 px-3 rounded-lg cursor-pointer bg-white shadow-sm checked:shadow-inner"+q(a[1])),j(e,"!cursor-not-allowed",a[3])},m(c,b){d(c,e,b),k(e,t),k(e,f),k(e,i),k(i,n),h||(s=L(t,"change",_),h=!0)},p(c,b){a=c,b&8&&(t.disabled=a[3]),b&5&&l!==(l=a[0].includes(a[9]))&&(t.checked=l),b&4&&o!==(o=a[9]+"")&&K(n,o),b&2&&u!==(u="flex items-center text-gray-700 text-sm space-x-2 border py-1.5 px-3 rounded-lg cursor-pointer bg-white shadow-sm checked:shadow-inner"+q(a[1]))&&m(e,"class",u),b&10&&j(e,"!cursor-not-allowed",a[3])},d(c){c&&g(e),h=!1,s()}}}function X(a){let e,t,l,f;e=new R({props:{show_label:a[5],$$slots:{default:[W]},$$scope:{ctx:a}}});let i=a[2],o=[];for(let n=0;n<i.length;n+=1)o[n]=T(E(a,i,n));return{c(){v(e.$$.fragment),t=S(),l=w("div");for(let n=0;n<o.length;n+=1)o[n].c();m(l,"class","flex flex-wrap gap-2"),m(l,"data-testid","checkbox-group")},m(n,u){C(e,n,u),d(n,t,u),d(n,l,u);for(let h=0;h<o.length;h+=1)o[h].m(l,null);f=!0},p(n,[u]){const h={};if(u&32&&(h.show_label=n[5]),u&4112&&(h.$$scope={dirty:u,ctx:n}),e.$set(h),u&79){i=n[2];let s;for(s=0;s<i.length;s+=1){const _=E(n,i,s);o[s]?o[s].p(_,u):(o[s]=T(_),o[s].c(),o[s].m(l,null))}for(;s<o.length;s+=1)o[s].d(1);o.length=i.length}},i(n){f||(y(e.$$.fragment,n),f=!0)},o(n){B(e.$$.fragment,n),f=!1},d(n){G(e,n),n&&g(t),n&&g(l),M(o,n)}}}function Y(a,e,t){let{value:l=[]}=e,{style:f={}}=e,{choices:i}=e,{disabled:o=!1}=e,{label:n}=e,{show_label:u}=e;const h=O(),s=c=>{l.includes(c)?l.splice(l.indexOf(c),1):l.push(c),h("change",l),t(0,l)},_=c=>s(c);return a.$$set=c=>{"value"in c&&t(0,l=c.value),"style"in c&&t(1,f=c.style),"choices"in c&&t(2,i=c.choices),"disabled"in c&&t(3,o=c.disabled),"label"in c&&t(4,n=c.label),"show_label"in c&&t(5,u=c.show_label)},[l,f,i,o,n,u,s,_]}class Z extends A{constructor(e){super(),D(this,e,Y,X,F,{value:0,style:1,choices:2,disabled:3,label:4,show_label:5})}}function x(a){let e,t,l,f,i;const o=[a[8]];let n={};for(let s=0;s<o.length;s+=1)n=p(n,o[s]);e=new V({props:n});function u(s){a[9](s)}let h={choices:a[2],label:a[5],style:a[3],show_label:a[7],disabled:a[4]==="static"};return a[0]!==void 0&&(h.value=a[0]),l=new Z({props:h}),z.push(()=>H(l,"value",u)),l.$on("change",a[10]),{c(){v(e.$$.fragment),t=S(),v(l.$$.fragment)},m(s,_){C(e,s,_),d(s,t,_),C(l,s,_),i=!0},p(s,_){const c=_&256?J(o,[N(s[8])]):{};e.$set(c);const b={};_&4&&(b.choices=s[2]),_&32&&(b.label=s[5]),_&8&&(b.style=s[3]),_&128&&(b.show_label=s[7]),_&16&&(b.disabled=s[4]==="static"),!f&&_&1&&(f=!0,b.value=s[0],P(()=>f=!1)),l.$set(b)},i(s){i||(y(e.$$.fragment,s),y(l.$$.fragment,s),i=!0)},o(s){B(e.$$.fragment,s),B(l.$$.fragment,s),i=!1},d(s){G(e,s),s&&g(t),G(l,s)}}}function $(a){let e,t;return e=new U({props:{form_position:a[6],elem_id:a[1],style:a[3],type:"fieldset",$$slots:{default:[x]},$$scope:{ctx:a}}}),{c(){v(e.$$.fragment)},m(l,f){C(e,l,f),t=!0},p(l,[f]){const i={};f&64&&(i.form_position=l[6]),f&2&&(i.elem_id=l[1]),f&8&&(i.style=l[3]),f&2493&&(i.$$scope={dirty:f,ctx:l}),e.$set(i)},i(l){t||(y(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){G(e,l)}}}function ee(a,e,t){let{elem_id:l=""}=e,{value:f=[]}=e,{choices:i}=e,{style:o={}}=e,{mode:n}=e,{label:u="Checkbox Group"}=e,{form_position:h="single"}=e,{show_label:s}=e,{loading_status:_}=e;function c(r){f=r,t(0,f)}function b(r){Q.call(this,a,r)}return a.$$set=r=>{"elem_id"in r&&t(1,l=r.elem_id),"value"in r&&t(0,f=r.value),"choices"in r&&t(2,i=r.choices),"style"in r&&t(3,o=r.style),"mode"in r&&t(4,n=r.mode),"label"in r&&t(5,u=r.label),"form_position"in r&&t(6,h=r.form_position),"show_label"in r&&t(7,s=r.show_label),"loading_status"in r&&t(8,_=r.loading_status)},[f,l,i,o,n,u,h,s,_,c,b]}class le extends A{constructor(e){super(),D(this,e,ee,$,F,{elem_id:1,value:0,choices:2,style:3,mode:4,label:5,form_position:6,show_label:7,loading_status:8})}}var ie=le;const ce=["static","dynamic"];export{ie as Component,ce as modes};
