!function(e){"use strict";var t=e(".betterdocs-load-more-wrapper .betterdocs-load-more-button");t?.map((a=>{e(t[a]).on("click",(function(r){r.preventDefault();var l=e(this),o=e(e(t[a]).parent().siblings(".betterdocs-related-terms-inner-wrapper")),d=e(e(t[a]).children()[0]),c=e(e(t[a]).children()[1]),s=(e(".betterdocs-related-terms-inner-wrapper").children().length,e(this).data("current_term_id")),n=e(this).data("page");let i={_wpnonce:null!=l?.attr("block_id")&&null!=l?.attr("block_id")?window?.eval("betterdocsRelatedTerms_"+l?.attr("block_id"))?.nonce:betterdocsRelatedTerms.nonce,action:"load_more_terms",current_term_id:s,page:n,kb_slug:null!=l?.attr("block_id")&&null!=l?.attr("block_id")?window?.eval("betterdocsRelatedTerms_"+l?.attr("block_id"))?.kb_slug:betterdocsRelatedTerms.kb_slug};null!=l?.attr("block_id")&&null!=l?.attr("block_id")&&(i.block_attributes=window?.eval("betterdocsRelatedTerms_"+l?.attr("block_id"))?.block_attributes,i.action="load_more_terms_gutenberg"),e.ajax({url:null!=l?.attr("block_id")&&null!=l?.attr("block_id")?window?.eval("betterdocsRelatedTerms_"+l?.attr("block_id"))?.ajax_url:betterdocsRelatedTerms.ajax_url,type:"GET",data:i,beforeSend:()=>{d.text("Loading"),c.css("display","block")},success:t=>{if(""!=t.data){l.data("page",n+1);var a=e(t.data.html);let r=setTimeout((()=>{d.text("Load More"),c.css("display","none"),o.append(a),a.css("opacity",0).slideDown("slow").animate({opacity:3}),t.data?.has_more_term||(e(l.parent()).remove(),clearTimeout(r))}),100)}}})}))}))}(jQuery);