{"size": 68398, "ext": "js", "max_stars_repo_path": "packages/@headlessui-vue/dist/headlessui.umd.production.min.js", "max_stars_repo_name": "sietzekeuning/headlessui", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "packages/@headlessui-vue/dist/headlessui.umd.production.min.js", "max_issues_repo_name": "sietzekeuning/headlessui", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/@headlessui-vue/dist/headlessui.umd.production.min.js", "max_forks_repo_name": "sietzekeuning/headlessui", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22799.3333333333, "max_line_length": 68339, "alphanum_fraction": 0.7101669639}
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self).headlessui={},e.Vue)}(this,(function(e,t){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t.indexOf(n=a[o])>=0||(r[n]=e[n]);return r}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function a(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function i(e,t){if(e in t){for(var n=t[e],o=arguments.length,r=new Array(o>2?o-2:0),a=2;a<o;a++)r[a-2]=arguments[a];return"function"==typeof n?n.apply(void 0,r):n}var u=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(u,i),u}var u,l,s;function c(e){var t,r,a=e.visible,s=void 0===a||a,c=e.features,p=void 0===c?u.None:c,f=o(e,["visible","features"]);return s||p&u.Static&&f.props.static?d(f):p&u.RenderStrategy?i(null==(t=f.props.unmount)||t?l.Unmount:l.Hidden,((r={})[l.Unmount]=function(){return null},r[l.Hidden]=function(){return d(n({},f,{props:n({},f.props,{hidden:!0,style:{display:"none"}})}))},r)):d(f)}function d(e){var n,r=e.attrs,a=e.slots,i=e.slot,u=e.name,l=p(e.props,["unmount","static"]),s=l.as,c=o(l,["as"]),d=null==a.default?void 0:a.default(i);if("template"===s){if(Object.keys(c).length>0||Object.keys(r).length>0){var f=null!=d?d:[],v=f[0],m=f.slice(1);if(null==(n=v)||"string"!=typeof n.type&&"object"!=typeof n.type&&"function"!=typeof n.type||m.length>0)throw new Error(['Passing props on "template"!',"","The current component <"+u+' /> is rendering a "template".',"However we need to passthrough the following props:",Object.keys(c).concat(Object.keys(r)).map((function(e){return"  - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return"  - "+e})).join("\n")].join("\n"));return t.cloneVNode(v,c)}return Array.isArray(d)&&1===d.length?d[0]:d}return t.h(s,c,d)}function p(e,t){void 0===t&&(t=[]);for(var n,o=Object.assign({},e),r=a(t);!(n=r()).done;){var i=n.value;i in o&&delete o[i]}return o}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(u||(u={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(l||(l={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(s||(s={}));var f=0;function v(){return++f}var m,b,h,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 h.Next;if(t&(m.Previous|m.Last))return h.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=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")}(),i=t&m.NoScroll?{preventScroll:!0}:{},u=0,l=n.length,s=void 0;do{var c;if(u>=l||u+l<=0)return b.Error;var d=a+u;if(t&m.WrapAround)d=(d+l)%l;else{if(d<0)return b.Underflow;if(d>=l)return b.Overflow}null==(c=s=n[d])||c.focus(i),u+=r}while(s!==document.activeElement);return s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),b.Success}function x(e,n,o){try{window.addEventListener(e,n,o)}catch(e){}t.onUnmounted((function(){return window.removeEventListener(e,n,o)}))}function E(e,t){for(var n,o=a(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),i=t.ref(null);function u(){if(n.value&&1===e.value.size){var t=o.value.initialFocus,u=document.activeElement;if(t){if(t===u)return}else if(E(e.value,u))return;if(r.value=u,t)w(t);else{for(var l,s=!1,c=a(e.value);!(l=c()).done;)if(O(l.value,m.First)===b.Success){s=!0;break}s||console.warn("There are no focusable elements inside the <FocusTrap />")}i.value=document.activeElement}}function l(){w(r.value),r.value=null,i.value=null}t.watchEffect(u),t.onUpdated((function(){n.value?u():l()})),t.onUnmounted(l),x("keydown",(function(t){if(n.value&&t.key===s.Tab&&document.activeElement&&1===e.value.size){t.preventDefault();for(var o,r=a(e.value);!(o=r()).done;)if(O(o.value,(t.shiftKey?m.Previous:m.Next)|m.WrapAround)===b.Success){i.value=document.activeElement;break}}})),x("focus",(function(t){if(n.value&&1===e.value.size){var o=i.value;if(o){var r=t.target;r&&r instanceof HTMLElement?E(e.value,r)?(i.value=r,w(r)):(t.preventDefault(),t.stopPropagation(),w(o)):w(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"}(m||(m={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(b||(b={})),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"}(y||(y={}));var P=new Set,T=new Map;function k(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function D(e){var t=T.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var I,R=Symbol("StackContext");function L(){return t.inject(R,(function(){}))}function A(e){var n=L();t.provide(R,(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];null==e||e.apply(void 0,o),n.apply(void 0,o)}))}!function(e){e[e.AddElement=0]="AddElement",e[e.RemoveElement=1]="RemoveElement"}(I||(I={}));var F=Symbol("ForcePortalRootContext"),j=t.defineComponent({name:"ForcePortalRoot",props:{as:{type:[Object,String],default:"template"},force:{type:Boolean,default:!1}},setup:function(e,n){var r=n.slots,a=n.attrs;return t.provide(F,e.force),function(){return c({props:o(e,["force"]),slot:{},slots:r,attrs:a,name:"ForcePortalRoot"})}}}),$=t.defineComponent({name:"Portal",props:{as:{type:[Object,String],default:"div"}},setup:function(e,o){var r=o.slots,a=o.attrs,i=t.inject(F,!1),u=t.inject(B,null),l=t.ref(!0===i||null===u?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)}():u.resolveTarget());t.watchEffect((function(){i||null!==u&&(l.value=u.resolveTarget())}));var s=t.ref(null);return function(e){var n=L();t.watchEffect((function(t){var o=null==e?void 0:e.value;o&&(n(I.AddElement,o),t((function(){return n(I.RemoveElement,o)})))}))}(s),t.onUnmounted((function(){var e,t=document.getElementById("headlessui-portal-root");t&&l.value===t&&l.value.children.length<=0&&(null==(e=l.value.parentElement)||e.removeChild(l.value))})),A(),function(){return null===l.value?null:t.h(t.Teleport,{to:l.value},c({props:n({},e,{ref:s}),slot:{},attrs:a,slots:r,name:"Portal"}))}}}),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,a=n.slots,i=t.reactive({resolveTarget:function(){return e.target}});return t.provide(B,i),function(){return c({props:o(e,["target"]),slot:{},attrs:r,slots:a,name:"PortalGroup"})}}}),K=Symbol("DescriptionContext");function U(e){var n=void 0===e?{}:e,o=n.slot,r=void 0===o?t.ref({}):o,a=n.name,i=void 0===a?"Description":a,u=n.props,l=void 0===u?{}:u,s=t.ref([]);return t.provide(K,{register:function(e){return s.value.push(e),function(){var t=s.value.indexOf(e);-1!==t&&s.value.splice(t,1)}},slot:r,name:i,props:l}),t.computed((function(){return s.value.length>0?s.value.join(" "):void 0}))}var N=t.defineComponent({name:"Description",props:{as:{type:[Object,String],default:"p"}},render:function(){var e=this.context,o=e.name,r=void 0===o?"Description":o,a=e.slot,i=void 0===a?t.ref({}):a,u=e.props,l=this.$props,s=n({},Object.entries(void 0===u?{}:u).reduce((function(e,n){var o;return Object.assign(e,((o={})[n[0]]=t.unref(n[1]),o))}),{}),{id:this.id});return c({props:n({},l,s),slot:i.value,attrs:this.$attrs,slots:this.$slots,name:r})},setup:function(){var e=function(){var e=t.inject(K,null);if(null===e)throw new Error("Missing parent");return e}(),n="headlessui-description-"+v();return t.onMounted((function(){return t.onUnmounted(e.register(n))})),{id:n,context:e}}});function V(e){var t;return null==e||null==e.value?null:null!=(t=e.value.$el)?t:e.value}var G,H,W=Symbol("Context");function z(){return t.inject(W,null)}function q(e){t.provide(W,e)}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(G||(G={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(H||(H={}));var _=Symbol("DialogContext");function Q(e){var n=t.inject(_,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Dialog /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Q),o}return n}var Y,J="DC8F892D-2EBD-447C-A4C8-A03058436FF4",X=t.defineComponent({name:"Dialog",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:[Boolean,String],default:J},initialFocus:{type:Object,default:null}},emits:{close:function(e){return!0}},render:function(){var e=this,r=n({},this.$attrs,{ref:"el",id:this.id,role:"dialog","aria-modal":this.dialogState===H.Open||void 0,"aria-labelledby":this.titleId,"aria-describedby":this.describedby,onClick:this.handleClick}),a=o(this.$props,["open","initialFocus"]),i={open:this.dialogState===H.Open};return t.h(j,{force:!0},(function(){return t.h($,(function(){return t.h(M,{target:e.dialogRef},(function(){return t.h(j,{force:!1},(function(){return c({props:n({},a,r),slot:i,attrs:e.$attrs,slots:e.$slots,visible:e.visible,features:u.RenderStrategy|u.Static,name:"Dialog"})}))}))}))}))},setup:function(e,n){var o=n.emit,r=t.ref(new Set),u=z(),l=t.computed((function(){var t;return e.open===J&&null!==u?i(u.value,((t={})[G.Open]=!0,t[G.Closed]=!1,t)):e.open}));if(e.open===J&&null===u)throw new Error("You forgot to provide an `open` prop to the `Dialog`.");if("boolean"!=typeof l.value)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+(l.value===J?void 0:e.open));var c=t.computed((function(){return e.open?H.Open:H.Closed})),d=t.computed((function(){return null!==u?u.value===G.Open:c.value===H.Open})),p=t.ref(null),f=t.ref(c.value===H.Open);t.onUpdated((function(){f.value=c.value===H.Open}));var m="headlessui-dialog-"+v(),b=t.computed((function(){return{initialFocus:e.initialFocus}}));C(r,f,b),function(e,n){void 0===n&&(n=t.ref(!0)),t.watchEffect((function(t){if(n.value&&e.value){var o=e.value;P.add(o);for(var r,i=a(T.keys());!(r=i()).done;){var u=r.value;u.contains(o)&&(D(u),T.delete(u))}document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=a(P);!(t=n()).done;)if(e.contains(t.value))return;1===P.size&&(T.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),k(e))}})),t((function(){if(P.delete(o),P.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!T.has(e)){for(var t,n=a(P);!(t=n()).done;)if(e.contains(t.value))return;T.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),k(e)}}));else for(var e,t=a(T.keys());!(e=t()).done;){var n=e.value;D(n),T.delete(n)}}))}}))}(p,f),A((function(e,t){var n;return i(e,((n={})[I.AddElement]=function(){r.value.add(t)},n[I.RemoveElement]=function(){r.value.delete(t)},n))}));var h=U({name:"DialogDescription",slot:t.computed((function(){return{open:l.value}}))}),y=t.ref(null),g={titleId:y,dialogState:c,setTitleId:function(e){y.value!==e&&(y.value=e)},close:function(){o("close",!1)}};return t.provide(_,g),x("mousedown",(function(e){var n=e.target;c.value===H.Open&&1===r.value.size&&(E(r.value,n)||(g.close(),t.nextTick((function(){return null==n?void 0:n.focus()}))))})),x("keydown",(function(e){e.key===s.Escape&&c.value===H.Open&&(r.value.size>1||(e.preventDefault(),e.stopPropagation(),g.close()))})),t.watchEffect((function(e){if(c.value===H.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(c.value===H.Open){var t=V(p);if(t){var n=new IntersectionObserver((function(e){for(var t,n=a(e);!(t=n()).done;){var o=t.value;0===o.boundingClientRect.x&&0===o.boundingClientRect.y&&0===o.boundingClientRect.width&&0===o.boundingClientRect.height&&g.close()}}));n.observe(t),e((function(){return n.disconnect()}))}}})),{id:m,el:p,dialogRef:p,containers:r,dialogState:c,titleId:y,describedby:h,visible:d,open:l,handleClick:function(e){e.stopPropagation()}}}}),Z=t.defineComponent({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"}},render:function(){var e=Q("DialogOverlay");return c({props:n({},this.$props,{ref:"el",id:this.id,"aria-hidden":!0,onClick:this.handleClick}),slot:{open:e.dialogState.value===H.Open},attrs:this.$attrs,slots:this.$slots,name:"DialogOverlay"})},setup:function(){var e=Q("DialogOverlay");return{id:"headlessui-dialog-overlay-"+v(),handleClick:function(t){t.preventDefault(),t.stopPropagation(),e.close()}}}}),ee=t.defineComponent({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"}},render:function(){var e=Q("DialogTitle");return c({props:n({},this.$props,{id:this.id}),slot:{open:e.dialogState.value===H.Open},attrs:this.$attrs,slots:this.$slots,name:"DialogTitle"})},setup:function(){var e=Q("DialogTitle"),n="headlessui-dialog-title-"+v();return t.onMounted((function(){e.setTitleId(n),t.onUnmounted((function(){return e.setTitleId(null)}))})),{id:n}}}),te=N;function ne(e,t){if(e)return e;var n=null!=t?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function oe(e,n){var o=t.ref(ne(e.value.type,e.value.as));return t.onMounted((function(){o.value=ne(e.value.type,e.value.as)})),t.watchEffect((function(){var e;o.value||V(n)&&V(n)instanceof HTMLButtonElement&&!(null==(e=V(n))?void 0:e.hasAttribute("type"))&&(o.value="button")})),o}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Y||(Y={}));var re=Symbol("DisclosureContext");function ae(e){var n=t.inject(re,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Disclosure /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,ae),o}return n}var ie,ue,le=Symbol("DisclosurePanelContext"),se=t.defineComponent({name:"Disclosure",props:{as:{type:[Object,String],default:"template"},defaultOpen:{type:[Boolean],default:!1}},setup:function(e,n){var r=n.slots,a=n.attrs,u="headlessui-disclosure-button-"+v(),l="headlessui-disclosure-panel-"+v(),s=t.ref(e.defaultOpen?Y.Open:Y.Closed),d=t.ref(null),p=t.ref(null),f={buttonId:u,panelId:l,disclosureState:s,panel:d,button:p,toggleDisclosure:function(){var e;s.value=i(s.value,((e={})[Y.Open]=Y.Closed,e[Y.Closed]=Y.Open,e))},closeDisclosure:function(){s.value!==Y.Closed&&(s.value=Y.Closed)},close:function(e){f.closeDisclosure();var t=e?e instanceof HTMLElement?e:e.value instanceof HTMLElement?V(e):V(f.button):V(f.button);null==t||t.focus()}};return t.provide(re,f),q(t.computed((function(){var e;return i(s.value,((e={})[Y.Open]=G.Open,e[Y.Closed]=G.Closed,e))}))),function(){return c({props:o(e,["defaultOpen"]),slot:{open:s.value===Y.Open,close:f.close},slots:r,attrs:a,name:"Disclosure"})}}}),ce=t.defineComponent({name:"DisclosureButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=ae("DisclosureButton"),t={open:e.disclosureState.value===Y.Open},o=this.isWithinPanel?{ref:"el",type:this.type,onClick:this.handleClick,onKeydown:this.handleKeyDown}:{id:this.id,ref:"el",type:this.type,"aria-expanded":this.$props.disabled?void 0:e.disclosureState.value===Y.Open,"aria-controls":V(e.panel)?e.panelId:void 0,disabled:!!this.$props.disabled||void 0,onClick:this.handleClick,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp};return c({props:n({},this.$props,o),slot:t,attrs:this.$attrs,slots:this.$slots,name:"DisclosureButton"})},setup:function(e,n){var o=n.attrs,r=ae("DisclosureButton"),a=t.inject(le,null),i=null!==a&&a===r.panelId,u=t.ref(null);return i||t.watchEffect((function(){r.button.value=u.value})),{isWithinPanel:i,id:r.buttonId,el:u,type:oe(t.computed((function(){return{as:e.as,type:o.type}})),u),handleClick:function(){var t;e.disabled||(i?(r.toggleDisclosure(),null==(t=V(r.button))||t.focus()):r.toggleDisclosure())},handleKeyDown:function(t){var n;if(!e.disabled)if(i)switch(t.key){case s.Space:case s.Enter:t.preventDefault(),t.stopPropagation(),r.toggleDisclosure(),null==(n=V(r.button))||n.focus()}else switch(t.key){case s.Space:case s.Enter:t.preventDefault(),t.stopPropagation(),r.toggleDisclosure()}},handleKeyUp:function(e){switch(e.key){case s.Space:e.preventDefault()}}}}}),de=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=ae("DisclosurePanel"),t={open:e.disclosureState.value===Y.Open,close:e.close};return c({props:n({},this.$props,{id:this.id,ref:"el"}),slot:t,attrs:this.$attrs,slots:this.$slots,features:u.RenderStrategy|u.Static,visible:this.visible,name:"DisclosurePanel"})},setup:function(){var e=ae("DisclosurePanel");t.provide(le,e.panelId);var n=z(),o=t.computed((function(){return null!==n?n.value===G.Open:e.disclosureState.value===Y.Open}));return{id:e.panelId,el:e.panel,visible:o}}}),pe=t.defineComponent({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null}},render:function(){return c({props:n({},o(this.$props,["initialFocus"]),{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"FocusTrap"})},setup:function(e){var n=t.ref(new Set),o=t.ref(null),r=t.ref(!0),a=t.computed((function(){return{initialFocus:e.initialFocus}}));return t.onMounted((function(){o.value&&(n.value.add(o.value),C(n,r,a))})),t.onUnmounted((function(){r.value=!1})),{el:o}}});function fe(e,t){var n=t.resolveItems();if(n.length<=0)return null;var o=t.resolveActiveIndex(),r=null!=o?o:-1,a=function(){switch(e.focus){case ie.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case ie.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 ie.Next:return n.findIndex((function(e,n){return!(n<=r||t.resolveDisabled(e))}));case ie.Last:var a=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===a?a:n.length-1-a;case ie.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case ie.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===a?o:a}!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"}(ie||(ie={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ue||(ue={}));var ve=Symbol("ListboxContext");function me(e){var n=t.inject(ve,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Listbox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,me),o}return n}var be,he=t.defineComponent({name:"Listbox",emits:{"update:modelValue":function(e){return!0}},props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},horizontal:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean]}},setup:function(e,n){var o=n.slots,r=n.attrs,a=n.emit,u=t.ref(ue.Closed),l=t.ref(null),s=t.ref(null),d=t.ref(null),f=t.ref([]),v=t.ref(""),m=t.ref(null),b=t.computed((function(){return e.modelValue})),h={listboxState:u,value:b,orientation:t.computed((function(){return e.horizontal?"horizontal":"vertical"})),labelRef:l,buttonRef:s,optionsRef:d,disabled:t.computed((function(){return e.disabled})),options:f,searchQuery:v,activeOptionIndex:m,closeListbox:function(){e.disabled||u.value!==ue.Closed&&(u.value=ue.Closed,m.value=null)},openListbox:function(){e.disabled||u.value!==ue.Open&&(u.value=ue.Open)},goToOption:function(t,n){if(!e.disabled&&u.value!==ue.Closed){var o=fe(t===ie.Specific?{focus:ie.Specific,id:n}:{focus:t},{resolveItems:function(){return f.value},resolveActiveIndex:function(){return m.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===v.value&&m.value===o||(v.value="",m.value=o)}},search:function(t){if(!e.disabled&&u.value!==ue.Closed){v.value+=t.toLowerCase();var n=f.value.findIndex((function(e){return!e.dataRef.disabled&&e.dataRef.textValue.startsWith(v.value)}));-1!==n&&n!==m.value&&(m.value=n)}},clearSearch:function(){e.disabled||u.value!==ue.Closed&&""!==v.value&&(v.value="")},registerOption:function(e,t){f.value.push({id:e,dataRef:t})},unregisterOption:function(e){var t=f.value.slice(),n=null!==m.value?t[m.value]:null,o=t.findIndex((function(t){return t.id===e}));-1!==o&&t.splice(o,1),f.value=t,m.value=o===m.value||null===n?null:t.indexOf(n)},select:function(t){e.disabled||a("update:modelValue",t)}};return x("mousedown",(function(e){var t,n,o,r=e.target,a=document.activeElement;u.value===ue.Open&&((null==(t=V(s))?void 0:t.contains(r))||((null==(n=V(d))?void 0:n.contains(r))||h.closeListbox(),a!==document.body&&(null==a?void 0:a.contains(r))||e.defaultPrevented||null==(o=V(s))||o.focus({preventScroll:!0})))})),t.provide(ve,h),q(t.computed((function(){var e;return i(u.value,((e={})[ue.Open]=G.Open,e[ue.Closed]=G.Closed,e))}))),function(){var t={open:u.value===ue.Open,disabled:e.disabled,openListbox:h.openListbox,closeListbox:h.closeListbox};return c({props:p(e,["modelValue","onUpdate:modelValue","disabled","horizontal"]),slot:t,slots:o,attrs:r,name:"Listbox"})}}}),ye=t.defineComponent({name:"ListboxLabel",props:{as:{type:[Object,String],default:"label"}},render:function(){var e=me("ListboxLabel"),t={open:e.listboxState.value===ue.Open,disabled:e.disabled.value};return c({props:n({},this.$props,{id:this.id,ref:"el",onClick:this.handleClick}),slot:t,attrs:this.$attrs,slots:this.$slots,name:"ListboxLabel"})},setup:function(){var e=me("ListboxLabel");return{id:"headlessui-listbox-label-"+v(),el:e.labelRef,handleClick:function(){var t;null==(t=V(e.buttonRef))||t.focus({preventScroll:!0})}}}}),ge=t.defineComponent({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"}},render:function(){var e,t,o=me("ListboxButton"),r={open:o.listboxState.value===ue.Open,disabled:o.disabled.value},a={ref:"el",id:this.id,type:this.type,"aria-haspopup":!0,"aria-controls":null==(e=V(o.optionsRef))?void 0:e.id,"aria-expanded":o.disabled.value?void 0:o.listboxState.value===ue.Open,"aria-labelledby":o.labelRef.value?[null==(t=V(o.labelRef))?void 0:t.id,this.id].join(" "):void 0,disabled:!0===o.disabled.value||void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return c({props:n({},this.$props,a),slot:r,attrs:this.$attrs,slots:this.$slots,name:"ListboxButton"})},setup:function(e,n){var o=n.attrs,r=me("ListboxButton");return{id:"headlessui-listbox-button-"+v(),el:r.buttonRef,type:oe(t.computed((function(){return{as:e.as,type:o.type}})),r.buttonRef),handleKeyDown:function(e){switch(e.key){case s.Space:case s.Enter:case s.ArrowDown:e.preventDefault(),r.openListbox(),t.nextTick((function(){var e;null==(e=V(r.optionsRef))||e.focus({preventScroll:!0}),r.value.value||r.goToOption(ie.First)}));break;case s.ArrowUp:e.preventDefault(),r.openListbox(),t.nextTick((function(){var e;null==(e=V(r.optionsRef))||e.focus({preventScroll:!0}),r.value.value||r.goToOption(ie.Last)}))}},handleKeyUp:function(e){switch(e.key){case s.Space:e.preventDefault()}},handleClick:function(e){var n;r.disabled.value||(r.listboxState.value===ue.Open?(r.closeListbox(),t.nextTick((function(){var e;return null==(e=V(r.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),r.openListbox(),n=function(){var e;return null==(e=V(r.optionsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(n)}))))}}}}),Se=t.defineComponent({name:"ListboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,o,r,a=me("ListboxOptions"),i={open:a.listboxState.value===ue.Open},l={"aria-activedescendant":null===a.activeOptionIndex.value||null==(e=a.options.value[a.activeOptionIndex.value])?void 0:e.id,"aria-labelledby":null!=(t=null==(o=V(a.labelRef))?void 0:o.id)?t:null==(r=V(a.buttonRef))?void 0:r.id,"aria-orientation":a.orientation.value,id:this.id,onKeydown:this.handleKeyDown,role:"listbox",tabIndex:0,ref:"el"};return c({props:n({},this.$props,l),slot:i,attrs:this.$attrs,slots:this.$slots,features:u.RenderStrategy|u.Static,visible:this.visible,name:"ListboxOptions"})},setup:function(){var e=me("ListboxOptions"),n="headlessui-listbox-options-"+v(),o=t.ref(null),r=z(),a=t.computed((function(){return null!==r?r.value===G.Open:e.listboxState.value===ue.Open}));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=V(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case i(e.orientation.value,{vertical:s.ArrowDown,horizontal:s.ArrowRight}):return n.preventDefault(),n.stopPropagation(),e.goToOption(ie.Next);case i(e.orientation.value,{vertical:s.ArrowUp,horizontal:s.ArrowLeft}):return n.preventDefault(),n.stopPropagation(),e.goToOption(ie.Previous);case s.Home:case s.PageUp:return n.preventDefault(),n.stopPropagation(),e.goToOption(ie.First);case s.End:case s.PageDown:return n.preventDefault(),n.stopPropagation(),e.goToOption(ie.Last);case s.Escape:n.preventDefault(),n.stopPropagation(),e.closeListbox(),t.nextTick((function(){var t;return null==(t=V(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))}},visible:a}}}),we=t.defineComponent({name:"ListboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String,Number,Boolean]},disabled:{type:Boolean,default:!1}},setup:function(e,o){var r=o.slots,a=o.attrs,i=me("ListboxOption"),u="headlessui-listbox-option-"+v(),l=t.computed((function(){return null!==i.activeOptionIndex.value&&i.options.value[i.activeOptionIndex.value].id===u})),s=t.computed((function(){return t.toRaw(i.value.value)===t.toRaw(e.value)})),d=t.ref({disabled:e.disabled,value:e.value,textValue:""});function p(n){if(e.disabled)return n.preventDefault();i.select(e.value),i.closeListbox(),t.nextTick((function(){var e;return null==(e=V(i.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function f(){if(e.disabled)return i.goToOption(ie.Nothing);i.goToOption(ie.Specific,u)}function m(){e.disabled||l.value||i.goToOption(ie.Specific,u)}function b(){e.disabled||l.value&&i.goToOption(ie.Nothing)}return t.onMounted((function(){var e,t,n=null==(e=document.getElementById(u))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(d.value.textValue=n)})),t.onMounted((function(){return i.registerOption(u,d)})),t.onUnmounted((function(){return i.unregisterOption(u)})),t.onMounted((function(){t.watch([i.listboxState,s],(function(){var e;i.listboxState.value===ue.Open&&s.value&&(i.goToOption(ie.Specific,u),null==(e=document.getElementById(u))||null==e.focus||e.focus())}),{immediate:!0})})),t.watchEffect((function(){i.listboxState.value===ue.Open&&l.value&&t.nextTick((function(){var e;return null==(e=document.getElementById(u))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t=e.disabled,o={active:l.value,selected:s.value,disabled:t};return c({props:n({},e,{id:u,role:"option",tabIndex:!0===t?void 0:-1,"aria-disabled":!0===t||void 0,"aria-selected":!0===s.value?s.value:void 0,disabled:void 0,onClick:p,onFocus:f,onPointermove:m,onMousemove:m,onPointerleave:b,onMouseleave:b}),slot:o,attrs:a,slots:r,name:"ListboxOption"})}}});function Oe(e){var n=e.container,o=e.accept,r=e.walk,a=e.enabled;t.watchEffect((function(){var e=n.value;if(e&&(void 0===a||a.value))for(var t=Object.assign((function(e){return o(e)}),{acceptNode:o}),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,t,!1);i.nextNode();)r(i.currentNode)}))}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(be||(be={}));var xe=Symbol("MenuContext");function Ee(e){var n=t.inject(xe,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <Menu /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Ee),o}return n}var Ce,Pe=t.defineComponent({name:"Menu",props:{as:{type:[Object,String],default:"template"}},setup:function(e,n){var o=n.slots,r=n.attrs,a=t.ref(be.Closed),u=t.ref(null),l=t.ref(null),s=t.ref([]),d=t.ref(""),p=t.ref(null),f={menuState:a,buttonRef:u,itemsRef:l,items:s,searchQuery:d,activeItemIndex:p,closeMenu:function(){a.value=be.Closed,p.value=null},openMenu:function(){return a.value=be.Open},goToItem:function(e,t){var n=fe(e===ie.Specific?{focus:ie.Specific,id:t}:{focus:e},{resolveItems:function(){return s.value},resolveActiveIndex:function(){return p.value},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.disabled}});""===d.value&&p.value===n||(d.value="",p.value=n)},search:function(e){d.value+=e.toLowerCase();var t=s.value.findIndex((function(e){return e.dataRef.textValue.startsWith(d.value)&&!e.dataRef.disabled}));-1!==t&&t!==p.value&&(p.value=t)},clearSearch:function(){d.value=""},registerItem:function(e,t){s.value.push({id:e,dataRef:t})},unregisterItem:function(e){var t=s.value.slice(),n=null!==p.value?t[p.value]:null,o=t.findIndex((function(t){return t.id===e}));-1!==o&&t.splice(o,1),s.value=t,p.value=o===p.value||null===n?null:t.indexOf(n)}};return x("mousedown",(function(e){var t,n,o,r=e.target,i=document.activeElement;a.value===be.Open&&((null==(t=V(u))?void 0:t.contains(r))||((null==(n=V(l))?void 0:n.contains(r))||f.closeMenu(),i!==document.body&&(null==i?void 0:i.contains(r))||e.defaultPrevented||null==(o=V(u))||o.focus({preventScroll:!0})))})),t.provide(xe,f),q(t.computed((function(){var e;return i(a.value,((e={})[be.Open]=G.Open,e[be.Closed]=G.Closed,e))}))),function(){return c({props:e,slot:{open:a.value===be.Open},slots:o,attrs:r,name:"Menu"})}}}),Te=t.defineComponent({name:"MenuButton",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"}},render:function(){var e,t=Ee("MenuButton"),o={open:t.menuState.value===be.Open},r={ref:"el",id:this.id,type:this.type,"aria-haspopup":!0,"aria-controls":null==(e=V(t.itemsRef))?void 0:e.id,"aria-expanded":this.$props.disabled?void 0:t.menuState.value===be.Open,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return c({props:n({},this.$props,r),slot:o,attrs:this.$attrs,slots:this.$slots,name:"MenuButton"})},setup:function(e,n){var o=n.attrs,r=Ee("MenuButton");return{id:"headlessui-menu-button-"+v(),el:r.buttonRef,type:oe(t.computed((function(){return{as:e.as,type:o.type}})),r.buttonRef),handleKeyDown:function(e){switch(e.key){case s.Space:case s.Enter:case s.ArrowDown:e.preventDefault(),e.stopPropagation(),r.openMenu(),t.nextTick((function(){var e;null==(e=V(r.itemsRef))||e.focus({preventScroll:!0}),r.goToItem(ie.First)}));break;case s.ArrowUp:e.preventDefault(),e.stopPropagation(),r.openMenu(),t.nextTick((function(){var e;null==(e=V(r.itemsRef))||e.focus({preventScroll:!0}),r.goToItem(ie.Last)}))}},handleKeyUp:function(e){switch(e.key){case s.Space:e.preventDefault()}},handleClick:function(n){var o;e.disabled||(r.menuState.value===be.Open?(r.closeMenu(),t.nextTick((function(){var e;return null==(e=V(r.buttonRef))?void 0:e.focus({preventScroll:!0})}))):(n.preventDefault(),n.stopPropagation(),r.openMenu(),o=function(){var e;return null==(e=V(r.itemsRef))?void 0:e.focus({preventScroll:!0})},requestAnimationFrame((function(){return requestAnimationFrame(o)}))))}}}}),ke=t.defineComponent({name:"MenuItems",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,o=Ee("MenuItems"),r={open:o.menuState.value===be.Open},a={"aria-activedescendant":null===o.activeItemIndex.value||null==(e=o.items.value[o.activeItemIndex.value])?void 0:e.id,"aria-labelledby":null==(t=V(o.buttonRef))?void 0:t.id,id:this.id,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,role:"menu",tabIndex:0,ref:"el"};return c({props:n({},this.$props,a),slot:r,attrs:this.$attrs,slots:this.$slots,features:u.RenderStrategy|u.Static,visible:this.visible,name:"MenuItems"})},setup:function(){var e=Ee("MenuItems"),n="headlessui-menu-items-"+v(),o=t.ref(null);Oe({container:t.computed((function(){return V(e.itemsRef)})),enabled:t.computed((function(){return e.menuState.value===be.Open})),accept:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}});var r=z(),a=t.computed((function(){return null!==r?r.value===G.Open:e.menuState.value===be.Open}));return{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=V(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.ArrowDown:return n.preventDefault(),n.stopPropagation(),e.goToItem(ie.Next);case s.ArrowUp:return n.preventDefault(),n.stopPropagation(),e.goToItem(ie.Previous);case s.Home:case s.PageUp:return n.preventDefault(),n.stopPropagation(),e.goToItem(ie.First);case s.End:case s.PageDown:return n.preventDefault(),n.stopPropagation(),e.goToItem(ie.Last);case s.Escape:n.preventDefault(),n.stopPropagation(),e.closeMenu(),t.nextTick((function(){var t;return null==(t=V(e.buttonRef))?void 0:t.focus({preventScroll:!0})}));break;case s.Tab:n.preventDefault(),n.stopPropagation();break;default:1===n.key.length&&(e.search(n.key),o.value=setTimeout((function(){return e.clearSearch()}),350))}},handleKeyUp:function(e){switch(e.key){case s.Space:e.preventDefault()}},visible:a}}}),De=t.defineComponent({name:"MenuItem",props:{as:{type:[Object,String],default:"template"},disabled:{type:Boolean,default:!1}},setup:function(e,o){var r=o.slots,a=o.attrs,i=Ee("MenuItem"),u="headlessui-menu-item-"+v(),l=t.computed((function(){return null!==i.activeItemIndex.value&&i.items.value[i.activeItemIndex.value].id===u})),s=t.ref({disabled:e.disabled,textValue:""});function d(n){if(e.disabled)return n.preventDefault();i.closeMenu(),t.nextTick((function(){var e;return null==(e=V(i.buttonRef))?void 0:e.focus({preventScroll:!0})}))}function p(){if(e.disabled)return i.goToItem(ie.Nothing);i.goToItem(ie.Specific,u)}function f(){e.disabled||l.value||i.goToItem(ie.Specific,u)}function m(){e.disabled||l.value&&i.goToItem(ie.Nothing)}return t.onMounted((function(){var e,t,n=null==(e=document.getElementById(u))||null==(t=e.textContent)?void 0:t.toLowerCase().trim();void 0!==n&&(s.value.textValue=n)})),t.onMounted((function(){return i.registerItem(u,s)})),t.onUnmounted((function(){return i.unregisterItem(u)})),t.watchEffect((function(){i.menuState.value===be.Open&&l.value&&t.nextTick((function(){var e;return null==(e=document.getElementById(u))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})}))})),function(){var t=e.disabled,o={active:l.value,disabled:t};return c({props:n({},e,{id:u,role:"menuitem",tabIndex:!0===t?void 0:-1,"aria-disabled":!0===t||void 0,onClick:d,onFocus:p,onPointermove:f,onMousemove:f,onPointerleave:m,onMouseleave:m}),slot:o,attrs:a,slots:r,name:"MenuItem"})}}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Ce||(Ce={}));var Ie=Symbol("PopoverContext");function Re(e){var n=t.inject(Ie,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <"+je.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Re),o}return n}var Le=Symbol("PopoverGroupContext");function Ae(){return t.inject(Le,null)}var Fe=Symbol("PopoverPanelContext"),je=t.defineComponent({name:"Popover",props:{as:{type:[Object,String],default:"div"}},setup:function(e,n){var o=n.slots,r=n.attrs,a="headlessui-popover-button-"+v(),u="headlessui-popover-panel-"+v(),l=t.ref(Ce.Closed),s=t.ref(null),d=t.ref(null),p={popoverState:l,buttonId:a,panelId:u,panel:d,button:s,togglePopover:function(){var e;l.value=i(l.value,((e={})[Ce.Open]=Ce.Closed,e[Ce.Closed]=Ce.Open,e))},closePopover:function(){l.value!==Ce.Closed&&(l.value=Ce.Closed)},close:function(e){p.closePopover();var t=e?e instanceof HTMLElement?e:e.value instanceof HTMLElement?V(e):V(p.button):V(p.button);null==t||t.focus()}};t.provide(Ie,p),q(t.computed((function(){var e;return i(l.value,((e={})[Ce.Open]=G.Open,e[Ce.Closed]=G.Closed,e))})));var f={buttonId:a,panelId:u,close:function(){p.closePopover()}},m=Ae(),b=null==m?void 0:m.registerPopover;return t.watchEffect((function(){return null==b?void 0:b(f)})),x("focus",(function(){var e,t,n;l.value===Ce.Open&&((null!=(e=null==m?void 0:m.isFocusWithinPopoverGroup())?e:(null==(t=V(s))?void 0:t.contains(document.activeElement))||(null==(n=V(d))?void 0:n.contains(document.activeElement)))||s&&d&&p.closePopover())}),!0),x("mousedown",(function(e){var t,n,o,r,a,u,c=e.target;l.value===Ce.Open&&((null==(t=V(s))?void 0:t.contains(c))||(null==(n=V(d))?void 0:n.contains(c))||(p.closePopover(),void 0===(a=y.Loose)&&(a=y.Strict),(r=c)!==document.body&&i(a,((u={})[y.Strict]=function(){return r.matches(g)},u[y.Loose]=function(){for(var e=r;null!==e;){if(e.matches(g))return!0;e=e.parentElement}return!1},u))||(e.preventDefault(),null==(o=V(s))||o.focus())))})),function(){return c({props:e,slot:{open:l.value===Ce.Open,close:p.close},slots:o,attrs:r,name:"Popover"})}}}),$e=t.defineComponent({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e=Re("PopoverButton"),t={open:e.popoverState.value===Ce.Open},o=this.isWithinPanel?{ref:"el",type:this.type,onKeydown:this.handleKeyDown,onClick:this.handleClick}:{ref:"el",id:e.buttonId,type:this.type,"aria-expanded":this.$props.disabled?void 0:e.popoverState.value===Ce.Open,"aria-controls":V(e.panel)?e.panelId:void 0,disabled:!!this.$props.disabled||void 0,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onClick:this.handleClick};return c({props:n({},this.$props,o),slot:t,attrs:this.$attrs,slots:this.$slots,name:"PopoverButton"})},setup:function(e,n){var o=n.attrs,r=Re("PopoverButton"),a=Ae(),i=null==a?void 0:a.closeOthers,u=t.inject(Fe,null),l=null!==u&&u===r.panelId,c=t.ref(null),d=t.ref("undefined"==typeof window?null:document.activeElement);x("focus",(function(){d.value=c.value,c.value=document.activeElement}),!0);var p=t.ref(null);return l||t.watchEffect((function(){r.button.value=p.value})),{isWithinPanel:l,el:p,type:oe(t.computed((function(){return{as:e.as,type:o.type}})),p),handleKeyDown:function(e){var t,n;if(l){if(r.popoverState.value===Ce.Closed)return;switch(e.key){case s.Space:case s.Enter:e.preventDefault(),e.stopPropagation(),r.closePopover(),null==(t=V(r.button))||t.focus()}}else switch(e.key){case s.Space:case s.Enter:e.preventDefault(),e.stopPropagation(),r.popoverState.value===Ce.Closed&&(null==i||i(r.buttonId)),r.togglePopover();break;case s.Escape:if(r.popoverState.value!==Ce.Open)return null==i?void 0:i(r.buttonId);if(!V(r.button))return;if(!(null==(n=V(r.button))?void 0:n.contains(document.activeElement)))return;r.closePopover();break;case s.Tab:if(r.popoverState.value!==Ce.Open)return;if(!r.panel)return;if(!r.button)return;if(e.shiftKey){var o,a;if(!d.value)return;if(null==(o=V(r.button))?void 0:o.contains(d.value))return;if(null==(a=V(r.panel))?void 0:a.contains(d.value))return;var u=S(),c=u.indexOf(d.value);if(u.indexOf(V(r.button))>c)return;e.preventDefault(),e.stopPropagation(),O(V(r.panel),m.Last)}else e.preventDefault(),e.stopPropagation(),O(V(r.panel),m.First)}},handleKeyUp:function(e){var t,n;if(!l&&(e.key===s.Space&&e.preventDefault(),r.popoverState.value===Ce.Open&&r.panel&&r.button))switch(e.key){case s.Tab:if(!d.value)return;if(null==(t=V(r.button))?void 0:t.contains(d.value))return;if(null==(n=V(r.panel))?void 0:n.contains(d.value))return;var o=S(),a=o.indexOf(d.value);if(o.indexOf(V(r.button))>a)return;e.preventDefault(),e.stopPropagation(),O(V(r.panel),m.Last)}},handleClick:function(){var t,n;e.disabled||(l?(r.closePopover(),null==(t=V(r.button))||t.focus()):(r.popoverState.value===Ce.Closed&&(null==i||i(r.buttonId)),null==(n=V(r.button))||n.focus(),r.togglePopover()))}}}}),Be=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:Re("PopoverOverlay").popoverState.value===Ce.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:u.RenderStrategy|u.Static,visible:this.visible,name:"PopoverOverlay"})},setup:function(){var e=Re("PopoverOverlay"),n=z(),o=t.computed((function(){return null!==n?n.value===G.Open:e.popoverState.value===Ce.Open}));return{id:"headlessui-popover-overlay-"+v(),handleClick:function(){e.closePopover()},visible:o}}}),Me=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=Re("PopoverPanel"),t={open:e.popoverState.value===Ce.Open,close:e.close};return c({props:n({},this.$props,{ref:"el",id:this.id,onKeydown:this.handleKeyDown}),slot:t,attrs:this.$attrs,slots:this.$slots,features:u.RenderStrategy|u.Static,visible:this.visible,name:"PopoverPanel"})},setup:function(e){var n=e.focus,o=Re("PopoverPanel");t.provide(Fe,o.panelId),t.onUnmounted((function(){o.panel.value=null})),t.watchEffect((function(){var e;if(n&&o.popoverState.value===Ce.Open&&o.panel){var t=document.activeElement;(null==(e=V(o.panel))?void 0:e.contains(t))||O(V(o.panel),m.First)}})),x("keydown",(function(e){var t;if(o.popoverState.value===Ce.Open&&V(o.panel)&&e.key===s.Tab&&document.activeElement&&(null==(t=V(o.panel))?void 0:t.contains(document.activeElement))){e.preventDefault();var n,r=O(V(o.panel),e.shiftKey?m.Previous:m.Next);if(r===b.Underflow)return null==(n=V(o.button))?void 0:n.focus();if(r===b.Overflow){if(!V(o.button))return;var a=S(),i=a.indexOf(V(o.button));O(a.splice(i+1).filter((function(e){var t;return!(null==(t=V(o.panel))?void 0:t.contains(e))})),m.First)===b.Error&&O(document.body,m.First)}}})),x("focus",(function(){var e;n&&o.popoverState.value===Ce.Open&&V(o.panel)&&((null==(e=V(o.panel))?void 0:e.contains(document.activeElement))||o.closePopover())}),!0);var r=z(),a=t.computed((function(){return null!==r?r.value===G.Open:o.popoverState.value===Ce.Open}));return{id:o.panelId,el:o.panel,handleKeyDown:function(e){var t,n;switch(e.key){case s.Escape:if(o.popoverState.value!==Ce.Open)return;if(!V(o.panel))return;if(!(null==(t=V(o.panel))?void 0:t.contains(document.activeElement)))return;e.preventDefault(),o.closePopover(),null==(n=V(o.button))||n.focus()}},visible:a}}}),Ke=t.defineComponent({name:"PopoverGroup",props:{as:{type:[Object,String],default:"div"}},render:function(){return c({props:n({},this.$props,{ref:"el"}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"PopoverGroup"})},setup:function(){var e=t.ref(null),n=t.ref([]);function o(e){var t=n.value.indexOf(e);-1!==t&&n.value.splice(t,1)}return t.provide(Le,{registerPopover:function(e){return n.value.push(e),function(){o(e)}},unregisterPopover:o,isFocusWithinPopoverGroup:function(){var t,o=document.activeElement;return!!(null==(t=V(e))?void 0:t.contains(o))||n.value.some((function(e){var t,n;return(null==(t=document.getElementById(e.buttonId))?void 0:t.contains(o))||(null==(n=document.getElementById(e.panelId))?void 0:n.contains(o))}))},closeOthers:function(e){for(var t,o=a(n.value);!(t=o()).done;){var r=t.value;r.buttonId!==e&&r.close()}}}),{el:e}}}),Ue=Symbol("LabelContext");function Ne(){var e=t.inject(Ue,null);if(null===e){var n=new Error("You used a <Label /> component, but it is not inside a parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ne),n}return e}function Ve(e){var n=void 0===e?{}:e,o=n.slot,r=void 0===o?{}:o,a=n.name,i=void 0===a?"Label":a,u=n.props,l=void 0===u?{}:u,s=t.ref([]);return t.provide(Ue,{register:function(e){return s.value.push(e),function(){var t=s.value.indexOf(e);-1!==t&&s.value.splice(t,1)}},slot:r,name:i,props:l}),t.computed((function(){return s.value.length>0?s.value.join(" "):void 0}))}var Ge=t.defineComponent({name:"Label",props:{as:{type:[Object,String],default:"label"},passive:{type:[Boolean],default:!1}},render:function(){var e=this.context,r=e.name,a=void 0===r?"Label":r,i=e.slot,u=void 0===i?{}:i,l=e.props,s=void 0===l?{}:l,d=this.$props,p=d.passive,f=o(d,["passive"]),v=n({},Object.entries(s).reduce((function(e,n){var o;return Object.assign(e,((o={})[n[0]]=t.unref(n[1]),o))}),{}),{id:this.id}),m=n({},f,v);return p&&delete m.onClick,c({props:m,slot:u,attrs:this.$attrs,slots:this.$slots,name:a})},setup:function(){var e=Ne(),n="headlessui-label-"+v();return t.onMounted((function(){return t.onUnmounted(e.register(n))})),{id:n,context:e}}}),He=Symbol("RadioGroupContext");function We(e){var n=t.inject(He,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <RadioGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,We),o}return n}var ze,qe=t.defineComponent({name:"RadioGroup",emits:{"update:modelValue":function(e){return!0}},props:{as:{type:[Object,String],default:"div"},disabled:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean]}},render:function(){return c({props:n({},o(this.$props,["modelValue","disabled"]),{ref:"el",id:this.id,role:"radiogroup","aria-labelledby":this.labelledby,"aria-describedby":this.describedby,onKeydown:this.handleKeyDown}),slot:{},attrs:this.$attrs,slots:this.$slots,name:"RadioGroup"})},setup:function(e,n){var o=n.emit,r=t.ref(null),a=t.ref([]),i=Ve({name:"RadioGroupLabel"}),u=U({name:"RadioGroupDescription"}),l=t.computed((function(){return e.modelValue})),c={options:a,value:l,disabled:t.computed((function(){return e.disabled})),firstOption:t.computed((function(){return a.value.find((function(e){return!e.propsRef.disabled}))})),containsCheckedOption:t.computed((function(){return a.value.some((function(n){return t.toRaw(n.propsRef.value)===t.toRaw(e.modelValue)}))})),change:function(n){var r;if(e.disabled)return!1;if(l.value===n)return!1;var i=null==(r=a.value.find((function(e){return t.toRaw(e.propsRef.value)===t.toRaw(n)})))?void 0:r.propsRef;return!(null==i?void 0:i.disabled)&&(o("update:modelValue",n),!0)},registerOption:function(e){var t,n=Array.from(null==(t=r.value)?void 0:t.querySelectorAll('[id^="headlessui-radiogroup-option-"]')).reduce((function(e,t,n){var o;return Object.assign(e,((o={})[t.id]=n,o))}),{});a.value.push(e),a.value.sort((function(e,t){return n[e.id]-n[t.id]}))},unregisterOption:function(e){var t=a.value.findIndex((function(t){return t.id===e}));-1!==t&&a.value.splice(t,1)}};return t.provide(He,c),Oe({container:t.computed((function(){return V(r)})),accept:function(e){return"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}}),{id:"headlessui-radiogroup-"+v(),labelledby:i,describedby:u,el:r,handleKeyDown:function(e){if(r.value&&r.value.contains(e.target)){var t=a.value.filter((function(e){return!1===e.propsRef.disabled})).map((function(e){return e.element}));switch(e.key){case s.ArrowLeft:case s.ArrowUp:if(e.preventDefault(),e.stopPropagation(),O(t,m.Previous|m.WrapAround)===b.Success){var n=a.value.find((function(e){return e.element===document.activeElement}));n&&c.change(n.propsRef.value)}break;case s.ArrowRight:case s.ArrowDown:if(e.preventDefault(),e.stopPropagation(),O(t,m.Next|m.WrapAround)===b.Success){var o=a.value.find((function(e){return e.element===document.activeElement}));o&&c.change(o.propsRef.value)}break;case s.Space:e.preventDefault(),e.stopPropagation();var i=a.value.find((function(e){return e.element===document.activeElement}));i&&c.change(i.propsRef.value)}}}}}});!function(e){e[e.Empty=1]="Empty",e[e.Active=2]="Active"}(ze||(ze={}));var _e=t.defineComponent({name:"RadioGroupOption",props:{as:{type:[Object,String],default:"div"},value:{type:[Object,String,Number,Boolean]},disabled:{type:Boolean,default:!1}},render:function(){var e=o(this.$props,["value","disabled"]),t={checked:this.checked,disabled:this.disabled,active:Boolean(this.state&ze.Active)};return c({props:n({},e,{id:this.id,ref:"el",role:"radio","aria-checked":this.checked?"true":"false","aria-labelledby":this.labelledby,"aria-describedby":this.describedby,"aria-disabled":!!this.disabled||void 0,tabIndex:this.tabIndex,onClick:this.disabled?void 0:this.handleClick,onFocus:this.disabled?void 0:this.handleFocus,onBlur:this.disabled?void 0:this.handleBlur}),slot:t,attrs:this.$attrs,slots:this.$slots,name:"RadioGroupOption"})},setup:function(e){var n=We("RadioGroupOption"),o="headlessui-radiogroup-option-"+v(),r=Ve({name:"RadioGroupLabel"}),a=U({name:"RadioGroupDescription"}),i=t.ref(null),u=t.computed((function(){return{value:e.value,disabled:e.disabled}})),l=t.ref(ze.Empty);t.onMounted((function(){return n.registerOption({id:o,element:i,propsRef:u})})),t.onUnmounted((function(){return n.unregisterOption(o)}));var s=t.computed((function(){var e;return(null==(e=n.firstOption.value)?void 0:e.id)===o})),c=t.computed((function(){return n.disabled.value||e.disabled})),d=t.computed((function(){return t.toRaw(n.value.value)===t.toRaw(e.value)}));return{id:o,el:i,labelledby:r,describedby:a,state:l,disabled:c,checked:d,tabIndex:t.computed((function(){return c.value?-1:d.value||!n.containsCheckedOption.value&&s.value?0:-1})),handleClick:function(){var t;n.change(e.value)&&(l.value|=ze.Active,null==(t=i.value)||t.focus())},handleFocus:function(){l.value|=ze.Active},handleBlur:function(){l.value&=~ze.Active}}}}),Qe=Ge,Ye=N,Je=Symbol("GroupContext"),Xe=t.defineComponent({name:"SwitchGroup",props:{as:{type:[Object,String],default:"template"}},setup:function(e,n){var o=n.slots,r=n.attrs,a=t.ref(null),i=Ve({name:"SwitchLabel",props:{onClick:function(){a.value&&(a.value.click(),a.value.focus({preventScroll:!0}))}}}),u=U({name:"SwitchDescription"});return t.provide(Je,{switchRef:a,labelledby:i,describedby:u}),function(){return c({props:e,slot:{},slots:o,attrs:r,name:"SwitchGroup"})}}}),Ze=t.defineComponent({name:"Switch",emits:{"update:modelValue":function(e){return!0}},props:{as:{type:[Object,String],default:"button"},modelValue:{type:Boolean,default:!1}},render:function(){var e={checked:this.$props.modelValue};return c({props:n({},this.$props,{id:this.id,ref:"el",role:"switch",type:this.type,tabIndex:0,"aria-checked":this.$props.modelValue,"aria-labelledby":this.labelledby,"aria-describedby":this.describedby,onClick:this.handleClick,onKeyup:this.handleKeyUp,onKeypress:this.handleKeyPress}),slot:e,attrs:this.$attrs,slots:this.$slots,name:"Switch"})},setup:function(e,n){var o=n.emit,r=n.attrs,a=t.inject(Je,null),i="headlessui-switch-"+v();function u(){o("update:modelValue",!e.modelValue)}var l=t.ref(null),c=null===a?l:a.switchRef;return{id:i,el:c,type:oe(t.computed((function(){return{as:e.as,type:r.type}})),c),labelledby:null==a?void 0:a.labelledby,describedby:null==a?void 0:a.describedby,handleClick:function(e){e.preventDefault(),u()},handleKeyUp:function(e){e.key!==s.Tab&&e.preventDefault(),e.key===s.Space&&u()},handleKeyPress:function(e){e.preventDefault()}}}}),et=Ge,tt=N,nt=Symbol("TabsContext");function ot(e){var n=t.inject(nt,null);if(null===n){var o=new Error("<"+e+" /> is missing a parent <TabGroup /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(o,ot),o}return n}var rt,at=t.defineComponent({name:"TabGroup",emits:{change:function(e){return!0}},props:{as:{type:[Object,String],default:"template"},defaultIndex:{type:[Number],default:0},vertical:{type:[Boolean],default:!1},manual:{type:[Boolean],default:!1}},setup:function(e,n){var o=n.slots,r=n.attrs,a=n.emit,i=t.ref(null),u=t.ref([]),l=t.ref([]),s={selectedIndex:i,orientation:t.computed((function(){return e.vertical?"vertical":"horizontal"})),activation:t.computed((function(){return e.manual?"manual":"auto"})),tabs:u,panels:l,setSelectedIndex:function(e){i.value!==e&&(i.value=e,a("change",e))},registerTab:function(e){u.value.includes(e)||u.value.push(e)},unregisterTab:function(e){var t=u.value.indexOf(e);-1!==t&&u.value.slice(t,1)},registerPanel:function(e){l.value.includes(e)||l.value.push(e)},unregisterPanel:function(e){var t=l.value.indexOf(e);-1!==t&&l.value.slice(t,1)}};return t.provide(nt,s),t.onMounted((function(){if(s.tabs.value.length<=0)return console.log("bail");if(null!==i.value)return console.log("bail 2");var t=s.tabs.value.map((function(e){return V(e)})).filter(Boolean),n=t.filter((function(e){return!e.hasAttribute("disabled")}));if(e.defaultIndex<0)i.value=t.indexOf(n[0]);else if(e.defaultIndex>s.tabs.value.length)i.value=t.indexOf(n[n.length-1]);else{var o=t.slice(0,e.defaultIndex),r=t.slice(e.defaultIndex),a=[].concat(r,o).find((function(e){return n.includes(e)}));if(!a)return;i.value=t.indexOf(a)}})),function(){var t={selectedIndex:i.value};return c({props:p(e,["defaultIndex","manual","vertical"]),slot:t,slots:o,attrs:r,name:"TabGroup"})}}}),it=t.defineComponent({name:"TabList",props:{as:{type:[Object,String],default:"div"}},setup:function(e,t){var o=t.attrs,r=t.slots,a=ot("TabList");return function(){var t={selectedIndex:a.selectedIndex.value};return c({props:n({},e,{role:"tablist","aria-orientation":a.orientation.value}),slot:t,attrs:o,slots:r,name:"TabList"})}}}),ut=t.defineComponent({name:"Tab",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1}},render:function(){var e,t,o=ot("Tab"),r={selected:this.selected},a={ref:"el",onKeydown:this.handleKeyDown,onFocus:"manual"===o.activation.value?this.handleFocus:this.handleSelection,onClick:this.handleSelection,id:this.id,role:"tab",type:this.type,"aria-controls":null==(e=o.panels.value[this.myIndex])||null==(t=e.value)?void 0:t.id,"aria-selected":this.selected,tabIndex:this.selected?0:-1,disabled:!!this.$props.disabled||void 0};return c({props:n({},this.$props,a),slot:r,attrs:this.$attrs,slots:this.$slots,name:"Tab"})},setup:function(e,n){var o=n.attrs,r=ot("Tab"),a="headlessui-tabs-tab-"+v(),u=t.ref();t.onMounted((function(){return r.registerTab(u)})),t.onUnmounted((function(){return r.unregisterTab(u)}));var l=t.computed((function(){return r.tabs.value.indexOf(u)})),c=t.computed((function(){return l.value===r.selectedIndex.value})),d=t.computed((function(){var t;return null!=(t=o.type)?t:"button"===e.as?"button":void 0}));return{el:u,id:a,selected:c,myIndex:l,type:d,handleKeyDown:function(e){var t=r.tabs.value.map((function(e){return V(e)})).filter(Boolean);if(e.key===s.Space||e.key===s.Enter)return e.preventDefault(),e.stopPropagation(),void r.setSelectedIndex(l.value);switch(e.key){case s.Home:case s.PageUp:return e.preventDefault(),e.stopPropagation(),O(t,m.First);case s.End:case s.PageDown:return e.preventDefault(),e.stopPropagation(),O(t,m.Last)}return i(r.orientation.value,{vertical:function(){return e.key===s.ArrowUp?O(t,m.Previous|m.WrapAround):e.key===s.ArrowDown?O(t,m.Next|m.WrapAround):void 0},horizontal:function(){return e.key===s.ArrowLeft?O(t,m.Previous|m.WrapAround):e.key===s.ArrowRight?O(t,m.Next|m.WrapAround):void 0}})},handleFocus:function(){var e;null==(e=V(u))||e.focus()},handleSelection:function(){var t;e.disabled||(null==(t=V(u))||t.focus(),r.setSelectedIndex(l.value))}}}}),lt=t.defineComponent({name:"TabPanels",props:{as:{type:[Object,String],default:"div"}},setup:function(e,t){var n=t.slots,o=t.attrs,r=ot("TabPanels");return function(){return c({props:e,slot:{selectedIndex:r.selectedIndex.value},attrs:o,slots:n,name:"TabPanels"})}}}),st=t.defineComponent({name:"TabPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0}},render:function(){var e,t,o=ot("TabPanel"),r={selected:this.selected},a={ref:"el",id:this.id,role:"tabpanel","aria-labelledby":null==(e=o.tabs.value[this.myIndex])||null==(t=e.value)?void 0:t.id,tabIndex:this.selected?0:-1};return c({props:n({},this.$props,a),slot:r,attrs:this.$attrs,slots:this.$slots,features:u.Static|u.RenderStrategy,visible:this.selected,name:"TabPanel"})},setup:function(){var e=ot("TabPanel"),n="headlessui-tabs-panel-"+v(),o=t.ref();t.onMounted((function(){return e.registerPanel(o)})),t.onUnmounted((function(){return e.unregisterPanel(o)}));var r=t.computed((function(){return e.panels.value.indexOf(o)})),a=t.computed((function(){return r.value===e.selectedIndex.value}));return{id:n,el:o,selected:a,myIndex:r}}});function ct(){var e=[],t={requestAnimationFrame:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=requestAnimationFrame.apply(void 0,arguments);t.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];t.requestAnimationFrame((function(){t.requestAnimationFrame.apply(t,n)}))},setTimeout:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=setTimeout.apply(void 0,arguments);t.add((function(){return clearTimeout(e)}))})),add:function(t){e.push(t)},dispose:function(){for(var t,n=a(e.splice(0));!(t=n()).done;)(0,t.value)()}};return t}function dt(e){for(var t,n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];e&&o.length>0&&(t=e.classList).add.apply(t,o)}function pt(e){for(var t,n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];e&&o.length>0&&(t=e.classList).remove.apply(t,o)}function ft(e,t,n,o,r,a){var i,u,l=ct(),s=void 0!==a?(i=a,u={called:!1},function(){if(!u.called)return u.called=!0,i.apply(void 0,arguments)}):function(){};return pt.apply(void 0,[e].concat(r)),dt.apply(void 0,[e].concat(t,n)),l.nextFrame((function(){pt.apply(void 0,[e].concat(n)),dt.apply(void 0,[e].concat(o)),l.add(function(e,t){var n=ct();if(!e)return n.dispose;var o=getComputedStyle(e),r=[o.transitionDuration,o.transitionDelay].map((function(e){var t=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,t){return t-e}))[0];return void 0===t?0:t})),a=r[0];return 0!==a?n.setTimeout((function(){return t(rt.Finished)}),a+r[1]):t(rt.Finished),n.add((function(){return t(rt.Cancelled)})),n.dispose}(e,(function(n){return pt.apply(void 0,[e].concat(o,t)),dt.apply(void 0,[e].concat(r)),s(n)})))})),l.add((function(){return pt.apply(void 0,[e].concat(t,n,o,r))})),l.add((function(){return s(rt.Cancelled)})),l.dispose}function vt(e){return void 0===e&&(e=""),e.split(" ").filter((function(e){return e.trim().length>1}))}!function(e){e.Finished="finished",e.Cancelled="cancelled"}(rt||(rt={}));var mt,bt=Symbol("TransitionContext");!function(e){e.Visible="visible",e.Hidden="hidden"}(mt||(mt={}));var ht=Symbol("NestingContext");function yt(e){return"children"in e?yt(e.children):e.value.filter((function(e){return e.state===mt.Visible})).length>0}function gt(e){var n=t.ref([]),o=t.ref(!1);function r(t,r){var a;void 0===r&&(r=l.Hidden);var u=n.value.findIndex((function(e){return e.id===t}));-1!==u&&(i(r,((a={})[l.Unmount]=function(){n.value.splice(u,1)},a[l.Hidden]=function(){n.value[u].state=mt.Hidden},a)),!yt(n)&&o.value&&(null==e||e()))}return t.onMounted((function(){return o.value=!0})),t.onUnmounted((function(){return o.value=!1})),{children:n,register:function(e){var t=n.value.find((function(t){return t.id===e}));return t?t.state!==mt.Visible&&(t.state=mt.Visible):n.value.push({id:e,state:mt.Visible}),function(){return r(e,l.Unmount)}},unregister:r}}var St=u.RenderStrategy,wt=t.defineComponent({props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:""},enterFrom:{type:[String],default:""},enterTo:{type:[String],default:""},entered:{type:[String],default:""},leave:{type:[String],default:""},leaveFrom:{type:[String],default:""},leaveTo:{type:[String],default:""}},emits:{beforeEnter:function(){return!0},afterEnter:function(){return!0},beforeLeave:function(){return!0},afterLeave:function(){return!0}},render:function(){var e=this;return this.renderAsRoot?t.h(Ot,n({},this.$props,{onBeforeEnter:function(){return e.$emit("beforeEnter")},onAfterEnter:function(){return e.$emit("afterEnter")},onBeforeLeave:function(){return e.$emit("beforeLeave")},onAfterLeave:function(){return e.$emit("afterLeave")}}),this.$slots):c({props:n({},o(this.$props,["appear","show","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"]),{ref:"el"}),slot:{},slots:this.$slots,attrs:this.$attrs,features:St,visible:this.state===mt.Visible,name:"TransitionChild"})},setup:function(e,n){var o=n.emit;if(null===t.inject(bt,null)&&null!==z())return{renderAsRoot:!0};var r=t.ref(null),a=t.ref(mt.Visible),u=t.computed((function(){return e.unmount?l.Unmount:l.Hidden})),s=function(){var e=t.inject(bt,null);if(null===e)throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");return e}(),c=s.show,d=s.appear,p=function(){var e=t.inject(ht,null);if(null===e)throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");return e}(),f=p.register,m=p.unregister,b={value:!0},h=v(),y={value:!1},g=gt((function(){y.value||(a.value=mt.Hidden,m(h),o("afterLeave"))}));t.onMounted((function(){var e=f(h);t.onUnmounted(e)})),t.watchEffect((function(){var e;u.value===l.Hidden&&h&&(c&&a.value!==mt.Visible?a.value=mt.Visible:i(a.value,((e={})[mt.Hidden]=function(){return m(h)},e[mt.Visible]=function(){return f(h)},e)))}));var S=vt(e.enter),w=vt(e.enterFrom),O=vt(e.enterTo),x=vt(e.entered),E=vt(e.leave),C=vt(e.leaveFrom),P=vt(e.leaveTo);return t.onMounted((function(){t.watchEffect((function(){if(a.value===mt.Visible){var e=V(r);if(e instanceof Comment&&""===e.data)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}}))})),t.onMounted((function(){t.watch([c,d],(function(e,t,n){!function(e){var t=b.value&&!d.value,n=V(r);n&&n instanceof HTMLElement&&(t||(y.value=!0,c.value&&o("beforeEnter"),c.value||o("beforeLeave"),e(c.value?ft(n,S,w,O,x,(function(e){y.value=!1,e===rt.Finished&&o("afterEnter")})):ft(n,E,C,P,x,(function(e){y.value=!1,e===rt.Finished&&(yt(g)||(a.value=mt.Hidden,m(h),o("afterLeave")))})))))}(n),b.value=!1}),{immediate:!0})})),t.provide(ht,g),q(t.computed((function(){var e;return i(a.value,((e={})[mt.Visible]=G.Open,e[mt.Hidden]=G.Closed,e))}))),{el:r,renderAsRoot:!1,state:a}}}),Ot=t.defineComponent({inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:""},enterFrom:{type:[String],default:""},enterTo:{type:[String],default:""},entered:{type:[String],default:""},leave:{type:[String],default:""},leaveFrom:{type:[String],default:""},leaveTo:{type:[String],default:""}},emits:{beforeEnter:function(){return!0},afterEnter:function(){return!0},beforeLeave:function(){return!0},afterLeave:function(){return!0}},render:function(){var e=this,r=this.$props,a=r.unmount,i=o(r,["show","appear","unmount"]),u={unmount:a};return c({props:n({},u,{as:"template"}),slot:{},slots:n({},this.$slots,{default:function(){return[t.h(wt,n({onBeforeEnter:function(){return e.$emit("beforeEnter")},onAfterEnter:function(){return e.$emit("afterEnter")},onBeforeLeave:function(){return e.$emit("beforeLeave")},onAfterLeave:function(){return e.$emit("afterLeave")}},e.$attrs,u,i),e.$slots.default)]}}),attrs:{},features:St,visible:this.state===mt.Visible,name:"Transition"})},setup:function(e){var n=z(),o=t.computed((function(){var t;return null===e.show&&null!==n?i(n.value,((t={})[G.Open]=!0,t[G.Closed]=!1,t)):e.show}));t.watchEffect((function(){if(![!0,!1].includes(o.value))throw new Error('A <Transition /> is used but it is missing a `:show="true | false"` prop.')}));var r=t.ref(o.value?mt.Visible:mt.Hidden),a=gt((function(){r.value=mt.Hidden})),u={value:!0},l={show:o,appear:t.computed((function(){return e.appear||!u.value}))};return t.onMounted((function(){t.watchEffect((function(){u.value=!1,o.value?r.value=mt.Visible:yt(a)||(r.value=mt.Hidden)}))})),t.provide(ht,a),t.provide(bt,l),{state:r,show:o}}});e.Dialog=X,e.DialogDescription=te,e.DialogOverlay=Z,e.DialogTitle=ee,e.Disclosure=se,e.DisclosureButton=ce,e.DisclosurePanel=de,e.FocusTrap=pe,e.Listbox=he,e.ListboxButton=ge,e.ListboxLabel=ye,e.ListboxOption=we,e.ListboxOptions=Se,e.Menu=Pe,e.MenuButton=Te,e.MenuItem=De,e.MenuItems=ke,e.Popover=je,e.PopoverButton=$e,e.PopoverGroup=Ke,e.PopoverOverlay=Be,e.PopoverPanel=Me,e.Portal=$,e.PortalGroup=M,e.RadioGroup=qe,e.RadioGroupDescription=Ye,e.RadioGroupLabel=Qe,e.RadioGroupOption=_e,e.Switch=Ze,e.SwitchDescription=tt,e.SwitchGroup=Xe,e.SwitchLabel=et,e.Tab=ut,e.TabGroup=at,e.TabList=it,e.TabPanel=st,e.TabPanels=lt,e.TransitionChild=wt,e.TransitionRoot=Ot,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=headlessui.umd.production.min.js.map
