import{S as T,i as j,s as z,e as w,k as S,d as H,a as d,t as q,b as g,f as k,l as K,g as J,h as m,o as v,q as C,u as y,v as B,w as G,m as L,z as O,J as A,B as F,H as I,K as M,L as N,E as P,D as Q}from"./index.c156a17d.js";import{B as R}from"./Block.dfe8f898.js";import{B as U}from"./BlockTitle.58147fe7.js";import{S as V}from"./StatusTracker.f0d63e01.js";function D(a,e,t){const l=a.slice();return l[9]=e[t],l[11]=t,l}function W(a){let e;return{c(){e=H(a[3])},m(t,l){g(t,e,l)},p(t,l){l&8&&J(e,t[3])},d(t){t&&m(e)}}}function E(a){let e,t,l,u,c,o=a[9]+"",n,r,b;function s(){return a[7](a[9])}return{c(){e=w("label"),t=w("input"),u=S(),c=w("span"),n=H(o),t.disabled=a[2],t.checked=l=a[0].includes(a[9]),d(t,"type","checkbox"),d(t,"name","test"),d(t,"class","rounded border-gray-300 text-blue-600 disabled:text-gray-400 disabled:cursor-not-allowed shadow-sm focus:border-blue-300 focus:ring focus:ring-offset-0 focus:ring-blue-200 focus:ring-opacity-50"),d(c,"class","ml-2"),d(e,"class","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(e,"!cursor-not-allowed",a[2])},m(f,i){g(f,e,i),k(e,t),k(e,u),k(e,c),k(c,n),r||(b=K(t,"change",s),r=!0)},p(f,i){a=f,i&4&&(t.disabled=a[2]),i&3&&l!==(l=a[0].includes(a[9]))&&(t.checked=l),i&2&&o!==(o=a[9]+"")&&J(n,o),i&4&&q(e,"!cursor-not-allowed",a[2])},d(f){f&&m(e),r=!1,b()}}}function X(a){let e,t,l,u;e=new U({props:{show_label:a[5],$$slots:{default:[W]},$$scope:{ctx:a}}});let c=a[1],o=[];for(let n=0;n<c.length;n+=1)o[n]=E(D(a,c,n));return{c(){v(e.$$.fragment),t=S(),l=w("div");for(let n=0;n<o.length;n+=1)o[n].c();d(l,"class","flex flex-wrap gap-2"),d(l,"data-testid","checkbox-group"),d(l,"style",a[4])},m(n,r){C(e,n,r),g(n,t,r),g(n,l,r);for(let b=0;b<o.length;b+=1)o[b].m(l,null);u=!0},p(n,[r]){const b={};if(r&32&&(b.show_label=n[5]),r&4104&&(b.$$scope={dirty:r,ctx:n}),e.$set(b),r&71){c=n[1];let s;for(s=0;s<c.length;s+=1){const f=D(n,c,s);o[s]?o[s].p(f,r):(o[s]=E(f),o[s].c(),o[s].m(l,null))}for(;s<o.length;s+=1)o[s].d(1);o.length=c.length}(!u||r&16)&&d(l,"style",n[4])},i(n){u||(y(e.$$.fragment,n),u=!0)},o(n){B(e.$$.fragment,n),u=!1},d(n){G(e,n),n&&m(t),n&&m(l),L(o,n)}}}function Y(a,e,t){let{value:l=[]}=e,{choices:u}=e,{disabled:c=!1}=e,{label:o}=e,{style:n=""}=e,{show_label:r}=e;const b=O(),s=i=>{l.includes(i)?l.splice(l.indexOf(i),1):l.push(i),b("change",l),t(0,l)},f=i=>s(i);return a.$$set=i=>{"value"in i&&t(0,l=i.value),"choices"in i&&t(1,u=i.choices),"disabled"in i&&t(2,c=i.disabled),"label"in i&&t(3,o=i.label),"style"in i&&t(4,n=i.style),"show_label"in i&&t(5,r=i.show_label)},[l,u,c,o,n,r,s,f]}class Z extends T{constructor(e){super(),j(this,e,Y,X,z,{value:0,choices:1,disabled:2,label:3,style:4,show_label:5})}}function p(a){let e,t,l,u,c;const o=[a[7]];let n={};for(let s=0;s<o.length;s+=1)n=A(n,o[s]);e=new V({props:n});function r(s){a[9](s)}let b={choices:a[1],style:a[3],label:a[4],show_label:a[6],disabled:a[2]==="static"};return a[0]!==void 0&&(b.value=a[0]),l=new Z({props:b}),F.push(()=>I(l,"value",r)),l.$on("change",a[10]),{c(){v(e.$$.fragment),t=S(),v(l.$$.fragment)},m(s,f){C(e,s,f),g(s,t,f),C(l,s,f),c=!0},p(s,f){const i=f&128?M(o,[N(s[7])]):{};e.$set(i);const h={};f&2&&(h.choices=s[1]),f&8&&(h.style=s[3]),f&16&&(h.label=s[4]),f&64&&(h.show_label=s[6]),f&4&&(h.disabled=s[2]==="static"),!u&&f&1&&(u=!0,h.value=s[0],P(()=>u=!1)),l.$set(h)},i(s){c||(y(e.$$.fragment,s),y(l.$$.fragment,s),c=!0)},o(s){B(e.$$.fragment,s),B(l.$$.fragment,s),c=!1},d(s){G(e,s),s&&m(t),G(l,s)}}}function x(a){let e,t;return e=new R({props:{form_position:a[5],type:"fieldset",$$slots:{default:[p]},$$scope:{ctx:a}}}),{c(){v(e.$$.fragment)},m(l,u){C(e,l,u),t=!0},p(l,[u]){const c={};u&32&&(c.form_position=l[5]),u&2271&&(c.$$scope={dirty:u,ctx:l}),e.$set(c)},i(l){t||(y(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){G(e,l)}}}function $(a,e,t){let{value:l=[]}=e,{default_value:u=[]}=e,{choices:c}=e,{mode:o}=e,{style:n=""}=e,{label:r="Checkbox Group"}=e,{form_position:b="single"}=e,{show_label:s}=e,{loading_status:f}=e;u&&(l=u);function i(_){l=_,t(0,l)}function h(_){Q.call(this,a,_)}return a.$$set=_=>{"value"in _&&t(0,l=_.value),"default_value"in _&&t(8,u=_.default_value),"choices"in _&&t(1,c=_.choices),"mode"in _&&t(2,o=_.mode),"style"in _&&t(3,n=_.style),"label"in _&&t(4,r=_.label),"form_position"in _&&t(5,b=_.form_position),"show_label"in _&&t(6,s=_.show_label),"loading_status"in _&&t(7,f=_.loading_status)},[l,c,o,n,r,b,s,f,u,i,h]}class ee extends T{constructor(e){super(),j(this,e,$,x,z,{value:0,default_value:8,choices:1,mode:2,style:3,label:4,form_position:5,show_label:6,loading_status:7})}}var ne=ee;const oe=["static","dynamic"];export{ne as Component,oe as modes};
