PageSourceSearch

https://www.kinderclothdiapers.com/cdn/shop/t/59/assets/focus.js?v=55611277788357068411758199273

js kinderclothdiapers.com collected 2026-10-08 20:34:35 UTC 1,613 bytes, 6 lines download raw bytes

1const trapFocusHandlers={};function getFocusableElements(container){return Array.from(container.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe"))}
2export function trapFocus(container){removeTrapFocus();const focusable=getFocusableElements(container);if(!focusable.length){return}
3const first=focusable[0];const last=focusable[focusable.length-1];trapFocusHandlers.keydown=(event)=>{if(event.key!=='Tab')return;const activeEl=document.activeElement;if(!event.shiftKey&&activeEl===last){event.preventDefault();first?.focus()}else if(event.shiftKey&&(activeEl===first||activeEl===container)){event.preventDefault();last?.focus()}};trapFocusHandlers.focusin=(event)=>{if(event.target instanceof Node&&!container.contains(event.target)){event.stopPropagation();first?.focus()}};document.addEventListener('keydown',trapFocusHandlers.keydown,!0);document.addEventListener('focusin',trapFocusHandlers.focusin,!0);container.focus()}
4export function removeTrapFocus(){trapFocusHandlers.keydown&&document.removeEventListener('keydown',trapFocusHandlers.keydown,!0);trapFocusHandlers.focusin&&document.removeEventListener('focusin',trapFocusHandlers.focusin,!0)}
5export function cycleFocus(items,increment){const currentIndex=items.findIndex((item)=>item.matches(':focus'));let targetIndex=currentIndex+increment;if(targetIndex>=items.length){targetIndex=0}else if(targetIndex<0){targetIndex=items.length-1}
6const targetItem=items[targetIndex];if(!targetItem)return;targetItem.focus()}

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.