(function(){function e(e,t){try{const n=window.webkit;delete window["webkit"];window.webkit.messageHandlers[e].postMessage(t);window.webkit=n}catch(e){}}function t(){const e=new Uint32Array(4);window.crypto.getRandomValues(e);return e.reduce(((e="",t)=>e+t.toString(16).padStart(8,"0")),"")}class n{registeredApis={};frameId=t();registerApi(e,t){if(this.registeredApis[e]!==undefined){throw new Error(`API ${e} already registered.`)}this.registeredApis[e]=t}getRegisteredApi(e){return this.registeredApis[e]}getFrameId(){if(!this.frameId){this.frameId=t()}return this.frameId}registerFrame(){e("FrameBecameAvailable",{crwFrameId:this.getFrameId()})}}if(!window.__gCrWeb){window.__gCrWeb=new n}const r=window.__gCrWeb;function i(e,t){if("name"in e&&e.name===t){return e}for(const n of e.children){const e=i(n,t);if(e){return e}}return null}function o(e,t){const n=Array.from(t);if(!c(e)){const t=n.indexOf(e);if(t===n.length-1||t===-1){return null}for(let e=t+1;e<n.length;++e){const t=n[e];if(t instanceof HTMLElement&&c(t)){return t}}return null}const r=function(e,t,n,r){const i=f(e);const o=f(n);return i>o||i===o&&t>r};return s(e,n,r)}function u(e,t){const n=Array.from(t);if(!c(e)){const t=n.indexOf(e);if(t<=0){return null}for(let e=t-1;e>=0;--e){const t=n[e];if(t&&t instanceof HTMLElement&&c(t)){return t}}return null}const r=function(e,t,n,r){const i=f(e);const o=f(n);return i<o||i===o&&t<r};return s(e,n,r)}function s(e,t,n){const r=t.indexOf(e);if(r===-1){return null}let i=null;let o=-1;for(let u=0;u<t.length;++u){if(u===r){continue}const s=t[u];if(!s||!c(s)){continue}if(n(s,u,e,r)){if(!i){i=s;o=u}else{if(n(i,o,s,u)){i=s;o=u}}}}return i}function l(e){let t=e;while(t&&t!==document){if(t.nodeType===Node.ELEMENT_NODE){const e=window.getComputedStyle(t);if(e.display==="none"||e.visibility==="hidden"){return false}}t=t.parentNode}return true}function c(e){const t="tabIndex"in e?e.tabIndex:null;if(!t&&t!==0||t<0){return false}const n="type"in e?e.type:null;if(n==="hidden"||e.hasAttribute("disabled")){return false}if(e.tagName!=="INPUT"&&e.tagName!=="SELECT"&&e.tagName!=="TEXTAREA"){return false}if(e.tagName==="INPUT"&&(n==="submit"||n==="reset"||n==="image"||n==="button"||n==="range"||n==="radio"||n==="checkbox")){return false}return l(e)}function f(e){const t="tabIndex"in e?e.tabIndex:null;if(t===0){return Number.MAX_VALUE}return t}function a(e,t){const n=r.form.getFormElementFromIdentifier(e);if(!n){return null}return i(n,t)}function d(e,t){const n=e?a(e,t):document.activeElement;if(!n){return}const r=o(n,document.querySelectorAll("*"));if(r&&r instanceof HTMLElement){r.focus()}}function m(e,t){const n=e?a(e,t):document.activeElement;if(!n){return}const r=u(n,document.querySelectorAll("*"));if(r&&r instanceof HTMLElement){r.focus()}}function g(e,t){const n=e?a(e,t):document.activeElement;if(!n){return false}return o(n,document.querySelectorAll("*"))!==null}function w(e,t){const n=e?a(e,t):document.activeElement;if(!n){return false}return u(n,document.querySelectorAll("*"))!==null}function E(e,t){return{previous:w(e,t),next:g(e,t)}}r.suggestion={getNextElementInTabOrder:o,getPreviousElementInTabOrder:u,selectNextElement:d,selectPreviousElement:m,hasNextElement:g,hasPreviousElement:w,hasPreviousNextElements:E}})();