import{S as D,i as E,s as T,e as k,k as G,d as z,a as b,t as S,b as h,f as g,l as O,g as H,h as m,o as v,q as w,u as y,v as C,w as B,m as j,z as A,B as F,H as I,E as J,D as K}from"./index.3c784113.js";import{B as L}from"./Block.1239058b.js";import{B as M}from"./BlockTitle.0ab46369.js";import{S as N}from"./StatusTracker.eec9373b.js";function p(s,e,l){const t=s.slice();return t[8]=e[l],t[10]=l,t}function P(s){let e;return{c(){e=z(s[3])},m(l,t){h(l,e,t)},p(l,t){t&8&&H(e,l[3])},d(l){l&&m(e)}}}function q(s){let e,l,t,f,c,i=s[8]+"",a,n,u;function r(){return s[6](s[8])}return{c(){e=k("label"),l=k("input"),f=G(),c=k("span"),a=z(i),l.disabled=s[2],l.checked=t=s[0].includes(s[8]),b(l,"type","checkbox"),b(l,"name","test"),b(l,"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"),b(c,"class","ml-2"),b(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"),S(e,"!cursor-not-allowed",s[2])},m(o,_){h(o,e,_),g(e,l),g(e,f),g(e,c),g(c,a),n||(u=O(l,"change",r),n=!0)},p(o,_){s=o,_&4&&(l.disabled=s[2]),_&3&&t!==(t=s[0].includes(s[8]))&&(l.checked=t),_&2&&i!==(i=s[8]+"")&&H(a,i),_&4&&S(e,"!cursor-not-allowed",s[2])},d(o){o&&m(e),n=!1,u()}}}function Q(s){let e,l,t,f;e=new M({props:{$$slots:{default:[P]},$$scope:{ctx:s}}});let c=s[1],i=[];for(let a=0;a<c.length;a+=1)i[a]=q(p(s,c,a));return{c(){v(e.$$.fragment),l=G(),t=k("div");for(let a=0;a<i.length;a+=1)i[a].c();b(t,"class","flex flex-wrap gap-2"),b(t,"data-testid","checkbox-group")},m(a,n){w(e,a,n),h(a,l,n),h(a,t,n);for(let u=0;u<i.length;u+=1)i[u].m(t,null);f=!0},p(a,[n]){const u={};if(n&2056&&(u.$$scope={dirty:n,ctx:a}),e.$set(u),n&23){c=a[1];let r;for(r=0;r<c.length;r+=1){const o=p(a,c,r);i[r]?i[r].p(o,n):(i[r]=q(o),i[r].c(),i[r].m(t,null))}for(;r<i.length;r+=1)i[r].d(1);i.length=c.length}},i(a){f||(y(e.$$.fragment,a),f=!0)},o(a){C(e.$$.fragment,a),f=!1},d(a){B(e,a),a&&m(l),a&&m(t),j(i,a)}}}function R(s,e,l){let{value:t=[]}=e,{choices:f}=e,{disabled:c=!1}=e,{label:i}=e,{style:a=""}=e;const n=A(),u=o=>{t.includes(o)?t.splice(t.indexOf(o),1):t.push(o),n("change",t),l(0,t)},r=o=>u(o);return s.$$set=o=>{"value"in o&&l(0,t=o.value),"choices"in o&&l(1,f=o.choices),"disabled"in o&&l(2,c=o.disabled),"label"in o&&l(3,i=o.label),"style"in o&&l(5,a=o.style)},[t,f,c,i,u,a,r]}class U extends D{constructor(e){super(),E(this,e,R,Q,T,{value:0,choices:1,disabled:2,label:3,style:5})}}function V(s){let e,l,t,f,c;e=new N({props:{tracked_status:s[6]}});function i(n){s[8](n)}let a={choices:s[1],style:s[3],label:s[4],disabled:s[2]==="static"};return s[0]!==void 0&&(a.value=s[0]),t=new U({props:a}),F.push(()=>I(t,"value",i)),t.$on("change",s[9]),{c(){v(e.$$.fragment),l=G(),v(t.$$.fragment)},m(n,u){w(e,n,u),h(n,l,u),w(t,n,u),c=!0},p(n,u){const r={};u&64&&(r.tracked_status=n[6]),e.$set(r);const o={};u&2&&(o.choices=n[1]),u&8&&(o.style=n[3]),u&16&&(o.label=n[4]),u&4&&(o.disabled=n[2]==="static"),!f&&u&1&&(f=!0,o.value=n[0],J(()=>f=!1)),t.$set(o)},i(n){c||(y(e.$$.fragment,n),y(t.$$.fragment,n),c=!0)},o(n){C(e.$$.fragment,n),C(t.$$.fragment,n),c=!1},d(n){B(e,n),n&&m(l),B(t,n)}}}function W(s){let e,l;return e=new L({props:{form_position:s[5],type:"fieldset",$$slots:{default:[V]},$$scope:{ctx:s}}}),{c(){v(e.$$.fragment)},m(t,f){w(e,t,f),l=!0},p(t,[f]){const c={};f&32&&(c.form_position=t[5]),f&1119&&(c.$$scope={dirty:f,ctx:t}),e.$set(c)},i(t){l||(y(e.$$.fragment,t),l=!0)},o(t){C(e.$$.fragment,t),l=!1},d(t){B(e,t)}}}function X(s,e,l){let{value:t=[]}=e,{default_value:f=[]}=e,{choices:c}=e,{mode:i}=e,{style:a=""}=e,{label:n="Checkbox Group"}=e,{form_position:u="single"}=e,{loading_status:r}=e;f&&(t=f);function o(d){t=d,l(0,t)}function _(d){K.call(this,s,d)}return s.$$set=d=>{"value"in d&&l(0,t=d.value),"default_value"in d&&l(7,f=d.default_value),"choices"in d&&l(1,c=d.choices),"mode"in d&&l(2,i=d.mode),"style"in d&&l(3,a=d.style),"label"in d&&l(4,n=d.label),"form_position"in d&&l(5,u=d.form_position),"loading_status"in d&&l(6,r=d.loading_status)},[t,c,i,a,n,u,r,f,o,_]}class Y extends D{constructor(e){super(),E(this,e,X,W,T,{value:0,default_value:7,choices:1,mode:2,style:3,label:4,form_position:5,loading_status:6})}}var te=Y;const le=["static","dynamic"];export{te as Component,le as modes};
