var TF_FAQ=function(){function t(){this.initEvents()}var e=t.prototype;return e.initEvents=function(){document.addEventListener("click",function(t){this.onQuestionToggle(t)}.bind(this))},e.onQuestionToggle=function(t){t=t.target.closest(".tf-faq-widget--item--question");t&&this.toggleItem(t.closest(".tf-faq-widget--item"))},e.toggleItem=function(t){var e=this,n=t.closest(".tf-faq-widget"),i="true"===t.dataset.open||!1;n.classList.contains("keep-one-question-open")&&(n=n.querySelectorAll('.tf-faq-widget--item[data-open="true"]'))&&n.forEach(function(t){e.collapseItem(t)}),i?this.collapseItem(t):this.expandItem(t)},e.collapseItem=function(t){var e=t.querySelector(".tf-faq-widget--item--answer"),n=e.scrollHeight,i=e.style.transition;e.style.transition="",requestAnimationFrame(function(){e.style.height=n+"px",e.style.transition=i,requestAnimationFrame(function(){e.style.height="0px"})}),t.setAttribute("data-open","false")},e.expandItem=function(t){console.log("expand");var e=t.querySelector(".tf-faq-widget--item--answer"),n=e.scrollHeight;e.style.height=n+"px",e.addEventListener("transitionend",function(t){e.removeEventListener("transitionend",arguments.callee),e.style.height=null}),t.setAttribute("data-open","true")},t}();document.addEventListener("DOMContentLoaded",function(){new TF_FAQ});

