Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@headlessui/vue

Package Overview
Dependencies
Maintainers
2
Versions
681
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@headlessui/vue - npm Package Compare versions

Comparing version 0.3.0-b309699 to 0.3.0-b7fe69a

dist/components/radio-group/radio-group.d.ts

12

dist/components/popover/popover.d.ts

@@ -44,2 +44,10 @@ import { Ref } from 'vue';

};
static: {
type: BooleanConstructor;
default: boolean;
};
unmount: {
type: BooleanConstructor;
default: boolean;
};
}, {

@@ -50,4 +58,8 @@ id: string;

as: string;
unmount: boolean;
static: boolean;
} & {}>, {
as: string;
unmount: boolean;
static: boolean;
}>;

@@ -54,0 +66,0 @@ export declare let PopoverPanel: import("vue").DefineComponent<{

2

dist/headlessui.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,n=require("vue");function o(){return(o=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 r(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 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 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}function u(n){var i,l,u=n.visible,c=void 0===u||u,d=n.features,p=void 0===d?e.None:d,f=r(n,["visible","features"]);return c||p&e.Static&&f.props.static?s(f):p&e.RenderStrategy?a(null==(i=f.props.unmount)||i?t.Unmount:t.Hidden,((l={})[t.Unmount]=function(){return null},l[t.Hidden]=function(){return s(o({},f,{props:o({},f.props,{hidden:!0,style:{display:"none"}})}))},l)):s(f)}function s(e){var t=e.attrs,o=e.slots,i=e.slot,a=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"]),u=a.as,s=r(a,["as"]),c=null==o.default?void 0:o.default(i);if("template"===u){if(Object.keys(s).length>0||"class"in t){var d=null!=c?c:[],p=d[0];if(d.slice(1).length>0)throw new Error('You should only render 1 child or use the `as="..."` prop');return n.cloneVNode(p,s)}return c}return n.h(u,s,c)}!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={}));var c,d=n.defineComponent({name:"Alert",props:{as:{type:[Object,String],default:"div"},importance:{type:String,default:"polite"}},setup:function(e,t){var n=t.slots,i=t.attrs,l=e.importance,s=void 0===l?"polite":l,c=r(e,["importance"]),d={importance:s},p=a(s,{polite:function(){return{role:"status"}},assertive:function(){return{role:"alert"}}});return function(){return u({props:o({},c,p),slot:d,slots:n,attrs:i})}}});!function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(c||(c={}));var p=0;function f(){return++p}var v,m,h,b,g=["[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(g))}function S(e){null==e||e.focus({preventScroll:!0})}function x(e,t){var n=Array.isArray(e)?e:y(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")}(),l=t&v.NoScroll?{preventScroll:!0}:{},a=0,u=n.length,s=void 0;do{var c;if(a>=u||a+u<=0)return m.Error;var d=i+a;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(l),a+=r}while(s!==document.activeElement);return s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),m.Success}function w(e,t,o){window.addEventListener(e,t,o),n.onUnmounted((function(){return window.removeEventListener(e,t,o)}))}function O(e,t){for(var n,o=l(e);!(n=o()).done;)if(n.value.contains(t))return!0;return!1}function E(e,t,o){void 0===t&&(t=n.ref(!0)),void 0===o&&(o=n.ref({}));var r=n.ref("undefined"!=typeof window?document.activeElement:null),i=n.ref(null);n.watchEffect((function(n){if(t.value&&1===e.value.size){var a=o.value.initialFocus,u=document.activeElement;if(a){if(a===u)return}else if(O(e.value,u))return;if(r.value=u,a)S(a);else{for(var s,c=!1,d=l(e.value);!(s=d()).done;)if(x(s.value,v.First)===m.Success){c=!0;break}if(!c)throw new Error("There are no focusable elements inside the <FocusTrap />")}i.value=document.activeElement,n((function(){S(r.value),r.value=null,i.value=null}))}})),w("keydown",(function(n){if(t.value&&n.key===c.Tab&&document.activeElement&&1===e.value.size){n.preventDefault();for(var o,r=l(e.value);!(o=r()).done;)if(x(o.value,(n.shiftKey?v.Previous:v.Next)|v.WrapAround)===m.Success){i.value=document.activeElement;break}}})),w("focus",(function(n){if(t.value&&1===e.value.size){var o=i.value;if(o){var r=n.target;r&&r instanceof HTMLElement?O(e.value,r)?(i.value=r,S(r)):(n.preventDefault(),n.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 C=new Set,D=new Map;function P(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function I(e){var t=D.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var k,T=Symbol("StackContext");function R(){return n.inject(T,(function(){}))}!function(e){e[e.AddElement=0]="AddElement",e[e.RemoveElement=1]="RemoveElement"}(k||(k={}));var L,F=n.defineComponent({name:"StackProvider",props:{onUpdate:{type:Function,default:void 0}},setup:function(e,t){var o=t.slots,r=R();return n.provide(T,(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"),$=n.defineComponent({name:"ForcePortalRoot",props:{force:{type:Boolean,default:!1}},setup:function(e,t){var o=t.slots;return n.provide(j,e.force),function(){return o.default()}}}),A=n.defineComponent({name:"Portal",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var o=t.slots,r=t.attrs,i=n.inject(j,!1),l=n.inject(B,null),a=n.ref(!0===i||null===l?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)}():l.resolveTarget());n.watchEffect((function(){i||null!==l&&(a.value=l.resolveTarget())}));var s=n.ref(null);return function(e){var t=R();n.watchEffect((function(n){var o=null==e?void 0:e.value;o&&(t(k.AddElement,o),n((function(){return t(k.RemoveElement,o)})))}))}(s),n.onUnmounted((function(){var e,t=document.getElementById("headlessui-portal-root");t&&a.value===t&&a.value.children.length<=0&&(null==(e=a.value.parentElement)||e.removeChild(a.value))})),function(){return null===a.value?null:n.h(F,{},(function(){return[n.h(n.Teleport,{to:a.value},[n.h("div",{ref:s},[u({props:e,slot:{},attrs:r,slots:o})])])]}))}}}),B=Symbol("PortalGroupContext"),M=n.defineComponent({name:"PortalGroup",props:{as:{type:[Object,String],default:"template"},target:{type:Object,default:null}},setup:function(e,t){var o=t.attrs,i=t.slots,l=n.reactive({resolveTarget:function(){return e.target}});return n.provide(B,l),function(){return u({props:r(e,["target"]),slot:{},attrs:o,slots:i})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(L||(L={}));var N=Symbol("DialogContext");function U(e){var t=n.inject(N,null);if(null===t){var o=new Error("<"+e+" /> is missing a parent <Dialog /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,U),o}return t}var K,V="DC8F892D-2EBD-447C-A4C8-A03058436FF4",q=n.defineComponent({name:"Dialog",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:Boolean,default:V},onClose:{type:Function,default:V},initialFocus:{type:Object,default:null}},render:function(){var t=this,i={ref:"el",id:this.id,role:"dialog","aria-modal":this.dialogState===L.Open||void 0,"aria-labelledby":this.titleId,"aria-describedby":this.descriptionId},l=this.$props,s=l.open,c=r(l,["open","onClose","initialFocus"]),d=this.containers;return n.h(F,{onUpdate:function(e,t){var n;return a(e,((n={})[k.AddElement]=function(){d.add(t)},n[k.RemoveElement]=function(){d.delete(t)},n))}},(function(){return[n.h($,{force:!0},(function(){return[n.h(A,{},(function(){return[n.h(M,{target:t.dialogRef},(function(){return[n.h($,{force:!1},(function(){return[u({props:o({},c,i),slot:{open:t.dialogState===L.Open},attrs:t.$attrs,slots:t.$slots,visible:s,features:e.RenderStrategy|e.Static})]}))]}))]}))]}))]}))},setup:function(e){var t=n.ref(new Set),o=e.open!==V,r=e.onClose!==V;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===V?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===V?void 0:e.onClose));var i=n.computed((function(){return e.open?L.Open:L.Closed})),a=n.ref(null),u=n.computed((function(){return!!e.static||i.value===L.Open})),s="headlessui-dialog-"+f(),d=n.computed((function(){return{initialFocus:e.initialFocus}}));E(t,u,d),function(e,t){void 0===t&&(t=n.ref(!0)),n.watchEffect((function(n){if(t.value&&e.value){var o=e.value;C.add(o);for(var r,i=l(D.keys());!(r=i()).done;){var a=r.value;a.contains(o)&&(I(a),D.delete(a))}document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=l(C);!(t=n()).done;)if(e.contains(t.value))return;1===C.size&&(D.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),P(e))}})),n((function(){if(C.delete(o),C.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!D.has(e)){for(var t,n=l(C);!(t=n()).done;)if(e.contains(t.value))return;D.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),P(e)}}));else for(var e,t=l(D.keys());!(e=t()).done;){var n=e.value;I(n),D.delete(n)}}))}}))}(a,u);var p=n.ref(null),v=n.ref(null),m={titleId:p,descriptionId:v,dialogState:i,setTitleId:function(e){p.value!==e&&(p.value=e)},setDescriptionId:function(e){v.value!==e&&(v.value=e)},close:function(){e.onClose(!1)}};return n.provide(N,m),w("mousedown",(function(e){var o=e.target;i.value===L.Open&&1===t.value.size&&(O(t.value,o)||(m.close(),n.nextTick((function(){null==o||o.focus()}))))})),w("keydown",(function(e){e.key===c.Escape&&i.value===L.Open&&(t.value.size>1||m.close())})),n.watchEffect((function(e){if(i.value===L.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}))}})),n.watchEffect((function(e){if(i.value===L.Open&&a.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&&close()}}));t.observe(a.value),e((function(){return t.disconnect()}))}})),{id:s,el:a,dialogRef:a,containers:t,dialogState:i,titleId:p,descriptionId:v}}}),W=n.defineComponent({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e=U("DialogOverlay");return u({props:o({},this.$props,{ref:"el",id:this.id,"aria-hidden":!0,onClick:this.handleClick}),slot:{open:e.dialogState.value===L.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=U("DialogOverlay");return{id:"headlessui-dialog-overlay-"+f(),handleClick:function(){e.close()}}}}),G=n.defineComponent({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"}},render:function(){var e=U("DialogTitle");return u({props:o({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===L.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=U("DialogTitle"),t="headlessui-dialog-title-"+f();return n.onMounted((function(){e.setTitleId(t),n.onUnmounted((function(){return e.setTitleId(null)}))})),{id:t}}}),H=n.defineComponent({name:"DialogDescription",props:{as:{type:[Object,String],default:"p"}},render:function(){var e=U("DialogDescription");return u({props:o({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===L.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=U("DialogDescription"),t="headlessui-dialog-description-"+f();return n.onMounted((function(){e.setDescriptionId(t),n.onUnmounted((function(){return e.setDescriptionId(null)}))})),{id:t}}});function z(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"}(K||(K={}));var Y=Symbol("DisclosureContext");function _(e){var t=n.inject(Y,null);if(null===t){var o=new Error("<"+e+" /> is missing a parent <Disclosure /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,_),o}return t}var Q,J,X=n.defineComponent({name:"Disclosure",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var r=t.slots,i=t.attrs,l=o({},e),s=n.ref(K.Closed),c=n.ref(null);return n.provide(Y,{disclosureState:s,panelRef:c,toggleDisclosure:function(){var e;s.value=a(s.value,((e={})[K.Open]=K.Closed,e[K.Closed]=K.Open,e))}}),function(){return u({props:l,slot:{open:s.value===K.Open},slots:r,attrs:i})}}}),Z=n.defineComponent({name:"DisclosureButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=_("DisclosureButton"),t={open:e.disclosureState.value===K.Open};return u({props:o({},this.$props,{id:this.id,type:"button","aria-expanded":e.disclosureState.value===K.Open||void 0,"aria-controls":this.ariaControls,onClick:this.handleClick,onKeydown:this.handleKeyDown}),slot:t,attrs:this.$attrs,slots:this.$slots})},setup:function(e){var t=_("DisclosureButton");return{id:"headlessui-disclosure-button-"+f(),ariaControls:n.computed((function(){var e,n;return null!=(e=null==(n=z(t.panelRef))?void 0:n.id)?e:void 0})),handleClick:function(){e.disabled||t.toggleDisclosure()},handleKeyDown:function(n){if(!e.disabled)switch(n.key){case c.Space:case c.Enter:n.preventDefault(),t.toggleDisclosure()}}}}}),ee=n.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:_("DisclosurePanel").disclosureState.value===K.Open};return u({props:o({},this.$props,{id:this.id,ref:"el"}),slot:t,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:t.open})},setup:function(){var e=_("DisclosurePanel");return{id:"headlessui-disclosure-panel-"+f(),el:e.panelRef}}}),te=n.defineComponent({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null}},render:function(){return u({props:o({},r(this.$props,["initialFocus"]),{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots})},setup:function(e){var t=n.ref(new Set),o=n.ref(null),r=n.ref(!0),i=n.computed((function(){return{initialFocus:e.initialFocus}}));return n.onMounted((function(){o.value&&(t.value.add(o.value),E(t,r,i))})),n.onUnmounted((function(){r.value=!1})),{el:o}}});function ne(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 Q.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case Q.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 Q.Next:return n.findIndex((function(e,n){return!(n<=r||t.resolveDisabled(e))}));case Q.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case Q.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case Q.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?o:i}function oe(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"}(Q||(Q={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(J||(J={}));var re=Symbol("ListboxContext");function ie(e){var t=n.inject(re,null);if(null===t){var o=new Error("<"+e+" /> is missing a parent <Listbox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,ie),o}return t}var le,ae=n.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 o=t.slots,i=t.attrs,l=t.emit,a=e.disabled,s=r(e,["modelValue","disabled"]),c=n.ref(J.Closed),d=n.ref(null),p=n.ref(null),f=n.ref(null),v=n.ref([]),m=n.ref(""),h=n.ref(null),b=n.computed((function(){return e.modelValue})),g={listboxState:c,value:b,labelRef:d,buttonRef:p,optionsRef:f,disabled:a,options:v,searchQuery:m,activeOptionIndex:h,closeListbox:function(){a||c.value!==J.Closed&&(c.value=J.Closed,h.value=null)},openListbox:function(){a||c.value!==J.Open&&(c.value=J.Open)},goToOption:function(e,t){if(!a&&c.value!==J.Closed){var n=ne(e===Q.Specific?{focus:Q.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(!a&&c.value!==J.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(){a||c.value!==J.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){a||l("update:modelValue",e)}};return n.onMounted((function(){function e(e){var t,n,o,r=e.target,i=document.activeElement;c.value===J.Open&&((null==(t=z(p))?void 0:t.contains(r))||((null==(n=z(f))?void 0:n.contains(r))||g.closeListbox(),i!==document.body&&(null==i?void 0:i.contains(r))||e.defaultPrevented||null==(o=z(p))||o.focus({preventScroll:!0})))}window.addEventListener("mousedown",e),n.onUnmounted((function(){return window.removeEventListener("mousedown",e)}))})),n.provide(re,g),function(){return u({props:s,slot:{open:c.value===J.Open,disabled:a},slots:o,attrs:i})}}}),ue=n.defineComponent({name:"ListboxLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){var e=ie("ListboxLabel"),t={open:e.listboxState.value===J.Open,disabled:e.disabled};return u({props:o({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:t,attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=ie("ListboxLabel");return{id:"headlessui-listbox-label-"+f(),el:e.labelRef,handleClick:function(){var t;null==(t=z(e.buttonRef))||t.focus({preventScroll:!0})}}}}),se=n.defineComponent({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"}},render:function(){var e,t,n=ie("ListboxButton"),r={open:n.listboxState.value===J.Open,disabled:n.disabled},i={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=z(n.optionsRef))?void 0:e.id,"aria-expanded":n.listboxState.value===J.Open||void 0,"aria-labelledby":n.labelRef.value?[null==(t=z(n.labelRef))?void 0:t.id,this.id].join(" "):void 0,disabled:n.disabled,onKeydown:this.handleKeyDown,onClick:this.handleClick};return u({props:o({},this.$props,i),slot:r,attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=ie("ListboxButton");return{id:"headlessui-listbox-button-"+f(),el:e.buttonRef,handleKeyDown:function(t){switch(t.key){case c.Space:case c.Enter:case c.ArrowDown:t.preventDefault(),e.openListbox(),n.nextTick((function(){var t;null==(t=z(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(Q.First)}));break;case c.ArrowUp:t.preventDefault(),e.openListbox(),n.nextTick((function(){var t;null==(t=z(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(Q.Last)}))}},handleClick:function(t){var o;e.disabled||(e.listboxState.value===J.Open?(e.closeListbox(),n.nextTick((function(){var t;return null==(t=z(e.buttonRef))?void 0:t.focus({preventScroll:!0})}))):(t.preventDefault(),e.openListbox(),o=function(){var t;return null==(t=z(e.optionsRef))?void 0:t.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(o)}))))}}}}),ce=n.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,r,i,l=ie("ListboxOptions"),a={open:l.listboxState.value===J.Open},s={"aria-activedescendant":null===l.activeOptionIndex.value||null==(t=l.options.value[l.activeOptionIndex.value])?void 0:t.id,"aria-labelledby":null!=(n=null==(r=z(l.labelRef))?void 0:r.id)?n:null==(i=z(l.buttonRef))?void 0:i.id,id:this.id,onKeydown:this.handleKeyDown,role:"listbox",tabIndex:0,ref:"el"};return u({props:o({},this.$props,s),slot:a,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:a.open})},setup:function(){var e=ie("ListboxOptions"),t="headlessui-listbox-options-"+f(),o=n.ref(null);return{id:t,el:e.optionsRef,handleKeyDown:function(t){switch(o.value&&clearTimeout(o.value),t.key){case c.Space:if(""!==e.searchQuery.value)return t.preventDefault(),t.stopPropagation(),e.search(t.key);case c.Enter:t.preventDefault(),t.stopPropagation(),null!==e.activeOptionIndex.value&&e.select(e.options.value[e.activeOptionIndex.value].dataRef.value),e.closeListbox(),n.nextTick((function(){var t;return null==(t=z(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case c.ArrowDown:return t.preventDefault(),t.stopPropagation(),e.goToOption(Q.Next);case c.ArrowUp:return t.preventDefault(),t.stopPropagation(),e.goToOption(Q.Previous);case c.Home:case c.PageUp:return t.preventDefault(),t.stopPropagation(),e.goToOption(Q.First);case c.End:case c.PageDown:return t.preventDefault(),t.stopPropagation(),e.goToOption(Q.Last);case c.Escape:t.preventDefault(),t.stopPropagation(),e.closeListbox(),n.nextTick((function(){var t;return null==(t=z(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case c.Tab:t.preventDefault(),t.stopPropagation();break;default:1===t.key.length&&(e.search(t.key),o.value=setTimeout((function(){return e.clearSearch()}),350))}}}}}),de=n.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 r=t.slots,i=t.attrs,l=ie("ListboxOption"),a="headlessui-listbox-option-"+f(),s=e.disabled,c=e.className,d=void 0===c?e.class:c,p=e.value,v=n.computed((function(){return null!==l.activeOptionIndex.value&&l.options.value[l.activeOptionIndex.value].id===a})),m=n.computed((function(){return n.toRaw(l.value.value)===n.toRaw(p)})),h=n.ref({disabled:s,value:p,textValue:""});function b(e){if(s)return e.preventDefault();l.select(p),l.closeListbox(),n.nextTick((function(){var e;return null==(e=z(l.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function g(){if(s)return l.goToOption(Q.Nothing);l.goToOption(Q.Specific,a)}function y(){s||v.value||l.goToOption(Q.Specific,a)}function S(){s||v.value&&l.goToOption(Q.Nothing)}return n.onMounted((function(){var e,t,n=null==(e=document.getElementById(a))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(h.value.textValue=n)})),n.onMounted((function(){return l.registerOption(a,h)})),n.onUnmounted((function(){return l.unregisterOption(a)})),n.onMounted((function(){n.watch([l.listboxState,m],(function(){var e;l.listboxState.value===J.Open&&m.value&&(l.goToOption(Q.Specific,a),null==(e=document.getElementById(a))||null==e.focus||e.focus())}),{immediate:!0})})),n.watchEffect((function(){l.listboxState.value===J.Open&&v.value&&n.nextTick((function(){var e;return null==(e=document.getElementById(a))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:v.value,selected:m.value,disabled:s},n={id:a,role:"option",tabIndex:-1,class:oe(d,t),"aria-disabled":!0===s||void 0,"aria-selected":!0===m.value?m.value:void 0,onClick:b,onFocus:g,onPointermove:y,onMousemove:y,onPointerleave:S,onMouseleave:S};return u({props:o({},e,n),slot:t,attrs:i,slots:r})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(le||(le={}));var pe=Symbol("MenuContext");function fe(e){var t=n.inject(pe,null);if(null===t){var o=new Error("<"+e+" /> is missing a parent <Menu /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,fe),o}return t}var ve,me=n.defineComponent({props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var o=t.slots,r=t.attrs,i=n.ref(le.Closed),l=n.ref(null),a=n.ref(null),s=n.ref([]),c=n.ref(""),d=n.ref(null),p={menuState:i,buttonRef:l,itemsRef:a,items:s,searchQuery:c,activeItemIndex:d,closeMenu:function(){i.value=le.Closed,d.value=null},openMenu:function(){return i.value=le.Open},goToItem:function(e,t){var n=ne(e===Q.Specific?{focus:Q.Specific,id:t}:{focus:e},{resolveItems:function(){return s.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=s.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){s.value.push({id:e,dataRef:t})},unregisterItem:function(e){var t=s.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),s.value=t,d.value=o===d.value||null===n?null:t.indexOf(n)}};return n.onMounted((function(){function e(e){var t,n,o,r=e.target,u=document.activeElement;i.value===le.Open&&((null==(t=z(l))?void 0:t.contains(r))||((null==(n=z(a))?void 0:n.contains(r))||p.closeMenu(),u!==document.body&&(null==u?void 0:u.contains(r))||e.defaultPrevented||null==(o=z(l))||o.focus({preventScroll:!0})))}window.addEventListener("mousedown",e),n.onUnmounted((function(){return window.removeEventListener("mousedown",e)}))})),n.provide(pe,p),function(){return u({props:e,slot:{open:i.value===le.Open},slots:o,attrs:r})}}}),he=n.defineComponent({props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"}},render:function(){var e,t=fe("MenuButton"),n={open:t.menuState.value===le.Open},r={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=z(t.itemsRef))?void 0:e.id,"aria-expanded":t.menuState.value===le.Open||void 0,onKeydown:this.handleKeyDown,onClick:this.handleClick};return u({props:o({},this.$props,r),slot:n,attrs:this.$attrs,slots:this.$slots})},setup:function(e){var t=fe("MenuButton");return{id:"headlessui-menu-button-"+f(),el:t.buttonRef,handleKeyDown:function(e){switch(e.key){case c.Space:case c.Enter:case c.ArrowDown:e.preventDefault(),e.stopPropagation(),t.openMenu(),n.nextTick((function(){var e;null==(e=z(t.itemsRef))||e.focus({preventScroll:!0}),t.goToItem(Q.First)}));break;case c.ArrowUp:e.preventDefault(),e.stopPropagation(),t.openMenu(),n.nextTick((function(){var e;null==(e=z(t.itemsRef))||e.focus({preventScroll:!0}),t.goToItem(Q.Last)}))}},handleClick:function(o){var r;e.disabled||(t.menuState.value===le.Open?(t.closeMenu(),n.nextTick((function(){var e;return null==(e=z(t.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(o.preventDefault(),o.stopPropagation(),t.openMenu(),r=function(){var e;return null==(e=z(t.itemsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(r)}))))}}}}),be=n.defineComponent({props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var t,n,r=fe("MenuItems"),i={open:r.menuState.value===le.Open},l={"aria-activedescendant":null===r.activeItemIndex.value||null==(t=r.items.value[r.activeItemIndex.value])?void 0:t.id,"aria-labelledby":null==(n=z(r.buttonRef))?void 0:n.id,id:this.id,onKeydown:this.handleKeyDown,role:"menu",tabIndex:0,ref:"el"};return u({props:o({},this.$props,l),slot:i,attrs:this.$attrs,slots:this.$slots,features:e.RenderStrategy|e.Static,visible:i.open})},setup:function(){var e=fe("MenuItems"),t="headlessui-menu-items-"+f(),o=n.ref(null);return n.watchEffect((function(){var t=z(e.itemsRef);if(t&&e.menuState.value===le.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(o.value&&clearTimeout(o.value),t.key){case c.Space:if(""!==e.searchQuery.value)return t.preventDefault(),t.stopPropagation(),e.search(t.key);case c.Enter:var r;t.preventDefault(),t.stopPropagation(),null!==e.activeItemIndex.value&&(null==(r=document.getElementById(e.items.value[e.activeItemIndex.value].id))||r.click()),e.closeMenu(),n.nextTick((function(){var t;return null==(t=z(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case c.ArrowDown:return t.preventDefault(),t.stopPropagation(),e.goToItem(Q.Next);case c.ArrowUp:return t.preventDefault(),t.stopPropagation(),e.goToItem(Q.Previous);case c.Home:case c.PageUp:return t.preventDefault(),t.stopPropagation(),e.goToItem(Q.First);case c.End:case c.PageDown:return t.preventDefault(),t.stopPropagation(),e.goToItem(Q.Last);case c.Escape:t.preventDefault(),t.stopPropagation(),e.closeMenu(),n.nextTick((function(){var t;return null==(t=z(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case c.Tab:t.preventDefault(),t.stopPropagation();break;default:1===t.key.length&&(e.search(t.key),o.value=setTimeout((function(){return e.clearSearch()}),350))}}}}}),ge=n.defineComponent({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 r=t.slots,i=t.attrs,l=fe("MenuItem"),a="headlessui-menu-item-"+f(),s=e.disabled,c=e.className,d=void 0===c?e.class:c,p=n.computed((function(){return null!==l.activeItemIndex.value&&l.items.value[l.activeItemIndex.value].id===a})),v=n.ref({disabled:s,textValue:""});function m(e){if(s)return e.preventDefault();l.closeMenu(),n.nextTick((function(){var e;return null==(e=z(l.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function h(){if(s)return l.goToItem(Q.Nothing);l.goToItem(Q.Specific,a)}function b(){s||p.value||l.goToItem(Q.Specific,a)}function g(){s||p.value&&l.goToItem(Q.Nothing)}return n.onMounted((function(){var e,t,n=null==(e=document.getElementById(a))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(v.value.textValue=n)})),n.onMounted((function(){return l.registerItem(a,v)})),n.onUnmounted((function(){return l.unregisterItem(a)})),n.watchEffect((function(){l.menuState.value===le.Open&&p.value&&n.nextTick((function(){var e;return null==(e=document.getElementById(a))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:p.value,disabled:s},n={id:a,role:"menuitem",tabIndex:-1,class:oe(d,t),"aria-disabled":!0===s||void 0,onClick:m,onFocus:h,onPointermove:b,onMousemove:b,onPointerleave:g,onMouseleave:g};return u({props:o({},e,n),slot:t,attrs:i,slots:r})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ve||(ve={}));var ye=Symbol("PopoverContext");function Se(e){var t=n.inject(ye,null);if(null===t){var o=new Error("<"+e+" /> is missing a parent <"+Ee.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Se),o}return t}var xe=Symbol("PopoverGroupContext");function we(){return n.inject(xe,null)}var Oe=Symbol("PopoverPanelContext"),Ee=n.defineComponent({name:"Popover",props:{as:{type:[Object,String],default:"div"}},setup:function(e,t){var r=t.slots,i=t.attrs,l=o({},e),s="headlessui-popover-button-"+f(),c="headlessui-popover-panel-"+f(),d=n.ref(ve.Closed),p=n.ref(null),v=n.ref(null),m={popoverState:d,buttonId:s,panelId:c,panel:v,button:p,togglePopover:function(){var e;d.value=a(d.value,((e={})[ve.Open]=ve.Closed,e[ve.Closed]=ve.Open,e))},closePopover:function(){d.value!==ve.Closed&&(d.value=ve.Closed)}};n.provide(ye,m);var h={buttonId:s,panelId:c,close:function(){m.closePopover()}},y=we(),S=null==y?void 0:y.registerPopover;return n.watchEffect((function(){return null==S?void 0:S(h)})),w("focus",(function(){var e,t,n;d.value===ve.Open&&((null!=(e=null==y?void 0:y.isFocusWithinPopoverGroup())?e:(null==(t=z(p))?void 0:t.contains(document.activeElement))||(null==(n=z(v))?void 0:n.contains(document.activeElement)))||p&&v&&m.closePopover())}),!0),w("mousedown",(function(e){var t,n,o,r,i,l,u=e.target;d.value===ve.Open&&((null==(t=z(p))?void 0:t.contains(u))||(null==(n=z(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(g)},l[b.Loose]=function(){for(var e=r;null!==e;){if(e.matches(g))return!0;e=e.parentElement}return!1},l))||(e.preventDefault(),null==(o=z(p))||o.focus())))})),function(){return u({props:l,slot:{open:d.value===ve.Open},slots:r,attrs:i})}}}),Ce=n.defineComponent({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=Se("PopoverButton"),t={open:e.popoverState.value===ve.Open},n=this.isWithinPanel?{type:"button",onKeydown:this.handleKeyDown,onClick:this.handleClick}:{ref:"el",id:e.buttonId,type:"button","aria-expanded":e.popoverState.value===ve.Open||void 0,"aria-controls":z(e.panel)?e.panelId:void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return u({props:o({},this.$props,n),slot:t,attrs:this.$attrs,slots:this.$slots})},setup:function(e){var t=Se("PopoverButton"),o=we(),r=null==o?void 0:o.closeOthers,i=n.inject(Oe,null),l=null!==i&&i===t.panelId,a=n.ref(null),u=n.ref("undefined"==typeof window?null:document.activeElement);return w("focus",(function(){u.value=a.value,a.value=document.activeElement}),!0),{isWithinPanel:l,el:l?null:t.button,handleKeyDown:function(e){var n,o;if(l){if(t.popoverState.value===ve.Closed)return;switch(e.key){case c.Space:case c.Enter:e.preventDefault(),e.stopPropagation(),t.closePopover(),null==(n=z(t.button))||n.focus()}}else switch(e.key){case c.Space:case c.Enter:e.preventDefault(),e.stopPropagation(),t.popoverState.value===ve.Closed&&(null==r||r(t.buttonId)),t.togglePopover();break;case c.Escape:if(t.popoverState.value!==ve.Open)return null==r?void 0:r(t.buttonId);if(!z(t.button))return;if(!(null==(o=z(t.button))?void 0:o.contains(document.activeElement)))return;t.closePopover();break;case c.Tab:if(t.popoverState.value!==ve.Open)return;if(!t.panel)return;if(!t.button)return;if(e.shiftKey){var i,a;if(!u.value)return;if(null==(i=z(t.button))?void 0:i.contains(u.value))return;if(null==(a=z(t.panel))?void 0:a.contains(u.value))return;var s=y(),d=s.indexOf(u.value);if(s.indexOf(z(t.button))>d)return;e.preventDefault(),e.stopPropagation(),x(z(t.panel),v.Last)}else e.preventDefault(),e.stopPropagation(),x(z(t.panel),v.First)}},handleKeyUp:function(e){var n,o;if(!l&&t.popoverState.value===ve.Open&&t.panel&&t.button)switch(e.key){case c.Tab:if(!u.value)return;if(null==(n=z(t.button))?void 0:n.contains(u.value))return;if(null==(o=z(t.panel))?void 0:o.contains(u.value))return;var r=y(),i=r.indexOf(u.value);if(r.indexOf(z(t.button))>i)return;e.preventDefault(),e.stopPropagation(),x(z(t.panel),v.Last)}},handleClick:function(){var n,o;e.disabled||(l?(t.closePopover(),null==(n=z(t.button))||n.focus()):(t.popoverState.value===ve.Closed&&(null==r||r(t.buttonId)),null==(o=z(t.button))||o.focus(),t.togglePopover()))},handleFocus:function(){}}}}),De=n.defineComponent({name:"PopoverOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e={open:Se("PopoverOverlay").popoverState.value===ve.Open};return u({props:o({},this.$props,{id:this.id,ref:"el","aria-hidden":!0,onClick:this.handleClick}),slot:e,attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=Se("PopoverOverlay");return{id:"headlessui-popover-overlay-"+f(),handleClick:function(){e.closePopover()}}}}),Pe=n.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:Se("PopoverPanel").popoverState.value===ve.Open};return u({props:o({},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})},setup:function(e){var t=e.focus,o=Se("PopoverPanel");return n.provide(Oe,o.panelId),n.onUnmounted((function(){o.panel.value=null})),n.watchEffect((function(){var e;if(t&&o.popoverState.value===ve.Open&&o.panel){var n=document.activeElement;(null==(e=z(o.panel))?void 0:e.contains(n))||x(z(o.panel),v.First)}})),w("keydown",(function(e){var t;if(o.popoverState.value===ve.Open&&z(o.panel)&&e.key===c.Tab&&document.activeElement&&(null==(t=z(o.panel))?void 0:t.contains(document.activeElement))){e.preventDefault();var n,r=x(z(o.panel),e.shiftKey?v.Previous:v.Next);if(r===m.Underflow)return null==(n=z(o.button))?void 0:n.focus();if(r===m.Overflow){if(!z(o.button))return;var i=y(),l=i.indexOf(z(o.button));x(i.splice(l+1).filter((function(e){var t;return!(null==(t=z(o.panel))?void 0:t.contains(e))})),v.First)===m.Error&&x(document.body,v.First)}}})),w("focus",(function(){var e;t&&o.popoverState.value===ve.Open&&z(o.panel)&&((null==(e=z(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 c.Escape:if(o.popoverState.value!==ve.Open)return;if(!z(o.panel))return;if(!(null==(t=z(o.panel))?void 0:t.contains(document.activeElement)))return;e.preventDefault(),o.closePopover(),null==(n=z(o.button))||n.focus()}}}}}),Ie=n.defineComponent({name:"PopoverGroup",props:{as:{type:[Object,String],default:"div"}},render:function(){return u({props:o({},this.$props,{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=n.ref(null),t=n.ref([]);function o(e){var n=t.value.indexOf(e);-1!==n&&t.value.splice(n,1)}return n.provide(xe,{registerPopover:function(e){return t.value.push(e),function(){o(e)}},unregisterPopover:o,isFocusWithinPopoverGroup:function(){var n,o=document.activeElement;return!!(null==(n=z(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}}}),ke=Symbol("GroupContext");function Te(e){var t=n.inject(ke,null);if(null===t){var o=new Error("<"+e+" /> is missing a parent <SwitchGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Te),o}return t}var Re=n.defineComponent({name:"SwitchGroup",props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var o=t.slots,r=t.attrs,i=n.ref(null),l=n.ref(null),a=n.ref(null);return n.provide(ke,{switchRef:i,labelRef:l,descriptionRef:a}),function(){return u({props:e,slot:{},slots:o,attrs:r})}}}),Le=n.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=n.inject(ke,null),t=this.$props,r=t.className,i=void 0===r?t.class:r,l=n.computed((function(){var t;return null==(t=z(null==e?void 0:e.labelRef))?void 0:t.id})),a=n.computed((function(){var t;return null==(t=z(null==e?void 0:e.descriptionRef))?void 0:t.id})),s={checked:this.$props.modelValue},c={id:this.id,ref:null===e?void 0:e.switchRef,role:"switch",tabIndex:0,class:oe(i,s),"aria-checked":this.$props.modelValue,"aria-labelledby":l.value,"aria-describedby":a.value,onClick:this.handleClick,onKeyup:this.handleKeyUp,onKeypress:this.handleKeyPress};return"button"===this.$props.as&&Object.assign(c,{type:"button"}),u({props:o({},this.$props,c),slot:s,attrs:this.$attrs,slots:this.$slots})},setup:function(e,t){var o=t.emit,r=n.inject(ke,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!==c.Tab&&e.preventDefault(),e.key===c.Space&&i()},handleKeyPress:function(e){e.preventDefault()}}}}),Fe=n.defineComponent({name:"SwitchLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){return u({props:o({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:{},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=Te("SwitchLabel");return{id:"headlessui-switch-label-"+f(),el:e.labelRef,handleClick:function(){var t=z(e.switchRef);null==t||t.click(),null==t||t.focus({preventScroll:!0})}}}}),je=n.defineComponent({name:"SwitchDescription",props:{as:{type:[Object,String],default:"p"}},render:function(){return u({props:o({},this.$props,{id:this.id,ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=Te("SwitchDescription");return{id:"headlessui-switch-description-"+f(),el:e.descriptionRef}}});exports.Alert=d,exports.Dialog=q,exports.DialogDescription=H,exports.DialogOverlay=W,exports.DialogTitle=G,exports.Disclosure=X,exports.DisclosureButton=Z,exports.DisclosurePanel=ee,exports.FocusTrap=te,exports.Listbox=ae,exports.ListboxButton=se,exports.ListboxLabel=ue,exports.ListboxOption=de,exports.ListboxOptions=ce,exports.Menu=me,exports.MenuButton=he,exports.MenuItem=ge,exports.MenuItems=be,exports.Popover=Ee,exports.PopoverButton=Ce,exports.PopoverGroup=Ie,exports.PopoverOverlay=De,exports.PopoverPanel=Pe,exports.Portal=A,exports.PortalGroup=M,exports.Switch=Le,exports.SwitchDescription=je,exports.SwitchGroup=Re,exports.SwitchLabel=Fe;
"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,f=i(n,["visible","features"]);return s||p&e.Static&&f.props.static?c(f):p&e.RenderStrategy?u(null==(o=f.props.unmount)||o?t.Unmount:t.Hidden,((a={})[t.Unmount]=function(){return null},a[t.Hidden]=function(){return c(r({},f,{props:r({},f.props,{hidden:!0,style:{display:"none"}})}))},a)):c(f)}function c(e){var t=e.attrs,n=e.slots,r=e.slot,a=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"]),u=a.as,s=i(a,["as"]),c=null==n.default?void 0:n.default(r);if("template"===u){if(Object.keys(s).length>0||"class"in t){var d=null!=c?c:[],p=d[0];if(d.slice(1).length>0)throw new Error('You should only render 1 child or use the `as="..."` prop');return o.cloneVNode(p,s)}return c}return o.h(u,s,c)}!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.ArrowUp="ArrowUp",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 f,v,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&(f.First|f.Next))return m.Next;if(t&(f.Previous|f.Last))return m.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),i=function(){if(t&f.First)return 0;if(t&f.Previous)return Math.max(0,n.indexOf(o))-1;if(t&f.Next)return Math.max(0,n.indexOf(o))+1;if(t&f.Last)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=t&f.NoScroll?{preventScroll:!0}:{},l=0,u=n.length,s=void 0;do{var c;if(l>=u||l+u<=0)return v.Error;var d=i+l;if(t&f.WrapAround)d=(d+u)%u;else{if(d<0)return v.Underflow;if(d>=u)return v.Overflow}null==(c=s=n[d])||c.focus(a),l+=r}while(s!==document.activeElement);return s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),v.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,f.First)===v.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?f.Previous:f.Next)|f.WrapAround)===v.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"}(f||(f={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(v||(v={})),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 D(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function P(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,k=Symbol("StackContext");function T(){return o.inject(k,(function(){}))}!function(e){e[e.AddElement=0]="AddElement",e[e.RemoveElement=1]="RemoveElement"}(I||(I={}));var R,L=o.defineComponent({name:"StackProvider",props:{onUpdate:{type:Function,default:void 0}},setup:function(e,t){var n=t.slots,r=T();return o.provide(k,(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()}}}),F=Symbol("ForcePortalRootContext"),$=o.defineComponent({name:"ForcePortalRoot",props:{force:{type:Boolean,default:!1}},setup:function(e,t){var n=t.slots;return o.provide(F,e.force),function(){return n.default()}}}),j=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(F,!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=T();o.watchEffect((function(n){var o=null==e?void 0:e.value;o&&(t(I.AddElement,o),n((function(){return t(I.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(L,{},(function(){return[o.h(o.Teleport,{to:l.value},[o.h("div",{ref:u},[s({props:e,slot:{},attrs:r,slots:n})])])]}))}}}),A=Symbol("PortalGroupContext"),B=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})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(R||(R={}));var M=Symbol("DialogContext");function N(e){var t=o.inject(M,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Dialog /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,N),n}return t}var U,K="DC8F892D-2EBD-447C-A4C8-A03058436FF4",V=o.defineComponent({name:"Dialog",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:Boolean,default:K},onClose:{type:Function,default:K},initialFocus:{type:Object,default:null}},render:function(){var t=this,n={ref:"el",id:this.id,role:"dialog","aria-modal":this.dialogState===R.Open||void 0,"aria-labelledby":this.titleId,"aria-describedby":this.descriptionId},a=this.$props,l=a.open,c=i(a,["open","onClose","initialFocus"]),d=this.containers;return o.h(L,{onUpdate:function(e,t){var n;return u(e,((n={})[I.AddElement]=function(){d.add(t)},n[I.RemoveElement]=function(){d.delete(t)},n))}},(function(){return[o.h($,{force:!0},(function(){return[o.h(j,{},(function(){return[o.h(B,{target:t.dialogRef},(function(){return[o.h($,{force:!1},(function(){return[s({props:r({},c,n),slot:{open:t.dialogState===R.Open},attrs:t.$attrs,slots:t.$slots,visible:l,features:e.RenderStrategy|e.Static})]}))]}))]}))]}))]}))},setup:function(e){var t=o.ref(new Set),r=e.open!==K,i=e.onClose!==K;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===K?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===K?void 0:e.onClose));var a=o.computed((function(){return e.open?R.Open:R.Closed})),u=o.ref(null),s=o.ref(!!e.static||a.value===R.Open);o.onUpdated((function(){s.value=!!e.static||a.value===R.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)&&(P(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}),D(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}),D(e)}}));else for(var e,t=l(C.keys());!(e=t()).done;){var n=e.value;P(n),C.delete(n)}}))}}))}(u,s);var f=o.ref(null),v=o.ref(null),m={titleId:f,descriptionId:v,dialogState:a,setTitleId:function(e){f.value!==e&&(f.value=e)},setDescriptionId:function(e){v.value!==e&&(v.value=e)},close:function(){e.onClose(!1)}};return o.provide(M,m),x("mousedown",(function(e){var n=e.target;a.value===R.Open&&1===t.value.size&&(w(t.value,n)||(m.close(),o.nextTick((function(){null==n||n.focus()}))))})),x("keydown",(function(e){e.key===n.Escape&&a.value===R.Open&&(t.value.size>1||m.close())})),o.watchEffect((function(e){if(a.value===R.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===R.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&&m.close()}}));t.observe(u.value),e((function(){return t.disconnect()}))}})),{id:c,el:u,dialogRef:u,containers:t,dialogState:a,titleId:f,descriptionId:v}}}),q=o.defineComponent({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e=N("DialogOverlay");return s({props:r({},this.$props,{ref:"el",id:this.id,"aria-hidden":!0,onClick:this.handleClick}),slot:{open:e.dialogState.value===R.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=N("DialogOverlay");return{id:"headlessui-dialog-overlay-"+p(),handleClick:function(){e.close()}}}}),W=o.defineComponent({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"}},render:function(){var e=N("DialogTitle");return s({props:r({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===R.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=N("DialogTitle"),t="headlessui-dialog-title-"+p();return o.onMounted((function(){e.setTitleId(t),o.onUnmounted((function(){return e.setTitleId(null)}))})),{id:t}}}),G=o.defineComponent({name:"DialogDescription",props:{as:{type:[Object,String],default:"p"}},render:function(){var e=N("DialogDescription");return s({props:r({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===R.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=N("DialogDescription"),t="headlessui-dialog-description-"+p();return o.onMounted((function(){e.setDescriptionId(t),o.onUnmounted((function(){return e.setDescriptionId(null)}))})),{id:t}}});function H(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"}(U||(U={}));var z=Symbol("DisclosureContext");function Y(e){var t=o.inject(z,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Disclosure /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Y),n}return t}var _,Q,J=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(U.Closed),c=o.ref(null);return o.provide(z,{disclosureState:l,panelRef:c,toggleDisclosure:function(){var e;l.value=u(l.value,((e={})[U.Open]=U.Closed,e[U.Closed]=U.Open,e))}}),function(){return s({props:a,slot:{open:l.value===U.Open},slots:n,attrs:i})}}}),X=o.defineComponent({name:"DisclosureButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=Y("DisclosureButton"),t={open:e.disclosureState.value===U.Open};return s({props:r({},this.$props,{id:this.id,type:"button","aria-expanded":e.disclosureState.value===U.Open||void 0,"aria-controls":this.ariaControls,onClick:this.handleClick,onKeydown:this.handleKeyDown}),slot:t,attrs:this.$attrs,slots:this.$slots})},setup:function(e){var t=Y("DisclosureButton");return{id:"headlessui-disclosure-button-"+p(),ariaControls:o.computed((function(){var e,n;return null!=(e=null==(n=H(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()}}}}}),Z=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:Y("DisclosurePanel").disclosureState.value===U.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})},setup:function(){var e=Y("DisclosurePanel");return{id:"headlessui-disclosure-panel-"+p(),el:e.panelRef}}}),ee=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})},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 te(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 _.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case _.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 _.Next:return n.findIndex((function(e,n){return!(n<=r||t.resolveDisabled(e))}));case _.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case _.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case _.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?o:i}function ne(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"}(_||(_={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Q||(Q={}));var oe=Symbol("ListboxContext");function re(e){var t=o.inject(oe,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Listbox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,re),n}return t}var ie,ae=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(Q.Closed),d=o.ref(null),p=o.ref(null),f=o.ref(null),v=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:f,disabled:l,options:v,searchQuery:m,activeOptionIndex:h,closeListbox:function(){l||c.value!==Q.Closed&&(c.value=Q.Closed,h.value=null)},openListbox:function(){l||c.value!==Q.Open&&(c.value=Q.Open)},goToOption:function(e,t){if(!l&&c.value!==Q.Closed){var n=te(e===_.Specific?{focus:_.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&&c.value!==Q.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||c.value!==Q.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.onMounted((function(){function e(e){var t,n,o,r=e.target,i=document.activeElement;c.value===Q.Open&&((null==(t=H(p))?void 0:t.contains(r))||((null==(n=H(f))?void 0:n.contains(r))||g.closeListbox(),i!==document.body&&(null==i?void 0:i.contains(r))||e.defaultPrevented||null==(o=H(p))||o.focus({preventScroll:!0})))}window.addEventListener("mousedown",e),o.onUnmounted((function(){return window.removeEventListener("mousedown",e)}))})),o.provide(oe,g),function(){return s({props:u,slot:{open:c.value===Q.Open,disabled:l},slots:n,attrs:r})}}}),le=o.defineComponent({name:"ListboxLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){var e=re("ListboxLabel"),t={open:e.listboxState.value===Q.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})},setup:function(){var e=re("ListboxLabel");return{id:"headlessui-listbox-label-"+p(),el:e.labelRef,handleClick:function(){var t;null==(t=H(e.buttonRef))||t.focus({preventScroll:!0})}}}}),ue=o.defineComponent({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"}},render:function(){var e,t,n=re("ListboxButton"),o={open:n.listboxState.value===Q.Open,disabled:n.disabled},i={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=H(n.optionsRef))?void 0:e.id,"aria-expanded":n.listboxState.value===Q.Open||void 0,"aria-labelledby":n.labelRef.value?[null==(t=H(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})},setup:function(){var e=re("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=H(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(_.First)}));break;case n.ArrowUp:t.preventDefault(),e.openListbox(),o.nextTick((function(){var t;null==(t=H(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(_.Last)}))}},handleClick:function(t){var n;e.disabled||(e.listboxState.value===Q.Open?(e.closeListbox(),o.nextTick((function(){var t;return null==(t=H(e.buttonRef))?void 0:t.focus({preventScroll:!0})}))):(t.preventDefault(),e.openListbox(),n=function(){var t;return null==(t=H(e.optionsRef))?void 0:t.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(n)}))))}}}}),se=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=re("ListboxOptions"),l={open:a.listboxState.value===Q.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=H(a.labelRef))?void 0:o.id)?n:null==(i=H(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})},setup:function(){var e=re("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=H(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case n.ArrowDown:return t.preventDefault(),t.stopPropagation(),e.goToOption(_.Next);case n.ArrowUp:return t.preventDefault(),t.stopPropagation(),e.goToOption(_.Previous);case n.Home:case n.PageUp:return t.preventDefault(),t.stopPropagation(),e.goToOption(_.First);case n.End:case n.PageDown:return t.preventDefault(),t.stopPropagation(),e.goToOption(_.Last);case n.Escape:t.preventDefault(),t.stopPropagation(),e.closeListbox(),o.nextTick((function(){var t;return null==(t=H(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))}}}}}),ce=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=re("ListboxOption"),l="headlessui-listbox-option-"+p(),u=e.disabled,c=e.className,d=void 0===c?e.class:c,f=e.value,v=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(f)})),h=o.ref({disabled:u,value:f,textValue:""});function b(e){if(u)return e.preventDefault();a.select(f),a.closeListbox(),o.nextTick((function(){var e;return null==(e=H(a.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function g(){if(u)return a.goToOption(_.Nothing);a.goToOption(_.Specific,l)}function y(){u||v.value||a.goToOption(_.Specific,l)}function S(){u||v.value&&a.goToOption(_.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===Q.Open&&m.value&&(a.goToOption(_.Specific,l),null==(e=document.getElementById(l))||null==e.focus||e.focus())}),{immediate:!0})})),o.watchEffect((function(){a.listboxState.value===Q.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,selected:m.value,disabled:u},o={id:l,role:"option",tabIndex:-1,class:ne(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})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ie||(ie={}));var de=Symbol("MenuContext");function pe(e){var t=o.inject(de,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Menu /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,pe),n}return t}var fe,ve=o.defineComponent({props:{as:{type:[Object,String],default:"template"}},setup:function(e,t){var n=t.slots,r=t.attrs,i=o.ref(ie.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=ie.Closed,d.value=null},openMenu:function(){return i.value=ie.Open},goToItem:function(e,t){var n=te(e===_.Specific?{focus:_.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 o.onMounted((function(){function e(e){var t,n,o,r=e.target,u=document.activeElement;i.value===ie.Open&&((null==(t=H(a))?void 0:t.contains(r))||((null==(n=H(l))?void 0:n.contains(r))||p.closeMenu(),u!==document.body&&(null==u?void 0:u.contains(r))||e.defaultPrevented||null==(o=H(a))||o.focus({preventScroll:!0})))}window.addEventListener("mousedown",e),o.onUnmounted((function(){return window.removeEventListener("mousedown",e)}))})),o.provide(de,p),function(){return s({props:e,slot:{open:i.value===ie.Open},slots:n,attrs:r})}}}),me=o.defineComponent({props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"}},render:function(){var e,t=pe("MenuButton"),n={open:t.menuState.value===ie.Open},o={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=H(t.itemsRef))?void 0:e.id,"aria-expanded":t.menuState.value===ie.Open||void 0,onKeydown:this.handleKeyDown,onClick:this.handleClick};return s({props:r({},this.$props,o),slot:n,attrs:this.$attrs,slots:this.$slots})},setup:function(e){var t=pe("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=H(t.itemsRef))||e.focus({preventScroll:!0}),t.goToItem(_.First)}));break;case n.ArrowUp:e.preventDefault(),e.stopPropagation(),t.openMenu(),o.nextTick((function(){var e;null==(e=H(t.itemsRef))||e.focus({preventScroll:!0}),t.goToItem(_.Last)}))}},handleClick:function(n){var r;e.disabled||(t.menuState.value===ie.Open?(t.closeMenu(),o.nextTick((function(){var e;return null==(e=H(t.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(n.preventDefault(),n.stopPropagation(),t.openMenu(),r=function(){var e;return null==(e=H(t.itemsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(r)}))))}}}}),he=o.defineComponent({props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var t,n,o=pe("MenuItems"),i={open:o.menuState.value===ie.Open},a={"aria-activedescendant":null===o.activeItemIndex.value||null==(t=o.items.value[o.activeItemIndex.value])?void 0:t.id,"aria-labelledby":null==(n=H(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})},setup:function(){var e=pe("MenuItems"),t="headlessui-menu-items-"+p(),r=o.ref(null);return o.watchEffect((function(){var t=H(e.itemsRef);if(t&&e.menuState.value===ie.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=H(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case n.ArrowDown:return t.preventDefault(),t.stopPropagation(),e.goToItem(_.Next);case n.ArrowUp:return t.preventDefault(),t.stopPropagation(),e.goToItem(_.Previous);case n.Home:case n.PageUp:return t.preventDefault(),t.stopPropagation(),e.goToItem(_.First);case n.End:case n.PageDown:return t.preventDefault(),t.stopPropagation(),e.goToItem(_.Last);case n.Escape:t.preventDefault(),t.stopPropagation(),e.closeMenu(),o.nextTick((function(){var t;return null==(t=H(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))}}}}}),be=o.defineComponent({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=pe("MenuItem"),l="headlessui-menu-item-"+p(),u=e.disabled,c=e.className,d=void 0===c?e.class:c,f=o.computed((function(){return null!==a.activeItemIndex.value&&a.items.value[a.activeItemIndex.value].id===l})),v=o.ref({disabled:u,textValue:""});function m(e){if(u)return e.preventDefault();a.closeMenu(),o.nextTick((function(){var e;return null==(e=H(a.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function h(){if(u)return a.goToItem(_.Nothing);a.goToItem(_.Specific,l)}function b(){u||f.value||a.goToItem(_.Specific,l)}function g(){u||f.value&&a.goToItem(_.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&&(v.value.textValue=n)})),o.onMounted((function(){return a.registerItem(l,v)})),o.onUnmounted((function(){return a.unregisterItem(l)})),o.watchEffect((function(){a.menuState.value===ie.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,disabled:u},o={id:l,role:"menuitem",tabIndex:-1,class:ne(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})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(fe||(fe={}));var ge=Symbol("PopoverContext");function ye(e){var t=o.inject(ge,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Oe.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,ye),n}return t}var Se=Symbol("PopoverGroupContext");function xe(){return o.inject(Se,null)}var we=Symbol("PopoverPanelContext"),Oe=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(fe.Closed),f=o.ref(null),v=o.ref(null),m={popoverState:d,buttonId:l,panelId:c,panel:v,button:f,togglePopover:function(){var e;d.value=u(d.value,((e={})[fe.Open]=fe.Closed,e[fe.Closed]=fe.Open,e))},closePopover:function(){d.value!==fe.Closed&&(d.value=fe.Closed)}};o.provide(ge,m);var g={buttonId:l,panelId:c,close:function(){m.closePopover()}},y=xe(),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===fe.Open&&((null!=(e=null==y?void 0:y.isFocusWithinPopoverGroup())?e:(null==(t=H(f))?void 0:t.contains(document.activeElement))||(null==(n=H(v))?void 0:n.contains(document.activeElement)))||f&&v&&m.closePopover())}),!0),x("mousedown",(function(e){var t,n,o,r,i,a,l=e.target;d.value===fe.Open&&((null==(t=H(f))?void 0:t.contains(l))||(null==(n=H(v))?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=H(f))||o.focus())))})),function(){return s({props:a,slot:{open:d.value===fe.Open},slots:n,attrs:i})}}}),Ee=o.defineComponent({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=ye("PopoverButton"),t={open:e.popoverState.value===fe.Open},n=this.isWithinPanel?{type:"button",onKeydown:this.handleKeyDown,onClick:this.handleClick}:{ref:"el",id:e.buttonId,type:"button","aria-expanded":e.popoverState.value===fe.Open||void 0,"aria-controls":H(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})},setup:function(e){var t=ye("PopoverButton"),r=xe(),i=null==r?void 0:r.closeOthers,a=o.inject(we,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===fe.Closed)return;switch(e.key){case n.Space:case n.Enter:e.preventDefault(),e.stopPropagation(),t.closePopover(),null==(o=H(t.button))||o.focus()}}else switch(e.key){case n.Space:case n.Enter:e.preventDefault(),e.stopPropagation(),t.popoverState.value===fe.Closed&&(null==i||i(t.buttonId)),t.togglePopover();break;case n.Escape:if(t.popoverState.value!==fe.Open)return null==i?void 0:i(t.buttonId);if(!H(t.button))return;if(!(null==(r=H(t.button))?void 0:r.contains(document.activeElement)))return;t.closePopover();break;case n.Tab:if(t.popoverState.value!==fe.Open)return;if(!t.panel)return;if(!t.button)return;if(e.shiftKey){var a,u;if(!s.value)return;if(null==(a=H(t.button))?void 0:a.contains(s.value))return;if(null==(u=H(t.panel))?void 0:u.contains(s.value))return;var c=g(),d=c.indexOf(s.value);if(c.indexOf(H(t.button))>d)return;e.preventDefault(),e.stopPropagation(),S(H(t.panel),f.Last)}else e.preventDefault(),e.stopPropagation(),S(H(t.panel),f.First)}},handleKeyUp:function(e){var o,r;if(!l&&t.popoverState.value===fe.Open&&t.panel&&t.button)switch(e.key){case n.Tab:if(!s.value)return;if(null==(o=H(t.button))?void 0:o.contains(s.value))return;if(null==(r=H(t.panel))?void 0:r.contains(s.value))return;var i=g(),a=i.indexOf(s.value);if(i.indexOf(H(t.button))>a)return;e.preventDefault(),e.stopPropagation(),S(H(t.panel),f.Last)}},handleClick:function(){var n,o;e.disabled||(l?(t.closePopover(),null==(n=H(t.button))||n.focus()):(t.popoverState.value===fe.Closed&&(null==i||i(t.buttonId)),null==(o=H(t.button))||o.focus(),t.togglePopover()))},handleFocus:function(){}}}}),Ce=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:ye("PopoverOverlay").popoverState.value===fe.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})},setup:function(){var e=ye("PopoverOverlay");return{id:"headlessui-popover-overlay-"+p(),handleClick:function(){e.closePopover()}}}}),De=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:ye("PopoverPanel").popoverState.value===fe.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})},setup:function(e){var t=e.focus,r=ye("PopoverPanel");return o.provide(we,r.panelId),o.onUnmounted((function(){r.panel.value=null})),o.watchEffect((function(){var e;if(t&&r.popoverState.value===fe.Open&&r.panel){var n=document.activeElement;(null==(e=H(r.panel))?void 0:e.contains(n))||S(H(r.panel),f.First)}})),x("keydown",(function(e){var t;if(r.popoverState.value===fe.Open&&H(r.panel)&&e.key===n.Tab&&document.activeElement&&(null==(t=H(r.panel))?void 0:t.contains(document.activeElement))){e.preventDefault();var o,i=S(H(r.panel),e.shiftKey?f.Previous:f.Next);if(i===v.Underflow)return null==(o=H(r.button))?void 0:o.focus();if(i===v.Overflow){if(!H(r.button))return;var a=g(),l=a.indexOf(H(r.button));S(a.splice(l+1).filter((function(e){var t;return!(null==(t=H(r.panel))?void 0:t.contains(e))})),f.First)===v.Error&&S(document.body,f.First)}}})),x("focus",(function(){var e;t&&r.popoverState.value===fe.Open&&H(r.panel)&&((null==(e=H(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!==fe.Open)return;if(!H(r.panel))return;if(!(null==(t=H(r.panel))?void 0:t.contains(document.activeElement)))return;e.preventDefault(),r.closePopover(),null==(o=H(r.button))||o.focus()}}}}}),Pe=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})},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(Se,{registerPopover:function(e){return t.value.push(e),function(){n(e)}},unregisterPopover:n,isFocusWithinPopoverGroup:function(){var n,o=document.activeElement;return!!(null==(n=H(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}}}),Ie=Symbol("GroupContext");function ke(e){var t=o.inject(Ie,null);if(null===t){var n=new Error("<"+e+" /> is missing a parent <SwitchGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,ke),n}return t}var Te=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(Ie,{switchRef:i,labelRef:a,descriptionRef:l}),function(){return s({props:e,slot:{},slots:n,attrs:r})}}}),Re=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(Ie,null),t=this.$props,n=t.className,i=void 0===n?t.class:n,a=o.computed((function(){var t;return null==(t=H(null==e?void 0:e.labelRef))?void 0:t.id})),l=o.computed((function(){var t;return null==(t=H(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:ne(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})},setup:function(e,t){var r=t.emit,i=o.inject(Ie,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()}}}}),Le=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})},setup:function(){var e=ke("SwitchLabel");return{id:"headlessui-switch-label-"+p(),el:e.labelRef,handleClick:function(){var t=H(e.switchRef);null==t||t.click(),null==t||t.focus({preventScroll:!0})}}}}),Fe=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})},setup:function(){var e=ke("SwitchDescription");return{id:"headlessui-switch-description-"+p(),el:e.descriptionRef}}});exports.Dialog=V,exports.DialogDescription=G,exports.DialogOverlay=q,exports.DialogTitle=W,exports.Disclosure=J,exports.DisclosureButton=X,exports.DisclosurePanel=Z,exports.FocusTrap=ee,exports.Listbox=ae,exports.ListboxButton=ue,exports.ListboxLabel=le,exports.ListboxOption=ce,exports.ListboxOptions=se,exports.Menu=ve,exports.MenuButton=me,exports.MenuItem=be,exports.MenuItems=he,exports.Popover=Oe,exports.PopoverButton=Ee,exports.PopoverGroup=Pe,exports.PopoverOverlay=Ce,exports.PopoverPanel=De,exports.Portal=j,exports.PortalGroup=B,exports.Switch=Re,exports.SwitchDescription=Fe,exports.SwitchGroup=Te,exports.SwitchLabel=Le;
//# 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 l(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,l),a}var a,u;function s(e){var t,r,i=e.visible,s=void 0===i||i,d=e.features,p=void 0===d?a.None:d,f=o(e,["visible","features"]);return s||p&a.Static&&f.props.static?c(f):p&a.RenderStrategy?l(null==(t=f.props.unmount)||t?u.Unmount:u.Hidden,((r={})[u.Unmount]=function(){return null},r[u.Hidden]=function(){return c(n({},f,{props:n({},f.props,{hidden:!0,style:{display:"none"}})}))},r)):c(f)}function c(e){var n=e.attrs,r=e.slots,l=e.slot,a=function(e,t){void 0===t&&(t=[]);for(var n,o=Object.assign({},e),r=i(t);!(n=r()).done;){var l=n.value;l in o&&delete o[l]}return o}(e.props,["unmount","static"]),u=a.as,s=o(a,["as"]),c=null==r.default?void 0:r.default(l);if("template"===u){if(Object.keys(s).length>0||"class"in n){var d=null!=c?c:[],p=d[0];if(d.slice(1).length>0)throw new Error('You should only render 1 child or use the `as="..."` prop');return t.cloneVNode(p,s)}return c}return t.h(u,s,c)}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(a||(a={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(u||(u={}));var d,p=t.defineComponent({name:"Alert",props:{as:{type:[Object,String],default:"div"},importance:{type:String,default:"polite"}},setup:function(e,t){var r=t.slots,i=t.attrs,a=e.importance,u=void 0===a?"polite":a,c=o(e,["importance"]),d={importance:u},p=l(u,{polite:function(){return{role:"status"}},assertive:function(){return{role:"alert"}}});return function(){return s({props:n({},c,p),slot:d,slots:r,attrs:i})}}});!function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(d||(d={}));var f=0;function v(){return++f}var m,h,b,y,g=["[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 S(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(g))}function w(e){null==e||e.focus({preventScroll:!0})}function O(e,t){var n=Array.isArray(e)?e:S(e),o=document.activeElement,r=function(){if(t&(m.First|m.Next))return b.Next;if(t&(m.Previous|m.Last))return b.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),i=function(){if(t&m.First)return 0;if(t&m.Previous)return Math.max(0,n.indexOf(o))-1;if(t&m.Next)return Math.max(0,n.indexOf(o))+1;if(t&m.Last)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),l=t&m.NoScroll?{preventScroll:!0}:{},a=0,u=n.length,s=void 0;do{var c;if(a>=u||a+u<=0)return h.Error;var d=i+a;if(t&m.WrapAround)d=(d+u)%u;else{if(d<0)return h.Underflow;if(d>=u)return h.Overflow}null==(c=s=n[d])||c.focus(l),a+=r}while(s!==document.activeElement);return s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),h.Success}function x(e,n,o){window.addEventListener(e,n,o),t.onUnmounted((function(){return window.removeEventListener(e,n,o)}))}function E(e,t){for(var n,o=i(e);!(n=o()).done;)if(n.value.contains(t))return!0;return!1}function C(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),l=t.ref(null);t.watchEffect((function(t){if(n.value&&1===e.value.size){var a=o.value.initialFocus,u=document.activeElement;if(a){if(a===u)return}else if(E(e.value,u))return;if(r.value=u,a)w(a);else{for(var s,c=!1,d=i(e.value);!(s=d()).done;)if(O(s.value,m.First)===h.Success){c=!0;break}if(!c)throw new Error("There are no focusable elements inside the <FocusTrap />")}l.value=document.activeElement,t((function(){w(r.value),r.value=null,l.value=null}))}})),x("keydown",(function(t){if(n.value&&t.key===d.Tab&&document.activeElement&&1===e.value.size){t.preventDefault();for(var o,r=i(e.value);!(o=r()).done;)if(O(o.value,(t.shiftKey?m.Previous:m.Next)|m.WrapAround)===h.Success){l.value=document.activeElement;break}}})),x("focus",(function(t){if(n.value&&1===e.value.size){var o=l.value;if(o){var r=t.target;r&&r instanceof HTMLElement?E(e.value,r)?(l.value=r,w(r)):(t.preventDefault(),t.stopPropagation(),w(o)):w(l.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"}(m||(m={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(h||(h={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(b||(b={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(y||(y={}));var D=new Set,P=new Map;function I(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 T,R=Symbol("StackContext");function L(){return t.inject(R,(function(){}))}!function(e){e[e.AddElement=0]="AddElement",e[e.RemoveElement=1]="RemoveElement"}(T||(T={}));var F,j=t.defineComponent({name:"StackProvider",props:{onUpdate:{type:Function,default:void 0}},setup:function(e,n){var o=n.slots,r=L();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()}}}),$=Symbol("ForcePortalRootContext"),A=t.defineComponent({name:"ForcePortalRoot",props:{force:{type:Boolean,default:!1}},setup:function(e,n){var o=n.slots;return t.provide($,e.force),function(){return o.default()}}}),B=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($,!1),l=t.inject(M,null),a=t.ref(!0===i||null===l?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)}():l.resolveTarget());t.watchEffect((function(){i||null!==l&&(a.value=l.resolveTarget())}));var u=t.ref(null);return function(e){var n=L();t.watchEffect((function(t){var o=null==e?void 0:e.value;o&&(n(T.AddElement,o),t((function(){return n(T.RemoveElement,o)})))}))}(u),t.onUnmounted((function(){var e,t=document.getElementById("headlessui-portal-root");t&&a.value===t&&a.value.children.length<=0&&(null==(e=a.value.parentElement)||e.removeChild(a.value))})),function(){return null===a.value?null:t.h(j,{},(function(){return[t.h(t.Teleport,{to:a.value},[t.h("div",{ref:u},[s({props:e,slot:{},attrs:r,slots:o})])])]}))}}}),M=Symbol("PortalGroupContext"),N=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,l=t.reactive({resolveTarget:function(){return e.target}});return t.provide(M,l),function(){return s({props:o(e,["target"]),slot:{},attrs:r,slots:i})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(F||(F={}));var U=Symbol("DialogContext");function K(e){var n=t.inject(U,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Dialog /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,K),o}return n}var V,q="DC8F892D-2EBD-447C-A4C8-A03058436FF4",W=t.defineComponent({name:"Dialog",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={ref:"el",id:this.id,role:"dialog","aria-modal":this.dialogState===F.Open||void 0,"aria-labelledby":this.titleId,"aria-describedby":this.descriptionId},i=this.$props,u=i.open,c=o(i,["open","onClose","initialFocus"]),d=this.containers;return t.h(j,{onUpdate:function(e,t){var n;return l(e,((n={})[T.AddElement]=function(){d.add(t)},n[T.RemoveElement]=function(){d.delete(t)},n))}},(function(){return[t.h(A,{force:!0},(function(){return[t.h(B,{},(function(){return[t.h(N,{target:e.dialogRef},(function(){return[t.h(A,{force:!1},(function(){return[s({props:n({},c,r),slot:{open:e.dialogState===F.Open},attrs:e.$attrs,slots:e.$slots,visible:u,features:a.RenderStrategy|a.Static})]}))]}))]}))]}))]}))},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 l=t.computed((function(){return e.open?F.Open:F.Closed})),a=t.ref(null),u=t.computed((function(){return!!e.static||l.value===F.Open})),s="headlessui-dialog-"+v(),c=t.computed((function(){return{initialFocus:e.initialFocus}}));C(n,u,c),function(e,n){void 0===n&&(n=t.ref(!0)),t.watchEffect((function(t){if(n.value&&e.value){var o=e.value;D.add(o);for(var r,l=i(P.keys());!(r=l()).done;){var a=r.value;a.contains(o)&&(k(a),P.delete(a))}document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=i(D);!(t=n()).done;)if(e.contains(t.value))return;1===D.size&&(P.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),I(e))}})),t((function(){if(D.delete(o),D.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!P.has(e)){for(var t,n=i(D);!(t=n()).done;)if(e.contains(t.value))return;P.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),I(e)}}));else for(var e,t=i(P.keys());!(e=t()).done;){var n=e.value;k(n),P.delete(n)}}))}}))}(a,u);var p=t.ref(null),f=t.ref(null),m={titleId:p,descriptionId:f,dialogState:l,setTitleId:function(e){p.value!==e&&(p.value=e)},setDescriptionId:function(e){f.value!==e&&(f.value=e)},close:function(){e.onClose(!1)}};return t.provide(U,m),x("mousedown",(function(e){var o=e.target;l.value===F.Open&&1===n.value.size&&(E(n.value,o)||(m.close(),t.nextTick((function(){null==o||o.focus()}))))})),x("keydown",(function(e){e.key===d.Escape&&l.value===F.Open&&(n.value.size>1||m.close())})),t.watchEffect((function(e){if(l.value===F.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(l.value===F.Open&&a.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&&close()}}));t.observe(a.value),e((function(){return t.disconnect()}))}})),{id:s,el:a,dialogRef:a,containers:n,dialogState:l,titleId:p,descriptionId:f}}}),G=t.defineComponent({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e=K("DialogOverlay");return s({props:n({},this.$props,{ref:"el",id:this.id,"aria-hidden":!0,onClick:this.handleClick}),slot:{open:e.dialogState.value===F.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=K("DialogOverlay");return{id:"headlessui-dialog-overlay-"+v(),handleClick:function(){e.close()}}}}),H=t.defineComponent({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"}},render:function(){var e=K("DialogTitle");return s({props:n({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===F.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=K("DialogTitle"),n="headlessui-dialog-title-"+v();return t.onMounted((function(){e.setTitleId(n),t.onUnmounted((function(){return e.setTitleId(null)}))})),{id:n}}}),z=t.defineComponent({name:"DialogDescription",props:{as:{type:[Object,String],default:"p"}},render:function(){var e=K("DialogDescription");return s({props:n({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===F.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=K("DialogDescription"),n="headlessui-dialog-description-"+v();return t.onMounted((function(){e.setDescriptionId(n),t.onUnmounted((function(){return e.setDescriptionId(null)}))})),{id:n}}});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 _=Symbol("DisclosureContext");function Q(e){var n=t.inject(_,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Disclosure /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Q),o}return n}var J,X,Z=t.defineComponent({name:"Disclosure",props:{as:{type:[Object,String],default:"template"}},setup:function(e,o){var r=o.slots,i=o.attrs,a=n({},e),u=t.ref(V.Closed),c=t.ref(null);return t.provide(_,{disclosureState:u,panelRef:c,toggleDisclosure:function(){var e;u.value=l(u.value,((e={})[V.Open]=V.Closed,e[V.Closed]=V.Open,e))}}),function(){return s({props:a,slot:{open:u.value===V.Open},slots:r,attrs:i})}}}),ee=t.defineComponent({name:"DisclosureButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=Q("DisclosureButton"),t={open:e.disclosureState.value===V.Open};return s({props:n({},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})},setup:function(e){var n=Q("DisclosureButton");return{id:"headlessui-disclosure-button-"+v(),ariaControls:t.computed((function(){var e,t;return null!=(e=null==(t=Y(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 d.Space:case d.Enter:t.preventDefault(),n.toggleDisclosure()}}}}}),te=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:Q("DisclosurePanel").disclosureState.value===V.Open};return s({props:n({},this.$props,{id:this.id,ref:"el"}),slot:e,attrs:this.$attrs,slots:this.$slots,features:a.RenderStrategy|a.Static,visible:e.open})},setup:function(){var e=Q("DisclosurePanel");return{id:"headlessui-disclosure-panel-"+v(),el:e.panelRef}}}),ne=t.defineComponent({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null}},render:function(){return s({props:n({},o(this.$props,["initialFocus"]),{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots})},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),C(n,r,i))})),t.onUnmounted((function(){r.value=!1})),{el:o}}});function oe(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 J.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case J.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 J.Next:return n.findIndex((function(e,n){return!(n<=r||t.resolveDisabled(e))}));case J.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case J.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case J.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?o:i}function re(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"}(J||(J={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(X||(X={}));var ie=Symbol("ListboxContext");function le(e){var n=t.inject(ie,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Listbox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,le),o}return n}var ae,ue=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,l=n.emit,a=e.disabled,u=o(e,["modelValue","disabled"]),c=t.ref(X.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:c,value:b,labelRef:d,buttonRef:p,optionsRef:f,disabled:a,options:v,searchQuery:m,activeOptionIndex:h,closeListbox:function(){a||c.value!==X.Closed&&(c.value=X.Closed,h.value=null)},openListbox:function(){a||c.value!==X.Open&&(c.value=X.Open)},goToOption:function(e,t){if(!a&&c.value!==X.Closed){var n=oe(e===J.Specific?{focus:J.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(!a&&c.value!==X.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(){a||c.value!==X.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){a||l("update:modelValue",e)}};return t.onMounted((function(){function e(e){var t,n,o,r=e.target,i=document.activeElement;c.value===X.Open&&((null==(t=Y(p))?void 0:t.contains(r))||((null==(n=Y(f))?void 0:n.contains(r))||y.closeListbox(),i!==document.body&&(null==i?void 0:i.contains(r))||e.defaultPrevented||null==(o=Y(p))||o.focus({preventScroll:!0})))}window.addEventListener("mousedown",e),t.onUnmounted((function(){return window.removeEventListener("mousedown",e)}))})),t.provide(ie,y),function(){return s({props:u,slot:{open:c.value===X.Open,disabled:a},slots:r,attrs:i})}}}),se=t.defineComponent({name:"ListboxLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){var e=le("ListboxLabel"),t={open:e.listboxState.value===X.Open,disabled:e.disabled};return s({props:n({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:t,attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=le("ListboxLabel");return{id:"headlessui-listbox-label-"+v(),el:e.labelRef,handleClick:function(){var t;null==(t=Y(e.buttonRef))||t.focus({preventScroll:!0})}}}}),ce=t.defineComponent({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"}},render:function(){var e,t,o=le("ListboxButton"),r={open:o.listboxState.value===X.Open,disabled:o.disabled},i={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=Y(o.optionsRef))?void 0:e.id,"aria-expanded":o.listboxState.value===X.Open||void 0,"aria-labelledby":o.labelRef.value?[null==(t=Y(o.labelRef))?void 0:t.id,this.id].join(" "):void 0,disabled:o.disabled,onKeydown:this.handleKeyDown,onClick:this.handleClick};return s({props:n({},this.$props,i),slot:r,attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=le("ListboxButton");return{id:"headlessui-listbox-button-"+v(),el:e.buttonRef,handleKeyDown:function(n){switch(n.key){case d.Space:case d.Enter:case d.ArrowDown:n.preventDefault(),e.openListbox(),t.nextTick((function(){var t;null==(t=Y(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(J.First)}));break;case d.ArrowUp:n.preventDefault(),e.openListbox(),t.nextTick((function(){var t;null==(t=Y(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(J.Last)}))}},handleClick:function(n){var o;e.disabled||(e.listboxState.value===X.Open?(e.closeListbox(),t.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}))):(n.preventDefault(),e.openListbox(),o=function(){var t;return null==(t=Y(e.optionsRef))?void 0:t.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(o)}))))}}}}),de=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=le("ListboxOptions"),l={open:i.listboxState.value===X.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=Y(i.labelRef))?void 0:o.id)?t:null==(r=Y(i.buttonRef))?void 0:r.id,id:this.id,onKeydown:this.handleKeyDown,role:"listbox",tabIndex:0,ref:"el"};return s({props:n({},this.$props,u),slot:l,attrs:this.$attrs,slots:this.$slots,features:a.RenderStrategy|a.Static,visible:l.open})},setup:function(){var e=le("ListboxOptions"),n="headlessui-listbox-options-"+v(),o=t.ref(null);return{id:n,el:e.optionsRef,handleKeyDown:function(n){switch(o.value&&clearTimeout(o.value),n.key){case d.Space:if(""!==e.searchQuery.value)return n.preventDefault(),n.stopPropagation(),e.search(n.key);case d.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=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case d.ArrowDown:return n.preventDefault(),n.stopPropagation(),e.goToOption(J.Next);case d.ArrowUp:return n.preventDefault(),n.stopPropagation(),e.goToOption(J.Previous);case d.Home:case d.PageUp:return n.preventDefault(),n.stopPropagation(),e.goToOption(J.First);case d.End:case d.PageDown:return n.preventDefault(),n.stopPropagation(),e.goToOption(J.Last);case d.Escape:n.preventDefault(),n.stopPropagation(),e.closeListbox(),t.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case d.Tab:n.preventDefault(),n.stopPropagation();break;default:1===n.key.length&&(e.search(n.key),o.value=setTimeout((function(){return e.clearSearch()}),350))}}}}}),pe=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,l=le("ListboxOption"),a="headlessui-listbox-option-"+v(),u=e.disabled,c=e.className,d=void 0===c?e.class:c,p=e.value,f=t.computed((function(){return null!==l.activeOptionIndex.value&&l.options.value[l.activeOptionIndex.value].id===a})),m=t.computed((function(){return t.toRaw(l.value.value)===t.toRaw(p)})),h=t.ref({disabled:u,value:p,textValue:""});function b(e){if(u)return e.preventDefault();l.select(p),l.closeListbox(),t.nextTick((function(){var e;return null==(e=Y(l.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function y(){if(u)return l.goToOption(J.Nothing);l.goToOption(J.Specific,a)}function g(){u||f.value||l.goToOption(J.Specific,a)}function S(){u||f.value&&l.goToOption(J.Nothing)}return t.onMounted((function(){var e,t,n=null==(e=document.getElementById(a))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(h.value.textValue=n)})),t.onMounted((function(){return l.registerOption(a,h)})),t.onUnmounted((function(){return l.unregisterOption(a)})),t.onMounted((function(){t.watch([l.listboxState,m],(function(){var e;l.listboxState.value===X.Open&&m.value&&(l.goToOption(J.Specific,a),null==(e=document.getElementById(a))||null==e.focus||e.focus())}),{immediate:!0})})),t.watchEffect((function(){l.listboxState.value===X.Open&&f.value&&t.nextTick((function(){var e;return null==(e=document.getElementById(a))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:f.value,selected:m.value,disabled:u},o={id:a,role:"option",tabIndex:-1,class:re(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 s({props:n({},e,o),slot:t,attrs:i,slots:r})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ae||(ae={}));var fe=Symbol("MenuContext");function ve(e){var n=t.inject(fe,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Menu /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,ve),o}return n}var me,he=t.defineComponent({props:{as:{type:[Object,String],default:"template"}},setup:function(e,n){var o=n.slots,r=n.attrs,i=t.ref(ae.Closed),l=t.ref(null),a=t.ref(null),u=t.ref([]),c=t.ref(""),d=t.ref(null),p={menuState:i,buttonRef:l,itemsRef:a,items:u,searchQuery:c,activeItemIndex:d,closeMenu:function(){i.value=ae.Closed,d.value=null},openMenu:function(){return i.value=ae.Open},goToItem:function(e,t){var n=oe(e===J.Specific?{focus:J.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 t.onMounted((function(){function e(e){var t,n,o,r=e.target,u=document.activeElement;i.value===ae.Open&&((null==(t=Y(l))?void 0:t.contains(r))||((null==(n=Y(a))?void 0:n.contains(r))||p.closeMenu(),u!==document.body&&(null==u?void 0:u.contains(r))||e.defaultPrevented||null==(o=Y(l))||o.focus({preventScroll:!0})))}window.addEventListener("mousedown",e),t.onUnmounted((function(){return window.removeEventListener("mousedown",e)}))})),t.provide(fe,p),function(){return s({props:e,slot:{open:i.value===ae.Open},slots:o,attrs:r})}}}),be=t.defineComponent({props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"}},render:function(){var e,t=ve("MenuButton"),o={open:t.menuState.value===ae.Open},r={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===ae.Open||void 0,onKeydown:this.handleKeyDown,onClick:this.handleClick};return s({props:n({},this.$props,r),slot:o,attrs:this.$attrs,slots:this.$slots})},setup:function(e){var n=ve("MenuButton");return{id:"headlessui-menu-button-"+v(),el:n.buttonRef,handleKeyDown:function(e){switch(e.key){case d.Space:case d.Enter:case d.ArrowDown:e.preventDefault(),e.stopPropagation(),n.openMenu(),t.nextTick((function(){var e;null==(e=Y(n.itemsRef))||e.focus({preventScroll:!0}),n.goToItem(J.First)}));break;case d.ArrowUp:e.preventDefault(),e.stopPropagation(),n.openMenu(),t.nextTick((function(){var e;null==(e=Y(n.itemsRef))||e.focus({preventScroll:!0}),n.goToItem(J.Last)}))}},handleClick:function(o){var r;e.disabled||(n.menuState.value===ae.Open?(n.closeMenu(),t.nextTick((function(){var e;return null==(e=Y(n.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(o.preventDefault(),o.stopPropagation(),n.openMenu(),r=function(){var e;return null==(e=Y(n.itemsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(r)}))))}}}}),ye=t.defineComponent({props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,o=ve("MenuItems"),r={open:o.menuState.value===ae.Open},i={"aria-activedescendant":null===o.activeItemIndex.value||null==(e=o.items.value[o.activeItemIndex.value])?void 0:e.id,"aria-labelledby":null==(t=Y(o.buttonRef))?void 0:t.id,id:this.id,onKeydown:this.handleKeyDown,role:"menu",tabIndex:0,ref:"el"};return s({props:n({},this.$props,i),slot:r,attrs:this.$attrs,slots:this.$slots,features:a.RenderStrategy|a.Static,visible:r.open})},setup:function(){var e=ve("MenuItems"),n="headlessui-menu-items-"+v(),o=t.ref(null);return t.watchEffect((function(){var t=Y(e.itemsRef);if(t&&e.menuState.value===ae.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 d.Space:if(""!==e.searchQuery.value)return n.preventDefault(),n.stopPropagation(),e.search(n.key);case d.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=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case d.ArrowDown:return n.preventDefault(),n.stopPropagation(),e.goToItem(J.Next);case d.ArrowUp:return n.preventDefault(),n.stopPropagation(),e.goToItem(J.Previous);case d.Home:case d.PageUp:return n.preventDefault(),n.stopPropagation(),e.goToItem(J.First);case d.End:case d.PageDown:return n.preventDefault(),n.stopPropagation(),e.goToItem(J.Last);case d.Escape:n.preventDefault(),n.stopPropagation(),e.closeMenu(),t.nextTick((function(){var t;return null==(t=Y(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case d.Tab:n.preventDefault(),n.stopPropagation();break;default:1===n.key.length&&(e.search(n.key),o.value=setTimeout((function(){return e.clearSearch()}),350))}}}}}),ge=t.defineComponent({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,l=ve("MenuItem"),a="headlessui-menu-item-"+v(),u=e.disabled,c=e.className,d=void 0===c?e.class:c,p=t.computed((function(){return null!==l.activeItemIndex.value&&l.items.value[l.activeItemIndex.value].id===a})),f=t.ref({disabled:u,textValue:""});function m(e){if(u)return e.preventDefault();l.closeMenu(),t.nextTick((function(){var e;return null==(e=Y(l.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function h(){if(u)return l.goToItem(J.Nothing);l.goToItem(J.Specific,a)}function b(){u||p.value||l.goToItem(J.Specific,a)}function y(){u||p.value&&l.goToItem(J.Nothing)}return t.onMounted((function(){var e,t,n=null==(e=document.getElementById(a))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(f.value.textValue=n)})),t.onMounted((function(){return l.registerItem(a,f)})),t.onUnmounted((function(){return l.unregisterItem(a)})),t.watchEffect((function(){l.menuState.value===ae.Open&&p.value&&t.nextTick((function(){var e;return null==(e=document.getElementById(a))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:p.value,disabled:u},o={id:a,role:"menuitem",tabIndex:-1,class:re(d,t),"aria-disabled":!0===u||void 0,onClick:m,onFocus:h,onPointermove:b,onMousemove:b,onPointerleave:y,onMouseleave:y};return s({props:n({},e,o),slot:t,attrs:i,slots:r})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(me||(me={}));var Se=Symbol("PopoverContext");function we(e){var n=t.inject(Se,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <"+Ce.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,we),o}return n}var Oe=Symbol("PopoverGroupContext");function xe(){return t.inject(Oe,null)}var Ee=Symbol("PopoverPanelContext"),Ce=t.defineComponent({name:"Popover",props:{as:{type:[Object,String],default:"div"}},setup:function(e,o){var r=o.slots,i=o.attrs,a=n({},e),u="headlessui-popover-button-"+v(),c="headlessui-popover-panel-"+v(),d=t.ref(me.Closed),p=t.ref(null),f=t.ref(null),m={popoverState:d,buttonId:u,panelId:c,panel:f,button:p,togglePopover:function(){var e;d.value=l(d.value,((e={})[me.Open]=me.Closed,e[me.Closed]=me.Open,e))},closePopover:function(){d.value!==me.Closed&&(d.value=me.Closed)}};t.provide(Se,m);var h={buttonId:u,panelId:c,close:function(){m.closePopover()}},b=xe(),S=null==b?void 0:b.registerPopover;return t.watchEffect((function(){return null==S?void 0:S(h)})),x("focus",(function(){var e,t,n;d.value===me.Open&&((null!=(e=null==b?void 0:b.isFocusWithinPopoverGroup())?e:(null==(t=Y(p))?void 0:t.contains(document.activeElement))||(null==(n=Y(f))?void 0:n.contains(document.activeElement)))||p&&f&&m.closePopover())}),!0),x("mousedown",(function(e){var t,n,o,r,i,a,u=e.target;d.value===me.Open&&((null==(t=Y(p))?void 0:t.contains(u))||(null==(n=Y(f))?void 0:n.contains(u))||(m.closePopover(),void 0===(i=y.Loose)&&(i=y.Strict),(r=u)!==document.body&&l(i,((a={})[y.Strict]=function(){return r.matches(g)},a[y.Loose]=function(){for(var e=r;null!==e;){if(e.matches(g))return!0;e=e.parentElement}return!1},a))||(e.preventDefault(),null==(o=Y(p))||o.focus())))})),function(){return s({props:a,slot:{open:d.value===me.Open},slots:r,attrs:i})}}}),De=t.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===me.Open},o=this.isWithinPanel?{type:"button",onKeydown:this.handleKeyDown,onClick:this.handleClick}:{ref:"el",id:e.buttonId,type:"button","aria-expanded":e.popoverState.value===me.Open||void 0,"aria-controls":Y(e.panel)?e.panelId:void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return s({props:n({},this.$props,o),slot:t,attrs:this.$attrs,slots:this.$slots})},setup:function(e){var n=we("PopoverButton"),o=xe(),r=null==o?void 0:o.closeOthers,i=t.inject(Ee,null),l=null!==i&&i===n.panelId,a=t.ref(null),u=t.ref("undefined"==typeof window?null:document.activeElement);return x("focus",(function(){u.value=a.value,a.value=document.activeElement}),!0),{isWithinPanel:l,el:l?null:n.button,handleKeyDown:function(e){var t,o;if(l){if(n.popoverState.value===me.Closed)return;switch(e.key){case d.Space:case d.Enter:e.preventDefault(),e.stopPropagation(),n.closePopover(),null==(t=Y(n.button))||t.focus()}}else switch(e.key){case d.Space:case d.Enter:e.preventDefault(),e.stopPropagation(),n.popoverState.value===me.Closed&&(null==r||r(n.buttonId)),n.togglePopover();break;case d.Escape:if(n.popoverState.value!==me.Open)return null==r?void 0:r(n.buttonId);if(!Y(n.button))return;if(!(null==(o=Y(n.button))?void 0:o.contains(document.activeElement)))return;n.closePopover();break;case d.Tab:if(n.popoverState.value!==me.Open)return;if(!n.panel)return;if(!n.button)return;if(e.shiftKey){var i,a;if(!u.value)return;if(null==(i=Y(n.button))?void 0:i.contains(u.value))return;if(null==(a=Y(n.panel))?void 0:a.contains(u.value))return;var s=S(),c=s.indexOf(u.value);if(s.indexOf(Y(n.button))>c)return;e.preventDefault(),e.stopPropagation(),O(Y(n.panel),m.Last)}else e.preventDefault(),e.stopPropagation(),O(Y(n.panel),m.First)}},handleKeyUp:function(e){var t,o;if(!l&&n.popoverState.value===me.Open&&n.panel&&n.button)switch(e.key){case d.Tab:if(!u.value)return;if(null==(t=Y(n.button))?void 0:t.contains(u.value))return;if(null==(o=Y(n.panel))?void 0:o.contains(u.value))return;var r=S(),i=r.indexOf(u.value);if(r.indexOf(Y(n.button))>i)return;e.preventDefault(),e.stopPropagation(),O(Y(n.panel),m.Last)}},handleClick:function(){var t,o;e.disabled||(l?(n.closePopover(),null==(t=Y(n.button))||t.focus()):(n.popoverState.value===me.Closed&&(null==r||r(n.buttonId)),null==(o=Y(n.button))||o.focus(),n.togglePopover()))},handleFocus:function(){}}}}),Pe=t.defineComponent({name:"PopoverOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e={open:we("PopoverOverlay").popoverState.value===me.Open};return s({props:n({},this.$props,{id:this.id,ref:"el","aria-hidden":!0,onClick:this.handleClick}),slot:e,attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=we("PopoverOverlay");return{id:"headlessui-popover-overlay-"+v(),handleClick:function(){e.closePopover()}}}}),Ie=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:we("PopoverPanel").popoverState.value===me.Open};return s({props:n({},this.$props,{ref:"el",id:this.id,onKeydown:this.handleKeyDown}),slot:e,attrs:this.$attrs,slots:this.$slots,features:a.RenderStrategy|a.Static,visible:e.open})},setup:function(e){var n=e.focus,o=we("PopoverPanel");return t.provide(Ee,o.panelId),t.onUnmounted((function(){o.panel.value=null})),t.watchEffect((function(){var e;if(n&&o.popoverState.value===me.Open&&o.panel){var t=document.activeElement;(null==(e=Y(o.panel))?void 0:e.contains(t))||O(Y(o.panel),m.First)}})),x("keydown",(function(e){var t;if(o.popoverState.value===me.Open&&Y(o.panel)&&e.key===d.Tab&&document.activeElement&&(null==(t=Y(o.panel))?void 0:t.contains(document.activeElement))){e.preventDefault();var n,r=O(Y(o.panel),e.shiftKey?m.Previous:m.Next);if(r===h.Underflow)return null==(n=Y(o.button))?void 0:n.focus();if(r===h.Overflow){if(!Y(o.button))return;var i=S(),l=i.indexOf(Y(o.button));O(i.splice(l+1).filter((function(e){var t;return!(null==(t=Y(o.panel))?void 0:t.contains(e))})),m.First)===h.Error&&O(document.body,m.First)}}})),x("focus",(function(){var e;n&&o.popoverState.value===me.Open&&Y(o.panel)&&((null==(e=Y(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 d.Escape:if(o.popoverState.value!==me.Open)return;if(!Y(o.panel))return;if(!(null==(t=Y(o.panel))?void 0:t.contains(document.activeElement)))return;e.preventDefault(),o.closePopover(),null==(n=Y(o.button))||n.focus()}}}}}),ke=t.defineComponent({name:"PopoverGroup",props:{as:{type:[Object,String],default:"div"}},render:function(){return s({props:n({},this.$props,{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots})},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(Oe,{registerPopover:function(e){return n.value.push(e),function(){o(e)}},unregisterPopover:o,isFocusWithinPopoverGroup:function(){var t,o=document.activeElement;return!!(null==(t=Y(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}}}),Te=Symbol("GroupContext");function Re(e){var n=t.inject(Te,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <SwitchGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Re),o}return n}var Le=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),l=t.ref(null),a=t.ref(null);return t.provide(Te,{switchRef:i,labelRef:l,descriptionRef:a}),function(){return s({props:e,slot:{},slots:o,attrs:r})}}}),Fe=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(Te,null),o=this.$props,r=o.className,i=void 0===r?o.class:r,l=t.computed((function(){var t;return null==(t=Y(null==e?void 0:e.labelRef))?void 0:t.id})),a=t.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:re(i,u),"aria-checked":this.$props.modelValue,"aria-labelledby":l.value,"aria-describedby":a.value,onClick:this.handleClick,onKeyup:this.handleKeyUp,onKeypress:this.handleKeyPress};return"button"===this.$props.as&&Object.assign(c,{type:"button"}),s({props:n({},this.$props,c),slot:u,attrs:this.$attrs,slots:this.$slots})},setup:function(e,n){var o=n.emit,r=t.inject(Te,null);function i(){o("update:modelValue",!e.modelValue)}return{id:"headlessui-switch-"+v(),el:null==r?void 0:r.switchRef,handleClick:function(e){e.preventDefault(),i()},handleKeyUp:function(e){e.key!==d.Tab&&e.preventDefault(),e.key===d.Space&&i()},handleKeyPress:function(e){e.preventDefault()}}}}),je=t.defineComponent({name:"SwitchLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){return s({props:n({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:{},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=Re("SwitchLabel");return{id:"headlessui-switch-label-"+v(),el:e.labelRef,handleClick:function(){var t=Y(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 s({props:n({},this.$props,{id:this.id,ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=Re("SwitchDescription");return{id:"headlessui-switch-description-"+v(),el:e.descriptionRef}}});e.Alert=p,e.Dialog=W,e.DialogDescription=z,e.DialogOverlay=G,e.DialogTitle=H,e.Disclosure=Z,e.DisclosureButton=ee,e.DisclosurePanel=te,e.FocusTrap=ne,e.Listbox=ue,e.ListboxButton=ce,e.ListboxLabel=se,e.ListboxOption=pe,e.ListboxOptions=de,e.Menu=he,e.MenuButton=be,e.MenuItem=ge,e.MenuItems=ye,e.Popover=Ce,e.PopoverButton=De,e.PopoverGroup=ke,e.PopoverOverlay=Pe,e.PopoverPanel=Ie,e.Portal=B,e.PortalGroup=N,e.Switch=Fe,e.SwitchDescription=$e,e.SwitchGroup=Le,e.SwitchLabel=je,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={},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 l(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,l),a}var a,u,s;function c(e){var t,r,i=e.visible,s=void 0===i||i,c=e.features,p=void 0===c?a.None:c,f=o(e,["visible","features"]);return s||p&a.Static&&f.props.static?d(f):p&a.RenderStrategy?l(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=e.attrs,r=e.slots,l=e.slot,a=function(e,t){void 0===t&&(t=[]);for(var n,o=Object.assign({},e),r=i(t);!(n=r()).done;){var l=n.value;l in o&&delete o[l]}return o}(e.props,["unmount","static"]),u=a.as,s=o(a,["as"]),c=null==r.default?void 0:r.default(l);if("template"===u){if(Object.keys(s).length>0||"class"in n){var d=null!=c?c:[],p=d[0];if(d.slice(1).length>0)throw new Error('You should only render 1 child or use the `as="..."` prop');return t.cloneVNode(p,s)}return c}return t.h(u,s,c)}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(a||(a={})),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.ArrowUp="ArrowUp",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")}(),l=t&v.NoScroll?{preventScroll:!0}:{},a=0,u=n.length,s=void 0;do{var c;if(a>=u||a+u<=0)return m.Error;var d=i+a;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(l),a+=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),l=t.ref(null);function a(){if(n.value&&1===e.value.size){var t=o.value.initialFocus,a=document.activeElement;if(t){if(t===a)return}else if(x(e.value,a))return;if(r.value=a,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 />")}l.value=document.activeElement}}function u(){S(r.value),r.value=null,l.value=null}t.watchEffect(a),t.onUpdated((function(){n.value?a():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){l.value=document.activeElement;break}}})),O("focus",(function(t){if(n.value&&1===e.value.size){var o=l.value;if(o){var r=t.target;r&&r instanceof HTMLElement?x(e.value,r)?(l.value=r,S(r)):(t.preventDefault(),t.stopPropagation(),S(o)):S(l.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,D=new Map;function P(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function I(e){var t=D.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var k,T=Symbol("StackContext");function R(){return t.inject(T,(function(){}))}!function(e){e[e.AddElement=0]="AddElement",e[e.RemoveElement=1]="RemoveElement"}(k||(k={}));var L,F=t.defineComponent({name:"StackProvider",props:{onUpdate:{type:Function,default:void 0}},setup:function(e,n){var o=n.slots,r=R();return t.provide(T,(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"),$=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),l=t.inject(B,null),a=t.ref(!0===i||null===l?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)}():l.resolveTarget());t.watchEffect((function(){i||null!==l&&(a.value=l.resolveTarget())}));var u=t.ref(null);return function(e){var n=R();t.watchEffect((function(t){var o=null==e?void 0:e.value;o&&(n(k.AddElement,o),t((function(){return n(k.RemoveElement,o)})))}))}(u),t.onUnmounted((function(){var e,t=document.getElementById("headlessui-portal-root");t&&a.value===t&&a.value.children.length<=0&&(null==(e=a.value.parentElement)||e.removeChild(a.value))})),function(){return null===a.value?null:t.h(F,{},(function(){return[t.h(t.Teleport,{to:a.value},[t.h("div",{ref:u},[c({props:e,slot:{},attrs:r,slots:o})])])]}))}}}),B=Symbol("PortalGroupContext"),M=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,l=t.reactive({resolveTarget:function(){return e.target}});return t.provide(B,l),function(){return c({props:o(e,["target"]),slot:{},attrs:r,slots:i})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(L||(L={}));var N=Symbol("DialogContext");function U(e){var n=t.inject(N,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Dialog /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,U),o}return n}var K,V="DC8F892D-2EBD-447C-A4C8-A03058436FF4",q=t.defineComponent({name:"Dialog",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:Boolean,default:V},onClose:{type:Function,default:V},initialFocus:{type:Object,default:null}},render:function(){var e=this,r={ref:"el",id:this.id,role:"dialog","aria-modal":this.dialogState===L.Open||void 0,"aria-labelledby":this.titleId,"aria-describedby":this.descriptionId},i=this.$props,u=i.open,s=o(i,["open","onClose","initialFocus"]),d=this.containers;return t.h(F,{onUpdate:function(e,t){var n;return l(e,((n={})[k.AddElement]=function(){d.add(t)},n[k.RemoveElement]=function(){d.delete(t)},n))}},(function(){return[t.h($,{force:!0},(function(){return[t.h(A,{},(function(){return[t.h(M,{target:e.dialogRef},(function(){return[t.h($,{force:!1},(function(){return[c({props:n({},s,r),slot:{open:e.dialogState===L.Open},attrs:e.$attrs,slots:e.$slots,visible:u,features:a.RenderStrategy|a.Static})]}))]}))]}))]}))]}))},setup:function(e){var n=t.ref(new Set),o=e.open!==V,r=e.onClose!==V;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===V?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===V?void 0:e.onClose));var l=t.computed((function(){return e.open?L.Open:L.Closed})),a=t.ref(null),u=t.ref(!!e.static||l.value===L.Open);t.onUpdated((function(){u.value=!!e.static||l.value===L.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,l=i(D.keys());!(r=l()).done;){var a=r.value;a.contains(o)&&(I(a),D.delete(a))}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&&(D.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),P(e))}})),t((function(){if(C.delete(o),C.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!D.has(e)){for(var t,n=i(C);!(t=n()).done;)if(e.contains(t.value))return;D.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),P(e)}}));else for(var e,t=i(D.keys());!(e=t()).done;){var n=e.value;I(n),D.delete(n)}}))}}))}(a,u);var p=t.ref(null),v=t.ref(null),m={titleId:p,descriptionId:v,dialogState:l,setTitleId:function(e){p.value!==e&&(p.value=e)},setDescriptionId:function(e){v.value!==e&&(v.value=e)},close:function(){e.onClose(!1)}};return t.provide(N,m),O("mousedown",(function(e){var o=e.target;l.value===L.Open&&1===n.value.size&&(x(n.value,o)||(m.close(),t.nextTick((function(){null==o||o.focus()}))))})),O("keydown",(function(e){e.key===s.Escape&&l.value===L.Open&&(n.value.size>1||m.close())})),t.watchEffect((function(e){if(l.value===L.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(l.value===L.Open&&a.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&&m.close()}}));t.observe(a.value),e((function(){return t.disconnect()}))}})),{id:c,el:a,dialogRef:a,containers:n,dialogState:l,titleId:p,descriptionId:v}}}),W=t.defineComponent({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e=U("DialogOverlay");return c({props:n({},this.$props,{ref:"el",id:this.id,"aria-hidden":!0,onClick:this.handleClick}),slot:{open:e.dialogState.value===L.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=U("DialogOverlay");return{id:"headlessui-dialog-overlay-"+f(),handleClick:function(){e.close()}}}}),G=t.defineComponent({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"}},render:function(){var e=U("DialogTitle");return c({props:n({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===L.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=U("DialogTitle"),n="headlessui-dialog-title-"+f();return t.onMounted((function(){e.setTitleId(n),t.onUnmounted((function(){return e.setTitleId(null)}))})),{id:n}}}),H=t.defineComponent({name:"DialogDescription",props:{as:{type:[Object,String],default:"p"}},render:function(){var e=U("DialogDescription");return c({props:n({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===L.Open},attrs:this.$attrs,slots:this.$slots})},setup:function(){var e=U("DialogDescription"),n="headlessui-dialog-description-"+f();return t.onMounted((function(){e.setDescriptionId(n),t.onUnmounted((function(){return e.setDescriptionId(null)}))})),{id:n}}});function z(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"}(K||(K={}));var Y=Symbol("DisclosureContext");function _(e){var n=t.inject(Y,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Disclosure /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,_),o}return n}var Q,J,X=t.defineComponent({name:"Disclosure",props:{as:{type:[Object,String],default:"template"}},setup:function(e,o){var r=o.slots,i=o.attrs,a=n({},e),u=t.ref(K.Closed),s=t.ref(null);return t.provide(Y,{disclosureState:u,panelRef:s,toggleDisclosure:function(){var e;u.value=l(u.value,((e={})[K.Open]=K.Closed,e[K.Closed]=K.Open,e))}}),function(){return c({props:a,slot:{open:u.value===K.Open},slots:r,attrs:i})}}}),Z=t.defineComponent({name:"DisclosureButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=_("DisclosureButton"),t={open:e.disclosureState.value===K.Open};return c({props:n({},this.$props,{id:this.id,type:"button","aria-expanded":e.disclosureState.value===K.Open||void 0,"aria-controls":this.ariaControls,onClick:this.handleClick,onKeydown:this.handleKeyDown}),slot:t,attrs:this.$attrs,slots:this.$slots})},setup:function(e){var n=_("DisclosureButton");return{id:"headlessui-disclosure-button-"+f(),ariaControls:t.computed((function(){var e,t;return null!=(e=null==(t=z(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()}}}}}),ee=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:_("DisclosurePanel").disclosureState.value===K.Open};return c({props:n({},this.$props,{id:this.id,ref:"el"}),slot:e,attrs:this.$attrs,slots:this.$slots,features:a.RenderStrategy|a.Static,visible:e.open})},setup:function(){var e=_("DisclosurePanel");return{id:"headlessui-disclosure-panel-"+f(),el:e.panelRef}}}),te=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})},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 ne(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 Q.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case Q.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 Q.Next:return n.findIndex((function(e,n){return!(n<=r||t.resolveDisabled(e))}));case Q.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case Q.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case Q.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?o:i}function oe(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"}(Q||(Q={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(J||(J={}));var re=Symbol("ListboxContext");function ie(e){var n=t.inject(re,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Listbox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,ie),o}return n}var le,ae=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,l=n.emit,a=e.disabled,u=o(e,["modelValue","disabled"]),s=t.ref(J.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:a,options:v,searchQuery:m,activeOptionIndex:h,closeListbox:function(){a||s.value!==J.Closed&&(s.value=J.Closed,h.value=null)},openListbox:function(){a||s.value!==J.Open&&(s.value=J.Open)},goToOption:function(e,t){if(!a&&s.value!==J.Closed){var n=ne(e===Q.Specific?{focus:Q.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(!a&&s.value!==J.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(){a||s.value!==J.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){a||l("update:modelValue",e)}};return t.onMounted((function(){function e(e){var t,n,o,r=e.target,i=document.activeElement;s.value===J.Open&&((null==(t=z(p))?void 0:t.contains(r))||((null==(n=z(f))?void 0:n.contains(r))||y.closeListbox(),i!==document.body&&(null==i?void 0:i.contains(r))||e.defaultPrevented||null==(o=z(p))||o.focus({preventScroll:!0})))}window.addEventListener("mousedown",e),t.onUnmounted((function(){return window.removeEventListener("mousedown",e)}))})),t.provide(re,y),function(){return c({props:u,slot:{open:s.value===J.Open,disabled:a},slots:r,attrs:i})}}}),ue=t.defineComponent({name:"ListboxLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){var e=ie("ListboxLabel"),t={open:e.listboxState.value===J.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})},setup:function(){var e=ie("ListboxLabel");return{id:"headlessui-listbox-label-"+f(),el:e.labelRef,handleClick:function(){var t;null==(t=z(e.buttonRef))||t.focus({preventScroll:!0})}}}}),se=t.defineComponent({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"}},render:function(){var e,t,o=ie("ListboxButton"),r={open:o.listboxState.value===J.Open,disabled:o.disabled},i={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=z(o.optionsRef))?void 0:e.id,"aria-expanded":o.listboxState.value===J.Open||void 0,"aria-labelledby":o.labelRef.value?[null==(t=z(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})},setup:function(){var e=ie("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=z(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(Q.First)}));break;case s.ArrowUp:n.preventDefault(),e.openListbox(),t.nextTick((function(){var t;null==(t=z(e.optionsRef))||t.focus({preventScroll:!0}),e.value.value||e.goToOption(Q.Last)}))}},handleClick:function(n){var o;e.disabled||(e.listboxState.value===J.Open?(e.closeListbox(),t.nextTick((function(){var t;return null==(t=z(e.buttonRef))?void 0:t.focus({preventScroll:!0})}))):(n.preventDefault(),e.openListbox(),o=function(){var t;return null==(t=z(e.optionsRef))?void 0:t.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(o)}))))}}}}),ce=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=ie("ListboxOptions"),l={open:i.listboxState.value===J.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=z(i.labelRef))?void 0:o.id)?t:null==(r=z(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:l,attrs:this.$attrs,slots:this.$slots,features:a.RenderStrategy|a.Static,visible:l.open})},setup:function(){var e=ie("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=z(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.ArrowDown:return n.preventDefault(),n.stopPropagation(),e.goToOption(Q.Next);case s.ArrowUp:return n.preventDefault(),n.stopPropagation(),e.goToOption(Q.Previous);case s.Home:case s.PageUp:return n.preventDefault(),n.stopPropagation(),e.goToOption(Q.First);case s.End:case s.PageDown:return n.preventDefault(),n.stopPropagation(),e.goToOption(Q.Last);case s.Escape:n.preventDefault(),n.stopPropagation(),e.closeListbox(),t.nextTick((function(){var t;return null==(t=z(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))}}}}}),de=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,l=ie("ListboxOption"),a="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!==l.activeOptionIndex.value&&l.options.value[l.activeOptionIndex.value].id===a})),m=t.computed((function(){return t.toRaw(l.value.value)===t.toRaw(p)})),h=t.ref({disabled:u,value:p,textValue:""});function b(e){if(u)return e.preventDefault();l.select(p),l.closeListbox(),t.nextTick((function(){var e;return null==(e=z(l.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function y(){if(u)return l.goToOption(Q.Nothing);l.goToOption(Q.Specific,a)}function g(){u||v.value||l.goToOption(Q.Specific,a)}function S(){u||v.value&&l.goToOption(Q.Nothing)}return t.onMounted((function(){var e,t,n=null==(e=document.getElementById(a))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(h.value.textValue=n)})),t.onMounted((function(){return l.registerOption(a,h)})),t.onUnmounted((function(){return l.unregisterOption(a)})),t.onMounted((function(){t.watch([l.listboxState,m],(function(){var e;l.listboxState.value===J.Open&&m.value&&(l.goToOption(Q.Specific,a),null==(e=document.getElementById(a))||null==e.focus||e.focus())}),{immediate:!0})})),t.watchEffect((function(){l.listboxState.value===J.Open&&v.value&&t.nextTick((function(){var e;return null==(e=document.getElementById(a))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:v.value,selected:m.value,disabled:u},o={id:a,role:"option",tabIndex:-1,class:oe(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})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(le||(le={}));var pe=Symbol("MenuContext");function fe(e){var n=t.inject(pe,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Menu /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,fe),o}return n}var ve,me=t.defineComponent({props:{as:{type:[Object,String],default:"template"}},setup:function(e,n){var o=n.slots,r=n.attrs,i=t.ref(le.Closed),l=t.ref(null),a=t.ref(null),u=t.ref([]),s=t.ref(""),d=t.ref(null),p={menuState:i,buttonRef:l,itemsRef:a,items:u,searchQuery:s,activeItemIndex:d,closeMenu:function(){i.value=le.Closed,d.value=null},openMenu:function(){return i.value=le.Open},goToItem:function(e,t){var n=ne(e===Q.Specific?{focus:Q.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 t.onMounted((function(){function e(e){var t,n,o,r=e.target,u=document.activeElement;i.value===le.Open&&((null==(t=z(l))?void 0:t.contains(r))||((null==(n=z(a))?void 0:n.contains(r))||p.closeMenu(),u!==document.body&&(null==u?void 0:u.contains(r))||e.defaultPrevented||null==(o=z(l))||o.focus({preventScroll:!0})))}window.addEventListener("mousedown",e),t.onUnmounted((function(){return window.removeEventListener("mousedown",e)}))})),t.provide(pe,p),function(){return c({props:e,slot:{open:i.value===le.Open},slots:o,attrs:r})}}}),he=t.defineComponent({props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"}},render:function(){var e,t=fe("MenuButton"),o={open:t.menuState.value===le.Open},r={ref:"el",id:this.id,type:"button","aria-haspopup":!0,"aria-controls":null==(e=z(t.itemsRef))?void 0:e.id,"aria-expanded":t.menuState.value===le.Open||void 0,onKeydown:this.handleKeyDown,onClick:this.handleClick};return c({props:n({},this.$props,r),slot:o,attrs:this.$attrs,slots:this.$slots})},setup:function(e){var n=fe("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=z(n.itemsRef))||e.focus({preventScroll:!0}),n.goToItem(Q.First)}));break;case s.ArrowUp:e.preventDefault(),e.stopPropagation(),n.openMenu(),t.nextTick((function(){var e;null==(e=z(n.itemsRef))||e.focus({preventScroll:!0}),n.goToItem(Q.Last)}))}},handleClick:function(o){var r;e.disabled||(n.menuState.value===le.Open?(n.closeMenu(),t.nextTick((function(){var e;return null==(e=z(n.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(o.preventDefault(),o.stopPropagation(),n.openMenu(),r=function(){var e;return null==(e=z(n.itemsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(r)}))))}}}}),be=t.defineComponent({props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,o=fe("MenuItems"),r={open:o.menuState.value===le.Open},i={"aria-activedescendant":null===o.activeItemIndex.value||null==(e=o.items.value[o.activeItemIndex.value])?void 0:e.id,"aria-labelledby":null==(t=z(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:a.RenderStrategy|a.Static,visible:r.open})},setup:function(){var e=fe("MenuItems"),n="headlessui-menu-items-"+f(),o=t.ref(null);return t.watchEffect((function(){var t=z(e.itemsRef);if(t&&e.menuState.value===le.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=z(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.ArrowDown:return n.preventDefault(),n.stopPropagation(),e.goToItem(Q.Next);case s.ArrowUp:return n.preventDefault(),n.stopPropagation(),e.goToItem(Q.Previous);case s.Home:case s.PageUp:return n.preventDefault(),n.stopPropagation(),e.goToItem(Q.First);case s.End:case s.PageDown:return n.preventDefault(),n.stopPropagation(),e.goToItem(Q.Last);case s.Escape:n.preventDefault(),n.stopPropagation(),e.closeMenu(),t.nextTick((function(){var t;return null==(t=z(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))}}}}}),ye=t.defineComponent({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,l=fe("MenuItem"),a="headlessui-menu-item-"+f(),u=e.disabled,s=e.className,d=void 0===s?e.class:s,p=t.computed((function(){return null!==l.activeItemIndex.value&&l.items.value[l.activeItemIndex.value].id===a})),v=t.ref({disabled:u,textValue:""});function m(e){if(u)return e.preventDefault();l.closeMenu(),t.nextTick((function(){var e;return null==(e=z(l.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function h(){if(u)return l.goToItem(Q.Nothing);l.goToItem(Q.Specific,a)}function b(){u||p.value||l.goToItem(Q.Specific,a)}function y(){u||p.value&&l.goToItem(Q.Nothing)}return t.onMounted((function(){var e,t,n=null==(e=document.getElementById(a))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(v.value.textValue=n)})),t.onMounted((function(){return l.registerItem(a,v)})),t.onUnmounted((function(){return l.unregisterItem(a)})),t.watchEffect((function(){l.menuState.value===le.Open&&p.value&&t.nextTick((function(){var e;return null==(e=document.getElementById(a))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t={active:p.value,disabled:u},o={id:a,role:"menuitem",tabIndex:-1,class:oe(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})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ve||(ve={}));var ge=Symbol("PopoverContext");function Se(e){var n=t.inject(ge,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <"+Ee.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Se),o}return n}var we=Symbol("PopoverGroupContext");function Oe(){return t.inject(we,null)}var xe=Symbol("PopoverPanelContext"),Ee=t.defineComponent({name:"Popover",props:{as:{type:[Object,String],default:"div"}},setup:function(e,o){var r=o.slots,i=o.attrs,a=n({},e),u="headlessui-popover-button-"+f(),s="headlessui-popover-panel-"+f(),d=t.ref(ve.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=l(d.value,((e={})[ve.Open]=ve.Closed,e[ve.Closed]=ve.Open,e))},closePopover:function(){d.value!==ve.Closed&&(d.value=ve.Closed)}};t.provide(ge,m);var h={buttonId:u,panelId:s,close:function(){m.closePopover()}},g=Oe(),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===ve.Open&&((null!=(e=null==g?void 0:g.isFocusWithinPopoverGroup())?e:(null==(t=z(p))?void 0:t.contains(document.activeElement))||(null==(n=z(v))?void 0:n.contains(document.activeElement)))||p&&v&&m.closePopover())}),!0),O("mousedown",(function(e){var t,n,o,r,i,a,u=e.target;d.value===ve.Open&&((null==(t=z(p))?void 0:t.contains(u))||(null==(n=z(v))?void 0:n.contains(u))||(m.closePopover(),void 0===(i=b.Loose)&&(i=b.Strict),(r=u)!==document.body&&l(i,((a={})[b.Strict]=function(){return r.matches(y)},a[b.Loose]=function(){for(var e=r;null!==e;){if(e.matches(y))return!0;e=e.parentElement}return!1},a))||(e.preventDefault(),null==(o=z(p))||o.focus())))})),function(){return c({props:a,slot:{open:d.value===ve.Open},slots:r,attrs:i})}}}),Ce=t.defineComponent({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=Se("PopoverButton"),t={open:e.popoverState.value===ve.Open},o=this.isWithinPanel?{type:"button",onKeydown:this.handleKeyDown,onClick:this.handleClick}:{ref:"el",id:e.buttonId,type:"button","aria-expanded":e.popoverState.value===ve.Open||void 0,"aria-controls":z(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})},setup:function(e){var n=Se("PopoverButton"),o=Oe(),r=null==o?void 0:o.closeOthers,i=t.inject(xe,null),l=null!==i&&i===n.panelId,a=t.ref(null),u=t.ref("undefined"==typeof window?null:document.activeElement);return O("focus",(function(){u.value=a.value,a.value=document.activeElement}),!0),{isWithinPanel:l,el:l?null:n.button,handleKeyDown:function(e){var t,o;if(l){if(n.popoverState.value===ve.Closed)return;switch(e.key){case s.Space:case s.Enter:e.preventDefault(),e.stopPropagation(),n.closePopover(),null==(t=z(n.button))||t.focus()}}else switch(e.key){case s.Space:case s.Enter:e.preventDefault(),e.stopPropagation(),n.popoverState.value===ve.Closed&&(null==r||r(n.buttonId)),n.togglePopover();break;case s.Escape:if(n.popoverState.value!==ve.Open)return null==r?void 0:r(n.buttonId);if(!z(n.button))return;if(!(null==(o=z(n.button))?void 0:o.contains(document.activeElement)))return;n.closePopover();break;case s.Tab:if(n.popoverState.value!==ve.Open)return;if(!n.panel)return;if(!n.button)return;if(e.shiftKey){var i,a;if(!u.value)return;if(null==(i=z(n.button))?void 0:i.contains(u.value))return;if(null==(a=z(n.panel))?void 0:a.contains(u.value))return;var c=g(),d=c.indexOf(u.value);if(c.indexOf(z(n.button))>d)return;e.preventDefault(),e.stopPropagation(),w(z(n.panel),v.Last)}else e.preventDefault(),e.stopPropagation(),w(z(n.panel),v.First)}},handleKeyUp:function(e){var t,o;if(!l&&n.popoverState.value===ve.Open&&n.panel&&n.button)switch(e.key){case s.Tab:if(!u.value)return;if(null==(t=z(n.button))?void 0:t.contains(u.value))return;if(null==(o=z(n.panel))?void 0:o.contains(u.value))return;var r=g(),i=r.indexOf(u.value);if(r.indexOf(z(n.button))>i)return;e.preventDefault(),e.stopPropagation(),w(z(n.panel),v.Last)}},handleClick:function(){var t,o;e.disabled||(l?(n.closePopover(),null==(t=z(n.button))||t.focus()):(n.popoverState.value===ve.Closed&&(null==r||r(n.buttonId)),null==(o=z(n.button))||o.focus(),n.togglePopover()))},handleFocus:function(){}}}}),De=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:Se("PopoverOverlay").popoverState.value===ve.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:a.RenderStrategy|a.Static,visible:e.open})},setup:function(){var e=Se("PopoverOverlay");return{id:"headlessui-popover-overlay-"+f(),handleClick:function(){e.closePopover()}}}}),Pe=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:Se("PopoverPanel").popoverState.value===ve.Open};return c({props:n({},this.$props,{ref:"el",id:this.id,onKeydown:this.handleKeyDown}),slot:e,attrs:this.$attrs,slots:this.$slots,features:a.RenderStrategy|a.Static,visible:e.open})},setup:function(e){var n=e.focus,o=Se("PopoverPanel");return t.provide(xe,o.panelId),t.onUnmounted((function(){o.panel.value=null})),t.watchEffect((function(){var e;if(n&&o.popoverState.value===ve.Open&&o.panel){var t=document.activeElement;(null==(e=z(o.panel))?void 0:e.contains(t))||w(z(o.panel),v.First)}})),O("keydown",(function(e){var t;if(o.popoverState.value===ve.Open&&z(o.panel)&&e.key===s.Tab&&document.activeElement&&(null==(t=z(o.panel))?void 0:t.contains(document.activeElement))){e.preventDefault();var n,r=w(z(o.panel),e.shiftKey?v.Previous:v.Next);if(r===m.Underflow)return null==(n=z(o.button))?void 0:n.focus();if(r===m.Overflow){if(!z(o.button))return;var i=g(),l=i.indexOf(z(o.button));w(i.splice(l+1).filter((function(e){var t;return!(null==(t=z(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===ve.Open&&z(o.panel)&&((null==(e=z(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!==ve.Open)return;if(!z(o.panel))return;if(!(null==(t=z(o.panel))?void 0:t.contains(document.activeElement)))return;e.preventDefault(),o.closePopover(),null==(n=z(o.button))||n.focus()}}}}}),Ie=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})},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(we,{registerPopover:function(e){return n.value.push(e),function(){o(e)}},unregisterPopover:o,isFocusWithinPopoverGroup:function(){var t,o=document.activeElement;return!!(null==(t=z(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}}}),ke=Symbol("GroupContext");function Te(e){var n=t.inject(ke,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <SwitchGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Te),o}return n}var Re=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),l=t.ref(null),a=t.ref(null);return t.provide(ke,{switchRef:i,labelRef:l,descriptionRef:a}),function(){return c({props:e,slot:{},slots:o,attrs:r})}}}),Le=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(ke,null),o=this.$props,r=o.className,i=void 0===r?o.class:r,l=t.computed((function(){var t;return null==(t=z(null==e?void 0:e.labelRef))?void 0:t.id})),a=t.computed((function(){var t;return null==(t=z(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:oe(i,u),"aria-checked":this.$props.modelValue,"aria-labelledby":l.value,"aria-describedby":a.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})},setup:function(e,n){var o=n.emit,r=t.inject(ke,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()}}}}),Fe=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})},setup:function(){var e=Te("SwitchLabel");return{id:"headlessui-switch-label-"+f(),el:e.labelRef,handleClick:function(){var t=z(e.switchRef);null==t||t.click(),null==t||t.focus({preventScroll:!0})}}}}),je=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})},setup:function(){var e=Te("SwitchDescription");return{id:"headlessui-switch-description-"+f(),el:e.descriptionRef}}});e.Dialog=q,e.DialogDescription=H,e.DialogOverlay=W,e.DialogTitle=G,e.Disclosure=X,e.DisclosureButton=Z,e.DisclosurePanel=ee,e.FocusTrap=te,e.Listbox=ae,e.ListboxButton=se,e.ListboxLabel=ue,e.ListboxOption=de,e.ListboxOptions=ce,e.Menu=me,e.MenuButton=he,e.MenuItem=ye,e.MenuItems=be,e.Popover=Ee,e.PopoverButton=Ce,e.PopoverGroup=Ie,e.PopoverOverlay=De,e.PopoverPanel=Pe,e.Portal=A,e.PortalGroup=M,e.Switch=Le,e.SwitchDescription=je,e.SwitchGroup=Re,e.SwitchLabel=Fe,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=headlessui.umd.production.min.js.map

@@ -1,2 +0,1 @@

export * from './components/alert/alert';
export * from './components/dialog/dialog';

@@ -3,0 +2,0 @@ export * from './components/disclosure/disclosure';

{
"name": "@headlessui/vue",
"version": "0.3.0-b309699",
"version": "0.3.0-b7fe69a",
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc