1import{r as a,b as u,c as ge,j as x}from"./vendor-react-DA8Lujin.js";import{f as D,s as L,a as O,w as q,l as ve,H as xe,U as ye}from"./description-CvHDt_P5.js";import{o as E,p as V,m as $e,K as R,y as W,n as we,h as Ee,j as P,l as ke,L as N,b as K,_ as Ce}from"./keyboard-CDib9W9Z.js";import{s as Se,$ as je,a as Te,w as Fe,e as Ne}from"./use-resolve-button-type-BVtEHIH6.js";import{c as w}from"./cn-DyVGX7hK.js";try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="675e8c8f-97b3-4015-8c0e-3a581c2cb4ff",e._sentryDebugIdIdentifier="sentry-dbid-675e8c8f-97b3-4015-8c0e-3a581c2cb4ff")}catch{}function Ie(e,t,r){let[l,n]=a.useState(r),o=e!==void 0,d=a.useRef(o),i=a.useRef(!1),s=a.useRef(!1);return o&&!d.current&&!i.current?(i.current=!0,d.current=o,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.")):!o&&d.current&&!s.current&&(s.current=!0,d.current=o,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.")),[o?e:l,E(c=>(o||n(c),t==null?void 0:t(c)))]}function Pe(e){let[t]=a.useState(e);return t}function z(e={},t=null,r=[]){for(let[l,n]of Object.entries(e))Q(r,J(t,l),n);return r}function J(e,t){return e?e+"["+t+"]":t}function Q(e,t,r){if(Array.isArray(r))for(let[l,n]of r.entries())Q(e,J(t,l.toString()),n);else r instanceof Date?e.push([t,r.toISOString()]):typeof r=="boolean"?e.push([t,r?"1":"0"]):typeof r=="string"?e.push([t,r]):typeof r=="number"?e.push([t,`${r}`]):r==null?e.push([t,""]):z(r,t,e)}function De(e){var t,r;let l=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(l){for(let n of l.elements)if(n!==e&&(n.tagName==="INPUT"&&n.type==="submit"||n.tagName==="BUTTON"&&n.type==="submit"||n.nodeName==="INPUT"&&n.type==="image")){n.click();return}(r=l.requestSubmit)==null||r.call(l)}}let X=a.createContext(null);function Le(e){let[t,r]=a.useState(null);return u.createElement(X.Provider,{value:{target:t}},e.children,u.createElement(D,{features:L.Hidden,ref:r}))}function Oe({children:e}){let t=a.useContext(X);if(!t)return u.createElement(u.Fragment,null,e);let{target:r}=t;return r?ge.createPortal(u.createElement(u.Fragment,null,e),r):null}function Re({data:e,form:t,disabled:r,onReset:l,overrides:n}){let[o,d]=a.useState(null),i=V();return a.useEffect(()=>{if(l&&o)return i.addEventListener(o,"reset",l)},[o,t,l]),u.createElement(Oe,null,u.createElement(Ue,{setForm:d,formId:t}),z(e).map(([s,c])=>u.createElement(D,{features:L.Hidden,...$e({key:s,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:r,name:s,value:c,...n})})))}function Ue({setForm:e,formId:t}){return a.useEffect(()=>{if(t){let r=document.getElementById(t);r&&e(r)}},[e,t]),t?null:u.createElement(D,{features:L.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:r=>{if(!r)return;let l=r.closest("form");l&&e(l)}})}let Y=a.createContext(void 0);function Z(){return a.useContext(Y)}function He({id:e,children:t}){return u.createElement(Y.Provider,{value:e},t)}let I=a.createContext(null);I.displayName="LabelContext";function ee(){let e=a.useContext(I);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,ee),t}return e}function te(e){var t,r,l;let n=(r=(t=a.useContext(I))==null?void 0:t.value)!=null?r:void 0;return((l=e==null?void 0:e.length)!=null?l:0)>0?[n,...e].filter(Boolean).join(" "):n}function re({inherit:e=!1}={}){let t=te(),[r,l]=a.useState([]),n=e?[t,...r].filter(Boolean):r;return[n.length>0?n.join(" "):void 0,a.useMemo(()=>function(o){let d=E(s=>(l(c=>[...c,s]),()=>l(c=>{let p=c.slice(),m=p.indexOf(s);return m!==-1&&p.splice(m,1),p}))),i=a.useMemo(()=>({register:d,slot:o.slot,name:o.name,props:o.props,value:o.value}),[d,o.slot,o.name,o.props,o.value]);return u.createElement(I.Provider,{value:i},o.children)},[l])]}let _e="label";function Ae(e,t){var r;let l=a.useId(),n=ee(),o=Z(),d=O(),{id:i=`headlessui-label-${l}`,htmlFor:s=o??((r=n.props)==null?void 0:r.htmlFor),passive:c=!1,...p}=e,m=W(t);we(()=>n.register(i),[i,n.register]);let h=E(g=>{let y=g.currentTarget;if(!(g.target!==g.currentTarget&&Ee(g.target))&&(P(y)&&g.preventDefault(),n.props&&"onClick"in n.props&&typeof n.props.onClick=="function"&&n.props.onClick(g),P(y))){let f=document.getElementById(y.htmlFor);if(f){let T=f.getAttribute("disabled");if(T==="true"||T==="")return;let F=f.getAttribute("aria-disabled");if(F==="true"||F==="")return;(ke(f)&&(f.type==="file"||f.type==="radio"||f.type==="checkbox")||f.role==="radio"||f.role==="checkbox"||f.role==="switch")&&f.click(),f.focu
1s({preventScroll:!0})}}}),k=d||!1,b=a.useMemo(()=>({...n.slot,disabled:k}),[n.slot,k]),$={ref:m,...n.props,id:i,htmlFor:s,onClick:h};return c&&("onClick"in $&&(delete $.htmlFor,delete $.onClick),"onClick"in p&&delete p.onClick),N()({ourProps:$,theirProps:p,slot:b,defaultTag:s?_e:"div",name:n.name||"Label"})}let Me=R(Ae),ne=Object.assign(Me,{}),Be="div";function Ge(e,t){let r=`headlessui-control-${a.useId()}`,[l,n]=re(),[o,d]=q(),i=O(),{disabled:s=i||!1,...c}=e,p=a.useMemo(()=>({disabled:s}),[s]),m={ref:t,disabled:s||void 0,"aria-disabled":s||void 0},h=N();return u.createElement(ve,{value:s},u.createElement(n,{value:l},u.createElement(d,{value:o},u.createElement(He,{id:r},h({ourProps:m,theirProps:{...c,children:u.createElement(Le,null,typeof c.children=="function"?c.children(p):c.children)},slot:p,defaultTag:Be,name:"Field"})))))}let Ke=R(Ge),U=a.createContext(null);U.displayName="GroupContext";let qe=a.Fragment;function Ve(e){var t;let[r,l]=a.useState(null),[n,o]=re(),[d,i]=q(),s=a.useMemo(()=>({switch:r,setSwitch:l}),[r,l]),c={},p=e,m=N();return u.createElement(i,{name:"Switch.Description",value:d},u.createElement(o,{name:"Switch.Label",value:n,props:{htmlFor:(t=s.switch)==null?void 0:t.id,onClick(h){r&&(P(h.currentTarget)&&h.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},u.createElement(U.Provider,{value:s},m({ourProps:c,theirProps:p,slot:{},defaultTag:qe,name:"Switch.Group"}))))}let We="button";function ze(e,t){var r;let l=a.useId(),n=Z(),o=O(),{id:d=n||`headlessui-switch-${l}`,disabled:i=o||!1,checked:s,defaultChecked:c,onChange:p,name:m,value:h,form:k,autoFocus:b=!1,...$}=e,g=a.useContext(U),[y,f]=a.useState(null),T=a.useRef(null),F=W(T,t,g===null?null:g.setSwitch,f),C=Pe(c),[S,j]=Ie(s,p,C??!1),le=V(),[H,_]=a.useState(!1),A=E(()=>{_(!0),j==null||j(!S),le.nextFrame(()=>{_(!1)})}),ae=E(v=>{if(Se(v.currentTarget))return v.preventDefault();v.preventDefault(),A()}),oe=E(v=>{v.key===K.Space?(v.preventDefault(),A()):v.key===K.Enter&&De(v.currentTarget)}),se=E(v=>v.preventDefault()),ie=te(),ue=ye(),{isFocusVisible:M,focusProps:ce}=je({autoFocus:b}),{isHovered:B,hoverProps:de}=Te({isDisabled:i}),{pressed:G,pressProps:fe}=Fe({disabled:i}),pe=a.useMemo(()=>({checked:S,disabled:i,hover:B,focus:M,active:G,autofocus:b,changing:H}),[S,B,M,G,i,H,b]),me=Ce({id:d,ref:F,role:"switch",type:Ne(e,y),tabIndex:e.tabIndex===-1?0:(r=e.tabIndex)!=null?r:0,"aria-checked":S,"aria-labelledby":ie,"aria-describedby":ue,disabled:i||void 0,autoFocus:b,onClick:ae,onKeyUp:oe,onKeyPress:se},ce,de,fe),he=a.useCallback(()=>{if(C!==void 0)return j==null?void 0:j(C)},[j,C]),be=N();return u.createElement(u.Fragment,null,m!=null&&u.createElement(Re,{disabled:i,data:{[m]:h||"on"},overrides:{type:"checkbox",checked:S},form:k,onReset:he}),be({ourProps:me,theirProps:$,slot:pe,defaultTag:We,name:"Switch"}))}let Je=R(ze),Qe=Ve,Xe=ne,Ye=xe,Ze=Object.assign(Je,{Group:Qe,Label:Xe,Description:Ye});function at({enabled:e,onChange:t,type:r,label:l,labelPosition:n="left",labelClassName:o,enabledClassName:d,disabledClassName:i,name:s,value:c,className:p,disabledIcon:m,enabledIcon:h,disabledIconClassName:k,small:b,disabled:$,innerLabel:g=!1}){const y=l?x.jsx(ne,{className:w(e?"text-blue":"text-grey","lg:text-base text-sm hover:cursor-pointer",o),children:l}):null,f=x.jsxs(Ze,{as:"button",checked:e,onChange:t,disabled:$,type:r,name:s,value:c,className:w(e?"bg-blue border border-blue text-blue":"bg-grey-light border border-grey text-grey","relative inline-flex flex-shrink-0 items-center cursor-pointer rounded-full transition-all ease-in-out",b?"h-6 w-12 px-1":"h-7 w-16 px-1",p,e&&d,!e&&i),children:[x.jsx("span",{className:"sr-only",children:"Use setting"}),g&&x.jsx("span",{className:w("absolute transition duration-200 ease-in-out text-xs text-inherit uppercase",e?"translate-x-0 ml-0":"translate-x-6 mr-1"),children:e?"On":"Off"}),x.jsxs("span",{className:w(e?"translate-x-8 bg-white":"translate-x-0 bg-grey","pointer-events-none relative inline-block aspect-square transform rounded-full ring-0 transition duration-200 ease-in-out",b?" h-4 w-4":"h-5 w-5"),children:[x.jsx("span",{className:w(e?"opacity-0 duration-100 ease-out":"opacity-100 duration-200 ease-in","absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"),"aria-hidden":"true",children:m&&x.jsx(m,{className:w("text-white-pearl/60",b?"h-4 w-4":"h-5 w-5",!e&&k)})}),x.jsx("span",{className:w(e?"opacity-100 duration-200 ease-in":"opacity-0 duration-100 ease-out","absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"),"aria-hidden":"true",children:h&&x.jsx(h,{className:w("text-blue",b?"h-4 w-4":"h-5 w-5")})})]})]});return y?x.jsxs(Ke,{as:"div",className:"flex items-center space-x-2",children:[n==="left"&&y,f,n==="right"&&y]}):f}export{Ke as H,te as N,re as Q,at as T,ne as V,Ie as a,Re as j,Pe as l,De as p,Z as u}; 2//# sourceMappingURL=Toggle-C0K86moL.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.