PageSourceSearch

https://cdn.shopify.com/shopifycloud/world/brochure/production-homepage/assets/useFocusTrap-DSQqHZ9F.js

js shopify.com collected 2026-09-24 03:05:02 UTC 1,695 bytes, 2 lines download raw bytes

1import{I as e,N as t}from"./chunk-62JRHF6Z-D3Q3NlnB.js";var n=e(t(),1),r=(e,t)=>{(0,n.useEffect)(()=>{let n=n=>{n.key===e&&t(n)};return document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`keydown`,n)}},[e,t])},i=`dev_window`;function a(){let[e,t]=(0,n.useState)(!0),[r,a]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(i);try{e===`off`?(localStorage.setItem(i,`off`),t(!1)):e===`on`?(localStorage.setItem(i,`on`),t(!0)):t(localStorage.getItem(`dev_window`)!==`off`)}catch(e){console.warn(`Failed to access localStorage for ${i}:`,e),t(!1)}a(!0)},[]),{ready:r,override:e}}var o=(e,t,r)=>{(0,n.useEffect)(()=>{if(!e?.current)return;let n=typeof r==`function`?r():r,i=new MutationObserver(t);return Array.isArray(e.current)?e.current.forEach(e=>{e&&i.observe(e,n)}):e.current&&i.observe(e.current,n),()=>{i.disconnect()}},[e,t,r])},s=`a, button, textarea, input, select, [tabindex], [contenteditable], iframe`,c=(e,t=!1,i=s)=>{let[a,c]=(0,n.useState)([]),l=(0,n.useCallback)(()=>{e?.current&&c([...e.current.querySelectorAll(i)].filter(e=>!e.hasAttribute(`tabindex`)||e.getAttribute(`tabindex`)!==`-1`))},[e,i]);(0,n.useEffect)(()=>
1{l()},[e,t,l]),o(e,()=>{l()},{childList:!0,subtree:!0});let u=a[0],d=a[a.length-1],f=e=>{if(!(!u||!d)){if(e.shiftKey)document.activeElement===u&&(e.preventDefault(),d.focus());else if(document.activeElement===d){e.preventDefault();let t=[...d.querySelectorAll(i)].filter(e=>!e.hasAttribute(`tabindex`)||e.getAttribute(`tabindex`)!==`-1`);t.length>0?t[0].focus():u.focus()}}};return r(`Tab`,e=>t&&f(e)),a};export{r as i,i as n,a as r,c as t};
2//# sourceMappingURL=useFocusTrap-DSQqHZ9F.js.map

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.