(()=>{function n(t){return(n="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})(t)}window.jQuery(document).ready(function(a){function r(t,o){t.prop("disabled",!o),o?t.removeClass("is-loading"):t.addClass("is-loading")}a("#tutor-gc-student-password-set button").click(function(){var t=a(this),o=t.parent().parent(),e=o.find('[name="password-1"]').val(),n=o.find('[name="password-2"]').val(),o=o.find('[name="token"]').val();e&&n&&e===n?(r(t,!1),a.ajax({url:window._tutorobject.ajaxurl,data:{action:"tutor_gc_student_set_password",token:o,password:e},type:"POST",success:function(t){window.location.replace(window._tutorobject.tutor_frontend_dashboard_url)},error:function(){r(t,!0),alert("Request Failed.")}})):alert("Invalid Password")}),a("[tutor-gc-stream-loader]").click(function(t){t.preventDefault();var o=a(this),t=o.data("next_token"),e=o.data("course_id");a.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{next_token:t,action:"tutor_gc_load_more_stream",course_id:e},beforeSend:function(){o.addClass("is-loading")},success:function(t){try{t=JSON.parse(t)}catch(t){}o.removeClass("is-loading"),"object"!=n(t)||t.html&&0!=/\S+/.test(t.html)&&(o.data("next_token",t.next_token),a("[tutor-gc-streams]").append(t.html),t.next_token)||o.remove()},error:function(){o.removeClass("is-loading")}})})})})();