"use client";import s from"react";import{useResolvedTag as b}from'../../hooks/use-resolved-tag.js';import{useSlot as E}from'../../hooks/use-slot.js';import{useSyncRefs as P}from'../../hooks/use-sync-refs.js';import{DisabledProvider as u,useDisabled as g}from'../../internal/disabled.js';import{forwardRefWithAs as D,useRender as A}from'../../utils/render.js';import{useLabels as L}from'../label/label.js';let d="fieldset";function R(t,i){var o;let a=g(),{disabled:e=a||!1,...p}=t,[n,T]=b((o=t.as)!=null?o:d),l=P(i,T),[r,f]=L(),m=E({disabled:e}),y=n==="fieldset"?{ref:l,"aria-labelledby":r,disabled:e||void 0}:{ref:l,role:"group","aria-labelledby":r,"aria-disabled":e||void 0},F=A();return s.createElement(u,{value:e},s.createElement(f,null,F({ourProps:y,theirProps:p,slot:m,defaultTag:d,name:"Fieldset"})))}let I=D(R);export{I as Fieldset};
