import{d as S}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-GFXNKJ5U.js";import{a as P}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-YAHMRLQ4.js";import{a as V}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-34QOOIQ4.js";import{a as s}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-LL6AKNEK.js";import{a as N}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-LQ2PFFE3.js";import{d as l}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-H7QMOPDN.js";var d=l(s());function k({disabled:t=!1}){return(0,d.jsxs)("svg",{className:"h-[32px] w-[32px]",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,d.jsx)("rect",{width:"32",height:"32",rx:"8",fill:"white"}),(0,d.jsx)("path",{d:"M23 15H9C8.4 15 8 15.4 8 16C8 16.6 8.4 17 9 17H23C23.6 17 24 16.6 24 16C24 15.4 23.6 15 23 15Z",fill:"black"})]})}var a=l(s());function B({disabled:t=!1}){return(0,a.jsxs)("svg",{className:"h-[32px] w-[32px]",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("rect",{width:"32",height:"32",rx:"8",fill:"white"}),(0,a.jsx)("g",{clipPath:"url(#clip0_1884_13173)",children:(0,a.jsx)("path",{d:"M23 15H17V9C17 8.4 16.6 8 16 8C15.4 8 15 8.4 15 9V15H9C8.4 15 8 15.4 8 16C8 16.6 8.4 17 9 17H15V23C15 23.6 15.4 24 16 24C16.6 24 17 23.6 17 23V17H23C23.6 17 24 16.6 24 16C24 15.4 23.6 15 23 15Z",fill:"black"})}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"clip0_1884_13173",children:(0,a.jsx)("rect",{width:"16",height:"16",fill:"white",transform:"translate(8 8)"})})})]})}var v=l(N());var u=l(s()),C=({item:t,defaultValue:p,availableValues:e,currentValue:o,changeOptionValue:r,className:c,dropdownClassName:h,label:g=!0,orientation:i="down"})=>{let n=m=>{r(m)};return(0,v.useEffect)(()=>{o||r(t.values.length===1?t.values[0]:p)},[]),(0,v.useEffect)(()=>{e.length&&!e.includes(o)&&r(e[0])},[e]),t.name.toLowerCase()==="title"?null:(0,u.jsxs)("div",{className:V("flex flex-col gap-3",c),children:[g&&(0,u.jsx)("p",{children:t.name}),(0,u.jsx)(S.Dropdown,{items:e,select:n,current:o,className:h,orientation:i})]},t.id)};var b=(t,p,e,o=0)=>{if(o===p)return t;let r=t.filter(c=>c.selectedOptions[o].value===e?.[o]);return b(r,p,e,o+1)};var O=l(s()),z=({variants:t,options:p,changeOptionValue:e,getDefaultOptionValue:o,optionValues:r,orientation:c="down",label:h=!0})=>{let g=P(t);return p.length?p.map((i,n)=>{if(n===0){let f=i.values.filter(w=>g.some(y=>y.selectedOptions.some(H=>H.value===w)));return(0,O.jsx)(C,{changeOptionValue:w=>e(n,w),currentValue:r[n],defaultValue:o(i.name),item:i,availableValues:f,label:h,orientation:c},JSON.stringify(i.values)+n)}let m=b(g,n,r).map(f=>f.selectedOptions?.[n].value),x=new Set(m);return(0,O.jsx)(C,{changeOptionValue:f=>e(n,f),defaultValue:o(i.name),item:i,currentValue:r[n],availableValues:[...x],label:h,orientation:c},i.id+n)}):""};export{k as a,B as b,C as c,b as d,z as e};