PageSourceSearch

https://portal.voiceinfra.ai/assets/useRovingTabIndex-CyPLR13U.js

js voiceinfra.ai collected 2026-10-05 13:15:18 UTC 19,959 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{F as t,I as n,P as r,Z as i,a,g as o,o as s,w as c,wt as l}from"./Box-B1HC3EmG.js";import{t as u}from"./react-dom-DqxAECDm.js";import{d,f,m as p,s as m,v as h}from"./Button-OnXvpUz6.js";import{n as g}from"./Paper-B7aYfVW9.js";import{a as _,i as v,n as y,r as b,t as x}from"./useSlot-jWczOn1n.js";import{a as S,i as C,n as w,o as T,t as E}from"./utils-CB0IO9uR.js";var D=e(l(),1),O=i(),k=D.createContext();function A({value:e,...t}){return(0,O.jsx)(k.Provider,{value:e??!0,...t})}var j=()=>D.useContext(k)??!1;function M(...e){return e.reduce((e,t)=>t==null?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function N(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return r.clear=()=>{clearTimeout(n)},r}var P=N;function F(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}var I=e(u(),1),L=F;function R(e){return e&&e.ownerDocument||document}var z=R;function B(e){return R(e).defaultView||window}var ee=B;function V(e,t){typeof e==`function`?e(t):e&&(e.current=t)}var te=h;function H(e,t){if(!e||!t)return!1;if(e.contains(t))return!0;let n=t.getRootNode?.();if(n&&n instanceof ShadowRoot){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode??n.host??null}}return!1}function ne(e){let{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...a}=e,o=i?{}:v(n,r),{props:s,internalRef:c}=y({...a,externalSlotProps:o}),l=f(c,o?.ref,e.additionalProps?.ref);return _(t,{...s,ref:l},r)}function U(e){return e?.props?.ref||null}function re(e){return typeof e==`function`?e():e}var ie=D.forwardRef(function(e,t){let{children:n,container:r,disablePortal:i=!1}=e,[a,o]=D.useState(null),s=f(D.isValidElement(n)?U(n):null,t);if(h(()=>{i||o(re(r)||document.body)},[r,i]),h(()=>{if(a&&!i)return V(t,a),()=>{V(t,null)}},[t,a,i]),i){if(D.isValidElement(n)){let e={ref:s};return D.cloneElement(n,e)}return n}return a&&I.createPortal(n,a)}),ae={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0}},oe={opacity:0,visibility:`hidden`},se=D.forwardRef(function(e,t){let n=g(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:a=!0,children:o,easing:s,in:c,onEnter:l,onEntered:u,onEntering:f,onExit:p,onExited:m,onExiting:h,style:_,timeout:v=r,...y}=e,b=D.useRef(null),x=d(b,U(o),t),k=C(b,f),A=C(b,(e,t)=>{S(e);let r=w({style:_,timeout:v,easing:s},{mode:`enter`});e.style.transition=n.transitions.create(`opacity`,r),l&&l(e,t)}),j=C(b,u),M=C(b,h),N=C(b,e=>{let t=w({style:_,timeout:v,easing:s},{mode:`exit`});e.style.transition=n.transitions.create(`opacity`,t),p&&p(e)}),P=C(b,e=>{e.style.transition=``,m&&m(e)});return(0,O.jsx)(T,{appear:a,in:c,nodeRef:b,onEnter:A,onEntered:j,onEntering:k,onExit:N,onExited:P,onExiting:M,addEndListener:e=>{i&&i(b.current,e)},timeout:v,...y,children:(e,{ownerState:t,...n})=>{let r=E(e,c,ae,oe,_,o.props.style);return D.cloneElement(o,{style:r,ref:x,...n})}})});function ce(e){return t(`MuiBackdrop`,e)}r(`MuiBackdrop`,[`root`,`invisible`]);var le=e=>{let{classes:t,invisible:n}=e;return c({root:[`root`,n&&`invisible`]},ce,t)},ue=o(`div`,{name:`MuiBackdrop`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:`fixed`,display:`flex`,alignItems:`center`,justifyContent:`center`,right:0,bottom:0,top:0,left:0,backgroundColor:`rgba(0, 0, 0, 0.5)`,WebkitTapHighlightColor:`transparent`,variants:[{props:{invisible:!0},style:{backgroundColor:`transparent`}}]}),de=D.forwardRef(function(e,t){let r=a({props:e,name:`MuiBackdrop`}),{children:i,className:o,component:s=`div`,invisible:c=!1,open:l,slotProps:u={},slots:d={},transitionDuration:f,...p}
vendor: 9,217 bytes, line 1
1=r,m={...r,component:s,invisible:c},h=le(m),g={component:s,slots:d,slotProps:u},[_,v]=x(`root`,{elementType:ue,externalForwardedProps:g,className:n(h.root,o),ownerState:m}),[y,b]=x(`transition`,{elementType:se,externalForwardedProps:g,ownerState:m});return(0,O.jsx)(y,{in:l,timeout:f,...p,...b,children:(0,O.jsx)(_,{...v,ref:t,children:i})})});function fe(e=window){let t=e.document.documentElement.clientWidth;return e.innerWidth-t}function pe(e){let t=R(e);return t.body===e?B(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function W(e,t){t?e.setAttribute(`aria-hidden`,`true`):e.removeAttribute(`aria-hidden`)}function me(e){return parseFloat(B(e).getComputedStyle(e).paddingRight)||0}function he(e){let t=[`TEMPLATE`,`SCRIPT`,`STYLE`,`LINK`,`MAP`,`META`,`NOSCRIPT`,`PICTURE`,`COL`,`COLGROUP`,`PARAM`,`SLOT`,`SOURCE`,`TRACK`].includes(e.tagName),n=e.tagName===`INPUT`&&e.getAttribute(`type`)===`hidden`;return t||n}function ge(e,t,n,r,i){let a=[t,n,...r];[].forEach.call(e.children,e=>{let t=!a.includes(e),n=!he(e);t&&n&&W(e,i)})}function G(e,t){let n=-1;return e.some((e,r)=>t(e)?(n=r,!0):!1),n}function _e(e,t){let n=[],r=e.container;if(!t.disableScrollLock){if(pe(r)){let e=fe(B(r));n.push({value:r.style.paddingRight,property:`padding-right`,el:r}),r.style.paddingRight=`${me(r)+e}px`;let t=R(r).querySelectorAll(`.mui-fixed`);[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:`padding-right`,el:t}),t.style.paddingRight=`${me(t)+e}px`})}let e;if(r.parentNode instanceof DocumentFragment)e=R(r).body;else{let t=r.parentElement,n=B(r);e=t?.nodeName===`HTML`&&n.getComputedStyle(t).overflowY===`scroll`?t:r}n.push({value:e.style.overflow,property:`overflow`,el:e},{value:e.style.overflowX,property:`overflow-x`,el:e},{value:e.style.overflowY,property:`overflow-y`,el:e}),e.style.overflow=`hidden`}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}function ve(e){let t=[];return[].forEach.call(e.children,e=>{e.getAttribute(`aria-hidden`)===`true`&&t.push(e)}),t}var ye=class{constructor(){this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(n!==-1)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&W(e.modalRef,!1);let r=ve(t);ge(t,e.mount,e.modalRef,r,!0);let i=G(this.containers,e=>e.container===t);return i===-1?(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n):(this.containers[i].modals.push(e),n)}mount(e,t){let n=G(this.containers,t=>t.modals.includes(e)),r=this.containers[n];r.restore||=_e(r,t)}remove(e,t=!0){let n=this.modals.indexOf(e);if(n===-1)return n;let r=G(this.containers,t=>t.modals.includes(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),e.modalRef&&W(e.modalRef,t),ge(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{let e=i.modals[i.modals.length-1];e.modalRef&&W(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}},K=H,be=`data-mui-focusable`;function xe(e){return e?e.hasAttribute(`data-mui-focusable`)?e:e.querySelector(`[${be}]`):null}var Se=[`input`,`select`,`textarea`,`a[href]`,`button`,`[tabindex]`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable="false"])`].join(`,`);function Ce(e){let t=parseInt(e.getAttribute(`tabindex`)||``,10);return Number.isNaN(t)?e.contentEditable===`true`||(e.nodeName===`AUDIO`||e.nodeName===`VIDEO`||e.nodeName===`DETAILS`)&&e.getAttribute(`tabindex`)===null?0:e.tabIndex:t}function we(e){if(e.tagName!==`INPUT`||e.type!==`radio`||!e.name)return!1;let t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`),n=t(`[name="${e.name}"]:checked`);return n||=t(`[name="${e.name}"]`),n!==e}function Te(e){return!(e.disabled||e.tagName===`INPUT`&&e.type===`hidden`||we(e))}function Ee(e){let t=[],n=[];return Array.from(e.querySelectorAll(Se)).forEach((e,r)=>{let i=Ce(e);i!==-1&&Te(e)&&(i===0?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function De(){return!0}function Oe(e){let{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:a=Ee,isEnabled:o=De,open:s}=e,c=D.useRef(!1),l=D.useRef(null),u=D.useRef(null),d=D.useRef(null),p=D.useRef(null),m=D.useRef(!1),h=D.useRef(null),g=f(U(t),h),_=D.useRef(null);D.useEffect(()=>{s&&h.current&&(m.current=!n)},[n,s]),D.useEffect(()=>{if(c.current=!1,!s||!h.current)return;let e=L(R(h.current)),t=xe(h.current)??h.current;return K(h.current,e)||(t.hasAttribute(`tabIndex`)||t.setAttribute(`tabIndex`,`-1`),m.current&&t.focus()),()=>{!i&&d.current&&(c.current=!0,d.current.focus(),d.current=null)}},[s]),D.useEffect(()=>{if(!s||!h.current)return;let e=R(h.current),t=t=>{_.current=t,!r&&o()&&t.key===`Tab`&&L(e)===h.current&&t.shiftKey&&(c.current=!0,u.current&&u.current.focus())},n=()=>{let t=h.current;if(t===null)return;let n=L(e);if(!e.hasFocus()||!o()||c.current){c.current=!1;return}if(K(t,n)||r&&n!==l.current&&n!==u.current)return;if(n!==p.current)p.current=null;else if(p.current!==null)return;if(!m.current)return;let i=[];if((n===l.current||n===u.current)&&(i=a(h.current)),i.length>0){let e=!!(_.current?.shiftKey&&_.current?.key===`Tab`),t=i[0],n=i[i.length-1];typeof t!=`string`&&typeof n!=`string`&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener(`focusin`,n),e.addEventListener(`keydown`,t,!0);let i=setInterval(()=>{let t=L(e);t&&t.tagName===`BODY`&&n()},50);return()=>{clearInterval(i),e.removeEventListener(`focusin`,n),e.removeEventListener(`keydown`,t,!0)}},[n,r,i,o,s,a]);let v=e=>{d.current===null&&(d.current=e.relatedTarget),m.current=!0,p.current=e.target;let n=t.props.onFocus;n&&n(e)},y=e=>{d.current===null&&(d.current=e.relatedTarget),m.current=!0};return(0,O.jsxs)(D.Fragment,{children:[(0,O.jsx)(`div`,{tabIndex:s?0:-1,onFocus:y,ref:l,"data-testid":`sentinelStart`}),D.cloneElement(t,{ref:g,onFocus:v}),(0,O.jsx)(`div`,{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":`sentinelEnd`})]})}function ke(e){return typeof e==`function`?e():e}function Ae(e){return e?e.props.hasOwnProperty(`in`):!1}var je=()=>{},q=new ye;function Me(e){let{container:t,disableScrollLock:n=!1,closeAfterTransition:r=!1,onTransitionEnter:i,onTransitionExited:a,children:o,onClose:s,open:c,rootRef:l}=e,u=D.useRef({}),d=D.useRef(null),m=D.useRef(null),h=f(m,l),[g,_]=D.useState(!c),v=Ae(o),y=!0;(e[`aria-hidden`]===`false`||e[`aria-hidden`]===!1)&&(y=!1);let x=()=>R(d.current),S=()=>(u.current.modalRef=m.current,u.current.mount=d.current,u.current),C=()=>{q.mount(S(),{disableScrollLock:n}),m.current&&(m.current.scrollTop=0)},w=p(()=>{let e=ke(t)||x().body;q.add(S(),e),m.current&&C()}),T=()=>q.isTopModal(S()),E=p(e=>{d.current=e,e&&(c&&T()?C():m.current&&W(m.current,y))}),O=D.useCallback(()=>{q.remove(S(),y)},[y]);D.useEffect(()=>()=>{O()},[O]),D.useEffect(()=>{c?w():(!v||!r)&&O()},[c,O,v,r,w]);let k=e=>t=>{e.onKeyDown?.(t),t.key===`Escape`&&t.which!==229&&T()&&(t.stopPropagation(),s&&s(t,`escapeKeyDown`))},A=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&s&&s(t,`backdropClick`)};return{getRootProps:(t={})=>{let n=b(e);delete n.onTransitionEnter,delete n.onTransitionExited;let r={...n,...t};return{role:`presentation`,...r,onKeyDown:k(r),ref:h}},getBackdropProps:(e={})=>{let t=e;return{"aria-hidden":!0,...t,onClick:A(t),open:c}},getTransitionProps:()=>({onEnter:M(()=>{_(!1),i&&i()},o?.props.onEnter??je),onExited:M(()=>{_(!0),a&&a(),r&&O()},o?.props.onExited??je)}),rootRef:h,portalRef:E,isTopModal:T,exited:g,hasTransition:v}}function Ne(e){return t(`MuiModal`,e)}r(`MuiModal`,[`root`,`hidden`,`backdrop`]);var Pe=e=>{let{open:t,exited:n,classes:r}=e;return c({root:[`root`,!t&&n&&`hidden`],backdrop:[`backdrop`]},Ne,r)},Fe=o(`div`,{name:`MuiModal`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(s(({theme:e})=>({position:`fixed`,zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:`hidden`}}]}))),Ie=o(de,{name:`MuiModal`,slot:`Backdrop`})({zIndex:-1}),Le=D.forwardRef(function(e,t){let r=a({name:`MuiModal`,props:e}),{classes:i,className:o,closeAfterTransition:s=!1,children:c,container:l,component:u,disableAutoFocus:d=!1,disableEnforceFocus:f=!1,disablePortal:p=!1,disableRestoreFocus:m=!1,disableScrollLock:h=!1,hideBackdrop:g=!1,keepMounted:_=!1,onClose:v,onTransitionEnter:y,onTransitionExited:b,open:S,slotProps:C={},slots:w={},theme:T,...E}=r,k={...r,closeAfterTransition:s,disableAutoFocus:d,disableEnforceFocus:f,disablePortal:p,disableRestoreFocus:m,disableScrollLock:h,hideBackdrop:g,keepMounted:_},{getRootProps:A,getBackdropProps:j,getTransitionProps:M,portalRef:N,isTopModal:P,exited:F,hasTransition:I}=Me({...k,rootRef:t}),L={...k,exited:F},R=Pe(L),z={};if(c.props.tabIndex===void 0&&(z.tabIndex=`-1`),I){let{onEnter:e,onExited:t}=M();z.onEnter=e,z.onExited=t}let B={slots:w,slotProps:C},[ee,V]=x(`root`,{ref:t,elementType:Fe,externalForwardedProps:{...B,...E,component:u}
1,getSlotProps:A,ownerState:L,className:n(o,R?.root,!L.open&&L.exited&&R?.hidden)}),[te,H]=x(`backdrop`,{elementType:Ie,externalForwardedProps:B,shouldForwardComponentProp:!0,getSlotProps:e=>j({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:R?.backdrop,ownerState:L});return!_&&!S&&(!I||F)?null:(0,O.jsx)(ie,{ref:N,container:l,disablePortal:p,children:(0,O.jsxs)(ee,{...V,children:[g?null:(0,O.jsx)(te,{...H}),(0,O.jsx)(Oe,{disableEnforceFocus:f,disableAutoFocus:d,disableRestoreFocus:m,isEnabled:P,open:S,children:D.cloneElement(c,z)})]})})});function J(e){return`scale(${e}, ${e**2})`}var Re={entering:{opacity:1,transform:J(1)},entered:{opacity:1,transform:`none`},exiting:{opacity:0,transform:J(.75)},exited:{opacity:0,transform:J(.75)}},ze={opacity:0,transform:J(.75),visibility:`hidden`},Y=D.forwardRef(function(e,t){let{addEndListener:n,appear:r=!0,children:i,easing:a,in:o,onEnter:s,onEntered:c,onEntering:l,onExit:u,onExited:f,onExiting:p,style:h,timeout:_=`auto`,...v}=e,y=m(),b=D.useRef(),x=g(),k=D.useRef(null),A=d(k,U(i),t),j=C(k,l),M=C(k,(e,t)=>{S(e);let{duration:n,delay:r,easing:i}=w({style:h,timeout:_,easing:a},{mode:`enter`}),o;_===`auto`?(o=x.transitions.getAutoHeightDuration(e.clientHeight),b.current=o):o=n,e.style.transition=[x.transitions.create(`opacity`,{duration:o,delay:r}),x.transitions.create(`transform`,{duration:o*.666,delay:r,easing:i})].join(`,`),s&&s(e,t)}),N=C(k,c),P=C(k,p),F=C(k,e=>{let{duration:t,delay:n,easing:r}=w({style:h,timeout:_,easing:a},{mode:`exit`}),i;_===`auto`?(i=x.transitions.getAutoHeightDuration(e.clientHeight),b.current=i):i=t,e.style.transition=[x.transitions.create(`opacity`,{duration:i,delay:n}),x.transitions.create(`transform`,{duration:i*.666,delay:n||i*.333,easing:r})].join(`,`),e.style.opacity=0,e.style.transform=J(.75),u&&u(e)}),I=C(k,e=>{e.style.transition=``,f&&f(e)});return(0,O.jsx)(T,{appear:r,in:o,nodeRef:k,onEnter:M,onEntered:N,onEntering:j,onExit:F,onExited:I,onExiting:P,addEndListener:e=>{_===`auto`&&y.start(b.current||0,e),n&&n(k.current,e)},timeout:_===`auto`?null:_,...v,children:(e,{ownerState:t,...n})=>{let r=E(e,o,Re,ze,h,i.props.style);return D.cloneElement(i,{style:r,ref:A,...n})}})});Y&&(Y.muiSupportAuto=!0);var Be=D.createContext(void 0);function Ve(){let e=D.useContext(Be);if(e===void 0)throw Error(`MUI: RovingTabIndexContext is missing. Roving tab index items must be placed within a roving tab index provider.`);return e}var He=Object.is;function Ue(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(let r in e)if(n+=1,!He(e[r],t[r])||!(r in t))return!1;for(let e in t)r+=1;return n===r}var We=[`ArrowRight`,`ArrowLeft`,`ArrowUp`,`ArrowDown`,`Home`,`End`];function Ge(e){let{activeItemId:t,getDefaultActiveItemId:n,orientation:r,isRtl:i=!1,isItemFocusable:a=nt,wrap:o=!0}=e,[s,c]=D.useState(t),[l,u]=D.useState(t),d=s;t!==l&&(u(t),t!==void 0&&t!==s&&(d=t,c(t)));let f=D.useRef(null),m=D.useRef(new Map),[h,g]=D.useState(0),_=D.useMemo(()=>Z(m.current),[h]),v=qe(d,_,a,n),y=D.useRef(v);y.current=v;let b=D.useCallback(()=>{let e=Z(m.current);return Qe(e,qe(y.current,e,a,n))},[n,a]),x=D.useCallback(()=>m.current,[]),S=p(e=>{Ue(m.current.get(e.id)??null,e)||(m.current.set(e.id,e),g(e=>e+1))}),C=p(e=>{m.current.delete(e)&&g(e=>e+1)}),w=p(e=>{c(e)}),T=D.useCallback(e=>y.current===e,[]),E=D.useCallback((e,t,n,r)=>{let i=Ze(Q(m.current),e,t,n,r??a);return i?(i.element?.focus(),c(i.id),i):null},[a]),O=D.useCallback((e,t,n)=>({onFocus:e=>{t?.(e);let n=Q(m.current),r=et(n,e.target);r!==-1&&c(n[r].id)},onKeyDown:e=>{if(n?.(e),e.defaultPrevented||e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||!We.includes(e.key))return;let t=r===`horizontal`?`ArrowLeft`:`ArrowUp`,a=r===`horizontal`?`ArrowRight`:`ArrowDown`;r===`horizontal`&&i&&(t=`ArrowRight`,a=`ArrowLeft`);let s=Q(m.current),c=F(R(f.current)),l=c===f.current,u=Xe(s,c,y.current),d=`next`;switch(e.key){case t:d=`previous`,e.preventDefault(),l&&(u=s.length);break;case a:e.preventDefault(),l&&(u=-1);break;case`Home`:e.preventDefault(),u=-1;break;case`End`:e.preventDefault(),d=`previous`,u=s.length;break;default:return}E(u,d,o)},ref:it(e,e=>{f.current=e})}),[E,i,r,o]),k=D.useCallback(e=>{let t=Q(m.current),n=F(R(f.current)),r=n===f.current?-1:Xe(t,n,y.current);return E(r,`next`,!0,e)?.id??null},[E]);return D.useMemo(()=>({activeItemId:v,focusNext:k,getActiveItem:b,getContainerProps:O,getItemMap:x,isItemActive:T,registerItem:S,setActiveItemId:w,unregisterItem:C}),[v,k,b,O,x,T,S,w,C])}function Ke(e){let{activeItemId:t,registerItem:n,unregisterItem:r}=Ve(),i=D.useRef(null),a=D.useMemo(()=>({disabled:e.disabled??!1,element:null,focusableWhenDisabled:e.focusableWhenDisabled??!1,id:e.id,selected:e.selected??!1,textValue:e.textValue}),[e.disabled,e.focusableWhenDisabled,e.id,e.selected,e.textValue]),o=D.useRef(a);o.current=a;let s=D.useCallback(t=>{if(i.current=t,t==null){queueMicrotask(()=>{i.current??r(e.id)});return}n({...o.current,element:t})},[e.id,n,r]),c=f(e.ref,s);return h(()=>{i.current&&n({...a,element:i.current})},[a,n]),h(()=>{let t=e.id;return()=>{r(t)}},[e.id,r]),{ref:c,tabIndex:t===e.id?0:-1}}function qe(e,t,n,r){return e==null?Ye(t,n,r):Je(e,t,n)}function Je(e,t,n){let r=$e(t,e);return r===-1?X(t,n):n(t[r])?t[r].id:Ze(t,r,`next`,!1,n)?.id??null}function Ye(e,t,n){let r=n?.(e);if(r!=null){let n=Qe(e,r);if(n&&t(n))return n.id}return X(e,t)}function Xe(e,t,n){if(t){let n=et(e,t);if(n!==-1)return n}return $e(e,n)}function Ze(e,t,n,r,i){let a=e.length-1;if(a===-1)return null;let o=!1,s=tt(t,a,n,r),c=s;for(;s!==-1;){if(s===c){if(o)return null;o=!0}let t=e[s];if(!t||!i(t))s=tt(s,a,n,r);else return t}return null}function X(e,t){return e.find(e=>t(e))?.id??null}function Qe(e,t){return t==null?null:e.find(e=>e.id===t)??null}function $e(e,t){return t==null?-1:e.findIndex(e=>e.id===t)}function et(e,t){return t?e.findIndex(e=>e.element===t||e.element?.contains(t)):-1}function Z(e){let t=Array.from(e.values());if(t.every(e=>e.element==null))return t;let n=t.filter($).sort((e,t)=>
1rt(e.element,t.element)),r=t.filter(e=>!$(e));return[...n,...r]}function Q(e){return Z(e).filter($)}function tt(e,t,n,r=!0){return n===`next`?e===t?r?0:-1:e+1:e===0?r?t:-1:e-1}function nt(e){return e.element?e.focusableWhenDisabled?!0:!e.disabled&&!e.element.hasAttribute(`disabled`)&&e.element.getAttribute(`aria-disabled`)!==`true`&&e.element.hasAttribute(`tabindex`):!1}function $(e){return e.element!=null&&e.element.isConnected}function rt(e,t){if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function it(...e){return t=>{e.forEach(e=>{V(e??null,t)})}}export{R as C,A as D,N as E,j as O,z as S,P as T,H as _,Ve as a,ee as b,Oe as c,fe as d,de as f,ne as g,U as h,Be as i,be as l,ie as m,Ke as n,Y as o,se as p,Ge as r,Le as s,nt as t,K as u,te as v,L as w,B as x,V as y};

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.