"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([["vendors-node_modules_primer_behaviors_dist_esm_focus-zone_js"],{48542:(e,t,n)=>{let r;n.d(t,{Qw:()=>i,LM:()=>v,v5:()=>b,km:()=>g,pd:()=>A,BG:()=>f});var i,o=n(44542);function l(){return void 0===r&&(r=/^mac/i.test(window.navigator.platform)),r}var a=n(78160);let d=1e4;(0,o.O)(),function(e){e[e.ArrowHorizontal=1]="ArrowHorizontal",e[e.ArrowVertical=2]="ArrowVertical",e[e.JK=4]="JK",e[e.HL=8]="HL",e[e.HomeAndEnd=16]="HomeAndEnd",e[e.PageUpDown=256]="PageUpDown",e[e.WS=32]="WS",e[e.AD=64]="AD",e[e.Tab=128]="Tab",e[e.Backspace=512]="Backspace",e[e.ArrowAll=3]="ArrowAll",e[e.HJKL=12]="HJKL",e[e.WASD=96]="WASD",e[e.All=511]="All"}(i||(i={}));let s={ArrowLeft:i.ArrowHorizontal,ArrowDown:i.ArrowVertical,ArrowUp:i.ArrowVertical,ArrowRight:i.ArrowHorizontal,h:i.HL,j:i.JK,k:i.JK,l:i.HL,a:i.AD,s:i.WS,w:i.WS,d:i.AD,Tab:i.Tab,Home:i.HomeAndEnd,End:i.HomeAndEnd,PageUp:i.PageUpDown,PageDown:i.PageUpDown,Backspace:i.Backspace},u={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"};function c(e){let t=u[e.key];if("Tab"===e.key&&e.shiftKey)return"previous";let n=l();if(n&&e.metaKey||!n&&e.ctrlKey){if("ArrowLeft"===e.key||"ArrowUp"===e.key)return"start";if("ArrowRight"===e.key||"ArrowDown"===e.key)return"end"}return t}let f="data-is-active-descendant",v="activated-directly",b="activated-indirectly",A="data-has-active-descendant";function g(e,t){var n,r,o,g,w;let E,p,m;let T=[],h=new WeakMap,L=null!==(n=null==t?void 0:t.bindKeys)&&void 0!==n?n:((null==t?void 0:t.getNextFocusable)?i.ArrowAll:i.ArrowVertical)|i.HomeAndEnd,y=null!==(r=null==t?void 0:t.focusOutBehavior)&&void 0!==r?r:"stop",H=null!==(o=null==t?void 0:t.focusInStrategy)&&void 0!==o?o:"previous",x=null==t?void 0:t.activeDescendantControl,k=null==t?void 0:t.onActiveDescendantChanged,D=null!==(g=null==t?void 0:t.preventScroll)&&void 0!==g&&g;function M(e,t=!1){let n=E;if(E=e,x){e&&document.activeElement===x?N(n,e,t):P();return}n&&n!==e&&h.has(n)&&n.setAttribute("tabindex","-1"),null==e||e.setAttribute("tabindex","0")}function N(t,n,r=!1){n.id||n.setAttribute("id",`__primer_id_${d++}`),t&&t!==n&&t.removeAttribute(f),x&&(r||x.getAttribute("aria-activedescendant")!==n.id)&&(x.setAttribute("aria-activedescendant",n.id),e.setAttribute(A,n.id),n.setAttribute(f,r?v:b),null==k||k(n,t,r))}function P(t=E){"first"===H&&(E=void 0),null==x||x.removeAttribute("aria-activedescendant"),e.removeAttribute(A),null==t||t.removeAttribute(f),null==k||k(void 0,t,!1)}function O(...e){let n=e.filter(e=>{var n,r;return null===(r=null===(n=null==t?void 0:t.focusableElementFilter)||void 0===n?void 0:n.call(t,e))||void 0===r||r});if(0!==n.length){for(let e of(T.splice(function(e){let t=e[0];if(0===T.length)return 0;let n=0,r=T.length-1;for(;n<=r;){let e=Math.floor((n+r)/2),i=T[e];(i.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)>0?r=e-1:n=e+1}return n}(n),0,...n),n))h.has(e)||h.set(e,e.getAttribute("tabindex")),e.setAttribute("tabindex","-1");E||M(T[0])}}function S(...e){for(let t of e){let e=T.indexOf(t);e>=0&&T.splice(e,1);let n=h.get(t);if(void 0!==n&&(null===n?t.removeAttribute("tabindex"):t.setAttribute("tabindex",n),h.delete(t)),t===E){let e=T[0];M(e)}}}let _={reverse:null==t?void 0:t.reverse,strict:null==t?void 0:t.strict,onlyTabbable:null==t?void 0:t.onlyTabbable};O(...(0,a.hT)(e,_));let C="function"==typeof H?H(document.body):T[0];M(C);let U=new MutationObserver(e=>{for(let t of e)for(let e of t.removedNodes)e instanceof HTMLElement&&S(...(0,a.hT)(e,_));for(let t of e)for(let e of t.addedNodes)e instanceof HTMLElement&&O(...(0,a.hT)(e,_))});U.observe(e,{subtree:!0,childList:!0});let I=new AbortController,K=null!==(w=null==t?void 0:t.abortSignal)&&void 0!==w?w:I.signal;K.addEventListener("abort",()=>{S(...T)}),e.addEventListener("mousedown",e=>{e.target instanceof HTMLElement&&e.target!==document.activeElement&&(p=T.indexOf(e.target))},{signal:K}),x?(e.addEventListener("focusin",e=>{e.target instanceof HTMLElement&&T.includes(e.target)&&(x.focus({preventScroll:D}),M(e.target))}),e.addEventListener("mousemove",({target:e})=>{if(!(e instanceof Node))return;let t=T.find(t=>t.contains(e));t&&M(t)},{signal:K,capture:!0}),x.addEventListener("focusin",()=>{E?N(void 0,E):M(T[0])}),x.addEventListener("focusout",()=>{P()})):e.addEventListener("focusin",t=>{if(t.target instanceof HTMLElement){if(void 0!==p)p>=0&&T[p]!==E&&M(T[p]),p=void 0;else if("previous"===H)M(t.target);else if("closest"===H||"first"===H){if(t.relatedTarget instanceof Element&&!e.contains(t.relatedTarget)){let e="previous"===m?T.length-1:0,t=T[e];null==t||t.focus({preventScroll:D});return}M(t.target)}else if("function"==typeof H){if(t.relatedTarget instanceof Element&&!e.contains(t.relatedTarget)){let e=H(t.relatedTarget),n=e?T.indexOf(e):-1;if(n>=0&&e instanceof HTMLElement){e.focus({preventScroll:D});return}console.warn("Element requested is not a known focusable element.")}else M(t.target)}}m=void 0},{signal:K});let W=null!=x?x:e;return"closest"===H&&document.addEventListener("keydown",e=>{"Tab"===e.key&&(m=c(e))},{signal:K,capture:!0}),W.addEventListener("keydown",n=>{var r;if(n.key in u){let i=s[n.key];if(!n.defaultPrevented&&(i&L)>0&&!function(e,t){let n=e.key,r=[...n].length,i=t instanceof HTMLInputElement&&"text"===t.type||t instanceof HTMLTextAreaElement;if(i&&(1===r||"Home"===n||"End"===n)||t instanceof HTMLSelectElement&&(1===r||"ArrowDown"===n&&l()&&!e.metaKey||"ArrowDown"===n&&!l()&&e.altKey)||t instanceof HTMLTextAreaElement&&("PageUp"===n||"PageDown"===n))return!0;if(i){let e=0===t.selectionStart&&0===t.selectionEnd,r=t.selectionStart===t.value.length&&t.selectionEnd===t.value.length;if("ArrowLeft"===n&&!e||"ArrowRight"===n&&!r||t instanceof HTMLTextAreaElement&&("ArrowUp"===n&&!e||"ArrowDown"===n&&!r))return!0}return!1}(n,document.activeElement)){let i;let o=c(n);if((null==t?void 0:t.getNextFocusable)&&(i=t.getNextFocusable(o,null!==(r=document.activeElement)&&void 0!==r?r:void 0,n)),!i){let t=function(){if(!E)return 0;let t=T.indexOf(E),n=E===e?-1:0;return -1!==t?t:n}(),r=t;"previous"===o?r-=1:"start"===o?r=0:"next"===o?r+=1:r=T.length-1,r<0&&(r="wrap"===y&&"Tab"!==n.key?T.length-1:0),r>=T.length&&(r="wrap"===y&&"Tab"!==n.key?0:T.length-1),t!==r&&(i=T[r])}x?M(i||E,!0):i&&(m=o,i.focus({preventScroll:D})),("Tab"!==n.key||i)&&n.preventDefault()}}},{signal:K}),I}},44542:(e,t,n)=>{n.d(t,{O:()=>o});let r=!1;function i(){}try{let e=Object.create({},{signal:{get(){r=!0}}});window.addEventListener("test",i,e),window.removeEventListener("test",i,e)}catch(e){}function o(){r||(!function(){if("undefined"==typeof window)return;let e=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(t,n,r){return"object"==typeof r&&"signal"in r&&r.signal instanceof AbortSignal&&e.call(r.signal,"abort",()=>{this.removeEventListener(t,n,r)}),e.call(this,t,n,r)}}(),r=!0)}},78160:(e,t,n)=>{function*r(e,t={}){var n,r;let i=null!==(n=t.strict)&&void 0!==n&&n,a=null!==(r=t.onlyTabbable)&&void 0!==r&&r?l:o,d=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e instanceof HTMLElement&&a(e,i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}),s=null;if(!t.reverse&&a(e,i)&&(yield e),t.reverse){let e=d.lastChild();for(;e;)s=e,e=d.lastChild()}else s=d.firstChild();for(;s instanceof HTMLElement;)yield s,s=t.reverse?d.previousNode():d.nextNode();t.reverse&&a(e,i)&&(yield e)}function i(e,t=!1){return r(e,{reverse:t,strict:!0,onlyTabbable:!0}).next().value}function o(e,t=!1){let n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(e.tagName)&&e.disabled,r=e.hidden,i=e instanceof HTMLInputElement&&"hidden"===e.type,o=e.classList.contains("sentinel");if(n||r||i||o)return!1;if(t){let t=getComputedStyle(e),n=0===e.offsetWidth||0===e.offsetHeight,r=["hidden","collapse"].includes(t.visibility),i="none"===t.display||!e.offsetParent,o=0===e.getClientRects().length;if(n||r||o||i)return!1}return null!=e.getAttribute("tabindex")||"true"===e.getAttribute("contenteditable")||"plaintext-only"===e.getAttribute("contenteditable")||(!(e instanceof HTMLAnchorElement)||null!=e.getAttribute("href"))&&-1!==e.tabIndex}function l(e,t=!1){return o(e,t)&&"-1"!==e.getAttribute("tabindex")}n.d(t,{EB:()=>o,O:()=>i,Wq:()=>l,hT:()=>r})}}]); //# sourceMappingURL=vendors-node_modules_primer_behaviors_dist_esm_focus-zone_js-6d212bb2cb69.js.map