
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6fc2b2a4-cbf2-5fd8-a8a1-1d455d6bb1b1")}catch(e){}}();
import{r as s,e as g}from"./index-CnhpwU98.js";import{o as f,U as b,I as v,y,l as T,C as S}from"./keyboard-DGYiofhD.js";function O(t,n,e){let[o,r]=s.useState(e),l=t!==void 0,u=s.useRef(l),i=s.useRef(!1),a=s.useRef(!1);return l&&!u.current&&!i.current?(i.current=!0,u.current=l,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!l&&u.current&&!a.current&&(a.current=!0,u.current=l,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[l?t:o,f(c=>(l||r(c),n?.(c)))]}function k(t={},n=null,e=[]){for(let[o,r]of Object.entries(t))d(e,p(n,o),r);return e}function p(t,n){return t?t+"["+n+"]":n}function d(t,n,e){if(Array.isArray(e))for(let[o,r]of e.entries())d(t,p(n,o.toString()),r);else e instanceof Date?t.push([n,e.toISOString()]):typeof e=="boolean"?t.push([n,e?"1":"0"]):typeof e=="string"?t.push([n,e]):typeof e=="number"?t.push([n,`${e}`]):e==null?t.push([n,""]):k(e,n,t)}function P(t){var n,e;let o=(n=t?.form)!=null?n:t.closest("form");if(o){for(let r of o.elements)if(r!==t&&(r.tagName==="INPUT"&&r.type==="submit"||r.tagName==="BUTTON"&&r.type==="submit"||r.nodeName==="INPUT"&&r.type==="image")){r.click();return}(e=o.requestSubmit)==null||e.call(o)}}let m=s.createContext(null);function h(){let t=s.useContext(m);if(t===null){let n=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,h),n}return t}function $(){let[t,n]=s.useState([]);return[t.length>0?t.join(" "):void 0,s.useMemo(()=>function(e){let o=f(l=>(n(u=>[...u,l]),()=>n(u=>{let i=u.slice(),a=i.indexOf(l);return a!==-1&&i.splice(a,1),i}))),r=s.useMemo(()=>({register:o,slot:e.slot,name:e.name,props:e.props}),[o,e.slot,e.name,e.props]);return g.createElement(m.Provider,{value:r},e.children)},[n])]}let C="label";function N(t,n){let e=v(),{id:o=`headlessui-label-${e}`,passive:r=!1,...l}=t,u=h(),i=y(n);T(()=>u.register(o),[o,u.register]);let a={ref:i,...u.props,id:o};return r&&("onClick"in a&&(delete a.htmlFor,delete a.onClick),"onClick"in l&&delete l.onClick),S({ourProps:a,theirProps:l,slot:u.slot||{},defaultTag:C,name:u.name||"Label"})}let x=b(N),w=Object.assign(x,{});export{w as B,$ as F,O as T,k as e,P as p};
//# sourceMappingURL=label-CcpBYFiw.js.map

//# debugId=6fc2b2a4-cbf2-5fd8-a8a1-1d455d6bb1b1
