PageSourceSearch

https://fnpr.ru/bitrix/js/ui/a11y/dist/a11y.bundle.min.js?178852414132543

js fnpr.ru collected 2026-09-25 02:33:02 UTC 32,543 bytes, 2 lines download raw bytes

1this.BX=this.BX||{};this.BX.UI=this.BX.UI||{};(function(t,e){"use strict";const s=["a[href]","input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]:not([disabled]):not([hidden])"];const i=s.join(",");const n=!e.Type.isUndefined(window.Element)&&"checkVisibility"in window.Element.prototype;const o=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);const r=new Set(["button","checkbox","file","hidden","image","radio","range","reset","submit"]);class a{static isDisabled(t){return e.Type.isElementNode(t)&&(t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true")}static isTextInput(t){if(!e.Type.isElementNode(t)){return false}if(t.tagName==="INPUT"){return!o.has(t.type)}return t.tagName==="TEXTAREA"||t.isContentEditable}static isEditable(t){if(!e.Type.isElementNode(t)){return false}if(t.tagName==="INPUT"){return!r.has(t.type)}return t.tagName==="TEXTAREA"||t.tagName==="SELECT"||t.isContentEditable}static isVisible(t){if(!e.Type.isElementNode(t)||!t.isConnected){return false}if(n){return t.checkVisibility({visibilityProperty:true,opacityProperty:true})}const s=t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0;return s&&getComputedStyle(t).visibility==="visible"}static isTabbable(t){if(!this.isFocusable(t)){return false}return!this.hasNegativeTabIndex(t)}static hasNegativeTabIndex(t){const e=t?.getAttribute("tabindex");if(e===null){return false}return Number.parseInt(e,10)<0}static isFocusable(t){if(!e.Type.isElementNode(t)||t.closest("[inert]")||!t.isConnected){return false}return t.matches(i)&&this.isVisible(t)}}const c="bx:a11y:debug";const l="*";const u={"focus-monitor":"FocusMonitor","focus-trap":"FocusTrap","focus-zone":"FocusZone","input-modality":"InputModality","live-announcer":"LiveAnnouncer"};class d{static#t=new Set;static#e=false;static#s=false;static#i(){if(this.#s){return}this.#s=true;try{const t=localStorage.getItem(c);if(t===l){this.#e=true}else if(t){const e=JSON.parse(t);if(Array.isArray(e)){for(const t of e){this.#t.add(t)}}}}catch{}}static enable(t){this.#i();if(t){this.#t.add(t)}else{this.#e=true}this.#n()}static disable(t){this.#i();if(t){this.#t.delete(t)}else{this.#e=false;this.#t.clear()}this.#n()}static isEnabled(t){this.#i();return this.#e||this.#t.has(t)}static log(t,e,...s){if(!this.isEnabled(t)){return}const i=u[t]||t;console.log(`%c[${i}]%c ${e}`,"color: #0075ff; font-weight: bold;","color: inherit; font-weight: normal;",...s)}static logNode(t,s,i){if(!this.isEnabled(t)||!e.Type.isElementNode(i)){return}const n=i.tagName.toLowerCase();const o=i.className?`.${[...i.classList].join(".")}`:"";const r=i.id?`#${i.id}`:"";const a=`${n}${o}${r}`;const c=i.getAttribute("role");const l=i.getAttribute("aria-labelledby");const d=l?l.split(/\s+/).map((t=>document.getElementById(t)?.textContent?.trim())).filter(Boolean).join(" "):"";const h=(i.getAttribute("aria-label")||d||i.textContent.trim().slice(0,30)||"\u2014").replaceAll(/\s+/g," ");const f=[c&&`role="${c}"`,i.getAttribute("aria-expanded")!==null&&`aria-expanded="${i.getAttribute("aria-expanded")}"`,i.getAttribute("href")&&`href="${i.getAttribute("href")}"`,i.getAttribute("tabindex")&&`tabindex="${i.getAttribute("tabindex")}"`].filter(Boolean).join(" ");const m=u[t]||t;const p=[`%c[${m}]%c ${s}`,`%c${a}%c`,`"%c${h}%c"`,f&&`%c${f}%c`].filter(Boolean).join(" ");console.log(p,"color: #0075ff; font-weight: bold;","color: inherit; font-weight: normal;","color: #0075ff; font-weight: bold;","color: inherit; font-weight: normal;","color: #e36209; font-style: italic;","color: inherit; font-style: normal;",...f?["color: #9b59b6;","color: inherit;"]:[])}static warn(t,e,...s){if(!this.isEnabled(t)){return}const i=u[t]||t;console.warn(`[${i}] ${e}`,...s)}static#n(){try{if(this.#e){localStorage.setItem(c,l)}else if(this.#t.size>0){localStorage.setItem(c,JSON.stringify([...this.#t]))}else{localStorage.removeItem(c)}}catch{}}}const h="a11y:restore-focus";class f{static get FOCUSABLE_SELECTOR(){return i}static isFocusLost(t){const e=this.getActiveElement(t);return e===null||e.tagName==="BODY"}static getFirst(t,e){return this.#o(t,"first",e)}static getLast(t,e){return this.#o(t,"last",e)}
1static getNext(t,e){return this.#o(t,"next",e)}static getPrevious(t,e){return this.#o(t,"previous",e)}static focusFirst(t,e){return this.focusTarget(this.#o(t,"first",e),e)}static focusLast(t,e){return this.focusTarget(this.#o(t,"last",e),e)}static focusNext(t,e){return this.focusTarget(this.#o(t,"next",e),e)}static focusPrevious(t,e){return this.focusTarget(this.#o(t,"previous",e),e)}static focusContainer(t,e){if(!t.hasAttribute("tabindex")){t.setAttribute("tabindex","-1")}this.focusTarget(t,e);return t}static getActiveElement(t){const{activeElement:s}=this.#r(t);if(s?.tagName==="IFRAME"&&s.contentDocument?.body){const t=s;return this.getActiveElement(t.contentDocument?.body)}if(e.Type.isElementNode(s)){return s}return null}static createWalker(t,e){const{tabbableOnly:s=false,accept:i}=e??{};const n=t.ownerDocument??document;return n.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode(t){const e=t;if(!a.isFocusable(e)){return NodeFilter.FILTER_SKIP}if(s&&e.tabIndex<0){return NodeFilter.FILTER_SKIP}if(i&&!i(e)&&e.tagName!=="IFRAME"){return NodeFilter.FILTER_SKIP}return NodeFilter.FILTER_ACCEPT}})}static*#a(t,e){const s=this.createWalker(t,e);for(let t=s.nextNode();t!==null;t=s.nextNode()){const s=t;if(s.tagName==="IFRAME"){try{const t=s;const i=t.contentDocument?.body;if(i){yield*this.#a(i,e);continue}}catch{}}yield s}}static#o(t,e,s){const i={tabbableOnly:s?.tabbableOnly??true,accept:s?.accept};switch(e){case"first":{return this.#a(t,i).next().value??null}case"last":{let e=null;for(const s of this.#a(t,i)){e=s}return e}case"next":{const e=this.#c(t,s);let n=e===null;for(const s of this.#a(t,i)){if(n){return s}if(s===e){n=true}}if(s?.wrap){return this.#a(t,i).next().value??null}return null}case"previous":{const e=this.#c(t,s);let n=null;for(const s of this.#a(t,i)){if(s===e){break}n=s}if(n){return n}if(s?.wrap){return this.#o(t,"last",s)}return null}}return null}static focusBySelector(t,e,s){const{accept:i,...n}=s??{};const o=t=>t.matches(e)&&(i?i(t):true);const r=this.#c(t,s);let a=r===null;for(const e of this.#a(t,{...n,accept:o})){if(a){return this.focusTarget(e,s)}if(e===r){a=true}}if(s?.wrap){const e=this.#a(t,{...n,accept:o}).next().value;if(e){return this.focusTarget(e,s)}}return null}static#c(t,e){const s=e?.from??this.getActiveElement(t);if(!s||t===s){return null}if(t.contains(s)){return s}let i=s.ownerDocument;while(i!==null){const e=i.defaultView?.frameElement;if(!e){return null}if(t.contains(e)){return s}i=e.ownerDocument}return null}static focusTarget(t,e){if(!t){return null}const{preventScroll:s,focusVisible:i}=e??{};t.focus({preventScroll:s,focusVisible:i});return t}static restoreFocus(t,s){if(!e.Type.isElementNode(t)){return null}try{const e=new CustomEvent(h,{bubbles:true,cancelable:true});const i=t.dispatchEvent(e);
1if(i){this.focusTarget(t,s);d.log("focus-monitor","restored focus to",t);return t}}catch{d.warn("focus-monitor","failed to restore focus to",t)}return null}static#r(t){if(!t){return document}if(t.window===t){return t.document}return t.ownerDocument??document}}class m{#l;#u=[];constructor(t=25){this.#l=t}record(t){if(!a.isFocusable(t)){return}if(this.#u[this.#u.length-1]?.deref()===t){return}for(let e=this.#u.length-1;e>=0;e--){const s=this.#u[e].deref();if(!s){this.#u.splice(e,1);continue}if(s===t){this.#u.splice(e,1);break}}d.logNode("focus-monitor","recorded",t);this.#u.push(new WeakRef(t));this.#d(t.ownerDocument)}getLastValid(){for(let t=this.#u.length-1;t>=0;t--){const e=this.#u[t].deref();if(!e){this.#u.splice(t,1);continue}if(a.isFocusable(e)){this.#u.length=t+1;return e}this.#u.splice(t,1)}return null}#d(t){const e=[];for(let s=this.#u.length-1;s>=0;s--){const i=this.#u[s].deref();if(!i){this.#u.splice(s,1);continue}if(i.ownerDocument===t){e.push(s)}}const s=e.length-this.#l;if(s<=0){return}for(let t=e.length-s;t<e.length;t++){this.#u.splice(e[t],1)}}}const p=new Set(["Tab","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]);const g=new Set(["Alt","AltGraph","CapsLock","Control","Meta","NumLock","ScrollLock","Shift"]);const b=new Set(["mouse","pen","touch"]);class y{#h="unknown";#f=null;#m=null;#p=false;#g=[];#b=new WeakMap;attach(t){if(this.#b.has(t)){return}const s=t=>{if(y.isBareModifier(t.key)){return}if(p.has(t.key)){this.#m=t.key;this.#p=t.shiftKey}else{this.#m=null;this.#p=false}this.#y("keyboard")};const i=t=>{this.#f=b.has(t.pointerType)?t.pointerType:"mouse";this.#m=null;this.#p=false;this.#y("pointer")};e.Event.bind(t,"keydown",s,true);e.Event.bind(t,"pointerdown",i,true);const n=()=>{e.Event.unbind(t,"keydown",s,true);e.Event.unbind(t,"pointerdown",i,true)};this.#g.push(new WeakRef(t));this.#b.set(t,n);t.documentElement.dataset.inputModality=this.#h}detach(t){const e=this.#b.get(t);if(e){e();this.#b.delete(t);this.#v()}}static isBareModifier(t){return g.has(t)}static enableDebug(){d.enable("input-modality")}static disableDebug(){d.disable("input-modality")}#y(t){if(this.#h!==t){d.log("input-modality",`${this.#h} -> ${t}`);this.#h=t;this.#F()}}#F(){const t=[];for(const e of this.#g){const s=e.deref();if(s){s.documentElement.dataset.inputModality=this.#h;t.push(e)}}this.#g=t}#v(){this.#g=this.#g.filter((t=>{const e=t.deref();return e&&this.#b.has(e)}))}getLastModality(){return this.#h}getLastPointerType(){return this.#h==="pointer"?this.#f:null}getLastNavigationKey(){return this.#h==="keyboard"?this.#m:null}isLastNavigationReversed(){return this.#h==="keyboard"&&this.#m==="Tab"&&this.#p}}class v{static useFocusTrapInDialogs(){const t=e.Extension.getSettings("ui.a11y");return t.get("useFocusTrapInDialogs")===true}static restoreLostFocus(){const t=e.Extension.getSettings("ui.a11y");return t.get("restoreLostFocus")===true}static suppressFocusOnRestore(){const t=e.Extension.getSettings("ui.a11y");return t.get("suppressFocusOnRestore")===true}}class F{static#E=null;#T;#h;#A=new WeakMap;constructor(){this.#T=new m(25);this.#h=new y;this.#I(document)}static get Instance(){return this.initialize()}static initialize(){const t=e.Page.getRootWindow();if(t!==window){const t=e.Reflection.getClass("top.BX.UI.Accessibility.FocusMonitor");if(t!==null){return t.Instance}}if(this.#E===null){this.#E=new F}return this.#E}static enableDebug(){d.enable("focus-monitor")}static disableDebug(){d.disable("focus-monitor")}static shouldRestoreLostFocus(){return v.restoreLostFocus()}#I(t){if(this.#A.has(t)){return}let s=null;const i=t=>{if(s!==null){clearTimeout(s);s=null}const i=t.target;if(e.Type.isElementNode(i)){this.#T.record(i);if(i.tagName==="IFRAME"){this.attachIframe(i)}}};const n=()=>
1{if(s!==null){return}s=window.setTimeout((()=>{s=null;this.#S(t)}),0)};t.addEventListener("focusin",i,true);t.addEventListener("focusout",n,true);const o=this.#w(t);this.#h.attach(t);this.#A.set(t,{detach:()=>{if(s!==null){clearTimeout(s)}t.removeEventListener("focusin",i,true);t.removeEventListener("focusout",n,true);this.#h.detach(t);o?.disconnect()}})}attachIframe(t){if(!e.Type.isElementNode(t)||t.tagName!=="IFRAME"){return}try{const e=t.contentDocument;if(!e){return}const s=this.#A.get(e);if(s){return}this.#I(e)}catch{}}detachIframe(t){try{const e=t.contentDocument;if(!e){return}const s=this.#A.get(e);if(s){s.detach();this.#A.delete(e)}}catch{}}#S(t){if(!F.shouldRestoreLostFocus()){return}const e=t.activeElement;if(e&&e!==t.body){return}if(this.#h.getLastModality()!=="keyboard"){return}const s=this.#T.getLastValid();if(s){this.#N(s);return}this.#D(t)}restoreFocus(){const t=this.#T.getLastValid();if(t){this.#N(t);return}this.#D(document)}#D(t){d.log("focus-monitor","restoring focus to root");f.restoreFocus(this.getRoot(t),{preventScroll:true})}getRoot(t=document){return t.querySelector("[data-focus-root]")||t.querySelector("main")||t.body}#N(t){if(!t.isConnected){return}const e=t.ownerDocument.defaultView;if(!e){return}const s=f.getActiveElement(t);if(s===t){return}if(e===window){f.restoreFocus(t,{preventScroll:true});return}e.requestAnimationFrame((()=>{f.restoreFocus(t,{preventScroll:true})}))}getLastInputModality(){return this.#h.getLastModality()}getModalityTracker(){return this.#h}#w(t){if(!F.shouldRestoreLostFocus()){return null}if(e.Browser.isFirefox()||e.Browser.isSafari()){const e=new MutationObserver((e=>{this.#S(t)}));const s=()=>e.observe(t.body,{childList:true,subtree:true,characterData:false});if(t.readyState==="loading"){t.addEventListener("DOMContentLoaded",s)}else{s()}return e}return null}}const E=Node.DOCUMENT_POSITION_PRECEDING|Node.DOCUMENT_POSITION_CONTAINS;const T=Node.DOCUMENT_POSITION_FOLLOWING|Node.DOCUMENT_POSITION_CONTAINED_BY;class A{#x=`focus-trap-${e.Text.getRandom()}`;#L;#k;#O=false;#C=true;#s=false;#B=null;#R=true;#M=null;#P=null;#H=null;#_=new WeakSet;#K=this.#z.bind(this);#$=this.#W.bind(this);constructor(t,s={}){this.#L=t;this.#k=e.Type.isPlainObject(s)?s:{};this.setRestoreFocus(this.#k.restoreFocus??null);if(this.#k.looped!==undefined){this.setLooped(this.#k.looped)}if(this.#k.preventScroll!==undefined){this.setPreventScroll(this.#k.preventScroll)}}static enableDebug(){d.enable("focus-trap")}static disableDebug(){d.disable("focus-trap")}activate(t={}){if(this.#O){return}if(!this.#s){this.#i()}if(this.#H===null){this.captureActiveElement()}this.#O=true;if(this.#C){this.#U(true)}const{initialFocus:e}={initialFocus:true,...t};if(e){this.applyInitialFocus()}this.#V(true)}deactivate(){if(!this.#O){return}this.#O=false;this.#U(false);this.#V(false);this.restoreFocus()}destroy(){this.deactivate();if(!this.#s){return}e.Event.unbind(this.#M,"focus",this.#K);e.Event.unbind(this.#P,"focus",this.#$);e.Dom.remove(this.#M);e.Dom.remove(this.#P);this.#s=false}setLooped(t){if(!e.Type.isBoolean(t)){return}this.#C=t;if(this.#O){this.#U(t)}}setPreventScroll(t){this.#R=e.Type.isBoolean(t)?t:true}isLooped(){return this.#C}isActive(){return this.#O}setLastFocusedElement(t){if(e.Type.isElementNode(t)&&t.tagName!=="BODY"&&!this.contains(t)){this.#H=t;d.logNode("focus-trap","set last focus",t)}}captureActiveElement(){const t=f.getActiveElement();if(t!==null){this.setLastFocusedElement(t)}return t}contains(t){return this.#L.contains(t)}focusFirst(t){return f.focusFirst(this.#L,this.#q(t))}focusLast(t){return f.focusLast(this.#L,this.#q(t))}focusNext(t){return f.focusNext(this.#L,this.#q(t))}focusPrevious(t){return f.focusPrevious(this.#L,this.#q(t))}focusContainer(t){return f.focusContainer(this.#L,this.#q(t))}focusBySelector(t,e){return f.focusBySelector(this.#L,t,this.#q(e))}#q(t){const s=e.Type.isPlainObject(t)?{...t}:{};if(e.Type.isNil(s.preventScroll)){s.preventScroll=this.#R}return s}getId(){return this.#x}#i(){this.#M=this.#j();this.#P=this.#j();e.Event.bind(this.#M,"focus",this.#K);e.Event.bind(this.#P,"focus",this.#$);this.#L.insertAdjacentElement("beforebegin",this.#M);this.#L.insertAdjacentElement("afterend",this.#P);this.#s=true}#j(){const t=document.createElement("div");t.setAttribute("aria-hidden","true");t.setAttribute("data-focus-trap",this.getId());e.Dom.style(t,{position:"fixed",width:0,height:0,opacity:"0",pointerEvents:"none",outline:"none"});return t}#z(t){if(!this.#O||!this.#M){return}const e=t.relatedTarget?this.#M.compareDocumentPosition(t.relatedTarget):0;const s=e&T;
1if(!s){if(!this.focusFirst()){this.focusContainer()}return}const i=this.#k.startBoundary?this.#X(this.#k.startBoundary):null;if(i){f.focusTarget(i,{preventScroll:this.#R});return}if(!this.focusLast()){this.focusContainer()}}#W(t){if(!this.#O||!this.#P){return}const e=t.relatedTarget?this.#P.compareDocumentPosition(t.relatedTarget):0;const s=e&E;if(!s){if(!this.focusLast()){this.focusContainer()}return}const i=this.#k.endBoundary?this.#X(this.#k.endBoundary):null;if(i){f.focusTarget(i,{preventScroll:this.#R});return}if(!this.focusFirst()){this.focusContainer()}}#X(t){if(e.Type.isStringFilled(t)){const s=document.querySelector(t);return s!==null&&e.Type.isElementNode(s)&&a.isFocusable(s)?s:null}if(e.Type.isElementNode(t)&&a.isFocusable(t)){return t}if(e.Type.isFunction(t)){const s=t();return e.Type.isElementNode(s)&&a.isFocusable(s)?s:null}return null}#U(t){const e=t?"0":"-1";this.#M?.setAttribute("tabindex",e);this.#P?.setAttribute("tabindex",e)}applyInitialFocus(){const t=this.#k.initialFocus??true;if(t===false){return}if(!this.#k.forceInitialFocus){const t=f.getActiveElement(this.#L);if(t&&this.#L.contains(t)&&t!==this.#L){return}}const e=Array.isArray(t)?t:[t];for(const t of e){if(this.#J(t)){return}}this.focusContainer()}#J(t){if(t===false){return false}if(t==="container"){this.focusContainer();return true}if(e.Type.isStringFilled(t)){return this.focusBySelector(t)!==null}if(e.Type.isFunction(t)){const e=t();if(a.isFocusable(e)){f.focusTarget(e,{preventScroll:this.#R});return true}return false}if(t===true||t==="first-tabbable"||e.Type.isNil(t)){return Boolean(this.focusFirst())}return false}setRestoreFocus(t){if(e.Type.isBoolean(t)||e.Type.isNull(t)||e.Type.isStringFilled(t)||e.Type.isFunction(t)||e.Type.isElementNode(t)){this.#B=t}}restoreFocus(){try{if(this.#B===null&&this.#Y()){this.#G(this.#H);return}const t=this.#B??true;if(t===false){return}if(e.Type.isStringFilled(t)){const e=this.#L.ownerDocument??document;let s=null;try{s=e.querySelector(t)}catch{console.error("FocusTrap: invalid restoreFocus selector provided")}if(s!==null&&a.isFocusable(s)){f.restoreFocus(s,{preventScroll:true});return}}if(e.Type.isElementNode(t)&&a.isFocusable(t)){f.restoreFocus(t,{preventScroll:true});return}if(e.Type.isFunction(t)){const e=t();if(a.isFocusable(e)){f.restoreFocus(e,{preventScroll:true});return}}if(this.#H!==null&&a.isFocusable(this.#H)){let t=[];const s=e.Type.isBoolean(this.#k.suppressFocusOnRestore)?this.#k.suppressFocusOnRestore:v.suppressFocusOnRestore();try{if(s){t=e.Event.getEventListeners(this.#H,"focus");if(t.length>0){e.Event.unbindAll(this.#H,"focus")}}d.logNode("focus-trap","back to last focus",this.#H);f.restoreFocus(this.#H,{preventScroll:true})}finally{if(s){for(const s of t){e.Event.bind(this.#H,"focus",s.listener)}}}return}F.Instance.restoreFocus()}finally{this.#H=null}}#Y(){if(f.isFocusLost(this.#L)){return false}const t=f.getActiveElement(this.#L);return t!==null&&!this.#Z(t)}#G(t){setTimeout((()=>{if(!f.isFocusLost(this.#L)){return}if(t!==null&&a.isFocusable(t)){d.logNode("focus-trap","back to last focus (lost)",t);f.restoreFocus(t,{preventScroll:true});return}F.Instance.restoreFocus()}),0)}#Z(t){if(this.contains(t)){return true}let s=t.ownerDocument;while(s?.defaultView?.frameElement){const t=s.defaultView.frameElement;if(e.Type.isElementNode(t)&&this.contains(t)){return true}s=t.ownerDocument}return false}#V(t){if(this.#k.isolateOutside!==true){return}const e=[this.#L,...this.#Q()];const s=e.filter((t=>!e.some((e=>e!==t&&e.contains(t)))));const i=this.#tt(s);if(t){this.#_=new WeakSet;for(const t of i){if(t===this.#L||this.#L.contains(t)||t.getAttribute("data-focus-trap")===this.getId()){continue}if(t.parentNode?.nodeName==="BODY"&&t.offsetWidth===0&&t.offsetHeight===0){continue}if(t.inert||t.hasAttribute("inert")){this.#_.add(t)}t.setAttribute("inert","true")}}else{for(const t of i){if(this.#_.has(t)){continue}t.removeAttribute("inert")}this.#_=new WeakSet}}#tt(t){const s=new Set;const i=new Set;for(const n of t){let t=n;while(t&&t.tagName!=="BODY"){i.add(t);const n=t.parentElement;const o=n?n.children:[];for(const t of o){if(t.tagName!=="SCRIPT"&&t.tagName!=="STYLE"&&!t.getAttribute("data-a11y-ignore-inert")&&e.Type.isElementNode(t)){s.add(t)}}t=n}}i.forEach((t=>{s.delete(t)}));return s}#Q(){if(!e.Type.isArrayFilled(this.#k.outsideExceptionSelectors)){return[]}try{const t=this.#k.outsideExceptionSelectors.join(",");return[...document.querySelectorAll(t)]}
1catch{console.error("FocusTrap: invalid outsideExceptionSelectors provided");return[]}}}const I={mounted(t,e){const{active:s,options:i}=S(e.value);t.__focusTrap=new A(t,i);if(s){t.__focusTrap.activate()}},updated(t,e){const{active:s,options:i}=S(e.value);const{active:n,options:o}=S(e.oldValue);if(i!==o&&i){t.__focusTrap?.destroy();t.__focusTrap=new A(t,i)}const r=t.__focusTrap;if(!r){return}if(s){r.activate()}else{r.deactivate()}},unmounted(t){t.__focusTrap?.destroy();delete t.__focusTrap}};function S(t){if(e.Type.isBoolean(t)){return{active:t}}if(e.Type.isPlainObject(t)){return{active:t.active!==false,options:t.options}}return{active:false}}class w{static#E=null;#et;#st=[];#it=false;#nt=null;#ot=null;#rt=false;#at=null;#ct=500;#lt=30;#ut=4e3;#dt=160;static enableDebug(){d.enable("live-announcer")}static disableDebug(){d.disable("live-announcer")}static announce(t,e="polite"){if(!w.#E){w.#E=new w}w.#E.announce(t,e)}static destroy(){w.#E?.destroy();w.#E=null}constructor(t){const{politeness:s="polite",container:i=document.body||document.documentElement,baseDelay:n,charDelay:o,maxDelay:r,maxMessageLength:a}=t??{};if(e.Type.isNumber(n)){this.#ct=n}if(e.Type.isNumber(o)){this.#lt=o}if(e.Type.isNumber(r)){this.#ut=r}if(e.Type.isNumber(a)){this.#dt=a}this.#et=this.#ht(s);e.Dom.append(this.#et,i);this.#at=requestAnimationFrame((()=>{this.#at=null;this.#rt=true;this.#ft()}))}announce(t,e="polite"){const s=this.#mt(t);if(!s){return}d.log("live-announcer",`[${e}] ${s}`);const i=this.#st[this.#st.length-1];if(i&&i.message===s&&i.politeness===e){return}if(e==="assertive"){this.#pt();this.#st.unshift({message:s,politeness:e})}else{this.#st.push({message:s,politeness:e})}this.#ft()}destroy(){if(this.#at!==null){cancelAnimationFrame(this.#at);this.#at=null}this.#st.length=0;this.#pt();this.#et.remove()}#ft(){if(!this.#rt||this.#it||this.#st.length===0){return}const t=this.#st.shift();if(!t){return}this.#it=true;const{message:e,politeness:s}=t;const i=this.#gt(e);this.#et.setAttribute("aria-live",s);this.#et.textContent="";this.#nt=requestAnimationFrame((()=>{this.#nt=null;this.#et.textContent=e;this.#ot=setTimeout((()=>{this.#ot=null;this.#it=false;if(this.#st.length===0){this.#et.textContent=""}this.#ft()}),i)}))}#pt(){this.#it=false;if(this.#nt!==null){cancelAnimationFrame(this.#nt);this.#nt=null}if(this.#ot!==null){clearTimeout(this.#ot);this.#ot=null}this.#et.textContent=""}#gt(t){const e=this.#ct+t.length*this.#lt;return Math.min(e,this.#ut)}#mt(t){if(!e.Type.isStringFilled(t)){return""}const s=t.trim();if(!s){return""}if(s.length<=this.#dt){return s}const i=s.slice(0,this.#dt-1);const n=i.replace(/\s+\S*$/,"");return`${n||i}\u2026`}#ht(t){const s=document.createElement("div");s.setAttribute("aria-live",t);s.setAttribute("aria-atomic","true");s.setAttribute("data-a11y-ignore-inert","true");e.Dom.style(s,{position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:"0"});return s}}const N=1;const D=2;const x=4;const L=8;const k=16;const O=32;const C=64;const B=128;const R=256;const M=512;const P={ArrowHorizontal:N,ArrowVertical:D,JK:x,HL:L,HomeAndEnd:k,WS:O,AD:C,Tab:B,PageUpDown:R,Backspace:M,ArrowAll:N|D,HJKL:L|x,WASD:O|C,All:N|D|x|L|k|O|C|B|R|M};const H={ELEMENT_ATTR:"data-active-descendant",CONTAINER_ATTR:"data-has-active-descendant",EXPLICIT:"activated-by-keyboard",IMPLICIT:"activated-by-other"};const _={ArrowLeft:P.ArrowHorizontal,ArrowDown:P.ArrowVertical,ArrowUp:P.ArrowVertical,ArrowRight:P.ArrowHorizontal,h:P.HL,j:P.JK,k:P.JK,l:P.HL,a:P.AD,s:P.WS,w:P.WS,d:P.AD,Tab:P.Tab,Home:P.HomeAndEnd,End:P.HomeAndEnd,PageUp:P.PageUpDown,PageDown:P.PageUpDown,Backspace:P.Backspace};const K={ArrowLeft:"previous",ArrowDown:"next",ArrowUp:"previous",ArrowRight:"next",h:"previous",j:"next",k:"previous",l:"next",a:"previous",s:"next",w:"previous",d:"next",Tab:"next",Home:"start",End:"end",PageUp:"start",PageDown:"end",Backspace:"previous"};class z{#L;#k;#O=false;#bt;#yt;#vt;#R;#Ft;#Et;#Tt=new Set;#At=new WeakMap;#It=null;#St=null;#wt=null;#Nt=null;#Dt=[];#xt=false;#Lt=new WeakSet;#kt=this.#Ot.bind(this);#Ct=this.#Bt.bind(this);#Rt=this.#Mt.bind(this);#Pt=this.#Ht.bind(this);#_t=this.#Kt.bind(this);constructor(t,s={}){this.#L=t;this.#k=e.Type.isPlainObject(s)?s:{};this.#St=this.#k.activeDescendantControl??null;this.#yt=this.#k.focusOutBehavior??"stop";this.#vt=this.#k.focusInStrategy??"previous";this.#R=this.#k.preventScroll??false;this.#Ft=this.#k.ignoreHoverEvents??false;this.#Et=this.#k.tabbableOnly??false;this.#bt=this.#k.bindKeys??(this.#k.getNextFocusable?P.ArrowAll:P.ArrowVertical)|P.HomeAndEnd}static enableDebug(){d.enable("focus-zone")}static disableDebug(){d.disable("focus-zone")}activate(){if(this.#O){return}this.#O=true;this.#Tt=this.#zt();for(const t of this.#Tt){this.#$t(t)}if(this.#St){if(!this.#L.id){this.#L.setAttribute("id",`fz-${e.Text.getRandom()}`);this.#xt=true}this.#St.setAttribute("aria-controls",this.#L.id)}const t=this.#vt==="initial"&&this.#St;if(!t){this.#Wt(this.#Ut())}this.#Vt();this.#w();
1d.log("focus-zone",`activated with ${this.#Tt.size} elements`)}deactivate(){if(!this.#O){return}this.#O=false;if(this.#wt){this.#wt.disconnect();this.#wt=null}if(this.#Nt!==null){cancelAnimationFrame(this.#Nt);this.#Nt=null}this.#qt();for(const t of this.#Tt){this.#jt(t);if(this.#Lt.has(t)){t.removeAttribute("id");this.#Lt.delete(t)}}if(this.#St){this.#Xt();this.#St.removeAttribute("aria-controls")}if(this.#xt){this.#L.removeAttribute("id");this.#xt=false}this.#Tt.clear();this.#It=null;d.log("focus-zone","deactivated")}isActive(){return this.#O}getCurrentFocusedElement(){return this.#It}refreshElements(){if(this.#O){this.#Jt()}}#zt(){const t=new Set;const e=f.createWalker(this.#L,{tabbableOnly:this.#Et,accept:this.#k.focusableElementFilter});for(let s=e.nextNode();s!==null;s=e.nextNode()){t.add(s)}return t}#Yt(t=null,e=false){return{from:t??undefined,tabbableOnly:false,accept:t=>this.#Tt.has(t),wrap:e}}#Gt(t){let s=e.Type.isElementNode(t)?t:t.parentElement;while(s&&s!==this.#L){if(this.#Tt.has(s)){return s}s=s.parentElement}return null}#$t(t){if(!this.#At.has(t)){this.#At.set(t,t.getAttribute("tabindex"))}t.setAttribute("tabindex","-1")}#jt(t){const e=this.#At.get(t);if(e!==undefined){if(e===null){t.removeAttribute("tabindex")}else{t.setAttribute("tabindex",e)}this.#At.delete(t)}}#Wt(t=null,e=false){const s=this.#It;this.#It=t;if(this.#St){if(t&&f.getActiveElement()===this.#St){this.#Zt(s,t,e)}else{this.#Xt()}return}if(s&&s!==t&&this.#At.has(s)){s.setAttribute("tabindex","-1")}if(t){t.setAttribute("tabindex","0")}}#Zt(t,s,i=false){if(!s.id){s.setAttribute("id",`fz-${e.Text.getRandom()}`);this.#Lt.add(s)}if(t&&t!==s){t.removeAttribute(H.ELEMENT_ATTR)}if(!this.#St){return}const n=this.#St.getAttribute("aria-activedescendant");const o=i?H.EXPLICIT:H.IMPLICIT;const r=s.getAttribute(H.ELEMENT_ATTR);if(n===s.id&&r===o){return}this.#St.setAttribute("aria-activedescendant",s.id);this.#L.setAttribute(H.CONTAINER_ATTR,s.id);s.setAttribute(H.ELEMENT_ATTR,o);d.logNode("focus-zone","active descendant ->",s);this.#k.onActiveDescendantChanged?.(s,t,i)}#Xt(t=this.#It){if(this.#vt==="first"){this.#It=null}this.#St?.removeAttribute("aria-activedescendant");this.#L.removeAttribute(H.CONTAINER_ATTR);if(t){t.removeAttribute(H.ELEMENT_ATTR)}const e=this.#L.querySelectorAll(`[${H.ELEMENT_ATTR}]`);for(const t of e){t.removeAttribute(H.ELEMENT_ATTR)}this.#k.onActiveDescendantChanged?.(null,t,false)}#Ot(t){const e=_[t.key];if(e===undefined||this.#Tt.size===0){return}if(t.defaultPrevented||(e&this.#bt)===0||z.#Qt(t,f.getActiveElement())){return}const s=z.#te(t);let i=null;if(this.#k.getNextFocusable){i=this.#k.getNextFocusable(s,f.getActiveElement()??null,t)}if(!i){const e=this.#yt==="wrap"&&t.key!=="Tab";const n=this.#Yt(this.#It,e);switch(s){case"previous":{i=f.getPrevious(this.#L,n);break}case"next":{i=f.getNext(this.#L,n);break}case"start":{i=f.getFirst(this.#L,n);break}default:{i=f.getLast(this.#L,n)}}}if(this.#St){this.#Wt(i||this.#It,true)}else if(i){i.focus({preventScroll:this.#R})}if(t.key!=="Tab"||i){t.preventDefault()}}#Bt(t){if(!e.Type.isElementNode(t.target)){return}if(this.#St){this.#ee(t)}else{this.#se(t)}}#ee(t){const e=t.target;if(this.#Tt.has(e)){this.#St?.focus({preventScroll:this.#R});this.#Wt(e)}}#se(t){const s=t.target;const i=F.Instance.getModalityTracker();const n=i.getLastModality()==="pointer";if(n){if(this.#Tt.has(s)){this.#Wt(s)}return}if(!this.#Tt.has(s)){return}if(this.#vt==="previous"){this.#Wt(s)}else if(this.#vt==="closest"||this.#vt==="first"){if(this.#ie(t.relatedTarget)){const t=this.#ne();if(t){t.focus({preventScroll:this.#R})}return}this.#Wt(s)}else if(e.Type.isFunction(this.#vt)){if(this.#ie(t.relatedTarget)){const e=this.#vt(t.relatedTarget);if(e&&this.#Tt.has(e)){e.focus({preventScroll:this.#R});return}d.warn("focus-zone","focusInStrategy returned an element outside the managed focus set.")}this.#Wt(s)}}#Ut(){if(e.Type.isFunction(this.#vt)){const t=this.#vt(this.#It);return t&&this.#Tt.has(t)?t:null}return f.getFirst(this.#L,this.#Yt())}#ne(){const t=this.#Yt();return F.Instance.getModalityTracker().isLastNavigationReversed()?f.getLast(this.#L,t):f.getFirst(this.#L,t)}#ie(t){return e.Type.isElementNode(t)&&!this.#L.contains(t)}#Mt(t){const{target:s}=t;if(!e.Type.isElementNode(s)){return}const i=this.#Gt(s);if(i){this.#Wt(i)}}#Ht(){const t=this.#vt==="initial"&&this.#St;if(this.#It){this.#Zt(null,this.#It)}else if(!t){this.#Wt(f.getFirst(this.#L,this.#Yt()))}}#Kt(){this.#Xt()}#oe(t,s,i,n=false){e.Event.bind(t,s,i,n);this.#Dt.push([t,s,i,n])}#Vt(){const t=this.#St??this.#L;this.#oe(t,"keydown",this.#kt);this.#oe(this.#L,"focusin",this.#Ct);if(this.#St){if(!this.#Ft){this.#oe(this.#L,"mousemove",this.#Rt,true)}this.#oe(this.#St,"focusin",this.#Pt);this.#oe(this.#St,"focusout",this.#_t)}}#qt(){for(const[t,s,i,n]of this.#Dt){e.Event.unbind(t,s,i,n)}this.#Dt=[]}#w(){this.#wt=new MutationObserver((t=>{if(this.#re(t)){return}this.#ae()}));this.#wt.observe(this.#L,{attributes:true,subtree:true,childList:true,attributeFilter:["hidden","disabled","tabindex","inert","contenteditable","aria-disabled"]})}#re(t){if(this.#Et){return false}return t.every((t=>t.type==="attributes"&&t.attributeName==="tabindex"&&this.#Tt.has(t.target)))}#ae(){if(!this.#O||this.#Nt!==null){return}this.#Nt=requestAnimationFrame((()=>{this.#Nt=null;this.#Jt()}))}#Jt(){if(!this.#O){return}const t=this.#zt();const e=this.#Tt;for(const s of e){if(!t.has(s)){this.#jt(s)}}for(const s of t){if(!e.has(s)){this.#$t(s)}}this.#Tt=t;if(this.#It&&!t.has(this.#It)){this.#Wt(f.getFirst(this.#L,this.#Yt()))}else if(!this.#It&&t.size>0){const t=this.#vt==="initial"&&this.#St;if(!t){this.#Wt(f.getFirst(this.#L,this.#Yt()))}}}static#te(t){const s=K[t.key];if(t.key==="Tab"&&t.shiftKey){return"previous"}const i=e.Browser.isMac();if(i&&t.metaKey||!i&&t.ctrlKey){if(t.key==="ArrowLeft"||t.key==="ArrowUp"){return"start"}if(t.key==="ArrowRight"||t.key==="ArrowDown"){return"end"}}return s}static#Qt(t,s){const{key:i,metaKey:n,altKey:o}=t;const r=i.codePointAt(0)??0;const c=i.length===1||i.length===2&&r>=55296&&r<=56319;const l=a.isEditable(s);const u=s?.tagName==="SELECT";if(l&&(c||i==="Home"||i==="End")){return true}if(u){const t=e.Browser.isMac();if(i==="ArrowDown"&&t&&!n){return true}return i==="ArrowDown"&&!t&&o}if(l){const t=s?.tagName==="TEXTAREA"||s?.tagName==="INPUT";const n=s;const o=t&&n.selectionStart===0&&n.selectionEnd===0;const r=t&&n.selectionStart===n.value.length&&n.selectionEnd===n.value.length;if(i==="ArrowLeft"&&!o){return true}if(i==="ArrowRight"&&!r){return true}const a=e.Type.isElementNode(s)&&s.isContentEditable;if(s?.tagName==="TEXTAREA"||a){if(i==="PageUp"||i==="PageDown"){return true}if(i==="ArrowUp"&&!o){return true}if(i==="ArrowDown"&&!r){return true}}}return false}}class $ extends HTMLElement{connectedCallback(){Object.assign(this.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"})}}if(!customElements.get("visually-hidden")){customElements.define("visually-hidden",$)}F.initialize();t.AccessibilityLogger=d;t.AccessibilitySettings=v;t.ActiveDescendant=H;t.FocusKeys=P;t.FocusMonitor=F;t.FocusNavigator=f;t.FocusTrap=A;t.FocusTrapDirective=I;t.FocusZone=z;t.InputModalityTracker=y;t.InteractivityChecker=a;t.LiveAnnouncer=w;t.RESTORE_FOCUS_EVENT=h;t.VisuallyHidden=$})(this.BX.UI.Accessibility=this.BX.UI.Accessibility||{},BX);
2//# sourceMappingURL=a11y.bundle.map.js

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.