@reactfast/nav 0.2.17 → 0.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),u=require("react"),gt=require("react-dom"),Le=require("next/link");function So(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=So(u),Vt=So(gt),Ql=typeof document<"u"?u.useLayoutEffect:()=>{},He=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Ge=e=>e&&"window"in e&&e.window===e?e:He(e).defaultView||window;function Xl(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Jl(e){return Xl(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let ea=!1;function Un(){return ea}function No(e,t){if(!Un())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Jl(n)?n=n.host:n=n.parentNode}return!1}const Fn=(e=document)=>{var t;if(!Un())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Co(e){return Un()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function ta(e){if(na())e.focus({preventScroll:!0});else{let t=ra(e);e.focus(),oa(t)}}let Ft=null;function na(){if(Ft==null){Ft=!1;try{document.createElement("div").focus({get preventScroll(){return Ft=!0,!0}})}catch{}}return Ft}function ra(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function oa(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function Jt(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function Yn(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Oe(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const vt=Oe(function(){return Yn(/^Mac/i)}),la=Oe(function(){return Yn(/^iPhone/i)}),jo=Oe(function(){return Yn(/^iPad/i)||vt()&&navigator.maxTouchPoints>1}),aa=Oe(function(){return la()||jo()});Oe(function(){return vt()||aa()});const sa=Oe(function(){return Jt(/AppleWebKit/i)&&!ia()}),ia=Oe(function(){return Jt(/Chrome/i)}),ua=Oe(function(){return Jt(/Android/i)}),ca=Oe(function(){return Jt(/Firefox/i)});function bt(e,t,n=!0){var r,o;let{metaKey:l,ctrlKey:a,altKey:s,shiftKey:i}=t;ca()&&(!((o=window.event)===null||o===void 0||(r=o.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(vt()?l=!0:a=!0);let d=sa()&&vt()&&!jo()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:l,ctrlKey:a,altKey:s,shiftKey:i}):new MouseEvent("click",{metaKey:l,ctrlKey:a,altKey:s,shiftKey:i,detail:1,bubbles:!0,cancelable:!0});bt.isOpening=n,ta(e),e.dispatchEvent(d),bt.isOpening=!1}bt.isOpening=!1;function Po(){let e=u.useRef(new Map),t=u.useCallback((o,l,a,s)=>{let i=s!=null&&s.once?(...d)=>{e.current.delete(a),a(...d)}:a;e.current.set(a,{type:l,eventTarget:o,fn:i,options:s}),o.addEventListener(l,i,s)},[]),n=u.useCallback((o,l,a,s)=>{var i;let d=((i=e.current.get(a))===null||i===void 0?void 0:i.fn)||a;o.removeEventListener(l,d,s),e.current.delete(a)},[]),r=u.useCallback(()=>{e.current.forEach((o,l)=>{n(o.eventTarget,o.type,l,o.options)})},[n]);return u.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function da(e){return e.pointerType===""&&e.isTrusted?!0:ua()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ro(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function fa(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function To(e){let t=u.useRef({isFocused:!1,observer:null});return Ql(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),u.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=n.target,o=l=>{if(t.current.isFocused=!1,r.disabled){let a=Ro(l);e==null||e(a)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};r.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){var l;(l=t.current.observer)===null||l===void 0||l.disconnect();let a=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let ma=!1,$t=null,Mn=new Set,pt=new Map,Ue=!1,Ln=!1;const pa={Tab:!0,Escape:!0};function qn(e,t){for(let n of Mn)n(e,t)}function ha(e){return!(e.metaKey||!vt()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Wt(e){Ue=!0,!bt.isOpening&&ha(e)&&($t="keyboard",qn("keyboard",e))}function xe(e){$t="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(Ue=!0,qn("pointer",e))}function Oo(e){!bt.isOpening&&da(e)&&(Ue=!0,$t="virtual")}function Fo(e){e.target===window||e.target===document||ma||!e.isTrusted||(!Ue&&!Ln&&($t="virtual",qn("virtual",e)),Ue=!1,Ln=!1)}function Mo(){Ue=!1,Ln=!0}function In(e){if(typeof window>"u"||typeof document>"u"||pt.get(Ge(e)))return;const t=Ge(e),n=He(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ue=!0,r.apply(this,arguments)},n.addEventListener("keydown",Wt,!0),n.addEventListener("keyup",Wt,!0),n.addEventListener("click",Oo,!0),t.addEventListener("focus",Fo,!0),t.addEventListener("blur",Mo,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",xe,!0),n.addEventListener("pointermove",xe,!0),n.addEventListener("pointerup",xe,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",xe,!0),n.addEventListener("mousemove",xe,!0),n.addEventListener("mouseup",xe,!0)),t.addEventListener("beforeunload",()=>{Lo(e)},{once:!0}),pt.set(t,{focus:r})}const Lo=(e,t)=>{const n=Ge(e),r=He(e);t&&r.removeEventListener("DOMContentLoaded",t),pt.has(n)&&(n.HTMLElement.prototype.focus=pt.get(n).focus,r.removeEventListener("keydown",Wt,!0),r.removeEventListener("keyup",Wt,!0),r.removeEventListener("click",Oo,!0),n.removeEventListener("focus",Fo,!0),n.removeEventListener("blur",Mo,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",xe,!0),r.removeEventListener("pointermove",xe,!0),r.removeEventListener("pointerup",xe,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",xe,!0),r.removeEventListener("mousemove",xe,!0),r.removeEventListener("mouseup",xe,!0)),pt.delete(n))};function ga(e){const t=He(e);let n;return t.readyState!=="loading"?In(e):(n=()=>{In(e)},t.addEventListener("DOMContentLoaded",n)),()=>Lo(e,n)}typeof document<"u"&&ga();function Io(){return $t!=="pointer"}const va=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ba(e,t,n){let r=He(n==null?void 0:n.target);const o=typeof window<"u"?Ge(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,l=typeof window<"u"?Ge(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?Ge(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?Ge(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!va.has(r.activeElement.type)||r.activeElement instanceof l||r.activeElement instanceof a&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof s&&!pa[n.key])}function xa(e,t,n){In(),u.useEffect(()=>{let r=(o,l)=>{ba(!!(n!=null&&n.isTextInput),o,l)&&e(Io())};return Mn.add(r),()=>{Mn.delete(r)}},t)}function ya(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const l=u.useCallback(i=>{if(i.target===i.currentTarget)return r&&r(i),o&&o(!1),!0},[r,o]),a=To(l),s=u.useCallback(i=>{const d=He(i.target),c=d?Fn(d):Fn();i.target===i.currentTarget&&c===Co(i.nativeEvent)&&(n&&n(i),o&&o(!0),a(i))},[o,n,a]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:!t&&(r||o)?l:void 0}}}function wa(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,l=u.useRef({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:s}=Po(),i=u.useCallback(g=>{g.currentTarget.contains(g.target)&&l.current.isFocusWithin&&!g.currentTarget.contains(g.relatedTarget)&&(l.current.isFocusWithin=!1,s(),n&&n(g),o&&o(!1))},[n,o,l,s]),d=To(i),c=u.useCallback(g=>{if(!g.currentTarget.contains(g.target))return;const m=He(g.target),p=Fn(m);if(!l.current.isFocusWithin&&p===Co(g.nativeEvent)){r&&r(g),o&&o(!0),l.current.isFocusWithin=!0,d(g);let h=g.currentTarget;a(m,"focus",v=>{if(l.current.isFocusWithin&&!No(h,v.target)){let b=new m.defaultView.FocusEvent("blur",{relatedTarget:v.target});fa(b,h);let x=Ro(b);i(x)}},{capture:!0})}},[r,o,d,a,i]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:i}}}let zt=!1,Mt=0;function An(){zt=!0,setTimeout(()=>{zt=!1},50)}function Tr(e){e.pointerType==="touch"&&An()}function Ea(){if(!(typeof document>"u"))return Mt===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",Tr):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",An)),Mt++,()=>{Mt--,!(Mt>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Tr):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",An))}}function Zn(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[l,a]=u.useState(!1),s=u.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;u.useEffect(Ea,[]);let{addGlobalListener:i,removeAllGlobalListeners:d}=Po(),{hoverProps:c,triggerHoverEnd:g}=u.useMemo(()=>{let m=(v,b)=>{if(s.pointerType=b,o||b==="touch"||s.isHovered||!v.currentTarget.contains(v.target))return;s.isHovered=!0;let x=v.currentTarget;s.target=x,i(He(v.target),"pointerover",E=>{s.isHovered&&s.target&&!No(s.target,E.target)&&p(E,E.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:x,pointerType:b}),n&&n(!0),a(!0)},p=(v,b)=>{let x=s.target;s.pointerType="",s.target=null,!(b==="touch"||!s.isHovered||!x)&&(s.isHovered=!1,d(),r&&r({type:"hoverend",target:x,pointerType:b}),n&&n(!1),a(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=v=>{zt&&v.pointerType==="mouse"||m(v,v.pointerType)},h.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(h.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=v=>{!s.ignoreEmulatedMouseEvents&&!zt&&m(v,"mouse"),s.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,"mouse")}),{hoverProps:h,triggerHoverEnd:p}},[t,n,r,o,s,i,d]);return u.useEffect(()=>{o&&g({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:l}}function Qn(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=u.useRef({isFocused:!1,isFocusVisible:t||Io()}),[l,a]=u.useState(!1),[s,i]=u.useState(()=>o.current.isFocused&&o.current.isFocusVisible),d=u.useCallback(()=>i(o.current.isFocused&&o.current.isFocusVisible),[]),c=u.useCallback(p=>{o.current.isFocused=p,a(p),d()},[d]);xa(p=>{o.current.isFocusVisible=p,d()},[],{isTextInput:n});let{focusProps:g}=ya({isDisabled:r,onFocusChange:c}),{focusWithinProps:m}=wa({isDisabled:!r,onFocusWithinChange:c});return{isFocused:l,isFocusVisible:s,focusProps:r?m:g}}var ka=Object.defineProperty,$a=(e,t,n)=>t in e?ka(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,En=(e,t,n)=>($a(e,typeof t!="symbol"?t+"":t,n),n);let Sa=class{constructor(){En(this,"current",this.detect()),En(this,"handoffState","pending"),En(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},$e=new Sa;function Fe(e){var t;return $e.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Ae(e){var t,n;return $e.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function De(e){var t,n;return(n=(t=Ae(e))==null?void 0:t.activeElement)!=null?n:null}function Ao(e){return De(e)===e}function en(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ce(){let e=[],t={addEventListener(n,r,o,l){return n.addEventListener(r,o,l),t.add(()=>n.removeEventListener(r,o,l))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return en(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let l=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:l})})},group(n){let r=ce();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Je(){let[e]=u.useState(ce);return u.useEffect(()=>()=>e.dispose(),[e]),e}let Y=(e,t)=>{$e.isServer?u.useEffect(e,t):u.useLayoutEffect(e,t)};function Te(e){let t=u.useRef(e);return Y(()=>{t.current=e},[e]),t}let C=function(e){let t=Te(e);return u.useCallback((...n)=>t.current(...n),[t])};function Na(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function Ca(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Xn({disabled:e=!1}={}){let t=u.useRef(null),[n,r]=u.useState(!1),o=Je(),l=C(()=>{t.current=null,r(!1),o.dispose()}),a=C(s=>{if(o.dispose(),t.current===null){t.current=s.currentTarget,r(!0);{let i=Fe(s.currentTarget);o.addEventListener(i,"pointerup",l,!1),o.addEventListener(i,"pointermove",d=>{if(t.current){let c=Na(d);r(Ca(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(i,"pointercancel",l,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:a,onPointerUp:l,onClick:l}}}function re(e){return u.useMemo(()=>e,Object.values(e))}let ja=u.createContext(void 0);function Do(){return u.useContext(ja)}function Dn(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function J(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,J),r}var ye=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ye||{}),Ie=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ie||{});function K(){let e=Ra();return u.useCallback(t=>Pa({mergeRefs:e,...t}),[e])}function Pa({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:l=!0,name:a,mergeRefs:s}){s=s??Ta;let i=_o(t,e);if(l)return Lt(i,n,r,a,s);let d=o??0;if(d&2){let{static:c=!1,...g}=i;if(c)return Lt(g,n,r,a,s)}if(d&1){let{unmount:c=!0,...g}=i;return J(c?0:1,{0(){return null},1(){return Lt({...g,hidden:!0,style:{display:"none"}},n,r,a,s)}})}return Lt(i,n,r,a,s)}function Lt(e,t={},n,r,o){let{as:l=n,children:a,refName:s="ref",...i}=kn(e,["unmount","static"]),d=e.ref!==void 0?{[s]:e.ref}:{},c=typeof a=="function"?a(t):a;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(t)),i["aria-labelledby"]&&i["aria-labelledby"]===i.id&&(i["aria-labelledby"]=void 0);let g={};if(t){let m=!1,p=[];for(let[h,v]of Object.entries(t))typeof v=="boolean"&&(m=!0),v===!0&&p.push(h.replace(/([A-Z])/g,b=>`-${b.toLowerCase()}`));if(m){g["data-headlessui-state"]=p.join(" ");for(let h of p)g[`data-${h}`]=""}}if(tt(l)&&(Object.keys(We(i)).length>0||Object.keys(We(g)).length>0))if(!u.isValidElement(c)||Array.isArray(c)&&c.length>1||Fa(c)){if(Object.keys(We(i)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(We(i)).concat(Object.keys(We(g))).map(m=>` - ${m}`).join(`
2
- `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(m=>` - ${m}`).join(`
3
- `)].join(`
4
- `))}else{let m=c.props,p=m==null?void 0:m.className,h=typeof p=="function"?(...x)=>Dn(p(...x),i.className):Dn(p,i.className),v=h?{className:h}:{},b=_o(c.props,We(kn(i,["ref"])));for(let x in g)x in b&&delete g[x];return u.cloneElement(c,Object.assign({},b,g,d,{ref:o(Oa(c),d.ref)},v))}return u.createElement(l,Object.assign({},kn(i,["ref"]),!tt(l)&&d,!tt(l)&&g),c)}function Ra(){let e=u.useRef([]),t=u.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Ta(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function _o(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var l;return(l=o==null?void 0:o.preventDefault)==null?void 0:l.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...l){let a=n[r];for(let s of a){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...l)}}});return t}function Ye(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let l=n[r];for(let a of l)a==null||a(...o)}});return t}function H(e){var t;return Object.assign(u.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function We(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function kn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Oa(e){return u.version.split(".")[0]>="19"?e.props.ref:e.ref}function tt(e){return e===u.Fragment||e===Symbol.for("react.fragment")}function Fa(e){return tt(e.type)}let Ma="span";var qe=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(qe||{});function La(e,t){var n;let{features:r=1,...o}=e,l={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return K()({ourProps:l,theirProps:o,slot:{},defaultTag:Ma,name:"Hidden"})}let rt=H(La),Ia=u.createContext(void 0);function Aa(){return u.useContext(Ia)}function Bo(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Re(e){return Bo(e)&&"tagName"in e}function se(e){return Re(e)&&"accessKey"in e}function pe(e){return Re(e)&&"tabIndex"in e}function Da(e){return Re(e)&&"style"in e}function _a(e){return se(e)&&e.nodeName==="IFRAME"}function Ho(e){return se(e)&&e.nodeName==="INPUT"}function Or(e){return se(e)&&e.nodeName==="LABEL"}function Ba(e){return se(e)&&e.nodeName==="FIELDSET"}function Vo(e){return se(e)&&e.nodeName==="LEGEND"}function Ha(e){return Re(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function xt(e){let t=e.parentElement,n=null;for(;t&&!Ba(t);)Vo(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Va(n)?!1:r}function Va(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Vo(t))return!1;t=t.previousElementSibling}return!0}let Wo=Symbol();function Jn(e,t=!0){return Object.assign(e,{[Wo]:t})}function Z(...e){let t=u.useRef(e);u.useEffect(()=>{t.current=e},[e]);let n=C(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Wo]))?void 0:n}let er=u.createContext(null);er.displayName="DescriptionContext";function zo(){let e=u.useContext(er);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,zo),t}return e}function Go(){let[e,t]=u.useState([]);return[e.length>0?e.join(" "):void 0,u.useMemo(()=>function(n){let r=C(l=>(t(a=>[...a,l]),()=>t(a=>{let s=a.slice(),i=s.indexOf(l);return i!==-1&&s.splice(i,1),s}))),o=u.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return u.createElement(er.Provider,{value:o},n.children)},[t])]}let Wa="p";function za(e,t){let n=u.useId(),r=Do(),{id:o=`headlessui-description-${n}`,...l}=e,a=zo(),s=Z(t);Y(()=>a.register(o),[o,a.register]);let i=re({...a.slot,disabled:r||!1}),d={ref:s,...a.props,id:o};return K()({ourProps:d,theirProps:l,slot:i,defaultTag:Wa,name:a.name||"Description"})}let Ga=H(za),Ka=Object.assign(Ga,{});var G=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(G||{});let tn=u.createContext(null);tn.displayName="LabelContext";function tr(){let e=u.useContext(tn);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,tr),t}return e}function Ua(e){var t,n,r;let o=(n=(t=u.useContext(tn))==null?void 0:t.value)!=null?n:void 0;return((r=void 0)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Ko({inherit:e=!1}={}){let t=Ua(),[n,r]=u.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,u.useMemo(()=>function(l){let a=C(i=>(r(d=>[...d,i]),()=>r(d=>{let c=d.slice(),g=c.indexOf(i);return g!==-1&&c.splice(g,1),c}))),s=u.useMemo(()=>({register:a,slot:l.slot,name:l.name,props:l.props,value:l.value}),[a,l.slot,l.name,l.props,l.value]);return u.createElement(tn.Provider,{value:s},l.children)},[r])]}let Ya="label";function qa(e,t){var n;let r=u.useId(),o=tr(),l=Aa(),a=Do(),{id:s=`headlessui-label-${r}`,htmlFor:i=l??((n=o.props)==null?void 0:n.htmlFor),passive:d=!1,...c}=e,g=Z(t);Y(()=>o.register(s),[s,o.register]);let m=C(v=>{let b=v.currentTarget;if(!(v.target!==v.currentTarget&&Ha(v.target))&&(Or(b)&&v.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(v),Or(b))){let x=document.getElementById(b.htmlFor);if(x){let E=x.getAttribute("disabled");if(E==="true"||E==="")return;let w=x.getAttribute("aria-disabled");if(w==="true"||w==="")return;(Ho(x)&&(x.type==="file"||x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),p=re({...o.slot,disabled:a||!1}),h={ref:g,...o.props,id:s,htmlFor:i,onClick:m};return d&&("onClick"in h&&(delete h.htmlFor,delete h.onClick),"onClick"in c&&delete c.onClick),K()({ourProps:h,theirProps:c,slot:p,defaultTag:i?Ya:"div",name:o.name||"Label"})}let Za=H(qa);Object.assign(Za,{});let Qa=u.createContext(()=>{});function nn({value:e,children:t}){return u.createElement(Qa.Provider,{value:e},t)}function Fr(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Uo(e,t,n=!1){let[r,o]=u.useState(()=>Fr(t));return Y(()=>{if(!t||!e)return;let l=ce();return l.requestAnimationFrame(function a(){l.requestAnimationFrame(a),o(s=>{let i=Fr(t);return i.width===s.width&&i.height===s.height?s:i})}),()=>{l.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var Yo=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Yo||{});function Xa(e){let t=u.useRef(null),n=C(o=>{t.current=o.pointerType,!xt(o.currentTarget)&&o.pointerType==="mouse"&&o.button===Yo.Left&&(o.preventDefault(),e(o))}),r=C(o=>{t.current!=="mouse"&&(xt(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let qo=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};var Ja=Object.defineProperty,es=(e,t,n)=>t in e?Ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ts=(e,t,n)=>(es(e,t+"",n),n),Zo=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},be=(e,t,n)=>(Zo(e,t,"read from private field"),n?n.call(e):t.get(e)),$n=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Mr=(e,t,n,r)=>(Zo(e,t,"write to private field"),t.set(e,n),n),ke,ft,mt;let nr=class{constructor(t){$n(this,ke,{}),$n(this,ft,new qo(()=>new Set)),$n(this,mt,new Set),ts(this,"disposables",ce()),Mr(this,ke,t),$e.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return be(this,ke)}subscribe(t,n){if($e.isServer)return()=>{};let r={selector:t,callback:n,current:t(be(this,ke))};return be(this,mt).add(r),this.disposables.add(()=>{be(this,mt).delete(r)})}on(t,n){return $e.isServer?()=>{}:(be(this,ft).get(t).add(n),this.disposables.add(()=>{be(this,ft).get(t).delete(n)}))}send(t){let n=this.reduce(be(this,ke),t);if(n!==be(this,ke)){Mr(this,ke,n);for(let r of be(this,mt)){let o=r.selector(be(this,ke));Qo(r.current,o)||(r.current=o,r.callback(o))}for(let r of be(this,ft).get(t.type))r(be(this,ke),t)}}};ke=new WeakMap,ft=new WeakMap,mt=new WeakMap;function Qo(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Sn(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Sn(e.entries(),t.entries()):Lr(e)&&Lr(t)?Sn(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Sn(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function Lr(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Ir(e){let[t,n]=e(),r=ce();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var ns=Object.defineProperty,rs=(e,t,n)=>t in e?ns(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ar=(e,t,n)=>(rs(e,typeof t!="symbol"?t+"":t,n),n),Xo=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Xo||{});let os={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let l=e.stack.slice();return l.splice(o,1),l.push(n),r=l,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},ls=class Jo extends nr{constructor(){super(...arguments),Ar(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),Ar(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Jo({stack:[]})}reduce(t,n){return J(n.type,os,t,n)}};const St=new qo(()=>ls.new());var _n={exports:{}},Nn={};/**
5
- * @license React
6
- * use-sync-external-store-with-selector.production.js
7
- *
8
- * Copyright (c) Meta Platforms, Inc. and affiliates.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- */var Dr;function as(){if(Dr)return Nn;Dr=1;var e=u;function t(i,d){return i===d&&(i!==0||1/i===1/d)||i!==i&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,l=e.useEffect,a=e.useMemo,s=e.useDebugValue;return Nn.useSyncExternalStoreWithSelector=function(i,d,c,g,m){var p=o(null);if(p.current===null){var h={hasValue:!1,value:null};p.current=h}else h=p.current;p=a(function(){function b($){if(!x){if(x=!0,E=$,$=g($),m!==void 0&&h.hasValue){var j=h.value;if(m(j,$))return w=j}return w=$}if(j=w,n(E,$))return j;var R=g($);return m!==void 0&&m(j,R)?(E=$,j):(E=$,w=R)}var x=!1,E,w,k=c===void 0?null:c;return[function(){return b(d())},k===null?void 0:function(){return b(k())}]},[d,c,g,m]);var v=r(i,p[0],p[1]);return l(function(){h.hasValue=!0,h.value=v},[v]),s(v),v},Nn}var Cn={};/**
13
- * @license React
14
- * use-sync-external-store-with-selector.development.js
15
- *
16
- * Copyright (c) Meta Platforms, Inc. and affiliates.
17
- *
18
- * This source code is licensed under the MIT license found in the
19
- * LICENSE file in the root directory of this source tree.
20
- */var _r;function ss(){return _r||(_r=1,process.env.NODE_ENV!=="production"&&function(){function e(i,d){return i===d&&(i!==0||1/i===1/d)||i!==i&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=u,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,l=t.useEffect,a=t.useMemo,s=t.useDebugValue;Cn.useSyncExternalStoreWithSelector=function(i,d,c,g,m){var p=o(null);if(p.current===null){var h={hasValue:!1,value:null};p.current=h}else h=p.current;p=a(function(){function b($){if(!x){if(x=!0,E=$,$=g($),m!==void 0&&h.hasValue){var j=h.value;if(m(j,$))return w=j}return w=$}if(j=w,n(E,$))return j;var R=g($);return m!==void 0&&m(j,R)?(E=$,j):(E=$,w=R)}var x=!1,E,w,k=c===void 0?null:c;return[function(){return b(d())},k===null?void 0:function(){return b(k())}]},[d,c,g,m]);var v=r(i,p[0],p[1]);return l(function(){h.hasValue=!0,h.value=v},[v]),s(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Cn}process.env.NODE_ENV==="production"?_n.exports=as():_n.exports=ss();var is=_n.exports;function ne(e,t,n=Qo){return is.useSyncExternalStoreWithSelector(C(r=>e.subscribe(us,r)),C(()=>e.state),C(()=>e.state),C(t),n)}function us(e){return e}function Nt(e,t){let n=u.useId(),r=St.get(t),[o,l]=ne(r,u.useCallback(a=>[r.selectors.isTop(a,n),r.selectors.inStack(a,n)],[r,n]));return Y(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?l?o:!0:!1}let Bn=new Map,ht=new Map;function Br(e){var t;let n=(t=ht.get(e))!=null?t:0;return ht.set(e,n+1),n!==0?()=>Hr(e):(Bn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Hr(e))}function Hr(e){var t;let n=(t=ht.get(e))!=null?t:1;if(n===1?ht.delete(e):ht.set(e,n-1),n!==1)return;let r=Bn.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Bn.delete(e))}function el(e,{allowed:t,disallowed:n}={}){let r=Nt(e,"inert-others");Y(()=>{var o,l;if(!r)return;let a=ce();for(let i of(o=n==null?void 0:n())!=null?o:[])i&&a.add(Br(i));let s=(l=t==null?void 0:t())!=null?l:[];for(let i of s){if(!i)continue;let d=Fe(i);if(!d)continue;let c=i.parentElement;for(;c&&c!==d.body;){for(let g of c.children)s.some(m=>g.contains(m))||a.add(Br(g));c=c.parentElement}}return a.dispose},[r,t,n])}function rr(e,t,n){let r=Te(o=>{let l=o.getBoundingClientRect();l.x===0&&l.y===0&&l.width===0&&l.height===0&&n()});u.useEffect(()=>{if(!e)return;let o=t===null?null:se(t)?t:t.current;if(!o)return;let l=ce();if(typeof ResizeObserver<"u"){let a=new ResizeObserver(()=>r.current(o));a.observe(o),l.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>r.current(o));a.observe(o),l.add(()=>a.disconnect())}return()=>l.dispose()},[t,r,e])}let Gt=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),cs=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var te=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(te||{}),ot=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(ot||{}),ds=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(ds||{});function Ct(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Gt)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function fs(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(cs)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var rn=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(rn||{});function on(e,t=0){var n;return e===((n=Fe(e))==null?void 0:n.body)?!1:J(t,{0(){return e.matches(Gt)},1(){let r=e;for(;r!==null;){if(r.matches(Gt))return!0;r=r.parentElement}return!1}})}function tl(e){ce().nextFrame(()=>{let t=De(e);t&&pe(t)&&!on(t,0)&&Se(e)})}var ms=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(ms||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Se(e){e==null||e.focus({preventScroll:!0})}let ps=["textarea","input"].join(",");function hs(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ps))!=null?n:!1}function nl(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),l=t(r);if(o===null||l===null)return 0;let a=o.compareDocumentPosition(l);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function gs(e,t,n=e===null?document.body:Ae(e)){return he(Ct(n),t,{relativeTo:e})}function he(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let l=Array.isArray(e)?e.length>0?Ae(e[0]):document:Ae(e),a=Array.isArray(e)?n?nl(e):e:t&64?fs(e):Ct(e);o.length>0&&a.length>1&&(a=a.filter(p=>!o.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===p:h===p))),r=r??(l==null?void 0:l.activeElement);let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(r))-1;if(t&4)return Math.max(0,a.indexOf(r))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=t&32?{preventScroll:!0}:{},c=0,g=a.length,m;do{if(c>=g||c+g<=0)return 0;let p=i+c;if(t&16)p=(p+g)%g;else{if(p<0)return 3;if(p>=g)return 1}m=a[p],m==null||m.focus(d),c+=s}while(m!==De(m));return t&6&&hs(m)&&m.select(),2}function rl(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function vs(){return/Android/gi.test(window.navigator.userAgent)}function Vr(){return rl()||vs()}function et(e,t,n,r){let o=Te(n);u.useEffect(()=>{if(!e)return;function l(a){o.current(a)}return document.addEventListener(t,l,r),()=>document.removeEventListener(t,l,r)},[e,t,r])}function ol(e,t,n,r){let o=Te(n);u.useEffect(()=>{if(!e)return;function l(a){o.current(a)}return window.addEventListener(t,l,r),()=>window.removeEventListener(t,l,r)},[e,t,r])}const Wr=30;function or(e,t,n){let r=Te(n),o=u.useCallback(function(s,i){if(s.defaultPrevented)return;let d=i(s);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let c=function g(m){return typeof m=="function"?g(m()):Array.isArray(m)||m instanceof Set?m:[m]}(t);for(let g of c)if(g!==null&&(g.contains(d)||s.composed&&s.composedPath().includes(g)))return;return!on(d,rn.Loose)&&d.tabIndex!==-1&&s.preventDefault(),r.current(s,d)},[r,t]),l=u.useRef(null);et(e,"pointerdown",s=>{var i,d;Vr()||(l.current=((d=(i=s.composedPath)==null?void 0:i.call(s))==null?void 0:d[0])||s.target)},!0),et(e,"pointerup",s=>{if(Vr()||!l.current)return;let i=l.current;return l.current=null,o(s,()=>i)},!0);let a=u.useRef({x:0,y:0});et(e,"touchstart",s=>{a.current.x=s.touches[0].clientX,a.current.y=s.touches[0].clientY},!0),et(e,"touchend",s=>{let i={x:s.changedTouches[0].clientX,y:s.changedTouches[0].clientY};if(!(Math.abs(i.x-a.current.x)>=Wr||Math.abs(i.y-a.current.y)>=Wr))return o(s,()=>pe(s.target)?s.target:null)},!0),ol(e,"blur",s=>o(s,()=>_a(window.document.activeElement)?window.document.activeElement:null),!0)}function Ze(...e){return u.useMemo(()=>Fe(...e),[...e])}function bs(...e){return u.useMemo(()=>Ae(...e),[...e])}var xs=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(xs||{});const It={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},ys=200,zr=5;function ws(e,{trigger:t,action:n,close:r,select:o}){let l=u.useRef(null),a=u.useRef(null),s=u.useRef(null);et(e&&t!==null,"pointerdown",i=>{Bo(i==null?void 0:i.target)&&t!=null&&t.contains(i.target)&&(a.current=i.x,s.current=i.y,l.current=i.timeStamp)}),et(e&&t!==null,"pointerup",i=>{var d,c;let g=l.current;if(g===null||(l.current=null,!pe(i.target))||Math.abs(i.x-((d=a.current)!=null?d:i.x))<zr&&Math.abs(i.y-((c=s.current)!=null?c:i.y))<zr)return;let m=n(i);switch(m.kind){case 0:return;case 1:{i.timeStamp-g>ys&&(o(m.target),r());break}case 2:{r();break}}},{capture:!0})}function lr(e,t,n,r){let o=Te(n);u.useEffect(()=>{e=e??window;function l(a){o.current(a)}return e.addEventListener(t,l,r),()=>e.removeEventListener(t,l,r)},[e,t,r])}function ar(e,t){return u.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Es(e){return u.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function ks(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...l){let a=t[o].call(n,...l);a&&(n=a,r.forEach(s=>s()))}}}function $s(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),l=Math.max(0,e-o);n.style(r,"paddingRight",`${l}px`)}}}function Ss(){return rl()?{before({doc:e,d:t,meta:n}){function r(o){for(let l of n().containers)for(let a of l())if(a.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=ce();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let l=(o=window.scrollY)!=null?o:window.pageYOffset,a=null;t.addEventListener(e,"click",s=>{if(pe(s.target))try{let i=s.target.closest("a");if(!i)return;let{hash:d}=new URL(i.href),c=e.querySelector(d);pe(c)&&!r(c)&&(a=c)}catch{}},!0),t.group(s=>{t.addEventListener(e,"touchstart",i=>{if(s.dispose(),pe(i.target)&&Da(i.target))if(r(i.target)){let d=i.target;for(;d.parentElement&&r(d.parentElement);)d=d.parentElement;s.style(d,"overscrollBehavior","contain")}else s.style(i.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",s=>{if(pe(s.target)){if(Ho(s.target))return;if(r(s.target)){let i=s.target;for(;i.parentElement&&i.dataset.headlessuiPortal!==""&&!(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth);)i=i.parentElement;i.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let i=(s=window.scrollY)!=null?s:window.pageYOffset;l!==i&&window.scrollTo(0,l),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function Ns(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Gr(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Ke=ks(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ce(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=Gr(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=Gr(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[Ss(),$s(),Ns()];n.forEach(({before:r})=>r==null?void 0:r(t)),n.forEach(({after:r})=>r==null?void 0:r(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ke.subscribe(()=>{let e=Ke.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Ke.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Ke.dispatch("TEARDOWN",n)}});function Cs(e,t,n=()=>({containers:[]})){let r=Es(Ke),o=t?r.get(t):void 0,l=o?o.count>0:!1;return Y(()=>{if(!(!t||!e))return Ke.dispatch("PUSH",t,n),()=>Ke.dispatch("POP",t,n)},[e,t]),l}function sr(e,t,n=()=>[document.body]){let r=Nt(e,"scroll-lock");Cs(r,t,o=>{var l;return{containers:[...(l=o.containers)!=null?l:[],n]}})}function Kr(e){return[e.screenX,e.screenY]}function js(){let e=u.useRef([-1,-1]);return{wasMoved(t){let n=Kr(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Kr(t)}}}function Ps(e=0){let[t,n]=u.useState(e),r=u.useCallback(i=>n(i),[]),o=u.useCallback(i=>n(d=>d|i),[]),l=u.useCallback(i=>(t&i)===i,[t]),a=u.useCallback(i=>n(d=>d&~i),[]),s=u.useCallback(i=>n(d=>d^i),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:l,removeFlag:a,toggleFlag:s}}var Ur,Yr;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Ur=process==null?void 0:process.env)==null?void 0:Ur.NODE_ENV)==="test"&&typeof((Yr=Element==null?void 0:Element.prototype)==null?void 0:Yr.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
21
- `)),[]});var Rs=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Rs||{});function jt(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Pt(e,t,n,r){let[o,l]=u.useState(n),{hasFlag:a,addFlag:s,removeFlag:i}=Ps(e&&o?3:0),d=u.useRef(!1),c=u.useRef(!1),g=Je();return Y(()=>{var m;if(e){if(n&&l(!0),!t){n&&s(3);return}return(m=r==null?void 0:r.start)==null||m.call(r,n),Ts(t,{inFlight:d,prepare(){c.current?c.current=!1:c.current=d.current,d.current=!0,!c.current&&(n?(s(3),i(4)):(s(4),i(2)))},run(){c.current?n?(i(3),s(4)):(i(4),s(3)):n?i(1):s(1)},done(){var p;c.current&&Ms(t)||(d.current=!1,i(7),n||l(!1),(p=r==null?void 0:r.end)==null||p.call(r,n))}})}},[e,n,t,g]),e?[o,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Ts(e,{prepare:t,run:n,done:r,inFlight:o}){let l=ce();return Fs(e,{prepare:t,inFlight:o}),l.nextFrame(()=>{n(),l.requestAnimationFrame(()=>{l.add(Os(e,r))})}),l.dispose}function Os(e,t){var n,r;let o=ce();if(!e)return o.dispose;let l=!1;o.add(()=>{l=!0});let a=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(s=>s instanceof CSSTransition))!=null?r:[];return a.length===0?(t(),o.dispose):(Promise.allSettled(a.map(s=>s.finished)).then(()=>{l||t()}),o.dispose)}function Fs(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function Ms(e){var t,n;return((n=(t=e.getAnimations)==null?void 0:t.call(e))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function Ls(e,{container:t,accept:n,walk:r}){let o=u.useRef(n),l=u.useRef(r);u.useEffect(()=>{o.current=n,l.current=r},[n,r]),Y(()=>{if(!t||!e)return;let a=Fe(t);if(!a)return;let s=o.current,i=l.current,d=Object.assign(g=>s(g),{acceptNode:s}),c=a.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,d,!1);for(;c.nextNode();)i(c.currentNode)},[t,e,o,l])}function ir(e,t){let n=u.useRef([]),r=C(e);u.useEffect(()=>{let o=[...n.current];for(let[l,a]of t.entries())if(n.current[l]!==a){let s=r(t,o);return n.current=t,s}},[r,...t])}function ln(){return typeof window<"u"}function ut(e){return ll(e)?(e.nodeName||"").toLowerCase():"#document"}function ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function je(e){var t;return(t=(ll(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ll(e){return ln()?e instanceof Node||e instanceof ve(e).Node:!1}function ae(e){return ln()?e instanceof Element||e instanceof ve(e).Element:!1}function Ce(e){return ln()?e instanceof HTMLElement||e instanceof ve(e).HTMLElement:!1}function qr(e){return!ln()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ve(e).ShadowRoot}const Is=new Set(["inline","contents"]);function Rt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Is.has(o)}const As=new Set(["table","td","th"]);function Ds(e){return As.has(ut(e))}const _s=[":popover-open",":modal"];function an(e){return _s.some(t=>{try{return e.matches(t)}catch{return!1}})}const Bs=["transform","translate","scale","rotate","perspective"],Hs=["transform","translate","scale","rotate","perspective","filter"],Vs=["paint","layout","strict","content"];function ur(e){const t=cr(),n=ae(e)?Ee(e):e;return Bs.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Hs.some(r=>(n.willChange||"").includes(r))||Vs.some(r=>(n.contain||"").includes(r))}function Ws(e){let t=_e(e);for(;Ce(t)&&!lt(t);){if(ur(t))return t;if(an(t))return null;t=_e(t)}return null}function cr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zs=new Set(["html","body","#document"]);function lt(e){return zs.has(ut(e))}function Ee(e){return ve(e).getComputedStyle(e)}function sn(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _e(e){if(ut(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qr(e)&&e.host||je(e);return qr(t)?t.host:t}function al(e){const t=_e(e);return lt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ce(t)&&Rt(t)?t:al(t)}function yt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=al(e),l=o===((r=e.ownerDocument)==null?void 0:r.body),a=ve(o);if(l){const s=Hn(a);return t.concat(a,a.visualViewport||[],Rt(o)?o:[],s&&n?yt(s):[])}return t.concat(o,yt(o,[],n))}function Hn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gs(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const Qe=Math.min,le=Math.max,wt=Math.round,At=Math.floor,Ne=e=>({x:e,y:e}),Ks={left:"right",right:"left",bottom:"top",top:"bottom"},Us={start:"end",end:"start"};function Zr(e,t,n){return le(e,Qe(t,n))}function ct(e,t){return typeof e=="function"?e(t):e}function Be(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function sl(e){return e==="x"?"y":"x"}function il(e){return e==="y"?"height":"width"}const Ys=new Set(["top","bottom"]);function Pe(e){return Ys.has(Be(e))?"y":"x"}function ul(e){return sl(Pe(e))}function qs(e,t,n){n===void 0&&(n=!1);const r=Tt(e),o=ul(e),l=il(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(a=Kt(a)),[a,Kt(a)]}function Zs(e){const t=Kt(e);return[Vn(e),t,Vn(t)]}function Vn(e){return e.replace(/start|end/g,t=>Us[t])}const Qr=["left","right"],Xr=["right","left"],Qs=["top","bottom"],Xs=["bottom","top"];function Js(e,t,n){switch(e){case"top":case"bottom":return n?t?Xr:Qr:t?Qr:Xr;case"left":case"right":return t?Qs:Xs;default:return[]}}function ei(e,t,n,r){const o=Tt(e);let l=Js(Be(e),n==="start",r);return o&&(l=l.map(a=>a+"-"+o),t&&(l=l.concat(l.map(Vn)))),l}function Kt(e){return e.replace(/left|right|bottom|top/g,t=>Ks[t])}function ti(e){return{top:0,right:0,bottom:0,left:0,...e}}function ni(e){return typeof e!="number"?ti(e):{top:e,right:e,bottom:e,left:e}}function Ut(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Jr(e,t,n){let{reference:r,floating:o}=e;const l=Pe(t),a=ul(t),s=il(a),i=Be(t),d=l==="y",c=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,m=r[s]/2-o[s]/2;let p;switch(i){case"top":p={x:c,y:r.y-o.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:g};break;case"left":p={x:r.x-o.width,y:g};break;default:p={x:r.x,y:r.y}}switch(Tt(t)){case"start":p[a]-=m*(n&&d?-1:1);break;case"end":p[a]+=m*(n&&d?-1:1);break}return p}const ri=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:a}=n,s=l.filter(Boolean),i=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:g}=Jr(d,r,i),m=r,p={},h=0;for(let v=0;v<s.length;v++){const{name:b,fn:x}=s[v],{x:E,y:w,data:k,reset:$}=await x({x:c,y:g,initialPlacement:r,placement:m,strategy:o,middlewareData:p,rects:d,platform:a,elements:{reference:e,floating:t}});c=E??c,g=w??g,p={...p,[b]:{...p[b],...k}},$&&h<=50&&(h++,typeof $=="object"&&($.placement&&(m=$.placement),$.rects&&(d=$.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):$.rects),{x:c,y:g}=Jr(d,m,i)),v=-1)}return{x:c,y:g,placement:m,strategy:o,middlewareData:p}};async function un(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:a,elements:s,strategy:i}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:g="floating",altBoundary:m=!1,padding:p=0}=ct(t,e),h=ni(p),b=s[m?g==="floating"?"reference":"floating":g],x=Ut(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(b)))==null||n?b:b.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(s.floating)),boundary:d,rootBoundary:c,strategy:i})),E=g==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,w=await(l.getOffsetParent==null?void 0:l.getOffsetParent(s.floating)),k=await(l.isElement==null?void 0:l.isElement(w))?await(l.getScale==null?void 0:l.getScale(w))||{x:1,y:1}:{x:1,y:1},$=Ut(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:w,strategy:i}):E);return{top:(x.top-$.top+h.top)/k.y,bottom:($.bottom-x.bottom+h.bottom)/k.y,left:(x.left-$.left+h.left)/k.x,right:($.right-x.right+h.right)/k.x}}const oi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:l,rects:a,initialPlacement:s,platform:i,elements:d}=t,{mainAxis:c=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...b}=ct(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const x=Be(o),E=Pe(s),w=Be(s)===s,k=await(i.isRTL==null?void 0:i.isRTL(d.floating)),$=m||(w||!v?[Kt(s)]:Zs(s)),j=h!=="none";!m&&j&&$.push(...ei(s,v,h,k));const R=[s,...$],I=await un(t,b),M=[];let N=((r=l.flip)==null?void 0:r.overflows)||[];if(c&&M.push(I[x]),g){const P=qs(o,a,k);M.push(I[P[0]],I[P[1]])}if(N=[...N,{placement:o,overflows:M}],!M.every(P=>P<=0)){var T,B;const P=(((T=l.flip)==null?void 0:T.index)||0)+1,V=R[P];if(V&&(!(g==="alignment"?E!==Pe(V):!1)||N.every(S=>Pe(S.placement)===E?S.overflows[0]>0:!0)))return{data:{index:P,overflows:N},reset:{placement:V}};let D=(B=N.filter(W=>W.overflows[0]<=0).sort((W,S)=>W.overflows[1]-S.overflows[1])[0])==null?void 0:B.placement;if(!D)switch(p){case"bestFit":{var A;const W=(A=N.filter(S=>{if(j){const L=Pe(S.placement);return L===E||L==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(L=>L>0).reduce((L,z)=>L+z,0)]).sort((S,L)=>S[1]-L[1])[0])==null?void 0:A[0];W&&(D=W);break}case"initialPlacement":D=s;break}if(o!==D)return{reset:{placement:D}}}return{}}}},li=new Set(["left","top"]);async function ai(e,t){const{placement:n,platform:r,elements:o}=e,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Be(n),s=Tt(n),i=Pe(n)==="y",d=li.has(a)?-1:1,c=l&&i?-1:1,g=ct(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),i?{x:p*c,y:m*d}:{x:m*d,y:p*c}}const si=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:l,placement:a,middlewareData:s}=t,i=await ai(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+i.x,y:l+i.y,data:{...i,placement:a}}}}},ii=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:s={fn:b=>{let{x,y:E}=b;return{x,y:E}}},...i}=ct(e,t),d={x:n,y:r},c=await un(t,i),g=Pe(Be(o)),m=sl(g);let p=d[m],h=d[g];if(l){const b=m==="y"?"top":"left",x=m==="y"?"bottom":"right",E=p+c[b],w=p-c[x];p=Zr(E,p,w)}if(a){const b=g==="y"?"top":"left",x=g==="y"?"bottom":"right",E=h+c[b],w=h-c[x];h=Zr(E,h,w)}const v=s.fn({...t,[m]:p,[g]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:l,[g]:a}}}}}},ui=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:l,platform:a,elements:s}=t,{apply:i=()=>{},...d}=ct(e,t),c=await un(t,d),g=Be(o),m=Tt(o),p=Pe(o)==="y",{width:h,height:v}=l.floating;let b,x;g==="top"||g==="bottom"?(b=g,x=m===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(x=g,b=m==="end"?"top":"bottom");const E=v-c.top-c.bottom,w=h-c.left-c.right,k=Qe(v-c[b],E),$=Qe(h-c[x],w),j=!t.middlewareData.shift;let R=k,I=$;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=E),j&&!m){const N=le(c.left,0),T=le(c.right,0),B=le(c.top,0),A=le(c.bottom,0);p?I=h-2*(N!==0||T!==0?N+T:le(c.left,c.right)):R=v-2*(B!==0||A!==0?B+A:le(c.top,c.bottom))}await i({...t,availableWidth:I,availableHeight:R});const M=await a.getDimensions(s.floating);return h!==M.width||v!==M.height?{reset:{rects:!0}}:{}}}};function cl(e){const t=Ee(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ce(e),l=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=wt(n)!==l||wt(r)!==a;return s&&(n=l,r=a),{width:n,height:r,$:s}}function dr(e){return ae(e)?e:e.contextElement}function nt(e){const t=dr(e);if(!Ce(t))return Ne(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:l}=cl(t);let a=(l?wt(n.width):n.width)/r,s=(l?wt(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const ci=Ne(0);function dl(e){const t=ve(e);return!cr()||!t.visualViewport?ci:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function di(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ve(e)?!1:t}function Xe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=dr(e);let a=Ne(1);t&&(r?ae(r)&&(a=nt(r)):a=nt(e));const s=di(l,n,r)?dl(l):Ne(0);let i=(o.left+s.x)/a.x,d=(o.top+s.y)/a.y,c=o.width/a.x,g=o.height/a.y;if(l){const m=ve(l),p=r&&ae(r)?ve(r):r;let h=m,v=Hn(h);for(;v&&r&&p!==h;){const b=nt(v),x=v.getBoundingClientRect(),E=Ee(v),w=x.left+(v.clientLeft+parseFloat(E.paddingLeft))*b.x,k=x.top+(v.clientTop+parseFloat(E.paddingTop))*b.y;i*=b.x,d*=b.y,c*=b.x,g*=b.y,i+=w,d+=k,h=ve(v),v=Hn(h)}}return Ut({width:c,height:g,x:i,y:d})}function cn(e,t){const n=sn(e).scrollLeft;return t?t.left+n:Xe(je(e)).left+n}function fl(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-cn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function fi(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const l=o==="fixed",a=je(r),s=t?an(t.floating):!1;if(r===a||s&&l)return n;let i={scrollLeft:0,scrollTop:0},d=Ne(1);const c=Ne(0),g=Ce(r);if((g||!g&&!l)&&((ut(r)!=="body"||Rt(a))&&(i=sn(r)),Ce(r))){const p=Xe(r);d=nt(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const m=a&&!g&&!l?fl(a,i):Ne(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-i.scrollLeft*d.x+c.x+m.x,y:n.y*d.y-i.scrollTop*d.y+c.y+m.y}}function mi(e){return Array.from(e.getClientRects())}function pi(e){const t=je(e),n=sn(e),r=e.ownerDocument.body,o=le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+cn(e);const s=-n.scrollTop;return Ee(r).direction==="rtl"&&(a+=le(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:a,y:s}}const eo=25;function hi(e,t){const n=ve(e),r=je(e),o=n.visualViewport;let l=r.clientWidth,a=r.clientHeight,s=0,i=0;if(o){l=o.width,a=o.height;const c=cr();(!c||c&&t==="fixed")&&(s=o.offsetLeft,i=o.offsetTop)}const d=cn(r);if(d<=0){const c=r.ownerDocument,g=c.body,m=getComputedStyle(g),p=c.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(r.clientWidth-g.clientWidth-p);h<=eo&&(l-=h)}else d<=eo&&(l+=d);return{width:l,height:a,x:s,y:i}}const gi=new Set(["absolute","fixed"]);function vi(e,t){const n=Xe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=Ce(e)?nt(e):Ne(1),a=e.clientWidth*l.x,s=e.clientHeight*l.y,i=o*l.x,d=r*l.y;return{width:a,height:s,x:i,y:d}}function to(e,t,n){let r;if(t==="viewport")r=hi(e,n);else if(t==="document")r=pi(je(e));else if(ae(t))r=vi(t,n);else{const o=dl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ut(r)}function ml(e,t){const n=_e(e);return n===t||!ae(n)||lt(n)?!1:Ee(n).position==="fixed"||ml(n,t)}function bi(e,t){const n=t.get(e);if(n)return n;let r=yt(e,[],!1).filter(s=>ae(s)&&ut(s)!=="body"),o=null;const l=Ee(e).position==="fixed";let a=l?_e(e):e;for(;ae(a)&&!lt(a);){const s=Ee(a),i=ur(a);!i&&s.position==="fixed"&&(o=null),(l?!i&&!o:!i&&s.position==="static"&&!!o&&gi.has(o.position)||Rt(a)&&!i&&ml(e,a))?r=r.filter(c=>c!==a):o=s,a=_e(a)}return t.set(e,r),r}function xi(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?an(t)?[]:bi(t,this._c):[].concat(n),r],s=a[0],i=a.reduce((d,c)=>{const g=to(t,c,o);return d.top=le(g.top,d.top),d.right=Qe(g.right,d.right),d.bottom=Qe(g.bottom,d.bottom),d.left=le(g.left,d.left),d},to(t,s,o));return{width:i.right-i.left,height:i.bottom-i.top,x:i.left,y:i.top}}function yi(e){const{width:t,height:n}=cl(e);return{width:t,height:n}}function wi(e,t,n){const r=Ce(t),o=je(t),l=n==="fixed",a=Xe(e,!0,l,t);let s={scrollLeft:0,scrollTop:0};const i=Ne(0);function d(){i.x=cn(o)}if(r||!r&&!l)if((ut(t)!=="body"||Rt(o))&&(s=sn(t)),r){const p=Xe(t,!0,l,t);i.x=p.x+t.clientLeft,i.y=p.y+t.clientTop}else o&&d();l&&!r&&o&&d();const c=o&&!r&&!l?fl(o,s):Ne(0),g=a.left+s.scrollLeft-i.x-c.x,m=a.top+s.scrollTop-i.y-c.y;return{x:g,y:m,width:a.width,height:a.height}}function jn(e){return Ee(e).position==="static"}function no(e,t){if(!Ce(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return je(e)===n&&(n=n.ownerDocument.body),n}function pl(e,t){const n=ve(e);if(an(e))return n;if(!Ce(e)){let o=_e(e);for(;o&&!lt(o);){if(ae(o)&&!jn(o))return o;o=_e(o)}return n}let r=no(e,t);for(;r&&Ds(r)&&jn(r);)r=no(r,t);return r&&lt(r)&&jn(r)&&!ur(r)?n:r||Ws(e)||n}const Ei=async function(e){const t=this.getOffsetParent||pl,n=this.getDimensions,r=await n(e.floating);return{reference:wi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ki(e){return Ee(e).direction==="rtl"}const $i={convertOffsetParentRelativeRectToViewportRelativeRect:fi,getDocumentElement:je,getClippingRect:xi,getOffsetParent:pl,getElementRects:Ei,getClientRects:mi,getDimensions:yi,getScale:nt,isElement:ae,isRTL:ki};function hl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Si(e,t){let n=null,r;const o=je(e);function l(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,i){s===void 0&&(s=!1),i===void 0&&(i=1),l();const d=e.getBoundingClientRect(),{left:c,top:g,width:m,height:p}=d;if(s||t(),!m||!p)return;const h=At(g),v=At(o.clientWidth-(c+m)),b=At(o.clientHeight-(g+p)),x=At(c),w={rootMargin:-h+"px "+-v+"px "+-b+"px "+-x+"px",threshold:le(0,Qe(1,i))||1};let k=!0;function $(j){const R=j[0].intersectionRatio;if(R!==i){if(!k)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!hl(d,e.getBoundingClientRect())&&a(),k=!1}try{n=new IntersectionObserver($,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver($,w)}n.observe(e)}return a(!0),l}function Ni(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:i=!1}=r,d=dr(e),c=o||l?[...d?yt(d):[],...yt(t)]:[];c.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),l&&x.addEventListener("resize",n)});const g=d&&s?Si(d,n):null;let m=-1,p=null;a&&(p=new ResizeObserver(x=>{let[E]=x;E&&E.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),d&&!i&&p.observe(d),p.observe(t));let h,v=i?Xe(e):null;i&&b();function b(){const x=Xe(e);v&&!hl(v,x)&&n(),v=x,h=requestAnimationFrame(b)}return n(),()=>{var x;c.forEach(E=>{o&&E.removeEventListener("scroll",n),l&&E.removeEventListener("resize",n)}),g==null||g(),(x=p)==null||x.disconnect(),p=null,i&&cancelAnimationFrame(h)}}const Pn=un,Ci=si,ji=ii,Pi=oi,Ri=ui,Ti=(e,t,n)=>{const r=new Map,o={platform:$i,...n},l={...o.platform,_c:r};return ri(e,t,{...o,platform:l})};var Oi=typeof document<"u",Fi=function(){},_t=Oi?u.useLayoutEffect:Fi;function Yt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Yt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&e.$$typeof)&&!Yt(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function gl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ro(e,t){const n=gl(e);return Math.round(t*n)/n}function Rn(e){const t=y.useRef(e);return _t(()=>{t.current=e}),t}function Mi(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:a}={},transform:s=!0,whileElementsMounted:i,open:d}=e,[c,g]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=y.useState(r);Yt(m,r)||p(r);const[h,v]=y.useState(null),[b,x]=y.useState(null),E=y.useCallback(S=>{S!==j.current&&(j.current=S,v(S))},[]),w=y.useCallback(S=>{S!==R.current&&(R.current=S,x(S))},[]),k=l||h,$=a||b,j=y.useRef(null),R=y.useRef(null),I=y.useRef(c),M=i!=null,N=Rn(i),T=Rn(o),B=Rn(d),A=y.useCallback(()=>{if(!j.current||!R.current)return;const S={placement:t,strategy:n,middleware:m};T.current&&(S.platform=T.current),Ti(j.current,R.current,S).then(L=>{const z={...L,isPositioned:B.current!==!1};P.current&&!Yt(I.current,z)&&(I.current=z,Vt.flushSync(()=>{g(z)}))})},[m,t,n,T,B]);_t(()=>{d===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(S=>({...S,isPositioned:!1})))},[d]);const P=y.useRef(!1);_t(()=>(P.current=!0,()=>{P.current=!1}),[]),_t(()=>{if(k&&(j.current=k),$&&(R.current=$),k&&$){if(N.current)return N.current(k,$,A);A()}},[k,$,A,N,M]);const V=y.useMemo(()=>({reference:j,floating:R,setReference:E,setFloating:w}),[E,w]),D=y.useMemo(()=>({reference:k,floating:$}),[k,$]),W=y.useMemo(()=>{const S={position:n,left:0,top:0};if(!D.floating)return S;const L=ro(D.floating,c.x),z=ro(D.floating,c.y);return s?{...S,transform:"translate("+L+"px, "+z+"px)",...gl(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:z}},[n,s,D.floating,c.x,c.y]);return y.useMemo(()=>({...c,update:A,refs:V,elements:D,floatingStyles:W}),[c,A,V,D,W])}const vl=(e,t)=>({...Ci(e),options:[e,t]}),Li=(e,t)=>({...ji(e),options:[e,t]}),Ii=(e,t)=>({...Pi(e),options:[e,t]}),Ai=(e,t)=>({...Ri(e),options:[e,t]}),bl={...y},Di=bl.useInsertionEffect,_i=Di||(e=>e());function xl(e){const t=y.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return _i(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Wn=typeof document<"u"?u.useLayoutEffect:u.useEffect;let oo=!1,Bi=0;const lo=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Bi++;function Hi(){const[e,t]=y.useState(()=>oo?lo():void 0);return Wn(()=>{e==null&&t(lo())},[]),y.useEffect(()=>{oo=!0},[]),e}const Vi=bl.useId,Wi=Vi||Hi;let Et;process.env.NODE_ENV!=="production"&&(Et=new Set);function zi(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Et)!=null&&e.has(o))){var l;(l=Et)==null||l.add(o),console.warn(o)}}function Gi(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Et)!=null&&e.has(o))){var l;(l=Et)==null||l.add(o),console.error(o)}}function Ki(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Ui=y.createContext(null),Yi=y.createContext(null),qi=()=>{var e;return((e=y.useContext(Ui))==null?void 0:e.id)||null},Zi=()=>y.useContext(Yi),Qi="data-floating-ui-focusable";function Xi(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Wi(),l=y.useRef({}),[a]=y.useState(()=>Ki()),s=qi()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!ae(p)&&Gi("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[i,d]=y.useState(r.reference),c=xl((p,h,v)=>{l.current.openEvent=p?h:void 0,a.emit("openchange",{open:p,event:h,reason:v,nested:s}),n==null||n(p,h,v)}),g=y.useMemo(()=>({setPositionReference:d}),[]),m=y.useMemo(()=>({reference:i||r.reference||null,floating:r.floating||null,domReference:r.reference}),[i,r.reference,r.floating]);return y.useMemo(()=>({dataRef:l,open:t,onOpenChange:c,elements:m,events:a,floatingId:o,refs:g}),[t,c,m,a,o,g])}function Ji(e){e===void 0&&(e={});const{nodeId:t}=e,n=Xi({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[l,a]=y.useState(null),[s,i]=y.useState(null),c=(o==null?void 0:o.domReference)||l,g=y.useRef(null),m=Zi();Wn(()=>{c&&(g.current=c)},[c]);const p=Mi({...e,elements:{...o,...s&&{reference:s}}}),h=y.useCallback(w=>{const k=ae(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;i(k),p.refs.setReference(k)},[p.refs]),v=y.useCallback(w=>{(ae(w)||w===null)&&(g.current=w,a(w)),(ae(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!ae(w))&&p.refs.setReference(w)},[p.refs]),b=y.useMemo(()=>({...p.refs,setReference:v,setPositionReference:h,domReference:g}),[p.refs,v,h]),x=y.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),E=y.useMemo(()=>({...p,...r,refs:b,elements:x,nodeId:t}),[p,b,x,t,r]);return Wn(()=>{r.dataRef.current.floatingContext=E;const w=m==null?void 0:m.nodesRef.current.find(k=>k.id===t);w&&(w.context=E)}),y.useMemo(()=>({...p,context:E,refs:b,elements:x}),[p,b,x,E])}const ao="active",so="selected";function Tn(e,t,n){const r=new Map,o=n==="item";let l=e;if(o&&e){const{[ao]:a,[so]:s,...i}=e;l=i}return{...n==="floating"&&{tabIndex:-1,[Qi]:""},...l,...t.map(a=>{const s=a?a[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((a,s)=>(s&&Object.entries(s).forEach(i=>{let[d,c]=i;if(!(o&&[ao,so].includes(d)))if(d.indexOf("on")===0){if(r.has(d)||r.set(d,[]),typeof c=="function"){var g;(g=r.get(d))==null||g.push(c),a[d]=function(){for(var m,p=arguments.length,h=new Array(p),v=0;v<p;v++)h[v]=arguments[v];return(m=r.get(d))==null?void 0:m.map(b=>b(...h)).find(b=>b!==void 0)}}}else a[d]=c}),a),{})}}function eu(e){e===void 0&&(e=[]);const t=e.map(s=>s==null?void 0:s.reference),n=e.map(s=>s==null?void 0:s.floating),r=e.map(s=>s==null?void 0:s.item),o=y.useCallback(s=>Tn(s,e,"reference"),t),l=y.useCallback(s=>Tn(s,e,"floating"),n),a=y.useCallback(s=>Tn(s,e,"item"),r);return y.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:a}),[o,l,a])}function io(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const tu=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:l=0,index:a=0,minItemsVisible:s=4,referenceOverflowThreshold:i=0,scrollRef:d,...c}=ct(e,t),{rects:g,elements:{floating:m}}=t,p=n.current[a],h=(d==null?void 0:d.current)||m,v=m.clientTop||h.clientTop,b=m.clientTop!==0,x=h.clientTop!==0,E=m===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||zi('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const w={...t,...await vl(-p.offsetTop-m.clientTop-g.reference.height/2-p.offsetHeight/2-l).fn(t)},k=await Pn(io(w,h.scrollHeight+v+m.clientTop),c),$=await Pn(w,{...c,elementContext:"reference"}),j=le(0,k.top),R=w.y+j,N=(h.scrollHeight>h.clientHeight?T=>T:wt)(le(0,h.scrollHeight+(b&&E||x?v*2:0)-j-le(0,k.bottom)));if(h.style.maxHeight=N+"px",h.scrollTop=j,o){const T=h.offsetHeight<p.offsetHeight*Qe(s,n.current.length)-1||$.top>=-i||$.bottom>=-i;Vt.flushSync(()=>o(T))}return r&&(r.current=await Pn(io({...w,y:R},h.offsetHeight+v+m.clientTop),c)),{y:R}}});function nu(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:l,scrollRef:a,onChange:s}=t,i=xl(s),d=y.useRef(!1),c=y.useRef(null),g=y.useRef(null);y.useEffect(()=>{if(!o)return;function p(v){if(v.ctrlKey||!h||l.current==null)return;const b=v.deltaY,x=l.current.top>=-.5,E=l.current.bottom>=-.5,w=h.scrollHeight-h.clientHeight,k=b<0?-1:1,$=b<0?"max":"min";h.scrollHeight<=h.clientHeight||(!x&&b>0||!E&&b<0?(v.preventDefault(),Vt.flushSync(()=>{i(j=>j+Math[$](b,w*k))})):/firefox/i.test(Gs())&&(h.scrollTop+=b))}const h=(a==null?void 0:a.current)||r.floating;if(n&&h)return h.addEventListener("wheel",p),requestAnimationFrame(()=>{c.current=h.scrollTop,l.current!=null&&(g.current={...l.current})}),()=>{c.current=null,g.current=null,h.removeEventListener("wheel",p)}},[o,n,r.floating,l,a,i]);const m=y.useMemo(()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const p=(a==null?void 0:a.current)||r.floating;if(!(!l.current||!p||!d.current)){if(c.current!==null){const h=p.scrollTop-c.current;(l.current.bottom<-.5&&h<-1||l.current.top<-.5&&h>1)&&Vt.flushSync(()=>i(v=>v+h))}requestAnimationFrame(()=>{c.current=p.scrollTop})}}}),[r.floating,i,l,a]);return y.useMemo(()=>o?{floating:m}:{},[o,m])}let dt=u.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});dt.displayName="FloatingContext";let fr=u.createContext(null);fr.displayName="PlacementContext";function yl(e){return u.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function wl(){return u.useContext(dt).setReference}function ru(){return u.useContext(dt).getReferenceProps}function El(){let{getFloatingProps:e,slot:t}=u.useContext(dt);return u.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function kl(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=u.useContext(fr),n=u.useMemo(()=>e,[JSON.stringify(e,(o,l)=>{var a;return(a=l==null?void 0:l.outerHTML)!=null?a:l})]);Y(()=>{t==null||t(n??null)},[t,n]);let r=u.useContext(dt);return u.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let uo=4;function $l({children:e,enabled:t=!0}){let[n,r]=u.useState(null),[o,l]=u.useState(0),a=u.useRef(null),[s,i]=u.useState(null);ou(s);let d=t&&n!==null&&s!==null,{to:c="bottom",gap:g=0,offset:m=0,padding:p=0,inner:h}=lu(n,s),[v,b="center"]=c.split(" ");Y(()=>{d&&l(0)},[d]);let{refs:x,floatingStyles:E,context:w}=Ji({open:d,placement:v==="selection"?b==="center"?"bottom":`bottom-${b}`:b==="center"?`${v}`:`${v}-${b}`,strategy:"absolute",transform:!1,middleware:[vl({mainAxis:v==="selection"?0:g,crossAxis:m}),Li({padding:p}),v!=="selection"&&Ii({padding:p}),v==="selection"&&h?tu({...h,padding:p,overflowRef:a,offset:o,minItemsVisible:uo,referenceOverflowThreshold:p,onFallbackChange(T){var B,A;if(!T)return;let P=w.elements.floating;if(!P)return;let V=parseFloat(getComputedStyle(P).scrollPaddingBottom)||0,D=Math.min(uo,P.childElementCount),W=0,S=0;for(let L of(A=(B=w.elements.floating)==null?void 0:B.childNodes)!=null?A:[])if(se(L)){let z=L.offsetTop,ee=z+L.clientHeight+V,de=P.scrollTop,O=de+P.clientHeight;if(z>=de&&ee<=O)D--;else{S=Math.max(0,Math.min(ee,O)-Math.max(z,de)),W=L.clientHeight;break}}D>=1&&l(L=>{let z=W*D-S+V;return L>=z?L:z})}}):null,Ai({padding:p,apply({availableWidth:T,availableHeight:B,elements:A}){Object.assign(A.floating.style,{overflow:"auto",maxWidth:`${T}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${B}px)`})}})].filter(Boolean),whileElementsMounted:Ni}),[k=v,$=b]=w.placement.split("-");v==="selection"&&(k="selection");let j=u.useMemo(()=>({anchor:[k,$].filter(Boolean).join(" ")}),[k,$]),R=nu(w,{overflowRef:a,onChange:l}),{getReferenceProps:I,getFloatingProps:M}=eu([R]),N=C(T=>{i(T),x.setFloating(T)});return y.createElement(fr.Provider,{value:r},y.createElement(dt.Provider,{value:{setFloating:N,setReference:x.setReference,styles:E,getReferenceProps:I,getFloatingProps:M,slot:j}},e))}function ou(e){Y(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function lu(e,t){var n,r,o;let l=On((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),a=On((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),s=On((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:l,offset:a,padding:s}}function On(e,t,n=void 0){let r=Je(),o=C((i,d)=>{if(i==null)return[n,null];if(typeof i=="number")return[i,null];if(typeof i=="string"){if(!d)return[n,null];let c=co(i,d);return[c,g=>{let m=Sl(i);{let p=m.map(h=>window.getComputedStyle(d).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let v=!1;for(let[x,E]of m.entries()){let w=window.getComputedStyle(d).getPropertyValue(E);if(p[x]!==w){p[x]=w,v=!0;break}}if(!v)return;let b=co(i,d);c!==b&&(g(b),c=b)})}return r.dispose}]}return[n,null]}),l=u.useMemo(()=>o(e,t)[0],[e,t]),[a=l,s]=u.useState();return Y(()=>{let[i,d]=o(e,t);if(s(i),!!d)return d(s)},[e,t]),a}function Sl(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...Sl(o)]:[r]}return[]}function co(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}let dn=u.createContext(null);dn.displayName="OpenClosedContext";var q=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(q||{});function Ve(){return u.useContext(dn)}function fn({value:e,children:t}){return u.createElement(dn.Provider,{value:e},t)}function mr({children:e}){return u.createElement(dn.Provider,{value:null},e)}function au(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Me=[];au(()=>{function e(t){if(!pe(t.target)||t.target===document.body||Me[0]===t.target)return;let n=t.target;n=n.closest(Gt),Me.unshift(n??t.target),Me=Me.filter(r=>r!=null&&r.isConnected),Me.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function su(e){throw new Error("Unexpected object: "+e)}var Q=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Q||{});function Dt(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let l=0;l<n.length;++l)if(!t.resolveDisabled(n[l],l,n))return l;return r}case 1:{o===-1&&(o=n.length);for(let l=o-1;l>=0;--l)if(!t.resolveDisabled(n[l],l,n))return l;return r}case 2:{for(let l=o+1;l<n.length;++l)if(!t.resolveDisabled(n[l],l,n))return l;return r}case 3:{for(let l=n.length-1;l>=0;--l)if(!t.resolveDisabled(n[l],l,n))return l;return r}case 4:{for(let l=0;l<n.length;++l)if(t.resolveId(n[l],l,n)===e.id)return l;return r}case 5:return null;default:su(e)}}function mn(e){let t=C(e),n=u.useRef(!1);u.useEffect(()=>(n.current=!1,()=>{n.current=!0,en(()=>{n.current&&t()})}),[t])}let Nl=u.createContext(!1);function iu(){return u.useContext(Nl)}function fo(e){return u.createElement(Nl.Provider,{value:e.force},e.children)}function uu(e){let t=iu(),n=u.useContext(jl),[r,o]=u.useState(()=>{var l;if(!t&&n!==null)return(l=n.current)!=null?l:null;if($e.isServer)return null;let a=e==null?void 0:e.getElementById("headlessui-portal-root");if(a)return a;if(e===null)return null;let s=e.createElement("div");return s.setAttribute("id","headlessui-portal-root"),e.body.appendChild(s)});return u.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),u.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let Cl=u.Fragment,cu=H(function(e,t){let{ownerDocument:n=null,...r}=e,o=u.useRef(null),l=Z(Jn(m=>{o.current=m}),t),a=Ze(o.current),s=n??a,i=uu(s),d=u.useContext(zn),c=Je(),g=K();return mn(()=>{var m;i&&i.childNodes.length<=0&&((m=i.parentElement)==null||m.removeChild(i))}),i?gt.createPortal(u.createElement("div",{"data-headlessui-portal":"",ref:m=>{c.dispose(),d&&m&&c.add(d.register(m))}},g({ourProps:{ref:l},theirProps:r,slot:{},defaultTag:Cl,name:"Portal"})),i):null});function du(e,t){let n=Z(t),{enabled:r=!0,ownerDocument:o,...l}=e,a=K();return r?u.createElement(cu,{...l,ownerDocument:o,ref:n}):a({ourProps:{ref:n},theirProps:l,slot:{},defaultTag:Cl,name:"Portal"})}let fu=u.Fragment,jl=u.createContext(null);function mu(e,t){let{target:n,...r}=e,o={ref:Z(t)},l=K();return u.createElement(jl.Provider,{value:n},l({ourProps:o,theirProps:r,defaultTag:fu,name:"Popover.Group"}))}let zn=u.createContext(null);function Pl(){let e=u.useContext(zn),t=u.useRef([]),n=C(l=>(t.current.push(l),e&&e.register(l),()=>r(l))),r=C(l=>{let a=t.current.indexOf(l);a!==-1&&t.current.splice(a,1),e&&e.unregister(l)}),o=u.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,u.useMemo(()=>function({children:l}){return u.createElement(zn.Provider,{value:o},l)},[o])]}let pu=H(du),Rl=H(mu),pr=Object.assign(pu,{Group:Rl});const Bt={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function Tl(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function hu(e,t,n){let r=ce();if(t.kind==="Tracked"){let o=function(){l!==Tl(e)&&(r.dispose(),n())},{position:l}=t,a=new ResizeObserver(o);a.observe(e),r.add(()=>a.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}function gu(e,t=typeof document<"u"?document.defaultView:null,n){let r=Nt(e,"escape");lr(t,"keydown",o=>{r&&(o.defaultPrevented||o.key===G.Escape&&n(o))})}function vu(){var e;let[t]=u.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=u.useState((e=t==null?void 0:t.matches)!=null?e:!1);return Y(()=>{if(!t)return;function o(l){r(l.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),n}function Ol({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=C(()=>{var o,l;let a=Fe(n),s=[];for(let i of e)i!==null&&(Re(i)?s.push(i):"current"in i&&Re(i.current)&&s.push(i.current));if(t!=null&&t.current)for(let i of t.current)s.push(i);for(let i of(o=a==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?o:[])i!==document.body&&i!==document.head&&Re(i)&&i.id!=="headlessui-portal-root"&&(n&&(i.contains(n)||i.contains((l=n==null?void 0:n.getRootNode())==null?void 0:l.host))||s.some(d=>i.contains(d))||s.push(i));return s});return{resolveContainers:r,contains:C(o=>r().some(l=>l.contains(o)))}}let Fl=u.createContext(null);function qt({children:e,node:t}){let[n,r]=u.useState(null),o=hr(t??n);return u.createElement(Fl.Provider,{value:o},e,o===null&&u.createElement(rt,{features:qe.Hidden,ref:l=>{var a,s;if(l){for(let i of(s=(a=Fe(l))==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?s:[])if(i!==document.body&&i!==document.head&&Re(i)&&i!=null&&i.contains(l)){r(i);break}}}}))}function hr(e=null){var t;return(t=u.useContext(Fl))!=null?t:e}function bu(){let e=typeof document>"u";return"useSyncExternalStore"in y?(t=>t.useSyncExternalStore)(y)(()=>()=>{},()=>!1,()=>!e):!1}function pn(){let e=bu(),[t,n]=y.useState($e.isHandoffComplete);return t&&$e.isHandoffComplete===!1&&n(!1),y.useEffect(()=>{t!==!0&&n(!0)},[t]),y.useEffect(()=>$e.handoff(),[]),e?!1:t}function gr(){let e=u.useRef(!1);return Y(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var ge=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(ge||{});function vr(){let e=u.useRef(0);return ol(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Ml(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)Re(n.current)&&t.add(n.current);return t}let xu="div";var ze=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(ze||{});function yu(e,t){let n=u.useRef(null),r=Z(n,t),{initialFocus:o,initialFocusFallback:l,containers:a,features:s=15,...i}=e;pn()||(s=0);let d=Ze(n.current);$u(s,{ownerDocument:d});let c=Su(s,{ownerDocument:d,container:n,initialFocus:o,initialFocusFallback:l});Nu(s,{ownerDocument:d,container:n,containers:a,previousActiveElement:c});let g=vr(),m=C(E=>{if(!se(n.current))return;let w=n.current;(k=>k())(()=>{J(g.current,{[ge.Forwards]:()=>{he(w,te.First,{skipElements:[E.relatedTarget,l]})},[ge.Backwards]:()=>{he(w,te.Last,{skipElements:[E.relatedTarget,l]})}})})}),p=Nt(!!(s&2),"focus-trap#tab-lock"),h=Je(),v=u.useRef(!1),b={ref:r,onKeyDown(E){E.key=="Tab"&&(v.current=!0,h.requestAnimationFrame(()=>{v.current=!1}))},onBlur(E){if(!(s&4))return;let w=Ml(a);se(n.current)&&w.add(n.current);let k=E.relatedTarget;pe(k)&&k.dataset.headlessuiFocusGuard!=="true"&&(Ll(w,k)||(v.current?he(n.current,J(g.current,{[ge.Forwards]:()=>te.Next,[ge.Backwards]:()=>te.Previous})|te.WrapAround,{relativeTo:E.target}):pe(E.target)&&Se(E.target)))}},x=K();return u.createElement(u.Fragment,null,p&&u.createElement(rt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:qe.Focusable}),x({ourProps:b,theirProps:i,defaultTag:xu,name:"FocusTrap"}),p&&u.createElement(rt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:qe.Focusable}))}let wu=H(yu),Eu=Object.assign(wu,{features:ze});function ku(e=!0){let t=u.useRef(Me.slice());return ir(([n],[r])=>{r===!0&&n===!1&&en(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=Me.slice())},[e,Me,t]),C(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function $u(e,{ownerDocument:t}){let n=!!(e&8),r=ku(n);ir(()=>{n||Ao(t==null?void 0:t.body)&&Se(r())},[n]),mn(()=>{n&&Se(r())})}function Su(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let l=u.useRef(null),a=Nt(!!(e&1),"focus-trap#initial-focus"),s=gr();return ir(()=>{if(e===0)return;if(!a){o!=null&&o.current&&Se(o.current);return}let i=n.current;i&&en(()=>{if(!s.current)return;let d=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===d){l.current=d;return}}else if(i.contains(d)){l.current=d;return}if(r!=null&&r.current)Se(r.current);else{if(e&16){if(he(i,te.First|te.AutoFocus)!==ot.Error)return}else if(he(i,te.First)!==ot.Error)return;if(o!=null&&o.current&&(Se(o.current),(t==null?void 0:t.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}l.current=t==null?void 0:t.activeElement})},[o,a,e]),l}function Nu(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let l=gr(),a=!!(e&4);lr(t==null?void 0:t.defaultView,"focus",s=>{if(!a||!l.current)return;let i=Ml(r);se(n.current)&&i.add(n.current);let d=o.current;if(!d)return;let c=s.target;se(c)?Ll(i,c)?(o.current=c,Se(c)):(s.preventDefault(),s.stopPropagation(),Se(d)):Se(o.current)},!0)}function Ll(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function Il(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!tt((t=e.as)!=null?t:Dl)||u.Children.count(e.children)===1}let hn=u.createContext(null);hn.displayName="TransitionContext";var Cu=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Cu||{});function ju(){let e=u.useContext(hn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Pu(){let e=u.useContext(gn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let gn=u.createContext(null);gn.displayName="NestingContext";function vn(e){return"children"in e?vn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Al(e,t){let n=Te(e),r=u.useRef([]),o=gr(),l=Je(),a=C((p,h=Ie.Hidden)=>{let v=r.current.findIndex(({el:b})=>b===p);v!==-1&&(J(h,{[Ie.Unmount](){r.current.splice(v,1)},[Ie.Hidden](){r.current[v].state="hidden"}}),l.microTask(()=>{var b;!vn(r)&&o.current&&((b=n.current)==null||b.call(n))}))}),s=C(p=>{let h=r.current.find(({el:v})=>v===p);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:p,state:"visible"}),()=>a(p,Ie.Unmount)}),i=u.useRef([]),d=u.useRef(Promise.resolve()),c=u.useRef({enter:[],leave:[]}),g=C((p,h,v)=>{i.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([b])=>b!==p)),t==null||t.chains.current[h].push([p,new Promise(b=>{i.current.push(b)})]),t==null||t.chains.current[h].push([p,new Promise(b=>{Promise.all(c.current[h].map(([x,E])=>E)).then(()=>b())})]),h==="enter"?d.current=d.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(h)):v(h)}),m=C((p,h,v)=>{Promise.all(c.current[h].splice(0).map(([b,x])=>x)).then(()=>{var b;(b=i.current.shift())==null||b()}).then(()=>v(h))});return u.useMemo(()=>({children:r,register:s,unregister:a,onStart:g,onStop:m,wait:d,chains:c}),[s,a,r,g,m,c,d])}let Dl=u.Fragment,_l=ye.RenderStrategy;function Ru(e,t){var n,r;let{transition:o=!0,beforeEnter:l,afterEnter:a,beforeLeave:s,afterLeave:i,enter:d,enterFrom:c,enterTo:g,entered:m,leave:p,leaveFrom:h,leaveTo:v,...b}=e,[x,E]=u.useState(null),w=u.useRef(null),k=Il(e),$=Z(...k?[w,t,E]:t===null?[]:[t]),j=(n=b.unmount)==null||n?Ie.Unmount:Ie.Hidden,{show:R,appear:I,initial:M}=ju(),[N,T]=u.useState(R?"visible":"hidden"),B=Pu(),{register:A,unregister:P}=B;Y(()=>A(w),[A,w]),Y(()=>{if(j===Ie.Hidden&&w.current){if(R&&N!=="visible"){T("visible");return}return J(N,{hidden:()=>P(w),visible:()=>A(w)})}},[N,w,A,P,R,j]);let V=pn();Y(()=>{if(k&&V&&N==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,N,V,k]);let D=M&&!I,W=I&&R&&M,S=u.useRef(!1),L=Al(()=>{S.current||(T("hidden"),P(w))},B),z=C(ue=>{S.current=!0;let fe=ue?"enter":"leave";L.onStart(w,fe,me=>{me==="enter"?l==null||l():me==="leave"&&(s==null||s())})}),ee=C(ue=>{let fe=ue?"enter":"leave";S.current=!1,L.onStop(w,fe,me=>{me==="enter"?a==null||a():me==="leave"&&(i==null||i())}),fe==="leave"&&!vn(L)&&(T("hidden"),P(w))});u.useEffect(()=>{k&&o||(z(R),ee(R))},[R,k,o]);let de=!(!o||!k||!V||D),[,O]=Pt(de,x,R,{start:z,end:ee}),F=We({ref:$,className:((r=Dn(b.className,W&&d,W&&c,O.enter&&d,O.enter&&O.closed&&c,O.enter&&!O.closed&&g,O.leave&&p,O.leave&&!O.closed&&h,O.leave&&O.closed&&v,!O.transition&&R&&m))==null?void 0:r.trim())||void 0,...jt(O)}),_=0;N==="visible"&&(_|=q.Open),N==="hidden"&&(_|=q.Closed),R&&N==="hidden"&&(_|=q.Opening),!R&&N==="visible"&&(_|=q.Closing);let ie=K();return u.createElement(gn.Provider,{value:L},u.createElement(fn,{value:_},ie({ourProps:F,theirProps:b,defaultTag:Dl,features:_l,visible:N==="visible",name:"Transition.Child"})))}function Tu(e,t){let{show:n,appear:r=!1,unmount:o=!0,...l}=e,a=u.useRef(null),s=Il(e),i=Z(...s?[a,t]:t===null?[]:[t]);pn();let d=Ve();if(n===void 0&&d!==null&&(n=(d&q.Open)===q.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,g]=u.useState(n?"visible":"hidden"),m=Al(()=>{n||g("hidden")}),[p,h]=u.useState(!0),v=u.useRef([n]);Y(()=>{p!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),h(!1))},[v,n]);let b=u.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);Y(()=>{n?g("visible"):!vn(m)&&a.current!==null&&g("hidden")},[n,m]);let x={unmount:o},E=C(()=>{var $;p&&h(!1),($=e.beforeEnter)==null||$.call(e)}),w=C(()=>{var $;p&&h(!1),($=e.beforeLeave)==null||$.call(e)}),k=K();return u.createElement(gn.Provider,{value:m},u.createElement(hn.Provider,{value:b},k({ourProps:{...x,as:u.Fragment,children:u.createElement(Bl,{ref:i,...x,...l,beforeEnter:E,beforeLeave:w})},theirProps:{},defaultTag:u.Fragment,features:_l,visible:c==="visible",name:"Transition"})))}function Ou(e,t){let n=u.useContext(hn)!==null,r=Ve()!==null;return u.createElement(u.Fragment,null,!n&&r?u.createElement(Gn,{ref:t,...e}):u.createElement(Bl,{ref:t,...e}))}let Gn=H(Tu),Bl=H(Ru),br=H(Ou),Fu=Object.assign(Gn,{Child:br,Root:Gn});var Mu=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Mu||{}),Lu=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Lu||{});let Iu={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},xr=u.createContext(null);xr.displayName="DialogContext";function bn(e){let t=u.useContext(xr);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,bn),n}return t}function Au(e,t){return J(t.type,Iu,e,t)}let mo=H(function(e,t){let n=u.useId(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:l,initialFocus:a,role:s="dialog",autoFocus:i=!0,__demoMode:d=!1,unmount:c=!1,...g}=e,m=u.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(m.current||(m.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=Ve();o===void 0&&p!==null&&(o=(p&q.Open)===q.Open);let h=u.useRef(null),v=Z(h,t),b=Ze(h.current),x=o?0:1,[E,w]=u.useReducer(Au,{titleId:null,descriptionId:null,panelRef:u.createRef()}),k=C(()=>l(!1)),$=C(O=>w({type:0,id:O})),j=pn()?x===0:!1,[R,I]=Pl(),M={get current(){var O;return(O=E.panelRef.current)!=null?O:h.current}},N=hr(),{resolveContainers:T}=Ol({mainTreeNode:N,portals:R,defaultContainers:[M]}),B=p!==null?(p&q.Closing)===q.Closing:!1;el(d||B?!1:j,{allowed:C(()=>{var O,F;return[(F=(O=h.current)==null?void 0:O.closest("[data-headlessui-portal]"))!=null?F:null]}),disallowed:C(()=>{var O;return[(O=N==null?void 0:N.closest("body > *:not(#headlessui-portal-root)"))!=null?O:null]})});let A=St.get(null);Y(()=>{if(j)return A.actions.push(r),()=>A.actions.pop(r)},[A,r,j]);let P=ne(A,u.useCallback(O=>A.selectors.isTop(O,r),[A,r]));or(P,T,O=>{O.preventDefault(),k()}),gu(P,b==null?void 0:b.defaultView,O=>{O.preventDefault(),O.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),k()}),sr(d||B?!1:j,b,T),rr(j,h,k);let[V,D]=Go(),W=u.useMemo(()=>[{dialogState:x,close:k,setTitleId:$,unmount:c},E],[x,k,$,c,E]),S=re({open:x===0}),L={ref:v,id:r,role:s,tabIndex:-1,"aria-modal":d?void 0:x===0?!0:void 0,"aria-labelledby":E.titleId,"aria-describedby":V,unmount:c},z=!vu(),ee=ze.None;j&&!d&&(ee|=ze.RestoreFocus,ee|=ze.TabLock,i&&(ee|=ze.AutoFocus),z&&(ee|=ze.InitialFocus));let de=K();return u.createElement(mr,null,u.createElement(fo,{force:!0},u.createElement(pr,null,u.createElement(xr.Provider,{value:W},u.createElement(Rl,{target:h},u.createElement(fo,{force:!1},u.createElement(D,{slot:S},u.createElement(I,null,u.createElement(Eu,{initialFocus:a,initialFocusFallback:h,containers:T,features:ee},u.createElement(nn,{value:k},de({ourProps:L,theirProps:g,slot:S,defaultTag:Du,features:_u,visible:x===0,name:"Dialog"})))))))))))}),Du="div",_u=ye.RenderStrategy|ye.Static;function Bu(e,t){let{transition:n=!1,open:r,...o}=e,l=Ve(),a=e.hasOwnProperty("open")||l!==null,s=e.hasOwnProperty("onClose");if(!a&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!l&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!o.static?u.createElement(qt,null,u.createElement(Fu,{show:r,transition:n,unmount:o.unmount},u.createElement(mo,{ref:t,...o}))):u.createElement(qt,null,u.createElement(mo,{ref:t,open:r,...o}))}let Hu="div";function Vu(e,t){let n=u.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...l}=e,[{dialogState:a,unmount:s},i]=bn("Dialog.Panel"),d=Z(t,i.panelRef),c=re({open:a===0}),g=C(b=>{b.stopPropagation()}),m={ref:d,id:r,onClick:g},p=o?br:u.Fragment,h=o?{unmount:s}:{},v=K();return u.createElement(p,{...h},v({ourProps:m,theirProps:l,slot:c,defaultTag:Hu,name:"Dialog.Panel"}))}let Wu="div";function zu(e,t){let{transition:n=!1,...r}=e,[{dialogState:o,unmount:l}]=bn("Dialog.Backdrop"),a=re({open:o===0}),s={ref:t,"aria-hidden":!0},i=n?br:u.Fragment,d=n?{unmount:l}:{},c=K();return u.createElement(i,{...d},c({ourProps:s,theirProps:r,slot:a,defaultTag:Wu,name:"Dialog.Backdrop"}))}let Gu="h2";function Ku(e,t){let n=u.useId(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:l,setTitleId:a}]=bn("Dialog.Title"),s=Z(t);u.useEffect(()=>(a(r),()=>a(null)),[r,a]);let i=re({open:l===0}),d={ref:s,id:r};return K()({ourProps:d,theirProps:o,slot:i,defaultTag:Gu,name:"Dialog.Title"})}let Uu=H(Bu),Zt=H(Vu);H(zu);let Yu=H(Ku),Kn=Object.assign(Uu,{Panel:Zt,Title:Yu,Description:Ka});var po;let qu=(po=u.startTransition)!=null?po:function(e){e()};var Zu=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Zu||{}),Qu=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))(Qu||{});let Xu={0:e=>({...e,disclosureState:J(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}},4(e,t){return e.buttonElement===t.element?e:{...e,buttonElement:t.element}},5(e,t){return e.panelElement===t.element?e:{...e,panelElement:t.element}}},yr=u.createContext(null);yr.displayName="DisclosureContext";function wr(e){let t=u.useContext(yr);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,wr),n}return t}let Er=u.createContext(null);Er.displayName="DisclosureAPIContext";function Hl(e){let t=u.useContext(Er);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Hl),n}return t}let kr=u.createContext(null);kr.displayName="DisclosurePanelContext";function Ju(){return u.useContext(kr)}function ec(e,t){return J(t.type,Xu,e,t)}let tc=u.Fragment;function nc(e,t){let{defaultOpen:n=!1,...r}=e,o=u.useRef(null),l=Z(t,Jn(v=>{o.current=v},e.as===void 0||tt(e.as))),a=u.useReducer(ec,{disclosureState:n?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:s,buttonId:i},d]=a,c=C(v=>{d({type:1});let b=Fe(o.current);if(!b||!i)return;let x=v?pe(v)?v:"current"in v&&pe(v.current)?v.current:b.getElementById(i):b.getElementById(i);x==null||x.focus()}),g=u.useMemo(()=>({close:c}),[c]),m=re({open:s===0,close:c}),p={ref:l},h=K();return u.createElement(yr.Provider,{value:a},u.createElement(Er.Provider,{value:g},u.createElement(nn,{value:c},u.createElement(fn,{value:J(s,{0:q.Open,1:q.Closed})},h({ourProps:p,theirProps:r,slot:m,defaultTag:tc,name:"Disclosure"})))))}let rc="button";function oc(e,t){let n=u.useId(),{id:r=`headlessui-disclosure-button-${n}`,disabled:o=!1,autoFocus:l=!1,...a}=e,[s,i]=wr("Disclosure.Button"),d=Ju(),c=d===null?!1:d===s.panelId,g=u.useRef(null),m=Z(g,t,C(M=>{if(!c)return i({type:4,element:M})}));u.useEffect(()=>{if(!c)return i({type:2,buttonId:r}),()=>{i({type:2,buttonId:null})}},[r,i,c]);let p=C(M=>{var N;if(c){if(s.disclosureState===1)return;switch(M.key){case G.Space:case G.Enter:M.preventDefault(),M.stopPropagation(),i({type:0}),(N=s.buttonElement)==null||N.focus();break}}else switch(M.key){case G.Space:case G.Enter:M.preventDefault(),M.stopPropagation(),i({type:0});break}}),h=C(M=>{switch(M.key){case G.Space:M.preventDefault();break}}),v=C(M=>{var N;xt(M.currentTarget)||o||(c?(i({type:0}),(N=s.buttonElement)==null||N.focus()):i({type:0}))}),{isFocusVisible:b,focusProps:x}=Qn({autoFocus:l}),{isHovered:E,hoverProps:w}=Zn({isDisabled:o}),{pressed:k,pressProps:$}=Xn({disabled:o}),j=re({open:s.disclosureState===0,hover:E,active:k,disabled:o,focus:b,autofocus:l}),R=ar(e,s.buttonElement),I=Ye(c?{ref:m,type:R,disabled:o||void 0,autoFocus:l,onKeyDown:p,onClick:v}:{ref:m,id:r,type:R,"aria-expanded":s.disclosureState===0,"aria-controls":s.panelElement?s.panelId:void 0,disabled:o||void 0,autoFocus:l,onKeyDown:p,onKeyUp:h,onClick:v},x,w,$);return K()({ourProps:I,theirProps:a,slot:j,defaultTag:rc,name:"Disclosure.Button"})}let lc="div",ac=ye.RenderStrategy|ye.Static;function sc(e,t){let n=u.useId(),{id:r=`headlessui-disclosure-panel-${n}`,transition:o=!1,...l}=e,[a,s]=wr("Disclosure.Panel"),{close:i}=Hl("Disclosure.Panel"),[d,c]=u.useState(null),g=Z(t,C(E=>{qu(()=>s({type:5,element:E}))}),c);u.useEffect(()=>(s({type:3,panelId:r}),()=>{s({type:3,panelId:null})}),[r,s]);let m=Ve(),[p,h]=Pt(o,d,m!==null?(m&q.Open)===q.Open:a.disclosureState===0),v=re({open:a.disclosureState===0,close:i}),b={ref:g,id:r,...jt(h)},x=K();return u.createElement(mr,null,u.createElement(kr.Provider,{value:a.panelId},x({ourProps:b,theirProps:l,slot:v,defaultTag:lc,features:ac,visible:p,name:"Disclosure.Panel"})))}let ic=H(nc),we=H(oc),$r=H(sc),Vl=Object.assign(ic,{Button:we,Panel:$r}),ho=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function go(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!se(o))return r;let l=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),l=!0;let a=l?(n=o.innerText)!=null?n:"":r;return ho.test(a)&&(a=a.replace(ho,"")),a}function uc(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let l=document.getElementById(o);if(l){let a=l.getAttribute("aria-label");return typeof a=="string"?a.trim():go(l).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return go(e).trim()}function cc(e){let t=u.useRef(""),n=u.useRef("");return C(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let l=uc(r).trim().toLowerCase();return t.current=o,n.current=l,l})}var dc=Object.defineProperty,fc=(e,t,n)=>t in e?dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vo=(e,t,n)=>(fc(e,typeof t!="symbol"?t+"":t,n),n),oe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(oe||{}),Qt=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Qt||{}),U=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItems=5]="RegisterItems",e[e.UnregisterItems=6]="UnregisterItems",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetItemsElement=8]="SetItemsElement",e[e.SortItems=9]="SortItems",e[e.MarkButtonAsMoved=10]="MarkButtonAsMoved",e))(U||{});function bo(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=nl(t(e.items.slice()),l=>l.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{items:r,activeItemIndex:o}}let mc={1(e){if(e.menuState===1)return e;let t=e.buttonElement?Bt.Tracked(Tl(e.buttonElement)):e.buttonPositionState;return{...e,activeItemIndex:null,pendingFocus:{focus:Q.Nothing},menuState:1,buttonPositionState:t}},0(e,t){return e.menuState===0?e:{...e,__demoMode:!1,pendingFocus:t.focus,menuState:0,buttonPositionState:Bt.Idle}},2:(e,t)=>{var n,r,o,l,a;if(e.menuState===1)return e;let s={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===Q.Nothing)return{...s,activeItemIndex:null};if(t.focus===Q.Specific)return{...s,activeItemIndex:e.items.findIndex(c=>c.id===t.id)};if(t.focus===Q.Previous){let c=e.activeItemIndex;if(c!==null){let g=e.items[c].dataRef.current.domRef,m=Dt(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(m!==null){let p=e.items[m].dataRef.current.domRef;if(((r=g.current)==null?void 0:r.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...s,activeItemIndex:m}}}}else if(t.focus===Q.Next){let c=e.activeItemIndex;if(c!==null){let g=e.items[c].dataRef.current.domRef,m=Dt(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(m!==null){let p=e.items[m].dataRef.current.domRef;if(((l=g.current)==null?void 0:l.nextElementSibling)===p.current||((a=p.current)==null?void 0:a.nextElementSibling)===null)return{...s,activeItemIndex:m}}}}let i=bo(e),d=Dt(t,{resolveItems:()=>i.items,resolveActiveIndex:()=>i.activeItemIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...s,...i,activeItemIndex:d}},3:(e,t)=>{let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(a=>{var s;return((s=a.dataRef.current.textValue)==null?void 0:s.startsWith(r))&&!a.dataRef.current.disabled}),l=o?e.items.indexOf(o):-1;return l===-1||l===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:l,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let n=e.items.concat(t.items.map(o=>o)),r=e.activeItemIndex;return e.pendingFocus.focus!==Q.Nothing&&(r=Dt(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeItemIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),{...e,items:n,activeItemIndex:r,pendingFocus:{focus:Q.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.items,r=[],o=new Set(t.items);for(let[l,a]of n.entries())if(o.has(a.id)&&(r.push(l),o.delete(a.id),o.size===0))break;if(r.length>0){n=n.slice();for(let l of r.reverse())n.splice(l,1)}return{...e,items:n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.itemsElement===t.element?e:{...e,itemsElement:t.element},9:e=>e.pendingShouldSort?{...e,...bo(e),pendingShouldSort:!1}:e,10(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Bt.Moved}}},pc=class Wl extends nr{constructor(t){super(t),vo(this,"actions",{registerItem:Ir(()=>{let n=[],r=new Set;return[(o,l)=>{r.has(l)||(r.add(l),n.push({id:o,dataRef:l}))},()=>(r.clear(),this.send({type:5,items:n.splice(0)}))]}),unregisterItem:Ir(()=>{let n=[];return[r=>n.push(r),()=>this.send({type:6,items:n.splice(0)})]})}),vo(this,"selectors",{activeDescendantId(n){var r;let o=n.activeItemIndex,l=n.items;return o===null||(r=l[o])==null?void 0:r.id},isActive(n,r){var o;let l=n.activeItemIndex,a=n.items;return l!==null?((o=a[l])==null?void 0:o.id)===r:!1},shouldScrollIntoView(n,r){return n.__demoMode||n.menuState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,r=St.get(null);this.disposables.add(r.on(Xo.Push,o=>{!r.selectors.isTop(o,n)&&this.state.menuState===0&&this.send({type:1})})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(hu(r.buttonElement,r.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:t,__demoMode:n=!1}){return new Wl({id:t,__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:Q.Nothing},buttonPositionState:Bt.Idle})}reduce(t,n){return J(n.type,mc,t,n)}};const zl=u.createContext(null);function Sr(e){let t=u.useContext(zl);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Gl),n}return t}function Gl({id:e,__demoMode:t=!1}){let n=u.useMemo(()=>pc.new({id:e,__demoMode:t}),[]);return mn(()=>n.dispose()),n}let hc=u.Fragment;function gc(e,t){let n=u.useId(),{__demoMode:r=!1,...o}=e,l=Gl({id:n,__demoMode:r}),[a,s,i]=ne(l,b=>[b.menuState,b.itemsElement,b.buttonElement]),d=Z(t),c=St.get(null),g=ne(c,u.useCallback(b=>c.selectors.isTop(b,n),[c,n]));or(g,[i,s],(b,x)=>{var E;l.send({type:U.CloseMenu}),on(x,rn.Loose)||(b.preventDefault(),(E=l.state.buttonElement)==null||E.focus())});let m=C(()=>{l.send({type:U.CloseMenu})}),p=re({open:a===oe.Open,close:m}),h={ref:d},v=K();return u.createElement($l,null,u.createElement(zl.Provider,{value:l},u.createElement(fn,{value:J(a,{[oe.Open]:q.Open,[oe.Closed]:q.Closed})},v({ourProps:h,theirProps:o,slot:p,defaultTag:hc,name:"Menu"}))))}let vc="button";function bc(e,t){let n=Sr("Menu.Button"),r=u.useId(),{id:o=`headlessui-menu-button-${r}`,disabled:l=!1,autoFocus:a=!1,...s}=e,i=u.useRef(null),d=ru(),c=Z(t,i,wl(),C(N=>n.send({type:U.SetButtonElement,element:N}))),g=C(N=>{switch(N.key){case G.Space:case G.Enter:case G.ArrowDown:N.preventDefault(),N.stopPropagation(),n.send({type:U.OpenMenu,focus:{focus:Q.First}});break;case G.ArrowUp:N.preventDefault(),N.stopPropagation(),n.send({type:U.OpenMenu,focus:{focus:Q.Last}});break}}),m=C(N=>{switch(N.key){case G.Space:N.preventDefault();break}}),[p,h,v]=ne(n,N=>[N.menuState,N.buttonElement,N.itemsElement]),b=p===oe.Open;ws(b,{trigger:h,action:u.useCallback(N=>{if(h!=null&&h.contains(N.target))return It.Ignore;let T=N.target.closest('[role="menuitem"]:not([data-disabled])');return se(T)?It.Select(T):v!=null&&v.contains(N.target)?It.Ignore:It.Close},[h,v]),close:u.useCallback(()=>n.send({type:U.CloseMenu}),[]),select:u.useCallback(N=>N.click(),[])});let x=Xa(N=>{var T;l||(p===oe.Open?(gt.flushSync(()=>n.send({type:U.CloseMenu})),(T=i.current)==null||T.focus({preventScroll:!0})):(N.preventDefault(),n.send({type:U.OpenMenu,focus:{focus:Q.Nothing},trigger:Qt.Pointer})))}),{isFocusVisible:E,focusProps:w}=Qn({autoFocus:a}),{isHovered:k,hoverProps:$}=Zn({isDisabled:l}),{pressed:j,pressProps:R}=Xn({disabled:l}),I=re({open:p===oe.Open,active:j||p===oe.Open,disabled:l,hover:k,focus:E,autofocus:a}),M=Ye(d(),{ref:c,id:o,type:ar(e,i.current),"aria-haspopup":"menu","aria-controls":v==null?void 0:v.id,"aria-expanded":p===oe.Open,disabled:l||void 0,autoFocus:a,onKeyDown:g,onKeyUp:m},x,w,$,R);return K()({ourProps:M,theirProps:s,slot:I,defaultTag:vc,name:"Menu.Button"})}let xc="div",yc=ye.RenderStrategy|ye.Static;function wc(e,t){let n=u.useId(),{id:r=`headlessui-menu-items-${n}`,anchor:o,portal:l=!1,modal:a=!0,transition:s=!1,...i}=e,d=yl(o),c=Sr("Menu.Items"),[g,m]=kl(d),p=El(),[h,v]=u.useState(null),b=Z(t,d?g:null,C(S=>c.send({type:U.SetItemsElement,element:S})),v),[x,E]=ne(c,S=>[S.menuState,S.buttonElement]),w=Ze(E),k=Ze(h);d&&(l=!0);let $=Ve(),[j,R]=Pt(s,h,$!==null?($&q.Open)===q.Open:x===oe.Open);rr(j,E,()=>{c.send({type:U.CloseMenu})});let I=ne(c,S=>S.__demoMode),M=I?!1:a&&x===oe.Open;sr(M,k);let N=I?!1:a&&x===oe.Open;el(N,{allowed:u.useCallback(()=>[E,h],[E,h])});let T=ne(c,c.selectors.didButtonMove)?!1:j;u.useEffect(()=>{let S=h;S&&x===oe.Open&&(Ao(S)||S.focus({preventScroll:!0}))},[x,h]),Ls(x===oe.Open,{container:h,accept(S){return S.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:S.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(S){S.setAttribute("role","none")}});let B=Je(),A=C(S=>{var L,z,ee;switch(B.dispose(),S.key){case G.Space:if(c.state.searchQuery!=="")return S.preventDefault(),S.stopPropagation(),c.send({type:U.Search,value:S.key});case G.Enter:if(S.preventDefault(),S.stopPropagation(),c.state.activeItemIndex!==null){let{dataRef:de}=c.state.items[c.state.activeItemIndex];(z=(L=de.current)==null?void 0:L.domRef.current)==null||z.click()}c.send({type:U.CloseMenu}),tl(c.state.buttonElement);break;case G.ArrowDown:return S.preventDefault(),S.stopPropagation(),c.send({type:U.GoToItem,focus:Q.Next});case G.ArrowUp:return S.preventDefault(),S.stopPropagation(),c.send({type:U.GoToItem,focus:Q.Previous});case G.Home:case G.PageUp:return S.preventDefault(),S.stopPropagation(),c.send({type:U.GoToItem,focus:Q.First});case G.End:case G.PageDown:return S.preventDefault(),S.stopPropagation(),c.send({type:U.GoToItem,focus:Q.Last});case G.Escape:S.preventDefault(),S.stopPropagation(),gt.flushSync(()=>c.send({type:U.CloseMenu})),(ee=c.state.buttonElement)==null||ee.focus({preventScroll:!0});break;case G.Tab:S.preventDefault(),S.stopPropagation(),gt.flushSync(()=>c.send({type:U.CloseMenu})),gs(c.state.buttonElement,S.shiftKey?te.Previous:te.Next);break;default:S.key.length===1&&(c.send({type:U.Search,value:S.key}),B.setTimeout(()=>c.send({type:U.ClearSearch}),350));break}}),P=C(S=>{switch(S.key){case G.Space:S.preventDefault();break}}),V=re({open:x===oe.Open}),D=Ye(d?p():{},{"aria-activedescendant":ne(c,c.selectors.activeDescendantId),"aria-labelledby":ne(c,S=>{var L;return(L=S.buttonElement)==null?void 0:L.id}),id:r,onKeyDown:A,onKeyUp:P,role:"menu",tabIndex:x===oe.Open?0:void 0,ref:b,style:{...i.style,...m,"--button-width":Uo(j,E,!0).width},...jt(R)}),W=K();return u.createElement(pr,{enabled:l?e.static||j:!1,ownerDocument:w},W({ourProps:D,theirProps:i,slot:V,defaultTag:xc,features:yc,visible:T,name:"Menu.Items"}))}let Ec=u.Fragment;function kc(e,t){let n=u.useId(),{id:r=`headlessui-menu-item-${n}`,disabled:o=!1,...l}=e,a=Sr("Menu.Item"),s=ne(a,T=>a.selectors.isActive(T,r)),i=u.useRef(null),d=Z(t,i),c=ne(a,T=>a.selectors.shouldScrollIntoView(T,r));Y(()=>{if(c)return ce().requestAnimationFrame(()=>{var T,B;(B=(T=i.current)==null?void 0:T.scrollIntoView)==null||B.call(T,{block:"nearest"})})},[c,i]);let g=cc(i),m=u.useRef({disabled:o,domRef:i,get textValue(){return g()}});Y(()=>{m.current.disabled=o},[m,o]),Y(()=>(a.actions.registerItem(r,m),()=>a.actions.unregisterItem(r)),[m,r]);let p=C(()=>{a.send({type:U.CloseMenu})}),h=C(T=>{if(o)return T.preventDefault();a.send({type:U.CloseMenu}),tl(a.state.buttonElement)}),v=C(()=>{if(o)return a.send({type:U.GoToItem,focus:Q.Nothing});a.send({type:U.GoToItem,focus:Q.Specific,id:r})}),b=js(),x=C(T=>b.update(T)),E=C(T=>{b.wasMoved(T)&&(o||s||a.send({type:U.GoToItem,focus:Q.Specific,id:r,trigger:Qt.Pointer}))}),w=C(T=>{b.wasMoved(T)&&(o||s&&a.state.activationTrigger===Qt.Pointer&&a.send({type:U.GoToItem,focus:Q.Nothing}))}),[k,$]=Ko(),[j,R]=Go(),I=re({active:s,focus:s,disabled:o,close:p}),M={id:r,ref:d,role:"menuitem",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-labelledby":k,"aria-describedby":j,disabled:void 0,onClick:h,onFocus:v,onPointerEnter:x,onMouseEnter:x,onPointerMove:E,onMouseMove:E,onPointerLeave:w,onMouseLeave:w},N=K();return u.createElement($,null,u.createElement(R,null,N({ourProps:M,theirProps:l,slot:I,defaultTag:Ec,name:"Menu.Item"})))}let $c="div";function Sc(e,t){let[n,r]=Ko(),o=e,l={ref:t,"aria-labelledby":n,role:"group"},a=K();return u.createElement(r,null,a({ourProps:l,theirProps:o,slot:{},defaultTag:$c,name:"Menu.Section"}))}let Nc="header";function Cc(e,t){let n=u.useId(),{id:r=`headlessui-menu-heading-${n}`,...o}=e,l=tr();Y(()=>l.register(r),[r,l.register]);let a={id:r,ref:t,role:"presentation",...l.props};return K()({ourProps:a,theirProps:o,slot:{},defaultTag:Nc,name:"Menu.Heading"})}let jc="div";function Pc(e,t){let n=e,r={ref:t,role:"separator"};return K()({ourProps:r,theirProps:n,slot:{},defaultTag:jc,name:"Menu.Separator"})}let Rc=H(gc),Kl=H(bc),Ul=H(wc),Ht=H(kc),Tc=H(Sc),Oc=H(Cc),Fc=H(Pc),Mc=Object.assign(Rc,{Button:Kl,Items:Ul,Item:Ht,Section:Tc,Heading:Oc,Separator:Fc});var Lc=Object.defineProperty,Ic=(e,t,n)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xo=(e,t,n)=>(Ic(e,typeof t!="symbol"?t+"":t,n),n),X=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(X||{}),Ac=(e=>(e[e.OpenPopover=0]="OpenPopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(Ac||{});let Dc={0:e=>e.popoverState===0?e:{...e,popoverState:0,__demoMode:!1},1(e){return e.popoverState===1?e:{...e,popoverState:1,__demoMode:!1}},2(e,t){return e.button===t.button?e:{...e,button:t.button}},3(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},4(e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},5(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}};class Nr extends nr{constructor(t){super(t),xo(this,"actions",{close:()=>this.send({type:1}),refocusableClose:n=>{this.actions.close();let r=n?se(n)?n:"current"in n&&se(n.current)?n.current:this.state.button:this.state.button;r==null||r.focus()},open:()=>this.send({type:0}),setButtonId:n=>this.send({type:3,buttonId:n}),setButton:n=>this.send({type:2,button:n}),setPanelId:n=>this.send({type:5,panelId:n}),setPanel:n=>this.send({type:4,panel:n})}),xo(this,"selectors",{isPortalled:n=>{var r;if(!n.button||!n.panel)return!1;let o=(r=Fe(n.button))!=null?r:document;for(let g of o.querySelectorAll("body > *"))if(Number(g==null?void 0:g.contains(n.button))^Number(g==null?void 0:g.contains(n.panel)))return!0;let l=Ct(o),a=l.indexOf(n.button),s=(a+l.length-1)%l.length,i=(a+1)%l.length,d=l[s],c=l[i];return!n.panel.contains(d)&&!n.panel.contains(c)}});{let n=this.state.id,r=St.get(null);this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}}static new({id:t,__demoMode:n=!1}){return new Nr({id:t,__demoMode:n,popoverState:n?0:1,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(t,n){return J(n.type,Dc,t,n)}}const Yl=u.createContext(null);function xn(e){let t=u.useContext(Yl);if(t===null){let n=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,xn),n}return t}function _c({id:e,__demoMode:t=!1}){let n=u.useMemo(()=>Nr.new({id:e,__demoMode:t}),[]);return mn(()=>n.dispose()),n}let Cr=u.createContext(null);Cr.displayName="PopoverGroupContext";function ql(){return u.useContext(Cr)}let yn=u.createContext(null);yn.displayName="PopoverPanelContext";function Bc(){return u.useContext(yn)}let Hc="div";function Vc(e,t){var n;let r=u.useId(),{__demoMode:o=!1,...l}=e,a=_c({id:r,__demoMode:o}),s=u.useRef(null),i=Z(t,Jn(P=>{s.current=P})),[d,c,g,m,p]=ne(a,u.useCallback(P=>[P.popoverState,P.button,P.panel,P.buttonId,P.panelId],[])),h=bs((n=s.current)!=null?n:c),v=Te(m),b=Te(p),x=u.useMemo(()=>({buttonId:v,panelId:b,close:a.actions.close}),[v,b,a]),E=ql(),w=E==null?void 0:E.registerPopover,k=C(()=>{var P,V;let D=De((P=s.current)!=null?P:c);return(V=E==null?void 0:E.isFocusWithinPopoverGroup())!=null?V:D&&((c==null?void 0:c.contains(D))||(g==null?void 0:g.contains(D)))});u.useEffect(()=>w==null?void 0:w(x),[w,x]);let[$,j]=Pl(),R=hr(c),I=Ol({mainTreeNode:R,portals:$,defaultContainers:[{get current(){return a.state.button}},{get current(){return a.state.panel}}]});lr(h,"focus",P=>{var V,D,W,S,L,z;P.target!==window&&pe(P.target)&&a.state.popoverState===X.Open&&(k()||a.state.button&&a.state.panel&&(I.contains(P.target)||(D=(V=a.state.beforePanelSentinel.current)==null?void 0:V.contains)!=null&&D.call(V,P.target)||(S=(W=a.state.afterPanelSentinel.current)==null?void 0:W.contains)!=null&&S.call(W,P.target)||(z=(L=a.state.afterButtonSentinel.current)==null?void 0:L.contains)!=null&&z.call(L,P.target)||a.actions.close()))},!0);let M=d===X.Open;or(M,I.resolveContainers,(P,V)=>{a.actions.close(),on(V,rn.Loose)||(P.preventDefault(),c==null||c.focus())});let N=re({open:d===X.Open,close:a.actions.refocusableClose}),T=ne(a,u.useCallback(P=>J(P.popoverState,{[X.Open]:q.Open,[X.Closed]:q.Closed}),[])),B={ref:i},A=K();return u.createElement(qt,{node:R},u.createElement($l,null,u.createElement(yn.Provider,{value:null},u.createElement(Yl.Provider,{value:a},u.createElement(nn,{value:a.actions.refocusableClose},u.createElement(fn,{value:T},u.createElement(j,null,A({ourProps:B,theirProps:l,slot:N,defaultTag:Hc,name:"Popover"}))))))))}let Wc="button";function zc(e,t){let n=u.useId(),{id:r=`headlessui-popover-button-${n}`,disabled:o=!1,autoFocus:l=!1,...a}=e,s=xn("Popover.Button"),[i,d,c,g,m,p,h]=ne(s,u.useCallback(F=>[F.popoverState,s.selectors.isPortalled(F),F.button,F.buttonId,F.panel,F.panelId,F.afterButtonSentinel],[])),v=u.useRef(null),b=`headlessui-focus-sentinel-${u.useId()}`,x=ql(),E=x==null?void 0:x.closeOthers,w=Bc()!==null;u.useEffect(()=>{if(!w)return s.actions.setButtonId(r),()=>s.actions.setButtonId(null)},[w,r,s]);let[k]=u.useState(()=>Symbol()),$=Z(v,t,wl(),C(F=>{if(!w){if(F)s.state.buttons.current.push(k);else{let _=s.state.buttons.current.indexOf(k);_!==-1&&s.state.buttons.current.splice(_,1)}s.state.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),F&&s.actions.setButton(F)}})),j=Z(v,t),R=C(F=>{var _,ie,ue;if(w){if(s.state.popoverState===X.Closed)return;switch(F.key){case G.Space:case G.Enter:F.preventDefault(),(ie=(_=F.target).click)==null||ie.call(_),s.actions.close(),(ue=s.state.button)==null||ue.focus();break}}else switch(F.key){case G.Space:case G.Enter:F.preventDefault(),F.stopPropagation(),s.state.popoverState===X.Closed?(E==null||E(s.state.buttonId),s.actions.open()):s.actions.close();break;case G.Escape:if(s.state.popoverState!==X.Open)return E==null?void 0:E(s.state.buttonId);if(!v.current)return;let fe=De(v.current);if(fe&&!v.current.contains(fe))return;F.preventDefault(),F.stopPropagation(),s.actions.close();break}}),I=C(F=>{w||F.key===G.Space&&F.preventDefault()}),M=C(F=>{var _,ie;xt(F.currentTarget)||o||(w?(s.actions.close(),(_=s.state.button)==null||_.focus()):(F.preventDefault(),F.stopPropagation(),s.state.popoverState===X.Closed?(E==null||E(s.state.buttonId),s.actions.open()):s.actions.close(),(ie=s.state.button)==null||ie.focus()))}),N=C(F=>{F.preventDefault(),F.stopPropagation()}),{isFocusVisible:T,focusProps:B}=Qn({autoFocus:l}),{isHovered:A,hoverProps:P}=Zn({isDisabled:o}),{pressed:V,pressProps:D}=Xn({disabled:o}),W=i===X.Open,S=re({open:W,active:V||W,disabled:o,hover:A,focus:T,autofocus:l}),L=ar(e,c),z=Ye(w?{ref:j,type:L,onKeyDown:R,onClick:M,disabled:o||void 0,autoFocus:l}:{ref:$,id:g,type:L,"aria-expanded":i===X.Open,"aria-controls":m?p:void 0,disabled:o||void 0,autoFocus:l,onKeyDown:R,onKeyUp:I,onClick:M,onMouseDown:N},B,P,D),ee=vr(),de=C(()=>{if(!se(s.state.panel))return;let F=s.state.panel;function _(){J(ee.current,{[ge.Forwards]:()=>he(F,te.First),[ge.Backwards]:()=>he(F,te.Last)})===ot.Error&&he(Ct(Ae(s.state.button)).filter(ie=>ie.dataset.headlessuiFocusGuard!=="true"),J(ee.current,{[ge.Forwards]:te.Next,[ge.Backwards]:te.Previous}),{relativeTo:s.state.button})}_()}),O=K();return u.createElement(u.Fragment,null,O({ourProps:z,theirProps:a,slot:S,defaultTag:Wc,name:"Popover.Button"}),W&&!w&&d&&u.createElement(rt,{id:b,ref:h,features:qe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:de}))}let Gc="div",Kc=ye.RenderStrategy|ye.Static;function Zl(e,t){let n=u.useId(),{id:r=`headlessui-popover-backdrop-${n}`,transition:o=!1,...l}=e,a=xn("Popover.Backdrop"),s=ne(a,u.useCallback(x=>x.popoverState,[])),[i,d]=u.useState(null),c=Z(t,d),g=Ve(),[m,p]=Pt(o,i,g!==null?(g&q.Open)===q.Open:s===X.Open),h=C(x=>{if(xt(x.currentTarget))return x.preventDefault();a.actions.close()}),v=re({open:s===X.Open}),b={ref:c,id:r,"aria-hidden":!0,onClick:h,...jt(p)};return K()({ourProps:b,theirProps:l,slot:v,defaultTag:Gc,features:Kc,visible:m,name:"Popover.Backdrop"})}let Uc="div",Yc=ye.RenderStrategy|ye.Static;function qc(e,t){let n=u.useId(),{id:r=`headlessui-popover-panel-${n}`,focus:o=!1,anchor:l,portal:a=!1,modal:s=!1,transition:i=!1,...d}=e,c=xn("Popover.Panel"),g=ne(c,c.selectors.isPortalled),[m,p,h,v,b]=ne(c,u.useCallback(O=>[O.popoverState,O.button,O.__demoMode,O.beforePanelSentinel,O.afterPanelSentinel],[])),x=`headlessui-focus-sentinel-before-${n}`,E=`headlessui-focus-sentinel-after-${n}`,w=u.useRef(null),k=yl(l),[$,j]=kl(k),R=El();k&&(a=!0);let[I,M]=u.useState(null),N=Z(w,t,k?$:null,c.actions.setPanel,M),T=Ze(p),B=Ze(w.current);Y(()=>(c.actions.setPanelId(r),()=>c.actions.setPanelId(null)),[r,c]);let A=Ve(),[P,V]=Pt(i,I,A!==null?(A&q.Open)===q.Open:m===X.Open);rr(P,p,c.actions.close),sr(h?!1:s&&P,B);let D=C(O=>{var F;switch(O.key){case G.Escape:if(c.state.popoverState!==X.Open||!w.current)return;let _=De(w.current);if(_&&!w.current.contains(_))return;O.preventDefault(),O.stopPropagation(),c.actions.close(),(F=c.state.button)==null||F.focus();break}});u.useEffect(()=>{var O;e.static||m===X.Closed&&((O=e.unmount)==null||O)&&c.actions.setPanel(null)},[m,e.unmount,e.static,c]),u.useEffect(()=>{if(h||!o||m!==X.Open||!w.current)return;let O=De(w.current);w.current.contains(O)||he(w.current,te.First)},[h,o,w.current,m]);let W=re({open:m===X.Open,close:c.actions.refocusableClose}),S=Ye(k?R():{},{ref:N,id:r,onKeyDown:D,onBlur:o&&m===X.Open?O=>{var F,_,ie,ue,fe;let me=O.relatedTarget;me&&w.current&&((F=w.current)!=null&&F.contains(me)||(c.actions.close(),((ie=(_=v.current)==null?void 0:_.contains)!=null&&ie.call(_,me)||(fe=(ue=b.current)==null?void 0:ue.contains)!=null&&fe.call(ue,me))&&me.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...d.style,...j,"--button-width":Uo(P,p,!0).width},...jt(V)}),L=vr(),z=C(()=>{let O=w.current;if(!O)return;function F(){J(L.current,{[ge.Forwards]:()=>{var _;he(O,te.First)===ot.Error&&((_=c.state.afterPanelSentinel.current)==null||_.focus())},[ge.Backwards]:()=>{var _;(_=c.state.button)==null||_.focus({preventScroll:!0})}})}F()}),ee=C(()=>{let O=w.current;if(!O)return;function F(){J(L.current,{[ge.Forwards]:()=>{var _;if(!c.state.button)return;let ie=(_=Ae(c.state.button))!=null?_:document.body,ue=Ct(ie),fe=ue.indexOf(c.state.button),me=ue.slice(0,fe+1),Ot=[...ue.slice(fe+1),...me];for(let wn of Ot.slice())if(wn.dataset.headlessuiFocusGuard==="true"||I!=null&&I.contains(wn)){let Rr=Ot.indexOf(wn);Rr!==-1&&Ot.splice(Rr,1)}he(Ot,te.First,{sorted:!1})},[ge.Backwards]:()=>{var _;he(O,te.Previous)===ot.Error&&((_=c.state.button)==null||_.focus())}})}F()}),de=K();return u.createElement(mr,null,u.createElement(yn.Provider,{value:r},u.createElement(nn,{value:c.actions.refocusableClose},u.createElement(pr,{enabled:a?e.static||P:!1,ownerDocument:T},P&&g&&u.createElement(rt,{id:x,ref:v,features:qe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:z}),de({ourProps:S,theirProps:d,slot:W,defaultTag:Uc,features:Yc,visible:P,name:"Popover.Panel"}),P&&g&&u.createElement(rt,{id:E,ref:b,features:qe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ee})))))}let Zc="div";function Qc(e,t){let n=u.useRef(null),r=Z(n,t),[o,l]=u.useState([]),a=C(v=>{l(b=>{let x=b.indexOf(v);if(x!==-1){let E=b.slice();return E.splice(x,1),E}return b})}),s=C(v=>(l(b=>[...b,v]),()=>a(v))),i=C(()=>{var v;let b=Ae(n.current);if(!b)return!1;let x=De(n.current);return(v=n.current)!=null&&v.contains(x)?!0:o.some(E=>{var w,k;return((w=b.getElementById(E.buttonId.current))==null?void 0:w.contains(x))||((k=b.getElementById(E.panelId.current))==null?void 0:k.contains(x))})}),d=C(v=>{for(let b of o)b.buttonId.current!==v&&b.close()}),c=u.useMemo(()=>({registerPopover:s,unregisterPopover:a,isFocusWithinPopoverGroup:i,closeOthers:d}),[s,a,i,d]),g=re({}),m=e,p={ref:r},h=K();return u.createElement(qt,null,u.createElement(Cr.Provider,{value:c},h({ourProps:p,theirProps:m,slot:g,defaultTag:Zc,name:"Popover.Group"})))}let Xc=H(Vc),at=H(zc),Jc=H(Zl),ed=H(Zl),st=H(qc),jr=H(Qc),kt=Object.assign(Xc,{Button:at,Backdrop:ed,Overlay:Jc,Panel:st,Group:jr});function td({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const nd=y.forwardRef(td);function rd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const Pr=y.forwardRef(rd);function od({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"}))}const yo=y.forwardRef(od);function ld({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 14.15v4.25c0 1.094-.787 2.036-1.872 2.18-2.087.277-4.216.42-6.378.42s-4.291-.143-6.378-.42c-1.085-.144-1.872-1.086-1.872-2.18v-4.25m16.5 0a2.18 2.18 0 0 0 .75-1.661V8.706c0-1.081-.768-2.015-1.837-2.175a48.114 48.114 0 0 0-3.413-.387m4.5 8.006c-.194.165-.42.295-.673.38A23.978 23.978 0 0 1 12 15.75c-2.648 0-5.195-.429-7.577-1.22a2.016 2.016 0 0 1-.673-.38m0 0A2.18 2.18 0 0 1 3 12.489V8.706c0-1.081.768-2.015 1.837-2.175a48.111 48.111 0 0 1 3.413-.387m7.5 0V5.25A2.25 2.25 0 0 0 13.5 3h-3a2.25 2.25 0 0 0-2.25 2.25v.894m7.5 0a48.667 48.667 0 0 0-7.5 0M12 12.75h.008v.008H12v-.008Z"}))}const ad=y.forwardRef(ld);function sd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6a7.5 7.5 0 1 0 7.5 7.5h-7.5V6Z"}),y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5H21A7.5 7.5 0 0 0 13.5 3v7.5Z"}))}const id=y.forwardRef(sd);function ud({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-2.25-1.313M21 7.5v2.25m0-2.25-2.25 1.313M3 7.5l2.25-1.313M3 7.5l2.25 1.313M3 7.5v2.25m9 3 2.25-1.313M12 12.75l-2.25-1.313M12 12.75V15m0 6.75 2.25-1.313M12 21.75V19.5m0 2.25-2.25-1.313m0-16.875L12 2.25l2.25 1.313M21 14.25v2.25l-2.25 1.313m-13.5 0L3 16.5v-2.25"}))}const cd=y.forwardRef(ud);function dd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59"}))}const fd=y.forwardRef(dd);function md({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.864 4.243A7.5 7.5 0 0 1 19.5 10.5c0 2.92-.556 5.709-1.568 8.268M5.742 6.364A7.465 7.465 0 0 0 4.5 10.5a7.464 7.464 0 0 1-1.15 3.993m1.989 3.559A11.209 11.209 0 0 0 8.25 10.5a3.75 3.75 0 1 1 7.5 0c0 .527-.021 1.049-.064 1.565M12 10.5a14.94 14.94 0 0 1-3.6 9.75m6.633-4.596a18.666 18.666 0 0 1-2.485 5.33"}))}const pd=y.forwardRef(md);function hd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const wo=y.forwardRef(hd);function gd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}),y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"}))}const vd=y.forwardRef(gd);function bd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7.5h1.5m-1.5 3h1.5m-7.5 3h7.5m-7.5 3h7.5m3-9h3.375c.621 0 1.125.504 1.125 1.125V18a2.25 2.25 0 0 1-2.25 2.25M16.5 7.5V18a2.25 2.25 0 0 0 2.25 2.25M16.5 7.5V4.875c0-.621-.504-1.125-1.125-1.125H4.125C3.504 3.75 3 4.254 3 4.875V18a2.25 2.25 0 0 0 2.25 2.25h13.5M6 7.5h3v3H6v-3Z"}))}const xd=y.forwardRef(bd);function yd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const wd=y.forwardRef(yd);function Ed({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const kd=y.forwardRef(Ed);function $d({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z"}))}const Sd=y.forwardRef($d);function Nd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const Xt=y.forwardRef(Nd);function Cd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const it=y.forwardRef(Cd);function jd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{fillRule:"evenodd",d:"M2 3.5A1.5 1.5 0 0 1 3.5 2h1.148a1.5 1.5 0 0 1 1.465 1.175l.716 3.223a1.5 1.5 0 0 1-1.052 1.767l-.933.267c-.41.117-.643.555-.48.95a11.542 11.542 0 0 0 6.254 6.254c.395.163.833-.07.95-.48l.267-.933a1.5 1.5 0 0 1 1.767-1.052l3.223.716A1.5 1.5 0 0 1 18 15.352V16.5a1.5 1.5 0 0 1-1.5 1.5H15c-1.149 0-2.263-.15-3.326-.43A13.022 13.022 0 0 1 2.43 8.326 13.019 13.019 0 0 1 2 5V3.5Z",clipRule:"evenodd"}))}const Pd=y.forwardRef(jd);function Rd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{fillRule:"evenodd",d:"M2 10a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm6.39-2.908a.75.75 0 0 1 .766.027l3.5 2.25a.75.75 0 0 1 0 1.262l-3.5 2.25A.75.75 0 0 1 8 12.25v-4.5a.75.75 0 0 1 .39-.658Z",clipRule:"evenodd"}))}const Td=y.forwardRef(Rd);function Od({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{d:"M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z"}))}const Fd=y.forwardRef(Od);function Md({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{fillRule:"evenodd",d:"M14.5 10a4.5 4.5 0 0 0 4.284-5.882c-.105-.324-.51-.391-.752-.15L15.34 6.66a.454.454 0 0 1-.493.11 3.01 3.01 0 0 1-1.618-1.616.455.455 0 0 1 .11-.494l2.694-2.692c.24-.241.174-.647-.15-.752a4.5 4.5 0 0 0-5.873 4.575c.055.873-.128 1.808-.8 2.368l-7.23 6.024a2.724 2.724 0 1 0 3.837 3.837l6.024-7.23c.56-.672 1.495-.855 2.368-.8.096.007.193.01.291.01ZM5 16a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",clipRule:"evenodd"}),y.createElement("path",{d:"M14.5 11.5c.173 0 .345-.007.514-.022l3.754 3.754a2.5 2.5 0 0 1-3.536 3.536l-4.41-4.41 2.172-2.607c.052-.063.147-.138.342-.196.202-.06.469-.087.777-.067.128.008.257.012.387.012ZM6 4.586l2.33 2.33a.452.452 0 0 1-.08.09L6.8 8.214 4.586 6H3.309a.5.5 0 0 1-.447-.276l-1.7-3.402a.5.5 0 0 1 .093-.577l.49-.49a.5.5 0 0 1 .577-.094l3.402 1.7A.5.5 0 0 1 6 3.31v1.277Z"}))}const Ld=y.forwardRef(Md),Eo=[{name:"Analytics",description:"Get a better understanding of your traffic",href:"#",icon:id},{name:"Engagement",description:"Speak directly to your customers",href:"#",icon:fd},{name:"Security",description:"Your customers’ data will be safe and secure",href:"#",icon:pd},{name:"Integrations",description:"Connect with third-party tools",href:"#",icon:Sd},{name:"Automations",description:"Build strategic funnels that will convert",href:"#",icon:nd}],Id=[{name:"Watch demo",href:"#",icon:Td},{name:"Contact sales",href:"#",icon:Pd}],ko=[{name:"About us",href:"#",description:"Learn more about our company values and mission to empower others"},{name:"Careers",href:"#",description:"Looking for you next career opportunity? See all of our open positions"},{name:"Support",href:"#",description:"Get in touch with our dedicated support team or reach out on our community forums"},{name:"Blog",href:"#",description:"Read our latest announcements and get perspectives from our team"}];function Ad(){const[e,t]=u.useState(!1);return f.jsxs("header",{className:"bg-white dark:bg-gray-900",children:[f.jsxs("nav",{"aria-label":"Global",className:"mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8",children:[f.jsx("div",{className:"flex lg:flex-1",children:f.jsxs("a",{href:"#",className:"-m-1.5 p-1.5",children:[f.jsx("span",{className:"sr-only",children:"Your Company"}),f.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),f.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]})}),f.jsx("div",{className:"flex lg:hidden",children:f.jsxs("button",{type:"button",onClick:()=>t(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 dark:text-gray-400",children:[f.jsx("span",{className:"sr-only",children:"Open main menu"}),f.jsx(Pr,{"aria-hidden":"true",className:"size-6"})]})}),f.jsxs(jr,{className:"hidden lg:flex lg:gap-x-12",children:[f.jsxs(kt,{className:"relative",children:[f.jsxs(at,{className:"flex items-center gap-x-1 text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Product",f.jsx(it,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"})]}),f.jsxs(st,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-screen max-w-md -translate-x-1/2 overflow-hidden rounded-3xl bg-white shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[f.jsx("div",{className:"p-4",children:Eo.map(n=>f.jsxs("div",{className:"group relative flex items-center gap-x-6 rounded-lg p-4 text-sm/6 hover:bg-gray-50 dark:hover:bg-white/5",children:[f.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-700/50 dark:group-hover:bg-gray-700",children:f.jsx(n.icon,{"aria-hidden":"true",className:"size-6 text-gray-600 group-hover:text-indigo-600 dark:text-gray-400 dark:group-hover:text-white"})}),f.jsxs("div",{className:"flex-auto",children:[f.jsxs("a",{href:n.href,className:"block font-semibold text-gray-900 dark:text-white",children:[n.name,f.jsx("span",{className:"absolute inset-0"})]}),f.jsx("p",{className:"mt-1 text-gray-600 dark:text-gray-400",children:n.description})]})]},n.name))}),f.jsx("div",{className:"grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 dark:divide-white/10 dark:bg-gray-700/50",children:Id.map(n=>f.jsxs("a",{href:n.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700/50",children:[f.jsx(n.icon,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"}),n.name]},n.name))})]})]}),f.jsx("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:"Features"}),f.jsx("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:"Marketplace"}),f.jsxs(kt,{className:"relative",children:[f.jsxs(at,{className:"flex items-center gap-x-1 text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Company",f.jsx(it,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"})]}),f.jsx(st,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-96 -translate-x-1/2 rounded-3xl bg-white p-4 shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:-outline-offset-1 dark:outline-white/10",children:ko.map(n=>f.jsxs("div",{className:"relative rounded-lg p-4 hover:bg-gray-50 dark:hover:bg-white/5",children:[f.jsxs("a",{href:n.href,className:"block text-sm/6 font-semibold text-gray-900 dark:text-white",children:[n.name,f.jsx("span",{className:"absolute inset-0"})]}),f.jsx("p",{className:"mt-1 text-sm/6 text-gray-600 dark:text-gray-400",children:n.description})]},n.name))})]})]}),f.jsx("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:f.jsxs("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Log in ",f.jsx("span",{"aria-hidden":"true",children:"→"})]})})]}),f.jsxs(Kn,{open:e,onClose:t,className:"lg:hidden",children:[f.jsx("div",{className:"fixed inset-0 z-10"}),f.jsxs(Zt,{className:"fixed inset-y-0 right-0 z-10 flex w-full flex-col justify-between overflow-y-auto bg-white sm:max-w-sm sm:ring-1 sm:ring-gray-900/10 dark:bg-gray-900 dark:sm:ring-white/10",children:[f.jsxs("div",{className:"p-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("a",{href:"#",className:"-m-1.5 p-1.5",children:[f.jsx("span",{className:"sr-only",children:"Your Company"}),f.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),f.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]}),f.jsxs("button",{type:"button",onClick:()=>t(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 dark:text-gray-400",children:[f.jsx("span",{className:"sr-only",children:"Close menu"}),f.jsx(Xt,{"aria-hidden":"true",className:"size-6"})]})]}),f.jsx("div",{className:"mt-6 flow-root",children:f.jsxs("div",{className:"-my-6 divide-y divide-gray-500/10 dark:divide-white/10",children:[f.jsx("div",{className:"space-y-2 py-6",children:Eo.map(n=>f.jsxs("a",{href:n.href,className:"group -mx-3 flex items-center gap-x-6 rounded-lg p-3 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:[f.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-800 dark:group-hover:bg-gray-700",children:f.jsx(n.icon,{"aria-hidden":"true",className:"size-6 text-gray-600 group-hover:text-indigo-600 dark:text-gray-300 dark:group-hover:text-white"})}),n.name]},n.name))}),f.jsxs("div",{className:"space-y-2 py-6",children:[f.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Features"}),f.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Marketplace"}),ko.map(n=>f.jsx("a",{href:n.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:n.name},n.name))]}),f.jsx("div",{className:"py-6",children:f.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Log in"})})]})})]}),f.jsx("div",{className:"sticky bottom-0 grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 text-center dark:divide-white/5 dark:bg-gray-800/50",children:item.ctas.map(n=>f.jsx("a",{href:n.href,className:"p-3 text-base/7 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-800",children:n.title},n.title))})]})]})]})}function Dd(){return f.jsxs(Vl,{as:"nav",className:"relative bg-white shadow dark:bg-gray-800/50 dark:shadow-none dark:after:pointer-events-none dark:after:absolute dark:after:inset-x-0 dark:after:bottom-0 dark:after:h-px dark:after:bg-white/10",children:[f.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:f.jsxs("div",{className:"flex h-16 justify-between",children:[f.jsxs("div",{className:"flex",children:[f.jsx("div",{className:"-ml-2 mr-2 flex items-center md:hidden",children:f.jsxs(we,{className:"group relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-600 dark:hover:bg-white/5 dark:hover:text-white dark:focus:ring-white",children:[f.jsx("span",{className:"absolute -inset-0.5"}),f.jsx("span",{className:"sr-only",children:"Open main menu"}),f.jsx(Pr,{"aria-hidden":"true",className:"block size-6 group-data-[open]:hidden"}),f.jsx(Xt,{"aria-hidden":"true",className:"hidden size-6 group-data-[open]:block"})]})}),f.jsxs("div",{className:"flex shrink-0 items-center",children:[f.jsx("img",{alt:"Your Company",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),f.jsx("img",{alt:"Your Company",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]}),f.jsxs("div",{className:"hidden md:ml-6 md:flex md:space-x-8",children:[f.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-indigo-600 px-1 pt-1 text-sm font-medium text-gray-900 dark:border-indigo-500 dark:text-white",children:"Dashboard"}),f.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Team"}),f.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Projects"}),f.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Calendar"})]})]}),f.jsxs("div",{className:"flex items-center",children:[f.jsx("div",{className:"shrink-0",children:f.jsxs("button",{type:"button",className:"relative inline-flex items-center gap-x-1.5 rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:bg-indigo-500 dark:shadow-none dark:hover:bg-indigo-400 dark:focus-visible:outline-indigo-500",children:[f.jsx(Fd,{"aria-hidden":"true",className:"-ml-0.5 size-5"}),"New Job"]})}),f.jsxs("div",{className:"hidden md:ml-4 md:flex md:shrink-0 md:items-center",children:[f.jsxs("button",{type:"button",className:"relative rounded-full p-1 text-gray-400 hover:text-gray-500 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-indigo-600 dark:hover:text-white dark:focus:outline-indigo-500",children:[f.jsx("span",{className:"absolute -inset-1.5"}),f.jsx("span",{className:"sr-only",children:"View notifications"}),f.jsx(yo,{"aria-hidden":"true",className:"size-6"})]}),f.jsxs(Mc,{as:"div",className:"relative ml-3",children:[f.jsxs(Kl,{className:"relative flex rounded-full focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-500",children:[f.jsx("span",{className:"absolute -inset-1.5"}),f.jsx("span",{className:"sr-only",children:"Open user menu"}),f.jsx("img",{alt:"",src:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",className:"size-8 rounded-full bg-gray-100 outline outline-1 -outline-offset-1 outline-black/5 dark:bg-gray-800 dark:outline-white/10"})]}),f.jsxs(Ul,{transition:!0,className:"absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg outline outline-1 outline-black/5 transition data-[closed]:scale-95 data-[closed]:transform data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-75 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[f.jsx(Ht,{children:f.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Your profile"})}),f.jsx(Ht,{children:f.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Settings"})}),f.jsx(Ht,{children:f.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Sign out"})})]})]})]})]})]})}),f.jsxs($r,{className:"md:hidden",children:[f.jsxs("div",{className:"space-y-1 pb-3 pt-2",children:[f.jsx(we,{as:"a",href:"#",className:"block border-l-4 border-indigo-600 bg-indigo-50 py-2 pl-3 pr-4 text-base font-medium text-indigo-700 sm:pl-5 sm:pr-6 dark:border-indigo-500 dark:bg-indigo-600/10 dark:text-indigo-400",children:"Dashboard"}),f.jsx(we,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Team"}),f.jsx(we,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Projects"}),f.jsx(we,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Calendar"})]}),f.jsxs("div",{className:"border-t border-gray-200 pb-3 pt-4 dark:border-white/10",children:[f.jsxs("div",{className:"flex items-center px-4 sm:px-6",children:[f.jsx("div",{className:"shrink-0",children:f.jsx("img",{alt:"",src:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",className:"size-10 rounded-full bg-gray-100 outline outline-1 -outline-offset-1 outline-black/5 dark:bg-gray-800 dark:outline-white/10"})}),f.jsxs("div",{className:"ml-3",children:[f.jsx("div",{className:"text-base font-medium text-gray-800 dark:text-white",children:"Tom Cook"}),f.jsx("div",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"tom@example.com"})]}),f.jsxs("button",{type:"button",className:"relative ml-auto shrink-0 rounded-full p-1 text-gray-400 hover:text-gray-500 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-indigo-600 dark:hover:text-white dark:focus:outline-indigo-500",children:[f.jsx("span",{className:"absolute -inset-1.5"}),f.jsx("span",{className:"sr-only",children:"View notifications"}),f.jsx(yo,{"aria-hidden":"true",className:"size-6"})]})]}),f.jsxs("div",{className:"mt-3 space-y-1",children:[f.jsx(we,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Your profile"}),f.jsx(we,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Settings"}),f.jsx(we,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Sign out"})]})]})]})]})}function _d({item:e,onHover:t}){const n=u.useRef(null);return f.jsx(kt,{children:({open:r})=>f.jsxs("div",{className:"relative",onMouseEnter:()=>{var o;t&&!r&&((o=n.current)==null||o.click())},onMouseLeave:()=>{var o;t&&r&&((o=n.current)==null||o.click())},children:[f.jsxs("div",{className:"flex items-center gap-x-1",children:[e.useLink?f.jsx(Le,{href:e.href,className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:e.title}):f.jsx("span",{className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:e.title}),f.jsx(at,{ref:n,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white","aria-label":`Open ${e.title} menu`,children:f.jsx(it,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),f.jsxs(st,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-screen max-w-md -translate-x-1/2 overflow-hidden rounded-3xl bg-white shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[f.jsx("div",{className:"p-4",children:e.subMenu.map(o=>f.jsxs("div",{className:"group relative flex items-center gap-x-6 rounded-lg p-4 text-sm/6 hover:bg-gray-50 dark:hover:bg-white/5",children:[f.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-700/50 dark:group-hover:bg-gray-700",children:(()=>{const l=o.icon;if(!l)return null;if(u.isValidElement(l))return u.cloneElement(l,{className:"size-6 text-gray-600 group-hover:text-primary","aria-hidden":!0});if(typeof l=="function"){const a=l;return f.jsx(a,{"aria-hidden":!0,className:"size-6 text-gray-600 group-hover:text-primary"})}return null})()}),f.jsxs("div",{className:"flex-auto",children:[f.jsxs("a",{href:o.href,className:"block font-semibold text-gray-900 dark:text-white",children:[o.title,f.jsx("span",{className:"absolute inset-0"})]}),f.jsx("p",{className:"mt-1 text-gray-600 dark:text-gray-400",children:o.description})]})]},o.title))}),f.jsx("div",{className:"grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 dark:divide-white/10 dark:bg-gray-700/50",children:e.ctas&&e.ctas.map(o=>f.jsxs("a",{href:o.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700/50",children:[(()=>{const l=o.icon;if(!l)return null;if(u.isValidElement(l))return u.cloneElement(l,{className:"size-5 flex-none text-gray-400","aria-hidden":!0});if(typeof l=="function"){const a=l;return f.jsx(a,{"aria-hidden":!0,className:"size-5 flex-none text-gray-400"})}return null})(),o.title]},o.title))})]})]})})}function Bd({item:e,onHover:t}){const n=u.useRef(null);return f.jsx(kt,{children:({open:r})=>f.jsxs("div",{onMouseEnter:()=>{var o;t&&!r&&((o=n.current)==null||o.click())},onMouseLeave:()=>{var o;t&&r&&((o=n.current)==null||o.click())},children:[f.jsxs("div",{className:"flex items-center gap-x-1",children:[e.useLink?f.jsx(Le,{href:e.href,className:"text-sm/6 font-semibold text-gray-900",children:e.title}):f.jsx("span",{className:"text-sm/6 font-semibold text-gray-900",children:e.title}),f.jsx(at,{ref:n,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900","aria-label":`Open ${e.title} menu`,children:f.jsx(it,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),f.jsxs(st,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-white pt-14 shadow-lg ring-1 ring-gray-900/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[f.jsx("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8",children:e.subMenu.map(o=>f.jsxs("div",{className:"group relative rounded-lg p-6 text-sm/6 hover:bg-gray-50",children:[o.image?f.jsx("div",{className:"aspect-[4/3] w-full overflow-hidden rounded-md bg-gray-100",children:f.jsx("img",{alt:o.imageAlt||o.title,src:o.image,className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-105"})}):f.jsx("div",{className:"flex size-11 items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white",children:(()=>{const l=o.icon;if(!l)return null;if(u.isValidElement(l))return u.cloneElement(l,{className:"size-6 text-gray-600 group-hover:text-primary","aria-hidden":!0});if(typeof l=="function"){const a=l;return f.jsx(a,{"aria-hidden":!0,className:"size-6 text-gray-600 group-hover:text-primary"})}return null})()}),f.jsxs("a",{href:o.href,className:`${o.image?"mt-4":"mt-6"} block font-semibold text-gray-900`,children:[o.title,f.jsx("span",{className:"absolute inset-0"})]}),f.jsx("p",{className:"mt-1 text-gray-600",children:o.description})]},o.title))}),f.jsx("div",{className:"bg-gray-50",children:e.ctas&&f.jsx("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:f.jsx("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:e.ctas.map(o=>f.jsxs("a",{href:o.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100",children:[(()=>{const l=o.icon;if(!l)return null;if(u.isValidElement(l))return u.cloneElement(l,{className:"size-5 flex-none text-gray-400","aria-hidden":!0});if(typeof l=="function"){const a=l;return f.jsx(a,{"aria-hidden":!0,className:"size-5 flex-none text-gray-400"})}return null})(),o.title]},o.title))})})})]})]})},e.id)}function Hd({title:e,titleId:t,...n},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?y.createElement("title",{id:t},e):null,y.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const $o=y.forwardRef(Hd);function Vd({item:e,onHover:t}){const n=u.useRef(null);return f.jsx(kt,{children:({open:r})=>{var o,l;return f.jsxs("div",{className:"relative",onMouseEnter:()=>{var a;t&&!r&&((a=n.current)==null||a.click())},onMouseLeave:()=>{var a;t&&r&&((a=n.current)==null||a.click())},children:[f.jsxs("div",{className:"flex items-center gap-x-1",children:[e.useLink?f.jsx(Le,{href:e.href,className:"text-sm/6 font-semibold text-gray-900",children:e.title}):f.jsx("span",{className:"text-sm/6 font-semibold text-gray-900",children:e.title}),f.jsx(at,{ref:n,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900","aria-label":`Open ${e.title} menu`,children:f.jsx(it,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),f.jsx(st,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-72 -translate-x-1/2 overflow-hidden rounded-2xl bg-white p-2 shadow-lg ring-1 ring-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:f.jsxs("ul",{className:"space-y-1",children:[(o=e.subMenu)==null?void 0:o.map(a=>f.jsx("li",{className:"group",children:f.jsxs(Le,{href:a.href,className:"flex items-center rounded-md px-3 py-2 text-sm text-gray-400 transition-colors duration-300 group-hover:text-black",children:[(()=>{const s=a.icon;if(!s)return f.jsx($o,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"});if(u.isValidElement(s))return u.cloneElement(s,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary","aria-hidden":!0});if(typeof s=="function"){const i=s;return f.jsx(i,{"aria-hidden":!0,className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"})}return null})(),f.jsx("span",{children:a.title})]})},a.title)),(l=e.ctas)==null?void 0:l.map(a=>f.jsx("li",{className:"group",children:f.jsxs("a",{href:a.href,className:"flex items-center rounded-md px-3 py-2 text-sm text-gray-400 transition-colors duration-300 group-hover:text-black",children:[(()=>{const s=a.icon;if(!s)return f.jsx($o,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"});if(u.isValidElement(s))return u.cloneElement(s,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary","aria-hidden":!0});if(typeof s=="function"){const i=s;return f.jsx(i,{"aria-hidden":!0,className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"})}return null})(),f.jsx("span",{children:a.title})]})},a.title))]})})]})}})}function Wd({config:e,onScrolledChange:t,scrollThreshold:n=10,quickSearchResults:r=[]}){const[o,l]=u.useState(!1),[a,s]=u.useState(!1),[i,d]=u.useState(!1),[c,g]=u.useState("");return u.useEffect(()=>{typeof(e==null?void 0:e.onSearchOpenChange)=="function"&&e.onSearchOpenChange(i),i||(g(""),typeof(e==null?void 0:e.onClearQuickResults)=="function"&&e.onClearQuickResults())},[i]),u.useEffect(()=>{const m=()=>{const p=window.scrollY>n;s(h=>(h!==p&&typeof t=="function"&&t(p),p))};return m(),window.addEventListener("scroll",m,{passive:!0}),()=>window.removeEventListener("scroll",m)},[t,n]),f.jsxs("header",{className:`${e!=null&&e.sticky?"sticky top-0 z-50 bg-white/95 backdrop-blur supports-[backdrop-filter]:bg-white/70":"relative z-10"} isolate bg-white`,children:[f.jsxs("nav",{"aria-label":"Global",className:"mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8",children:[f.jsx("div",{className:"flex lg:flex-1",children:f.jsx(Le,{href:"/","aria-label":e.logoAlt||"Home",children:e.logo?f.jsx("img",{alt:e.logoAlt||"Logo",src:e.logo,className:`w-auto transition-all duration-300 ${a?"h-8 md:h-14":"h-12 md:h-20"}`}):f.jsx("div",{className:`h-auto transition-all duration-300 ${a?"w-28":"w-32"}`,children:f.jsx("h1",{className:`transition-all duration-300 ${a?"text-xl":"text-2xl"}`,children:e.fallbackText||"<NovaNav>"})})})}),f.jsx("div",{className:"flex lg:hidden",children:f.jsxs("button",{type:"button",onClick:()=>l(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700",children:[f.jsx("span",{className:"sr-only",children:"Open main menu"}),f.jsx(Pr,{"aria-hidden":"true",className:"size-6"})]})}),f.jsx(jr,{className:"hidden lg:flex lg:gap-x-12",children:e.menuItems.map(m=>{const p=m.type||(m.full?"full":"default");return m.subMenu?p==="full"?f.jsx(Bd,{item:m,onHover:m.onHover},m.id||m.title):p==="simple"?f.jsx(Vd,{item:m,onHover:m.onHover},m.id||m.title):f.jsx(_d,{item:m,onHover:m.onHover},m.id||m.title):m.useLink?f.jsx(Le,{href:m.href,className:"text-sm/6 font-semibold text-gray-900",children:m.title},m.id):f.jsx("a",{href:m.href,className:"text-sm/6 font-semibold text-gray-900",children:m.title},m.id)})}),f.jsxs("div",{className:"hidden gap-4 lg:flex lg:flex-1 lg:justify-end",children:[e.search&&f.jsx("button",{type:"button",onClick:()=>d(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 hover:bg-gray-100","aria-label":"Open search",children:f.jsx(wo,{"aria-hidden":"true",className:"size-6"})}),e.login&&f.jsxs("a",{href:e.loginHref,className:"text-sm/6 font-semibold text-gray-900",children:["Log in ",f.jsx("span",{"aria-hidden":"true",children:"→"})]}),e.cta&&f.jsx("a",{href:e.ctaBtnHref,className:"rounded-md bg-gray-900 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900",children:e.ctaTitle||"Sign up"})]})]}),f.jsxs(Kn,{open:i,onClose:d,children:[f.jsx("div",{className:"fixed inset-0 z-50 bg-black/30"}),f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:f.jsxs(Zt,{className:"w-full max-w-lg rounded-lg bg-white p-6 shadow-lg ring-1 ring-gray-900/10",children:[f.jsxs("div",{className:"flex items-center justify-between pb-2",children:[f.jsx("h2",{className:"text-base font-semibold text-gray-900",children:"Search"}),f.jsx("button",{type:"button",onClick:()=>d(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 hover:bg-gray-100","aria-label":"Close search",children:f.jsx(Xt,{"aria-hidden":"true",className:"size-5"})})]}),f.jsxs("form",{className:"mt-2",onSubmit:m=>{m.preventDefault(),typeof(e==null?void 0:e.onSearch)=="function"&&e.onSearch(c),d(!1)},children:[f.jsx("label",{htmlFor:"site-search",className:"sr-only",children:"Search"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{id:"site-search",type:"search",placeholder:"Search...",autoFocus:!0,value:c,onChange:m=>{const p=m.target.value;g(p),typeof(e==null?void 0:e.onSearchChange)=="function"&&e.onSearchChange(p)},className:"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 shadow-sm placeholder:text-gray-400 focus:border-gray-900 focus:outline-none focus:ring-2 focus:ring-gray-900"}),f.jsx("button",{type:"submit",className:"rounded-md bg-gray-900 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900",children:"Search"})]})]}),Array.isArray(r)&&r.length>0&&f.jsx("div",{className:"mt-4 divide-y divide-gray-200",children:r.map((m,p)=>{if(!m||typeof m!="object")return null;const h=m.title||m.q||m.name||"Result",v=m.desc||m.description||m.summary||m.a||"",b=typeof(e==null?void 0:e.searchTitleMax)=="number"?e.searchTitleMax:60,x=typeof(e==null?void 0:e.searchDescMax)=="number"?e.searchDescMax:100,E=typeof h=="string"&&h.length>b?`${h.slice(0,b-1)}…`:h,w=typeof v=="string"&&v.length>x?`${v.slice(0,x-1)}…`:v,k=typeof m.link=="string"?m.link:void 0,$=typeof k=="string"&&k.startsWith("/"),j=f.jsxs("div",{className:"flex items-start gap-3 py-3",children:[m!=null&&m.icon?f.jsx("div",{className:"mt-0.5 h-6 w-6 text-gray-500",children:m.icon}):m!=null&&m.image?f.jsx("img",{src:m.image,alt:h,className:"mt-0.5 h-6 w-6 rounded object-cover"}):f.jsx(wo,{"aria-hidden":"true",className:"mt-0.5 size-6 text-gray-400"}),f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-gray-900 truncate",children:E}),w?f.jsx("div",{className:"text-sm text-gray-500 truncate",children:w}):null]})]});return k?$?f.jsx("a",{href:k,className:"block hover:bg-gray-50",onClick:()=>{typeof(e==null?void 0:e.onBeginNavigate)=="function"&&e.onBeginNavigate(),typeof(e==null?void 0:e.onClearQuickResults)=="function"&&e.onClearQuickResults(),d(!1)},children:j},k||p):f.jsx("a",{href:k,className:"block hover:bg-gray-50",onClick:()=>{typeof(e==null?void 0:e.onBeginNavigate)=="function"&&e.onBeginNavigate(),typeof(e==null?void 0:e.onClearQuickResults)=="function"&&e.onClearQuickResults(),d(!1)},children:j},k||p):f.jsx("div",{className:"block hover:bg-gray-50",children:j},p)})})]})})]}),f.jsxs(Kn,{open:o,onClose:l,className:"lg:hidden",children:[f.jsx("div",{className:"fixed inset-0 z-50"}),f.jsxs(Zt,{className:"fixed inset-y-0 right-0 z-50 w-full overflow-y-auto bg-white p-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx(Le,{href:"/",className:"-m-1.5 p-1.5","aria-label":e.logoAlt||"Home",children:e.logo?f.jsx("img",{alt:e.logoAlt||"Logo",src:e.logo,className:"h-8 w-auto"}):f.jsx("span",{className:"text-lg font-semibold",children:e.fallbackText||"NEXGEN Roofing Systems"})}),f.jsxs("button",{type:"button",onClick:()=>l(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700",children:[f.jsx("span",{className:"sr-only",children:"Close menu"}),f.jsx(Xt,{"aria-hidden":"true",className:"size-6"})]})]}),f.jsx("div",{className:"mt-6 flow-root",children:f.jsxs("div",{className:"-my-6 divide-y divide-gray-500/10",children:[f.jsx("div",{className:"space-y-2 py-6",children:e.menuItems.map(m=>m.subMenu?f.jsxs(Vl,{as:"div",className:"-mx-3",children:[f.jsxs(we,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:[m.title,f.jsx(it,{"aria-hidden":"true",className:"size-5 flex-none group-data-[open]:rotate-180"})]}),f.jsx($r,{className:"mt-2 space-y-2",children:[...m.subMenu,...m.ctas||[]].map(p=>f.jsx(we,{as:"a",href:p.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm/7 font-semibold text-gray-900 hover:bg-gray-50",children:p.title},p.title))})]},m.id):m.useLink?f.jsx(Le,{href:m.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:m.title},m.id):f.jsx("a",{href:m.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:m.title},m.id))}),f.jsxs("div",{className:"space-y-2 py-6",children:[e.login&&f.jsxs("a",{href:e.loginHref,className:"-mx-3 block rounded-lg px-3 py-2.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:["Log in ",f.jsx("span",{"aria-hidden":"true",children:"→"})]}),e.cta&&f.jsx("a",{href:e.ctaBtnHref,className:"-mx-3 block rounded-lg bg-gray-900 px-3 py-2.5 text-base/7 font-semibold text-white hover:bg-gray-800",children:e.ctaTitle||"Sign up"})]})]})})]})]})]})}function zd(){return f.jsx(f.Fragment,{children:f.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center",children:f.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[f.jsx(cd,{className:"inset-shadow-sm 8 h-16 w-16 animate-[spin_2s_linear_infinite] rounded-full border-4 border-t-4 border-solid border-white text-5xl font-black text-primary"}),f.jsx("div",{className:"mt-16 flex w-full items-center justify-center py-8",children:f.jsx("p",{className:"text-xl font-thin uppercase tracking-widest text-primary",children:"Loading..."})})]})})})}function Gd({baseConfig:e}){const[t,n]=u.useState([]),[r,o]=u.useState(""),l=u.useRef(null),[a,s]=u.useState(!1),i=async p=>{const h=(p||"").trim();if(!h){n([]);return}try{const v=await fetch(`/api/search?q=${encodeURIComponent(h)}`);if(!v.ok)throw new Error("search failed");const b=await v.json(),x=[...Array.isArray(b==null?void 0:b.services)?b.services:[],...Array.isArray(b==null?void 0:b.faqs)?b.faqs:[],...Array.isArray(b==null?void 0:b.gallery)?b.gallery:[],...Array.isArray(b==null?void 0:b.posts)?b.posts:[],...Array.isArray(b==null?void 0:b.projects)?b.projects:[],...Array.isArray(b==null?void 0:b.locations)?b.locations:[]].filter(k=>k&&typeof k=="object"),E=new Set,w=x.filter(k=>{const $=`${(k.link||"").toLowerCase()}|${(k.title||k.q||"").toLowerCase()}`;return E.has($)?!1:(E.add($),!0)}).map(k=>{if(k!=null&&k.icon)return k;const $="h-6 w-6 text-gray-400";switch(k==null?void 0:k.kind){case"faq":return{...k,icon:f.jsx(kd,{"aria-hidden":"true",className:$})};case"service":return{...k,icon:f.jsx(Ld,{"aria-hidden":"true",className:$})};case"project":return{...k,icon:f.jsx(ad,{"aria-hidden":"true",className:$})};case"post":return{...k,icon:f.jsx(xd,{"aria-hidden":"true",className:$})};case"gallery":return{...k,icon:f.jsx(wd,{"aria-hidden":"true",className:$})};case"location":return{...k,icon:f.jsx(vd,{"aria-hidden":"true",className:$})};default:return k}});n(w)}catch{n([])}},d=p=>{o(p),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>i(p),300)},c=p=>{const h=(p||"").trim();h&&(s(!0),typeof window<"u"&&(window.location.href=`/search?q=${encodeURIComponent(h)}`))},g=p=>{p||(o(""),n([]),l.current&&clearTimeout(l.current))},m=u.useMemo(()=>({...e,search:!0,onSearchChange:d,onSearch:c,onSearchOpenChange:g,onClearQuickResults:()=>n([]),onBeginNavigate:()=>s(!0)}),[e]);return f.jsxs(f.Fragment,{children:[a&&f.jsx("div",{className:"fixed inset-0 z-[60]",children:f.jsx(zd,{})}),f.jsx(Wd,{config:m,quickSearchResults:t})]})}exports.NavController=Gd;exports.SimpleLight=Dd;exports.WithFlyout=Ad;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),n=require("@headlessui/react"),x=require("@heroicons/react/24/outline"),b=require("@heroicons/react/20/solid"),N=require("next/link"),P=require("@heroicons/react/24/solid"),I=[{name:"Analytics",description:"Get a better understanding of your traffic",href:"#",icon:x.ChartPieIcon},{name:"Engagement",description:"Speak directly to your customers",href:"#",icon:x.CursorArrowRaysIcon},{name:"Security",description:"Your customers’ data will be safe and secure",href:"#",icon:x.FingerPrintIcon},{name:"Integrations",description:"Connect with third-party tools",href:"#",icon:x.SquaresPlusIcon},{name:"Automations",description:"Build strategic funnels that will convert",href:"#",icon:x.ArrowPathIcon}],B=[{name:"Watch demo",href:"#",icon:b.PlayCircleIcon},{name:"Contact sales",href:"#",icon:b.PhoneIcon}],D=[{name:"About us",href:"#",description:"Learn more about our company values and mission to empower others"},{name:"Careers",href:"#",description:"Looking for you next career opportunity? See all of our open positions"},{name:"Support",href:"#",description:"Get in touch with our dedicated support team or reach out on our community forums"},{name:"Blog",href:"#",description:"Read our latest announcements and get perspectives from our team"}];function E(){const[a,u]=c.useState(!1);return e.jsxs("header",{className:"bg-white dark:bg-gray-900",children:[e.jsxs("nav",{"aria-label":"Global",className:"mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8",children:[e.jsx("div",{className:"flex lg:flex-1",children:e.jsxs("a",{href:"#",className:"-m-1.5 p-1.5",children:[e.jsx("span",{className:"sr-only",children:"Your Company"}),e.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),e.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]})}),e.jsx("div",{className:"flex lg:hidden",children:e.jsxs("button",{type:"button",onClick:()=>u(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 dark:text-gray-400",children:[e.jsx("span",{className:"sr-only",children:"Open main menu"}),e.jsx(x.Bars3Icon,{"aria-hidden":"true",className:"size-6"})]})}),e.jsxs(n.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:[e.jsxs(n.Popover,{className:"relative",children:[e.jsxs(n.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Product",e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"})]}),e.jsxs(n.PopoverPanel,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-screen max-w-md -translate-x-1/2 overflow-hidden rounded-3xl bg-white shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[e.jsx("div",{className:"p-4",children:I.map(r=>e.jsxs("div",{className:"group relative flex items-center gap-x-6 rounded-lg p-4 text-sm/6 hover:bg-gray-50 dark:hover:bg-white/5",children:[e.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-700/50 dark:group-hover:bg-gray-700",children:e.jsx(r.icon,{"aria-hidden":"true",className:"size-6 text-gray-600 group-hover:text-indigo-600 dark:text-gray-400 dark:group-hover:text-white"})}),e.jsxs("div",{className:"flex-auto",children:[e.jsxs("a",{href:r.href,className:"block font-semibold text-gray-900 dark:text-white",children:[r.name,e.jsx("span",{className:"absolute inset-0"})]}),e.jsx("p",{className:"mt-1 text-gray-600 dark:text-gray-400",children:r.description})]})]},r.name))}),e.jsx("div",{className:"grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 dark:divide-white/10 dark:bg-gray-700/50",children:B.map(r=>e.jsxs("a",{href:r.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700/50",children:[e.jsx(r.icon,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"}),r.name]},r.name))})]})]}),e.jsx("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:"Features"}),e.jsx("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:"Marketplace"}),e.jsxs(n.Popover,{className:"relative",children:[e.jsxs(n.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Company",e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none text-gray-400 dark:text-gray-500"})]}),e.jsx(n.PopoverPanel,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-96 -translate-x-1/2 rounded-3xl bg-white p-4 shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:-outline-offset-1 dark:outline-white/10",children:D.map(r=>e.jsxs("div",{className:"relative rounded-lg p-4 hover:bg-gray-50 dark:hover:bg-white/5",children:[e.jsxs("a",{href:r.href,className:"block text-sm/6 font-semibold text-gray-900 dark:text-white",children:[r.name,e.jsx("span",{className:"absolute inset-0"})]}),e.jsx("p",{className:"mt-1 text-sm/6 text-gray-600 dark:text-gray-400",children:r.description})]},r.name))})]})]}),e.jsx("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:e.jsxs("a",{href:"#",className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:["Log in ",e.jsx("span",{"aria-hidden":"true",children:"→"})]})})]}),e.jsxs(n.Dialog,{open:a,onClose:u,className:"lg:hidden",children:[e.jsx("div",{className:"fixed inset-0 z-10"}),e.jsxs(n.DialogPanel,{className:"fixed inset-y-0 right-0 z-10 flex w-full flex-col justify-between overflow-y-auto bg-white sm:max-w-sm sm:ring-1 sm:ring-gray-900/10 dark:bg-gray-900 dark:sm:ring-white/10",children:[e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("a",{href:"#",className:"-m-1.5 p-1.5",children:[e.jsx("span",{className:"sr-only",children:"Your Company"}),e.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),e.jsx("img",{alt:"",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]}),e.jsxs("button",{type:"button",onClick:()=>u(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 dark:text-gray-400",children:[e.jsx("span",{className:"sr-only",children:"Close menu"}),e.jsx(x.XMarkIcon,{"aria-hidden":"true",className:"size-6"})]})]}),e.jsx("div",{className:"mt-6 flow-root",children:e.jsxs("div",{className:"-my-6 divide-y divide-gray-500/10 dark:divide-white/10",children:[e.jsx("div",{className:"space-y-2 py-6",children:I.map(r=>e.jsxs("a",{href:r.href,className:"group -mx-3 flex items-center gap-x-6 rounded-lg p-3 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:[e.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-800 dark:group-hover:bg-gray-700",children:e.jsx(r.icon,{"aria-hidden":"true",className:"size-6 text-gray-600 group-hover:text-indigo-600 dark:text-gray-300 dark:group-hover:text-white"})}),r.name]},r.name))}),e.jsxs("div",{className:"space-y-2 py-6",children:[e.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Features"}),e.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Marketplace"}),D.map(r=>e.jsx("a",{href:r.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:r.name},r.name))]}),e.jsx("div",{className:"py-6",children:e.jsx("a",{href:"#",className:"-mx-3 block rounded-lg px-3 py-2.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",children:"Log in"})})]})})]}),e.jsx("div",{className:"sticky bottom-0 grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 text-center dark:divide-white/5 dark:bg-gray-800/50",children:item.ctas.map(r=>e.jsx("a",{href:r.href,className:"p-3 text-base/7 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-800",children:r.title},r.title))})]})]})]})}function R(){return e.jsxs(n.Disclosure,{as:"nav",className:"relative bg-white shadow dark:bg-gray-800/50 dark:shadow-none dark:after:pointer-events-none dark:after:absolute dark:after:inset-x-0 dark:after:bottom-0 dark:after:h-px dark:after:bg-white/10",children:[e.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex h-16 justify-between",children:[e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"-ml-2 mr-2 flex items-center md:hidden",children:e.jsxs(n.DisclosureButton,{className:"group relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-600 dark:hover:bg-white/5 dark:hover:text-white dark:focus:ring-white",children:[e.jsx("span",{className:"absolute -inset-0.5"}),e.jsx("span",{className:"sr-only",children:"Open main menu"}),e.jsx(x.Bars3Icon,{"aria-hidden":"true",className:"block size-6 group-data-[open]:hidden"}),e.jsx(x.XMarkIcon,{"aria-hidden":"true",className:"hidden size-6 group-data-[open]:block"})]})}),e.jsxs("div",{className:"flex shrink-0 items-center",children:[e.jsx("img",{alt:"Your Company",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600",className:"h-8 w-auto dark:hidden"}),e.jsx("img",{alt:"Your Company",src:"https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500",className:"hidden h-8 w-auto dark:block"})]}),e.jsxs("div",{className:"hidden md:ml-6 md:flex md:space-x-8",children:[e.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-indigo-600 px-1 pt-1 text-sm font-medium text-gray-900 dark:border-indigo-500 dark:text-white",children:"Dashboard"}),e.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Team"}),e.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Projects"}),e.jsx("a",{href:"#",className:"inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white",children:"Calendar"})]})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"shrink-0",children:e.jsxs("button",{type:"button",className:"relative inline-flex items-center gap-x-1.5 rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:bg-indigo-500 dark:shadow-none dark:hover:bg-indigo-400 dark:focus-visible:outline-indigo-500",children:[e.jsx(b.PlusIcon,{"aria-hidden":"true",className:"-ml-0.5 size-5"}),"New Job"]})}),e.jsxs("div",{className:"hidden md:ml-4 md:flex md:shrink-0 md:items-center",children:[e.jsxs("button",{type:"button",className:"relative rounded-full p-1 text-gray-400 hover:text-gray-500 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-indigo-600 dark:hover:text-white dark:focus:outline-indigo-500",children:[e.jsx("span",{className:"absolute -inset-1.5"}),e.jsx("span",{className:"sr-only",children:"View notifications"}),e.jsx(x.BellIcon,{"aria-hidden":"true",className:"size-6"})]}),e.jsxs(n.Menu,{as:"div",className:"relative ml-3",children:[e.jsxs(n.MenuButton,{className:"relative flex rounded-full focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-500",children:[e.jsx("span",{className:"absolute -inset-1.5"}),e.jsx("span",{className:"sr-only",children:"Open user menu"}),e.jsx("img",{alt:"",src:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",className:"size-8 rounded-full bg-gray-100 outline outline-1 -outline-offset-1 outline-black/5 dark:bg-gray-800 dark:outline-white/10"})]}),e.jsxs(n.MenuItems,{transition:!0,className:"absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg outline outline-1 outline-black/5 transition data-[closed]:scale-95 data-[closed]:transform data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-75 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[e.jsx(n.MenuItem,{children:e.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Your profile"})}),e.jsx(n.MenuItem,{children:e.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Settings"})}),e.jsx(n.MenuItem,{children:e.jsx("a",{href:"#",className:"block px-4 py-2 text-sm text-gray-700 data-[focus]:bg-gray-100 data-[focus]:outline-none dark:text-gray-300 dark:data-[focus]:bg-white/5",children:"Sign out"})})]})]})]})]})]})}),e.jsxs(n.DisclosurePanel,{className:"md:hidden",children:[e.jsxs("div",{className:"space-y-1 pb-3 pt-2",children:[e.jsx(n.DisclosureButton,{as:"a",href:"#",className:"block border-l-4 border-indigo-600 bg-indigo-50 py-2 pl-3 pr-4 text-base font-medium text-indigo-700 sm:pl-5 sm:pr-6 dark:border-indigo-500 dark:bg-indigo-600/10 dark:text-indigo-400",children:"Dashboard"}),e.jsx(n.DisclosureButton,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Team"}),e.jsx(n.DisclosureButton,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Projects"}),e.jsx(n.DisclosureButton,{as:"a",href:"#",className:"block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 sm:pl-5 sm:pr-6 dark:text-gray-300 dark:hover:border-white/20 dark:hover:bg-white/5 dark:hover:text-white",children:"Calendar"})]}),e.jsxs("div",{className:"border-t border-gray-200 pb-3 pt-4 dark:border-white/10",children:[e.jsxs("div",{className:"flex items-center px-4 sm:px-6",children:[e.jsx("div",{className:"shrink-0",children:e.jsx("img",{alt:"",src:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",className:"size-10 rounded-full bg-gray-100 outline outline-1 -outline-offset-1 outline-black/5 dark:bg-gray-800 dark:outline-white/10"})}),e.jsxs("div",{className:"ml-3",children:[e.jsx("div",{className:"text-base font-medium text-gray-800 dark:text-white",children:"Tom Cook"}),e.jsx("div",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"tom@example.com"})]}),e.jsxs("button",{type:"button",className:"relative ml-auto shrink-0 rounded-full p-1 text-gray-400 hover:text-gray-500 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-indigo-600 dark:hover:text-white dark:focus:outline-indigo-500",children:[e.jsx("span",{className:"absolute -inset-1.5"}),e.jsx("span",{className:"sr-only",children:"View notifications"}),e.jsx(x.BellIcon,{"aria-hidden":"true",className:"size-6"})]})]}),e.jsxs("div",{className:"mt-3 space-y-1",children:[e.jsx(n.DisclosureButton,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Your profile"}),e.jsx(n.DisclosureButton,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Settings"}),e.jsx(n.DisclosureButton,{as:"a",href:"#",className:"block px-4 py-2 text-base font-medium text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",children:"Sign out"})]})]})]})]})}function A({item:a,onHover:u}){const r=c.useRef(null);return e.jsx(n.Popover,{children:({open:g})=>e.jsxs("div",{className:"relative",onMouseEnter:()=>{var s;u&&!g&&((s=r.current)==null||s.click())},onMouseLeave:()=>{var s;u&&g&&((s=r.current)==null||s.click())},children:[e.jsxs("div",{className:"flex items-center gap-x-1",children:[a.useLink?e.jsx(N,{href:a.href,className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:a.title}):e.jsx("span",{className:"text-sm/6 font-semibold text-gray-900 dark:text-white",children:a.title}),e.jsx(n.PopoverButton,{ref:r,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white","aria-label":`Open ${a.title} menu`,children:e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),e.jsxs(n.PopoverPanel,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-screen max-w-md -translate-x-1/2 overflow-hidden rounded-3xl bg-white shadow-lg outline outline-1 outline-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10",children:[e.jsx("div",{className:"p-4",children:a.subMenu.map(s=>e.jsxs("div",{className:"group relative flex items-center gap-x-6 rounded-lg p-4 text-sm/6 hover:bg-gray-50 dark:hover:bg-white/5",children:[e.jsx("div",{className:"flex size-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white dark:bg-gray-700/50 dark:group-hover:bg-gray-700",children:(()=>{const i=s.icon;if(!i)return null;if(c.isValidElement(i))return c.cloneElement(i,{className:"size-6 text-gray-600 group-hover:text-primary","aria-hidden":!0});if(typeof i=="function"){const l=i;return e.jsx(l,{"aria-hidden":!0,className:"size-6 text-gray-600 group-hover:text-primary"})}return null})()}),e.jsxs("div",{className:"flex-auto",children:[e.jsxs("a",{href:s.href,className:"block font-semibold text-gray-900 dark:text-white",children:[s.title,e.jsx("span",{className:"absolute inset-0"})]}),e.jsx("p",{className:"mt-1 text-gray-600 dark:text-gray-400",children:s.description})]})]},s.title))}),e.jsx("div",{className:"grid grid-cols-2 divide-x divide-gray-900/5 bg-gray-50 dark:divide-white/10 dark:bg-gray-700/50",children:a.ctas&&a.ctas.map(s=>e.jsxs("a",{href:s.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700/50",children:[(()=>{const i=s.icon;if(!i)return null;if(c.isValidElement(i))return c.cloneElement(i,{className:"size-5 flex-none text-gray-400","aria-hidden":!0});if(typeof i=="function"){const l=i;return e.jsx(l,{"aria-hidden":!0,className:"size-5 flex-none text-gray-400"})}return null})(),s.title]},s.title))})]})]})})}function L({item:a,onHover:u}){const r=c.useRef(null);return e.jsx(n.Popover,{children:({open:g})=>e.jsxs("div",{onMouseEnter:()=>{var s;u&&!g&&((s=r.current)==null||s.click())},onMouseLeave:()=>{var s;u&&g&&((s=r.current)==null||s.click())},children:[e.jsxs("div",{className:"flex items-center gap-x-1",children:[a.useLink?e.jsx(N,{href:a.href,className:"text-sm/6 font-semibold text-gray-900",children:a.title}):e.jsx("span",{className:"text-sm/6 font-semibold text-gray-900",children:a.title}),e.jsx(n.PopoverButton,{ref:r,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900","aria-label":`Open ${a.title} menu`,children:e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),e.jsxs(n.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-white pt-14 shadow-lg ring-1 ring-gray-900/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[e.jsx("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8",children:a.subMenu.map(s=>e.jsxs("div",{className:"group relative rounded-lg p-6 text-sm/6 hover:bg-gray-50",children:[s.image?e.jsx("div",{className:"aspect-[4/3] w-full overflow-hidden rounded-md bg-gray-100",children:e.jsx("img",{alt:s.imageAlt||s.title,src:s.image,className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-105"})}):e.jsx("div",{className:"flex size-11 items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white",children:(()=>{const i=s.icon;if(!i)return null;if(c.isValidElement(i))return c.cloneElement(i,{className:"size-6 text-gray-600 group-hover:text-primary","aria-hidden":!0});if(typeof i=="function"){const l=i;return e.jsx(l,{"aria-hidden":!0,className:"size-6 text-gray-600 group-hover:text-primary"})}return null})()}),e.jsxs("a",{href:s.href,className:`${s.image?"mt-4":"mt-6"} block font-semibold text-gray-900`,children:[s.title,e.jsx("span",{className:"absolute inset-0"})]}),e.jsx("p",{className:"mt-1 text-gray-600",children:s.description})]},s.title))}),e.jsx("div",{className:"bg-gray-50",children:a.ctas&&e.jsx("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:e.jsx("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.ctas.map(s=>e.jsxs("a",{href:s.href,className:"flex items-center justify-center gap-x-2.5 p-3 text-sm/6 font-semibold text-gray-900 hover:bg-gray-100",children:[(()=>{const i=s.icon;if(!i)return null;if(c.isValidElement(i))return c.cloneElement(i,{className:"size-5 flex-none text-gray-400","aria-hidden":!0});if(typeof i=="function"){const l=i;return e.jsx(l,{"aria-hidden":!0,className:"size-5 flex-none text-gray-400"})}return null})(),s.title]},s.title))})})})]})]})},a.id)}function O({item:a,onHover:u}){const r=c.useRef(null);return e.jsx(n.Popover,{children:({open:g})=>{var s,i;return e.jsxs("div",{className:"relative",onMouseEnter:()=>{var l;u&&!g&&((l=r.current)==null||l.click())},onMouseLeave:()=>{var l;u&&g&&((l=r.current)==null||l.click())},children:[e.jsxs("div",{className:"flex items-center gap-x-1",children:[a.useLink?e.jsx(N,{href:a.href,className:"text-sm/6 font-semibold text-gray-900",children:a.title}):e.jsx("span",{className:"text-sm/6 font-semibold text-gray-900",children:a.title}),e.jsx(n.PopoverButton,{ref:r,className:"inline-flex items-center p-1 text-gray-700 hover:text-gray-900","aria-label":`Open ${a.title} menu`,children:e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none"})})]}),e.jsx(n.PopoverPanel,{transition:!0,className:"absolute left-1/2 z-10 mt-3 w-72 -translate-x-1/2 overflow-hidden rounded-2xl bg-white p-2 shadow-lg ring-1 ring-gray-900/5 transition data-[closed]:translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:e.jsxs("ul",{className:"space-y-1",children:[(s=a.subMenu)==null?void 0:s.map(l=>e.jsx("li",{className:"group",children:e.jsxs(N,{href:l.href,className:"flex items-center rounded-md px-3 py-2 text-sm text-gray-400 transition-colors duration-300 group-hover:text-black",children:[(()=>{const m=l.icon;if(!m)return e.jsx(P.ChevronRightIcon,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"});if(c.isValidElement(m))return c.cloneElement(m,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary","aria-hidden":!0});if(typeof m=="function"){const y=m;return e.jsx(y,{"aria-hidden":!0,className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"})}return null})(),e.jsx("span",{children:l.title})]})},l.title)),(i=a.ctas)==null?void 0:i.map(l=>e.jsx("li",{className:"group",children:e.jsxs("a",{href:l.href,className:"flex items-center rounded-md px-3 py-2 text-sm text-gray-400 transition-colors duration-300 group-hover:text-black",children:[(()=>{const m=l.icon;if(!m)return e.jsx(P.ChevronRightIcon,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"});if(c.isValidElement(m))return c.cloneElement(m,{className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary","aria-hidden":!0});if(typeof m=="function"){const y=m;return e.jsx(y,{"aria-hidden":!0,className:"mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"})}return null})(),e.jsx("span",{children:l.title})]})},l.title))]})})]})}})}function q({config:a,onScrolledChange:u,scrollThreshold:r=10,quickSearchResults:g=[]}){const[s,i]=c.useState(!1),[l,m]=c.useState(!1),[y,v]=c.useState(!1),[k,w]=c.useState("");return c.useEffect(()=>{typeof(a==null?void 0:a.onSearchOpenChange)=="function"&&a.onSearchOpenChange(y),y||(w(""),typeof(a==null?void 0:a.onClearQuickResults)=="function"&&a.onClearQuickResults())},[y]),c.useEffect(()=>{const t=()=>{const h=window.scrollY>r;m(p=>(p!==h&&typeof u=="function"&&u(h),h))};return t(),window.addEventListener("scroll",t,{passive:!0}),()=>window.removeEventListener("scroll",t)},[u,r]),e.jsxs("header",{className:`${a!=null&&a.sticky?"sticky top-0 z-50 bg-white/95 backdrop-blur supports-[backdrop-filter]:bg-white/70":"relative z-10"} isolate bg-white`,children:[e.jsxs("nav",{"aria-label":"Global",className:"mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8",children:[e.jsx("div",{className:"flex lg:flex-1",children:e.jsx(N,{href:"/","aria-label":a.logoAlt||"Home",children:a.logo?e.jsx("img",{alt:a.logoAlt||"Logo",src:a.logo,className:`w-auto transition-all duration-300 ${l?"h-8 md:h-14":"h-12 md:h-20"}`}):e.jsx("div",{className:`h-auto transition-all duration-300 ${l?"w-28":"w-32"}`,children:e.jsx("h1",{className:`transition-all duration-300 ${l?"text-xl":"text-2xl"}`,children:a.fallbackText||"<NovaNav>"})})})}),e.jsx("div",{className:"flex lg:hidden",children:e.jsxs("button",{type:"button",onClick:()=>i(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700",children:[e.jsx("span",{className:"sr-only",children:"Open main menu"}),e.jsx(x.Bars3Icon,{"aria-hidden":"true",className:"size-6"})]})}),e.jsx(n.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:a.menuItems.map(t=>{const h=t.type||(t.full?"full":"default");return t.subMenu?h==="full"?e.jsx(L,{item:t,onHover:t.onHover},t.id||t.title):h==="simple"?e.jsx(O,{item:t,onHover:t.onHover},t.id||t.title):e.jsx(A,{item:t,onHover:t.onHover},t.id||t.title):t.useLink?e.jsx(N,{href:t.href,className:"text-sm/6 font-semibold text-gray-900",children:t.title},t.id):e.jsx("a",{href:t.href,className:"text-sm/6 font-semibold text-gray-900",children:t.title},t.id)})}),e.jsxs("div",{className:"hidden gap-4 lg:flex lg:flex-1 lg:justify-end",children:[a.search&&e.jsx("button",{type:"button",onClick:()=>v(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 hover:bg-gray-100","aria-label":"Open search",children:e.jsx(x.MagnifyingGlassIcon,{"aria-hidden":"true",className:"size-6"})}),a.login&&e.jsxs("a",{href:a.loginHref,className:"text-sm/6 font-semibold text-gray-900",children:["Log in ",e.jsx("span",{"aria-hidden":"true",children:"→"})]}),a.cta&&e.jsx("a",{href:a.ctaBtnHref,className:"rounded-md bg-gray-900 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900",children:a.ctaTitle||"Sign up"})]})]}),e.jsxs(n.Dialog,{open:y,onClose:v,children:[e.jsx("div",{className:"fixed inset-0 z-50 bg-black/30"}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs(n.DialogPanel,{className:"w-full max-w-lg rounded-lg bg-white p-6 shadow-lg ring-1 ring-gray-900/10",children:[e.jsxs("div",{className:"flex items-center justify-between pb-2",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-900",children:"Search"}),e.jsx("button",{type:"button",onClick:()=>v(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 hover:bg-gray-100","aria-label":"Close search",children:e.jsx(x.XMarkIcon,{"aria-hidden":"true",className:"size-5"})})]}),e.jsxs("form",{className:"mt-2",onSubmit:t=>{t.preventDefault(),typeof(a==null?void 0:a.onSearch)=="function"&&a.onSearch(k),v(!1)},children:[e.jsx("label",{htmlFor:"site-search",className:"sr-only",children:"Search"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:"site-search",type:"search",placeholder:"Search...",autoFocus:!0,value:k,onChange:t=>{const h=t.target.value;w(h),typeof(a==null?void 0:a.onSearchChange)=="function"&&a.onSearchChange(h)},className:"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 shadow-sm placeholder:text-gray-400 focus:border-gray-900 focus:outline-none focus:ring-2 focus:ring-gray-900"}),e.jsx("button",{type:"submit",className:"rounded-md bg-gray-900 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900",children:"Search"})]})]}),Array.isArray(g)&&g.length>0&&e.jsx("div",{className:"mt-4 divide-y divide-gray-200",children:g.map((t,h)=>{if(!t||typeof t!="object")return null;const p=t.title||t.q||t.name||"Result",j=t.desc||t.description||t.summary||t.a||"",d=typeof(a==null?void 0:a.searchTitleMax)=="number"?a.searchTitleMax:60,C=typeof(a==null?void 0:a.searchDescMax)=="number"?a.searchDescMax:100,z=typeof p=="string"&&p.length>d?`${p.slice(0,d-1)}…`:p,S=typeof j=="string"&&j.length>C?`${j.slice(0,C-1)}…`:j,o=typeof t.link=="string"?t.link:void 0,f=typeof o=="string"&&o.startsWith("/"),M=e.jsxs("div",{className:"flex items-start gap-3 py-3",children:[t!=null&&t.icon?e.jsx("div",{className:"mt-0.5 h-6 w-6 text-gray-500",children:t.icon}):t!=null&&t.image?e.jsx("img",{src:t.image,alt:p,className:"mt-0.5 h-6 w-6 rounded object-cover"}):e.jsx(x.MagnifyingGlassIcon,{"aria-hidden":"true",className:"mt-0.5 size-6 text-gray-400"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 truncate",children:z}),S?e.jsx("div",{className:"text-sm text-gray-500 truncate",children:S}):null]})]});return o?f?e.jsx("a",{href:o,className:"block hover:bg-gray-50",onClick:()=>{typeof(a==null?void 0:a.onBeginNavigate)=="function"&&a.onBeginNavigate(),typeof(a==null?void 0:a.onClearQuickResults)=="function"&&a.onClearQuickResults(),v(!1)},children:M},o||h):e.jsx("a",{href:o,className:"block hover:bg-gray-50",onClick:()=>{typeof(a==null?void 0:a.onBeginNavigate)=="function"&&a.onBeginNavigate(),typeof(a==null?void 0:a.onClearQuickResults)=="function"&&a.onClearQuickResults(),v(!1)},children:M},o||h):e.jsx("div",{className:"block hover:bg-gray-50",children:M},h)})})]})})]}),e.jsxs(n.Dialog,{open:s,onClose:i,className:"lg:hidden",children:[e.jsx("div",{className:"fixed inset-0 z-50"}),e.jsxs(n.DialogPanel,{className:"fixed inset-y-0 right-0 z-50 w-full overflow-y-auto bg-white p-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{href:"/",className:"-m-1.5 p-1.5","aria-label":a.logoAlt||"Home",children:a.logo?e.jsx("img",{alt:a.logoAlt||"Logo",src:a.logo,className:"h-8 w-auto"}):e.jsx("span",{className:"text-lg font-semibold",children:a.fallbackText||"NEXGEN Roofing Systems"})}),e.jsxs("button",{type:"button",onClick:()=>i(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700",children:[e.jsx("span",{className:"sr-only",children:"Close menu"}),e.jsx(x.XMarkIcon,{"aria-hidden":"true",className:"size-6"})]})]}),e.jsx("div",{className:"mt-6 flow-root",children:e.jsxs("div",{className:"-my-6 divide-y divide-gray-500/10",children:[e.jsx("div",{className:"space-y-2 py-6",children:a.menuItems.map(t=>t.subMenu?e.jsxs(n.Disclosure,{as:"div",className:"-mx-3",children:[e.jsxs(n.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:[t.title,e.jsx(b.ChevronDownIcon,{"aria-hidden":"true",className:"size-5 flex-none group-data-[open]:rotate-180"})]}),e.jsx(n.DisclosurePanel,{className:"mt-2 space-y-2",children:[...t.subMenu,...t.ctas||[]].map(h=>e.jsx(n.DisclosureButton,{as:"a",href:h.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm/7 font-semibold text-gray-900 hover:bg-gray-50",children:h.title},h.title))})]},t.id):t.useLink?e.jsx(N,{href:t.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:t.title},t.id):e.jsx("a",{href:t.href,className:"-mx-3 block rounded-lg px-3 py-2 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:t.title},t.id))}),e.jsxs("div",{className:"space-y-2 py-6",children:[a.login&&e.jsxs("a",{href:a.loginHref,className:"-mx-3 block rounded-lg px-3 py-2.5 text-base/7 font-semibold text-gray-900 hover:bg-gray-50",children:["Log in ",e.jsx("span",{"aria-hidden":"true",children:"→"})]}),a.cta&&e.jsx("a",{href:a.ctaBtnHref,className:"-mx-3 block rounded-lg bg-gray-900 px-3 py-2.5 text-base/7 font-semibold text-white hover:bg-gray-800",children:a.ctaTitle||"Sign up"})]})]})})]})]})]})}function $(){return e.jsx(e.Fragment,{children:e.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[e.jsx(x.CubeTransparentIcon,{className:"inset-shadow-sm 8 h-16 w-16 animate-[spin_2s_linear_infinite] rounded-full border-4 border-t-4 border-solid border-white text-5xl font-black text-primary"}),e.jsx("div",{className:"mt-16 flex w-full items-center justify-center py-8",children:e.jsx("p",{className:"text-xl font-thin uppercase tracking-widest text-primary",children:"Loading..."})})]})})})}function T({baseConfig:a}){const[u,r]=c.useState([]),[g,s]=c.useState(""),i=c.useRef(null),[l,m]=c.useState(!1),y=async h=>{const p=(h||"").trim();if(!p){r([]);return}try{const j=await fetch(`/api/search?q=${encodeURIComponent(p)}`);if(!j.ok)throw new Error("search failed");const d=await j.json(),C=[...Array.isArray(d==null?void 0:d.services)?d.services:[],...Array.isArray(d==null?void 0:d.faqs)?d.faqs:[],...Array.isArray(d==null?void 0:d.gallery)?d.gallery:[],...Array.isArray(d==null?void 0:d.posts)?d.posts:[],...Array.isArray(d==null?void 0:d.projects)?d.projects:[],...Array.isArray(d==null?void 0:d.locations)?d.locations:[]].filter(o=>o&&typeof o=="object"),z=new Set,S=C.filter(o=>{const f=`${(o.link||"").toLowerCase()}|${(o.title||o.q||"").toLowerCase()}`;return z.has(f)?!1:(z.add(f),!0)}).map(o=>{if(o!=null&&o.icon)return o;const f="h-6 w-6 text-gray-400";switch(o==null?void 0:o.kind){case"faq":return{...o,icon:e.jsx(x.QuestionMarkCircleIcon,{"aria-hidden":"true",className:f})};case"service":return{...o,icon:e.jsx(b.WrenchScrewdriverIcon,{"aria-hidden":"true",className:f})};case"project":return{...o,icon:e.jsx(x.BriefcaseIcon,{"aria-hidden":"true",className:f})};case"post":return{...o,icon:e.jsx(x.NewspaperIcon,{"aria-hidden":"true",className:f})};case"gallery":return{...o,icon:e.jsx(x.PhotoIcon,{"aria-hidden":"true",className:f})};case"location":return{...o,icon:e.jsx(x.MapPinIcon,{"aria-hidden":"true",className:f})};default:return o}});r(S)}catch{r([])}},v=h=>{s(h),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>y(h),300)},k=h=>{const p=(h||"").trim();p&&(m(!0),typeof window<"u"&&(window.location.href=`/search?q=${encodeURIComponent(p)}`))},w=h=>{h||(s(""),r([]),i.current&&clearTimeout(i.current))},t=c.useMemo(()=>({...a,search:!0,onSearchChange:v,onSearch:k,onSearchOpenChange:w,onClearQuickResults:()=>r([]),onBeginNavigate:()=>m(!0)}),[a]);return e.jsxs(e.Fragment,{children:[l&&e.jsx("div",{className:"fixed inset-0 z-[60]",children:e.jsx($,{})}),e.jsx(q,{config:t,quickSearchResults:u})]})}exports.NavController=T;exports.SimpleLight=R;exports.WithFlyout=E;