(()=>{var t={83282:function(){/**
 * Color PRESET and PICKER manipulation
 */(()=>{var t=document.querySelectorAll("label.color-preset-input input[type='radio']");var e=document.querySelectorAll("label.color-picker-input input[type='color']");var r=document.querySelectorAll("label.color-picker-input input[type='text']");var o=document.querySelectorAll(".color-picker-wrapper [data-key]");// Color PRESET selection (color inputs)
if(t){t.forEach(t=>{var e=t.parentElement.querySelector(".preset-item");var r=e.querySelectorAll(".header span");var a=t.closest(".color-preset-input");var n=a.parentElement.querySelectorAll("label.color-preset-input");// listening preset input events
if(t.checked){a.classList.add("is-checked")}t.addEventListener("input",t=>{n.forEach(t=>t.classList.remove("is-checked"));a.classList.add("is-checked");r.forEach(t=>{var e=t.dataset.preset;var r=t.dataset.color;o.forEach(t=>{var o=t.dataset.key;if(o==e){t.querySelectorAll("input").forEach(t=>t.value=r);t.style.borderColor=r;t.style.boxShadow="inset 0 0 0 1px ".concat(r);setTimeout(()=>{t.style.borderColor="#cdcfd5";t.style.boxShadow="none"},5e3)}})})})})}// Updating Custom Color PRESET
var a=t=>{var r=document.querySelector("label.color-preset-input[for='tutor_preset_custom']");// listening picker input events
t.addEventListener("input",function(o){var a=r&&r.querySelectorAll(".header span");var n=r&&r.querySelector('input[type="radio"]');var i=t.nextElementSibling;i.value=t.value;if(a){e.forEach(t=>{var e=t.dataset.picker;a.forEach(r=>{if(r.dataset.preset==e){r.dataset.color=t.value;r.style.backgroundColor=t.value}});n.checked=true})}})};// listening color pickers input event
if(e){e.forEach(t=>{a(t)})}if(r){r.forEach(t=>{t.addEventListener("input",function(e){if(e.target.value.length===7){t.previousElementSibling.value=e.target.value;t.previousElementSibling.dispatchEvent(new Event("input",{bubbles:true}))}})})}})()},82111:function(){(function(){"use strict";h()})();/**
 * Toggle disable input fields
 * Selecetor -> .tutor-option-single-item.monetization-fees
 */var t=document.querySelector(".monetization-fees");var e=document.querySelector(".monetization-fees input[name=deduct-fees]");if(t&&e){window.addEventListener("load",()=>r(e,t));e.addEventListener("change",()=>r(e,t))}var r=(e,r)=>{if(e.checked){r.classList.remove("is-disable");o(t,false)}else{r.classList.add("is-disable");o(t,true)}};var o=(t,e)=>{var r=t.querySelectorAll(".tutor-option-field-row:nth-child(2) textarea, .tutor-option-field-row:nth-child(3) select, .tutor-option-field-row:nth-child(3) input");r.forEach(t=>t.disabled=e)};/**
 * Image Preview : Logo and Signature Upload
 * Selector -> .tutor-option-field-input.image-previewer
 */var a=document.querySelectorAll(".image-previewer");var n=document.querySelectorAll(".image-previewer img");var i=document.querySelectorAll(".image-previewer input[type=file]");var s=document.querySelectorAll(".image-previewer .delete-btn");if(i&&s){// Checking Img Src when document loads
document.addEventListener("DOMContentLoaded",()=>{a.forEach(t=>{n.forEach(e=>{if(e.getAttribute("src")){e.closest(".image-previewer").classList.add("is-selected")}else{t.classList.remove("is-selected")}})})});// Updating Image Preview
i.forEach(t=>{t.addEventListener("change",function(e){var r=this.files[0];var o=t.closest(".image-previewer");var a=o.querySelector("img");var n=o.querySelector(".preview-loading");if(r){n.classList.add("is-loading");c(r,a);o.classList.add("is-selected");setTimeout(()=>{n.classList.remove("is-loading")},200)}})});// Deleting Image Preview
s.forEach(t=>{t.addEventListener("click",function(t){var e=this.closest(".image-previewer");var r=e.querySelector("img");r.setAttribute("src","");e.classList.remove("is-selected")})})}// Get Image file as Data URL
var c=(t,e)=>{var r=new FileReader;r.onload=function t(){e.setAttribute("src",this.result)};r.readAsDataURL(t)};/**
 * Sharing Percentage : Monitization > Option
 */var l=document.querySelector("input[type=number]#revenue-instructor");var u=document.querySelector("input[type=number]#revenue-admin");var d=document.querySelectorAll(".revenue-percentage input[type=number]");var v=document.getElementById("save_tutor_option");var p=t=>{setTimeout(()=>{if(v)v.disabled=true},t)};if(l&&u&&d){l.addEventListener("input",t=>{var{__,_x:e,_n:r,_nx:o}=wp.i18n;if(t.target.value<=100){u.value=100-t.target.value}else{u.value=0;tutor_toast(__("Error","tutor"),__("Amount must be less than 100","tutor"),"error");p(50)}});u.addEventListener("input",t=>{var{__,_x:e,_n:r,_nx:o}=wp.i18n;if(t.target.value<=100){l.value=100-t.target.value}else{l.value=0;tutor_toast(__("Error","tutor"),__("Amount must be less than 100","tutor"),"error");p(50)}})}/**
 * Copy to clipboard : Email > Server Cron
 */var m=document.querySelector(".input-field-code textarea");var f=document.querySelector(".code-copy-btn");if(f&&m){f.addEventListener("click",function(t){t.preventDefault();this.focus();m.select();document.execCommand("copy");var e=this.innerHTML;setTimeout(()=>{this.innerHTML=e},3e3);// @todo: remove las icon
this.innerHTML='\n			<span class="tutor-btn-icon las la-clipboard-list"></span>\n			<span>Copied to Clipboard!</span>\n		'})}/**
 * Drag and Drop files -> Import/Export > .import-setting
 */var _=document.querySelectorAll(".drag-drop-zone input[type=file]");_.forEach(t=>{var e=t.closest(".drag-drop-zone");["dragover","dragleave","dragend"].forEach(t=>{if(t==="dragover"){e.addEventListener(t,t=>{t.preventDefault();e.classList.add("dragover")})}else{e.addEventListener(t,t=>{e.classList.remove("dragover")})}});e.addEventListener("drop",r=>{r.preventDefault();var o=r.dataTransfer.files;g(o,t,e);e.classList.remove("dragover")});t.addEventListener("change",r=>{var o=r.target.files;g(o,t,e)})});var g=(t,e,r)=>{if(t.length){e.files=t;r.classList.add("file-attached");r.querySelector(".file-info").innerHTML="File attached - ".concat(t[0].name)}else{r.classList.remove("file-attached");r.querySelector(".file-info").innerHTML=""}};/**
 * Tooltip direction change on smaller devices -> .tooltip-right
 */function h(){var t=window.matchMedia("(max-width: 992px)");var e=document.querySelectorAll(".tooltip-responsive");if(e.length){if(t.matches){var r=document.querySelectorAll(".tooltip-right");r.forEach(t=>{t.classList.replace("tooltip-right","tooltip-left")})}else{var o=document.querySelectorAll(".tooltip-left");o.forEach(t=>{t.classList.replace("tooltip-left","tooltip-right")})}}}window.addEventListener("resize",h)},37392:function(){// this function will load after document content load
window.readyState_complete=t=>{var e=t=>t();document.addEventListener("readystatechange",r=>r.target.readyState==="complete"?typeof t=="function"?setTimeout(()=>e(t)):"":"")};window.addBodyClass=t=>{// History push
var e=new URL(t);var r=e.searchParams.get("tab_page");var o=e.searchParams.get("edit")&&"_edit";document.body.classList.add(r);document.body.classList.add(r+o)};window.selectorById=t=>{return document.getElementById(t)};window.selectorByClass=t=>{return document.getElementsByClassName(t)};/**
 * Function to download json file
 * @param {json} response
 * @param {string} fileName
 */window.json_download=(t,e)=>{var r=new Blob([t],{type:"application/json"});var o=document.createElement("a");o.href=URL.createObjectURL(r);o.download=e;o.click()}},55227:function(){var t=t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).toLowerCase())};var e=document.querySelectorAll(".multiple_email_input");e.forEach(e=>{var r=e.value.split(",");var o="";r.forEach(t=>{// console.log(arrItem.trim());
o+='<span class="item_email">'+t.trim()+'<span class="delete tutor-icon-line-cross-line"></span></span>'});e.insertAdjacentHTML("beforebegin",'<div class="receipient_input">'+o+'<input type="email" placeholder="add receipient..."></div>');// inputReceipient.onchange
var a=e.previousElementSibling.querySelector("input[type=email]");setTimeout(()=>{console.log(e.previousElementSibling.querySelectorAll(".item_email"));e.previousElementSibling.querySelectorAll(".item_email").forEach(t=>{t.querySelector(".delete").onclick=()=>{console.log(t);t.remove()};t.addEventListener("dblclick",function(e){a.value=t.innerText;t.remove();a.focus()})});a.addEventListener("keyup",function(t){});a.addEventListener("keydown",function(r){var o=r.key;// const {key} = event; ES6+
a.classList.remove("invalid");if(r.keyCode===32){tutor_toast("Invalid","Space is not allowed!","warning");r.preventDefault()}if(o==="Backspace"){if(""===a.value){a.previousElementSibling.remove()}}if(o==="Enter"||o==="Tab"||r.keyCode===188){if(false===t(a.value)){tutor_toast("Invalid","Invalid email","warning");r.preventDefault();a.focus();a.classList.add("invalid");return false}else{// console.log(inputReceipient.value);
e.value+=","+a.value;console.log(a.value);a.insertAdjacentHTML("beforebegin",'<span class="item_email">'+a.value+'<span class="delete tutor-icon-line-cross-line"></span></span>');a.style.borderColor="transparent";a.value="";tutor_toast("Success","Valid email","success");r.preventDefault();a.focus();return false}}})},10)})},18569:function(){/**
 * Navigation tab
 */var t=document.querySelectorAll("[tutor-option-tabs]");var e=document.querySelectorAll("[tutor-option-tabs] li > a");var r=document.querySelectorAll(".tutor-option-nav-page");function o(){if(document.getElementById("save_tutor_option")){document.getElementById("save_tutor_option").disabled=false}}readyState_complete(()=>{var o=document.querySelector("[tutor-option-tabs] li > a.is-active");if(null!==o){document.title=o.querySelector("[tutor-option-label]").innerText+" < "+_tutorobject.site_title}t.forEach(t=>{t.addEventListener("click",t=>{var o=t.target.parentElement.dataset.tab||t.target.dataset.tab;var a=t.target.parentElement.dataset.page||t.target.dataset.page;if(o){// Set page title on changing nav tabs
document.title=t.target.innerText+" < "+_tutorobject.site_title;// remove active from other buttons
e.forEach(e=>{e.classList.remove("is-active");document.body.classList.remove(e.dataset.tab);if(t.target.dataset.tab){document.body.classList.add(t.target.dataset.tab);t.target.classList.add("is-active")}else{t.target.parentElement.classList.add("is-active")}});// hide other tab contents
r.forEach(t=>{t.classList.remove("is-active")});// add active to the current content
var n=document.querySelector("#".concat(o));n.classList.add("is-active");// History push
var i=new URL(window.location);var s=new URLSearchParams({page:a,tab_page:o});var c="".concat(i.origin+i.pathname,"?").concat(s.toString());window.history.pushState({},"",c);addBodyClass(window.location);var l=document.getElementById(o).querySelector(".loading-spinner");if(l){document.getElementById(o).querySelector(".loading-spinner").remove()}// Update certificate pagination on tab change
if(o==="tutor_certificate"){var u=document.querySelectorAll("#tutor-settings-tab-certificate_list .tutor-pagination a");u.forEach(t=>{var e=new URL(t.href);e.searchParams.set("tab_page",o);// Update the 'tab_page' parameter
t.href=e.toString()})}}})})});addBodyClass(window.location)},4064:function(){/**
 * Reset to default for settings individual page
 */readyState_complete(()=>{typeof r==="function"?r():"";typeof e==="function"?e():""});var t=document.getElementById("tutor-modal-bulk-action");var e=()=>{var e=document.querySelectorAll(".modal-reset-open");var r=t&&t.querySelector(".reset_to_default");var o=t&&t.querySelector("[data-modal-dynamic-title]");var a=t&&t.querySelector("[data-modal-dynamic-content]");e.forEach((t,e)=>{t.disabled=false;t.onclick=e=>{r.dataset.reset=t.dataset.reset;o.innerText=t.dataset.heading;r.dataset.resetFor=t.previousElementSibling.innerText;a.innerText=t.dataset.message}})};var r=()=>{var{__,sprintf:e}=wp.i18n;var r=document.querySelectorAll(".reset_to_default");r.forEach((r,a)=>{r.onclick=a=>{if(!a.detail||a.detail==1){a.preventDefault();r.classList.add("is-loading");var n=r.dataset.reset;var i=r.dataset.resetFor.replace("_"," ").toUpperCase();var s=new FormData;s.append("action","reset_settings_data");s.append("reset_page",n);s.append(_tutorobject.nonce_key,_tutorobject._tutor_nonce);var c=new XMLHttpRequest;c.open("POST",_tutorobject.ajaxurl,true);c.send(s);c.onreadystatechange=function(){if(c.readyState===4){var a=JSON.parse(c.response).data;a.forEach(t=>{var e=["color_preset","upload_full","checkbox_notification","checkgroup","group_radio_full_3","group_radio","radio_vertical","checkbox_horizontal","radio_horizontal","radio_horizontal_full","checkbox_vertical","toggle_switch","toggle_switch_button","text","textarea","email","hidden","select","number"];if(e.includes(t.type)){var r="tutor_option["+t.key+"]";var a=o(r)[0];if(t.type=="select"){var n=a.options;[...n].forEach(e=>{e.selected=typeof t.default==="number"?e.value===t.default:t.default.includes(e.value)})}else if(t.type=="color_preset"){var i=o(r);i.forEach(e=>{var r=e.parentElement.classList;t.default.includes(e.value)?r.add("is-checked"):r.remove("is-checked");e.checked=t.default.includes(e.value)?true:false});t.fields.forEach(e=>{if(e.key===t.default){e.colors.forEach(t=>{var e="tutor_option["+t.slug+"]";var r=o(e)[0];var a=r.parentElement;r.value=t.value;r.nextElementSibling.innerText=t.value;a.style.borderColor=t.value;a.style.boxShadow="inset 0 0 0 1px ".concat(t.value);setTimeout(()=>{a.style.borderColor="#cdcfd5";a.style.boxShadow="none"},5e3)})}})}else if(t.type=="checkbox_horizontal"||t.type=="checkbox_vertical"||t.type=="radio_horizontal"||t.type=="radio_horizontal_full"||t.type=="radio_vertical"||t.type=="group_radio"||t.type=="group_radio_full_3"){if(t.type=="checkbox_horizontal"){Object.keys(t.options).forEach(e=>{r="tutor_option["+t.key+"]["+e+"]";checkElements=o("".concat(r));[...checkElements].forEach(e=>{e.checked=t.default.includes(e.value)?true:false})})}else{var s=o("".concat(r));[...s].forEach(e=>{e.checked=t.default.includes(e.value)?true:false})}}else if(t.type=="upload_full"){a.value="";a.nextElementSibling.src="";a.parentNode.querySelector(".delete-btn").style.display="none"}else if(t.type=="checkbox_notification"){Object.keys(t.options).forEach(t=>{r="tutor_option"+t;checkElements=o("".concat(r));[...checkElements].forEach(t=>{t.checked=false})})}else if(t.type=="checkgroup"){Object.values(t.group_options).forEach(t=>{r="tutor_option["+t.key+"]";checkElements=o("".concat(r));[...checkElements].forEach(e=>{e.value="on"===t.default?"on":"off";e.nextElementSibling.checked="on"===t.default?true:false})})}else if(t.type=="toggle_switch_button"){r="tutor_option["+t.key+"]["+t.event+"]";checkElements=o("".concat(r));[...checkElements].forEach(e=>{e.nextElementSibling.checked="on"===t.default?true:false})}else if(t.type=="toggle_switch"){a.value=a.nextElementSibling.value=t.default;a.nextElementSibling.checked=false}else{a.value=t.default}}var c=["group_fields"];if(c.includes(t.type)){var l=t.key;var u=t.group_fields;if(typeof u==="object"&&u!==null){Object.keys(u).forEach((t,e)=>{var r=u[t];var a=["toggle_switch","text","textarea","email","hidden","select","number"];if(a.includes(r.type)){var n="tutor_option[".concat(l,"][").concat(t,"]");// console.log(itemName);
var i=o(n)[0];if(r.type=="select"){var s=i.options;[...s].forEach(t=>{t.selected=r.default===t.value?true:false})}else if(r.type=="toggle_switch"){i.value=r.default;i.nextElementSibling.value=r.default;i.nextElementSibling.checked=false}else{// console.log(itemChild);
i.value=r.default}}})}}});setTimeout(()=>{r.classList.remove("is-loading");tutor_toast(__("Reset Successful","tutor"),e(__("All modified settings of %s have been changed to default.","tutor"),i),"success");t.classList.remove("tutor-is-active");document.body.classList.remove("tutor-modal-open");if(document.getElementById("save_tutor_option")){document.getElementById("save_tutor_option").disabled=false}},300)}}}}})};var o=t=>{return document.getElementsByName(t)};/**
 * Enable save button if any input changes
 */var a=document.querySelector("#tutor-option-form");if(null!==a){a.addEventListener("input",t=>{if(document.getElementById("save_tutor_option")){document.getElementById("save_tutor_option").disabled=false}})}},38482:function(){/**
 * WP Gutenberg Events Subscriber
 *
 * @since 2.1.7
 * @package Tutor\AdminScripts
 */document.addEventListener("DOMContentLoaded",function(){wp.data.subscribe(function(){// Handle course move to trash event
var t=_tutorobject.course_list_page_url;var e=_tutorobject.course_post_type;if(wp.data&&wp.data.select("core/editor")){var r=wp.data.select("core/editor").getEditedPostAttribute("type");if(r===e){var o=wp.data.select("core/editor").getEditedPostAttribute("status");if(o==="trash"){// Redirect to course list page
window.location.href=t}}}})})},99210:function(){window.selectSearchField=t=>{var e=document.querySelectorAll(t);(()=>{e.forEach(t=>{if(t&&!t.classList.contains("tutor-js-form-select")&&!t.hasAttribute("noDropdown")&&!t.classList.contains("no-tutor-dropdown")){var e=t.hasAttribute("data-searchable");var a=t.options[t.selectedIndex];t.style.display="none";var n,i,s,c,l,u,d,v;t.insertAdjacentHTML("afterend",o(t.options,t.value,e));n=t.nextElementSibling;i=n.querySelector(".tutor-form-select-search");s=i&&i.querySelector("input");v=n.querySelector(".tutor-form-select-dropdown");var p=n.querySelector(".tutor-form-select-label");p.innerText=a&&a.text;n.onclick=t=>{t.stopPropagation();r(document.querySelectorAll(".tutor-js-form-select"),n);n.classList.toggle("is-active");if(s){setTimeout(()=>{s.focus()},100)}v.onclick=t=>{t.stopPropagation()}};r(document.querySelectorAll(".tutor-js-form-select"));l=n.querySelector(".tutor-form-select-options");u=l&&l.querySelectorAll(".tutor-form-select-option");if(u){u.forEach(e=>{e.onclick=r=>{r.stopPropagation();var o=Array.from(t.options);o.forEach((o,a)=>{if(o.value===r.target.dataset.key){var i;(i=l.querySelector(".is-active"))===null||i===void 0?void 0:i.classList.remove("is-active");e.classList.add("is-active");n.classList.remove("is-active");p.innerText=r.target.innerText;p.dataset.value=o.value;t.value=o.value;var s=document.getElementById("save_tutor_option");if(s){s.disabled=false}}});var a=new Event("change",{bubbles:true});t.dispatchEvent(a)}})}var m=t=>{var e=0;t.forEach(t=>{if(t.style.display!=="none"){e+=1}});return e};if(s){s.oninput=t=>{var e,r=false;c=t.target.value.toUpperCase();u.forEach(t=>{d=t.querySelector("[tutor-dropdown-item]");e=d.textContent||d.innerText;if(e.toUpperCase().indexOf(c)>-1){t.style.display="";r="false"}else{r="true";t.style.display="none"}});var o='\n							<div class="tutor-form-select-option noItem tutor-text-center tutor-fs-7">\n								'.concat(window.wp.i18n.__("No item found","tutor"),"\n							</div>\n						");var a=v.querySelector(".tutor-form-select-options");if(0==m(u)){var n=false;a.querySelectorAll(".tutor-form-select-option").forEach(t=>{if(t.classList.contains("noItem")==true){n=true}});if(false==n){a.insertAdjacentHTML("beforeend",o);n=true}}else{if(null!==v.querySelector(".noItem")){v.querySelector(".noItem").remove()}}}}}});var t=document.querySelectorAll(".tutor-js-form-select");t.forEach(t=>{if(t.nextElementSibling){if(t.nextElementSibling.classList.contains("tutor-js-form-select")){t.nextElementSibling.remove()}}});var a=document.querySelectorAll(".tutor-js-form-select");document.onclick=t=>{r(a)}})();function r(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(t){t.forEach(t=>{if(t!==e){t.classList.remove("is-active")}})}}function o(t,e,r){var o="";Array.from(t).forEach(t=>{o+='\n            <div class="tutor-form-select-option '.concat(e===t.value?"is-active":"",'">\n				<span tutor-dropdown-item data-key="').concat(tutor_esc_attr(t.value),'" class="tutor-nowrap-ellipsis" title="').concat(tutor_esc_attr(t.text),'">').concat(tutor_esc_html(t.text),"</span>\n            </div>\n            ")});var a="";if(r){a='\n				<div class="tutor-form-select-search tutor-pt-8 tutor-px-8">\n					<div class="tutor-form-wrap">\n						<span class="tutor-form-icon">\n							<i class="tutor-icon-search" aria-hidden="true"></i>\n						</span>\n						<input type="search" class="tutor-form-control" placeholder="'.concat(window.wp.i18n.__("Search ...","tutor"),'" />\n					</div>\n				</div>\n			')}var n='\n			<div class="tutor-form-control tutor-form-select tutor-js-form-select">\n				<span class="tutor-form-select-label" tutor-dropdown-label>'.concat(window.wp.i18n.__("Select","tutor"),'</span>\n				<div class="tutor-form-select-dropdown">\n					').concat(a,'\n					<div class="tutor-form-select-options">\n						').concat(o,"\n					</div>\n				</div>\n			</div>\n        ");return n}};selectSearchField(".tutor-form-select")}};// The module cache
var e={};// The require function
function r(o){// Check if module is in cache
var a=e[o];if(a!==undefined){return a.exports}// Create a new module (and put it into the cache)
var n=e[o]={exports:{}};// Execute the module function
t[o](n,n.exports,r);// Return the exports of the module
return n.exports}// webpack/runtime/rspack_version
(()=>{r.rv=()=>"1.6.4"})();// webpack/runtime/rspack_unique_id
(()=>{r.ruid="bundler=rspack@1.6.4"})();// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(()=>{"use strict";// CONCATENATED MODULE: ./node_modules/@swc/helpers/esm/_async_to_generator.js
function t(t,e,r,o,a,n,i){try{var s=t[n](i);var c=s.value}catch(t){r(t);return}if(s.done)e(c);else Promise.resolve(c).then(o,a)}function e(e){return function(){var r=this,o=arguments;return new Promise(function(a,n){var i=e.apply(r,o);function s(e){t(i,a,n,s,c,"next",e)}function c(e){t(i,a,n,s,c,"throw",e)}s(undefined)})}}// EXTERNAL MODULE: ./assets/react/front/_select_dd_search.js
var o=r(99210);// CONCATENATED MODULE: ./assets/react/helper/ajax-handler.js
function a(t){return e(function*(){try{var e=yield fetch(window._tutorobject.ajaxurl,{method:"POST",body:t});return e}catch(t){tutor_toast(__("Operation failed","tutor"),t,"error")}})()};// CONCATENATED MODULE: ./assets/react/admin-dashboard/quiz-attempts.js
/**
 * Get quiz attempts count data
 *
 * @since v2.0.6
 */document.addEventListener("DOMContentLoaded",function(){return e(function*(){// Create new course
var t=_tutorobject.current_page;if(t==="tutor_quiz_attempts"){var e=new FormData;e.set("action","tutor_quiz_attempts_count");e.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);var r=new URLSearchParams(window.location.search);var o=["course-id","date","search"];o.forEach(t=>{var o=r.get(t);if(o){e.set(t.replace("-","_"),o)}});var n=yield a(e);if(n.ok){var i=yield n.json();if(i.success&&i.data){var s=document.querySelector(".tutor-form-control[name=data]");if(s){var c=document.querySelectorAll(".tutor-form-control[name=data] + .tutor-form-select .tutor-form-select-label");c.forEach(t=>{t.innerHTML=t.innerHTML.replace("(0)","(".concat(i.data[s.value||"all"],")"))})}var l=document.querySelectorAll(".tutor-form-control[name=data] + .tutor-form-select [tutor-dropdown-item]");l.forEach(t=>{t.innerHTML=t.innerHTML.replace("(0)","(".concat(i.data[t.dataset.key||"all"],")"))})}}}})()});// EXTERNAL MODULE: ./assets/react/admin-dashboard/segments/color-preset.js
var n=r(83282);// CONCATENATED MODULE: ./assets/react/admin-dashboard/segments/filter.js
/**
 * On click add filter value on the url
 * and refresh page
 *
 * Handle bulk action
 *
 * @package Filter / sorting
 * @since v2.0.0
 */document.addEventListener("DOMContentLoaded",function(){var{__,_x:t,_n:r,_nx:o}=wp.i18n;var n=document.getElementById("tutor-common-confirmation-modal");var i=document.getElementById("tutor-common-confirmation-form");var s=document.querySelectorAll(".tutor-filter-select");s.forEach(t=>{t.addEventListener("change",t=>{var e=t.target.name;var r=t.target.value;if(r.length){window.location=y(e,r)}else{window.location=w(e)}},{once:true})});var c=document.querySelectorAll(".tutor-admin-dashboard-filter-form");c.forEach(t=>{t.addEventListener("submit",t=>{t.preventDefault();var e=new FormData(t.target);var r=Object.fromEntries(e);var o=new URL(window.location.href);var a=o.searchParams;a.set("paged",1);for(var n in r){var i=r[n];if(i){a.set(n,i)}else{a.delete(n)}}window.location=o})});var l=document.getElementById("tutor-backend-filter-course");if(l){l.addEventListener("change",t=>{window.location=y("course-id",t.target.value)},{once:true})}var u=document.getElementById("tutor-backend-filter-category");if(u){u.addEventListener("change",t=>{window.location=y("category",t.target.value)},{once:true})}var d=document.getElementById("tutor-backend-filter-order");if(d){d.addEventListener("change",t=>{window.location=y("order",t.target.value)},{once:true})}var v=document.getElementById("tutor-backend-filter-payment-status");v===null||v===void 0?void 0:v.addEventListener("change",t=>{window.location=y("payment-status",t.target.value)},{once:true});var p=document.getElementById("tutor-admin-search-filter-form");var m=document.getElementById("tutor-backend-filter-search");if(p){// Resubmit filter on clear
// So we can avoid wrong tab link retaining search value
m.addEventListener("search",t=>{var{value:e}=t.currentTarget||{};if(/\S+/.test(e)==false){window.location=w("search")}});// Assign search value to normal form submission
p.onsubmit=t=>{t.preventDefault();var e=m.value;window.location=y("search",e)}}/**
	 * onclick apply button show checkbox select message
	 * if not selected
	 */var f=document.getElementById("tutor-admin-bulk-action-btn");var _=document.querySelector(".tutor-bulk-modal-disabled");if(f){f.onclick=()=>{var t=[];var e=document.querySelectorAll(".tutor-bulk-checkbox");for(var r of e){if(r.checked){t.push(r.value)}}if(t.length){_.setAttribute("id","tutor-bulk-confirm-popup")}else{tutor_toast(__("Warning","tutor"),__("Nothing was selected for bulk action.","tutor"),"error");if(_.hasAttribute("id")){_.removeAttribute("id")}}}}/**
	 * Onsubmit bulk form handle ajax request then reload page
	 */var g=document.getElementById("tutor-admin-bulk-action-form");if(g){g.onsubmit=t=>e(function*(){t.preventDefault();t.stopPropagation();var e=new FormData(g);var r=[];var o=document.querySelectorAll(".tutor-bulk-checkbox");for(var a of o){if(a.checked){r.push(a.value)}}if(!r.length){alert(__("Select checkbox for action","tutor"));return}e.set("bulk-ids",r);e.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);try{var n=document.querySelector("#tutor-confirm-bulk-action[data-tutor-modal-submit]");n.classList.add("is-loading");var i=yield fetch(window._tutorobject.ajaxurl,{method:"POST",body:e});n.classList.remove("is-loading");if(i.ok){var s=yield i.json();if(s.success||200===(s===null||s===void 0?void 0:s.status_code)){location.reload()}else{var{message:c=__("Something went wrong, please try again ","tutor")}=s.data||{};tutor_toast(__("Failed","tutor"),c,"error")}}}catch(t){console.log(t)}})()}/**
	 * onclick bulk action button show confirm popup
	 * on click confirm button submit bulk form
	 */var h=document.getElementById("tutor-confirm-bulk-action");if(h){h.onclick=()=>{var t=document.createElement("input");t.type="submit";g.appendChild(t);t.click();t.remove()}}function y(t,e){var r=new URL(window.location.href);var o=r.searchParams;o.set(t,e);o.set("paged",1);return r}function w(t){var e=new URL(window.location.href);var r=e.searchParams;r.delete(t);return e}/**
	 * Select all bulk checkboxes
	 *
	 * @since v2.0.0
	 */var b=document.querySelector("#tutor-bulk-checkbox-all");if(b){b.addEventListener("click",()=>{var t=document.querySelectorAll(".tutor-bulk-checkbox");t.forEach(t=>{if(b.checked){t.checked=true}else{t.checked=false}})})}/**
	 * Delete course delete
	 */var S=document.querySelectorAll(".tutor-admin-course-delete");for(var E of S){E.onclick=t=>{var e=t.currentTarget.dataset.id;if(i){i.elements.action.value="tutor_course_delete";i.elements.id.value=e}}}/**
	 * Handle permanent delete action
	 *
	 * @since 3.0.0
	 */var k=document.querySelectorAll(".tutor-delete-permanently");for(var L of k){L.onclick=t=>{var e=t.currentTarget.dataset.id;var r=t.currentTarget.dataset.action;if(i){i.elements.action.value=r;i.elements.id.value=e}}}/**
	 * Handle common confirmation form
	 *
	 * @since v.2.0.0
	 */if(i){i.onsubmit=t=>e(function*(){t.preventDefault();var e=new FormData(i);//show loading
    var r=i.querySelector("[data-tutor-modal-submit]");r.classList.add("is-loading");var o=yield a(e);//hide modal
    if(n.classList.contains("tutor-is-active")){n.classList.remove("tutor-is-active")}if(o.ok){var s=yield o.json();r.classList.remove("is-loading");if(s){if(typeof s==="object"&&s.success){tutor_toast(__("Delete","tutor"),s.data,"success");location.reload(true)}else if(typeof s==="object"&&s.success===false){tutor_toast(__("Failed","tutor"),s.data,"error")}else{tutor_toast(__("Delete","tutor"),__("Successfully deleted ","tutor"),"success");location.reload()}}else{tutor_toast(__("Failed","tutor"),__("Delete failed ","tutor"),"error")}}})()}});// EXTERNAL MODULE: ./assets/react/admin-dashboard/segments/image-preview.js
var i=r(82111);// CONCATENATED MODULE: ./assets/react/admin-dashboard/segments/import-export.js
/**
 * Settings logs, previously known as import/export
 * 
 * @since 3.6.0
 */var s=()=>{return Math.ceil(Date.now()/1e3)+6*60*60};var c=()=>e(function*(){var t=new FormData;t.append("action","load_saved_data");t.append(_tutorobject.nonce_key,_tutorobject._tutor_nonce);var e=yield a(t);var r=yield e.json();l(Object.entries(r.data))})();function l(t){var{__:e}=wp.i18n;var r="";if(null!==t&&0!==t.length){t.forEach(t=>{var o=t[0];var a=t[1];var n=a.datatype=="saved"?" label-primary":a.datatype==="Imported"?" label-success":" label-default";r+='<div class="tutor-option-field-row">\n				<div class="tutor-option-field-label">\n					<div class="tutor-fs-7 tutor-fw-medium">'.concat(a.history_date,'\n					<span class="tutor-badge-label tutor-text-capitalize tutor-ml-16').concat(n,'"> ').concat(a.datatype,'</span> </div>\n				</div>\n				<div class="tutor-option-field-input">\n					<button class="tutor-btn tutor-btn-outline-primary tutor-btn-sm apply_settings" data-tutor-modal-target="tutor-modal-bulk-action" data-btntext="').concat(e('Yes, Restore Settings" data-heading="Restore Previous Settings?',"tutor"),'" data-message="').concat(e("WARNING! This will overwrite all existing settings, please proceed with caution.","tutor"),'" data-id="').concat(o,'">').concat(e("Apply","tutor"),'</button>\n					<div class="tutor-dropdown-parent tutor-ml-16">\n						<button type="button" class="tutor-iconic-btn" action-tutor-dropdown="toggle">\n							<span class="tutor-icon-kebab-menu" aria-hidden="true"></span>\n						</button>\n						<ul class="tutor-dropdown tutor-dropdown-dark tutor-text-left">\n							<li>\n								<a href="javascript:;" class="tutor-dropdown-item export_single_settings" data-id="').concat(o,'">\n									<span class="tutor-icon-archive tutor-mr-8" aria-hidden="true"></span>\n									<span>').concat(e("Download","tutor"),'</span>\n								</a>\n							</li>\n							<li>\n								<a href="javascript:;" class="tutor-dropdown-item delete_single_settings" data-tutor-modal-target="tutor-modal-bulk-action" data-btntext="Yes, Delete Settings" data-heading="Delete This Settings?" data-message="WARNING! This will remove the settings history data from your system, please proceed with caution." data-id="').concat(o,'">\n									<span class="tutor-icon-trash-can-bold tutor-mr-8" aria-hidden="true"></span>\n									<span>').concat(e("Delete","tutor"),"</span>\n								</a>\n							</li>\n						</ul>\n					</div>\n          		</div>\n        	</div>")})}else{r+='<div class="tutor-option-field-row"><div class="tutor-option-field-label"><p class="tutor-fs-7 tutor-fw-medium">'.concat(e("No settings data found.","tutor"),"</p></div></div>")}var o='<div class="tutor-option-field-row"><div class="tutor-option-field-label">'.concat(e("Date","tutor"),"</div></div>");var a=document.querySelector(".history_data");if(a){a.innerHTML=o+r}}var u=(t,r,o)=>e(function*(){var{__:t}=wp.i18n;var e=new FormData;e.append("action","tutor_option_default_save");e.append(_tutorobject.nonce_key,_tutorobject._tutor_nonce);try{var n=yield a(e);var i=yield n.json();if(i.success){r.classList.remove("tutor-is-active");document.body.classList.remove("tutor-modal-open");tutor_toast(t("Success","tutor"),t("Reset all settings to default successfully!","tutor"),"success")}else{tutor_toast(t("Failed","tutor"),t("Something went wrong!","tutor"),"error")}}catch(e){tutor_toast(t("Failed","tutor"),t("Something went wrong!","tutor"),"error")}finally{o.classList.remove("is-loading")}})();var d=(t,r,o)=>e(function*(){var{__:e}=wp.i18n;var n=t.dataset.id;var i=new FormData;i.append("action","tutor_apply_settings");i.append(_tutorobject.nonce_key,_tutorobject._tutor_nonce);i.append("apply_id",n);try{var s=yield a(i);var c=yield s.json();if(c.success){r.classList.remove("tutor-is-active");document.body.classList.remove("tutor-modal-open");tutor_toast(e("Success","tutor"),e("Applied settings successfully!","tutor"),"success")}else{tutor_toast(e("Failed","tutor"),e("Something went wrong!","tutor"),"error")}}catch(t){tutor_toast(e("Failed","tutor"),e("Something went wrong!","tutor"),"error")}finally{o.classList.remove("is-loading")}})();var v=(t,r,o)=>e(function*(){var{__:e}=wp.i18n;var n=t.dataset.id;var i=new FormData;i.append("action","tutor_delete_single_settings");i.append(_tutorobject.nonce_key,_tutorobject._tutor_nonce);i.append("time",Date.now());i.append("delete_id",n);try{var s=yield a(i);var c=yield s.json();if(c.success){r.classList.remove("tutor-is-active");document.body.classList.remove("tutor-modal-open");tutor_toast(e("Success","tutor"),e("Data deleted successfully!","tutor"),"success");l(Object.entries(c.data))}else{tutor_toast(e("Failed","tutor"),e("Something went wrong!","tutor"),"error")}}catch(t){tutor_toast(e("Failed","tutor"),e("Something went wrong!","tutor"),"error")}finally{o.classList.remove("is-loading")}})();var p=t=>{var e=document.getElementById(t.dataset.tutorModalTarget);var r=e&&e.querySelector("[data-reset]");var o=e&&e.querySelector("[data-modal-dynamic-title]");var a=e&&e.querySelector("[data-modal-dynamic-content]");r.innerText=t.dataset.btntext;r.dataset.reset="";o.innerText=t.dataset.heading;a.innerText=t.dataset.message;if(r._handleConfirmClick){r.removeEventListener("click",r._handleConfirmClick)}var n=()=>{r.classList.add("is-loading");if(t.classList.contains("tutor-reset-all")){u(t,e,r)}if(t.classList.contains("apply_settings")){d(t,e,r)}if(t.classList.contains("delete_single_settings")){v(t,e,r)}};r._handleConfirmClick=n;r.addEventListener("click",n)};document.addEventListener("DOMContentLoaded",function(){var t=document.querySelector(".tutor-backend-tutor-tools");var e=document.querySelector(".tutor-modal-body button[data-reset]");if(t&&e){e.removeAttribute("data-reset-for");e.classList.remove("reset_to_default")}});document.addEventListener("click",function(t){return e(function*(){// Handle export all settings
var e=t.target.closest("#tutor_export_settings");if(e){var r=new FormData;r.append("action","tutor_export_settings");r.append(_tutorobject.nonce_key,_tutorobject._tutor_nonce);var o="tutor_options_"+s();try{var n;e.classList.add("is-loading");var i=yield a(r);var l=yield i.json();var u=l===null||l===void 0?void 0:(n=l.data)===null||n===void 0?void 0:n.exported_data;if(u){json_download(JSON.stringify(u),o);c()}else{tutor_toast(__("Failed","tutor"),__("Something went wrong!","tutor"),"error")}}catch(t){tutor_toast(__("Failed","tutor"),__("Something went wrong!","tutor"),"error")}finally{e.classList.remove("is-loading")}}// Handle export single settings
var d=t.target.closest(".export_single_settings");if(d){var v=d.dataset.id;var m=new FormData;m.append("action","tutor_export_single_settings");m.append(_tutorobject.nonce_key,_tutorobject._tutor_nonce);m.append("time",Date.now());m.append("export_id",v);var f=yield a(m);var _=yield f.json();json_download(JSON.stringify(_.data),v)}// Handle apply single settings
var g=t.target.closest(".apply_settings");if(g){p(g)}// Handle delete single settings
var h=t.target.closest(".delete_single_settings");if(h){p(h)}// Reset to default settings
var y=t.target.closest(".tutor-reset-all");if(y){p(y)}})()});// EXTERNAL MODULE: ./assets/react/admin-dashboard/segments/lib.js
var m=r(37392);// CONCATENATED MODULE: ./assets/react/helper/tutor-formdata.js
/**
 * Prepare custom form data, while setting form data
 * it will also set tutor nonce field.
 * 
 * @since v2.1.0
 * 
 * @param formId  form id attribute
 * @param data array of objects of form elements. Key value par
 * like: [{name: 'john doe'}, {age: 100}]
 * 
 * @return mixed formData on success, false on any error
 */if(!window.tutor_get_nonce_data){window.tutor_get_nonce_data=function(t){var e=window._tutorobject||{};var r=e.nonce_key||"";var o=e[r]||"";if(t){return{key:r,value:o}}return{[r]:o}}}function f(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];var e=new FormData;t.forEach(t=>{for(var[r,o]of Object.entries(t)){e.set(r,o)}});e.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);return e}/* export default */const _=f;// CONCATENATED MODULE: ./assets/react/admin-dashboard/segments/manage-api-keys.js
document.addEventListener("DOMContentLoaded",function(){return e(function*(){var{__}=wp.i18n;var t=__("Something went wrong, please try again after refreshing page","tutor");var r=document.querySelector(".tutor-rest-api-keys-wrapper");var o=document.querySelector(".tutor-rest-api-keys-wrapper tbody");var n=document.getElementById("tutor-generate-api-keys");var i=document.querySelector("#tutor-generate-api-keys button[type=submit]");var s=document.getElementById("tutor-add-new-api-keys");var c=document.getElementById("tutor-api-keys-no-record");var l=document.querySelector("#tutor-update-permission-form");var u=document.querySelector("#tutor-update-permission-modal button[type=submit]");var d=document.querySelector("#tutor-update-permission-modal");if(!r){return}// Add API keys
if(n){n.onsubmit=r=>e(function*(){r.preventDefault();var e=new FormData(n);try{// Show loading
    i.classList.add("is-loading");i.setAttribute("disabled",true);var l=yield a(e);var u=yield l.json();var{success:d,data:v}=u;if(d){o.insertAdjacentHTML("afterbegin","".concat(v));tutor_toast(__("Success","tutor"),__("API key & secret generated successfully","tutor"),"success")}else{tutor_toast(__("Failed","tutor"),v,"error")}}catch(e){tutor_toast(__("Failed","tutor"),t,"error")}finally{i.classList.remove("is-loading");i.removeAttribute("disabled");s.classList.remove("tutor-is-active");document.body.classList.remove("tutor-modal-open");if(c){c.remove()}// Reset form
    n.reset()}})()}// Edit API keys
if(l){l.onsubmit=r=>e(function*(){r.preventDefault();var e=new FormData(l);try{u.classList.add("is-loading");u.setAttribute("disabled",true);var o=yield a(e);var n=yield o.json();var{success:i,data:s}=n;if(i){document.getElementById(e.get("meta_id")).innerHTML=s;tutor_toast(__("Success","tutor"),__("API key permission updated successfully","tutor"),"success")}else{tutor_toast(__("Failed","tutor"),s,"error")}}catch(e){tutor_toast(__("Failed","tutor"),t,"error")}finally{u.classList.remove("is-loading");u.removeAttribute("disabled");d.classList.remove("tutor-is-active");document.body.classList.remove("tutor-modal-open");l.reset()}})()}if(o){o.addEventListener("click",r=>e(function*(){var e=r.target;// Revoke API keys
    if(e.hasAttribute("data-meta-id")){var o=e.dataset.metaId;var n=_([{action:"tutor_revoke_api_keys",meta_id:o}]);try{e.classList.add("is-loading");e.setAttribute("disabled",true);var i=yield a(n);var s=yield i.json();var{success:c,data:u}=s;if(c){e.closest("tr").remove();tutor_toast(__("Success","tutor"),u,"success")}else{tutor_toast(__("Failed","tutor"),u,"error")}}catch(r){tutor_toast(__("Failed","tutor"),t,"error");e.classList.remove("is-loading");e.removeAttribute("disabled")}}// Add meta id to forms input value
    if(e.hasAttribute("data-update-id")){var d=e.dataset.updateId;var v=e.dataset.permission;var p=e.dataset.description;if(d){l.querySelector("input[name=meta_id]").value=d;l.querySelector("select[name=permission]").value=v;l.querySelector("textarea[name=description]").value=p}}})())}})()});// EXTERNAL MODULE: ./assets/react/admin-dashboard/segments/multiple_email_input.js
var g=r(55227);// EXTERNAL MODULE: ./assets/react/admin-dashboard/segments/navigation.js
var h=r(18569);// CONCATENATED MODULE: ./assets/react/helper/response.js
var y=(t,e)=>{var{__}=wp.i18n;var{data:r={}}=t||{};var{message:o=e||__("Something Went Wrong!","tutor")}=r;return o};// CONCATENATED MODULE: ./assets/react/admin-dashboard/segments/options.js
// SVG Icons Totor V2
var w={warning:'<svg class="tutor-icon-v2 warning" width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18.0388 14.2395C18.2457 14.5683 18.3477 14.9488 18.3321 15.3333C18.3235 15.6951 18.2227 16.0493 18.0388 16.3647C17.851 16.6762 17.5885 16.9395 17.2733 17.1326C16.9301 17.3257 16.5383 17.4237 16.1412 17.4159H5.87591C5.47974 17.4234 5.08907 17.3253 4.74673 17.1326C4.42502 16.9409 4.15549 16.6776 3.96071 16.3647C3.77376 16.0506 3.67282 15.6956 3.66741 15.3333C3.6596 14.9496 3.76106 14.5713 3.96071 14.2395L9.11094 5.64829C9.29701 5.31063 9.58016 5.03215 9.9263 4.84641C10.2558 4.67355 10.6248 4.58301 10.9998 4.58301C11.3747 4.58301 11.7437 4.67355 12.0732 4.84641C12.4259 5.02952 12.7154 5.30825 12.9062 5.64829L18.0388 14.2395ZM11.7447 10.4086C11.7447 10.2131 11.7653 10.0176 11.7799 9.81924C11.7946 9.62089 11.8063 9.41971 11.818 9.21853C11.8178 9.1484 11.8129 9.07836 11.8034 9.00885C11.7916 8.94265 11.7719 8.87799 11.7447 8.81617C11.6644 8.64655 11.5255 8.50928 11.3517 8.42798C11.1805 8.3467 10.9848 8.32759 10.8003 8.37414C10.6088 8.42217 10.4413 8.53471 10.3281 8.69149C10.213 8.84985 10.1525 9.03921 10.1551 9.2327C10.1551 9.3602 10.1756 9.48771 10.1844 9.61239C10.1932 9.73706 10.202 9.86457 10.2137 9.99208C10.2401 10.4709 10.2695 10.947 10.2988 11.4088C10.3281 11.8707 10.3545 12.3552 10.3838 12.8256C10.3857 12.9019 10.4032 12.9771 10.4352 13.0468C10.4672 13.1166 10.5131 13.1796 10.5703 13.2322C10.6275 13.2849 10.6948 13.3261 10.7685 13.3536C10.8422 13.381 10.9208 13.3942 10.9998 13.3923C11.0794 13.3946 11.1587 13.3813 11.2328 13.353C11.307 13.3248 11.3744 13.2822 11.4309 13.228C11.5454 13.1171 11.6115 12.968 11.6157 12.8114V12.5281C11.6157 12.4317 11.6157 12.3382 11.6157 12.2447C11.6362 11.9415 11.6538 11.6327 11.6743 11.3238C11.6949 11.015 11.7271 10.7118 11.7447 10.4086ZM10.9998 15.5118C11.1049 15.5119 11.2091 15.4919 11.3062 15.453C11.4034 15.4141 11.4916 15.3571 11.5658 15.2851C11.6441 15.2191 11.7061 15.137 11.7472 15.0448C11.7883 14.9526 11.8075 14.8527 11.8034 14.7524C11.8053 14.6497 11.7863 14.5476 11.7474 14.452C11.7085 14.3564 11.6505 14.2692 11.5767 14.1953C11.5029 14.1213 11.4147 14.0621 11.3172 14.0211C11.2197 13.9801 11.1149 13.958 11.0086 13.9562C10.9023 13.9543 10.7966 13.9727 10.6977 14.0103C10.5987 14.0479 10.5084 14.1039 10.4319 14.1752C10.3553 14.2465 10.2941 14.3317 10.2516 14.4259C10.2092 14.52 10.1863 14.6214 10.1844 14.7241C10.1844 14.933 10.2703 15.1333 10.4232 15.2811C10.5761 15.4288 10.7835 15.5118 10.9998 15.5118Z" fill="#9CA0AC"/></svg>',magnifyingGlass:'<svg class="tutor-icon-v2 magnifying-glass" width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.3056 5.375C7.58249 5.375 5.375 7.58249 5.375 10.3056C5.375 13.0286 7.58249 15.2361 10.3056 15.2361C13.0286 15.2361 15.2361 13.0286 15.2361 10.3056C15.2361 7.58249 13.0286 5.375 10.3056 5.375ZM4.125 10.3056C4.125 6.89214 6.89214 4.125 10.3056 4.125C13.719 4.125 16.4861 6.89214 16.4861 10.3056C16.4861 13.719 13.719 16.4861 10.3056 16.4861C6.89214 16.4861 4.125 13.719 4.125 10.3056Z" fill="#9CA0AC"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.7874 13.7872C14.0314 13.5431 14.4272 13.5431 14.6712 13.7872L17.6921 16.8081C17.9362 17.0521 17.9362 17.4479 17.6921 17.6919C17.448 17.936 17.0523 17.936 16.8082 17.6919L13.7874 14.6711C13.5433 14.427 13.5433 14.0313 13.7874 13.7872Z" fill="#9CA0AC"/></svg>',angleRight:'<svg class="tutor-icon-v2 angle-right" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.842 12.633C7.80402 12.6702 7.7592 12.6998 7.71 12.72C7.65839 12.7401 7.60341 12.7503 7.548 12.75C7.49655 12.7496 7.44563 12.7395 7.398 12.72C7.34843 12.7005 7.30347 12.6709 7.266 12.633L6.88201 12.252C6.84384 12.2138 6.81284 12.1691 6.79051 12.12C6.76739 12.0694 6.75367 12.015 6.75001 11.9595C6.74971 11.9045 6.75832 11.8498 6.77551 11.7975C6.79308 11.7477 6.82181 11.7025 6.85951 11.6655L9.53249 9.00001L6.86701 6.33453C6.82576 6.29904 6.79427 6.2536 6.77551 6.20253C6.75832 6.15026 6.74971 6.09555 6.75001 6.04053C6.75367 5.98502 6.76739 5.93064 6.79051 5.88003C6.81284 5.8309 6.84384 5.78619 6.88201 5.74803L7.263 5.36704C7.30047 5.32916 7.34543 5.29953 7.395 5.28004C7.44263 5.26056 7.49355 5.25038 7.545 5.25004C7.60142 5.24931 7.65745 5.2595 7.71 5.28004C7.7592 5.30025 7.80402 5.3298 7.842 5.36704L11.181 8.70752C11.2233 8.74442 11.2579 8.78926 11.283 8.83951C11.3077 8.88941 11.3206 8.94433 11.3206 9.00001C11.3206 9.05569 11.3077 9.11062 11.283 9.16051C11.2579 9.21076 11.2233 9.25561 11.181 9.29251L7.842 12.633Z" fill="#B4B7C0"/></svg>'};// Tutor v2 icons
var{angleRight:b,magnifyingGlass:S,warning:E}=w;document.addEventListener("DOMContentLoaded",function(){var t=function(t){var e=r[t].closest(".image-previewer");var o=e.querySelector(".input_file");var a=e.querySelector(".upload_preview");var n=document.querySelector('[data-source="email-title-logo"]');// document.querySelector(
//   "[data-source='email-title-logo']"
// );
var i=e.querySelector(".delete-btn");r[t].onclick=function(t){t.preventDefault();var e=wp.media({title:"Upload Image",library:{type:"image"},multiple:false,frame:"post",state:"insert"});e.open();/* image_frame.on("select", function (e) {
				console.log("image size");
				console.log(image.state().get("selection").first().toJSON());

				var image_url = image_frame.state().get("selection").first().toJSON().url;

				upload_previewer.src = image_input.value = image_url;
			}); */e.on("insert",function(t){var r=e.state();t=t||r.get("selection");if(!t)return;// We set multiple to false so only get one image from the uploader
var i=t.first();var s=r.display(i).toJSON();// <-- additional properties
i=i.toJSON();// Do something with attachment.id and/or attachment.url here
var c=i.sizes[s.size].url;if(null!==a){a.src=o.value=c}if(null!==n){n.src=o.value=c}})};i.onclick=function(){o.value="";n.src=""}};var e=window.jQuery;var{__}=wp.i18n;var r=document.querySelectorAll(".image_upload_button");// let image_input = document.getElementById("image_url_field");
for(var o=0;o<r.length;++o)t(o);var a=t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).toLowerCase())};e(window).on("click",function(t){e(".tutor-notification, .search_result").removeClass("show")});e(".tutor-notification-close").click(function(t){e(".tutor-notification").removeClass("show")});var n=false;var i=t=>{t.forEach(t=>{t.onchange=e=>{if(false===a(t.value)){t.style.borderColor="red";t.focus();n=false}else{t.style.borderColor="#ddd";n=true}}})};var s=t=>{t.forEach(t=>{t.oninput=t=>{var{target:e}=t;var r=Number(e.getAttribute("min")||-Infinity);var o=Number(e.getAttribute("max")||Infinity);var a=e.getAttribute("data-number-type")||"decimal";var n=Number(e.value);if(r!==-Infinity&&n<=r)t.target.value=r;if(o!==Infinity&&n>=o)t.target.value=o;if(["integer","int"].includes(a))t.target.value=parseInt(t.target.value)}})};var c=t=>{t.forEach(t=>{var e=t.closest(".tutor-option-nav-page");var r=t&&t.parentNode.parentNode.querySelector("[tutor-option-name]").innerText;var o=e&&e.querySelector("[tutor-option-title]").innerText;var i='"'+o+" > "+r+'" email is invalid!';if(t.value&&false===a(t.value)){t.style.borderColor="red";t.focus();tutor_toast(__("Warning","tutor"),i,"error")}else{n=true}})};var l=t=>{t.forEach(t=>{// console.log(numberField);
})};var u=document.querySelectorAll('.tutor-form-control[type="email"]');// const inputEmailFields = document.querySelectorAll('[type="email"]');
var d=document.querySelectorAll('.tutor-form-control[type="number"]');// const inputNumberFields = document.querySelectorAll('[type="number"]');
if(d.length)s(d);if(0!==u.length){i(u)}else{n=true}e("#save_tutor_option").click(function(t){t.preventDefault();e("#tutor-option-form").submit()});e("#tutor-option-form").submit(function(t){t.preventDefault();if(tinyMCE){tinyMCE.triggerSave()}var r=e("#save_tutor_option");var o=e(this);var a=o.serializeObject();// if (typeof inputNumberFields !== 'undefined') {
if(0!==d.length){l(d)}// if (typeof inputEmailFields !== 'undefined') {
if(0!==u.length){c(u)}// Only keep action and properties that starts with tutor_option
a=Object.fromEntries(Object.entries(a).filter(t=>{var[e,r]=t;return e==="action"||e.startsWith("tutor_option")}));if(true===n){if(!t.detail||t.detail==1){e.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:a,beforeSend:function t(){r.addClass("is-loading");r.attr("disabled",true)},success:function t(t){var{data:e={},success:r,message:o=__("Settings Saved","tutor"),reload_required:a=false}=t||{};if(r){// Disabling save btn after saved successfully
if(document.getElementById("save_tutor_option")){document.getElementById("save_tutor_option").disabled=true}tutor_toast(__("Success!","tutor"),e.message||o,"success");window.dispatchEvent(new CustomEvent("tutor_option_saved",{detail:e}));if(a){window.location.reload(true)}}else{tutor_toast(__("Error!","tutor"),e.message||o,"error")}},error:function t(){tutor_toast(__("Error!","tutor"),__("Something went wrong!","tutor"),"error")},complete:function t(){r.removeClass("is-loading");r.attr("disabled","disabled")}})}}});function v(t,e,r,o,a){var n=o?"".concat(b," ").concat(o):"";var i='\n		<a data-tab="'.concat(e,'" data-key="field_').concat(a,'">\n			<div class="search_result_title">\n			').concat(S,'\n			<span class="tutor-fs-7">').concat(t,'</span>\n			</div>\n			<div class="search_navigation">\n			<div class="nav-track tutor-fs-7">\n				<span>').concat(r,"</span>\n				<span>").concat(n,"</span>\n			</div>\n			</div>\n		</a>");return i}var p;e("#search_settings").on("input",function(t){t.preventDefault();var r=e(this);if(p){window.clearTimeout(p)}p=window.setTimeout(()=>{if(t.target.value){var o=this.value;e.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{action:"tutor_option_search",keyword:o},beforeSend:function t(){r.parent().find(".tutor-form-icon").removeClass("tutor-icon-search").addClass("tutor-icon-circle-notch tutor-animation-spin")},success:function t(t){if(!t.success){tutor_toast(__("Error","tutor"),y(t),"error");return}var a="",n="",i=true,s="",c="",l="",u="",d="",p="",m="",f=t.data.fields;Object.values(f).forEach(function(t,e,r){var f;s=t.label;c=t.section_slug;l=t.section_label;u=t.block_label;m=t.event?t.key+"_"+t.event:t.key;p=new RegExp(o,"ig");d=(f=s.match(p))===null||f===void 0?void 0:f[0];if(d){n=s.replace(p,"<span style='color: #212327; font-weight:500'>".concat(d,"</span>"));a+=v(n,c,l,u,m);i=false}});if(i){a+='<div class="no_item">'.concat(E," No Results Found</div>")}e(".search_result").html(a).addClass("show");r.parent().find(".tutor-form-icon").removeClass("tutor-icon-circle-notch tutor-animation-spin").addClass("tutor-icon-search");a=""},complete:function t(){m()}})}else{document.querySelector(".search-popup-opener").classList.remove("show")}p=undefined},500)});/**
	 * Search suggestion, navigation trigger
	 */function m(){var t=document.querySelectorAll(".tutor-options-search .search-popup-opener a");var e=document.querySelectorAll("[tutor-option-tabs] li > a");var r=document.querySelectorAll(".tutor-option-nav-page");t.forEach(t=>{t.addEventListener("click",t=>{var o=t.target.closest("[data-tab]").dataset.tab;var a=t.target.closest("[data-key]").dataset.key;if(o){document.title=t.target.innerText+" < "+_tutorobject.site_title;e.forEach(t=>{t.classList.remove("is-active")});// add active to the current nav item
document.querySelector(".tutor-option-tabs [data-tab=".concat(o,"]")).classList.add("is-active");// hide other tab contents
r.forEach(t=>{t.classList.remove("is-active")});// add active to the current content
document.querySelector(".tutor-option-tab-pages #".concat(o)).classList.add("is-active");// History push
var n=new URL(window.location);n.searchParams.set("tab_page",o);window.history.pushState({},"",n)}// Reset + Hide Suggestion box
document.querySelector(".search-popup-opener").classList.remove("visible");document.querySelector('.tutor-options-search input[type="search"]').value="";// Highlight selected element
f(a)})})}/**
	 * Highlight items form search suggestion
	 */function f(t){var e=document.querySelector("#".concat(t));var r=e&&e.querySelector("[tutor-option-name]");if(r){r.classList.add("isHighlighted");setTimeout(()=>{r.classList.remove("isHighlighted")},6e3);r.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}else{console.warn("scrollTargetEl Not found!")}}/**
	 * Highlight items form query params
	 */var _=new URLSearchParams(window.location.search);if(_.get("highlight")){f(_.get("highlight"))}/**
	 * Input value change detector (Normal/Hidden input)
	 * 
	 * @param object	element 
	 * @param function	callback 
	 * @return void
	 * 
	 * @since 2.0.7
	 */function g(t,e){MutationObserver=window.MutationObserver||window.WebKitMutationObserver;var r=new MutationObserver(function(r,o){if(r[0].attributeName=="value"){if(typeof e==="function"){e(t.value)}}});r.observe(t,{attributes:true})}/**
	 * On toggle switch change - show, hide setting's elements
	 * @since 2.1.9
	 */function h(t){var r=t.is(":checked");var o=t.data("toggle-fields").split(",");if(Array.isArray(o)===false||o.length===0)return;o=o.map(t=>t.trim());r?o.forEach(t=>e("#field_".concat(t)).removeClass("tutor-hide-option")):o.forEach(t=>e("#field_".concat(t)).addClass("tutor-hide-option"));var a=t.closest(".tutor-option-field-row");var n=t.closest(".item-wrapper");var i=n.find(".tutor-option-field-row").not("div.tutor-hide-option");if(i.length===1){a.addClass("tutor-option-no-bottom-border")}else{a.removeClass("tutor-option-no-bottom-border");i.last().addClass("tutor-option-no-bottom-border")}}var w=e('input[type="checkbox"][data-toggle-fields]');w.each(function(){h(e(this))});w.change(function(){h(e(this))});/**
	 * On toggle switch change - show, hide setting's blocks
	 * @since 3.0.0
	 */function k(t){var r=t.is(":checked");var o=t.data("toggle-blocks").split(",");if(Array.isArray(o)===false||o.length===0)return;o=o.map(t=>t.trim());o.forEach(t=>{if(r){e(".tutor-option-single-item.".concat(t)).removeClass("tutor-d-none")}else{e(".tutor-option-single-item.".concat(t)).addClass("tutor-d-none")}})}var L=e('input[type="checkbox"][data-toggle-blocks]');L.each(function(){k(e(this))});L.change(function(){k(e(this))});/**
	 * Show/Hide setting option
	 * @param object element			Dom object
	 * @param conditionFn function	Condition function
	 * @return void
	 * 
	 * @since 2.0.7
	 */function C(t,e){if(!t)return;if(e()){t.classList.remove("tutor-d-none")}else{t.classList.add("tutor-d-none")}// Remove border if only one item left.
var r=t.closest(".item-wrapper");if(r){var o=r.querySelectorAll(".tutor-option-field-row:not(.tutor-d-none)");if(o.length&&o.length===1){o[0].classList.add("tutor-option-no-bottom-border")}else{o[0].classList.remove("tutor-option-no-bottom-border")}}}/**
	 * Woocommerce order auto complete
	 *
	 * @since 2.0.5
	 * 
	 * Invoice generate options added
	 *
	 * @since 2.1.4
	 * 
	 * Monetization options refactored
	 *
	 * @since 3.0.0
	 */var q=document.querySelector("[name='tutor_option[monetize_by]']");if(q){var x=q===null||q===void 0?void 0:q.value;var A=document.querySelector("[data-toggle-fields=sharing_percentage]");var j=["tutor","wc","edd","pmpro","restrict-content-pro"];var T=document.querySelector(".tutor-option-single-item.woocommerce");var D=document.querySelector(".tutor-option-single-item.ecommerce_currency");var I=document.querySelector(".tutor-option-single-item.revenue_sharing");var M=document.querySelector(".tutor-option-single-item.fees");var B=document.querySelector(".tutor-option-single-item.withdraw");var O=document.querySelector(".tutor-option-single-item.ecommerce_invoice");var F=document.querySelector("#field_tutor_cart_page_id");var N=document.querySelector("#field_tutor_checkout_page_id");C(T,()=>x==="wc");C(D,()=>x==="tutor");C(F,()=>x==="tutor");C(N,()=>x==="tutor");C(O,()=>x==="tutor");C(I,()=>j.includes(x));C(M,()=>j.includes(x)&&(A===null||A===void 0?void 0:A.checked));C(B,()=>j.includes(x)&&(A===null||A===void 0?void 0:A.checked));// Handle monetization fields on change.
q.onchange=t=>{var e=t.target.value;C(T,()=>e==="wc");C(D,()=>e==="tutor");C(F,()=>e==="tutor");C(N,()=>e==="tutor");C(O,()=>e==="tutor");C(I,()=>j.includes(e));C(M,()=>j.includes(e)&&(A===null||A===void 0?void 0:A.checked));C(B,()=>j.includes(e)&&(A===null||A===void 0?void 0:A.checked))}}/**
	 * Maxlength counter for Textarea and Text field.
	 * @since 2.2.3
	 */var P=e(".tutor-option-field-input textarea[maxlength], .tutor-option-field-input input[maxlength]");P.each(function(){var t=e(this),r=e(this).attr("maxlength"),o=e(this).val().length,a="".concat(o,"/").concat(r);t.css("margin-right",0);e(this).parent().append('<div class="tutor-field-maxlength-info tutor-mr-4 tutor-fs-8 tutor-color-muted">'.concat(a,"</div>"))});P.keyup(function(){var t=e(this),r=e(this).attr("maxlength"),o=e(this).val().length,a="".concat(o,"/").concat(r);t.parent().find(".tutor-field-maxlength-info").text(a)});/**
	 * Tutor option password type hide and show
	 * 
	 * @since 3.0.0
	 */document.querySelectorAll(".tutor-option-field-input .tutor-type-password").forEach(t=>{var e=t.querySelector("input");var r=t.querySelector("button");var o=r===null||r===void 0?void 0:r.querySelector("i");if(!e||!r||!o){return}r.addEventListener("click",()=>{var t=e.type==="password";e.type=t?"text":"password";o.className=t?"tutor-icon-eye-bold":"tutor-icon-eye-slash-bold"})});/**
	 * Tutor option withdraw bank transfer instruction hide and show
	 * 
	 * @since 3.0.0
	 */var H=document.querySelector("#tutor_check_bank_transfer_withdraw");var R=document.querySelector("#field_tutor_bank_transfer_withdraw_instruction");if(H&&R){if(!H.checked){var z;R.classList.add("tutor-d-none");(z=R.previousElementSibling)===null||z===void 0?void 0:z.classList.add("tutor-option-no-bottom-border")}H.addEventListener("change",t=>{var e;R.classList.toggle("tutor-d-none",!t.target.checked);(e=R.previousElementSibling)===null||e===void 0?void 0:e.classList.toggle("tutor-option-no-bottom-border",!t.target.checked)})}});// EXTERNAL MODULE: ./assets/react/admin-dashboard/segments/reset.js
var k=r(4064);// CONCATENATED MODULE: ./assets/react/admin-dashboard/segments/withdraw.js
document.addEventListener("DOMContentLoaded",function(){var{__,_x:t,_n:r,_nx:o,sprintf:a}=wp.i18n;// Approve and Reject button
var n=document.querySelectorAll(".tutor-admin-open-withdraw-approve-modal");var i=document.querySelectorAll(".tutor-admin-open-withdraw-reject-modal");var s;// Onclick button dynamically create content
if(n){for(var c of n){c.onclick=t=>{s=t.currentTarget.dataset.id;var e=t.currentTarget.dataset.amount;var r=t.currentTarget.dataset.name;var o=document.getElementById("tutor-admin-withdraw-approve-content");o.innerHTML="".concat(/* translators: %1$s is the Account name and %2$s is the Amount */a(__("You are approving %1$s withdrawal request for %2$s. Are you sure you want to approve?","tutor"),'<strong style="color:#000;">'.concat(r,"</strong>"),'<strong  style="color:#000;">'.concat(e,"</strong>")))}}}// Onclick button dynamically create content
if(i){for(var l of i){l.onclick=t=>{s=t.currentTarget.dataset.id;var e=t.currentTarget.dataset.amount;var r=t.currentTarget.dataset.name;var o=document.getElementById("tutor-admin-withdraw-reject-content");o.innerHTML="".concat(/* translators: %1$s is the Account name and %2$s is the Amount */a(__("You are rejecting %1$s withdrawal request for %2$s. Are you sure you want to reject?","tutor"),'<strong style="color:#000;">'.concat(r,"</strong>"),'<strong style="color:#000;">'.concat(e,"</strong>")))}}}// Approve & Reject form
var u=document.getElementById("tutor-admin-withdraw-approve-form");var d=document.getElementById("tutor-admin-withdraw-reject-form");// Handle form submit
if(u){u.onsubmit=t=>e(function*(){t.preventDefault();var e=new FormData(u);e.set("withdraw-id",s);var r=yield p(e,t.currentTarget);if(r.ok){var o=r.json();if(o){location.reload()}else{tutor_toast(__("Failed","tutor"),__("Something went wrong, please try again!","tutor"),"error")}}})()}if(d){d.onsubmit=t=>e(function*(){t.preventDefault();var e=new FormData(d);e.set("withdraw-id",s);var r=yield p(e,t.currentTarget);if(r.ok){var o=r.json();if(o){location.reload()}else{tutor_toast(__("Failed","tutor"),__("Something went wrong, please try again!","tutor"),"error")}}})()}// Onchange reject reason if other is value then create input field for adding reason
var v=document.getElementById("tutor-admin-withdraw-reject-type");if(v){v.onchange=t=>{var e=t.target.value;if(e==="Other"){document.getElementById("tutor-withdraw-reject-other").innerHTML='<input type="text" name="reject-comment" class="tutor-form-control" placeholder="'.concat(__("Withdraw Reject Reason","tutor"),'" required/>')}}}/**
     * Handle ajax request show toast message on success | failure
     *
     * @param {*} formData including action and all form fields
     */function p(t,r){return e(function*(){t.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);try{// select loading button
var e=r.querySelector("[data-tutor-modal-submit]");e.classList.add("is-loading");var o=yield fetch(window._tutorobject.ajaxurl,{method:"POST",body:t});e.classList.remove("is-loading");return o}catch(t){tutor_toast(__("Operation failed","tutor"),t,"error")}})()}/*
    * function to copy 
    * @textToCopy string
    * return a promise
    */function m(t){// navigator clipboard api needs a secure context (https)
if(navigator.clipboard&&window.isSecureContext){// navigator clipboard api method'
return navigator.clipboard.writeText(t)}else{// text area method
var e=document.createElement("textarea");e.value=t;// make the textarea out of viewport
e.style.position="fixed";e.style.left="-999999px";e.style.top="-999999px";document.body.appendChild(e);e.focus();e.select();return new Promise((t,r)=>{// here the magic happens
document.execCommand("copy")?t():r();e.remove()})}}var f=document.querySelectorAll(".withdraw-tutor-copy-to-clipboard");if(f){var _=function(t){t.addEventListener("click",e=>{m(e.currentTarget.dataset.textCopy).then(e=>{var r=t.innerHTML;t.innerHTML="".concat(__("Copied","tutor"));setTimeout(()=>{t.innerHTML=r},5e3)})})};for(var g of f)_(g)}});// EXTERNAL MODULE: ./assets/react/admin-dashboard/wp-events-subscriber.js
var L=r(38482);// CONCATENATED MODULE: ./assets/react/admin-dashboard/tutor-admin.js
document.querySelectorAll(".tutor-control-button").forEach(function(t){t.addEventListener("click",function(e){t.classList.toggle("active");var r=t.querySelector('input[type="checkbox"]');r.checked=!r.checked;r.dispatchEvent(new Event("change",{bubbles:true}))})});jQuery(document).ready(function(t){"use strict";var r;var{__}=wp.i18n;/**i
	 * Color Picker
	 * @since v.1.2.21
	 */if(jQuery().wpColorPicker){t(".tutor_colorpicker").wpColorPicker()}if(jQuery().select2){t(".tutor_select2").select2()}/**
	 * Open Sidebar Menu
	 */if(_tutorobject.open_tutor_admin_menu){var o=t("#adminmenu");o.find('[href="admin.php?page=tutor"]').closest("li.wp-has-submenu").addClass("wp-has-current-submenu");o.find('[href="admin.php?page=tutor"]').closest("li.wp-has-submenu").find("a.wp-has-submenu").removeClass("wp-has-current-submenu").addClass("wp-has-current-submenu")}t(document).on("click",".tutor-option-media-upload-btn",function(e){e.preventDefault();var r=t(this);var o;if(o){o.open();return}o=wp.media({title:__("Select or Upload Media Of Your Choice","tutor"),button:{text:__("Upload media","tutor")},multiple:false});o.on("select",function(){var t=o.state().get("selection").first().toJSON();r.closest(".option-media-wrap").find(".option-media-preview").html('<img src="'+t.url+'" alt="" />');r.closest(".option-media-wrap").find("input").val(t.id);r.closest(".option-media-wrap").find(".tutor-media-option-trash-btn").show()});o.open()});/**
	 * Remove option media
	 * @since v.1.4.3
	 */t(document).on("click",".tutor-media-option-trash-btn",function(e){e.preventDefault();var r=t(this);r.closest(".option-media-wrap").find("img").remove();r.closest(".option-media-wrap").find("input").val("");r.closest(".option-media-wrap").find(".tutor-media-option-trash-btn").hide()});// $(document).on("change", ".tutor-form-toggle-input", function(e) {
//   var $that = $(this);
//   var isEnable = $that.prop("checked") ? 1 : 0;
//   var addonFieldName = $that.attr("name");
//   $.ajax({
//     url: window._tutorobject.ajaxurl,
//     type: "POST",
//     data: {
//       isEnable: isEnable,
//       addonFieldName: addonFieldName,
//       action: "addon_enable_disable",
//     },
//     success: function(data) {
//       if (data.success) {
//         //Success
//       }
//     },
//   });
// });
/**
	 * Add instructor
	 * @since v.1.0.3
	 */t(document).on("submit","#tutor-new-instructor-form",function(e){e.preventDefault();var r=t(this);var o=r.serializeObject();var a=t("#tutor-new-instructor-form [data-tutor-modal-submit]");var n=t("#tutor-new-instructor-form-response");o.action="tutor_add_instructor";t.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:o,beforeSend:function t(){a.attr("disabled","disable").addClass("is-loading");n.html("")},success:function e(e){if(!e.success){var r;if(e===null||e===void 0?void 0:(r=e.data)===null||r===void 0?void 0:r.errors.errors){for(var o of Object.values(e.data.errors.errors)){n.append('\n								<div class=\'tutor-col\'>\n									<div class="tutor-alert tutor-warning">\n									<div class="tutor-alert-text">\n										<span class="tutor-alert-icon tutor-icon-circle-info tutor-mr-8"></span>\n										<span>\n											'.concat(o,"\n										</span>\n									</div>\n									</div>\n								</div>\n              				"))}}else{for(var a of Object.values(e.data.errors)){n.append('\n								<div class=\'tutor-col\'>\n									<div class="tutor-alert tutor-warning">\n									<div class="tutor-alert-text">\n										<span class="tutor-alert-icon tutor-icon-circle-info tutor-mr-8"></span>\n										<span>\n											'.concat(a,"\n										</span>\n									</div>\n									</div>\n								</div>\n							"))}}}else{t("#tutor-new-instructor-form").trigger("reset");tutor_toast(__("Success","tutor"),__("New Instructor Added","tutor"),"success");location.reload()}},complete:function t(){a.removeAttr("disabled").removeClass("is-loading")}})});/**
	 * Instructor block unblock action
	 * @since v.1.5.3
	 */t(document).on("click","a.instructor-action",function(r){return e(function*(){r.preventDefault();var e=t(this);var o=e.attr("data-action");var n=e.attr("data-instructor-id");var i=r.target;var s=i.innerHTML;i.innerHTML="";i.classList.add("is-loading");// prepare form data
var c=new FormData;c.set("action","instructor_approval_action");c.set("action_name",o);c.set("instructor_id",n);c.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);try{var l=yield a(c);var u=yield l.json();if(i.classList.contains("is-loading")){i.classList.remove("is-loading");i.innerHTML=o.charAt(0).toUpperCase()+o.slice(1)}if(l.ok&&u.success){var d="";if(o=="approve"){d="Instructor approved!"}if(o=="blocked"){d="Instructor blocked!"}/**
				 * If it is instructor modal for approve or blocked
				 * hide modal then show toast then reload
				 *
				 * @since v2.0.0
				 */var v=document.querySelector(".tutor-modal-ins-approval");if(v){if(v.classList.contains("tutor-is-active")){v.classList.remove("tutor-is-active")}tutor_toast(__("Success","tutor"),__(d,"tutor"),"success");location.href="".concat(window._tutorobject.home_url,"/wp-admin/admin.php?page=tutor-instructors")}else{tutor_toast(__("Success","tutor"),__(d,"tutor"),"success");location.reload()}}else{tutor_toast(__("Failed","tutor"),__("Something went wrong!","tutor"),"error")}}catch(t){i.innerHTML=s;tutor_toast(__("Operation failed","tutor"),t,"error")}}).call(this)});/**
	 * If click on close instructor approve or modal then redirect to main URL
	 * if not redirect then it will not work with pagination.
	 */var n=document.querySelector(".tutor-modal-ins-approval .tutor-icon-56.tutor-icon-line-cross-line");if(n){n.addEventListener("click",function(){console.log("ckk");location.href="".concat(window._tutorobject.home_url,"/wp-admin/admin.php?page=tutor-instructors")})}/**
	 * On form submit block | approve instructor
	 *
	 * @since v.2.0.0
	 */// if (instructorActionForm) {
//   instructorActionForm.onsubmit = async (e) => {
//     e.preventDefault();
//     const formData = new FormData(instructorActionForm);
//     const loadingButton = instructorActionForm.querySelector('#tutor-instructor-confirm-btn.tutor-btn-loading');
//     const prevHtml = loadingButton.innerHTML;
//     loadingButton.innerHTML = `<div class="ball"></div>
//     <div class="ball"></div>
//     <div class="ball"></div>
//     <div class="ball"></div>`;
//     try {
//       const post = await ajaxHandler(formData);
//       const response = await post.json();
//       loadingButton.innerHTML = prevHtml;
//       if (post.ok && response.success) {
//         location.reload();
//       } else {
//         tutor_toast(__("Failed", "tutor"), __('Something went wrong!', 'tutor'), "error");
//       }
//     } catch (error) {
//       loadingButton.innerHTML = prevHtml;
//       tutor_toast(__("Operation failed", "tutor"), error, "error");
//     }
//   }
// }
/**
	 * Password Reveal
	 */t(document).on("click",".tutor-password-reveal",function(e){//toggle icon
t(this).toggleClass("tutor-icon-eye-line tutor-icon-eye-bold");//toggle attr
t(this).next().attr("type",function(t,e){return e=="password"?"text":"password"})});/**
	 * Used for backend profile photo upload.
	 *///tutor_video_poster_upload_btn
t(document).on("click",".tutor_video_poster_upload_btn",function(e){e.preventDefault();var r=t(this);var o;// If the media frame already exists, reopen it.
if(o){o.open();return}// Create a new media frame
o=wp.media({title:__("Select or Upload Media Of Your Choice","tutor"),button:{text:__("Upload media","tutor")},multiple:false});// When an image is selected in the media frame...
o.on("select",function(){// Get media attachment details from the frame state
var t=o.state().get("selection").first().toJSON();r.closest(".tutor-video-poster-wrap").find(".video-poster-img").html('<img src="'+t.sizes.thumbnail.url+'" alt="" />');r.closest(".tutor-video-poster-wrap").find("input").val(t.id)});// Finally, open the modal on click
o.open()});/**
	 * Tutor Memberships toggle in Paid Membership Pro panel
	 * @since v.1.3.6
	 */t(document).on("change","#tutor_pmpro_membership_model_select",function(e){e.preventDefault();var r=t(this);if(r.val()==="category_wise_membership"){t(".membership_course_categories").show()}else{t(".membership_course_categories").hide()}});t(document).on("change","#tutor_pmpro_membership_model_select",function(e){e.preventDefault();var r=t(this);if(r.val()==="category_wise_membership"){t(".membership_course_categories").show()}else{t(".membership_course_categories").hide()}});// Require category selection
t(document).on("submit",".pmpro_admin form",function(e){var r=t(this);if(!r.find('input[name="tutor_action"]').length){// Level editor or tutor action not necessary
return}if(r.find('[name="tutor_pmpro_membership_model"]').val()=="category_wise_membership"&&!r.find(".membership_course_categories input:checked").length){if(!confirm(__("Do you want to save without any category?","tutor"))){e.preventDefault()}}});/**
	 * Show hide is course public checkbox (backend dashboard editor)
	 *
	 * @since  v.1.7.2
	 */var i=t('#tutor-attach-product [name="tutor_course_price_type"]');if(i.length==0){t("#_tutor_is_course_public_meta_checkbox").show()}else{i.change(function(){if(t(this).prop("checked")){var e=t(this).val()=="paid"?"hide":"show";t("#_tutor_is_course_public_meta_checkbox")[e]()}}).trigger("change")}/**
	 * Focus selected instructor layout in setting page
	 *
	 * @since  v.1.7.5
	 */t(document).on("click",".instructor-layout-template",function(){t(".instructor-layout-template").removeClass("selected-template");t(this).addClass("selected-template")});/**
	 * Programmatically open preview link. For some reason it's not working normally.
	 *
	 * @since  v.1.7.9
	 */t("#preview-action a.preview").click(function(e){var r=t(this).attr("href");if(r){e.preventDefault();window.open(r,"_blank")}});/**
	 * If Tutor course edit then show tutor menu as active
	 *
	 * @since v2.0.0
	 */var s=document.querySelectorAll("#adminmenu li > a");if(window._tutorobject.is_tutor_course_edit&&s){s.forEach(t=>{if(t.tagName==="A"&&t.hasAttribute("href")&&t.getAttribute("href")=="admin.php?page=tutor"){t.classList.add("current");t.closest("li").classList.add("current");var e=t.closest("li#toplevel_page_tutor");var r=t.closest("#toplevel_page_tutor  li.wp-not-current-submenu.menu-top.toplevel_page_tutor > a");if(e){e.className="wp-has-submenu wp-has-current-submenu wp-menu-open menu-top toplevel_page_tutor current"}if(r){r.className="wp-has-submenu wp-has-current-submenu wp-menu-open menu-top toplevel_page_tutor current"}}})}/**
	 * Fix - Table last row context menu hidden.
	 * 
	 * @since 2.2.4
	 */var c=jQuery(".tutor-table-responsive .tutor-table .tutor-dropdown");if(c.length){var l=jQuery(".tutor-table-responsive .tutor-table").height();jQuery(".tutor-table-responsive").css("min-height",l+110)}/**
	 * Set get pro link
	 * @since 2.2.5
	 */var u=document.querySelector("span.tutor-get-pro-text");if((u===null||u===void 0?void 0:(r=u.parentElement)===null||r===void 0?void 0:r.nodeName)==="A"){var d=u.parentElement;var v="https://tutorlms.com/pricing?utm_source=tutor_plugin_get_pro_page&utm_medium=wordpress_dashboard&utm_campaign=go_premium";d.setAttribute("href",v);d.setAttribute("target","_blank")}})})()})();