import"./CWj6FrbW.js";import{p as L,b as M,f as U,d,r as n,s as g,i as x,c as O,u as P,g as s}from"./CZBSCAq2.js";import{s as w}from"./BkjlwMHH.js";import{p as D,i as E}from"./DU61YhRX.js";import{e as Q,i as R}from"./B0glBihA.js";import{p as T,t as f,a as v,b as N}from"./BI1irte-.js";import{r as V,s as j}from"./DtRK3t_J.js";import{d as W}from"./DqKNatLn.js";import{s as X}from"./CTGZnkue.js";import{a as Y}from"./WgdeJtfK.js";function Z(u,e,t,_){s(e)?t([]):t(_.elements),_.onUpdate(t())}function $(u,e,t){e.onUpdate(t())}var ee=f('<div class="text-muted">No elements available to select.</div>'),ae=f('<div class="form-check form-check-inline"><input class="form-check-input" type="checkbox"> <label class="form-check-label"> </label></div>'),te=f('<button class="btn btn-outline-primary btn-sm"><!></button> <!>',1),ie=f('<div class="h3"> </div> <div class="form-group"><!></div>',1);function fe(u,e){const t=T();L(e,!0);const _=[];let c=D(e,"value",31,()=>M(e.elements)),k=D(e,"disabled",3,!1),y=P(()=>c().length==e.elements.length);var A=ie(),b=U(A),q=d(b,!0);n(b);var C=g(b,2),z=d(C);{var B=r=>{var m=ee();v(r,m)},F=r=>{var m=te(),o=U(m);o.__click=[Z,y,c,e],X(o,"",{},{"min-width":"100px"});var G=d(o);{var H=i=>{var a=N("Deselect all");v(i,a)},I=i=>{var a=N("Select all");v(i,a)};E(G,i=>{s(y)?i(H):i(I,!1)})}n(o);var J=g(o,2);Q(J,17,()=>e.elements,R,(i,a)=>{var h=ae(),l=d(h);V(l);var S;l.__change=[$,e,c];var p=g(l,2),K=d(p,!0);n(p),n(h),x(()=>{j(l,"id",`${s(a)}Checkbox${t}`),S!==(S=s(a))&&(l.value=(l.__value=s(a))??""),l.disabled=k(),j(p,"for",`${s(a)}Checkbox${t}`),w(K,s(a))}),Y(_,[],l,()=>(s(a),c()),c),v(i,h)}),x(()=>o.disabled=k()),v(r,m)};E(z,r=>{e.elements.length==0?r(B):r(F,!1)})}n(C),x(()=>w(q,e.label)),v(u,A),O()}W(["click","change"]);export{fe as A};
