Module 885714

2,993 characters · in 68925.4de164704c201108.js
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,r){"use strict";let n;r.d(t,{Cl:()=>T,K7:()=>A,ME:()=>k,lb:()=>C,pP:()=>S});var i=r(89494),o=r(408713),a=r(23975),s=r(297987),l=r(64700),u=r(341221);let c=null,f=new Set,d=new Map,p=!1,h=!1,m={Tab:!0,Escape:!0};function g(e,t){for(let r of f)r(e,t)}function v(e){p=!0,e.metaKey||!(0,o.cX)()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(c="keyboard",g("keyboard",e))}function y(e){c="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(p=!0,g("pointer",e))}function b(e){(0,a.Y)(e)&&(p=!0,c="virtual")}function w(e){e.target!==window&&e.target!==document&&!i.lR&&e.isTrusted&&(p||h||(c="virtual",g("virtual",e)),p=!1,h=!1)}function _(){i.lR||(p=!1,h=!0)}function x(e){if("u"<typeof window||"u"<typeof document||d.get((0,s.mD)(e)))return;let t=(0,s.mD)(e),r=(0,s.TW)(e),n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){p=!0,n.apply(this,arguments)},r.addEventListener("keydown",v,!0),r.addEventListener("keyup",v,!0),r.addEventListener("click",b,!0),t.addEventListener("focus",w,!0),t.addEventListener("blur",_,!1),"u">typeof PointerEvent&&(r.addEventListener("pointerdown",y,!0),r.addEventListener("pointermove",y,!0),r.addEventListener("pointerup",y,!0)),t.addEventListener("beforeunload",()=>{E(e)},{once:!0}),d.set(t,{focus:n})}let E=(e,t)=>{let r=(0,s.mD)(e),n=(0,s.TW)(e);t&&n.removeEventListener("DOMContentLoaded",t),d.has(r)&&(r.HTMLElement.prototype.focus=d.get(r).focus,n.removeEventListener("keydown",v,!0),n.removeEventListener("keyup",v,!0),n.removeEventListener("click",b,!0),r.removeEventListener("focus",w,!0),r.removeEventListener("blur",_,!1),"u">typeof PointerEvent&&(n.removeEventListener("pointerdown",y,!0),n.removeEventListener("pointermove",y,!0),n.removeEventListener("pointerup",y,!0)),d.delete(r))};function S(){return"pointer"!==c}function k(){return c}function T(e){c=e,g(e,null)}function C(){x();let[e,t]=(0,l.useState)(c);return(0,l.useEffect)(()=>{let e=()=>{t(c)};return f.add(e),()=>{f.delete(e)}},[]),(0,u.wR)()?null:e}"u">typeof document&&("loading"!==(n=(0,s.TW)(void 0)).readyState?x(void 0):n.addEventListener("DOMContentLoaded",()=>{x(void 0)}));let P=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function A(e,t,r){x(),(0,l.useEffect)(()=>{let t=(t,n)=>{var i;let o,a,l,u,c;i=!!(null==r?void 0:r.isTextInput),o=(0,s.TW)(null==n?void 0:n.target),a="u">typeof window?(0,s.mD)(null==n?void 0:n.target).HTMLInputElement:HTMLInputElement,l="u">typeof window?(0,s.mD)(null==n?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,u="u">typeof window?(0,s.mD)(null==n?void 0:n.target).HTMLElement:HTMLElement,c="u">typeof window?(0,s.mD)(null==n?void 0:n.target).KeyboardEvent:KeyboardEvent,(i=i||o.activeElement instanceof a&&!P.has(o.activeElement.type)||o.activeElement instanceof l||o.activeElement instanceof u&&o.activeElement.isContentEditable)&&"keyboard"===t&&n instanceof c&&!m[n.key]||e(S())};return f.add(t),()=>{f.delete(t)}},t)}}