"use strict";(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[5305],{85305:(s,t,e)=>{e.r(t),e.d(t,{Actions:()=>o,CourseEditorActions:()=>o});var c=e(26616),i=e(28610);class o extends c.e{constructor(){super(...arguments),this.doctype="none"}_raw_default_frame_tree(){return{type:"course_students"}}_init2(){this.init_course_actions_and_store(),this.init_changes_state()}close(){this.close_course_actions_and_store(),super.close()}init_changes_state(){const s=this.course_actions.syncdb;s.on("has-uncommitted-changes",(s=>this.setState({has_uncommitted_changes:s}))),s.on("has-unsaved-changes",(s=>{this.setState({has_unsaved_changes:s})}))}init_course_actions_and_store(){this.course_actions=(0,i.LM)({redux:this.redux,path:this.path,project_id:this.project_id})}close_course_actions_and_store(){(0,i.ex)({redux:this.redux,path:this.path,project_id:this.project_id})}save(s=!0){return t=this,null,e=function*(){if(null!=this.course_actions&&null!=this.course_actions.syncdb&&this.course_actions.syncdb.has_unsaved_changes())try{this.setState({is_saving:!0}),yield this.course_actions.save()}catch(s){if(console.warn("save_to_disk",this.path,"ERROR",s),"closed"==this._state)return;this.set_error(`error saving file to disk -- ${s}`)}finally{this.setState({is_saving:!1})}},new Promise(((s,c)=>{var i=s=>{try{n(e.next(s))}catch(s){c(s)}},o=s=>{try{n(e.throw(s))}catch(s){c(s)}},n=t=>t.done?s(t.value):Promise.resolve(t.value).then(i,o);n((e=e.apply(t,null)).next())}));var t,e}exit_undo_mode(){this.course_actions.syncdb.exit_undo_mode()}undo(s){this.course_actions.syncdb.undo(),this.course_actions.syncdb.commit()}redo(s){this.course_actions.syncdb.redo(),this.course_actions.syncdb.commit()}}}}]);