import{a6 as k,A as I,I as S,v as q,r as B,c as M,d as b,Q as x,a7 as G,a8 as C,a9 as V,aa as j,U as K,ab as Y,g as z,o as W,w as _,e as H,u as N,s as Q}from"./app-KXUNt_n9.js";import{r as J,S as O,P as X}from"./AppLogoIcon.vue_vue_type_script_setup_true_lang-M23wUS8o.js";import{q as Z,i as ee,u as te,b as ne}from"./useForwardExpose-B0NY7lip.js";import{b as R,g as P,c as ae,a as oe}from"./VisuallyHidden-OJAPlYzx.js";function Ie(t,e="reka"){return`${e}-${k?.()}`}function re(t,e){const i=I(t);function a(d){return e[i.value][d]??i.value}return{state:i,dispatch:d=>{i.value=a(d)}}}function ie(t,e){const i=I({}),a=I("none"),s=I(t),d=t.value?"mounted":"unmounted";let c;const v=e.value?.ownerDocument.defaultView??Z,{state:m,dispatch:u}=re(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),n=o=>{if(ee){const r=new CustomEvent(o,{bubbles:!1,cancelable:!1});e.value?.dispatchEvent(r)}};S(t,async(o,r)=>{const h=r!==o;if(await q(),h){const E=a.value,p=w(e.value);o?(u("MOUNT"),n("enter"),p==="none"&&n("after-enter")):p==="none"||p==="undefined"||i.value?.display==="none"?(u("UNMOUNT"),n("leave"),n("after-leave")):r&&E!==p?(u("ANIMATION_OUT"),n("leave")):(u("UNMOUNT"),n("after-leave"))}},{immediate:!0});const l=o=>{const r=w(e.value),h=r.includes(o.animationName),E=m.value==="mounted"?"enter":"leave";if(o.target===e.value&&h&&(n(`after-${E}`),u("ANIMATION_END"),!s.value)){const p=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",c=v?.setTimeout(()=>{e.value?.style.animationFillMode==="forwards"&&(e.value.style.animationFillMode=p)})}o.target===e.value&&r==="none"&&u("ANIMATION_END")},f=o=>{o.target===e.value&&(a.value=w(e.value))},A=S(e,(o,r)=>{o?(i.value=getComputedStyle(o),o.addEventListener("animationstart",f),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l)):(u("ANIMATION_END"),c!==void 0&&v?.clearTimeout(c),r?.removeEventListener("animationstart",f),r?.removeEventListener("animationcancel",l),r?.removeEventListener("animationend",l))},{immediate:!0}),g=S(m,()=>{const o=w(e.value);a.value=m.value==="mounted"?o:"none"});return B(()=>{A(),g()}),{isPresent:M(()=>["mounted","unmountSuspended"].includes(m.value))}}function w(t){return t&&getComputedStyle(t).animationName||"none"}var Ee=b({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:e,expose:i}){const{present:a,forceMount:s}=x(t),d=I(),{isPresent:c}=ie(a,d);i({present:c});let v=e.default({present:c.value});v=J(v||[]);const m=G();if(v&&v?.length>1){const u=m?.parent?.type.name?`<${m.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${u}\` for  \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(n=>`  - ${n}`).join(`
`)].join(`
`))}return()=>s.value||a.value||c.value?C(e.default({present:c.value})[0],{ref:u=>{const n=te(u);return typeof n?.hasAttribute>"u"||(n?.hasAttribute("data-reka-popper-content-wrapper")?d.value=n.firstElementChild:d.value=n),n}}):null}});const U="data-reka-collection-item";function se(t={}){const{key:e="",isProvider:i=!1}=t,a=`${e}CollectionProvider`;let s;if(i){const n=I(new Map);s={collectionRef:I(),itemMap:n},V(a,s)}else s=j(a);const d=(n=!1)=>{const l=s.collectionRef.value;if(!l)return[];const f=Array.from(l.querySelectorAll(`[${U}]`)),g=Array.from(s.itemMap.value.values()).sort((T,o)=>f.indexOf(T.ref)-f.indexOf(o.ref));return n?g:g.filter(T=>T.ref.dataset.disabled!=="")},c=b({name:"CollectionSlot",setup(n,{slots:l}){const{primitiveElement:f,currentElement:A}=R();return S(A,()=>{s.collectionRef.value=A.value}),()=>C(O,{ref:f},l)}}),v=b({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(n,{slots:l,attrs:f}){const{primitiveElement:A,currentElement:g}=R();return K(T=>{if(g.value){const o=Y(g.value);s.itemMap.value.set(o,{ref:g.value,value:n.value}),T(()=>s.itemMap.value.delete(o))}}),()=>C(O,{...f,[U]:"",ref:A},l)}}),m=M(()=>Array.from(s.itemMap.value.values())),u=M(()=>s.itemMap.value.size);return{getItems:d,reactiveItems:m,itemMapSize:u,CollectionSlot:c,CollectionItem:v}}const ue="rovingFocusGroup.onEntryFocus",le={bubbles:!1,cancelable:!0},ce={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function de(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function ye(t,e,i){const a=de(t.key,i);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return ce[a]}function fe(t,e=!1){const i=P();for(const a of t)if(a===i||(a.focus({preventScroll:e}),P()!==i))return}function Te(t,e){return t.map((i,a)=>t[(e+a)%t.length])}const[Ne,me]=ae("RovingFocusGroup");var ve=b({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(t,{expose:e,emit:i}){const a=t,s=i,{loop:d,orientation:c,dir:v}=x(a),m=oe(v),u=ne(a,"currentTabStopId",s,{defaultValue:a.defaultCurrentTabStopId,passive:a.currentTabStopId===void 0}),n=I(!1),l=I(!1),f=I(0),{getItems:A,CollectionSlot:g}=se({isProvider:!0});function T(r){const h=!l.value;if(r.currentTarget&&r.target===r.currentTarget&&h&&!n.value){const E=new CustomEvent(ue,le);if(r.currentTarget.dispatchEvent(E),s("entryFocus",E),!E.defaultPrevented){const p=A().map(y=>y.ref).filter(y=>y.dataset.disabled!==""),F=p.find(y=>y.getAttribute("data-active")===""),D=p.find(y=>y.getAttribute("data-highlighted")===""),$=p.find(y=>y.id===u.value),L=[F,D,$,...p].filter(Boolean);fe(L,a.preventScrollOnEntryFocus)}}l.value=!1}function o(){setTimeout(()=>{l.value=!1},1)}return e({getItems:A}),me({loop:d,dir:m,orientation:c,currentTabStopId:u,onItemFocus:r=>{u.value=r},onItemShiftTab:()=>{n.value=!0},onFocusableItemAdd:()=>{f.value++},onFocusableItemRemove:()=>{f.value--}}),(r,h)=>(W(),z(N(g),null,{default:_(()=>[H(N(X),{tabindex:n.value||f.value===0?-1:0,"data-orientation":N(c),as:r.as,"as-child":r.asChild,dir:N(m),style:{outline:"none"},onMousedown:h[0]||(h[0]=E=>l.value=!0),onMouseup:o,onFocus:T,onBlur:h[1]||(h[1]=E=>n.value=!1)},{default:_(()=>[Q(r.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),we=ve;export{Ee as P,we as R,se as a,fe as f,ye as g,Ne as i,Ie as u,Te as w};
