@headlessui/vue
Advanced tools
Comparing version 0.3.1-035f9b0 to 0.3.1-2aa95f2
@@ -1,2 +0,2 @@ | ||
import { defineComponent, ComputedRef } from 'vue'; | ||
import { defineComponent, ComputedRef, Ref } from 'vue'; | ||
export declare function useDescriptions(): [ComputedRef<string | undefined>, ReturnType<typeof defineComponent>]; | ||
@@ -10,3 +10,5 @@ export declare let Description: import("vue").DefineComponent<{ | ||
id: string; | ||
slot: Record<string, any>; | ||
slot: Ref<Record<string, any>>; | ||
name: Ref<string>; | ||
props: Ref<Record<string, any>>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -13,0 +15,0 @@ as: string; |
@@ -131,3 +131,5 @@ import { PropType, Ref } from 'vue'; | ||
id: string; | ||
slot: Record<string, any>; | ||
slot: Ref<Record<string, any>>; | ||
name: Ref<string>; | ||
props: Ref<Record<string, any>>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -134,0 +136,0 @@ as: string; |
@@ -30,2 +30,3 @@ import { Ref } from 'vue'; | ||
handleKeyDown(event: KeyboardEvent): void; | ||
handleKeyUp(event: KeyboardEvent): void; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -32,0 +33,0 @@ as: string; |
@@ -1,2 +0,2 @@ | ||
import { defineComponent, ComputedRef } from 'vue'; | ||
import { defineComponent, ComputedRef, Ref } from 'vue'; | ||
export declare function useLabels(): [ComputedRef<string | undefined>, ReturnType<typeof defineComponent>]; | ||
@@ -8,8 +8,17 @@ export declare let Label: import("vue").DefineComponent<{ | ||
}; | ||
clickable: { | ||
type: BooleanConstructor[]; | ||
default: boolean; | ||
}; | ||
}, { | ||
id: string; | ||
slot: Ref<Record<string, unknown>>; | ||
name: Ref<string>; | ||
props: Ref<Record<string, unknown>>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
as: string; | ||
clickable: boolean; | ||
} & {}>, { | ||
as: string; | ||
clickable: boolean; | ||
}>; |
@@ -51,2 +51,3 @@ import { Ref } from 'vue'; | ||
handleKeyDown: (event: KeyboardEvent) => void; | ||
handleKeyUp: (event: KeyboardEvent) => void; | ||
handleClick: (event: MouseEvent) => void; | ||
@@ -53,0 +54,0 @@ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ |
@@ -29,2 +29,3 @@ import { Ref } from 'vue'; | ||
handleKeyDown: (event: KeyboardEvent) => void; | ||
handleKeyUp: (event: KeyboardEvent) => void; | ||
handleClick: (event: MouseEvent) => void; | ||
@@ -55,2 +56,3 @@ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
handleKeyDown: (event: KeyboardEvent) => void; | ||
handleKeyUp: (event: KeyboardEvent) => void; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -57,0 +59,0 @@ as: string; |
@@ -19,2 +19,3 @@ import { Ref } from 'vue'; | ||
el: Ref<HTMLElement | null>; | ||
handleKeyDown: (event: KeyboardEvent) => void; | ||
LabelProvider: import("vue").DefineComponent<readonly string[] | Readonly<import("vue").ComponentObjectPropsOptions<Record<string, unknown>>>, unknown, unknown, Record<string, import("@vue/reactivity").ComputedGetter<any> | import("vue").WritableComputedOptions<any>>, import("vue").MethodOptions, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -259,8 +260,17 @@ [x: number]: string; | ||
}; | ||
clickable: { | ||
type: BooleanConstructor[]; | ||
default: boolean; | ||
}; | ||
}, { | ||
id: string; | ||
slot: Ref<Record<string, unknown>>; | ||
name: Ref<string>; | ||
props: Ref<Record<string, unknown>>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
as: string; | ||
clickable: boolean; | ||
} & {}>, { | ||
as: string; | ||
clickable: boolean; | ||
}>; | ||
@@ -274,3 +284,5 @@ export declare let RadioGroupDescription: import("vue").DefineComponent<{ | ||
id: string; | ||
slot: Record<string, any>; | ||
slot: Ref<Record<string, any>>; | ||
name: Ref<string>; | ||
props: Ref<Record<string, any>>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -277,0 +289,0 @@ as: string; |
@@ -9,5 +9,3 @@ import { Ref } from 'vue'; | ||
[key: string]: any; | ||
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { | ||
[key: string]: any; | ||
}>[] | null | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
as: string; | ||
@@ -37,2 +35,4 @@ } & {}>, { | ||
el: Ref<HTMLButtonElement | null> | undefined; | ||
labelledby: Ref<string | undefined> | undefined; | ||
describedby: Ref<string | undefined> | undefined; | ||
handleClick(event: MouseEvent): void; | ||
@@ -56,10 +56,17 @@ handleKeyUp(event: KeyboardEvent): void; | ||
}; | ||
clickable: { | ||
type: BooleanConstructor[]; | ||
default: boolean; | ||
}; | ||
}, { | ||
id: string; | ||
el: Ref<HTMLLabelElement | null>; | ||
handleClick(): void; | ||
slot: Ref<Record<string, unknown>>; | ||
name: Ref<string>; | ||
props: Ref<Record<string, unknown>>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
as: string; | ||
clickable: boolean; | ||
} & {}>, { | ||
as: string; | ||
clickable: boolean; | ||
}>; | ||
@@ -73,3 +80,5 @@ export declare let SwitchDescription: import("vue").DefineComponent<{ | ||
id: string; | ||
el: Ref<HTMLParagraphElement | null>; | ||
slot: Ref<Record<string, any>>; | ||
name: Ref<string>; | ||
props: Ref<Record<string, any>>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -76,0 +85,0 @@ as: string; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,n,o=require("vue");function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function i(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||(r[n]=e[n]);return r}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function l(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function u(e,t){if(e in t){for(var n=t[e],o=arguments.length,r=new Array(o>2?o-2:0),i=2;i<o;i++)r[i-2]=arguments[i];return"function"==typeof n?n.apply(void 0,r):n}var a=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(a,u),a}function s(n){var o,a,l=n.visible,s=void 0===l||l,d=n.features,p=void 0===d?e.None:d,v=i(n,["visible","features"]);return s||p&e.Static&&v.props.static?c(v):p&e.RenderStrategy?u(null==(o=v.props.unmount)||o?t.Unmount:t.Hidden,((a={})[t.Unmount]=function(){return null},a[t.Hidden]=function(){return c(r({},v,{props:r({},v.props,{hidden:!0,style:{display:"none"}})}))},a)):c(v)}function c(e){var t,n=e.attrs,r=e.slots,a=e.slot,u=e.name,s=function(e,t){void 0===t&&(t=[]);for(var n,o=Object.assign({},e),r=l(t);!(n=r()).done;){var i=n.value;i in o&&delete o[i]}return o}(e.props,["unmount","static"]),c=s.as,d=i(s,["as"]),p=null==r.default?void 0:r.default(a);if("template"===c){if(Object.keys(d).length>0||Object.keys(n).length>0){var v=null!=p?p:[],f=v[0],m=v.slice(1);if(null==(t=f)||"string"!=typeof t.type&&"object"!=typeof t.type||m.length>0)throw new Error(['Passing props on "template"!',"","The current component <"+u+' /> is rendering a "template".',"However we need to passthrough the following props:",Object.keys(d).concat(Object.keys(n)).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return o.cloneVNode(f,d)}return p}return o.h(c,d,p)}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(e||(e={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(t||(t={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",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"}(n||(n={}));var d=0;function p(){return++d}var v,f,m,h,b=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function g(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(b))}function y(e){null==e||e.focus({preventScroll:!0})}function S(e,t){var n=Array.isArray(e)?e:g(e),o=document.activeElement,r=function(){if(t&(v.First|v.Next))return m.Next;if(t&(v.Previous|v.Last))return m.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),i=function(){if(t&v.First)return 0;if(t&v.Previous)return Math.max(0,n.indexOf(o))-1;if(t&v.Next)return Math.max(0,n.indexOf(o))+1;if(t&v.Last)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=t&v.NoScroll?{preventScroll:!0}:{},l=0,u=n.length,s=void 0;do{var c;if(l>=u||l+u<=0)return f.Error;var d=i+l;if(t&v.WrapAround)d=(d+u)%u;else{if(d<0)return f.Underflow;if(d>=u)return f.Overflow}null==(c=s=n[d])||c.focus(a),l+=r}while(s!==document.activeElement);return s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),f.Success}function x(e,t,n){window.addEventListener(e,t,n),o.onUnmounted((function(){return window.removeEventListener(e,t,n)}))}function w(e,t){for(var n,o=l(e);!(n=o()).done;)if(n.value.contains(t))return!0;return!1}function O(e,t,r){void 0===t&&(t=o.ref(!0)),void 0===r&&(r=o.ref({}));var i=o.ref("undefined"!=typeof window?document.activeElement:null),a=o.ref(null);function u(){if(t.value&&1===e.value.size){var n=r.value.initialFocus,o=document.activeElement;if(n){if(n===o)return}else if(w(e.value,o))return;if(i.value=o,n)y(n);else{for(var u,s=!1,c=l(e.value);!(u=c()).done;)if(S(u.value,v.First)===f.Success){s=!0;break}if(!s)throw new Error("There are no focusable elements inside the <FocusTrap />")}a.value=document.activeElement}}function s(){y(i.value),i.value=null,a.value=null}o.watchEffect(u),o.onUpdated((function(){t.value?u():s()})),o.onUnmounted(s),x("keydown",(function(o){if(t.value&&o.key===n.Tab&&document.activeElement&&1===e.value.size){o.preventDefault();for(var r,i=l(e.value);!(r=i()).done;)if(S(r.value,(o.shiftKey?v.Previous:v.Next)|v.WrapAround)===f.Success){a.value=document.activeElement;break}}})),x("focus",(function(n){if(t.value&&1===e.value.size){var o=a.value;if(o){var r=n.target;r&&r instanceof HTMLElement?w(e.value,r)?(a.value=r,y(r)):(n.preventDefault(),n.stopPropagation(),y(o)):y(a.value)}}}),!0)}!function(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"}(v||(v={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(f||(f={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(m||(m={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(h||(h={}));var E=new Set,C=new Map;function P(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function D(e){var t=C.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var k,I=Symbol("StackContext");function R(){return o.inject(I,(function(){}))}!function(e){e[e.AddElement=0]="AddElement",e[e.RemoveElement=1]="RemoveElement"}(k||(k={}));var T=o.defineComponent({name:"StackProvider",props:{onUpdate:{type:Function,default:void 0}},setup:function(e,t){var n=t.slots,r=R();return o.provide(I,(function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];null==e.onUpdate||e.onUpdate.apply(e,n),r.apply(void 0,n)})),function(){return n.default()}}}),L=Symbol("ForcePortalRootContext"),j=o.defineComponent({name:"ForcePortalRoot",props:{force:{type:Boolean,default:!1}},setup:function(e,t){var n=t.slots;return o.provide(L,e.force),function(){return n.default()}}}),F=o.defineComponent({name:"Portal",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var n=t.slots,r=t.attrs,i=o.inject(L,!1),a=o.inject(A,null),l=o.ref(!0===i||null===a?function(){var e=document.getElementById("headlessui-portal-root");if(e)return e;var t=document.createElement("div");return t.setAttribute("id","headlessui-portal-root"),document.body.appendChild(t)}():a.resolveTarget());o.watchEffect((function(){i||null!==a&&(l.value=a.resolveTarget())}));var u=o.ref(null);return function(e){var t=R();o.watchEffect((function(n){var o=null==e?void 0:e.value;o&&(t(k.AddElement,o),n((function(){return t(k.RemoveElement,o)})))}))}(u),o.onUnmounted((function(){var e,t=document.getElementById("headlessui-portal-root");t&&l.value===t&&l.value.children.length<=0&&(null==(e=l.value.parentElement)||e.removeChild(l.value))})),function(){return null===l.value?null:o.h(T,{},(function(){return[o.h(o.Teleport,{to:l.value},[o.h("div",{ref:u},[s({props:e,slot:{},attrs:r,slots:n,name:"Portal"})])])]}))}}}),A=Symbol("PortalGroupContext"),$=o.defineComponent({name:"PortalGroup",props:{as:{type:[Object,String],default:"template"},target:{type:Object,default:null}},setup:function(e,t){var n=t.attrs,r=t.slots,a=o.reactive({resolveTarget:function(){return e.target}});return o.provide(A,a),function(){return s({props:i(e,["target"]),slot:{},attrs:n,slots:r,name:"PortalGroup"})}}}),B=Symbol("DescriptionContext");function N(){var e=o.ref([]);return[o.computed((function(){return e.value.length>0?e.value.join(" "):void 0})),o.defineComponent({name:"DescriptionProvider",props:["slot"],setup:function(t,n){var r=n.slots,i=o.computed((function(){return t.slot}));return o.provide(B,{register:function(t){return e.value.push(t),function(){var n=e.value.indexOf(t);-1!==n&&e.value.splice(n,1)}},slot:i}),function(){return r.default()}}})]}var M,U=o.defineComponent({name:"Description",props:{as:{type:[Object,String],default:"p"}},render:function(){return s({props:r({},this.$props,{id:this.id}),slot:this.slot,attrs:this.$attrs,slots:this.$slots,name:"Description"})},setup:function(){var e=o.inject(B,{register:function(){return function(){}},slot:{}}),t=e.register,n=e.slot,r="headlessui-description-"+p();return o.onMounted((function(){return o.onUnmounted(t(r))})),{id:r,slot:n}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(M||(M={}));var K=Symbol("DialogContext");function G(e){var t=o.inject(K,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Dialog /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,G),n}return t}var V,W="DC8F892D-2EBD-447C-A4C8-A03058436FF4",q=o.defineComponent({name:"Dialog",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:Boolean,default:W},onClose:{type:Function,default:W},initialFocus:{type:Object,default:null}},render:function(){var t=this,n=r({ref:"el",id:this.id,role:"dialog","aria-modal":this.dialogState===M.Open||void 0,"aria-labelledby":this.titleId,"aria-describedby":this.describedby},this.$attrs),a=this.$props,l=a.open,c=i(a,["open","onClose","initialFocus"]),d=this.containers,p={open:this.dialogState===M.Open};return o.h(T,{onUpdate:function(e,t){var n;return u(e,((n={})[k.AddElement]=function(){d.add(t)},n[k.RemoveElement]=function(){d.delete(t)},n))}},(function(){return[o.h(j,{force:!0},(function(){return[o.h(F,{},(function(){return[o.h($,{target:t.dialogRef},(function(){return[o.h(j,{force:!1},(function(){return[o.h(t.DescriptionProvider,{slot:p},(function(){return[s({props:r({},c,n),slot:p,attrs:t.$attrs,slots:t.$slots,visible:l,features:e.RenderStrategy|e.Static,name:"Dialog"})]}))]}))]}))]}))]}))]}))},setup:function(e){var t=o.ref(new Set),r=e.open!==W,i=e.onClose!==W;if(!r&&!i)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!r)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!i)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof e.open)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+(e.open===W?void 0:e.open));if("function"!=typeof e.onClose)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+(e.onClose===W?void 0:e.onClose));var a=o.computed((function(){return e.open?M.Open:M.Closed})),u=o.ref(null),s=o.ref(a.value===M.Open);o.onUpdated((function(){s.value=a.value===M.Open}));var c="headlessui-dialog-"+p(),d=o.computed((function(){return{initialFocus:e.initialFocus}}));O(t,s,d),function(e,t){void 0===t&&(t=o.ref(!0)),o.watchEffect((function(n){if(t.value&&e.value){var o=e.value;E.add(o);for(var r,i=l(C.keys());!(r=i()).done;){var a=r.value;a.contains(o)&&(D(a),C.delete(a))}document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=l(E);!(t=n()).done;)if(e.contains(t.value))return;1===E.size&&(C.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),P(e))}})),n((function(){if(E.delete(o),E.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!C.has(e)){for(var t,n=l(E);!(t=n()).done;)if(e.contains(t.value))return;C.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),P(e)}}));else for(var e,t=l(C.keys());!(e=t()).done;){var n=e.value;D(n),C.delete(n)}}))}}))}(u,s);var v=N(),f=v[0],m=v[1],h=o.ref(null),b={titleId:h,dialogState:a,setTitleId:function(e){h.value!==e&&(h.value=e)},close:function(){e.onClose(!1)}};return o.provide(K,b),x("mousedown",(function(e){var n=e.target;a.value===M.Open&&1===t.value.size&&(w(t.value,n)||(b.close(),o.nextTick((function(){null==n||n.focus()}))))})),x("keydown",(function(e){e.key===n.Escape&&a.value===M.Open&&(t.value.size>1||b.close())})),o.watchEffect((function(e){if(a.value===M.Open){var t=document.documentElement.style.overflow,n=document.documentElement.style.paddingRight,o=window.innerWidth-document.documentElement.clientWidth;document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=o+"px",e((function(){document.documentElement.style.overflow=t,document.documentElement.style.paddingRight=n}))}})),o.watchEffect((function(e){if(a.value===M.Open&&u.value){var t=new IntersectionObserver((function(e){for(var t,n=l(e);!(t=n()).done;){var o=t.value;0===o.boundingClientRect.x&&0===o.boundingClientRect.y&&0===o.boundingClientRect.width&&0===o.boundingClientRect.height&&b.close()}}));t.observe(u.value),e((function(){return t.disconnect()}))}})),{id:c,el:u,dialogRef:u,containers:t,dialogState:a,titleId:h,describedby:f,DescriptionProvider:m}}}),H=o.defineComponent({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e=G("DialogOverlay");return s({props:r({},this.$props,{ref:"el",id:this.id,"aria-hidden":!0,onClick:this.handleClick}),slot:{open:e.dialogState.value===M.Open},attrs:this.$attrs,slots:this.$slots,name:"DialogOverlay"})},setup:function(){var e=G("DialogOverlay");return{id:"headlessui-dialog-overlay-"+p(),handleClick:function(){e.close()}}}}),_=o.defineComponent({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"}},render:function(){var e=G("DialogTitle");return s({props:r({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===M.Open},attrs:this.$attrs,slots:this.$slots,name:"DialogTitle"})},setup:function(){var e=G("DialogTitle"),t="headlessui-dialog-title-"+p();return o.onMounted((function(){e.setTitleId(t),o.onUnmounted((function(){return e.setTitleId(null)}))})),{id:t}}}),z=U;function Y(e){var t;return null==e||null==e.value?null:null!=(t=e.value.$el)?t:e.value}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(V||(V={}));var Q=Symbol("DisclosureContext");function J(e){var t=o.inject(Q,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Disclosure /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,J),n}return t}var X,Z,ee=o.defineComponent({name:"Disclosure",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var n=t.slots,i=t.attrs,a=r({},e),l=o.ref(V.Closed),c=o.ref(null);return o.provide(Q,{disclosureState:l,panelRef:c,toggleDisclosure:function(){var e;l.value=u(l.value,((e={})[V.Open]=V.Closed,e[V.Closed]=V.Open,e))}}),function(){return s({props:a,slot:{open:l.value===V.Open},slots:n,attrs:i,name:"Disclosure"})}}}),te=o.defineComponent({name:"DisclosureButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=J("DisclosureButton"),t={open:e.disclosureState.value===V.Open};return s({props:r({},this.$props,{id:this.id,type:"button","aria-expanded":e.disclosureState.value===V.Open||void 0,"aria-controls":this.ariaControls,onClick:this.handleClick,onKeydown:this.handleKeyDown}),slot:t,attrs:this.$attrs,slots:this.$slots,name:"DisclosureButton"})},setup:function(e){var t=J("DisclosureButton");return{id:"headlessui-disclosure-button-"+p(),ariaControls:o.computed((function(){var e,n;return null!=(e=null==(n=Y(t.panelRef))?void 0:n.id)?e:void 0})),handleClick:function(){e.disabled||t.toggleDisclosure()},handleKeyDown:function(o){if(!e.disabled)switch(o.key){case n.Space:case n.Enter:o.preventDefault(),t.toggleDisclosure()}}}}}),ne=o.defineComponent({name:"DisclosurePanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var t={open:J("DisclosurePanel").disclosureState.value===V.Open};return s({props:r({},this.$props,{id:this.id,ref:"el"}),slot:t,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:t.open,name:"DisclosurePanel"})},setup:function(){var e=J("DisclosurePanel");return{id:"headlessui-disclosure-panel-"+p(),el:e.panelRef}}}),oe=o.defineComponent({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null}},render:function(){return s({props:r({},i(this.$props,["initialFocus"]),{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"FocusTrap"})},setup:function(e){var t=o.ref(new Set),n=o.ref(null),r=o.ref(!0),i=o.computed((function(){return{initialFocus:e.initialFocus}}));return o.onMounted((function(){n.value&&(t.value.add(n.value),O(t,r,i))})),o.onUnmounted((function(){r.value=!1})),{el:n}}});function re(e,t){var n=t.resolveItems();if(n.length<=0)return null;var o=t.resolveActiveIndex(),r=null!=o?o:-1,i=function(){switch(e.focus){case X.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case X.Previous:var o=n.slice().reverse().findIndex((function(e,n,o){return!(-1!==r&&o.length-n-1>=r||t.resolveDisabled(e))}));return-1===o?o:n.length-1-o;case X.Next:return n.findIndex((function(e,n){return!(n<=r||t.resolveDisabled(e))}));case X.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case X.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case X.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?o:i}function ie(e,t){if(void 0!==e)return"function"==typeof e?e(t):e}!function(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"}(X||(X={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Z||(Z={}));var ae=Symbol("ListboxContext");function le(e){var t=o.inject(ae,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Listbox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,le),n}return t}var ue,se=o.defineComponent({name:"Listbox",emits:["update:modelValue"],props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean],default:null}},setup:function(e,t){var n=t.slots,r=t.attrs,a=t.emit,l=e.disabled,u=i(e,["modelValue","disabled"]),c=o.ref(Z.Closed),d=o.ref(null),p=o.ref(null),v=o.ref(null),f=o.ref([]),m=o.ref(""),h=o.ref(null),b=o.computed((function(){return e.modelValue})),g={listboxState:c,value:b,labelRef:d,buttonRef:p,optionsRef:v,disabled:l,options:f,searchQuery:m,activeOptionIndex:h,closeListbox:function(){l||c.value!==Z.Closed&&(c.value=Z.Closed,h.value=null)},openListbox:function(){l||c.value!==Z.Open&&(c.value=Z.Open)},goToOption:function(e,t){if(!l&&c.value!==Z.Closed){var n=re(e===X.Specific?{focus:X.Specific,id:t}:{focus:e},{resolveItems:function(){return f.value},resolveActiveIndex:function(){return h.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===m.value&&h.value===n||(m.value="",h.value=n)}},search:function(e){if(!l&&c.value!==Z.Closed){m.value+=e;var t=f.value.findIndex((function(e){return!e.dataRef.disabled&&e.dataRef.textValue.startsWith(m.value)}));-1!==t&&t!==h.value&&(h.value=t)}},clearSearch:function(){l||c.value!==Z.Closed&&""!==m.value&&(m.value="")},registerOption:function(e,t){f.value.push({id:e,dataRef:t})},unregisterOption:function(e){var t=f.value.slice(),n=null!==h.value?t[h.value]:null,o=t.findIndex((function(t){return t.id===e}));-1!==o&&t.splice(o,1),f.value=t,h.value=o===h.value||null===n?null:t.indexOf(n)},select:function(e){l||a("update:modelValue",e)}};return x("mousedown",(function(e){var t,n,o,r=e.target,i=document.activeElement;c.value===Z.Open&&((null==(t=Y(p))?void 0:t.contains(r))||((null==(n=Y(v))?void 0:n.contains(r))||g.closeListbox(),i!==document.body&&(null==i?void 0:i.contains(r))||e.defaultPrevented||null==(o=Y(p))||o.focus({preventScroll:!0})))})),o.provide(ae,g),function(){return s({props:u,slot:{open:c.value===Z.Open,disabled:l},slots:n,attrs:r,name:"Listbox"})}}}),ce=o.defineComponent({name:"ListboxLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){var e=le("ListboxLabel"),t={open:e.listboxState.value===Z.Open,disabled:e.disabled};return s({props:r({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:t,attrs:this.$attrs,slots:this.$slots,name:"ListboxLabel"})},setup:function(){var e=le("ListboxLabel");return{id:"headlessui-listbox-label-"+p(),el:e.labelRef,handleClick:function(){var t;null==(t=Y(e.buttonRef))||t.focus({preventScroll:!0})}}}}),de=o.defineComponent({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"}},render:function(){var e,t,n=le("ListboxButton"),o={open:n.listboxState.value===Z.Open,disabled:n.disabled},i={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=Y(n.optionsRef))?void 0:e.id,"aria-expanded":n.listboxState.value===Z.Open||void 0,"aria-labelledby":n.labelRef.value?[null==(t=Y(n.labelRef))?void 0:t.id,this.id].join(" "):void 0,disabled:n.disabled,onKeydown:this.handleKeyDown,onClick:this.handleClick};return s({props:r({},this.$props,i),slot:o,attrs:this.$attrs,slots:this.$slots,name:"ListboxButton"})},setup:function(){var e=le("ListboxButton");return{id:"headlessui-listbox-button-"+p(),el:e.buttonRef,handleKeyDown:function(t){switch(t.key){case n.Space:case n.Enter:case n.ArrowDown:t.preventDefault(),e.openListbox(),o.nextTick((function(){var t;null==(t=Y(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(X.First)}));break;case n.ArrowUp:t.preventDefault(),e.openListbox(),o.nextTick((function(){var t;null==(t=Y(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(X.Last)}))}},handleClick:function(t){var n;e.disabled||(e.listboxState.value===Z.Open?(e.closeListbox(),o.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}))):(t.preventDefault(),e.openListbox(),n=function(){var t;return null==(t=Y(e.optionsRef))?void 0:t.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(n)}))))}}}}),pe=o.defineComponent({name:"ListboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var t,n,o,i,a=le("ListboxOptions"),l={open:a.listboxState.value===Z.Open},u={"aria-activedescendant":null===a.activeOptionIndex.value||null==(t=a.options.value[a.activeOptionIndex.value])?void 0:t.id,"aria-labelledby":null!=(n=null==(o=Y(a.labelRef))?void 0:o.id)?n:null==(i=Y(a.buttonRef))?void 0:i.id,id:this.id,onKeydown:this.handleKeyDown,role:"listbox",tabIndex:0,ref:"el"};return s({props:r({},this.$props,u),slot:l,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:l.open,name:"ListboxOptions"})},setup:function(){var e=le("ListboxOptions"),t="headlessui-listbox-options-"+p(),r=o.ref(null);return{id:t,el:e.optionsRef,handleKeyDown:function(t){switch(r.value&&clearTimeout(r.value),t.key){case n.Space:if(""!==e.searchQuery.value)return t.preventDefault(),t.stopPropagation(),e.search(t.key);case n.Enter:t.preventDefault(),t.stopPropagation(),null!==e.activeOptionIndex.value&&e.select(e.options.value[e.activeOptionIndex.value].dataRef.value),e.closeListbox(),o.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case n.ArrowDown:return t.preventDefault(),t.stopPropagation(),e.goToOption(X.Next);case n.ArrowUp:return t.preventDefault(),t.stopPropagation(),e.goToOption(X.Previous);case n.Home:case n.PageUp:return t.preventDefault(),t.stopPropagation(),e.goToOption(X.First);case n.End:case n.PageDown:return t.preventDefault(),t.stopPropagation(),e.goToOption(X.Last);case n.Escape:t.preventDefault(),t.stopPropagation(),e.closeListbox(),o.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case n.Tab:t.preventDefault(),t.stopPropagation();break;default:1===t.key.length&&(e.search(t.key),r.value=setTimeout((function(){return e.clearSearch()}),350))}}}}}),ve=o.defineComponent({name:"ListboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String],default:null},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},setup:function(e,t){var n=t.slots,i=t.attrs,a=le("ListboxOption"),l="headlessui-listbox-option-"+p(),u=e.disabled,c=e.className,d=void 0===c?e.class:c,v=e.value,f=o.computed((function(){return null!==a.activeOptionIndex.value&&a.options.value[a.activeOptionIndex.value].id===l})),m=o.computed((function(){return o.toRaw(a.value.value)===o.toRaw(v)})),h=o.ref({disabled:u,value:v,textValue:""});function b(e){if(u)return e.preventDefault();a.select(v),a.closeListbox(),o.nextTick((function(){var e;return null==(e=Y(a.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function g(){if(u)return a.goToOption(X.Nothing);a.goToOption(X.Specific,l)}function y(){u||f.value||a.goToOption(X.Specific,l)}function S(){u||f.value&&a.goToOption(X.Nothing)}return o.onMounted((function(){var e,t,n=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(h.value.textValue=n)})),o.onMounted((function(){return a.registerOption(l,h)})),o.onUnmounted((function(){return a.unregisterOption(l)})),o.onMounted((function(){o.watch([a.listboxState,m],(function(){var e;a.listboxState.value===Z.Open&&m.value&&(a.goToOption(X.Specific,l),null==(e=document.getElementById(l))||null==e.focus||e.focus())}),{immediate:!0})})),o.watchEffect((function(){a.listboxState.value===Z.Open&&f.value&&o.nextTick((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:f.value,selected:m.value,disabled:u},o={id:l,role:"option",tabIndex:-1,class:ie(d,t),"aria-disabled":!0===u||void 0,"aria-selected":!0===m.value?m.value:void 0,onClick:b,onFocus:g,onPointermove:y,onMousemove:y,onPointerleave:S,onMouseleave:S};return s({props:r({},e,o),slot:t,attrs:i,slots:n,name:"ListboxOption"})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ue||(ue={}));var fe=Symbol("MenuContext");function me(e){var t=o.inject(fe,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Menu /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,me),n}return t}var he,be=o.defineComponent({name:"Menu",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var n=t.slots,r=t.attrs,i=o.ref(ue.Closed),a=o.ref(null),l=o.ref(null),u=o.ref([]),c=o.ref(""),d=o.ref(null),p={menuState:i,buttonRef:a,itemsRef:l,items:u,searchQuery:c,activeItemIndex:d,closeMenu:function(){i.value=ue.Closed,d.value=null},openMenu:function(){return i.value=ue.Open},goToItem:function(e,t){var n=re(e===X.Specific?{focus:X.Specific,id:t}:{focus:e},{resolveItems:function(){return u.value},resolveActiveIndex:function(){return d.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===c.value&&d.value===n||(c.value="",d.value=n)},search:function(e){c.value+=e;var t=u.value.findIndex((function(e){return e.dataRef.textValue.startsWith(c.value)&&!e.dataRef.disabled}));-1!==t&&t!==d.value&&(d.value=t)},clearSearch:function(){c.value=""},registerItem:function(e,t){u.value.push({id:e,dataRef:t})},unregisterItem:function(e){var t=u.value.slice(),n=null!==d.value?t[d.value]:null,o=t.findIndex((function(t){return t.id===e}));-1!==o&&t.splice(o,1),u.value=t,d.value=o===d.value||null===n?null:t.indexOf(n)}};return x("mousedown",(function(e){var t,n,o,r=e.target,u=document.activeElement;i.value===ue.Open&&((null==(t=Y(a))?void 0:t.contains(r))||((null==(n=Y(l))?void 0:n.contains(r))||p.closeMenu(),u!==document.body&&(null==u?void 0:u.contains(r))||e.defaultPrevented||null==(o=Y(a))||o.focus({preventScroll:!0})))})),o.provide(fe,p),function(){return s({props:e,slot:{open:i.value===ue.Open},slots:n,attrs:r,name:"Menu"})}}}),ge=o.defineComponent({name:"MenuButton",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"}},render:function(){var e,t=me("MenuButton"),n={open:t.menuState.value===ue.Open},o={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=Y(t.itemsRef))?void 0:e.id,"aria-expanded":t.menuState.value===ue.Open||void 0,onKeydown:this.handleKeyDown,onClick:this.handleClick};return s({props:r({},this.$props,o),slot:n,attrs:this.$attrs,slots:this.$slots,name:"MenuButton"})},setup:function(e){var t=me("MenuButton");return{id:"headlessui-menu-button-"+p(),el:t.buttonRef,handleKeyDown:function(e){switch(e.key){case n.Space:case n.Enter:case n.ArrowDown:e.preventDefault(),e.stopPropagation(),t.openMenu(),o.nextTick((function(){var e;null==(e=Y(t.itemsRef))||e.focus({preventScroll:!0}),t.goToItem(X.First)}));break;case n.ArrowUp:e.preventDefault(),e.stopPropagation(),t.openMenu(),o.nextTick((function(){var e;null==(e=Y(t.itemsRef))||e.focus({preventScroll:!0}),t.goToItem(X.Last)}))}},handleClick:function(n){var r;e.disabled||(t.menuState.value===ue.Open?(t.closeMenu(),o.nextTick((function(){var e;return null==(e=Y(t.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(n.preventDefault(),n.stopPropagation(),t.openMenu(),r=function(){var e;return null==(e=Y(t.itemsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(r)}))))}}}}),ye=o.defineComponent({name:"MenuItems",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var t,n,o=me("MenuItems"),i={open:o.menuState.value===ue.Open},a={"aria-activedescendant":null===o.activeItemIndex.value||null==(t=o.items.value[o.activeItemIndex.value])?void 0:t.id,"aria-labelledby":null==(n=Y(o.buttonRef))?void 0:n.id,id:this.id,onKeydown:this.handleKeyDown,role:"menu",tabIndex:0,ref:"el"};return s({props:r({},this.$props,a),slot:i,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:i.open,name:"MenuItems"})},setup:function(){var e=me("MenuItems"),t="headlessui-menu-items-"+p(),r=o.ref(null);return o.watchEffect((function(){var t=Y(e.itemsRef);if(t&&e.menuState.value===ue.Open)for(var n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});n.nextNode();)n.currentNode.setAttribute("role","none")})),{id:t,el:e.itemsRef,handleKeyDown:function(t){switch(r.value&&clearTimeout(r.value),t.key){case n.Space:if(""!==e.searchQuery.value)return t.preventDefault(),t.stopPropagation(),e.search(t.key);case n.Enter:var i;t.preventDefault(),t.stopPropagation(),null!==e.activeItemIndex.value&&(null==(i=document.getElementById(e.items.value[e.activeItemIndex.value].id))||i.click()),e.closeMenu(),o.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case n.ArrowDown:return t.preventDefault(),t.stopPropagation(),e.goToItem(X.Next);case n.ArrowUp:return t.preventDefault(),t.stopPropagation(),e.goToItem(X.Previous);case n.Home:case n.PageUp:return t.preventDefault(),t.stopPropagation(),e.goToItem(X.First);case n.End:case n.PageDown:return t.preventDefault(),t.stopPropagation(),e.goToItem(X.Last);case n.Escape:t.preventDefault(),t.stopPropagation(),e.closeMenu(),o.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case n.Tab:t.preventDefault(),t.stopPropagation();break;default:1===t.key.length&&(e.search(t.key),r.value=setTimeout((function(){return e.clearSearch()}),350))}}}}}),Se=o.defineComponent({name:"MenuItem",props:{as:{type:[Object,String],default:"template"},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},setup:function(e,t){var n=t.slots,i=t.attrs,a=me("MenuItem"),l="headlessui-menu-item-"+p(),u=e.disabled,c=e.className,d=void 0===c?e.class:c,v=o.computed((function(){return null!==a.activeItemIndex.value&&a.items.value[a.activeItemIndex.value].id===l})),f=o.ref({disabled:u,textValue:""});function m(e){if(u)return e.preventDefault();a.closeMenu(),o.nextTick((function(){var e;return null==(e=Y(a.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function h(){if(u)return a.goToItem(X.Nothing);a.goToItem(X.Specific,l)}function b(){u||v.value||a.goToItem(X.Specific,l)}function g(){u||v.value&&a.goToItem(X.Nothing)}return o.onMounted((function(){var e,t,n=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(f.value.textValue=n)})),o.onMounted((function(){return a.registerItem(l,f)})),o.onUnmounted((function(){return a.unregisterItem(l)})),o.watchEffect((function(){a.menuState.value===ue.Open&&v.value&&o.nextTick((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:v.value,disabled:u},o={id:l,role:"menuitem",tabIndex:-1,class:ie(d,t),"aria-disabled":!0===u||void 0,onClick:m,onFocus:h,onPointermove:b,onMousemove:b,onPointerleave:g,onMouseleave:g};return s({props:r({},e,o),slot:t,attrs:i,slots:n,name:"MenuItem"})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(he||(he={}));var xe=Symbol("PopoverContext");function we(e){var t=o.inject(xe,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Pe.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,we),n}return t}var Oe=Symbol("PopoverGroupContext");function Ee(){return o.inject(Oe,null)}var Ce=Symbol("PopoverPanelContext"),Pe=o.defineComponent({name:"Popover",props:{as:{type:[Object,String],default:"div"}},setup:function(e,t){var n=t.slots,i=t.attrs,a=r({},e),l="headlessui-popover-button-"+p(),c="headlessui-popover-panel-"+p(),d=o.ref(he.Closed),v=o.ref(null),f=o.ref(null),m={popoverState:d,buttonId:l,panelId:c,panel:f,button:v,togglePopover:function(){var e;d.value=u(d.value,((e={})[he.Open]=he.Closed,e[he.Closed]=he.Open,e))},closePopover:function(){d.value!==he.Closed&&(d.value=he.Closed)}};o.provide(xe,m);var g={buttonId:l,panelId:c,close:function(){m.closePopover()}},y=Ee(),S=null==y?void 0:y.registerPopover;return o.watchEffect((function(){return null==S?void 0:S(g)})),x("focus",(function(){var e,t,n;d.value===he.Open&&((null!=(e=null==y?void 0:y.isFocusWithinPopoverGroup())?e:(null==(t=Y(v))?void 0:t.contains(document.activeElement))||(null==(n=Y(f))?void 0:n.contains(document.activeElement)))||v&&f&&m.closePopover())}),!0),x("mousedown",(function(e){var t,n,o,r,i,a,l=e.target;d.value===he.Open&&((null==(t=Y(v))?void 0:t.contains(l))||(null==(n=Y(f))?void 0:n.contains(l))||(m.closePopover(),void 0===(i=h.Loose)&&(i=h.Strict),(r=l)!==document.body&&u(i,((a={})[h.Strict]=function(){return r.matches(b)},a[h.Loose]=function(){for(var e=r;null!==e;){if(e.matches(b))return!0;e=e.parentElement}return!1},a))||(e.preventDefault(),null==(o=Y(v))||o.focus())))})),function(){return s({props:a,slot:{open:d.value===he.Open},slots:n,attrs:i,name:"Popover"})}}}),De=o.defineComponent({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=we("PopoverButton"),t={open:e.popoverState.value===he.Open},n=this.isWithinPanel?{type:"button",onKeydown:this.handleKeyDown,onClick:this.handleClick}:{ref:"el",id:e.buttonId,type:"button","aria-expanded":e.popoverState.value===he.Open||void 0,"aria-controls":Y(e.panel)?e.panelId:void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return s({props:r({},this.$props,n),slot:t,attrs:this.$attrs,slots:this.$slots,name:"PopoverButton"})},setup:function(e){var t=we("PopoverButton"),r=Ee(),i=null==r?void 0:r.closeOthers,a=o.inject(Ce,null),l=null!==a&&a===t.panelId,u=o.ref(null),s=o.ref("undefined"==typeof window?null:document.activeElement);return x("focus",(function(){s.value=u.value,u.value=document.activeElement}),!0),{isWithinPanel:l,el:l?null:t.button,handleKeyDown:function(e){var o,r;if(l){if(t.popoverState.value===he.Closed)return;switch(e.key){case n.Space:case n.Enter:e.preventDefault(),e.stopPropagation(),t.closePopover(),null==(o=Y(t.button))||o.focus()}}else switch(e.key){case n.Space:case n.Enter:e.preventDefault(),e.stopPropagation(),t.popoverState.value===he.Closed&&(null==i||i(t.buttonId)),t.togglePopover();break;case n.Escape:if(t.popoverState.value!==he.Open)return null==i?void 0:i(t.buttonId);if(!Y(t.button))return;if(!(null==(r=Y(t.button))?void 0:r.contains(document.activeElement)))return;t.closePopover();break;case n.Tab:if(t.popoverState.value!==he.Open)return;if(!t.panel)return;if(!t.button)return;if(e.shiftKey){var a,u;if(!s.value)return;if(null==(a=Y(t.button))?void 0:a.contains(s.value))return;if(null==(u=Y(t.panel))?void 0:u.contains(s.value))return;var c=g(),d=c.indexOf(s.value);if(c.indexOf(Y(t.button))>d)return;e.preventDefault(),e.stopPropagation(),S(Y(t.panel),v.Last)}else e.preventDefault(),e.stopPropagation(),S(Y(t.panel),v.First)}},handleKeyUp:function(e){var o,r;if(!l&&t.popoverState.value===he.Open&&t.panel&&t.button)switch(e.key){case n.Tab:if(!s.value)return;if(null==(o=Y(t.button))?void 0:o.contains(s.value))return;if(null==(r=Y(t.panel))?void 0:r.contains(s.value))return;var i=g(),a=i.indexOf(s.value);if(i.indexOf(Y(t.button))>a)return;e.preventDefault(),e.stopPropagation(),S(Y(t.panel),v.Last)}},handleClick:function(){var n,o;e.disabled||(l?(t.closePopover(),null==(n=Y(t.button))||n.focus()):(t.popoverState.value===he.Closed&&(null==i||i(t.buttonId)),null==(o=Y(t.button))||o.focus(),t.togglePopover()))},handleFocus:function(){}}}}),ke=o.defineComponent({name:"PopoverOverlay",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var t={open:we("PopoverOverlay").popoverState.value===he.Open};return s({props:r({},this.$props,{id:this.id,ref:"el","aria-hidden":!0,onClick:this.handleClick}),slot:t,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:t.open,name:"PopoverOverlay"})},setup:function(){var e=we("PopoverOverlay");return{id:"headlessui-popover-overlay-"+p(),handleClick:function(){e.closePopover()}}}}),Ie=o.defineComponent({name:"PopoverPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},focus:{type:Boolean,default:!1}},render:function(){var t={open:we("PopoverPanel").popoverState.value===he.Open};return s({props:r({},this.$props,{ref:"el",id:this.id,onKeydown:this.handleKeyDown}),slot:t,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:t.open,name:"PopoverPanel"})},setup:function(e){var t=e.focus,r=we("PopoverPanel");return o.provide(Ce,r.panelId),o.onUnmounted((function(){r.panel.value=null})),o.watchEffect((function(){var e;if(t&&r.popoverState.value===he.Open&&r.panel){var n=document.activeElement;(null==(e=Y(r.panel))?void 0:e.contains(n))||S(Y(r.panel),v.First)}})),x("keydown",(function(e){var t;if(r.popoverState.value===he.Open&&Y(r.panel)&&e.key===n.Tab&&document.activeElement&&(null==(t=Y(r.panel))?void 0:t.contains(document.activeElement))){e.preventDefault();var o,i=S(Y(r.panel),e.shiftKey?v.Previous:v.Next);if(i===f.Underflow)return null==(o=Y(r.button))?void 0:o.focus();if(i===f.Overflow){if(!Y(r.button))return;var a=g(),l=a.indexOf(Y(r.button));S(a.splice(l+1).filter((function(e){var t;return!(null==(t=Y(r.panel))?void 0:t.contains(e))})),v.First)===f.Error&&S(document.body,v.First)}}})),x("focus",(function(){var e;t&&r.popoverState.value===he.Open&&Y(r.panel)&&((null==(e=Y(r.panel))?void 0:e.contains(document.activeElement))||r.closePopover())}),!0),{id:r.panelId,el:r.panel,handleKeyDown:function(e){var t,o;switch(e.key){case n.Escape:if(r.popoverState.value!==he.Open)return;if(!Y(r.panel))return;if(!(null==(t=Y(r.panel))?void 0:t.contains(document.activeElement)))return;e.preventDefault(),r.closePopover(),null==(o=Y(r.button))||o.focus()}}}}}),Re=o.defineComponent({name:"PopoverGroup",props:{as:{type:[Object,String],default:"div"}},render:function(){return s({props:r({},this.$props,{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"PopoverGroup"})},setup:function(){var e=o.ref(null),t=o.ref([]);function n(e){var n=t.value.indexOf(e);-1!==n&&t.value.splice(n,1)}return o.provide(Oe,{registerPopover:function(e){return t.value.push(e),function(){n(e)}},unregisterPopover:n,isFocusWithinPopoverGroup:function(){var n,o=document.activeElement;return!!(null==(n=Y(e))?void 0:n.contains(o))||t.value.some((function(e){var t,n;return(null==(t=document.getElementById(e.buttonId))?void 0:t.contains(o))||(null==(n=document.getElementById(e.panelId))?void 0:n.contains(o))}))},closeOthers:function(e){for(var n,o=l(t.value);!(n=o()).done;){var r=n.value;r.buttonId!==e&&r.close()}}}),{el:e}}}),Te=Symbol("LabelContext");function Le(){var e=o.ref([]);return[o.computed((function(){return e.value.length>0?e.value.join(" "):void 0})),o.defineComponent({name:"LabelProvider",setup:function(t,n){var r=n.slots;return o.provide(Te,{register:function(t){return e.value.push(t),function(){var n=e.value.indexOf(t);-1!==n&&e.value.splice(n,1)}}}),function(){return r.default()}}})]}var je=o.defineComponent({name:"Label",props:{as:{type:[Object,String],default:"label"}},render:function(){return s({props:r({},this.$props,{id:this.id}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"Label"})},setup:function(){var e=o.inject(Te,{register:function(){return function(){}}}).register,t="headlessui-label-"+p();return o.onMounted((function(){return o.onUnmounted(e(t))})),{id:t}}}),Fe=Symbol("RadioGroupContext");function Ae(e){var t=o.inject(Fe,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <RadioGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ae),n}return t}var $e,Be=o.defineComponent({name:"RadioGroup",emits:["update:modelValue"],props:{as:{type:[Object,String],default:"div"},disabled:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean]}},render:function(){var e=this,t=i(this.$props,["modelValue","disabled"]),n={ref:"el",id:this.id,role:"radiogroup","aria-labelledby":this.labelledby,"aria-describedby":this.describedby};return o.h(this.DescriptionProvider,(function(){return[o.h(e.LabelProvider,(function(){return[s({props:r({},t,n),slot:{},attrs:e.$attrs,slots:e.$slots,name:"RadioGroup"})]}))]}))},setup:function(e,t){var r=t.emit,i=o.ref(null),a=o.ref([]),l=Le(),u=l[0],s=l[1],c=N(),d=c[0],m=c[1],h=o.computed((function(){return e.modelValue})),b={options:a,value:h,change:function(t){e.disabled||h.value!==t&&r("update:modelValue",t)},registerOption:function(e){var t,n=Array.from(null==(t=i.value)?void 0:t.querySelectorAll('[id^="headlessui-radiogroup-option-"]')).reduce((function(e,t,n){var o;return Object.assign(e,((o={})[t.id]=n,o))}),{});a.value.push(e),a.value.sort((function(e,t){return n[e.id]-n[t.id]}))},unregisterOption:function(e){var t=a.value.findIndex((function(t){return t.id===e}));-1!==t&&a.value.splice(t,1)}};return o.provide(Fe,b),o.watchEffect((function(){var e=Y(i);if(e)for(var t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});t.nextNode();)t.currentNode.setAttribute("role","none")})),x("keydown",(function(e){if(i.value&&i.value.contains(e.target))switch(e.key){case n.ArrowLeft:case n.ArrowUp:if(e.preventDefault(),e.stopPropagation(),S(a.value.map((function(e){return e.element})),v.Previous|v.WrapAround)===f.Success){var t=a.value.find((function(e){return e.element===document.activeElement}));t&&b.change(t.propsRef.value)}break;case n.ArrowRight:case n.ArrowDown:if(e.preventDefault(),e.stopPropagation(),S(a.value.map((function(e){return e.element})),v.Next|v.WrapAround)===f.Success){var o=a.value.find((function(e){return e.element===document.activeElement}));o&&b.change(o.propsRef.value)}break;case n.Space:e.preventDefault(),e.stopPropagation();var r=a.value.find((function(e){return e.element===document.activeElement}));r&&b.change(r.propsRef.value)}})),{id:"headlessui-radiogroup-"+p(),labelledby:u,describedby:d,el:i,LabelProvider:s,DescriptionProvider:m}}});!function(e){e[e.Empty=1]="Empty",e[e.Active=2]="Active"}($e||($e={}));var Ne=o.defineComponent({name:"RadioGroupOption",props:{as:{type:[Object,String],default:"div"},value:{type:[Object,String]},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},render:function(){var e,t,n=this,a=this.$props,l=a.className,u=void 0===l?a.class:l,c=i(a,["value","disabled","class","className"]),d=Ae("RadioGroupOption"),p=(null==(e=d.options.value)||null==(t=e[0])?void 0:t.id)===this.id,v={checked:this.checked,active:Boolean(this.state&$e.Active)},f={id:this.id,ref:"el",role:"radio",class:ie(u,v),"aria-checked":this.checked?"true":"false","aria-labelledby":this.labelledby,"aria-describedby":this.describedby,tabIndex:this.checked||void 0===d.value.value&&p?0:-1,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur};return o.h(this.DescriptionProvider,(function(){return[o.h(n.LabelProvider,(function(){return[s({props:r({},c,f),slot:v,attrs:n.$attrs,slots:n.$slots,name:"RadioGroupOption"})]}))]}))},setup:function(e){var t=Ae("RadioGroupOption"),n="headlessui-radiogroup-option-"+p(),r=Le(),i=r[0],a=r[1],l=N(),u=l[0],s=l[1],c=o.ref(null),d=o.computed((function(){return{value:e.value}})),v=o.ref($e.Empty);return o.onMounted((function(){return t.registerOption({id:n,element:c,propsRef:d})})),o.onUnmounted((function(){return t.unregisterOption(n)})),{id:n,el:c,labelledby:i,describedby:u,state:v,LabelProvider:a,DescriptionProvider:s,checked:o.computed((function(){return o.toRaw(t.value.value)===o.toRaw(e.value)})),handleClick:function(){var n,o=e.value;t.value.value!==o&&(v.value|=$e.Active,t.change(o),null==(n=c.value)||n.focus())},handleFocus:function(){v.value|=$e.Active},handleBlur:function(){v.value&=~$e.Active}}}}),Me=je,Ue=U,Ke=Symbol("GroupContext");function Ge(e){var t=o.inject(Ke,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <SwitchGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ge),n}return t}var Ve=o.defineComponent({name:"SwitchGroup",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var n=t.slots,r=t.attrs,i=o.ref(null),a=o.ref(null),l=o.ref(null);return o.provide(Ke,{switchRef:i,labelRef:a,descriptionRef:l}),function(){return s({props:e,slot:{},slots:n,attrs:r,name:"SwitchGroup"})}}}),We=o.defineComponent({name:"Switch",emits:["update:modelValue"],props:{as:{type:[Object,String],default:"button"},modelValue:{type:[Object,Boolean],default:null},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},render:function(){var e=o.inject(Ke,null),t=this.$props,n=t.className,i=void 0===n?t.class:n,a=o.computed((function(){var t;return null==(t=Y(null==e?void 0:e.labelRef))?void 0:t.id})),l=o.computed((function(){var t;return null==(t=Y(null==e?void 0:e.descriptionRef))?void 0:t.id})),u={checked:this.$props.modelValue},c={id:this.id,ref:null===e?void 0:e.switchRef,role:"switch",tabIndex:0,class:ie(i,u),"aria-checked":this.$props.modelValue,"aria-labelledby":a.value,"aria-describedby":l.value,onClick:this.handleClick,onKeyup:this.handleKeyUp,onKeypress:this.handleKeyPress};return"button"===this.$props.as&&Object.assign(c,{type:"button"}),s({props:r({},this.$props,c),slot:u,attrs:this.$attrs,slots:this.$slots,name:"Switch"})},setup:function(e,t){var r=t.emit,i=o.inject(Ke,null);function a(){r("update:modelValue",!e.modelValue)}return{id:"headlessui-switch-"+p(),el:null==i?void 0:i.switchRef,handleClick:function(e){e.preventDefault(),a()},handleKeyUp:function(e){e.key!==n.Tab&&e.preventDefault(),e.key===n.Space&&a()},handleKeyPress:function(e){e.preventDefault()}}}}),qe=o.defineComponent({name:"SwitchLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){return s({props:r({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"SwitchLabel"})},setup:function(){var e=Ge("SwitchLabel");return{id:"headlessui-switch-label-"+p(),el:e.labelRef,handleClick:function(){var t=Y(e.switchRef);null==t||t.click(),null==t||t.focus({preventScroll:!0})}}}}),He=o.defineComponent({name:"SwitchDescription",props:{as:{type:[Object,String],default:"p"}},render:function(){return s({props:r({},this.$props,{id:this.id,ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"SwitchDescription"})},setup:function(){var e=Ge("SwitchDescription");return{id:"headlessui-switch-description-"+p(),el:e.descriptionRef}}});exports.Dialog=q,exports.DialogDescription=z,exports.DialogOverlay=H,exports.DialogTitle=_,exports.Disclosure=ee,exports.DisclosureButton=te,exports.DisclosurePanel=ne,exports.FocusTrap=oe,exports.Listbox=se,exports.ListboxButton=de,exports.ListboxLabel=ce,exports.ListboxOption=ve,exports.ListboxOptions=pe,exports.Menu=be,exports.MenuButton=ge,exports.MenuItem=Se,exports.MenuItems=ye,exports.Popover=Pe,exports.PopoverButton=De,exports.PopoverGroup=Re,exports.PopoverOverlay=ke,exports.PopoverPanel=Ie,exports.Portal=F,exports.PortalGroup=$,exports.RadioGroup=Be,exports.RadioGroupDescription=Ue,exports.RadioGroupLabel=Me,exports.RadioGroupOption=Ne,exports.Switch=We,exports.SwitchDescription=He,exports.SwitchGroup=Ve,exports.SwitchLabel=qe; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,n,o=require("vue");function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function a(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t.indexOf(n=a[o])>=0||(r[n]=e[n]);return r}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function l(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function u(e,t){if(e in t){for(var n=t[e],o=arguments.length,r=new Array(o>2?o-2:0),a=2;a<o;a++)r[a-2]=arguments[a];return"function"==typeof n?n.apply(void 0,r):n}var i=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(i,u),i}function s(n){var o,i,l=n.visible,s=void 0===l||l,p=n.features,d=void 0===p?e.None:p,v=a(n,["visible","features"]);return s||d&e.Static&&v.props.static?c(v):d&e.RenderStrategy?u(null==(o=v.props.unmount)||o?t.Unmount:t.Hidden,((i={})[t.Unmount]=function(){return null},i[t.Hidden]=function(){return c(r({},v,{props:r({},v.props,{hidden:!0,style:{display:"none"}})}))},i)):c(v)}function c(e){var t,n=e.attrs,r=e.slots,i=e.slot,u=e.name,s=function(e,t){void 0===t&&(t=[]);for(var n,o=Object.assign({},e),r=l(t);!(n=r()).done;){var a=n.value;a in o&&delete o[a]}return o}(e.props,["unmount","static"]),c=s.as,p=a(s,["as"]),d=null==r.default?void 0:r.default(i);if("template"===c){if(Object.keys(p).length>0||Object.keys(n).length>0){var v=null!=d?d:[],f=v[0],m=v.slice(1);if(null==(t=f)||"string"!=typeof t.type&&"object"!=typeof t.type&&"function"!=typeof t.type||m.length>0)throw new Error(['Passing props on "template"!',"","The current component <"+u+' /> is rendering a "template".',"However we need to passthrough the following props:",Object.keys(p).concat(Object.keys(n)).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return o.cloneVNode(f,p)}return d}return o.h(c,p,d)}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(e||(e={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(t||(t={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",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"}(n||(n={}));var p=0;function d(){return++p}var v,f,m,h,b=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function y(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(b))}function g(e){null==e||e.focus({preventScroll:!0})}function S(e,t){var n=Array.isArray(e)?e:y(e),o=document.activeElement,r=function(){if(t&(v.First|v.Next))return m.Next;if(t&(v.Previous|v.Last))return m.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=function(){if(t&v.First)return 0;if(t&v.Previous)return Math.max(0,n.indexOf(o))-1;if(t&v.Next)return Math.max(0,n.indexOf(o))+1;if(t&v.Last)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),i=t&v.NoScroll?{preventScroll:!0}:{},l=0,u=n.length,s=void 0;do{var c;if(l>=u||l+u<=0)return f.Error;var p=a+l;if(t&v.WrapAround)p=(p+u)%u;else{if(p<0)return f.Underflow;if(p>=u)return f.Overflow}null==(c=s=n[p])||c.focus(i),l+=r}while(s!==document.activeElement);return s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),f.Success}function x(e,t,n){window.addEventListener(e,t,n),o.onUnmounted((function(){return window.removeEventListener(e,t,n)}))}function w(e,t){for(var n,o=l(e);!(n=o()).done;)if(n.value.contains(t))return!0;return!1}function O(e,t,r){void 0===t&&(t=o.ref(!0)),void 0===r&&(r=o.ref({}));var a=o.ref("undefined"!=typeof window?document.activeElement:null),i=o.ref(null);function u(){if(t.value&&1===e.value.size){var n=r.value.initialFocus,o=document.activeElement;if(n){if(n===o)return}else if(w(e.value,o))return;if(a.value=o,n)g(n);else{for(var u,s=!1,c=l(e.value);!(u=c()).done;)if(S(u.value,v.First)===f.Success){s=!0;break}if(!s)throw new Error("There are no focusable elements inside the <FocusTrap />")}i.value=document.activeElement}}function s(){g(a.value),a.value=null,i.value=null}o.watchEffect(u),o.onUpdated((function(){t.value?u():s()})),o.onUnmounted(s),x("keydown",(function(o){if(t.value&&o.key===n.Tab&&document.activeElement&&1===e.value.size){o.preventDefault();for(var r,a=l(e.value);!(r=a()).done;)if(S(r.value,(o.shiftKey?v.Previous:v.Next)|v.WrapAround)===f.Success){i.value=document.activeElement;break}}})),x("focus",(function(n){if(t.value&&1===e.value.size){var o=i.value;if(o){var r=n.target;r&&r instanceof HTMLElement?w(e.value,r)?(i.value=r,g(r)):(n.preventDefault(),n.stopPropagation(),g(o)):g(i.value)}}}),!0)}!function(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"}(v||(v={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(f||(f={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(m||(m={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(h||(h={}));var E=new Set,P=new Map;function C(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function k(e){var t=P.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var D,I=Symbol("StackContext");function R(){return o.inject(I,(function(){}))}!function(e){e[e.AddElement=0]="AddElement",e[e.RemoveElement=1]="RemoveElement"}(D||(D={}));var T=o.defineComponent({name:"StackProvider",props:{onUpdate:{type:Function,default:void 0}},setup:function(e,t){var n=t.slots,r=R();return o.provide(I,(function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];null==e.onUpdate||e.onUpdate.apply(e,n),r.apply(void 0,n)})),function(){return n.default()}}}),L=Symbol("ForcePortalRootContext"),A=o.defineComponent({name:"ForcePortalRoot",props:{force:{type:Boolean,default:!1}},setup:function(e,t){var n=t.slots;return o.provide(L,e.force),function(){return n.default()}}}),F=o.defineComponent({name:"Portal",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var n=t.slots,r=t.attrs,a=o.inject(L,!1),i=o.inject(j,null),l=o.ref(!0===a||null===i?function(){var e=document.getElementById("headlessui-portal-root");if(e)return e;var t=document.createElement("div");return t.setAttribute("id","headlessui-portal-root"),document.body.appendChild(t)}():i.resolveTarget());o.watchEffect((function(){a||null!==i&&(l.value=i.resolveTarget())}));var u=o.ref(null);return function(e){var t=R();o.watchEffect((function(n){var o=null==e?void 0:e.value;o&&(t(D.AddElement,o),n((function(){return t(D.RemoveElement,o)})))}))}(u),o.onUnmounted((function(){var e,t=document.getElementById("headlessui-portal-root");t&&l.value===t&&l.value.children.length<=0&&(null==(e=l.value.parentElement)||e.removeChild(l.value))})),function(){return null===l.value?null:o.h(T,{},(function(){return[o.h(o.Teleport,{to:l.value},[o.h("div",{ref:u},[s({props:e,slot:{},attrs:r,slots:n,name:"Portal"})])])]}))}}}),j=Symbol("PortalGroupContext"),$=o.defineComponent({name:"PortalGroup",props:{as:{type:[Object,String],default:"template"},target:{type:Object,default:null}},setup:function(e,t){var n=t.attrs,r=t.slots,i=o.reactive({resolveTarget:function(){return e.target}});return o.provide(j,i),function(){return s({props:a(e,["target"]),slot:{},attrs:n,slots:r,name:"PortalGroup"})}}}),B=Symbol("DescriptionContext");function N(){var e=o.ref([]);return[o.computed((function(){return e.value.length>0?e.value.join(" "):void 0})),o.defineComponent({name:"DescriptionProvider",props:["slot","name","props"],setup:function(t,n){var r=n.slots;return o.provide(B,{register:function(t){return e.value.push(t),function(){var n=e.value.indexOf(t);-1!==n&&e.value.splice(n,1)}},slot:o.computed((function(){return t.slot})),name:o.computed((function(){return t.name})),props:o.computed((function(){return t.props}))}),function(){return r.default()}}})]}var M,K=o.defineComponent({name:"Description",props:{as:{type:[Object,String],default:"p"}},render:function(){var e=this.$props,t=r({},this.props,{id:this.id});return s({props:r({},this.props,e,t),slot:this.slot||{},attrs:this.$attrs,slots:this.$slots,name:this.name||"Description"})},setup:function(){var e=function(){var e=o.inject(B,null);if(null===e)throw new Error("Missing parent");return e}(),t=e.register,n=e.slot,r=e.name,a=e.props,i="headlessui-description-"+d();return o.onMounted((function(){return o.onUnmounted(t(i))})),{id:i,slot:n,name:r,props:a}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(M||(M={}));var U=Symbol("DialogContext");function V(e){var t=o.inject(U,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Dialog /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,V),n}return t}var G,W="DC8F892D-2EBD-447C-A4C8-A03058436FF4",q=o.defineComponent({name:"Dialog",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:Boolean,default:W},onClose:{type:Function,default:W},initialFocus:{type:Object,default:null}},render:function(){var t=this,n=r({},this.$attrs,{ref:"el",id:this.id,role:"dialog","aria-modal":this.dialogState===M.Open||void 0,"aria-labelledby":this.titleId,"aria-describedby":this.describedby}),i=this.$props,l=i.open,c=a(i,["open","onClose","initialFocus"]),p=this.containers,d={open:this.dialogState===M.Open};return o.h(T,{onUpdate:function(e,t){var n;return u(e,((n={})[D.AddElement]=function(){p.add(t)},n[D.RemoveElement]=function(){p.delete(t)},n))}},(function(){return[o.h(A,{force:!0},(function(){return[o.h(F,{},(function(){return[o.h($,{target:t.dialogRef},(function(){return[o.h(A,{force:!1},(function(){return[o.h(t.DescriptionProvider,{slot:d},(function(){return[s({props:r({},c,n),slot:d,attrs:t.$attrs,slots:t.$slots,visible:l,features:e.RenderStrategy|e.Static,name:"Dialog"})]}))]}))]}))]}))]}))]}))},setup:function(e){var t=o.ref(new Set),r=e.open!==W,a=e.onClose!==W;if(!r&&!a)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!r)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!a)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof e.open)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+(e.open===W?void 0:e.open));if("function"!=typeof e.onClose)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+(e.onClose===W?void 0:e.onClose));var i=o.computed((function(){return e.open?M.Open:M.Closed})),u=o.ref(null),s=o.ref(i.value===M.Open);o.onUpdated((function(){s.value=i.value===M.Open}));var c="headlessui-dialog-"+d(),p=o.computed((function(){return{initialFocus:e.initialFocus}}));O(t,s,p),function(e,t){void 0===t&&(t=o.ref(!0)),o.watchEffect((function(n){if(t.value&&e.value){var o=e.value;E.add(o);for(var r,a=l(P.keys());!(r=a()).done;){var i=r.value;i.contains(o)&&(k(i),P.delete(i))}document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=l(E);!(t=n()).done;)if(e.contains(t.value))return;1===E.size&&(P.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),C(e))}})),n((function(){if(E.delete(o),E.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!P.has(e)){for(var t,n=l(E);!(t=n()).done;)if(e.contains(t.value))return;P.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),C(e)}}));else for(var e,t=l(P.keys());!(e=t()).done;){var n=e.value;k(n),P.delete(n)}}))}}))}(u,s);var v=N(),f=v[0],m=v[1],h=o.ref(null),b={titleId:h,dialogState:i,setTitleId:function(e){h.value!==e&&(h.value=e)},close:function(){e.onClose(!1)}};return o.provide(U,b),x("mousedown",(function(e){var n=e.target;i.value===M.Open&&1===t.value.size&&(w(t.value,n)||(b.close(),o.nextTick((function(){null==n||n.focus()}))))})),x("keydown",(function(e){e.key===n.Escape&&i.value===M.Open&&(t.value.size>1||b.close())})),o.watchEffect((function(e){if(i.value===M.Open){var t=document.documentElement.style.overflow,n=document.documentElement.style.paddingRight,o=window.innerWidth-document.documentElement.clientWidth;document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=o+"px",e((function(){document.documentElement.style.overflow=t,document.documentElement.style.paddingRight=n}))}})),o.watchEffect((function(e){if(i.value===M.Open&&u.value){var t=new IntersectionObserver((function(e){for(var t,n=l(e);!(t=n()).done;){var o=t.value;0===o.boundingClientRect.x&&0===o.boundingClientRect.y&&0===o.boundingClientRect.width&&0===o.boundingClientRect.height&&b.close()}}));t.observe(u.value),e((function(){return t.disconnect()}))}})),{id:c,el:u,dialogRef:u,containers:t,dialogState:i,titleId:h,describedby:f,DescriptionProvider:m}}}),H=o.defineComponent({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e=V("DialogOverlay");return s({props:r({},this.$props,{ref:"el",id:this.id,"aria-hidden":!0,onClick:this.handleClick}),slot:{open:e.dialogState.value===M.Open},attrs:this.$attrs,slots:this.$slots,name:"DialogOverlay"})},setup:function(){var e=V("DialogOverlay");return{id:"headlessui-dialog-overlay-"+d(),handleClick:function(){e.close()}}}}),_=o.defineComponent({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"}},render:function(){var e=V("DialogTitle");return s({props:r({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===M.Open},attrs:this.$attrs,slots:this.$slots,name:"DialogTitle"})},setup:function(){var e=V("DialogTitle"),t="headlessui-dialog-title-"+d();return o.onMounted((function(){e.setTitleId(t),o.onUnmounted((function(){return e.setTitleId(null)}))})),{id:t}}}),z=K;function Y(e){var t;return null==e||null==e.value?null:null!=(t=e.value.$el)?t:e.value}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(G||(G={}));var Q=Symbol("DisclosureContext");function J(e){var t=o.inject(Q,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Disclosure /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,J),n}return t}var X,Z,ee=o.defineComponent({name:"Disclosure",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var n=t.slots,a=t.attrs,i=r({},e),l=o.ref(G.Closed),c=o.ref(null);return o.provide(Q,{disclosureState:l,panelRef:c,toggleDisclosure:function(){var e;l.value=u(l.value,((e={})[G.Open]=G.Closed,e[G.Closed]=G.Open,e))}}),function(){return s({props:i,slot:{open:l.value===G.Open},slots:n,attrs:a,name:"Disclosure"})}}}),te=o.defineComponent({name:"DisclosureButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=J("DisclosureButton"),t={open:e.disclosureState.value===G.Open};return s({props:r({},this.$props,{id:this.id,type:"button","aria-expanded":e.disclosureState.value===G.Open||void 0,"aria-controls":this.ariaControls,onClick:this.handleClick,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp}),slot:t,attrs:this.$attrs,slots:this.$slots,name:"DisclosureButton"})},setup:function(e){var t=J("DisclosureButton");return{id:"headlessui-disclosure-button-"+d(),ariaControls:o.computed((function(){var e,n;return null!=(e=null==(n=Y(t.panelRef))?void 0:n.id)?e:void 0})),handleClick:function(){e.disabled||t.toggleDisclosure()},handleKeyDown:function(o){if(!e.disabled)switch(o.key){case n.Space:case n.Enter:o.preventDefault(),o.stopPropagation(),t.toggleDisclosure()}},handleKeyUp:function(e){switch(e.key){case n.Space:e.preventDefault()}}}}}),ne=o.defineComponent({name:"DisclosurePanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var t={open:J("DisclosurePanel").disclosureState.value===G.Open};return s({props:r({},this.$props,{id:this.id,ref:"el"}),slot:t,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:t.open,name:"DisclosurePanel"})},setup:function(){var e=J("DisclosurePanel");return{id:"headlessui-disclosure-panel-"+d(),el:e.panelRef}}}),oe=o.defineComponent({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null}},render:function(){return s({props:r({},a(this.$props,["initialFocus"]),{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"FocusTrap"})},setup:function(e){var t=o.ref(new Set),n=o.ref(null),r=o.ref(!0),a=o.computed((function(){return{initialFocus:e.initialFocus}}));return o.onMounted((function(){n.value&&(t.value.add(n.value),O(t,r,a))})),o.onUnmounted((function(){r.value=!1})),{el:n}}});function re(e,t){var n=t.resolveItems();if(n.length<=0)return null;var o=t.resolveActiveIndex(),r=null!=o?o:-1,a=function(){switch(e.focus){case X.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case X.Previous:var o=n.slice().reverse().findIndex((function(e,n,o){return!(-1!==r&&o.length-n-1>=r||t.resolveDisabled(e))}));return-1===o?o:n.length-1-o;case X.Next:return n.findIndex((function(e,n){return!(n<=r||t.resolveDisabled(e))}));case X.Last:var a=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===a?a:n.length-1-a;case X.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case X.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===a?o:a}function ae(e,t){if(void 0!==e)return"function"==typeof e?e(t):e}!function(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"}(X||(X={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Z||(Z={}));var ie=Symbol("ListboxContext");function le(e){var t=o.inject(ie,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Listbox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,le),n}return t}var ue,se=o.defineComponent({name:"Listbox",emits:["update:modelValue"],props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean],default:null}},setup:function(e,t){var n=t.slots,r=t.attrs,i=t.emit,l=e.disabled,u=a(e,["modelValue","disabled"]),c=o.ref(Z.Closed),p=o.ref(null),d=o.ref(null),v=o.ref(null),f=o.ref([]),m=o.ref(""),h=o.ref(null),b=o.computed((function(){return e.modelValue})),y={listboxState:c,value:b,labelRef:p,buttonRef:d,optionsRef:v,disabled:l,options:f,searchQuery:m,activeOptionIndex:h,closeListbox:function(){l||c.value!==Z.Closed&&(c.value=Z.Closed,h.value=null)},openListbox:function(){l||c.value!==Z.Open&&(c.value=Z.Open)},goToOption:function(e,t){if(!l&&c.value!==Z.Closed){var n=re(e===X.Specific?{focus:X.Specific,id:t}:{focus:e},{resolveItems:function(){return f.value},resolveActiveIndex:function(){return h.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===m.value&&h.value===n||(m.value="",h.value=n)}},search:function(e){if(!l&&c.value!==Z.Closed){m.value+=e;var t=f.value.findIndex((function(e){return!e.dataRef.disabled&&e.dataRef.textValue.startsWith(m.value)}));-1!==t&&t!==h.value&&(h.value=t)}},clearSearch:function(){l||c.value!==Z.Closed&&""!==m.value&&(m.value="")},registerOption:function(e,t){f.value.push({id:e,dataRef:t})},unregisterOption:function(e){var t=f.value.slice(),n=null!==h.value?t[h.value]:null,o=t.findIndex((function(t){return t.id===e}));-1!==o&&t.splice(o,1),f.value=t,h.value=o===h.value||null===n?null:t.indexOf(n)},select:function(e){l||i("update:modelValue",e)}};return x("mousedown",(function(e){var t,n,o,r=e.target,a=document.activeElement;c.value===Z.Open&&((null==(t=Y(d))?void 0:t.contains(r))||((null==(n=Y(v))?void 0:n.contains(r))||y.closeListbox(),a!==document.body&&(null==a?void 0:a.contains(r))||e.defaultPrevented||null==(o=Y(d))||o.focus({preventScroll:!0})))})),o.provide(ie,y),function(){return s({props:u,slot:{open:c.value===Z.Open,disabled:l},slots:n,attrs:r,name:"Listbox"})}}}),ce=o.defineComponent({name:"ListboxLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){var e=le("ListboxLabel"),t={open:e.listboxState.value===Z.Open,disabled:e.disabled};return s({props:r({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:t,attrs:this.$attrs,slots:this.$slots,name:"ListboxLabel"})},setup:function(){var e=le("ListboxLabel");return{id:"headlessui-listbox-label-"+d(),el:e.labelRef,handleClick:function(){var t;null==(t=Y(e.buttonRef))||t.focus({preventScroll:!0})}}}}),pe=o.defineComponent({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"}},render:function(){var e,t,n=le("ListboxButton"),o={open:n.listboxState.value===Z.Open,disabled:n.disabled},a={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=Y(n.optionsRef))?void 0:e.id,"aria-expanded":n.listboxState.value===Z.Open||void 0,"aria-labelledby":n.labelRef.value?[null==(t=Y(n.labelRef))?void 0:t.id,this.id].join(" "):void 0,disabled:n.disabled,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return s({props:r({},this.$props,a),slot:o,attrs:this.$attrs,slots:this.$slots,name:"ListboxButton"})},setup:function(){var e=le("ListboxButton");return{id:"headlessui-listbox-button-"+d(),el:e.buttonRef,handleKeyDown:function(t){switch(t.key){case n.Space:case n.Enter:case n.ArrowDown:t.preventDefault(),e.openListbox(),o.nextTick((function(){var t;null==(t=Y(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(X.First)}));break;case n.ArrowUp:t.preventDefault(),e.openListbox(),o.nextTick((function(){var t;null==(t=Y(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(X.Last)}))}},handleKeyUp:function(e){switch(e.key){case n.Space:e.preventDefault()}},handleClick:function(t){var n;e.disabled||(e.listboxState.value===Z.Open?(e.closeListbox(),o.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}))):(t.preventDefault(),e.openListbox(),n=function(){var t;return null==(t=Y(e.optionsRef))?void 0:t.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(n)}))))}}}}),de=o.defineComponent({name:"ListboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var t,n,o,a,i=le("ListboxOptions"),l={open:i.listboxState.value===Z.Open},u={"aria-activedescendant":null===i.activeOptionIndex.value||null==(t=i.options.value[i.activeOptionIndex.value])?void 0:t.id,"aria-labelledby":null!=(n=null==(o=Y(i.labelRef))?void 0:o.id)?n:null==(a=Y(i.buttonRef))?void 0:a.id,id:this.id,onKeydown:this.handleKeyDown,role:"listbox",tabIndex:0,ref:"el"};return s({props:r({},this.$props,u),slot:l,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:l.open,name:"ListboxOptions"})},setup:function(){var e=le("ListboxOptions"),t="headlessui-listbox-options-"+d(),r=o.ref(null);return{id:t,el:e.optionsRef,handleKeyDown:function(t){switch(r.value&&clearTimeout(r.value),t.key){case n.Space:if(""!==e.searchQuery.value)return t.preventDefault(),t.stopPropagation(),e.search(t.key);case n.Enter:t.preventDefault(),t.stopPropagation(),null!==e.activeOptionIndex.value&&e.select(e.options.value[e.activeOptionIndex.value].dataRef.value),e.closeListbox(),o.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case n.ArrowDown:return t.preventDefault(),t.stopPropagation(),e.goToOption(X.Next);case n.ArrowUp:return t.preventDefault(),t.stopPropagation(),e.goToOption(X.Previous);case n.Home:case n.PageUp:return t.preventDefault(),t.stopPropagation(),e.goToOption(X.First);case n.End:case n.PageDown:return t.preventDefault(),t.stopPropagation(),e.goToOption(X.Last);case n.Escape:t.preventDefault(),t.stopPropagation(),e.closeListbox(),o.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case n.Tab:t.preventDefault(),t.stopPropagation();break;default:1===t.key.length&&(e.search(t.key),r.value=setTimeout((function(){return e.clearSearch()}),350))}}}}}),ve=o.defineComponent({name:"ListboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String],default:null},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},setup:function(e,t){var n=t.slots,a=t.attrs,i=le("ListboxOption"),l="headlessui-listbox-option-"+d(),u=e.disabled,c=e.className,p=void 0===c?e.class:c,v=e.value,f=o.computed((function(){return null!==i.activeOptionIndex.value&&i.options.value[i.activeOptionIndex.value].id===l})),m=o.computed((function(){return o.toRaw(i.value.value)===o.toRaw(v)})),h=o.ref({disabled:u,value:v,textValue:""});function b(e){if(u)return e.preventDefault();i.select(v),i.closeListbox(),o.nextTick((function(){var e;return null==(e=Y(i.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function y(){if(u)return i.goToOption(X.Nothing);i.goToOption(X.Specific,l)}function g(){u||f.value||i.goToOption(X.Specific,l)}function S(){u||f.value&&i.goToOption(X.Nothing)}return o.onMounted((function(){var e,t,n=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(h.value.textValue=n)})),o.onMounted((function(){return i.registerOption(l,h)})),o.onUnmounted((function(){return i.unregisterOption(l)})),o.onMounted((function(){o.watch([i.listboxState,m],(function(){var e;i.listboxState.value===Z.Open&&m.value&&(i.goToOption(X.Specific,l),null==(e=document.getElementById(l))||null==e.focus||e.focus())}),{immediate:!0})})),o.watchEffect((function(){i.listboxState.value===Z.Open&&f.value&&o.nextTick((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:f.value,selected:m.value,disabled:u},o={id:l,role:"option",tabIndex:-1,class:ae(p,t),"aria-disabled":!0===u||void 0,"aria-selected":!0===m.value?m.value:void 0,onClick:b,onFocus:y,onPointermove:g,onMousemove:g,onPointerleave:S,onMouseleave:S};return s({props:r({},e,o),slot:t,attrs:a,slots:n,name:"ListboxOption"})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ue||(ue={}));var fe=Symbol("MenuContext");function me(e){var t=o.inject(fe,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Menu /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,me),n}return t}var he,be=o.defineComponent({name:"Menu",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var n=t.slots,r=t.attrs,a=o.ref(ue.Closed),i=o.ref(null),l=o.ref(null),u=o.ref([]),c=o.ref(""),p=o.ref(null),d={menuState:a,buttonRef:i,itemsRef:l,items:u,searchQuery:c,activeItemIndex:p,closeMenu:function(){a.value=ue.Closed,p.value=null},openMenu:function(){return a.value=ue.Open},goToItem:function(e,t){var n=re(e===X.Specific?{focus:X.Specific,id:t}:{focus:e},{resolveItems:function(){return u.value},resolveActiveIndex:function(){return p.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===c.value&&p.value===n||(c.value="",p.value=n)},search:function(e){c.value+=e;var t=u.value.findIndex((function(e){return e.dataRef.textValue.startsWith(c.value)&&!e.dataRef.disabled}));-1!==t&&t!==p.value&&(p.value=t)},clearSearch:function(){c.value=""},registerItem:function(e,t){u.value.push({id:e,dataRef:t})},unregisterItem:function(e){var t=u.value.slice(),n=null!==p.value?t[p.value]:null,o=t.findIndex((function(t){return t.id===e}));-1!==o&&t.splice(o,1),u.value=t,p.value=o===p.value||null===n?null:t.indexOf(n)}};return x("mousedown",(function(e){var t,n,o,r=e.target,u=document.activeElement;a.value===ue.Open&&((null==(t=Y(i))?void 0:t.contains(r))||((null==(n=Y(l))?void 0:n.contains(r))||d.closeMenu(),u!==document.body&&(null==u?void 0:u.contains(r))||e.defaultPrevented||null==(o=Y(i))||o.focus({preventScroll:!0})))})),o.provide(fe,d),function(){return s({props:e,slot:{open:a.value===ue.Open},slots:n,attrs:r,name:"Menu"})}}}),ye=o.defineComponent({name:"MenuButton",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"}},render:function(){var e,t=me("MenuButton"),n={open:t.menuState.value===ue.Open},o={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=Y(t.itemsRef))?void 0:e.id,"aria-expanded":t.menuState.value===ue.Open||void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return s({props:r({},this.$props,o),slot:n,attrs:this.$attrs,slots:this.$slots,name:"MenuButton"})},setup:function(e){var t=me("MenuButton");return{id:"headlessui-menu-button-"+d(),el:t.buttonRef,handleKeyDown:function(e){switch(e.key){case n.Space:case n.Enter:case n.ArrowDown:e.preventDefault(),e.stopPropagation(),t.openMenu(),o.nextTick((function(){var e;null==(e=Y(t.itemsRef))||e.focus({preventScroll:!0}),t.goToItem(X.First)}));break;case n.ArrowUp:e.preventDefault(),e.stopPropagation(),t.openMenu(),o.nextTick((function(){var e;null==(e=Y(t.itemsRef))||e.focus({preventScroll:!0}),t.goToItem(X.Last)}))}},handleKeyUp:function(e){switch(e.key){case n.Space:e.preventDefault()}},handleClick:function(n){var r;e.disabled||(t.menuState.value===ue.Open?(t.closeMenu(),o.nextTick((function(){var e;return null==(e=Y(t.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(n.preventDefault(),n.stopPropagation(),t.openMenu(),r=function(){var e;return null==(e=Y(t.itemsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(r)}))))}}}}),ge=o.defineComponent({name:"MenuItems",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var t,n,o=me("MenuItems"),a={open:o.menuState.value===ue.Open},i={"aria-activedescendant":null===o.activeItemIndex.value||null==(t=o.items.value[o.activeItemIndex.value])?void 0:t.id,"aria-labelledby":null==(n=Y(o.buttonRef))?void 0:n.id,id:this.id,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,role:"menu",tabIndex:0,ref:"el"};return s({props:r({},this.$props,i),slot:a,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:a.open,name:"MenuItems"})},setup:function(){var e=me("MenuItems"),t="headlessui-menu-items-"+d(),r=o.ref(null);return o.watchEffect((function(){var t=Y(e.itemsRef);if(t&&e.menuState.value===ue.Open)for(var n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});n.nextNode();)n.currentNode.setAttribute("role","none")})),{id:t,el:e.itemsRef,handleKeyDown:function(t){switch(r.value&&clearTimeout(r.value),t.key){case n.Space:if(""!==e.searchQuery.value)return t.preventDefault(),t.stopPropagation(),e.search(t.key);case n.Enter:var a;t.preventDefault(),t.stopPropagation(),null!==e.activeItemIndex.value&&(null==(a=document.getElementById(e.items.value[e.activeItemIndex.value].id))||a.click()),e.closeMenu(),o.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case n.ArrowDown:return t.preventDefault(),t.stopPropagation(),e.goToItem(X.Next);case n.ArrowUp:return t.preventDefault(),t.stopPropagation(),e.goToItem(X.Previous);case n.Home:case n.PageUp:return t.preventDefault(),t.stopPropagation(),e.goToItem(X.First);case n.End:case n.PageDown:return t.preventDefault(),t.stopPropagation(),e.goToItem(X.Last);case n.Escape:t.preventDefault(),t.stopPropagation(),e.closeMenu(),o.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case n.Tab:t.preventDefault(),t.stopPropagation();break;default:1===t.key.length&&(e.search(t.key),r.value=setTimeout((function(){return e.clearSearch()}),350))}},handleKeyUp:function(e){switch(e.key){case n.Space:e.preventDefault()}}}}}),Se=o.defineComponent({name:"MenuItem",props:{as:{type:[Object,String],default:"template"},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},setup:function(e,t){var n=t.slots,a=t.attrs,i=me("MenuItem"),l="headlessui-menu-item-"+d(),u=e.disabled,c=e.className,p=void 0===c?e.class:c,v=o.computed((function(){return null!==i.activeItemIndex.value&&i.items.value[i.activeItemIndex.value].id===l})),f=o.ref({disabled:u,textValue:""});function m(e){if(u)return e.preventDefault();i.closeMenu(),o.nextTick((function(){var e;return null==(e=Y(i.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function h(){if(u)return i.goToItem(X.Nothing);i.goToItem(X.Specific,l)}function b(){u||v.value||i.goToItem(X.Specific,l)}function y(){u||v.value&&i.goToItem(X.Nothing)}return o.onMounted((function(){var e,t,n=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(f.value.textValue=n)})),o.onMounted((function(){return i.registerItem(l,f)})),o.onUnmounted((function(){return i.unregisterItem(l)})),o.watchEffect((function(){i.menuState.value===ue.Open&&v.value&&o.nextTick((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:v.value,disabled:u},o={id:l,role:"menuitem",tabIndex:-1,class:ae(p,t),"aria-disabled":!0===u||void 0,onClick:m,onFocus:h,onPointermove:b,onMousemove:b,onPointerleave:y,onMouseleave:y};return s({props:r({},e,o),slot:t,attrs:a,slots:n,name:"MenuItem"})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(he||(he={}));var xe=Symbol("PopoverContext");function we(e){var t=o.inject(xe,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Ce.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,we),n}return t}var Oe=Symbol("PopoverGroupContext");function Ee(){return o.inject(Oe,null)}var Pe=Symbol("PopoverPanelContext"),Ce=o.defineComponent({name:"Popover",props:{as:{type:[Object,String],default:"div"}},setup:function(e,t){var n=t.slots,a=t.attrs,i=r({},e),l="headlessui-popover-button-"+d(),c="headlessui-popover-panel-"+d(),p=o.ref(he.Closed),v=o.ref(null),f=o.ref(null),m={popoverState:p,buttonId:l,panelId:c,panel:f,button:v,togglePopover:function(){var e;p.value=u(p.value,((e={})[he.Open]=he.Closed,e[he.Closed]=he.Open,e))},closePopover:function(){p.value!==he.Closed&&(p.value=he.Closed)}};o.provide(xe,m);var y={buttonId:l,panelId:c,close:function(){m.closePopover()}},g=Ee(),S=null==g?void 0:g.registerPopover;return o.watchEffect((function(){return null==S?void 0:S(y)})),x("focus",(function(){var e,t,n;p.value===he.Open&&((null!=(e=null==g?void 0:g.isFocusWithinPopoverGroup())?e:(null==(t=Y(v))?void 0:t.contains(document.activeElement))||(null==(n=Y(f))?void 0:n.contains(document.activeElement)))||v&&f&&m.closePopover())}),!0),x("mousedown",(function(e){var t,n,o,r,a,i,l=e.target;p.value===he.Open&&((null==(t=Y(v))?void 0:t.contains(l))||(null==(n=Y(f))?void 0:n.contains(l))||(m.closePopover(),void 0===(a=h.Loose)&&(a=h.Strict),(r=l)!==document.body&&u(a,((i={})[h.Strict]=function(){return r.matches(b)},i[h.Loose]=function(){for(var e=r;null!==e;){if(e.matches(b))return!0;e=e.parentElement}return!1},i))||(e.preventDefault(),null==(o=Y(v))||o.focus())))})),function(){return s({props:i,slot:{open:p.value===he.Open},slots:n,attrs:a,name:"Popover"})}}}),ke=o.defineComponent({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=we("PopoverButton"),t={open:e.popoverState.value===he.Open},n=this.isWithinPanel?{type:"button",onKeydown:this.handleKeyDown,onClick:this.handleClick}:{ref:"el",id:e.buttonId,type:"button","aria-expanded":e.popoverState.value===he.Open||void 0,"aria-controls":Y(e.panel)?e.panelId:void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return s({props:r({},this.$props,n),slot:t,attrs:this.$attrs,slots:this.$slots,name:"PopoverButton"})},setup:function(e){var t=we("PopoverButton"),r=Ee(),a=null==r?void 0:r.closeOthers,i=o.inject(Pe,null),l=null!==i&&i===t.panelId,u=o.ref(null),s=o.ref("undefined"==typeof window?null:document.activeElement);return x("focus",(function(){s.value=u.value,u.value=document.activeElement}),!0),{isWithinPanel:l,el:l?null:t.button,handleKeyDown:function(e){var o,r;if(l){if(t.popoverState.value===he.Closed)return;switch(e.key){case n.Space:case n.Enter:e.preventDefault(),e.stopPropagation(),t.closePopover(),null==(o=Y(t.button))||o.focus()}}else switch(e.key){case n.Space:case n.Enter:e.preventDefault(),e.stopPropagation(),t.popoverState.value===he.Closed&&(null==a||a(t.buttonId)),t.togglePopover();break;case n.Escape:if(t.popoverState.value!==he.Open)return null==a?void 0:a(t.buttonId);if(!Y(t.button))return;if(!(null==(r=Y(t.button))?void 0:r.contains(document.activeElement)))return;t.closePopover();break;case n.Tab:if(t.popoverState.value!==he.Open)return;if(!t.panel)return;if(!t.button)return;if(e.shiftKey){var i,u;if(!s.value)return;if(null==(i=Y(t.button))?void 0:i.contains(s.value))return;if(null==(u=Y(t.panel))?void 0:u.contains(s.value))return;var c=y(),p=c.indexOf(s.value);if(c.indexOf(Y(t.button))>p)return;e.preventDefault(),e.stopPropagation(),S(Y(t.panel),v.Last)}else e.preventDefault(),e.stopPropagation(),S(Y(t.panel),v.First)}},handleKeyUp:function(e){var o,r;if(!l&&(e.key===n.Space&&e.preventDefault(),t.popoverState.value===he.Open&&t.panel&&t.button))switch(e.key){case n.Tab:if(!s.value)return;if(null==(o=Y(t.button))?void 0:o.contains(s.value))return;if(null==(r=Y(t.panel))?void 0:r.contains(s.value))return;var a=y(),i=a.indexOf(s.value);if(a.indexOf(Y(t.button))>i)return;e.preventDefault(),e.stopPropagation(),S(Y(t.panel),v.Last)}},handleClick:function(){var n,o;e.disabled||(l?(t.closePopover(),null==(n=Y(t.button))||n.focus()):(t.popoverState.value===he.Closed&&(null==a||a(t.buttonId)),null==(o=Y(t.button))||o.focus(),t.togglePopover()))},handleFocus:function(){}}}}),De=o.defineComponent({name:"PopoverOverlay",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var t={open:we("PopoverOverlay").popoverState.value===he.Open};return s({props:r({},this.$props,{id:this.id,ref:"el","aria-hidden":!0,onClick:this.handleClick}),slot:t,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:t.open,name:"PopoverOverlay"})},setup:function(){var e=we("PopoverOverlay");return{id:"headlessui-popover-overlay-"+d(),handleClick:function(){e.closePopover()}}}}),Ie=o.defineComponent({name:"PopoverPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},focus:{type:Boolean,default:!1}},render:function(){var t={open:we("PopoverPanel").popoverState.value===he.Open};return s({props:r({},this.$props,{ref:"el",id:this.id,onKeydown:this.handleKeyDown}),slot:t,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:t.open,name:"PopoverPanel"})},setup:function(e){var t=e.focus,r=we("PopoverPanel");return o.provide(Pe,r.panelId),o.onUnmounted((function(){r.panel.value=null})),o.watchEffect((function(){var e;if(t&&r.popoverState.value===he.Open&&r.panel){var n=document.activeElement;(null==(e=Y(r.panel))?void 0:e.contains(n))||S(Y(r.panel),v.First)}})),x("keydown",(function(e){var t;if(r.popoverState.value===he.Open&&Y(r.panel)&&e.key===n.Tab&&document.activeElement&&(null==(t=Y(r.panel))?void 0:t.contains(document.activeElement))){e.preventDefault();var o,a=S(Y(r.panel),e.shiftKey?v.Previous:v.Next);if(a===f.Underflow)return null==(o=Y(r.button))?void 0:o.focus();if(a===f.Overflow){if(!Y(r.button))return;var i=y(),l=i.indexOf(Y(r.button));S(i.splice(l+1).filter((function(e){var t;return!(null==(t=Y(r.panel))?void 0:t.contains(e))})),v.First)===f.Error&&S(document.body,v.First)}}})),x("focus",(function(){var e;t&&r.popoverState.value===he.Open&&Y(r.panel)&&((null==(e=Y(r.panel))?void 0:e.contains(document.activeElement))||r.closePopover())}),!0),{id:r.panelId,el:r.panel,handleKeyDown:function(e){var t,o;switch(e.key){case n.Escape:if(r.popoverState.value!==he.Open)return;if(!Y(r.panel))return;if(!(null==(t=Y(r.panel))?void 0:t.contains(document.activeElement)))return;e.preventDefault(),r.closePopover(),null==(o=Y(r.button))||o.focus()}}}}}),Re=o.defineComponent({name:"PopoverGroup",props:{as:{type:[Object,String],default:"div"}},render:function(){return s({props:r({},this.$props,{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"PopoverGroup"})},setup:function(){var e=o.ref(null),t=o.ref([]);function n(e){var n=t.value.indexOf(e);-1!==n&&t.value.splice(n,1)}return o.provide(Oe,{registerPopover:function(e){return t.value.push(e),function(){n(e)}},unregisterPopover:n,isFocusWithinPopoverGroup:function(){var n,o=document.activeElement;return!!(null==(n=Y(e))?void 0:n.contains(o))||t.value.some((function(e){var t,n;return(null==(t=document.getElementById(e.buttonId))?void 0:t.contains(o))||(null==(n=document.getElementById(e.panelId))?void 0:n.contains(o))}))},closeOthers:function(e){for(var n,o=l(t.value);!(n=o()).done;){var r=n.value;r.buttonId!==e&&r.close()}}}),{el:e}}}),Te=Symbol("LabelContext");function Le(){var e=o.inject(Te,null);if(null===e){var t=new Error("You used a <Label /> component, but it is not inside a parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Le),t}return e}function Ae(){var e=o.ref([]);return[o.computed((function(){return e.value.length>0?e.value.join(" "):void 0})),o.defineComponent({name:"LabelProvider",props:{slot:{type:Object,default:void 0},name:{type:String,default:void 0},props:{type:Object,default:void 0}},setup:function(t,n){var r=n.slots;return o.provide(Te,{register:function(t){return e.value.push(t),function(){var n=e.value.indexOf(t);-1!==n&&e.value.splice(n,1)}},slot:o.computed((function(){return t.slot})),name:o.computed((function(){return t.name})),props:o.computed((function(){return t.props}))}),function(){return r.default()}}})]}var Fe=o.defineComponent({name:"Label",props:{as:{type:[Object,String],default:"label"},clickable:{type:[Boolean],default:!1}},render:function(){var e=this.$props,t=e.clickable,n=a(e,["clickable"]),o=r({},this.props,{id:this.id}),i=r({},n,o);return t||delete i.onClick,s({props:i,slot:this.slot||{},attrs:this.$attrs,slots:this.$slots,name:this.name||"Label"})},setup:function(){var e=Le(),t=e.register,n=e.slot,r=e.name,a=e.props,i="headlessui-label-"+d();return o.onMounted((function(){return o.onUnmounted(t(i))})),{id:i,slot:n,name:r,props:a}}}),je=Symbol("RadioGroupContext");function $e(e){var t=o.inject(je,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <RadioGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,$e),n}return t}var Be,Ne=o.defineComponent({name:"RadioGroup",emits:["update:modelValue"],inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},disabled:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean]}},render:function(){var e=this,t=a(this.$props,["modelValue","disabled"]),n=r({},this.$attrs,{ref:"el",id:this.id,role:"radiogroup","aria-labelledby":this.labelledby,"aria-describedby":this.describedby,onKeydown:this.handleKeyDown});return o.h(this.DescriptionProvider,(function(){return[o.h(e.LabelProvider,(function(){return[s({props:r({},t,n),slot:{},attrs:e.$attrs,slots:e.$slots,name:"RadioGroup"})]}))]}))},setup:function(e,t){var r=t.emit,a=o.ref(null),i=o.ref([]),l=Ae(),u=l[0],s=l[1],c=N(),p=c[0],m=c[1],h=o.computed((function(){return e.modelValue})),b={options:i,value:h,change:function(t){e.disabled||h.value!==t&&r("update:modelValue",t)},registerOption:function(e){var t,n=Array.from(null==(t=a.value)?void 0:t.querySelectorAll('[id^="headlessui-radiogroup-option-"]')).reduce((function(e,t,n){var o;return Object.assign(e,((o={})[t.id]=n,o))}),{});i.value.push(e),i.value.sort((function(e,t){return n[e.id]-n[t.id]}))},unregisterOption:function(e){var t=i.value.findIndex((function(t){return t.id===e}));-1!==t&&i.value.splice(t,1)}};return o.provide(je,b),o.watchEffect((function(){var e=Y(a);if(e)for(var t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});t.nextNode();)t.currentNode.setAttribute("role","none")})),{id:"headlessui-radiogroup-"+d(),labelledby:u,describedby:p,el:a,handleKeyDown:function(e){if(a.value&&a.value.contains(e.target))switch(e.key){case n.ArrowLeft:case n.ArrowUp:if(e.preventDefault(),e.stopPropagation(),S(i.value.map((function(e){return e.element})),v.Previous|v.WrapAround)===f.Success){var t=i.value.find((function(e){return e.element===document.activeElement}));t&&b.change(t.propsRef.value)}break;case n.ArrowRight:case n.ArrowDown:if(e.preventDefault(),e.stopPropagation(),S(i.value.map((function(e){return e.element})),v.Next|v.WrapAround)===f.Success){var o=i.value.find((function(e){return e.element===document.activeElement}));o&&b.change(o.propsRef.value)}break;case n.Space:e.preventDefault(),e.stopPropagation();var r=i.value.find((function(e){return e.element===document.activeElement}));r&&b.change(r.propsRef.value)}},LabelProvider:s,DescriptionProvider:m}}});!function(e){e[e.Empty=1]="Empty",e[e.Active=2]="Active"}(Be||(Be={}));var Me=o.defineComponent({name:"RadioGroupOption",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},value:{type:[Object,String]},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},render:function(){var e,t,n=this,i=this.$props,l=i.className,u=void 0===l?i.class:l,c=a(i,["value","disabled","class","className"]),p=$e("RadioGroupOption"),d=(null==(e=p.options.value)||null==(t=e[0])?void 0:t.id)===this.id,v={checked:this.checked,active:Boolean(this.state&Be.Active)},f=r({},this.$attrs,{id:this.id,ref:"el",role:"radio",class:ae(u,v),"aria-checked":this.checked?"true":"false","aria-labelledby":this.labelledby,"aria-describedby":this.describedby,tabIndex:this.checked||void 0===p.value.value&&d?0:-1,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur});return o.h(this.DescriptionProvider,(function(){return[o.h(n.LabelProvider,(function(){return[s({props:r({},c,f),slot:v,attrs:n.$attrs,slots:n.$slots,name:"RadioGroupOption"})]}))]}))},setup:function(e){var t=$e("RadioGroupOption"),n="headlessui-radiogroup-option-"+d(),r=Ae(),a=r[0],i=r[1],l=N(),u=l[0],s=l[1],c=o.ref(null),p=o.computed((function(){return{value:e.value}})),v=o.ref(Be.Empty);return o.onMounted((function(){return t.registerOption({id:n,element:c,propsRef:p})})),o.onUnmounted((function(){return t.unregisterOption(n)})),{id:n,el:c,labelledby:a,describedby:u,state:v,LabelProvider:i,DescriptionProvider:s,checked:o.computed((function(){return o.toRaw(t.value.value)===o.toRaw(e.value)})),handleClick:function(){var n,o=e.value;t.value.value!==o&&(v.value|=Be.Active,t.change(o),null==(n=c.value)||n.focus())},handleFocus:function(){v.value|=Be.Active},handleBlur:function(){v.value&=~Be.Active}}}}),Ke=Fe,Ue=K,Ve=Symbol("GroupContext"),Ge=o.defineComponent({name:"SwitchGroup",inheritAttrs:!1,props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var n=t.slots,a=t.attrs,i=o.ref(null),l=Ae(),u=l[0],c=l[1],p=N(),d=p[1];return o.provide(Ve,{switchRef:i,labelledby:u,describedby:p[0]}),function(){return o.h(d,{name:"SwitchDescription"},(function(){return[o.h(c,{name:"SwitchLabel",props:{onClick:function(){i.value&&(i.value.click(),i.value.focus({preventScroll:!0}))}}},(function(){return[s({props:r({},a,e),slot:{},slots:n,attrs:a,name:"SwitchGroup"})]}))]}))}}}),We=o.defineComponent({name:"Switch",emits:["update:modelValue"],props:{as:{type:[Object,String],default:"button"},modelValue:{type:[Object,Boolean],default:null},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},render:function(){var e=o.inject(Ve,null),t=this.$props,n=t.className,a={checked:this.$props.modelValue},i={id:this.id,ref:null===e?void 0:e.switchRef,role:"switch",tabIndex:0,class:ae(void 0===n?t.class:n,a),"aria-checked":this.$props.modelValue,"aria-labelledby":this.labelledby,"aria-describedby":this.describedby,onClick:this.handleClick,onKeyup:this.handleKeyUp,onKeypress:this.handleKeyPress};return"button"===this.$props.as&&Object.assign(i,{type:"button"}),s({props:r({},this.$props,i),slot:a,attrs:this.$attrs,slots:this.$slots,name:"Switch"})},setup:function(e,t){var r=t.emit,a=o.inject(Ve,null);function i(){r("update:modelValue",!e.modelValue)}return{id:"headlessui-switch-"+d(),el:null==a?void 0:a.switchRef,labelledby:null==a?void 0:a.labelledby,describedby:null==a?void 0:a.describedby,handleClick:function(e){e.preventDefault(),i()},handleKeyUp:function(e){e.key!==n.Tab&&e.preventDefault(),e.key===n.Space&&i()},handleKeyPress:function(e){e.preventDefault()}}}}),qe=Fe,He=K;exports.Dialog=q,exports.DialogDescription=z,exports.DialogOverlay=H,exports.DialogTitle=_,exports.Disclosure=ee,exports.DisclosureButton=te,exports.DisclosurePanel=ne,exports.FocusTrap=oe,exports.Listbox=se,exports.ListboxButton=pe,exports.ListboxLabel=ce,exports.ListboxOption=ve,exports.ListboxOptions=de,exports.Menu=be,exports.MenuButton=ye,exports.MenuItem=Se,exports.MenuItems=ge,exports.Popover=Ce,exports.PopoverButton=ke,exports.PopoverGroup=Re,exports.PopoverOverlay=De,exports.PopoverPanel=Ie,exports.Portal=F,exports.PortalGroup=$,exports.RadioGroup=Ne,exports.RadioGroupDescription=Ue,exports.RadioGroupLabel=Ke,exports.RadioGroupOption=Me,exports.Switch=We,exports.SwitchDescription=He,exports.SwitchGroup=Ge,exports.SwitchLabel=qe; | ||
//# sourceMappingURL=headlessui.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self).headlessui={},e.Vue)}(this,(function(e,t){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||(r[n]=e[n]);return r}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function i(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function a(e,t){if(e in t){for(var n=t[e],o=arguments.length,r=new Array(o>2?o-2:0),i=2;i<o;i++)r[i-2]=arguments[i];return"function"==typeof n?n.apply(void 0,r):n}var l=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(l,a),l}var l,u,s;function c(e){var t,r,i=e.visible,s=void 0===i||i,c=e.features,p=void 0===c?l.None:c,f=o(e,["visible","features"]);return s||p&l.Static&&f.props.static?d(f):p&l.RenderStrategy?a(null==(t=f.props.unmount)||t?u.Unmount:u.Hidden,((r={})[u.Unmount]=function(){return null},r[u.Hidden]=function(){return d(n({},f,{props:n({},f.props,{hidden:!0,style:{display:"none"}})}))},r)):d(f)}function d(e){var n,r=e.attrs,a=e.slots,l=e.slot,u=e.name,s=function(e,t){void 0===t&&(t=[]);for(var n,o=Object.assign({},e),r=i(t);!(n=r()).done;){var a=n.value;a in o&&delete o[a]}return o}(e.props,["unmount","static"]),c=s.as,d=o(s,["as"]),p=null==a.default?void 0:a.default(l);if("template"===c){if(Object.keys(d).length>0||Object.keys(r).length>0){var f=null!=p?p:[],v=f[0],m=f.slice(1);if(null==(n=v)||"string"!=typeof n.type&&"object"!=typeof n.type||m.length>0)throw new Error(['Passing props on "template"!',"","The current component <"+u+' /> is rendering a "template".',"However we need to passthrough the following props:",Object.keys(d).concat(Object.keys(r)).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return t.cloneVNode(v,d)}return p}return t.h(c,d,p)}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(l||(l={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(u||(u={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",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"}(s||(s={}));var p=0;function f(){return++p}var v,m,h,b,y=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function g(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(y))}function S(e){null==e||e.focus({preventScroll:!0})}function w(e,t){var n=Array.isArray(e)?e:g(e),o=document.activeElement,r=function(){if(t&(v.First|v.Next))return h.Next;if(t&(v.Previous|v.Last))return h.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),i=function(){if(t&v.First)return 0;if(t&v.Previous)return Math.max(0,n.indexOf(o))-1;if(t&v.Next)return Math.max(0,n.indexOf(o))+1;if(t&v.Last)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=t&v.NoScroll?{preventScroll:!0}:{},l=0,u=n.length,s=void 0;do{var c;if(l>=u||l+u<=0)return m.Error;var d=i+l;if(t&v.WrapAround)d=(d+u)%u;else{if(d<0)return m.Underflow;if(d>=u)return m.Overflow}null==(c=s=n[d])||c.focus(a),l+=r}while(s!==document.activeElement);return s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),m.Success}function O(e,n,o){window.addEventListener(e,n,o),t.onUnmounted((function(){return window.removeEventListener(e,n,o)}))}function x(e,t){for(var n,o=i(e);!(n=o()).done;)if(n.value.contains(t))return!0;return!1}function E(e,n,o){void 0===n&&(n=t.ref(!0)),void 0===o&&(o=t.ref({}));var r=t.ref("undefined"!=typeof window?document.activeElement:null),a=t.ref(null);function l(){if(n.value&&1===e.value.size){var t=o.value.initialFocus,l=document.activeElement;if(t){if(t===l)return}else if(x(e.value,l))return;if(r.value=l,t)S(t);else{for(var u,s=!1,c=i(e.value);!(u=c()).done;)if(w(u.value,v.First)===m.Success){s=!0;break}if(!s)throw new Error("There are no focusable elements inside the <FocusTrap />")}a.value=document.activeElement}}function u(){S(r.value),r.value=null,a.value=null}t.watchEffect(l),t.onUpdated((function(){n.value?l():u()})),t.onUnmounted(u),O("keydown",(function(t){if(n.value&&t.key===s.Tab&&document.activeElement&&1===e.value.size){t.preventDefault();for(var o,r=i(e.value);!(o=r()).done;)if(w(o.value,(t.shiftKey?v.Previous:v.Next)|v.WrapAround)===m.Success){a.value=document.activeElement;break}}})),O("focus",(function(t){if(n.value&&1===e.value.size){var o=a.value;if(o){var r=t.target;r&&r instanceof HTMLElement?x(e.value,r)?(a.value=r,S(r)):(t.preventDefault(),t.stopPropagation(),S(o)):S(a.value)}}}),!0)}!function(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"}(v||(v={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(m||(m={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(h||(h={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(b||(b={}));var C=new Set,P=new Map;function D(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function k(e){var t=P.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var I,R=Symbol("StackContext");function T(){return t.inject(R,(function(){}))}!function(e){e[e.AddElement=0]="AddElement",e[e.RemoveElement=1]="RemoveElement"}(I||(I={}));var L=t.defineComponent({name:"StackProvider",props:{onUpdate:{type:Function,default:void 0}},setup:function(e,n){var o=n.slots,r=T();return t.provide(R,(function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];null==e.onUpdate||e.onUpdate.apply(e,n),r.apply(void 0,n)})),function(){return o.default()}}}),j=Symbol("ForcePortalRootContext"),F=t.defineComponent({name:"ForcePortalRoot",props:{force:{type:Boolean,default:!1}},setup:function(e,n){var o=n.slots;return t.provide(j,e.force),function(){return o.default()}}}),A=t.defineComponent({name:"Portal",props:{as:{type:[Object,String],default:"template"}},setup:function(e,n){var o=n.slots,r=n.attrs,i=t.inject(j,!1),a=t.inject($,null),l=t.ref(!0===i||null===a?function(){var e=document.getElementById("headlessui-portal-root");if(e)return e;var t=document.createElement("div");return t.setAttribute("id","headlessui-portal-root"),document.body.appendChild(t)}():a.resolveTarget());t.watchEffect((function(){i||null!==a&&(l.value=a.resolveTarget())}));var u=t.ref(null);return function(e){var n=T();t.watchEffect((function(t){var o=null==e?void 0:e.value;o&&(n(I.AddElement,o),t((function(){return n(I.RemoveElement,o)})))}))}(u),t.onUnmounted((function(){var e,t=document.getElementById("headlessui-portal-root");t&&l.value===t&&l.value.children.length<=0&&(null==(e=l.value.parentElement)||e.removeChild(l.value))})),function(){return null===l.value?null:t.h(L,{},(function(){return[t.h(t.Teleport,{to:l.value},[t.h("div",{ref:u},[c({props:e,slot:{},attrs:r,slots:o,name:"Portal"})])])]}))}}}),$=Symbol("PortalGroupContext"),B=t.defineComponent({name:"PortalGroup",props:{as:{type:[Object,String],default:"template"},target:{type:Object,default:null}},setup:function(e,n){var r=n.attrs,i=n.slots,a=t.reactive({resolveTarget:function(){return e.target}});return t.provide($,a),function(){return c({props:o(e,["target"]),slot:{},attrs:r,slots:i,name:"PortalGroup"})}}}),N=Symbol("DescriptionContext");function M(){var e=t.ref([]);return[t.computed((function(){return e.value.length>0?e.value.join(" "):void 0})),t.defineComponent({name:"DescriptionProvider",props:["slot"],setup:function(n,o){var r=o.slots,i=t.computed((function(){return n.slot}));return t.provide(N,{register:function(t){return e.value.push(t),function(){var n=e.value.indexOf(t);-1!==n&&e.value.splice(n,1)}},slot:i}),function(){return r.default()}}})]}var U,K=t.defineComponent({name:"Description",props:{as:{type:[Object,String],default:"p"}},render:function(){return c({props:n({},this.$props,{id:this.id}),slot:this.slot,attrs:this.$attrs,slots:this.$slots,name:"Description"})},setup:function(){var e=t.inject(N,{register:function(){return function(){}},slot:{}}),n=e.register,o=e.slot,r="headlessui-description-"+f();return t.onMounted((function(){return t.onUnmounted(n(r))})),{id:r,slot:o}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(U||(U={}));var V=Symbol("DialogContext");function G(e){var n=t.inject(V,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Dialog /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,G),o}return n}var W,q="DC8F892D-2EBD-447C-A4C8-A03058436FF4",H=t.defineComponent({name:"Dialog",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:Boolean,default:q},onClose:{type:Function,default:q},initialFocus:{type:Object,default:null}},render:function(){var e=this,r=n({ref:"el",id:this.id,role:"dialog","aria-modal":this.dialogState===U.Open||void 0,"aria-labelledby":this.titleId,"aria-describedby":this.describedby},this.$attrs),i=this.$props,u=i.open,s=o(i,["open","onClose","initialFocus"]),d=this.containers,p={open:this.dialogState===U.Open};return t.h(L,{onUpdate:function(e,t){var n;return a(e,((n={})[I.AddElement]=function(){d.add(t)},n[I.RemoveElement]=function(){d.delete(t)},n))}},(function(){return[t.h(F,{force:!0},(function(){return[t.h(A,{},(function(){return[t.h(B,{target:e.dialogRef},(function(){return[t.h(F,{force:!1},(function(){return[t.h(e.DescriptionProvider,{slot:p},(function(){return[c({props:n({},s,r),slot:p,attrs:e.$attrs,slots:e.$slots,visible:u,features:l.RenderStrategy|l.Static,name:"Dialog"})]}))]}))]}))]}))]}))]}))},setup:function(e){var n=t.ref(new Set),o=e.open!==q,r=e.onClose!==q;if(!o&&!r)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!r)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof e.open)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+(e.open===q?void 0:e.open));if("function"!=typeof e.onClose)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+(e.onClose===q?void 0:e.onClose));var a=t.computed((function(){return e.open?U.Open:U.Closed})),l=t.ref(null),u=t.ref(a.value===U.Open);t.onUpdated((function(){u.value=a.value===U.Open}));var c="headlessui-dialog-"+f(),d=t.computed((function(){return{initialFocus:e.initialFocus}}));E(n,u,d),function(e,n){void 0===n&&(n=t.ref(!0)),t.watchEffect((function(t){if(n.value&&e.value){var o=e.value;C.add(o);for(var r,a=i(P.keys());!(r=a()).done;){var l=r.value;l.contains(o)&&(k(l),P.delete(l))}document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=i(C);!(t=n()).done;)if(e.contains(t.value))return;1===C.size&&(P.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),D(e))}})),t((function(){if(C.delete(o),C.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!P.has(e)){for(var t,n=i(C);!(t=n()).done;)if(e.contains(t.value))return;P.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),D(e)}}));else for(var e,t=i(P.keys());!(e=t()).done;){var n=e.value;k(n),P.delete(n)}}))}}))}(l,u);var p=M(),v=p[0],m=p[1],h=t.ref(null),b={titleId:h,dialogState:a,setTitleId:function(e){h.value!==e&&(h.value=e)},close:function(){e.onClose(!1)}};return t.provide(V,b),O("mousedown",(function(e){var o=e.target;a.value===U.Open&&1===n.value.size&&(x(n.value,o)||(b.close(),t.nextTick((function(){null==o||o.focus()}))))})),O("keydown",(function(e){e.key===s.Escape&&a.value===U.Open&&(n.value.size>1||b.close())})),t.watchEffect((function(e){if(a.value===U.Open){var t=document.documentElement.style.overflow,n=document.documentElement.style.paddingRight,o=window.innerWidth-document.documentElement.clientWidth;document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=o+"px",e((function(){document.documentElement.style.overflow=t,document.documentElement.style.paddingRight=n}))}})),t.watchEffect((function(e){if(a.value===U.Open&&l.value){var t=new IntersectionObserver((function(e){for(var t,n=i(e);!(t=n()).done;){var o=t.value;0===o.boundingClientRect.x&&0===o.boundingClientRect.y&&0===o.boundingClientRect.width&&0===o.boundingClientRect.height&&b.close()}}));t.observe(l.value),e((function(){return t.disconnect()}))}})),{id:c,el:l,dialogRef:l,containers:n,dialogState:a,titleId:h,describedby:v,DescriptionProvider:m}}}),_=t.defineComponent({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e=G("DialogOverlay");return c({props:n({},this.$props,{ref:"el",id:this.id,"aria-hidden":!0,onClick:this.handleClick}),slot:{open:e.dialogState.value===U.Open},attrs:this.$attrs,slots:this.$slots,name:"DialogOverlay"})},setup:function(){var e=G("DialogOverlay");return{id:"headlessui-dialog-overlay-"+f(),handleClick:function(){e.close()}}}}),z=t.defineComponent({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"}},render:function(){var e=G("DialogTitle");return c({props:n({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===U.Open},attrs:this.$attrs,slots:this.$slots,name:"DialogTitle"})},setup:function(){var e=G("DialogTitle"),n="headlessui-dialog-title-"+f();return t.onMounted((function(){e.setTitleId(n),t.onUnmounted((function(){return e.setTitleId(null)}))})),{id:n}}}),Y=K;function Q(e){var t;return null==e||null==e.value?null:null!=(t=e.value.$el)?t:e.value}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(W||(W={}));var J=Symbol("DisclosureContext");function X(e){var n=t.inject(J,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Disclosure /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,X),o}return n}var Z,ee,te=t.defineComponent({name:"Disclosure",props:{as:{type:[Object,String],default:"template"}},setup:function(e,o){var r=o.slots,i=o.attrs,l=n({},e),u=t.ref(W.Closed),s=t.ref(null);return t.provide(J,{disclosureState:u,panelRef:s,toggleDisclosure:function(){var e;u.value=a(u.value,((e={})[W.Open]=W.Closed,e[W.Closed]=W.Open,e))}}),function(){return c({props:l,slot:{open:u.value===W.Open},slots:r,attrs:i,name:"Disclosure"})}}}),ne=t.defineComponent({name:"DisclosureButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=X("DisclosureButton"),t={open:e.disclosureState.value===W.Open};return c({props:n({},this.$props,{id:this.id,type:"button","aria-expanded":e.disclosureState.value===W.Open||void 0,"aria-controls":this.ariaControls,onClick:this.handleClick,onKeydown:this.handleKeyDown}),slot:t,attrs:this.$attrs,slots:this.$slots,name:"DisclosureButton"})},setup:function(e){var n=X("DisclosureButton");return{id:"headlessui-disclosure-button-"+f(),ariaControls:t.computed((function(){var e,t;return null!=(e=null==(t=Q(n.panelRef))?void 0:t.id)?e:void 0})),handleClick:function(){e.disabled||n.toggleDisclosure()},handleKeyDown:function(t){if(!e.disabled)switch(t.key){case s.Space:case s.Enter:t.preventDefault(),n.toggleDisclosure()}}}}}),oe=t.defineComponent({name:"DisclosurePanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e={open:X("DisclosurePanel").disclosureState.value===W.Open};return c({props:n({},this.$props,{id:this.id,ref:"el"}),slot:e,attrs:this.$attrs,slots:this.$slots,features:l.RenderStrategy|l.Static,visible:e.open,name:"DisclosurePanel"})},setup:function(){var e=X("DisclosurePanel");return{id:"headlessui-disclosure-panel-"+f(),el:e.panelRef}}}),re=t.defineComponent({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null}},render:function(){return c({props:n({},o(this.$props,["initialFocus"]),{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"FocusTrap"})},setup:function(e){var n=t.ref(new Set),o=t.ref(null),r=t.ref(!0),i=t.computed((function(){return{initialFocus:e.initialFocus}}));return t.onMounted((function(){o.value&&(n.value.add(o.value),E(n,r,i))})),t.onUnmounted((function(){r.value=!1})),{el:o}}});function ie(e,t){var n=t.resolveItems();if(n.length<=0)return null;var o=t.resolveActiveIndex(),r=null!=o?o:-1,i=function(){switch(e.focus){case Z.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case Z.Previous:var o=n.slice().reverse().findIndex((function(e,n,o){return!(-1!==r&&o.length-n-1>=r||t.resolveDisabled(e))}));return-1===o?o:n.length-1-o;case Z.Next:return n.findIndex((function(e,n){return!(n<=r||t.resolveDisabled(e))}));case Z.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case Z.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case Z.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?o:i}function ae(e,t){if(void 0!==e)return"function"==typeof e?e(t):e}!function(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"}(Z||(Z={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ee||(ee={}));var le=Symbol("ListboxContext");function ue(e){var n=t.inject(le,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Listbox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,ue),o}return n}var se,ce=t.defineComponent({name:"Listbox",emits:["update:modelValue"],props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean],default:null}},setup:function(e,n){var r=n.slots,i=n.attrs,a=n.emit,l=e.disabled,u=o(e,["modelValue","disabled"]),s=t.ref(ee.Closed),d=t.ref(null),p=t.ref(null),f=t.ref(null),v=t.ref([]),m=t.ref(""),h=t.ref(null),b=t.computed((function(){return e.modelValue})),y={listboxState:s,value:b,labelRef:d,buttonRef:p,optionsRef:f,disabled:l,options:v,searchQuery:m,activeOptionIndex:h,closeListbox:function(){l||s.value!==ee.Closed&&(s.value=ee.Closed,h.value=null)},openListbox:function(){l||s.value!==ee.Open&&(s.value=ee.Open)},goToOption:function(e,t){if(!l&&s.value!==ee.Closed){var n=ie(e===Z.Specific?{focus:Z.Specific,id:t}:{focus:e},{resolveItems:function(){return v.value},resolveActiveIndex:function(){return h.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===m.value&&h.value===n||(m.value="",h.value=n)}},search:function(e){if(!l&&s.value!==ee.Closed){m.value+=e;var t=v.value.findIndex((function(e){return!e.dataRef.disabled&&e.dataRef.textValue.startsWith(m.value)}));-1!==t&&t!==h.value&&(h.value=t)}},clearSearch:function(){l||s.value!==ee.Closed&&""!==m.value&&(m.value="")},registerOption:function(e,t){v.value.push({id:e,dataRef:t})},unregisterOption:function(e){var t=v.value.slice(),n=null!==h.value?t[h.value]:null,o=t.findIndex((function(t){return t.id===e}));-1!==o&&t.splice(o,1),v.value=t,h.value=o===h.value||null===n?null:t.indexOf(n)},select:function(e){l||a("update:modelValue",e)}};return O("mousedown",(function(e){var t,n,o,r=e.target,i=document.activeElement;s.value===ee.Open&&((null==(t=Q(p))?void 0:t.contains(r))||((null==(n=Q(f))?void 0:n.contains(r))||y.closeListbox(),i!==document.body&&(null==i?void 0:i.contains(r))||e.defaultPrevented||null==(o=Q(p))||o.focus({preventScroll:!0})))})),t.provide(le,y),function(){return c({props:u,slot:{open:s.value===ee.Open,disabled:l},slots:r,attrs:i,name:"Listbox"})}}}),de=t.defineComponent({name:"ListboxLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){var e=ue("ListboxLabel"),t={open:e.listboxState.value===ee.Open,disabled:e.disabled};return c({props:n({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:t,attrs:this.$attrs,slots:this.$slots,name:"ListboxLabel"})},setup:function(){var e=ue("ListboxLabel");return{id:"headlessui-listbox-label-"+f(),el:e.labelRef,handleClick:function(){var t;null==(t=Q(e.buttonRef))||t.focus({preventScroll:!0})}}}}),pe=t.defineComponent({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"}},render:function(){var e,t,o=ue("ListboxButton"),r={open:o.listboxState.value===ee.Open,disabled:o.disabled},i={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=Q(o.optionsRef))?void 0:e.id,"aria-expanded":o.listboxState.value===ee.Open||void 0,"aria-labelledby":o.labelRef.value?[null==(t=Q(o.labelRef))?void 0:t.id,this.id].join(" "):void 0,disabled:o.disabled,onKeydown:this.handleKeyDown,onClick:this.handleClick};return c({props:n({},this.$props,i),slot:r,attrs:this.$attrs,slots:this.$slots,name:"ListboxButton"})},setup:function(){var e=ue("ListboxButton");return{id:"headlessui-listbox-button-"+f(),el:e.buttonRef,handleKeyDown:function(n){switch(n.key){case s.Space:case s.Enter:case s.ArrowDown:n.preventDefault(),e.openListbox(),t.nextTick((function(){var t;null==(t=Q(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(Z.First)}));break;case s.ArrowUp:n.preventDefault(),e.openListbox(),t.nextTick((function(){var t;null==(t=Q(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(Z.Last)}))}},handleClick:function(n){var o;e.disabled||(e.listboxState.value===ee.Open?(e.closeListbox(),t.nextTick((function(){var t;return null==(t=Q(e.buttonRef))?void 0:t.focus({preventScroll:!0})}))):(n.preventDefault(),e.openListbox(),o=function(){var t;return null==(t=Q(e.optionsRef))?void 0:t.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(o)}))))}}}}),fe=t.defineComponent({name:"ListboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,o,r,i=ue("ListboxOptions"),a={open:i.listboxState.value===ee.Open},u={"aria-activedescendant":null===i.activeOptionIndex.value||null==(e=i.options.value[i.activeOptionIndex.value])?void 0:e.id,"aria-labelledby":null!=(t=null==(o=Q(i.labelRef))?void 0:o.id)?t:null==(r=Q(i.buttonRef))?void 0:r.id,id:this.id,onKeydown:this.handleKeyDown,role:"listbox",tabIndex:0,ref:"el"};return c({props:n({},this.$props,u),slot:a,attrs:this.$attrs,slots:this.$slots,features:l.RenderStrategy|l.Static,visible:a.open,name:"ListboxOptions"})},setup:function(){var e=ue("ListboxOptions"),n="headlessui-listbox-options-"+f(),o=t.ref(null);return{id:n,el:e.optionsRef,handleKeyDown:function(n){switch(o.value&&clearTimeout(o.value),n.key){case s.Space:if(""!==e.searchQuery.value)return n.preventDefault(),n.stopPropagation(),e.search(n.key);case s.Enter:n.preventDefault(),n.stopPropagation(),null!==e.activeOptionIndex.value&&e.select(e.options.value[e.activeOptionIndex.value].dataRef.value),e.closeListbox(),t.nextTick((function(){var t;return null==(t=Q(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.ArrowDown:return n.preventDefault(),n.stopPropagation(),e.goToOption(Z.Next);case s.ArrowUp:return n.preventDefault(),n.stopPropagation(),e.goToOption(Z.Previous);case s.Home:case s.PageUp:return n.preventDefault(),n.stopPropagation(),e.goToOption(Z.First);case s.End:case s.PageDown:return n.preventDefault(),n.stopPropagation(),e.goToOption(Z.Last);case s.Escape:n.preventDefault(),n.stopPropagation(),e.closeListbox(),t.nextTick((function(){var t;return null==(t=Q(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.Tab:n.preventDefault(),n.stopPropagation();break;default:1===n.key.length&&(e.search(n.key),o.value=setTimeout((function(){return e.clearSearch()}),350))}}}}}),ve=t.defineComponent({name:"ListboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String],default:null},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},setup:function(e,o){var r=o.slots,i=o.attrs,a=ue("ListboxOption"),l="headlessui-listbox-option-"+f(),u=e.disabled,s=e.className,d=void 0===s?e.class:s,p=e.value,v=t.computed((function(){return null!==a.activeOptionIndex.value&&a.options.value[a.activeOptionIndex.value].id===l})),m=t.computed((function(){return t.toRaw(a.value.value)===t.toRaw(p)})),h=t.ref({disabled:u,value:p,textValue:""});function b(e){if(u)return e.preventDefault();a.select(p),a.closeListbox(),t.nextTick((function(){var e;return null==(e=Q(a.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function y(){if(u)return a.goToOption(Z.Nothing);a.goToOption(Z.Specific,l)}function g(){u||v.value||a.goToOption(Z.Specific,l)}function S(){u||v.value&&a.goToOption(Z.Nothing)}return t.onMounted((function(){var e,t,n=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(h.value.textValue=n)})),t.onMounted((function(){return a.registerOption(l,h)})),t.onUnmounted((function(){return a.unregisterOption(l)})),t.onMounted((function(){t.watch([a.listboxState,m],(function(){var e;a.listboxState.value===ee.Open&&m.value&&(a.goToOption(Z.Specific,l),null==(e=document.getElementById(l))||null==e.focus||e.focus())}),{immediate:!0})})),t.watchEffect((function(){a.listboxState.value===ee.Open&&v.value&&t.nextTick((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:v.value,selected:m.value,disabled:u},o={id:l,role:"option",tabIndex:-1,class:ae(d,t),"aria-disabled":!0===u||void 0,"aria-selected":!0===m.value?m.value:void 0,onClick:b,onFocus:y,onPointermove:g,onMousemove:g,onPointerleave:S,onMouseleave:S};return c({props:n({},e,o),slot:t,attrs:i,slots:r,name:"ListboxOption"})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(se||(se={}));var me=Symbol("MenuContext");function he(e){var n=t.inject(me,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Menu /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,he),o}return n}var be,ye=t.defineComponent({name:"Menu",props:{as:{type:[Object,String],default:"template"}},setup:function(e,n){var o=n.slots,r=n.attrs,i=t.ref(se.Closed),a=t.ref(null),l=t.ref(null),u=t.ref([]),s=t.ref(""),d=t.ref(null),p={menuState:i,buttonRef:a,itemsRef:l,items:u,searchQuery:s,activeItemIndex:d,closeMenu:function(){i.value=se.Closed,d.value=null},openMenu:function(){return i.value=se.Open},goToItem:function(e,t){var n=ie(e===Z.Specific?{focus:Z.Specific,id:t}:{focus:e},{resolveItems:function(){return u.value},resolveActiveIndex:function(){return d.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===s.value&&d.value===n||(s.value="",d.value=n)},search:function(e){s.value+=e;var t=u.value.findIndex((function(e){return e.dataRef.textValue.startsWith(s.value)&&!e.dataRef.disabled}));-1!==t&&t!==d.value&&(d.value=t)},clearSearch:function(){s.value=""},registerItem:function(e,t){u.value.push({id:e,dataRef:t})},unregisterItem:function(e){var t=u.value.slice(),n=null!==d.value?t[d.value]:null,o=t.findIndex((function(t){return t.id===e}));-1!==o&&t.splice(o,1),u.value=t,d.value=o===d.value||null===n?null:t.indexOf(n)}};return O("mousedown",(function(e){var t,n,o,r=e.target,u=document.activeElement;i.value===se.Open&&((null==(t=Q(a))?void 0:t.contains(r))||((null==(n=Q(l))?void 0:n.contains(r))||p.closeMenu(),u!==document.body&&(null==u?void 0:u.contains(r))||e.defaultPrevented||null==(o=Q(a))||o.focus({preventScroll:!0})))})),t.provide(me,p),function(){return c({props:e,slot:{open:i.value===se.Open},slots:o,attrs:r,name:"Menu"})}}}),ge=t.defineComponent({name:"MenuButton",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"}},render:function(){var e,t=he("MenuButton"),o={open:t.menuState.value===se.Open},r={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=Q(t.itemsRef))?void 0:e.id,"aria-expanded":t.menuState.value===se.Open||void 0,onKeydown:this.handleKeyDown,onClick:this.handleClick};return c({props:n({},this.$props,r),slot:o,attrs:this.$attrs,slots:this.$slots,name:"MenuButton"})},setup:function(e){var n=he("MenuButton");return{id:"headlessui-menu-button-"+f(),el:n.buttonRef,handleKeyDown:function(e){switch(e.key){case s.Space:case s.Enter:case s.ArrowDown:e.preventDefault(),e.stopPropagation(),n.openMenu(),t.nextTick((function(){var e;null==(e=Q(n.itemsRef))||e.focus({preventScroll:!0}),n.goToItem(Z.First)}));break;case s.ArrowUp:e.preventDefault(),e.stopPropagation(),n.openMenu(),t.nextTick((function(){var e;null==(e=Q(n.itemsRef))||e.focus({preventScroll:!0}),n.goToItem(Z.Last)}))}},handleClick:function(o){var r;e.disabled||(n.menuState.value===se.Open?(n.closeMenu(),t.nextTick((function(){var e;return null==(e=Q(n.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(o.preventDefault(),o.stopPropagation(),n.openMenu(),r=function(){var e;return null==(e=Q(n.itemsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(r)}))))}}}}),Se=t.defineComponent({name:"MenuItems",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,o=he("MenuItems"),r={open:o.menuState.value===se.Open},i={"aria-activedescendant":null===o.activeItemIndex.value||null==(e=o.items.value[o.activeItemIndex.value])?void 0:e.id,"aria-labelledby":null==(t=Q(o.buttonRef))?void 0:t.id,id:this.id,onKeydown:this.handleKeyDown,role:"menu",tabIndex:0,ref:"el"};return c({props:n({},this.$props,i),slot:r,attrs:this.$attrs,slots:this.$slots,features:l.RenderStrategy|l.Static,visible:r.open,name:"MenuItems"})},setup:function(){var e=he("MenuItems"),n="headlessui-menu-items-"+f(),o=t.ref(null);return t.watchEffect((function(){var t=Q(e.itemsRef);if(t&&e.menuState.value===se.Open)for(var n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});n.nextNode();)n.currentNode.setAttribute("role","none")})),{id:n,el:e.itemsRef,handleKeyDown:function(n){switch(o.value&&clearTimeout(o.value),n.key){case s.Space:if(""!==e.searchQuery.value)return n.preventDefault(),n.stopPropagation(),e.search(n.key);case s.Enter:var r;n.preventDefault(),n.stopPropagation(),null!==e.activeItemIndex.value&&(null==(r=document.getElementById(e.items.value[e.activeItemIndex.value].id))||r.click()),e.closeMenu(),t.nextTick((function(){var t;return null==(t=Q(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.ArrowDown:return n.preventDefault(),n.stopPropagation(),e.goToItem(Z.Next);case s.ArrowUp:return n.preventDefault(),n.stopPropagation(),e.goToItem(Z.Previous);case s.Home:case s.PageUp:return n.preventDefault(),n.stopPropagation(),e.goToItem(Z.First);case s.End:case s.PageDown:return n.preventDefault(),n.stopPropagation(),e.goToItem(Z.Last);case s.Escape:n.preventDefault(),n.stopPropagation(),e.closeMenu(),t.nextTick((function(){var t;return null==(t=Q(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.Tab:n.preventDefault(),n.stopPropagation();break;default:1===n.key.length&&(e.search(n.key),o.value=setTimeout((function(){return e.clearSearch()}),350))}}}}}),we=t.defineComponent({name:"MenuItem",props:{as:{type:[Object,String],default:"template"},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},setup:function(e,o){var r=o.slots,i=o.attrs,a=he("MenuItem"),l="headlessui-menu-item-"+f(),u=e.disabled,s=e.className,d=void 0===s?e.class:s,p=t.computed((function(){return null!==a.activeItemIndex.value&&a.items.value[a.activeItemIndex.value].id===l})),v=t.ref({disabled:u,textValue:""});function m(e){if(u)return e.preventDefault();a.closeMenu(),t.nextTick((function(){var e;return null==(e=Q(a.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function h(){if(u)return a.goToItem(Z.Nothing);a.goToItem(Z.Specific,l)}function b(){u||p.value||a.goToItem(Z.Specific,l)}function y(){u||p.value&&a.goToItem(Z.Nothing)}return t.onMounted((function(){var e,t,n=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(v.value.textValue=n)})),t.onMounted((function(){return a.registerItem(l,v)})),t.onUnmounted((function(){return a.unregisterItem(l)})),t.watchEffect((function(){a.menuState.value===se.Open&&p.value&&t.nextTick((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:p.value,disabled:u},o={id:l,role:"menuitem",tabIndex:-1,class:ae(d,t),"aria-disabled":!0===u||void 0,onClick:m,onFocus:h,onPointermove:b,onMousemove:b,onPointerleave:y,onMouseleave:y};return c({props:n({},e,o),slot:t,attrs:i,slots:r,name:"MenuItem"})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(be||(be={}));var Oe=Symbol("PopoverContext");function xe(e){var n=t.inject(Oe,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <"+De.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,xe),o}return n}var Ee=Symbol("PopoverGroupContext");function Ce(){return t.inject(Ee,null)}var Pe=Symbol("PopoverPanelContext"),De=t.defineComponent({name:"Popover",props:{as:{type:[Object,String],default:"div"}},setup:function(e,o){var r=o.slots,i=o.attrs,l=n({},e),u="headlessui-popover-button-"+f(),s="headlessui-popover-panel-"+f(),d=t.ref(be.Closed),p=t.ref(null),v=t.ref(null),m={popoverState:d,buttonId:u,panelId:s,panel:v,button:p,togglePopover:function(){var e;d.value=a(d.value,((e={})[be.Open]=be.Closed,e[be.Closed]=be.Open,e))},closePopover:function(){d.value!==be.Closed&&(d.value=be.Closed)}};t.provide(Oe,m);var h={buttonId:u,panelId:s,close:function(){m.closePopover()}},g=Ce(),S=null==g?void 0:g.registerPopover;return t.watchEffect((function(){return null==S?void 0:S(h)})),O("focus",(function(){var e,t,n;d.value===be.Open&&((null!=(e=null==g?void 0:g.isFocusWithinPopoverGroup())?e:(null==(t=Q(p))?void 0:t.contains(document.activeElement))||(null==(n=Q(v))?void 0:n.contains(document.activeElement)))||p&&v&&m.closePopover())}),!0),O("mousedown",(function(e){var t,n,o,r,i,l,u=e.target;d.value===be.Open&&((null==(t=Q(p))?void 0:t.contains(u))||(null==(n=Q(v))?void 0:n.contains(u))||(m.closePopover(),void 0===(i=b.Loose)&&(i=b.Strict),(r=u)!==document.body&&a(i,((l={})[b.Strict]=function(){return r.matches(y)},l[b.Loose]=function(){for(var e=r;null!==e;){if(e.matches(y))return!0;e=e.parentElement}return!1},l))||(e.preventDefault(),null==(o=Q(p))||o.focus())))})),function(){return c({props:l,slot:{open:d.value===be.Open},slots:r,attrs:i,name:"Popover"})}}}),ke=t.defineComponent({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=xe("PopoverButton"),t={open:e.popoverState.value===be.Open},o=this.isWithinPanel?{type:"button",onKeydown:this.handleKeyDown,onClick:this.handleClick}:{ref:"el",id:e.buttonId,type:"button","aria-expanded":e.popoverState.value===be.Open||void 0,"aria-controls":Q(e.panel)?e.panelId:void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return c({props:n({},this.$props,o),slot:t,attrs:this.$attrs,slots:this.$slots,name:"PopoverButton"})},setup:function(e){var n=xe("PopoverButton"),o=Ce(),r=null==o?void 0:o.closeOthers,i=t.inject(Pe,null),a=null!==i&&i===n.panelId,l=t.ref(null),u=t.ref("undefined"==typeof window?null:document.activeElement);return O("focus",(function(){u.value=l.value,l.value=document.activeElement}),!0),{isWithinPanel:a,el:a?null:n.button,handleKeyDown:function(e){var t,o;if(a){if(n.popoverState.value===be.Closed)return;switch(e.key){case s.Space:case s.Enter:e.preventDefault(),e.stopPropagation(),n.closePopover(),null==(t=Q(n.button))||t.focus()}}else switch(e.key){case s.Space:case s.Enter:e.preventDefault(),e.stopPropagation(),n.popoverState.value===be.Closed&&(null==r||r(n.buttonId)),n.togglePopover();break;case s.Escape:if(n.popoverState.value!==be.Open)return null==r?void 0:r(n.buttonId);if(!Q(n.button))return;if(!(null==(o=Q(n.button))?void 0:o.contains(document.activeElement)))return;n.closePopover();break;case s.Tab:if(n.popoverState.value!==be.Open)return;if(!n.panel)return;if(!n.button)return;if(e.shiftKey){var i,l;if(!u.value)return;if(null==(i=Q(n.button))?void 0:i.contains(u.value))return;if(null==(l=Q(n.panel))?void 0:l.contains(u.value))return;var c=g(),d=c.indexOf(u.value);if(c.indexOf(Q(n.button))>d)return;e.preventDefault(),e.stopPropagation(),w(Q(n.panel),v.Last)}else e.preventDefault(),e.stopPropagation(),w(Q(n.panel),v.First)}},handleKeyUp:function(e){var t,o;if(!a&&n.popoverState.value===be.Open&&n.panel&&n.button)switch(e.key){case s.Tab:if(!u.value)return;if(null==(t=Q(n.button))?void 0:t.contains(u.value))return;if(null==(o=Q(n.panel))?void 0:o.contains(u.value))return;var r=g(),i=r.indexOf(u.value);if(r.indexOf(Q(n.button))>i)return;e.preventDefault(),e.stopPropagation(),w(Q(n.panel),v.Last)}},handleClick:function(){var t,o;e.disabled||(a?(n.closePopover(),null==(t=Q(n.button))||t.focus()):(n.popoverState.value===be.Closed&&(null==r||r(n.buttonId)),null==(o=Q(n.button))||o.focus(),n.togglePopover()))},handleFocus:function(){}}}}),Ie=t.defineComponent({name:"PopoverOverlay",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e={open:xe("PopoverOverlay").popoverState.value===be.Open};return c({props:n({},this.$props,{id:this.id,ref:"el","aria-hidden":!0,onClick:this.handleClick}),slot:e,attrs:this.$attrs,slots:this.$slots,features:l.RenderStrategy|l.Static,visible:e.open,name:"PopoverOverlay"})},setup:function(){var e=xe("PopoverOverlay");return{id:"headlessui-popover-overlay-"+f(),handleClick:function(){e.closePopover()}}}}),Re=t.defineComponent({name:"PopoverPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},focus:{type:Boolean,default:!1}},render:function(){var e={open:xe("PopoverPanel").popoverState.value===be.Open};return c({props:n({},this.$props,{ref:"el",id:this.id,onKeydown:this.handleKeyDown}),slot:e,attrs:this.$attrs,slots:this.$slots,features:l.RenderStrategy|l.Static,visible:e.open,name:"PopoverPanel"})},setup:function(e){var n=e.focus,o=xe("PopoverPanel");return t.provide(Pe,o.panelId),t.onUnmounted((function(){o.panel.value=null})),t.watchEffect((function(){var e;if(n&&o.popoverState.value===be.Open&&o.panel){var t=document.activeElement;(null==(e=Q(o.panel))?void 0:e.contains(t))||w(Q(o.panel),v.First)}})),O("keydown",(function(e){var t;if(o.popoverState.value===be.Open&&Q(o.panel)&&e.key===s.Tab&&document.activeElement&&(null==(t=Q(o.panel))?void 0:t.contains(document.activeElement))){e.preventDefault();var n,r=w(Q(o.panel),e.shiftKey?v.Previous:v.Next);if(r===m.Underflow)return null==(n=Q(o.button))?void 0:n.focus();if(r===m.Overflow){if(!Q(o.button))return;var i=g(),a=i.indexOf(Q(o.button));w(i.splice(a+1).filter((function(e){var t;return!(null==(t=Q(o.panel))?void 0:t.contains(e))})),v.First)===m.Error&&w(document.body,v.First)}}})),O("focus",(function(){var e;n&&o.popoverState.value===be.Open&&Q(o.panel)&&((null==(e=Q(o.panel))?void 0:e.contains(document.activeElement))||o.closePopover())}),!0),{id:o.panelId,el:o.panel,handleKeyDown:function(e){var t,n;switch(e.key){case s.Escape:if(o.popoverState.value!==be.Open)return;if(!Q(o.panel))return;if(!(null==(t=Q(o.panel))?void 0:t.contains(document.activeElement)))return;e.preventDefault(),o.closePopover(),null==(n=Q(o.button))||n.focus()}}}}}),Te=t.defineComponent({name:"PopoverGroup",props:{as:{type:[Object,String],default:"div"}},render:function(){return c({props:n({},this.$props,{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"PopoverGroup"})},setup:function(){var e=t.ref(null),n=t.ref([]);function o(e){var t=n.value.indexOf(e);-1!==t&&n.value.splice(t,1)}return t.provide(Ee,{registerPopover:function(e){return n.value.push(e),function(){o(e)}},unregisterPopover:o,isFocusWithinPopoverGroup:function(){var t,o=document.activeElement;return!!(null==(t=Q(e))?void 0:t.contains(o))||n.value.some((function(e){var t,n;return(null==(t=document.getElementById(e.buttonId))?void 0:t.contains(o))||(null==(n=document.getElementById(e.panelId))?void 0:n.contains(o))}))},closeOthers:function(e){for(var t,o=i(n.value);!(t=o()).done;){var r=t.value;r.buttonId!==e&&r.close()}}}),{el:e}}}),Le=Symbol("LabelContext");function je(){var e=t.ref([]);return[t.computed((function(){return e.value.length>0?e.value.join(" "):void 0})),t.defineComponent({name:"LabelProvider",setup:function(n,o){var r=o.slots;return t.provide(Le,{register:function(t){return e.value.push(t),function(){var n=e.value.indexOf(t);-1!==n&&e.value.splice(n,1)}}}),function(){return r.default()}}})]}var Fe=t.defineComponent({name:"Label",props:{as:{type:[Object,String],default:"label"}},render:function(){return c({props:n({},this.$props,{id:this.id}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"Label"})},setup:function(){var e=t.inject(Le,{register:function(){return function(){}}}).register,n="headlessui-label-"+f();return t.onMounted((function(){return t.onUnmounted(e(n))})),{id:n}}}),Ae=Symbol("RadioGroupContext");function $e(e){var n=t.inject(Ae,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <RadioGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,$e),o}return n}var Be,Ne=t.defineComponent({name:"RadioGroup",emits:["update:modelValue"],props:{as:{type:[Object,String],default:"div"},disabled:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean]}},render:function(){var e=this,r=o(this.$props,["modelValue","disabled"]),i={ref:"el",id:this.id,role:"radiogroup","aria-labelledby":this.labelledby,"aria-describedby":this.describedby};return t.h(this.DescriptionProvider,(function(){return[t.h(e.LabelProvider,(function(){return[c({props:n({},r,i),slot:{},attrs:e.$attrs,slots:e.$slots,name:"RadioGroup"})]}))]}))},setup:function(e,n){var o=n.emit,r=t.ref(null),i=t.ref([]),a=je(),l=a[0],u=a[1],c=M(),d=c[0],p=c[1],h=t.computed((function(){return e.modelValue})),b={options:i,value:h,change:function(t){e.disabled||h.value!==t&&o("update:modelValue",t)},registerOption:function(e){var t,n=Array.from(null==(t=r.value)?void 0:t.querySelectorAll('[id^="headlessui-radiogroup-option-"]')).reduce((function(e,t,n){var o;return Object.assign(e,((o={})[t.id]=n,o))}),{});i.value.push(e),i.value.sort((function(e,t){return n[e.id]-n[t.id]}))},unregisterOption:function(e){var t=i.value.findIndex((function(t){return t.id===e}));-1!==t&&i.value.splice(t,1)}};return t.provide(Ae,b),t.watchEffect((function(){var e=Q(r);if(e)for(var t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});t.nextNode();)t.currentNode.setAttribute("role","none")})),O("keydown",(function(e){if(r.value&&r.value.contains(e.target))switch(e.key){case s.ArrowLeft:case s.ArrowUp:if(e.preventDefault(),e.stopPropagation(),w(i.value.map((function(e){return e.element})),v.Previous|v.WrapAround)===m.Success){var t=i.value.find((function(e){return e.element===document.activeElement}));t&&b.change(t.propsRef.value)}break;case s.ArrowRight:case s.ArrowDown:if(e.preventDefault(),e.stopPropagation(),w(i.value.map((function(e){return e.element})),v.Next|v.WrapAround)===m.Success){var n=i.value.find((function(e){return e.element===document.activeElement}));n&&b.change(n.propsRef.value)}break;case s.Space:e.preventDefault(),e.stopPropagation();var o=i.value.find((function(e){return e.element===document.activeElement}));o&&b.change(o.propsRef.value)}})),{id:"headlessui-radiogroup-"+f(),labelledby:l,describedby:d,el:r,LabelProvider:u,DescriptionProvider:p}}});!function(e){e[e.Empty=1]="Empty",e[e.Active=2]="Active"}(Be||(Be={}));var Me=t.defineComponent({name:"RadioGroupOption",props:{as:{type:[Object,String],default:"div"},value:{type:[Object,String]},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},render:function(){var e,r,i=this,a=this.$props,l=a.className,u=void 0===l?a.class:l,s=o(a,["value","disabled","class","className"]),d=$e("RadioGroupOption"),p=(null==(e=d.options.value)||null==(r=e[0])?void 0:r.id)===this.id,f={checked:this.checked,active:Boolean(this.state&Be.Active)},v={id:this.id,ref:"el",role:"radio",class:ae(u,f),"aria-checked":this.checked?"true":"false","aria-labelledby":this.labelledby,"aria-describedby":this.describedby,tabIndex:this.checked||void 0===d.value.value&&p?0:-1,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur};return t.h(this.DescriptionProvider,(function(){return[t.h(i.LabelProvider,(function(){return[c({props:n({},s,v),slot:f,attrs:i.$attrs,slots:i.$slots,name:"RadioGroupOption"})]}))]}))},setup:function(e){var n=$e("RadioGroupOption"),o="headlessui-radiogroup-option-"+f(),r=je(),i=r[0],a=r[1],l=M(),u=l[0],s=l[1],c=t.ref(null),d=t.computed((function(){return{value:e.value}})),p=t.ref(Be.Empty);return t.onMounted((function(){return n.registerOption({id:o,element:c,propsRef:d})})),t.onUnmounted((function(){return n.unregisterOption(o)})),{id:o,el:c,labelledby:i,describedby:u,state:p,LabelProvider:a,DescriptionProvider:s,checked:t.computed((function(){return t.toRaw(n.value.value)===t.toRaw(e.value)})),handleClick:function(){var t,o=e.value;n.value.value!==o&&(p.value|=Be.Active,n.change(o),null==(t=c.value)||t.focus())},handleFocus:function(){p.value|=Be.Active},handleBlur:function(){p.value&=~Be.Active}}}}),Ue=Fe,Ke=K,Ve=Symbol("GroupContext");function Ge(e){var n=t.inject(Ve,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <SwitchGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Ge),o}return n}var We=t.defineComponent({name:"SwitchGroup",props:{as:{type:[Object,String],default:"template"}},setup:function(e,n){var o=n.slots,r=n.attrs,i=t.ref(null),a=t.ref(null),l=t.ref(null);return t.provide(Ve,{switchRef:i,labelRef:a,descriptionRef:l}),function(){return c({props:e,slot:{},slots:o,attrs:r,name:"SwitchGroup"})}}}),qe=t.defineComponent({name:"Switch",emits:["update:modelValue"],props:{as:{type:[Object,String],default:"button"},modelValue:{type:[Object,Boolean],default:null},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},render:function(){var e=t.inject(Ve,null),o=this.$props,r=o.className,i=void 0===r?o.class:r,a=t.computed((function(){var t;return null==(t=Q(null==e?void 0:e.labelRef))?void 0:t.id})),l=t.computed((function(){var t;return null==(t=Q(null==e?void 0:e.descriptionRef))?void 0:t.id})),u={checked:this.$props.modelValue},s={id:this.id,ref:null===e?void 0:e.switchRef,role:"switch",tabIndex:0,class:ae(i,u),"aria-checked":this.$props.modelValue,"aria-labelledby":a.value,"aria-describedby":l.value,onClick:this.handleClick,onKeyup:this.handleKeyUp,onKeypress:this.handleKeyPress};return"button"===this.$props.as&&Object.assign(s,{type:"button"}),c({props:n({},this.$props,s),slot:u,attrs:this.$attrs,slots:this.$slots,name:"Switch"})},setup:function(e,n){var o=n.emit,r=t.inject(Ve,null);function i(){o("update:modelValue",!e.modelValue)}return{id:"headlessui-switch-"+f(),el:null==r?void 0:r.switchRef,handleClick:function(e){e.preventDefault(),i()},handleKeyUp:function(e){e.key!==s.Tab&&e.preventDefault(),e.key===s.Space&&i()},handleKeyPress:function(e){e.preventDefault()}}}}),He=t.defineComponent({name:"SwitchLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){return c({props:n({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"SwitchLabel"})},setup:function(){var e=Ge("SwitchLabel");return{id:"headlessui-switch-label-"+f(),el:e.labelRef,handleClick:function(){var t=Q(e.switchRef);null==t||t.click(),null==t||t.focus({preventScroll:!0})}}}}),_e=t.defineComponent({name:"SwitchDescription",props:{as:{type:[Object,String],default:"p"}},render:function(){return c({props:n({},this.$props,{id:this.id,ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"SwitchDescription"})},setup:function(){var e=Ge("SwitchDescription");return{id:"headlessui-switch-description-"+f(),el:e.descriptionRef}}});e.Dialog=H,e.DialogDescription=Y,e.DialogOverlay=_,e.DialogTitle=z,e.Disclosure=te,e.DisclosureButton=ne,e.DisclosurePanel=oe,e.FocusTrap=re,e.Listbox=ce,e.ListboxButton=pe,e.ListboxLabel=de,e.ListboxOption=ve,e.ListboxOptions=fe,e.Menu=ye,e.MenuButton=ge,e.MenuItem=we,e.MenuItems=Se,e.Popover=De,e.PopoverButton=ke,e.PopoverGroup=Te,e.PopoverOverlay=Ie,e.PopoverPanel=Re,e.Portal=A,e.PortalGroup=B,e.RadioGroup=Ne,e.RadioGroupDescription=Ke,e.RadioGroupLabel=Ue,e.RadioGroupOption=Me,e.Switch=qe,e.SwitchDescription=_e,e.SwitchGroup=We,e.SwitchLabel=He,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self).headlessui={},e.Vue)}(this,(function(e,t){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t.indexOf(n=a[o])>=0||(r[n]=e[n]);return r}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function a(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function i(e,t){if(e in t){for(var n=t[e],o=arguments.length,r=new Array(o>2?o-2:0),a=2;a<o;a++)r[a-2]=arguments[a];return"function"==typeof n?n.apply(void 0,r):n}var l=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(l,i),l}var l,u,s;function c(e){var t,r,a=e.visible,s=void 0===a||a,c=e.features,p=void 0===c?l.None:c,f=o(e,["visible","features"]);return s||p&l.Static&&f.props.static?d(f):p&l.RenderStrategy?i(null==(t=f.props.unmount)||t?u.Unmount:u.Hidden,((r={})[u.Unmount]=function(){return null},r[u.Hidden]=function(){return d(n({},f,{props:n({},f.props,{hidden:!0,style:{display:"none"}})}))},r)):d(f)}function d(e){var n,r=e.attrs,i=e.slots,l=e.slot,u=e.name,s=function(e,t){void 0===t&&(t=[]);for(var n,o=Object.assign({},e),r=a(t);!(n=r()).done;){var i=n.value;i in o&&delete o[i]}return o}(e.props,["unmount","static"]),c=s.as,d=o(s,["as"]),p=null==i.default?void 0:i.default(l);if("template"===c){if(Object.keys(d).length>0||Object.keys(r).length>0){var f=null!=p?p:[],v=f[0],m=f.slice(1);if(null==(n=v)||"string"!=typeof n.type&&"object"!=typeof n.type&&"function"!=typeof n.type||m.length>0)throw new Error(['Passing props on "template"!',"","The current component <"+u+' /> is rendering a "template".',"However we need to passthrough the following props:",Object.keys(d).concat(Object.keys(r)).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return t.cloneVNode(v,d)}return p}return t.h(c,d,p)}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(l||(l={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(u||(u={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",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"}(s||(s={}));var p=0;function f(){return++p}var v,m,h,b,y=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function g(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(y))}function S(e){null==e||e.focus({preventScroll:!0})}function w(e,t){var n=Array.isArray(e)?e:g(e),o=document.activeElement,r=function(){if(t&(v.First|v.Next))return h.Next;if(t&(v.Previous|v.Last))return h.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=function(){if(t&v.First)return 0;if(t&v.Previous)return Math.max(0,n.indexOf(o))-1;if(t&v.Next)return Math.max(0,n.indexOf(o))+1;if(t&v.Last)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),i=t&v.NoScroll?{preventScroll:!0}:{},l=0,u=n.length,s=void 0;do{var c;if(l>=u||l+u<=0)return m.Error;var d=a+l;if(t&v.WrapAround)d=(d+u)%u;else{if(d<0)return m.Underflow;if(d>=u)return m.Overflow}null==(c=s=n[d])||c.focus(i),l+=r}while(s!==document.activeElement);return s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),m.Success}function O(e,n,o){window.addEventListener(e,n,o),t.onUnmounted((function(){return window.removeEventListener(e,n,o)}))}function x(e,t){for(var n,o=a(e);!(n=o()).done;)if(n.value.contains(t))return!0;return!1}function E(e,n,o){void 0===n&&(n=t.ref(!0)),void 0===o&&(o=t.ref({}));var r=t.ref("undefined"!=typeof window?document.activeElement:null),i=t.ref(null);function l(){if(n.value&&1===e.value.size){var t=o.value.initialFocus,l=document.activeElement;if(t){if(t===l)return}else if(x(e.value,l))return;if(r.value=l,t)S(t);else{for(var u,s=!1,c=a(e.value);!(u=c()).done;)if(w(u.value,v.First)===m.Success){s=!0;break}if(!s)throw new Error("There are no focusable elements inside the <FocusTrap />")}i.value=document.activeElement}}function u(){S(r.value),r.value=null,i.value=null}t.watchEffect(l),t.onUpdated((function(){n.value?l():u()})),t.onUnmounted(u),O("keydown",(function(t){if(n.value&&t.key===s.Tab&&document.activeElement&&1===e.value.size){t.preventDefault();for(var o,r=a(e.value);!(o=r()).done;)if(w(o.value,(t.shiftKey?v.Previous:v.Next)|v.WrapAround)===m.Success){i.value=document.activeElement;break}}})),O("focus",(function(t){if(n.value&&1===e.value.size){var o=i.value;if(o){var r=t.target;r&&r instanceof HTMLElement?x(e.value,r)?(i.value=r,S(r)):(t.preventDefault(),t.stopPropagation(),S(o)):S(i.value)}}}),!0)}!function(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"}(v||(v={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(m||(m={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(h||(h={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(b||(b={}));var P=new Set,C=new Map;function k(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function D(e){var t=C.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var I,R=Symbol("StackContext");function T(){return t.inject(R,(function(){}))}!function(e){e[e.AddElement=0]="AddElement",e[e.RemoveElement=1]="RemoveElement"}(I||(I={}));var L=t.defineComponent({name:"StackProvider",props:{onUpdate:{type:Function,default:void 0}},setup:function(e,n){var o=n.slots,r=T();return t.provide(R,(function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];null==e.onUpdate||e.onUpdate.apply(e,n),r.apply(void 0,n)})),function(){return o.default()}}}),A=Symbol("ForcePortalRootContext"),j=t.defineComponent({name:"ForcePortalRoot",props:{force:{type:Boolean,default:!1}},setup:function(e,n){var o=n.slots;return t.provide(A,e.force),function(){return o.default()}}}),F=t.defineComponent({name:"Portal",props:{as:{type:[Object,String],default:"template"}},setup:function(e,n){var o=n.slots,r=n.attrs,a=t.inject(A,!1),i=t.inject($,null),l=t.ref(!0===a||null===i?function(){var e=document.getElementById("headlessui-portal-root");if(e)return e;var t=document.createElement("div");return t.setAttribute("id","headlessui-portal-root"),document.body.appendChild(t)}():i.resolveTarget());t.watchEffect((function(){a||null!==i&&(l.value=i.resolveTarget())}));var u=t.ref(null);return function(e){var n=T();t.watchEffect((function(t){var o=null==e?void 0:e.value;o&&(n(I.AddElement,o),t((function(){return n(I.RemoveElement,o)})))}))}(u),t.onUnmounted((function(){var e,t=document.getElementById("headlessui-portal-root");t&&l.value===t&&l.value.children.length<=0&&(null==(e=l.value.parentElement)||e.removeChild(l.value))})),function(){return null===l.value?null:t.h(L,{},(function(){return[t.h(t.Teleport,{to:l.value},[t.h("div",{ref:u},[c({props:e,slot:{},attrs:r,slots:o,name:"Portal"})])])]}))}}}),$=Symbol("PortalGroupContext"),B=t.defineComponent({name:"PortalGroup",props:{as:{type:[Object,String],default:"template"},target:{type:Object,default:null}},setup:function(e,n){var r=n.attrs,a=n.slots,i=t.reactive({resolveTarget:function(){return e.target}});return t.provide($,i),function(){return c({props:o(e,["target"]),slot:{},attrs:r,slots:a,name:"PortalGroup"})}}}),N=Symbol("DescriptionContext");function M(){var e=t.ref([]);return[t.computed((function(){return e.value.length>0?e.value.join(" "):void 0})),t.defineComponent({name:"DescriptionProvider",props:["slot","name","props"],setup:function(n,o){var r=o.slots;return t.provide(N,{register:function(t){return e.value.push(t),function(){var n=e.value.indexOf(t);-1!==n&&e.value.splice(n,1)}},slot:t.computed((function(){return n.slot})),name:t.computed((function(){return n.name})),props:t.computed((function(){return n.props}))}),function(){return r.default()}}})]}var K,U=t.defineComponent({name:"Description",props:{as:{type:[Object,String],default:"p"}},render:function(){var e=this.$props,t=n({},this.props,{id:this.id});return c({props:n({},this.props,e,t),slot:this.slot||{},attrs:this.$attrs,slots:this.$slots,name:this.name||"Description"})},setup:function(){var e=function(){var e=t.inject(N,null);if(null===e)throw new Error("Missing parent");return e}(),n=e.register,o=e.slot,r=e.name,a=e.props,i="headlessui-description-"+f();return t.onMounted((function(){return t.onUnmounted(n(i))})),{id:i,slot:o,name:r,props:a}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(K||(K={}));var V=Symbol("DialogContext");function G(e){var n=t.inject(V,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Dialog /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,G),o}return n}var W,q="DC8F892D-2EBD-447C-A4C8-A03058436FF4",H=t.defineComponent({name:"Dialog",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:Boolean,default:q},onClose:{type:Function,default:q},initialFocus:{type:Object,default:null}},render:function(){var e=this,r=n({},this.$attrs,{ref:"el",id:this.id,role:"dialog","aria-modal":this.dialogState===K.Open||void 0,"aria-labelledby":this.titleId,"aria-describedby":this.describedby}),a=this.$props,u=a.open,s=o(a,["open","onClose","initialFocus"]),d=this.containers,p={open:this.dialogState===K.Open};return t.h(L,{onUpdate:function(e,t){var n;return i(e,((n={})[I.AddElement]=function(){d.add(t)},n[I.RemoveElement]=function(){d.delete(t)},n))}},(function(){return[t.h(j,{force:!0},(function(){return[t.h(F,{},(function(){return[t.h(B,{target:e.dialogRef},(function(){return[t.h(j,{force:!1},(function(){return[t.h(e.DescriptionProvider,{slot:p},(function(){return[c({props:n({},s,r),slot:p,attrs:e.$attrs,slots:e.$slots,visible:u,features:l.RenderStrategy|l.Static,name:"Dialog"})]}))]}))]}))]}))]}))]}))},setup:function(e){var n=t.ref(new Set),o=e.open!==q,r=e.onClose!==q;if(!o&&!r)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!r)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof e.open)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+(e.open===q?void 0:e.open));if("function"!=typeof e.onClose)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+(e.onClose===q?void 0:e.onClose));var i=t.computed((function(){return e.open?K.Open:K.Closed})),l=t.ref(null),u=t.ref(i.value===K.Open);t.onUpdated((function(){u.value=i.value===K.Open}));var c="headlessui-dialog-"+f(),d=t.computed((function(){return{initialFocus:e.initialFocus}}));E(n,u,d),function(e,n){void 0===n&&(n=t.ref(!0)),t.watchEffect((function(t){if(n.value&&e.value){var o=e.value;P.add(o);for(var r,i=a(C.keys());!(r=i()).done;){var l=r.value;l.contains(o)&&(D(l),C.delete(l))}document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=a(P);!(t=n()).done;)if(e.contains(t.value))return;1===P.size&&(C.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),k(e))}})),t((function(){if(P.delete(o),P.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!C.has(e)){for(var t,n=a(P);!(t=n()).done;)if(e.contains(t.value))return;C.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),k(e)}}));else for(var e,t=a(C.keys());!(e=t()).done;){var n=e.value;D(n),C.delete(n)}}))}}))}(l,u);var p=M(),v=p[0],m=p[1],h=t.ref(null),b={titleId:h,dialogState:i,setTitleId:function(e){h.value!==e&&(h.value=e)},close:function(){e.onClose(!1)}};return t.provide(V,b),O("mousedown",(function(e){var o=e.target;i.value===K.Open&&1===n.value.size&&(x(n.value,o)||(b.close(),t.nextTick((function(){null==o||o.focus()}))))})),O("keydown",(function(e){e.key===s.Escape&&i.value===K.Open&&(n.value.size>1||b.close())})),t.watchEffect((function(e){if(i.value===K.Open){var t=document.documentElement.style.overflow,n=document.documentElement.style.paddingRight,o=window.innerWidth-document.documentElement.clientWidth;document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=o+"px",e((function(){document.documentElement.style.overflow=t,document.documentElement.style.paddingRight=n}))}})),t.watchEffect((function(e){if(i.value===K.Open&&l.value){var t=new IntersectionObserver((function(e){for(var t,n=a(e);!(t=n()).done;){var o=t.value;0===o.boundingClientRect.x&&0===o.boundingClientRect.y&&0===o.boundingClientRect.width&&0===o.boundingClientRect.height&&b.close()}}));t.observe(l.value),e((function(){return t.disconnect()}))}})),{id:c,el:l,dialogRef:l,containers:n,dialogState:i,titleId:h,describedby:v,DescriptionProvider:m}}}),_=t.defineComponent({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e=G("DialogOverlay");return c({props:n({},this.$props,{ref:"el",id:this.id,"aria-hidden":!0,onClick:this.handleClick}),slot:{open:e.dialogState.value===K.Open},attrs:this.$attrs,slots:this.$slots,name:"DialogOverlay"})},setup:function(){var e=G("DialogOverlay");return{id:"headlessui-dialog-overlay-"+f(),handleClick:function(){e.close()}}}}),z=t.defineComponent({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"}},render:function(){var e=G("DialogTitle");return c({props:n({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===K.Open},attrs:this.$attrs,slots:this.$slots,name:"DialogTitle"})},setup:function(){var e=G("DialogTitle"),n="headlessui-dialog-title-"+f();return t.onMounted((function(){e.setTitleId(n),t.onUnmounted((function(){return e.setTitleId(null)}))})),{id:n}}}),Y=U;function Q(e){var t;return null==e||null==e.value?null:null!=(t=e.value.$el)?t:e.value}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(W||(W={}));var J=Symbol("DisclosureContext");function X(e){var n=t.inject(J,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Disclosure /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,X),o}return n}var Z,ee,te=t.defineComponent({name:"Disclosure",props:{as:{type:[Object,String],default:"template"}},setup:function(e,o){var r=o.slots,a=o.attrs,l=n({},e),u=t.ref(W.Closed),s=t.ref(null);return t.provide(J,{disclosureState:u,panelRef:s,toggleDisclosure:function(){var e;u.value=i(u.value,((e={})[W.Open]=W.Closed,e[W.Closed]=W.Open,e))}}),function(){return c({props:l,slot:{open:u.value===W.Open},slots:r,attrs:a,name:"Disclosure"})}}}),ne=t.defineComponent({name:"DisclosureButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=X("DisclosureButton"),t={open:e.disclosureState.value===W.Open};return c({props:n({},this.$props,{id:this.id,type:"button","aria-expanded":e.disclosureState.value===W.Open||void 0,"aria-controls":this.ariaControls,onClick:this.handleClick,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp}),slot:t,attrs:this.$attrs,slots:this.$slots,name:"DisclosureButton"})},setup:function(e){var n=X("DisclosureButton");return{id:"headlessui-disclosure-button-"+f(),ariaControls:t.computed((function(){var e,t;return null!=(e=null==(t=Q(n.panelRef))?void 0:t.id)?e:void 0})),handleClick:function(){e.disabled||n.toggleDisclosure()},handleKeyDown:function(t){if(!e.disabled)switch(t.key){case s.Space:case s.Enter:t.preventDefault(),t.stopPropagation(),n.toggleDisclosure()}},handleKeyUp:function(e){switch(e.key){case s.Space:e.preventDefault()}}}}}),oe=t.defineComponent({name:"DisclosurePanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e={open:X("DisclosurePanel").disclosureState.value===W.Open};return c({props:n({},this.$props,{id:this.id,ref:"el"}),slot:e,attrs:this.$attrs,slots:this.$slots,features:l.RenderStrategy|l.Static,visible:e.open,name:"DisclosurePanel"})},setup:function(){var e=X("DisclosurePanel");return{id:"headlessui-disclosure-panel-"+f(),el:e.panelRef}}}),re=t.defineComponent({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null}},render:function(){return c({props:n({},o(this.$props,["initialFocus"]),{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"FocusTrap"})},setup:function(e){var n=t.ref(new Set),o=t.ref(null),r=t.ref(!0),a=t.computed((function(){return{initialFocus:e.initialFocus}}));return t.onMounted((function(){o.value&&(n.value.add(o.value),E(n,r,a))})),t.onUnmounted((function(){r.value=!1})),{el:o}}});function ae(e,t){var n=t.resolveItems();if(n.length<=0)return null;var o=t.resolveActiveIndex(),r=null!=o?o:-1,a=function(){switch(e.focus){case Z.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case Z.Previous:var o=n.slice().reverse().findIndex((function(e,n,o){return!(-1!==r&&o.length-n-1>=r||t.resolveDisabled(e))}));return-1===o?o:n.length-1-o;case Z.Next:return n.findIndex((function(e,n){return!(n<=r||t.resolveDisabled(e))}));case Z.Last:var a=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===a?a:n.length-1-a;case Z.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case Z.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===a?o:a}function ie(e,t){if(void 0!==e)return"function"==typeof e?e(t):e}!function(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"}(Z||(Z={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ee||(ee={}));var le=Symbol("ListboxContext");function ue(e){var n=t.inject(le,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Listbox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,ue),o}return n}var se,ce=t.defineComponent({name:"Listbox",emits:["update:modelValue"],props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean],default:null}},setup:function(e,n){var r=n.slots,a=n.attrs,i=n.emit,l=e.disabled,u=o(e,["modelValue","disabled"]),s=t.ref(ee.Closed),d=t.ref(null),p=t.ref(null),f=t.ref(null),v=t.ref([]),m=t.ref(""),h=t.ref(null),b=t.computed((function(){return e.modelValue})),y={listboxState:s,value:b,labelRef:d,buttonRef:p,optionsRef:f,disabled:l,options:v,searchQuery:m,activeOptionIndex:h,closeListbox:function(){l||s.value!==ee.Closed&&(s.value=ee.Closed,h.value=null)},openListbox:function(){l||s.value!==ee.Open&&(s.value=ee.Open)},goToOption:function(e,t){if(!l&&s.value!==ee.Closed){var n=ae(e===Z.Specific?{focus:Z.Specific,id:t}:{focus:e},{resolveItems:function(){return v.value},resolveActiveIndex:function(){return h.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===m.value&&h.value===n||(m.value="",h.value=n)}},search:function(e){if(!l&&s.value!==ee.Closed){m.value+=e;var t=v.value.findIndex((function(e){return!e.dataRef.disabled&&e.dataRef.textValue.startsWith(m.value)}));-1!==t&&t!==h.value&&(h.value=t)}},clearSearch:function(){l||s.value!==ee.Closed&&""!==m.value&&(m.value="")},registerOption:function(e,t){v.value.push({id:e,dataRef:t})},unregisterOption:function(e){var t=v.value.slice(),n=null!==h.value?t[h.value]:null,o=t.findIndex((function(t){return t.id===e}));-1!==o&&t.splice(o,1),v.value=t,h.value=o===h.value||null===n?null:t.indexOf(n)},select:function(e){l||i("update:modelValue",e)}};return O("mousedown",(function(e){var t,n,o,r=e.target,a=document.activeElement;s.value===ee.Open&&((null==(t=Q(p))?void 0:t.contains(r))||((null==(n=Q(f))?void 0:n.contains(r))||y.closeListbox(),a!==document.body&&(null==a?void 0:a.contains(r))||e.defaultPrevented||null==(o=Q(p))||o.focus({preventScroll:!0})))})),t.provide(le,y),function(){return c({props:u,slot:{open:s.value===ee.Open,disabled:l},slots:r,attrs:a,name:"Listbox"})}}}),de=t.defineComponent({name:"ListboxLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){var e=ue("ListboxLabel"),t={open:e.listboxState.value===ee.Open,disabled:e.disabled};return c({props:n({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:t,attrs:this.$attrs,slots:this.$slots,name:"ListboxLabel"})},setup:function(){var e=ue("ListboxLabel");return{id:"headlessui-listbox-label-"+f(),el:e.labelRef,handleClick:function(){var t;null==(t=Q(e.buttonRef))||t.focus({preventScroll:!0})}}}}),pe=t.defineComponent({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"}},render:function(){var e,t,o=ue("ListboxButton"),r={open:o.listboxState.value===ee.Open,disabled:o.disabled},a={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=Q(o.optionsRef))?void 0:e.id,"aria-expanded":o.listboxState.value===ee.Open||void 0,"aria-labelledby":o.labelRef.value?[null==(t=Q(o.labelRef))?void 0:t.id,this.id].join(" "):void 0,disabled:o.disabled,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return c({props:n({},this.$props,a),slot:r,attrs:this.$attrs,slots:this.$slots,name:"ListboxButton"})},setup:function(){var e=ue("ListboxButton");return{id:"headlessui-listbox-button-"+f(),el:e.buttonRef,handleKeyDown:function(n){switch(n.key){case s.Space:case s.Enter:case s.ArrowDown:n.preventDefault(),e.openListbox(),t.nextTick((function(){var t;null==(t=Q(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(Z.First)}));break;case s.ArrowUp:n.preventDefault(),e.openListbox(),t.nextTick((function(){var t;null==(t=Q(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(Z.Last)}))}},handleKeyUp:function(e){switch(e.key){case s.Space:e.preventDefault()}},handleClick:function(n){var o;e.disabled||(e.listboxState.value===ee.Open?(e.closeListbox(),t.nextTick((function(){var t;return null==(t=Q(e.buttonRef))?void 0:t.focus({preventScroll:!0})}))):(n.preventDefault(),e.openListbox(),o=function(){var t;return null==(t=Q(e.optionsRef))?void 0:t.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(o)}))))}}}}),fe=t.defineComponent({name:"ListboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,o,r,a=ue("ListboxOptions"),i={open:a.listboxState.value===ee.Open},u={"aria-activedescendant":null===a.activeOptionIndex.value||null==(e=a.options.value[a.activeOptionIndex.value])?void 0:e.id,"aria-labelledby":null!=(t=null==(o=Q(a.labelRef))?void 0:o.id)?t:null==(r=Q(a.buttonRef))?void 0:r.id,id:this.id,onKeydown:this.handleKeyDown,role:"listbox",tabIndex:0,ref:"el"};return c({props:n({},this.$props,u),slot:i,attrs:this.$attrs,slots:this.$slots,features:l.RenderStrategy|l.Static,visible:i.open,name:"ListboxOptions"})},setup:function(){var e=ue("ListboxOptions"),n="headlessui-listbox-options-"+f(),o=t.ref(null);return{id:n,el:e.optionsRef,handleKeyDown:function(n){switch(o.value&&clearTimeout(o.value),n.key){case s.Space:if(""!==e.searchQuery.value)return n.preventDefault(),n.stopPropagation(),e.search(n.key);case s.Enter:n.preventDefault(),n.stopPropagation(),null!==e.activeOptionIndex.value&&e.select(e.options.value[e.activeOptionIndex.value].dataRef.value),e.closeListbox(),t.nextTick((function(){var t;return null==(t=Q(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.ArrowDown:return n.preventDefault(),n.stopPropagation(),e.goToOption(Z.Next);case s.ArrowUp:return n.preventDefault(),n.stopPropagation(),e.goToOption(Z.Previous);case s.Home:case s.PageUp:return n.preventDefault(),n.stopPropagation(),e.goToOption(Z.First);case s.End:case s.PageDown:return n.preventDefault(),n.stopPropagation(),e.goToOption(Z.Last);case s.Escape:n.preventDefault(),n.stopPropagation(),e.closeListbox(),t.nextTick((function(){var t;return null==(t=Q(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.Tab:n.preventDefault(),n.stopPropagation();break;default:1===n.key.length&&(e.search(n.key),o.value=setTimeout((function(){return e.clearSearch()}),350))}}}}}),ve=t.defineComponent({name:"ListboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String],default:null},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},setup:function(e,o){var r=o.slots,a=o.attrs,i=ue("ListboxOption"),l="headlessui-listbox-option-"+f(),u=e.disabled,s=e.className,d=void 0===s?e.class:s,p=e.value,v=t.computed((function(){return null!==i.activeOptionIndex.value&&i.options.value[i.activeOptionIndex.value].id===l})),m=t.computed((function(){return t.toRaw(i.value.value)===t.toRaw(p)})),h=t.ref({disabled:u,value:p,textValue:""});function b(e){if(u)return e.preventDefault();i.select(p),i.closeListbox(),t.nextTick((function(){var e;return null==(e=Q(i.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function y(){if(u)return i.goToOption(Z.Nothing);i.goToOption(Z.Specific,l)}function g(){u||v.value||i.goToOption(Z.Specific,l)}function S(){u||v.value&&i.goToOption(Z.Nothing)}return t.onMounted((function(){var e,t,n=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(h.value.textValue=n)})),t.onMounted((function(){return i.registerOption(l,h)})),t.onUnmounted((function(){return i.unregisterOption(l)})),t.onMounted((function(){t.watch([i.listboxState,m],(function(){var e;i.listboxState.value===ee.Open&&m.value&&(i.goToOption(Z.Specific,l),null==(e=document.getElementById(l))||null==e.focus||e.focus())}),{immediate:!0})})),t.watchEffect((function(){i.listboxState.value===ee.Open&&v.value&&t.nextTick((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:v.value,selected:m.value,disabled:u},o={id:l,role:"option",tabIndex:-1,class:ie(d,t),"aria-disabled":!0===u||void 0,"aria-selected":!0===m.value?m.value:void 0,onClick:b,onFocus:y,onPointermove:g,onMousemove:g,onPointerleave:S,onMouseleave:S};return c({props:n({},e,o),slot:t,attrs:a,slots:r,name:"ListboxOption"})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(se||(se={}));var me=Symbol("MenuContext");function he(e){var n=t.inject(me,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Menu /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,he),o}return n}var be,ye=t.defineComponent({name:"Menu",props:{as:{type:[Object,String],default:"template"}},setup:function(e,n){var o=n.slots,r=n.attrs,a=t.ref(se.Closed),i=t.ref(null),l=t.ref(null),u=t.ref([]),s=t.ref(""),d=t.ref(null),p={menuState:a,buttonRef:i,itemsRef:l,items:u,searchQuery:s,activeItemIndex:d,closeMenu:function(){a.value=se.Closed,d.value=null},openMenu:function(){return a.value=se.Open},goToItem:function(e,t){var n=ae(e===Z.Specific?{focus:Z.Specific,id:t}:{focus:e},{resolveItems:function(){return u.value},resolveActiveIndex:function(){return d.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===s.value&&d.value===n||(s.value="",d.value=n)},search:function(e){s.value+=e;var t=u.value.findIndex((function(e){return e.dataRef.textValue.startsWith(s.value)&&!e.dataRef.disabled}));-1!==t&&t!==d.value&&(d.value=t)},clearSearch:function(){s.value=""},registerItem:function(e,t){u.value.push({id:e,dataRef:t})},unregisterItem:function(e){var t=u.value.slice(),n=null!==d.value?t[d.value]:null,o=t.findIndex((function(t){return t.id===e}));-1!==o&&t.splice(o,1),u.value=t,d.value=o===d.value||null===n?null:t.indexOf(n)}};return O("mousedown",(function(e){var t,n,o,r=e.target,u=document.activeElement;a.value===se.Open&&((null==(t=Q(i))?void 0:t.contains(r))||((null==(n=Q(l))?void 0:n.contains(r))||p.closeMenu(),u!==document.body&&(null==u?void 0:u.contains(r))||e.defaultPrevented||null==(o=Q(i))||o.focus({preventScroll:!0})))})),t.provide(me,p),function(){return c({props:e,slot:{open:a.value===se.Open},slots:o,attrs:r,name:"Menu"})}}}),ge=t.defineComponent({name:"MenuButton",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"}},render:function(){var e,t=he("MenuButton"),o={open:t.menuState.value===se.Open},r={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=Q(t.itemsRef))?void 0:e.id,"aria-expanded":t.menuState.value===se.Open||void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return c({props:n({},this.$props,r),slot:o,attrs:this.$attrs,slots:this.$slots,name:"MenuButton"})},setup:function(e){var n=he("MenuButton");return{id:"headlessui-menu-button-"+f(),el:n.buttonRef,handleKeyDown:function(e){switch(e.key){case s.Space:case s.Enter:case s.ArrowDown:e.preventDefault(),e.stopPropagation(),n.openMenu(),t.nextTick((function(){var e;null==(e=Q(n.itemsRef))||e.focus({preventScroll:!0}),n.goToItem(Z.First)}));break;case s.ArrowUp:e.preventDefault(),e.stopPropagation(),n.openMenu(),t.nextTick((function(){var e;null==(e=Q(n.itemsRef))||e.focus({preventScroll:!0}),n.goToItem(Z.Last)}))}},handleKeyUp:function(e){switch(e.key){case s.Space:e.preventDefault()}},handleClick:function(o){var r;e.disabled||(n.menuState.value===se.Open?(n.closeMenu(),t.nextTick((function(){var e;return null==(e=Q(n.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(o.preventDefault(),o.stopPropagation(),n.openMenu(),r=function(){var e;return null==(e=Q(n.itemsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(r)}))))}}}}),Se=t.defineComponent({name:"MenuItems",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,o=he("MenuItems"),r={open:o.menuState.value===se.Open},a={"aria-activedescendant":null===o.activeItemIndex.value||null==(e=o.items.value[o.activeItemIndex.value])?void 0:e.id,"aria-labelledby":null==(t=Q(o.buttonRef))?void 0:t.id,id:this.id,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,role:"menu",tabIndex:0,ref:"el"};return c({props:n({},this.$props,a),slot:r,attrs:this.$attrs,slots:this.$slots,features:l.RenderStrategy|l.Static,visible:r.open,name:"MenuItems"})},setup:function(){var e=he("MenuItems"),n="headlessui-menu-items-"+f(),o=t.ref(null);return t.watchEffect((function(){var t=Q(e.itemsRef);if(t&&e.menuState.value===se.Open)for(var n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});n.nextNode();)n.currentNode.setAttribute("role","none")})),{id:n,el:e.itemsRef,handleKeyDown:function(n){switch(o.value&&clearTimeout(o.value),n.key){case s.Space:if(""!==e.searchQuery.value)return n.preventDefault(),n.stopPropagation(),e.search(n.key);case s.Enter:var r;n.preventDefault(),n.stopPropagation(),null!==e.activeItemIndex.value&&(null==(r=document.getElementById(e.items.value[e.activeItemIndex.value].id))||r.click()),e.closeMenu(),t.nextTick((function(){var t;return null==(t=Q(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.ArrowDown:return n.preventDefault(),n.stopPropagation(),e.goToItem(Z.Next);case s.ArrowUp:return n.preventDefault(),n.stopPropagation(),e.goToItem(Z.Previous);case s.Home:case s.PageUp:return n.preventDefault(),n.stopPropagation(),e.goToItem(Z.First);case s.End:case s.PageDown:return n.preventDefault(),n.stopPropagation(),e.goToItem(Z.Last);case s.Escape:n.preventDefault(),n.stopPropagation(),e.closeMenu(),t.nextTick((function(){var t;return null==(t=Q(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.Tab:n.preventDefault(),n.stopPropagation();break;default:1===n.key.length&&(e.search(n.key),o.value=setTimeout((function(){return e.clearSearch()}),350))}},handleKeyUp:function(e){switch(e.key){case s.Space:e.preventDefault()}}}}}),we=t.defineComponent({name:"MenuItem",props:{as:{type:[Object,String],default:"template"},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},setup:function(e,o){var r=o.slots,a=o.attrs,i=he("MenuItem"),l="headlessui-menu-item-"+f(),u=e.disabled,s=e.className,d=void 0===s?e.class:s,p=t.computed((function(){return null!==i.activeItemIndex.value&&i.items.value[i.activeItemIndex.value].id===l})),v=t.ref({disabled:u,textValue:""});function m(e){if(u)return e.preventDefault();i.closeMenu(),t.nextTick((function(){var e;return null==(e=Q(i.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function h(){if(u)return i.goToItem(Z.Nothing);i.goToItem(Z.Specific,l)}function b(){u||p.value||i.goToItem(Z.Specific,l)}function y(){u||p.value&&i.goToItem(Z.Nothing)}return t.onMounted((function(){var e,t,n=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(v.value.textValue=n)})),t.onMounted((function(){return i.registerItem(l,v)})),t.onUnmounted((function(){return i.unregisterItem(l)})),t.watchEffect((function(){i.menuState.value===se.Open&&p.value&&t.nextTick((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:p.value,disabled:u},o={id:l,role:"menuitem",tabIndex:-1,class:ie(d,t),"aria-disabled":!0===u||void 0,onClick:m,onFocus:h,onPointermove:b,onMousemove:b,onPointerleave:y,onMouseleave:y};return c({props:n({},e,o),slot:t,attrs:a,slots:r,name:"MenuItem"})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(be||(be={}));var Oe=Symbol("PopoverContext");function xe(e){var n=t.inject(Oe,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <"+ke.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,xe),o}return n}var Ee=Symbol("PopoverGroupContext");function Pe(){return t.inject(Ee,null)}var Ce=Symbol("PopoverPanelContext"),ke=t.defineComponent({name:"Popover",props:{as:{type:[Object,String],default:"div"}},setup:function(e,o){var r=o.slots,a=o.attrs,l=n({},e),u="headlessui-popover-button-"+f(),s="headlessui-popover-panel-"+f(),d=t.ref(be.Closed),p=t.ref(null),v=t.ref(null),m={popoverState:d,buttonId:u,panelId:s,panel:v,button:p,togglePopover:function(){var e;d.value=i(d.value,((e={})[be.Open]=be.Closed,e[be.Closed]=be.Open,e))},closePopover:function(){d.value!==be.Closed&&(d.value=be.Closed)}};t.provide(Oe,m);var h={buttonId:u,panelId:s,close:function(){m.closePopover()}},g=Pe(),S=null==g?void 0:g.registerPopover;return t.watchEffect((function(){return null==S?void 0:S(h)})),O("focus",(function(){var e,t,n;d.value===be.Open&&((null!=(e=null==g?void 0:g.isFocusWithinPopoverGroup())?e:(null==(t=Q(p))?void 0:t.contains(document.activeElement))||(null==(n=Q(v))?void 0:n.contains(document.activeElement)))||p&&v&&m.closePopover())}),!0),O("mousedown",(function(e){var t,n,o,r,a,l,u=e.target;d.value===be.Open&&((null==(t=Q(p))?void 0:t.contains(u))||(null==(n=Q(v))?void 0:n.contains(u))||(m.closePopover(),void 0===(a=b.Loose)&&(a=b.Strict),(r=u)!==document.body&&i(a,((l={})[b.Strict]=function(){return r.matches(y)},l[b.Loose]=function(){for(var e=r;null!==e;){if(e.matches(y))return!0;e=e.parentElement}return!1},l))||(e.preventDefault(),null==(o=Q(p))||o.focus())))})),function(){return c({props:l,slot:{open:d.value===be.Open},slots:r,attrs:a,name:"Popover"})}}}),De=t.defineComponent({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=xe("PopoverButton"),t={open:e.popoverState.value===be.Open},o=this.isWithinPanel?{type:"button",onKeydown:this.handleKeyDown,onClick:this.handleClick}:{ref:"el",id:e.buttonId,type:"button","aria-expanded":e.popoverState.value===be.Open||void 0,"aria-controls":Q(e.panel)?e.panelId:void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return c({props:n({},this.$props,o),slot:t,attrs:this.$attrs,slots:this.$slots,name:"PopoverButton"})},setup:function(e){var n=xe("PopoverButton"),o=Pe(),r=null==o?void 0:o.closeOthers,a=t.inject(Ce,null),i=null!==a&&a===n.panelId,l=t.ref(null),u=t.ref("undefined"==typeof window?null:document.activeElement);return O("focus",(function(){u.value=l.value,l.value=document.activeElement}),!0),{isWithinPanel:i,el:i?null:n.button,handleKeyDown:function(e){var t,o;if(i){if(n.popoverState.value===be.Closed)return;switch(e.key){case s.Space:case s.Enter:e.preventDefault(),e.stopPropagation(),n.closePopover(),null==(t=Q(n.button))||t.focus()}}else switch(e.key){case s.Space:case s.Enter:e.preventDefault(),e.stopPropagation(),n.popoverState.value===be.Closed&&(null==r||r(n.buttonId)),n.togglePopover();break;case s.Escape:if(n.popoverState.value!==be.Open)return null==r?void 0:r(n.buttonId);if(!Q(n.button))return;if(!(null==(o=Q(n.button))?void 0:o.contains(document.activeElement)))return;n.closePopover();break;case s.Tab:if(n.popoverState.value!==be.Open)return;if(!n.panel)return;if(!n.button)return;if(e.shiftKey){var a,l;if(!u.value)return;if(null==(a=Q(n.button))?void 0:a.contains(u.value))return;if(null==(l=Q(n.panel))?void 0:l.contains(u.value))return;var c=g(),d=c.indexOf(u.value);if(c.indexOf(Q(n.button))>d)return;e.preventDefault(),e.stopPropagation(),w(Q(n.panel),v.Last)}else e.preventDefault(),e.stopPropagation(),w(Q(n.panel),v.First)}},handleKeyUp:function(e){var t,o;if(!i&&(e.key===s.Space&&e.preventDefault(),n.popoverState.value===be.Open&&n.panel&&n.button))switch(e.key){case s.Tab:if(!u.value)return;if(null==(t=Q(n.button))?void 0:t.contains(u.value))return;if(null==(o=Q(n.panel))?void 0:o.contains(u.value))return;var r=g(),a=r.indexOf(u.value);if(r.indexOf(Q(n.button))>a)return;e.preventDefault(),e.stopPropagation(),w(Q(n.panel),v.Last)}},handleClick:function(){var t,o;e.disabled||(i?(n.closePopover(),null==(t=Q(n.button))||t.focus()):(n.popoverState.value===be.Closed&&(null==r||r(n.buttonId)),null==(o=Q(n.button))||o.focus(),n.togglePopover()))},handleFocus:function(){}}}}),Ie=t.defineComponent({name:"PopoverOverlay",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e={open:xe("PopoverOverlay").popoverState.value===be.Open};return c({props:n({},this.$props,{id:this.id,ref:"el","aria-hidden":!0,onClick:this.handleClick}),slot:e,attrs:this.$attrs,slots:this.$slots,features:l.RenderStrategy|l.Static,visible:e.open,name:"PopoverOverlay"})},setup:function(){var e=xe("PopoverOverlay");return{id:"headlessui-popover-overlay-"+f(),handleClick:function(){e.closePopover()}}}}),Re=t.defineComponent({name:"PopoverPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},focus:{type:Boolean,default:!1}},render:function(){var e={open:xe("PopoverPanel").popoverState.value===be.Open};return c({props:n({},this.$props,{ref:"el",id:this.id,onKeydown:this.handleKeyDown}),slot:e,attrs:this.$attrs,slots:this.$slots,features:l.RenderStrategy|l.Static,visible:e.open,name:"PopoverPanel"})},setup:function(e){var n=e.focus,o=xe("PopoverPanel");return t.provide(Ce,o.panelId),t.onUnmounted((function(){o.panel.value=null})),t.watchEffect((function(){var e;if(n&&o.popoverState.value===be.Open&&o.panel){var t=document.activeElement;(null==(e=Q(o.panel))?void 0:e.contains(t))||w(Q(o.panel),v.First)}})),O("keydown",(function(e){var t;if(o.popoverState.value===be.Open&&Q(o.panel)&&e.key===s.Tab&&document.activeElement&&(null==(t=Q(o.panel))?void 0:t.contains(document.activeElement))){e.preventDefault();var n,r=w(Q(o.panel),e.shiftKey?v.Previous:v.Next);if(r===m.Underflow)return null==(n=Q(o.button))?void 0:n.focus();if(r===m.Overflow){if(!Q(o.button))return;var a=g(),i=a.indexOf(Q(o.button));w(a.splice(i+1).filter((function(e){var t;return!(null==(t=Q(o.panel))?void 0:t.contains(e))})),v.First)===m.Error&&w(document.body,v.First)}}})),O("focus",(function(){var e;n&&o.popoverState.value===be.Open&&Q(o.panel)&&((null==(e=Q(o.panel))?void 0:e.contains(document.activeElement))||o.closePopover())}),!0),{id:o.panelId,el:o.panel,handleKeyDown:function(e){var t,n;switch(e.key){case s.Escape:if(o.popoverState.value!==be.Open)return;if(!Q(o.panel))return;if(!(null==(t=Q(o.panel))?void 0:t.contains(document.activeElement)))return;e.preventDefault(),o.closePopover(),null==(n=Q(o.button))||n.focus()}}}}}),Te=t.defineComponent({name:"PopoverGroup",props:{as:{type:[Object,String],default:"div"}},render:function(){return c({props:n({},this.$props,{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"PopoverGroup"})},setup:function(){var e=t.ref(null),n=t.ref([]);function o(e){var t=n.value.indexOf(e);-1!==t&&n.value.splice(t,1)}return t.provide(Ee,{registerPopover:function(e){return n.value.push(e),function(){o(e)}},unregisterPopover:o,isFocusWithinPopoverGroup:function(){var t,o=document.activeElement;return!!(null==(t=Q(e))?void 0:t.contains(o))||n.value.some((function(e){var t,n;return(null==(t=document.getElementById(e.buttonId))?void 0:t.contains(o))||(null==(n=document.getElementById(e.panelId))?void 0:n.contains(o))}))},closeOthers:function(e){for(var t,o=a(n.value);!(t=o()).done;){var r=t.value;r.buttonId!==e&&r.close()}}}),{el:e}}}),Le=Symbol("LabelContext");function Ae(){var e=t.inject(Le,null);if(null===e){var n=new Error("You used a <Label /> component, but it is not inside a parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ae),n}return e}function je(){var e=t.ref([]);return[t.computed((function(){return e.value.length>0?e.value.join(" "):void 0})),t.defineComponent({name:"LabelProvider",props:{slot:{type:Object,default:void 0},name:{type:String,default:void 0},props:{type:Object,default:void 0}},setup:function(n,o){var r=o.slots;return t.provide(Le,{register:function(t){return e.value.push(t),function(){var n=e.value.indexOf(t);-1!==n&&e.value.splice(n,1)}},slot:t.computed((function(){return n.slot})),name:t.computed((function(){return n.name})),props:t.computed((function(){return n.props}))}),function(){return r.default()}}})]}var Fe=t.defineComponent({name:"Label",props:{as:{type:[Object,String],default:"label"},clickable:{type:[Boolean],default:!1}},render:function(){var e=this.$props,t=e.clickable,r=o(e,["clickable"]),a=n({},this.props,{id:this.id}),i=n({},r,a);return t||delete i.onClick,c({props:i,slot:this.slot||{},attrs:this.$attrs,slots:this.$slots,name:this.name||"Label"})},setup:function(){var e=Ae(),n=e.register,o=e.slot,r=e.name,a=e.props,i="headlessui-label-"+f();return t.onMounted((function(){return t.onUnmounted(n(i))})),{id:i,slot:o,name:r,props:a}}}),$e=Symbol("RadioGroupContext");function Be(e){var n=t.inject($e,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <RadioGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Be),o}return n}var Ne,Me=t.defineComponent({name:"RadioGroup",emits:["update:modelValue"],inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},disabled:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean]}},render:function(){var e=this,r=o(this.$props,["modelValue","disabled"]),a=n({},this.$attrs,{ref:"el",id:this.id,role:"radiogroup","aria-labelledby":this.labelledby,"aria-describedby":this.describedby,onKeydown:this.handleKeyDown});return t.h(this.DescriptionProvider,(function(){return[t.h(e.LabelProvider,(function(){return[c({props:n({},r,a),slot:{},attrs:e.$attrs,slots:e.$slots,name:"RadioGroup"})]}))]}))},setup:function(e,n){var o=n.emit,r=t.ref(null),a=t.ref([]),i=je(),l=i[0],u=i[1],c=M(),d=c[0],p=c[1],h=t.computed((function(){return e.modelValue})),b={options:a,value:h,change:function(t){e.disabled||h.value!==t&&o("update:modelValue",t)},registerOption:function(e){var t,n=Array.from(null==(t=r.value)?void 0:t.querySelectorAll('[id^="headlessui-radiogroup-option-"]')).reduce((function(e,t,n){var o;return Object.assign(e,((o={})[t.id]=n,o))}),{});a.value.push(e),a.value.sort((function(e,t){return n[e.id]-n[t.id]}))},unregisterOption:function(e){var t=a.value.findIndex((function(t){return t.id===e}));-1!==t&&a.value.splice(t,1)}};return t.provide($e,b),t.watchEffect((function(){var e=Q(r);if(e)for(var t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});t.nextNode();)t.currentNode.setAttribute("role","none")})),{id:"headlessui-radiogroup-"+f(),labelledby:l,describedby:d,el:r,handleKeyDown:function(e){if(r.value&&r.value.contains(e.target))switch(e.key){case s.ArrowLeft:case s.ArrowUp:if(e.preventDefault(),e.stopPropagation(),w(a.value.map((function(e){return e.element})),v.Previous|v.WrapAround)===m.Success){var t=a.value.find((function(e){return e.element===document.activeElement}));t&&b.change(t.propsRef.value)}break;case s.ArrowRight:case s.ArrowDown:if(e.preventDefault(),e.stopPropagation(),w(a.value.map((function(e){return e.element})),v.Next|v.WrapAround)===m.Success){var n=a.value.find((function(e){return e.element===document.activeElement}));n&&b.change(n.propsRef.value)}break;case s.Space:e.preventDefault(),e.stopPropagation();var o=a.value.find((function(e){return e.element===document.activeElement}));o&&b.change(o.propsRef.value)}},LabelProvider:u,DescriptionProvider:p}}});!function(e){e[e.Empty=1]="Empty",e[e.Active=2]="Active"}(Ne||(Ne={}));var Ke=t.defineComponent({name:"RadioGroupOption",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},value:{type:[Object,String]},disabled:{type:Boolean,default:!1},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},render:function(){var e,r,a=this,i=this.$props,l=i.className,u=void 0===l?i.class:l,s=o(i,["value","disabled","class","className"]),d=Be("RadioGroupOption"),p=(null==(e=d.options.value)||null==(r=e[0])?void 0:r.id)===this.id,f={checked:this.checked,active:Boolean(this.state&Ne.Active)},v=n({},this.$attrs,{id:this.id,ref:"el",role:"radio",class:ie(u,f),"aria-checked":this.checked?"true":"false","aria-labelledby":this.labelledby,"aria-describedby":this.describedby,tabIndex:this.checked||void 0===d.value.value&&p?0:-1,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur});return t.h(this.DescriptionProvider,(function(){return[t.h(a.LabelProvider,(function(){return[c({props:n({},s,v),slot:f,attrs:a.$attrs,slots:a.$slots,name:"RadioGroupOption"})]}))]}))},setup:function(e){var n=Be("RadioGroupOption"),o="headlessui-radiogroup-option-"+f(),r=je(),a=r[0],i=r[1],l=M(),u=l[0],s=l[1],c=t.ref(null),d=t.computed((function(){return{value:e.value}})),p=t.ref(Ne.Empty);return t.onMounted((function(){return n.registerOption({id:o,element:c,propsRef:d})})),t.onUnmounted((function(){return n.unregisterOption(o)})),{id:o,el:c,labelledby:a,describedby:u,state:p,LabelProvider:i,DescriptionProvider:s,checked:t.computed((function(){return t.toRaw(n.value.value)===t.toRaw(e.value)})),handleClick:function(){var t,o=e.value;n.value.value!==o&&(p.value|=Ne.Active,n.change(o),null==(t=c.value)||t.focus())},handleFocus:function(){p.value|=Ne.Active},handleBlur:function(){p.value&=~Ne.Active}}}}),Ue=Fe,Ve=U,Ge=Symbol("GroupContext"),We=t.defineComponent({name:"SwitchGroup",inheritAttrs:!1,props:{as:{type:[Object,String],default:"template"}},setup:function(e,o){var r=o.slots,a=o.attrs,i=t.ref(null),l=je(),u=l[0],s=l[1],d=M(),p=d[1];return t.provide(Ge,{switchRef:i,labelledby:u,describedby:d[0]}),function(){return t.h(p,{name:"SwitchDescription"},(function(){return[t.h(s,{name:"SwitchLabel",props:{onClick:function(){i.value&&(i.value.click(),i.value.focus({preventScroll:!0}))}}},(function(){return[c({props:n({},a,e),slot:{},slots:r,attrs:a,name:"SwitchGroup"})]}))]}))}}}),qe=t.defineComponent({name:"Switch",emits:["update:modelValue"],props:{as:{type:[Object,String],default:"button"},modelValue:{type:[Object,Boolean],default:null},class:{type:[String,Function],required:!1},className:{type:[String,Function],required:!1}},render:function(){var e=t.inject(Ge,null),o=this.$props,r=o.className,a={checked:this.$props.modelValue},i={id:this.id,ref:null===e?void 0:e.switchRef,role:"switch",tabIndex:0,class:ie(void 0===r?o.class:r,a),"aria-checked":this.$props.modelValue,"aria-labelledby":this.labelledby,"aria-describedby":this.describedby,onClick:this.handleClick,onKeyup:this.handleKeyUp,onKeypress:this.handleKeyPress};return"button"===this.$props.as&&Object.assign(i,{type:"button"}),c({props:n({},this.$props,i),slot:a,attrs:this.$attrs,slots:this.$slots,name:"Switch"})},setup:function(e,n){var o=n.emit,r=t.inject(Ge,null);function a(){o("update:modelValue",!e.modelValue)}return{id:"headlessui-switch-"+f(),el:null==r?void 0:r.switchRef,labelledby:null==r?void 0:r.labelledby,describedby:null==r?void 0:r.describedby,handleClick:function(e){e.preventDefault(),a()},handleKeyUp:function(e){e.key!==s.Tab&&e.preventDefault(),e.key===s.Space&&a()},handleKeyPress:function(e){e.preventDefault()}}}}),He=Fe,_e=U;e.Dialog=H,e.DialogDescription=Y,e.DialogOverlay=_,e.DialogTitle=z,e.Disclosure=te,e.DisclosureButton=ne,e.DisclosurePanel=oe,e.FocusTrap=re,e.Listbox=ce,e.ListboxButton=pe,e.ListboxLabel=de,e.ListboxOption=ve,e.ListboxOptions=fe,e.Menu=ye,e.MenuButton=ge,e.MenuItem=we,e.MenuItems=Se,e.Popover=ke,e.PopoverButton=De,e.PopoverGroup=Te,e.PopoverOverlay=Ie,e.PopoverPanel=Re,e.Portal=F,e.PortalGroup=B,e.RadioGroup=Me,e.RadioGroupDescription=Ve,e.RadioGroupLabel=Ue,e.RadioGroupOption=Ke,e.Switch=qe,e.SwitchDescription=_e,e.SwitchGroup=We,e.SwitchLabel=He,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=headlessui.umd.production.min.js.map |
{ | ||
"name": "@headlessui/vue", | ||
"version": "0.3.1-035f9b0", | ||
"version": "0.3.1-2aa95f2", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1517457
12106