import"./CWj6FrbW.js";import{p as D,j as i,b as k,r as s,l as U,c as N,a as V,i as W,g as v,f as X}from"./C8SLBV5c.js";import{s as j}from"./DoZZLr3H.js";import{p as q,f as p,a as n,t as T,c as Y}from"./CkybfRqV.js";import{r as z,s as _}from"./DVWfzEL5.js";import{d as F}from"./DhOWJd6e.js";import{a as Z,b as $}from"./DywZ3GX-.js";import{p as u,i as B}from"./hCS139x6.js";import{e as ee,i as ae}from"./C0O8QyND.js";function te(d,e){var a;(a=e.onUpdate)==null||a.call(e)}var le=p('<div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch"/> <label class="form-check-label"> </label></div>');function ge(d,e){q(),D(e,!0);let a=u(e,"value",15),f=u(e,"texts",19,()=>["on","off"]);var l=le(),r=i(l);z(r),r.__change=[te,e];var m=k(r,2),h=i(m,!0);s(m),s(l),U(()=>{_(r,"id",e.formId),_(m,"for",e.formId),j(h,a()?f()[0]:f()[1])}),Z(r,a),n(d,l),N()}F(["change"]);function ie(d,e,a,f,l){v(e)?a([]):a(f.elements),l()(a())}function se(d,e,a){e()(a())}var re=p('<div class="text-muted">No elements available to select.</div>'),ce=p('<div class="form-check form-check-inline"><input class="form-check-input" type="checkbox"/> <label class="form-check-label"> </label></div>'),oe=p('<div class="row mb-2"><div class="col-sm-3 d-flex justify-content-between"><label class="form-label fw-medium fs-4"> </label> <div><button class="btn btn-outline-primary btn-sm align-self-baseline px-3"><!></button></div></div> <div class="col-sm-9 form-group"><!></div></div>');function xe(d,e){const a=q();D(e,!0);const f=[];let l=u(e,"value",31,()=>V(e.elements)),r=u(e,"disabled",3,!1),m=u(e,"onUpdate",3,()=>{}),h=W(()=>l().length==e.elements.length);var w=oe(),y=i(w),g=i(y),G=i(g,!0);s(g);var E=k(g,2),x=i(E);x.__click=[ie,h,l,e,m];var H=i(x);{var J=t=>{var c=T("Deselect all");n(t,c)},K=t=>{var c=T("Select all");n(t,c)};B(H,t=>{v(h)?t(J):t(K,!1)})}s(x),s(E),s(y);var I=k(y,2),L=i(I);{var M=t=>{var c=re();n(t,c)},O=t=>{var c=Y(),P=X(c);ee(P,17,()=>e.elements,ae,(Q,b)=>{var A=ce(),o=i(A);z(o);var S;o.__change=[se,m,l];var C=k(o,2),R=i(C,!0);s(C),s(A),U(()=>{_(o,"id",`${v(b)}Checkbox${a}`),S!==(S=v(b))&&(o.value=(o.__value=v(b))??""),o.disabled=r(),_(C,"for",`${v(b)}Checkbox${a}`),j(R,v(b))}),$(f,[],o,()=>(v(b),l()),l),n(Q,A)}),n(t,c)};B(L,t=>{e.elements.length==0?t(M):t(O,!1)})}s(I),s(w),U(()=>{_(g,"for","checkbox"+a),j(G,e.label),x.disabled=r()}),n(d,w),N()}F(["click","change"]);export{xe as A,ge as T};
