import{i as m,U as f,I as h,y as b,Q as C,C as g,o as k}from"./index-BbBXKozi.js";const u=await m("react"),{createContext:v,useContext:x,useMemo:c,useState:E}=u;let p=v(null);function d(){let n=x(p);if(n===null){let r=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(r,d),r}return n}function T(){let[n,r]=E([]);return[n.length>0?n.join(" "):void 0,c(()=>function(e){let o=k(a=>(r(t=>[...t,a]),()=>r(t=>{let i=t.slice(),l=i.indexOf(a);return l!==-1&&i.splice(l,1),i}))),s=c(()=>({register:o,slot:e.slot,name:e.name,props:e.props}),[o,e.slot,e.name,e.props]);return u.createElement(p.Provider,{value:s},e.children)},[r])]}let S="label";function w(n,r){let e=h(),{id:o=`headlessui-label-${e}`,passive:s=!1,...a}=n,t=d(),i=b(r);C(()=>t.register(o),[o,t.register]);let l={ref:i,...t.props,id:o};return s&&("onClick"in l&&(delete l.htmlFor,delete l.onClick),"onClick"in a&&delete a.onClick),g({ourProps:l,theirProps:a,slot:t.slot||{},defaultTag:S,name:t.name||"Label"})}let L=f(w),$=Object.assign(L,{});export{$ as B,T as F};
//# sourceMappingURL=label-DP1H2-kl.js.map