PageSourceSearch

https://viem.sh/assets/dist-CAI68jx6.js

js viem.sh collected 2026-10-02 06:20:56 UTC 9,405 bytes, 1 lines download raw bytes

1import{c as e,d as t,h as n}from"./index-PiQp26Sx.js";import{C as r,c as i,dt as a,et as o,ft as s,it as c,k as l,lt as u,o as d,ot as f,rt as p,s as m,st as h,ut as g,y as _}from"./useOpenChangeComplete-BPOosvtI.js";import{t as v}from"./clsx-DBr6wyP7.js";var y=n(t(),1),b=`data-composite-item-active`;function x(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=m(),{ref:i,index:a}=l(e),o=n===a,s=y.useRef(null),c=h(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function S(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:C,platform:w,maxTouchPoints:T}=S(),E=C.toLowerCase(),D=w.toLowerCase(),O=/^i(os$|p)/.test(D)||D===`macintel`&&T>1,k=`android`,A=D===k||E.includes(k),j=!O&&D.startsWith(`mac`);D.startsWith(`win`),!A&&/^(linux|chrome os)/.test(D);var M=j||O,N=/jsdom|happydom/.test(E),P=`data-base-ui-focusable`,F=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,ee=`ArrowLeft`,te=`ArrowRight`,ne=`ArrowUp`,re=`ArrowDown`;function ie(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ae(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&r(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function I(e){return`composedPath`in e?e.composedPath()[0]:e.target}function oe(e){e.preventDefault(),e.stopPropagation()}function se(e){return`nativeEvent`in e}function ce(e){return e.pointerType===``&&e.isTrusted?!0:A&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function le(e){return N?!1:!A&&e.width===0&&e.height===0||A&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ue(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function de(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function L(e,t){return t<0||t>=e.length}function R(e,t){return B(e.current,{disabledIndices:t})}function z(e,t){return B(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function B(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&V(e,a,r));return a}function V(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?H(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function fe(e){return e.visibility===`hidden`||e.visibility===`collapse`}function H(e,t=e?i(e):null){return!e||!e.isConnected||!t||fe(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}function pe(e){return f(19)?e:e?`true`:void 0}function me(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var U=`ArrowUp`,W=`ArrowDown`,G=`ArrowLeft`,K=`ArrowRight`,q=`Home`,J=new Set([G,K]),he=new Set([G,K,q,`End`]),Y=new Set([U,W]),ge=new Set([U,W,q,`End`]),X=new Set([...J,...Y]),Z=new Set([...X,q,`End`]),_e=`Shift`,ve=new Set([_e,`Control`,`Alt`,`Meta`]);function ye(e){return _(e)&&e.tagName===`INPUT`}function be(e){return!!(ye(e)&&e.selectionStart!=null||_(e)&&e.tagName===`TEXTAREA`)}function xe(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Se(e,t,`left`),a=Q(e),o=Q(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Se(e,t,`top`),r=Q(e),i=Q(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Se(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Q(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||
10,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var Ce=[];function we(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:o,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:u,enableHomeAndEndKeys:d=!1,stopEventPropagation:f=!1,disabledIndices:p,modifierKeys:m=Ce}=e,[g,_]=y.useState(0),v=r!=null,b=y.useRef(null),x=h(b,u),S=y.useRef([]),C=y.useRef(!1),w=c??g,T=s((e,t=!1)=>{if((l??_)(e),t){let t=S.current[e];xe(b.current,t,o,n)}}),E=s(e=>{if(e.size===0||C.current)return;C.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?t.indexOf(r):-1;if(i!==-1)T(i);else if(V(t,w,p)){let e=B(t,{disabledIndices:p});L(t,e)||T(e)}xe(b.current,r,o,n)});a(()=>{if(p==null||c!=null||!C.current)return;let e=S.current;if(V(e,w,p)){let t=B(e,{disabledIndices:p});L(e,t)||T(t)}},[p,c,w,S,T]);let D=s((e,t,n)=>i?i(e,t,n,S):n),O=s(e=>{let a=d?Z:X;if(!a.has(e.key)||Te(e,m)||!b.current)return;let s=o===`rtl`,c=s?G:K,l={horizontal:c,vertical:W,both:c}[n],u=s?K:G,h={horizontal:u,vertical:U,both:u}[n],g=I(e.nativeEvent);if(g!=null&&be(g)&&!me(g)){let t=g.selectionStart,n=g.selectionEnd,r=g.value??``;if(t==null||e.shiftKey||t!==n||e.key!==h&&t<r.length||e.key!==l&&t>0)return}let _=w,y=R(S,p),x=z(S,p);r!=null&&(_=r({disabledIndices:p,elementsRef:S,event:e,highlightedIndex:w,loopFocus:t,maxIndex:x,minIndex:y,onLoop:D,orientation:n,rtl:s}));let C={horizontal:[c],vertical:[W],both:[c,W]}[n],E={horizontal:[u],vertical:[U],both:[u,U]}[n],O=v?a:{horizontal:d?he:J,vertical:d?ge:Y,both:a}[n];d&&(e.key===`Home`?_=y:e.key===`End`&&(_=x)),_===w&&(C.includes(e.key)||E.includes(e.key))&&(t&&_===x&&C.includes(e.key)?(_=y,i&&(_=i(e,w,_,S))):t&&_===y&&E.includes(e.key)?(_=x,i&&(_=i(e,w,_,S))):_=B(S.current,{startingIndex:_,decrement:E.includes(e.key),disabledIndices:p})),_!==w&&!L(S.current,_)&&(f&&e.stopPropagation(),O.has(e.key)&&e.preventDefault(),T(_,!0),queueMicrotask(()=>{S.current[_]?.focus()}))});return{props:{ref:x,onFocus(e){let t=b.current,n=I(e.nativeEvent);!t||n==null||!be(n)||n.setSelectionRange(0,n.value.length??0)},onKeyDown:O},highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:S,disabledIndices:p,onMapChange:E,relayKeyboardEvent:O}}function Te(e,t){for(let n of ve.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var Ee=e();function De(e){let{render:t,className:n,style:r,refs:i=p,props:a=p,state:s=c,stateAttributesMapping:l,highlightedIndex:f,onHighlightedIndexChange:m,orientation:h,grid:_,loopFocus:v,onLoop:b,enableHomeAndEndKeys:x,onMapChange:S,stopEventPropagation:C=!0,rootRef:w,disabledIndices:T,modifierKeys:E,highlightItemOnHover:D=!1,tag:O=`div`,...k}=e,{props:A,highlightedIndex:j,onHighlightedIndexChange:M,elementsRef:N,onMapChange:P,relayKeyboardEvent:F}=we({grid:_,loopFocus:v,onLoop:b,orientation:h,highlightedIndex:f,onHighlightedIndexChange:m,rootRef:w,stopEventPropagation:C,enableHomeAndEndKeys:x,direction:u(),disabledIndices:T,modifierKeys:E}),ee=o(O,e,{state:s,ref:i,props:[A,...a,k],stateAttributesMapping:l}),te=y.useMemo(()=>({highlightedIndex:j,onHighlightedIndexChange:M,highlightItemOnHover:D,relayKeyboardEvent:F}),[j,M,D,F]);return(0,Ee.jsx)(d.Provider,{value:te,children:(0,Ee.jsx)(g,{elementsRef:N,onMapChange:e=>{S?.(e),P(e)},children:ee})})}var Oe=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,$=v,ke=(e,t)=>n=>{if(t?.variants==null)return $(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Oe(t)||Oe(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return $(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};export{O as A,ee as C,F as D,P as E,E as M,x as N,N as O,b as P,re as S,ne as T,le as _,_e as a,ae as b,z as c,L as d,V as f,ce as g,se as h,Z as i,j,M as k,R as l,ue as m,$ as n,pe as o,de as p,De as r,B as s,ke as t,H as u,oe as v,te as w,I as x,ie 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.