import{E as e,J as t,f as n,h as r,j as i,k as a}from"./vue.runtime.esm-bundler-56z_v_HH.js";var o=Symbol(`headlessui.useid`),s=0,c=t??function(){return i(o,()=>`${++s}`)()};function l(e){if(e==null||e.value==null)return null;let t=e.value.$el??e.value;return t instanceof Node?t:null}function u(e,t,...n){if(e in t){let r=t[e];return typeof r==`function`?r(...n):r}let r=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(`, `)}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,u),r}var d=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(d||{}),f=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(f||{});function p({visible:e=!0,features:t=0,ourProps:n,theirProps:r,...i}){var a;let o=g(r,n),s=Object.assign(i,{props:o});return e||t&2&&o.static?m(s):t&1?u((a=o.unmount)==null||a?0:1,{0(){return null},1(){return m({...i,props:{...o,hidden:!0,style:{display:`none`}}})}}):m(s)}function m({props:e,attrs:t,slots:n,slot:i,name:o}){let{as:s,...c}=v(e,[`unmount`,`static`]),l=n.default?.call(n,i),u={};if(i){let e=!1,t=[];for(let[n,r]of Object.entries(i))typeof r==`boolean`&&(e=!0),r===!0&&t.push(n);e&&(u[`data-headlessui-state`]=t.join(` `))}if(s===`template`){if(l=h(l??[]),Object.keys(c).length>0||Object.keys(t).length>0){let[e,...n]=l??[];if(!y(e)||n.length>0)throw Error([`Passing props on "template"!`,``,`The current component <${o} /> is rendering a "template".`,`However we need to passthrough the following props:`,Object.keys(c).concat(Object.keys(t)).map(e=>e.trim()).filter((e,t,n)=>n.indexOf(e)===t).sort((e,t)=>e.localeCompare(t)).map(e=>`  - ${e}`).join(`
`),``,`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(e=>`  - ${e}`).join(`
`)].join(`
`));let i=g(e.props??{},c,u),a=r(e,i,!0);for(let e in i)e.startsWith(`on`)&&(a.props||={},a.props[e]=i[e]);return a}return Array.isArray(l)&&l.length===1?l[0]:l}return a(s,Object.assign({},c,u),{default:()=>l})}function h(e){return e.flatMap(e=>e.type===n?h(e.children):[e])}function g(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t[`aria-disabled`])return Object.assign(t,Object.fromEntries(Object.keys(n).map(e=>[e,void 0])));for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if(t instanceof Event&&t.defaultPrevented)return;e(t,...r)}}});return t}function _(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}function v(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function y(e){return e==null?!1:typeof e.type==`string`||typeof e.type==`object`||typeof e.type==`function`}var b=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(b||{}),x=e({name:`Hidden`,props:{as:{type:[Object,String],default:`div`},features:{type:Number,default:1}},setup(e,{slots:t,attrs:n}){return()=>{let{features:r,...i}=e;return p({ourProps:{"aria-hidden":(r&2)==2?!0:i[`aria-hidden`]??void 0,hidden:(r&4)==4?!0:void 0,style:{position:`fixed`,top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,...(r&4)==4&&(r&2)!=2&&{display:`none`}}},theirProps:i,slot:{},attrs:n,slots:t,name:`Hidden`})}}}),S=(e=>(e.Space=` `,e.Enter=`Enter`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.Delete=`Delete`,e.ArrowLeft=`ArrowLeft`,e.ArrowUp=`ArrowUp`,e.ArrowRight=`ArrowRight`,e.ArrowDown=`ArrowDown`,e.Home=`Home`,e.End=`End`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Tab=`Tab`,e))(S||{});export{_ as a,v as c,c as d,p as i,u as l,x as n,d as o,b as r,f as s,S as t,l as u};