var __spreadArray=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-55faf181.js";function toggleOption(e,t){if(e===void 0){e=[]}if(e.indexOf(t)>-1){return e.filter((function(e){return e!==t}))}else{return __spreadArray(__spreadArray([],e),[t])}}var DvnCheckboxGroup=function(){function e(e){registerInstance(this,e);this.change=createEvent(this,"change",7);this.scale="medium";this.value=[];this.disabled=false;this.inline=false;this.options=[];this.tint="primary"}e.prototype.render=function(){var e=this;var t=this.name||Math.random().toString(36).substr(2,5);return h(Host,null,this.options.map((function(n){return h("dvn-checkbox",{onChange:function(t){t.stopPropagation();e.change.emit(toggleOption(e.value,n.value))},checked:e.value.indexOf(n.value)>-1,value:n.value,label:n.label,name:t,inline:e.inline,disabled:e.disabled||n.disabled,scale:e.scale,tint:e.tint})})))};return e}();export{DvnCheckboxGroup as dvn_checkbox_group};