jQuery(document).ready(function(t){t.ajaxSetup({cache:!0}),__tnt.user.loggedIn?($userDir=t(".tn-user-profile-url").data("app"),t(".tn-user-screenname").html(__tnt.user.screenName),__tnt.user.avatar&&t(".tn-user-avatar").attr("src",__tnt.user.avatar),t(".tn-user-profile-url").attr("href",$userDir+"profile/"+__tnt.user.screenName+"/"),t(".logged-in").show()):t(".not-logged-in").show(),t("[data-toggle=offcanvas]").on(__tnt.client.clickEvent,function(){var e="left"===t(this).data("target")?"active-left":"active-right";return t("html").toggleClass("drawer-open "+e),!1}),t(".offcanvas-close-btn").on(__tnt.client.clickEvent,function(){return t("html").removeClass("drawer-open active-left active-right"),!1}),t(".hide-onload").hide(),t(".show-onload").show(),Array.from(document.querySelectorAll(".save-asset")).forEach(function(e){e.addEventListener("click",function(a){a.preventDefault(),t(".save-list-"+e.getAttribute("data-asset-uuid")+"-form").submit()})}),t(".save-asset-to-list").on("submit",function(e){if(e.preventDefault(),__tnt.user.loggedIn){var a=t(this).data("uuid"),r=".save-list-"+a+"-btn";t.ajax({type:"POST",url:t(this).attr("action"),data:t(this).serialize(),error:function(){alert("An error ocurred. Please try again.")},success:function(e){e.success?(t(r).addClass("disabled").attr("title","Saved"),t(r+" .asset-save-icon").attr("data-prefix","fas"),t(r+" .share-expand").text("Saved")):(t(r).addClass("btn-danger"),t(r+" .share-expand").text("Error"),setTimeout(function(){t(r).removeClass("btn-danger"),t(r+" .share-expand").text("Save")},1e3))}})}else{var n=window.location.href,s=window.location.search?"&":"?",o=encodeURIComponent(n+s+"save_asset="+t(this).data("uuid"));top.location.href="/users/login/?referer_url="+o}return!1}),t('[data-toggle="tooltip"]').length>0&&t('[data-toggle="tooltip"]').tooltip(),t('[data-toggle="new-window"]').click(function(e){e.preventDefault();var a=t(this).attr("href"),r=t(this).data("new-window-width"),n=t(this).data("new-window-height"),s=screen.width/2-r/2,o=screen.height/2-n/2;window.open(a,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width="+r+",height="+n+",top="+o+",left="+s)}),jQuery().stupidtable&&t(".table-sortable").stupidtable()}); //# sourceMappingURL=application.d7e566f2ec7f9a8512220af2ca01f265.js.map