PageSourceSearch

https://cdn.shopify.com/shopifycloud/world/brochure/production-blog/assets/useFocusTrap-DlZMxa35.js

js shopify.com collected 2026-10-01 03:15:04 UTC 1,265 bytes, 2 lines download raw bytes

1import{H as e,z as t}from"./chunk-62JRHF6Z-CS0B5gRj.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=(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])},a=`a, button, textarea, input, select, [tabindex], [contenteditable], iframe`,o=(e,t=!1,o=a)=>{let[s,c]=(0,n.useState)([]),l=(0,n.useCallback)(()=>{e?.current&&c([...e.current.querySelectorAll(o)].filter(e=>!e.hasAttribute(`tabindex`)||e.getAttribute(`tabindex`)!==`-1`))},[e,o]);(0,n.useEffect)(()=>{l()},[e,t,l]),i(e,()=>{l()},{childList:!0,subtree:!0});let u=s[0],d=s[s.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(o)].filter(e=>!e.hasAttribute(`tabindex`)||e.getAttribute(`tabindex`)!==`-1`);t.length>0?t[0].focus():u.focus()}}};return r(`Tab`,e=>t&&f(e)),s};export{o as n,r,a as t};
2//# sourceMappingURL=useFocusTrap-DlZMxa35.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.