jQuery(document).ready(function(){if(window.IntersectionObserver){var t=new IntersectionObserver(function(e,r){e.forEach(function(e){if(e.isIntersecting){e.target.classList.add("loaded");var t=e.target.querySelector(".tf-select-ajaxify");"function"==typeof jQuery(t).chosen&&jQuery(t).chosen("destroy"),jQuery(t).select2({templateResult:function(e){if(e.id)return e.text},placeholder:e.target.dataset.placeholder,ajax:{url:e.target.dataset.ajaxEndpoint,dataType:"json",error:function(e){"abort"!=e.statusText&&alert(e.responseText)}},allowClear:!0,multiple:!0,cache:!0}),r.unobserve(t)}})},{rootMargin:"0px 0px 0px 0px"});document.querySelectorAll(".tf-ajaxify-wrapper:not(.loaded)").forEach(function(e){t.observe(e)})}});

