'use client';
import{jsx as r}from"react/jsx-runtime";import{useVariants as t,useSelectedOption as e}from"@gem-sdk/core";import a from"./Dropdown.js";import{useMemo as o}from"react";let VariantGroup=({...i})=>{let n=t(),{selectedOptions:m}=e(),p=o(()=>{let r=Object.keys(m||{}),t=n.find(t=>{let e=0;return r.forEach(r=>{let a=t?.selectedOptions.find(t=>t.name===r);a?.value===m?.[r]&&e++}),e===r.length});return t},[n,m]);return r(a,{variants:n,initValue:p?.id,variantGroup:i.variantGroup,...i})};export{VariantGroup as default};
