"use strict";const t=require("react/jsx-runtime"),$=require("react"),f=require("@chakra-ui/react"),x=require("@chakra-ui/react/styled-system"),R=require("./extract-style-props-B4hqila-.cjs.js"),q=require("./index-CVXB9mwf.cjs.js"),w=require("./useObjectRef-4v2MxSjQ.cjs.js"),y=require("./mergeProps-CxnHrnow.cjs.js"),j=require("./useToggleState-D7k4zllv.cjs.js"),m=require("./useToggle-DWRQYar0.cjs.js"),g=require("./useFocusRing-B7_ogYbr.cjs.js"),k=require("./visually-hidden-BjtXUoFK.cjs.js");function v(s,e,c){let{labelProps:i,inputProps:l,isSelected:o,isPressed:a,isDisabled:n,isReadOnly:d}=m.$d2c8e2b0480f3f34$export$cbe85ee05b554577(s,e,c);return{labelProps:i,inputProps:{...l,role:"switch",checked:o},isSelected:o,isPressed:a,isDisabled:n,isReadOnly:d}}const{withProvider:D,withContext:u}=f.createSlotRecipeContext({key:"switch"}),O=D("label","root"),T=u("span","label"),C=u("span","track"),F=u("span","thumb"),b=({ref:s,...e})=>{const c=$.useRef(null),i=w.$df56164dff5785e2$export$4338b53315abf666(s?f.mergeRefs(c,s):c),l=x.useSlotRecipe({recipe:q.switchSlotRecipe}),[o,a]=l.splitVariantProps(e),[n,d]=R.extractStyleProps(a),p=j.$3017fa7ffdddec74$export$8042c6c013fd5226(e),{inputProps:S}=v(d,p,i),{isFocused:h,focusProps:P}=g.$f7dceffc5ad7768b$export$4e328f61c538687f(),r={"data-selected":p.isSelected,"data-invalid":e.isInvalid,"data-disabled":e.isDisabled,"data-focus":h||void 0};return t.jsxs(O,{"data-slot":"root",...o,...r,...n,children:[t.jsxs(C,{"data-slot":"track",...r,children:[t.jsx(F,{"data-slot":"thumb",...r}),t.jsx(k.VisuallyHidden,{as:"span",children:t.jsx("input",{"data-slot":"input",...y.$3ef42575df84b30b$export$9d1611c77c2fe928(S,P),ref:i})})]}),e.children&&t.jsx(T,{"data-slot":"label",...r,children:e.children})]})};b.displayName="Switch";exports.Switch=b;
//# sourceMappingURL=switch-CsiG41ZR.cjs.js.map
