PageSourceSearch

https://shipping-explorer-production.up.railway.app/static/js/useFocusRing.Ch5Orgk4.js

js shipping-explorer-production.up.railway.app collected 2026-10-03 12:15:08 UTC 7,942 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{J as n,Pt as r,U as i,X as a,Y as o,Z as s,ft as c,it as l,kt as u,lt as d,mt as f,pt as p,q as ee,tt as te,ut as m}from"./StreamlitMarkdown.Dt4WoAEs.js";function h(e){return e.pointerType===``&&e.isTrusted?!0:a()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function g(e){return!a()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}var _=e(t(),1),v=(0,_.createContext)({isNative:!0,open:x,useHref:e=>e});function y(){return(0,_.useContext)(v)}function ne(e,t){let n=e.getAttribute(`target`);return(!n||n===`_self`)&&e.origin===location.origin&&!e.hasAttribute(`download`)&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey}function b(e,t,r=!0){let{metaKey:i,ctrlKey:a,altKey:c,shiftKey:l}=t;s()&&window.event?.type?.startsWith(`key`)&&e.target===`_blank`&&(o()?i=!0:a=!0);let u=ee()&&o()&&!n()?new KeyboardEvent(`keydown`,{keyIdentifier:`Enter`,metaKey:i,ctrlKey:a,altKey:c,shiftKey:l}):new MouseEvent(`click`,{metaKey:i,ctrlKey:a,altKey:c,shiftKey:l,detail:1,bubbles:!0,cancelable:!0});b.isOpening=r,f(e),e.dispatchEvent(u),b.isOpening=!1}b.isOpening=!1;function re(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute(`data-href`)){let n=document.createElement(`a`);n.href=e.getAttribute(`data-href`),e.hasAttribute(`data-target`)&&(n.target=e.getAttribute(`data-target`)),e.hasAttribute(`data-rel`)&&(n.rel=e.getAttribute(`data-rel`)),e.hasAttribute(`data-download`)&&(n.download=e.getAttribute(`data-download`)),e.hasAttribute(`data-ping`)&&(n.ping=e.getAttribute(`data-ping`)),e.hasAttribute(`data-referrer-policy`)&&(n.referrerPolicy=e.getAttribute(`data-referrer-policy`)),e.appendChild(n),t(n),e.removeChild(n)}}function x(e,t){re(e,e=>b(e,t))}function ie(e){let t=y().useHref(e?.href??``),n={};if(e)for(let r of[`href`,`target`,`rel`,`download`,`ping`,`referrerPolicy`])r in e&&(n[r]=r===`href`?t:e[r]);return n}function S(e,t,n,r){!t.isNative&&e.currentTarget instanceof HTMLAnchorElement&&e.currentTarget.href&&!e.isDefaultPrevented()&&ne(e.currentTarget,e)&&n&&(e.preventDefault(),t.open(e.currentTarget,e,n,r))}var C=null,w=new Set,T=new Map,E=!1,D=!1,ae={Tab:!0,Escape:!0};function O(e,t){for(let n of w)n(e,t)}function k(e){return!(e.metaKey||!o()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function A(e){E=!0,!b.isOpening&&k(e)&&(C=`keyboard`,O(`keyboard`,e))}function j(e){C=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(E=!0,O(`pointer`,e))}function M(e){!b.isOpening&&h(e)&&(E=!0,C=`virtual`)}function N(e){let t=p(m(e)),n=c(m(e));m(e)===t||m(e)===n||l||!e.isTrusted||(!E&&!D&&(C=`virtual`,O(`virtual`,e)),E=!1,D=!1)}function P(){l||(E=!1,D=!0)}function F(e){if(typeof window>`u`||typeof document>`u`)return;let t=p(e),n=c(e);if(T.get(t))return;let r=t.HTMLElement.prototype.focus;Reflect.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:function(){E=!0,r.apply(this,arguments)}}),n.addEventListener(`keydown`,A,!0),n.addEventListener(`keyup`,A,!0),n.addEventListener(`click`,M,!0),t.addEventListener(`focus`,N,!0),t.addEventListener(`blur`,P,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,j,!0),n.addEventListener(`pointermove`,j,!0),n.addEventListener(`pointerup`,j,!0)),t.addEventListener(`beforeunload`,()=>{I(e)},{once:!0}),T.set(t,{focus:r})}var I=(e,t)=>{let n=p(e),r=c(e);t&&r.removeEventListener(`DOMContentLoaded`,t),T.has(n)&&(Reflect.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:T.get(n).focus}),r.removeEventListener(`keydown`,A,!0),r.removeEventListener(`keyup`,A,!0),r.removeEventListener(`click`,M,!0),n.removeEventListener(`focus`,N,!0),n.removeEventListener(`blur`,P,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,j,!0),r.removeEventListener(`pointermove`,j,!0),r.removeEventListener(`pointerup`,j,!0)),T.delete(n))};function oe(e){let t=c(e),n;return t.readyState===`loading`?(n=()=>{F(e)},t.addEventListener(`DOMContentLoaded`,n)):F(e),()=>I(e,n)}typeof document<`u`&&oe();function L(){return C!==`pointer`}function R(){return C}function z(e){C=e,O(e,null)}var B=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);
1function V(e,t,n){let r=n?m(n):void 0,i=c(r),a=p(r),o=a===void 0?HTMLInputElement:a.HTMLInputElement,s=a===void 0?HTMLTextAreaElement:a.HTMLTextAreaElement,l=a===void 0?HTMLElement:a.HTMLElement,u=a===void 0?KeyboardEvent:a.KeyboardEvent,f=d(i);return e=e||f instanceof o&&!B.has(f.type)||f instanceof s||f instanceof l&&f.isContentEditable,!(e&&t===`keyboard`&&n instanceof u&&!ae[n.key])}function H(e,t,n){F(),(0,_.useEffect)(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{V(!!n?.isTextInput,t,r)&&e(L())};return w.add(t),()=>{w.delete(t)}},t)}var U=new Map,W=new Set;function G(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=m(t);if(!e(t)||!r)return;let i=U.get(r);i||(i=new Set,U.set(r,i),r.addEventListener(`transitioncancel`,n,{once:!0})),i.add(t.propertyName)},n=t=>{let r=m(t);if(!e(t)||!r)return;let i=U.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),U.delete(r)),U.size===0)){for(let e of W)e();W.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,G):G());function K(){for(let[e]of U)`isConnected`in e&&!e.isConnected&&U.delete(e)}function q(e){requestAnimationFrame(()=>{K(),U.size===0?e():W.add(e)})}function J(e){if(!e.isConnected)return;let t=c(e);if(R()===`virtual`){let n=d(t);q(()=>{let r=d(t);(r===n||r===t.body)&&e.isConnected&&f(e)})}else f(e)}function Y(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e,a=(0,_.useCallback)(e=>{if(m(e)===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),o=te(a),s=(0,_.useCallback)(e=>{let t=m(e),r=c(t),a=r?d(r):d();t===e.currentTarget&&t===a&&(n&&n(e),i&&i(!0),o(e))},[i,n,o]);return{focusProps:{onFocus:!t&&(n||i||r)?s:void 0,onBlur:!t&&(r||i)?a:void 0}}}function X(e){if(!e)return;let t=!0;return n=>{e({...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1,typeof n.continuePropagation==`function`&&n.continuePropagation()},isPropagationStopped(){return t}}),t&&n.stopPropagation()}}function Z(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:X(e.onKeyDown),onKeyUp:X(e.onKeyUp)}}}function Q(e,t){r(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}var $=_.createContext(null);function se(e){let t=(0,_.useContext)($)||{};Q(t,e);let{ref:n,...r}=t;return r}function ce(e,t){let{focusProps:n}=Y(e),{keyboardProps:r}=Z(e),i=u(n,r),a=se(t),o=e.isDisabled?{}:a,s=(0,_.useRef)(e.autoFocus);(0,_.useEffect)(()=>{s.current&&t.current&&J(t.current),s.current=!1},[t]);let c=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(c=void 0),{focusableProps:u({...i,tabIndex:c},o)}}function le(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,a=(0,_.useRef)({isFocused:!1,isFocusVisible:t||L()}),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(()=>a.current.isFocused&&a.current.isFocusVisible),u=(0,_.useCallback)(()=>l(a.current.isFocused&&a.current.isFocusVisible),[]),d=(0,_.useCallback)(e=>{a.current.isFocused=e,a.current.isFocusVisible=L(),s(e),u()},[u]);H(e=>{a.current.isFocusVisible=e,u()},[n,o],{enabled:o,isTextInput:n});let{focusProps:f}=Y({isDisabled:r,onFocusChange:d}),{focusWithinProps:p}=i({isDisabled:!r,onFocusWithinChange:d});return{isFocused:o,isFocusVisible:c,focusProps:r?p:f}}export{h as _,Z as a,q as c,L as d,S as f,g,y as h,Q as i,R as l,b as m,ce as n,Y as o,ie as p,$ as r,J as s,le as t,z as u};

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.