File manager - Edit - /home/opticamezl/www/newok/focus-visible.zip
Back
PK �)�\L��&� � js/focus-visible.min.jsnu �[��� !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,function(){"use strict";function e(e){var t=!0,n=!1,o=null,d={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function i(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function u(e){t=!1}function a(){document.addEventListener("mousemove",c),document.addEventListener("mousedown",c),document.addEventListener("mouseup",c),document.addEventListener("pointermove",c),document.addEventListener("pointerdown",c),document.addEventListener("pointerup",c),document.addEventListener("touchmove",c),document.addEventListener("touchstart",c),document.addEventListener("touchend",c)}function c(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1,document.removeEventListener("mousemove",c),document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",c),document.removeEventListener("pointermove",c),document.removeEventListener("pointerdown",c),document.removeEventListener("pointerup",c),document.removeEventListener("touchmove",c),document.removeEventListener("touchstart",c),document.removeEventListener("touchend",c))}document.addEventListener("keydown",function(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=!0)},!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",function(e){"hidden"===document.visibilityState&&(n&&(t=!0),a())},!0),a(),e.addEventListener("focus",function(e){var n,o,u;i(e.target)&&(t||(n=e.target,o=n.type,"INPUT"===(u=n.tagName)&&d[o]&&!n.readOnly||"TEXTAREA"===u&&!n.readOnly||n.isContentEditable))&&s(e.target)},!0),e.addEventListener("blur",function(e){var t;i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(o),o=window.setTimeout(function(){n=!1},100),(t=e.target).hasAttribute("data-focus-visible-added")&&(t.classList.remove("focus-visible"),t.removeAttribute("data-focus-visible-added")))},!0),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}"undefined"!=typeof document&&e(document)}); //# sourceMappingURL=focus-visible.min.js.map PK �)�\�)~?� � js/focus-visible.min.js.gznu �[��� � �V�n�6}߯�X� Y�&�4�E��"u�EQ��8fV"r�a���b;��pD�̍3�f^g��f#_3}�I��3���Xt��%̔I�n�0��p��_����Ni3&��Ȑ_"��v�"���U��n~ ��M���(�it�T�<�e�B����(v l6��y� �j��-��A־�� �a,��z��{�]�:�t?��d"'�Ѩڪ����[E(�(M��|)%�N�ޓ(M!�F(�R������Y.��W�҃z�hJ��?�,�jC���R�madf2�oʩi���l'�<�Đ8�D������h(�IbB��>h�it����:'��h̠�2R�0o@����,t/�/�J�4��C�B������h|6�C^ ����e�m��5��¾ �&����!��4�f�V8`!]B@�ĶW�0��:�4vߛG�'���'�z{"���Gb{܆�W�wX6vm ��+���wX��:9�R�6�E�$"C���ɜRw0�̫8�����](w]v\�*�+\fs�_`�%�Wd���Ь6U:���LS�j�c�xk�`�D���=Ih[:6�� nnG��Lo�^�gIh�1�����$��|�/�JrJ�?�_J#�X�Q���L�Mn��7�u�ܭ��R���ې�Z4��c�{{h)���=�Og �2�BiiI���U����M�.8�nz�)� U|1���Ѽ7}�юe͕<��J?�6>�v�,!M�#!�{�}�:~������Zxx�S ��8�n�cM�ս��;��l�������;nk_�x�f��[� ��wfG��b|Q���K���a�f��L�y Wh�+L5,�ޡ)�,��l��pu��W��lr��.dB{��i��Di�� ��"|��W� R�2p6��W�O)lb�+~�����x��WQ�J�<?ݧ�4H ��W����?L��&� PK �)�\�����7 �7 js/focus-visible.min.js.mapnu �[��� {"version":3,"file":"focus-visible.min.js","sources":["../src/focus-visible.js"],"sourcesContent":["/**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-visible\n */\nfunction applyFocusVisiblePolyfill(scope) {\n var hadKeyboardEvent = true;\n var hadFocusVisibleRecently = false;\n var hadFocusVisibleRecentlyTimeout = null;\n\n var inputTypesAllowlist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n };\n\n /**\n * Helper function for legacy browsers and iframes which sometimes focus\n * elements like document, body, and non-interactive SVG.\n * @param {Element} el\n */\n function isValidFocusTarget(el) {\n if (\n el &&\n el !== document &&\n el.nodeName !== 'HTML' &&\n el.nodeName !== 'BODY' &&\n 'classList' in el &&\n 'contains' in el.classList\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} el\n * @return {boolean}\n */\n function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n\n if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !el.readOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Add the `focus-visible` class to the given element if it was not added by\n * the author.\n * @param {Element} el\n */\n function addFocusVisibleClass(el) {\n if (el.classList.contains('focus-visible')) {\n return;\n }\n el.classList.add('focus-visible');\n el.setAttribute('data-focus-visible-added', '');\n }\n\n /**\n * Remove the `focus-visible` class from the given element if it was not\n * originally added by the author.\n * @param {Element} el\n */\n function removeFocusVisibleClass(el) {\n if (!el.hasAttribute('data-focus-visible-added')) {\n return;\n }\n el.classList.remove('focus-visible');\n el.removeAttribute('data-focus-visible-added');\n }\n\n /**\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * Apply `focus-visible` to any current active element and keep track\n * of our keyboard modality state with `hadKeyboardEvent`.\n * @param {KeyboardEvent} e\n */\n function onKeyDown(e) {\n if (e.metaKey || e.altKey || e.ctrlKey) {\n return;\n }\n\n if (isValidFocusTarget(scope.activeElement)) {\n addFocusVisibleClass(scope.activeElement);\n }\n\n hadKeyboardEvent = true;\n }\n\n /**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n * @param {Event} e\n */\n function onPointerDown(e) {\n hadKeyboardEvent = false;\n }\n\n /**\n * On `focus`, add the `focus-visible` class to the target if:\n * - the target received focus as a result of keyboard navigation, or\n * - the event target is an element that will likely require interaction\n * via the keyboard (e.g. a text box)\n * @param {Event} e\n */\n function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleClass(e.target);\n }\n }\n\n /**\n * On `blur`, remove the `focus-visible` class from the target.\n * @param {Event} e\n */\n function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (\n e.target.classList.contains('focus-visible') ||\n e.target.hasAttribute('data-focus-visible-added')\n ) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {\n hadFocusVisibleRecently = false;\n }, 100);\n removeFocusVisibleClass(e.target);\n }\n }\n\n /**\n * If the user changes tabs, keep track of whether or not the previously\n * focused element had .focus-visible.\n * @param {Event} e\n */\n function onVisibilityChange(e) {\n if (document.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n addInitialPointerMoveListeners();\n }\n }\n\n /**\n * Add a group of listeners to detect usage of any pointing devices.\n * These listeners will be added when the polyfill first loads, and anytime\n * the window is blurred, so that they are active when the window regains\n * focus.\n */\n function addInitialPointerMoveListeners() {\n document.addEventListener('mousemove', onInitialPointerMove);\n document.addEventListener('mousedown', onInitialPointerMove);\n document.addEventListener('mouseup', onInitialPointerMove);\n document.addEventListener('pointermove', onInitialPointerMove);\n document.addEventListener('pointerdown', onInitialPointerMove);\n document.addEventListener('pointerup', onInitialPointerMove);\n document.addEventListener('touchmove', onInitialPointerMove);\n document.addEventListener('touchstart', onInitialPointerMove);\n document.addEventListener('touchend', onInitialPointerMove);\n }\n\n function removeInitialPointerMoveListeners() {\n document.removeEventListener('mousemove', onInitialPointerMove);\n document.removeEventListener('mousedown', onInitialPointerMove);\n document.removeEventListener('mouseup', onInitialPointerMove);\n document.removeEventListener('pointermove', onInitialPointerMove);\n document.removeEventListener('pointerdown', onInitialPointerMove);\n document.removeEventListener('pointerup', onInitialPointerMove);\n document.removeEventListener('touchmove', onInitialPointerMove);\n document.removeEventListener('touchstart', onInitialPointerMove);\n document.removeEventListener('touchend', onInitialPointerMove);\n }\n\n /**\n * When the polfyill first loads, assume the user is in keyboard modality.\n * If any event is received from a pointing device (e.g. mouse, pointer,\n * touch), turn off keyboard modality.\n * This accounts for situations where focus enters the page from the URL bar.\n * @param {Event} e\n */\n function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on <html> whenever the\n // window blurs, even if you're tabbing out of the page. ¯\\_(ツ)_/¯\n if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n }\n\n // For some kinds of state, we are interested in changes at the global scope\n // only. For example, global pointer input, global key presses and global\n // visibility change should affect the state at every scope:\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onPointerDown, true);\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('touchstart', onPointerDown, true);\n document.addEventListener('visibilitychange', onVisibilityChange, true);\n\n addInitialPointerMoveListeners();\n\n // For focus and blur, we specifically care about state changes in the local\n // scope. This is because focus / blur events that originate from within a\n // shadow root are not re-dispatched from the host element if it was already\n // the active element in its own scope:\n scope.addEventListener('focus', onFocus, true);\n scope.addEventListener('blur', onBlur, true);\n\n // We detect that a node is a ShadowRoot by ensuring that it is a\n // DocumentFragment and also has a host property. This check covers native\n // implementation and polyfill implementation transparently. If we only cared\n // about the native implementation, we could just check if the scope was\n // an instance of a ShadowRoot.\n if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n // have a root element to add a class to. So, we add this attribute to the\n // host element instead:\n scope.host.setAttribute('data-js-focus-visible', '');\n } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n document.documentElement.classList.add('js-focus-visible');\n document.documentElement.setAttribute('data-js-focus-visible', '');\n }\n}\n\n// It is important to wrap all references to global window and document in\n// these checks to support server-side rendering use cases\n// @see https://github.com/WICG/focus-visible/issues/199\nif (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // Make the polyfill helper globally available. This can be used as a signal\n // to interested libraries that wish to coordinate with the polyfill for e.g.,\n // applying the polyfill to a shadow root:\n window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;\n\n // Notify interested libraries of the polyfill's presence, in case the\n // polyfill was loaded lazily:\n var event;\n\n try {\n event = new CustomEvent('focus-visible-polyfill-ready');\n } catch (error) {\n // IE11 does not support using CustomEvent as a constructor directly:\n event = document.createEvent('CustomEvent');\n event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n }\n\n window.dispatchEvent(event);\n}\n\nif (typeof document !== 'undefined') {\n // Apply the polyfill to the global document, so that no JavaScript\n // coordination is required to use the polyfill in the top-level document:\n applyFocusVisiblePolyfill(document);\n}\n"],"names":["applyFocusVisiblePolyfill","scope","hadKeyboardEvent","hadFocusVisibleRecently","hadFocusVisibleRecentlyTimeout","inputTypesAllowlist","text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local","isValidFocusTarget","el","document","nodeName","classList","addFocusVisibleClass","contains","add","setAttribute","onPointerDown","e","addInitialPointerMoveListeners","addEventListener","onInitialPointerMove","target","toLowerCase","removeEventListener","metaKey","altKey","ctrlKey","activeElement","visibilityState","type","tagName","readOnly","isContentEditable","hasAttribute","window","clearTimeout","setTimeout","remove","removeAttribute","nodeType","Node","DOCUMENT_FRAGMENT_NODE","host","DOCUMENT_NODE","documentElement","event","CustomEvent","error","createEvent","initCustomEvent","dispatchEvent"],"mappings":"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"}PK �)�\O��, �, js/focus-visible.jsnu �[��� (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory() : typeof define === 'function' && define.amd ? define(factory) : (factory()); }(this, (function () { 'use strict'; /** * Applies the :focus-visible polyfill at the given scope. * A scope in this case is either the top-level Document or a Shadow Root. * * @param {(Document|ShadowRoot)} scope * @see https://github.com/WICG/focus-visible */ function applyFocusVisiblePolyfill(scope) { var hadKeyboardEvent = true; var hadFocusVisibleRecently = false; var hadFocusVisibleRecentlyTimeout = null; var inputTypesAllowlist = { text: true, search: true, url: true, tel: true, email: true, password: true, number: true, date: true, month: true, week: true, time: true, datetime: true, 'datetime-local': true }; /** * Helper function for legacy browsers and iframes which sometimes focus * elements like document, body, and non-interactive SVG. * @param {Element} el */ function isValidFocusTarget(el) { if ( el && el !== document && el.nodeName !== 'HTML' && el.nodeName !== 'BODY' && 'classList' in el && 'contains' in el.classList ) { return true; } return false; } /** * Computes whether the given element should automatically trigger the * `focus-visible` class being added, i.e. whether it should always match * `:focus-visible` when focused. * @param {Element} el * @return {boolean} */ function focusTriggersKeyboardModality(el) { var type = el.type; var tagName = el.tagName; if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) { return true; } if (tagName === 'TEXTAREA' && !el.readOnly) { return true; } if (el.isContentEditable) { return true; } return false; } /** * Add the `focus-visible` class to the given element if it was not added by * the author. * @param {Element} el */ function addFocusVisibleClass(el) { if (el.classList.contains('focus-visible')) { return; } el.classList.add('focus-visible'); el.setAttribute('data-focus-visible-added', ''); } /** * Remove the `focus-visible` class from the given element if it was not * originally added by the author. * @param {Element} el */ function removeFocusVisibleClass(el) { if (!el.hasAttribute('data-focus-visible-added')) { return; } el.classList.remove('focus-visible'); el.removeAttribute('data-focus-visible-added'); } /** * If the most recent user interaction was via the keyboard; * and the key press did not include a meta, alt/option, or control key; * then the modality is keyboard. Otherwise, the modality is not keyboard. * Apply `focus-visible` to any current active element and keep track * of our keyboard modality state with `hadKeyboardEvent`. * @param {KeyboardEvent} e */ function onKeyDown(e) { if (e.metaKey || e.altKey || e.ctrlKey) { return; } if (isValidFocusTarget(scope.activeElement)) { addFocusVisibleClass(scope.activeElement); } hadKeyboardEvent = true; } /** * If at any point a user clicks with a pointing device, ensure that we change * the modality away from keyboard. * This avoids the situation where a user presses a key on an already focused * element, and then clicks on a different element, focusing it with a * pointing device, while we still think we're in keyboard modality. * @param {Event} e */ function onPointerDown(e) { hadKeyboardEvent = false; } /** * On `focus`, add the `focus-visible` class to the target if: * - the target received focus as a result of keyboard navigation, or * - the event target is an element that will likely require interaction * via the keyboard (e.g. a text box) * @param {Event} e */ function onFocus(e) { // Prevent IE from focusing the document or HTML element. if (!isValidFocusTarget(e.target)) { return; } if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) { addFocusVisibleClass(e.target); } } /** * On `blur`, remove the `focus-visible` class from the target. * @param {Event} e */ function onBlur(e) { if (!isValidFocusTarget(e.target)) { return; } if ( e.target.classList.contains('focus-visible') || e.target.hasAttribute('data-focus-visible-added') ) { // To detect a tab/window switch, we look for a blur event followed // rapidly by a visibility change. // If we don't see a visibility change within 100ms, it's probably a // regular focus change. hadFocusVisibleRecently = true; window.clearTimeout(hadFocusVisibleRecentlyTimeout); hadFocusVisibleRecentlyTimeout = window.setTimeout(function() { hadFocusVisibleRecently = false; }, 100); removeFocusVisibleClass(e.target); } } /** * If the user changes tabs, keep track of whether or not the previously * focused element had .focus-visible. * @param {Event} e */ function onVisibilityChange(e) { if (document.visibilityState === 'hidden') { // If the tab becomes active again, the browser will handle calling focus // on the element (Safari actually calls it twice). // If this tab change caused a blur on an element with focus-visible, // re-apply the class when the user switches back to the tab. if (hadFocusVisibleRecently) { hadKeyboardEvent = true; } addInitialPointerMoveListeners(); } } /** * Add a group of listeners to detect usage of any pointing devices. * These listeners will be added when the polyfill first loads, and anytime * the window is blurred, so that they are active when the window regains * focus. */ function addInitialPointerMoveListeners() { document.addEventListener('mousemove', onInitialPointerMove); document.addEventListener('mousedown', onInitialPointerMove); document.addEventListener('mouseup', onInitialPointerMove); document.addEventListener('pointermove', onInitialPointerMove); document.addEventListener('pointerdown', onInitialPointerMove); document.addEventListener('pointerup', onInitialPointerMove); document.addEventListener('touchmove', onInitialPointerMove); document.addEventListener('touchstart', onInitialPointerMove); document.addEventListener('touchend', onInitialPointerMove); } function removeInitialPointerMoveListeners() { document.removeEventListener('mousemove', onInitialPointerMove); document.removeEventListener('mousedown', onInitialPointerMove); document.removeEventListener('mouseup', onInitialPointerMove); document.removeEventListener('pointermove', onInitialPointerMove); document.removeEventListener('pointerdown', onInitialPointerMove); document.removeEventListener('pointerup', onInitialPointerMove); document.removeEventListener('touchmove', onInitialPointerMove); document.removeEventListener('touchstart', onInitialPointerMove); document.removeEventListener('touchend', onInitialPointerMove); } /** * When the polfyill first loads, assume the user is in keyboard modality. * If any event is received from a pointing device (e.g. mouse, pointer, * touch), turn off keyboard modality. * This accounts for situations where focus enters the page from the URL bar. * @param {Event} e */ function onInitialPointerMove(e) { // Work around a Safari quirk that fires a mousemove on <html> whenever the // window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯ if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') { return; } hadKeyboardEvent = false; removeInitialPointerMoveListeners(); } // For some kinds of state, we are interested in changes at the global scope // only. For example, global pointer input, global key presses and global // visibility change should affect the state at every scope: document.addEventListener('keydown', onKeyDown, true); document.addEventListener('mousedown', onPointerDown, true); document.addEventListener('pointerdown', onPointerDown, true); document.addEventListener('touchstart', onPointerDown, true); document.addEventListener('visibilitychange', onVisibilityChange, true); addInitialPointerMoveListeners(); // For focus and blur, we specifically care about state changes in the local // scope. This is because focus / blur events that originate from within a // shadow root are not re-dispatched from the host element if it was already // the active element in its own scope: scope.addEventListener('focus', onFocus, true); scope.addEventListener('blur', onBlur, true); // We detect that a node is a ShadowRoot by ensuring that it is a // DocumentFragment and also has a host property. This check covers native // implementation and polyfill implementation transparently. If we only cared // about the native implementation, we could just check if the scope was // an instance of a ShadowRoot. if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) { // Since a ShadowRoot is a special kind of DocumentFragment, it does not // have a root element to add a class to. So, we add this attribute to the // host element instead: scope.host.setAttribute('data-js-focus-visible', ''); } else if (scope.nodeType === Node.DOCUMENT_NODE) { document.documentElement.classList.add('js-focus-visible'); document.documentElement.setAttribute('data-js-focus-visible', ''); } } // It is important to wrap all references to global window and document in // these checks to support server-side rendering use cases // @see https://github.com/WICG/focus-visible/issues/199 if (typeof window !== 'undefined' && typeof document !== 'undefined') { // Make the polyfill helper globally available. This can be used as a signal // to interested libraries that wish to coordinate with the polyfill for e.g., // applying the polyfill to a shadow root: window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill; // Notify interested libraries of the polyfill's presence, in case the // polyfill was loaded lazily: var event; try { event = new CustomEvent('focus-visible-polyfill-ready'); } catch (error) { // IE11 does not support using CustomEvent as a constructor directly: event = document.createEvent('CustomEvent'); event.initCustomEvent('focus-visible-polyfill-ready', false, false, {}); } window.dispatchEvent(event); } if (typeof document !== 'undefined') { // Apply the polyfill to the global document, so that no JavaScript // coordination is required to use the polyfill in the top-level document: applyFocusVisiblePolyfill(document); } }))); PK �)�\���( ( LICENSE.mdnu �[��� All Reports in this Repository are licensed by Contributors under the [W3C Software and Document License](http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document). Contributions to Specifications are made under the [W3C CLA](https://www.w3.org/community/about/agreements/cla/). PK �)�\L��&� � js/focus-visible.min.jsnu �[��� PK �)�\�)~?� � 2 js/focus-visible.min.js.gznu �[��� PK �)�\�����7 �7 j js/focus-visible.min.js.mapnu �[��� PK �)�\O��, �, �H js/focus-visible.jsnu �[��� PK �)�\���( ( �u LICENSE.mdnu �[��� PK � 7w
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings