@cocalc/static
Version:
CoCalc's static frontend Webpack-based build system and framework
1 lines • 6.84 kB
JavaScript
"use strict";(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[5403],{12430:(t,e,r)=>{r.d(e,{l:()=>s,v:()=>c});var n=r(24620),o=r(56393),i=r(41780);function s(t){var e=(0,n.path_split)(t),r=(0,n.separate_file_extension)(e.tail);return{directory:e.head,base:r.name,filename:e.tail}}function c(t,e){var r=(0,n.encode_path)(e);return(0,o.join)(i.appBasePath,t,"raw",r)}},75403:(t,e,r)=>{r.r(e),r.d(e,{Actions:()=>x});var n=r(56160),o=r(5010),i=r(78193),s=r(94873),c=r(24620);function u(t,e,r,n,o,i,s){try{var c=t[i](s),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function s(t){u(i,n,o,s,c,"next",t)}function c(t){u(i,n,o,s,c,"throw",t)}s(void 0)}))}}var l=function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};function f(t,e,r){return h.apply(this,arguments)}function h(){return(h=a((function(t,e,r){return l(this,(function(n){return[2,(0,s.GL)({command:"rst2html",args:[e,(0,c.aux_file)(e,"html")],project_id:t,err_on_exit:!0,aggregate:r})]}))}))).apply(this,arguments)}var p=r(12430);function _(t,e,r,n,o,i,s){try{var c=t[i](s),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function y(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function s(t){_(i,n,o,s,c,"next",t)}function c(t){_(i,n,o,s,c,"throw",t)}s(void 0)}))}}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e,r){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=d(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},b(t,e,r||t)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function m(t,e){return!e||"object"!==g(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function w(t,e){return w=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},w(t,e)}var g=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};var k=function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},x=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&w(t,e)}(s,t);var e,r,o=(e=s,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=d(e);if(r){var o=d(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return m(this,t)});function s(){var t;return v(this,s),(t=o.apply(this,arguments))._last_rst_hash="",t}var u=s.prototype;return u._init2=function(){this.is_public?this._init_value():(this._init_syncstring_value(),this._init_spellcheck(),this._init_rst2html())},u._init_rst2html=function(){this.run_rst2html=(0,n.reuseInFlight)(this._run_rst2html.bind(this));var t=this;this._syncstring.on("save-to-disk",(0,n.reuseInFlight)(y((function(){var e;return k(this,(function(r){switch(r.label){case 0:return null==t._syncstring?[2]:(e=t._syncstring.hash_of_saved_version(),t._last_rst_hash==e?[3,2]:(t._last_rst_hash=e,[4,t.run_rst2html()]));case 1:r.sent(),r.label=2;case 2:return[2]}}))})))),this._syncstring.once("ready",this.run_rst2html.bind(this))},u._run_rst2html=function(t){var e=this;return y((function(){var r;return k(this,(function(n){switch(n.label){case 0:e.set_status("Running rst2html..."),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,f(e.project_id,e.path,t)];case 2:return n.sent(),[3,5];case 3:return r=n.sent(),e.set_error(r),[3,5];case 4:return e.set_status(""),[7];case 5:return e.set_reload("rst"),[2]}}))}))()},u._raw_default_frame_tree=function(){return this.is_public?{type:"cm"}:{direction:"col",type:"node",first:{type:"cm"},second:{type:"rst"}}},u.reload=function(t,e){var r=this._get_frame_node(t);r&&("cm"===r.get("type")?this._run_rst2html():(e=e||(new Date).getTime(),this.set_reload("rst",e)))},u.print=function(t){var e=this._get_frame_node(t);if(e){var r=e.get("type");if("cm"!==r)if("rst"===r)try{(0,i.kX)({src:(0,p.v)(this.project_id,(0,c.aux_file)(this.path,"html"))})}catch(t){this.set_error(t)}else this.set_error("printing of #{type} not implemented");else b(d(s.prototype),"print",this).call(this,t)}},s}(o.e)}}]);