vendor: 3,953 bytes, line 1
1import{r as s,j as d}from"./index-fHMyORYL.js";import{c as H,b as m,u as V}from"./index-DJawpQ_K.js";import{c as z,u as q}from"./index-C913gOmL.js";import{b as J}from"./i18n-compat-Egy22pE5.js";import{u as Q,a as W}from"./index-B1XP5fQN.js";import{P as G}from"./index-Dolb4-0I.js";try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6b62f9f5-2198-44d9-85d9-616daf3ad0eb",e._sentryDebugIdIdentifier="sentry-dbid-6b62f9f5-2198-44d9-85d9-616daf3ad0eb")}catch{}var x="rovingFocusGroup.onEntryFocus",X={bubbles:!1,cancelable:!0},I="RovingFocusGroup",[A,N,Z]=z(I),[$,me]=H(I,[Z]),[ee,te]=$(I),O=s.forwardRef((e,t)=>d.jsx(A.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(A.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(oe,{...e,ref:t})})}));O.displayName=I;var oe=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:c,orientation:o,loop:E=!1,dir:T,currentTabStopId:b,defaultCurrentTabStopId:y,onCurrentTabStopIdChange:C,onEntryFocus:p,preventScrollOnEntryFocus:a=!1,...v}=e,g=s.useRef(null),F=J(t,g),R=q(T),[w,r]=V({prop:b,defaultProp:y??null,onChange:C,caller:I}),[i,S]=s.useState(!1),u=W(p),l=N(c),h=s.useRef(!1),[M,D]=s.useState(0);return s.useEffect(()=>{const n=g.current;if(n)return n.addEventListener(x,u),()=>n.removeEventListener(x,u)},[u]),d.jsx(ee,{scope:c,orientation:o,dir:R,loop:E,currentTabStopId:w,onItemFocus:s.useCallback(n=>r(n),[r]),onItemShiftTab:s.useCallback(()=>S(!0),[]),onFocusableItemAdd:s.useCallback(()=>D(n=>n+1),[]),onFocusableItemRemove:s.useCallback(()=>D(n=>n-1),[]),children:d.jsx(G.div,{tabIndex:i||M===0?-1:0,"data-orientation":o,...v,ref:F,style:{outline:"none",...e.style},onMouseDown:m(e.onMouseDown,()=>{h.current=!0}),onFocus:m(e.onFocus,n=>{const L=!h.current;if(n.target===n.currentTarget&&L&&!i){const P=new CustomEvent(x,X);if(n.currentTarget.dispatchEvent(P),!P.defaultPrevented){const _=l().filter(f=>f.focusable),U=_.find(f=>f.active),B=_.find(f=>f.id===w),Y=[U,B,..._].filter(Boolean).map(f=>f.ref.current);k(Y,a)}}h.current=!1}),onBlur:m(e.onBlur,()=>S(!1))})})}),K="RovingFocusGroupItem",j=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:c,focusable:o=!0,active:E=!1,tabStopId:T,children:b,...y}=e,C=Q(),p=T||C,a=te(K,c),v=a.currentTabStopId===p,g=N(c),{onFocusableItemAdd:F,onFocusableItemRemove:R,currentTabStopId:w}=a;return s.useEffect(()=>{if(o)return F(),()=>R()},[o,F,R]),d.jsx(A.ItemSlot,{scope:c,id:p,focusable:o,active:E,children:d.jsx(G.span,{tabIndex:v?0:-1,"data-orientation":a.orientation,...y,ref:t,onMouseDown:m(e.onMouseDown,r=>{o?a.onItemFocus(p):r.preventDefault()}),onFocus:m(e.onFocus,()=>a.onItemFocus(p)),onKeyDown:m(e.onKeyDown,r=>{if(r.key==="Tab"&&r.shiftKey){a.onItemShiftTab();return}if(r.target!==r.currentTarget)return;const i=se(r,a.orientation,a.dir);if(i!==void 0){if(r.metaKey||r.ctrlKey||r.altKey||r.shiftKey)return;r.preventDefault();let u=g().filter(l=>l.focusable).map(l=>l.ref.current);if(i==="last")u.reverse();else if(i==="prev"||i==="next"){i==="prev"&&u.reverse();const l=u.indexOf(r.currentTarget);u=a.loop?ce(u,l+1):u.slice(l+1)}setTimeout(()=>k(u))}}),children:typeof b=="function"?b({isCurrentTabStop:v,hasTabStop:w!=null}):b})})});j.displayName=K;var re={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ne(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function se(e,t,c){const o=ne(e.key,c);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return re[o]}function k(e,t=!1){const c=document.activeElement;for(const o of e)if(o===c||(o.focus({preventScroll:t}),document.activeElement!==c))return}function ce(e,t){return e.map((c,o)=>e[(t+o)%e.length])}var be=O,Ie=j;export{Ie as I,be as R,me as c};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.