Tutor LMS – eLearning and online course solution - Version 2.1.2

Version Description

  • November 2, 2022

Update: BunnyNet Compatibility Update is Introduced Update: More Security Compatibility Update is Introduced Fix: Backend Assignment page was not showing newly submitted assignments in some cases

Download this release

Release Info

Developer themeum
Plugin Icon wp plugin Tutor LMS – eLearning and online course solution
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

assets/js/tutor-front.min.js CHANGED
@@ -1,4 +1,4 @@
1
- (()=>{var n={3676:()=>{window.readyState_complete=function(e){var r=function t(e){return e()};document.addEventListener("readystatechange",function(t){return t.target.readyState==="complete"?typeof e=="function"?setTimeout(function(){return r(e)}):"":""})};window.addBodyClass=function(t){var e=new URL(t);var r=e.searchParams.get("tab_page");var n=e.searchParams.get("edit")&&"_edit";document.body.classList.add(r);document.body.classList.add(r+n)};window.selectorById=function(t){return document.getElementById(t)};window.selectorByClass=function(t){return document.getElementsByClassName(t)};window.json_download=function(t,e){var r=new Blob([t],{type:"application/json"});var n=document.createElement("a");n.href=URL.createObjectURL(r);n.download=e;n.click()}},4367:()=>{window.selectSearchField=function(t){var r=document.querySelectorAll(t);(function(){r.forEach(function(o){if(o&&!o.classList.contains("tutor-js-form-select")&&!o.hasAttribute("noDropdown")&&!o.classList.contains("no-tutor-dropdown")){var t=o.options[o.selectedIndex];o.style.display="none";var i,e,r,a,n,u,c,s;o.insertAdjacentHTML("afterend",h(o.options));i=o.nextElementSibling;e=i.querySelector(".tutor-form-select-search");r=e&&e.querySelector("input");if(o.options.length<10){e.style.display="none"}s=i.querySelector(".tutor-form-select-dropdown");var l=i.querySelector(".tutor-form-select-label");l.innerText=t&&t.text;i.onclick=function(t){t.stopPropagation();f(document.querySelectorAll(".tutor-js-form-select"));i.classList.toggle("is-active");setTimeout(function(){r.focus()},100);s.onclick=function(t){t.stopPropagation()}};f(document.querySelectorAll(".tutor-js-form-select"));n=e.nextElementSibling;u=n&&n.querySelectorAll(".tutor-form-select-option");if(u){u.forEach(function(t){t.onclick=function(n){n.stopPropagation();var t=Array.from(o.options);t.forEach(function(t,e){if(t.value===n.target.dataset.key){i.classList.remove("is-active");l.innerText=n.target.innerText;l.dataset.value=t.value;o.value=t.value;var r=document.getElementById("save_tutor_option");if(r){r.disabled=false}}});var e=new Event("change",{bubbles:true});o.dispatchEvent(e)}})}var d=function t(e){var r=0;e.forEach(function(t){if(t.style.display!=="none"){r+=1}});return r};r.oninput=function(t){var e,r=false;a=t.target.value.toUpperCase();u.forEach(function(t){c=t.querySelector("[tutor-dropdown-item]");e=c.textContent||c.innerText;if(e.toUpperCase().indexOf(a)>-1){t.style.display="";r="false"}else{r="true";t.style.display="none"}});var n='\n <div class="tutor-form-select-option noItem">\n No item found\n </div>\n ';var o=s.querySelector(".tutor-form-select-options");if(0==d(u)){var i=false;o.querySelectorAll(".tutor-form-select-option").forEach(function(t){if(t.classList.contains("noItem")==true){i=true}});if(false==i){o.insertAdjacentHTML("beforeend",n);i=true}}else{if(null!==s.querySelector(".noItem")){s.querySelector(".noItem").remove()}}}}});var t=document.querySelectorAll(".tutor-js-form-select");t.forEach(function(t){if(t.nextElementSibling){if(t.nextElementSibling.classList.contains("tutor-js-form-select")){t.nextElementSibling.remove()}}});var e=document.querySelectorAll(".tutor-js-form-select");document.onclick=function(t){f(e)}})();function f(t){if(t){t.forEach(function(t){t.classList.remove("is-active")})}}function h(t){var e="";Array.from(t).forEach(function(t){e+='\n <div class="tutor-form-select-option">\n\t\t\t\t<span tutor-dropdown-item data-key="'.concat(t.value,'" class="tutor-nowrap-ellipsis" title="').concat(t.text,'">').concat(t.text,"</span>\n </div>\n ")});var r='\n <div class="tutor-form-control tutor-form-select tutor-js-form-select">\n\t\t\t<span class="tutor-form-select-label" tutor-dropdown-label>'.concat(window.wp.i18n.__("Select","tutor"),'</span>\n <div class="tutor-form-select-dropdown">\n\t\t\t\t<div class="tutor-form-select-search tutor-pt-8 tutor-px-8">\n\t\t\t\t\t<div class="tutor-form-wrap">\n\t\t\t\t\t\t<span class="tutor-form-icon"><i class="tutor-icon-search" area-hidden="true"></i></span>\n\t\t\t\t\t\t<input type="search" class="tutor-form-control" placeholder="Search ..." />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n <div class="tutor-form-select-options">\n ').concat(e,"\n </div>\n </div>\n </div>\n ");return r}};selectSearchField(".tutor-form-select")},1103:()=>{window.jQuery(document).ready(function(i){i("div.tutor-lesson-wrapper [data-mce-style]").each(function(){i(this).attr("style",i(this).attr("data-mce-style"));i(this).removeAttr("data-mce-style")});i(document).on("click",'.tutor-single-course-lesson-comments button[type="submit"]',function(t){t.preventDefault();var e=wp.i18n.__;var r=i(this);var o=r.closest("form");var n=o.serialize();i.ajax({url:_tutorobject.ajaxurl,type:"POST",data:n,beforeSend:function t(){r.addClass("is-loading").prop("disabled",true)},complete:function t(){r.removeClass("is-loading");r.removeAttr("disabled")},success:function t(e){var r=o.attr("tutor-comment-reply");if(typeof r!=="undefined"&&r!==false){o.before(e.data.html)}else{var n=document.querySelector(".tutor-course-spotlight-comments");n.innerHTML=e.data.html}i(".tutor-comment-line").css("height","calc(100% - 308px)");i("textarea").val("")},error:function t(e){r.removeClass("is-loading").prop("disabled",false)}})})})},818:()=>{window.jQuery(document).ready(function(t){if(t.fn.ShareLink){var e=t(".tutor-social-share-wrap");if(e.length){var r=JSON.parse(e.attr("data-social-share-config"));e.find(".tutor_share").ShareLink({title:r.title,text:r.text,image:r.image,class_prefix:"s_",width:640,height:480})}}})},6470:()=>{window.jQuery(document).ready(function(f){var h=window.wp.i18n.__;if(f(".tutor-quiz-wrap").length){if(!f(".tutor-table-quiz-attempts").length&&!f(".tutor-quiz-attempt-details").length){f(".tutor-course-topic-single-footer").remove()}}var p=f("#tutor-quiz-time-update");if(p.length){var t=JSON.parse(p.attr("data-attempt-settings"));var v=JSON.parse(p.attr("data-attempt-meta"));if(v.time_limit.time_limit_seconds>0){var e,r;var m=new Date((e=t.attempt_started_at)===null||e===void 0?void 0:e.replaceAll("-","/")).getTime()+v.time_limit.time_limit_seconds*1e3;var g=new Date((r=v.date_time_now)===null||r===void 0?void 0:r.replaceAll("-","/")).getTime();var y=setInterval(function(){var t=m-g;var e=Math.floor(t/(1e3*60*60*24));var r=Math.floor(t%(1e3*60*60*24)/(1e3*60*60));var n=Math.floor(t%(1e3*60*60)/(1e3*60));var o=Math.floor(t%(1e3*60)/1e3);var i="";e?i+=e+"d ":0;i+=(r||0)+"h ";i+=(n||0)+"m ";i+=(o||0)+"s ";if(t<0){clearInterval(y);p.toggleClass("tutor-quiz-time-expired");i="EXPIRED";if(_tutorobject.quiz_options.quiz_when_time_expires==="auto_submit"){f("form#tutor-answering-quiz").submit()}else{f(".tutor-quiz-answer-next-btn, .tutor-quiz-submit-btn, .tutor-quiz-answer-previous-btn").prop("disabled",true);f(".time-remaining span").css("color","#F44337");f.ajax({url:_tutorobject.ajaxurl,type:"POST",data:{quiz_id:f("#tutor_quiz_id").val(),action:"tutor_quiz_timeout"},success:function t(e){var r=f("#tutor-quiz-time-expire-wrapper").data("attempt-allowed");var n=f("#tutor-quiz-time-expire-wrapper").data("attempt-remaining");var o="#tutor-quiz-time-expire-wrapper";f(o).addClass("tutor-alert-show");if(n>0){f("".concat(o," .tutor-quiz-alert-text")).html(h("Your time limit for this quiz has expired, please reattempt the quiz. Attempts remaining:","tutor")+" "+n+"/"+r)}else{if(f(o).hasClass("time-remaining-warning")){f(o).removeClass("time-remaining-warning");f(o).addClass("time-over")}if(f("".concat(o," .flash-info span:first-child")).hasClass("tutor-icon-circle-info")){f("".concat(o," .flash-info span:first-child")).removeClass("tutor-icon-circle-info");f("".concat(o," .flash-info span:first-child")).addClass("tutor-icon-circle-times-line")}p.toggleClass("tutor-quiz-time-expired");f("#tutor-start-quiz").hide();f("".concat(o," .tutor-quiz-alert-text")).html("".concat(h("Unfortunately, you are out of time and quiz attempts. ","tutor")))}},complete:function t(){}})}}g=g+1e3;p.html(i);if(i=="EXPIRED"){p.addClass("color-text-error")}if(t){var a=t/1e3;var u=v.time_limit.time_limit_seconds;var c=Math.ceil(a*100/u);var s=document.querySelector(".quiz-time-remaining-progress-circle");var l=document.querySelector(".quiz-time-remaining-progress-circle svg");if(l&&s){var d=44-44*(c/100);if(c<=0){c=0;s.innerHTML='<svg viewBox="0 0 50 50" width="50" height="50">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<circle cx="0" cy="0" r="11"></circle>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</svg>';s.setAttribute("class","quiz-time-remaining-expired-circle")}l.setAttribute("style","stroke-dashoffset: ".concat(d,";"))}}},1e3)}else{p.html(h("No Limit","tutor"))}}var n=f("form#tutor-start-quiz");if(n.length){if(_tutorobject.quiz_options.quiz_auto_start==1){n.submit()}}})},3419:()=>{window.jQuery(document).ready(function(f){var u=window.wp.i18n.__;function h(t){var o=false;var i=JSON.parse(window.tutor_quiz_context.split("").reverse().join(""));!Array.isArray(i)?i=[]:0;var e=t.attr("data-quiz-feedback-mode");f(".tutor-quiz-answer-single-info").remove();f(".tutor-quiz-answer-single").removeClass("tutor-quiz-answer-single-correct tutor-quiz-answer-single-incorrect");var a=true;var r=t.find("input");var n=t.find('input[type="radio"]:checked, input[type="checkbox"]:checked');if(e==="reveal"){n.each(function(){var t=f(this);var e=i.indexOf(t.val())>-1;if(!e){a=false}});r.each(function(){var t=f(this);var e=t.attr("type");if(e==="radio"||e==="checkbox"){var r=i.indexOf(t.val())>-1;var n=t.is(":checked");if(r){t.closest(".tutor-quiz-answer-single").addClass("tutor-quiz-answer-single-correct").append('<span class="tutor-quiz-answer-single-info tutor-color-success tutor-mt-8">\n <i class="tutor-icon-mark tutor-color-success" area-hidden="true"></i>\n '.concat(u("Correct Answer","tutor"),"\n </span>")).find(".tutor-quiz-answer-single-info:eq(1)").remove()}else{if(t.prop("checked")){t.closest(".tutor-quiz-answer-single").addClass("tutor-quiz-answer-single-incorrect")}}if(r&&!n){t.attr("disabled","disabled");a=false;o=true}}})}if(a){o=true}return o}function p(r){var n=true;var t=r.find(".quiz-answer-required");if(t.length){var e=t.find("input");if(e.length){var o=e.attr("type");if(o==="radio"){if(t.find('input[type="radio"]:checked').length==0){r.find(".answer-help-block").html('<p style="color: #dc3545">'.concat(u("Please select an option to answer","tutor"),"</p>"));n=false}}else if(o==="checkbox"){if(t.find('input[type="checkbox"]:checked').length==0){r.find(".answer-help-block").html('<p style="color: #dc3545">'.concat(u("Please select at least one option to answer.","tutor"),"</p>"));n=false}}else if(o==="text"){e.each(function(t,e){if(!f(e).val().trim().length){r.find(".answer-help-block").html('<p style="color: #dc3545">'.concat(u("The answer for this question is required","tutor"),"</p>"));n=false}})}}if(t.find("textarea").length){if(t.find("textarea").val().trim().length<1){r.find(".answer-help-block").html('<p style="color: #dc3545">'.concat(u("The answer for this question is required","tutor"),"</p>"));n=false}}}return n}f(".tutor-quiz-next-btn-all").prop("disabled",false);f(".quiz-attempt-single-question input").filter('[type="radio"], [type="checkbox"]').change(function(){f(".tutor-quiz-next-btn-all").prop("disabled",false)});f(document).on("click",".tutor-quiz-answer-next-btn, .tutor-quiz-answer-previous-btn",function(t){t.preventDefault();var e=f(".tutor-quiz-question-counter>span:first-child");var r=parseInt(f(this).closest("[data-question_index]").data("question_index"));if(f(this).hasClass("tutor-quiz-answer-previous-btn")){f(this).closest(".quiz-attempt-single-question").hide().prev().show();e.text(r-1);return}var n=f(this);var o=n.closest(".quiz-attempt-single-question");var i=p(o);if(!i){return}var a=h(o);if(!l==="reveal"){if(!a){return}}var u=parseInt(n.closest(".quiz-attempt-single-question").attr("id").match(/\d+/)[0],10);var c=n.closest(".quiz-attempt-single-question").attr("data-next-question-id");console.log("next question ".concat(c));if(c){var s=f(c);if(s&&s.length){var l=o.attr("data-quiz-feedback-mode");var d=Number(_tutorobject.quiz_answer_display_time);if(l==="reveal"){setTimeout(function(){f(".quiz-attempt-single-question").hide();s.show()},d)}else{f(".quiz-attempt-single-question").hide();s.show()}if(f(".tutor-quiz-questions-pagination").length){f(".tutor-quiz-question-paginate-item").removeClass("active");f('.tutor-quiz-questions-pagination a[href="'+c+'"]').addClass("active")}e.text(r+1)}}});f(document).on("click",".tutor-quiz-question-paginate-item",function(t){t.preventDefault();var e=f(this);var r=f(e.attr("href"));f(".quiz-attempt-single-question").hide();r.show();f(".tutor-quiz-question-paginate-item").removeClass("active");e.addClass("active")});f(document).on("keyup","textarea.question_type_short_answer, textarea.question_type_open_ended",function(t){var e=f(this);var r=e.val();var n=e.hasClass("question_type_short_answer")?_tutorobject.quiz_options.short_answer_characters_limit:_tutorobject.quiz_options.open_ended_answer_characters_limit;var o=n-r.length;if(o<1){e.val(r.substr(0,n));o=0}e.closest(".tutor-quiz-answers-wrap").find(".characters_remaining").html(o)});f(document).on("submit","#tutor-answering-quiz",function(t){var e=f(".quiz-attempt-single-question");var r=document.querySelector(".tutor-quiz-submit-btn");var n=true;var o=true;if(e.length){e.each(function(t,e){n=p(f(e));o=h(f(e))})}if(n&&o){setTimeout(function(){r.disabled=true},500)}else{t.preventDefault();r.classList.remove("is-loading");r.disabled=false}});f(".tutor-quiz-submit-btn").click(function(t){var e=this;t.preventDefault();var r=t.target.closest(".quiz-attempt-single-question");var n=r.getAttribute("data-quiz-feedback-mode");var o=Number(_tutorobject.quiz_answer_display_time);if(n==="reveal"){var i=f(".quiz-attempt-single-question");var a=true;if(i.length){i.each(function(t,e){a=p(f(e));a=h(f(e))})}f(this).attr("disabled","disabled");setTimeout(function(){f(e).addClass("is-loading");f("#tutor-answering-quiz").submit()},o)}else{f(this).attr("disabled","disabled").addClass("is-loading");f("#tutor-answering-quiz").submit()}});var o=f("#tutor-quiz-time-update");f(document).on("click","a",function(t){var r=f(this).attr("href");if(t.target.classList.contains("sidebar-ask-new-qna-btn")||t.target.classList.contains("tutor-quiz-question-paginate-item")){return}if(o.length>0&&o.text()!="EXPIRED"){t.preventDefault();t.stopImmediatePropagation();var n;var e={title:u("Abandon Quiz?","tutor"),description:u("Do you want to abandon this quiz? The quiz will be submitted partially up to this question if you leave this page.","tutor"),buttons:{keep:{title:u("Yes, leave quiz","tutor"),id:"leave",class:"tutor-btn tutor-btn-outline-primary",callback:function t(){var e=f("form#tutor-answering-quiz").serialize()+"&action="+"tutor_quiz_abandon";f.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:e,beforeSend:function t(){document.querySelector("#tutor-popup-leave").innerHTML=u("Leaving...","tutor")},success:function t(e){if(e.success){location.href=r}else{alert(u("Something went wrong","tutor"))}},error:function t(){alert(u("Something went wrong","tutor"));n.remove()}})}},reset:{title:u("Stay here","tutor"),id:"reset",class:"tutor-btn tutor-btn-primary tutor-ml-20",callback:function t(){n.remove()}}}};n=new window.tutor_popup(f,"").popup(e)}});f("body").on("submit","form#tutor-start-quiz",function(){f(this).find("button").prop("disabled",true)})})},7942:()=>{window.jQuery(document).ready(function(n){var t=wp.i18n.__;n(document).on("click",".tutor-course-wishlist-btn",function(t){t.preventDefault();var r=n(this);var e=r.attr("data-course-id");n.ajax({url:_tutorobject.ajaxurl,type:"POST",data:{course_id:e,action:"tutor_course_add_to_wishlist"},beforeSend:function t(){r.attr("disabled","disabled").addClass("is-loading")},success:function t(e){if(e.success){if(e.data.status==="added"){r.find("i").addClass("tutor-icon-bookmark-bold").removeClass("tutor-icon-bookmark-line")}else{r.find("i").addClass("tutor-icon-bookmark-line").removeClass("tutor-icon-bookmark-bold")}}else{n(".tutor-login-modal").addClass("tutor-is-active")}},complete:function t(){r.removeAttr("disabled").removeClass("is-loading")}})})})},7723:()=>{window.jQuery(document).ready(function(t){t(document).on("added_to_cart",function(t,e,r,n){n.removeClass("is-loading");n.siblings("a.added_to_cart").addClass("tutor-btn tutor-btn-outline-primary tutor-btn-md tutor-btn-block").prepend('<span class="tutor-icon-cart-line tutor-mr-8"></span>')});t(document).on("adding_to_cart",function(t,e){e.addClass("is-loading");setTimeout(function(){e.removeClass("is-loading")},4e3)})})},1626:()=>{function l(e,t){var r=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&typeof e.length==="number"){if(r)e=r;var n=0;var o=function t(){};return{s:o,n:function t(){if(n>=e.length)return{done:true};return{done:false,value:e[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=true,a=false,u;return{s:function t(){r=r.call(e)},n:function t(){var e=r.next();i=e.done;return e},e:function t(e){a=true;u=e},f:function t(){try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}}}function c(t,e){if(!t)return;if(typeof t==="string")return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}function n(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++){n[r]=t[r]}return n}document.addEventListener("DOMContentLoaded",function(){var t=wp.i18n,e=t.__,r=t._x,n=t._n,o=t._nx;var i=document.querySelectorAll(".tutor-export-purchase-history");var a=l(i),u;try{for(a.s();!(u=a.n()).done;){var c=u.value;if(c){c.onclick=function(t){var e=t.currentTarget;var r="order-".concat(e.dataset.order,"-purchase-history.csv");var n=[{"Order ID ":e.dataset.order,"Course Name":e.dataset.courseName,Price:e.dataset.price,Date:e.dataset.date,Status:e.dataset.status}];s(n,r)}}}}catch(t){a.e(t)}finally{a.f()}function s(t,e){var r=Object.keys(t[0]);var n=[r.join(","),t.map(function(e){return r.map(function(t){return e[t]}).join(",")}).join("\n")].join("\n");var o=new Blob([n],{type:"text/csv;charset=utf-8"});var i=URL.createObjectURL(o);var a=document.createElement("a");a.setAttribute("href",i);a.setAttribute("download",e);a.style.visibility="hidden";document.body.appendChild(a);a.click();document.body.removeChild(a)}})},6966:()=>{document.addEventListener("DOMContentLoaded",function(){var e=window.jQuery;e(".tutor-dashboard .tutor-dashboard-menu-toggler").click(function(){var t=e(".tutor-dashboard-left-menu");t.closest(".tutor-dashboard").toggleClass("is-sidebar-expanded");if(t.css("display")!=="none"){t.get(0).scrollIntoView({block:"start"})}})})},6344:(t,e,r)=>{var n=r(3632),i=n.get_response_message;window.jQuery(document).ready(function(o){o('.tutor-settings-pass-field [name="confirm_new_password"]').on("input",function(){var t=o('[name="new_password"]');var e=(t.val()||"").trim();var r=e&&o(this).val()===e;o(this).parent().find(".tutor-validation-icon")[r?"show":"hide"]()});o(".tutor-profile-password-reset").click(function(t){t.preventDefault();var e=o(this);var r=e.closest("form");var n=r.serializeObject();n.action="tutor_profile_password_reset";o.ajax({url:_tutorobject.ajaxurl,type:"POST",data:n,beforeSend:function t(){e.addClass("is-loading")},success:function t(e){var t=e.success;if(t){window.tutor_toast("Success",i(e),"success");window.location.reload()}else{window.tutor_toast("Error",i(e),"error")}},complete:function t(){e.removeClass("is-loading")}})})})},1974:(t,e,r)=>{var n=r(3632),i=n.get_response_message;var o=function t(e){var r=new RegExp("^(https?:\\/\\/)?"+"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|"+"((\\d{1,3}\\.){3}\\d{1,3}))"+"(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*"+"(\\?[;&a-z\\d%_.~+=-]*)?"+"(\\#[-a-z\\d_]*)?$","i");return!!r.test(e)};var c=function t(d,f,h){var e=new FileReader;e.addEventListener("load",function(){var l=new Image;l.addEventListener("load",function(){var t=l.width,e=l.height;var r=0;var n=0;var o=t;var i=e;if(f.width==f.height){r=t>e?(t-e)/2:0;n=e>t?(e-t)/2:0;o=t>e?e:t;i=e>t?t:e}f.height=f.height||e/t*f.width;var a=f.width>t?t:f.width;var u=f.width>t?e:f.height;var c=document.createElement("canvas");c.width=a;c.height=u;var s=c.getContext("2d");s.drawImage(l,r,n,o,i,0,0,c.width,c.height);c.toBlob(function(t){t.name=d.name;t.lastModified=d.lastModified;var e=new FileReader;e.addEventListener("load",function(){h(t,e.result)});e.readAsDataURL(t)},"image/jpeg")});l.src=e.result});e.readAsDataURL(d)};window.jQuery(document).ready(function(a){var u=wp.i18n.__;var t=function t(o){this.dialogue_box=o.find("#tutor_photo_dialogue_box");this.open_dialogue_box=function(t){this.dialogue_box.attr("name",t);this.dialogue_box.trigger("click")};this.upload_selected_image=function(o,t){var e=tutor_get_nonce_data(true);var r=this;r.toggle_loader(o,true);var n=new FormData;n.append("action","tutor_user_photo_upload");n.append("photo_type",o);n.append("photo_file",t,t.name);n.append(e.key,e.value);var i=this;a.ajax({url:window._tutorobject.ajaxurl,data:n,type:"POST",processData:false,contentType:false,error:r.error_alert,success:function t(){var e=i.title_capitalize(o.replace("_"," "));var r=u("Success","tutor");var n=e+" Changed Successfully!";if("Profile Photo"===e){n=u("Profile Photo Changed Successfully!","tutor")}if("Cover Photo"===e){n=u("Cover Photo Changed Successfully!","tutor")}tutor_toast(r,n,"success")},complete:function t(){r.toggle_loader(o,false)}})};this.title_capitalize=function(t){var e=t.split(" ");for(var r=0;r<e.length;r++){e[r]=e[r].charAt(0).toUpperCase()+e[r].slice(1)}return e.join(" ")};this.accept_upload_image=function(e,r){var t=r.currentTarget.files[0]||null;e.update_preview(r.currentTarget.name,t);c(t,{width:1200},function(t){e.upload_selected_image(r.currentTarget.name,t)});a(r.currentTarget).val("")};this.delete_image=function(e){var r=this;r.toggle_loader(e,true);a.ajax({url:window._tutorobject.ajaxurl,data:{action:"tutor_user_photo_remove",photo_type:e},type:"POST",error:r.error_alert,complete:function t(){r.toggle_loader(e,false)}})};this.update_preview=function(t,e){var r=o.find(t=="cover_photo"?"#tutor_cover_area":"#tutor_profile_area");if(!e){r.css("background-image","url("+r.data("fallback")+")");this.delete_image(t);return}var n=new FileReader;n.onload=function(t){r.css("background-image","url("+t.target.result+")")};n.readAsDataURL(e)};this.toggle_profile_pic_action=function(t){var e=t===undefined?"toggleClass":t?"addClass":"removeClass";o[e]("pop-up-opened")};this.error_alert=function(){tutor_toast("Error","Maximum file size exceeded!","error")};this.toggle_loader=function(t,e){o.find("#tutor_photo_meta_area .loader-area").css("display",e?"block":"none")};this.initialize=function(){var e=this;this.dialogue_box.change(function(t){e.accept_upload_image(e,t)});o.find("#tutor_profile_area .tutor_overlay, #tutor_pp_option>div:last-child").click(function(){e.toggle_profile_pic_action()});o.find(".tutor_cover_uploader").click(function(){e.open_dialogue_box("cover_photo")});o.find(".tutor_pp_uploader").click(function(){e.open_dialogue_box("profile_photo")});o.find(".tutor_cover_deleter").click(function(){e.update_preview("cover_photo",null)});o.find(".tutor_pp_deleter").click(function(){e.update_preview("profile_photo",null)})}};var e=a("#tutor_profile_cover_photo_editor");e.length>0?new t(e).initialize():0;a(".tutor-profile-settings-save").click(function(t){t.preventDefault();var e=a(this);var r=e.closest("form");var n=r.serializeObject();var o=document.querySelector("[name=phone_number]");if(n.phone_number&&!n.phone_number.match(/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im)){o.classList.add("invalid");tutor_toast("Invalid","Invalid phone number","error");o.focus();return false}else{o.classList.remove("invalid")}n.action="tutor_update_profile";a.ajax({url:_tutorobject.ajaxurl,type:"POST",data:n,beforeSend:function t(){e.addClass("is-loading")},success:function t(e){var t=e.success;if(t){window.tutor_toast("Success",i(e),"success")}else{window.tutor_toast("Error",i(e),"error")}},complete:function t(){e.removeClass("is-loading")}})})})},787:()=>{document.addEventListener("DOMContentLoaded",function(){var n=window.jQuery;n('.tutor-dashboard-setting-withdraw input[name="tutor_selected_withdraw_method"]').on("change",function(t){var e=n(this);var r=e.closest("form");r.find(".withdraw-method-form").hide();r.find(".withdraw-method-form").hide().filter('[data-withdraw-form="'+e.val()+'"]').show()})})},9834:()=>{window.jQuery(document).ready(function(o){var i=window.wp.i18n.__;o(".tutor-course-retake-button").prop("disabled",false).click(function(t){t.preventDefault();var e=o(this).attr("href");var r=o(this).data("course_id");var n={title:i("Override Previous Progress","tutor"),description:i("Before continue, please decide whether to keep progress or reset.","tutor"),buttons:{reset:{title:i("Reset Data","tutor"),class:"tutor-btn tutor-btn-primary",callback:function t(e){o.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{action:"tutor_reset_course_progress",course_id:r},beforeSend:function t(){e.prop("disabled",true).addClass("is-loading")},success:function t(e){if(e.success){window.location.assign(e.data.redirect_to)}else{alert((e.data||{}).message||i("Something went wrong","tutor"))}},complete:function t(){e.prop("disabled",false).removeClass("is-loading")}})}},keep:{title:i("Keep Data","tutor"),class:"tutor-btn tutor-btn-outline-primary tutor-ml-20",attr:"data-tutor-modal-close",callback:function t(){window.location.assign(e)}}}};new window.tutor_popup(o,"icon-gear").popup(n)})});readyState_complete(function(){var t=document.querySelector(".tutor-video-player .loading-spinner");if(null!==t){t.remove()}})},1033:()=>{function d(e,t){var r=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&typeof e.length==="number"){if(r)e=r;var n=0;var o=function t(){};return{s:o,n:function t(){if(n>=e.length)return{done:true};return{done:false,value:e[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=true,a=false,u;return{s:function t(){r=r.call(e)},n:function t(){var e=r.next();i=e.done;return e},e:function t(e){a=true;u=e},f:function t(){try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}}}function c(t,e){if(!t)return;if(typeof t==="string")return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}function n(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++){n[r]=t[r]}return n}jQuery(document).ready(function(c){var t=wp.i18n,u=t.__,e=t._x,r=t._n,n=t._nx;c("[tutor-instructors]").each(function(){var a=c(this);var u={};var e;var t=document.querySelector(".tutor-ratings-stars i.is-active");var r=0;if(t){r=t.dataset.value}function i(t,e,r){var n=a.find("[tutor-instructors-content]");var o=n.html();var i=a.data();i.current_page=r||1;t?u[t]=e:u={};u.attributes=i;u.action="load_filtered_instructor";n.html('<div class="tutor-spinner-wrap"><span class="tutor-spinner" area-hidden="true"></span></div>');c.ajax({url:window._tutorobject.ajaxurl,data:u,type:"POST",success:function t(e){n.html((e.data||{}).html)},error:function t(){n.html(o);tutor_toast("Failed","Request Error","error")}})}a.on("change",'[tutor-instructors-filter-category] [type="checkbox"]',function(){var t={};c(this).closest("[tutor-instructors-filter-category]").find("input:checked").each(function(){t[c(this).val()]=c(this).parent().text()});var e=Object.keys(t);i(c(this).attr("name"),e)}).on("click","[tutor-instructors-filter-rating]",function(t){var e=t.target.dataset.value;if(e!=r){i("rating_filter",e)}r=e}).on("change","[tutor-instructors-filter-sort]",function(t){var e=t.target.value;i("short_by",e)}).on("input","[tutor-instructors-filter-search]",function(){var t=c(this).val();e?window.clearTimeout(e):0;e=window.setTimeout(function(){i("keyword",t);e=null},500)}).on("click","[data-page_number]",function(t){t.preventDefault();i(null,null,c(this).data("page_number"))}).on("click","[tutor-instructors-filter-clear]",function(){var t=c(this).closest("[tutor-instructors-filters]");t.find('input[type="checkbox"]').prop("checked",false);t.find("[tutor-instructors-filter-search]").val("");var e=document.querySelectorAll("[tutor-instructors-filter-rating]");var r=d(e),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.classList.contains("active")){o.classList.remove("active")}if(o.classList.contains("tutor-icon-star-bold")){o.classList.remove("tutor-icon-star-bold");o.classList.add("tutor-icon-star-line")}}}catch(t){r.e(t)}finally{r.f()}l.innerHTML="";i()})});var s=document.querySelectorAll("[tutor-instructors-filter-rating]");var l=document.querySelector("[tutor-instructors-filter-rating-count]");var o=d(s),i;try{for(o.s();!(i=o.n()).done;){var a=i.value;a.onclick=function(t){var e=t.currentTarget;var r=d(s),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.classList.contains("is-active")){o.classList.remove("is-active")}if(o.classList.contains("tutor-icon-star-bold")){o.classList.remove("tutor-icon-star-bold");o.classList.add("tutor-icon-star-line")}}}catch(t){r.e(t)}finally{r.f()}var i=Number(t.target.dataset.value);var a=u("star","tutor");if(i>1){a=u("stars","tutor")}if(!e.classList.contains("is-active")){e.classList.add("is-active")}if(!e.classList.contains("tutor-icon-star-bold")){e.classList.remove("tutor-icon-star-line");e.classList.add("tutor-icon-star-bold")}l.innerHTML="".concat(i," ").concat(a)}}}catch(t){o.e(t)}finally{o.f()}})},3632:(t,e,r)=>{"use strict";r.r(e);r.d(e,{get_response_message:()=>n});var n=function t(e,r){var n=wp.i18n.__;var o=e||{},i=o.data,a=i===void 0?{}:i;var u=a.message,c=u===void 0?r||n("Something Went Wrong!","tutor"):u;return c}}};var o={};function ft(t){var e=o[t];if(e!==undefined){return e.exports}var r=o[t]={exports:{}};n[t](r,r.exports,ft);return r.exports}(()=>{ft.d=(t,e)=>{for(var r in e){if(ft.o(e,r)&&!ft.o(t,r)){Object.defineProperty(t,r,{enumerable:true,get:e[r]})}}}})();(()=>{ft.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})();(()=>{ft.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();var t={};(()=>{"use strict";var S=ft(3676);var u=ft(3632);window.jQuery(document).ready(function(i){var a=wp.i18n.__;i(document).on("submit","#tutor-login-form",function(t){t.preventDefault();var e=i(this);var r=e.find("button");var n=e.find(".tutor-login-error");var o=i(this).serializeObject();o.action="tutor_user_login";i.ajax({url:_tutorobject.ajaxurl,type:"POST",data:o,beforeSend:function t(){r.addClass("is-loading");n.empty()},success:function t(e){if(e.success){location.assign(e.data.redirect_to);return}var r=(e.data||{}).message||a("Invalid username or password!","tutor");n.html('\n <div class="tutor-alert tutor-warning tutor-mt-28">\n <div class="tutor-alert-text">\n <span class="tutor-alert-icon tutor-icon-34 tutor-icon-circle-info tutor-mr-12"></span>\n <span>\n '.concat(r,"\n </span>\n </div>\n </div>\n "))},error:function t(){tutor_toast(a("Error!","tutor"),(0,u.get_response_message)(),"error")},complete:function t(){r.removeClass("is-loading")}})})});function j(t){"@babel/helpers - typeof";return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function E(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */E=function t(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function t(e,r,n){return e[r]=n}}function u(t,e,r,n){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(i,a,u){var c="suspendedStart";return function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return S()}for(u.method=t,u.arg=e;;){var r=u.delegate;if(r){var n=b(r,u);if(n){if(n===s)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=d(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}}(t,r,a),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s={};function c(){}function f(){}function h(){}var p={};i(p,o,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==t&&l.call(m,o)&&(p=m);var g=h.prototype=c.prototype=Object.create(p);function y(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,c){function s(t,e,r,n){var o=d(u[t],u,e);if("throw"!==o.type){var i=o.arg,a=i.value;return a&&"object"==j(a)&&l.call(a,"__await")?c.resolve(a.__await).then(function(t){s("next",t,r,n)},function(t){s("throw",t,r,n)}):c.resolve(a).then(function(t){i.value=t,r(i)},function(t){return s("throw",t,r,n)})}n(o.arg)}var e;this._invoke=function(r,n){function t(){return new c(function(t,e){s(r,n,t,e)})}return e=e?e.then(t,t):t()}}function b(t,e){var r=t.iterator[e.method];if(undefined===r){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=undefined,b(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=d(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;){if(l.call(e,r))return t.value=e[r],t.done=!1,t}return t.value=undefined,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:undefined,done:!0}}return f.prototype=h,i(g,"constructor",h),i(h,"constructor",f),f.displayName=i(h,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,i(t,n,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},y(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},y(g),i(g,n,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var t in r){n.push(t)}return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=L,k.prototype={constructor:k,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!e)for(var r in this){"t"===r.charAt(0)&&l.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=undefined)}},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(r){if(this.done)throw r;var n=this;function e(t,e){return a.type="throw",a.arg=r,n.next=t,e&&(n.method="next",n.arg=undefined),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var u=l.call(i,"catchLoc"),c=l.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function t(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),s},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),s}},a}function c(t,e,r,n,o,i,a){try{var u=t[i](a);var c=u.value}catch(t){r(t);return}if(u.done){e(c)}else{Promise.resolve(c).then(n,o)}}function w(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){c(n,e,r,o,i,"next",t)}function i(t){c(n,e,r,o,i,"throw",t)}o(undefined)})}}function b(e,t){var r=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s(e))||t&&e&&typeof e.length==="number"){if(r)e=r;var n=0;var o=function t(){};return{s:o,n:function t(){if(n>=e.length)return{done:true};return{done:false,value:e[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=true,a=false,u;return{s:function t(){r=r.call(e)},n:function t(){var e=r.next();i=e.done;return e},e:function t(e){a=true;u=e},f:function t(){try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}}}function s(t,e){if(!t)return;if(typeof t==="string")return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}function n(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++){n[r]=t[r]}return n}var t=wp.i18n,_=t.__,N=t._x,M=t._n,F=t._nx;document.addEventListener("DOMContentLoaded",function(){var u=document.getElementById("tutor-common-confirmation-modal");var c=document.getElementById("tutor-common-confirmation-form");var t=document.getElementById("tutor-backend-filter-course");if(t){t.addEventListener("change",function(t){window.location=l("course-id",t.target.value)},{once:true})}var e=document.getElementById("tutor-backend-filter-category");if(e){e.addEventListener("change",function(t){window.location=l("category",t.target.value)},{once:true})}var r=document.getElementById("tutor-backend-filter-order");if(r){r.addEventListener("change",function(t){window.location=l("order",t.target.value)},{once:true})}var n=document.getElementById("tutor-admin-search-filter-form");var o=document.getElementById("tutor-backend-filter-search");if(n){o.addEventListener("search",function(t){var e=t.currentTarget||{},r=e.value;if(/\S+/.test(r)==false){window.location=l("search","")}});n.onsubmit=function(t){t.preventDefault();var e=o.value;window.location=l("search",e)}}var i=document.getElementById("tutor-admin-bulk-action-btn");var a=document.querySelector(".tutor-bulk-modal-disabled");if(i){i.onclick=function(){var t=[];var e=document.querySelectorAll(".tutor-bulk-checkbox");var r=b(e),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.checked){t.push(o.value)}}}catch(t){r.e(t)}finally{r.f()}if(t.length){a.setAttribute("id","tutor-bulk-confirm-popup")}else{tutor_toast(_("Warning","tutor"),_("Nothing was selected for bulk action.","tutor"),"error");if(a.hasAttribute("id")){a.removeAttribute("id")}}}}var v=document.getElementById("tutor-admin-bulk-action-form");if(v){v.onsubmit=function(){var e=w(E().mark(function t(r){var n,o,i,a,u,c,s,l,d,f,h,p;return E().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:r.preventDefault();r.stopPropagation();n=new FormData(v);o=[];i=document.querySelectorAll(".tutor-bulk-checkbox");a=b(i);try{for(a.s();!(u=a.n()).done;){c=u.value;if(c.checked){o.push(c.value)}}}catch(t){a.e(t)}finally{a.f()}if(o.length){e.next=10;break}alert(_("Select checkbox for action","tutor"));return e.abrupt("return");case 10:n.set("bulk-ids",o);n.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);e.prev=12;s=document.querySelector("#tutor-confirm-bulk-action[data-tutor-modal-submit]");s.classList.add("is-loading");e.next=17;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:n});case 17:l=e.sent;s.classList.remove("is-loading");if(!l.ok){e.next=24;break}e.next=22;return l.json();case 22:d=e.sent;if(d.success){location.reload()}else{f=d.data||{},h=f.message,p=h===void 0?_("Something went wrong, please try again ","tutor"):h;tutor_toast(_("Failed","tutor"),p,"error")}case 24:e.next=29;break;case 26:e.prev=26;e.t0=e["catch"](12);console.log(e.t0);case 29:case"end":return e.stop()}}},t,null,[[12,26]])}));return function(t){return e.apply(this,arguments)}}()}var s=document.getElementById("tutor-confirm-bulk-action");if(s){s.onclick=function(){var t=document.createElement("input");t.type="submit";v.appendChild(t);t.click();t.remove()}}function l(t,e){var r=new URL(window.location.href);var n=r.searchParams;n.set(t,e);n.set("paged",1);return r}var d=document.querySelector("#tutor-bulk-checkbox-all");if(d){d.addEventListener("click",function(){var t=document.querySelectorAll(".tutor-bulk-checkbox");t.forEach(function(t){if(d.checked){t.checked=true}else{t.checked=false}})})}var f=document.querySelectorAll(".tutor-admin-course-delete");var h=b(f),p;try{for(h.s();!(p=h.n()).done;){var m=p.value;m.onclick=function(t){var e=t.currentTarget.dataset.id;if(c){console.log(c);c.elements.action.value="tutor_course_delete";c.elements.id.value=e}}}}catch(t){h.e(t)}finally{h.f()}if(c){c.onsubmit=function(){var e=w(E().mark(function t(r){var n,o,i,a;return E().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:r.preventDefault();n=new FormData(c);o=c.querySelector("[data-tutor-modal-submit]");o.classList.add("is-loading");e.next=6;return g(n);case 6:i=e.sent;if(u.classList.contains("tutor-is-active")){u.classList.remove("tutor-is-active")}if(!i.ok){e.next=14;break}e.next=11;return i.json();case 11:a=e.sent;o.classList.remove("is-loading");if(a){tutor_toast(_("Delete","tutor"),_("Course has been deleted ","tutor"),"success");location.reload()}else{tutor_toast(_("Failed","tutor"),_("Course delete failed ","tutor"),"error")}case 14:case"end":return e.stop()}}},t)}));return function(t){return e.apply(this,arguments)}}()}function g(t){return y.apply(this,arguments)}function y(){y=w(E().mark(function t(r){var n;return E().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:e.prev=0;e.next=3;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:r});case 3:n=e.sent;return e.abrupt("return",n);case 7:e.prev=7;e.t0=e["catch"](0);tutor_toast(_("Operation failed","tutor"),e.t0,"error");case 10:case"end":return e.stop()}}},t,null,[[0,7]])}));return y.apply(this,arguments)}});function q(t){return e.apply(this,arguments)}function e(){e=w(E().mark(function t(r){var n;return E().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:e.prev=0;e.next=3;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:r});case 3:n=e.sent;return e.abrupt("return",n);case 7:e.prev=7;e.t0=e["catch"](0);tutor_toast(_("Operation failed","tutor"),e.t0,"error");case 10:case"end":return e.stop()}}},t,null,[[0,7]])}));return e.apply(this,arguments)}function C(t){"@babel/helpers - typeof";return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function z(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */z=function t(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function t(e,r,n){return e[r]=n}}function u(t,e,r,n){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(i,a,u){var c="suspendedStart";return function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return S()}for(u.method=t,u.arg=e;;){var r=u.delegate;if(r){var n=b(r,u);if(n){if(n===s)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=d(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}}(t,r,a),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s={};function c(){}function f(){}function h(){}var p={};i(p,o,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==t&&l.call(m,o)&&(p=m);var g=h.prototype=c.prototype=Object.create(p);function y(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,c){function s(t,e,r,n){var o=d(u[t],u,e);if("throw"!==o.type){var i=o.arg,a=i.value;return a&&"object"==C(a)&&l.call(a,"__await")?c.resolve(a.__await).then(function(t){s("next",t,r,n)},function(t){s("throw",t,r,n)}):c.resolve(a).then(function(t){i.value=t,r(i)},function(t){return s("throw",t,r,n)})}n(o.arg)}var e;this._invoke=function(r,n){function t(){return new c(function(t,e){s(r,n,t,e)})}return e=e?e.then(t,t):t()}}function b(t,e){var r=t.iterator[e.method];if(undefined===r){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=undefined,b(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=d(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;){if(l.call(e,r))return t.value=e[r],t.done=!1,t}return t.value=undefined,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:undefined,done:!0}}return f.prototype=h,i(g,"constructor",h),i(h,"constructor",f),f.displayName=i(h,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,i(t,n,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},y(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},y(g),i(g,n,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var t in r){n.push(t)}return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=L,k.prototype={constructor:k,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!e)for(var r in this){"t"===r.charAt(0)&&l.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=undefined)}},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(r){if(this.done)throw r;var n=this;function e(t,e){return a.type="throw",a.arg=r,n.next=t,e&&(n.method="next",n.arg=undefined),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var u=l.call(i,"catchLoc"),c=l.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function t(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),s},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),s}},a}function l(t,e,r,n,o,i,a){try{var u=t[i](a);var c=u.value}catch(t){r(t);return}if(u.done){e(c)}else{Promise.resolve(c).then(n,o)}}function O(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){l(n,e,r,o,i,"next",t)}function i(t){l(n,e,r,o,i,"throw",t)}o(undefined)})}}function A(t){return a(t)||i(t)||o(t)||r()}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t,e){if(!t)return;if(typeof t==="string")return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(t,e)}function i(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function a(t){if(Array.isArray(t))return d(t)}function d(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++){n[r]=t[r]}return n}jQuery(document).ready(function(t){t(".tutor-sortable-list").sortable()});document.addEventListener("DOMContentLoaded",function(t){var e=wp.i18n,h=e.__,r=e._x,n=e._n,o=e._nx;var i=document.querySelector(".tutor-lesson-sidebar.tutor-desktop-sidebar");var a=document.querySelector(".tutor-sidebar-toggle-anchor");if(i&&a){a.addEventListener("click",function(){if(getComputedStyle(i).flex==="0 0 400px"){i.style.flex="0 0 0px";i.style.display="none"}else{i.style.display="block";i.style.flex="0 0 400px"}})}var u=document.querySelector(".tutor-sidebar-tabs-content");if(u){var c=u.getBoundingClientRect().top;u.style.height="calc(100vh - ".concat(c,"px)")}var s=function t(i){var e=document.querySelector(".tutor-desktop-sidebar-area");if(null!==e&&e.children.length<2){return}i.forEach(function(t){t.addEventListener("click",function(t){var e=t.currentTarget.parentNode.nextElementSibling;a(e);t.currentTarget.classList.add("active");var r=t.currentTarget.getAttribute("data-sidebar-tab");var n=e.querySelector("#"+r);n.classList.add("active");var o=document.querySelector(".tutor-lessons-tab-area");var i=o.offsetHeight;if(r=="sidebar-qna-tab-content"){n.style.height="calc(100% - ".concat(i,"px)")}})});var a=function t(e){for(var r=0;r<i.length;r++){i[r].classList.remove("active")}var n=e.querySelectorAll(".tutor-lesson-sidebar-tab-item");for(var o=0;o<n.length;o++){n[o].classList.remove("active")}}};var l=document.querySelectorAll(".tutor-desktop-sidebar-area .tutor-sidebar-tab-item");var d=document.querySelectorAll(".tutor-mobile-sidebar-area .tutor-sidebar-tab-item");if(l){s(l)}if(d){s(d)}var f=document.querySelectorAll(".tutor-comment-textarea textarea");if(f){f.forEach(function(t){t.addEventListener("focus",function(){t.parentElement.classList.add("is-focused")});t.addEventListener("blur",function(){t.parentElement.classList.remove("is-focused")})})}function p(){var t=document.querySelectorAll(".tutor-comments-list.tutor-parent-comment");var a=document.querySelector(".tutor-comment-box.tutor-reply-box");if(t){A(t).forEach(function(t){var e=t.querySelectorAll(".tutor-comments-list.tutor-child-comment");var r=t.querySelector(".tutor-comment-line");var n=e.length;if(e[n-1]){var o=e[n-1].clientHeight;var i=o+a.clientHeight+20-25+50;r.style.setProperty("height","calc(100% - ".concat(i,"px)"))}})}}p();window.addEventListener(_tutorobject.content_change_event,p);var v=document.querySelectorAll(".tutor-draggable > div");var m=document.querySelectorAll(".tutor-dropzone");v.forEach(function(t){t.addEventListener("dragstart",y);t.addEventListener("dragend",w)});v.forEach(function(e){["touchstart","touchmove","touchend"].forEach(function(t){e.addEventListener(t,g)})});m.forEach(function(t){t.addEventListener("dragover",b);t.addEventListener("dragenter",_);t.addEventListener("dragleave",x);t.addEventListener("drop",k)});function g(t){t.preventDefault();var e=t.type;if(e==="touchstart"){this.classList.add("tutor-dragging")}else if(e==="touchmove"){var r=document.querySelector(".tutor-drag-copy");if(t.target.classList.contains("tutor-dragging")){var n=t.target.getBoundingClientRect();if(!r){r=t.target.cloneNode(true);r.classList.add("tutor-drag-copy");t.target.parentNode.appendChild(r)}r.style.position="fixed";r.style.left=t.touches[0].clientX-r.clientWidth/2+"px";r.style.top=t.touches[0].clientY-r.clientHeight/2+"px";r.style.zIndex="9999";r.style.opacity="0.5";r.style.width=n.width+"px";r.style.height=n.height+"px"}}else if(e==="touchend"){var o=document.querySelector(".tutor-drag-copy");if(o){o.remove();var i=typeof t.originalEvent==="undefined"?t:t.originalEvent;var a=i.touches[0]||i.changedTouches[0];var u=[a.clientX,a.clientY],c=u[0],s=u[1];var l=document.elementFromPoint(c,s);if(l.classList.contains("tutor-dropzone")||l.closest(".tutor-dropzone")){if(!l.classList.contains("tutor-dropzone")){l=l.closest(".tutor-dropzone")}var d=o.querySelector("input");var f=d.dataset.name;var h=document.createElement("input");h.type="text";h.setAttribute("value",d.value);h.setAttribute("name",f);l.appendChild(h);var p=o.querySelector(".tutor-dragging-text-conent").textContent;l.querySelector(".tutor-dragging-text-conent").textContent=p;this.classList.remove("tutor-dragging")}}}}function y(){this.classList.add("tutor-dragging")}function w(){this.classList.remove("tutor-dragging")}function b(t){this.classList.add("tutor-drop-over");t.preventDefault()}function _(){}function x(){this.classList.remove("tutor-drop-over")}function k(){var t=document.querySelector(".tutor-quiz-border-box.tutor-dragging");if(this.querySelector("input")){this.querySelector("input").remove()}var e=t.querySelector("input");var r=e.dataset.name;var n=document.createElement("input");n.type="text";n.setAttribute("value",e.value);n.setAttribute("name",r);this.appendChild(n);var o=t.querySelector(".tutor-dragging-text-conent").textContent;this.querySelector(".tutor-dragging-text-conent").textContent=o;this.classList.remove("tutor-drop-over")}var L=document.getElementById("tutor-assignment-file-upload");if(L){L.addEventListener("change",S)}function S(){var t;var e=A(L.files).reduce(function(t,e){return t+e.size},0);var r=parseInt((t=document.querySelector('input[name="tutor_assignment_upload_limit"]'))===null||t===void 0?void 0:t.value)||0;var n="";var o=window._tutorobject.assignment_max_file_allowed;var i=document.querySelectorAll("#tutor-student-assignment-edit-file-preview .tutor-instructor-card").length;var a=o-i;if(L.files.length>a){tutor_toast(h("Warning","tutor"),h("Max ".concat(o," file allowed to upload"),"tutor"),"error");return}if(e>r){tutor_toast(h("Warning","tutor"),h("File size exceeds maximum limit ".concat(Math.floor(r/1e6)," MB."),"tutor"),"error");return}if("files"in L){if(L&&L.files.length==0){n="Select one or more files."}else{if(L.files.length>a){tutor_toast(h("Warning","tutor"),h("Max ".concat(o," file allowed to upload"),"tutor"),"error")}var u="";var c=document.querySelector(".tutor-asisgnment-upload-file-preview");var s=document.getElementById("tutor-student-assignment-edit-file-preview");for(var l=0;l<a;l++){var d=L.files[l];if(!d){continue}var f=s?"tutor-col-sm-5 tutor-py-16 tutor-mr-16":"";u+='<div class="tutor-instructor-card '.concat(f,'">\n <div class="tutor-icard-content">\n <div class="tutor-fs-6 tutor-color-secondary">\n ').concat(d.name,'\n </div>\n <div class="tutor-fs-7">Size: ').concat(d.size,'</div>\n </div>\n <div onclick="(() => {\n\t\t\t\t\t\t\t\t\t\tthis.closest(\'.tutor-instructor-card\').remove();\n\t\t\t\t\t\t\t\t\t})()" class="tutor-attachment-file-close tutor-iconic-btn tutor-iconic-btn-outline flex-center">\n <span class="tutor-icon-times"></span>\n </div>\n </div>')}if(c){c.innerHTML=u}if(s){s.insertAdjacentHTML("beforeend",u)}}}}var j=document.querySelectorAll(".tutor-attachment-file-close a");j.forEach(function(t){t.onclick=function(){var e=O(z().mark(function t(r){var n,o,i,a,u,c,s;return z().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:r.preventDefault();n=r.currentTarget;o=n.dataset.name;i=n.dataset.id;a=new FormData;a.set("action","tutor_remove_assignment_attachment");a.set("assignment_comment_id",i);a.set("file_name",o);a.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);u=n.querySelector("span");u.classList.add("is-loading");e.next=13;return q(a);case 13:c=e.sent;if(!c.ok){e.next=21;break}e.next=17;return c.json();case 17:s=e.sent;if(!s){tutor_toast(h("Warning","tutor"),h("Attachment remove failed","tutor"),"error")}else{n.closest(".tutor-instructor-card").remove()}e.next=23;break;case 21:alert(c.statusText);u.classList.remove("is-loading");case 23:case"end":return e.stop()}}},t)}));return function(t){return e.apply(this,arguments)}}()})});var G=ft(7942);var B=ft(818);var Q=ft(3419);var R=ft(6470);var U=ft(1103);var Y=ft(7723);function f(t,e){return W(t)||H(t,e)||p(t,e)||h()}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(t,e){if(!t)return;if(typeof t==="string")return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(t,e)}function v(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++){n[r]=t[r]}return n}function H(t,e){var r=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(r==null)return;var n=[];var o=true;var i=false;var a,u;try{for(r=r.call(t);!(o=(a=r.next()).done);o=true){n.push(a.value);if(e&&n.length===e)break}}catch(t){i=true;u=t}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(i)throw u}}return n}function W(t){if(Array.isArray(t))return t}function $(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var a=new FormData;t.forEach(function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var n=f(r[e],2),o=n[0],i=n[1];a.set(o,i)}});a.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);return a}const X=$;function T(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */T=function t(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function t(e,r,n){return e[r]=n}}function u(t,e,r,n){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(i,a,u){var c="suspendedStart";return function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return S()}for(u.method=t,u.arg=e;;){var r=u.delegate;if(r){var n=b(r,u);if(n){if(n===s)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=d(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}}(t,r,a),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s={};function c(){}function f(){}function h(){}var p={};i(p,o,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==t&&l.call(m,o)&&(p=m);var g=h.prototype=c.prototype=Object.create(p);function y(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,c){function s(t,e,r,n){var o=d(u[t],u,e);if("throw"!==o.type){var i=o.arg,a=i.value;return a&&"object"==P(a)&&l.call(a,"__await")?c.resolve(a.__await).then(function(t){s("next",t,r,n)},function(t){s("throw",t,r,n)}):c.resolve(a).then(function(t){i.value=t,r(i)},function(t){return s("throw",t,r,n)})}n(o.arg)}var e;this._invoke=function(r,n){function t(){return new c(function(t,e){s(r,n,t,e)})}return e=e?e.then(t,t):t()}}function b(t,e){var r=t.iterator[e.method];if(undefined===r){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=undefined,b(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=d(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;){if(l.call(e,r))return t.value=e[r],t.done=!1,t}return t.value=undefined,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:undefined,done:!0}}return f.prototype=h,i(g,"constructor",h),i(h,"constructor",f),f.displayName=i(h,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,i(t,n,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},y(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},y(g),i(g,n,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var t in r){n.push(t)}return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=L,k.prototype={constructor:k,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!e)for(var r in this){"t"===r.charAt(0)&&l.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=undefined)}},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(r){if(this.done)throw r;var n=this;function e(t,e){return a.type="throw",a.arg=r,n.next=t,e&&(n.method="next",n.arg=undefined),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var u=l.call(i,"catchLoc"),c=l.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function t(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),s},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),s}},a}function m(t,e,r,n,o,i,a){try{var u=t[i](a);var c=u.value}catch(t){r(t);return}if(u.done){e(c)}else{Promise.resolve(c).then(n,o)}}function J(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){m(n,e,r,o,i,"next",t)}function i(t){m(n,e,r,o,i,"throw",t)}o(undefined)})}}function P(t){"@babel/helpers - typeof";return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}var V=wp.i18n.__;var K=["keyword","course_order","tutor-course-filter-level","tutor-course-filter-tag","tutor-course-filter-category","tutor-course-filter-price","course_filter","supported_filters","current_page","action"];var Z=function t(i){var a=new URL(window.location.origin+window.location.pathname);var e=g();for(var r in e){if(K.indexOf(r)==-1){a.searchParams.append(r,e[r])}}var n=function t(e){var r=Array.isArray(i[e]);var n=r?e+"[]":e;var o=r?i[e]:[i[e]];o.forEach(function(t){if(P(t)!="object"){a.searchParams.append(n,t)}})};for(var o in i){n(o)}window.history.pushState({},"",a)};var g=function t(){var n={};new URL(window.location).searchParams.forEach(function(t,e){if(e.slice(-2)=="[]"){var r=e.slice(0,-2);!n[r]?n[r]=[]:0;!Array.isArray(n[r])?n[r]=[n[r]]:0;n[r].push(t)}else{n[e]=t}});return n};var y=function t(e){var r=g();e.find('[type="checkbox"]').prop("checked",false);e.find('[type="text"], select').val("");for(var n in r){var o=r[n];var i=e.find('[name="'+n+'"]');if(i.eq(0).attr("type")=="checkbox"){(function(){var e=!Array.isArray(o)?[o]:o;i.each(function(){var t=e.indexOf(window.jQuery(this).attr("value"))>-1;window.jQuery(this).prop("checked",t)})})()}else{i.val(o)}}};window.jQuery(document).ready(function(i){var d=window.wp.i18n.__;var a=i("[tutor-course-filter] form");if(!a.length){return}var u=i("[tutor-course-list-container]");var c=i(".tutor-courses-wrap").data("tutor_courses_meta")||{};var s={};a.on("submit",function(t){t.preventDefault()}).find("input,select").on("change",function(t){e()});y(a);window.addEventListener("popstate",function(){y(a);e(false,true)});var e=function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n=g();var o=Object.assign(a.serializeObject(),s,c);o.current_page=r&&n.current_page?n.current_page:1;o.action="tutor_course_filter_ajax";if(e){Z(o)}u.html('<div class="tutor-spinner-wrap"><span class="tutor-spinner" area-hidden="true"></span></div>');a.find("[action-tutor-clear-filter]").closest(".tutor-widget-course-filter").removeClass("tutor-d-none");i.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:o,success:function t(e){if(!e.success){u.html(d("Could not load courses","tutor"));return}u.html(e.data.html).find("nav").css("display","flex")}})};i("[tutor-toggle-course-filter]").on("click",function(t){t.preventDefault();i("body").toggleClass("tutor-course-filter-open");if(i(".tutor-course-filter-backdrop").length==0){i("body").append(i('<div class="tutor-course-filter-backdrop" area-hidden="true"></div>').hide().fadeIn(150))}});i("[tutor-hide-course-filter]").on("click",function(t){t.preventDefault();i("body").removeClass("tutor-course-filter-open")});var t=document.querySelectorAll(".tutor-course-list-enroll");t.forEach(function(t){t.onclick=function(){var e=J(T().mark(function t(r){var n,o,i,a,u,c,s,l;return T().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:r.preventDefault();n=d("Something went wrong, please try again!","tutor");o=r.target;i=[{action:"tutor_course_enrollment"},{course_id:o.dataset.courseId}];a=X(i);o.classList.add("is-loading");o.setAttribute("disabled",true);e.next=9;return q(a);case 9:u=e.sent;if(!u.ok){e.next=19;break}e.next=13;return u.json();case 13:c=e.sent;console.log(c);s=c.success,l=c.data;if(s){tutor_toast(d("Success","tutor-pro"),l,"success");window.location.href=o.href}else{tutor_toast(d("Failed","tutor-pro"),l?l:n,"error")}e.next=20;break;case 19:tutor_toast(d("Error","tutor-pro"),d(n),"error");case 20:o.classList.remove("is-loading");o.removeAttribute("disabled");case 22:case"end":return e.stop()}}},t)}));return function(t){return e.apply(this,arguments)}}()})});window.jQuery(document).ready(function(r){r(document).on("click",".tutor-course-entry-box-login button, .tutor-course-entry-box-login a, .tutor-open-login-modal",function(t){t.preventDefault();var e=r(this).data("login_url")||r(this).closest(".tutor-course-entry-box-login").data("login_url");if(e){window.location.assign(e)}else{r(".tutor-login-modal").addClass("tutor-is-active")}})});var tt=ft(6966);var et=ft(787);var rt=ft(1974);var nt=ft(6344);function D(t){"@babel/helpers - typeof";return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function I(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */I=function t(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function t(e,r,n){return e[r]=n}}function u(t,e,r,n){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(i,a,u){var c="suspendedStart";return function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return S()}for(u.method=t,u.arg=e;;){var r=u.delegate;if(r){var n=b(r,u);if(n){if(n===s)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=d(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}}(t,r,a),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s={};function c(){}function f(){}function h(){}var p={};i(p,o,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==t&&l.call(m,o)&&(p=m);var g=h.prototype=c.prototype=Object.create(p);function y(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,c){function s(t,e,r,n){var o=d(u[t],u,e);if("throw"!==o.type){var i=o.arg,a=i.value;return a&&"object"==D(a)&&l.call(a,"__await")?c.resolve(a.__await).then(function(t){s("next",t,r,n)},function(t){s("throw",t,r,n)}):c.resolve(a).then(function(t){i.value=t,r(i)},function(t){return s("throw",t,r,n)})}n(o.arg)}var e;this._invoke=function(r,n){function t(){return new c(function(t,e){s(r,n,t,e)})}return e=e?e.then(t,t):t()}}function b(t,e){var r=t.iterator[e.method];if(undefined===r){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=undefined,b(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=d(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;){if(l.call(e,r))return t.value=e[r],t.done=!1,t}return t.value=undefined,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:undefined,done:!0}}return f.prototype=h,i(g,"constructor",h),i(h,"constructor",f),f.displayName=i(h,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,i(t,n,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},y(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},y(g),i(g,n,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var t in r){n.push(t)}return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=L,k.prototype={constructor:k,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!e)for(var r in this){"t"===r.charAt(0)&&l.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=undefined)}},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(r){if(this.done)throw r;var n=this;function e(t,e){return a.type="throw",a.arg=r,n.next=t,e&&(n.method="next",n.arg=undefined),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var u=l.call(i,"catchLoc"),c=l.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function t(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),s},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),s}},a}function x(t,e,r,n,o,i,a){try{var u=t[i](a);var c=u.value}catch(t){r(t);return}if(u.done){e(c)}else{Promise.resolve(c).then(n,o)}}function ot(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){x(n,e,r,o,i,"next",t)}function i(t){x(n,e,r,o,i,"throw",t)}o(undefined)})}}var k=wp.i18n,L=k.__,it=k._x,at=k._n,ut=k._nx;document.addEventListener("DOMContentLoaded",function(){var u=document.getElementById("tutor-create-new-course");if(u){u.onclick=function(){var e=ot(I().mark(function t(r){var n,o,i,a;return I().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:r.preventDefault();u.setAttribute("disabled","disabled");u.classList.add("is-loading");n=L("Something went wrong, please try again","tutor");o=new FormData;o.set("action","tutor_create_new_draft_course");o.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);e.next=9;return q(o);case 9:i=e.sent;if(!i.ok){e.next=18;break}u.classList.remove("is-loading");e.next=14;return i.json();case 14:a=e.sent;if(a.success){window.location=a.data.url}else{if(a.data.error_message){tutor_toast(L("Failed","tutor"),a.data.error_message,"error")}else{tutor_toast(L("Failed","tutor"),n,"error")}}e.next=19;break;case 18:tutor_toast(L("Failed","tutor"),n,"error");case 19:case"end":return e.stop()}}},t)}));return function(t){return e.apply(this,arguments)}}()}var e=document.getElementById("tutor-course-save-draft");if(e){e.onclick=function(t){t.preventDefault();e.setAttribute("disabled","disabled");e.classList.add("is-loading");document.getElementById("tutor-frontend-course-builder").submit()}}});var ct=ft(1626);var st=ft(9834);var lt=ft(1033);var dt=ft(4367);readyState_complete(function(){Object.entries(document.getElementsByTagName("a")).forEach(function(t){var e=t[1].getAttribute("href");if(e!==null&&e!==void 0&&e.includes("/logout")||e!==null&&e!==void 0&&e.includes("logout")){t[1].setAttribute("data-no-instant","")}})});jQuery(document).ready(function(a){"use strict";var t=wp.i18n,i=t.__,e=t._x,r=t._n,n=t._nx;if(jQuery().select2){a(".tutor_select2").select2({escapeMarkup:function t(e){return e}})}
2
  /*!
3
  * jQuery UI Touch Punch 0.2.3
4
  *
1
+ (()=>{var n={3676:()=>{window.readyState_complete=function(e){var r=function t(e){return e()};document.addEventListener("readystatechange",function(t){return t.target.readyState==="complete"?typeof e=="function"?setTimeout(function(){return r(e)}):"":""})};window.addBodyClass=function(t){var e=new URL(t);var r=e.searchParams.get("tab_page");var n=e.searchParams.get("edit")&&"_edit";document.body.classList.add(r);document.body.classList.add(r+n)};window.selectorById=function(t){return document.getElementById(t)};window.selectorByClass=function(t){return document.getElementsByClassName(t)};window.json_download=function(t,e){var r=new Blob([t],{type:"application/json"});var n=document.createElement("a");n.href=URL.createObjectURL(r);n.download=e;n.click()}},4367:()=>{window.selectSearchField=function(t){var r=document.querySelectorAll(t);(function(){r.forEach(function(o){if(o&&!o.classList.contains("tutor-js-form-select")&&!o.hasAttribute("noDropdown")&&!o.classList.contains("no-tutor-dropdown")){var t=o.options[o.selectedIndex];o.style.display="none";var i,e,r,a,n,u,c,s;o.insertAdjacentHTML("afterend",h(o.options));i=o.nextElementSibling;e=i.querySelector(".tutor-form-select-search");r=e&&e.querySelector("input");if(o.options.length<10){e.style.display="none"}s=i.querySelector(".tutor-form-select-dropdown");var l=i.querySelector(".tutor-form-select-label");l.innerText=t&&t.text;i.onclick=function(t){t.stopPropagation();f(document.querySelectorAll(".tutor-js-form-select"));i.classList.toggle("is-active");setTimeout(function(){r.focus()},100);s.onclick=function(t){t.stopPropagation()}};f(document.querySelectorAll(".tutor-js-form-select"));n=e.nextElementSibling;u=n&&n.querySelectorAll(".tutor-form-select-option");if(u){u.forEach(function(t){t.onclick=function(n){n.stopPropagation();var t=Array.from(o.options);t.forEach(function(t,e){if(t.value===n.target.dataset.key){i.classList.remove("is-active");l.innerText=n.target.innerText;l.dataset.value=t.value;o.value=t.value;var r=document.getElementById("save_tutor_option");if(r){r.disabled=false}}});var e=new Event("change",{bubbles:true});o.dispatchEvent(e)}})}var d=function t(e){var r=0;e.forEach(function(t){if(t.style.display!=="none"){r+=1}});return r};r.oninput=function(t){var e,r=false;a=t.target.value.toUpperCase();u.forEach(function(t){c=t.querySelector("[tutor-dropdown-item]");e=c.textContent||c.innerText;if(e.toUpperCase().indexOf(a)>-1){t.style.display="";r="false"}else{r="true";t.style.display="none"}});var n='\n <div class="tutor-form-select-option noItem">\n No item found\n </div>\n ';var o=s.querySelector(".tutor-form-select-options");if(0==d(u)){var i=false;o.querySelectorAll(".tutor-form-select-option").forEach(function(t){if(t.classList.contains("noItem")==true){i=true}});if(false==i){o.insertAdjacentHTML("beforeend",n);i=true}}else{if(null!==s.querySelector(".noItem")){s.querySelector(".noItem").remove()}}}}});var t=document.querySelectorAll(".tutor-js-form-select");t.forEach(function(t){if(t.nextElementSibling){if(t.nextElementSibling.classList.contains("tutor-js-form-select")){t.nextElementSibling.remove()}}});var e=document.querySelectorAll(".tutor-js-form-select");document.onclick=function(t){f(e)}})();function f(t){if(t){t.forEach(function(t){t.classList.remove("is-active")})}}function h(t){var e="";Array.from(t).forEach(function(t){e+='\n <div class="tutor-form-select-option">\n\t\t\t\t<span tutor-dropdown-item data-key="'.concat(t.value,'" class="tutor-nowrap-ellipsis" title="').concat(t.text,'">').concat(t.text,"</span>\n </div>\n ")});var r='\n <div class="tutor-form-control tutor-form-select tutor-js-form-select">\n\t\t\t<span class="tutor-form-select-label" tutor-dropdown-label>'.concat(window.wp.i18n.__("Select","tutor"),'</span>\n <div class="tutor-form-select-dropdown">\n\t\t\t\t<div class="tutor-form-select-search tutor-pt-8 tutor-px-8">\n\t\t\t\t\t<div class="tutor-form-wrap">\n\t\t\t\t\t\t<span class="tutor-form-icon"><i class="tutor-icon-search" area-hidden="true"></i></span>\n\t\t\t\t\t\t<input type="search" class="tutor-form-control" placeholder="Search ..." />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n <div class="tutor-form-select-options">\n ').concat(e,"\n </div>\n </div>\n </div>\n ");return r}};selectSearchField(".tutor-form-select")},1103:()=>{window.jQuery(document).ready(function(i){i("div.tutor-lesson-wrapper [data-mce-style]").each(function(){i(this).attr("style",i(this).attr("data-mce-style"));i(this).removeAttr("data-mce-style")});i(document).on("click",'.tutor-single-course-lesson-comments button[type="submit"]',function(t){t.preventDefault();var e=wp.i18n.__;var r=i(this);var o=r.closest("form");var n=o.serialize();i.ajax({url:_tutorobject.ajaxurl,type:"POST",data:n,beforeSend:function t(){r.addClass("is-loading").prop("disabled",true)},complete:function t(){r.removeClass("is-loading");r.removeAttr("disabled")},success:function t(e){var r=o.attr("tutor-comment-reply");if(typeof r!=="undefined"&&r!==false){o.before(e.data.html)}else{var n=document.querySelector(".tutor-course-spotlight-comments");n.innerHTML=e.data.html}i(".tutor-comment-line").css("height","calc(100% - 308px)");i("textarea").val("")},error:function t(e){r.removeClass("is-loading").prop("disabled",false)}})})})},818:()=>{window.jQuery(document).ready(function(t){if(t.fn.ShareLink){var e=t(".tutor-social-share-wrap");if(e.length){var r=JSON.parse(e.attr("data-social-share-config"));e.find(".tutor_share").ShareLink({title:r.title,text:r.text,image:r.image,class_prefix:"s_",width:640,height:480})}}})},6470:()=>{window.jQuery(document).ready(function(f){var h=window.wp.i18n.__;if(f(".tutor-quiz-wrap").length){if(!f(".tutor-table-quiz-attempts").length&&!f(".tutor-quiz-attempt-details").length){f(".tutor-course-topic-single-footer").remove()}}var p=f("#tutor-quiz-time-update");if(p.length){var t=JSON.parse(p.attr("data-attempt-settings"));var v=JSON.parse(p.attr("data-attempt-meta"));if(v.time_limit.time_limit_seconds>0){var e,r;var m=new Date((e=t.attempt_started_at)===null||e===void 0?void 0:e.replaceAll("-","/")).getTime()+v.time_limit.time_limit_seconds*1e3;var g=new Date((r=v.date_time_now)===null||r===void 0?void 0:r.replaceAll("-","/")).getTime();var y=setInterval(function(){var t=m-g;var e=Math.floor(t/(1e3*60*60*24));var r=Math.floor(t%(1e3*60*60*24)/(1e3*60*60));var n=Math.floor(t%(1e3*60*60)/(1e3*60));var o=Math.floor(t%(1e3*60)/1e3);var i="";e?i+=e+"d ":0;i+=(r||0)+"h ";i+=(n||0)+"m ";i+=(o||0)+"s ";if(t<0){clearInterval(y);p.toggleClass("tutor-quiz-time-expired");i="EXPIRED";if(_tutorobject.quiz_options.quiz_when_time_expires==="auto_submit"){f("form#tutor-answering-quiz").submit()}else{f(".tutor-quiz-answer-next-btn, .tutor-quiz-submit-btn, .tutor-quiz-answer-previous-btn").prop("disabled",true);f(".time-remaining span").css("color","#F44337");f.ajax({url:_tutorobject.ajaxurl,type:"POST",data:{quiz_id:f("#tutor_quiz_id").val(),action:"tutor_quiz_timeout"},success:function t(e){var r=f("#tutor-quiz-time-expire-wrapper").data("attempt-allowed");var n=f("#tutor-quiz-time-expire-wrapper").data("attempt-remaining");var o="#tutor-quiz-time-expire-wrapper";f(o).addClass("tutor-alert-show");if(n>0){f("".concat(o," .tutor-quiz-alert-text")).html(h("Your time limit for this quiz has expired, please reattempt the quiz. Attempts remaining:","tutor")+" "+n+"/"+r)}else{if(f(o).hasClass("time-remaining-warning")){f(o).removeClass("time-remaining-warning");f(o).addClass("time-over")}if(f("".concat(o," .flash-info span:first-child")).hasClass("tutor-icon-circle-info")){f("".concat(o," .flash-info span:first-child")).removeClass("tutor-icon-circle-info");f("".concat(o," .flash-info span:first-child")).addClass("tutor-icon-circle-times-line")}p.toggleClass("tutor-quiz-time-expired");f("#tutor-start-quiz").hide();f("".concat(o," .tutor-quiz-alert-text")).html("".concat(h("Unfortunately, you are out of time and quiz attempts. ","tutor")))}},complete:function t(){}})}}g=g+1e3;p.html(i);if(i=="EXPIRED"){p.addClass("color-text-error")}if(t){var a=t/1e3;var u=v.time_limit.time_limit_seconds;var c=Math.ceil(a*100/u);var s=document.querySelector(".quiz-time-remaining-progress-circle");var l=document.querySelector(".quiz-time-remaining-progress-circle svg");if(l&&s){var d=44-44*(c/100);if(c<=0){c=0;s.innerHTML='<svg viewBox="0 0 50 50" width="50" height="50">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<circle cx="0" cy="0" r="11"></circle>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</svg>';s.setAttribute("class","quiz-time-remaining-expired-circle")}l.setAttribute("style","stroke-dashoffset: ".concat(d,";"))}}},1e3)}else{p.html(h("No Limit","tutor"))}}var n=f("form#tutor-start-quiz");if(n.length){if(_tutorobject.quiz_options.quiz_auto_start==1){n.submit()}}})},3419:()=>{window.jQuery(document).ready(function(f){var u=window.wp.i18n.__;function h(t){var o=false;var i=JSON.parse(window.tutor_quiz_context.split("").reverse().join(""));!Array.isArray(i)?i=[]:0;var e=t.attr("data-quiz-feedback-mode");f(".tutor-quiz-answer-single-info").remove();f(".tutor-quiz-answer-single").removeClass("tutor-quiz-answer-single-correct tutor-quiz-answer-single-incorrect");var a=true;var r=t.find("input");var n=t.find('input[type="radio"]:checked, input[type="checkbox"]:checked');if(e==="reveal"){n.each(function(){var t=f(this);var e=i.indexOf(t.val())>-1;if(!e){a=false}});r.each(function(){var t=f(this);var e=t.attr("type");if(e==="radio"||e==="checkbox"){var r=i.indexOf(t.val())>-1;var n=t.is(":checked");if(r){t.closest(".tutor-quiz-answer-single").addClass("tutor-quiz-answer-single-correct").append('<span class="tutor-quiz-answer-single-info tutor-color-success tutor-mt-8">\n <i class="tutor-icon-mark tutor-color-success" area-hidden="true"></i>\n '.concat(u("Correct Answer","tutor"),"\n </span>")).find(".tutor-quiz-answer-single-info:eq(1)").remove()}else{if(t.prop("checked")){t.closest(".tutor-quiz-answer-single").addClass("tutor-quiz-answer-single-incorrect")}}if(r&&!n){t.attr("disabled","disabled");a=false;o=true}}})}if(a){o=true}return o}function p(r){var n=true;var t=r.find(".quiz-answer-required");if(t.length){var e=t.find("input");if(e.length){var o=e.attr("type");if(o==="radio"){if(t.find('input[type="radio"]:checked').length==0){r.find(".answer-help-block").html('<p style="color: #dc3545">'.concat(u("Please select an option to answer","tutor"),"</p>"));n=false}}else if(o==="checkbox"){if(t.find('input[type="checkbox"]:checked').length==0){r.find(".answer-help-block").html('<p style="color: #dc3545">'.concat(u("Please select at least one option to answer.","tutor"),"</p>"));n=false}}else if(o==="text"){e.each(function(t,e){if(!f(e).val().trim().length){r.find(".answer-help-block").html('<p style="color: #dc3545">'.concat(u("The answer for this question is required","tutor"),"</p>"));n=false}})}}if(t.find("textarea").length){if(t.find("textarea").val().trim().length<1){r.find(".answer-help-block").html('<p style="color: #dc3545">'.concat(u("The answer for this question is required","tutor"),"</p>"));n=false}}}return n}f(".tutor-quiz-next-btn-all").prop("disabled",false);f(".quiz-attempt-single-question input").filter('[type="radio"], [type="checkbox"]').change(function(){f(".tutor-quiz-next-btn-all").prop("disabled",false)});f(document).on("click",".tutor-quiz-answer-next-btn, .tutor-quiz-answer-previous-btn",function(t){t.preventDefault();var e=f(".tutor-quiz-question-counter>span:first-child");var r=parseInt(f(this).closest("[data-question_index]").data("question_index"));if(f(this).hasClass("tutor-quiz-answer-previous-btn")){f(this).closest(".quiz-attempt-single-question").hide().prev().show();e.text(r-1);return}var n=f(this);var o=n.closest(".quiz-attempt-single-question");var i=p(o);if(!i){return}var a=h(o);if(!l==="reveal"){if(!a){return}}var u=parseInt(n.closest(".quiz-attempt-single-question").attr("id").match(/\d+/)[0],10);var c=n.closest(".quiz-attempt-single-question").attr("data-next-question-id");console.log("next question ".concat(c));if(c){var s=f(c);if(s&&s.length){var l=o.attr("data-quiz-feedback-mode");var d=Number(_tutorobject.quiz_answer_display_time);if(l==="reveal"){setTimeout(function(){f(".quiz-attempt-single-question").hide();s.show()},d)}else{f(".quiz-attempt-single-question").hide();s.show()}if(f(".tutor-quiz-questions-pagination").length){f(".tutor-quiz-question-paginate-item").removeClass("active");f('.tutor-quiz-questions-pagination a[href="'+c+'"]').addClass("active")}e.text(r+1)}}});f(document).on("click",".tutor-quiz-question-paginate-item",function(t){t.preventDefault();var e=f(this);var r=f(e.attr("href"));f(".quiz-attempt-single-question").hide();r.show();f(".tutor-quiz-question-paginate-item").removeClass("active");e.addClass("active")});f(document).on("keyup","textarea.question_type_short_answer, textarea.question_type_open_ended",function(t){var e=f(this);var r=e.val();var n=e.hasClass("question_type_short_answer")?_tutorobject.quiz_options.short_answer_characters_limit:_tutorobject.quiz_options.open_ended_answer_characters_limit;var o=n-r.length;if(o<1){e.val(r.substr(0,n));o=0}e.closest(".tutor-quiz-answers-wrap").find(".characters_remaining").html(o)});f(document).on("submit","#tutor-answering-quiz",function(t){var e=f(".quiz-attempt-single-question");var r=document.querySelector(".tutor-quiz-submit-btn");var n=true;var o=true;if(e.length){e.each(function(t,e){n=p(f(e));o=h(f(e))})}if(n&&o){setTimeout(function(){r.disabled=true},500)}else{t.preventDefault();r.classList.remove("is-loading");r.disabled=false}});f(".tutor-quiz-submit-btn").click(function(t){var e=this;t.preventDefault();var r=t.target.closest(".quiz-attempt-single-question");var n=r.getAttribute("data-quiz-feedback-mode");var o=Number(_tutorobject.quiz_answer_display_time);if(n==="reveal"){var i=f(".quiz-attempt-single-question");var a=true;if(i.length){i.each(function(t,e){a=p(f(e));a=h(f(e))})}f(this).attr("disabled","disabled");setTimeout(function(){f(e).addClass("is-loading");f("#tutor-answering-quiz").submit()},o)}else{f(this).attr("disabled","disabled").addClass("is-loading");f("#tutor-answering-quiz").submit()}});var o=f("#tutor-quiz-time-update");f(document).on("click","a",function(t){var r=f(this).attr("href");if(t.target.classList.contains("sidebar-ask-new-qna-btn")||t.target.classList.contains("tutor-quiz-question-paginate-item")){return}if(o.length>0&&o.text()!="EXPIRED"){t.preventDefault();t.stopImmediatePropagation();var n;var e={title:u("Abandon Quiz?","tutor"),description:u("Do you want to abandon this quiz? The quiz will be submitted partially up to this question if you leave this page.","tutor"),buttons:{keep:{title:u("Yes, leave quiz","tutor"),id:"leave",class:"tutor-btn tutor-btn-outline-primary",callback:function t(){var e=f("form#tutor-answering-quiz").serialize()+"&action="+"tutor_quiz_abandon";f.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:e,beforeSend:function t(){document.querySelector("#tutor-popup-leave").innerHTML=u("Leaving...","tutor")},success:function t(e){if(e.success){location.href=r}else{alert(u("Something went wrong","tutor"))}},error:function t(){alert(u("Something went wrong","tutor"));n.remove()}})}},reset:{title:u("Stay here","tutor"),id:"reset",class:"tutor-btn tutor-btn-primary tutor-ml-20",callback:function t(){n.remove()}}}};n=new window.tutor_popup(f,"").popup(e)}});f("body").on("submit","form#tutor-start-quiz",function(){f(this).find("button").prop("disabled",true)})})},7942:()=>{window.jQuery(document).ready(function(n){var t=wp.i18n.__;n(document).on("click",".tutor-course-wishlist-btn",function(t){t.preventDefault();var r=n(this);var e=r.attr("data-course-id");n.ajax({url:_tutorobject.ajaxurl,type:"POST",data:{course_id:e,action:"tutor_course_add_to_wishlist"},beforeSend:function t(){r.attr("disabled","disabled").addClass("is-loading")},success:function t(e){if(e.success){if(e.data.status==="added"){r.find("i").addClass("tutor-icon-bookmark-bold").removeClass("tutor-icon-bookmark-line")}else{r.find("i").addClass("tutor-icon-bookmark-line").removeClass("tutor-icon-bookmark-bold")}}else{n(".tutor-login-modal").addClass("tutor-is-active")}},complete:function t(){r.removeAttr("disabled").removeClass("is-loading")}})})})},7723:()=>{window.jQuery(document).ready(function(t){t(document).on("added_to_cart",function(t,e,r,n){n.removeClass("is-loading");n.siblings("a.added_to_cart").addClass("tutor-btn tutor-btn-outline-primary tutor-btn-md tutor-btn-block").prepend('<span class="tutor-icon-cart-line tutor-mr-8"></span>')});t(document).on("adding_to_cart",function(t,e){e.addClass("is-loading");setTimeout(function(){e.removeClass("is-loading")},4e3)})})},1626:()=>{function l(e,t){var r=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&typeof e.length==="number"){if(r)e=r;var n=0;var o=function t(){};return{s:o,n:function t(){if(n>=e.length)return{done:true};return{done:false,value:e[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=true,a=false,u;return{s:function t(){r=r.call(e)},n:function t(){var e=r.next();i=e.done;return e},e:function t(e){a=true;u=e},f:function t(){try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}}}function c(t,e){if(!t)return;if(typeof t==="string")return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}function n(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++){n[r]=t[r]}return n}document.addEventListener("DOMContentLoaded",function(){var t=wp.i18n,e=t.__,r=t._x,n=t._n,o=t._nx;var i=document.querySelectorAll(".tutor-export-purchase-history");var a=l(i),u;try{for(a.s();!(u=a.n()).done;){var c=u.value;if(c){c.onclick=function(t){var e=t.currentTarget;var r="order-".concat(e.dataset.order,"-purchase-history.csv");var n=[{"Order ID ":e.dataset.order,"Course Name":e.dataset.courseName,Price:e.dataset.price,Date:e.dataset.date,Status:e.dataset.status}];s(n,r)}}}}catch(t){a.e(t)}finally{a.f()}function s(t,e){var r=Object.keys(t[0]);var n=[r.join(","),t.map(function(e){return r.map(function(t){return e[t]}).join(",")}).join("\n")].join("\n");var o=new Blob([n],{type:"text/csv;charset=utf-8"});var i=URL.createObjectURL(o);var a=document.createElement("a");a.setAttribute("href",i);a.setAttribute("download",e);a.style.visibility="hidden";document.body.appendChild(a);a.click();document.body.removeChild(a)}})},6966:()=>{document.addEventListener("DOMContentLoaded",function(){var e=window.jQuery;e(".tutor-dashboard .tutor-dashboard-menu-toggler").click(function(){var t=e(".tutor-dashboard-left-menu");t.closest(".tutor-dashboard").toggleClass("is-sidebar-expanded");if(t.css("display")!=="none"){t.get(0).scrollIntoView({block:"start"})}})})},6344:(t,e,r)=>{var n=r(3632),i=n.get_response_message;window.jQuery(document).ready(function(o){o('.tutor-settings-pass-field [name="confirm_new_password"]').on("input",function(){var t=o('[name="new_password"]');var e=(t.val()||"").trim();var r=e&&o(this).val()===e;o(this).parent().find(".tutor-validation-icon")[r?"show":"hide"]()});o(".tutor-profile-password-reset").click(function(t){t.preventDefault();var e=o(this);var r=e.closest("form");var n=r.serializeObject();n.action="tutor_profile_password_reset";o.ajax({url:_tutorobject.ajaxurl,type:"POST",data:n,beforeSend:function t(){e.addClass("is-loading")},success:function t(e){var t=e.success;if(t){window.tutor_toast("Success",i(e),"success");window.location.reload()}else{window.tutor_toast("Error",i(e),"error")}},complete:function t(){e.removeClass("is-loading")}})})})},1974:(t,e,r)=>{var n=r(3632),i=n.get_response_message;var o=function t(e){var r=new RegExp("^(https?:\\/\\/)?"+"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|"+"((\\d{1,3}\\.){3}\\d{1,3}))"+"(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*"+"(\\?[;&a-z\\d%_.~+=-]*)?"+"(\\#[-a-z\\d_]*)?$","i");return!!r.test(e)};var c=function t(d,f,h){var e=new FileReader;e.addEventListener("load",function(){var l=new Image;l.addEventListener("load",function(){var t=l.width,e=l.height;var r=0;var n=0;var o=t;var i=e;if(f.width==f.height){r=t>e?(t-e)/2:0;n=e>t?(e-t)/2:0;o=t>e?e:t;i=e>t?t:e}f.height=f.height||e/t*f.width;var a=f.width>t?t:f.width;var u=f.width>t?e:f.height;var c=document.createElement("canvas");c.width=a;c.height=u;var s=c.getContext("2d");s.drawImage(l,r,n,o,i,0,0,c.width,c.height);c.toBlob(function(t){t.name=d.name;t.lastModified=d.lastModified;var e=new FileReader;e.addEventListener("load",function(){h(t,e.result)});e.readAsDataURL(t)},"image/jpeg")});l.src=e.result});e.readAsDataURL(d)};window.jQuery(document).ready(function(a){var u=wp.i18n.__;var t=function t(o){this.dialogue_box=o.find("#tutor_photo_dialogue_box");this.open_dialogue_box=function(t){this.dialogue_box.attr("name",t);this.dialogue_box.trigger("click")};this.upload_selected_image=function(o,t){var e=tutor_get_nonce_data(true);var r=this;r.toggle_loader(o,true);var n=new FormData;n.append("action","tutor_user_photo_upload");n.append("photo_type",o);n.append("photo_file",t,t.name);n.append(e.key,e.value);var i=this;a.ajax({url:window._tutorobject.ajaxurl,data:n,type:"POST",processData:false,contentType:false,error:r.error_alert,success:function t(){var e=i.title_capitalize(o.replace("_"," "));var r=u("Success","tutor");var n=e+" Changed Successfully!";if("Profile Photo"===e){n=u("Profile Photo Changed Successfully!","tutor")}if("Cover Photo"===e){n=u("Cover Photo Changed Successfully!","tutor")}tutor_toast(r,n,"success")},complete:function t(){r.toggle_loader(o,false)}})};this.title_capitalize=function(t){var e=t.split(" ");for(var r=0;r<e.length;r++){e[r]=e[r].charAt(0).toUpperCase()+e[r].slice(1)}return e.join(" ")};this.accept_upload_image=function(e,r){var t=r.currentTarget.files[0]||null;e.update_preview(r.currentTarget.name,t);c(t,{width:1200},function(t){e.upload_selected_image(r.currentTarget.name,t)});a(r.currentTarget).val("")};this.delete_image=function(e){var r=this;r.toggle_loader(e,true);a.ajax({url:window._tutorobject.ajaxurl,data:{action:"tutor_user_photo_remove",photo_type:e},type:"POST",error:r.error_alert,complete:function t(){r.toggle_loader(e,false)}})};this.update_preview=function(t,e){var r=o.find(t=="cover_photo"?"#tutor_cover_area":"#tutor_profile_area");if(!e){r.css("background-image","url("+r.data("fallback")+")");this.delete_image(t);return}var n=new FileReader;n.onload=function(t){r.css("background-image","url("+t.target.result+")")};n.readAsDataURL(e)};this.toggle_profile_pic_action=function(t){var e=t===undefined?"toggleClass":t?"addClass":"removeClass";o[e]("pop-up-opened")};this.error_alert=function(){tutor_toast("Error","Maximum file size exceeded!","error")};this.toggle_loader=function(t,e){o.find("#tutor_photo_meta_area .loader-area").css("display",e?"block":"none")};this.initialize=function(){var e=this;this.dialogue_box.change(function(t){e.accept_upload_image(e,t)});o.find("#tutor_profile_area .tutor_overlay, #tutor_pp_option>div:last-child").click(function(){e.toggle_profile_pic_action()});o.find(".tutor_cover_uploader").click(function(){e.open_dialogue_box("cover_photo")});o.find(".tutor_pp_uploader").click(function(){e.open_dialogue_box("profile_photo")});o.find(".tutor_cover_deleter").click(function(){e.update_preview("cover_photo",null)});o.find(".tutor_pp_deleter").click(function(){e.update_preview("profile_photo",null)})}};var e=a("#tutor_profile_cover_photo_editor");e.length>0?new t(e).initialize():0;a(".tutor-profile-settings-save").click(function(t){t.preventDefault();var e=a(this);var r=e.closest("form");var n=r.serializeObject();var o=document.querySelector("[name=phone_number]");if(n.phone_number&&!n.phone_number.match(/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im)){o.classList.add("invalid");tutor_toast("Invalid","Invalid phone number","error");o.focus();return false}else{o.classList.remove("invalid")}n.action="tutor_update_profile";a.ajax({url:_tutorobject.ajaxurl,type:"POST",data:n,beforeSend:function t(){e.addClass("is-loading")},success:function t(e){var t=e.success;if(t){window.tutor_toast("Success",i(e),"success")}else{window.tutor_toast("Error",i(e),"error")}},complete:function t(){e.removeClass("is-loading")}})})})},787:()=>{document.addEventListener("DOMContentLoaded",function(){var n=window.jQuery;n('.tutor-dashboard-setting-withdraw input[name="tutor_selected_withdraw_method"]').on("change",function(t){var e=n(this);var r=e.closest("form");r.find(".withdraw-method-form").hide();r.find(".withdraw-method-form").hide().filter('[data-withdraw-form="'+e.val()+'"]').show()})})},9834:()=>{window.jQuery(document).ready(function(o){var i=window.wp.i18n.__;o(".tutor-course-retake-button").prop("disabled",false).click(function(t){t.preventDefault();var e=o(this).attr("href");var r=o(this).data("course_id");var n={title:i("Override Previous Progress","tutor"),description:i("Before continue, please decide whether to keep progress or reset.","tutor"),buttons:{reset:{title:i("Reset Data","tutor"),class:"tutor-btn tutor-btn-primary",callback:function t(e){o.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{action:"tutor_reset_course_progress",course_id:r},beforeSend:function t(){e.prop("disabled",true).addClass("is-loading")},success:function t(e){if(e.success){window.location.assign(e.data.redirect_to)}else{alert((e.data||{}).message||i("Something went wrong","tutor"))}},complete:function t(){e.prop("disabled",false).removeClass("is-loading")}})}},keep:{title:i("Keep Data","tutor"),class:"tutor-btn tutor-btn-outline-primary tutor-ml-20",attr:"data-tutor-modal-close",callback:function t(){window.location.assign(e)}}}};new window.tutor_popup(o,"icon-gear").popup(n)})});readyState_complete(function(){var t=document.querySelector(".tutor-video-player .loading-spinner");if(null!==t){t.remove()}})},1033:()=>{function d(e,t){var r=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&typeof e.length==="number"){if(r)e=r;var n=0;var o=function t(){};return{s:o,n:function t(){if(n>=e.length)return{done:true};return{done:false,value:e[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=true,a=false,u;return{s:function t(){r=r.call(e)},n:function t(){var e=r.next();i=e.done;return e},e:function t(e){a=true;u=e},f:function t(){try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}}}function c(t,e){if(!t)return;if(typeof t==="string")return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}function n(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++){n[r]=t[r]}return n}jQuery(document).ready(function(c){var t=wp.i18n,u=t.__,e=t._x,r=t._n,n=t._nx;c("[tutor-instructors]").each(function(){var a=c(this);var u={};var e;var t=document.querySelector(".tutor-ratings-stars i.is-active");var r=0;if(t){r=t.dataset.value}function i(t,e,r){var n=a.find("[tutor-instructors-content]");var o=n.html();var i=a.data();i.current_page=r||1;t?u[t]=e:u={};u.attributes=i;u.action="load_filtered_instructor";n.html('<div class="tutor-spinner-wrap"><span class="tutor-spinner" area-hidden="true"></span></div>');c.ajax({url:window._tutorobject.ajaxurl,data:u,type:"POST",success:function t(e){n.html((e.data||{}).html)},error:function t(){n.html(o);tutor_toast("Failed","Request Error","error")}})}a.on("change",'[tutor-instructors-filter-category] [type="checkbox"]',function(){var t={};c(this).closest("[tutor-instructors-filter-category]").find("input:checked").each(function(){t[c(this).val()]=c(this).parent().text()});var e=Object.keys(t);i(c(this).attr("name"),e)}).on("click","[tutor-instructors-filter-rating]",function(t){var e=t.target.dataset.value;if(e!=r){i("rating_filter",e)}r=e}).on("change","[tutor-instructors-filter-sort]",function(t){var e=t.target.value;i("short_by",e)}).on("input","[tutor-instructors-filter-search]",function(){var t=c(this).val();e?window.clearTimeout(e):0;e=window.setTimeout(function(){i("keyword",t);e=null},500)}).on("click","[data-page_number]",function(t){t.preventDefault();i(null,null,c(this).data("page_number"))}).on("click","[tutor-instructors-filter-clear]",function(){var t=c(this).closest("[tutor-instructors-filters]");t.find('input[type="checkbox"]').prop("checked",false);t.find("[tutor-instructors-filter-search]").val("");var e=document.querySelectorAll("[tutor-instructors-filter-rating]");var r=d(e),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.classList.contains("active")){o.classList.remove("active")}if(o.classList.contains("tutor-icon-star-bold")){o.classList.remove("tutor-icon-star-bold");o.classList.add("tutor-icon-star-line")}}}catch(t){r.e(t)}finally{r.f()}l.innerHTML="";i()})});var s=document.querySelectorAll("[tutor-instructors-filter-rating]");var l=document.querySelector("[tutor-instructors-filter-rating-count]");var o=d(s),i;try{for(o.s();!(i=o.n()).done;){var a=i.value;a.onclick=function(t){var e=t.currentTarget;var r=d(s),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.classList.contains("is-active")){o.classList.remove("is-active")}if(o.classList.contains("tutor-icon-star-bold")){o.classList.remove("tutor-icon-star-bold");o.classList.add("tutor-icon-star-line")}}}catch(t){r.e(t)}finally{r.f()}var i=Number(t.target.dataset.value);var a=u("star","tutor");if(i>1){a=u("stars","tutor")}if(!e.classList.contains("is-active")){e.classList.add("is-active")}if(!e.classList.contains("tutor-icon-star-bold")){e.classList.remove("tutor-icon-star-line");e.classList.add("tutor-icon-star-bold")}l.innerHTML="".concat(i," ").concat(a)}}}catch(t){o.e(t)}finally{o.f()}})},3632:(t,e,r)=>{"use strict";r.r(e);r.d(e,{get_response_message:()=>n});var n=function t(e,r){var n=wp.i18n.__;var o=e||{},i=o.data,a=i===void 0?{}:i;var u=a.message,c=u===void 0?r||n("Something Went Wrong!","tutor"):u;return c}}};var o={};function ft(t){var e=o[t];if(e!==undefined){return e.exports}var r=o[t]={exports:{}};n[t](r,r.exports,ft);return r.exports}(()=>{ft.d=(t,e)=>{for(var r in e){if(ft.o(e,r)&&!ft.o(t,r)){Object.defineProperty(t,r,{enumerable:true,get:e[r]})}}}})();(()=>{ft.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})();(()=>{ft.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();var t={};(()=>{"use strict";var S=ft(3676);var u=ft(3632);window.jQuery(document).ready(function(i){var a=wp.i18n.__;i(document).on("submit","#tutor-login-form",function(t){t.preventDefault();var e=i(this);var r=e.find("button");var n=e.find(".tutor-login-error");var o=i(this).serializeObject();o.action="tutor_user_login";i.ajax({url:_tutorobject.ajaxurl,type:"POST",data:o,beforeSend:function t(){r.addClass("is-loading");n.empty()},success:function t(e){if(e.success){location.assign(e.data.redirect_to);return}var r=(e.data||{}).message||a("Invalid username or password!","tutor");n.html('\n <div class="tutor-alert tutor-warning tutor-mt-28">\n <div class="tutor-alert-text">\n <span class="tutor-alert-icon tutor-icon-34 tutor-icon-circle-info tutor-mr-12"></span>\n <span>\n '.concat(r,"\n </span>\n </div>\n </div>\n "))},error:function t(){tutor_toast(a("Error!","tutor"),(0,u.get_response_message)(),"error")},complete:function t(){r.removeClass("is-loading")}})})});function j(t){"@babel/helpers - typeof";return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function E(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */E=function t(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function t(e,r,n){return e[r]=n}}function u(t,e,r,n){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(i,a,u){var c="suspendedStart";return function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return S()}for(u.method=t,u.arg=e;;){var r=u.delegate;if(r){var n=b(r,u);if(n){if(n===s)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=d(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}}(t,r,a),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s={};function c(){}function f(){}function h(){}var p={};i(p,o,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==t&&l.call(m,o)&&(p=m);var g=h.prototype=c.prototype=Object.create(p);function y(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,c){function s(t,e,r,n){var o=d(u[t],u,e);if("throw"!==o.type){var i=o.arg,a=i.value;return a&&"object"==j(a)&&l.call(a,"__await")?c.resolve(a.__await).then(function(t){s("next",t,r,n)},function(t){s("throw",t,r,n)}):c.resolve(a).then(function(t){i.value=t,r(i)},function(t){return s("throw",t,r,n)})}n(o.arg)}var e;this._invoke=function(r,n){function t(){return new c(function(t,e){s(r,n,t,e)})}return e=e?e.then(t,t):t()}}function b(t,e){var r=t.iterator[e.method];if(undefined===r){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=undefined,b(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=d(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;){if(l.call(e,r))return t.value=e[r],t.done=!1,t}return t.value=undefined,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:undefined,done:!0}}return f.prototype=h,i(g,"constructor",h),i(h,"constructor",f),f.displayName=i(h,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,i(t,n,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},y(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},y(g),i(g,n,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var t in r){n.push(t)}return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=L,k.prototype={constructor:k,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!e)for(var r in this){"t"===r.charAt(0)&&l.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=undefined)}},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(r){if(this.done)throw r;var n=this;function e(t,e){return a.type="throw",a.arg=r,n.next=t,e&&(n.method="next",n.arg=undefined),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var u=l.call(i,"catchLoc"),c=l.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function t(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),s},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),s}},a}function c(t,e,r,n,o,i,a){try{var u=t[i](a);var c=u.value}catch(t){r(t);return}if(u.done){e(c)}else{Promise.resolve(c).then(n,o)}}function w(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){c(n,e,r,o,i,"next",t)}function i(t){c(n,e,r,o,i,"throw",t)}o(undefined)})}}function b(e,t){var r=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s(e))||t&&e&&typeof e.length==="number"){if(r)e=r;var n=0;var o=function t(){};return{s:o,n:function t(){if(n>=e.length)return{done:true};return{done:false,value:e[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=true,a=false,u;return{s:function t(){r=r.call(e)},n:function t(){var e=r.next();i=e.done;return e},e:function t(e){a=true;u=e},f:function t(){try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}}}function s(t,e){if(!t)return;if(typeof t==="string")return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}function n(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++){n[r]=t[r]}return n}var t=wp.i18n,_=t.__,N=t._x,M=t._n,F=t._nx;document.addEventListener("DOMContentLoaded",function(){var u=document.getElementById("tutor-common-confirmation-modal");var c=document.getElementById("tutor-common-confirmation-form");var t=document.getElementById("tutor-backend-filter-course");if(t){t.addEventListener("change",function(t){window.location=l("course-id",t.target.value)},{once:true})}var e=document.getElementById("tutor-backend-filter-category");if(e){e.addEventListener("change",function(t){window.location=l("category",t.target.value)},{once:true})}var r=document.getElementById("tutor-backend-filter-order");if(r){r.addEventListener("change",function(t){window.location=l("order",t.target.value)},{once:true})}var n=document.getElementById("tutor-admin-search-filter-form");var o=document.getElementById("tutor-backend-filter-search");if(n){o.addEventListener("search",function(t){var e=t.currentTarget||{},r=e.value;if(/\S+/.test(r)==false){window.location=l("search","")}});n.onsubmit=function(t){t.preventDefault();var e=o.value;window.location=l("search",e)}}var i=document.getElementById("tutor-admin-bulk-action-btn");var a=document.querySelector(".tutor-bulk-modal-disabled");if(i){i.onclick=function(){var t=[];var e=document.querySelectorAll(".tutor-bulk-checkbox");var r=b(e),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.checked){t.push(o.value)}}}catch(t){r.e(t)}finally{r.f()}if(t.length){a.setAttribute("id","tutor-bulk-confirm-popup")}else{tutor_toast(_("Warning","tutor"),_("Nothing was selected for bulk action.","tutor"),"error");if(a.hasAttribute("id")){a.removeAttribute("id")}}}}var v=document.getElementById("tutor-admin-bulk-action-form");if(v){v.onsubmit=function(){var e=w(E().mark(function t(r){var n,o,i,a,u,c,s,l,d,f,h,p;return E().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:r.preventDefault();r.stopPropagation();n=new FormData(v);o=[];i=document.querySelectorAll(".tutor-bulk-checkbox");a=b(i);try{for(a.s();!(u=a.n()).done;){c=u.value;if(c.checked){o.push(c.value)}}}catch(t){a.e(t)}finally{a.f()}if(o.length){e.next=10;break}alert(_("Select checkbox for action","tutor"));return e.abrupt("return");case 10:n.set("bulk-ids",o);n.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);e.prev=12;s=document.querySelector("#tutor-confirm-bulk-action[data-tutor-modal-submit]");s.classList.add("is-loading");e.next=17;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:n});case 17:l=e.sent;s.classList.remove("is-loading");if(!l.ok){e.next=24;break}e.next=22;return l.json();case 22:d=e.sent;if(d.success){location.reload()}else{f=d.data||{},h=f.message,p=h===void 0?_("Something went wrong, please try again ","tutor"):h;tutor_toast(_("Failed","tutor"),p,"error")}case 24:e.next=29;break;case 26:e.prev=26;e.t0=e["catch"](12);console.log(e.t0);case 29:case"end":return e.stop()}}},t,null,[[12,26]])}));return function(t){return e.apply(this,arguments)}}()}var s=document.getElementById("tutor-confirm-bulk-action");if(s){s.onclick=function(){var t=document.createElement("input");t.type="submit";v.appendChild(t);t.click();t.remove()}}function l(t,e){var r=new URL(window.location.href);var n=r.searchParams;n.set(t,e);n.set("paged",1);return r}var d=document.querySelector("#tutor-bulk-checkbox-all");if(d){d.addEventListener("click",function(){var t=document.querySelectorAll(".tutor-bulk-checkbox");t.forEach(function(t){if(d.checked){t.checked=true}else{t.checked=false}})})}var f=document.querySelectorAll(".tutor-admin-course-delete");var h=b(f),p;try{for(h.s();!(p=h.n()).done;){var m=p.value;m.onclick=function(t){var e=t.currentTarget.dataset.id;if(c){console.log(c);c.elements.action.value="tutor_course_delete";c.elements.id.value=e}}}}catch(t){h.e(t)}finally{h.f()}if(c){c.onsubmit=function(){var e=w(E().mark(function t(r){var n,o,i,a;return E().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:r.preventDefault();n=new FormData(c);o=c.querySelector("[data-tutor-modal-submit]");o.classList.add("is-loading");e.next=6;return g(n);case 6:i=e.sent;if(u.classList.contains("tutor-is-active")){u.classList.remove("tutor-is-active")}if(!i.ok){e.next=14;break}e.next=11;return i.json();case 11:a=e.sent;o.classList.remove("is-loading");if(a){tutor_toast(_("Delete","tutor"),_("Course has been deleted ","tutor"),"success");location.reload()}else{tutor_toast(_("Failed","tutor"),_("Course delete failed ","tutor"),"error")}case 14:case"end":return e.stop()}}},t)}));return function(t){return e.apply(this,arguments)}}()}function g(t){return y.apply(this,arguments)}function y(){y=w(E().mark(function t(r){var n;return E().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:e.prev=0;e.next=3;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:r});case 3:n=e.sent;return e.abrupt("return",n);case 7:e.prev=7;e.t0=e["catch"](0);tutor_toast(_("Operation failed","tutor"),e.t0,"error");case 10:case"end":return e.stop()}}},t,null,[[0,7]])}));return y.apply(this,arguments)}});function q(t){return e.apply(this,arguments)}function e(){e=w(E().mark(function t(r){var n;return E().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:e.prev=0;e.next=3;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:r});case 3:n=e.sent;return e.abrupt("return",n);case 7:e.prev=7;e.t0=e["catch"](0);tutor_toast(_("Operation failed","tutor"),e.t0,"error");case 10:case"end":return e.stop()}}},t,null,[[0,7]])}));return e.apply(this,arguments)}function C(t){"@babel/helpers - typeof";return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function z(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */z=function t(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function t(e,r,n){return e[r]=n}}function u(t,e,r,n){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(i,a,u){var c="suspendedStart";return function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return S()}for(u.method=t,u.arg=e;;){var r=u.delegate;if(r){var n=b(r,u);if(n){if(n===s)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=d(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}}(t,r,a),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s={};function c(){}function f(){}function h(){}var p={};i(p,o,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==t&&l.call(m,o)&&(p=m);var g=h.prototype=c.prototype=Object.create(p);function y(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,c){function s(t,e,r,n){var o=d(u[t],u,e);if("throw"!==o.type){var i=o.arg,a=i.value;return a&&"object"==C(a)&&l.call(a,"__await")?c.resolve(a.__await).then(function(t){s("next",t,r,n)},function(t){s("throw",t,r,n)}):c.resolve(a).then(function(t){i.value=t,r(i)},function(t){return s("throw",t,r,n)})}n(o.arg)}var e;this._invoke=function(r,n){function t(){return new c(function(t,e){s(r,n,t,e)})}return e=e?e.then(t,t):t()}}function b(t,e){var r=t.iterator[e.method];if(undefined===r){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=undefined,b(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=d(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;){if(l.call(e,r))return t.value=e[r],t.done=!1,t}return t.value=undefined,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:undefined,done:!0}}return f.prototype=h,i(g,"constructor",h),i(h,"constructor",f),f.displayName=i(h,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,i(t,n,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},y(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},y(g),i(g,n,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var t in r){n.push(t)}return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=L,k.prototype={constructor:k,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!e)for(var r in this){"t"===r.charAt(0)&&l.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=undefined)}},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(r){if(this.done)throw r;var n=this;function e(t,e){return a.type="throw",a.arg=r,n.next=t,e&&(n.method="next",n.arg=undefined),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var u=l.call(i,"catchLoc"),c=l.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function t(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),s},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),s}},a}function l(t,e,r,n,o,i,a){try{var u=t[i](a);var c=u.value}catch(t){r(t);return}if(u.done){e(c)}else{Promise.resolve(c).then(n,o)}}function O(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){l(n,e,r,o,i,"next",t)}function i(t){l(n,e,r,o,i,"throw",t)}o(undefined)})}}function A(t){return a(t)||i(t)||o(t)||r()}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t,e){if(!t)return;if(typeof t==="string")return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(t,e)}function i(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function a(t){if(Array.isArray(t))return d(t)}function d(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++){n[r]=t[r]}return n}jQuery(document).ready(function(t){t(".tutor-sortable-list").sortable()});document.addEventListener("DOMContentLoaded",function(t){var e=wp.i18n,h=e.__,r=e._x,n=e._n,o=e._nx;var i=document.querySelector(".tutor-lesson-sidebar.tutor-desktop-sidebar");var a=document.querySelector(".tutor-sidebar-toggle-anchor");if(i&&a){a.addEventListener("click",function(){if(getComputedStyle(i).flex==="0 0 400px"){i.style.flex="0 0 0px";i.style.display="none"}else{i.style.display="block";i.style.flex="0 0 400px"}})}var u=document.querySelector(".tutor-sidebar-tabs-content");if(u){var c=u.getBoundingClientRect().top;u.style.height="calc(100vh - ".concat(c,"px)")}var s=function t(i){var e=document.querySelector(".tutor-desktop-sidebar-area");if(null!==e&&e.children.length<2){return}i.forEach(function(t){t.addEventListener("click",function(t){var e=t.currentTarget.parentNode.nextElementSibling;a(e);t.currentTarget.classList.add("active");var r=t.currentTarget.getAttribute("data-sidebar-tab");var n=e.querySelector("#"+r);n.classList.add("active");var o=document.querySelector(".tutor-lessons-tab-area");var i=o.offsetHeight;if(r=="sidebar-qna-tab-content"){n.style.height="calc(100% - ".concat(i,"px)")}})});var a=function t(e){for(var r=0;r<i.length;r++){i[r].classList.remove("active")}var n=e.querySelectorAll(".tutor-lesson-sidebar-tab-item");for(var o=0;o<n.length;o++){n[o].classList.remove("active")}}};var l=document.querySelectorAll(".tutor-desktop-sidebar-area .tutor-sidebar-tab-item");var d=document.querySelectorAll(".tutor-mobile-sidebar-area .tutor-sidebar-tab-item");if(l){s(l)}if(d){s(d)}var f=document.querySelectorAll(".tutor-comment-textarea textarea");if(f){f.forEach(function(t){t.addEventListener("focus",function(){t.parentElement.classList.add("is-focused")});t.addEventListener("blur",function(){t.parentElement.classList.remove("is-focused")})})}function p(){var t=document.querySelectorAll(".tutor-comments-list.tutor-parent-comment");var a=document.querySelector(".tutor-comment-box.tutor-reply-box");if(t){A(t).forEach(function(t){var e=t.querySelectorAll(".tutor-comments-list.tutor-child-comment");var r=t.querySelector(".tutor-comment-line");var n=e.length;if(e[n-1]){var o=e[n-1].clientHeight;var i=o+a.clientHeight+20-25+50;r.style.setProperty("height","calc(100% - ".concat(i,"px)"))}})}}p();window.addEventListener(_tutorobject.content_change_event,p);var v=document.querySelectorAll(".tutor-draggable > div");var m=document.querySelectorAll(".tutor-dropzone");v.forEach(function(t){t.addEventListener("dragstart",y);t.addEventListener("dragend",w)});v.forEach(function(e){["touchstart","touchmove","touchend"].forEach(function(t){e.addEventListener(t,g)})});m.forEach(function(t){t.addEventListener("dragover",b);t.addEventListener("dragenter",_);t.addEventListener("dragleave",x);t.addEventListener("drop",k)});function g(t){t.preventDefault();var e=t.type;if(e==="touchstart"){this.classList.add("tutor-dragging")}else if(e==="touchmove"){var r=document.querySelector(".tutor-drag-copy");if(t.target.classList.contains("tutor-dragging")){var n=t.target.getBoundingClientRect();if(!r){r=t.target.cloneNode(true);r.classList.add("tutor-drag-copy");t.target.parentNode.appendChild(r)}r.style.position="fixed";r.style.left=t.touches[0].clientX-r.clientWidth/2+"px";r.style.top=t.touches[0].clientY-r.clientHeight/2+"px";r.style.zIndex="9999";r.style.opacity="0.5";r.style.width=n.width+"px";r.style.height=n.height+"px"}}else if(e==="touchend"){var o=document.querySelector(".tutor-drag-copy");if(o){o.remove();var i=typeof t.originalEvent==="undefined"?t:t.originalEvent;var a=i.touches[0]||i.changedTouches[0];var u=[a.clientX,a.clientY],c=u[0],s=u[1];var l=document.elementFromPoint(c,s);if(l.classList.contains("tutor-dropzone")||l.closest(".tutor-dropzone")){if(!l.classList.contains("tutor-dropzone")){l=l.closest(".tutor-dropzone")}var d=o.querySelector("input");var f=d.dataset.name;var h=document.createElement("input");h.type="text";h.setAttribute("value",d.value);h.setAttribute("name",f);l.appendChild(h);var p=o.querySelector(".tutor-dragging-text-conent").textContent;l.querySelector(".tutor-dragging-text-conent").textContent=p;this.classList.remove("tutor-dragging")}}}}function y(){this.classList.add("tutor-dragging")}function w(){this.classList.remove("tutor-dragging")}function b(t){this.classList.add("tutor-drop-over");t.preventDefault()}function _(){}function x(){this.classList.remove("tutor-drop-over")}function k(){var t=document.querySelector(".tutor-quiz-border-box.tutor-dragging");if(this.querySelector("input")){this.querySelector("input").remove()}var e=t.querySelector("input");var r=e.dataset.name;var n=document.createElement("input");n.type="text";n.setAttribute("value",e.value);n.setAttribute("name",r);this.appendChild(n);var o=t.querySelector(".tutor-dragging-text-conent").textContent;this.querySelector(".tutor-dragging-text-conent").textContent=o;this.classList.remove("tutor-drop-over")}var L=document.getElementById("tutor-assignment-file-upload");if(L){L.addEventListener("change",S)}function S(){var t;var e=A(L.files).reduce(function(t,e){return t+e.size},0);var r=parseInt((t=document.querySelector('input[name="tutor_assignment_upload_limit"]'))===null||t===void 0?void 0:t.value)||0;var n="";var o=window._tutorobject.assignment_max_file_allowed;var i=document.querySelectorAll("#tutor-student-assignment-edit-file-preview .tutor-instructor-card").length;var a=o-i;if(L.files.length>a){L.value=null;tutor_toast(h("Warning","tutor"),h("Max ".concat(o," file allowed to upload"),"tutor"),"error");return}if(e>r){L.value=null;tutor_toast(h("Warning","tutor"),h("File size exceeds maximum limit ".concat(Math.floor(r/1e6)," MB."),"tutor"),"error");return}if("files"in L){if(L&&L.files.length==0){n="Select one or more files."}else{if(L.files.length>a){tutor_toast(h("Warning","tutor"),h("Max ".concat(o," file allowed to upload"),"tutor"),"error")}var u="";var c=document.querySelector(".tutor-asisgnment-upload-file-preview");var s=document.getElementById("tutor-student-assignment-edit-file-preview");for(var l=0;l<a;l++){var d=L.files[l];if(!d){continue}var f=s?"tutor-col-sm-5 tutor-py-16 tutor-mr-16":"";u+='<div class="tutor-instructor-card '.concat(f,'">\n <div class="tutor-icard-content">\n <div class="tutor-fs-6 tutor-color-secondary">\n ').concat(d.name,'\n </div>\n <div class="tutor-fs-7">Size: ').concat(d.size,'</div>\n </div>\n <div onclick="(() => {\n\t\t\t\t\t\t\t\t\t\tthis.closest(\'.tutor-instructor-card\').remove();\n\t\t\t\t\t\t\t\t\t})()" class="tutor-attachment-file-close tutor-iconic-btn tutor-iconic-btn-outline flex-center">\n <span class="tutor-icon-times"></span>\n </div>\n </div>')}if(c){c.innerHTML=u}if(s){s.insertAdjacentHTML("beforeend",u)}}}}var j=document.querySelectorAll(".tutor-attachment-file-close a");j.forEach(function(t){t.onclick=function(){var e=O(z().mark(function t(r){var n,o,i,a,u,c,s;return z().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:r.preventDefault();n=r.currentTarget;o=n.dataset.name;i=n.dataset.id;a=new FormData;a.set("action","tutor_remove_assignment_attachment");a.set("assignment_comment_id",i);a.set("file_name",o);a.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);u=n.querySelector("span");r.target.classList.add("is-loading");e.next=13;return q(a);case 13:c=e.sent;if(!c.ok){e.next=21;break}e.next=17;return c.json();case 17:s=e.sent;if(!s){tutor_toast(h("Warning","tutor"),h("Attachment remove failed","tutor"),"error")}else{n.closest(".tutor-instructor-card").remove()}e.next=23;break;case 21:alert(c.statusText);r.target.classList.remove("is-loading");case 23:case"end":return e.stop()}}},t)}));return function(t){return e.apply(this,arguments)}}()})});var G=ft(7942);var B=ft(818);var Q=ft(3419);var R=ft(6470);var U=ft(1103);var Y=ft(7723);function f(t,e){return W(t)||H(t,e)||p(t,e)||h()}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(t,e){if(!t)return;if(typeof t==="string")return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(t,e)}function v(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++){n[r]=t[r]}return n}function H(t,e){var r=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(r==null)return;var n=[];var o=true;var i=false;var a,u;try{for(r=r.call(t);!(o=(a=r.next()).done);o=true){n.push(a.value);if(e&&n.length===e)break}}catch(t){i=true;u=t}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(i)throw u}}return n}function W(t){if(Array.isArray(t))return t}function $(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var a=new FormData;t.forEach(function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var n=f(r[e],2),o=n[0],i=n[1];a.set(o,i)}});a.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);return a}const X=$;function T(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */T=function t(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function t(e,r,n){return e[r]=n}}function u(t,e,r,n){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(i,a,u){var c="suspendedStart";return function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return S()}for(u.method=t,u.arg=e;;){var r=u.delegate;if(r){var n=b(r,u);if(n){if(n===s)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=d(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}}(t,r,a),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s={};function c(){}function f(){}function h(){}var p={};i(p,o,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==t&&l.call(m,o)&&(p=m);var g=h.prototype=c.prototype=Object.create(p);function y(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,c){function s(t,e,r,n){var o=d(u[t],u,e);if("throw"!==o.type){var i=o.arg,a=i.value;return a&&"object"==P(a)&&l.call(a,"__await")?c.resolve(a.__await).then(function(t){s("next",t,r,n)},function(t){s("throw",t,r,n)}):c.resolve(a).then(function(t){i.value=t,r(i)},function(t){return s("throw",t,r,n)})}n(o.arg)}var e;this._invoke=function(r,n){function t(){return new c(function(t,e){s(r,n,t,e)})}return e=e?e.then(t,t):t()}}function b(t,e){var r=t.iterator[e.method];if(undefined===r){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=undefined,b(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=d(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;){if(l.call(e,r))return t.value=e[r],t.done=!1,t}return t.value=undefined,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:undefined,done:!0}}return f.prototype=h,i(g,"constructor",h),i(h,"constructor",f),f.displayName=i(h,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,i(t,n,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},y(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},y(g),i(g,n,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var t in r){n.push(t)}return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=L,k.prototype={constructor:k,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!e)for(var r in this){"t"===r.charAt(0)&&l.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=undefined)}},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(r){if(this.done)throw r;var n=this;function e(t,e){return a.type="throw",a.arg=r,n.next=t,e&&(n.method="next",n.arg=undefined),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var u=l.call(i,"catchLoc"),c=l.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function t(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),s},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),s}},a}function m(t,e,r,n,o,i,a){try{var u=t[i](a);var c=u.value}catch(t){r(t);return}if(u.done){e(c)}else{Promise.resolve(c).then(n,o)}}function J(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){m(n,e,r,o,i,"next",t)}function i(t){m(n,e,r,o,i,"throw",t)}o(undefined)})}}function P(t){"@babel/helpers - typeof";return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}var V=wp.i18n.__;var K=["keyword","course_order","tutor-course-filter-level","tutor-course-filter-tag","tutor-course-filter-category","tutor-course-filter-price","course_filter","supported_filters","current_page","action"];var Z=function t(i){var a=new URL(window.location.origin+window.location.pathname);var e=g();for(var r in e){if(K.indexOf(r)==-1){a.searchParams.append(r,e[r])}}var n=function t(e){var r=Array.isArray(i[e]);var n=r?e+"[]":e;var o=r?i[e]:[i[e]];o.forEach(function(t){if(P(t)!="object"){a.searchParams.append(n,t)}})};for(var o in i){n(o)}window.history.pushState({},"",a)};var g=function t(){var n={};new URL(window.location).searchParams.forEach(function(t,e){if(e.slice(-2)=="[]"){var r=e.slice(0,-2);!n[r]?n[r]=[]:0;!Array.isArray(n[r])?n[r]=[n[r]]:0;n[r].push(t)}else{n[e]=t}});return n};var y=function t(e){var r=g();e.find('[type="checkbox"]').prop("checked",false);e.find('[type="text"], select').val("");for(var n in r){var o=r[n];var i=e.find('[name="'+n+'"]');if(i.eq(0).attr("type")=="checkbox"){(function(){var e=!Array.isArray(o)?[o]:o;i.each(function(){var t=e.indexOf(window.jQuery(this).attr("value"))>-1;window.jQuery(this).prop("checked",t)})})()}else{i.val(o)}}};window.jQuery(document).ready(function(i){var d=window.wp.i18n.__;var a=i("[tutor-course-filter] form");if(!a.length){return}var u=i("[tutor-course-list-container]");var c=i(".tutor-courses-wrap").data("tutor_courses_meta")||{};var s={};a.on("submit",function(t){t.preventDefault()}).find("input,select").on("change",function(t){e()});y(a);window.addEventListener("popstate",function(){y(a);e(false,true)});var e=function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n=g();var o=Object.assign(a.serializeObject(),s,c);o.current_page=r&&n.current_page?n.current_page:1;o.action="tutor_course_filter_ajax";if(e){Z(o)}u.html('<div class="tutor-spinner-wrap"><span class="tutor-spinner" area-hidden="true"></span></div>');a.find("[action-tutor-clear-filter]").closest(".tutor-widget-course-filter").removeClass("tutor-d-none");i.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:o,success:function t(e){if(!e.success){u.html(d("Could not load courses","tutor"));return}u.html(e.data.html).find("nav").css("display","flex")}})};i("[tutor-toggle-course-filter]").on("click",function(t){t.preventDefault();i("body").toggleClass("tutor-course-filter-open");if(i(".tutor-course-filter-backdrop").length==0){i("body").append(i('<div class="tutor-course-filter-backdrop" area-hidden="true"></div>').hide().fadeIn(150))}});i("[tutor-hide-course-filter]").on("click",function(t){t.preventDefault();i("body").removeClass("tutor-course-filter-open")});var t=document.querySelectorAll(".tutor-course-list-enroll");t.forEach(function(t){t.onclick=function(){var e=J(T().mark(function t(r){var n,o,i,a,u,c,s,l;return T().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:r.preventDefault();n=d("Something went wrong, please try again!","tutor");o=r.target;i=[{action:"tutor_course_enrollment"},{course_id:o.dataset.courseId}];a=X(i);o.classList.add("is-loading");o.setAttribute("disabled",true);e.next=9;return q(a);case 9:u=e.sent;if(!u.ok){e.next=19;break}e.next=13;return u.json();case 13:c=e.sent;console.log(c);s=c.success,l=c.data;if(s){tutor_toast(d("Success","tutor-pro"),l,"success");window.location.href=o.href}else{tutor_toast(d("Failed","tutor-pro"),l?l:n,"error")}e.next=20;break;case 19:tutor_toast(d("Error","tutor-pro"),d(n),"error");case 20:o.classList.remove("is-loading");o.removeAttribute("disabled");case 22:case"end":return e.stop()}}},t)}));return function(t){return e.apply(this,arguments)}}()})});window.jQuery(document).ready(function(r){r(document).on("click",".tutor-course-entry-box-login button, .tutor-course-entry-box-login a, .tutor-open-login-modal",function(t){t.preventDefault();var e=r(this).data("login_url")||r(this).closest(".tutor-course-entry-box-login").data("login_url");if(e){window.location.assign(e)}else{r(".tutor-login-modal").addClass("tutor-is-active")}})});var tt=ft(6966);var et=ft(787);var rt=ft(1974);var nt=ft(6344);function D(t){"@babel/helpers - typeof";return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function I(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */I=function t(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function t(e,r,n){return e[r]=n}}function u(t,e,r,n){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(i,a,u){var c="suspendedStart";return function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return S()}for(u.method=t,u.arg=e;;){var r=u.delegate;if(r){var n=b(r,u);if(n){if(n===s)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=d(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}}(t,r,a),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s={};function c(){}function f(){}function h(){}var p={};i(p,o,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==t&&l.call(m,o)&&(p=m);var g=h.prototype=c.prototype=Object.create(p);function y(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,c){function s(t,e,r,n){var o=d(u[t],u,e);if("throw"!==o.type){var i=o.arg,a=i.value;return a&&"object"==D(a)&&l.call(a,"__await")?c.resolve(a.__await).then(function(t){s("next",t,r,n)},function(t){s("throw",t,r,n)}):c.resolve(a).then(function(t){i.value=t,r(i)},function(t){return s("throw",t,r,n)})}n(o.arg)}var e;this._invoke=function(r,n){function t(){return new c(function(t,e){s(r,n,t,e)})}return e=e?e.then(t,t):t()}}function b(t,e){var r=t.iterator[e.method];if(undefined===r){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=undefined,b(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=d(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;){if(l.call(e,r))return t.value=e[r],t.done=!1,t}return t.value=undefined,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:undefined,done:!0}}return f.prototype=h,i(g,"constructor",h),i(h,"constructor",f),f.displayName=i(h,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,i(t,n,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},y(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},y(g),i(g,n,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var t in r){n.push(t)}return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=L,k.prototype={constructor:k,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!e)for(var r in this){"t"===r.charAt(0)&&l.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=undefined)}},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(r){if(this.done)throw r;var n=this;function e(t,e){return a.type="throw",a.arg=r,n.next=t,e&&(n.method="next",n.arg=undefined),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var u=l.call(i,"catchLoc"),c=l.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function t(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),s},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),s}},a}function x(t,e,r,n,o,i,a){try{var u=t[i](a);var c=u.value}catch(t){r(t);return}if(u.done){e(c)}else{Promise.resolve(c).then(n,o)}}function ot(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){x(n,e,r,o,i,"next",t)}function i(t){x(n,e,r,o,i,"throw",t)}o(undefined)})}}var k=wp.i18n,L=k.__,it=k._x,at=k._n,ut=k._nx;document.addEventListener("DOMContentLoaded",function(){var u=document.getElementById("tutor-create-new-course");if(u){u.onclick=function(){var e=ot(I().mark(function t(r){var n,o,i,a;return I().wrap(function t(e){while(1){switch(e.prev=e.next){case 0:r.preventDefault();u.setAttribute("disabled","disabled");u.classList.add("is-loading");n=L("Something went wrong, please try again","tutor");o=new FormData;o.set("action","tutor_create_new_draft_course");o.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);e.next=9;return q(o);case 9:i=e.sent;if(!i.ok){e.next=18;break}u.classList.remove("is-loading");e.next=14;return i.json();case 14:a=e.sent;if(a.success){window.location=a.data.url}else{if(a.data.error_message){tutor_toast(L("Failed","tutor"),a.data.error_message,"error")}else{tutor_toast(L("Failed","tutor"),n,"error")}}e.next=19;break;case 18:tutor_toast(L("Failed","tutor"),n,"error");case 19:case"end":return e.stop()}}},t)}));return function(t){return e.apply(this,arguments)}}()}var e=document.getElementById("tutor-course-save-draft");if(e){e.onclick=function(t){t.preventDefault();e.setAttribute("disabled","disabled");e.classList.add("is-loading");document.getElementById("tutor-frontend-course-builder").submit()}}});var ct=ft(1626);var st=ft(9834);var lt=ft(1033);var dt=ft(4367);readyState_complete(function(){Object.entries(document.getElementsByTagName("a")).forEach(function(t){var e=t[1].getAttribute("href");if(e!==null&&e!==void 0&&e.includes("/logout")||e!==null&&e!==void 0&&e.includes("logout")){t[1].setAttribute("data-no-instant","")}})});jQuery(document).ready(function(a){"use strict";var t=wp.i18n,i=t.__,e=t._x,r=t._n,n=t._nx;if(jQuery().select2){a(".tutor_select2").select2({escapeMarkup:function t(e){return e}})}
2
  /*!
3
  * jQuery UI Touch Punch 0.2.3
4
  *
classes/Addons.php CHANGED
@@ -2,19 +2,22 @@
2
  /**
3
  * Addons class
4
  *
5
- * @author: themeum
6
- * @link: https://themeum.com
7
  * @package Tutor
8
  * @since v.1.0.0
9
  */
10
 
11
-
12
  namespace TUTOR;
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
  exit;
16
  }
17
-
 
 
 
 
18
  class Addons {
19
 
20
  /**
@@ -28,6 +31,7 @@ class Addons {
28
  * Get tutor addons list
29
  *
30
  * @return array
 
31
  */
32
  public function tutor_addons_lists_to_show() {
33
  $addons = array(
@@ -99,7 +103,7 @@ class Addons {
99
  'name' => __( 'Tutor Zoom Integration', 'tutor' ),
100
  'description' => __( 'Connect Tutor LMS with Zoom to host live online classes. Students can attend live classes right from the lesson page.', 'tutor' ),
101
  ),
102
- 'google-meet' => array(
103
  'name' => __( 'Tutor Google Meet Integration', 'tutor' ),
104
  'description' => __( 'Connect Tutor LMS with Google Meet to host live online classes. Students can attend live classes right from the lesson page.', 'tutor' ),
105
  ),
2
  /**
3
  * Addons class
4
  *
5
+ * @author themeum
6
+ * @link https://themeum.com
7
  * @package Tutor
8
  * @since v.1.0.0
9
  */
10
 
 
11
  namespace TUTOR;
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
14
  exit;
15
  }
16
+ /**
17
+ * Addons Class
18
+ *
19
+ * @since 1.0.0
20
+ */
21
  class Addons {
22
 
23
  /**
31
  * Get tutor addons list
32
  *
33
  * @return array
34
+ * @since 1.0.0
35
  */
36
  public function tutor_addons_lists_to_show() {
37
  $addons = array(
103
  'name' => __( 'Tutor Zoom Integration', 'tutor' ),
104
  'description' => __( 'Connect Tutor LMS with Zoom to host live online classes. Students can attend live classes right from the lesson page.', 'tutor' ),
105
  ),
106
+ 'google-meet' => array(
107
  'name' => __( 'Tutor Google Meet Integration', 'tutor' ),
108
  'description' => __( 'Connect Tutor LMS with Google Meet to host live online classes. Students can attend live classes right from the lesson page.', 'tutor' ),
109
  ),
classes/Admin.php CHANGED
@@ -1,25 +1,33 @@
1
  <?php
2
-
3
- namespace TUTOR;
4
-
5
- use TUTOR\Input;
6
-
7
  /**
8
  * Class Admin
9
  *
10
- * @package TUTOR
11
- *
 
12
  * @since v.1.0.0
13
  */
14
 
 
 
 
 
15
  if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  }
18
 
 
 
 
 
 
19
  class Admin {
 
 
 
20
  public function __construct() {
21
  add_action( 'admin_menu', array( $this, 'register_menu' ) );
22
- // Force activate menu for necessary
23
  add_filter( 'parent_file', array( $this, 'parent_menu_active' ) );
24
  add_filter( 'submenu_file', array( $this, 'submenu_file_active' ), 10, 2 );
25
 
@@ -29,25 +37,26 @@ class Admin {
29
  add_action( 'admin_action_uninstall_tutor_and_erase', array( $this, 'erase_tutor_data' ) );
30
  add_filter( 'plugin_action_links_' . plugin_basename( TUTOR_FILE ), array( $this, 'plugin_action_links' ) );
31
 
32
- // Plugin Row Meta
33
  add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
34
 
35
- // Admin Footer Text
36
  add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
37
- // Register Course Widget
38
  add_action( 'widgets_init', array( $this, 'register_course_widget' ) );
39
 
40
- // Handle flash toast message for redirect_to util helper
41
- add_action( 'admin_head', array( new Utils, 'handle_flash_message' ), 999 );
42
  }
43
 
44
  /**
45
  * Register admin menus
46
  *
47
  * @return void
 
48
  */
49
  public function register_menu() {
50
- $hasPro = tutor()->has_pro;
51
 
52
  $unanswered_questions = tutor_utils()->unanswered_question_count();
53
  $unanswered_bubble = '';
@@ -58,7 +67,7 @@ class Admin {
58
  $course_post_type = tutor()->course_post_type;
59
 
60
  $pro_text = '';
61
- if ( $hasPro ) {
62
  $pro_text = ' ' . __( 'Pro', 'tutor' );
63
  }
64
 
@@ -83,8 +92,8 @@ class Admin {
83
  $icon_base64_uri,
84
  $menu_position
85
  );
86
-
87
- // @since v2.0.0
88
  add_submenu_page( 'tutor', __( 'Courses', 'tutor' ), __( 'Courses', 'tutor' ), 'manage_tutor_instructor', 'tutor', array( $this, 'tutor_course_list' ) );
89
 
90
  add_submenu_page( 'tutor', __( 'Categories', 'tutor' ), __( 'Categories', 'tutor' ), 'manage_tutor', 'edit-tags.php?taxonomy=course-category&post_type=' . $course_post_type, null );
@@ -102,7 +111,7 @@ class Admin {
102
  add_submenu_page( 'tutor', __( 'Q & A', 'tutor' ), __( 'Q & A ', 'tutor' ) . $unanswered_bubble, 'manage_tutor_instructor', Question_Answers_List::Question_Answer_PAGE, array( $this, 'question_answer' ) );
103
 
104
  add_submenu_page( 'tutor', __( 'Quiz Attempts', 'tutor' ), __( 'Quiz Attempts', 'tutor' ), 'manage_tutor_instructor', Quiz_Attempts_List::QUIZ_ATTEMPT_PAGE, array( $this, 'quiz_attempts' ) );
105
-
106
  if ( $enable_course_marketplace ) {
107
  add_submenu_page( 'tutor', __( 'Withdraw Requests', 'tutor' ), __( 'Withdraw Requests', 'tutor' ), 'manage_tutor', Withdraw_Requests_List::WITHDRAW_REQUEST_LIST_PAGE, array( $this, 'withdraw_requests' ) );
108
  }
@@ -115,27 +124,57 @@ class Admin {
115
 
116
  add_submenu_page( 'tutor', __( 'Settings', 'tutor' ), __( 'Settings', 'tutor' ), 'manage_tutor', 'tutor_settings', array( new \TUTOR\Options_V2(), 'load_settings_page' ) );
117
 
118
- if ( ! $hasPro ) {
119
  add_submenu_page( 'tutor', __( 'Get Pro', 'tutor' ), __( '<span class="dashicons dashicons-awards tutor-get-pro-text"></span> Get Pro', 'tutor' ), 'manage_options', 'tutor-get-pro', array( $this, 'tutor_get_pro' ) );
120
  }
121
  }
122
 
 
 
 
 
 
 
123
  public function tutor_students() {
124
  include tutor()->path . 'views/pages/students.php';
125
  }
126
 
 
 
 
 
 
 
127
  public function tutor_instructors() {
128
  include tutor()->path . 'views/pages/instructors.php';
129
  }
130
 
 
 
 
 
 
 
131
  public function tutor_announcements() {
132
  include tutor()->path . 'views/pages/announcements.php';
133
  }
134
 
 
 
 
 
 
 
135
  public function question_answer() {
136
  include tutor()->path . 'views/pages/question_answer.php';
137
  }
138
 
 
 
 
 
 
 
139
  public function quiz_attempts() {
140
  include tutor()->path . 'views/pages/quiz_attempts.php';
141
  }
@@ -149,6 +188,12 @@ class Admin {
149
  include tutor()->path . 'views/pages/withdraw_requests.php';
150
  }
151
 
 
 
 
 
 
 
152
  public function enable_disable_addons() {
153
 
154
  if ( defined( 'TUTOR_PRO_VERSION' ) ) {
@@ -158,6 +203,12 @@ class Admin {
158
  }
159
  }
160
 
 
 
 
 
 
 
161
  public function tutor_tools_old() {
162
  $tutor_admin_tools_page = Input::get( 'tutor_admin_tools_page' );
163
  if ( $tutor_admin_tools_page ) {
@@ -186,6 +237,12 @@ class Admin {
186
  }
187
  }
188
 
 
 
 
 
 
 
189
  public function tutor_get_pro() {
190
  include tutor()->path . 'views/pages/get-pro.php';
191
  }
@@ -193,12 +250,13 @@ class Admin {
193
  /**
194
  * Parent menu active
195
  *
196
- * @param string $parent_file
197
  * @return string
 
198
  */
199
  public function parent_menu_active( $parent_file ) {
200
  $taxonomy = Input::get( 'taxonomy' );
201
- if ( $taxonomy === 'course-category' || $taxonomy === 'course-tag' ) {
202
  return 'tutor';
203
  }
204
 
@@ -208,18 +266,19 @@ class Admin {
208
  /**
209
  * Sub-menu active
210
  *
211
- * @param string $submenu_file
212
- * @param string $parent_file
213
  * @return string
 
214
  */
215
  public function submenu_file_active( $submenu_file, $parent_file ) {
216
  $taxonomy = Input::get( 'taxonomy' );
217
  $course_post_type = tutor()->course_post_type;
218
 
219
- if ( $taxonomy === 'course-category' ) {
220
  return 'edit-tags.php?taxonomy=course-category&post_type=' . $course_post_type;
221
  }
222
- if ( $taxonomy === 'course-tag' ) {
223
  return 'edit-tags.php?taxonomy=course-tag&post_type=' . $course_post_type;
224
  }
225
 
@@ -228,21 +287,31 @@ class Admin {
228
 
229
  /**
230
  * Filter posts for instructor
 
 
 
231
  */
232
  public function filter_posts_for_instructors() {
233
  if ( ! current_user_can( 'administrator' ) && current_user_can( tutor()->instructor_role ) ) {
234
- @remove_menu_page( 'edit-comments.php' ); // Comments
235
  add_filter( 'posts_clauses_request', array( $this, 'posts_clauses_request' ) );
236
  }
237
  }
238
 
 
 
 
 
 
 
 
239
  public function posts_clauses_request( $clauses ) {
240
 
241
  if ( ! is_admin() || ( ! Input::has( 'post_type' ) || Input::get( 'post_type' ) != tutor()->course_post_type ) || tutor_utils()->has_user_role( array( 'administrator', 'editor' ) ) ) {
242
  return $clauses;
243
  }
244
 
245
- // Need multi instructor check
246
  global $wpdb;
247
 
248
  $user_id = get_current_user_id();
@@ -253,7 +322,7 @@ class Admin {
253
  $in_query_pre = count( $own_courses ) ? implode( ',', $own_courses ) : null;
254
  $in_query_where = $in_query_pre ? " OR {$wpdb->posts}.ID IN({$in_query_pre})" : '';
255
 
256
- $course_post_type = tutor()->course_post_type;
257
  $custom_author_query = " AND ({$wpdb->posts}.post_type!='{$course_post_type}' OR {$wpdb->posts}.post_author = {$user_id}) {$in_query_where}";
258
 
259
  $clauses['where'] .= $custom_author_query;
@@ -292,16 +361,19 @@ class Admin {
292
  );
293
 
294
  if ( ! $get_assigned_courses_ids ) {
295
- wp_die( __( 'Permission Denied', 'tutor' ) );
296
  }
297
  }
298
  }
299
  }
300
 
301
  /**
302
- * Status
 
 
 
 
303
  */
304
-
305
  public static function scan_template_files( $template_path = null ) {
306
  if ( ! $template_path ) {
307
  $template_path = tutor()->path . 'templates/';
@@ -331,6 +403,7 @@ class Admin {
331
  * Get Template overridden files
332
  *
333
  * @return array
 
334
  */
335
  public static function template_overridden_files() {
336
  $template_files = self::scan_template_files();
@@ -356,12 +429,13 @@ class Admin {
356
  * Erase tutor data
357
  *
358
  * @return void
 
359
  */
360
  public function erase_tutor_data() {
361
  global $wpdb;
362
 
363
  $is_erase_data = tutor_utils()->get_option( 'delete_on_uninstall' );
364
- // => Deleting Data
365
 
366
  $plugin_file = tutor()->basename;
367
  if ( $is_erase_data && current_user_can( 'deactivate_plugin', $plugin_file ) ) {
@@ -382,23 +456,23 @@ class Admin {
382
  );
383
 
384
  $post_type_strings = "'" . implode( "','", $post_types ) . "'";
385
- $tutor_posts = $wpdb->get_col( "SELECT ID from {$wpdb->posts} WHERE post_type in({$post_type_strings}) ;" );
386
 
387
  if ( is_array( $tutor_posts ) && count( $tutor_posts ) ) {
388
  foreach ( $tutor_posts as $post_id ) {
389
- // Delete categories
390
  $terms = wp_get_object_terms( $post_id, 'course-category' );
391
  foreach ( $terms as $term ) {
392
  wp_remove_object_terms( $post_id, array( $term->term_id ), 'course-category' );
393
  }
394
 
395
- // Delete tags if available
396
  $terms = wp_get_object_terms( $post_id, 'course-tag' );
397
  foreach ( $terms as $term ) {
398
  wp_remove_object_terms( $post_id, array( $term->term_id ), 'course-tag' );
399
  }
400
 
401
- // Delete All Meta
402
  $wpdb->delete( $wpdb->postmeta, array( 'post_id' => $post_id ) );
403
  $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) );
404
  }
@@ -410,7 +484,7 @@ class Admin {
410
  $tutor_comments = $wpdb->get_col( "SELECT comment_ID from {$wpdb->comments} WHERE comment_agent = 'comment_agent' ;" );
411
  $comments_ids_strings = "'" . implode( "','", $tutor_comments ) . "'";
412
  if ( is_array( $tutor_comments ) && count( $tutor_comments ) ) {
413
- $wpdb->query( "DELETE from {$wpdb->commentmeta} WHERE comment_ID in({$comments_ids_strings}) " );
414
  }
415
  $wpdb->delete( $wpdb->comments, array( 'comment_agent' => 'comment_agent' ) );
416
 
@@ -425,8 +499,9 @@ class Admin {
425
  $wpdb->delete( $wpdb->usermeta, array( 'meta_key' => '_is_tutor_instructor' ) );
426
  $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '%_tutor_completed_lesson_id_%' " );
427
 
428
- // Deleting Table
429
  $prefix = $wpdb->prefix;
 
430
  $wpdb->query( "DROP TABLE IF EXISTS {$prefix}tutor_quiz_attempts, {$prefix}tutor_quiz_attempt_answers, {$prefix}tutor_quiz_questions, {$prefix}tutor_quiz_question_answers, {$prefix}tutor_earnings, {$prefix}tutor_withdraws " );
431
 
432
  deactivate_plugins( $plugin_file );
@@ -439,13 +514,14 @@ class Admin {
439
  /**
440
  * Plugin activation link
441
  *
442
- * @param array $actions
443
  * @return array
 
444
  */
445
  public function plugin_action_links( $actions ) {
446
- $hasPro = tutor()->has_pro;
447
 
448
- if ( ! $hasPro ) {
449
  $actions['tutor_pro_link'] =
450
  '<a href="https://www.themeum.com/product/tutor-lms/#pricing?utm_source=tutor_plugin_action_link&utm_medium=wordpress_dashboard&utm_campaign=go_premium" target="_blank">
451
  <span style="color: #ff7742; font-weight: bold;">' .
@@ -462,13 +538,14 @@ class Admin {
462
  /**
463
  * Add plugin meta data in WP plugins list page
464
  *
465
- * @param array $plugin_meta
466
- * @param string $plugin_file
467
  * @return array
 
468
  */
469
  public function plugin_row_meta( $plugin_meta, $plugin_file ) {
470
 
471
- if ( $plugin_file === tutor()->basename ) {
472
  $plugin_meta[] = sprintf(
473
  '<a href="%s">%s</a>',
474
  esc_url( 'https://docs.themeum.com/tutor-lms/?utm_source=tutor&utm_medium=plugins_installation_list&utm_campaign=plugin_docs_link' ),
@@ -485,11 +562,11 @@ class Admin {
485
  }
486
 
487
  /**
488
- * @param $footer_text
489
  *
 
490
  * @return string
491
- *
492
- * Add footer text only on tutor pages
493
  */
494
  public function admin_footer_text( $footer_text ) {
495
  $current_screen = get_current_screen();
@@ -499,6 +576,7 @@ class Admin {
499
  */
500
  if ( apply_filters( 'tutor_display_admin_footer_text', ( tutor_utils()->array_get( 'parent_base', $current_screen ) === 'tutor' ) ) ) {
501
  $footer_text = sprintf(
 
502
  __( 'If you like %1$s please leave us a %2$s rating. A huge thanks in advance!', 'tutor' ),
503
  sprintf( '<strong>%s</strong>', esc_html__( 'Tutor LMS', 'tutor' ) ),
504
  '<a href="https://wordpress.org/support/plugin/tutor/reviews?rate=5#new-post" target="_blank" class="tutor-rating-link">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
@@ -512,6 +590,7 @@ class Admin {
512
  * Register course widget
513
  *
514
  * @return void
 
515
  */
516
  public function register_course_widget() {
517
  register_widget( 'Tutor\Course_Widget' );
@@ -520,7 +599,7 @@ class Admin {
520
  /**
521
  * Tutor Course List
522
  *
523
- * @package Course List
524
  * @since v2.0.0
525
  */
526
  public function tutor_course_list() {
@@ -531,6 +610,7 @@ class Admin {
531
  * Show welcome page
532
  *
533
  * @return void
 
534
  */
535
  public function welcome_page() {
536
  Tutor_Setup::mark_as_visited();
1
  <?php
 
 
 
 
 
2
  /**
3
  * Class Admin
4
  *
5
+ * @author themeum
6
+ * @link https://themeum.com
7
+ * @package Tutor
8
  * @since v.1.0.0
9
  */
10
 
11
+ namespace TUTOR;
12
+
13
+ use TUTOR\Input;
14
+
15
  if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  }
18
 
19
+ /**
20
+ * Admin Class
21
+ *
22
+ * @since 1.0.0
23
+ */
24
  class Admin {
25
+ /**
26
+ * Constructor
27
+ */
28
  public function __construct() {
29
  add_action( 'admin_menu', array( $this, 'register_menu' ) );
30
+ // Force activate menu for necessary.
31
  add_filter( 'parent_file', array( $this, 'parent_menu_active' ) );
32
  add_filter( 'submenu_file', array( $this, 'submenu_file_active' ), 10, 2 );
33
 
37
  add_action( 'admin_action_uninstall_tutor_and_erase', array( $this, 'erase_tutor_data' ) );
38
  add_filter( 'plugin_action_links_' . plugin_basename( TUTOR_FILE ), array( $this, 'plugin_action_links' ) );
39
 
40
+ // Plugin Row Meta.
41
  add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
42
 
43
+ // Admin Footer Text.
44
  add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
45
+ // Register Course Widget.
46
  add_action( 'widgets_init', array( $this, 'register_course_widget' ) );
47
 
48
+ // Handle flash toast message for redirect_to util helper.
49
+ add_action( 'admin_head', array( new Utils(), 'handle_flash_message' ), 999 );
50
  }
51
 
52
  /**
53
  * Register admin menus
54
  *
55
  * @return void
56
+ * @since 1.0.0
57
  */
58
  public function register_menu() {
59
+ $has_pro = tutor()->has_pro;
60
 
61
  $unanswered_questions = tutor_utils()->unanswered_question_count();
62
  $unanswered_bubble = '';
67
  $course_post_type = tutor()->course_post_type;
68
 
69
  $pro_text = '';
70
+ if ( $has_pro ) {
71
  $pro_text = ' ' . __( 'Pro', 'tutor' );
72
  }
73
 
92
  $icon_base64_uri,
93
  $menu_position
94
  );
95
+
96
+ // Added @since v2.0.0.
97
  add_submenu_page( 'tutor', __( 'Courses', 'tutor' ), __( 'Courses', 'tutor' ), 'manage_tutor_instructor', 'tutor', array( $this, 'tutor_course_list' ) );
98
 
99
  add_submenu_page( 'tutor', __( 'Categories', 'tutor' ), __( 'Categories', 'tutor' ), 'manage_tutor', 'edit-tags.php?taxonomy=course-category&post_type=' . $course_post_type, null );
111
  add_submenu_page( 'tutor', __( 'Q & A', 'tutor' ), __( 'Q & A ', 'tutor' ) . $unanswered_bubble, 'manage_tutor_instructor', Question_Answers_List::Question_Answer_PAGE, array( $this, 'question_answer' ) );
112
 
113
  add_submenu_page( 'tutor', __( 'Quiz Attempts', 'tutor' ), __( 'Quiz Attempts', 'tutor' ), 'manage_tutor_instructor', Quiz_Attempts_List::QUIZ_ATTEMPT_PAGE, array( $this, 'quiz_attempts' ) );
114
+
115
  if ( $enable_course_marketplace ) {
116
  add_submenu_page( 'tutor', __( 'Withdraw Requests', 'tutor' ), __( 'Withdraw Requests', 'tutor' ), 'manage_tutor', Withdraw_Requests_List::WITHDRAW_REQUEST_LIST_PAGE, array( $this, 'withdraw_requests' ) );
117
  }
124
 
125
  add_submenu_page( 'tutor', __( 'Settings', 'tutor' ), __( 'Settings', 'tutor' ), 'manage_tutor', 'tutor_settings', array( new \TUTOR\Options_V2(), 'load_settings_page' ) );
126
 
127
+ if ( ! $has_pro ) {
128
  add_submenu_page( 'tutor', __( 'Get Pro', 'tutor' ), __( '<span class="dashicons dashicons-awards tutor-get-pro-text"></span> Get Pro', 'tutor' ), 'manage_options', 'tutor-get-pro', array( $this, 'tutor_get_pro' ) );
129
  }
130
  }
131
 
132
+ /**
133
+ * Show students page
134
+ *
135
+ * @return void
136
+ * @since 1.0.0
137
+ */
138
  public function tutor_students() {
139
  include tutor()->path . 'views/pages/students.php';
140
  }
141
 
142
+ /**
143
+ * Show instructor page
144
+ *
145
+ * @return void
146
+ * @since 1.0.0
147
+ */
148
  public function tutor_instructors() {
149
  include tutor()->path . 'views/pages/instructors.php';
150
  }
151
 
152
+ /**
153
+ * Show announcements page
154
+ *
155
+ * @return void
156
+ * @since 1.0.0
157
+ */
158
  public function tutor_announcements() {
159
  include tutor()->path . 'views/pages/announcements.php';
160
  }
161
 
162
+ /**
163
+ * Show Q&A page
164
+ *
165
+ * @return void
166
+ * @since 1.0.0
167
+ */
168
  public function question_answer() {
169
  include tutor()->path . 'views/pages/question_answer.php';
170
  }
171
 
172
+ /**
173
+ * Show quiz attempts page
174
+ *
175
+ * @return void
176
+ * @since 1.0.0
177
+ */
178
  public function quiz_attempts() {
179
  include tutor()->path . 'views/pages/quiz_attempts.php';
180
  }
188
  include tutor()->path . 'views/pages/withdraw_requests.php';
189
  }
190
 
191
+ /**
192
+ * Enable or disable addons
193
+ *
194
+ * @return void
195
+ * @since 1.0.0
196
+ */
197
  public function enable_disable_addons() {
198
 
199
  if ( defined( 'TUTOR_PRO_VERSION' ) ) {
203
  }
204
  }
205
 
206
+ /**
207
+ * Tutor tools page (OLD)
208
+ *
209
+ * @return void
210
+ * @since 1.0.0
211
+ */
212
  public function tutor_tools_old() {
213
  $tutor_admin_tools_page = Input::get( 'tutor_admin_tools_page' );
214
  if ( $tutor_admin_tools_page ) {
237
  }
238
  }
239
 
240
+ /**
241
+ * Show pro upgrade page
242
+ *
243
+ * @return void
244
+ * @since 1.0.0
245
+ */
246
  public function tutor_get_pro() {
247
  include tutor()->path . 'views/pages/get-pro.php';
248
  }
250
  /**
251
  * Parent menu active
252
  *
253
+ * @param string $parent_file parent file.
254
  * @return string
255
+ * @since 1.0.0
256
  */
257
  public function parent_menu_active( $parent_file ) {
258
  $taxonomy = Input::get( 'taxonomy' );
259
+ if ( 'course-category' === $taxonomy || 'course-tag' === $taxonomy ) {
260
  return 'tutor';
261
  }
262
 
266
  /**
267
  * Sub-menu active
268
  *
269
+ * @param string $submenu_file submenu file.
270
+ * @param string $parent_file parent file.
271
  * @return string
272
+ * @since 1.0.0
273
  */
274
  public function submenu_file_active( $submenu_file, $parent_file ) {
275
  $taxonomy = Input::get( 'taxonomy' );
276
  $course_post_type = tutor()->course_post_type;
277
 
278
+ if ( 'course-category' === $taxonomy ) {
279
  return 'edit-tags.php?taxonomy=course-category&post_type=' . $course_post_type;
280
  }
281
+ if ( 'course-tag' === $taxonomy ) {
282
  return 'edit-tags.php?taxonomy=course-tag&post_type=' . $course_post_type;
283
  }
284
 
287
 
288
  /**
289
  * Filter posts for instructor
290
+ *
291
+ * @return void
292
+ * @since 1.0.0
293
  */
294
  public function filter_posts_for_instructors() {
295
  if ( ! current_user_can( 'administrator' ) && current_user_can( tutor()->instructor_role ) ) {
296
+ @remove_menu_page( 'edit-comments.php' ); // Comments.
297
  add_filter( 'posts_clauses_request', array( $this, 'posts_clauses_request' ) );
298
  }
299
  }
300
 
301
+ /**
302
+ * Request for posts clauses
303
+ *
304
+ * @param mixed $clauses clauses.
305
+ * @return mixed
306
+ * @since 1.0.0
307
+ */
308
  public function posts_clauses_request( $clauses ) {
309
 
310
  if ( ! is_admin() || ( ! Input::has( 'post_type' ) || Input::get( 'post_type' ) != tutor()->course_post_type ) || tutor_utils()->has_user_role( array( 'administrator', 'editor' ) ) ) {
311
  return $clauses;
312
  }
313
 
314
+ // Need multi instructor check.
315
  global $wpdb;
316
 
317
  $user_id = get_current_user_id();
322
  $in_query_pre = count( $own_courses ) ? implode( ',', $own_courses ) : null;
323
  $in_query_where = $in_query_pre ? " OR {$wpdb->posts}.ID IN({$in_query_pre})" : '';
324
 
325
+ $course_post_type = tutor()->course_post_type;
326
  $custom_author_query = " AND ({$wpdb->posts}.post_type!='{$course_post_type}' OR {$wpdb->posts}.post_author = {$user_id}) {$in_query_where}";
327
 
328
  $clauses['where'] .= $custom_author_query;
361
  );
362
 
363
  if ( ! $get_assigned_courses_ids ) {
364
+ wp_die( esc_html__( 'Permission Denied', 'tutor' ) );
365
  }
366
  }
367
  }
368
  }
369
 
370
  /**
371
+ * Scan template files
372
+ *
373
+ * @param string $template_path template file path.
374
+ * @return array
375
+ * @since 1.0.0
376
  */
 
377
  public static function scan_template_files( $template_path = null ) {
378
  if ( ! $template_path ) {
379
  $template_path = tutor()->path . 'templates/';
403
  * Get Template overridden files
404
  *
405
  * @return array
406
+ * @since 1.0.0
407
  */
408
  public static function template_overridden_files() {
409
  $template_files = self::scan_template_files();
429
  * Erase tutor data
430
  *
431
  * @return void
432
+ * @since 1.0.0
433
  */
434
  public function erase_tutor_data() {
435
  global $wpdb;
436
 
437
  $is_erase_data = tutor_utils()->get_option( 'delete_on_uninstall' );
438
+ // Deleting Data.
439
 
440
  $plugin_file = tutor()->basename;
441
  if ( $is_erase_data && current_user_can( 'deactivate_plugin', $plugin_file ) ) {
456
  );
457
 
458
  $post_type_strings = "'" . implode( "','", $post_types ) . "'";
459
+ $tutor_posts = $wpdb->get_col( "SELECT ID from {$wpdb->posts} WHERE post_type in({$post_type_strings}) ;" ); //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
460
 
461
  if ( is_array( $tutor_posts ) && count( $tutor_posts ) ) {
462
  foreach ( $tutor_posts as $post_id ) {
463
+ // Delete categories.
464
  $terms = wp_get_object_terms( $post_id, 'course-category' );
465
  foreach ( $terms as $term ) {
466
  wp_remove_object_terms( $post_id, array( $term->term_id ), 'course-category' );
467
  }
468
 
469
+ // Delete tags if available.
470
  $terms = wp_get_object_terms( $post_id, 'course-tag' );
471
  foreach ( $terms as $term ) {
472
  wp_remove_object_terms( $post_id, array( $term->term_id ), 'course-tag' );
473
  }
474
 
475
+ // Delete All Meta.
476
  $wpdb->delete( $wpdb->postmeta, array( 'post_id' => $post_id ) );
477
  $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) );
478
  }
484
  $tutor_comments = $wpdb->get_col( "SELECT comment_ID from {$wpdb->comments} WHERE comment_agent = 'comment_agent' ;" );
485
  $comments_ids_strings = "'" . implode( "','", $tutor_comments ) . "'";
486
  if ( is_array( $tutor_comments ) && count( $tutor_comments ) ) {
487
+ $wpdb->query( "DELETE from {$wpdb->commentmeta} WHERE comment_ID in({$comments_ids_strings}) " ); //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
488
  }
489
  $wpdb->delete( $wpdb->comments, array( 'comment_agent' => 'comment_agent' ) );
490
 
499
  $wpdb->delete( $wpdb->usermeta, array( 'meta_key' => '_is_tutor_instructor' ) );
500
  $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '%_tutor_completed_lesson_id_%' " );
501
 
502
+ // Deleting Table.
503
  $prefix = $wpdb->prefix;
504
+ //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
505
  $wpdb->query( "DROP TABLE IF EXISTS {$prefix}tutor_quiz_attempts, {$prefix}tutor_quiz_attempt_answers, {$prefix}tutor_quiz_questions, {$prefix}tutor_quiz_question_answers, {$prefix}tutor_earnings, {$prefix}tutor_withdraws " );
506
 
507
  deactivate_plugins( $plugin_file );
514
  /**
515
  * Plugin activation link
516
  *
517
+ * @param array $actions action list.
518
  * @return array
519
+ * @since 1.0.0
520
  */
521
  public function plugin_action_links( $actions ) {
522
+ $has_pro = tutor()->has_pro;
523
 
524
+ if ( ! $has_pro ) {
525
  $actions['tutor_pro_link'] =
526
  '<a href="https://www.themeum.com/product/tutor-lms/#pricing?utm_source=tutor_plugin_action_link&utm_medium=wordpress_dashboard&utm_campaign=go_premium" target="_blank">
527
  <span style="color: #ff7742; font-weight: bold;">' .
538
  /**
539
  * Add plugin meta data in WP plugins list page
540
  *
541
+ * @param array $plugin_meta plugin meta data.
542
+ * @param string $plugin_file plugin file.
543
  * @return array
544
+ * @since 1.0.0
545
  */
546
  public function plugin_row_meta( $plugin_meta, $plugin_file ) {
547
 
548
+ if ( tutor()->basename === $plugin_file ) {
549
  $plugin_meta[] = sprintf(
550
  '<a href="%s">%s</a>',
551
  esc_url( 'https://docs.themeum.com/tutor-lms/?utm_source=tutor&utm_medium=plugins_installation_list&utm_campaign=plugin_docs_link' ),
562
  }
563
 
564
  /**
565
+ * Add footer text only on tutor pages
566
  *
567
+ * @param string $footer_text footer text.
568
  * @return string
569
+ * @since 1.0.0
 
570
  */
571
  public function admin_footer_text( $footer_text ) {
572
  $current_screen = get_current_screen();
576
  */
577
  if ( apply_filters( 'tutor_display_admin_footer_text', ( tutor_utils()->array_get( 'parent_base', $current_screen ) === 'tutor' ) ) ) {
578
  $footer_text = sprintf(
579
+ /* translators: %s: plugin name */
580
  __( 'If you like %1$s please leave us a %2$s rating. A huge thanks in advance!', 'tutor' ),
581
  sprintf( '<strong>%s</strong>', esc_html__( 'Tutor LMS', 'tutor' ) ),
582
  '<a href="https://wordpress.org/support/plugin/tutor/reviews?rate=5#new-post" target="_blank" class="tutor-rating-link">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
590
  * Register course widget
591
  *
592
  * @return void
593
+ * @since 1.0.0
594
  */
595
  public function register_course_widget() {
596
  register_widget( 'Tutor\Course_Widget' );
599
  /**
600
  * Tutor Course List
601
  *
602
+ * @return void
603
  * @since v2.0.0
604
  */
605
  public function tutor_course_list() {
610
  * Show welcome page
611
  *
612
  * @return void
613
+ * @since 1.0.0
614
  */
615
  public function welcome_page() {
616
  Tutor_Setup::mark_as_visited();
classes/Ajax.php CHANGED
@@ -1,4 +1,13 @@
1
  <?php
 
 
 
 
 
 
 
 
 
2
  namespace TUTOR;
3
 
4
  if ( ! defined( 'ABSPATH' ) ) {
@@ -6,11 +15,20 @@ if ( ! defined( 'ABSPATH' ) ) {
6
  }
7
 
8
  use Tutor\Models\LessonModel;
 
9
  /**
10
- * Class Ajax
 
11
  * @since 1.0.0
12
  */
13
  class Ajax {
 
 
 
 
 
 
 
14
  public function __construct() {
15
 
16
  add_action( 'wp_ajax_sync_video_playback', array( $this, 'sync_video_playback' ) );
@@ -52,15 +70,16 @@ class Ajax {
52
  /**
53
  * Update video information and data when necessary
54
  *
 
55
  * @since v.1.0.0
56
  */
57
  public function sync_video_playback() {
58
  tutor_utils()->checking_nonce();
59
 
60
- $user_id = get_current_user_id();
61
- $post_id = isset( $_POST['post_id'] ) ? sanitize_text_field( $_POST['post_id'] ) : 0;
62
- $duration = sanitize_text_field( $_POST['duration'] );
63
- $currentTime = sanitize_text_field( $_POST['currentTime'] );
64
 
65
  if ( ! tutor_utils()->has_enrolled_content_access( 'lesson', $post_id ) ) {
66
  wp_send_json_error( array( 'message' => __( 'Access Denied', 'tutor' ) ) );
@@ -73,7 +92,7 @@ class Ajax {
73
  $video = tutor_utils()->get_video( $post_id );
74
 
75
  if ( $duration ) {
76
- $video['duration_sec'] = $duration; // secs
77
  $video['playtime'] = tutor_utils()->playtime_string( $duration );
78
  $video['runtime'] = tutor_utils()->playtime_array( $duration );
79
  }
@@ -84,30 +103,41 @@ class Ajax {
84
  */
85
 
86
  $best_watch_time = tutor_utils()->get_lesson_reading_info( $post_id, $user_id, 'video_best_watched_time' );
87
- if ( $best_watch_time < $currentTime ) {
88
- LessonModel::update_lesson_reading_info( $post_id, $user_id, 'video_best_watched_time', $currentTime );
89
  }
90
 
91
- if ( tutor_utils()->avalue_dot( 'is_ended', $_POST ) ) {
92
  LessonModel::mark_lesson_complete( $post_id );
93
  }
94
  exit();
95
  }
96
 
 
 
 
 
 
 
97
  public function sync_video_playback_noprev() {
98
 
99
  }
100
 
101
-
 
 
 
 
 
102
  public function tutor_place_rating() {
103
  global $wpdb;
104
 
105
  tutor_utils()->checking_nonce();
106
 
107
- $moderation= tutor_utils()->get_option('enable_course_review_moderation', false, true, true);
108
- $rating = sanitize_text_field( tutor_utils()->avalue_dot( 'tutor_rating_gen_input', $_POST ) );
109
- $course_id = sanitize_text_field( tutor_utils()->avalue_dot( 'course_id', $_POST ) );
110
- $review = sanitize_textarea_field( tutor_utils()->avalue_dot( 'review', $_POST ) );
111
 
112
  ! $rating ? $rating = 0 : 0;
113
  $rating > 5 ? $rating = 5 : 0;
@@ -136,12 +166,12 @@ class Ajax {
136
  )
137
  );
138
 
139
- $review_ID = $previous_rating_id;
140
  if ( $previous_rating_id ) {
141
  $wpdb->update(
142
  $wpdb->comments,
143
- array(
144
- 'comment_content' => $review,
145
  'comment_approved' => $moderation ? 'hold' : 'approved',
146
  'comment_date' => $date,
147
  'comment_date_gmt' => get_gmt_from_date( $date ),
@@ -149,12 +179,14 @@ class Ajax {
149
  array( 'comment_ID' => $previous_rating_id )
150
  );
151
 
152
- $rating_info = $wpdb->get_row( $wpdb->prepare(
153
- "SELECT * FROM {$wpdb->commentmeta}
 
154
  WHERE comment_id = %d
155
- AND meta_key = 'tutor_rating'; ",
156
- $previous_rating_id
157
- ) );
 
158
 
159
  if ( $rating_info ) {
160
  $wpdb->update(
@@ -192,7 +224,7 @@ class Ajax {
192
 
193
  $wpdb->insert( $wpdb->comments, $data );
194
  $comment_id = (int) $wpdb->insert_id;
195
- $review_ID = $comment_id;
196
 
197
  if ( $comment_id ) {
198
  $result = $wpdb->insert(
@@ -211,15 +243,21 @@ class Ajax {
211
  wp_send_json_success(
212
  array(
213
  'message' => __( 'Rating placed successsully!', 'tutor' ),
214
- 'review_id' => $review_ID,
215
  )
216
  );
217
  }
218
 
 
 
 
 
 
 
219
  public function delete_tutor_review() {
220
  tutor_utils()->checking_nonce();
221
 
222
- $review_id = sanitize_text_field( tutor_utils()->array_get( 'review_id', $_POST ) );
223
 
224
  if ( ! tutor_utils()->can_user_manage( 'review', $review_id, get_current_user_id() ) ) {
225
  wp_send_json_error( array( 'message' => __( 'Permissioned Denied!', 'tutor' ) ) );
@@ -233,10 +271,16 @@ class Ajax {
233
  wp_send_json_success();
234
  }
235
 
 
 
 
 
 
 
236
  public function tutor_course_add_to_wishlist() {
237
  tutor_utils()->checking_nonce();
238
 
239
- // Redirect login since only logged in user can add courses to wishlist
240
  if ( ! is_user_logged_in() ) {
241
  wp_send_json_error(
242
  array(
@@ -247,7 +291,7 @@ class Ajax {
247
 
248
  global $wpdb;
249
  $user_id = get_current_user_id();
250
- $course_id = (int) sanitize_text_field( $_POST['course_id'] );
251
 
252
  $if_added_to_list = $wpdb->get_row(
253
  $wpdb->prepare(
@@ -288,6 +332,9 @@ class Ajax {
288
 
289
  /**
290
  * Prepare addons data
 
 
 
291
  */
292
  public function prepare_addons_data() {
293
  $addons = apply_filters( 'tutor_addons_lists_config', array() );
@@ -332,7 +379,7 @@ class Ajax {
332
  $plugins_data[ $base_name ]['plugins_required'] = $depended_plugins;
333
 
334
  // Check if it's notifications.
335
- if ( function_exists( 'tutor_notifications' ) && $base_name == tutor_notifications()->basename ) {
336
 
337
  $required = array();
338
  version_compare( PHP_VERSION, '7.2.5', '>=' ) ? 0 : $required[] = __( 'PHP 7.2.5 or greater is required', 'tutor' );
@@ -357,6 +404,9 @@ class Ajax {
357
 
358
  /**
359
  * Get all notifications
 
 
 
360
  */
361
  public function tutor_get_all_addons() {
362
 
@@ -375,6 +425,9 @@ class Ajax {
375
 
376
  /**
377
  * Method for enable / disable addons
 
 
 
378
  */
379
  public function addon_enable_disable() {
380
 
@@ -382,30 +435,27 @@ class Ajax {
382
  wp_send_json_error( array( 'message' => __( 'Access Denied', 'tutor' ) ) );
383
  }
384
 
385
- $addonsConfig = maybe_unserialize( get_option( 'tutor_addons_config' ) );
386
-
387
- // $isEnable = (bool) sanitize_text_field( tutor_utils()->avalue_dot( 'isEnable', $_POST ) );
388
- // $addonFieldName = sanitize_text_field( tutor_utils()->avalue_dot( 'addonFieldName', $_POST ) );
389
- $addonFieldNames = json_decode( stripslashes( ( tutor_utils()->avalue_dot( 'addonFieldNames', $_POST ) ) ), true );
390
 
391
- foreach ( $addonFieldNames as $addonFieldName => $isEnable ) {
392
  do_action( 'tutor_addon_before_enable_disable' );
393
- if ( $isEnable ) {
394
- do_action( "tutor_addon_before_enable_{$addonFieldName}" );
395
- do_action( 'tutor_addon_before_enable', $addonFieldName );
396
- $addonsConfig[ $addonFieldName ]['is_enable'] = 1;
397
- update_option( 'tutor_addons_config', $addonsConfig );
398
-
399
- do_action( 'tutor_addon_after_enable', $addonFieldName );
400
- do_action( "tutor_addon_after_enable_{$addonFieldName}" );
401
  } else {
402
- do_action( "tutor_addon_before_disable_{$addonFieldName}" );
403
- do_action( 'tutor_addon_before_disable', $addonFieldName );
404
- $addonsConfig[ $addonFieldName ]['is_enable'] = 0;
405
- update_option( 'tutor_addons_config', $addonsConfig );
406
 
407
- do_action( 'tutor_addon_after_disable', $addonFieldName );
408
- do_action( "tutor_addon_after_disable_{$addonFieldName}" );
409
  }
410
  do_action( 'tutor_addon_after_enable_disable' );
411
  }
@@ -416,20 +466,27 @@ class Ajax {
416
  /**
417
  * Process ajax login
418
  *
 
419
  * @since v.1.6.3
420
  */
421
  public function process_ajax_login() {
422
  tutor_utils()->checking_nonce();
423
-
 
 
 
 
424
  $username = tutor_utils()->array_get( 'log', $_POST );
425
  $password = tutor_utils()->array_get( 'pwd', $_POST );
426
  $redirect_to = tutor_utils()->array_get( 'redirect_to', $_POST );
 
 
427
 
428
  try {
429
  $creds = array(
430
  'user_login' => trim( wp_unslash( $username ) ),
431
  'user_password' => $password,
432
- 'remember' => isset( $_POST['rememberme'] ),
433
  );
434
 
435
  $validation_error = new \WP_Error();
@@ -471,9 +528,10 @@ class Ajax {
471
  );
472
  } else {
473
  do_action( 'tutor_after_login_success', $user->ID );
474
- // since 1.9.8 do enroll if guest attempt to enroll
475
- if ( ! empty( $_POST['tutor_course_enroll_attempt'] ) && is_a( $user, 'WP_User' ) ) {
476
- do_action( 'tutor_do_enroll_after_login_if_attempt', $_POST['tutor_course_enroll_attempt'], $user->ID );
 
477
  }
478
  wp_send_json_success(
479
  array(
@@ -490,22 +548,23 @@ class Ajax {
490
  /**
491
  * Create/Update announcement
492
  *
 
493
  * @since v.1.7.9
494
  */
495
  public function create_or_update_annoucement() {
496
  tutor_utils()->checking_nonce();
497
 
498
  $error = array();
499
- $course_id = sanitize_text_field( $_POST['tutor_announcement_course'] );
500
- $announcement_title = sanitize_text_field( $_POST['tutor_announcement_title'] );
501
- $announcement_summary = sanitize_textarea_field( $_POST['tutor_announcement_summary'] );
502
 
503
- // Check if user can manage this announcment
504
  if ( ! tutor_utils()->can_user_manage( 'course', $course_id ) ) {
505
  wp_send_json_error( array( 'message' => __( 'Access Denied', 'tutor' ) ) );
506
  }
507
 
508
- // set data and sanitize it
509
  $form_data = array(
510
  'post_type' => 'tutor_announcements',
511
  'post_title' => $announcement_title,
@@ -514,11 +573,11 @@ class Ajax {
514
  'post_status' => 'publish',
515
  );
516
 
517
- if ( isset( $_POST['announcement_id'] ) ) {
518
- $form_data['ID'] = sanitize_text_field( $_POST['announcement_id'] );
519
  }
520
 
521
- // validation message set
522
  if ( empty( $form_data['post_parent'] ) ) {
523
  $error['post_parent'] = __( 'Course name required', 'tutor' );
524
 
@@ -538,7 +597,7 @@ class Ajax {
538
 
539
  }
540
 
541
- // If validation fails
542
  if ( count( $error ) > 0 ) {
543
  wp_send_json_error(
544
  array(
@@ -548,15 +607,15 @@ class Ajax {
548
  );
549
  }
550
 
551
- // insert or update post
552
  $post_id = wp_insert_post( $form_data );
553
  if ( $post_id > 0 ) {
554
  $announcement = get_post( $post_id );
555
- $action_type = sanitize_textarea_field( $_POST['action_type'] );
556
 
557
  do_action( 'tutor_announcements/after/save', $post_id, $announcement, $action_type );
558
 
559
- $resp_message = $action_type == 'create' ? __( 'Announcement created successfully', 'tutor' ) : __( 'Announcement updated successfully', 'tutor' );
560
  wp_send_json_success( array( 'message' => $resp_message ) );
561
  }
562
 
@@ -566,12 +625,14 @@ class Ajax {
566
  /**
567
  * Delete announcement
568
  *
 
569
  * @since v.1.7.9
570
  */
571
  public function delete_annoucement() {
572
- $announcement_id = sanitize_text_field( $_POST['announcement_id'] );
573
  tutor_utils()->checking_nonce();
574
 
 
 
575
  if ( ! tutor_utils()->can_user_manage( 'announcement', $announcement_id ) ) {
576
  wp_send_json_error( array( 'message' => __( 'Access Denied', 'tutor' ) ) );
577
  }
1
  <?php
2
+ /**
3
+ * Ajax class for handling ajax request
4
+ *
5
+ * @author themeum
6
+ * @link https://themeum.com
7
+ * @package Tutor
8
+ * @since 1.0.0
9
+ */
10
+
11
  namespace TUTOR;
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
15
  }
16
 
17
  use Tutor\Models\LessonModel;
18
+
19
  /**
20
+ * Ajax Class
21
+ *
22
  * @since 1.0.0
23
  */
24
  class Ajax {
25
+
26
+ /**
27
+ * Constructor
28
+ *
29
+ * @return void
30
+ * @since 1.0.0
31
+ */
32
  public function __construct() {
33
 
34
  add_action( 'wp_ajax_sync_video_playback', array( $this, 'sync_video_playback' ) );
70
  /**
71
  * Update video information and data when necessary
72
  *
73
+ * @return void
74
  * @since v.1.0.0
75
  */
76
  public function sync_video_playback() {
77
  tutor_utils()->checking_nonce();
78
 
79
+ $user_id = get_current_user_id();
80
+ $post_id = Input::post( 'post_id', 0, Input::TYPE_INT );
81
+ $duration = Input::post( 'duration' );
82
+ $current_time = Input::post( 'currentTime' );
83
 
84
  if ( ! tutor_utils()->has_enrolled_content_access( 'lesson', $post_id ) ) {
85
  wp_send_json_error( array( 'message' => __( 'Access Denied', 'tutor' ) ) );
92
  $video = tutor_utils()->get_video( $post_id );
93
 
94
  if ( $duration ) {
95
+ $video['duration_sec'] = $duration; // Duration in sec.
96
  $video['playtime'] = tutor_utils()->playtime_string( $duration );
97
  $video['runtime'] = tutor_utils()->playtime_array( $duration );
98
  }
103
  */
104
 
105
  $best_watch_time = tutor_utils()->get_lesson_reading_info( $post_id, $user_id, 'video_best_watched_time' );
106
+ if ( $best_watch_time < $current_time ) {
107
+ LessonModel::update_lesson_reading_info( $post_id, $user_id, 'video_best_watched_time', $current_time );
108
  }
109
 
110
+ if ( Input::post( 'is_ended', false, Input::TYPE_BOOL ) ) {
111
  LessonModel::mark_lesson_complete( $post_id );
112
  }
113
  exit();
114
  }
115
 
116
+ /**
117
+ * Video playback callback for noprev
118
+ *
119
+ * @return void
120
+ * @since 1.0.0
121
+ */
122
  public function sync_video_playback_noprev() {
123
 
124
  }
125
 
126
+ /**
127
+ * Place rating
128
+ *
129
+ * @return void
130
+ * @since 1.0.0
131
+ */
132
  public function tutor_place_rating() {
133
  global $wpdb;
134
 
135
  tutor_utils()->checking_nonce();
136
 
137
+ $moderation = tutor_utils()->get_option( 'enable_course_review_moderation', false, true, true );
138
+ $rating = Input::post( 'tutor_rating_gen_input' );
139
+ $course_id = Input::post( 'course_id' );
140
+ $review = Input::post( 'review', '', Input::TYPE_TEXTAREA );
141
 
142
  ! $rating ? $rating = 0 : 0;
143
  $rating > 5 ? $rating = 5 : 0;
166
  )
167
  );
168
 
169
+ $review_id = $previous_rating_id;
170
  if ( $previous_rating_id ) {
171
  $wpdb->update(
172
  $wpdb->comments,
173
+ array(
174
+ 'comment_content' => $review,
175
  'comment_approved' => $moderation ? 'hold' : 'approved',
176
  'comment_date' => $date,
177
  'comment_date_gmt' => get_gmt_from_date( $date ),
179
  array( 'comment_ID' => $previous_rating_id )
180
  );
181
 
182
+ $rating_info = $wpdb->get_row(
183
+ $wpdb->prepare(
184
+ "SELECT * FROM {$wpdb->commentmeta}
185
  WHERE comment_id = %d
186
+ AND meta_key = 'tutor_rating'; ",
187
+ $previous_rating_id
188
+ )
189
+ );
190
 
191
  if ( $rating_info ) {
192
  $wpdb->update(
224
 
225
  $wpdb->insert( $wpdb->comments, $data );
226
  $comment_id = (int) $wpdb->insert_id;
227
+ $review_id = $comment_id;
228
 
229
  if ( $comment_id ) {
230
  $result = $wpdb->insert(
243
  wp_send_json_success(
244
  array(
245
  'message' => __( 'Rating placed successsully!', 'tutor' ),
246
+ 'review_id' => $review_id,
247
  )
248
  );
249
  }
250
 
251
+ /**
252
+ * Delete a review
253
+ *
254
+ * @return void
255
+ * @since 1.0.0
256
+ */
257
  public function delete_tutor_review() {
258
  tutor_utils()->checking_nonce();
259
 
260
+ $review_id = Input::post( 'review_id' );
261
 
262
  if ( ! tutor_utils()->can_user_manage( 'review', $review_id, get_current_user_id() ) ) {
263
  wp_send_json_error( array( 'message' => __( 'Permissioned Denied!', 'tutor' ) ) );
271
  wp_send_json_success();
272
  }
273
 
274
+ /**
275
+ * Add course in wishlist
276
+ *
277
+ * @return void
278
+ * @since 1.0.0
279
+ */
280
  public function tutor_course_add_to_wishlist() {
281
  tutor_utils()->checking_nonce();
282
 
283
+ // Redirect login since only logged in user can add courses to wishlist.
284
  if ( ! is_user_logged_in() ) {
285
  wp_send_json_error(
286
  array(
291
 
292
  global $wpdb;
293
  $user_id = get_current_user_id();
294
+ $course_id = Input::post( 'course_id', 0, Input::TYPE_INT );
295
 
296
  $if_added_to_list = $wpdb->get_row(
297
  $wpdb->prepare(
332
 
333
  /**
334
  * Prepare addons data
335
+ *
336
+ * @return array
337
+ * @since 1.0.0
338
  */
339
  public function prepare_addons_data() {
340
  $addons = apply_filters( 'tutor_addons_lists_config', array() );
379
  $plugins_data[ $base_name ]['plugins_required'] = $depended_plugins;
380
 
381
  // Check if it's notifications.
382
+ if ( function_exists( 'tutor_notifications' ) && tutor_notifications()->basename === $base_name ) {
383
 
384
  $required = array();
385
  version_compare( PHP_VERSION, '7.2.5', '>=' ) ? 0 : $required[] = __( 'PHP 7.2.5 or greater is required', 'tutor' );
404
 
405
  /**
406
  * Get all notifications
407
+ *
408
+ * @return void
409
+ * @since 1.0.0
410
  */
411
  public function tutor_get_all_addons() {
412
 
425
 
426
  /**
427
  * Method for enable / disable addons
428
+ *
429
+ * @return void
430
+ * @since 1.0.0
431
  */
432
  public function addon_enable_disable() {
433
 
435
  wp_send_json_error( array( 'message' => __( 'Access Denied', 'tutor' ) ) );
436
  }
437
 
438
+ $addons_config = maybe_unserialize( get_option( 'tutor_addons_config' ) );
439
+ $addon_field_names = json_decode( stripslashes( ( tutor_utils()->avalue_dot( 'addonFieldNames', $_POST ) ) ), true ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
 
 
 
440
 
441
+ foreach ( $addon_field_names as $addon_field_name => $is_enable ) {
442
  do_action( 'tutor_addon_before_enable_disable' );
443
+ if ( $is_enable ) {
444
+ do_action( "tutor_addon_before_enable_{$addon_field_name}" );
445
+ do_action( 'tutor_addon_before_enable', $addon_field_name );
446
+ $addons_config[ $addon_field_name ]['is_enable'] = 1;
447
+ update_option( 'tutor_addons_config', $addons_config );
448
+
449
+ do_action( 'tutor_addon_after_enable', $addon_field_name );
450
+ do_action( "tutor_addon_after_enable_{$addon_field_name}" );
451
  } else {
452
+ do_action( "tutor_addon_before_disable_{$addon_field_name}" );
453
+ do_action( 'tutor_addon_before_disable', $addon_field_name );
454
+ $addons_config[ $addon_field_name ]['is_enable'] = 0;
455
+ update_option( 'tutor_addons_config', $addons_config );
456
 
457
+ do_action( 'tutor_addon_after_disable', $addon_field_name );
458
+ do_action( "tutor_addon_after_disable_{$addon_field_name}" );
459
  }
460
  do_action( 'tutor_addon_after_enable_disable' );
461
  }
466
  /**
467
  * Process ajax login
468
  *
469
+ * @return void
470
  * @since v.1.6.3
471
  */
472
  public function process_ajax_login() {
473
  tutor_utils()->checking_nonce();
474
+ /**
475
+ * Sanitization will happend
476
+ * inside wp_signon > wp_authenticate function
477
+ */
478
+ //phpcs:disable WordPress.Security.NonceVerification.Missing
479
  $username = tutor_utils()->array_get( 'log', $_POST );
480
  $password = tutor_utils()->array_get( 'pwd', $_POST );
481
  $redirect_to = tutor_utils()->array_get( 'redirect_to', $_POST );
482
+ $remember = isset( $_POST['rememberme'] );
483
+ //phpcs:enable WordPress.Security.NonceVerification.Missing
484
 
485
  try {
486
  $creds = array(
487
  'user_login' => trim( wp_unslash( $username ) ),
488
  'user_password' => $password,
489
+ 'remember' => $remember,
490
  );
491
 
492
  $validation_error = new \WP_Error();
528
  );
529
  } else {
530
  do_action( 'tutor_after_login_success', $user->ID );
531
+ // Since 1.9.8 do enroll if guest attempt to enroll.
532
+ $course_enroll_attempt = Input::post( 'tutor_course_enroll_attempt' );
533
+ if ( ! empty( $course_enroll_attempt ) && is_a( $user, 'WP_User' ) ) {
534
+ do_action( 'tutor_do_enroll_after_login_if_attempt', $course_enroll_attempt, $user->ID );
535
  }
536
  wp_send_json_success(
537
  array(
548
  /**
549
  * Create/Update announcement
550
  *
551
+ * @return void
552
  * @since v.1.7.9
553
  */
554
  public function create_or_update_annoucement() {
555
  tutor_utils()->checking_nonce();
556
 
557
  $error = array();
558
+ $course_id = Input::post( 'tutor_announcement_course' );
559
+ $announcement_title = Input::post( 'tutor_announcement_title' );
560
+ $announcement_summary = Input::post( 'tutor_announcement_summary', '', Input::TYPE_TEXTAREA );
561
 
562
+ // Check if user can manage this announcment.
563
  if ( ! tutor_utils()->can_user_manage( 'course', $course_id ) ) {
564
  wp_send_json_error( array( 'message' => __( 'Access Denied', 'tutor' ) ) );
565
  }
566
 
567
+ // Set data and sanitize it.
568
  $form_data = array(
569
  'post_type' => 'tutor_announcements',
570
  'post_title' => $announcement_title,
573
  'post_status' => 'publish',
574
  );
575
 
576
+ if ( Input::has( 'announcement_id' ) ) {
577
+ $form_data['ID'] = Input::post( 'announcement_id' );
578
  }
579
 
580
+ // Validation message set.
581
  if ( empty( $form_data['post_parent'] ) ) {
582
  $error['post_parent'] = __( 'Course name required', 'tutor' );
583
 
597
 
598
  }
599
 
600
+ // If validation fails.
601
  if ( count( $error ) > 0 ) {
602
  wp_send_json_error(
603
  array(
607
  );
608
  }
609
 
610
+ // Insert or update post.
611
  $post_id = wp_insert_post( $form_data );
612
  if ( $post_id > 0 ) {
613
  $announcement = get_post( $post_id );
614
+ $action_type = Input::post( 'action_type' );
615
 
616
  do_action( 'tutor_announcements/after/save', $post_id, $announcement, $action_type );
617
 
618
+ $resp_message = 'create' === $action_type ? __( 'Announcement created successfully', 'tutor' ) : __( 'Announcement updated successfully', 'tutor' );
619
  wp_send_json_success( array( 'message' => $resp_message ) );
620
  }
621
 
625
  /**
626
  * Delete announcement
627
  *
628
+ * @return void
629
  * @since v.1.7.9
630
  */
631
  public function delete_annoucement() {
 
632
  tutor_utils()->checking_nonce();
633
 
634
+ $announcement_id = Input::post( 'announcement_id' );
635
+
636
  if ( ! tutor_utils()->can_user_manage( 'announcement', $announcement_id ) ) {
637
  wp_send_json_error( array( 'message' => __( 'Access Denied', 'tutor' ) ) );
638
  }
classes/Utils.php CHANGED
@@ -1811,7 +1811,8 @@ class Utils {
1811
  ! empty( $video['source_youtube'] ) ||
1812
  ! empty( $video['source_vimeo'] ) ||
1813
  ! empty( $video['source_embedded'] ) ||
1814
- ! empty( $video['source_shortcode'] );
 
1815
 
1816
  return $not_empty ? $video : false;
1817
  }
1811
  ! empty( $video['source_youtube'] ) ||
1812
  ! empty( $video['source_vimeo'] ) ||
1813
  ! empty( $video['source_embedded'] ) ||
1814
+ ! empty( $video['source_shortcode'] ) ||
1815
+ ( isset( $video['source_bunnynet'] ) && ! empty( $video['source_bunnynet'] ) );
1816
 
1817
  return $not_empty ? $video : false;
1818
  }
helpers/QueryHelper.php CHANGED
@@ -359,4 +359,33 @@ class QueryHelper {
359
  }
360
  return rtrim( $set, ',' );
361
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  }
359
  }
360
  return rtrim( $set, ',' );
361
  }
362
+
363
+ /**
364
+ * Make sanitized SQL IN clause value from an array
365
+ *
366
+ * @param array $arr a sequentital array.
367
+ * @return string
368
+ * @since 2.1.1
369
+ */
370
+ public static function prepare_in_clause( array $arr ) {
371
+ $escaped = array_map(
372
+ function( $value ) {
373
+ global $wpdb;
374
+ $escaped_value = null;
375
+ if ( is_int( $value ) ) {
376
+ $escaped_value = $wpdb->prepare( '%d', $value );
377
+ } else if( is_float( $value ) ) {
378
+ list( $whole, $decimal ) = explode( '.', $value );
379
+ $expression = '%.'. strlen( $decimal ) . 'f';
380
+ $escaped_value = $wpdb->prepare( $expression, $value );
381
+ } else {
382
+ $escaped_value = $wpdb->prepare( '%s', $value );
383
+ }
384
+ return $escaped_value;
385
+ },
386
+ $arr
387
+ );
388
+
389
+ return implode( ',', $escaped );
390
+ }
391
  }
languages/tutor.pot CHANGED
@@ -6,7 +6,7 @@ msgstr ""
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
9
- "POT-Creation-Date: 2022-10-25 15:06+0000\n"
10
  "X-Poedit-Basepath: ..\n"
11
  "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
12
  "X-Poedit-SearchPath-0: .\n"
@@ -18,263 +18,264 @@ msgstr ""
18
  msgid "Tutor Instructor"
19
  msgstr ""
20
 
21
- #: classes/Addons.php:35
22
  msgid "BuddyPress"
23
  msgstr ""
24
 
25
- #: classes/Addons.php:39
26
  msgid "Gradebook"
27
  msgstr ""
28
 
29
- #: classes/Addons.php:43
30
  msgid "Content Drip"
31
  msgstr ""
32
 
33
- #: classes/Addons.php:47
34
  msgid "Enrollment"
35
  msgstr ""
36
 
37
- #: classes/Addons.php:51
38
  msgid "WooCommerce Subscriptions"
39
  msgstr ""
40
 
41
- #: classes/Addons.php:55
42
  msgid "Paid Memberships Pro"
43
  msgstr ""
44
 
45
- #: classes/Addons.php:59
46
  msgid "Restrict Content Pro"
47
  msgstr ""
48
 
49
- #: classes/Addons.php:63
50
  msgid "Tutor Assignments"
51
  msgstr ""
52
 
53
- #: classes/Addons.php:67
54
  msgid "Tutor Certificate"
55
  msgstr ""
56
 
57
- #: classes/Addons.php:71
58
  msgid "Tutor Course Attachments"
59
  msgstr ""
60
 
61
- #: classes/Addons.php:75
62
  msgid "Tutor Course Preview"
63
  msgstr ""
64
 
65
- #: classes/Addons.php:79
66
  msgid "Tutor E-Mail"
67
  msgstr ""
68
 
69
- #: classes/Addons.php:83
70
  msgid "Tutor Multi Instructors"
71
  msgstr ""
72
 
73
- #: classes/Addons.php:87
74
  msgid "Tutor Prerequisites"
75
  msgstr ""
76
 
77
- #: classes/Addons.php:91
78
  msgid "Tutor Report"
79
  msgstr ""
80
 
81
- #: classes/Addons.php:95
82
  msgid "Quiz Export/Import"
83
  msgstr ""
84
 
85
- #: classes/Addons.php:96
86
  msgid "Save time by exporting/importing quiz data with easy options."
87
  msgstr ""
88
 
89
- #: classes/Addons.php:99
90
  msgid "Tutor Zoom Integration"
91
  msgstr ""
92
 
93
- #: classes/Addons.php:100
94
  msgid "Connect Tutor LMS with Zoom to host live online classes. Students can attend live classes right from the lesson page."
95
  msgstr ""
96
 
97
- #: classes/Addons.php:103
98
  msgid "Tutor Google Meet Integration"
99
  msgstr ""
100
 
101
- #: classes/Addons.php:104
102
  msgid "Connect Tutor LMS with Google Meet to host live online classes. Students can attend live classes right from the lesson page."
103
  msgstr ""
104
 
105
- #: classes/Addons.php:107
106
  msgid "Google Classroom Integration"
107
  msgstr ""
108
 
109
- #: classes/Addons.php:108
110
  msgid "Helps connect Google Classrooms with Tutor LMS courses, allowing you to use features like Classroom streams and files directly from the Tutor LMS course."
111
  msgstr ""
112
 
113
- #: classes/Addons.php:119
114
  msgid "WPML Multilingual CMS"
115
  msgstr ""
116
 
117
- #: classes/Addons.php:120
118
  msgid "Create multilingual courses, lessons, dashboard and more for a global audience."
119
  msgstr ""
120
 
121
- #: classes/Admin.php:62
122
  msgid "Pro"
123
  msgstr ""
124
 
125
- #: classes/Admin.php:78, classes/Admin.php:79, classes/Admin.php:503, classes/Gutenberg.php:102
126
  msgid "Tutor LMS"
127
  msgstr ""
128
 
129
- #: classes/Admin.php:88, classes/Admin.php:88, classes/Course_List.php:45, classes/Post_types.php:56, classes/Tutor_List_Table.php:1382, templates/archive-course-init.php:126, templates/public-profile.php:110, templates/public-profile.php:171, templates/dashboard/announcements.php:87, templates/dashboard/assignments.php:42, templates/instructor/cover.php:33, templates/instructor/default.php:31, templates/instructor/minimal-horizontal.php:30, templates/instructor/minimal.php:29, templates/instructor/portrait-horizontal.php:35, templates/dashboard/elements/filters.php:20
130
  msgid "Courses"
131
  msgstr ""
132
 
133
- #: classes/Admin.php:90, classes/Admin.php:90, views/pages/course-list.php:162
134
  msgid "Categories"
135
  msgstr ""
136
 
137
- #: classes/Admin.php:92, classes/Admin.php:92, classes/Post_types.php:147, templates/single/course/tags.php:20
138
  msgid "Tags"
139
  msgstr ""
140
 
141
- #: classes/Admin.php:94, classes/Admin.php:94, classes/Course.php:533, classes/Students_List.php:38, templates/public-profile.php:117, views/pages/students.php:80
142
  msgid "Students"
143
  msgstr ""
144
 
145
- #: classes/Admin.php:97, classes/Admin.php:97
146
  msgid "Instructors"
147
  msgstr ""
148
 
149
- #: classes/Admin.php:100, classes/Admin.php:100, classes/Announcements.php:43, classes/Options_V2.php:1130, classes/Utils.php:8444, classes/Utils.php:8703, views/fragments/announcement-list.php:201
150
  msgid "Announcements"
151
  msgstr ""
152
 
153
- #: classes/Admin.php:102
154
  msgid "Q & A"
155
  msgstr ""
156
 
157
- #: classes/Admin.php:102
158
  msgid "Q & A "
159
  msgstr ""
160
 
161
- #: classes/Admin.php:104, classes/Admin.php:104, classes/Quiz_Attempts_List.php:41, classes/Utils.php:8713, templates/dashboard.php:54, templates/dashboard/quiz-attempts.php:31
162
  msgid "Quiz Attempts"
163
  msgstr ""
164
 
165
- #: classes/Admin.php:107, classes/Admin.php:107
166
  msgid "Withdraw Requests"
167
  msgstr ""
168
 
169
- #: classes/Admin.php:110, classes/Admin.php:110, views/pages/tutor-pro-addons.php:48
170
  msgid "Add-ons"
171
  msgstr ""
172
 
173
- #: classes/Admin.php:114, classes/Admin.php:114, views/options/tools.php:11, views/pages/tools.php:2
174
  msgid "Tools"
175
  msgstr ""
176
 
177
- #: classes/Admin.php:116, classes/Admin.php:116, classes/Admin.php:457, classes/Utils.php:2685, templates/dashboard/settings.php:8, views/metabox/course-topics.php:52, views/options/settings.php:15, templates/dashboard/notifications/profile-completion.php:12, templates/dashboard/settings/social-profile.php:12
178
  msgid "Settings"
179
  msgstr ""
180
 
181
- #: classes/Admin.php:119
182
  msgid "Get Pro"
183
  msgstr ""
184
 
185
- #: classes/Admin.php:119
186
  msgid "<span class=\"dashicons dashicons-awards tutor-get-pro-text\"></span> Get Pro"
187
  msgstr ""
188
 
189
- #: classes/Admin.php:169, classes/Tools_V2.php:305, views/options/template/tutor_pages.php:5
190
  msgid "Tutor Pages"
191
  msgstr ""
192
 
193
- #: classes/Admin.php:170, classes/Instructors_List.php:328, classes/Tools_V2.php:90, templates/dashboard/purchase_history.php:96, templates/dashboard/withdraw.php:204, views/pages/instructors.php:122, views/pages/instructors.php:168, views/pages/instructors.php:187, views/pages/withdraw_requests.php:97, views/pages/withdraw_requests.php:242, views/qna/contexts.php:11, views/options/template/status.php:2, views/options/template/tutor_pages.php:23, views/pages/tools/tutor_pages.php:11
194
  msgid "Status"
195
  msgstr ""
196
 
197
- #: classes/Admin.php:295, templates/permission-denied.php:26, templates/single/lesson/required-enroll.php:5
198
  msgid "Permission Denied"
199
  msgstr ""
200
 
201
- #: classes/Admin.php:475
202
  msgid "<strong style=\"color: #03bd24\">Documentation</strong>"
203
  msgstr ""
204
 
205
- #: classes/Admin.php:480
206
  msgid "<strong style=\"color: #03bd24\">Get Support</strong>"
207
  msgstr ""
208
 
209
- #: classes/Admin.php:502
 
210
  msgid "If you like %1$s please leave us a %2$s rating. A huge thanks in advance!"
211
  msgstr ""
212
 
213
- #: classes/Ajax.php:66, classes/Ajax.php:120, classes/Ajax.php:382, classes/Ajax.php:505, classes/Ajax.php:576, classes/Course.php:497, classes/Course.php:722, classes/Instructor.php:262, classes/Lesson.php:153, classes/Lesson.php:198, classes/Lesson.php:255, classes/Quiz.php:153, classes/Quiz.php:593, classes/Quiz.php:688, classes/Quiz.php:744, classes/Quiz.php:820, classes/Quiz.php:949, classes/Quiz.php:973, classes/Quiz.php:1104, classes/Quiz.php:1165, classes/Quiz.php:1192, classes/Quiz.php:1278, classes/Q_and_A.php:121
214
  msgid "Access Denied"
215
  msgstr ""
216
 
217
- #: classes/Ajax.php:213
218
  msgid "Rating placed successsully!"
219
  msgstr ""
220
 
221
- #: classes/Ajax.php:225
222
  msgid "Permissioned Denied!"
223
  msgstr ""
224
 
225
- #: classes/Ajax.php:283
226
  msgid "Course added to wish list"
227
  msgstr ""
228
 
229
- #: classes/Ajax.php:275
230
  msgid "Course removed from wish list"
231
  msgstr ""
232
 
233
- #: classes/Ajax.php:338
234
  msgid "PHP 7.2.5 or greater is required"
235
  msgstr ""
236
 
237
- #: classes/Ajax.php:339
238
  msgid "SSL certificate"
239
  msgstr ""
240
 
241
- #: classes/Ajax.php:449
242
  msgid "Username is required."
243
  msgstr ""
244
 
245
- #: classes/Ajax.php:523
246
  msgid "Course name required"
247
  msgstr ""
248
 
249
- #: classes/Ajax.php:528
250
  msgid "Announcement title required"
251
  msgstr ""
252
 
253
- #: classes/Ajax.php:532, classes/Ajax.php:537
254
  msgid "Announcement summary required"
255
  msgstr ""
256
 
257
- #: classes/Ajax.php:545
258
  msgid "All fields required!"
259
  msgstr ""
260
 
261
- #: classes/Ajax.php:559
262
  msgid "Announcement created successfully"
263
  msgstr ""
264
 
265
- #: classes/Ajax.php:559
266
  msgid "Announcement updated successfully"
267
  msgstr ""
268
 
269
- #: classes/Ajax.php:563
270
  msgid "Something Went Wrong!"
271
  msgstr ""
272
 
273
- #: classes/Ajax.php:581
274
  msgid "Announcement deleted successfully"
275
  msgstr ""
276
 
277
- #: classes/Ajax.php:584
278
  msgid "Announcement delete failed"
279
  msgstr ""
280
 
@@ -286,23 +287,23 @@ msgstr ""
286
  msgid "Complete"
287
  msgstr ""
288
 
289
- #: classes/Backend_Page_Trait.php:62, classes/Utils.php:8246, templates/dashboard/my-courses.php:52, templates/dashboard/my-courses.php:173, views/fragments/announcement-list.php:68, views/pages/course-list.php:127, templates/dashboard/announcements/create.php:52
290
  msgid "Publish"
291
  msgstr ""
292
 
293
- #: classes/Backend_Page_Trait.php:75, classes/Course_List.php:131, classes/Utils.php:8254, templates/dashboard/my-courses.php:62, views/pages/course-list.php:130
294
  msgid "Draft"
295
  msgstr ""
296
 
297
- #: classes/Backend_Page_Trait.php:88, classes/Utils.php:8234, classes/Utils.php:8238, classes/Utils.php:8242, templates/dashboard/purchase_history.php:123
298
  msgid "On Hold"
299
  msgstr ""
300
 
301
- #: classes/Backend_Page_Trait.php:101, classes/Course_List.php:137, classes/Instructors_List.php:85, classes/Instructors_List.php:232, classes/Quiz_Attempts_List.php:200, classes/Utils.php:2821, classes/Utils.php:8182, templates/dashboard/dashboard.php:143, templates/dashboard/my-courses.php:57, templates/dashboard/purchase_history.php:135, views/pages/course-list.php:128, views/pages/instructors.php:91, views/quiz/attempt-details.php:258, views/quiz/attempt-details.php:633, views/quiz/attempt-table.php:144, templates/single/assignment/content.php:431, templates/single/course/reviews-loop.php:25
302
  msgid "Pending"
303
  msgstr ""
304
 
305
- #: classes/Backend_Page_Trait.php:114, classes/Utils.php:8214, templates/dashboard/purchase_history.php:119, templates/dashboard/purchase_history.php:127
306
  msgid "Processing"
307
  msgstr ""
308
 
@@ -322,7 +323,7 @@ msgstr ""
322
  msgid "Block"
323
  msgstr ""
324
 
325
- #: classes/Backend_Page_Trait.php:177, classes/Course_List.php:143, classes/Utils.php:8250, templates/dashboard/dashboard.php:144, views/pages/course-list.php:129
326
  msgid "Trash"
327
  msgstr ""
328
 
@@ -430,7 +431,7 @@ msgstr ""
430
  msgid "Enrollment successfully done!"
431
  msgstr ""
432
 
433
- #: classes/Course_List.php:113, classes/Instructors_List.php:73, classes/Quiz_Attempts_List.php:182, classes/Tutor_List_Table.php:397, classes/Tutor_List_Table.php:1391, classes/Utils.php:8166, templates/dashboard/announcements.php:90, templates/dashboard/assignments.php:45, templates/dashboard/elements/filters.php:24
434
  msgid "All"
435
  msgstr ""
436
 
@@ -478,7 +479,7 @@ msgstr ""
478
  msgid "Make This Course Public. No enrollment required."
479
  msgstr ""
480
 
481
- #: classes/Course_Settings_Tabs.php:73, classes/Options_V2.php:1019, classes/Utils.php:8439, templates/dashboard.php:54
482
  msgid "Q&A"
483
  msgstr ""
484
 
@@ -638,15 +639,15 @@ msgstr ""
638
  msgid "Instructor has been added successfully"
639
  msgstr ""
640
 
641
- #: classes/Instructors_List.php:47, classes/Options_V2.php:472, classes/Tutor_Setup.php:287, classes/Tutor_Setup.php:495, classes/Utils.php:8688, templates/dashboard/question-answer.php:46
642
  msgid "Instructor"
643
  msgstr ""
644
 
645
- #: classes/Instructors_List.php:235, classes/Utils.php:2822, classes/Utils.php:8202, views/pages/instructors.php:92
646
  msgid "Approved"
647
  msgstr ""
648
 
649
- #: classes/Instructors_List.php:238, classes/Utils.php:2823, classes/Utils.php:8226, views/pages/instructors.php:93
650
  msgid "Blocked"
651
  msgstr ""
652
 
@@ -730,7 +731,7 @@ msgstr ""
730
  msgid " ago"
731
  msgstr ""
732
 
733
- #: classes/Options_V2.php:427, classes/Utils.php:6875
734
  msgid "Dashboard Page"
735
  msgstr ""
736
 
@@ -1326,7 +1327,7 @@ msgstr ""
1326
  msgid "Enable to show course announcements section"
1327
  msgstr ""
1328
 
1329
- #: classes/Options_V2.php:1138, views/quiz/attempt-table.php:160, views/quiz/contexts.php:92
1330
  msgid "Review"
1331
  msgstr ""
1332
 
@@ -1438,7 +1439,7 @@ msgstr ""
1438
  msgid "This page will be used to list all the published courses."
1439
  msgstr ""
1440
 
1441
- #: classes/Options_V2.php:1397, classes/Utils.php:6876
1442
  msgid "Instructor Registration Page"
1443
  msgstr ""
1444
 
@@ -1446,7 +1447,7 @@ msgstr ""
1446
  msgid "Choose the page for instructor registration."
1447
  msgstr ""
1448
 
1449
- #: classes/Options_V2.php:1405, classes/Utils.php:6877
1450
  msgid "Student Registration Page"
1451
  msgstr ""
1452
 
@@ -1932,11 +1933,11 @@ msgstr ""
1932
  msgid "Attempt deleted successfully!"
1933
  msgstr ""
1934
 
1935
- #: classes/Quiz_Attempts_List.php:188, classes/Utils.php:8186, views/quiz/attempt-details.php:260, views/quiz/attempt-table.php:147
1936
  msgid "Pass"
1937
  msgstr ""
1938
 
1939
- #: classes/Quiz_Attempts_List.php:194, classes/Utils.php:8194, views/quiz/attempt-details.php:262, views/quiz/attempt-table.php:148
1940
  msgid "Fail"
1941
  msgstr ""
1942
 
@@ -2170,7 +2171,7 @@ msgstr ""
2170
  msgid "Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it."
2171
  msgstr ""
2172
 
2173
- #: classes/Tutor.php:571, classes/Utils.php:8731, templates/dashboard.php:48, templates/dashboard/dashboard.php:126
2174
  msgid "Dashboard"
2175
  msgstr ""
2176
 
@@ -2514,250 +2515,250 @@ msgstr ""
2514
  msgid " left"
2515
  msgstr ""
2516
 
2517
- #: classes/Utils.php:2328, templates/public-profile.php:129
2518
  msgid "Course Enrolled"
2519
  msgstr ""
2520
 
2521
- #: classes/Utils.php:2689
2522
  msgid "Logout"
2523
  msgstr ""
2524
 
2525
- #: classes/Utils.php:2706
2526
  msgid "Retrieve Password"
2527
  msgstr ""
2528
 
2529
- #: classes/Utils.php:3494, templates/shortcode/instructor-filter.php:81
2530
  msgid "Ratings"
2531
  msgstr ""
2532
 
2533
- #: classes/Utils.php:3494, templates/dashboard/dashboard.php:346
2534
  msgid "Rating"
2535
  msgstr ""
2536
 
2537
- #: classes/Utils.php:4620
2538
  msgid "True/False"
2539
  msgstr ""
2540
 
2541
- #: classes/Utils.php:4625
2542
  msgid "Single Choice"
2543
  msgstr ""
2544
 
2545
- #: classes/Utils.php:4630
2546
  msgid "Multiple Choice"
2547
  msgstr ""
2548
 
2549
- #: classes/Utils.php:4635
2550
  msgid "Open Ended"
2551
  msgstr ""
2552
 
2553
- #: classes/Utils.php:4640
2554
  msgid "Fill In The Blanks"
2555
  msgstr ""
2556
 
2557
- #: classes/Utils.php:4645
2558
  msgid "Short Answer"
2559
  msgstr ""
2560
 
2561
- #: classes/Utils.php:4650
2562
  msgid "Matching"
2563
  msgstr ""
2564
 
2565
- #: classes/Utils.php:4655
2566
  msgid "Image Matching"
2567
  msgstr ""
2568
 
2569
- #: classes/Utils.php:4660
2570
  msgid "Image Answering"
2571
  msgstr ""
2572
 
2573
- #: classes/Utils.php:4665
2574
  msgid "Ordering"
2575
  msgstr ""
2576
 
2577
- #: classes/Utils.php:5086
2578
  msgid "All Levels"
2579
  msgstr ""
2580
 
2581
- #: classes/Utils.php:5087
2582
  msgid "Beginner"
2583
  msgstr ""
2584
 
2585
- #: classes/Utils.php:5088
2586
  msgid "Intermediate"
2587
  msgstr ""
2588
 
2589
- #: classes/Utils.php:5089
2590
  msgid "Expert"
2591
  msgstr ""
2592
 
2593
- #: classes/Utils.php:5381, classes/Utils.php:5411
2594
  msgid "Facebook"
2595
  msgstr ""
2596
 
2597
- #: classes/Utils.php:5387, classes/Utils.php:5416
2598
  msgid "Twitter"
2599
  msgstr ""
2600
 
2601
- #: classes/Utils.php:5393, classes/Utils.php:5421
2602
  msgid "Linkedin"
2603
  msgstr ""
2604
 
2605
- #: classes/Utils.php:5426
2606
  msgid "Website"
2607
  msgstr ""
2608
 
2609
- #: classes/Utils.php:5431
2610
  msgid "Github"
2611
  msgstr ""
2612
 
2613
- #: classes/Utils.php:6838
2614
  msgid "Not Taken"
2615
  msgstr ""
2616
 
2617
- #: classes/Utils.php:6836
2618
  msgid "In Progress"
2619
  msgstr ""
2620
 
2621
- #: classes/Utils.php:6832, classes/Utils.php:8210, templates/dashboard/purchase_history.php:115
2622
  msgid "Completed"
2623
  msgstr ""
2624
 
2625
- #: classes/Utils.php:7028
2626
  msgid "Set Your Profile Photo"
2627
  msgstr ""
2628
 
2629
- #: classes/Utils.php:7029
2630
  msgid "Set Your Bio"
2631
  msgstr ""
2632
 
2633
- #: classes/Utils.php:7034
2634
  msgid "Set Withdraw Method"
2635
  msgstr ""
2636
 
2637
- #: classes/Utils.php:8127
2638
  msgctxt "$page_title"
2639
  msgid "%s"
2640
  msgstr ""
2641
 
2642
- #: classes/Utils.php:8169
2643
  msgid "Read"
2644
  msgstr ""
2645
 
2646
- #: classes/Utils.php:8172
2647
  msgid "Unread"
2648
  msgstr ""
2649
 
2650
- #: classes/Utils.php:8175, views/qna/qna-single.php:59
2651
  msgid "Important"
2652
  msgstr ""
2653
 
2654
- #: classes/Utils.php:8178
2655
  msgid "Archived"
2656
  msgstr ""
2657
 
2658
- #: classes/Utils.php:8190, views/quiz/attempt-details.php:629
2659
  msgid "Correct"
2660
  msgstr ""
2661
 
2662
- #: classes/Utils.php:8198
2663
  msgid "Wrong"
2664
  msgstr ""
2665
 
2666
- #: classes/Utils.php:8206
2667
  msgid "Rejected"
2668
  msgstr ""
2669
 
2670
- #: classes/Utils.php:8218, classes/Utils.php:8222, classes/Utils.php:8230, templates/dashboard/purchase_history.php:131
2671
  msgid "Cancelled"
2672
  msgstr ""
2673
 
2674
- #: classes/Utils.php:8258, views/pages/course-list.php:131
2675
  msgid "Private"
2676
  msgstr ""
2677
 
2678
- #: classes/Utils.php:8261
2679
  msgctxt "true/false question options"
2680
  msgid "True"
2681
  msgstr ""
2682
 
2683
- #: classes/Utils.php:8264
2684
  msgctxt "true/false question options"
2685
  msgid "False"
2686
  msgstr ""
2687
 
2688
- #: classes/Utils.php:8431
2689
  msgid "Course Info"
2690
  msgstr ""
2691
 
2692
- #: classes/Utils.php:8435, classes/Utils.php:8747, templates/dashboard/reviews.php:27, templates/dashboard/reviews/given-reviews.php:29
2693
  msgid "Reviews"
2694
  msgstr ""
2695
 
2696
- #: classes/Utils.php:8667, templates/single/lesson/sidebar_question_and_answer.php:45
2697
  msgid "No Data Available in this Section"
2698
  msgstr ""
2699
 
2700
- #: classes/Utils.php:8668
2701
  msgid "No Data Found from your Search/Filter"
2702
  msgstr ""
2703
 
2704
- #: classes/Utils.php:8693
2705
  msgid "Create Course"
2706
  msgstr ""
2707
 
2708
- #: classes/Utils.php:8698, templates/dashboard.php:48, templates/dashboard/dashboard.php:328, templates/dashboard/my-courses.php:44
2709
  msgid "My Courses"
2710
  msgstr ""
2711
 
2712
- #: classes/Utils.php:8708
2713
  msgid "Withdrawals"
2714
  msgstr ""
2715
 
2716
- #: classes/Utils.php:8735, templates/dashboard/my-profile.php:34
2717
  msgid "My Profile"
2718
  msgstr ""
2719
 
2720
- #: classes/Utils.php:8739, templates/dashboard/dashboard.php:156, templates/dashboard/enrolled-courses.php:17
2721
  msgid "Enrolled Courses"
2722
  msgstr ""
2723
 
2724
- #: classes/Utils.php:8743, templates/dashboard/wishlist.php:15, templates/single/course/lead-info.php:83
2725
  msgid "Wishlist"
2726
  msgstr ""
2727
 
2728
- #: classes/Utils.php:8751, templates/dashboard/my-quiz-attempts.php:34
2729
  msgid "My Quiz Attempts"
2730
  msgstr ""
2731
 
2732
- #: classes/Utils.php:8755, templates/dashboard/purchase_history.php:79
2733
  msgid "Order History"
2734
  msgstr ""
2735
 
2736
- #: classes/Utils.php:8759, templates/dashboard/question-answer.php:36, views/pages/question_answer.php:41, templates/single/course/enrolled/question_and_answer.php:108
2737
  msgid "Question & Answer"
2738
  msgstr ""
2739
 
2740
- #: classes/Utils.php:8804
2741
  msgid "HTML 5 (mp4)"
2742
  msgstr ""
2743
 
2744
- #: classes/Utils.php:8808
2745
  msgid "External URL"
2746
  msgstr ""
2747
 
2748
- #: classes/Utils.php:8812
2749
  msgid "Youtube"
2750
  msgstr ""
2751
 
2752
- #: classes/Utils.php:8816
2753
  msgid "Vimeo"
2754
  msgstr ""
2755
 
2756
- #: classes/Utils.php:8820
2757
  msgid "Embedded"
2758
  msgstr ""
2759
 
2760
- #: classes/Utils.php:8824
2761
  msgid "Shortcode"
2762
  msgstr ""
2763
 
@@ -3549,15 +3550,15 @@ msgstr ""
3549
  msgid "View Cart"
3550
  msgstr ""
3551
 
3552
- #: templates/loop/course-price-edd.php:31, templates/loop/course-price-woocommerce.php:22, templates/loop/course-price.php:21
3553
  msgid "Enroll Course"
3554
  msgstr ""
3555
 
3556
- #: templates/loop/course-price-edd.php:59, templates/loop/course-price-woocommerce.php:64, templates/loop/course-price.php:48
3557
  msgid "% Booked"
3558
  msgstr ""
3559
 
3560
- #: templates/loop/course-price-edd.php:82, templates/loop/course-price-woocommerce.php:76, templates/loop/course-price.php:61
3561
  msgid "Fully Booked"
3562
  msgstr ""
3563
 
@@ -3781,11 +3782,11 @@ msgstr ""
3781
  msgid "Total Course Duration"
3782
  msgstr ""
3783
 
3784
- #: views/metabox/course-additional-data.php:45, views/metabox/video-metabox.php:152, templates/single/quiz/top.php:66
3785
  msgid "Hour"
3786
  msgstr ""
3787
 
3788
- #: views/metabox/course-additional-data.php:49, views/metabox/video-metabox.php:156, templates/single/quiz/top.php:65
3789
  msgid "Minute"
3790
  msgstr ""
3791
 
@@ -3917,67 +3918,67 @@ msgstr ""
3917
  msgid "Upload"
3918
  msgstr ""
3919
 
3920
- #: views/metabox/video-metabox.php:26
3921
  msgid "No video source selected from settings!"
3922
  msgstr ""
3923
 
3924
- #: views/metabox/video-metabox.php:59
3925
  msgid "Video Source"
3926
  msgstr ""
3927
 
3928
- #: views/metabox/video-metabox.php:57
3929
  msgid "Course Intro Video"
3930
  msgstr ""
3931
 
3932
- #: views/metabox/video-metabox.php:75
3933
  msgid "Select Video Source"
3934
  msgstr ""
3935
 
3936
- #: views/metabox/video-metabox.php:89
3937
  msgid "Drag & Drop Your Video"
3938
  msgstr ""
3939
 
3940
- #: views/metabox/video-metabox.php:90
3941
  msgid "File Format: "
3942
  msgstr ""
3943
 
3944
- #: views/metabox/video-metabox.php:91
3945
  msgid "or"
3946
  msgstr ""
3947
 
3948
- #: views/metabox/video-metabox.php:95, views/options/template/import_export.php:46
3949
  msgid "Browse File"
3950
  msgstr ""
3951
 
3952
- #: views/metabox/video-metabox.php:110
3953
  msgid "Upload Video Poster"
3954
  msgstr ""
3955
 
3956
- #: views/metabox/video-metabox.php:121
3957
  msgid "Paste External Video URL"
3958
  msgstr ""
3959
 
3960
- #: views/metabox/video-metabox.php:125
3961
  msgid "Paste Shortcode"
3962
  msgstr ""
3963
 
3964
- #: views/metabox/video-metabox.php:129
3965
  msgid "Paste YouTube Video URL"
3966
  msgstr ""
3967
 
3968
- #: views/metabox/video-metabox.php:133
3969
  msgid "Paste Vimeo Video URL"
3970
  msgstr ""
3971
 
3972
- #: views/metabox/video-metabox.php:137
3973
  msgid "Place your embedded code here"
3974
  msgstr ""
3975
 
3976
- #: views/metabox/video-metabox.php:147
3977
  msgid "Video playback time"
3978
  msgstr ""
3979
 
3980
- #: views/metabox/video-metabox.php:160, templates/single/quiz/top.php:64
3981
  msgid "Second"
3982
  msgstr ""
3983
 
@@ -4744,11 +4745,11 @@ msgstr ""
4744
  msgid "Mark as In correct"
4745
  msgstr ""
4746
 
4747
- #: views/quiz/attempt-table.php:124
4748
  msgid "Student:"
4749
  msgstr ""
4750
 
4751
- #: views/quiz/attempt-table.php:188
4752
  msgid "Would you like to delete Quiz Attempt permanently? We suggest you proceed with caution."
4753
  msgstr ""
4754
 
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
9
+ "POT-Creation-Date: 2022-11-02 07:21+0000\n"
10
  "X-Poedit-Basepath: ..\n"
11
  "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
12
  "X-Poedit-SearchPath-0: .\n"
18
  msgid "Tutor Instructor"
19
  msgstr ""
20
 
21
+ #: classes/Addons.php:39
22
  msgid "BuddyPress"
23
  msgstr ""
24
 
25
+ #: classes/Addons.php:43
26
  msgid "Gradebook"
27
  msgstr ""
28
 
29
+ #: classes/Addons.php:47
30
  msgid "Content Drip"
31
  msgstr ""
32
 
33
+ #: classes/Addons.php:51
34
  msgid "Enrollment"
35
  msgstr ""
36
 
37
+ #: classes/Addons.php:55
38
  msgid "WooCommerce Subscriptions"
39
  msgstr ""
40
 
41
+ #: classes/Addons.php:59
42
  msgid "Paid Memberships Pro"
43
  msgstr ""
44
 
45
+ #: classes/Addons.php:63
46
  msgid "Restrict Content Pro"
47
  msgstr ""
48
 
49
+ #: classes/Addons.php:67
50
  msgid "Tutor Assignments"
51
  msgstr ""
52
 
53
+ #: classes/Addons.php:71
54
  msgid "Tutor Certificate"
55
  msgstr ""
56
 
57
+ #: classes/Addons.php:75
58
  msgid "Tutor Course Attachments"
59
  msgstr ""
60
 
61
+ #: classes/Addons.php:79
62
  msgid "Tutor Course Preview"
63
  msgstr ""
64
 
65
+ #: classes/Addons.php:83
66
  msgid "Tutor E-Mail"
67
  msgstr ""
68
 
69
+ #: classes/Addons.php:87
70
  msgid "Tutor Multi Instructors"
71
  msgstr ""
72
 
73
+ #: classes/Addons.php:91
74
  msgid "Tutor Prerequisites"
75
  msgstr ""
76
 
77
+ #: classes/Addons.php:95
78
  msgid "Tutor Report"
79
  msgstr ""
80
 
81
+ #: classes/Addons.php:99
82
  msgid "Quiz Export/Import"
83
  msgstr ""
84
 
85
+ #: classes/Addons.php:100
86
  msgid "Save time by exporting/importing quiz data with easy options."
87
  msgstr ""
88
 
89
+ #: classes/Addons.php:103
90
  msgid "Tutor Zoom Integration"
91
  msgstr ""
92
 
93
+ #: classes/Addons.php:104
94
  msgid "Connect Tutor LMS with Zoom to host live online classes. Students can attend live classes right from the lesson page."
95
  msgstr ""
96
 
97
+ #: classes/Addons.php:107
98
  msgid "Tutor Google Meet Integration"
99
  msgstr ""
100
 
101
+ #: classes/Addons.php:108
102
  msgid "Connect Tutor LMS with Google Meet to host live online classes. Students can attend live classes right from the lesson page."
103
  msgstr ""
104
 
105
+ #: classes/Addons.php:111
106
  msgid "Google Classroom Integration"
107
  msgstr ""
108
 
109
+ #: classes/Addons.php:112
110
  msgid "Helps connect Google Classrooms with Tutor LMS courses, allowing you to use features like Classroom streams and files directly from the Tutor LMS course."
111
  msgstr ""
112
 
113
+ #: classes/Addons.php:123
114
  msgid "WPML Multilingual CMS"
115
  msgstr ""
116
 
117
+ #: classes/Addons.php:124
118
  msgid "Create multilingual courses, lessons, dashboard and more for a global audience."
119
  msgstr ""
120
 
121
+ #: classes/Admin.php:71
122
  msgid "Pro"
123
  msgstr ""
124
 
125
+ #: classes/Admin.php:87, classes/Admin.php:88, classes/Admin.php:581, classes/Gutenberg.php:102
126
  msgid "Tutor LMS"
127
  msgstr ""
128
 
129
+ #: classes/Admin.php:97, classes/Admin.php:97, classes/Course_List.php:45, classes/Post_types.php:56, classes/Tutor_List_Table.php:1382, templates/archive-course-init.php:126, templates/public-profile.php:110, templates/public-profile.php:171, templates/dashboard/announcements.php:87, templates/dashboard/assignments.php:42, templates/instructor/cover.php:33, templates/instructor/default.php:31, templates/instructor/minimal-horizontal.php:30, templates/instructor/minimal.php:29, templates/instructor/portrait-horizontal.php:35, templates/dashboard/elements/filters.php:20
130
  msgid "Courses"
131
  msgstr ""
132
 
133
+ #: classes/Admin.php:99, classes/Admin.php:99, views/pages/course-list.php:162
134
  msgid "Categories"
135
  msgstr ""
136
 
137
+ #: classes/Admin.php:101, classes/Admin.php:101, classes/Post_types.php:147, templates/single/course/tags.php:20
138
  msgid "Tags"
139
  msgstr ""
140
 
141
+ #: classes/Admin.php:103, classes/Admin.php:103, classes/Course.php:533, classes/Students_List.php:38, templates/public-profile.php:117, views/pages/students.php:80
142
  msgid "Students"
143
  msgstr ""
144
 
145
+ #: classes/Admin.php:106, classes/Admin.php:106
146
  msgid "Instructors"
147
  msgstr ""
148
 
149
+ #: classes/Admin.php:109, classes/Admin.php:109, classes/Announcements.php:43, classes/Options_V2.php:1130, classes/Utils.php:8445, classes/Utils.php:8704, views/fragments/announcement-list.php:201
150
  msgid "Announcements"
151
  msgstr ""
152
 
153
+ #: classes/Admin.php:111
154
  msgid "Q & A"
155
  msgstr ""
156
 
157
+ #: classes/Admin.php:111
158
  msgid "Q & A "
159
  msgstr ""
160
 
161
+ #: classes/Admin.php:113, classes/Admin.php:113, classes/Quiz_Attempts_List.php:41, classes/Utils.php:8714, templates/dashboard.php:54, templates/dashboard/quiz-attempts.php:31
162
  msgid "Quiz Attempts"
163
  msgstr ""
164
 
165
+ #: classes/Admin.php:116, classes/Admin.php:116
166
  msgid "Withdraw Requests"
167
  msgstr ""
168
 
169
+ #: classes/Admin.php:119, classes/Admin.php:119, views/pages/tutor-pro-addons.php:48
170
  msgid "Add-ons"
171
  msgstr ""
172
 
173
+ #: classes/Admin.php:123, classes/Admin.php:123, views/options/tools.php:11, views/pages/tools.php:2
174
  msgid "Tools"
175
  msgstr ""
176
 
177
+ #: classes/Admin.php:125, classes/Admin.php:125, classes/Admin.php:533, classes/Utils.php:2686, templates/dashboard/settings.php:8, views/metabox/course-topics.php:52, views/options/settings.php:15, templates/dashboard/notifications/profile-completion.php:12, templates/dashboard/settings/social-profile.php:12
178
  msgid "Settings"
179
  msgstr ""
180
 
181
+ #: classes/Admin.php:128
182
  msgid "Get Pro"
183
  msgstr ""
184
 
185
+ #: classes/Admin.php:128
186
  msgid "<span class=\"dashicons dashicons-awards tutor-get-pro-text\"></span> Get Pro"
187
  msgstr ""
188
 
189
+ #: classes/Admin.php:220, classes/Tools_V2.php:305, views/options/template/tutor_pages.php:5
190
  msgid "Tutor Pages"
191
  msgstr ""
192
 
193
+ #: classes/Admin.php:221, classes/Instructors_List.php:328, classes/Tools_V2.php:90, templates/dashboard/purchase_history.php:96, templates/dashboard/withdraw.php:204, views/pages/instructors.php:122, views/pages/instructors.php:168, views/pages/instructors.php:187, views/pages/withdraw_requests.php:97, views/pages/withdraw_requests.php:242, views/qna/contexts.php:11, views/options/template/status.php:2, views/options/template/tutor_pages.php:23, views/pages/tools/tutor_pages.php:11
194
  msgid "Status"
195
  msgstr ""
196
 
197
+ #: classes/Admin.php:364, templates/permission-denied.php:26, templates/single/lesson/required-enroll.php:5
198
  msgid "Permission Denied"
199
  msgstr ""
200
 
201
+ #: classes/Admin.php:552
202
  msgid "<strong style=\"color: #03bd24\">Documentation</strong>"
203
  msgstr ""
204
 
205
+ #: classes/Admin.php:557
206
  msgid "<strong style=\"color: #03bd24\">Get Support</strong>"
207
  msgstr ""
208
 
209
+ #. translators: %s: plugin name
210
+ #: classes/Admin.php:580
211
  msgid "If you like %1$s please leave us a %2$s rating. A huge thanks in advance!"
212
  msgstr ""
213
 
214
+ #: classes/Ajax.php:85, classes/Ajax.php:150, classes/Ajax.php:435, classes/Ajax.php:564, classes/Ajax.php:637, classes/Course.php:497, classes/Course.php:722, classes/Instructor.php:262, classes/Lesson.php:153, classes/Lesson.php:198, classes/Lesson.php:255, classes/Quiz.php:153, classes/Quiz.php:593, classes/Quiz.php:688, classes/Quiz.php:744, classes/Quiz.php:820, classes/Quiz.php:949, classes/Quiz.php:973, classes/Quiz.php:1104, classes/Quiz.php:1165, classes/Quiz.php:1192, classes/Quiz.php:1278, classes/Q_and_A.php:121
215
  msgid "Access Denied"
216
  msgstr ""
217
 
218
+ #: classes/Ajax.php:245
219
  msgid "Rating placed successsully!"
220
  msgstr ""
221
 
222
+ #: classes/Ajax.php:263
223
  msgid "Permissioned Denied!"
224
  msgstr ""
225
 
226
+ #: classes/Ajax.php:327
227
  msgid "Course added to wish list"
228
  msgstr ""
229
 
230
+ #: classes/Ajax.php:319
231
  msgid "Course removed from wish list"
232
  msgstr ""
233
 
234
+ #: classes/Ajax.php:385
235
  msgid "PHP 7.2.5 or greater is required"
236
  msgstr ""
237
 
238
+ #: classes/Ajax.php:386
239
  msgid "SSL certificate"
240
  msgstr ""
241
 
242
+ #: classes/Ajax.php:506
243
  msgid "Username is required."
244
  msgstr ""
245
 
246
+ #: classes/Ajax.php:582
247
  msgid "Course name required"
248
  msgstr ""
249
 
250
+ #: classes/Ajax.php:587
251
  msgid "Announcement title required"
252
  msgstr ""
253
 
254
+ #: classes/Ajax.php:591, classes/Ajax.php:596
255
  msgid "Announcement summary required"
256
  msgstr ""
257
 
258
+ #: classes/Ajax.php:604
259
  msgid "All fields required!"
260
  msgstr ""
261
 
262
+ #: classes/Ajax.php:618
263
  msgid "Announcement created successfully"
264
  msgstr ""
265
 
266
+ #: classes/Ajax.php:618
267
  msgid "Announcement updated successfully"
268
  msgstr ""
269
 
270
+ #: classes/Ajax.php:622
271
  msgid "Something Went Wrong!"
272
  msgstr ""
273
 
274
+ #: classes/Ajax.php:642
275
  msgid "Announcement deleted successfully"
276
  msgstr ""
277
 
278
+ #: classes/Ajax.php:645
279
  msgid "Announcement delete failed"
280
  msgstr ""
281
 
287
  msgid "Complete"
288
  msgstr ""
289
 
290
+ #: classes/Backend_Page_Trait.php:62, classes/Utils.php:8247, templates/dashboard/my-courses.php:52, templates/dashboard/my-courses.php:173, views/fragments/announcement-list.php:68, views/pages/course-list.php:127, templates/dashboard/announcements/create.php:52
291
  msgid "Publish"
292
  msgstr ""
293
 
294
+ #: classes/Backend_Page_Trait.php:75, classes/Course_List.php:131, classes/Utils.php:8255, templates/dashboard/my-courses.php:62, views/pages/course-list.php:130
295
  msgid "Draft"
296
  msgstr ""
297
 
298
+ #: classes/Backend_Page_Trait.php:88, classes/Utils.php:8235, classes/Utils.php:8239, classes/Utils.php:8243, templates/dashboard/purchase_history.php:123
299
  msgid "On Hold"
300
  msgstr ""
301
 
302
+ #: classes/Backend_Page_Trait.php:101, classes/Course_List.php:137, classes/Instructors_List.php:85, classes/Instructors_List.php:232, classes/Quiz_Attempts_List.php:200, classes/Utils.php:2822, classes/Utils.php:8183, templates/dashboard/dashboard.php:143, templates/dashboard/my-courses.php:57, templates/dashboard/purchase_history.php:135, views/pages/course-list.php:128, views/pages/instructors.php:91, views/quiz/attempt-details.php:258, views/quiz/attempt-details.php:633, views/quiz/attempt-table.php:145, templates/single/assignment/content.php:431, templates/single/course/reviews-loop.php:25
303
  msgid "Pending"
304
  msgstr ""
305
 
306
+ #: classes/Backend_Page_Trait.php:114, classes/Utils.php:8215, templates/dashboard/purchase_history.php:119, templates/dashboard/purchase_history.php:127
307
  msgid "Processing"
308
  msgstr ""
309
 
323
  msgid "Block"
324
  msgstr ""
325
 
326
+ #: classes/Backend_Page_Trait.php:177, classes/Course_List.php:143, classes/Utils.php:8251, templates/dashboard/dashboard.php:144, views/pages/course-list.php:129
327
  msgid "Trash"
328
  msgstr ""
329
 
431
  msgid "Enrollment successfully done!"
432
  msgstr ""
433
 
434
+ #: classes/Course_List.php:113, classes/Instructors_List.php:73, classes/Quiz_Attempts_List.php:182, classes/Tutor_List_Table.php:397, classes/Tutor_List_Table.php:1391, classes/Utils.php:8167, templates/dashboard/announcements.php:90, templates/dashboard/assignments.php:45, templates/dashboard/elements/filters.php:24
435
  msgid "All"
436
  msgstr ""
437
 
479
  msgid "Make This Course Public. No enrollment required."
480
  msgstr ""
481
 
482
+ #: classes/Course_Settings_Tabs.php:73, classes/Options_V2.php:1019, classes/Utils.php:8440, templates/dashboard.php:54
483
  msgid "Q&A"
484
  msgstr ""
485
 
639
  msgid "Instructor has been added successfully"
640
  msgstr ""
641
 
642
+ #: classes/Instructors_List.php:47, classes/Options_V2.php:472, classes/Tutor_Setup.php:287, classes/Tutor_Setup.php:495, classes/Utils.php:8689, templates/dashboard/question-answer.php:46
643
  msgid "Instructor"
644
  msgstr ""
645
 
646
+ #: classes/Instructors_List.php:235, classes/Utils.php:2823, classes/Utils.php:8203, views/pages/instructors.php:92
647
  msgid "Approved"
648
  msgstr ""
649
 
650
+ #: classes/Instructors_List.php:238, classes/Utils.php:2824, classes/Utils.php:8227, views/pages/instructors.php:93
651
  msgid "Blocked"
652
  msgstr ""
653
 
731
  msgid " ago"
732
  msgstr ""
733
 
734
+ #: classes/Options_V2.php:427, classes/Utils.php:6876
735
  msgid "Dashboard Page"
736
  msgstr ""
737
 
1327
  msgid "Enable to show course announcements section"
1328
  msgstr ""
1329
 
1330
+ #: classes/Options_V2.php:1138, views/quiz/attempt-table.php:161, views/quiz/contexts.php:92
1331
  msgid "Review"
1332
  msgstr ""
1333
 
1439
  msgid "This page will be used to list all the published courses."
1440
  msgstr ""
1441
 
1442
+ #: classes/Options_V2.php:1397, classes/Utils.php:6877
1443
  msgid "Instructor Registration Page"
1444
  msgstr ""
1445
 
1447
  msgid "Choose the page for instructor registration."
1448
  msgstr ""
1449
 
1450
+ #: classes/Options_V2.php:1405, classes/Utils.php:6878
1451
  msgid "Student Registration Page"
1452
  msgstr ""
1453
 
1933
  msgid "Attempt deleted successfully!"
1934
  msgstr ""
1935
 
1936
+ #: classes/Quiz_Attempts_List.php:188, classes/Utils.php:8187, views/quiz/attempt-details.php:260, views/quiz/attempt-table.php:148
1937
  msgid "Pass"
1938
  msgstr ""
1939
 
1940
+ #: classes/Quiz_Attempts_List.php:194, classes/Utils.php:8195, views/quiz/attempt-details.php:262, views/quiz/attempt-table.php:149
1941
  msgid "Fail"
1942
  msgstr ""
1943
 
2171
  msgid "Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it."
2172
  msgstr ""
2173
 
2174
+ #: classes/Tutor.php:571, classes/Utils.php:8732, templates/dashboard.php:48, templates/dashboard/dashboard.php:126
2175
  msgid "Dashboard"
2176
  msgstr ""
2177
 
2515
  msgid " left"
2516
  msgstr ""
2517
 
2518
+ #: classes/Utils.php:2329, templates/public-profile.php:129
2519
  msgid "Course Enrolled"
2520
  msgstr ""
2521
 
2522
+ #: classes/Utils.php:2690
2523
  msgid "Logout"
2524
  msgstr ""
2525
 
2526
+ #: classes/Utils.php:2707
2527
  msgid "Retrieve Password"
2528
  msgstr ""
2529
 
2530
+ #: classes/Utils.php:3495, templates/shortcode/instructor-filter.php:81
2531
  msgid "Ratings"
2532
  msgstr ""
2533
 
2534
+ #: classes/Utils.php:3495, templates/dashboard/dashboard.php:346
2535
  msgid "Rating"
2536
  msgstr ""
2537
 
2538
+ #: classes/Utils.php:4621
2539
  msgid "True/False"
2540
  msgstr ""
2541
 
2542
+ #: classes/Utils.php:4626
2543
  msgid "Single Choice"
2544
  msgstr ""
2545
 
2546
+ #: classes/Utils.php:4631
2547
  msgid "Multiple Choice"
2548
  msgstr ""
2549
 
2550
+ #: classes/Utils.php:4636
2551
  msgid "Open Ended"
2552
  msgstr ""
2553
 
2554
+ #: classes/Utils.php:4641
2555
  msgid "Fill In The Blanks"
2556
  msgstr ""
2557
 
2558
+ #: classes/Utils.php:4646
2559
  msgid "Short Answer"
2560
  msgstr ""
2561
 
2562
+ #: classes/Utils.php:4651
2563
  msgid "Matching"
2564
  msgstr ""
2565
 
2566
+ #: classes/Utils.php:4656
2567
  msgid "Image Matching"
2568
  msgstr ""
2569
 
2570
+ #: classes/Utils.php:4661
2571
  msgid "Image Answering"
2572
  msgstr ""
2573
 
2574
+ #: classes/Utils.php:4666
2575
  msgid "Ordering"
2576
  msgstr ""
2577
 
2578
+ #: classes/Utils.php:5087
2579
  msgid "All Levels"
2580
  msgstr ""
2581
 
2582
+ #: classes/Utils.php:5088
2583
  msgid "Beginner"
2584
  msgstr ""
2585
 
2586
+ #: classes/Utils.php:5089
2587
  msgid "Intermediate"
2588
  msgstr ""
2589
 
2590
+ #: classes/Utils.php:5090
2591
  msgid "Expert"
2592
  msgstr ""
2593
 
2594
+ #: classes/Utils.php:5382, classes/Utils.php:5412
2595
  msgid "Facebook"
2596
  msgstr ""
2597
 
2598
+ #: classes/Utils.php:5388, classes/Utils.php:5417
2599
  msgid "Twitter"
2600
  msgstr ""
2601
 
2602
+ #: classes/Utils.php:5394, classes/Utils.php:5422
2603
  msgid "Linkedin"
2604
  msgstr ""
2605
 
2606
+ #: classes/Utils.php:5427
2607
  msgid "Website"
2608
  msgstr ""
2609
 
2610
+ #: classes/Utils.php:5432
2611
  msgid "Github"
2612
  msgstr ""
2613
 
2614
+ #: classes/Utils.php:6839
2615
  msgid "Not Taken"
2616
  msgstr ""
2617
 
2618
+ #: classes/Utils.php:6837
2619
  msgid "In Progress"
2620
  msgstr ""
2621
 
2622
+ #: classes/Utils.php:6833, classes/Utils.php:8211, templates/dashboard/purchase_history.php:115
2623
  msgid "Completed"
2624
  msgstr ""
2625
 
2626
+ #: classes/Utils.php:7029
2627
  msgid "Set Your Profile Photo"
2628
  msgstr ""
2629
 
2630
+ #: classes/Utils.php:7030
2631
  msgid "Set Your Bio"
2632
  msgstr ""
2633
 
2634
+ #: classes/Utils.php:7035
2635
  msgid "Set Withdraw Method"
2636
  msgstr ""
2637
 
2638
+ #: classes/Utils.php:8128
2639
  msgctxt "$page_title"
2640
  msgid "%s"
2641
  msgstr ""
2642
 
2643
+ #: classes/Utils.php:8170
2644
  msgid "Read"
2645
  msgstr ""
2646
 
2647
+ #: classes/Utils.php:8173
2648
  msgid "Unread"
2649
  msgstr ""
2650
 
2651
+ #: classes/Utils.php:8176, views/qna/qna-single.php:59
2652
  msgid "Important"
2653
  msgstr ""
2654
 
2655
+ #: classes/Utils.php:8179
2656
  msgid "Archived"
2657
  msgstr ""
2658
 
2659
+ #: classes/Utils.php:8191, views/quiz/attempt-details.php:629
2660
  msgid "Correct"
2661
  msgstr ""
2662
 
2663
+ #: classes/Utils.php:8199
2664
  msgid "Wrong"
2665
  msgstr ""
2666
 
2667
+ #: classes/Utils.php:8207
2668
  msgid "Rejected"
2669
  msgstr ""
2670
 
2671
+ #: classes/Utils.php:8219, classes/Utils.php:8223, classes/Utils.php:8231, templates/dashboard/purchase_history.php:131
2672
  msgid "Cancelled"
2673
  msgstr ""
2674
 
2675
+ #: classes/Utils.php:8259, views/pages/course-list.php:131
2676
  msgid "Private"
2677
  msgstr ""
2678
 
2679
+ #: classes/Utils.php:8262
2680
  msgctxt "true/false question options"
2681
  msgid "True"
2682
  msgstr ""
2683
 
2684
+ #: classes/Utils.php:8265
2685
  msgctxt "true/false question options"
2686
  msgid "False"
2687
  msgstr ""
2688
 
2689
+ #: classes/Utils.php:8432
2690
  msgid "Course Info"
2691
  msgstr ""
2692
 
2693
+ #: classes/Utils.php:8436, classes/Utils.php:8748, templates/dashboard/reviews.php:27, templates/dashboard/reviews/given-reviews.php:29
2694
  msgid "Reviews"
2695
  msgstr ""
2696
 
2697
+ #: classes/Utils.php:8668, templates/single/lesson/sidebar_question_and_answer.php:45
2698
  msgid "No Data Available in this Section"
2699
  msgstr ""
2700
 
2701
+ #: classes/Utils.php:8669
2702
  msgid "No Data Found from your Search/Filter"
2703
  msgstr ""
2704
 
2705
+ #: classes/Utils.php:8694
2706
  msgid "Create Course"
2707
  msgstr ""
2708
 
2709
+ #: classes/Utils.php:8699, templates/dashboard.php:48, templates/dashboard/dashboard.php:328, templates/dashboard/my-courses.php:44
2710
  msgid "My Courses"
2711
  msgstr ""
2712
 
2713
+ #: classes/Utils.php:8709
2714
  msgid "Withdrawals"
2715
  msgstr ""
2716
 
2717
+ #: classes/Utils.php:8736, templates/dashboard/my-profile.php:34
2718
  msgid "My Profile"
2719
  msgstr ""
2720
 
2721
+ #: classes/Utils.php:8740, templates/dashboard/dashboard.php:156, templates/dashboard/enrolled-courses.php:17
2722
  msgid "Enrolled Courses"
2723
  msgstr ""
2724
 
2725
+ #: classes/Utils.php:8744, templates/dashboard/wishlist.php:15, templates/single/course/lead-info.php:83
2726
  msgid "Wishlist"
2727
  msgstr ""
2728
 
2729
+ #: classes/Utils.php:8752, templates/dashboard/my-quiz-attempts.php:34
2730
  msgid "My Quiz Attempts"
2731
  msgstr ""
2732
 
2733
+ #: classes/Utils.php:8756, templates/dashboard/purchase_history.php:79
2734
  msgid "Order History"
2735
  msgstr ""
2736
 
2737
+ #: classes/Utils.php:8760, templates/dashboard/question-answer.php:36, views/pages/question_answer.php:41, templates/single/course/enrolled/question_and_answer.php:108
2738
  msgid "Question & Answer"
2739
  msgstr ""
2740
 
2741
+ #: classes/Utils.php:8805
2742
  msgid "HTML 5 (mp4)"
2743
  msgstr ""
2744
 
2745
+ #: classes/Utils.php:8809
2746
  msgid "External URL"
2747
  msgstr ""
2748
 
2749
+ #: classes/Utils.php:8813
2750
  msgid "Youtube"
2751
  msgstr ""
2752
 
2753
+ #: classes/Utils.php:8817
2754
  msgid "Vimeo"
2755
  msgstr ""
2756
 
2757
+ #: classes/Utils.php:8821
2758
  msgid "Embedded"
2759
  msgstr ""
2760
 
2761
+ #: classes/Utils.php:8825
2762
  msgid "Shortcode"
2763
  msgstr ""
2764
 
3550
  msgid "View Cart"
3551
  msgstr ""
3552
 
3553
+ #: templates/loop/course-price-edd.php:31, templates/loop/course-price-woocommerce.php:22, templates/loop/course-price.php:32
3554
  msgid "Enroll Course"
3555
  msgstr ""
3556
 
3557
+ #: templates/loop/course-price-edd.php:59, templates/loop/course-price-woocommerce.php:64, templates/loop/course-price.php:59
3558
  msgid "% Booked"
3559
  msgstr ""
3560
 
3561
+ #: templates/loop/course-price-edd.php:82, templates/loop/course-price-woocommerce.php:76, templates/loop/course-price.php:72
3562
  msgid "Fully Booked"
3563
  msgstr ""
3564
 
3782
  msgid "Total Course Duration"
3783
  msgstr ""
3784
 
3785
+ #: views/metabox/course-additional-data.php:45, views/metabox/video-metabox.php:189, templates/single/quiz/top.php:66
3786
  msgid "Hour"
3787
  msgstr ""
3788
 
3789
+ #: views/metabox/course-additional-data.php:49, views/metabox/video-metabox.php:193, templates/single/quiz/top.php:65
3790
  msgid "Minute"
3791
  msgstr ""
3792
 
3918
  msgid "Upload"
3919
  msgstr ""
3920
 
3921
+ #: views/metabox/video-metabox.php:27
3922
  msgid "No video source selected from settings!"
3923
  msgstr ""
3924
 
3925
+ #: views/metabox/video-metabox.php:73
3926
  msgid "Video Source"
3927
  msgstr ""
3928
 
3929
+ #: views/metabox/video-metabox.php:71
3930
  msgid "Course Intro Video"
3931
  msgstr ""
3932
 
3933
+ #: views/metabox/video-metabox.php:97
3934
  msgid "Select Video Source"
3935
  msgstr ""
3936
 
3937
+ #: views/metabox/video-metabox.php:111
3938
  msgid "Drag & Drop Your Video"
3939
  msgstr ""
3940
 
3941
+ #: views/metabox/video-metabox.php:112
3942
  msgid "File Format: "
3943
  msgstr ""
3944
 
3945
+ #: views/metabox/video-metabox.php:113
3946
  msgid "or"
3947
  msgstr ""
3948
 
3949
+ #: views/metabox/video-metabox.php:117, views/options/template/import_export.php:46
3950
  msgid "Browse File"
3951
  msgstr ""
3952
 
3953
+ #: views/metabox/video-metabox.php:143
3954
  msgid "Upload Video Poster"
3955
  msgstr ""
3956
 
3957
+ #: views/metabox/video-metabox.php:158
3958
  msgid "Paste External Video URL"
3959
  msgstr ""
3960
 
3961
+ #: views/metabox/video-metabox.php:162
3962
  msgid "Paste Shortcode"
3963
  msgstr ""
3964
 
3965
+ #: views/metabox/video-metabox.php:166
3966
  msgid "Paste YouTube Video URL"
3967
  msgstr ""
3968
 
3969
+ #: views/metabox/video-metabox.php:170
3970
  msgid "Paste Vimeo Video URL"
3971
  msgstr ""
3972
 
3973
+ #: views/metabox/video-metabox.php:174
3974
  msgid "Place your embedded code here"
3975
  msgstr ""
3976
 
3977
+ #: views/metabox/video-metabox.php:184
3978
  msgid "Video playback time"
3979
  msgstr ""
3980
 
3981
+ #: views/metabox/video-metabox.php:197, templates/single/quiz/top.php:64
3982
  msgid "Second"
3983
  msgstr ""
3984
 
4745
  msgid "Mark as In correct"
4746
  msgstr ""
4747
 
4748
+ #: views/quiz/attempt-table.php:125
4749
  msgid "Student:"
4750
  msgstr ""
4751
 
4752
+ #: views/quiz/attempt-table.php:189
4753
  msgid "Would you like to delete Quiz Attempt permanently? We suggest you proceed with caution."
4754
  msgstr ""
4755
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: lms, course, elearning, education, learning management system
5
  Requires at least: 5.3
6
  Tested up to: 6.0.3
7
  Requires PHP: 7.0
8
- Stable tag: 2.1.1
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -225,6 +225,12 @@ Looking for the best LMS for WordPress? Get Tutor and start your e-learning webs
225
 
226
  == Changelog ==
227
 
 
 
 
 
 
 
228
  = 2.1.1 - October 25, 2022
229
 
230
  Update: More security improvement is introduced
5
  Requires at least: 5.3
6
  Tested up to: 6.0.3
7
  Requires PHP: 7.0
8
+ Stable tag: 2.1.2
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
225
 
226
  == Changelog ==
227
 
228
+ = 2.1.2 - November 2, 2022
229
+
230
+ Update: BunnyNet Compatibility Update is Introduced
231
+ Update: More Security Compatibility Update is Introduced
232
+ Fix: Backend Assignment page was not showing newly submitted assignments in some cases
233
+
234
  = 2.1.1 - October 25, 2022
235
 
236
  Update: More security improvement is introduced
templates/loop/course-price.php CHANGED
@@ -14,7 +14,18 @@
14
  ?>
15
  <?php
16
  $course_id = get_the_ID();
17
- $button_class = ' tutor-course-list-enroll';
 
 
 
 
 
 
 
 
 
 
 
18
  if ( ! is_user_logged_in() ) {
19
  $button_class = ' tutor-open-login-modal';
20
  }
14
  ?>
15
  <?php
16
  $course_id = get_the_ID();
17
+ $monetization = tutor_utils()->get_option( 'monetize_by' );
18
+ /**
19
+ * If Monetization is PMPRO then ignore ajax enrolment
20
+ * to avoid Paid course enrollment without payment.
21
+ *
22
+ * Note: There is no mapping between Tutor Course and PMPRO
23
+ * That is way there is no way to determine whether course if free
24
+ * or paid
25
+ *
26
+ * @since v2.1.2
27
+ */
28
+ $button_class = 'pmpro' === $monetization ? ' ' : ' tutor-course-list-enroll';
29
  if ( ! is_user_logged_in() ) {
30
  $button_class = ' tutor-open-login-modal';
31
  }
tutor.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://www.themeum.com/product/tutor-lms/
5
  * Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create small to large scale online education site very conveniently. Power features like report, certificate, course preview, private file sharing make Tutor a robust plugin for any educational institutes.
6
  * Author: Themeum
7
- * Version: 2.1.1
8
  * Author URI: https://themeum.com
9
  * Requires at least: 5.3
10
  * Tested up to: 6.0.3
@@ -21,7 +21,7 @@ require_once "vendor/autoload.php";
21
  /**
22
  * Defined the tutor main file
23
  */
24
- define( 'TUTOR_VERSION', '2.1.1' );
25
  define( 'TUTOR_FILE', __FILE__ );
26
 
27
  /**
4
  * Plugin URI: https://www.themeum.com/product/tutor-lms/
5
  * Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create small to large scale online education site very conveniently. Power features like report, certificate, course preview, private file sharing make Tutor a robust plugin for any educational institutes.
6
  * Author: Themeum
7
+ * Version: 2.1.2
8
  * Author URI: https://themeum.com
9
  * Requires at least: 5.3
10
  * Tested up to: 6.0.3
21
  /**
22
  * Defined the tutor main file
23
  */
24
+ define( 'TUTOR_VERSION', '2.1.2' );
25
  define( 'TUTOR_FILE', __FILE__ );
26
 
27
  /**
vendor/composer/installed.php CHANGED
@@ -3,7 +3,7 @@
3
  'name' => 'themeum/tutor',
4
  'pretty_version' => 'dev-master',
5
  'version' => 'dev-master',
6
- 'reference' => '02d53199c44855880dbe137d71077d167f1be117',
7
  'type' => 'library',
8
  'install_path' => __DIR__ . '/../../',
9
  'aliases' => array(),
@@ -13,7 +13,7 @@
13
  'themeum/tutor' => array(
14
  'pretty_version' => 'dev-master',
15
  'version' => 'dev-master',
16
- 'reference' => '02d53199c44855880dbe137d71077d167f1be117',
17
  'type' => 'library',
18
  'install_path' => __DIR__ . '/../../',
19
  'aliases' => array(),
3
  'name' => 'themeum/tutor',
4
  'pretty_version' => 'dev-master',
5
  'version' => 'dev-master',
6
+ 'reference' => '8d016ba24c95fb2acdbe197a766ec82bb5eca0bd',
7
  'type' => 'library',
8
  'install_path' => __DIR__ . '/../../',
9
  'aliases' => array(),
13
  'themeum/tutor' => array(
14
  'pretty_version' => 'dev-master',
15
  'version' => 'dev-master',
16
+ 'reference' => '8d016ba24c95fb2acdbe197a766ec82bb5eca0bd',
17
  'type' => 'library',
18
  'install_path' => __DIR__ . '/../../',
19
  'aliases' => array(),
views/metabox/video-metabox.php CHANGED
@@ -4,162 +4,199 @@
4
  * Don't change it, it's supporting modal in other place
5
  * if get_the_ID() empty, then it's means we are passing $post variable from another place
6
  */
7
- if (get_the_ID())
8
- global $post;
9
-
10
- $video = maybe_unserialize(get_post_meta($post->ID, '_video', true));
11
- $videoSource = tutor_utils()->avalue_dot('source', $video, 'html5');
12
- $runtimeHours = tutor_utils()->avalue_dot('runtime.hours', $video);
13
- $runtimeMinutes = tutor_utils()->avalue_dot('runtime.minutes', $video);
14
- $runtimeSeconds = tutor_utils()->avalue_dot('runtime.seconds', $video);
15
- $sourceVideoID = tutor_utils()->avalue_dot('source_video_id', $video);
16
- $poster = tutor_utils()->avalue_dot('poster', $video);
17
- $videoAttachment = $sourceVideoID ? tutor_utils()->get_attachment_data($sourceVideoID) : null;
18
-
19
- $video_sources = tutor_utils()->get_video_sources(false);
20
-
21
- $supported_sources = tutor_utils()->get_option('supported_video_sources', array());
22
- !is_array($supported_sources) ? $supported_sources = array($supported_sources) : 0;
23
- $GLOBALS['supported_sources'] = $supported_sources;
24
-
25
- if (!is_array($supported_sources) || !count($supported_sources)) {
26
- $notice = __('No video source selected from settings!', 'tutor');
27
- echo "<div class='tutor-alert tutor-warning'>
 
28
  <div class='tutor-alert-text'>
29
  <span class='tutor-alert-icon tutor-fs-4 tutor-icon-circle-info tutor-mr-12'></span>
30
  <span>{$notice}</span>
31
  </div>
32
  </div>";
33
- // _e('No video source selected from settings!', 'tutor');
34
- return;
35
  }
36
 
37
  /**
38
  * On course create
39
  * From video source list first item will be selected, When only one video source selected from settings
40
- *
41
  * @since 2.0.6
42
  */
43
- if( is_array( $supported_sources ) && 1 === count( $supported_sources ) && false === $video ) {
44
- $videoSource = $supported_sources[0];
45
  }
46
 
47
- function tutor_video_input_state($videoSource, $source){
48
- $value = ($videoSource == $source && in_array($source, $GLOBALS['supported_sources'])) ? 'block' : 'none';
49
- echo 'display:'.$value.';';
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
 
51
  ?>
52
 
53
  <div class="tutor-mb-32">
54
- <label class="tutor-form-label">
55
- <?php
56
- if ($post->post_type === tutor()->course_post_type) {
57
- _e('Course Intro Video', 'tutor');
58
- } else {
59
- _e('Video Source', 'tutor');
60
- }
61
- ?>
62
- </label>
63
-
64
- <div class="tutor-input-group tutor-mb-16 tutor-mt-12 tutor-d-block">
65
- <div class="tutor-video-upload-wrap">
66
- <div class="tutor-dropdown-icon-pack tutor-mt-4" data-video_source="<?php echo empty($videoSource) ? '' : $videoSource; ?>">
67
- <i class="tutor-icon-brand-html5-bold" data-for="html5"></i>
68
- <i class="tutor-icon-brand-youtube-line" data-for="youtube"></i>
69
- <i class="tutor-icon-brand-vimeo-line" data-for="vimeo"></i>
70
- <i class="tutor-icon-shortcode" data-for="shortcode"></i>
71
- <i class="tutor-icon-link" data-for="external_url"></i>
72
- <i class="tutor-icon-coding" data-for="embedded"></i>
73
- </div>
74
- <select name="video[source]" class="tutor-form-control tutor-select-icon-primary tutor_lesson_video_source no-tutor-dropdown">
75
- <option value="-1"><?php _e('Select Video Source', 'tutor'); ?></option>
76
- <?php
77
- foreach ( $video_sources as $value => $source ) {
78
- if ( in_array( $value, $supported_sources ) ) {
79
- $selected = selected( $value, $videoSource );
80
- echo sprintf('<option value="%s" %s data-icon="%s">%s</option>', $value, $selected, $source['icon'], $source['title'] );
81
- }
82
- }
83
- ?>
84
- </select>
85
-
86
- <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_html5 tutor-dashed-uploader <?php echo $sourceVideoID ? 'tutor-has-video' : ''; ?>" style="<?php tutor_video_input_state($videoSource, 'html5'); ?>">
87
- <div class="video-metabox-source-html5-upload">
88
- <p class="video-upload-icon"><i class="tutor-icon-upload-icon-line"></i></p>
89
- <p><strong><?php _e('Drag & Drop Your Video', 'tutor'); ?></strong></p>
90
- <p><?php _e('File Format: ', 'tutor'); ?> <span class="tutor-color-black">.mp4</span></p>
91
- <p class="tutor-color-black"><?php _e('or', 'tutor'); ?></p>
92
-
93
- <div class="video_source_upload_wrap_html5">
94
- <button class="video_upload_btn tutor-btn tutor-btn-secondary tutor-btn-md">
95
- <?php _e('Browse File', 'tutor'); ?>
96
- </button>
97
- <input type="hidden" class="input_source_video_id" name="video[source_video_id]" value="<?php echo $sourceVideoID; ?>">
98
- </div>
99
- </div>
100
-
101
- <div class="html5-video-data">
102
- <?php
103
- // Load Attachment card segment
104
- tutor_load_template_from_custom_path(tutor()->path . '/views/fragments/attachments.php', array(
105
- 'attachments' => array($videoAttachment ? $videoAttachment : (object)array('id' => 0, 'url' => '', 'title' => '', 'size' => '')),
106
- 'size_below' => true,
107
- 'no_control' => true
108
- ), false);
109
-
110
- echo '<div class="tutor-fs-6 tutor-fw-medium tutor-color-secondary tutor-mb-12" >' . __('Upload Video Poster', 'tutor') . '</div>';
111
- // Load thumbnail segment
112
- tutor_load_template_from_custom_path(tutor()->path . '/views/fragments/thumbnail-uploader.php', array(
113
- 'media_id' => tutor_utils()->avalue_dot('poster', $video),
114
- 'input_name' => 'video[poster]'
115
- ), false);
116
- ?>
117
- </div>
118
- </div>
119
-
120
- <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_external_url tutor-dashed-uploader" style="<?php tutor_video_input_state($videoSource, 'external_url'); ?>">
121
- <input class="tutor-form-control" type="text" name="video[source_external_url]" value="<?php echo tutor_utils()->avalue_dot('source_external_url', $video); ?>" placeholder="<?php _e('Paste External Video URL', 'tutor'); ?>">
122
- </div>
123
-
124
- <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_shortcode tutor-dashed-uploader" style="<?php tutor_video_input_state($videoSource, 'shortcode'); ?>">
125
- <input class="tutor-form-control" type="text" name="video[source_shortcode]" value="<?php echo tutor_utils()->avalue_dot('source_shortcode', $video); ?>" placeholder="<?php _e('Paste Shortcode', 'tutor'); ?>">
126
- </div>
127
-
128
- <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_youtube tutor-dashed-uploader" style="<?php tutor_video_input_state($videoSource, 'youtube'); ?>">
129
- <input class="tutor-form-control" type="text" name="video[source_youtube]" value="<?php echo tutor_utils()->avalue_dot('source_youtube', $video); ?>" placeholder="<?php _e('Paste YouTube Video URL', 'tutor'); ?>" data-youtube_api_key="<?php echo tutor_utils()->get_option('lesson_video_duration_youtube_api_key', ''); ?>">
130
- </div>
131
-
132
- <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_vimeo tutor-dashed-uploader" style="<?php tutor_video_input_state($videoSource, 'vimeo'); ?>">
133
- <input class="tutor-form-control" type="text" name="video[source_vimeo]" value="<?php echo tutor_utils()->avalue_dot('source_vimeo', $video); ?>" placeholder="<?php _e('Paste Vimeo Video URL', 'tutor'); ?>">
134
- </div>
135
-
136
- <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_embedded tutor-dashed-uploader" style="<?php tutor_video_input_state($videoSource, 'embedded'); ?>">
137
- <textarea class="tutor-form-control" name="video[source_embedded]" placeholder="<?php _e('Place your embedded code here', 'tutor'); ?>"><?php echo tutor_utils()->avalue_dot('source_embedded', $video); ?></textarea>
138
- </div>
139
- <?php do_action( 'tutor_after_video_meta_box_item', $post ); ?>
140
- </div>
141
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  </div>
143
 
144
  <!-- For Lesson -->
145
- <?php if ($post->post_type !== tutor()->course_post_type) : ?>
146
- <div class="tutor-mb-20">
147
- <label class="tutor-form-label"><?php _e('Video playback time', 'tutor'); ?></label>
148
- <div class="tutor-input-group tutor-option-field-video-duration">
149
- <div class="tutor-row">
150
- <div class="tutor-col-4">
151
- <input class="tutor-form-control" type="number" value="<?php echo $runtimeHours ? $runtimeHours : '00'; ?>" name="video[runtime][hours]" min="0">
152
- <span><?php _e('Hour', 'tutor'); ?></span>
153
- </div>
154
- <div class="tutor-col-4">
155
- <input class="tutor-form-control" type="number" class="tutor-number-validation" data-min="0" data-max="59" value="<?php echo $runtimeMinutes ? $runtimeMinutes : '00'; ?>" name="video[runtime][minutes]" min="0">
156
- <span><?php _e('Minute', 'tutor'); ?></span>
157
- </div>
158
- <div class="tutor-col-4">
159
- <input class="tutor-form-control" type="number" class="tutor-number-validation" data-min="0" data-max="59" value="<?php echo $runtimeSeconds ? $runtimeSeconds : '00'; ?>" name="video[runtime][seconds]" min="0">
160
- <span><?php _e('Second', 'tutor'); ?></span>
161
- </div>
162
- </div>
163
- </div>
164
- </div>
165
  <?php endif; ?>
4
  * Don't change it, it's supporting modal in other place
5
  * if get_the_ID() empty, then it's means we are passing $post variable from another place
6
  */
7
+ if ( get_the_ID() ) {
8
+ global $post;
9
+ }
10
+
11
+ $video = maybe_unserialize( get_post_meta( $post->ID, '_video', true ) );
12
+ $videoSource = tutor_utils()->avalue_dot( 'source', $video, 'html5' );
13
+ $runtimeHours = tutor_utils()->avalue_dot( 'runtime.hours', $video );
14
+ $runtimeMinutes = tutor_utils()->avalue_dot( 'runtime.minutes', $video );
15
+ $runtimeSeconds = tutor_utils()->avalue_dot( 'runtime.seconds', $video );
16
+ $sourceVideoID = tutor_utils()->avalue_dot( 'source_video_id', $video );
17
+ $poster = tutor_utils()->avalue_dot( 'poster', $video );
18
+ $videoAttachment = $sourceVideoID ? tutor_utils()->get_attachment_data( $sourceVideoID ) : null;
19
+
20
+ $video_sources = tutor_utils()->get_video_sources( false );
21
+
22
+ $supported_sources = tutor_utils()->get_option( 'supported_video_sources', array() );
23
+ ! is_array( $supported_sources ) ? $supported_sources = array( $supported_sources ) : 0;
24
+ $GLOBALS['supported_sources'] = $supported_sources;
25
+
26
+ if ( ! is_array( $supported_sources ) || ! count( $supported_sources ) ) {
27
+ $notice = __( 'No video source selected from settings!', 'tutor' );
28
+ echo "<div class='tutor-alert tutor-warning'>
29
  <div class='tutor-alert-text'>
30
  <span class='tutor-alert-icon tutor-fs-4 tutor-icon-circle-info tutor-mr-12'></span>
31
  <span>{$notice}</span>
32
  </div>
33
  </div>";
34
+ // _e('No video source selected from settings!', 'tutor');
35
+ return;
36
  }
37
 
38
  /**
39
  * On course create
40
  * From video source list first item will be selected, When only one video source selected from settings
41
+ *
42
  * @since 2.0.6
43
  */
44
+ if ( is_array( $supported_sources ) && 1 === count( $supported_sources ) && false === $video ) {
45
+ $videoSource = $supported_sources[0];
46
  }
47
 
48
+ /**
49
+ * Should meta box visible or not
50
+ *
51
+ * @param array $videoSource video source.
52
+ * @param array $source source.
53
+ * @param boolean $echo should echo.
54
+ * @return string
55
+ */
56
+ function tutor_video_input_state( $videoSource, $source, $echo = true ) {
57
+ $value = ( $videoSource == $source && in_array( $source, $GLOBALS['supported_sources'] ) ) ? 'block' : 'none';
58
+ if ( $echo ) {
59
+ echo esc_attr( 'display: ' . $value );
60
+ } else {
61
+ return "display: {$value};";
62
+ }
63
  }
64
+
65
  ?>
66
 
67
  <div class="tutor-mb-32">
68
+ <label class="tutor-form-label">
69
+ <?php
70
+ if ( $post->post_type === tutor()->course_post_type ) {
71
+ _e( 'Course Intro Video', 'tutor' );
72
+ } else {
73
+ _e( 'Video Source', 'tutor' );
74
+ }
75
+ ?>
76
+ </label>
77
+
78
+ <div class="tutor-input-group tutor-mb-16 tutor-mt-12 tutor-d-block">
79
+ <div class="tutor-video-upload-wrap">
80
+ <div class="tutor-dropdown-icon-pack tutor-mt-4" data-video_source="<?php echo empty( $videoSource ) ? '' : $videoSource; ?>">
81
+ <i class="tutor-icon-brand-html5-bold" data-for="html5"></i>
82
+ <i class="tutor-icon-brand-youtube-line" data-for="youtube"></i>
83
+ <i class="tutor-icon-brand-vimeo-line" data-for="vimeo"></i>
84
+ <i class="tutor-icon-shortcode" data-for="shortcode"></i>
85
+ <i class="tutor-icon-link" data-for="external_url"></i>
86
+ <i class="tutor-icon-coding" data-for="embedded"></i>
87
+ <?php
88
+ /**
89
+ * Hook added to add external video source icon
90
+ *
91
+ * @since v2.1.2
92
+ */
93
+ do_action( 'tutor_after_video_source_icon' );
94
+ ?>
95
+ </div>
96
+ <select name="video[source]" class="tutor-form-control tutor-select-icon-primary tutor_lesson_video_source no-tutor-dropdown">
97
+ <option value="-1"><?php _e( 'Select Video Source', 'tutor' ); ?></option>
98
+ <?php
99
+ foreach ( $video_sources as $value => $source ) {
100
+ if ( in_array( $value, $supported_sources ) ) {
101
+ $selected = selected( $value, $videoSource );
102
+ echo sprintf( '<option value="%s" %s data-icon="%s">%s</option>', $value, $selected, $source['icon'], $source['title'] );
103
+ }
104
+ }
105
+ ?>
106
+ </select>
107
+
108
+ <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_html5 tutor-dashed-uploader <?php echo $sourceVideoID ? 'tutor-has-video' : ''; ?>" style="<?php tutor_video_input_state( $videoSource, 'html5' ); ?>">
109
+ <div class="video-metabox-source-html5-upload">
110
+ <p class="video-upload-icon"><i class="tutor-icon-upload-icon-line"></i></p>
111
+ <p><strong><?php _e( 'Drag & Drop Your Video', 'tutor' ); ?></strong></p>
112
+ <p><?php _e( 'File Format: ', 'tutor' ); ?> <span class="tutor-color-black">.mp4</span></p>
113
+ <p class="tutor-color-black"><?php _e( 'or', 'tutor' ); ?></p>
114
+
115
+ <div class="video_source_upload_wrap_html5">
116
+ <button class="video_upload_btn tutor-btn tutor-btn-secondary tutor-btn-md">
117
+ <?php _e( 'Browse File', 'tutor' ); ?>
118
+ </button>
119
+ <input type="hidden" class="input_source_video_id" name="video[source_video_id]" value="<?php echo $sourceVideoID; ?>">
120
+ </div>
121
+ </div>
122
+
123
+ <div class="html5-video-data">
124
+ <?php
125
+ // Load Attachment card segment
126
+ tutor_load_template_from_custom_path(
127
+ tutor()->path . '/views/fragments/attachments.php',
128
+ array(
129
+ 'attachments' => array(
130
+ $videoAttachment ? $videoAttachment : (object) array(
131
+ 'id' => 0,
132
+ 'url' => '',
133
+ 'title' => '',
134
+ 'size' => '',
135
+ ),
136
+ ),
137
+ 'size_below' => true,
138
+ 'no_control' => true,
139
+ ),
140
+ false
141
+ );
142
+
143
+ echo '<div class="tutor-fs-6 tutor-fw-medium tutor-color-secondary tutor-mb-12" >' . __( 'Upload Video Poster', 'tutor' ) . '</div>';
144
+ // Load thumbnail segment
145
+ tutor_load_template_from_custom_path(
146
+ tutor()->path . '/views/fragments/thumbnail-uploader.php',
147
+ array(
148
+ 'media_id' => tutor_utils()->avalue_dot( 'poster', $video ),
149
+ 'input_name' => 'video[poster]',
150
+ ),
151
+ false
152
+ );
153
+ ?>
154
+ </div>
155
+ </div>
156
+
157
+ <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_external_url tutor-dashed-uploader" style="<?php tutor_video_input_state( $videoSource, 'external_url' ); ?>">
158
+ <input class="tutor-form-control" type="text" name="video[source_external_url]" value="<?php echo tutor_utils()->avalue_dot( 'source_external_url', $video ); ?>" placeholder="<?php _e( 'Paste External Video URL', 'tutor' ); ?>">
159
+ </div>
160
+
161
+ <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_shortcode tutor-dashed-uploader" style="<?php tutor_video_input_state( $videoSource, 'shortcode' ); ?>">
162
+ <input class="tutor-form-control" type="text" name="video[source_shortcode]" value="<?php echo tutor_utils()->avalue_dot( 'source_shortcode', $video ); ?>" placeholder="<?php _e( 'Paste Shortcode', 'tutor' ); ?>">
163
+ </div>
164
+
165
+ <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_youtube tutor-dashed-uploader" style="<?php tutor_video_input_state( $videoSource, 'youtube' ); ?>">
166
+ <input class="tutor-form-control" type="text" name="video[source_youtube]" value="<?php echo tutor_utils()->avalue_dot( 'source_youtube', $video ); ?>" placeholder="<?php _e( 'Paste YouTube Video URL', 'tutor' ); ?>" data-youtube_api_key="<?php echo tutor_utils()->get_option( 'lesson_video_duration_youtube_api_key', '' ); ?>">
167
+ </div>
168
+
169
+ <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_vimeo tutor-dashed-uploader" style="<?php tutor_video_input_state( $videoSource, 'vimeo' ); ?>">
170
+ <input class="tutor-form-control" type="text" name="video[source_vimeo]" value="<?php echo tutor_utils()->avalue_dot( 'source_vimeo', $video ); ?>" placeholder="<?php _e( 'Paste Vimeo Video URL', 'tutor' ); ?>">
171
+ </div>
172
+
173
+ <div class="tutor-mt-16 video-metabox-source-item video_source_wrap_embedded tutor-dashed-uploader" style="<?php tutor_video_input_state( $videoSource, 'embedded' ); ?>">
174
+ <textarea class="tutor-form-control" name="video[source_embedded]" placeholder="<?php _e( 'Place your embedded code here', 'tutor' ); ?>"><?php echo tutor_utils()->avalue_dot( 'source_embedded', $video ); ?></textarea>
175
+ </div>
176
+ <?php do_action( 'tutor_after_video_meta_box_item', tutor_video_input_state( $videoSource, 'bunnynet', false ), $post ); ?>
177
+ </div>
178
+ </div>
179
  </div>
180
 
181
  <!-- For Lesson -->
182
+ <?php if ( $post->post_type !== tutor()->course_post_type ) : ?>
183
+ <div class="tutor-mb-20">
184
+ <label class="tutor-form-label"><?php _e( 'Video playback time', 'tutor' ); ?></label>
185
+ <div class="tutor-input-group tutor-option-field-video-duration">
186
+ <div class="tutor-row">
187
+ <div class="tutor-col-4">
188
+ <input class="tutor-form-control" type="number" value="<?php echo $runtimeHours ? $runtimeHours : '00'; ?>" name="video[runtime][hours]" min="0">
189
+ <span><?php _e( 'Hour', 'tutor' ); ?></span>
190
+ </div>
191
+ <div class="tutor-col-4">
192
+ <input class="tutor-form-control" type="number" class="tutor-number-validation" data-min="0" data-max="59" value="<?php echo $runtimeMinutes ? $runtimeMinutes : '00'; ?>" name="video[runtime][minutes]" min="0">
193
+ <span><?php _e( 'Minute', 'tutor' ); ?></span>
194
+ </div>
195
+ <div class="tutor-col-4">
196
+ <input class="tutor-form-control" type="number" class="tutor-number-validation" data-min="0" data-max="59" value="<?php echo $runtimeSeconds ? $runtimeSeconds : '00'; ?>" name="video[runtime][seconds]" min="0">
197
+ <span><?php _e( 'Second', 'tutor' ); ?></span>
198
+ </div>
199
+ </div>
200
+ </div>
201
+ </div>
202
  <?php endif; ?>
views/quiz/attempt-table.php CHANGED
@@ -43,6 +43,7 @@ if ( $context == 'course-single-previous-attempts' && is_array( $attempt_list )
43
  <tbody>
44
  <?php foreach ( $attempt_list as $attempt ) : ?>
45
  <?php
 
46
  $earned_percentage = $attempt->earned_marks > 0 ? ( number_format( ( $attempt->earned_marks * 100 ) / $attempt->total_marks ) ) : 0;
47
  $answers = isset( $answers_array[ $attempt->attempt_id ] ) ? $answers_array[ $attempt->attempt_id ] : array();
48
  $attempt_info = @unserialize( $attempt->attempt_info );
@@ -163,7 +164,7 @@ if ( $context == 'course-single-previous-attempts' && is_array( $attempt_list )
163
  }
164
  ?>
165
  </a>
166
- <?php if ( ! is_admin() && current_user_can( tutor()->instructor_role ) ) : ?>
167
  <a href="#" class="tutor-quiz-attempt-delete tutor-iconic-btn tutor-flex-shrink-0 tutor-ml-4" data-quiz-id="<?php echo esc_attr( $attempt_id ); ?>" data-tutor-modal-target="tutor-common-confirmation-modal">
168
  <i class="tutor-icon-trash-can-line" data-quiz-id="<?php echo esc_attr( $attempt_id ); ?>"></i>
169
  </a>
43
  <tbody>
44
  <?php foreach ( $attempt_list as $attempt ) : ?>
45
  <?php
46
+ $course_id = is_object( $attempt ) && property_exists( $attempt, 'course_id' ) ? $attempt->course_id : 0;
47
  $earned_percentage = $attempt->earned_marks > 0 ? ( number_format( ( $attempt->earned_marks * 100 ) / $attempt->total_marks ) ) : 0;
48
  $answers = isset( $answers_array[ $attempt->attempt_id ] ) ? $answers_array[ $attempt->attempt_id ] : array();
49
  $attempt_info = @unserialize( $attempt->attempt_info );
164
  }
165
  ?>
166
  </a>
167
+ <?php if ( ! is_admin() && $course_id && ( tutor_utils()->is_instructor_of_this_course( get_current_user_id(), $course_id ) || current_user_can( 'administrator' ) ) ) : ?>
168
  <a href="#" class="tutor-quiz-attempt-delete tutor-iconic-btn tutor-flex-shrink-0 tutor-ml-4" data-quiz-id="<?php echo esc_attr( $attempt_id ); ?>" data-tutor-modal-target="tutor-common-confirmation-modal">
169
  <i class="tutor-icon-trash-can-line" data-quiz-id="<?php echo esc_attr( $attempt_id ); ?>"></i>
170
  </a>