@cocalc/static
Version:
CoCalc's static frontend Webpack-based build system and framework
1 lines • 6.79 kB
JavaScript
"use strict";(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[9364],{12430:(t,e,n)=>{n.d(e,{l:()=>c,v:()=>a});var r=n(24620),i=n(56393),o=n(41780);function c(t){var e=(0,r.path_split)(t),n=(0,r.separate_file_extension)(e.tail);return{directory:e.head,base:n.name,filename:e.tail}}function a(t,e){var n=(0,r.encode_path)(e);return(0,i.join)(o.appBasePath,t,"raw",n)}},59364:(t,e,n)=>{n.r(e),n.d(e,{Actions:()=>x});var r=n(56160),i=n(38198),o=n(94873),c=n(24620);function a(t,e,n,r,i,o,c){try{var a=t[o](c),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function c(t){a(o,r,i,c,u,"next",t)}function u(t){a(o,r,i,c,u,"throw",t)}c(void 0)}))}}var s=function(t,e){var n,r,i,o,c={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,r=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!((i=(i=c.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){c.label=o[1];break}if(6===o[0]&&c.label<i[1]){c.label=i[1],i=o;break}if(i&&c.label<i[2]){c.label=i[2],c.ops.push(o);break}i[2]&&c.ops.pop(),c.trys.pop();continue}o=e.call(t,c)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};function l(t,e,n){return f.apply(this,arguments)}function f(){return(f=u((function(t,e,n){var r;return s(this,(function(i){switch(i.label){case 0:return r=(0,c.aux_file)(e,"html"),[4,(0,o.GL)({command:"pandoc",args:["--toc","-f","mediawiki","-t","html5","--highlight-style","pygments",e,"-o",r],project_id:t,err_on_exit:!0,aggregate:n})];case 1:return i.sent(),[2]}}))}))).apply(this,arguments)}var h=n(78193),p=n(12430);function y(t,e,n,r,i,o,c){try{var a=t[o](c),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function _(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function c(t){y(o,r,i,c,a,"next",t)}function a(t){y(o,r,i,c,a,"throw",t)}c(void 0)}))}}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e,n){return v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=d(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}},v(t,e,n||t)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function w(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 m(t,e){return m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},m(t,e)}var g=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};var k=function(t,e){var n,r,i,o,c={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,r=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!((i=(i=c.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){c.label=o[1];break}if(6===o[0]&&c.label<i[1]){c.label=i[1],i=o;break}if(i&&c.label<i[2]){c.label=i[2],c.ops.push(o);break}i[2]&&c.ops.pop(),c.trys.pop();continue}o=e.call(t,c)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},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&&m(t,e)}(o,t);var e,n,i=(e=o,n=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,r=d(e);if(n){var i=d(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return w(this,t)});function o(){var t;return b(this,o),(t=i.apply(this,arguments))._last_wiki_hash="",t}var a=o.prototype;return a._init2=function(){this.is_public||this._init_wiki2html()},a._init_wiki2html=function(){this.run_wiki2html=(0,r.reuseInFlight)(this._run_wiki2html.bind(this));var t=this;this._syncstring.on("save-to-disk",(0,r.reuseInFlight)(_((function(){var e;return k(this,(function(n){switch(n.label){case 0:return null==t._syncstring?[2]:(e=t._syncstring.hash_of_saved_version(),t._last_wiki_hash==e?[3,2]:(t._last_wiki_hash=e,[4,t.run_wiki2html()]));case 1:n.sent(),n.label=2;case 2:return[2]}}))})))),this._syncstring.once("ready",this.run_wiki2html.bind(this))},a._run_wiki2html=function(t){var e=this;return _((function(){var n;return k(this,(function(r){switch(r.label){case 0:e.set_status("Converting wiki to html (using pandoc)..."),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,l(e.project_id,e.path,t)];case 2:return r.sent(),e.set_reload("html"),[3,5];case 3:return n=r.sent(),e.set_error(n),[3,5];case 4:return e.set_status(""),[7];case 5:return[2]}}))}))()},a._raw_default_frame_tree=function(){return this.is_public?{type:"cm"}:{direction:"col",type:"node",first:{type:"cm"},second:{type:"html"}}},a.print=function(t){var e=this._get_frame_node(t);if(e){var n=e.get("type");if("cm"!=n)if("html"==n)try{(0,h.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 v(d(o.prototype),"print",this).call(this,t)}},o}(i.Actions)}}]);