(()=>{"use strict";var e={};// The module cache
var t={};// The require function
function r(o){// Check if module is in cache
var n=t[o];if(n!==undefined){return n.exports}// Create a new module (and put it into the cache)
var i=t[o]={exports:{}};// Execute the module function
e[o](i,i.exports,r);// Return the exports of the module
return i.exports}// expose the modules object (__webpack_modules__)
r.m=e;// webpack/runtime/define_property_getters
(()=>{r.d=(e,t)=>{for(var o in t){if(r.o(t,o)&&!r.o(e,o)){Object.defineProperty(e,o,{enumerable:true,get:t[o]})}}}})();// webpack/runtime/ensure_chunk
(()=>{r.f={};// This file contains only the entry chunk.
// The chunk loading function for additional chunks
r.e=e=>{return Promise.all(Object.keys(r.f).reduce((t,o)=>{r.f[o](e,t);return t},[]))}})();// webpack/runtime/get javascript chunk filename
(()=>{// This function allow to reference chunks
r.u=e=>{// return url for filenames not based on template
if(e==="587")return"js/lazy-chunks/tutor-chart-js.js?ver=4.0.0";if(e==="4")return"js/lazy-chunks/tutor-dnd-kit.js?ver=4.0.0";// return url for filenames based on template
return""+e+".javascript"}})();// webpack/runtime/get mini-css chunk filename
(()=>{// This function allow to reference chunks
r.miniCssF=e=>{// return url for filenames not based on template
// return url for filenames based on template
return""+e+".css"}})();// webpack/runtime/get_full_hash
(()=>{r.h=()=>"4627d878f4dec41b"})();// webpack/runtime/global
(()=>{r.g=(()=>{if(typeof globalThis==="object")return globalThis;try{return this||new Function("return this")()}catch(e){if(typeof window==="object")return window}})()})();// webpack/runtime/has_own_property
(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();// webpack/runtime/load_script
(()=>{var e={};var t="tutor:";// loadScript function to load a script via script tag
r.l=function(o,n,i,a){if(e[o]){e[o].push(n);return}var s,l;if(i!==undefined){var u=document.getElementsByTagName("script");for(var d=0;d<u.length;d++){var c=u[d];if(c.getAttribute("src")==o||c.getAttribute("data-webpack")==t+i){s=c;break}}}if(!s){l=true;s=document.createElement("script");s.timeout=120;if(r.nc){s.setAttribute("nonce",r.nc)}s.setAttribute("data-webpack",t+i);s.src=o}e[o]=[n];var v=function(t,r){s.onerror=s.onload=null;clearTimeout(h);var n=e[o];delete e[o];s.parentNode&&s.parentNode.removeChild(s);n&&n.forEach(function(e){return e(r)});if(t)return t(r)};var h=setTimeout(v.bind(null,undefined,{type:"timeout",target:s}),12e4);s.onerror=v.bind(null,s.onerror);s.onload=v.bind(null,s.onload);l&&document.head.appendChild(s)}})();// webpack/runtime/make_namespace_object
(()=>{// define __esModule on exports
r.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();// webpack/runtime/rspack_version
(()=>{r.rv=()=>"1.6.5"})();// webpack/runtime/auto_public_path
(()=>{var e;if(r.g.importScripts)e=r.g.location+"";var t=r.g.document;if(!e&&t){// Technically we could use `document.currentScript instanceof window.HTMLScriptElement`,
// but an attacker could try to inject `<script>HTMLScriptElement = HTMLImageElement</script>`
// and use `<img name="currentScript" src="https://attacker.controlled.server/"></img>`
if(t.currentScript&&t.currentScript.tagName.toUpperCase()==="SCRIPT")e=t.currentScript.src;if(!e){var o=t.getElementsByTagName("script");if(o.length){var n=o.length-1;while(n>-1&&(!e||!/^http(s?):/.test(e)))e=o[n--].src}}}// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration",
// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.',
if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");r.p=e+"../"})();// webpack/runtime/jsonp_chunk_loading
(()=>{// object to store loaded and loading chunks
// undefined = chunk not loaded, null = chunk preloaded/prefetched
// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
var e={"775":0};r.f.j=function(t,o){// JSONP chunk loading for javascript
var n=r.o(e,t)?e[t]:undefined;if(n!==0){// 0 means "already installed".
// a Promise means "currently loading".
if(n){o.push(n[2])}else{if(true){// setup Promise in chunk cache
var i=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=i);// start chunk loading
var a=r.p+r.u(t);// create error before stack unwound to get useful stacktrace later
var s=new Error;var l=function(o){if(r.o(e,t)){n=e[t];if(n!==0)e[t]=undefined;if(n){var i=o&&(o.type==="load"?"missing":o.type);var a=o&&o.target&&o.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")";s.name="ChunkLoadError";s.type=i;s.request=a;n[1](s)}}};r.l(a,l,"chunk-"+t,t)}}}};// install a JSONP callback for chunk loading
var t=(t,o)=>{var[n,i,a]=o;// add "moreModules" to the modules object,
// then flag all "chunkIds" as loaded and fire callback
var s,l,u=0;if(n.some(t=>e[t]!==0)){for(s in i){if(r.o(i,s)){r.m[s]=i[s]}}if(a)var d=a(r)}if(t)t(o);for(;u<n.length;u++){l=n[u];if(r.o(e,l)&&e[l]){e[l][0]()}e[l]=0}};var o=self["webpackChunktutor"]=self["webpackChunktutor"]||[];o.forEach(t.bind(null,0));o.push=t.bind(null,o.push.bind(o))})();// webpack/runtime/rspack_unique_id
(()=>{r.ruid="bundler=rspack@1.6.5"})();var o={};// UNUSED EXPORTS: initializeDashboard
;// CONCATENATED MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_async_to_generator.js
function n(e,t,r,o,n,i,a){try{var s=e[i](a);var l=s.value}catch(e){r(e);return}if(s.done)t(l);else Promise.resolve(l).then(o,n)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(o,i){var a=e.apply(t,r);function s(e){n(a,o,i,s,l,"next",e)}function l(e){n(a,o,i,s,l,"throw",e)}s(undefined)})}};// CONCATENATED MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_define_property.js
function a(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else e[t]=r;return e};// CONCATENATED MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_object_spread.js
function s(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var o=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}o.forEach(function(t){a(e,t,r[t])})}return e};// CONCATENATED MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_object_spread_props.js
function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);if(t){o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,o)}return r}function u(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors)Object.defineProperties(e,Object.getOwnPropertyDescriptors(t));else{l(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e};// CONCATENATED MODULE: external "wp.i18n"
const d=wp.i18n;// CONCATENATED MODULE: ./assets/src/js/frontend/components/reviews.ts
var c=()=>{var{query:e,endpoints:t,toast:r}=window.TutorCore;var{wpPost:o}=window.TutorCore.api;return{query:e,$el:null,deleteReviewMutation:null,init(){if(!this.$el){return}this.deleteReviewMutation=this.query.useMutation(this.deleteReview,{onSuccess:e=>{window.location.reload();var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,d.__)("Review deleted successfully","tutor"))},onError:e=>{r.error(e.message||(0,d.__)("Failed to delete review","tutor"))}})},handleDeleteReview(e){return i(function*(){var t;yield(t=this.deleteReviewMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)},deleteReview(e){return i(function*(){return o(t.DELETE_REVIEW,{review_id:e})})()}}};var v=()=>{var{query:e,modal:t,toast:r,endpoints:o}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{query:e,saveRatingMutation:null,clear_review_popup_data:false,init(){this.saveRatingMutation=this.query.useMutation(this.saveRating,{onSuccess:(e,o)=>i(function*(){if(this.clear_review_popup_data){yield this.clearReviewPopupData(o.course_id)}t.closeModal("create-review-modal");r.success(e.message);window.location.reload()}).call(this),onError:e=>{r.error(a(e))}})},handleReviewSubmit(e){return i(function*(){var t;this.clear_review_popup_data=!!e.clear_review_popup_data;var r=this.convertFormDataToPayload(e);yield(t=this.saveRatingMutation)===null||t===void 0?void 0:t.mutate(r)}).call(this)},saveRating(e){return i(function*(){return n(o.PLACE_RATING,e)})()},clearReviewPopupData(e){return i(function*(){return n(o.CLEAR_REVIEW_POPUP_DATA,{course_id:e})})()},convertFormDataToPayload(e){return u(s({},e.comment_ID&&{comment_id:e.comment_ID}),{course_id:e.comment_post_ID,tutor_rating_gen_input:e.rating,review:e.comment_content})}}};var h=e=>{var{query:t,endpoints:r,toast:o}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{query:t,id:e,isEditMode:false,$el:null,$refs:{},saveRatingMutation:null,handlers:{},init(){var e,t,r;if(!this.$el){return}// Bind handlers once to maintain stable references for cleanup
this.handlers.toggleEditMode=()=>this.toggleEditMode();(e=this.$refs.edit)===null||e===void 0?void 0:e.addEventListener("click",this.handlers.toggleEditMode);(t=this.$refs.cancel)===null||t===void 0?void 0:t.addEventListener("click",this.handlers.toggleEditMode);(r=this.$refs.delete)===null||r===void 0?void 0:r.addEventListener("click",this.handlers.onDeleteButtonClick);this.saveRatingMutation=this.query.useMutation(this.saveRating,{onSuccess:e=>{this.isEditMode=false;o.success(e.message);window.location.reload()},onError:e=>{o.error(a(e))}})},destroy(){var e,t,r;(e=this.$refs.edit)===null||e===void 0?void 0:e.removeEventListener("click",this.handlers.toggleEditMode);(t=this.$refs.cancel)===null||t===void 0?void 0:t.removeEventListener("click",this.handlers.toggleEditMode);(r=this.$refs.delete)===null||r===void 0?void 0:r.removeEventListener("click",this.handlers.onDeleteButtonClick)},handleReviewSubmit(e){return i(function*(){var t;var r=this.convertFormDataToPayload(e);yield(t=this.saveRatingMutation)===null||t===void 0?void 0:t.mutate(r)}).call(this)},saveRating(e){return i(function*(){return n(r.PLACE_RATING,e)})()},convertFormDataToPayload(e){return u(s({},e.comment_ID&&{comment_id:e.comment_ID}),{course_id:e.comment_post_ID,tutor_rating_gen_input:e.rating,review:e.comment_content})},toggleEditMode(){this.isEditMode=!this.isEditMode}}};var f={name:"reviewDeleteModal",component:c};var p={name:"reviewModal",component:v};var m={name:"reviewCard",component:h};var _=()=>{window.TutorComponentRegistry.registerAll({components:[m,f,p]});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/core/ts/config/config.ts
/* eslint-disable @typescript-eslint/no-explicit-any */var g,w;var y={ID:0,ajaxurl:"",site_url:"",home_url:"",site_title:"",base_path:"",tutor_url:"",tutor_pro_url:"",dashboard_url:"",nonce_key:"",_tutor_nonce:"",loading_icon_url:"",placeholder_img_src:"",enable_lesson_classic_editor:"",tutor_frontend_dashboard_url:"",backend_course_list_url:"",backend_bundle_list_url:"",frontend_course_list_url:"",frontend_bundle_list_url:"",wp_date_format:"",wp_rest_nonce:"",is_admin:"",is_admin_bar_showing:"",is_tour_completed:"",max_upload_size:"",content_change_event:"",is_tutor_course_edit:"",assignment_max_file_allowed:"",current_page:"",quiz_answer_display_time:"",is_ssl:"",course_list_page_url:"",course_post_type:"",local:"",tutor_pn_vapid_key:"",tutor_pn_client_id:"",tutor_pn_subscription_saved:"",difficulty_levels:[],supported_video_sources:[],edd_products:[],bp_groups:[],timezones:{},addons_data:[],kids_icons_registry:[],is_kids_mode:false,user_preferences:{auto_play_next:false,contrast:"",font_scale:1,learning_mood:"modern",motion_effects:"auto",theme:"light",vision:"normal"},is_legacy_learning_mode:false,current_user:{data:{id:"",user_login:"",user_pass:"",user_nicename:"",user_email:"",user_url:"",user_registered:"",user_activation_key:"",user_status:"",display_name:""},caps:{},cap_key:"",roles:[],allcaps:{},filter:null},settings:{learning_mode:"",monetize_by:"tutor",enable_course_marketplace:"off",course_permalink_base:"",supported_video_sources:"",enrollment_expiry_enabled:"off",enable_q_and_a_on_course:"off",instructor_can_delete_course:"off",instructor_can_change_course_author:"off",instructor_can_manage_co_instructors:"off",chatgpt_enable:"off",course_builder_logo_url:"",chatgpt_key_exist:false,hide_admin_bar_for_users:"off",enable_redirect_on_course_publish_from_frontend:"off",instructor_can_publish_course:"off",youtube_api_key_exist:false,membership_only_mode:false,enable_tax:false,enable_individual_tax_control:false,is_tax_included_in_price:false},tutor_currency:{symbol:"",currency:"",position:"",thousand_separator:"",decimal_separator:"",no_of_decimal:""},visibility_control:{course_builder:{}}};var b=window._tutorobject||y;window.ajaxurl=b.ajaxurl;var E={TUTOR_SITE_URL:b.site_url,WP_AJAX_BASE_URL:b.ajaxurl,WP_API_BASE_URL:"".concat(((g=window.wpApiSettings)===null||g===void 0?void 0:g.root)||"").concat(((w=window.wpApiSettings)===null||w===void 0?void 0:w.versionString)||""),VIDEO_SOURCES_SETTINGS_URL:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=course#field_supported_video_sources"),MONETIZATION_SETTINGS_URL:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=monetization"),TUTOR_PRICING_PAGE:"https://tutorlms.com/pricing/",TUTOR_ADDONS_PAGE:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor-addons"),CHATGPT_PLATFORM_URL:"https://platform.openai.com/account/api-keys",TUTOR_MY_COURSES_PAGE_URL:"".concat(b.tutor_frontend_dashboard_url,"/my-courses"),TUTOR_SUPPORT_PAGE_URL:"https://tutorlms.com/support",TUTOR_SUBSCRIPTIONS_PAGE:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor-subscriptions"),TUTOR_ENROLLMENTS_PAGE:"".concat(b.site_url,"/wp-admin/admin.php?page=enrollments"),TUTOR_COUPONS_PAGE:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor_coupons"),TUTOR_IMPORT_EXPORT_PAGE:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor-tools&sub_page=import_export")};/* export default */const M=/* unused pure expression or super */null&&E;// CONCATENATED MODULE: ./assets/core/ts/constant.ts
var C={TAB_CHANGE:"tutor-tab-change",MODAL_OPEN:"tutor-modal-open",MODAL_UPDATE:"tutor-modal-update",MODAL_CLOSE:"tutor-modal-close",MODAL_CLOSED:"tutor-modal-closed",TOAST_SHOW:"tutor-toast-show",TOAST_CLEAR:"tutor-toast-clear",FORM_REGISTER:"tutor-form-register",FORM_UNREGISTER:"tutor-form-unregister",FORM_STATE_CHANGE:"tutor-form-state-change",FORM_RESET:"tutor-form-reset",WP_EDITOR_FOCUS:"wp-editor-focus",TUTOR_PLAYER_READY:"tutor-player-ready",COMMENT_REPLIED:"tutor:comment:replied",LESSON_PLAYER_READY:"tutorLessonPlayerReady",QUIZ_TIME_EXPIRED:"tutor-quiz-time-expired",QUIZ_ABANDON_REQUESTED:"tutor-quiz-abandon-requested",QUIZ_ATTEMPT_COMPLETED:"tutor-quiz-attempt-completed"};// CONCATENATED MODULE: ./assets/src/js/frontend/components/tour.ts
var T={NEXT:"next",BACK:"back"};var S=e=>{var{slidesData:t,modalId:r}=e;var{modal:o,api:n,endpoints:i}=window.TutorCore;var a=Number(b.is_tour_completed);return{currentSlide:0,slides:t||[],isOpen:false,slideDirection:T.NEXT,$nextTick:undefined,_onModalClose:undefined,init(){this._onModalClose=e=>{var t;if(((t=e.detail)===null||t===void 0?void 0:t.id)===r){this.isOpen=false}};document.addEventListener(C.MODAL_CLOSE,this._onModalClose);if(!a){var e,t;this.isOpen=true;(e=(t=this).$nextTick)===null||e===void 0?void 0:e.call(t,()=>{o.showModal(r)})}},destroy(){document.removeEventListener(C.MODAL_CLOSE,this._onModalClose)},next(){this.slideDirection=T.NEXT;if(this.currentSlide<this.slides.length-1){this.currentSlide++}else{this.skip()}},back(){this.slideDirection=T.BACK;if(this.currentSlide>0){this.currentSlide--}},skip(){// Fire-and-forget AJAX call to save user meta
n.wpPost(i.COMPLETE_TOUR);this.isOpen=false;o.closeModal(r)}}};var R=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"tour",component:S}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/services/common.ts
var P=()=>{var{query:e,toast:t,endpoints:r}=window.TutorCore;var{wpPost:o}=window.TutorCore.api;var{convertToErrorMessage:n}=window.TutorCore.error;return{createCourseMutation:null,init(){if(this.createCourseMutation){return}this.createCourseMutation=e.useMutation(this.createCourseRequest,{onSuccess:e=>{var t;window.location.href=(t=e.data)!==null&&t!==void 0?t:""},onError:e=>{t.error(n(e))}})},createCourseRequest(){return i(function*(){return o(r.CREATE_DRAFT_COURSE,{from_dashboard:true})})()},handleCreateCourse(){return i(function*(){var e;yield(e=this.createCourseMutation)===null||e===void 0?void 0:e.mutate({})}).call(this)}}};var A=()=>{var e=P();e.init();var t=document.querySelectorAll(".tutor-create-new-course");t.forEach(t=>{t.addEventListener("click",r=>i(function*(){r.preventDefault();t.classList.add(...["tutor-loading","tutor-btn-loading"]);t.setAttribute("disabled","true");var o=r.target;o.innerHTML="Creating...";try{yield e.handleCreateCourse()}finally{t.classList.remove(...["tutor-loading","tutor-btn-loading"]);t.removeAttribute("disabled")}})())})};// CONCATENATED MODULE: ./node_modules/.pnpm/canvas-confetti@1.9.4/node_modules/canvas-confetti/dist/confetti.module.mjs
// canvas-confetti v1.9.4 built on 2025-10-25T05:14:56.640Z
var x={};// source content
/* globals Map */(function e(t,r,o,n){var i=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL);var a=typeof Path2D==="function"&&typeof DOMMatrix==="function";var s=function(){// this mostly supports ssr
if(!t.OffscreenCanvas){return false}try{var e=new OffscreenCanvas(1,1);var r=e.getContext("2d");r.fillRect(0,0,1,1);var o=e.transferToImageBitmap();r.createPattern(o,"no-repeat")}catch(e){return false}return true}();function l(){}// create a promise if it exists, otherwise, just
// call the function directly
function u(e){var o=r.exports.Promise;var n=o!==void 0?o:t.Promise;if(typeof n==="function"){return new n(e)}e(l,l);return null}var d=function(e,t){// see https://github.com/catdad/canvas-confetti/issues/209
// creating canvases is actually pretty expensive, so we should create a
// 1:1 map for bitmap:canvas, so that we can animate the confetti in
// a performant manner, but also not store them forever so that we don't
// have a memory leak
return{transform:function(r){if(e){return r}if(t.has(r)){return t.get(r)}var o=new OffscreenCanvas(r.width,r.height);var n=o.getContext("2d");n.drawImage(r,0,0);t.set(r,o);return o},clear:function(){t.clear()}}}(s,new Map);var c=function(){var e=Math.floor(1e3/60);var t,r;var o={};var n=0;if(typeof requestAnimationFrame==="function"&&typeof cancelAnimationFrame==="function"){t=function(t){var r=Math.random();o[r]=requestAnimationFrame(function i(a){if(n===a||n+e-1<a){n=a;delete o[r];t()}else{o[r]=requestAnimationFrame(i)}});return r};r=function(e){if(o[e]){cancelAnimationFrame(o[e])}}}else{t=function(t){return setTimeout(t,e)};r=function(e){return clearTimeout(e)}}return{frame:t,cancel:r}}();var v=function(){var t;var r;var n={};function a(e){function t(t,r){e.postMessage({options:t||{},callback:r})}e.init=function t(t){var r=t.transferControlToOffscreen();e.postMessage({canvas:r},[r])};e.fire=function o(o,i,a){if(r){t(o,null);return r}var s=Math.random().toString(36).slice(2);r=u(function(i){function l(t){if(t.data.callback!==s){return}delete n[s];e.removeEventListener("message",l);r=null;d.clear();a();i()}e.addEventListener("message",l);t(o,s);n[s]=l.bind(null,{data:{callback:s}})});return r};e.reset=function t(){e.postMessage({reset:true});for(var t in n){n[t]();delete n[t]}}}return function(){if(t){return t}if(!o&&i){var r=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {","  if (msg.data.options) {","    CONFETTI(msg.data.options).then(function () {","      if (msg.data.callback) {","        postMessage({ callback: msg.data.callback });","      }","    });","  } else if (msg.data.reset) {","    CONFETTI && CONFETTI.reset();","  } else if (msg.data.resize) {","    SIZE.width = msg.data.resize.width;","    SIZE.height = msg.data.resize.height;","  } else if (msg.data.canvas) {","    SIZE.width = msg.data.canvas.width;","    SIZE.height = msg.data.canvas.height;","    CONFETTI = module.exports.create(msg.data.canvas);","  }","}"].join("\n");try{t=new Worker(URL.createObjectURL(new Blob([r])))}catch(e){// eslint-disable-next-line no-console
typeof console!=="undefined"&&typeof console.warn==="function"?console.warn("🎊 Could not load worker",e):null;return null}a(t)}return t}}();var h={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],// probably should be true, but back-compat
disableForReducedMotion:false,scalar:1};function f(e,t){return t?t(e):e}function p(e){return!(e===null||e===undefined)}function m(e,t,r){return f(e&&p(e[t])?e[t]:h[t],r)}function _(e){return e<0?0:Math.floor(e)}function g(e,t){// [min, max)
return Math.floor(Math.random()*(t-e))+e}function w(e){return parseInt(e,16)}function y(e){return e.map(b)}function b(e){var t=String(e).replace(/[^0-9a-f]/gi,"");if(t.length<6){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return{r:w(t.substring(0,2)),g:w(t.substring(2,4)),b:w(t.substring(4,6))}}function E(e){var t=m(e,"origin",Object);t.x=m(t,"x",Number);t.y=m(t,"y",Number);return t}function M(e){e.width=document.documentElement.clientWidth;e.height=document.documentElement.clientHeight}function C(e){var t=e.getBoundingClientRect();e.width=t.width;e.height=t.height}function T(e){var t=document.createElement("canvas");t.style.position="fixed";t.style.top="0px";t.style.left="0px";t.style.pointerEvents="none";t.style.zIndex=e;return t}function S(e,t,r,o,n,i,a,s,l){e.save();e.translate(t,r);e.rotate(i);e.scale(o,n);e.arc(0,0,1,a,s,l);e.restore()}function R(e){var t=e.angle*(Math.PI/180);var r=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:e.startVelocity*.5+Math.random()*e.startVelocity,angle2D:-t+(.5*r-Math.random()*r),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:e.gravity*3,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function P(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift;t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity;t.velocity*=t.decay;if(t.flat){t.wobble=0;t.wobbleX=t.x+10*t.scalar;t.wobbleY=t.y+10*t.scalar;t.tiltSin=0;t.tiltCos=0;t.random=1}else{t.wobble+=t.wobbleSpeed;t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble);t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble);t.tiltAngle+=.1;t.tiltSin=Math.sin(t.tiltAngle);t.tiltCos=Math.cos(t.tiltAngle);t.random=Math.random()+2}var r=t.tick++/t.totalTicks;var o=t.x+t.random*t.tiltCos;var n=t.y+t.random*t.tiltSin;var i=t.wobbleX+t.random*t.tiltCos;var s=t.wobbleY+t.random*t.tiltSin;e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-r)+")";e.beginPath();if(a&&t.shape.type==="path"&&typeof t.shape.path==="string"&&Array.isArray(t.shape.matrix)){e.fill(D(t.shape.path,t.shape.matrix,t.x,t.y,Math.abs(i-o)*.1,Math.abs(s-n)*.1,Math.PI/10*t.wobble))}else if(t.shape.type==="bitmap"){var l=Math.PI/10*t.wobble;var u=Math.abs(i-o)*.1;var c=Math.abs(s-n)*.1;var v=t.shape.bitmap.width*t.scalar;var h=t.shape.bitmap.height*t.scalar;var f=new DOMMatrix([Math.cos(l)*u,Math.sin(l)*u,-Math.sin(l)*c,Math.cos(l)*c,t.x,t.y]);// apply the transform matrix from the confetti shape
f.multiplySelf(new DOMMatrix(t.shape.matrix));var p=e.createPattern(d.transform(t.shape.bitmap),"no-repeat");p.setTransform(f);e.globalAlpha=1-r;e.fillStyle=p;e.fillRect(t.x-v/2,t.y-h/2,v,h);e.globalAlpha=1}else if(t.shape==="circle"){e.ellipse?e.ellipse(t.x,t.y,Math.abs(i-o)*t.ovalScalar,Math.abs(s-n)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):S(e,t.x,t.y,Math.abs(i-o)*t.ovalScalar,Math.abs(s-n)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI)}else if(t.shape==="star"){var m=Math.PI/2*3;var _=4*t.scalar;var g=8*t.scalar;var w=t.x;var y=t.y;var b=5;var E=Math.PI/b;while(b--){w=t.x+Math.cos(m)*g;y=t.y+Math.sin(m)*g;e.lineTo(w,y);m+=E;w=t.x+Math.cos(m)*_;y=t.y+Math.sin(m)*_;e.lineTo(w,y);m+=E}}else{e.moveTo(Math.floor(t.x),Math.floor(t.y));e.lineTo(Math.floor(t.wobbleX),Math.floor(n));e.lineTo(Math.floor(i),Math.floor(s));e.lineTo(Math.floor(o),Math.floor(t.wobbleY))}e.closePath();e.fill();return t.tick<t.totalTicks}function A(e,t,r,i,a){var s=t.slice();var l=e.getContext("2d");var v;var h;var f=u(function(t){function u(){v=h=null;l.clearRect(0,0,i.width,i.height);d.clear();a();t()}function f(){if(o&&!(i.width===n.width&&i.height===n.height)){i.width=e.width=n.width;i.height=e.height=n.height}if(!i.width&&!i.height){r(e);i.width=e.width;i.height=e.height}l.clearRect(0,0,i.width,i.height);s=s.filter(function(e){return P(l,e)});if(s.length){v=c.frame(f)}else{u()}}v=c.frame(f);h=u});return{addFettis:function(e){s=s.concat(e);return f},canvas:e,promise:f,reset:function(){if(v){c.cancel(v)}if(h){h()}}}}function x(e,r){var o=!e;var n=!!m(r||{},"resize");var a=false;var s=m(r,"disableForReducedMotion",Boolean);var l=i&&!!m(r||{},"useWorker");var d=l?v():null;var c=o?M:C;var h=e&&d?!!e.__confetti_initialized:false;var f=typeof matchMedia==="function"&&matchMedia("(prefers-reduced-motion)").matches;var p;function w(t,r,o){var n=m(t,"particleCount",_);var i=m(t,"angle",Number);var a=m(t,"spread",Number);var s=m(t,"startVelocity",Number);var l=m(t,"decay",Number);var u=m(t,"gravity",Number);var d=m(t,"drift",Number);var v=m(t,"colors",y);var h=m(t,"ticks",Number);var f=m(t,"shapes");var w=m(t,"scalar");var b=!!m(t,"flat");var M=E(t);var C=n;var T=[];var S=e.width*M.x;var P=e.height*M.y;while(C--){T.push(R({x:S,y:P,angle:i,spread:a,startVelocity:s,color:v[C%v.length],shape:f[g(0,f.length)],ticks:h,decay:l,gravity:u,drift:d,scalar:w,flat:b}))}// if we have a previous canvas already animating,
// add to it
if(p){return p.addFettis(T)}p=A(e,T,c,r,o);return p.promise}function b(r){var i=s||m(r,"disableForReducedMotion",Boolean);var l=m(r,"zIndex",Number);if(i&&f){return u(function(e){e()})}if(o&&p){// use existing canvas from in-progress animation
e=p.canvas}else if(o&&!e){// create and initialize a new canvas
e=T(l);document.body.appendChild(e)}if(n&&!h){// initialize the size of a user-supplied canvas
c(e)}var v={width:e.width,height:e.height};if(d&&!h){d.init(e)}h=true;if(d){e.__confetti_initialized=true}function _(){if(d){// TODO this really shouldn't be immediate, because it is expensive
var t={getBoundingClientRect:function(){if(!o){return e.getBoundingClientRect()}}};c(t);d.postMessage({resize:{width:t.width,height:t.height}});return}// don't actually query the size here, since this
// can execute frequently and rapidly
v.width=v.height=null}function g(){p=null;if(n){a=false;t.removeEventListener("resize",_)}if(o&&e){if(document.body.contains(e)){document.body.removeChild(e)}e=null;h=false}}if(n&&!a){a=true;t.addEventListener("resize",_,false)}if(d){return d.fire(r,v,g)}return w(r,v,g)}b.reset=function(){if(d){d.reset()}if(p){p.reset()}};return b}// Make default export lazy to defer worker creation until called.
var O;function I(){if(!O){O=x(null,{useWorker:true,resize:true})}return O}function D(e,t,r,o,n,i,a){var s=new Path2D(e);var l=new Path2D;l.addPath(s,new DOMMatrix(t));var u=new Path2D;// see https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix/DOMMatrix
u.addPath(l,new DOMMatrix([Math.cos(a)*n,Math.sin(a)*n,-Math.sin(a)*i,Math.cos(a)*i,r,o]));return u}function k(e){if(!a){throw new Error("path confetti are not supported in this browser")}var t,r;if(typeof e==="string"){t=e}else{t=e.path;r=e.matrix}var o=new Path2D(t);var n=document.createElement("canvas");var i=n.getContext("2d");if(!r){// attempt to figure out the width of the path, up to 1000x1000
var s=1e3;var l=s;var u=s;var d=0;var c=0;var v,h;// do some line skipping... this is faster than checking
// every pixel and will be mostly still correct
for(var f=0;f<s;f+=2){for(var p=0;p<s;p+=2){if(i.isPointInPath(o,f,p,"nonzero")){l=Math.min(l,f);u=Math.min(u,p);d=Math.max(d,f);c=Math.max(c,p)}}}v=d-l;h=c-u;var m=10;var _=Math.min(m/v,m/h);r=[_,0,0,_,-Math.round(v/2+l)*_,-Math.round(h/2+u)*_]}return{type:"path",path:t,matrix:r}}function L(e){var t,r=1,o="#000000",// see https://nolanlawson.com/2022/04/08/the-struggle-of-using-native-emoji-on-the-web/
n='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';if(typeof e==="string"){t=e}else{t=e.text;r="scalar"in e?e.scalar:r;n="fontFamily"in e?e.fontFamily:n;o="color"in e?e.color:o}// all other confetti are 10 pixels,
// so this pixel size is the de-facto 100% scale confetti
var i=10*r;var a=""+i+"px "+n;var s=new OffscreenCanvas(i,i);var l=s.getContext("2d");l.font=a;var u=l.measureText(t);var d=Math.ceil(u.actualBoundingBoxRight+u.actualBoundingBoxLeft);var c=Math.ceil(u.actualBoundingBoxAscent+u.actualBoundingBoxDescent);var v=2;var h=u.actualBoundingBoxLeft+v;var f=u.actualBoundingBoxAscent+v;d+=v+v;c+=v+v;s=new OffscreenCanvas(d,c);l=s.getContext("2d");l.font=a;l.fillStyle=o;l.fillText(t,h,f);var p=1/r;return{type:"bitmap",// TODO these probably need to be transfered for workers
bitmap:s.transferToImageBitmap(),matrix:[p,0,0,p,-d*p/2,-c*p/2]}}r.exports=function(){return I().apply(this,arguments)};r.exports.reset=function(){I().reset()};r.exports.create=x;r.exports.shapeFromPath=k;r.exports.shapeFromText=L})(function(){if(typeof window!=="undefined"){return window}if(typeof self!=="undefined"){return self}return this||{}}(),x,false);// end source content
/* export default */const O=x.exports;var I=x.exports.create;// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/confetti.ts
var D={wrapper:"tutor-modal",content:"tutor-modal-content"};var k="tutor-time-spent-modal";var L=60;var N=850;var q=850;var F=500;// safety margin for slower frame rates
var U=q/L*1e3;var B=N+U+F;var W=()=>{var e=document.querySelectorAll(".".concat(D.wrapper));for(var t of e){if(window.getComputedStyle(t).display!=="none"){return t}}return null};/**
 * Creates a full-viewport canvas inside the visible modal wrapper,
 * positioned between the backdrop and `.tutor-modal-content` in DOM
 * order so it layers above the backdrop but below the modal body.
 */var j=e=>{var t=document.createElement("canvas");// Explicit buffer dimensions so confetti renders at full resolution.
t.width=window.innerWidth;t.height=window.innerHeight;// `position: absolute` works here because `.tutor-modal` is the
// containing block (it has `position: fixed; width/height: 100%`).
t.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;";// Insert before `.tutor-modal-content` (i.e. after the backdrop div)
var r=e.querySelector(".".concat(D.content));if(r){e.insertBefore(t,r)}else{e.appendChild(t)}return{canvas:t,cleanup:()=>t.remove()}};var $;var z;var H;var Q=()=>{var e=W();if(!e){return}var{canvas:t,cleanup:r}=j(e);H=r;var o=O.create(t,{resize:true});var n=Date.now()+N;var i=()=>{o({particleCount:5,spread:360,startVelocity:30,origin:{x:Math.random(),y:0},shapes:["square"],ticks:q,scalar:2});if(Date.now()<n){z=requestAnimationFrame(i)}};i();$=setTimeout(()=>{r();H=undefined},B)};var G=()=>{if(z!==undefined){cancelAnimationFrame(z);z=undefined}if($!==undefined){clearTimeout($);$=undefined}H===null||H===void 0?void 0:H();H=undefined};function X(){document.addEventListener(C.MODAL_OPEN,e=>{var t;if(((t=e.detail)===null||t===void 0?void 0:t.id)===k){setTimeout(()=>Q(),300)}});document.addEventListener(C.MODAL_CLOSE,e=>{var t;if(((t=e.detail)===null||t===void 0?void 0:t.id)===k){G()}})};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/header.ts
var V=()=>{var{query:e,toast:t}=window.TutorCore;var{tutorConfig:r}=window.TutorCore.config;var{wpPost:o}=window.TutorCore.api;var{convertToErrorMessage:n}=window.TutorCore.error;return{query:e,profileSwitchMutation:null,init(){this.profileSwitchMutation=this.query.useMutation(e=>o("tutor_switch_profile",{current_mode:e}),{onSuccess:e=>{t.success(e===null||e===void 0?void 0:e.message);setTimeout(()=>{window.location.href=r.tutor_frontend_dashboard_url},1e3)},onError:e=>{t.error(n(e))}})}}};var Y=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"header",component:V}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/announcements.ts
var Z=e=>{var{formId:t,deleteModalId:r,createModalId:o}=e;var{query:n,modal:a,toast:l,form:c,endpoints:v}=window.TutorCore;var{wpPost:h}=window.TutorCore.api;var{convertToErrorMessage:f}=window.TutorCore.error;var p={FORM:t,DELETE:r,CREATE:o};return{query:n,deleteMutation:null,createUpdateMutation:null,formData:{id:0,course_id:"",title:"",summary:"",tutor_notify_all_students:true,action_type:"create"},get formTitle(){return this.formData.action_type==="create"?(0,d.__)("Create Announcement","tutor"):(0,d.__)("Edit Announcement","tutor")},get formActionText(){return this.formData.action_type==="create"?(0,d.__)("Publish","tutor"):(0,d.__)("Update","tutor")},init(){// Setup delete mutation
this.deleteMutation=this.query.useMutation(this.deleteAnnouncement,{onSuccess:()=>{a.closeModal(p.DELETE);window.location.reload()},onError:e=>{l.error(f(e))}});// Setup create/update mutation
this.createUpdateMutation=this.query.useMutation(this.createUpdateAnnouncement,{onSuccess:e=>{var t;a.closeModal(p.CREATE);l.success(((t=e.data)===null||t===void 0?void 0:t.message)||(0,d.__)("Operation successful","tutor"));window.location.reload()},onError:e=>{l.error(f(e))}})},deleteAnnouncement(e){return i(function*(){return h(v.DELETE_ANNOUNCEMENT,{announcement_id:e})})()},createUpdateAnnouncement(e){return i(function*(){return h(v.CREATE_ANNOUNCEMENT,e)})()},handleDeleteAnnouncement(e){return i(function*(){var t;yield(t=this.deleteMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)},openCreateModal(){this.formData.action_type="create";this.formData.id=0;a.showModal(p.CREATE);if(c.hasForm(t)){c.reset(t)}},openEditModal(e){this.formData.id=e.id;this.formData.course_id=e.course_id.toString();this.formData.title=e.title;this.formData.summary=e.summary;this.formData.action_type="update";a.showModal(p.CREATE);var r=document.getElementById(p.FORM);if(!r)return;// Manual registration fallback if auto-init hasn't fired yet
if(!c.hasForm(t)){var o=window.Alpine.$data(r);c.register(t,o)}if(c.hasForm(t)){var n={tutor_announcement_course:String(e.course_id),tutor_announcement_title:e.title,tutor_announcement_summary:e.summary,tutor_notify_all_students:true,tutor_push_notify_students:true};c.setValues(t,n)}},handleFormSubmit(e){return i(function*(){var t;var r=u(s({},e.tutor_notify_all_students&&{tutor_notify_all_students:e.tutor_notify_all_students?"on":"off"},e.tutor_push_notify_students&&{tutor_push_notify_students:e.tutor_push_notify_students?"on":"off"}),{tutor_announcement_course:e.tutor_announcement_course||"",tutor_announcement_title:e.tutor_announcement_title||"",tutor_announcement_summary:e.tutor_announcement_summary||"",action_type:this.formData.action_type});if(this.formData.action_type==="update"){r.announcement_id=this.formData.id}yield(t=this.createUpdateMutation)===null||t===void 0?void 0:t.mutate(r)}).call(this)}}};var K=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"announcements",component:Z}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/billing.ts
function J(e,t){if(!e.length){return}var r=Object.keys(e[0]);var o=e.map(e=>r.map(t=>{var r;return'"'.concat(((r=e[t])!==null&&r!==void 0?r:"").replace(/"/g,'""'),'"')}).join(","));var n=[r.join(","),...o].join("\n");var i=new Blob([n],{type:"text/csv;charset=utf-8;"});var a=URL.createObjectURL(i);var s=document.createElement("a");s.href=a;s.download=t;document.body.appendChild(s);s.click();document.body.removeChild(s);URL.revokeObjectURL(a)}function ee(){document.querySelectorAll(".tutor-export-purchase-history").forEach(e=>{e.addEventListener("click",t=>{t.preventDefault();var r;var o="order-".concat((r=e.dataset.order)!==null&&r!==void 0?r:"","-purchase-history.csv");var n,i,a,s,l;var u=[{"Order ID":(n=e.dataset.order)!==null&&n!==void 0?n:"","Course Name":(i=e.dataset.courseName)!==null&&i!==void 0?i:"",Price:(a=e.dataset.price)!==null&&a!==void 0?a:"",Date:(s=e.dataset.date)!==null&&s!==void 0?s:"",Status:(l=e.dataset.status)!==null&&l!==void 0?l:""}];J(u,o)})})}var et=()=>{ee()};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/discussions.ts
var er={COMMENT_EDIT:"lesson-comment-edit-",COMMENT_REPLY:"lesson-comment-reply-form-",QNA_EDIT:"qna-edit-",QNA_REPLY:"qna-reply-form-"};var eo={COMMENT_DELETE:"tutor-comment-delete-modal",QNA_DELETE:"tutor-qna-delete-modal"};var en={COMMENT_TEXT_PREFIX:"tutor-lesson-comment-text-",QNA_TEXT_PREFIX:"tutor-qna-text-",REPLIES_LIST_CONTAINER:"tutor-discussion-replies-list"};var ei={TAB:"tab",ID:"id",ORDER:"order"};var ea=60;/**
 * Discussions Page Component
 * Handles Q&A, Lesson comments related actions
 */var es=()=>{var{query:e,form:t,toast:r,modal:o,endpoints:n}=window.TutorCore;var{decodeHtmlEntities:a}=window.TutorCore.string;var{convertToErrorMessage:l}=window.TutorCore.error;var{wpPost:u}=window.TutorCore.api;return{query:e,deleteCommentMutation:null,replyCommentMutation:null,editCommentMutation:null,qnaSingleActionMutation:null,deleteQnAMutation:null,replyQnAMutation:null,updateQnAMutation:null,loadQnARepliesMutation:null,currentAction:null,currentQuestionId:null,isSolved:false,isImportant:false,isArchived:false,editingId:null,editingFormId:null,replyingId:null,replyingCommentId:null,loadingReplies:false,repliesOrder:"DESC",$nextTick:undefined,init(){// Set initial state from URL
var e=new URL(window.location.href);this.repliesOrder=e.searchParams.get(ei.ORDER)||"DESC";// Lesson comment delete mutation.
this.deleteCommentMutation=this.query.useMutation(this.deleteComment,{onSuccess:(e,t)=>{if(t.is_reply){r.success((0,d.__)("Reply deleted successfully","tutor"));o.closeModal(eo.COMMENT_DELETE);this.reloadReplies()}else{var n=new URL(window.location.href);n.searchParams.delete(ei.ID);window.location.href=n.toString()}},onError:e=>{r.error(l(e))}});// Lesson comment reply mutation
this.replyCommentMutation=this.query.useMutation(this.replyComment,{onSuccess:(e,o)=>{r.success((0,d.__)("Reply saved successfully","tutor"));var n="".concat(er.COMMENT_REPLY).concat(o.comment_parent);if(t.hasForm(n)){t.reset(n)}if(o.reply_context==="single"){this.reloadReplies()}else{this.setReplyingComment(null);this.updateCommentReplyCount(o.comment_parent);this.highlightCard(o.comment_parent,"comment")}},onError:e=>{r.error(l(e))}});// Lesson comment edit mutation.
this.editCommentMutation=this.query.useMutation(this.updateComment,{onSuccess:(e,o)=>{r.success((0,d.__)("Comment updated successfully.","tutor"));var n=document.getElementById("".concat(en.COMMENT_TEXT_PREFIX).concat(o.comment_id));if(n){n.innerHTML=o.comment}if(this.editingFormId&&t.hasForm(this.editingFormId)){t.reset(this.editingFormId);this.editingFormId=null}this.editingId=null},onError:e=>{r.error(l(e))}});// Q&A single action mutation (read, unread, solved, important, archived).
this.qnaSingleActionMutation=this.query.useMutation(this.qnaSingleAction,{onSuccess:(e,t)=>{var r=t.qna_action;if(r==="solved"){this.isSolved=!this.isSolved}else if(r==="important"){this.isImportant=!this.isImportant}else if(r==="archived"){this.isArchived=!this.isArchived}window.dispatchEvent(new CustomEvent("tutor-qna-action-success",{detail:{questionId:t.question_id,action:r}}))},onError:e=>{r.error(l(e))}});// Q&A delete mutation.
this.deleteQnAMutation=this.query.useMutation(this.deleteQnA,{onSuccess:(e,t)=>{if(t.context==="reply"){r.success((0,d.__)("Reply deleted successfully","tutor"));o.closeModal(eo.QNA_DELETE);// this.reloadReplies();
window.location.reload()}else{var n=new URL(window.location.href);n.searchParams.delete(ei.ID);window.location.href=n.toString()}},onError:e=>{r.error(l(e))}});// Q&A reply mutation.
this.replyQnAMutation=this.query.useMutation(this.replyQnA,{onSuccess:(e,o)=>{r.success((0,d.__)("Reply saved successfully","tutor"));var n="".concat(er.QNA_REPLY).concat(o.question_id);if(t.hasForm(n)){t.reset(n)}if(o.reply_context==="single"){// this.reloadReplies();
window.location.reload()}else{this.setReplying(null);this.updateReplyCount(o.question_id);this.highlightCard(o.question_id)}},onError:e=>{r.error(l(e))}});// Q&A update mutation.
this.updateQnAMutation=this.query.useMutation(this.updateQnA,{onSuccess:(e,t)=>{r.success((0,d.__)("Updated successfully","tutor"));// Update DOM directly for immediate feedback
var o=document.getElementById("".concat(en.QNA_TEXT_PREFIX).concat(t.question_id));if(o){if(o.closest(".tutor-discussion-card")){var n=a(t.answer);o.innerHTML=n.length>ea?"".concat(n.substring(0,60),"..."):n}else{o.innerHTML=t.answer}// Re-trigger syntax highlighting if Prism is available.
var i=window.Prism;if(i===null||i===void 0?void 0:i.highlightAllUnder){i.highlightAllUnder(o)}}if(this.editingId===t.question_id){this.setEditing(null)}},onError:e=>{r.error(l(e))}})},reloadReplies(e){return i(function*(){if(e){this.repliesOrder=e}var t=new URL(window.location.href);var r=parseInt(t.searchParams.get(ei.ID)||"0");var o=t.searchParams.get(ei.TAB)||"qna";if(!r)return;this.loadingReplies=true;try{var i;var a=o==="qna"?n.LOAD_QNA_REPLIES:n.LOAD_COMMENT_REPLIES;var s=yield u(a,{comment_id:r,order:this.repliesOrder});var l=document.getElementById(en.REPLIES_LIST_CONTAINER);if(l&&typeof((i=s.data)===null||i===void 0?void 0:i.html)==="string"){l.innerHTML=s.data.html;// Re-trigger syntax highlighting if Prism is available.
var d=window.Prism;if(d===null||d===void 0?void 0:d.highlightAllUnder){d.highlightAllUnder(l)}// Update URL without reload
var c=new URL(window.location.href);c.searchParams.set(ei.ORDER,this.repliesOrder);window.history.pushState({},"",c.toString())}}catch(e){// eslint-disable-next-line no-console
console.error("Failed to reload replies:",e)}finally{this.loadingReplies=false}}).call(this)},deleteComment(e){return u(n.DELETE_LESSON_COMMENT,e)},replyComment(e){return u(n.REPLY_LESSON_COMMENT,e)},updateComment(e){return u(n.UPDATE_LESSON_COMMENT,e)},qnaSingleAction(e){return u(n.QNA_SINGLE_ACTION,e)},deleteQnA(e){return u(n.DELETE_DASHBOARD_QNA,e)},replyQnA(e){return u(n.CREATE_UPDATE_QNA,e)},updateQnA(e){return u(n.UPDATE_QNA,e)},handleQnASingleAction(e,t){return i(function*(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.currentAction=t;this.currentQuestionId=e;try{var o;yield(o=this.qnaSingleActionMutation)===null||o===void 0?void 0:o.mutate(s({question_id:e,qna_action:t},r))}finally{this.currentAction=null;this.currentQuestionId=null}}).apply(this,arguments)},handleReplyComment(e,t,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"single";var n;return(n=this.replyCommentMutation)===null||n===void 0?void 0:n.mutate({comment:e.comment,comment_parent:t,comment_post_ID:r,reply_context:o})},handleEditComment(e,t){var r;return(r=this.editCommentMutation)===null||r===void 0?void 0:r.mutate({comment_id:t,comment:e.comment})},handleKeydown(e){if((e.metaKey||e.ctrlKey)&&e.key==="Enter"){var t;(t=e.target.closest("form"))===null||t===void 0?void 0:t.requestSubmit()}},setEditing(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"comment";var o=r==="qna"?er.QNA_EDIT:er.COMMENT_EDIT;var n=r==="qna"?"answer":"comment";this.editingId=e;var i=e?"".concat(o).concat(e):null;this.editingFormId=i;if(e&&i){var a,s;(a=(s=this).$nextTick)===null||a===void 0?void 0:a.call(s,()=>{if(t.hasForm(i)){t.setFocus(i,n)}})}},setReplying(e){this.replyingId=e;if(e){var r,o;var n="".concat(er.QNA_REPLY).concat(e);(r=(o=this).$nextTick)===null||r===void 0?void 0:r.call(o,()=>{if(t.hasForm(n)){t.setFocus(n,"answer")}})}},toggleReply(e){if(this.replyingId===e){this.setReplying(null)}else{this.setReplying(e)}},updateReplyCount(e){// Find the reply count element and increment it
var t=document.querySelector('[data-question-id="'.concat(e,'"]'));if(t){var r=t.querySelector(".tutor-discussion-card-reply-count");if(r){var o=parseInt(r.textContent||"0",10);r.textContent=String(o+1)}}},setReplyingComment(e){this.replyingCommentId=e;if(e){var r,o;var n="".concat(er.COMMENT_REPLY).concat(e);(r=(o=this).$nextTick)===null||r===void 0?void 0:r.call(o,()=>{if(t.hasForm(n)){t.setFocus(n,"comment")}})}},toggleCommentReply(e){if(this.replyingCommentId===e){this.setReplyingComment(null)}else{this.setReplyingComment(e)}},updateCommentReplyCount(e){// Find the reply count element and increment it
var t=document.querySelector('[data-comment-id="'.concat(e,'"]'));if(t){var r=t.querySelector(".tutor-discussion-card-reply-count");if(r){var o=parseInt(r.textContent||"0",10);r.textContent=String(o+1)}}},highlightCard(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"qna";var r=t==="comment"?"data-comment-id":"data-question-id";var o=document.querySelector("[".concat(r,'="').concat(e,'"]'));var n;var i=(n=o===null||o===void 0?void 0:o.closest(".tutor-discussion-card"))!==null&&n!==void 0?n:o;if(!i)return;if(window.innerWidth>576){i.style.boxShadow="0 0 0 2px var(--tutor-text-brand-secondary)";setTimeout(()=>{i.style.boxShadow=""},300)}}}};var el=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"discussions",component:es}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/instructor/home-charts.ts
var eu=null;var ed=()=>i(function*(){eu!==null&&eu!==void 0?eu:eu=r.e(/* import() | tutor-chart-js */"587").then(r.bind(r,72011)).then(e=>{var{Chart:t}=e;return t});return eu})();var ec={canvas:{statCardHeight:"33px",width:"100%",overviewMaxHeight:179,completionMaxHeight:118},aspectRatio:{overview:3},point:{radius:4,hoverRadius:6,borderWidth:2,hoverBorderWidth:3},line:{width:1.3,tension:.4},bar:{thickness:118,borderRadius:5,borderWidth:3},gradient:{topOffset:-.95,opacity:.9},tooltip:{fontSize:"10px",lineHeight:"1.6",padding:"4px 7px",minWidth:"70px",borderRadius:"4px",boxShadow:"0px 2px 4px -2px #1018280F, 0px 4px 8px -2px #1018281A",caretSize:6,caretInnerSize:5,caretInnerOffset:4,barOffsetX:6,lineOffsetX:12},common:{devicePixelRatio:()=>window.devicePixelRatio||2,responsive:true,hiddenLegend:{display:false},disabledTooltip:{enabled:false},hiddenAxis:{display:false,grid:{display:false}}}};var ev=(e,t)=>{// Expand 3-digit hex (#RGB → #RRGGBB)
var r=e.length===4?"#".concat(e[1]).concat(e[1]).concat(e[2]).concat(e[2]).concat(e[3]).concat(e[3]):e;var o=parseInt(r.slice(1,3),16)||0;var n=parseInt(r.slice(3,5),16)||0;var i=parseInt(r.slice(5,7),16)||0;return"rgba(".concat(o,", ").concat(n,", ").concat(i,", ").concat(t,")")};var eh=(e,t)=>{return e===0||e===t-1};var ef=(e,t)=>{return getComputedStyle(e).getPropertyValue(t).trim()};var ep=()=>{var e=document.querySelector("[data-tutor-theme]")||document.documentElement;var t=e.getAttribute("data-tutor-motion");return t==="reduce"||(!t||t==="auto")&&window.matchMedia("(prefers-reduced-motion: reduce)").matches};var em=()=>{if(ep()){return{duration:0}}return undefined};var e_=()=>{if(ep()){return{duration:0}}return{base:{duration:0},x:{from:e=>{var t=e.chart;var r=e.dataIndex;var o=e.datasetIndex;var n=0;for(var i=0;i<o;i++){n+=t.data.datasets[i].data[r]||0}return t.scales.x.getPixelForValue(n)}}}};var eg=(e,t)=>{requestAnimationFrame(()=>i(function*(){var r=yield ed();new r(e,t)})())};var ew=(e,t)=>{if(e.clientWidth>0){t();return}var r=new ResizeObserver(()=>{if(e.clientWidth>0){r.disconnect();t()}});r.observe(e)};var ey=(e,t)=>{var r=t[t.length-1]>t[0];return{line:ef(e,r?"--tutor-border-success":"--tutor-border-error"),point:ef(e,r?"--tutor-actions-success-primary":"--tutor-icon-critical"),pointBorder:ef(e,"--tutor-surface-l2"),tooltip:{background:ef(e,"--tutor-surface-l1"),title:ef(e,"--tutor-text-subdued"),subtitle:ef(e,"--tutor-text-primary")}}};var eb=e=>{return{earnings:{line:ef(e,"--tutor-border-brand"),point:ef(e,"--tutor-actions-brand-primary"),pointBorder:ef(e,"--tutor-actions-brand-secondary"),linearGradient:["#5E81F4",ef(e,"--tutor-surface-l1")]},enrolled:{line:ef(e,"--tutor-border-success"),point:ef(e,"--tutor-actions-success-primary"),pointBorder:ef(e,"--tutor-actions-success-secondary"),linearGradient:["#8AF1B9",ef(e,"--tutor-surface-l1")]},tooltip:{background:ef(e,"--tutor-surface-l1-hover"),title:ef(e,"--tutor-text-subdued"),subtitle:ef(e,"--tutor-text-primary")},ticks:{color:ef(e,"--tutor-text-subdued")},border:ef(e,"--tutor-border-idle")}};var eE=e=>{return{enrolled:ef(e,"--tutor-actions-exception5"),completed:ef(e,"--tutor-actions-success-primary"),in_progress:ef(e,"--tutor-actions-caution"),inactive:ef(e,"--tutor-surface-l2-hover"),cancelled:ef(e,"--tutor-actions-critical-primary"),tooltip:{background:ef(e,"--tutor-surface-l1"),title:ef(e,"--tutor-text-subdued"),subtitle:ef(e,"--tutor-text-primary")}}};var eM=function(e,t,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ef(document.documentElement,"--tutor-surface-l1");var n=t.bottom-t.top;var i=t.top+n*ec.gradient.topOffset;var a=e.createLinearGradient(0,i,0,t.bottom);a.addColorStop(0,ev(r,ec.gradient.opacity));a.addColorStop(1,ev(o,0));return a};var eC=()=>{var e=document.createElement("div");e.setAttribute("data-chart-tooltip","");Object.assign(e.style,{background:"transparent",pointerEvents:"none",position:"absolute",transform:"translate(-50%, 0)",transition:"all .1s ease"});var t=document.createElement("table");t.style.margin="0px";e.appendChild(t);return e};var eT=e=>{var t=e.canvas.parentElement;if(!t){return eC()}if(getComputedStyle(t).position==="static"){t.style.position="relative"}var r=t.querySelector("div[data-chart-tooltip]");if(!r){r=eC();t.appendChild(r)}return r};var eS=(e,t)=>{var r;if(e.opacity===0||!((r=e.dataPoints)===null||r===void 0?void 0:r.length)){return false}if(t==="bar"){return true}var o=e.dataPoints[0];var n=o.dataset.data.length;var i=o.dataIndex===0||o.dataIndex===n-1;return!i};var eR=(e,t)=>{var r=document.createElement("thead");if(e.length===0||e[0]===""){return r}for(var o of e){var n=document.createElement("tr");n.style.borderWidth="0";var i=document.createElement("th");Object.assign(i.style,{borderWidth:"0",fontSize:ec.tooltip.fontSize,lineHeight:ec.tooltip.lineHeight,fontWeight:"normal",color:t.tooltip.title,textAlign:"start"});i.appendChild(document.createTextNode(o));n.appendChild(i);r.appendChild(n)}return r};var eP=(e,t)=>{var r=document.createElement("tbody");for(var o of e){var n=document.createElement("tr");Object.assign(n.style,{backgroundColor:"inherit",borderWidth:"0"});var i=document.createElement("td");Object.assign(i.style,{borderWidth:"0",fontSize:ec.tooltip.fontSize,lineHeight:ec.tooltip.lineHeight,fontWeight:"bold",color:t.tooltip.subtitle,textAlign:"start"});i.appendChild(document.createTextNode(o[0]));n.appendChild(i);r.appendChild(n)}return r};var eA=(e,t)=>{Object.assign(e.style,{background:t.tooltip.background,borderRadius:ec.tooltip.borderRadius,padding:ec.tooltip.padding,minWidth:ec.tooltip.minWidth,boxShadow:ec.tooltip.boxShadow,position:"relative",direction:"inherit"})};var ex=(e,t,r)=>{var o=e.querySelectorAll("[data-caret]");for(var n of o){n.remove()}var{caretSize:i,caretInnerSize:a}=ec.tooltip;var s=ec.tooltip.caretInnerOffset;var l=document.createElement("div");l.setAttribute("data-caret","outer");Object.assign(l.style,{position:"absolute",top:"50%",transform:"translateY(-50%)",width:"0",height:"0",borderTop:"".concat(i,"px solid transparent"),borderBottom:"".concat(i,"px solid transparent"),zIndex:"1"});var u=document.createElement("div");u.setAttribute("data-caret","inner");Object.assign(u.style,{position:"absolute",top:"50%",transform:"translateY(-50%)",width:"0",height:"0",borderTop:"".concat(a,"px solid transparent"),borderBottom:"".concat(a,"px solid transparent"),zIndex:"2"});if(r==="right"){Object.assign(l.style,{left:"-".concat(i,"px"),borderRight:"".concat(i,"px solid transparent")});Object.assign(u.style,{left:"-".concat(s,"px"),borderRight:"".concat(a,"px solid ").concat(t.tooltip.background)})}else{Object.assign(l.style,{right:"-".concat(i,"px"),borderLeft:"".concat(i,"px solid transparent")});Object.assign(u.style,{right:"-".concat(s,"px"),borderLeft:"".concat(a,"px solid ").concat(t.tooltip.background)})}e.appendChild(l);e.appendChild(u)};var eO=(e,t,r)=>{if(t>r){return t}return Math.min(Math.max(e,t),r)};var eI=e=>{return e==="bar"?ec.tooltip.barOffsetX:ec.tooltip.lineOffsetX};var eD=(e,t,r)=>{var{chart:o,tooltip:n}=e;var i=eT(o);if(!eS(n,r)){i.style.opacity="0";return}var a=i.querySelector("table");if(!a){return}while(a.firstChild){a.firstChild.remove()}var s=n.title||[];var l=n.body.map(e=>e.lines);var u=eR(s,t);var d=eP(l,t);a.appendChild(u);a.appendChild(d);eA(a,t);var c=o.canvas.parentElement;if(!c){return}var v=eI(r);var{offsetLeft:h,offsetTop:f}=o.canvas;var p=h+n.caretX;var m=f+n.caretY;var _=8;var g="right";ex(a,t,g);var w=i.offsetWidth;var y=c.clientWidth;var b=c.clientHeight;var E=p+v;if(E+w>y-_){g="left";ex(a,t,g)}var M=i.offsetWidth;var C=i.offsetHeight;var T=g==="right"?p+v:p-M-v;var S=eO(T,_,y-M-_);var R=eO(m-C/2,_,b-C-_);Object.assign(i.style,{opacity:"1",left:"".concat(S,"px"),top:"".concat(R,"px"),transform:"translate(0, 0)"})};var ek=e=>({$refs:{},init(){var t;if(!((t=this.$refs)===null||t===void 0?void 0:t.canvas))return;this.setupCanvas();ew(this.$refs.canvas,()=>{var t=ey(this.$refs.canvas,e);eg(this.$refs.canvas,this.createChartConfig(e,t))})},setupCanvas(){this.$refs.canvas.setAttribute("height",ec.canvas.statCardHeight);this.$refs.canvas.setAttribute("width",ec.canvas.width)},createChartConfig(e,t){var r=e.length;var{formatPrice:o}=window.TutorCore.currency;return{type:"line",data:{labels:Array.from({length:r},(e,t)=>t),datasets:[{type:"line",data:e,borderWidth:1,tension:ec.line.tension,pointRadius:0,pointBackgroundColor:t.point,pointHoverRadius:e=>{return eh(e.dataIndex,r)?0:6},pointBorderWidth:ec.point.borderWidth,pointBorderColor:t.pointBorder,borderColor:t.line,backgroundColor:t.line,pointHoverBackgroundColor:t.point,pointHoverBorderColor:t.pointBorder,pointHoverBorderWidth:ec.point.hoverBorderWidth,pointHitRadius:30}]},options:{animation:em(),devicePixelRatio:ec.common.devicePixelRatio(),responsive:ec.common.responsive,maintainAspectRatio:false,interaction:{mode:"nearest",intersect:true},plugins:{legend:ec.common.hiddenLegend,tooltip:{enabled:false,position:"nearest",filter:e=>!eh(e.dataIndex,e.dataset.data.length),external:e=>eD(e,t,"line"),callbacks:{label:e=>{var t=e.parsed.y;if(t===null){return""}return e.datasetIndex===0?o(t):t.toString()},title:()=>""}}},scales:{x:ec.common.hiddenAxis,y:ec.common.hiddenAxis}}}}});var eL=e=>({$el:null,$refs:{},colors:null,init(){var t;if(!((t=this.$refs)===null||t===void 0?void 0:t.canvas))return;this.setupCanvas();ew(this.$refs.canvas,()=>{this.colors=eb(this.$refs.canvas);eg(this.$refs.canvas,this.createChartConfig(e,this.colors))})},setupCanvas(){this.$refs.canvas.style.maxHeight="".concat(ec.canvas.overviewMaxHeight,"px");this.$refs.canvas.setAttribute("width",ec.canvas.width)},getPointRadius(e,t){return eh(e.dataIndex,t)?0:ec.point.hoverRadius},getPointHoverColor(e,t,r,o){if(eh(e.dataIndex,t)){return"transparent"}var n=e.datasetIndex===0?r.earnings:r.enrolled;return n[o]},createDatasetConfig(e,t,r,o,n){return{label:e,data:t,borderColor:r.line,backgroundColor:e=>{var t=e.chart;var{ctx:o,chartArea:n}=t;if(!n)return r.line;return eM(o,n,r.linearGradient[0],r.linearGradient[1])},borderWidth:ec.line.width,tension:ec.line.tension,fill:true,pointRadius:e=>this.getPointRadius(e,n),pointBackgroundColor:"transparent",pointBorderColor:"transparent",pointBorderWidth:ec.point.hoverBorderWidth,pointHoverRadius:ec.point.hoverRadius,pointHoverBackgroundColor:e=>this.getPointHoverColor(e,n,o,"point"),pointHoverBorderColor:e=>this.getPointHoverColor(e,n,o,"pointBorder"),pointHoverBorderWidth:ec.point.hoverBorderWidth}},createChartConfig(e,t){var r,o;var n=(e===null||e===void 0?void 0:(r=e.earnings)===null||r===void 0?void 0:r.length)||(e===null||e===void 0?void 0:(o=e.enrolled)===null||o===void 0?void 0:o.length);var i=e===null||e===void 0?void 0:e.currency;return{type:"line",data:{labels:e.labels,datasets:[this.createDatasetConfig("Earnings",e.earnings,t.earnings,t,n),this.createDatasetConfig("Enrolled",e.enrolled,t.enrolled,t,n)]},options:{animation:em(),devicePixelRatio:ec.common.devicePixelRatio(),aspectRatio:ec.aspectRatio.overview,interaction:{mode:"nearest",intersect:true},plugins:{legend:ec.common.hiddenLegend,tooltip:{enabled:false,position:"nearest",filter:e=>!eh(e.dataIndex,e.dataset.data.length),external:e=>eD(e,t,"line"),callbacks:{title:t=>{var r,o,n,i,a,s;return(e===null||e===void 0?void 0:(o=e.earning_date)===null||o===void 0?void 0:o[(r=t[0])===null||r===void 0?void 0:r.dataIndex])||(e===null||e===void 0?void 0:(i=e.enrollment_date)===null||i===void 0?void 0:i[(n=t[0])===null||n===void 0?void 0:n.dataIndex])||((s=e.labels)===null||s===void 0?void 0:s[(a=t[0])===null||a===void 0?void 0:a.dataIndex])},label:e=>{var t=e.parsed.y;if(t===null){return""}return e.datasetIndex===0?eq(i,t):t.toString()}}}},scales:{x:{display:true,grid:{display:true,tickWidth:0,color:e=>{var{index:r}=e;var o=e.chart.scales.x.ticks.length;return eh(r,o)?"transparent":t.border}},border:{color:t.border,dash:[3,3]},ticks:{color:t.ticks.color,font:{size:10}}},y:{display:false,grace:"10%",grid:{display:false},border:{display:false}}}}}}});var eN=e=>({$el:null,$refs:{},init(){var t;if(!((t=this.$refs)===null||t===void 0?void 0:t.canvas))return;this.setupCanvas();ew(this.$refs.canvas,()=>{eg(this.$refs.canvas,this.createChartConfig(e))})},setupCanvas(){this.$refs.canvas.style.maxHeight="".concat(ec.canvas.completionMaxHeight,"px");this.$refs.canvas.setAttribute("width",ec.canvas.width)},createChartConfig(e){var t=eE(this.$refs.canvas);var r=[e.enrolled.value,e.completed.value,e.in_progress.value,e.inactive.value,e.cancelled.value];var o=[t.enrolled,t.completed,t.in_progress,t.inactive,t.cancelled];var n=["enrolled","completed","in_progress","inactive","cancelled"];var i=r.reduce((e,t,r)=>t>0?r:e,-1);var a=r.findIndex(e=>e>0);return{type:"bar",data:{labels:[""],datasets:r.map((e,t)=>({data:[e],backgroundColor:o[t],barThickness:ec.bar.thickness,borderRadius:{bottomLeft:t===(a>-1?a:0)?ec.bar.borderRadius:0,topLeft:t===(a>-1?a:0)?ec.bar.borderRadius:0,bottomRight:t===(i>-1?i:r.length-1)?ec.bar.borderRadius:0,topRight:t===(i>-1?i:r.length-1)?ec.bar.borderRadius:0},borderSkipped:false,borderWidth:{right:t===(i>-1?i:r.length-1)?0:ec.bar.borderWidth},borderColor:ef(this.$refs.canvas,"--tutor-surface-l1")}))},options:{animation:e_(),indexAxis:"y",responsive:ec.common.responsive,maintainAspectRatio:false,devicePixelRatio:ec.common.devicePixelRatio(),plugins:{legend:ec.common.hiddenLegend,tooltip:{enabled:false,position:"nearest",external:e=>eD(e,t,"bar"),callbacks:{title:t=>{var r;var o=t[0];return((r=e[n[o.datasetIndex]])===null||r===void 0?void 0:r.label)||""},label:e=>{var t=e.raw;return"".concat(t)}}}},scales:{x:s({stacked:true,max:r.reduce((e,t)=>e+t,0)},ec.common.hiddenAxis),y:s({stacked:true},ec.common.hiddenAxis)}}}}});var eq=(e,t)=>{var r,o,n,i,a;return window.TutorCore.currency.createPriceFormatter({symbol:(r=e===null||e===void 0?void 0:e.symbol)!==null&&r!==void 0?r:"$",position:(o=e===null||e===void 0?void 0:e.position)!==null&&o!==void 0?o:"left",thousandSeparator:(n=e===null||e===void 0?void 0:e.thousand_separator)!==null&&n!==void 0?n:",",decimalSeparator:(i=e===null||e===void 0?void 0:e.decimal_separator)!==null&&i!==void 0?i:".",fraction_digits:Number((a=e===null||e===void 0?void 0:e.no_of_decimal)!==null&&a!==void 0?a:2)})(t)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/instructor/sort-sections.ts
var eF=()=>i(function*(){var[e,t,o]=yield Promise.all([r.e(/* import() | tutor-dnd-kit */"4").then(r.bind(r,8679)),r.e(/* import() | tutor-dnd-kit */"4").then(r.bind(r,92945)),r.e(/* import() | tutor-dnd-kit */"4").then(r.bind(r,99375))]);return{DragDropManager:e.DragDropManager,KeyboardSensor:e.KeyboardSensor,PointerSensor:e.PointerSensor,RestrictToElement:t.RestrictToElement,Sortable:o.Sortable}})();var eU=e=>{var{toast:t,endpoints:r}=window.TutorCore;var{wpPost:o}=window.TutorCore.api;return{_sortables:[],_sortableSections:[],initialized:false,sectionsIds:e,$el:null,init(){if(!this.initialized){this.setupDrag();this.initialized=true}},setupDrag(){return i(function*(){var e=this.$el;if(!e){return}var{DragDropManager:n,KeyboardSensor:a,PointerSensor:s,RestrictToElement:l,Sortable:u}=yield eF();if(!this.initialized){return}var c=new n({sensors:[s,a]});var v=Array.from(e.querySelectorAll(".tutor-popover-menu-item"));this._sortables=[];this._sortableSections=[];for(var[h,f]of v.entries()){var p=f.querySelector("[data-grab]");var m;var _=(m=f.dataset.id)!==null&&m!==void 0?m:String(h);var g=new u({id:_,index:h,element:f,handle:p!==null&&p!==void 0?p:undefined,modifiers:[l.configure({element:this.$el})]},c);this._sortables.push(g)}c.monitor.addEventListener("dragstart",e=>{var t=e.operation;if(!t.source){return}var r=t.source.element;if(!r){return}});c.monitor.addEventListener("dragend",e=>i(function*(){var n=e.operation;if(!n.source){return}var i=n.source.element;if(!i){return}var a=this.getOrder();try{o(r.SAVE_INSTRUCTOR_HOME_SECTIONS_ORDER,{order:a}).then(e=>{if(!e.success){t.error((e===null||e===void 0?void 0:e.data)||(0,d.__)("Failed to save instructor home section order.","tutor"));return}})}catch(e){var s=e instanceof Error?e.message:(0,d.__)("Unknown error occurred.","tutor");t.error(s);return}if("startViewTransition"in document){setTimeout(()=>{document.startViewTransition(()=>this.updateDom())},260)}else{this.updateDom()}}).call(this))}).call(this)},handleCheckboxClick(){return i(function*(){var e=Array.from(document.querySelectorAll('input[type="checkbox"]')).reduce((e,t)=>{e[t.name]=t.checked;return e},{});try{o(r.SAVE_INSTRUCTOR_HOME_SECTIONS_VISIBILITY,{items:e}).then(e=>{if(!e.success){t.error((e===null||e===void 0?void 0:e.data)||(0,d.__)("Failed to save instructor home section visibility.","tutor"));return}})}catch(e){var n=e instanceof Error?e.message:(0,d.__)("Unknown error occurred.","tutor");t.error(n);return}})()},updateDom(){var e;var t=this.getOrder();var r=this.getSortableSections();var o=Object.keys(r)[0];var n=o?(e=r[o])===null||e===void 0?void 0:e.parentElement:null;if(!n){return}var i=Array.from(new Set(Array.from(n.querySelectorAll("[data-section-id]")).map(e=>e.dataset.sectionId).filter(e=>e!==undefined)));if(t.length===i.length&&t.every((e,t)=>e===i[t])){return}var a=document.createDocumentFragment();for(var s of t){var l=r[s];if(l){l.remove();a.appendChild(l)}}n.appendChild(a)},getOrder(){var e=this.$el;if(!e){return[]}var t=Array.from(e.querySelectorAll(".tutor-popover-menu-item")).map(e=>e.dataset.id).filter(e=>e!==undefined);return Array.from(new Set(t))},getSortableSections(){var e=document.querySelectorAll("[data-section-id]");return Array.from(e).reduce((e,t)=>{var r=t.dataset.sectionId;if(r){e[r]=t}return e},{})},destroy(){for(var e of this._sortables){e.destroy()}this._sortables=[];this.initialized=false}}};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/instructor/home.ts
var eB={name:"sortableSections",component:eU};var eW={name:"statCard",component:ek};var ej={name:"overviewChart",component:eL};var e$={name:"courseCompletionChart",component:eN};var ez=()=>{window.TutorComponentRegistry.registerAll({components:[e$,ej,eB,eW]});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/my-courses.ts
/**
 * My Courses Page Component
 * Handles course deletion and creation using HTTP and Query services
 */var eH=()=>{var{query:e,toast:t,modal:r}=window.TutorCore;var{wpPost:o}=window.TutorCore.api;return{query:e,createMutation:null,deleteMutation:null,init(){// Setup create mutation
this.createMutation=this.query.useMutation(this.createCourse,{onSuccess:e=>{if(e.status_code===201&&e.data){window.location.href=e.data}},onError:e=>{t.error(e.message||"Failed to create course")}});// Setup delete mutation
this.deleteMutation=this.query.useMutation(this.deleteCourse,{onSuccess:()=>{r.closeModal("tutor-course-delete-modal");window.location.reload()},onError:e=>{t.error(e.message||"Failed to delete course")}})},createCourse(e){return o("tutor_create_new_draft_course",e)},deleteCourse(e){return o("tutor_delete_dashboard_course",{course_id:e})},handleCreateCourse(){return i(function*(){var e;yield(e=this.createMutation)===null||e===void 0?void 0:e.mutate({from_dashboard:true})}).call(this)},handleDeleteCourse(e){return i(function*(){var t;yield(t=this.deleteMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)}}};var eQ=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"myCourses",component:eH}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/components/quiz/retry-attempt.ts
var eG=()=>{var{query:e,toast:t,endpoints:r}=window.TutorCore;var{wpPostForm:o}=window.TutorCore.api;var{convertToErrorMessage:n}=window.TutorCore.error;return{retryMutation:null,init(){this.retryMutation=e.useMutation(this.retryAttempt,{onSuccess:(e,t)=>{window.location.href=t.redirectURL},onError:e=>{t.error(n(e))}})},retryAttempt(e){return o(e.redirectURL,{tutor_action:r.START_QUIZ,quiz_id:e.quizID})}}};var eX={name:"quizRetryAttempt",component:eG};// CONCATENATED MODULE: ./assets/src/js/frontend/components/quiz/summary-sidebar.ts
var eV="question-";var eY=".tutor-quiz-summary-header";var eZ='[data-question-id="%s"]';var eK='[data-question-id="'.concat(eV,'%s"]');var eJ='[data-question-id="%s"]';var e0=new RegExp("^#".concat(eV,"(\\d+)$"));var e1=16;var e2=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t;return{activeQuestionId:String((t=e.firstQuestionId)!==null&&t!==void 0?t:""),$el:null,init(){var e=this.getQuestionIdFromHash(window.location.hash);if(e&&this.hasQuestionItem(e)){this.activeQuestionId=e}},getQuestionIdFromHash(e){var t=e.match(e0);return t?t[1]:null},hasQuestionItem(e){if(!e||!this.$el){return false}return!!this.$el.querySelector(eJ.replace("%s",e))},setActiveQuestion(e){var t=String(e||"");if(!t){return}this.activeQuestionId=t;history.replaceState(null,"","#".concat(eV).concat(t));this.scrollToQuestionAnswer(t)},scrollToQuestionAnswer(e){var t=String(e||"");if(!t){return}var r=document.getElementById("".concat(eV).concat(t))||document.querySelector(eK.replace("%s",t))||document.querySelector(eZ.replace("%s",t));if(r instanceof HTMLElement){var o=document.querySelector(eY);var n=o instanceof HTMLElement?o.getBoundingClientRect().top+o.offsetHeight:0;var i=r.getBoundingClientRect().top+window.scrollY-n-e1;window.scrollTo({top:Math.max(0,i),behavior:"smooth"})}}}};var e5={name:"quizSummarySidebar",component:e2};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/quiz-attempt-feedback.ts
var e3=["correct","incorrect"];var e6="review_statuses";var e4=e=>{var{attemptId:t,formId:r}=e;var{query:o,toast:n,endpoints:a,form:l}=window.TutorCore;var{wpPost:u}=window.TutorCore.api;var{convertToErrorMessage:c}=window.TutorCore.error;var v=new RegExp("^".concat(e6,"\\[[^\\]]+\\]$"));var h=false;var f=e=>{return Object.entries(e).reduce((e,t)=>{var[r,o]=t;if(!v.test(r)){return e}if(typeof o!=="string"||!e3.includes(o)){return e}var n=r;var i=n.slice("".concat(e6,"[").length,-1);var a=o;e[i]=a;return e},{})};var p=e=>{return Object.entries(e).reduce((e,t)=>{var[r,o]=t;var n="".concat(e6,"[").concat(r,"]");e[n]=o;return e},{})};return{formId:r,attemptId:t,feedbackMutation:null,_destroy:()=>{},init(){this.feedbackMutation=o.useMutation(this.saveFeedback,{onSuccess:()=>{n.success((0,d.__)("Quiz feedback updated successfully.","tutor"));h=true;window.location.reload()},onError:e=>{n.error(c(e))}});if(this.formId){document.dispatchEvent(new CustomEvent(C.FORM_REGISTER,{detail:{id:this.formId,instance:this}}))}var e=e=>{if(h){return false}if(l.hasForm(r)&&l.getFormState(r).isDirty){e.preventDefault()}};window.addEventListener("beforeunload",e);this._destroy=()=>{h=true;window.removeEventListener("beforeunload",e)}},destroy(){var e,t;(e=(t=this)._destroy)===null||e===void 0?void 0:e.call(t)},saveFeedback(e){return i(function*(){var t=true;var o=true;if(l.hasForm(r)){var n=l.getFormState(r);var i=n.dirtyFields;t=!!(i===null||i===void 0?void 0:i.feedback);o=Object.keys(i!==null&&i!==void 0?i:{}).some(e=>e.startsWith("".concat(e6,"["))&&i[e])}var d=p(e.review_statuses);var c=o&&Object.keys(d).length>0?u(a.REVIEW_QUIZ_ANSWERS,s({attempt_id:e.attempt_id},d)):Promise.resolve(null);var v=t?u(a.INSTRUCTOR_FEEDBACK,{attempt_id:e.attempt_id,feedback:e.feedback}):Promise.resolve(null);var[h,f]=yield Promise.all([c,v]);return{reviewResponse:h,feedbackResponse:f}})()},handleSaveFeedback(e){return i(function*(){var t;var r;yield(t=this.feedbackMutation)===null||t===void 0?void 0:t.mutate({attempt_id:this.attemptId,feedback:String((r=e.feedback)!==null&&r!==void 0?r:""),review_statuses:f(e)})}).call(this)}}};var e8={name:"quizAttemptFeedback",component:e4};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/quiz-attempts.ts
// Quiz Attempts Page
var e7=()=>{var{query:e,modal:t,toast:r}=window.TutorCore;var{wpPost:o}=window.TutorCore.api;var{convertToErrorMessage:n}=window.TutorCore.error;return{query:e,deleteMutation:null,init(){this.deleteMutation=this.query.useMutation(this.deleteAttempt,{onSuccess:()=>{t.closeModal("tutor-quiz-attempt-delete-modal");window.location.reload()},onError:e=>{r.error(n(e))}})},deleteAttempt(e){return o("tutor_attempt_delete",{id:e})},handleDeleteAttempt(e){return i(function*(){var t;yield(t=this.deleteMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)}}};var e9=()=>{window.TutorComponentRegistry.registerAll({components:[{name:"quizAttempts",component:e7},eX,e8,e5]});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/settings.ts
var te=()=>{var{query:e,form:t,toast:r,endpoints:o}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{$el:null,uploadProfilePhotoMutation:null,removeProfilePhotoMutation:null,uploadCoverPhotoMutation:null,removeCoverPhotoMutation:null,updateProfileMutation:null,saveSocialProfileMutation:null,saveBillingInfoMutation:null,saveWithdrawMethodMutation:null,resetPasswordMutation:null,handleUpdateNotification:null,savePreferencesMutation:null,resetPreferencesMutation:null,init(){if(!this.$el){return}this.handleUpdateProfile=this.handleUpdateProfile.bind(this);this.handleUploadProfilePhoto=this.handleUploadProfilePhoto.bind(this);this.handleRemoveProfilePhoto=this.handleRemoveProfilePhoto.bind(this);this.handleUploadCoverPhoto=this.handleUploadCoverPhoto.bind(this);this.handleRemoveCoverPhoto=this.handleRemoveCoverPhoto.bind(this);this.handleSaveSocialProfile=this.handleSaveSocialProfile.bind(this);this.handleSaveBillingInfo=this.handleSaveBillingInfo.bind(this);this.handleSaveWithdrawMethod=this.handleSaveWithdrawMethod.bind(this);this.handleResetPassword=this.handleResetPassword.bind(this);this.handleResetPreferences=this.handleResetPreferences.bind(this);this.handleUpdateNotification=e.useMutation(this.updateNotification,{onSuccess:(e,o)=>{t.reset(o===null||o===void 0?void 0:o.formId,o);var n;r.success((n=e===null||e===void 0?void 0:e.message)!==null&&n!==void 0?n:(0,d.__)("Notification settings updated","tutor"))},onError:e=>{r.error(a(e)||(0,d.__)("Failed to update notification settings","tutor"))}});this.uploadProfilePhotoMutation=e.useMutation(this.uploadUserPhoto,{onSuccess:()=>{r.success((0,d.__)("Successfully updated profile photo.","tutor"))},onError:e=>{r.error(a(e))}});this.removeProfilePhotoMutation=e.useMutation(this.removeUserPhoto,{onSuccess:()=>{r.success((0,d.__)("Successfully removed profile photo.","tutor"))},onError:e=>{r.error(a(e))}});this.uploadCoverPhotoMutation=e.useMutation(this.uploadUserPhoto,{onSuccess:()=>{r.success((0,d.__)("Successfully updated cover photo.","tutor"))},onError:e=>{r.error(a(e))}});this.removeCoverPhotoMutation=e.useMutation(this.removeUserPhoto,{onSuccess:()=>{r.success((0,d.__)("Successfully removed cover photo.","tutor"))},onError:e=>{r.error(a(e))}});this.updateProfileMutation=e.useMutation(this.updateProfile,{onSuccess:e=>{var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,d.__)("Successfully updated profile","tutor"))},onError:e=>{r.error(a(e))}});this.saveSocialProfileMutation=e.useMutation(this.saveSocialProfile,{onSuccess:e=>{var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,d.__)("Success successfully saved social profile","tutor"))},onError:e=>{r.error(a(e))}});this.saveBillingInfoMutation=e.useMutation(this.saveBillingInfo,{onSuccess:e=>{var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,d.__)("Success successfully saved billing info","tutor"))},onError:e=>{r.error(a(e))}});this.saveWithdrawMethodMutation=e.useMutation(this.saveWithdrawMethod,{onSuccess:e=>{var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,d.__)("Withdrawal method saved successfully","tutor"))},onError:e=>{r.error(a(e))}});this.resetPasswordMutation=e.useMutation(this.resetPassword,{onSuccess:e=>{if(e===null||e===void 0?void 0:e.success){var t;var o;r.success((o=(t=e.data)===null||t===void 0?void 0:t.message)!==null&&o!==void 0?o:(0,d.__)("Password updated successfully","tutor"))}else{var n;var i;r.error((i=(n=e.data)===null||n===void 0?void 0:n.message)!==null&&i!==void 0?i:(0,d.__)("Password update failed","tutor"))}},onError:e=>{r.error(a(e))}});this.savePreferencesMutation=e.useMutation(this.updatePreferences,{onSuccess:(e,o)=>{var n=Boolean(t.getFormState((o===null||o===void 0?void 0:o.formId)||"").dirtyFields.learning_mood);t.reset((o===null||o===void 0?void 0:o.formId)||"",o);var i;r.success((i=e===null||e===void 0?void 0:e.message)!==null&&i!==void 0?i:(0,d.__)("Preferences saved successfully","tutor"));if(n){window.location.reload()}},onError:e=>{r.error(a(e))}});this.resetPreferencesMutation=e.useMutation(this.resetPreferences,{onSuccess:e=>{var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,d.__)("Preferences reset successfully","tutor"));window.location.reload()},onError:e=>{r.error(a(e))}})},updatePreferences(e){return i(function*(){return n(o.UPDATE_USER_PREFERENCES,e)})()},resetPreferences(e){return i(function*(){return n(o.RESET_USER_PREFERENCES,e)})()},handleResetPreferences(e,t){var r;(r=this.resetPreferencesMutation)===null||r===void 0?void 0:r.mutate({formId:e,modalId:t})},updateNotification(e){return i(function*(){var t=Object.keys(e).reduce((t,r)=>{var o=e[r];if(typeof o!=="boolean"){t["".concat(r)]=o;return t}var n="";// disable_all=true means turning everything OFF
if(r==="disable_all"){n=o?"off":"on"}else{n=o?"on":"off"}if(!r.includes("__")){t["tutor_notification_preference[".concat(r,"]")]=n;return t}var[i,a]=r.split("__");if(!i&&!a){return t}t["tutor_notification_preference[email][".concat(i,"][").concat(a,"]")]=n;return t},{});return n(o.UPDATE_PROFILE_NOTIFICATION,t)})()},uploadUserPhoto(e){return i(function*(){var t=yield n(o.UPLOAD_PROFILE_PHOTO,e);if((t===null||t===void 0?void 0:t.status)!=="success"){throw new Error((0,d.__)("Image upload failed. Please try again.","tutor"))}return t})()},handleUploadProfilePhoto(e){return i(function*(){var t;if(e.length===0){return}var r={photo_file:e[0],photo_type:"profile_photo"};yield(t=this.uploadProfilePhotoMutation)===null||t===void 0?void 0:t.mutate(r)}).call(this)},handleUploadCoverPhoto(e){return i(function*(){var t;if(e.length===0){return}var r={photo_file:e[0],photo_type:"cover_photo"};yield(t=this.uploadCoverPhotoMutation)===null||t===void 0?void 0:t.mutate(r)}).call(this)},removeUserPhoto(e){return i(function*(){return n(o.REMOVE_PROFILE_PHOTO,e)})()},handleRemoveProfilePhoto(){return i(function*(){var e;yield(e=this.removeProfilePhotoMutation)===null||e===void 0?void 0:e.mutate({photo_type:"profile_photo"})}).call(this)},handleRemoveCoverPhoto(){return i(function*(){var e;yield(e=this.removeCoverPhotoMutation)===null||e===void 0?void 0:e.mutate({photo_type:"cover_photo"})}).call(this)},updateProfile(e){return i(function*(){return n(o.UPDATE_PROFILE,e)})()},handleUpdateProfile(e,r){return i(function*(){var o,n;var i=u(s({},e),{tutor_pro_custom_signature_id:((o=e.tutor_pro_custom_signature_id)===null||o===void 0?void 0:o.id)||""});yield(n=this.updateProfileMutation)===null||n===void 0?void 0:n.mutate(i);t.reset(r,e)}).call(this)},saveSocialProfile(e){return i(function*(){return n(o.SAVE_SOCIAL_PROFILE,e)})()},handleSaveSocialProfile(e,r){return i(function*(){var o;yield(o=this.saveSocialProfileMutation)===null||o===void 0?void 0:o.mutate(e);t.reset(r,e)}).call(this)},saveBillingInfo(e){return i(function*(){return n(o.SAVE_BILLING_INFO,e)})()},handleSaveBillingInfo(e,r){return i(function*(){var o;yield(o=this.saveBillingInfoMutation)===null||o===void 0?void 0:o.mutate(e);if(t.hasForm(r)){t.reset(r,e)}}).call(this)},saveWithdrawMethod(e){return i(function*(){return n(o.SAVE_WITHDRAW_METHOD,e)})()},handleSaveWithdrawMethod(e,r){return i(function*(){var o;var n=e.withdraw_method;var i={tutor_selected_withdraw_method:n};Object.keys(e).forEach(t=>{if(t.startsWith(n+"_")){var r=t.replace(n+"_","");i["withdraw_method_field[".concat(n,"][").concat(r,"]")]=e[t]||""}});yield(o=this.saveWithdrawMethodMutation)===null||o===void 0?void 0:o.mutate(i);t.reset(r,e)}).call(this)},resetPassword(e){return i(function*(){return n(o.RESET_PASSWORD,e)})()},handleResetPassword(e,o){return i(function*(){var n;if(e.new_password!==e.confirm_new_password){r.error((0,d.__)("Passwords do not match","tutor"));return}yield(n=this.resetPasswordMutation)===null||n===void 0?void 0:n.mutate(e);t.reset(o,e);window.location.reload()}).call(this)}}};var tt={name:"settings",component:te};var tr=()=>{window.TutorComponentRegistry.register({type:"component",meta:tt});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/withdrawals.ts
var to=()=>{var{query:e,form:t,toast:r,endpoints:o}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{query:e,form:t,toast:r,$el:null,withdrawalRequestMutation:null,handleWithdrawalFormSubmit(e,t){return i(function*(){var r;var o={amount:e.amount};yield(r=this.withdrawalRequestMutation)===null||r===void 0?void 0:r.mutate(o);this.form.reset(t)}).call(this)},init(){if(!this.$el){return}this.handleWithdrawalFormSubmit=this.handleWithdrawalFormSubmit.bind(this);this.withdrawalRequestMutation=this.query.useMutation(e=>n(o.MAKE_AN_WITHDRAW,e),{onSuccess:e=>{var t;this.toast.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,d.__)("Withdrawal request submitted successfully","tutor"));window.location.reload()},onError:e=>{this.toast.error(a(e))}})}}};var tn={name:"withdrawals",component:to};var ti=()=>{window.TutorComponentRegistry.register({type:"component",meta:tn});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/index.ts
// Dashboard Entry Point
// Initializes dashboard functionality based on current page
/**
 * Get current dashboard page from URL
 *
 * @since 4.0.0
 */var ta=()=>{var e=window.location.pathname;var t=new URLSearchParams(window.location.search);// Check for subpage parameter - if not 'dashboard', return early
var r=t.get("page")?t.get("subpage"):"";if(r&&r!=="dashboard"){return"";// Not on dashboard, will be handled by early return in initializeDashboard
}// Check for dashboard-page parameter (highest priority when subpage=dashboard)
var o=t.get("dashboard-page");if(o){return o}// Check for legacy query parameters
var n=t.get("subpage");if(n){return n}// Check URL path patterns
if(e.includes("/my-courses")||e.includes("my-courses")){return"my-courses"}if(e.includes("/announcements")){return"announcements"}if(e.includes("/quiz-attempts")||e.includes("/my-quiz-attempts")){return"quiz-attempts"}if(e.includes("/discussions")){return"discussions"}if(e.includes("/reviews")){return"reviews"}if(e.includes("/account/withdrawals")){return"withdrawals"}if(e.includes("/account/billing")){return"billing"}if(e.includes("/settings")){return"settings"}// Default to home when subpage=dashboard
return"home"};var ts=()=>{Y();A();R();var e=ta();// Initialize page-specific functionality
switch(e){case"home":case"dashboard":X();ez();break;case"my-courses":eQ();break;case"announcements":K();break;case"quiz-attempts":e9();break;case"discussions":el();break;case"reviews":_();break;case"withdrawals":ti();break;case"billing":et();break;case"settings":tr();break;default:// eslint-disable-next-line no-console
console.warn("Unknown dashboard page:",e)}};// Initialize when Alpine is ready
if(document.readyState==="loading"){document.addEventListener("alpine:init",ts)}else{ts()}})();