"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8595],{54572:function(e,t,n){n.d(t,{R:function(){return G}});var r,o,i,a,u=n(27378),l=n(84625),s=n(22652),c=n(85804),d=n(37349);function p(e,t){let[n,r]=(0,u.useState)(e),o=(0,d.E)(e);return(0,c.e)(()=>r(o.current),[o,r,...t]),n}var f=n(92296),v=n(36616),b=n(57953),m=n(71907),x=n(7723),g=n(98471),R=n(54518),y=n(4818),h=n(1635),I=n(62722),T=n(16490),S=n(14784),O=n(98283),P=n(70458),L=n(11981),E=n(55842),M=n(50184),k=((r=k||{})[r.Open=0]="Open",r[r.Closed=1]="Closed",r),w=((o=w||{})[o.Single=0]="Single",o[o.Multi=1]="Multi",o),D=((i=D||{})[i.Pointer=0]="Pointer",i[i.Other=1]="Other",i),C=((a=C||{})[a.OpenListbox=0]="OpenListbox",a[a.CloseListbox=1]="CloseListbox",a[a.GoToOption=2]="GoToOption",a[a.Search=3]="Search",a[a.ClearSearch=4]="ClearSearch",a[a.RegisterOption=5]="RegisterOption",a[a.UnregisterOption=6]="UnregisterOption",a[a.RegisterLabel=7]="RegisterLabel",a);function z(e,t=e=>e){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=(0,y.z2)(t(e.options.slice()),e=>e.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return -1===o&&(o=null),{options:r,activeOptionIndex:o}}let N={1:e=>e.dataRef.current.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.dataRef.current.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(e=>n(e.dataRef.current.value));return -1!==r&&(t=r),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||1===e.listboxState)return e;let r=z(e),o=(0,g.d)(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:o,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{if(e.dataRef.current.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))}),i=o?e.options.indexOf(o):-1;return -1===i||i===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:i,activationTrigger:1}},4:e=>e.dataRef.current.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=z(e,e=>[...e,n]);return null===e.activeOptionIndex&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=z(e,e=>{let n=e.findIndex(e=>e.id===t.id);return -1!==n&&e.splice(n,1),e});return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},A=(0,u.createContext)(null);function F(e){let t=(0,u.useContext)(A);if(null===t){let t=Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,F),t}return t}A.displayName="ListboxActionsContext";let Q=(0,u.createContext)(null);function U(e){let t=(0,u.useContext)(Q);if(null===t){let t=Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,U),t}return t}function V(e,t){return(0,b.E)(t.type,N,e,t)}Q.displayName="ListboxDataContext";let B=u.Fragment,$=v.AN.RenderStrategy|v.AN.Static,G=Object.assign((0,v.yV)(function(e,t){let{value:n,defaultValue:r,name:o,onChange:i,by:a=(e,t)=>e===t,disabled:s=!1,horizontal:d=!1,multiple:p=!1,...m}=e,x=d?"horizontal":"vertical",R=(0,f.T)(t),[I=p?[]:void 0,P]=(0,E.q)(n,i,r),[M,k]=(0,u.useReducer)(V,{dataRef:(0,u.createRef)(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),w=(0,u.useRef)({static:!1,hold:!1}),D=(0,u.useRef)(null),C=(0,u.useRef)(null),z=(0,u.useRef)(null),N=(0,L.z)("string"==typeof a?(e,t)=>(null==e?void 0:e[a])===(null==t?void 0:t[a]):a),F=(0,u.useCallback)(e=>(0,b.E)(U.mode,{1:()=>I.some(t=>N(t,e)),0:()=>N(I,e)}),[I]),U=(0,u.useMemo)(()=>({...M,value:I,disabled:s,mode:p?1:0,orientation:x,compare:N,isSelected:F,optionsPropsRef:w,labelRef:D,buttonRef:C,optionsRef:z}),[I,s,p,M]);(0,c.e)(()=>{M.dataRef.current=U},[U]),(0,T.O)([U.buttonRef,U.optionsRef],(e,t)=>{var n;k({type:1}),(0,y.sP)(t,y.tJ.Loose)||(e.preventDefault(),null==(n=U.buttonRef.current)||n.focus())},0===U.listboxState);let $=(0,u.useMemo)(()=>({open:0===U.listboxState,disabled:s,value:I}),[U,s,I]),G=(0,L.z)(e=>{let t=U.options.find(t=>t.id===e);t&&J(t.dataRef.current.value)}),Y=(0,L.z)(()=>{if(null!==U.activeOptionIndex){let{dataRef:e,id:t}=U.options[U.activeOptionIndex];J(e.current.value),k({type:2,focus:g.T.Specific,id:t})}}),K=(0,L.z)(()=>k({type:0})),_=(0,L.z)(()=>k({type:1})),Z=(0,L.z)((e,t,n)=>e===g.T.Specific?k({type:2,focus:g.T.Specific,id:t,trigger:n}):k({type:2,focus:e,trigger:n})),j=(0,L.z)((e,t)=>(k({type:5,id:e,dataRef:t}),()=>k({type:6,id:e}))),H=(0,L.z)(e=>(k({type:7,id:e}),()=>k({type:7,id:null}))),J=(0,L.z)(e=>(0,b.E)(U.mode,{0:()=>null==P?void 0:P(e),1(){let t=U.value.slice(),n=t.findIndex(t=>N(t,e));return -1===n?t.push(e):t.splice(n,1),null==P?void 0:P(t)}})),q=(0,L.z)(e=>k({type:3,value:e})),W=(0,L.z)(()=>k({type:4})),X=(0,u.useMemo)(()=>({onChange:J,registerOption:j,registerLabel:H,goToOption:Z,closeListbox:_,openListbox:K,selectActiveOption:Y,selectOption:G,search:q,clearSearch:W}),[]),ee=(0,u.useRef)(null),et=(0,l.G)();return(0,u.useEffect)(()=>{ee.current&&void 0!==r&&et.addEventListener(ee.current,"reset",()=>{J(r)})},[ee,J]),u.createElement(A.Provider,{value:X},u.createElement(Q.Provider,{value:U},u.createElement(h.up,{value:(0,b.E)(U.listboxState,{0:h.ZM.Open,1:h.ZM.Closed})},null!=o&&null!=I&&(0,O.t)({[o]:I}).map(([e,t],n)=>u.createElement(S._,{features:S.A.Hidden,ref:0===n?e=>{var t;ee.current=null!=(t=null==e?void 0:e.closest("form"))?t:null}:void 0,...(0,v.oA)({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:t})})),(0,v.sY)({ourProps:{ref:R},theirProps:m,slot:$,defaultTag:B,name:"Listbox"}))))}),{Button:(0,v.yV)(function(e,t){var n;let r=(0,s.M)(),{id:o=`headlessui-listbox-button-${r}`,...i}=e,a=U("Listbox.Button"),c=F("Listbox.Button"),d=(0,f.T)(a.buttonRef,t),b=(0,l.G)(),m=(0,L.z)(e=>{switch(e.key){case x.R.Space:case x.R.Enter:case x.R.ArrowDown:e.preventDefault(),c.openListbox(),b.nextFrame(()=>{a.value||c.goToOption(g.T.First)});break;case x.R.ArrowUp:e.preventDefault(),c.openListbox(),b.nextFrame(()=>{a.value||c.goToOption(g.T.Last)})}}),y=(0,L.z)(e=>{e.key===x.R.Space&&e.preventDefault()}),h=(0,L.z)(e=>{if((0,R.P)(e.currentTarget))return e.preventDefault();0===a.listboxState?(c.closeListbox(),b.nextFrame(()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})})):(e.preventDefault(),c.openListbox())}),T=p(()=>{if(a.labelId)return[a.labelId,o].join(" ")},[a.labelId,o]),S=(0,u.useMemo)(()=>({open:0===a.listboxState,disabled:a.disabled,value:a.value}),[a]),O={ref:d,id:o,type:(0,I.f)(e,a.buttonRef),"aria-haspopup":"listbox","aria-controls":null==(n=a.optionsRef.current)?void 0:n.id,"aria-expanded":a.disabled?void 0:0===a.listboxState,"aria-labelledby":T,disabled:a.disabled,onKeyDown:m,onKeyUp:y,onClick:h};return(0,v.sY)({ourProps:O,theirProps:i,slot:S,defaultTag:"button",name:"Listbox.Button"})}),Label:(0,v.yV)(function(e,t){let n=(0,s.M)(),{id:r=`headlessui-listbox-label-${n}`,...o}=e,i=U("Listbox.Label"),a=F("Listbox.Label"),l=(0,f.T)(i.labelRef,t);(0,c.e)(()=>a.registerLabel(r),[r]);let d=(0,L.z)(()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),p=(0,u.useMemo)(()=>({open:0===i.listboxState,disabled:i.disabled}),[i]);return(0,v.sY)({ourProps:{ref:l,id:r,onClick:d},theirProps:o,slot:p,defaultTag:"label",name:"Listbox.Label"})}),Options:(0,v.yV)(function(e,t){var n;let r=(0,s.M)(),{id:o=`headlessui-listbox-options-${r}`,...i}=e,a=U("Listbox.Options"),c=F("Listbox.Options"),d=(0,f.T)(a.optionsRef,t),R=(0,l.G)(),y=(0,l.G)(),I=(0,h.oJ)(),T=null!==I?(I&h.ZM.Open)===h.ZM.Open:0===a.listboxState;(0,u.useEffect)(()=>{var e;let t=a.optionsRef.current;t&&0===a.listboxState&&t!==(null==(e=(0,P.r)(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})},[a.listboxState,a.optionsRef]);let S=(0,L.z)(e=>{switch(y.dispose(),e.key){case x.R.Space:if(""!==a.searchQuery)return e.preventDefault(),e.stopPropagation(),c.search(e.key);case x.R.Enter:if(e.preventDefault(),e.stopPropagation(),null!==a.activeOptionIndex){let{dataRef:e}=a.options[a.activeOptionIndex];c.onChange(e.current.value)}0===a.mode&&(c.closeListbox(),(0,m.k)().nextFrame(()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case(0,b.E)(a.orientation,{vertical:x.R.ArrowDown,horizontal:x.R.ArrowRight}):return e.preventDefault(),e.stopPropagation(),c.goToOption(g.T.Next);case(0,b.E)(a.orientation,{vertical:x.R.ArrowUp,horizontal:x.R.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),c.goToOption(g.T.Previous);case x.R.Home:case x.R.PageUp:return e.preventDefault(),e.stopPropagation(),c.goToOption(g.T.First);case x.R.End:case x.R.PageDown:return e.preventDefault(),e.stopPropagation(),c.goToOption(g.T.Last);case x.R.Escape:return e.preventDefault(),e.stopPropagation(),c.closeListbox(),R.nextFrame(()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})});case x.R.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(c.search(e.key),y.setTimeout(()=>c.clearSearch(),350))}}),O=p(()=>{var e,t,n;return null!=(n=null==(e=a.labelRef.current)?void 0:e.id)?n:null==(t=a.buttonRef.current)?void 0:t.id},[a.labelRef.current,a.buttonRef.current]),E=(0,u.useMemo)(()=>({open:0===a.listboxState}),[a]),M={"aria-activedescendant":null===a.activeOptionIndex||null==(n=a.options[a.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===a.mode||void 0,"aria-labelledby":O,"aria-orientation":a.orientation,id:o,onKeyDown:S,role:"listbox",tabIndex:0,ref:d};return(0,v.sY)({ourProps:M,theirProps:i,slot:E,defaultTag:"ul",features:$,visible:T,name:"Listbox.Options"})}),Option:(0,v.yV)(function(e,t){let n=(0,s.M)(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...a}=e,l=U("Listbox.Option"),p=F("Listbox.Option"),b=null!==l.activeOptionIndex&&l.options[l.activeOptionIndex].id===r,x=l.isSelected(i),R=(0,u.useRef)(null),y=(0,d.E)({disabled:o,value:i,domRef:R,get textValue(){var h,I;return null==(I=null==(h=R.current)?void 0:h.textContent)?void 0:I.toLowerCase()}}),T=(0,f.T)(t,R);(0,c.e)(()=>{if(0!==l.listboxState||!b||0===l.activationTrigger)return;let e=(0,m.k)();return e.requestAnimationFrame(()=>{var e,t;null==(t=null==(e=R.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}),e.dispose},[R,b,l.listboxState,l.activationTrigger,l.activeOptionIndex]),(0,c.e)(()=>p.registerOption(r,y),[y,r]);let S=(0,L.z)(e=>{if(o)return e.preventDefault();p.onChange(i),0===l.mode&&(p.closeListbox(),(0,m.k)().nextFrame(()=>{var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),O=(0,L.z)(()=>{if(o)return p.goToOption(g.T.Nothing);p.goToOption(g.T.Specific,r)}),P=(0,M.g)(),E=(0,L.z)(e=>P.update(e)),k=(0,L.z)(e=>{P.wasMoved(e)&&(o||b||p.goToOption(g.T.Specific,r,0))}),w=(0,L.z)(e=>{P.wasMoved(e)&&(o||b&&p.goToOption(g.T.Nothing))}),D=(0,u.useMemo)(()=>({active:b,selected:x,disabled:o}),[b,x,o]);return(0,v.sY)({ourProps:{id:r,ref:T,role:"option",tabIndex:!0===o?void 0:-1,"aria-disabled":!0===o||void 0,"aria-selected":x,disabled:void 0,onClick:S,onFocus:O,onPointerEnter:E,onMouseEnter:E,onPointerMove:k,onMouseMove:k,onPointerLeave:w,onMouseLeave:w},theirProps:a,slot:D,defaultTag:"li",name:"Listbox.Option"})})})},53944:function(e,t,n){n.d(t,{v:function(){return A}});var r,o,i,a=n(27378),u=n(57953),l=n(36616),s=n(71907),c=n(84625),d=n(85804),p=n(92296),f=n(22652),v=n(7723),b=n(98471),m=n(54518),x=n(4818),g=n(16490),R=n(82555),y=n(1635),h=n(62722),I=n(37957),T=n(11981),S=n(50184),O=((r=O||{})[r.Open=0]="Open",r[r.Closed=1]="Closed",r),P=((o=P||{})[o.Pointer=0]="Pointer",o[o.Other=1]="Other",o),L=((i=L||{})[i.OpenMenu=0]="OpenMenu",i[i.CloseMenu=1]="CloseMenu",i[i.GoToItem=2]="GoToItem",i[i.Search=3]="Search",i[i.ClearSearch=4]="ClearSearch",i[i.RegisterItem=5]="RegisterItem",i[i.UnregisterItem=6]="UnregisterItem",i);function E(e,t=e=>e){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=(0,x.z2)(t(e.items.slice()),e=>e.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return -1===o&&(o=null),{items:r,activeItemIndex:o}}let M={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=E(e),o=(0,b.d)(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:o,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled}),i=o?e.items.indexOf(o):-1;return -1===i||i===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:i,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=E(e,e=>[...e,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=E(e,e=>{let n=e.findIndex(e=>e.id===t.id);return -1!==n&&e.splice(n,1),e});return{...e,...n,activationTrigger:1}}},k=(0,a.createContext)(null);function w(e){let t=(0,a.useContext)(k);if(null===t){let t=Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,w),t}return t}function D(e,t){return(0,u.E)(t.type,M,e,t)}k.displayName="MenuContext";let C=a.Fragment,z=l.AN.RenderStrategy|l.AN.Static,N=a.Fragment,A=Object.assign((0,l.yV)(function(e,t){let n=(0,a.useReducer)(D,{menuState:1,buttonRef:(0,a.createRef)(),itemsRef:(0,a.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:r,itemsRef:o,buttonRef:i},s]=n,c=(0,p.T)(t);(0,g.O)([i,o],(e,t)=>{var n;s({type:1}),(0,x.sP)(t,x.tJ.Loose)||(e.preventDefault(),null==(n=i.current)||n.focus())},0===r);let d=(0,T.z)(()=>{s({type:1})}),f=(0,a.useMemo)(()=>({open:0===r,close:d}),[r,d]);return a.createElement(k.Provider,{value:n},a.createElement(y.up,{value:(0,u.E)(r,{0:y.ZM.Open,1:y.ZM.Closed})},(0,l.sY)({ourProps:{ref:c},theirProps:e,slot:f,defaultTag:C,name:"Menu"})))}),{Button:(0,l.yV)(function(e,t){var n;let r=(0,f.M)(),{id:o=`headlessui-menu-button-${r}`,...i}=e,[u,s]=w("Menu.Button"),d=(0,p.T)(u.buttonRef,t),x=(0,c.G)(),g=(0,T.z)(e=>{switch(e.key){case v.R.Space:case v.R.Enter:case v.R.ArrowDown:e.preventDefault(),e.stopPropagation(),s({type:0}),x.nextFrame(()=>s({type:2,focus:b.T.First}));break;case v.R.ArrowUp:e.preventDefault(),e.stopPropagation(),s({type:0}),x.nextFrame(()=>s({type:2,focus:b.T.Last}))}}),R=(0,T.z)(e=>{e.key===v.R.Space&&e.preventDefault()}),y=(0,T.z)(t=>{if((0,m.P)(t.currentTarget))return t.preventDefault();e.disabled||(0===u.menuState?(s({type:1}),x.nextFrame(()=>{var e;return null==(e=u.buttonRef.current)?void 0:e.focus({preventScroll:!0})})):(t.preventDefault(),s({type:0})))}),I=(0,a.useMemo)(()=>({open:0===u.menuState}),[u]),S={ref:d,id:o,type:(0,h.f)(e,u.buttonRef),"aria-haspopup":"menu","aria-controls":null==(n=u.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===u.menuState,onKeyDown:g,onKeyUp:R,onClick:y};return(0,l.sY)({ourProps:S,theirProps:i,slot:I,defaultTag:"button",name:"Menu.Button"})}),Items:(0,l.yV)(function(e,t){var n,r;let o=(0,f.M)(),{id:i=`headlessui-menu-items-${o}`,...u}=e,[d,m]=w("Menu.Items"),g=(0,p.T)(d.itemsRef,t),h=(0,I.i)(d.itemsRef),S=(0,c.G)(),O=(0,y.oJ)(),P=null!==O?(O&y.ZM.Open)===y.ZM.Open:0===d.menuState;(0,a.useEffect)(()=>{let e=d.itemsRef.current;e&&0===d.menuState&&e!==(null==h?void 0:h.activeElement)&&e.focus({preventScroll:!0})},[d.menuState,d.itemsRef,h]),(0,R.B)({container:d.itemsRef.current,enabled:0===d.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let L=(0,T.z)(e=>{var t,n;switch(S.dispose(),e.key){case v.R.Space:if(""!==d.searchQuery)return e.preventDefault(),e.stopPropagation(),m({type:3,value:e.key});case v.R.Enter:if(e.preventDefault(),e.stopPropagation(),m({type:1}),null!==d.activeItemIndex){let{dataRef:e}=d.items[d.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}(0,x.wI)(d.buttonRef.current);break;case v.R.ArrowDown:return e.preventDefault(),e.stopPropagation(),m({type:2,focus:b.T.Next});case v.R.ArrowUp:return e.preventDefault(),e.stopPropagation(),m({type:2,focus:b.T.Previous});case v.R.Home:case v.R.PageUp:return e.preventDefault(),e.stopPropagation(),m({type:2,focus:b.T.First});case v.R.End:case v.R.PageDown:return e.preventDefault(),e.stopPropagation(),m({type:2,focus:b.T.Last});case v.R.Escape:e.preventDefault(),e.stopPropagation(),m({type:1}),(0,s.k)().nextFrame(()=>{var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})});break;case v.R.Tab:e.preventDefault(),e.stopPropagation(),m({type:1}),(0,s.k)().nextFrame(()=>{(0,x.EO)(d.buttonRef.current,e.shiftKey?x.TO.Previous:x.TO.Next)});break;default:1===e.key.length&&(m({type:3,value:e.key}),S.setTimeout(()=>m({type:4}),350))}}),E=(0,T.z)(e=>{e.key===v.R.Space&&e.preventDefault()}),M=(0,a.useMemo)(()=>({open:0===d.menuState}),[d]),k={"aria-activedescendant":null===d.activeItemIndex||null==(n=d.items[d.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=d.buttonRef.current)?void 0:r.id,id:i,onKeyDown:L,onKeyUp:E,role:"menu",tabIndex:0,ref:g};return(0,l.sY)({ourProps:k,theirProps:u,slot:M,defaultTag:"div",features:z,visible:P,name:"Menu.Items"})}),Item:(0,l.yV)(function(e,t){let n=(0,f.M)(),{id:r=`headlessui-menu-item-${n}`,disabled:o=!1,...i}=e,[u,c]=w("Menu.Item"),v=null!==u.activeItemIndex&&u.items[u.activeItemIndex].id===r,m=(0,a.useRef)(null),g=(0,p.T)(t,m);(0,d.e)(()=>{if(0!==u.menuState||!v||0===u.activationTrigger)return;let e=(0,s.k)();return e.requestAnimationFrame(()=>{var e,t;null==(t=null==(e=m.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}),e.dispose},[m,v,u.menuState,u.activationTrigger,u.activeItemIndex]);let R=(0,a.useRef)({disabled:o,domRef:m});(0,d.e)(()=>{R.current.disabled=o},[R,o]),(0,d.e)(()=>{var e,t;R.current.textValue=null==(t=null==(e=m.current)?void 0:e.textContent)?void 0:t.toLowerCase()},[R,m]),(0,d.e)(()=>(c({type:5,id:r,dataRef:R}),()=>c({type:6,id:r})),[R,r]);let y=(0,T.z)(()=>{c({type:1})}),h=(0,T.z)(e=>{if(o)return e.preventDefault();c({type:1}),(0,x.wI)(u.buttonRef.current)}),I=(0,T.z)(()=>{if(o)return c({type:2,focus:b.T.Nothing});c({type:2,focus:b.T.Specific,id:r})}),O=(0,S.g)(),P=(0,T.z)(e=>O.update(e)),L=(0,T.z)(e=>{O.wasMoved(e)&&(o||v||c({type:2,focus:b.T.Specific,id:r,trigger:0}))}),E=(0,T.z)(e=>{O.wasMoved(e)&&(o||v&&c({type:2,focus:b.T.Nothing}))}),M=(0,a.useMemo)(()=>({active:v,disabled:o,close:y}),[v,o,y]);return(0,l.sY)({ourProps:{id:r,ref:g,role:"menuitem",tabIndex:!0===o?void 0:-1,"aria-disabled":!0===o||void 0,disabled:void 0,onClick:h,onFocus:I,onPointerEnter:P,onMouseEnter:P,onPointerMove:L,onMouseMove:L,onPointerLeave:E,onMouseLeave:E},theirProps:i,slot:M,defaultTag:N,name:"Menu.Item"})})})},55842:function(e,t,n){n.d(t,{q:function(){return i}});var r=n(27378),o=n(11981);function i(e,t,n){let[i,a]=(0,r.useState)(n),u=void 0!==e,l=(0,r.useRef)(u),s=(0,r.useRef)(!1),c=(0,r.useRef)(!1);return!u||l.current||s.current?u||!l.current||c.current||(c.current=!0,l.current=u,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.")):(s.current=!0,l.current=u,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.")),[u?e:i,(0,o.z)(e=>(u||a(e),null==t?void 0:t(e)))]}},62722:function(e,t,n){n.d(t,{f:function(){return a}});var r=n(27378),o=n(85804);function i(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";if("string"==typeof n&&"button"===n.toLowerCase())return"button"}function a(e,t){let[n,a]=(0,r.useState)(()=>i(e));return(0,o.e)(()=>{a(i(e))},[e.type,e.as]),(0,o.e)(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&a("button")},[n,t]),n}},50184:function(e,t,n){n.d(t,{g:function(){return i}});var r=n(27378);function o(e){return[e.screenX,e.screenY]}function i(){let e=(0,r.useRef)([-1,-1]);return{wasMoved(t){let n=o(t);return(e.current[0]!==n[0]||e.current[1]!==n[1])&&(e.current=n,!0)},update(t){e.current=o(t)}}}},82555:function(e,t,n){n.d(t,{B:function(){return a}});var r=n(27378),o=n(85804),i=n(70458);function a({container:e,accept:t,walk:n,enabled:a=!0}){let u=(0,r.useRef)(t),l=(0,r.useRef)(n);(0,r.useEffect)(()=>{u.current=t,l.current=n},[t,n]),(0,o.e)(()=>{if(!e||!a)return;let t=(0,i.r)(e);if(!t)return;let n=u.current,r=l.current,o=Object.assign(e=>n(e),{acceptNode:n}),s=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,o,!1);for(;s.nextNode();)r(s.currentNode)},[e,a,u,l])}},98471:function(e,t,n){n.d(t,{T:function(){return o},d:function(){return i}});var r,o=((r=o||{})[r.First=0]="First",r[r.Previous=1]="Previous",r[r.Next=2]="Next",r[r.Last=3]="Last",r[r.Specific=4]="Specific",r[r.Nothing=5]="Nothing",r);function i(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=null!=r?r:-1,i=(()=>{switch(e.focus){case 0:return n.findIndex(e=>!t.resolveDisabled(e));case 1:{let e=n.slice().reverse().findIndex((e,n,r)=>(-1===o||!(r.length-n-1>=o))&&!t.resolveDisabled(e));return -1===e?e:n.length-1-e}case 2:return n.findIndex((e,n)=>!(n<=o)&&!t.resolveDisabled(e));case 3:{let e=n.slice().reverse().findIndex(e=>!t.resolveDisabled(e));return -1===e?e:n.length-1-e}case 4:return n.findIndex(n=>t.resolveId(n)===e.id);case 5:return null;default:!function(e){throw Error("Unexpected object: "+e)}(e)}})();return -1===i?r:i}},98283:function(e,t,n){function r(e,t){return e?e+"["+t+"]":t}function o(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n){for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type){e.click();return}}}n.d(t,{g:function(){return o},t:function(){return function e(t={},n=null,o=[]){for(let[i,a]of Object.entries(t))!function t(n,o,i){if(Array.isArray(i))for(let[e,a]of i.entries())t(n,r(o,e.toString()),a);else i instanceof Date?n.push([o,i.toISOString()]):"boolean"==typeof i?n.push([o,i?"1":"0"]):"string"==typeof i?n.push([o,i]):"number"==typeof i?n.push([o,`${i}`]):null==i?n.push([o,""]):e(i,o,n)}(o,r(n,i),a);return o}}})}}]);