!function(e){"use strict";var t,a,n,o=(t=function(){jQuery(".w3-comment-reply").on("click",function(t){t.preventDefault();var a=e(this).data("commentid");e(this).data("postid");var n=e(this).data("replyto"),o=e(this).parents(".comment .comment-body:first");e("#comment_parent").val(a),e("#commentform").trigger("reset"),e("#cancel-comment-reply").removeClass("d-none"),e("#reply-title").parent().removeClass("d-none").addClass("d-block"),e("#reply-title").html(n),e("#ReplyFormContainer").insertAfter(o)}),jQuery("#cancel-comment-reply").on("click",function(t){t.preventDefault(),e("#comment_parent").val(0),e("#reply-title").empty(),e("#reply-title").parent().removeClass("d-block").addClass("d-none"),e("#cancel-comment-reply").addClass("d-none"),e("#ReplyFormContainer").appendTo("#comments-div")})},a=function(){jQuery(".ajax-load-more").on("click",function(t){t.preventDefault();var a=jQuery(this),n=a.data("form-id"),o=e("#"+n).find('input[name="page"]').val(),i=e("#"+n).find('input[name="ajax_container"]').val(),l=e("#"+n).serialize();jQuery.ajax({headers:{"X-CSRF-TOKEN":e('meta[name="csrf-token"]').attr("content")},type:"Post",url:baseUrl+"/ajax-get-data",data:l,success:function(t){t.html?(jQuery("#"+i).append(t.html),t.has_more_pages?(o++,e("#"+n).find('input[name="page"]').val(o)):(e(a).text("No More Posts"),e(a).prop("disabled",!0).addClass("disabled"))):alert("Failed to load more posts.")}})})},n=function(){let t=e(".image-select");t.find("option").each((t,a)=>{let n=e(a),o=n.attr("data-thumbnail");o&&n.attr("data-content","<img src='%i'/> %s".replace(/%i/,o).replace(/%s/,n.text()))}),t.selectpicker()},{init:function(){n(),t(),a()}});jQuery(document).ready(function(){o.init()})}(jQuery);