[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.191.195.2: ~ $
"use strict";(self["webpackChunktutor"]=self["webpackChunktutor"]||[]).push([[883],{7301:(t,e,r)=>{r.d(e,{$:()=>h,S:()=>v});var n=r(7363);var o=r.n(n);var i=r(7536);var a=r(917);function u(t,e){return f(t)||d(t,e)||c(t,e)||s()}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,e){if(!t)return;if(typeof t==="string")return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(t,e)}function l(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function d(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function f(t){if(Array.isArray(t))return t}var p=(0,n.createContext)(null);var v=function t(){var e=(0,n.useContext)(p);if(!e){throw new Error("useQuizModalContext must be used within a QuizModalContextProvider")}return e};var h=function t(e){var r=e.children,o=e.quizId,s=e.contentType,c=e.validationError;var l=(0,n.useState)(""),d=u(l,2),f=d[0],v=d[1];var h=(0,i.Gc)();var y=h.watch("questions")||[];var _=(0,n.useRef)(y);var m=(0,n.useState)(c||null),g=u(m,2),b=g[0],w=g[1];var Z=y.findIndex((function(t){return t.question_id===f}));(0,n.useEffect)((function(){if(y.length===0){v("")}else if(_.current.length!==0&&_.current.length<y.length){var t=y.find((function(t){return!_.current.some((function(e){return String(e.question_id)===String(t.question_id)}))}));v((t===null||t===void 0?void 0:t.question_id)||"")}else if(Z===-1){v(y[0].question_id)}_.current=y}),[y.length]);(0,n.useEffect)((function(){if(Z===-1&&f){v("")}}),[Z,f]);return(0,a.tZ)(p.Provider,{value:{activeQuestionIndex:Z,activeQuestionId:f,setActiveQuestionId:v,quizId:o,validationError:b,setValidationError:w,contentType:s}},typeof r==="function"?r({activeQuestionIndex:Z,activeQuestionId:f,setActiveQuestionId:v,setValidationError:w}):r)}},9500:(t,e,r)=>{r.r(e);r.d(e,{default:()=>Ia});var n=r(9752);var o=r(2339);var i=r(5587);var a=r(917);var u=r(8003);var s=r(7363);var c=r(1533);var l=r(9250);var d=r(74);var f=r(5033);var p=r(6595);var v=r(96);var h=r(4285);var y=r(2329);var _=r(7536);var m=r(2798);var g=r(3389);var b=r(9592);var w=r(4900);var Z=r(8877);var x=r(9612);var q=r(7619);var O=r(932);var S=r(7100);var j=r(202);var k=r(7941);var E=r(5453);var P=r(9768);var T=r(1162);var I=r(8777);var z=r(6764);var A=r(9528);var C=r(178);var L=r(6413);var D=r(1537);var W=r(5460);var Q=r(5589);var N=r(7034);var J=r(2377);var F=r(5219);var B=r(9169);var R=r(8305);var G=r(7363);function M(t){"@babel/helpers - typeof";return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function V(){V=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return V.apply(this,arguments)}function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?U(Object(r),!0).forEach((function(e){Y(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Y(t,e,r){e=$(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function $(t){var e=K(t,"string");return M(e)==="symbol"?e:String(e)}function K(t,e){if(M(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(M(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function X(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */X=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function t(e,r,n){return e[r]=n}}function c(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),u=new O(o||[]);return n(a,"_invoke",{value:w(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var d={};function f(){}function p(){}function v(){}var h={};s(h,i,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(S([])));_&&_!==e&&r.call(_,i)&&(h=_);var m=v.prototype=f.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,u){var s=l(t[n],t,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==M(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(d).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(s.arg)}var i;n(this,"_invoke",{value:function t(r,n){function a(){return new e((function(t,e){o(r,n,t,e)}))}return i=i?i.then(a,a):a()}})}function w(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=Z(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function Z(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,Z(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:undefined,done:!0}}return p.prototype=v,n(m,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:p,configurable:!0}),p.displayName=s(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(b.prototype),s(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),s(m,u,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(q),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),d},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),d}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;q(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),d}},t}function tt(t,e,r,n,o,i,a){try{var u=t[i](a);var s=u.value}catch(t){r(t);return}if(u.done){e(s)}else{Promise.resolve(s).then(n,o)}}function et(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){tt(i,n,o,a,u,"next",t)}function u(t){tt(i,n,o,a,u,"throw",t)}a(undefined)}))}}var rt=(0,N.zs)();var nt=[{label:(0,u.__)("Weeks","tutor"),value:"weeks"},{label:(0,u.__)("Days","tutor"),value:"days"},{label:(0,u.__)("Hours","tutor"),value:"hours"}];var ot=function t(e){var r;var n=e.assignmentId,o=n===void 0?"":n,i=e.topicId,c=e.closeModal,l=e.icon,v=e.title,h=e.subtitle,y=e.contentDripType;var m=!!R.y.tutor_pro_url;var g=((r=R.y.settings)===null||r===void 0?void 0:r.chatgpt_enable)==="on";var b=(0,Q.T3)(o,i);var Z=(0,Q.CR)(rt);var x=(0,j.NL)();var q=b.data;var O=x.getQueryData(["Topic",rt]);var S=(0,J.O)({defaultValues:{title:"",summary:"",attachments:[],time_duration:{value:"0",time:"weeks"},total_mark:10,pass_mark:5,upload_files_limit:1,upload_file_size_limit:2,content_drip_settings:{unlock_date:"",after_xdays_of_enroll:"",prerequisites:[]}},shouldFocusError:true,mode:"onChange"});var D=S.formState.isDirty;(0,s.useEffect)((function(){if(q){var t,e,r;S.reset({title:q.post_title||"",summary:(0,F.qH)(q.post_content)||"",attachments:q.attachments||[],time_duration:{value:q.assignment_option.time_duration.value||"0",time:q.assignment_option.time_duration.time||"weeks"},total_mark:q.assignment_option.total_mark||10,pass_mark:q.assignment_option.pass_mark||5,upload_files_limit:q.assignment_option.upload_files_limit||1,upload_file_size_limit:q.assignment_option.upload_file_size_limit||2,content_drip_settings:{unlock_date:(q===null||q===void 0?void 0:(t=q.content_drip_settings)===null||t===void 0?void 0:t.unlock_date)||"",after_xdays_of_enroll:(q===null||q===void 0?void 0:(e=q.content_drip_settings)===null||e===void 0?void 0:e.after_xdays_of_enroll)||"",prerequisites:(q===null||q===void 0?void 0:(r=q.content_drip_settings)===null||r===void 0?void 0:r.prerequisites)||[]}},{keepDirty:false})}var n=setTimeout((function(){S.setFocus("title")}),0);return function(){clearTimeout(n)}}),[q]);var W=function(){var t=et(X().mark((function t(e){var r,n;return X().wrap((function t(a){while(1)switch(a.prev=a.next){case 0:r=(0,Q.iL)(e,o,i,y);a.next=3;return Z.mutateAsync(r);case 3:n=a.sent;if(n.status_code===200||n.status_code===201){c({action:"CONFIRM"})}case 5:case"end":return a.stop()}}),t)})));return function e(r){return t.apply(this,arguments)}}();return(0,a.tZ)(C.Z,{onClose:function t(){return c({action:"CLOSE"})},icon:D?(0,a.tZ)(p.Z,{name:"warning",width:24,height:24}):l,title:D?(0,u.__)("Unsaved Changes","tutor"):v,subtitle:h,maxWidth:1070,actions:D&&(0,a.tZ)(G.Fragment,null,(0,a.tZ)(d.Z,{variant:"text",size:"small",onClick:function t(){o?S.reset():c({action:"CLOSE"})}},o?(0,u.__)("Discard Changes","tutor"):(0,u.__)("Cancel","tutor")),(0,a.tZ)(d.Z,{loading:Z.isPending,variant:"primary",size:"small",onClick:S.handleSubmit(W)},o?(0,u.__)("Update","tutor"):(0,u.__)("Save","tutor")))},(0,a.tZ)("div",{css:at.wrapper},(0,a.tZ)(w.Z,{when:!b.isLoading,fallback:(0,a.tZ)(f.fz,null)},(0,a.tZ)("div",null,(0,a.tZ)("div",{css:at.assignmentInfo},(0,a.tZ)(_.Qr,{name:"title",control:S.control,rules:H({required:(0,u.__)("Assignment title is required","tutor")},(0,B.T9)(255)),render:function t(e){return(0,a.tZ)(P.Z,V({},e,{label:(0,u.__)("Title","tutor"),placeholder:(0,u.__)("Enter Assignment Title","tutor"),generateWithAi:!m||g,isClearable:true,selectOnFocus:true}))}}),(0,a.tZ)(_.Qr,{name:"summary",control:S.control,render:function t(e){return(0,a.tZ)(A.Z,V({},e,{label:(0,u.__)("Content","tutor"),placeholder:(0,u.__)("Enter Assignment Content","tutor"),generateWithAi:!m||g}))}}))),(0,a.tZ)("div",{css:at.rightPanel},(0,a.tZ)(_.Qr,{name:"attachments",control:S.control,render:function t(e){return(0,a.tZ)(E.Z,V({},e,{label:(0,u.__)("Attachments","tutor"),buttonText:(0,u.__)("Upload Attachment","tutor"),selectMultiple:true}))}}),(0,a.tZ)(w.Z,{when:(0,N.ro)(L.AO.CONTENT_DRIP)},(0,a.tZ)(w.Z,{when:y==="specific_days"},(0,a.tZ)(_.Qr,{name:"content_drip_settings.after_xdays_of_enroll",control:S.control,render:function t(e){return(0,a.tZ)(P.Z,V({},e,{type:"number",label:(0,a.tZ)("div",{css:at.contentDripLabel},(0,a.tZ)(p.Z,{name:"contentDrip",height:24,width:24}),(0,u.__)("Available after days","tutor")),helpText:(0,u.__)("This assignment will be available after the given number of days.","tutor"),placeholder:"0",selectOnFocus:true}))}})),(0,a.tZ)(w.Z,{when:y==="unlock_by_date"},(0,a.tZ)(_.Qr,{name:"content_drip_settings.unlock_date",control:S.control,render:function t(e){return(0,a.tZ)(k.Z,V({},e,{label:(0,a.tZ)("div",{css:at.contentDripLabel},(0,a.tZ)(p.Z,{name:"contentDrip",height:24,width:24}),(0,u.__)("Unlock Date","tutor")),placeholder:(0,u.__)("Select Unlock Date","tutor"),helpText:(0,u.__)("This assignment will be available from the given date. Leave empty to make it available immediately.","tutor")}))}})),(0,a.tZ)(w.Z,{when:y==="after_finishing_prerequisites"},(0,a.tZ)(_.Qr,{name:"content_drip_settings.prerequisites",control:S.control,render:function t(e){return(0,a.tZ)(z.Z,V({},e,{label:(0,a.tZ)("div",{css:at.contentDripLabel},(0,a.tZ)(p.Z,{name:"contentDrip",height:24,width:24}),(0,u.__)("Prerequisites","tutor")),placeholder:(0,u.__)("Select Prerequisite","tutor"),options:O.reduce((function(t,e){if(e.id===i){t.push(H(H({},e),{},{contents:e.contents.filter((function(t){return t.ID!==o}))}))}else{t.push(e)}return t}),[])||[],isSearchable:true,helpText:(0,u.__)("Select items that should be complete before this item","tutor")}))}}))),(0,a.tZ)("div",{css:at.timeLimit},(0,a.tZ)(_.Qr,{name:"time_duration.value",control:S.control,render:function t(e){return(0,a.tZ)(P.Z,V({},e,{type:"number",label:(0,u.__)("Time Limit","tutor"),placeholder:"0",dataAttribute:"data-time-limit",selectOnFocus:true}))}}),(0,a.tZ)(_.Qr,{name:"time_duration.time",control:S.control,render:function t(e){return(0,a.tZ)(I.Z,V({},e,{options:nt,removeOptionsMinWidth:true,dataAttribute:"data-time-limit-unit"}))}})),(0,a.tZ)(_.Qr,{name:"total_mark",control:S.control,render:function t(e){return(0,a.tZ)(P.Z,V({},e,{type:"number",label:(0,u.__)("Total Points","tutor"),placeholder:"0",selectOnFocus:true}))}}),(0,a.tZ)(_.Qr,{name:"pass_mark",control:S.control,rules:{validate:function t(e){if(Number(e)>Number(S.getValues("total_mark"))){return(0,u.__)("Pass mark cannot be greater than total mark","tutor")}return true}},render:function t(e){return(0,a.tZ)(P.Z,V({},e,{type:"number",label:(0,u.__)("Minimum Pass Points","tutor"),placeholder:"0",selectOnFocus:true}))}}),(0,a.tZ)(_.Qr,{name:"upload_files_limit",control:S.control,render:function t(e){return(0,a.tZ)(P.Z,V({},e,{placeholder:"0",type:"number",label:(0,u.__)("File Upload Limit","tutor"),helpText:(0,u.__)("Define the number of files that a student can upload in this assignment. Input 0 to disable the option to upload.","tutor"),selectOnFocus:true}))}}),(0,a.tZ)(_.Qr,{name:"upload_file_size_limit",control:S.control,render:function t(e){return(0,a.tZ)(T.Z,V({},e,{type:"number",label:(0,u.__)("Maximum File Size Limit","tutor"),placeholder:"0",content:(0,u.__)("MB","tutor"),contentPosition:"right"}))}})))))};const it=ot;var at={wrapper:(0,a.iv)("width:1070px;margin:0 auto;display:grid;grid-template-columns:1fr 338px;height:100%;padding-inline:",D.W0[32],";"+(true?"":0),true?"":0),assignmentInfo:(0,a.iv)("padding-block:",D.W0[24],";padding-right:",D.W0[32],";display:flex;flex-direction:column;gap:",D.W0[24],";position:sticky;top:0;z-index:",D.W5.positive,";"+(true?"":0),true?"":0),rightPanel:(0,a.iv)("border-left:1px solid ",D.Jv.stroke.divider,";display:flex;flex-direction:column;gap:",D.W0[16],";padding-block:",D.W0[24],";padding-left:",D.W0[32],";"+(true?"":0),true?"":0),timeLimit:(0,a.iv)("display:grid;align-items:end;grid-template-columns:1fr 100px;& input{border:1px solid ",D.Jv.stroke["default"],";&[data-time-limit]{border-radius:",D.E0[6]," 0 0 ",D.E0[6],";border-right:none;&:focus{border-right:1px solid ",D.Jv.stroke["default"],";z-index:",D.W5.positive,";}}&[data-time-limit-unit]{border-radius:0 ",D.E0[6]," ",D.E0[6]," 0;}}"+(true?"":0),true?"":0),uploadAttachment:(0,a.iv)("display:flex;flex-direction:column;gap:",D.W0[8],";"+(true?"":0),true?"":0),uploadLabel:(0,a.iv)(W.c.body()," color:",D.Jv.text.title,";"+(true?"":0),true?"":0),contentDripLabel:(0,a.iv)("display:flex;align-items:center;svg{margin-right:",D.W0[4],";color:",D.Jv.icon.success,";}"+(true?"":0),true?"":0)};var ut=r(5043);var st=r(4857);var ct=r(5216);var lt=r(4436);var dt=r(9546);var ft=r(1060);var pt=r(5056);var vt=r(6074);var ht=r(5130);var yt=r(5340);var _t=r(125);function mt(){mt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return mt.apply(this,arguments)}function gt(t){return Zt(t)||wt(t)||Ot(t)||bt()}function bt(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function wt(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Zt(t){if(Array.isArray(t))return St(t)}function xt(t,e){return kt(t)||jt(t,e)||Ot(t,e)||qt()}function qt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ot(t,e){if(!t)return;if(typeof t==="string")return St(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return St(t,e)}function St(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function jt(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function kt(t){if(Array.isArray(t))return t}function Et(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Pt=function t(e){var r=e.title,n=e.closeModal,o=e.onAddContent,i=e.contentType,c=e.addedContentIds,l=c===void 0?[]:c;var f=(0,J.O)({defaultValues:{search:""}});var v=(0,yt.N)(f.watch("search"),300);var h=(0,ht.HD)(v,i);var y=(0,Q.ri)(v,i);var m=(0,s.useState)([]),g=xt(m,2),b=g[0],Z=g[1];var x=i==="tutor_h5p_quiz"?h.data:y.data;var q=x===null||x===void 0?void 0:x.output.filter((function(t){return!l.includes(String(t.id))}));var O=[{Header:(0,a.tZ)("div",{"data-index":true,css:It.tableLabel},q!==null&&q!==void 0&&q.length?(0,a.tZ)(vt.Z,{onChange:function t(e){if(e){Z((q===null||q===void 0?void 0:q.filter((function(t){return!l.includes(String(t.id))})))||[])}else{Z([])}},checked:b.length===((q===null||q===void 0?void 0:q.filter((function(t){return!l.includes(String(t.id))})))||[]).length,isIndeterminate:b.length>0&&b.length<((q===null||q===void 0?void 0:q.filter((function(t){return!l.includes(String(t.id))})))||[]).length}):"#"),Cell:function t(e,r){return(0,a.tZ)("div",{css:W.c.caption()},(0,a.tZ)(vt.Z,{onChange:function t(r){if(r){Z([].concat(gt(b),[e]))}else{Z(b.filter((function(t){return t.id!==e.id})))}},checked:b.map((function(t){return t.id})).includes(e.id)&&!l.includes(String(e.id))}))}},{Header:(0,a.tZ)("div",{css:It.tableLabel},(0,u.__)("Title","tutor")),Cell:function t(e){return(0,a.tZ)("div",{css:It.title},e.title)}},{Header:(0,a.tZ)("div",{css:It.tableLabel},(0,u.__)("Content Type","tutor")),Cell:function t(e){return(0,a.tZ)("div",{css:W.c.caption()},e.content_type)}},{Header:(0,a.tZ)("div",{css:It.tableLabel},(0,u.__)("Created At","tutor")),Cell:function t(e){return(0,a.tZ)("div",{css:W.c.caption()},(0,dt["default"])(new Date(e.updated_at),L.E_.yearMonthDayHourMinuteSecond))}}];(0,s.useEffect)((function(){document.body.style.overflow="hidden";return function(){document.body.style.overflow="auto"}}),[]);return(0,a.tZ)(pt.Z,{title:b.length>0?(0,u.sprintf)((0,u.__)("%s  selected","tutor"),b.length):r,onClose:function t(){return n({action:"CLOSE"})}},(0,a.tZ)("div",{css:It.modalWrapper},(0,a.tZ)("div",{css:It.searchWrapper},(0,a.tZ)(_.Qr,{control:f.control,name:"search",render:function t(e){return(0,a.tZ)(T.Z,mt({},e,{placeholder:(0,u.__)("Search by title","tutor"),showVerticalBar:false,content:(0,a.tZ)(p.Z,{name:"search",width:24,height:24})}))}})),(0,a.tZ)("div",{css:It.tableWrapper},(0,a.tZ)(ft.Z,{columns:O,data:q||[],loading:h.isLoading||y.isLoading})),(0,a.tZ)(w.Z,{when:q===null||q===void 0?void 0:q.length},(0,a.tZ)("div",{css:It.footer},(0,a.tZ)(d.Z,{size:"small",variant:"text",onClick:function t(){return n({action:"CLOSE"})}},(0,u.__)("Cancel","tutor")),(0,a.tZ)(d.Z,{type:"submit",size:"small",variant:"primary",onClick:function t(){o(b);n({action:"CONFIRM"})},disabled:!b.length},(0,u.__)("Add","tutor"))))))};const Tt=Pt;var It={modalWrapper:true?{name:"tc3qxv",styles:"width:920px"}:0,searchWrapper:(0,a.iv)("display:flex;padding:",D.W0[20],";"+(true?"":0),true?"":0),tableWrapper:(0,a.iv)("max-height:calc(100vh - 350px);overflow:auto;tr{td:first-of-type{padding-left:",D.W0[20],";}td:last-of-type{padding-right:",D.W0[20],";}}"+(true?"":0),true?"":0),tableLabel:(0,a.iv)(W.c.body("medium"),";text-align:left;color:",D.Jv.text.primary,";&[data-index]{padding-left:",D.W0[4],";}"+(true?"":0),true?"":0),title:(0,a.iv)(_t.i.text.ellipsis(2)," width:100%;text-align:left;",W.c.caption(),";min-width:340px;max-width:400px;"+(true?"":0),true?"":0),footer:(0,a.iv)("box-shadow:",D.AF.dividerTop,";height:56px;display:flex;align-items:center;justify-content:end;gap:",D.W0[16],";padding-inline:",D.W0[16],";"+(true?"":0),true?"":0)};var zt=r(7363);function At(t){"@babel/helpers - typeof";return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function Ct(){Ct=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return Ct.apply(this,arguments)}function Lt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Lt(Object(r),!0).forEach((function(e){Wt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Wt(t,e,r){e=Qt(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function Qt(t){var e=Nt(t,"string");return At(e)==="symbol"?e:String(e)}function Nt(t,e){if(At(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(At(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jt(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Jt=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function t(e,r,n){return e[r]=n}}function c(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),u=new O(o||[]);return n(a,"_invoke",{value:w(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var d={};function f(){}function p(){}function v(){}var h={};s(h,i,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(S([])));_&&_!==e&&r.call(_,i)&&(h=_);var m=v.prototype=f.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,u){var s=l(t[n],t,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==At(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(d).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(s.arg)}var i;n(this,"_invoke",{value:function t(r,n){function a(){return new e((function(t,e){o(r,n,t,e)}))}return i=i?i.then(a,a):a()}})}function w(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=Z(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function Z(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,Z(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:undefined,done:!0}}return p.prototype=v,n(m,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:p,configurable:!0}),p.displayName=s(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(b.prototype),s(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),s(m,u,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(q),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),d},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),d}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;q(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),d}},t}function Ft(t,e,r,n,o,i,a){try{var u=t[i](a);var s=u.value}catch(t){r(t);return}if(u.done){e(s)}else{Promise.resolve(s).then(n,o)}}function Bt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ft(i,n,o,a,u,"next",t)}function u(t){Ft(i,n,o,a,u,"throw",t)}a(undefined)}))}}function Rt(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Gt=(0,N.zs)();var Mt=function t(e){var r,n;var o=e.lessonId,i=o===void 0?"":o,c=e.topicId,l=e.closeModal,v=e.icon,h=e.title,y=e.subtitle,g=e.contentDripType;var Z=!!R.y.tutor_pro_url;var x=((r=R.y.settings)===null||r===void 0?void 0:r.chatgpt_enable)==="on";var q=R.y.enable_lesson_classic_editor==="1";var O=((n=R.y.settings)===null||n===void 0?void 0:n.hide_admin_bar_for_users)==="off";var S=R.y.current_user.roles.includes(L.er.ADMINISTRATOR);var I=R.y.current_user.roles.includes(L.er.TUTOR_INSTRUCTOR);var D=q&&(S||I&&O);var W=(0,Q.yO)(i,c);var G=(0,Q.G4)(Gt);var M=(0,j.NL)();var V=(0,b.d)(),U=V.showModal;var H=W.data;var Y=M.getQueryData(["Topic",Gt]);var $=(0,J.O)({defaultValues:{title:"",description:"",thumbnail:null,tutor_attachments:[],lesson_preview:false,video:null,duration:{hour:0,minute:0,second:0},content_drip_settings:{unlock_date:"",after_xdays_of_enroll:"",prerequisites:[]}},shouldFocusError:true,mode:"onChange"});var K=$.formState.isDirty;(0,s.useEffect)((function(){if(H){var t,e,r,n,o,i;$.reset({title:H.post_title||"",description:(0,F.qH)(H.post_content)||"",thumbnail:{id:H.thumbnail_id?Number(H.thumbnail_id):0,title:"",url:H.thumbnail||""},tutor_attachments:H.attachments||[],lesson_preview:H.is_preview||false,video:H.video||null,duration:{hour:((t=H.video.runtime)===null||t===void 0?void 0:t.hours)||0,minute:((e=H.video.runtime)===null||e===void 0?void 0:e.minutes)||0,second:((r=H.video.runtime)===null||r===void 0?void 0:r.seconds)||0},content_drip_settings:{unlock_date:(H===null||H===void 0?void 0:(n=H.content_drip_settings)===null||n===void 0?void 0:n.unlock_date)||"",after_xdays_of_enroll:(H===null||H===void 0?void 0:(o=H.content_drip_settings)===null||o===void 0?void 0:o.after_xdays_of_enroll)||"",prerequisites:(H===null||H===void 0?void 0:(i=H.content_drip_settings)===null||i===void 0?void 0:i.prerequisites)||[]}})}var a=setTimeout((function(){$.setFocus("title")}),0);return function(){clearTimeout(a)}}),[H]);var X=function(){var t=Bt(Jt().mark((function t(e){var r,n;return Jt().wrap((function t(o){while(1)switch(o.prev=o.next){case 0:r=(0,Q.SF)(e,i,c,g);o.next=3;return G.mutateAsync(r);case 3:n=o.sent;if(n.data){l({action:"CONFIRM"})}case 5:case"end":return o.stop()}}),t)})));return function e(r){return t.apply(this,arguments)}}();return(0,a.tZ)(C.Z,{onClose:function t(){return l({action:"CLOSE"})},icon:K?(0,a.tZ)(p.Z,{name:"warning",width:24,height:24}):v,title:K?(0,u.__)("Unsaved Changes","tutor"):h,subtitle:y,maxWidth:1070,actions:K&&(0,a.tZ)(zt.Fragment,null,(0,a.tZ)(d.Z,{variant:"text",size:"small",onClick:function t(){i?$.reset():l({action:"CLOSE"})}},i?(0,u.__)("Discard Changes","tutor"):(0,u.__)("Cancel","tutor")),(0,a.tZ)(d.Z,{loading:G.isPending,variant:"primary",size:"small",onClick:$.handleSubmit(X)},i?(0,u.__)("Update","tutor"):(0,u.__)("Save","tutor")))},(0,a.tZ)("div",{css:Ut.wrapper},(0,a.tZ)(w.Z,{when:!W.isLoading,fallback:(0,a.tZ)(f.fz,null)},(0,a.tZ)("div",null,(0,a.tZ)("div",{css:Ut.lessonInfo},(0,a.tZ)(_.Qr,{name:"title",control:$.control,rules:Dt({required:(0,u.__)("Lesson title is required.","tutor")},(0,B.T9)(255)),render:function t(e){return(0,a.tZ)(P.Z,Ct({},e,{label:(0,u.__)("Name","tutor"),placeholder:(0,u.__)("Enter Lesson Name","tutor"),generateWithAi:!Z||x,selectOnFocus:true,isClearable:true}))}}),(0,a.tZ)("div",{css:Ut.description},(0,a.tZ)(_.Qr,{name:"description",control:$.control,render:function t(e){return(0,a.tZ)(A.Z,Ct({},e,{label:(0,a.tZ)("div",{css:Ut.descriptionLabel},(0,u.__)("Content","tutor"),(0,a.tZ)(w.Z,{when:D},(0,a.tZ)(ut.Z,{content:(0,u.__)("Save the lesson first to use the WP Editor.","tutor"),delay:200,disabled:!!i},(0,a.tZ)(d.Z,{variant:"text",size:"small",onClick:function t(){window.open("".concat(R.y.home_url,"/wp-admin/post.php?post=").concat(i,"&action=edit"),"_blank","noopener")},icon:(0,a.tZ)(p.Z,{name:"edit",width:24,height:24}),buttonCss:Ut.wpEditorButton,disabled:!i},(0,u.__)("WP Editor","tutor"))))),placeholder:(0,u.__)("Enter Lesson Description","tutor"),generateWithAi:!Z||x}))}}),(0,a.tZ)(w.Z,{when:Z&&(0,N.ro)(L.AO.H5P_INTEGRATION),fallback:(0,a.tZ)(w.Z,{when:!Z},(0,a.tZ)("div",{css:Ut.addH5PContentWrapper},(0,a.tZ)(m.Z,null,(0,a.tZ)("button",{css:Ut.addH5PContentButton,type:"button",disabled:true,onClick:F.ZT},(0,u.__)("Add H5P Content","tutor")))))},(0,a.tZ)("button",{css:Ut.addH5PContentButton,type:"button",onClick:function t(){U({component:Tt,props:{title:(0,u.__)("Select H5P Content","tutor"),onAddContent:function t(e){var r=function t(e){return'[h5p id="'.concat(e.id,'"]')};var n=$.getValues("description");var o=e.map(r);$.setValue("description","".concat(n,"\n").concat(o.join("\n")),{shouldDirty:true})},contentType:"lesson",addedContentIds:function(){var t=$.getValues("description");var e=t.match(/\[h5p id="(\d+)"\]/g)||[];return e.map((function(t){var e;var r=((e=t.match(/\[h5p id="(\d+)"\]/))===null||e===void 0?void 0:e[1])||"";return String(r)}))}()}})}},(0,u.__)("Add H5P Content","tutor")))))),(0,a.tZ)("div",{css:Ut.rightPanel},(0,a.tZ)(_.Qr,{name:"thumbnail",control:$.control,render:function t(e){return(0,a.tZ)(st.Z,Ct({},e,{label:(0,u.__)("Featured Image","tutor"),buttonText:(0,u.__)("Upload Image","tutor"),infoText:(0,u.sprintf)((0,u.__)("JPEG, PNG, GIF, and WebP formats, up to %s","tutor"),R.y.max_upload_size)}))}}),(0,a.tZ)(_.Qr,{name:"video",control:$.control,render:function t(e){return(0,a.tZ)(lt.Z,Ct({},e,{label:(0,u.__)("Video","tutor"),buttonText:(0,u.__)("Upload Video","tutor"),infoText:(0,u.sprintf)((0,u.__)("MP4, and WebM formats, up to %s","tutor"),R.y.max_upload_size),supportedFormats:["mp4","webm"],onGetDuration:function t(e){$.setValue("duration.hour",e.hours);$.setValue("duration.minute",e.minutes);$.setValue("duration.second",e.seconds)}}))}}),(0,a.tZ)("div",{css:Ut.durationWrapper},(0,a.tZ)("span",{css:Ut.additionLabel},(0,u.__)("Video Playback Time","tutor")),(0,a.tZ)("div",{css:Ut.duration},(0,a.tZ)(_.Qr,{name:"duration.hour",control:$.control,render:function t(e){return(0,a.tZ)(T.Z,Ct({},e,{type:"number",content:(0,a.tZ)("span",{css:Ut.durationContent},(0,u.__)("hour","tutor")),contentPosition:"right",placeholder:"0",showVerticalBar:false}))}}),(0,a.tZ)(_.Qr,{name:"duration.minute",control:$.control,render:function t(e){return(0,a.tZ)(T.Z,Ct({},e,{type:"number",content:(0,a.tZ)("span",{css:Ut.durationContent},(0,u.__)("min","tutor")),contentPosition:"right",placeholder:"0",showVerticalBar:false}))}}),(0,a.tZ)(_.Qr,{name:"duration.second",control:$.control,render:function t(e){return(0,a.tZ)(T.Z,Ct({},e,{type:"number",content:(0,a.tZ)("span",{css:Ut.durationContent},(0,u.__)("sec","tutor")),contentPosition:"right",placeholder:"0",showVerticalBar:false}))}}))),(0,a.tZ)(w.Z,{when:(0,N.ro)(L.AO.CONTENT_DRIP)},(0,a.tZ)(w.Z,{when:g==="specific_days"},(0,a.tZ)(_.Qr,{name:"content_drip_settings.after_xdays_of_enroll",control:$.control,render:function t(e){return(0,a.tZ)(P.Z,Ct({},e,{type:"number",label:(0,a.tZ)("div",{css:Ut.contentDripLabel},(0,a.tZ)(p.Z,{name:"contentDrip",height:24,width:24}),(0,u.__)("Available after days","tutor")),helpText:(0,u.__)("This lesson will be available after the given number of days.","tutor"),placeholder:"0",selectOnFocus:true}))}})),(0,a.tZ)(w.Z,{when:g==="unlock_by_date"},(0,a.tZ)(_.Qr,{name:"content_drip_settings.unlock_date",control:$.control,render:function t(e){return(0,a.tZ)(k.Z,Ct({},e,{label:(0,a.tZ)("div",{css:Ut.contentDripLabel},(0,a.tZ)(p.Z,{name:"contentDrip",height:24,width:24}),(0,u.__)("Unlock Date","tutor")),placeholder:(0,u.__)("Select Unlock Date","tutor"),helpText:(0,u.__)("This lesson will be available from the given date. Leave empty to make it available immediately.","tutor")}))}})),(0,a.tZ)(w.Z,{when:g==="after_finishing_prerequisites"},(0,a.tZ)(_.Qr,{name:"content_drip_settings.prerequisites",control:$.control,render:function t(e){return(0,a.tZ)(z.Z,Ct({},e,{label:(0,a.tZ)("div",{css:Ut.contentDripLabel},(0,a.tZ)(p.Z,{name:"contentDrip",height:24,width:24}),(0,u.__)("Prerequisites","tutor")),placeholder:(0,u.__)("Select Prerequisite","tutor"),options:Y.reduce((function(t,e){if(e.id===c){t.push(Dt(Dt({},e),{},{contents:e.contents.filter((function(t){return t.ID!==i}))}))}else{t.push(e)}return t}),[])||[],isSearchable:true,helpText:(0,u.__)("Select items that should be complete before this item","tutor")}))}}))),(0,a.tZ)(_.Qr,{name:"tutor_attachments",control:$.control,render:function t(e){return(0,a.tZ)(E.Z,Ct({},e,{label:(0,u.__)("Exercise Files","tutor"),buttonText:(0,u.__)("Upload Attachment","tutor"),selectMultiple:true}))}}),(0,a.tZ)(w.Z,{when:!Z||(0,N.ro)(L.AO.TUTOR_COURSE_PREVIEW)},(0,a.tZ)("div",{css:Ut.lessonPreview},(0,a.tZ)(_.Qr,{name:"lesson_preview",control:$.control,render:function t(e){return(0,a.tZ)(ct.Z,Ct({},e,{disabled:!Z,label:(0,a.tZ)("div",{css:Ut.previewLabel},(0,u.__)("Lesson Preview","tutor"),!Z&&(0,a.tZ)(m.Z,{size:"small",content:(0,u.__)("Pro","tutor")})),helpText:(0,u.__)("If checked, any user/guest can view this lesson without enrolling in the course.","tutor")}))}}),(0,a.tZ)(w.Z,{when:$.watch("lesson_preview")},(0,a.tZ)("div",{css:Ut.previewInfo},(0,u.__)("This lesson is now available for preview. Users and guests can view it without enrolling in the course.","tutor")))))))))};const Vt=Mt;var Ut={wrapper:(0,a.iv)("width:1070px;margin:0 auto;display:grid;grid-template-columns:1fr 338px;height:100%;padding-inline:",D.W0[32],";"+(true?"":0),true?"":0),lessonInfo:(0,a.iv)("padding-block:",D.W0[20],";padding-right:",D.W0[32],";display:flex;flex-direction:column;gap:",D.W0[24],";position:sticky;top:0;z-index:",D.W5.positive,";"+(true?"":0),true?"":0),description:true?{name:"bjn8wh",styles:"position:relative"}:0,descriptionLabel:true?{name:"188e2n4",styles:"display:flex;align-items:center;justify-content:space-between;height:32px"}:0,addH5PContentWrapper:true?{name:"1mlusth",styles:"position:absolute;top:36px;left:110px"}:0,addH5PContentButton:(0,a.iv)("position:absolute;top:36px;left:110px;display:inline-block;text-decoration:none;font-size:13px;line-height:2.15384615;min-height:30px;margin:0;padding:0 10px;cursor:pointer;border:1px solid #3e64de;border-radius:3px;white-space:nowrap;box-sizing:border-box;color:#3e64de;border-color:#3e64de;background:transparent;:hover:not(:disabled){background:",D.Jv.background.white,";}:disabled{cursor:not-allowed;position:relative;top:auto;left:auto;opacity:0.5;}"+(true?"":0),true?"":0),rightPanel:(0,a.iv)("border-left:1px solid ",D.Jv.stroke.divider,";display:flex;flex-direction:column;gap:",D.W0[16],";padding-block:",D.W0[20],";padding-left:",D.W0[32],";"+(true?"":0),true?"":0),durationWrapper:(0,a.iv)("display:flex;flex-direction:column;gap:",D.W0[8],";"+(true?"":0),true?"":0),duration:(0,a.iv)("display:flex;align-items:flex-end;gap:",D.W0[8],";"+(true?"":0),true?"":0),durationContent:(0,a.iv)(W.c.small(),";color:",D.Jv.text.hints,";"+(true?"":0),true?"":0),additionLabel:(0,a.iv)(W.c.body()," color:",D.Jv.text.title,";"+(true?"":0),true?"":0),lessonPreview:(0,a.iv)("background-color:",D.Jv.background.white,";padding:",D.W0[12],";border:1px solid ",D.Jv.stroke["default"],";border-radius:",D.E0[8],";"+(true?"":0),true?"":0),previewLabel:(0,a.iv)("display:flex;align-items:center;gap:",D.W0[4],";"+(true?"":0),true?"":0),contentDripLabel:(0,a.iv)("display:flex;align-items:center;svg{margin-right:",D.W0[4],";color:",D.Jv.icon.success,";}"+(true?"":0),true?"":0),previewInfo:(0,a.iv)(W.c.small(),";text-align:center;color:",D.Jv.text.title,";padding:",D.W0[8]," ",D.W0[24],";background:",D.Jv.background.status.success,";border-radius:",D.E0[4],";margin-top:",D.W0[12],";"+(true?"":0),true?"":0),wpEditorButton:(0,a.iv)("margin-left:",D.W0[4],";color:",D.Jv.text.brand,";svg{color:",D.Jv.icon.brand,";}&:hover{text-decoration:underline;color:",D.Jv.text.brand,";}"+(true?"":0),true?"":0)};var Ht=r(8898);var Yt=r(1933);var $t=r(6895);var Kt=r(7301);function Xt(){Xt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return Xt.apply(this,arguments)}function te(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var ee={true_false:{label:(0,u.__)("True/False","tutor"),icon:"quizTrueFalse"},multiple_choice:{label:(0,u.__)("Multiple Choice","tutor"),icon:"quizMultiChoice"},open_ended:{label:(0,u.__)("Open Ended/ Essay","tutor"),icon:"quizEssay"},fill_in_the_blank:{label:(0,u.__)("Fill in the Blanks","tutor"),icon:"quizFillInTheBlanks"},short_answer:{label:(0,u.__)("Short Answer","tutor"),icon:"quizShortAnswer"},matching:{label:(0,u.__)("Matching","tutor"),icon:"quizImageMatching"},image_answering:{label:(0,u.__)("Image Answering","tutor"),icon:"quizImageAnswer"},ordering:{label:(0,u.__)("Ordering","tutor"),icon:"quizOrdering"},h5p:{label:(0,u.__)("H5P","tutor"),icon:"quizTrueFalse"}};var re=true?{name:"z33n32",styles:"max-width:80px"}:0;var ne=function t(){var e=(0,Kt.S)(),r=e.activeQuestionIndex,n=e.activeQuestionId;var o=(0,_.Gc)();var i=o.watch("questions.".concat(r,".question_type"));var s=o.watch("questions.".concat(r,"._data_status"));if(!n){return(0,a.tZ)("p",{css:ie.emptyQuestions},(0,u.__)("Create/Select a question to view details","tutor"))}return(0,a.tZ)("div",{key:"".concat(n,"-").concat(r)},(0,a.tZ)("div",{css:ie.questionTypeWrapper},(0,a.tZ)("div",{css:W.c.caption("medium")},(0,u.__)("Question Type","tutor")),(0,a.tZ)("div",{css:ie.questionType},(0,a.tZ)(p.Z,{name:i?ee[i].icon:"quizTrueFalse",width:32,height:32}),(0,a.tZ)("span",null,i?ee[i].label:""))),(0,a.tZ)("div",{css:ie.conditions},(0,a.tZ)("p",null,(0,u.__)("Conditions:","tutor")),(0,a.tZ)("div",{css:ie.conditionControls},(0,a.tZ)(w.Z,{when:i==="multiple_choice"},(0,a.tZ)(_.Qr,{control:o.control,name:"questions.".concat(r,".question_settings.has_multiple_correct_answer"),render:function t(e){return(0,a.tZ)(ct.Z,Xt({},e,{label:(0,u.__)("Multiple Correct Answer","tutor"),onChange:function t(){(0,ht.JS)(s,"update")&&o.setValue("questions.".concat(r,"._data_status"),(0,ht.JS)(s,"update"))}}))}})),(0,a.tZ)(w.Z,{when:i==="matching"},(0,a.tZ)(_.Qr,{control:o.control,name:"questions.".concat(r,".question_settings.is_image_matching"),render:function t(e){return(0,a.tZ)(ct.Z,Xt({},e,{label:(0,u.__)("Image Matching","tutor"),onChange:function t(){(0,ht.JS)(s,"update")&&o.setValue("questions.".concat(r,"._data_status"),(0,ht.JS)(s,"update"))}}))}})),(0,a.tZ)(_.Qr,{control:o.control,name:"questions.".concat(r,".question_settings.answer_required"),render:function t(e){return(0,a.tZ)(ct.Z,Xt({},e,{label:(0,u.__)("Answer Required","tutor"),onChange:function t(){(0,ht.JS)(s,"update")&&o.setValue("questions.".concat(r,"._data_status"),(0,ht.JS)(s,"update"))}}))}}),(0,a.tZ)(_.Qr,{control:o.control,name:"questions.".concat(r,".question_settings.randomize_options"),render:function t(e){return(0,a.tZ)(ct.Z,Xt({},e,{label:(0,u.__)("Randomize Choice","tutor"),onChange:function t(){(0,ht.JS)(s,"update")&&o.setValue("questions.".concat(r,"._data_status"),(0,ht.JS)(s,"update"))}}))}}),(0,a.tZ)(_.Qr,{control:o.control,name:"questions.".concat(r,".question_settings.question_mark"),rules:{min:0},render:function t(e){return(0,a.tZ)(P.Z,Xt({},e,{label:(0,u.__)("Point For This Question","tutor"),type:"number",isInlineLabel:true,placeholder:"0",selectOnFocus:true,style:re,onChange:function t(){(0,ht.JS)(s,"update")&&o.setValue("questions.".concat(r,"._data_status"),(0,ht.JS)(s,"update"))}}))}}),(0,a.tZ)(_.Qr,{control:o.control,name:"questions.".concat(r,".question_settings.show_question_mark"),render:function t(e){return(0,a.tZ)(ct.Z,Xt({},e,{label:(0,u.__)("Display Points","tutor"),onChange:function t(){(0,ht.JS)(s,"update")&&o.setValue("questions.".concat(r,"._data_status"),(0,ht.JS)(s,"update"))}}))}}))))};const oe=ne;var ie={emptyQuestions:(0,a.iv)("padding:",D.W0[12]," ",D.W0[32]," ",D.W0[24]," ",D.W0[24],";",W.c.caption("medium"),";"+(true?"":0),true?"":0),questionTypeWrapper:(0,a.iv)(_t.i.display.flex("column"),";padding:",D.W0[8]," ",D.W0[32]," ",D.W0[24]," ",D.W0[24],";gap:",D.W0[10],";border-bottom:1px solid ",D.Jv.stroke.divider,";"+(true?"":0),true?"":0),questionType:(0,a.iv)("display:flex;align-items:center;gap:",D.W0[10],";"+(true?"":0),true?"":0),conditions:(0,a.iv)("padding:",D.W0[8]," ",D.W0[32]," ",D.W0[24]," ",D.W0[24],";p{",W.c.body("medium"),";color:",D.Jv.text.primary,";}"+(true?"":0),true?"":0),conditionControls:(0,a.iv)(_t.i.display.flex("column"),";gap:",D.W0[16],";margin-top:",D.W0[16],";"+(true?"":0),true?"":0)};var ae=r(4063);var ue=r(7687);var se=r(8304);var ce=r(4565);var le=r(8945);var de=function t(){var e=(0,_.Gc)();var r=(0,Kt.S)(),n=r.activeQuestionIndex;var o=(0,_.Dq)({control:e.control,name:"questions.".concat(n,".question_answers")}),i=o.fields;return(0,a.tZ)("div",{css:pe.optionWrapper},(0,a.tZ)(_.Qr,{key:i.length?JSON.stringify(i[0]):"",control:e.control,name:"questions.".concat(n,".question_answers.0"),render:function t(e){return(0,a.tZ)(le.Z,e)}}))};const fe=de;var pe={optionWrapper:(0,a.iv)(_t.i.display.flex("column"),";padding-left:",D.W0[40],";"+(true?"":0),true?"":0)};var ve=r(4830);var he=r(7583);function ye(t){"@babel/helpers - typeof";return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(t)}function _e(){_e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return _e.apply(this,arguments)}function me(t){return we(t)||be(t)||Ee(t)||ge()}function ge(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function be(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function we(t){if(Array.isArray(t))return Pe(t)}function Ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ze(Object(r),!0).forEach((function(e){qe(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function qe(t,e,r){e=Oe(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function Oe(t){var e=Se(t,"string");return ye(e)==="symbol"?e:String(e)}function Se(t,e){if(ye(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(ye(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function je(t,e){return Ie(t)||Te(t,e)||Ee(t,e)||ke()}function ke(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ee(t,e){if(!t)return;if(typeof t==="string")return Pe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pe(t,e)}function Pe(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Te(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function Ie(t){if(Array.isArray(t))return t}var ze=function t(){var e=(0,s.useState)(null),r=je(e,2),l=r[0],d=r[1];var f=(0,_.Gc)();var v=(0,Kt.S)(),h=v.activeQuestionIndex,y=v.activeQuestionId,m=v.validationError,g=v.setValidationError;var b=(0,_.Dq)({control:f.control,name:"questions.".concat(h,".question_answers")}),Z=b.fields,x=b.append,q=b.insert,O=b.remove,S=b.move;var j=(0,n.Dy)((0,n.VT)(n.we,{activationConstraint:{distance:10}}),(0,n.VT)(n.Lg,{coordinateGetter:i.is}));var k=(0,s.useMemo)((function(){if(!l){return null}return Z.find((function(t){return t.answer_id===l}))}),[l,Z]);var E=function t(e,r){var n=xe(xe({},r),{},{_data_status:"new",is_saved:true,answer_id:(0,F.x0)(),answer_title:"".concat(r.answer_title," (copy)"),is_correct:"0"});var o=e+1;q(o,n)};var P=function t(e,r){O(e);if(r._data_status!=="new"){f.setValue("deleted_answer_ids",[].concat(me(f.getValues("deleted_answer_ids")),[r.answer_id]))}};return(0,a.tZ)("div",{css:Ce.optionWrapper},(0,a.tZ)(n.LB,{sensors:j,collisionDetection:n.pE,modifiers:[o.hg],onDragStart:function t(e){d(e.active.id)},onDragEnd:function t(e){var r=e.active,n=e.over;if(!n){return}if(r.id!==n.id){var o=Z.findIndex((function(t){return t.answer_id===r.id}));var i=Z.findIndex((function(t){return t.answer_id===n.id}));S(o,i)}d(null)}},(0,a.tZ)(i.Fo,{items:Z.map((function(t){return xe(xe({},t),{},{id:t.answer_id})})),strategy:i.qw},(0,a.tZ)(he.Z,{each:Z},(function(t,e){return(0,a.tZ)(_.Qr,{key:"".concat(t.answer_id,"-").concat(e),control:f.control,name:"questions.".concat(h,".question_answers.").concat(e),render:function r(n){return(0,a.tZ)(ve.Z,_e({},n,{onDuplicateOption:function t(r){return E(e,r)},onRemoveOption:function r(){return P(e,t)},index:e}))}})}))),(0,c.createPortal)((0,a.tZ)(n.y9,null,(0,a.tZ)(w.Z,{when:k},(function(t){var e=Z.findIndex((function(e){return e.answer_id===t.answer_id}));return(0,a.tZ)(_.Qr,{key:l,control:f.control,name:"questions.".concat(h,".question_answers.").concat(e),render:function t(r){return(0,a.tZ)(ve.Z,_e({},r,{onDuplicateOption:F.ZT,onRemoveOption:F.ZT,index:e,isOverlay:true}))}})}))),document.body)),(0,a.tZ)("button",{type:"button",onClick:function t(){x({_data_status:"new",is_saved:false,answer_id:(0,F.x0)(),answer_title:"",is_correct:"0",belongs_question_id:y,belongs_question_type:"image_answering",answer_order:Z.length,answer_two_gap_match:"",answer_view_format:""},{shouldFocus:true,focusName:"questions.".concat(h,".question_answers.").concat(Z.length,".answer_title")});if((m===null||m===void 0?void 0:m.type)==="add_option"){g(null)}},css:Ce.addOptionButton},(0,a.tZ)(p.Z,{name:"plus",height:24,width:24}),(0,u.__)("Add Option","tutor")))};const Ae=ze;var Ce={optionWrapper:(0,a.iv)(_t.i.display.flex("column"),";gap:",D.W0[12],";padding-left:",D.W0[40],";"+(true?"":0),true?"":0),addOptionButton:(0,a.iv)(_t.i.resetButton," ",_t.i.display.flex()," align-items:center;gap:",D.W0[8],";color:",D.Jv.text.brand,";margin-top:",D.W0[28],";margin-left:",D.W0[8],";svg{color:",D.Jv.icon.brand,";}"+(true?"":0),true?"":0)};var Le=r(8931);function De(t){"@babel/helpers - typeof";return De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},De(t)}function We(){We=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return We.apply(this,arguments)}function Qe(t){return Fe(t)||Je(t)||Ye(t)||Ne()}function Ne(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Je(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Fe(t){if(Array.isArray(t))return $e(t)}function Be(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Re(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Be(Object(r),!0).forEach((function(e){Ge(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Be(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ge(t,e,r){e=Me(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function Me(t){var e=Ve(t,"string");return De(e)==="symbol"?e:String(e)}function Ve(t,e){if(De(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(De(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ue(t,e){return Xe(t)||Ke(t,e)||Ye(t,e)||He()}function He(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ye(t,e){if(!t)return;if(typeof t==="string")return $e(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $e(t,e)}function $e(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ke(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function Xe(t){if(Array.isArray(t))return t}var tr=function t(){var e=(0,s.useState)(null),r=Ue(e,2),l=r[0],d=r[1];var f=(0,_.Gc)();var v=(0,Kt.S)(),h=v.activeQuestionIndex,y=v.activeQuestionId,m=v.validationError,g=v.setValidationError;var b=(0,_.Dq)({control:f.control,name:"questions.".concat(h,".question_answers")}),Z=b.fields,x=b.append,q=b.insert,O=b.remove,S=b.move;var j=(0,_.qo)({control:f.control,name:"questions.".concat(h,".question_settings.is_image_matching"),defaultValue:false});var k=(0,n.Dy)((0,n.VT)(n.we,{activationConstraint:{distance:10}}),(0,n.VT)(n.Lg,{coordinateGetter:i.is}));var E=(0,s.useMemo)((function(){if(!l){return null}return Z.find((function(t){return t.answer_id===l}))}),[l,Z]);var P=function t(e,r){var n=Re(Re({},r),{},{_data_status:"new",is_saved:true,answer_id:(0,F.x0)(),answer_title:"".concat(r.answer_title," (copy)"),is_correct:"0"});var o=e+1;q(o,n)};var T=function t(e,r){O(e);if(r._data_status!=="new"){f.setValue("deleted_answer_ids",[].concat(Qe(f.getValues("deleted_answer_ids")),[r.answer_id]))}};return(0,a.tZ)("div",{css:rr.optionWrapper},(0,a.tZ)(n.LB,{sensors:k,collisionDetection:n.pE,modifiers:[o.hg],onDragStart:function t(e){d(e.active.id)},onDragEnd:function t(e){var r=e.active,n=e.over;if(!n){return}if(r.id!==n.id){var o=Z.findIndex((function(t){return t.answer_id===r.id}));var i=Z.findIndex((function(t){return t.answer_id===n.id}));S(o,i)}d(null)}},(0,a.tZ)(i.Fo,{items:Z.map((function(t){return Re(Re({},t),{},{id:t.answer_id})})),strategy:i.qw},(0,a.tZ)(he.Z,{each:Z},(function(t,e){return(0,a.tZ)(_.Qr,{key:"".concat(t.answer_id,"-").concat(e),control:f.control,name:"questions.".concat(h,".question_answers.").concat(e),render:function r(n){return(0,a.tZ)(Le.Z,We({},n,{index:e,onDuplicateOption:function t(r){return P(e,r)},onRemoveOption:function r(){return T(e,t)}}))}})}))),(0,c.createPortal)((0,a.tZ)(n.y9,null,(0,a.tZ)(w.Z,{when:E},(function(t){var e=Z.findIndex((function(e){return e.answer_id===t.answer_id}));return(0,a.tZ)(_.Qr,{key:l,control:f.control,name:"questions.".concat(h,".question_answers.").concat(e),render:function t(r){return(0,a.tZ)(Le.Z,We({},r,{index:e,onDuplicateOption:F.ZT,onRemoveOption:F.ZT,isOverlay:true}))}})}))),document.body)),(0,a.tZ)("button",{type:"button",onClick:function t(){x({_data_status:"new",is_saved:false,answer_id:(0,F.x0)(),answer_title:"",is_correct:"0",belongs_question_id:y,belongs_question_type:j?"image_matching":"matching",answer_order:Z.length,answer_two_gap_match:"",answer_view_format:""},{shouldFocus:true,focusName:"questions.".concat(h,".question_answers.").concat(Z.length,".answer_title")});if((m===null||m===void 0?void 0:m.type)==="add_option"){g(null)}},css:rr.addOptionButton},(0,a.tZ)(p.Z,{name:"plus",height:24,width:24}),(0,u.__)("Add Option","tutor")))};const er=tr;var rr={optionWrapper:(0,a.iv)(_t.i.display.flex("column"),";gap:",D.W0[12],";padding-left:",D.W0[40],";"+(true?"":0),true?"":0),addOptionButton:(0,a.iv)(_t.i.resetButton," ",_t.i.display.flex()," align-items:center;gap:",D.W0[8],";color:",D.Jv.text.brand,";margin-left:",D.W0[8],";margin-top:",D.W0[28],";svg{color:",D.Jv.icon.brand,";}"+(true?"":0),true?"":0)};var nr=r(9642);function or(t){"@babel/helpers - typeof";return or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},or(t)}function ir(){ir=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return ir.apply(this,arguments)}function ar(t){return cr(t)||sr(t)||_r(t)||ur()}function ur(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function sr(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function cr(t){if(Array.isArray(t))return mr(t)}function lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?lr(Object(r),!0).forEach((function(e){fr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function fr(t,e,r){e=pr(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function pr(t){var e=vr(t,"string");return or(e)==="symbol"?e:String(e)}function vr(t,e){if(or(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(or(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hr(t,e){return br(t)||gr(t,e)||_r(t,e)||yr()}function yr(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _r(t,e){if(!t)return;if(typeof t==="string")return mr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mr(t,e)}function mr(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function gr(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function br(t){if(Array.isArray(t))return t}var wr=function t(){var e=(0,s.useRef)(false);var r=(0,s.useState)(null),l=hr(r,2),d=l[0],f=l[1];var v=(0,_.Gc)();var h=(0,Kt.S)(),y=h.activeQuestionIndex,m=h.activeQuestionId,g=h.validationError,b=h.setValidationError;var Z=(0,_.qo)({control:v.control,name:"questions.".concat(y,".question_settings.has_multiple_correct_answer"),defaultValue:false});var x=v.watch("questions.".concat(y,".question_type"));var q=(0,_.Dq)({control:v.control,name:"questions.".concat(y,".question_answers")}),O=q.fields,S=q.append,j=q.insert,k=q.remove,E=q.update,P=q.replace,T=q.move;var I=(0,n.Dy)((0,n.VT)(n.we,{activationConstraint:{distance:10}}),(0,n.VT)(n.Lg,{coordinateGetter:i.is}));var z=(0,_.qo)({control:v.control,name:"questions.".concat(y,".question_answers"),defaultValue:[]});var A=(0,s.useMemo)((function(){if(!d){return null}return O.find((function(t){return t.answer_id===d}))}),[d,O]);var C=function t(e,r){if(Z){E(e,dr(dr(dr({},r),(0,ht.JS)(r._data_status,"update")&&{_data_status:(0,ht.JS)(r._data_status,"update")}),{},{is_correct:r.is_correct==="1"?"0":"1"}))}else{var n=z.map((function(t){return dr(dr(dr({},t),(0,ht.JS)(t._data_status,"update")&&{_data_status:(0,ht.JS)(t._data_status,"update")}),{},{is_correct:t.answer_id===r.answer_id?"1":"0"})}));P(n)}if((g===null||g===void 0?void 0:g.type)==="correct_option"){b(null)}};var L=function t(e,r){var n=dr(dr({},r),{},{_data_status:"new",is_saved:true,answer_id:(0,F.x0)(),answer_title:"".concat(r.answer_title," (copy)"),is_correct:"0"});var o=e+1;j(o,n)};var D=function t(e,r){k(e);if(r._data_status!=="new"){v.setValue("deleted_answer_ids",[].concat(ar(v.getValues("deleted_answer_ids")),[r.answer_id]))}};(0,s.useEffect)((function(){e.current=true;return function(){e.current=false}}),[]);(0,s.useEffect)((function(){if(!Z&&!e.current){var t=z.map((function(t){return dr(dr(dr({},t),(0,ht.JS)(t._data_status,"update")&&{_data_status:(0,ht.JS)(t._data_status,"update")}),{},{is_correct:"0",is_saved:true})}));P(t)}e.current=false}),[Z]);return(0,a.tZ)("div",{css:xr.optionWrapper({currentQuestionType:x})},(0,a.tZ)(n.LB,{sensors:I,collisionDetection:n.pE,modifiers:[o.hg],onDragStart:function t(e){f(e.active.id)},onDragEnd:function t(e){var r=e.active,n=e.over;if(!n){return}if(r.id!==n.id){var o=O.findIndex((function(t){return t.answer_id===r.id}));var i=O.findIndex((function(t){return t.answer_id===n.id}));T(o,i)}f(null)}},(0,a.tZ)(i.Fo,{items:O.map((function(t){return dr(dr({},t),{},{id:t.answer_id})})),strategy:i.qw},(0,a.tZ)(he.Z,{each:O},(function(t,e){return(0,a.tZ)(_.Qr,{key:"".concat(t.answer_id,"-").concat(t.is_correct),control:v.control,name:"questions.".concat(y,".question_answers.").concat(e),render:function r(n){return(0,a.tZ)(nr.Z,ir({},n,{onDuplicateOption:function t(r){return L(e,r)},onRemoveOption:function r(){return D(e,t)},onCheckCorrectAnswer:function r(){return C(e,t)},index:e}))}})}))),(0,c.createPortal)((0,a.tZ)(n.y9,null,(0,a.tZ)(w.Z,{when:A},(function(t){var e=z.findIndex((function(e){return e.answer_id===t.answer_id}));return(0,a.tZ)(_.Qr,{key:d,control:v.control,name:"questions.".concat(y,".question_answers.").concat(e),render:function t(r){return(0,a.tZ)(nr.Z,ir({},r,{onDuplicateOption:F.ZT,onRemoveOption:F.ZT,onCheckCorrectAnswer:F.ZT,index:e,isOverlay:true}))}})}))),document.body)),(0,a.tZ)("button",{type:"button",onClick:function t(){S({_data_status:"new",is_saved:false,answer_id:(0,F.x0)(),answer_title:"",is_correct:"0",belongs_question_id:m,belongs_question_type:x,answer_order:O.length,answer_two_gap_match:"",answer_view_format:"text"},{shouldFocus:true,focusName:"questions.".concat(y,".question_answers.").concat(O.length,".answer_title")});if((g===null||g===void 0?void 0:g.type)==="add_option"){b(null)}},css:xr.addOptionButton({currentQuestionType:x})},(0,a.tZ)(p.Z,{name:"plus",height:24,width:24}),(0,u.__)("Add Option","tutor")))};const Zr=wr;var xr={optionWrapper:function t(e){var r=e.currentQuestionType;return(0,a.iv)(_t.i.display.flex("column"),";gap:",D.W0[12],";",r==="ordering"&&(0,a.iv)("padding-left:",D.W0[40],";"+(true?"":0),true?"":0),";"+(true?"":0),true?"":0)},addOptionButton:function t(e){var r=e.currentQuestionType;return(0,a.iv)(_t.i.resetButton," ",_t.i.display.flex()," align-items:center;gap:",D.W0[8],";color:",D.Jv.text.brand,";margin-left:",D.W0[48],";margin-top:",D.W0[28],";svg{color:",D.Jv.icon.brand,";}",r==="ordering"&&(0,a.iv)("margin-left:",D.W0[8],";"+(true?"":0),true?"":0),";"+(true?"":0),true?"":0)}};var qr=function t(){return(0,a.tZ)("div",{css:Sr.optionWrapper},(0,a.tZ)(ae.Z,{icon:"bulb"},(0,u.__)("No options are necessary for this question type","tutor")))};const Or=qr;var Sr={optionWrapper:(0,a.iv)("padding-left:",D.W0[40],";"+(true?"":0),true?"":0)};var jr=r(6446);function kr(t){"@babel/helpers - typeof";return kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kr(t)}function Er(){Er=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return Er.apply(this,arguments)}function Pr(t,e){var r=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Fr(t))||e&&t&&typeof t.length==="number"){if(r)t=r;var n=0;var o=function t(){};return{s:o,n:function e(){if(n>=t.length)return{done:true};return{done:false,value:t[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=true,a=false,u;return{s:function e(){r=r.call(t)},n:function t(){var e=r.next();i=e.done;return e},e:function t(e){a=true;u=e},f:function t(){try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}}}function Tr(t){return Ar(t)||zr(t)||Fr(t)||Ir()}function Ir(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function zr(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ar(t){if(Array.isArray(t))return Br(t)}function Cr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Lr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Cr(Object(r),!0).forEach((function(e){Dr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Dr(t,e,r){e=Wr(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function Wr(t){var e=Qr(t,"string");return kr(e)==="symbol"?e:String(e)}function Qr(t,e){if(kr(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(kr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Nr(t,e){return Gr(t)||Rr(t,e)||Fr(t,e)||Jr()}function Jr(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Fr(t,e){if(!t)return;if(typeof t==="string")return Br(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Br(t,e)}function Br(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Rr(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function Gr(t){if(Array.isArray(t))return t}var Mr=function t(){var e=(0,s.useState)(null),r=Nr(e,2),u=r[0],l=r[1];var d=(0,_.Gc)();var f=(0,Kt.S)(),p=f.activeQuestionIndex;var v=(0,_.Dq)({control:d.control,name:"questions.".concat(p,".question_answers")}),h=v.fields,y=v.move,m=v.replace;var g=(0,n.Dy)((0,n.VT)(n.we,{activationConstraint:{distance:10}}),(0,n.VT)(n.Lg,{coordinateGetter:i.is}));var b=(0,_.qo)({control:d.control,name:"questions.".concat(p,".question_answers"),defaultValue:[]});var Z=(0,s.useMemo)((function(){if(!u){return null}return h.find((function(t){return t.answer_id===u}))}),[u,h]);var x=function t(e,r){var n=b.map((function(t){return Lr(Lr(Lr({},t),(0,ht.JS)(t._data_status,"update")&&{_data_status:(0,ht.JS)(t._data_status,"update")}),{},{is_correct:t.answer_id===r.answer_id?"1":"0"})}));m(n)};(0,s.useEffect)((function(){var t=b.filter((function(t){var e=h.findIndex((function(e){return e.answer_id===t.answer_id}));var r=h[e]||{};return t.is_correct!==r.is_correct}));if(t.length===0){return}var e=h.findIndex((function(e){return e.answer_id===t[0].answer_id}));var r=Tr(b);r[e]=Object.assign({},r[e],{is_correct:"1"});var n=Pr(r.entries()),o;try{for(n.s();!(o=n.n()).done;){var i=Nr(o.value,2),a=i[0],u=i[1];if(a!==e){r[a]=Lr(Lr(Lr({},u),(0,ht.JS)(u._data_status,"update")&&{_data_status:(0,ht.JS)(u._data_status,"update")}),{},{is_correct:"0"})}}}catch(t){n.e(t)}finally{n.f()}d.setValue("questions.".concat(p,".question_answers"),r)}),[b]);return(0,a.tZ)("div",{css:Ur.optionWrapper},(0,a.tZ)(n.LB,{sensors:g,collisionDetection:n.pE,modifiers:[o.hg],onDragStart:function t(e){l(e.active.id)},onDragEnd:function t(e){var r=e.active,n=e.over;if(!n){return}if(r.id!==n.id){var o=h.findIndex((function(t){return t.answer_id===r.id}));var i=h.findIndex((function(t){return t.answer_id===n.id}));y(o,i)}l(null)}},(0,a.tZ)(i.Fo,{items:h.map((function(t){return Lr(Lr({},t),{},{id:t.answer_id})})),strategy:i.qw},(0,a.tZ)(he.Z,{each:h},(function(t,e){return(0,a.tZ)(_.Qr,{key:"".concat(t.answer_id,"-").concat(t.is_correct),control:d.control,name:"questions.".concat(p,".question_answers.").concat(e),render:function r(n){return(0,a.tZ)(jr.Z,Er({},n,{index:e,onCheckCorrectAnswer:function r(){return x(e,t)}}))}})}))),(0,c.createPortal)((0,a.tZ)(n.y9,null,(0,a.tZ)(w.Z,{when:Z},(function(t){var e=h.findIndex((function(e){return e.answer_id===t.answer_id}));return(0,a.tZ)(_.Qr,{key:u,control:d.control,name:"questions.".concat(p,".question_answers.").concat(e),render:function t(r){return(0,a.tZ)(jr.Z,Er({},r,{index:e,onCheckCorrectAnswer:F.ZT,isOverlay:true}))}})}))),document.body)))};const Vr=Mr;var Ur={optionWrapper:(0,a.iv)(_t.i.display.flex("column"),";gap:",D.W0[12],";"+(true?"":0),true?"":0),option:function t(e){var r=e.isSelected;return(0,a.iv)(_t.i.display.flex(),";",W.c.caption("medium"),";align-items:center;color:",D.Jv.text.subdued,";gap:",D.W0[10],";height:48px;align-items:center;[data-check-icon]{opacity:0;transition:opacity 0.15s ease-in-out;fill:none;flex-shrink:0;}&:hover{[data-check-icon]{opacity:1;}}",r&&(0,a.iv)("[data-check-icon]{opacity:1;color:",D.Jv.bg.success,";}"+(true?"":0),true?"":0),";"+(true?"":0),true?"":0)},optionLabel:function t(e){var r=e.isSelected;return(0,a.iv)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;width:100%;border-radius:",D.E0.card,";padding:",D.W0[12]," ",D.W0[16],";background-color:",D.Jv.background.white,";cursor:pointer;[data-visually-hidden]{opacity:0;}&:hover{box-shadow:0 0 0 1px ",D.Jv.stroke.hover,";[data-visually-hidden]{opacity:1;}}",r&&(0,a.iv)("background-color:",D.Jv.background.success.fill40,";color:",D.Jv.text.primary,";&:hover{box-shadow:0 0 0 1px ",D.Jv.stroke.success.fill70,";}"+(true?"":0),true?"":0),";"+(true?"":0),true?"":0)},optionDragButton:(0,a.iv)(_t.i.resetButton," ",_t.i.flexCenter()," transform:rotate(90deg);color:",D.Jv.icon["default"],";cursor:grab;place-self:center center;"+(true?"":0),true?"":0)};var Hr=r(2460);const Yr=r.p+"images/9e5f8c5e5307063e90cc7f2a55e50d8c-quiz-empty-state-2x.webp";const $r=r.p+"images/bdb31b4692f8bb5ee2633ce7abb0356d-quiz-empty-state.webp";function Kr(){Kr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return Kr.apply(this,arguments)}function Xr(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var tn=!!R.y.tutor_pro_url;var en=function t(){var e=(0,Kt.S)(),r=e.activeQuestionIndex,n=e.activeQuestionId,o=e.validationError,i=e.contentType;var c=(0,Hr.D)(n);var l=(0,_.Gc)();var d=(0,s.useRef)(null);var f=l.watch("questions.".concat(r,".question_type"));var p=l.watch("questions")||[];var v=l.watch("questions.".concat(r,"._data_status"));var h={true_false:(0,a.tZ)(Vr,{key:n}),multiple_choice:(0,a.tZ)(Zr,{key:n}),open_ended:(0,a.tZ)(Or,{key:n}),fill_in_the_blank:(0,a.tZ)(fe,{key:n}),short_answer:(0,a.tZ)(Or,{key:n}),matching:(0,a.tZ)(er,{key:n}),image_answering:(0,a.tZ)(Ae,{key:n}),ordering:(0,a.tZ)(Zr,{key:n})};(0,s.useEffect)((function(){if(o&&d.current){d.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}}),[o]);if(!n&&!l.formState.isLoading&&p.length===0){return(0,a.tZ)("div",{css:nn.emptyState},(0,a.tZ)("img",{css:nn.emptyStateImage,src:$r,srcSet:"".concat($r," 1x, ").concat(Yr," 2x"),alt:""}),(0,a.tZ)("p",{css:nn.emptyStateText},(0,u.__)("Enter a quiz title to begin. Choose from a variety of question types to keep things interesting!","tutor")))}return(0,a.tZ)("div",{key:r,css:nn.questionForm(n===c)},(0,a.tZ)("div",{css:nn.questionWithIndex},(0,a.tZ)("div",{css:nn.questionIndex},r+1,"."),(0,a.tZ)("div",{css:nn.questionTitleAndDesc},(0,a.tZ)(_.Qr,{control:l.control,rules:{required:(0,u.__)("Question title is required","tutor")},name:"questions.".concat(r,".question_title"),render:function t(e){return(0,a.tZ)(ce.Z,Kr({},e,{placeholder:(0,u.__)("Write your question here..","tutor"),disabled:i==="tutor_h5p_quiz",onChange:function t(){(0,ht.JS)(v,"update")&&l.setValue("questions.".concat(r,"._data_status"),(0,ht.JS)(v,"update"))}}))}}),(0,a.tZ)(w.Z,{when:i!=="tutor_h5p_quiz",fallback:(0,a.tZ)("div",null,(0,a.tZ)("div",{css:nn.h5pShortCode},'[h5p id: "'.concat(l.watch("questions.".concat(r,".question_description")),'"]')))},(0,a.tZ)(_.Qr,{control:l.control,name:"questions.".concat(r,".question_description"),render:function t(e){return(0,a.tZ)(se.Z,Kr({},e,{placeholder:(0,u.__)("Description (optional)","tutor"),disabled:i==="tutor_h5p_quiz",onChange:function t(){(0,ht.JS)(v,"update")&&l.setValue("questions.".concat(r,"._data_status"),(0,ht.JS)(v,"update"))}}))}})))),(0,a.tZ)(w.Z,{when:o},(0,a.tZ)("div",{key:Math.random(),ref:d,css:nn.alertWrapper},(0,a.tZ)(ae.Z,{type:"danger",icon:"warning"},o===null||o===void 0?void 0:o.message))),h[f],(0,a.tZ)(w.Z,{when:tn&&f!=="h5p"},(0,a.tZ)("div",{css:nn.questionAnswer},(0,a.tZ)(_.Qr,{control:l.control,name:"questions.".concat(r,".answer_explanation"),render:function t(e){return(0,a.tZ)(ue.Z,Kr({},e,{label:(0,u.__)("Answer Explanation","tutor"),placeholder:(0,u.__)("Write answer explanation...","tutor"),onChange:function t(){(0,ht.JS)(v,"update")&&l.setValue("questions.".concat(r,"._data_status"),(0,ht.JS)(v,"update"))}}))}}))))};const rn=en;var nn={questionForm:function t(e){return(0,a.iv)(_t.i.display.flex("column"),";padding-right:",D.W0[48],";gap:",D.W0[16],";animation:",e?undefined:"fadeIn 0.25s ease-in-out",";@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}"+(true?"":0),true?"":0)},questionWithIndex:(0,a.iv)(_t.i.display.flex("row"),";align-items:flex-start;padding-left:",D.W0[40],";gap:",D.W0[4],";"+(true?"":0),true?"":0),questionIndex:(0,a.iv)("margin-top:",D.W0[10],";",W.c.heading6(),";color:",D.Jv.text.hints,";"+(true?"":0),true?"":0),questionTitleAndDesc:(0,a.iv)(_t.i.display.flex("column"),";gap:",D.W0[8],";width:100%;"+(true?"":0),true?"":0),h5pShortCode:(0,a.iv)("margin-left:",D.W0[8],";padding:",D.W0[4]," ",D.W0[8],";",W.c.caption(),";color:",D.Jv.text.white,";background-color:#2575BE;border-radius:",D.E0.card,";width:fit-content;font-family:'Fire Code',monospace;"+(true?"":0),true?"":0),questionAnswer:(0,a.iv)("padding-left:",D.W0[40],";"+(true?"":0),true?"":0),emptyState:(0,a.iv)(_t.i.flexCenter("column"),";padding-left:",D.W0[40],";padding-right:",D.W0[48],";gap:",D.W0[16],";"+(true?"":0),true?"":0),emptyStateImage:true?{name:"vdj5lp",styles:"width:220px;height:auto"}:0,emptyStateText:(0,a.iv)(W.c.small(),";color:",D.Jv.text.subdued,";text-align:center;max-width:330px;"+(true?"":0),true?"":0),alertWrapper:(0,a.iv)("padding-left:",D.W0[40],";animation:shake 0.3s linear;@keyframes shake{0%{transform:translateX(0);}25%{transform:translateX(-5px);}50%{transform:translateX(5px);}75%{transform:translateX(-5px);}100%{transform:translateX(0);}}"+(true?"":0),true?"":0)};var on=r(3366);var an=r(4215);function un(){un=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return un.apply(this,arguments)}function sn(t,e){return pn(t)||fn(t,e)||ln(t,e)||cn()}function cn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ln(t,e){if(!t)return;if(typeof t==="string")return dn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dn(t,e)}function dn(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function fn(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function pn(t){if(Array.isArray(t))return t}function vn(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var hn={true_false:"quizTrueFalse",multiple_choice:"quizMultiChoice",open_ended:"quizEssay",fill_in_the_blank:"quizFillInTheBlanks",short_answer:"quizShortAnswer",matching:"quizImageMatching",image_answering:"quizImageAnswer",ordering:"quizOrdering",h5p:"quizH5p"};var yn=!!R.y.tutor_pro_url;var _n=function t(e){var r=e.question,n=e.index,o=e.onDuplicateQuestion,c=e.onRemoveQuestion,l=e.isOverlay,d=l===void 0?false:l;var f=(0,Kt.S)(),v=f.activeQuestionIndex,y=f.activeQuestionId,g=f.validationError,b=f.setActiveQuestionId,w=f.setValidationError,Z=f.contentType;var x=(0,_.Gc)();var O=(0,s.useState)(false),S=sn(O,2),j=S[0],k=S[1];var E=(0,s.useRef)(null);var P=(0,i.nB)({id:r.question_id,animateLayoutChanges:an.h}),T=P.attributes,I=P.listeners,z=P.setNodeRef,A=P.transform,C=P.transition,L=P.isDragging;var W={transform:h.ux.Transform.toString(A),transition:C,opacity:L?.3:undefined,background:L?D.Jv.stroke.hover:undefined};(0,s.useEffect)((function(){if(y===r.question_id){var t;(t=E.current)===null||t===void 0?void 0:t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}}),[y,r.question_id]);return(0,a.tZ)("div",un({},T,{key:r.question_id,css:bn.questionItem({isActive:String(y)===String(r.question_id),isDragging:d,isThreeDotsOpen:j}),ref:function t(e){z(e);E.current=e},style:W,tabIndex:-1,onClick:function t(){if(y===r.question_id){return}var e=(0,N.aU)(v,x);if(e!==true){w(e);return}w(null);b(r.question_id)},onKeyDown:function t(e){if(e.key==="Enter"||e.key===" "){if(y===r.question_id){return}var n=(0,N.aU)(v,x);if(n!==true){w(n);return}w(null);b(r.question_id)}}}),(0,a.tZ)("div",{css:bn.iconAndSerial({isDragging:d}),"data-icon-serial":true},(0,a.tZ)("span",{"data-serial":true},n+1),(0,a.tZ)("button",un({"data-drag-icon":true},I,{type:"button",css:_t.i.resetButton}),(0,a.tZ)(p.Z,{"data-drag-icon":true,name:"dragVertical",width:24,height:24})),(0,a.tZ)(p.Z,{name:hn[r.question_type],width:24,height:24,"data-question-icon":true})),(0,a.tZ)("span",{css:bn.questionTitle({isActive:String(y)===String(r.question_id)})},r.question_title),(0,a.tZ)(q.Z,{isOpen:j,onClick:function t(e){e.stopPropagation();var r=(0,N.aU)(v,x);k(true);if(r!==true){w(r)}},animationType:on.ru.slideDown,closePopover:function t(){return k(false)},dotsOrientation:"vertical",maxWidth:yn?"150px":"160px",isInverse:true,arrowPosition:"auto",size:"small",hideArrow:true,"data-three-dots":true},!g&&Z!=="tutor_h5p_quiz"&&(0,a.tZ)(q.Z.Option,{text:(0,a.tZ)("div",{css:bn.duplicate},(0,u.__)("Duplicate","tutor"),!yn&&(0,a.tZ)(m.Z,{size:"small",content:(0,u.__)("Pro","tutor")})),icon:(0,a.tZ)(p.Z,{name:"duplicate",width:24,height:24}),disabled:!yn,onClick:function t(e){e.stopPropagation();o(r);k(false)}}),(0,a.tZ)(q.Z.Option,{isTrash:true,text:(0,u.__)("Delete","tutor"),icon:(0,a.tZ)(p.Z,{name:"delete",width:24,height:24}),onClick:function t(e){e.stopPropagation();c();k(false)}})))};const mn=_n;var gn=true?{name:"1c7c6p3",styles:"[data-three-dots]{opacity:1;}"}:0;var bn={questionItem:function t(e){var r=e.isActive,n=r===void 0?false:r,o=e.isDragging,i=o===void 0?false:o,u=e.isThreeDotsOpen,s=u===void 0?false:u;return(0,a.iv)("padding:",D.W0[10]," ",D.W0[8]," ",D.W0[10]," ",D.W0[28],";display:flex;align-items:center;justify-content:space-between;gap:",D.W0[12],";border-bottom:1px solid ",D.Jv.stroke.divider,";cursor:pointer;transition:border 0.3s ease-in-out,background-color 0.3s ease-in-out;[data-three-dots]{opacity:0;background:transparent;svg{color:",D.Jv.icon["default"],";}}",n&&(0,a.iv)("color:",D.Jv.text.brand,";background-color:",D.Jv.background.white,";[data-icon-serial]{border-top-right-radius:3px;border-bottom-right-radius:3px;border-color:transparent;}"+(true?"":0),true?"":0)," ",s&&gn," :hover{background-color:",D.Jv.background.hover,";[data-serial]{display:none;}[data-drag-icon]{display:block;}[data-icon-serial]{border-top-right-radius:3px;border-bottom-right-radius:3px;border-color:transparent;}[data-three-dots]{opacity:1;}}",i&&(0,a.iv)("box-shadow:",D.AF.drag,";background-color:",D.Jv.background.white,";border-radius:",D.E0.card,";:hover{background-color:",D.Jv.background.white,";}"+(true?"":0),true?"":0),";"+(true?"":0),true?"":0)},iconAndSerial:function t(e){var r=e.isDragging,n=r===void 0?false:r;return(0,a.iv)("display:grid;grid-template-columns:1fr 1fr;align-items:center;border-radius:3px 0 0 3px;width:64px;padding:",D.W0[4]," ",D.W0[8]," ",D.W0[4]," ",D.W0[4],";flex-shrink:0;column-gap:",D.W0[12],";place-items:center center;[data-drag-icon]{display:none;color:",D.Jv.icon.hints,";cursor:",n?"grabbing":"grab",";}[data-question-icon]{flex-shrink:0;}svg{flex-shrink:0;}[data-serial]{width:24px;display:block;",W.c.caption("medium")," text-align:center;flex-grow:1;}"+(true?"":0),true?"":0)},questionTitle:function t(e){var r=e.isActive,n=r===void 0?false:r;return(0,a.iv)(W.c.small(n?"medium":"regular"),";color:",n?D.Jv.text.brand:D.Jv.text.subdued,";flex-grow:1;"+(true?"":0),true?"":0)},duplicate:(0,a.iv)("display:flex;align-items:center;gap:",D.W0[4],";"+(true?"":0),true?"":0)};function wn(t){"@babel/helpers - typeof";return wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(t)}function Zn(t){return On(t)||qn(t)||An(t)||xn()}function xn(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qn(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function On(t){if(Array.isArray(t))return Cn(t)}function Sn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function jn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Sn(Object(r),!0).forEach((function(e){kn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Sn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function kn(t,e,r){e=En(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function En(t){var e=Pn(t,"string");return wn(e)==="symbol"?e:String(e)}function Pn(t,e){if(wn(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(wn(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Tn(t,e){var r=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=An(t))||e&&t&&typeof t.length==="number"){if(r)t=r;var n=0;var o=function t(){};return{s:o,n:function e(){if(n>=t.length)return{done:true};return{done:false,value:t[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=true,a=false,u;return{s:function e(){r=r.call(t)},n:function t(){var e=r.next();i=e.done;return e},e:function t(e){a=true;u=e},f:function t(){try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}}}function In(t,e){return Dn(t)||Ln(t,e)||An(t,e)||zn()}function zn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function An(t,e){if(!t)return;if(typeof t==="string")return Cn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cn(t,e)}function Cn(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ln(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function Dn(t){if(Array.isArray(t))return t}var Wn=[{label:(0,u.__)("True/False","tutor"),value:"true_false",icon:"quizTrueFalse",isPro:false},{label:(0,u.__)("Multiple Choice","tutor"),value:"multiple_choice",icon:"quizMultiChoice",isPro:false},{label:(0,u.__)("Open Ended/ Essay","tutor"),value:"open_ended",icon:"quizEssay",isPro:false},{label:(0,u.__)("Fill in the Blanks","tutor"),value:"fill_in_the_blank",icon:"quizFillInTheBlanks",isPro:false},{label:(0,u.__)("Short Answer","tutor"),value:"short_answer",icon:"quizShortAnswer",isPro:true},{label:(0,u.__)("Matching","tutor"),value:"matching",icon:"quizImageMatching",isPro:true},{label:(0,u.__)("Image Answering","tutor"),value:"image_answering",icon:"quizImageAnswer",isPro:true},{label:(0,u.__)("Ordering","tutor"),value:"ordering",icon:"quizOrdering",isPro:true}];var Qn=!!R.y.tutor_pro_url;var Nn=function t(e){var r=e.isEditing;var l=(0,s.useState)(null),d=In(l,2),f=d[0],v=d[1];var h=(0,s.useState)(false),y=In(h,2),Z=y[0],q=y[1];var O=(0,s.useRef)(null);var S=(0,s.useRef)(null);var j=(0,_.Gc)();var k=(0,Kt.S)(),E=k.contentType,P=k.activeQuestionIndex,T=k.validationError,I=k.setActiveQuestionId,z=k.setValidationError;var A=(0,_.Dq)({control:j.control,name:"questions"}),C=A.remove,L=A.append,D=A.insert,W=A.move,Q=A.fields;var J=(0,g.p)(),B=J.showToast;var R=(0,b.d)(),G=R.showModal;var M=(0,n.Dy)((0,n.VT)(n.we,{activationConstraint:{distance:10}}),(0,n.VT)(n.Lg,{coordinateGetter:i.is}));var V=(0,s.useMemo)((function(){if(!f){return null}return Q.find((function(t){return t.question_id===f}))}),[f,Q]);var U=j.watch("questions")||[];var H=function t(e,r){var n=(0,N.aU)(P,j);if(n!==true){z(n);q(false);return}var o=(0,F.x0)();L({_data_status:"new",question_id:o,question_title:e==="h5p"?r===null||r===void 0?void 0:r.title:"Question ".concat(Q.length+1),question_description:e==="h5p"?r===null||r===void 0?void 0:r.id:"",question_type:e,question_answers:e==="true_false"?[{answer_id:(0,F.x0)(),_data_status:"new",is_saved:true,answer_title:(0,u.__)("True","tutor"),is_correct:"1",answer_order:1,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:o,belongs_question_type:"true_false"},{answer_id:(0,F.x0)(),is_saved:true,_data_status:"new",answer_title:(0,u.__)("False","tutor"),is_correct:"0",answer_order:2,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:o,belongs_question_type:"true_false"}]:e==="fill_in_the_blank"?[{_data_status:"new",is_saved:false,answer_id:(0,F.x0)(),answer_title:"",belongs_question_id:o,belongs_question_type:"fill_in_the_blank",answer_two_gap_match:"",answer_view_format:"",answer_order:0,is_correct:"0"}]:[],answer_explanation:"",question_mark:1,question_order:Q.length+1,question_settings:{answer_required:false,question_mark:E==="tutor_h5p_quiz"?0:1,question_type:e,randomize_options:false,show_question_mark:false}});z(null);I(o);q(false)};var Y=function t(e){var r=Tn(e),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;H("h5p",o)}}catch(t){r.e(t)}finally{r.f()}};var $=function t(e,r){var n=j.watch("questions.".concat(r));if(!n||T){return}var o=jn(jn({},e),{},{question_id:(0,F.x0)(),_data_status:"new",question_title:"".concat(n.question_title," (copy)"),question_answers:n.question_answers.map((function(t){return jn(jn({},t),{},{answer_id:(0,F.x0)(),_data_status:"new"})}))});var i=r+1;D(i,o)};var K=function t(e,r){C(e);if(P===e){I("");z(null)}if(r._data_status!=="new"){j.setValue("deleted_question_ids",[].concat(Zn(j.getValues("deleted_question_ids")),[r.question_id]))}};var X=function t(e){var r=e.active,n=e.over;if(!n||r.id===n.id){return}var o=Q.findIndex((function(t){return t.question_id===r.id}));var i=Q.findIndex((function(t){return t.question_id===n.id}));W(o,i)};(0,s.useEffect)((function(){if(O.current){O.current.style.maxHeight="".concat(window.innerHeight-O.current.getBoundingClientRect().top,"px")}}),[O.current,r]);if(!j.getValues("quiz_title")){return null}return(0,a.tZ)("div",null,(0,a.tZ)("div",{css:Fn.questionsLabel},(0,a.tZ)("span",null,(0,u.__)("Questions","tutor")),(0,a.tZ)("button",{ref:S,type:"button",onClick:function t(){if(E==="tutor_h5p_quiz"){G({component:Tt,props:{title:(0,u.__)("Select H5P Content","tutor"),onAddContent:function t(e){Y(e)},contentType:"tutor_h5p_quiz",addedContentIds:U.map((function(t){return t.question_description}))}})}else{q(true)}}},(0,a.tZ)(p.Z,{name:"plusSquareBrand",width:32,height:32}))),(0,a.tZ)("div",{ref:O,css:Fn.questionList},(0,a.tZ)(w.Z,{when:U.length>0,fallback:(0,a.tZ)("div",{css:Fn.emptyQuestionText},(0,u.__)("No questions added yet.","tutor"))},(0,a.tZ)(n.LB,{sensors:M,collisionDetection:n.pE,modifiers:[o.hg],onDragStart:function t(e){v(e.active.id)},onDragEnd:function t(e){return X(e)}},(0,a.tZ)(i.Fo,{items:U.map((function(t){return jn(jn({},t),{},{id:t.question_id})})),strategy:i.qw},(0,a.tZ)(he.Z,{each:U},(function(t,e){return(0,a.tZ)(mn,{key:t.question_id,question:t,index:e,onDuplicateQuestion:function t(r){$(r,e)},onRemoveQuestion:function r(){return K(e,t)}})}))),(0,c.createPortal)((0,a.tZ)(n.y9,null,(0,a.tZ)(w.Z,{when:V},(function(t){var e=Q.findIndex((function(e){return e.question_id===t.question_id}));return(0,a.tZ)(mn,{key:t.question_id,question:t,index:e,onDuplicateQuestion:F.ZT,onRemoveQuestion:F.ZT,isOverlay:true})}))),document.body))),(0,a.tZ)(x.Z,{gap:4,maxWidth:"240px",arrow:"top",triggerRef:S,isOpen:Z,closePopover:function t(){return q(false)},animationType:on.ru.slideUp},(0,a.tZ)("div",{css:Fn.questionOptionsWrapper},(0,a.tZ)("span",{css:Fn.questionTypeOptionsTitle},(0,u.__)("Select Question Type","tutor")),Wn.map((function(t){return(0,a.tZ)(w.Z,{key:t.value,when:t.isPro&&!Qn,fallback:(0,a.tZ)("button",{key:t.value,type:"button",css:Fn.questionTypeOption,onClick:function e(){H(t.value)}},(0,a.tZ)(p.Z,{name:t.icon,width:24,height:24}),(0,a.tZ)("span",null,t.label))},(0,a.tZ)("button",{key:t.value,type:"button",css:Fn.questionTypeOption,disabled:true,onClick:F.ZT},(0,a.tZ)(p.Z,{"data-question-icon":true,name:t.icon,width:24,height:24}),(0,a.tZ)("span",null,t.label),(0,a.tZ)(m.Z,{size:"small",content:(0,u.__)("Pro","tutor")})))}))))))};const Jn=Nn;var Fn={questionsLabel:(0,a.iv)("display:flex;gap:",D.W0[4],";align-items:center;justify-content:space-between;border-bottom:1px solid ",D.Jv.stroke.divider,";padding:",D.W0[16]," ",D.W0[16]," ",D.W0[16]," ",D.W0[28],";",W.c.caption("medium"),";color:",D.Jv.text.subdued,";button{",_t.i.resetButton,";width:32px;height:32px;svg{color:",D.Jv.action.primary["default"],";width:100%;height:100%;}}"+(true?"":0),true?"":0),questionList:(0,a.iv)(_t.i.overflowYAuto,";scrollbar-gutter:auto;padding:",D.W0[8]," 0 ",D.W0[8]," 0;"+(true?"":0),true?"":0),questionTypeOptionsTitle:(0,a.iv)(W.c.caption("medium"),";color:",D.Jv.text.subdued,";padding:",D.W0[8]," ",D.W0[16]," ",D.W0[8]," ",D.W0[20],";border-bottom:1px solid ",D.Jv.stroke.divider,";"+(true?"":0),true?"":0),questionOptionsWrapper:(0,a.iv)("display:flex;flex-direction:column;padding-block:",D.W0[6],";"+(true?"":0),true?"":0),questionTypeOption:(0,a.iv)(_t.i.resetButton,";width:100%;padding:",D.W0[8]," ",D.W0[16]," ",D.W0[8]," ",D.W0[20],";transition:background-color 0.3s ease-in-out;display:flex;align-items:center;gap:",D.W0[4],";border:2px solid transparent;:disabled{cursor:not-allowed;color:",D.Jv.text.primary,";[data-question-icon]{filter:grayscale(100%);}}:hover:enabled{background-color:",D.Jv.background.hover,";color:",D.Jv.text.title,";}:focus:enabled,:active:enabled{border-color:",D.Jv.stroke.brand,";}"+(true?"":0),true?"":0),emptyQuestionText:(0,a.iv)(W.c.small(),";color:",D.Jv.text.subdued,";padding:",D.W0[8]," ",D.W0[16]," ",D.W0[8]," ",D.W0[28],";"+(true?"":0),true?"":0)};var Bn=r(3224);function Rn(t){"@babel/helpers - typeof";return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rn(t)}function Gn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Mn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gn(Object(r),!0).forEach((function(e){Vn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Vn(t,e,r){e=Un(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function Un(t){var e=Hn(t,"string");return Rn(e)==="symbol"?e:String(e)}function Hn(t,e){if(Rn(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(Rn(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yn(){Yn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return Yn.apply(this,arguments)}var $n=(0,N.zs)();var Kn=function t(e){var r=e.contentDripType;var n=(0,Kt.S)(),o=n.quizId,i=n.contentType;var s=(0,_.Gc)();var c=s.watch("quiz_option.feedback_mode");var l=(0,N.ro)(L.AO.CONTENT_DRIP)&&r==="unlock_sequentially"&&c==="retry";var d=s.watch("quiz_option.content_drip_settings.prerequisites");var f=(0,j.NL)();var v=f.getQueryData(["Topic",$n]);return(0,a.tZ)("div",{css:to.settings},(0,a.tZ)(Bn.Z,{title:(0,u.__)("Basic Settings","tutor"),collapsedAnimationDependencies:[c,d===null||d===void 0?void 0:d.length]},(0,a.tZ)("div",{css:to.formWrapper},(0,a.tZ)(w.Z,{when:i!=="tutor_h5p_quiz"},(0,a.tZ)("div",{css:to.timeWrapper},(0,a.tZ)(_.Qr,{name:"quiz_option.time_limit.time_value",control:s.control,render:function t(e){return(0,a.tZ)(P.Z,Yn({},e,{type:"number",label:(0,u.__)("Time Limit","tutor"),helpText:(0,u.__)("Set a time limit for this quiz. A value of “0” indicates no time limit","tutor"),selectOnFocus:true}))}}),(0,a.tZ)(_.Qr,{name:"quiz_option.time_limit.time_type",control:s.control,render:function t(e){return(0,a.tZ)(I.Z,Yn({},e,{options:[{label:(0,u.__)("Seconds","tutor"),value:"seconds"},{label:(0,u.__)("Minutes","tutor"),value:"minutes"},{label:(0,u.__)("Hours","tutor"),value:"hours"},{label:(0,u.__)("Days","tutor"),value:"days"},{label:(0,u.__)("Weeks","tutor"),value:"weeks"}]}))}}))),(0,a.tZ)(w.Z,{when:i!=="tutor_h5p_quiz"},(0,a.tZ)(_.Qr,{name:"quiz_option.hide_quiz_time_display",control:s.control,render:function t(e){return(0,a.tZ)(ct.Z,Yn({},e,{label:(0,u.__)("Hide Quiz Time","tutor")}))}}),(0,a.tZ)(_.Qr,{name:"quiz_option.feedback_mode",control:s.control,render:function t(e){return(0,a.tZ)(I.Z,Yn({},e,{label:(0,u.__)("Feedback Mode","tutor"),leftIcon:(0,a.tZ)(p.Z,{name:"eye",width:32,height:32}),options:[{label:(0,u.__)("Default","tutor"),value:"default",description:(0,u.__)("Answers are shown after finishing the quiz.","tutor")},{label:(0,u.__)("Reveal Mode","tutor"),value:"reveal",description:(0,u.__)("Show answer after attempting the question.","tutor")},{label:(0,u.__)("Retry","tutor"),value:"retry",description:(0,u.__)("Allows students to retake the quiz after their first attempt.","tutor")}]}))}})),(0,a.tZ)(w.Z,{when:c==="retry"},(0,a.tZ)(_.Qr,{name:"quiz_option.attempts_allowed",control:s.control,rules:{max:20,min:0},render:function t(e){return(0,a.tZ)(P.Z,Yn({},e,{type:"number",label:(0,u.__)("Attempts Allowed","tutor"),helpText:(0,u.__)('Define how many times a student can retake this quiz. Setting it to "0" allows unlimited attempts',"tutor"),selectOnFocus:true}))}})),(0,a.tZ)(w.Z,{when:l&&i!=="tutor_h5p_quiz"},(0,a.tZ)(_.Qr,{name:"quiz_option.pass_is_required",control:s.control,render:function t(e){return(0,a.tZ)(ct.Z,Yn({},e,{label:(0,u.__)("Passing is Required","tutor"),helpText:(0,u.__)("By enabling this option, the student must have to pass it to access the next quiz","tutor")}))}})),(0,a.tZ)(_.Qr,{name:"quiz_option.passing_grade",control:s.control,render:function t(e){return(0,a.tZ)(T.Z,Yn({},e,{label:(0,u.__)("Passing Grade","tutor"),helpText:(0,u.__)("Set the minimum score percentage required to pass this quiz","tutor"),content:"%",contentPosition:"right",contentCss:_t.i.inputCurrencyStyle}))}}),(0,a.tZ)(w.Z,{when:i!=="tutor_h5p_quiz"},(0,a.tZ)(_.Qr,{name:"quiz_option.max_questions_for_answer",control:s.control,render:function t(e){return(0,a.tZ)(P.Z,Yn({},e,{type:"number",label:(0,u.__)("Max Question Allowed to Answer","tutor"),helpText:(0,u.__)("Set the number of quiz questions randomly from your question pool. If the set number exceeds available questions, all questions will be included","tutor"),selectOnFocus:true}))}})),(0,a.tZ)(w.Z,{when:(0,N.ro)(L.AO.CONTENT_DRIP)&&i!=="tutor_h5p_quiz"},(0,a.tZ)(w.Z,{when:r==="specific_days"},(0,a.tZ)(_.Qr,{name:"quiz_option.content_drip_settings.after_xdays_of_enroll",control:s.control,render:function t(e){return(0,a.tZ)(P.Z,Yn({},e,{type:"number",label:(0,a.tZ)("div",{css:to.contentDripLabel},(0,a.tZ)(p.Z,{name:"contentDrip",height:24,width:24}),(0,u.__)("Available after days","tutor")),helpText:(0,u.__)("This quiz will be available after the given number of days.","tutor"),placeholder:"0",selectOnFocus:true}))}})),(0,a.tZ)(w.Z,{when:r==="unlock_by_date"},(0,a.tZ)(_.Qr,{name:"quiz_option.content_drip_settings.unlock_date",control:s.control,render:function t(e){return(0,a.tZ)(k.Z,Yn({},e,{label:(0,a.tZ)("div",{css:to.contentDripLabel},(0,a.tZ)(p.Z,{name:"contentDrip",height:24,width:24}),(0,u.__)("Unlock Date","tutor")),placeholder:(0,u.__)("Select Unlock Date","tutor"),helpText:(0,u.__)("This quiz will be available from the given date. Leave empty to make it available immediately.","tutor")}))}})),(0,a.tZ)(w.Z,{when:r==="after_finishing_prerequisites"},(0,a.tZ)(_.Qr,{name:"quiz_option.content_drip_settings.prerequisites",control:s.control,render:function t(e){return(0,a.tZ)(z.Z,Yn({},e,{label:(0,a.tZ)("div",{css:to.contentDripLabel},(0,a.tZ)(p.Z,{name:"contentDrip",height:24,width:24}),(0,u.__)("Prerequisites","tutor")),placeholder:(0,u.__)("Select Prerequisite","tutor"),options:v.reduce((function(t,e){t.push(Mn(Mn({},e),{},{contents:e.contents.filter((function(t){return t.ID!==o}))}));return t}),[])||[],isSearchable:true,helpText:(0,u.__)("Select items that should be complete before this item","tutor")}))}}))))),(0,a.tZ)(Bn.Z,{title:(0,u.__)("Advanced Settings","tutor")},(0,a.tZ)("div",{css:to.formWrapper},(0,a.tZ)(_.Qr,{name:"quiz_option.quiz_auto_start",control:s.control,render:function t(e){return(0,a.tZ)(ct.Z,Yn({},e,{label:(0,u.__)("Quiz Auto Start","tutor"),helpText:(0,u.__)("When enabled, the quiz begins immediately as soon as the page loads","tutor")}))}}),(0,a.tZ)("div",{css:to.questionLayoutAndOrder},(0,a.tZ)(w.Z,{when:i!=="tutor_h5p_quiz"},(0,a.tZ)(_.Qr,{name:"quiz_option.question_layout_view",control:s.control,render:function t(e){return(0,a.tZ)(I.Z,Yn({},e,{label:(0,u.__)("Question Layout","tutor"),placeholder:(0,u.__)("Select an option","tutor"),options:[{label:(0,u.__)("Single question","tutor"),value:"single_question"},{label:(0,u.__)("Question pagination","tutor"),value:"question_pagination"},{label:(0,u.__)("Question below each other","tutor"),value:"question_below_each_other"}]}))}})),(0,a.tZ)(_.Qr,{name:"quiz_option.questions_order",control:s.control,render:function t(e){return(0,a.tZ)(I.Z,Yn({},e,{label:(0,u.__)("Question Order","tutor"),placeholder:(0,u.__)("Select an option","tutor"),options:[{label:(0,u.__)("Random","tutor"),value:"rand"},{label:(0,u.__)("Sorting","tutor"),value:"sorting"},{label:(0,u.__)("Ascending","tutor"),value:"asc"},{label:(0,u.__)("Descending","tutor"),value:"desc"}]}))}})),(0,a.tZ)(w.Z,{when:i!=="tutor_h5p_quiz"},(0,a.tZ)(_.Qr,{name:"quiz_option.hide_question_number_overview",control:s.control,render:function t(e){return(0,a.tZ)(ct.Z,Yn({},e,{label:(0,u.__)("Hide Question Number","tutor")}))}}),(0,a.tZ)(_.Qr,{name:"quiz_option.short_answer_characters_limit",control:s.control,render:function t(e){return(0,a.tZ)(P.Z,Yn({},e,{type:"number",label:(0,u.__)("Set Character Limit for Short Answers","tutor"),selectOnFocus:true}))}}),(0,a.tZ)(_.Qr,{name:"quiz_option.open_ended_answer_characters_limit",control:s.control,render:function t(e){return(0,a.tZ)(P.Z,Yn({},e,{label:(0,u.__)("Set Character Limit for Open-Ended/Essay Answers","tutor"),selectOnFocus:true}))}})))))};const Xn=Kn;var to={settings:(0,a.iv)(_t.i.display.flex("column")," gap:",D.W0[24],";"+(true?"":0),true?"":0),formWrapper:(0,a.iv)(_t.i.display.flex("column")," gap:",D.W0[20],";"+(true?"":0),true?"":0),timeWrapper:(0,a.iv)(_t.i.display.flex()," align-items:flex-end;gap:",D.W0[8],";"+(true?"":0),true?"":0),questionLayoutAndOrder:(0,a.iv)(_t.i.display.flex()," gap:",D.W0[20],";"+(true?"":0),true?"":0),contentDripLabel:(0,a.iv)("display:flex;align-items:center;svg{margin-right:",D.W0[4],";color:",D.Jv.icon.success,";}"+(true?"":0),true?"":0)};var eo=r(7151);var ro=r(7363);function no(t){"@babel/helpers - typeof";return no="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},no(t)}function oo(){oo=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return oo.apply(this,arguments)}function io(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */io=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function t(e,r,n){return e[r]=n}}function c(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),u=new O(o||[]);return n(a,"_invoke",{value:w(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var d={};function f(){}function p(){}function v(){}var h={};s(h,i,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(S([])));_&&_!==e&&r.call(_,i)&&(h=_);var m=v.prototype=f.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,u){var s=l(t[n],t,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==no(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(d).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(s.arg)}var i;n(this,"_invoke",{value:function t(r,n){function a(){return new e((function(t,e){o(r,n,t,e)}))}return i=i?i.then(a,a):a()}})}function w(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=Z(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function Z(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,Z(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:undefined,done:!0}}return p.prototype=v,n(m,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:p,configurable:!0}),p.displayName=s(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(b.prototype),s(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),s(m,u,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(q),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),d},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),d}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;q(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),d}},t}function ao(t,e,r,n,o,i,a){try{var u=t[i](a);var s=u.value}catch(t){r(t);return}if(u.done){e(s)}else{Promise.resolve(s).then(n,o)}}function uo(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ao(i,n,o,a,u,"next",t)}function u(t){ao(i,n,o,a,u,"throw",t)}a(undefined)}))}}function so(t,e){return vo(t)||po(t,e)||lo(t,e)||co()}function co(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function lo(t,e){if(!t)return;if(typeof t==="string")return fo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fo(t,e)}function fo(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function po(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function vo(t){if(Array.isArray(t))return t}function ho(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var yo=(0,N.zs)();var _o=function t(e){var r=e.closeModal,n=e.icon,o=e.title,i=e.subtitle,c=e.quizId,l=e.topicId,v=e.contentDripType,h=e.contentType;var y=(0,s.useState)(false),m=so(y,2),b=m[0],Z=m[1];var x=(0,s.useState)("details"),q=so(x,2),O=q[0],S=q[1];var j=(0,s.useState)(!(0,eo.$K)(c)),k=so(j,2),E=k[0],T=k[1];var I=(0,s.useRef)(null);var z=(0,ht.UN)();var A=(0,ht.nz)(c||"");var D=(0,g.p)(),W=D.showToast;var Q=(0,J.O)({defaultValues:{quiz_option:{time_limit:{time_value:0,time_type:"minutes"},hide_quiz_time_display:false,feedback_mode:"retry",attempts_allowed:10,passing_grade:80,max_questions_for_answer:h==="tutor_h5p_quiz"?0:10,quiz_auto_start:false,question_layout_view:h==="tutor_h5p_quiz"?"question_below_each_other":"single_question",questions_order:"rand",hide_question_number_overview:false,short_answer_characters_limit:200,open_ended_answer_characters_limit:500,content_drip_settings:{unlock_date:"",after_xdays_of_enroll:0,prerequisites:[]}},questions:[]},shouldFocusError:true});var F=!!Object.values(Q.formState.dirtyFields).some((function(t){return t}));(0,s.useEffect)((function(){var t=function t(e){if(F){e.preventDefault();return}Q.reset()};window.addEventListener("beforeunload",t);return function(){window.removeEventListener("beforeunload",t)}}),[F]);(0,s.useEffect)((function(){if(!A.data){return}var t=(0,ht.MM)(A.data);Q.reset(t)}),[A.data]);var B=function(){var t=uo(io().mark((function t(e,n,o){var i,a,s;return io().wrap((function t(c){while(1)switch(c.prev=c.next){case 0:if(e.quiz_title){c.next=4;break}S("details");Promise.resolve().then((function(){Q.trigger("quiz_title");Q.setFocus("quiz_title")}));return c.abrupt("return");case 4:if(!(e.questions.length===0)){c.next=8;break}S("details");W({message:(0,u.__)("Please add a question","tutor"),type:"danger"});return c.abrupt("return");case 8:i=(0,N.aU)(n,Q);if(!(i!==true)){c.next=13;break}o(i);S("details");return c.abrupt("return");case 13:T(false);a=(0,ht.pi)(e,l,v,yo);c.next=17;return z.mutateAsync(a);case 17:s=c.sent;if(s.data){T(false);r({action:"CONFIRM"})}case 19:case"end":return c.stop()}}),t)})));return function e(r,n,o){return t.apply(this,arguments)}}();(0,s.useEffect)((function(){if(E){Q.setFocus("quiz_title")}}),[E]);return(0,a.tZ)(_.RV,Q,(0,a.tZ)(Kt.$,{quizId:c||"",contentType:h||"tutor_quiz"},(function(t){var e=t.activeQuestionIndex,s=t.activeQuestionId,l=t.setActiveQuestionId,y=t.setValidationError;return(0,a.tZ)(C.Z,{onClose:function t(){return r({action:"CLOSE"})},icon:F?(0,a.tZ)(p.Z,{name:"warning",width:24,height:24}):n,title:F?(0,u.__)("Unsaved Changes","tutor"):o,subtitle:i,headerChildren:(0,a.tZ)($t.Z,{wrapperCss:(0,a.iv)("height:",L.oC.HEADER_HEIGHT,"px;"+(true?"":0),true?"":0),activeTab:O,tabList:[{label:(0,u.__)("Question Details","tutor"),value:"details"},{label:(0,u.__)("Settings","tutor"),value:"settings"}],onChange:function t(e){return S(e)}}),actions:F&&(0,a.tZ)(ro.Fragment,null,(0,a.tZ)(d.Z,{variant:"text",size:"small",onClick:function t(){if(F){Z(true);return}r()},ref:I},c?(0,u.__)("Discard Changes","tutor"):(0,u.__)("Cancel","tutor")),(0,a.tZ)(w.Z,{when:O==="settings"||c,fallback:(0,a.tZ)(d.Z,{variant:"primary",size:"small",onClick:function t(){return S("settings")}},(0,u.__)("Next","tutor"))},(0,a.tZ)(d.Z,{loading:z.isPending,variant:"primary",size:"small",onClick:uo(io().mark((function t(){return io().wrap((function t(r){while(1)switch(r.prev=r.next){case 0:if(!(e<0)){r.next=4;break}r.next=3;return Q.handleSubmit((function(t){return B(t,e,y)}))();case 3:return r.abrupt("return");case 4:r.next=6;return Q.handleSubmit((function(t){return B(t,e,y)}))();case 6:case"end":return r.stop()}}),t)})))},(0,u.__)("Save","tutor"))))},(0,a.tZ)("div",{css:go.wrapper({activeTab:O,isH5pQuiz:h==="tutor_h5p_quiz"})},(0,a.tZ)(w.Z,{when:!A.isLoading,fallback:(0,a.tZ)(f.fz,null)},(0,a.tZ)(w.Z,{when:O==="details"},(0,a.tZ)("div",{css:go.left},(0,a.tZ)(w.Z,{when:O==="details"},(0,a.tZ)("div",{css:go.quizTitleWrapper},(0,a.tZ)(w.Z,{when:E,fallback:(0,a.tZ)("div",{css:go.quizNameWithButton},(0,a.tZ)("span",{css:go.quizTitle},Q.getValues("quiz_title")),(0,a.tZ)(d.Z,{variant:"text",type:"button",onClick:function t(){return T(true)}},(0,a.tZ)(p.Z,{name:"edit",width:24,height:24})))},(0,a.tZ)("div",{css:go.quizForm},(0,a.tZ)(_.Qr,{control:Q.control,name:"quiz_title",rules:{required:(0,u.__)("Quiz title is required","tutor")},render:function t(e){return(0,a.tZ)(P.Z,oo({},e,{placeholder:(0,u.__)("Add quiz title","tutor"),selectOnFocus:true}))}}),(0,a.tZ)(_.Qr,{control:Q.control,name:"quiz_description",render:function t(e){return(0,a.tZ)(Ht.Z,oo({},e,{placeholder:(0,u.__)("Add a summary","tutor"),enableResize:false,rows:2}))}}),(0,a.tZ)("div",{css:go.quizFormButtonWrapper},(0,a.tZ)(d.Z,{variant:"text",type:"button",onClick:function t(){if(!Q.watch("quiz_title")){r()}T(false)},size:"small"},(0,u.__)("Cancel","tutor")),(0,a.tZ)(d.Z,{loading:z.isPending,variant:"secondary",type:"submit",size:"small",onClick:function t(){if(!Q.getValues("quiz_title")){Q.trigger("quiz_title");return}T(false)}},(0,u.__)("Ok","tutor")))))),(0,a.tZ)(Jn,{isEditing:E})))),(0,a.tZ)("div",{css:go.content({activeTab:O})},(0,a.tZ)(w.Z,{when:O==="settings",fallback:(0,a.tZ)(rn,null)},(0,a.tZ)(Xn,{contentDripType:v}))),(0,a.tZ)(w.Z,{when:O==="details"&&h!=="tutor_h5p_quiz"},(0,a.tZ)("div",{css:go.right},(0,a.tZ)(oe,null))))),(0,a.tZ)(Yt.Z,{isOpen:b,triggerRef:I,closePopover:function t(){return Z(false)},maxWidth:"258px",title:(0,u.__)("Your quiz has unsaved changes. If you cancel, you'll lose your progress.","tutor"),message:(0,u.__)("Are you sure you want to continue?","tutor"),animationType:on.ru.slideUp,arrow:"top",positionModifier:{top:-50,left:c?88:O==="settings"?30:26},hideArrow:true,confirmButton:{text:(0,u.__)("Yes","tutor"),variant:"primary"},cancelButton:{text:(0,u.__)("No","tutor"),variant:"text"},onConfirmation:function t(){var e;Q.reset();if(!((e=A.data)!==null&&e!==void 0&&e.questions.find((function(t){return t.question_id===s})))){l("");y(null)}!c&&r()}}))})))};const mo=_o;var go={wrapper:function t(e){var r=e.activeTab,n=e.isH5pQuiz;return(0,a.iv)("width:1218px;display:grid;grid-template-columns:",r==="details"?n?"513px 1fr":"352px 1fr 280px":"1fr",";height:100%;"+(true?"":0),true?"":0)},left:(0,a.iv)("border-right:1px solid ",D.Jv.stroke.divider,";"+(true?"":0),true?"":0),content:function t(e){var r=e.activeTab;return(0,a.iv)(_t.i.overflowYAuto,";padding:",D.W0[32]," 0 ",D.W0[48]," ",D.W0[6],";",r==="settings"&&(0,a.iv)("padding-top:",D.W0[24],";padding-inline:352px 352px;"+(true?"":0),true?"":0),";"+(true?"":0),true?"":0)},right:(0,a.iv)(_t.i.overflowYAuto,";",_t.i.display.flex("column"),";gap:",D.W0[16],";border-left:1px solid ",D.Jv.stroke.divider,";"+(true?"":0),true?"":0),quizTitleWrapper:(0,a.iv)(W.c.caption(),";color:",D.Jv.text.subdued,";padding:",D.W0[16]," ",D.W0[32]," ",D.W0[16]," ",D.W0[28],";border-bottom:1px solid ",D.Jv.stroke.divider,";"+(true?"":0),true?"":0),quizNameWithButton:true?{name:"h4sk4u",styles:"display:inline-flex;width:100%;transition:all 0.3s ease-in-out;button{display:none;}:hover{button{display:block;}}"}:0,quizTitle:(0,a.iv)("flex:1;padding:",D.W0[8]," ",D.W0[16]," ",D.W0[8]," ",D.W0[8],";background-color:",D.Jv.background.white,";border-radius:",D.E0[6],";"+(true?"":0),true?"":0),quizForm:(0,a.iv)("display:flex;flex-direction:column;gap:",D.W0[12],";"+(true?"":0),true?"":0),quizFormButtonWrapper:(0,a.iv)("display:flex;justify-content:end;margin-top:",D.W0[4],";gap:",D.W0[8],";"+(true?"":0),true?"":0)};var bo=r(7363);function wo(t){"@babel/helpers - typeof";return wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wo(t)}function Zo(t,e){var r=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ko(t))||e&&t&&typeof t.length==="number"){if(r)t=r;var n=0;var o=function t(){};return{s:o,n:function e(){if(n>=t.length)return{done:true};return{done:false,value:t[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=true,a=false,u;return{s:function e(){r=r.call(t)},n:function t(){var e=r.next();i=e.done;return e},e:function t(e){a=true;u=e},f:function t(){try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}}}function xo(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */xo=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function t(e,r,n){return e[r]=n}}function c(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),u=new O(o||[]);return n(a,"_invoke",{value:w(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var d={};function f(){}function p(){}function v(){}var h={};s(h,i,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(S([])));_&&_!==e&&r.call(_,i)&&(h=_);var m=v.prototype=f.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,u){var s=l(t[n],t,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==wo(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(d).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(s.arg)}var i;n(this,"_invoke",{value:function t(r,n){function a(){return new e((function(t,e){o(r,n,t,e)}))}return i=i?i.then(a,a):a()}})}function w(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=Z(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function Z(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,Z(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:undefined,done:!0}}return p.prototype=v,n(m,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:p,configurable:!0}),p.displayName=s(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(b.prototype),s(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),s(m,u,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(q),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),d},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),d}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;q(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),d}},t}function qo(t,e,r,n,o,i,a){try{var u=t[i](a);var s=u.value}catch(t){r(t);return}if(u.done){e(s)}else{Promise.resolve(s).then(n,o)}}function Oo(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){qo(i,n,o,a,u,"next",t)}function u(t){qo(i,n,o,a,u,"throw",t)}a(undefined)}))}}function So(t,e){return To(t)||Po(t,e)||ko(t,e)||jo()}function jo(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ko(t,e){if(!t)return;if(typeof t==="string")return Eo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Eo(t,e)}function Eo(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Po(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function To(t){if(Array.isArray(t))return t}function Io(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var zo=(0,N.zs)();var Ao=!!R.y.tutor_pro_url;var Co=(0,N.ro)(L.AO.TUTOR_GOOGLE_MEET_INTEGRATION)||(0,N.ro)(L.AO.TUTOR_ZOOM_INTEGRATION);var Lo=function t(e){var r=e.topic;var n=(0,N.Wj)("topic-",r.id);var o=(0,g.p)(),i=o.showToast;var c=(0,b.d)(),l=c.showModal;var f=(0,_.Gc)();var v=(0,s.useState)(null),h=So(v,2),y=h[0],k=h[1];var E=(0,s.useState)(false),P=So(E,2),T=P[0],I=P[1];var z=(0,s.useRef)(null);var A=(0,s.useRef)(null);var C=(0,ht.$$)();var W=(0,j.NL)();var Q=W.getQueryData(["CourseDetails",Number(zo)]);var J=(0,Z.tZ)({acceptedTypes:[".csv"],onUpload:function(){var t=Oo(xo().mark((function t(e){return xo().wrap((function t(r){while(1)switch(r.prev=r.next){case 0:r.next=2;return C.mutateAsync({topic_id:n,csv_file:e[0]});case 2:I(false);case 3:case"end":return r.stop()}}),t)})));function e(e){return t.apply(this,arguments)}return e}(),onError:function t(e){var r=Zo(e),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;i({message:o,type:"danger"})}}catch(t){r.e(t)}finally{r.f()}I(false)}}),B=J.fileInputRef,R=J.handleChange;return(0,a.tZ)(bo.Fragment,null,(0,a.tZ)("div",{css:Wo.contentButtons},(0,a.tZ)("div",{css:[_t.i.display.flex(),{gap:D.W0[12]},true?"":0,true?"":0]},(0,a.tZ)(d.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:(0,a.tZ)(p.Z,{name:"plus",width:24,height:24}),disabled:!r.isSaved,buttonCss:Wo.contentButton,onClick:function t(){l({component:Vt,props:{contentDripType:f.watch("contentDripType"),topicId:n,title:(0,u.__)("Lesson","tutor"),icon:(0,a.tZ)(p.Z,{name:"lesson",width:24,height:24}),subtitle:(0,u.sprintf)((0,u.__)("Topic: %s","tutor"),r.title)}})}},(0,u.__)("Lesson","tutor")),(0,a.tZ)(d.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:(0,a.tZ)(p.Z,{name:"plus",width:24,height:24}),disabled:!r.isSaved,buttonCss:Wo.contentButton,onClick:function t(){l({component:mo,props:{topicId:n,contentDripType:f.watch("contentDripType"),title:(0,u.__)("Quiz","tutor"),icon:(0,a.tZ)(p.Z,{name:"quiz",width:24,height:24}),subtitle:(0,u.sprintf)((0,u.__)("Topic: %s","tutor"),r.title)},closeOnEscape:false})}},(0,u.__)("Quiz","tutor")),(0,a.tZ)(w.Z,{when:!Ao,fallback:(0,a.tZ)(w.Z,{when:(0,N.ro)(L.AO.H5P_INTEGRATION)},(0,a.tZ)(d.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:(0,a.tZ)(p.Z,{name:"plus",width:24,height:24}),disabled:!r.isSaved,buttonCss:Wo.contentButton,onClick:function t(){l({component:mo,props:{topicId:n,contentDripType:f.watch("contentDripType"),title:(0,u.__)("Interactive Quiz","tutor"),icon:(0,a.tZ)(p.Z,{name:"interactiveQuiz",width:24,height:24}),subtitle:(0,u.sprintf)((0,u.__)("Topic: %s","tutor"),r.title),contentType:"tutor_h5p_quiz"},closeOnEscape:false})}},(0,u.__)("Interactive Quiz","tutor")))},(0,a.tZ)(m.Z,null,(0,a.tZ)(d.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:(0,a.tZ)(p.Z,{name:"plus",width:24,height:24}),disabled:true,onClick:F.ZT},(0,u.__)("Interactive Quiz","tutor")))),(0,a.tZ)(w.Z,{when:!Ao,fallback:(0,a.tZ)(w.Z,{when:(0,N.ro)(L.AO.TUTOR_ASSIGNMENTS)},(0,a.tZ)(d.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:(0,a.tZ)(p.Z,{name:"plus",width:24,height:24}),disabled:!r.isSaved,buttonCss:Wo.contentButton,onClick:function t(){l({component:it,props:{topicId:n,contentDripType:f.watch("contentDripType"),title:(0,u.__)("Assignment","tutor"),icon:(0,a.tZ)(p.Z,{name:"assignment",width:24,height:24}),subtitle:(0,u.sprintf)((0,u.__)("Topic: %s","tutor"),r.title)}})}},(0,u.__)("Assignment","tutor")))},(0,a.tZ)(m.Z,null,(0,a.tZ)(d.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:(0,a.tZ)(p.Z,{name:"plus",width:24,height:24}),disabled:true,onClick:F.ZT},(0,u.__)("Assignment","tutor"))))),(0,a.tZ)("div",{css:Wo.footerButtons},(0,a.tZ)(w.Z,{when:!Ao||Co,fallback:(0,a.tZ)(w.Z,{when:Ao,fallback:(0,a.tZ)(m.Z,null,(0,a.tZ)(d.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:(0,a.tZ)(p.Z,{name:"import",width:24,height:24}),disabled:true,onClick:F.ZT},(0,u.__)("Import Quiz","tutor")))},(0,a.tZ)(w.Z,{when:(0,N.ro)(L.AO.QUIZ_EXPORT_IMPORT)},(0,a.tZ)(d.Z,{variant:"tertiary",isOutlined:true,size:"small",icon:(0,a.tZ)(p.Z,{name:"import",width:24,height:24}),disabled:!r.isSaved,buttonCss:Wo.contentButton,onClick:function t(){var e;B===null||B===void 0?void 0:(e=B.current)===null||e===void 0?void 0:e.click()}},(0,u.__)("Import Quiz","tutor"))))},(0,a.tZ)(q.Z,{isOpen:T,onClick:function t(){return I(true)},closePopover:function t(){return I(false)},disabled:!r.isSaved,dotsOrientation:"vertical",maxWidth:Ao?"220px":"240px",isInverse:true,arrowPosition:"auto",hideArrow:true,closeOnEscape:false},(0,a.tZ)(w.Z,{when:!Ao||(0,N.ro)(L.AO.TUTOR_GOOGLE_MEET_INTEGRATION)},(0,a.tZ)(q.Z.Option,{text:(0,a.tZ)("span",{ref:z,css:Wo.threeDotButton},(0,u.__)("Meet live lesson","tutor"),(0,a.tZ)(w.Z,{when:!Ao},(0,a.tZ)(m.Z,{size:"small",content:(0,u.__)("Pro","tutor")}))),disabled:!Ao,icon:(0,a.tZ)(p.Z,{width:24,height:24,name:"googleMeetColorize",isColorIcon:true}),onClick:function t(){return k("tutor-google-meet")}})),(0,a.tZ)(w.Z,{when:!Ao||(0,N.ro)(L.AO.TUTOR_ZOOM_INTEGRATION)},(0,a.tZ)(q.Z.Option,{text:(0,a.tZ)("span",{ref:A,css:Wo.threeDotButton},(0,u.__)("Zoom live lesson","tutor"),(0,a.tZ)(w.Z,{when:!Ao},(0,a.tZ)(m.Z,{size:"small",content:(0,u.__)("Pro","tutor")}))),disabled:!Ao,icon:(0,a.tZ)(p.Z,{width:24,height:24,name:"zoomColorize",isColorIcon:true}),onClick:function t(){return k("tutor_zoom_meeting")}})),(0,a.tZ)(w.Z,{when:!Ao||(0,N.ro)(L.AO.QUIZ_EXPORT_IMPORT)},(0,a.tZ)(q.Z.Option,{text:(0,a.tZ)("span",{css:Wo.threeDotButton},(0,u.__)("Import Quiz","tutor"),(0,a.tZ)(w.Z,{when:!Ao},(0,a.tZ)(m.Z,{size:"small",content:(0,u.__)("Pro","tutor")}))),disabled:!Ao,onClick:function t(){var e;B===null||B===void 0?void 0:(e=B.current)===null||e===void 0?void 0:e.click()},icon:(0,a.tZ)(p.Z,{name:"importColorized",width:24,height:24,isColorIcon:true})})))))),(0,a.tZ)("input",{css:_t.i.display.none,type:"file",ref:B,onChange:R,multiple:false,accept:".csv"}),(0,a.tZ)(x.Z,{triggerRef:z,isOpen:y==="tutor-google-meet",closePopover:F.ZT,maxWidth:"306px",closeOnEscape:false},(0,a.tZ)(O.Z,{topicId:n,data:null,onCancel:function t(){k(null);I(false)}})),(0,a.tZ)(x.Z,{triggerRef:A,isOpen:y==="tutor_zoom_meeting",closePopover:F.ZT,maxWidth:"306px",closeOnEscape:false},(0,a.tZ)(S.Z,{topicId:n,meetingHost:(Q===null||Q===void 0?void 0:Q.zoom_users)||{},data:null,onCancel:function t(){k(null);I(false)}})))};const Do=Lo;var Wo={contentButtons:(0,a.iv)(_t.i.display.flex(),";justify-content:space-between;"+(true?"":0),true?"":0),footerButtons:true?{name:"s5xdrg",styles:"display:flex;align-items:center"}:0,threeDotButton:(0,a.iv)("display:flex;align-items:center;gap:",D.W0[4],";"+(true?"":0),true?"":0),contentButton:(0,a.iv)(":hover:not(:disabled){background-color:",D.Jv.background.white,";color:",D.Jv.text.brand,";box-shadow:inset 0 0 0 1px ",D.Jv.stroke.brand,";}"+(true?"":0),true?"":0)};var Qo=r(9313);var No=r(7363);function Jo(t){"@babel/helpers - typeof";return Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(t)}function Fo(){Fo=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return Fo.apply(this,arguments)}function Bo(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Bo=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function t(e,r,n){return e[r]=n}}function c(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),u=new O(o||[]);return n(a,"_invoke",{value:w(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var d={};function f(){}function p(){}function v(){}var h={};s(h,i,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(S([])));_&&_!==e&&r.call(_,i)&&(h=_);var m=v.prototype=f.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,u){var s=l(t[n],t,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==Jo(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(d).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(s.arg)}var i;n(this,"_invoke",{value:function t(r,n){function a(){return new e((function(t,e){o(r,n,t,e)}))}return i=i?i.then(a,a):a()}})}function w(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=Z(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function Z(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,Z(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:undefined,done:!0}}return p.prototype=v,n(m,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:p,configurable:!0}),p.displayName=s(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(b.prototype),s(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),s(m,u,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(q),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),d},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),d}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;q(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),d}},t}function Ro(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Go(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ro(Object(r),!0).forEach((function(e){Mo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ro(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Mo(t,e,r){e=Vo(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function Vo(t){var e=Uo(t,"string");return Jo(e)==="symbol"?e:String(e)}function Uo(t,e){if(Jo(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(Jo(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ho(t,e,r,n,o,i,a){try{var u=t[i](a);var s=u.value}catch(t){r(t);return}if(u.done){e(s)}else{Promise.resolve(s).then(n,o)}}function Yo(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ho(i,n,o,a,u,"next",t)}function u(t){Ho(i,n,o,a,u,"throw",t)}a(undefined)}))}}function $o(t,e){return ri(t)||ei(t,e)||Xo(t,e)||Ko()}function Ko(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Xo(t,e){if(!t)return;if(typeof t==="string")return ti(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ti(t,e)}function ti(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ei(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function ri(t){if(Array.isArray(t))return t}function ni(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var oi=(0,N.zs)();var ii=!!R.y.tutor_pro_url;var ai=function t(e){var r=e.topic,n=e.isEdit,o=e.isActive,i=e.listeners,c=e.isDragging,l=e.onCollapse,v=e.onEdit,h=e.onCopy,g=e.onDelete,b=e.setIsEdit;var Z=(0,N.Wj)("topic-",r.id);var x=(0,J.O)({defaultValues:{title:r.title,summary:r.summary},shouldFocusError:true});var q=(0,s.useState)(false),O=$o(q,2),S=O[0],j=O[1];var k=(0,s.useRef)(null);var E=(0,s.useRef)(null);var T=(0,Q.FV)();var I=(0,Q.P_)();var z=(0,Q.Wn)(oi);var A=(0,Qo.m)({ref:k,isOpen:!r.isCollapsed,heightCalculator:"client"});var C=function(){var t=Yo(Bo().mark((function t(e){var n;return Bo().wrap((function t(o){while(1)switch(o.prev=o.next){case 0:o.next=2;return T.mutateAsync(Go(Go({},r.isSaved&&{topic_id:Z}),{},{course_id:oi,title:e.title,summary:e.summary}));case 2:n=o.sent;if(n.data){if(n.status_code===201){v===null||v===void 0?void 0:v("topic-".concat(n.data))}b(false)}case 4:case"end":return o.stop()}}),t)})));return function e(r){return t.apply(this,arguments)}}();var L=function(){var t=Yo(Bo().mark((function t(){var e;return Bo().wrap((function t(r){while(1)switch(r.prev=r.next){case 0:r.next=2;return I.mutateAsync({course_id:oi,content_id:Z,content_type:"topic"});case 2:e=r.sent;if(e.data){h===null||h===void 0?void 0:h("topic-".concat(e.data))}case 4:case"end":return r.stop()}}),t)})));return function e(){return t.apply(this,arguments)}}();(0,s.useEffect)((function(){if(n){x.setFocus("title")}}),[n]);return(0,a.tZ)(No.Fragment,null,(0,a.tZ)("div",{css:di.header({isCollapsed:r.isCollapsed,isEdit:n,isDeletePopoverOpen:S,isDragging:c})},(0,a.tZ)("div",{css:di.headerContent({isSaved:r.isSaved})},(0,a.tZ)("div",{css:di.grabberInput,onClick:function t(){return l(r.id)},onKeyDown:function t(e){if(e.key==="Enter"){l(r.id)}}},(0,a.tZ)("button",Fo({},r.isSaved?i:{},{css:di.grabButton({isDragging:c}),type:"button",disabled:!r.isSaved}),(0,a.tZ)(p.Z,{name:"dragVertical",width:24,height:24})),(0,a.tZ)(w.Z,{when:n,fallback:(0,a.tZ)("div",{css:di.title({isEdit:n}),onDoubleClick:function t(){return b(true)}},x.watch("title"))},(0,a.tZ)("div",{css:di.title({isEdit:n})},(0,a.tZ)(_.Qr,{control:x.control,name:"title",rules:{required:(0,u.__)("Title is required","tutor")},render:function t(e){return(0,a.tZ)(P.Z,Fo({},e,{placeholder:(0,u.__)("Add a title","tutor"),isSecondary:true,selectOnFocus:true}))}})))),(0,a.tZ)("div",{css:di.actions,"data-visually-hidden":true},(0,a.tZ)(w.Z,{when:!n},(0,a.tZ)(ut.Z,{content:(0,u.__)("Edit","tutor"),delay:200},(0,a.tZ)("button",{type:"button",css:_t.i.actionButton,disabled:!r.isSaved,onClick:function t(){b(true);if(r.isCollapsed){l===null||l===void 0?void 0:l(r.id)}}},(0,a.tZ)(p.Z,{name:"edit",width:24,height:24})))),(0,a.tZ)(w.Z,{when:r.isSaved},(0,a.tZ)(w.Z,{when:!I.isPending,fallback:(0,a.tZ)(f.ZP,{size:24})},(0,a.tZ)(ut.Z,{content:(0,u.__)("Duplicate","tutor"),delay:200},(0,a.tZ)(w.Z,{when:!ii,fallback:(0,a.tZ)("button",{type:"button",css:_t.i.actionButton,disabled:!r.isSaved,onClick:L},(0,a.tZ)(p.Z,{name:"copyPaste",width:24,height:24}))},(0,a.tZ)(m.Z,{size:"tiny"},(0,a.tZ)("button",{type:"button",css:_t.i.actionButton,disabled:true,onClick:F.ZT},(0,a.tZ)(p.Z,{name:"copyPaste",width:24,height:24}))))))),(0,a.tZ)(w.Z,{when:r.isSaved},(0,a.tZ)(ut.Z,{content:(0,u.__)("Delete","tutor"),delay:200},(0,a.tZ)("button",{type:"button",css:_t.i.actionButton,disabled:!r.isSaved,"data-visually-hidden":true,ref:E,onClick:function t(){j(true)}},(0,a.tZ)(p.Z,{name:"delete",width:24,height:24})))),(0,a.tZ)(w.Z,{when:r.isSaved},(0,a.tZ)("button",{type:"button",css:_t.i.actionButton,disabled:!r.isSaved,onClick:function t(){l===null||l===void 0?void 0:l(r.id)},"data-toggle-collapse":true},(0,a.tZ)(p.Z,{name:"chevronDown",width:24,height:24}))))),(0,a.tZ)(w.Z,{when:n,fallback:(0,a.tZ)(w.Z,{when:r.summary.length>0},(0,a.tZ)(y.q.div,{style:Go({},A)},(0,a.tZ)("div",{css:di.description({isEdit:n}),ref:k,onDoubleClick:function t(){return b(true)}},x.watch("summary"))))},(0,a.tZ)("div",{css:di.description({isEdit:n})},(0,a.tZ)(_.Qr,{control:x.control,name:"summary",render:function t(e){return(0,a.tZ)(Ht.Z,Fo({},e,{placeholder:(0,u.__)("Add a summary","tutor"),isSecondary:true,rows:2,enableResize:true}))}}))),(0,a.tZ)(w.Z,{when:n},(0,a.tZ)("div",{css:di.footer},(0,a.tZ)(d.Z,{variant:"text",size:"small",onClick:function t(){if(!x.formState.isValid&&!r.isSaved){g===null||g===void 0?void 0:g()}x.reset();b(false)}},(0,u.__)("Cancel","tutor")),(0,a.tZ)(d.Z,{loading:T.isPending,variant:"secondary",size:"small",onClick:x.handleSubmit(C)},(0,u.__)("Ok","tutor"))))),(0,a.tZ)(Yt.Z,{isOpen:S,triggerRef:E,isLoading:z.isPending,closePopover:F.ZT,maxWidth:"258px",title:(0,u.sprintf)((0,u.__)('Delete topic "%s"',"tutor"),r.title),message:(0,u.__)("Are you sure you want to delete this content from your course? This cannot be undone.","tutor"),animationType:on.ru.slideUp,arrow:"auto",hideArrow:true,confirmButton:{text:(0,u.__)("Delete","tutor"),variant:"text",isDelete:true},cancelButton:{text:(0,u.__)("Cancel","tutor"),variant:"text"},onConfirmation:Yo(Bo().mark((function t(){return Bo().wrap((function t(e){while(1)switch(e.prev=e.next){case 0:e.next=2;return z.mutateAsync(Z);case 2:j(false);g===null||g===void 0?void 0:g();case 4:case"end":return e.stop()}}),t)}))),onCancel:function t(){return j(false)}}))};const ui=ai;var si=true?{name:"jjyo93",styles:"padding-right:0"}:0;var ci=true?{name:"18g08sj",styles:"padding-bottom:0"}:0;var li=true?{name:"21xn5r",styles:"transform:rotate(180deg)"}:0;var di={header:function t(e){var r=e.isCollapsed,n=e.isEdit,o=e.isDeletePopoverOpen,i=e.isDragging;return(0,a.iv)("padding:",D.W0[12]," ",D.W0[16],";",_t.i.display.flex("column"),";[data-toggle-collapse]{transition:transform 0.3s ease-in-out;",!r&&li,";}",!r&&(0,a.iv)("border-bottom:1px solid ",D.Jv.stroke.divider,";"+(true?"":0),true?"":0)," ",!n&&ci," ",!n&&!o&&(0,a.iv)("[data-visually-hidden]{opacity:0;transition:",!i?"opacity 0.3s ease-in-out":"none",";}:hover,:focus-within{[data-visually-hidden]{opacity:",i?0:1,";}}"+(true?"":0),true?"":0),";"+(true?"":0),true?"":0)},headerContent:function t(e){var r=e.isSaved,n=r===void 0?true:r;return(0,a.iv)("display:grid;grid-template-columns:",n?"1fr auto":"1fr",";gap:",D.W0[12],";width:100%;padding-bottom:",D.W0[12],";"+(true?"":0),true?"":0)},grabberInput:(0,a.iv)(_t.i.display.flex(),";align-items:center;gap:",D.W0[8],";svg{color:",D.Jv.color.black[40],";flex-shrink:0;}"+(true?"":0),true?"":0),grabButton:function t(e){var r=e.isDragging,n=r===void 0?false:r;return(0,a.iv)(_t.i.resetButton,";",_t.i.flexCenter(),";cursor:",n?"grabbing":"grab",";:disabled{cursor:not-allowed;}&:focus-visible{outline:2px solid ",D.Jv.stroke.brand,";outline-offset:1px;border-radius:",D.E0[2],";}"+(true?"":0),true?"":0)},title:function t(e){var r=e.isEdit;return(0,a.iv)(W.c.body(),";color:",D.Jv.text.hints,";width:100%;",!r&&(0,a.iv)(_t.i.text.ellipsis(1),";"+(true?"":0),true?"":0),";"+(true?"":0),true?"":0)},description:function t(e){var r=e.isEdit;return(0,a.iv)(W.c.caption(),";color:",D.Jv.text.hints,";padding-inline:",D.W0[8],";margin-left:",D.W0[24],";padding-bottom:",D.W0[12],";",!r&&(0,a.iv)(_t.i.text.ellipsis(2),";"+(true?"":0),true?"":0)," ",r&&si,";"+(true?"":0),true?"":0)},footer:(0,a.iv)("width:100%;text-align:right;",_t.i.display.flex(),";gap:",D.W0[8],";justify-content:end;"+(true?"":0),true?"":0),actions:(0,a.iv)(_t.i.display.flex(),";align-items:start;gap:",D.W0[8],";justify-content:end;"+(true?"":0),true?"":0)};var fi=r(7363);function pi(t){"@babel/helpers - typeof";return pi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pi(t)}function vi(){vi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return vi.apply(this,arguments)}function hi(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */hi=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function t(e,r,n){return e[r]=n}}function c(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),u=new O(o||[]);return n(a,"_invoke",{value:w(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var d={};function f(){}function p(){}function v(){}var h={};s(h,i,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(S([])));_&&_!==e&&r.call(_,i)&&(h=_);var m=v.prototype=f.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,u){var s=l(t[n],t,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==pi(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(d).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(s.arg)}var i;n(this,"_invoke",{value:function t(r,n){function a(){return new e((function(t,e){o(r,n,t,e)}))}return i=i?i.then(a,a):a()}})}function w(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=Z(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function Z(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,Z(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=undefined),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:undefined,done:!0}}return p.prototype=v,n(m,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:p,configurable:!0}),p.displayName=s(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(b.prototype),s(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),s(m,u,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(q),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),d},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),d}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;q(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),d}},t}function yi(t,e,r,n,o,i,a){try{var u=t[i](a);var s=u.value}catch(t){r(t);return}if(u.done){e(s)}else{Promise.resolve(s).then(n,o)}}function _i(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){yi(i,n,o,a,u,"next",t)}function u(t){yi(i,n,o,a,u,"throw",t)}a(undefined)}))}}function mi(t,e){return xi(t)||Zi(t,e)||bi(t,e)||gi()}function gi(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function bi(t,e){if(!t)return;if(typeof t==="string")return wi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wi(t,e)}function wi(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Zi(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function xi(t){if(Array.isArray(t))return t}function qi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Oi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qi(Object(r),!0).forEach((function(e){Si(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Si(t,e,r){e=ji(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function ji(t){var e=ki(t,"string");return pi(e)==="symbol"?e:String(e)}function ki(t,e){if(pi(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(pi(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ei(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Pi={lesson:{name:"lesson",color:D.Jv.icon["default"]},tutor_quiz:{name:"quiz",color:D.Jv.design.warning},tutor_assignments:{name:"assignment",color:D.Jv.icon.processing},tutor_zoom_meeting:{name:"zoomColorize",color:""},"tutor-google-meet":{name:"googleMeetColorize",color:""},tutor_h5p_quiz:{name:"interactiveQuiz",color:"#C984FE"}};var Ti={lesson:Vt,tutor_quiz:mo,tutor_assignments:it,tutor_h5p_quiz:mo};var Ii={lesson:(0,u.__)("Lesson","tutor"),tutor_quiz:(0,u.__)("Quiz","tutor"),tutor_assignments:(0,u.__)("Assignment","tutor"),tutor_h5p_quiz:(0,u.__)("Interactive Quiz","tutor")};var zi={lesson:"lesson",tutor_quiz:"quiz",tutor_assignments:"assignment",tutor_h5p_quiz:"interactiveQuiz"};var Ai=function t(e){return(0,i.cP)(Oi(Oi({},e),{},{wasDragging:true}))};var Ci=!!R.y.tutor_pro_url;var Li=(0,N.zs)();var Di=function t(e){var r=e.type,n=e.topic,o=e.content,c=e.onCopy,l=e.onDelete,d=e.isOverlay,v=d===void 0?false:d;var y=(0,N.Wj)("topic-",n.id);var g=(0,N.Wj)("content-",o.id);var Z=(0,j.NL)();var q=Z.getQueryData(["CourseDetails",Number(Li)]);var k=(0,_.Gc)();var E=(0,s.useState)(null),P=mi(E,2),T=P[0],I=P[1];var z=(0,s.useState)(false),A=mi(z,2),C=A[0],W=A[1];var J=(0,s.useRef)(null);var B=(0,s.useRef)(null);var R=Pi[r];var G=(0,i.nB)({id:o.id,data:{type:"content"},animateLayoutChanges:Ai}),M=G.attributes,V=G.listeners,U=G.setNodeRef,H=G.transform,Y=G.transition,$=G.isDragging;var K={transform:h.ux.Transform.toString(H),transition:Y,opacity:$?.3:undefined,background:$?D.Jv.stroke.hover:undefined};var X=(0,b.d)(),tt=X.showModal;var et=(0,Q.P_)();var rt=(0,Q.PI)();var nt=(0,ht.T1)();var ot=(0,Q.PI)();var it=(0,Q.PI)();var at=(0,ht._l)();var st=function t(){var e=r;if(Ti[e]){tt({component:Ti[e],props:Oi({contentDripType:k.watch("contentDripType"),topicId:y,lessonId:g,assignmentId:g,quizId:g,title:Ii[e],subtitle:(0,u.sprintf)((0,u.__)("Topic: %s","tutor"),n.title),icon:(0,a.tZ)(p.Z,{name:zi[e],height:24,width:24})},r==="tutor_h5p_quiz"&&{contentType:"tutor_h5p_quiz"}),closeOnEscape:!["tutor_quiz","tutor_h5p_quiz"].includes(r)})}if(r==="tutor_zoom_meeting"){I("tutor_zoom_meeting")}if(r==="tutor-google-meet"){I("tutor-google-meet")}};var ct=function(){var t=_i(hi().mark((function t(){return hi().wrap((function t(e){while(1)switch(e.prev=e.next){case 0:if(!["lesson","tutor_assignments"].includes(r)){e.next=5;break}e.next=3;return rt.mutateAsync(g);case 3:e.next=18;break;case 5:if(!["tutor_quiz","tutor_h5p_quiz"].includes(r)){e.next=10;break}e.next=8;return nt.mutateAsync(g);case 8:e.next=18;break;case 10:if(!(r==="tutor-google-meet")){e.next=15;break}e.next=13;return ot.mutateAsync(g);case 13:e.next=18;break;case 15:if(!(r==="tutor_zoom_meeting")){e.next=18;break}e.next=18;return it.mutateAsync(g);case 18:W(false);l===null||l===void 0?void 0:l();case 20:case"end":return e.stop()}}),t)})));return function e(){return t.apply(this,arguments)}}();var lt=function t(){var e={lesson:"lesson",tutor_assignments:"assignment",tutor_quiz:"quiz",tutor_h5p_quiz:"quiz"};et.mutateAsync({course_id:Li,content_id:g,content_type:e[r]});c===null||c===void 0?void 0:c()};return(0,a.tZ)(fi.Fragment,null,(0,a.tZ)("div",vi({},M,{css:Ni.wrapper({isDragging:$,isOverlay:v,isActive:T===r||C||et.isPending}),ref:U,style:K}),(0,a.tZ)("div",vi({css:Ni.iconAndTitle({isDragging:v})},V),(0,a.tZ)("div",{"data-content-icon":true},(0,a.tZ)(p.Z,{name:R.name,width:24,height:24,style:(0,a.iv)("color:",R.color,";"+(true?"":0),true?"":0)})),(0,a.tZ)("div",{"data-bar-icon":true},(0,a.tZ)(p.Z,{name:"bars",width:24,height:24})),(0,a.tZ)("p",{css:Ni.title,onClick:st,onKeyDown:F.ZT},(0,a.tZ)("span",{dangerouslySetInnerHTML:{__html:o.title}}),(0,a.tZ)(w.Z,{when:(r==="tutor_quiz"||r==="tutor_h5p_quiz")&&!!o.total_question},(0,a.tZ)("span",{"data-question-count":true},"(",(0,u.sprintf)((0,u.__)("%s Questions","tutor"),o.total_question),")")))),(0,a.tZ)("div",{css:Ni.actions,"data-actions":true},(0,a.tZ)(w.Z,{when:r==="tutor_quiz"},(0,a.tZ)(ut.Z,{content:(0,u.__)("Export Quiz","tutor"),delay:200},(0,a.tZ)(w.Z,{when:!Ci,fallback:(0,a.tZ)(w.Z,{when:(0,N.ro)(L.AO.QUIZ_EXPORT_IMPORT)},(0,a.tZ)("button",{type:"button",css:_t.i.actionButton,onClick:function t(){at.mutate(g)}},(0,a.tZ)(p.Z,{name:"export",width:24,height:24})))},(0,a.tZ)(m.Z,{size:"tiny"},(0,a.tZ)("button",{type:"button",css:_t.i.actionButton,disabled:true,onClick:F.ZT},(0,a.tZ)(p.Z,{name:"export",width:24,height:24})))))),(0,a.tZ)(ut.Z,{content:(0,u.__)("Edit","tutor"),delay:200},(0,a.tZ)("button",{ref:J,type:"button",css:_t.i.actionButton,onClick:st},(0,a.tZ)(p.Z,{name:"edit",width:24,height:24}))),(0,a.tZ)(w.Z,{when:!["tutor_zoom_meeting","tutor_zoom_meeting"].includes(r)},(0,a.tZ)(w.Z,{when:!et.isPending,fallback:(0,a.tZ)(f.ZP,{size:24})},(0,a.tZ)(ut.Z,{content:(0,u.__)("Duplicate","tutor"),delay:200},(0,a.tZ)(w.Z,{when:!Ci,fallback:(0,a.tZ)("button",{type:"button",css:_t.i.actionButton,onClick:lt},(0,a.tZ)(p.Z,{name:"copyPaste",width:24,height:24}))},(0,a.tZ)(m.Z,{size:"tiny"},(0,a.tZ)("button",{disabled:true,type:"button",css:_t.i.actionButton,onClick:F.ZT},(0,a.tZ)(p.Z,{name:"copyPaste",width:24,height:24}))))))),(0,a.tZ)(ut.Z,{content:(0,u.__)("Delete","tutor"),delay:200},(0,a.tZ)("button",{ref:B,type:"button",css:_t.i.actionButton,onClick:function t(){W(true)}},(0,a.tZ)(p.Z,{name:"delete",width:24,height:24}))))),(0,a.tZ)(x.Z,{triggerRef:J,isOpen:T!==null,closePopover:F.ZT,maxWidth:"306px",closeOnEscape:false},(0,a.tZ)(w.Z,{when:T==="tutor_zoom_meeting"},(0,a.tZ)(S.Z,{data:null,topicId:y,meetingHost:(q===null||q===void 0?void 0:q.zoom_users)||{},onCancel:function t(){return I(null)},meetingId:g})),(0,a.tZ)(w.Z,{when:T==="tutor-google-meet"},(0,a.tZ)(O.Z,{data:null,topicId:y,onCancel:function t(){return I(null)},meetingId:g}))),(0,a.tZ)(Yt.Z,{isOpen:C,isLoading:rt.isPending||nt.isPending||ot.isPending,triggerRef:B,closePopover:F.ZT,maxWidth:"258px",title:(0,u.sprintf)((0,u.__)('Delete "%s"',"tutor"),o.title),message:(0,u.__)("Are you sure you want to delete this content from your course? This cannot be undone.","tutor"),animationType:on.ru.slideUp,arrow:"auto",hideArrow:true,confirmButton:{text:(0,u.__)("Delete","tutor"),variant:"text",isDelete:true},cancelButton:{text:(0,u.__)("Cancel","tutor"),variant:"text"},onConfirmation:ct,onCancel:function t(){return W(false)}}))};const Wi=Di;var Qi=true?{name:"1jfpmb0",styles:"[data-content-icon]{display:none;}[data-bar-icon]{display:block;}cursor:grabbing"}:0;var Ni={wrapper:function t(e){var r=e.isDragging,n=r===void 0?false:r,o=e.isOverlay,i=o===void 0?false:o,u=e.isActive,s=u===void 0?false:u;return(0,a.iv)("width:100%;padding:",D.W0[10]," ",D.W0[8],";border:1px solid transparent;border-radius:",D.E0[6],";display:flex;justify-content:space-between;align-items:center;[data-content-icon],[data-bar-icon]{display:flex;height:24px;}:hover,:focus-within{border-color:",D.Jv.stroke.border,";background-color:",D.Jv.background.white,";[data-content-icon]{display:none;}[data-bar-icon]{display:block;}[data-actions]{opacity:",n?0:1,";}}",s&&(0,a.iv)("border-color:",D.Jv.stroke.border,";background-color:",D.Jv.background.white,";[data-content-icon]{display:flex;}[data-bar-icon]{display:none;}[data-actions]{opacity:1;}"+(true?"":0),true?"":0)," ",i&&(0,a.iv)("box-shadow:",D.AF.drag,";border-color:",D.Jv.stroke.border,";background-color:",D.Jv.background.white,";[data-actions]{opacity:1;}"+(true?"":0),true?"":0),";"+(true?"":0),true?"":0)},title:(0,a.iv)(W.c.caption(),";color:",D.Jv.text.title,";display:flex;align-items:center;gap:",D.W0[4],";cursor:pointer;[data-question-count]{color:",D.Jv.text.hints,";}"+(true?"":0),true?"":0),iconAndTitle:function t(e){var r=e.isDragging,n=r===void 0?false:r;return(0,a.iv)("display:flex;align-items:center;gap:",D.W0[8],";cursor:grab;flex-grow:1;[data-bar-icon]{display:none;}",n&&Qi,";"+(true?"":0),true?"":0)},actions:(0,a.iv)("display:flex;opacity:0;align-items:start;gap:",D.W0[8],";justify-content:end;"+(true?"":0),true?"":0)};function Ji(t){"@babel/helpers - typeof";return Ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ji(t)}function Fi(){Fi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};return Fi.apply(this,arguments)}function Bi(t,e){return Ui(t)||Vi(t,e)||Gi(t,e)||Ri()}function Ri(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Gi(t,e){if(!t)return;if(typeof t==="string")return Mi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mi(t,e)}function Mi(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vi(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function Ui(t){if(Array.isArray(t))return t}function Hi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Yi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Hi(Object(r),!0).forEach((function(e){$i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Hi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $i(t,e,r){e=Ki(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function Ki(t){var e=Xi(t,"string");return Ji(e)==="symbol"?e:String(e)}function Xi(t,e){if(Ji(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(Ji(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ta(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var ea=function t(e){return(0,i.cP)(Yi(Yi({},e),{},{wasDragging:true}))};var ra=function t(e){var r;var n=e.topic,o=e.onDelete,u=e.onCopy,c=e.onSort,l=e.onCollapse,d=e.onEdit,f=e.isOverlay,p=f===void 0?false:f;var v=(0,s.useState)(false),_=Bi(v,2),m=_[0],g=_[1];var b=(0,s.useState)(!n.isSaved),Z=Bi(b,2),x=Z[0],q=Z[1];var O=(0,s.useRef)(null);var S=(0,s.useRef)(null);var j=(0,y.q_)({height:!n.isCollapsed?(r=O.current)===null||r===void 0?void 0:r.scrollHeight:0,opacity:!n.isCollapsed?1:0,overflow:"hidden",config:{duration:300,easing:function t(e){return e*(2-e)}}},[n.contents.length]),k=Bi(j,2),E=k[0],P=k[1];(0,s.useEffect)((function(){var t=function t(e){if((0,eo.$K)(S.current)&&!S.current.contains(e.target)){g(false)}};document.addEventListener("click",t);return function(){return document.removeEventListener("click",t)}}),[x]);var T=(0,i.nB)({id:n.id,data:{type:"topic"},animateLayoutChanges:ea}),I=T.attributes,z=T.listeners,A=T.setNodeRef,C=T.transform,L=T.transition,W=T.isDragging;var Q=(0,s.useCallback)((function(t){if(t){A(t);S.current=t}}),[A]);var N={transform:h.ux.Transform.toString(C),transition:L,opacity:W?.3:undefined,background:W?D.Jv.stroke.hover:undefined};(0,s.useEffect)((function(){if((0,eo.$K)(O.current)){P.start({height:!n.isCollapsed?O.current.scrollHeight:0,opacity:!n.isCollapsed?1:0})}}),[n.isCollapsed,n.contents.length]);return(0,a.tZ)("div",Fi({},n.isSaved?I:{},{css:oa.wrapper({isActive:m||x,isOverlay:p}),onClick:function t(){return g(true)},onKeyDown:F.ZT,tabIndex:-1,ref:Q,style:N}),(0,a.tZ)(ui,{isActive:m,isDragging:W,isEdit:x,listeners:z,onCollapse:function t(e){l===null||l===void 0?void 0:l(e)},onDelete:o,onEdit:function t(e){d===null||d===void 0?void 0:d(e)},onCopy:function t(e){u===null||u===void 0?void 0:u(e)},topic:n,setIsEdit:q}),(0,a.tZ)(y.q.div,{style:Yi({},E)},(0,a.tZ)("div",{css:oa.content,ref:O},(0,a.tZ)(w.Z,{when:n.contents.length>0},(0,a.tZ)(i.Fo,{items:n.contents.map((function(t){return Yi(Yi({},t),{},{id:t.ID})})),strategy:i.qw},(0,a.tZ)("div",null,(0,a.tZ)(he.Z,{each:n.contents},(function(t){return(0,a.tZ)(Wi,{key:t.ID,type:t.post_type,topic:n,content:{id:t.ID,title:t.post_title,total_question:t.total_question||0}})}))))),(0,a.tZ)(Do,{topic:n}))))};const na=ra;var oa={wrapper:function t(e){var r=e.isActive,n=r===void 0?false:r,o=e.isOverlay,i=o===void 0?false:o;return(0,a.iv)("border:1px solid ",D.Jv.stroke["default"],";border-radius:",D.E0[8],";transition:background-color 0.3s ease-in-out,border-color 0.3s ease-in-out;background-color:",D.Jv.bg.white,";width:100%;",n&&(0,a.iv)("border-color:",D.Jv.stroke.brand,";background-color:",D.Jv.background.hover,";"+(true?"":0),true?"":0)," :hover{background-color:",D.Jv.background.hover,";}",i&&(0,a.iv)("box-shadow:",D.AF.drag,";"+(true?"":0),true?"":0),";"+(true?"":0),true?"":0)},content:(0,a.iv)("padding:",D.W0[16],";",_t.i.display.flex("column"),";gap:",D.W0[12],";"+(true?"":0),true?"":0),contentButtons:(0,a.iv)(_t.i.display.flex(),";justify-content:space-between;"+(true?"":0),true?"":0),footerButtons:true?{name:"s5xdrg",styles:"display:flex;align-items:center"}:0,grabButton:function t(e){var r=e.isDragging,n=r===void 0?false:r;return(0,a.iv)(_t.i.resetButton,";",_t.i.flexCenter(),";cursor:",n?"grabbing":"grab",";:disabled{cursor:not-allowed;}"+(true?"":0),true?"":0)},threeDotButton:(0,a.iv)("display:flex;align-items:center;gap:",D.W0[4],";"+(true?"":0),true?"":0),contentButton:(0,a.iv)(":hover:not(:disabled){background-color:",D.Jv.background.white,";color:",D.Jv.text.brand,";box-shadow:inset 0 0 0 1px ",D.Jv.stroke.brand,";}"+(true?"":0),true?"":0)};var ia=r(2322);var aa=r(6051);const ua=r.p+"images/7a3f20a77fdf442a94bc38151eadcfcd-curriculum-empty-state-2x.webp";const sa=r.p+"images/986ea3637213dd5da688bb6f1e1319a6-curriculum-empty-state.webp";var ca=function t(e){var r=e.title;return(0,a.tZ)("div",{css:da.wrapper},(0,a.tZ)(p.Z,{name:"dragVertical",width:24,height:24}),(0,a.tZ)("span",null,r))};const la=ca;var da={wrapper:(0,a.iv)("display:flex;align-items:center;gap:",D.W0[8],";border:1px solid ",D.Jv.stroke["default"],";border-radius:",D.E0[8],";background-color:",D.Jv.background.hover,";padding:",D.W0[12]," ",D.W0[16],";box-shadow:",D.AF.drag,";",W.c.body(),";color:",D.Jv.text.hints,";cursor:grabbing;svg{color:",D.Jv.color.black[40],";flex-shrink:0;}"+(true?"":0),true?"":0)};function fa(t){"@babel/helpers - typeof";return fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fa(t)}function pa(t){return ya(t)||ha(t)||qa(t)||va()}function va(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ha(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ya(t){if(Array.isArray(t))return Oa(t)}function _a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ma(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_a(Object(r),!0).forEach((function(e){ga(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ga(t,e,r){e=ba(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function ba(t){var e=wa(t,"string");return fa(e)==="symbol"?e:String(e)}function wa(t,e){if(fa(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(fa(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Za(t,e){return ja(t)||Sa(t,e)||qa(t,e)||xa()}function xa(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qa(t,e){if(!t)return;if(typeof t==="string")return Oa(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oa(t,e)}function Oa(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Sa(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r["return"]&&(a=r["return"](),Object(a)!==a))return}finally{if(c)throw o}}return u}}function ja(t){if(Array.isArray(t))return t}function ka(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Ea=(0,N.zs)();var Pa=true?{name:"1wuky45",styles:"margin-block:40px"}:0;var Ta=function t(){var e=(0,l.s0)();(0,s.useEffect)((function(){if(!Ea){e("/",{replace:true})}}),[e]);if(!Ea){return null}var r=(0,s.useState)(true),h=Za(r,2),y=h[0],_=h[1];var m=(0,s.useState)(null),g=Za(m,2),b=g[0],Z=g[1];var x=(0,s.useState)([]),q=Za(x,2),O=q[0],S=q[1];var j=(0,s.useRef)([]);var k=(0,Q.rM)(Ea);var E=(0,Q.AI)();(0,s.useEffect)((function(){if(O.length===0){return}S((function(t){if(y){j.current=[]}if(!y){j.current=t.reduce((function(t,e){if(e.isSaved){t.push(e.id)}return t}),[])}return t.map((function(t){if(!t.isSaved){return t}return ma(ma({},t),{},{isCollapsed:y})}))}))}),[y]);(0,s.useEffect)((function(){var t;if(!((t=k.data)!==null&&t!==void 0&&t.length)){return}var e=function t(e){return k.data.map((function(t,r){var n="topic-".concat(t.id);var o=r===0;var i=j.current.includes(n);var a=e.length?!i:!o;if(o&&!e.length){j.current=[n]}return ma(ma({},t),{},{id:n,isCollapsed:a,isSaved:true,contents:t.contents.map((function(t){return ma(ma({},t),{},{ID:"content-".concat(t.ID)})}))})}))};S(e)}),[k.data]);var P=(0,s.useMemo)((function(){if(!b){return null}var t=b.toString().includes("topic")?"topic":"content";var e=O.flatMap((function(t){return t.contents}));var r=t==="topic"?O.find((function(t){return t.id===b})):e.find((function(t){return t.ID===b}));return r}),[b,O]);var T=(0,n.Dy)((0,n.VT)(n.we,{activationConstraint:{distance:10}}),(0,n.VT)(n.Lg,{coordinateGetter:i.is}));if(k.isLoading){return(0,a.tZ)(f.fz,null)}var I=function t(e,r){if(r==="topic"){return O.find((function(t){return t.id===e}))}if(r==="content"){return O.find((function(t){return t.contents.find((function(t){return t.ID===e}))}))}};var z=function t(e){var r=e.active,n=e.over;if(!n||!r){return}if(r.id.toString().includes("content")&&n.id.toString().includes("content")&&r.id!==n.id){var o=I(r.id,"content");var i=I(n.id,"content");if(!o||!i)return;var a=O.findIndex((function(t){return t.id===o.id}));var u=O.findIndex((function(t){return t.id===i.id}));if(i.isCollapsed||a===u){return}var s=o.contents.findIndex((function(t){return t.ID===r.id}));var c=i.contents.findIndex((function(t){return t.ID===n.id}));var l=pa(O);var d=l[a].contents.splice(s,1),f=Za(d,1),p=f[0];l[u].contents.splice(c,0,p);S(l)}if(r.id.toString().includes("content")&&n!==null&&n!==void 0&&n.id.toString().includes("topic")&&r.id!==n.id){var v=I(r.id,"content");var h=I(n.id,"topic");if(!v||!h||h.contents.length>0||h.isCollapsed){return}var y=O.findIndex((function(t){return t.id===v.id}));var _=O.findIndex((function(t){return t.id===h.id}));if(y===_){return}var m=v.contents.findIndex((function(t){return t.ID===r.id}));var g=pa(O);var b=g[y].contents.splice(m,1),w=Za(b,1),Z=w[0];g[_].contents.push(Z);S(g)}};var A=function t(e){var r,n;var o=e.active,i=e.over;if(!i){Z(null);return}var a=pa(O);if(o.id.toString().includes("topic")&&i!==null&&i!==void 0&&i.id.toString().includes("topic")&&o&&o.id!==i.id){var u=O.findIndex((function(t){return t.id===o.id}));var s=O.findIndex((function(t){return t.id===i.id}));a=(0,F.Ao)(a,u,s);S(a)}if(o.id.toString().includes("content")&&i!==null&&i!==void 0&&i.id.toString().includes("content")&&o&&o.id!==i.id){var c=I(o.id,"content");var l=I(i.id,"content");if(!c||!l||l.isCollapsed){return}var d=O.findIndex((function(t){return t.id===c.id}));var f=O.findIndex((function(t){return t.id===l.id}));var p=c.contents.findIndex((function(t){return t.ID===o.id}));var v=l.contents.findIndex((function(t){return t.ID===i.id}));if(d===f){a[d].contents=(0,F.Ao)(a[d].contents,p,v);S(a)}else{var h=a[d].contents.splice(p,1),y=Za(h,1),_=y[0];a[f].contents.splice(v,0,_);S(a)}}if(o.id.toString().includes("content")&&i.id.toString().includes("topic")&&o&&o.id!==i.id){var m=I(o.id,"content");var g=I(i.id,"topic");if(!m||!g||g.isCollapsed){return}var b=O.findIndex((function(t){return t.id===m.id}));var w=O.findIndex((function(t){return t.id===g.id}));var x=m.contents.findIndex((function(t){return t.ID===o.id}));var q=a[b].contents.splice(x,1),j=Za(q,1),P=j[0];a[w].contents.push(P);S(a)}var T=a.reduce((function(t,e,r){var n=0;t[r]={topic_id:(0,N.Wj)("topic-",e.id),lesson_ids:e.contents.reduce((function(t,e){t[n]=(0,N.Wj)("content-",e.ID);n++;return t}),{})};return t}),{});E.mutate(ma({tutor_topics_lessons_sorting:T},o.id.toString().includes("content")&&{"content_parent[parent_topic_id]":(r=k.data)===null||r===void 0?void 0:(n=r.find((function(t){return t.contents.find((function(t){return String(t.ID)===(0,N.Wj)("content-",i.id)}))})))===null||n===void 0?void 0:n.id,"content_parent[content_id]":(0,N.Wj)("content-",o.id)}));Z(null)};var C=function t(e,r){S((function(t){return t.filter((function(t,r){return r!==e}))}));j.current=j.current.filter((function(t){return t!==r}))};var L=function t(e){S((function(t){return t.map((function(t){if(t.id===e){return ma(ma({},t),{},{isCollapsed:!t.isCollapsed})}return t}))}));if(!j.current.includes(e)){j.current=[].concat(pa(j.current),[e])}else{j.current=j.current.filter((function(t){return t!==e}))}};return(0,a.tZ)("div",{css:za.container},(0,a.tZ)("div",{css:za.wrapper},(0,a.tZ)(ia.Z,{title:(0,u.__)("Curriculum","tutor"),backUrl:"/basics",rightButton:(0,a.tZ)(w.Z,{when:O.some((function(t){return t.isSaved}))},(0,a.tZ)(d.Z,{variant:"text",size:"small",onClick:function t(){return _((function(t){return!t}))}},y?(0,u.__)("Expand All","tutor"):(0,u.__)("Collapse All","tutor")))}),(0,a.tZ)("div",{css:za.content},(0,a.tZ)(w.Z,{when:!k.isLoading&&k.data&&(k.data.length>0||O.length>0),fallback:(0,a.tZ)(v.Z,{emptyStateImage:sa,emptyStateImage2x:ua,imageAltText:(0,u.__)("Empty State Illustration","tutor"),title:(0,u.__)("Start building your course!","tutor"),description:(0,u.__)("Add Topics, Lessons, and Quizzes to get started.","tutor"),actions:(0,a.tZ)(d.Z,{variant:"secondary",icon:(0,a.tZ)(p.Z,{name:"plusSquareBrand",width:24,height:25}),onClick:function t(){S((function(t){return[{id:(0,F.x0)(),title:"",summary:"",contents:[],isCollapsed:false,isSaved:false}]}))}},(0,u.__)("Add Topic","tutor"))})},(0,a.tZ)("div",{css:za.topicWrapper},(0,a.tZ)(n.LB,{sensors:T,collisionDetection:n.ey,measuring:an.O,modifiers:[o.hg],onDragStart:function t(e){Z(e.active.id)},onDragOver:function t(e){return z(e)},onDragEnd:function t(e){return A(e)}},(0,a.tZ)(i.Fo,{items:O.map((function(t){return ma(ma({},t),{},{id:t.id})})),strategy:i.qw},(0,a.tZ)(he.Z,{each:O},(function(t,e){return t.isSaved&&(0,a.tZ)(na,{key:t.id,topic:ma(ma({},t),{},{isCollapsed:b!==null&&b!==void 0&&b.toString().includes("topic")?true:t.isCollapsed}),onDelete:function r(){return C(e,t.id)},onCollapse:function t(e){return L(e)},onCopy:function t(e){j.current=[e]},onEdit:function t(e){j.current=[e]}})}))),(0,c.createPortal)((0,a.tZ)(n.y9,null,(0,a.tZ)(w.Z,{when:P},(function(t){return(0,a.tZ)(la,{title:b!==null&&b!==void 0&&b.toString().includes("topic")?t.title:t.post_title})}))),document.body)),(0,a.tZ)(he.Z,{each:O},(function(t,e){return!t.isSaved&&(0,a.tZ)(na,{key:t.id,topic:ma(ma({},t),{},{isCollapsed:false}),onDelete:function r(){return C(e,t.id)},onCollapse:function t(e){return L(e)},onCopy:function t(e){j.current=[e]},onEdit:function t(e){j.current=[e]}})}))))),(0,a.tZ)(w.Z,{when:O.length>0},(0,a.tZ)("div",{css:za.addButtonWrapper},(0,a.tZ)(d.Z,{variant:"secondary",icon:(0,a.tZ)(p.Z,{name:"plusSquareBrand",width:24,height:24}),onClick:function t(){S((function(t){return[].concat(pa(t.map((function(t){return ma(ma({},t),{},{isCollapsed:true})}))),[{id:(0,F.x0)(),title:"",summary:"",contents:[],isCollapsed:false,isSaved:false}])}));j.current=[]}},(0,u.__)("Add Topic","tutor"))))),(0,a.tZ)(aa.Z,{styleModifier:Pa}))};const Ia=Ta;var za={container:(0,a.iv)("margin-top:",D.W0[32],";"+(true?"":0),true?"":0),wrapper:(0,a.iv)("max-width:",D.V4,"px;width:100%;",_t.i.display.flex("column"),";gap:",D.W0[16],";"+(true?"":0),true?"":0),content:(0,a.iv)("margin-top:",D.W0[16],";"+(true?"":0),true?"":0),topicWrapper:(0,a.iv)(_t.i.display.flex("column"),";gap:",D.W0[16],";"+(true?"":0),true?"":0),addButtonWrapper:(0,a.iv)("path{stroke:",D.Jv.icon.brand,";}"+(true?"":0),true?"":0)}},5130:(t,e,r)=>{r.d(e,{$$:()=>k,HD:()=>D,JS:()=>C,MM:()=>q,T1:()=>J,UN:()=>I,_l:()=>P,nz:()=>A,pi:()=>O});var n=r(202);var o=r(6205);var i=r(8551);var a=r(8003);var u=r.n(a);var s=r(3389);var c=r(8305);var l=r(6413);var d=r(7034);var f=r(7307);var p=r(3603);var v=r(5219);function h(t){"@babel/helpers - typeof";return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function y(t,e){var r=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(t))||e&&t&&typeof t.length==="number"){if(r)t=r;var n=0;var o=function t(){};return{s:o,n:function e(){if(n>=t.length)return{done:true};return{done:false,value:t[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=true,a=false,u;return{s:function e(){r=r.call(t)},n:function t(){var e=r.next();i=e.done;return e},e:function t(e){a=true;u=e},f:function t(){try{if(!i&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}}}function _(t,e){if(!t)return;if(typeof t==="string")return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(t,e)}function m(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach((function(e){w(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function w(t,e,r){e=Z(e);if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function Z(t){var e=x(t,"string");return h(e)==="symbol"?e:String(e)}function x(t,e){if(h(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==undefined){var n=r.call(t,e||"default");if(h(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var q=function t(e){var r=function t(e){if(e.image_url){return e.answer_view_format==="text_image"?"no_change":"update"}return e.answer_view_format==="text"?"no_change":"update"};var n=function t(e){if(e.question_settings){e.question_settings.answer_required=!!Number(e.question_settings.answer_required);e.question_settings.show_question_mark=!!Number(e.question_settings.show_question_mark);e.question_settings.randomize_options=!!Number(e.question_settings.randomize_options)}e.question_answers=e.question_answers.map((function(t){return b(b({},t),{},{_data_status:"no_change",is_saved:true,answer_view_format:t.image_url?"text_image":"text"})}));e.question_description=(0,v.qH)(e.question_description)||"";e.answer_explanation=(0,v.qH)(e.answer_explanation)||"";switch(e.question_type){case"single_choice":{return b(b({},e),{},{_data_status:"update",question_type:"multiple_choice",question_answers:e.question_answers.map((function(t){return b(b({},t),{},{_data_status:r(t),answer_view_format:t.image_url?"text_image":"text"})})),question_settings:b(b({},e.question_settings),{},{question_type:"multiple_choice",has_multiple_correct_answer:false})})}case"multiple_choice":{return b(b({},e),{},{_data_status:e.question_settings.has_multiple_correct_answer?"no_change":"update",question_answers:e.question_answers.map((function(t){return b(b({},t),{},{_data_status:r(t),answer_view_format:t.image_url?"text_image":"text"})})),question_settings:b(b({},e.question_settings),{},{has_multiple_correct_answer:e.question_settings.has_multiple_correct_answer?!!Number(e.question_settings.has_multiple_correct_answer):true})})}case"matching":{return b(b({},e),{},{_data_status:e.question_settings.is_image_matching?"no_change":"update",question_settings:b(b({},e.question_settings),{},{is_image_matching:e.question_settings.is_image_matching?!!Number(e.question_settings.is_image_matching):false})})}case"image_matching":{return b(b({},e),{},{_data_status:"update",question_type:"matching",question_settings:b(b({},e.question_settings),{},{question_type:"matching",is_image_matching:true})})}default:return b(b({},e),{},{_data_status:"no_change"})}};return{ID:e.ID,_data_status:"no_change",quiz_title:e.post_title||"",quiz_description:e.post_content||"",quiz_option:{time_limit:{time_value:e.quiz_option.time_limit.time_value||0,time_type:e.quiz_option.time_limit.time_type||"minutes"},hide_quiz_time_display:e.quiz_option.hide_quiz_time_display==="1",feedback_mode:e.quiz_option.feedback_mode||"retry",attempts_allowed:e.quiz_option.attempts_allowed||10,pass_is_required:e.quiz_option.pass_is_required==="1",passing_grade:e.quiz_option.passing_grade||80,max_questions_for_answer:e.quiz_option.max_questions_for_answer||10,quiz_auto_start:e.quiz_option.quiz_auto_start==="1",question_layout_view:e.quiz_option.question_layout_view||"",questions_order:e.quiz_option.questions_order||"rand",hide_question_number_overview:e.quiz_option.hide_question_number_overview==="1",short_answer_characters_limit:e.quiz_option.short_answer_characters_limit||200,open_ended_answer_characters_limit:e.quiz_option.open_ended_answer_characters_limit||500,content_drip_settings:e.quiz_option.content_drip_settings||{unlock_date:"",after_xdays_of_enroll:0,prerequisites:[]}},questions:(e.questions||[]).map((function(t){return n(t)})),deleted_question_ids:[],deleted_answer_ids:[]}};var O=function t(e,r,n,o){return b(b(b({course_id:o,topic_id:r,payload:{ID:e.ID,_data_status:e._data_status,post_title:e.quiz_title,post_content:e.quiz_description,quiz_option:b(b(b({attempts_allowed:e.quiz_option.attempts_allowed,feedback_mode:e.quiz_option.feedback_mode,hide_question_number_overview:e.quiz_option.hide_question_number_overview?"1":"0",hide_quiz_time_display:e.quiz_option.hide_quiz_time_display?"1":"0",max_questions_for_answer:(0,d.ro)(l.AO.H5P_INTEGRATION)&&e.questions.every((function(t){return t.question_type==="h5p"}))?e.questions.length:e.quiz_option.max_questions_for_answer,open_ended_answer_characters_limit:e.quiz_option.open_ended_answer_characters_limit,pass_is_required:e.quiz_option.pass_is_required?"1":"0",passing_grade:e.quiz_option.passing_grade,question_layout_view:e.quiz_option.question_layout_view,questions_order:e.quiz_option.questions_order,quiz_auto_start:e.quiz_option.quiz_auto_start?"1":"0",short_answer_characters_limit:e.quiz_option.short_answer_characters_limit,time_limit:{time_type:e.quiz_option.time_limit.time_type,time_value:e.quiz_option.time_limit.time_value}},(0,d.ro)(l.AO.CONTENT_DRIP)&&n==="unlock_sequentially"&&e.quiz_option.feedback_mode==="retry"&&{pass_is_required:e.quiz_option.pass_is_required?"1":"0"}),(0,d.ro)(l.AO.CONTENT_DRIP)&&{content_drip_settings:b(b(b({},n==="unlock_by_date"&&{unlock_date:e.quiz_option.content_drip_settings.unlock_date}),n==="specific_days"&&{after_xdays_of_enroll:e.quiz_option.content_drip_settings.after_xdays_of_enroll}),n==="after_finishing_prerequisites"&&{prerequisites:e.quiz_option.content_drip_settings.prerequisites})}),(0,d.ro)(l.AO.H5P_INTEGRATION)&&e.questions.every((function(t){return t.question_type==="h5p"}))&&{quiz_type:"tutor_h5p_quiz"}),questions:e.questions.map((function(t){return b(b({_data_status:t._data_status,question_id:t.question_id,question_title:t.question_title,question_description:t.question_description,question_mark:t.question_settings.question_mark},!!c.y.tutor_pro_url&&{answer_explanation:t.answer_explanation}),{},{question_type:t.question_type,question_order:t.question_order,question_settings:b(b({answer_required:t.question_settings.answer_required?"1":"0",question_mark:t.question_settings.question_mark,question_type:t.question_type,randomize_options:t.question_settings.randomize_options?"1":"0",show_question_mark:t.question_settings.show_question_mark?"1":"0"},t.question_type==="multiple_choice"&&{has_multiple_correct_answer:t.question_settings.has_multiple_correct_answer?"1":"0"}),t.question_type==="matching"&&{is_image_matching:t.question_settings.is_image_matching?"1":"0"}),question_answers:t.question_answers.map((function(e){return{_data_status:e._data_status,answer_id:e.answer_id,belongs_question_id:t.question_id,belongs_question_type:t.question_type,answer_title:e.answer_title,is_correct:e.is_correct,image_id:t.question_type==="matching"&&!t.question_settings.is_image_matching?"":e.image_id,image_url:t.question_type==="matching"&&!t.question_settings.is_image_matching?"":e.image_url,answer_two_gap_match:e.answer_two_gap_match,answer_view_format:e.answer_view_format,answer_order:e.answer_order}}))})}))},deleted_question_ids:e.deleted_question_ids,deleted_answer_ids:e.deleted_answer_ids},(0,d.ro)(l.AO.CONTENT_DRIP)&&n==="unlock_by_date"&&{"content_drip_settings[unlock_date]":e.quiz_option.content_drip_settings.unlock_date}),(0,d.ro)(l.AO.CONTENT_DRIP)&&n==="specific_days"&&{"content_drip_settings[after_xdays_of_enroll]":e.quiz_option.content_drip_settings.after_xdays_of_enroll}),(0,d.ro)(l.AO.CONTENT_DRIP)&&n==="after_finishing_prerequisites"&&{"content_drip_settings[prerequisites]":e.quiz_option.content_drip_settings.prerequisites})};var S=function t(e){return{question_id:e.question_id,question_title:e.question_title,question_description:e.question_description,question_type:e.question_type,question_mark:e.question_mark,answer_explanation:e.answer_explanation,"question_settings[question_type]":e.question_type,"question_settings[answer_required]":e.question_settings.answer_required?1:0,"question_settings[question_mark]":e.question_mark}};var j=function t(e){return f.uF.post(p.Z.ADMIN_AJAX,b({action:"quiz_import_data"},e))};var k=function t(){var e=(0,n.NL)();var r=(0,s.p)(),i=r.showToast;return(0,o.D)({mutationFn:j,onSuccess:function t(r){if(r.success){e.invalidateQueries({queryKey:["Topic"]});i({message:(0,a.__)("Quiz imported successfully","tutor"),type:"success"})}else{i({message:r.data.message,type:"danger"})}},onError:function t(e){i({message:e.response.data.message,type:"danger"})}})};var E=function t(e){return f.uF.post(p.Z.ADMIN_AJAX,{action:"quiz_export_data",quiz_id:e})};var P=function t(){var e=(0,s.p)(),r=e.showToast;return(0,o.D)({mutationFn:E,onSuccess:function t(e){if(!e.success){r({message:(0,a.__)("Something went wrong.","tutor"),type:"danger"});return}var n="";var o=y(e.data.output_quiz_data),i;try{for(o.s();!(i=o.n()).done;){var u=i.value;var s=u.join(",");n+="".concat(s,"\r\n")}}catch(t){o.e(t)}finally{o.f()}var c=new Blob([n],{type:"text/csv"});var l=window.webkitURL.createObjectURL(c);var d=document.createElement("a");d.setAttribute("href",l);d.setAttribute("download","tutor-quiz-".concat(e.data.title,".csv"));document.body.appendChild(d);d.click()},onError:function t(e){r({message:e.response.data.message,type:"danger"})}})};var T=function t(e){return f.RL.post(p.Z.SAVE_QUIZ,b({action:"tutor_quiz_builder_save"},e))};var I=function t(){var e=(0,n.NL)();var r=(0,s.p)(),i=r.showToast;return(0,o.D)({mutationFn:T,onSuccess:function t(r){if(r.data){e.setQueryData(["Quiz",r.data.ID],r.data);e.invalidateQueries({queryKey:["Topic"]});i({message:(0,a.__)(r.message,"tutor"),type:"success"})}},onError:function t(e){i({message:e.response.data.message,type:"danger"})}})};var z=function t(e){return f.uF.post(p.Z.ADMIN_AJAX,{action:"tutor_quiz_details",quiz_id:e})};var A=function t(e){return(0,i.a)({queryKey:["Quiz",e],queryFn:function t(){return z(e).then((function(t){return t.data}))},enabled:!!e})};var C=function t(e,r){if(r===e){return null}if(e==="new"){return"new"}if((e==="update"||e==="no_change")&&r==="update"){return"update"}return"no_change"};var L=function t(e){return f.RL.post(p.Z.GET_H5P_QUIZ_CONTENT,{search_filter:e}).then((function(t){return t.data}))};var D=function t(e,r){return(0,i.a)({queryKey:["H5PQuizContents",e],queryFn:function t(){return L(e)},enabled:r==="tutor_h5p_quiz"})};var W=function t(e){return wpAjaxInstance.post(endpoints.GET_H5P_QUIZ_CONTENT_BY_ID,{content_id:e}).then((function(t){return t.data}))};var Q=function t(e,r){return useQuery({queryKey:["H5PQuizContent",e],queryFn:function t(){return W(e)},enabled:!!e&&r==="tutor_h5p_quiz"})};var N=function t(e){return f.uF.post(p.Z.ADMIN_AJAX,{action:"tutor_quiz_delete",quiz_id:e})};var J=function t(){var e=(0,n.NL)();var r=(0,s.p)(),i=r.showToast;return(0,o.D)({mutationFn:N,onSuccess:function t(r){if(r.status_code===200){i({message:(0,a.__)(r.message,"tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic"]})}},onError:function t(e){i({message:e.response.data.message,type:"danger"})}})}},7692:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/56f20c93d8e28423f724fe4e914fbd21-3d.png"},2663:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/7a53b07b7f13e48b7b7b47dff35d9946-black-and-white.png"},8505:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/9613f2a35fc147cbde38998fc279f6e9-concept.png"},9554:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/ff5a8a3d6c18c02f00d659da3824176b-dreamy.png"},628:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/bff40839481a6e109932774fea006137-filmic.png"},7210:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/dec5e33b385ba1a7c841dde2b6c1a5af-illustration.png"},4246:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/83571e85f649c56b82349466a5b4c844-neon.png"},121:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/9dcf3f4907036dd08b31bf2a7181bed0-none.jpg"},7758:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/fc8edfd709e8f6ed349b59a0f0a00647-painting.png"},4121:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/32925d4873712d856f4abc340b3334cb-photo.png"},4446:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/fb8df26f9102747dfafc31d912d6d074-retro.png"},9463:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/7c935ca7690aecae8c42142d8cec660e-sketch.png"},9502:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/e67e28356e87045281d41cd6583f5c41-generate-image-2x.webp"},8037:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"images/9c13bda85170ee68f15380378d920fd1-generate-image.webp"}}]);

Filemanager

Name Type Size Permission Actions
images Folder 0755
lazy-chunks Folder 0755
lib Folder 0755
105.js File 13.95 KB 0644
12.js File 55.83 KB 0644
46.js File 2.62 KB 0644
51.js File 2.88 KB 0644
558.js File 59.24 KB 0644
739.js File 54.35 KB 0644
883.js File 208.07 KB 0644
887.js File 94.43 KB 0644
979.js File 43.56 KB 0644
tutor-addon-list.min.js File 445.56 KB 0644
tutor-admin.min.js File 112.22 KB 0644
tutor-coupon.min.js File 591.12 KB 0644
tutor-course-builder.min.js File 617.22 KB 0644
tutor-front.min.js File 350.61 KB 0644
tutor-gutenberg.min.js File 1.08 KB 0644
tutor-order-details.min.js File 410.39 KB 0644
tutor-payment-settings.min.js File 275.35 KB 0644
tutor-setup.min.js File 69.25 KB 0644
tutor-shared.min.js File 894.53 KB 0644
tutor-tax-settings.min.js File 221.6 KB 0644
tutor.min.js File 369.72 KB 0644