"use strict";(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[2199],{75781:(e,t,i)=>{i.d(t,{l:()=>n,v:()=>c});var r=i(80643),s=i(91702),a=i(19036);function n(e){const t=(0,r.path_split)(e),i=(0,r.separate_file_extension)(t.tail);return{directory:t.head,base:i.name,filename:t.tail}}function c(e,t){const i=(0,r.encode_path)(t);return(0,s.join)(a.appBasePath,e,"raw",i)}},62199:(e,t,i)=>{i.r(t),i.d(t,{Actions:()=>_});var r=i(90243),s=i.n(r),a=i(26616),n=i(91367),c=i(75781);class _ extends a.e{_init2(){this.is_public||(this._init_syncstring_value(),this._init_spellcheck(),this._init_iframe_reload())}_init_iframe_reload(){this._syncstring.on("save-to-disk",(()=>{this.set_reload("iframe")}))}_raw_default_frame_tree(){return this.is_public?{type:"html"}:{direction:"col",type:"node",first:{type:"cm"},second:{type:"iframe"}}}reload(e){const t=this._get_frame_node(e);t&&("iframe"===t.get("type")?this.set_reload("iframe",(new Date).getTime()):super.reload(e))}print(e){const t=this._get_frame_node(e);if(t)if("cm"!==t.get("type"))try{switch(t.get("type")){case"iframe":(0,n.kX)({src:(0,c.v)(this.project_id,this.path)});break;case"preview":(0,n.kX)({html:s()(`#frame-${e}`).html(),project_id:this.project_id,path:this.path});break;default:throw Error("Printing not implemented")}}catch(e){this.set_error(e)}else super.print(e)}}}}]);