File: /home/slfopp7cb1df/public_html/shaneconrad.me/wp-content/plugins/shared-files/dist/js/p.js
(()=>{"use strict";jQuery((function(e){!function(e){e(".sf-public-file-upload-container input[type=checkbox]").prop("disabled",!1),e(".sf-termlist input[type=checkbox]").click((function(){this.checked?e(this).parents("li").children().children("input[type=checkbox]").prop("checked",!0):e(this).parents("li").children().children("input[type=checkbox]").prop("checked",!1)}))}(e),function(e){e(document).on("click",".shared-files-add-to-favorites",(function(s){s.preventDefault();var i={action:"sf_add_to_favorites",file_id:e(this).data("file-id")},a=e(this).parent();jQuery.post(ajaxurl,i,(function(e){var s=e.replace(/0$/,"");a.html(s)}))})),e(document).on("click",".shared-files-delete-from-favorites",(function(s){s.preventDefault();var i={action:"sf_delete_from_favorites",file_id:e(this).data("file-id")},a=e(this).parent();jQuery.post(ajaxurl,i,(function(e){var s=e.replace(/0$/,"");a.html(s)}))}))}(e),function(e){e(document).on("click",".shared-files-modal-container",(function(s){if(s.target===this){var i=e(this).data("file-id");i?e(".shared-files-modal-container-"+i).hide():e(".shared-files-modal-container").hide()}})),e(document).on("click",".shared-files-close-modal",(function(s){s.preventDefault();var i=e(this).data("file-id");i?e(".shared-files-modal-container-"+i).hide():e(".shared-files-modal-container").hide()})),e(document).on("click",".shared-files-edit-file",(function(s){s.preventDefault();var i=e(this).data("file-id"),a=".shared-files-modal-container-edit-file-"+i,l="shared-files-description-editor-file-"+i;tinyMCE.execCommand("mceRemoveEditor",!1,"shared-files-editor-"+i),tinyMCE.editors.length=0,tinyMCE.init({mode:"specific_textareas",elements:"pre-details",theme:"modern",skin:"lightgray",menubar:!1,statusbar:!1,toolbar:["bold italic underline | alignleft aligncenter alignright | bullist numlist outdent indent | undo redo | link"],plugins:"paste, lists, link",paste_auto_cleanup_on_paste:!0,paste_postprocess:function(e,s){s.node.innerHTML=s.node.innerHTML.replace(/ +/gi," ")},editor_selector:l}),e(a).show()}))}(e),function(e){var s="";e(".shared-files-container .shared-files-category-select, .shared-files-container .shared-files-tag-select, .shared-files-container .shared-files-custom-field-select").change((function(){var s=e(this).closest("form").data("elem-class"),i=e(this).closest("form").data("restricted"),a="";(a=e(this).closest("form").find('select[name="sf_category"]').val())||(a=e(this).closest("form").find('input[name="sf_category"]').val());var l={action:"sf_get_files",sf_category:a,sf_tag:e(this).closest("form").find('select[name="sf_tag"]').val(),atts:e(this).closest("form").find('input[name="atts"]').val(),restricted:i,cf_1:e(this).closest("form").find('select[name="cf_1"]').val(),cf_2:e(this).closest("form").find('select[name="cf_2"]').val(),cf_3:e(this).closest("form").find('select[name="cf_3"]').val(),cf_4:e(this).closest("form").find('select[name="cf_4"]').val(),cf_5:e(this).closest("form").find('select[name="cf_5"]').val(),cf_6:e(this).closest("form").find('select[name="cf_6"]').val(),cf_7:e(this).closest("form").find('select[name="cf_7"]').val(),cf_8:e(this).closest("form").find('select[name="cf_8"]').val(),cf_9:e(this).closest("form").find('select[name="cf_9"]').val(),cf_10:e(this).closest("form").find('select[name="cf_10"]').val(),cf_11:e(this).closest("form").find('select[name="cf_11"]').val(),cf_12:e(this).closest("form").find('select[name="cf_12"]').val(),cf_13:e(this).closest("form").find('select[name="cf_13"]').val(),cf_14:e(this).closest("form").find('select[name="cf_14"]').val(),cf_15:e(this).closest("form").find('select[name="cf_15"]').val(),cf_16:e(this).closest("form").find('select[name="cf_16"]').val(),cf_17:e(this).closest("form").find('select[name="cf_17"]').val(),cf_18:e(this).closest("form").find('select[name="cf_18"]').val(),cf_19:e(this).closest("form").find('select[name="cf_19"]').val(),cf_20:e(this).closest("form").find('select[name="cf_20"]').val()};jQuery.post(ajaxurl,l,(function(i){var a=i.replace(/0$/,"");e("."+s+" .shared-files-search-files").val(""),e("."+s+" .shared-files-nothing-found").hide(),e("."+s+" .shared-files-files-found").hide(),e("."+s+" .shared-files-non-ajax").hide(),e("."+s+" .shared-files-pagination").hide(),e("."+s+" .shared-files-pagination-improved").hide(),e("."+s+" .shared-files-ajax-list").empty().append(a);var l="./?"+e("."+s+" .shared-files-ajax-form select").serialize();window.history.pushState({urlPath:l},"",l)}))})),e(".shared-files-search-files:not(.shared-files-search-files-active-only)").keyup((function(i){var a,l,t,f,r=e(this).data("elem-class");l=(a=e("."+r+" .shared-files-search-files")).val().toUpperCase(),e("."+r+" .shared-files-all-files"),t=e("."+r+" .shared-files-all-files li");for(var n=0,o=0,d=0;d<t.length;d++)(f=t[d].getElementsByClassName("shared-files-main-elements")[0])&&f.textContent.toUpperCase().indexOf(l)>-1?(t[d].style.display="",o++):(t[d].style.display="none",n++);var h="."+r;if(1==parseInt(e(h).data("search-type"))){var c=a.val();if(s!=c){var m={action:"shared_files_search_log",search:c,post_id:e(h).data("post-id")};jQuery.post(ajaxurl,m,(function(e){e.replace(/0$/,"")})),s=c}}""==a.val()?(e("."+r+" .shared-files-nothing-found").hide(),e("."+r+" .shared-files-files-found").hide(),e("."+r+" .shared-files-main-file-list").show(),e("."+r+" .shared-files-pagination").show(),e("."+r+" .shared-files-pagination-improved").show(),e("."+r+" .shared-files-all-files").hide()):t.length==n?(e("."+r+" .shared-files-nothing-found").show(),e("."+r+" .shared-files-files-found").hide(),e("."+r+" .shared-files-main-file-list").hide(),e("."+r+" .shared-files-pagination").hide(),e("."+r+" .shared-files-pagination-improved").hide(),e("."+r+" .shared-files-all-files").css("display","flex")):(e("."+r+" .shared-files-nothing-found").hide(),e("."+r+" .shared-files-files-found").html(o+" "+(o>1?e("."+r+" .shared-files-more-than-one-file-found").html():e("."+r+" .shared-files-one-file-found").html())),e("."+r+" .shared-files-files-found").show(),e("."+r+" .shared-files-main-file-list").hide(),e("."+r+" .shared-files-pagination").hide(),e("."+r+" .shared-files-pagination-improved").hide(),e("."+r+" .shared-files-all-files").css("display","flex"))})),e(".shared-files-search-files.shared-files-search-files-active-only").keyup((function(i){var a,l,t,f,r=e(this).data("elem-class");l=(a=e("."+r+" .shared-files-search-files")).val().toUpperCase(),e("."+r+" .shared-files-ajax-list"),t=e("."+r+" .shared-files-ajax-list li");for(var n=0,o=0,d=0;d<t.length;d++)(f=t[d].getElementsByClassName("shared-files-main-elements")[0])&&f.textContent.toUpperCase().indexOf(l)>-1?(t[d].style.display="",o++):(t[d].style.display="none",n++);var h="."+r;if(1==parseInt(e(h).data("search-type"))){var c=a.val();if(s!=c){var m={action:"shared_files_search_log",search:c,post_id:e(h).data("post-id")};jQuery.post(ajaxurl,m,(function(e){e.replace(/0$/,"")})),s=c}}""==a.val()?(e("."+r+" .shared-files-nothing-found").hide(),e("."+r+" .shared-files-files-found").hide(),e("."+r+" .shared-files-pagination").show(),e("."+r+" .shared-files-pagination-improved").show()):t.length==n?(e("."+r+" .shared-files-nothing-found").show(),e("."+r+" .shared-files-files-found").hide(),e("."+r+" .shared-files-pagination").hide(),e("."+r+" .shared-files-pagination-improved").hide()):(e("."+r+" .shared-files-nothing-found").hide(),e("."+r+" .shared-files-files-found").html(o+" "+(o>1?e("."+r+" .shared-files-more-than-one-file-found").html():e("."+r+" .shared-files-one-file-found").html())),e("."+r+" .shared-files-files-found").show(),e("."+r+" .shared-files-pagination").hide(),e("."+r+" .shared-files-pagination-improved").hide())}))}(e),function(e){var s="";e(".shared-files-simple-container .shared-files-category-select, .shared-files-simple-container .shared-files-tag-select, .shared-files-simple-container .shared-files-custom-field-select").change((function(){var s=e(this).closest("form").data("elem-class"),i="";(i=e(this).closest("form").find('select[name="sf_category"]').val())||(i=e(this).closest("form").find('input[name="sf_category"]').val());var a={action:"sf_get_files_simple",sf_category:i,sf_tag:e(this).closest("form").find('select[name="sf_tag"]').val(),atts:e(this).closest("form").find('input[name="atts"]').val(),cf_1:e(this).closest("form").find('select[name="cf_1"]').val(),cf_2:e(this).closest("form").find('select[name="cf_2"]').val(),cf_3:e(this).closest("form").find('select[name="cf_3"]').val(),cf_4:e(this).closest("form").find('select[name="cf_4"]').val(),cf_5:e(this).closest("form").find('select[name="cf_5"]').val(),cf_6:e(this).closest("form").find('select[name="cf_6"]').val(),cf_7:e(this).closest("form").find('select[name="cf_7"]').val(),cf_8:e(this).closest("form").find('select[name="cf_8"]').val(),cf_9:e(this).closest("form").find('select[name="cf_9"]').val(),cf_10:e(this).closest("form").find('select[name="cf_10"]').val(),cf_11:e(this).closest("form").find('select[name="cf_11"]').val(),cf_12:e(this).closest("form").find('select[name="cf_12"]').val(),cf_13:e(this).closest("form").find('select[name="cf_13"]').val(),cf_14:e(this).closest("form").find('select[name="cf_14"]').val(),cf_15:e(this).closest("form").find('select[name="cf_15"]').val(),cf_16:e(this).closest("form").find('select[name="cf_16"]').val(),cf_17:e(this).closest("form").find('select[name="cf_17"]').val(),cf_18:e(this).closest("form").find('select[name="cf_18"]').val(),cf_19:e(this).closest("form").find('select[name="cf_19"]').val(),cf_20:e(this).closest("form").find('select[name="cf_20"]').val()};jQuery.post(ajaxurl,a,(function(i){var a=i.replace(/0$/,"");e("."+s+" .shared-files-simple-search").val(""),e("."+s+" .shared-files-simple-nothing-found").hide(),e("."+s+" .shared-files-files-found").hide(),e("."+s+" .shared-files-non-ajax").hide(),e("."+s+" .shared-files-pagination").hide(),e("."+s+" .shared-files-pagination-improved").hide(),e("."+s+" .shared-files-simple-ajax-results").empty().append(a);var l="./?"+e("."+s+" .shared-files-ajax-form select").serialize();window.history.pushState({urlPath:l},"",l)}))})),e(".shared-files-simple-search:not(.shared-files-simple-search-active-only)").keyup((function(){var i,a,l,t,f=e(this).data("elem-class");a=(i=e("."+f+" .shared-files-simple-search")).val().toUpperCase(),e("."+f+" .shared-files-simple-search-all-files .shared-files-simple-list"),l=e("."+f+" .shared-files-simple-search-all-files .shared-files-simple-list .shared-files-simple-list-row:not(.shared-files-simple-list-title-row)");for(var r=0,n=0,o=0;o<l.length;o++)(t=l[o])&&t.textContent.toUpperCase().indexOf(a)>-1?(l[o].style.display="",n++):(l[o].style.display="none",r++);var d="."+f;if(1==parseInt(e(d).data("search-type"))){var h=i.val();if(s!=h){var c={action:"shared_files_search_log",search:h,post_id:e(d).data("post-id")};jQuery.post(ajaxurl,c,(function(e){e.replace(/0$/,"")})),s=h}}""==i.val()?(e("."+f+" .shared-files-simple-ajax-results").show(),e("."+f+" .shared-files-simple-search-all-files").hide(),e("."+f+" .shared-files-simple-nothing-found").hide(),e("."+f+" .shared-files-files-found").hide(),e("."+f+" .shared-files-pagination").show(),e("."+f+" .shared-files-pagination-improved").show()):l.length==r?(e("."+f+" .shared-files-simple-ajax-results").hide(),e("."+f+" .shared-files-simple-search-all-files").hide(),e("."+f+" .shared-files-simple-nothing-found").show(),e("."+f+" .shared-files-files-found").hide(),e("."+f+" .shared-files-pagination").hide(),e("."+f+" .shared-files-pagination-improved").hide()):(e("."+f+" .shared-files-simple-ajax-results").hide(),e("."+f+" .shared-files-simple-search-all-files").show(),e("."+f+" .shared-files-simple-nothing-found").hide(),e("."+f+" .shared-files-files-found").html(n+" "+(n>1?e("."+f+" .shared-files-more-than-one-file-found").html():e("."+f+" .shared-files-one-file-found").html())),e("."+f+" .shared-files-files-found").show(),e("."+f+" .shared-files-pagination").hide(),e("."+f+" .shared-files-pagination-improved").hide())})),e(".shared-files-simple-search.shared-files-simple-search-active-only").keyup((function(){var i,a,l,t,f=e(this).data("elem-class");a=(i=e("."+f+" .shared-files-simple-search")).val().toUpperCase(),e("."+f+" .shared-files-simple-ajax-results .shared-files-simple-list"),l=e("."+f+" .shared-files-simple-ajax-results .shared-files-simple-list .shared-files-simple-list-row:not(.shared-files-simple-list-title-row)");for(var r=0,n=0,o=0;o<l.length;o++)(t=l[o])&&t.textContent.toUpperCase().indexOf(a)>-1?(l[o].style.display="",n++):(l[o].style.display="none",r++);var d="."+f;if(1==parseInt(e(d).data("search-type"))){var h=i.val();if(s!=h){var c={action:"shared_files_search_log",search:h,post_id:e(d).data("post-id")};jQuery.post(ajaxurl,c,(function(e){e.replace(/0$/,"")})),s=h}}""==i.val()?(e("."+f+" .shared-files-simple-ajax-results").show(),e("."+f+" .shared-files-simple-nothing-found").hide(),e("."+f+" .shared-files-files-found").hide(),e("."+f+" .shared-files-pagination").show(),e("."+f+" .shared-files-pagination-improved").show()):l.length==r?(e("."+f+" .shared-files-simple-ajax-results").hide(),e("."+f+" .shared-files-simple-nothing-found").show(),e("."+f+" .shared-files-files-found").hide(),e("."+f+" .shared-files-pagination").hide(),e("."+f+" .shared-files-pagination-improved").hide()):(e("."+f+" .shared-files-simple-ajax-results").show(),e("."+f+" .shared-files-simple-nothing-found").hide(),e("."+f+" .shared-files-files-found").html(n+" "+(n>1?e("."+f+" .shared-files-more-than-one-file-found").html():e("."+f+" .shared-files-one-file-found").html())),e("."+f+" .shared-files-files-found").show(),e("."+f+" .shared-files-pagination").hide(),e("."+f+" .shared-files-pagination-improved").hide())}))}(e),function(e){e(document).on("click",".shared-files-accordion-show-all",(function(s){s.preventDefault();var i=e(this).data("elem-class"),a="."+i+" .shared-files-accordion-show-all",l="."+i+" .shared-files-accordion-hide-all",t="."+i+" .shared-files-accordion-category",f="."+i+" .shared-files-accordion-contents";e(t).removeClass("shared-files-accordion-category-closed"),e(t).addClass("shared-files-accordion-category-open"),e(f).show(),e(a).hide(),e(l).css("display","inline-block")})),e(document).on("click",".shared-files-accordion-hide-all",(function(s){s.preventDefault();var i=e(this).data("elem-class"),a="."+i+" .shared-files-accordion-show-all",l="."+i+" .shared-files-accordion-hide-all",t="."+i+" .shared-files-accordion-category",f="."+i+" .shared-files-accordion-contents";e(t).removeClass("shared-files-accordion-category-open"),e(t).addClass("shared-files-accordion-category-closed"),e(f).hide(),e(a).css("display","inline-block"),e(l).hide()})),e(document).on("click",".shared-files-accordion-category-title-container",(function(s){var i=e(this).data("elem-class"),a=e(this).data("category-id"),l="."+i+" .shared-files-accordion-category-"+a,t="."+i+" .shared-files-accordion-contents-"+a;e(t).is(":visible")?(e(l).removeClass("shared-files-accordion-category-open"),e(l).addClass("shared-files-accordion-category-closed"),e(t).hide()):(e(l).addClass("shared-files-accordion-category-open"),e(l).removeClass("shared-files-accordion-category-closed"),e(t).show())}))}(e),function(e){var s="";e(".shared-files-search-all-files").keyup((function(){var i,a,l,t,f=e(this).data("elem-class");a=(i=e("."+f+" .shared-files-search-all-files")).val().toUpperCase();for(var r=e("."+f+" .shared-files-in-category"),n=0,o=0;o<r.length;o++){l=r[o].getElementsByTagName("li");for(var d=0,h=0;h<l.length;h++)(t=l[h].getElementsByClassName("shared-files-main-elements")[0])&&t.textContent.toUpperCase().indexOf(a)>-1?(l[h].style.display="",n++,d++):l[h].style.display="none";r[o].parentElement.style.display=0==d?"none":""}var c="."+f;if(1==parseInt(e(c).data("search-type"))){var m=i.val();if(s!=m){var p={action:"shared_files_search_log",search:m,post_id:e(c).data("post-id")};jQuery.post(ajaxurl,p,(function(e){e.replace(/0$/,"")})),s=m}}""==i.val()?(e("."+f+" .shared-files-nothing-found").hide(),e("."+f+" .shared-files-files-found").hide(),e("."+f+" .shared-files-all-files-and-categories").hide()):0==n?(e("."+f+" .shared-files-nothing-found").show(),e("."+f+" .shared-files-files-found").hide(),e("."+f+" .shared-files-all-files-and-categories").show()):(e("."+f+" .shared-files-nothing-found").hide(),e("."+f+" .shared-files-files-found").html(n+" "+(n>1?e("."+f+" .shared-files-more-than-one-file-found").html():e("."+f+" .shared-files-one-file-found").html())),e("."+f+" .shared-files-files-found").show(),e("."+f+" .shared-files-all-files-and-categories").show())})),e(".shared-files-search-files-v2").keyup((function(){var i,a,l,t,f=e(this).data("elem-class");a=(i=e("."+f+" .shared-files-search-files-v2")).val().toUpperCase(),e("."+f+" .shared-files-all-files"),l=e("."+f+" .shared-files-all-files li");for(var r=0,n=0,o=0;o<l.length;o++)(t=l[o].getElementsByClassName("shared-files-main-elements")[0])&&t.textContent.toUpperCase().indexOf(a)>-1?(l[o].style.display="",n++):(l[o].style.display="none",r++);var d="."+f;if(1==parseInt(e(d).data("search-type"))){var h=i.val();if(s!=h){var c={action:"shared_files_search_log",search:h,post_id:e(d).data("post-id")};jQuery.post(ajaxurl,c,(function(e){e.replace(/0$/,"")})),s=h}}""==i.val()?(e("."+f+" .shared-files-nothing-found").hide(),e("."+f+" .shared-files-files-found").hide(),e("."+f+" .shared-files-main-file-list").show(),e("."+f+" .shared-files-pagination").show(),e("."+f+" .shared-files-pagination-improved").show(),e("."+f+" .shared-files-all-files").hide()):l.length==r?(e("."+f+" .shared-files-nothing-found").show(),e("."+f+" .shared-files-files-found").hide(),e("."+f+" .shared-files-main-file-list").hide(),e("."+f+" .shared-files-pagination").hide(),e("."+f+" .shared-files-pagination-improved").hide(),e("."+f+" .shared-files-all-files").css("display","flex")):(e("."+f+" .shared-files-nothing-found").hide(),e("."+f+" .shared-files-files-found").html(n+" "+(n>1?e("."+f+" .shared-files-more-than-one-file-found").html():e("."+f+" .shared-files-one-file-found").html())),e("."+f+" .shared-files-files-found").show(),e("."+f+" .shared-files-main-file-list").hide(),e("."+f+" .shared-files-pagination").hide(),e("."+f+" .shared-files-pagination-improved").hide(),e("."+f+" .shared-files-all-files").css("display","flex"))}))}(e),function(e){var s="";e(".shared-files-search-file-exact").keyup((function(){var i=e(this).data("elem-class"),a=e(this),l="."+i;if(1==parseInt(e(l).data("search-type"))){var t=a.val();if(s!=t){var f={action:"shared_files_search_log",search:t,post_id:e(l).data("post-id")};jQuery.post(ajaxurl,f,(function(e){e.replace(/0$/,"")})),s=t}}}))}(e),function(e){e(document).on("click","a.shared-files-file-title, a.shared-files-preview-image",(function(s){var i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),a=e(this).data("file-type"),l=e(this).data("file-url"),t=e(this).data("external-url"),f=e(this).attr("href");if(e(this).data("image-url")&&(f=e(this).data("image-url")),a.startsWith("video")&&!i){s.preventDefault();var r=l,n=e(this).data("video-url-redir");n&&(r=n);var o='<video preload controls autoplay><source src="'+r+'" /></video>',d=basicLightbox.create(o);jQuery.post(l,{only_meta:1},(function(e){})),d.show()}else if("youtube"==a&&t){s.preventDefault();var h=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/),c=h&&11===h[2].length?h[2]:null,m=basicLightbox.create('<iframe allow="autoplay" src="//www.youtube.com/embed/'+c+'?autoplay=1" width="560" height="315" frameborder="0" allowfullscreen style="width: 560px;"></iframe>');jQuery.post(l,{youtube:1},(function(e){})),m.show()}else"image"==a&&(s.preventDefault(),basicLightbox.create('<img src="'+f+'" />').show(),l&&jQuery.post(l,{only_meta:1},(function(e){})))}))}(e)}))})();