function t_popup__trapFocus(t){var t=t.querySelectorAll('a, button, input:not([type="hidden"]):not(.js-form-spec-comments), select, textarea, embed, video, iframe, [tabindex="0"]'),e=t[0],o=t[t.length-1];document.addEventListener("keydown",function(t){!document.body.classList.contains("t-body_popupshowed")||"Tab"!==t.key&&9!==t.keyCode||(t.shiftKey&&document.activeElement.classList.contains("t-popup_show")&&o.focus(),"Tab"!==t.key||t.shiftKey||document.activeElement!==o||(t.preventDefault(),e.focus()),"Tab"===t.key&&t.shiftKey&&document.activeElement===e&&(t.preventDefault(),o.focus()))})}function t_popup__addAttributesForAccessibility(t){t=document.querySelectorAll('a[href="'+t+'"]');Array.prototype.forEach.call(t,function(t){t&&(t.setAttribute("role","button"),t.setAttribute("aria-haspopup","dialog"))})}function t_popup__resizePopup(t){var e,o,p,n,t=document.getElementById("rec"+t);!t||(e=t.querySelector(".t-popup__container"))&&(p=getComputedStyle(e,null),o=parseInt(p.paddingTop)||0,p=parseInt(p.paddingBottom)||0,o=e.clientHeight-(o+p),p=120,t=1093===(n=Number(t.getAttribute("data-record-type")))||121===n&&t.querySelector(".t1093"),364!==n&&365!==n||(p=30),868!==n&&331!==n&&358!==n&&1013!==n&&746!==n&&!t||(p=0),o>window.innerHeight-p?e.classList.add("t-popup__container-static"):e.classList.remove("t-popup__container-static"))}function t_popup__showPopup(e){e&&(e.style.display="block"),setTimeout(function(){e.focus();var t=e?e.querySelector(".t-popup__container"):null;t&&t.classList.add("t-popup__container-animated"),e&&e.classList.add("t-popup_show"),t_onFuncLoad("t_popup__trapFocus",function(){t_popup__trapFocus(e)})},50)}function t_popup__addClassOnTriggerButton(t,e){var o=document.querySelectorAll(".t-popup__triggered-btn");Array.prototype.forEach.call(o,function(t){t.classList.remove("t-popup__triggered-btn")}),t.addEventListener("keydown",function(t){13===t.keyCode&&(t=!!(t=t.target).closest('a[href="'+e+'"]')&&t)&&!window.isMobile&&t.classList.add("t-popup__triggered-btn")})}function t_popup__addFocusOnTriggerButton(){var t=document.querySelector(".t-popup__triggered-btn");t&&(t.focus(),t.classList.remove("t-popup__triggered-btn"))}Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){for(var e=this;e&&1===e.nodeType;){if(Element.prototype.matches.call(e,t))return e;e=e.parentElement||e.parentNode}return null});