diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-09-04 10:59:31 +0300 |
---|---|---|
committer | npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com> | 2019-09-04 11:44:00 +0300 |
commit | 930909d7ad2da93644ecb4df02f4f69fc96ae81d (patch) | |
tree | aec9e2e2444b518d756d73503fa023d61e8fb4ef /js/editor.js | |
parent | a89449926a62529b5c29b1108e7e8c6c02e48bf6 (diff) |
Use tightLists option
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'js/editor.js')
-rw-r--r-- | js/editor.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/js/editor.js b/js/editor.js index c88cdecea..bb570eef9 100644 --- a/js/editor.js +++ b/js/editor.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[187],{268:function(e,t,n){"use strict";var r=n(46),o=n(52);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}function l(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)} +(window.textWebpackJsonp=window.textWebpackJsonp||[]).push([[187],{268:function(e,t,r){"use strict";var n=r(48),o=r(53);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}function l(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)} /* * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net> * @@ -19,7 +19,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * - */var h=function(e){function t(){return s(this,t),l(this,u(t).apply(this,arguments))}return d(t,o["b"]),c(t,[{key:"name",get:function(){return"strong"}}]),t}(),f=function(e){function t(){return s(this,t),l(this,u(t).apply(this,arguments))}return d(t,o["m"]),c(t,[{key:"name",get:function(){return"em"}}]),t}(),m=function(e){function t(){return s(this,t),l(this,u(t).apply(this,arguments))}return d(t,o["q"]),c(t,[{key:"schema",get:function(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:function(e){return"line-through"===e}}],toDOM:function(){return["s",0]},toMarkdown:{open:"~~",close:"~~",mixable:!0,expelEnclosingWhitespace:!0}}}}]),t}(),v=["image/png","image/jpeg","image/gif","image/x-xbitmap","image/bmp","image/svg+xml"],b=function(e,t){var n=e.split("#")[1];if(void 0!==n){var r=n.split("&");if(void 0!==r)for(var o=0;o<r.length;o++){var i=r[o].split("=");if(decodeURIComponent(i[0])===t)return decodeURIComponent(i[1])}}},y={name:"ImageView",props:["node","updateAttrs","view"],data:function(){return{imageLoaded:!1,loaded:!1,failed:!1}},computed:{mimeIcon:function(){var e=b(this.src,"mimetype");return e?{backgroundImage:"url("+window.OC.MimeType.getIconUrl(e)+")"}:{}},isSupportedImage:function(){var e=b(this.src,"mimetype");return void 0===e||-1!==v.indexOf(e)},internalLinkOrImage:function(){var e=b(this.src,"fileId");return e?OC.generateUrl("/f/"+e):this.src},src:{get:function(){return this.node.attrs.src},set:function(e){this.updateAttrs({src:e})}},alt:{get:function(){return this.node.attrs.alt?this.node.attrs.alt:""},set:function(e){this.updateAttrs({alt:e})}},t:function(){return function(e,t){return window.t(e,t)}}},beforeMount:function(){var e=this;if(!this.isSupportedImage)return this.failed=!0,this.imageLoaded=!1,void(this.loaded=!0);var t=new Image;t.src=this.node.attrs.src,t.onload=function(){e.imageLoaded=!0},t.onerror=function(){e.failed=!0,e.imageLoaded=!1,e.loaded=!0}},methods:{updateAlt:function(){this.alt=this.$refs.altInput.value},onLoaded:function(){this.loaded=!0}}},g=(n(281),n(5)),j=Object(g.a)(y,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"image",class:{"icon-loading":!e.loaded},attrs:{"data-src":e.src}},[e.imageLoaded&&e.isSupportedImage?n("div",[n("transition",{attrs:{name:"fade"}},[n("img",{directives:[{name:"show",rawName:"v-show",value:e.loaded,expression:"loaded"}],staticClass:"image__main",attrs:{src:e.src},on:{load:e.onLoaded}})]),e._v(" "),n("transition",{attrs:{name:"fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.loaded,expression:"loaded"}],staticClass:"image__caption"},[n("input",{ref:"altInput",attrs:{type:"text"},domProps:{value:e.alt},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.updateAlt()}}})])])],1):n("div",{staticClass:"image__placeholder"},[n("transition",{attrs:{name:"fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.loaded,expression:"loaded"}],staticClass:"image__main"},[n("div",{staticClass:"icon-image",style:e.mimeIcon}),e._v(" "),n("p",[n("a",{attrs:{href:e.internalLinkOrImage,target:"_blank"}},[e._v(e._s(e.isSupportedImage?e.t("text","Show image"):e.t("text","Show file")))])])])]),n("transition",{attrs:{name:"fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.loaded,expression:"loaded"}],staticClass:"image__caption"},[n("input",{ref:"altInput",attrs:{type:"text"},domProps:{value:e.alt},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.updateAlt()}}})])])],1)])},[],!1,null,"3153cb96",null).exports;function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function O(e,t,n){return(O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=P(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)} + */var h=function(e){function t(){return s(this,t),l(this,u(t).apply(this,arguments))}return d(t,o["b"]),c(t,[{key:"name",get:function(){return"strong"}}]),t}(),f=function(e){function t(){return s(this,t),l(this,u(t).apply(this,arguments))}return d(t,o["m"]),c(t,[{key:"name",get:function(){return"em"}}]),t}(),m=function(e){function t(){return s(this,t),l(this,u(t).apply(this,arguments))}return d(t,o["q"]),c(t,[{key:"schema",get:function(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:function(e){return"line-through"===e}}],toDOM:function(){return["s",0]},toMarkdown:{open:"~~",close:"~~",mixable:!0,expelEnclosingWhitespace:!0}}}}]),t}(),v=["image/png","image/jpeg","image/gif","image/x-xbitmap","image/bmp","image/svg+xml"],b=function(e,t){var r=e.split("#")[1];if(void 0!==r){var n=r.split("&");if(void 0!==n)for(var o=0;o<n.length;o++){var i=n[o].split("=");if(decodeURIComponent(i[0])===t)return decodeURIComponent(i[1])}}},y={name:"ImageView",props:["node","updateAttrs","view"],data:function(){return{imageLoaded:!1,loaded:!1,failed:!1}},computed:{mimeIcon:function(){var e=b(this.src,"mimetype");return e?{backgroundImage:"url("+window.OC.MimeType.getIconUrl(e)+")"}:{}},isSupportedImage:function(){var e=b(this.src,"mimetype");return void 0===e||-1!==v.indexOf(e)},internalLinkOrImage:function(){var e=b(this.src,"fileId");return e?OC.generateUrl("/f/"+e):this.src},src:{get:function(){return this.node.attrs.src},set:function(e){this.updateAttrs({src:e})}},alt:{get:function(){return this.node.attrs.alt?this.node.attrs.alt:""},set:function(e){this.updateAttrs({alt:e})}},t:function(){return function(e,t){return window.t(e,t)}}},beforeMount:function(){var e=this;if(!this.isSupportedImage)return this.failed=!0,this.imageLoaded=!1,void(this.loaded=!0);var t=new Image;t.src=this.node.attrs.src,t.onload=function(){e.imageLoaded=!0},t.onerror=function(){e.failed=!0,e.imageLoaded=!1,e.loaded=!0}},methods:{updateAlt:function(){this.alt=this.$refs.altInput.value},onLoaded:function(){this.loaded=!0}}},g=(r(281),r(5)),j=Object(g.a)(y,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"image",class:{"icon-loading":!e.loaded},attrs:{"data-src":e.src}},[e.imageLoaded&&e.isSupportedImage?r("div",[r("transition",{attrs:{name:"fade"}},[r("img",{directives:[{name:"show",rawName:"v-show",value:e.loaded,expression:"loaded"}],staticClass:"image__main",attrs:{src:e.src},on:{load:e.onLoaded}})]),e._v(" "),r("transition",{attrs:{name:"fade"}},[r("div",{directives:[{name:"show",rawName:"v-show",value:e.loaded,expression:"loaded"}],staticClass:"image__caption"},[r("input",{ref:"altInput",attrs:{type:"text"},domProps:{value:e.alt},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.updateAlt()}}})])])],1):r("div",{staticClass:"image__placeholder"},[r("transition",{attrs:{name:"fade"}},[r("div",{directives:[{name:"show",rawName:"v-show",value:e.loaded,expression:"loaded"}],staticClass:"image__main"},[r("div",{staticClass:"icon-image",style:e.mimeIcon}),e._v(" "),r("p",[r("a",{attrs:{href:e.internalLinkOrImage,target:"_blank"}},[e._v(e._s(e.isSupportedImage?e.t("text","Show image"):e.t("text","Show file")))])])])]),r("transition",{attrs:{name:"fade"}},[r("div",{directives:[{name:"show",rawName:"v-show",value:e.loaded,expression:"loaded"}],staticClass:"image__caption"},[r("input",{ref:"altInput",attrs:{type:"text"},domProps:{value:e.alt},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.updateAlt()}}})])])],1)])},[],!1,null,"3153cb96",null).exports;function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function O(e,t,r){return(O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=P(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)} /* * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net> * @@ -40,7 +40,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * - */var C=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),x(this,P(t).apply(this,arguments))}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(t,o["l"]),n=t,(r=[{key:"view",get:function(){return j}},{key:"schema",get:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(n,!0).forEach(function(t){S(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},O(P(t.prototype),"schema",this),{selectable:!1})}}])&&_(n.prototype,r),i&&_(n,i),t}(),M=n(57);function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)} + */var C=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),x(this,P(t).apply(this,arguments))}var r,n,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(t,o["l"]),r=t,(n=[{key:"view",get:function(){return j}},{key:"schema",get:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(r,!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},O(P(t.prototype),"schema",this),{selectable:!1})}}])&&_(r.prototype,n),i&&_(r,i),t}(),I=r(71);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function R(e,t){return!t||"object"!==M(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)} /* * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net> * @@ -61,7 +61,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * - */var D=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),R(this,N(t).apply(this,arguments))}var n,o,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&L(e,t)}(t,r["g"]),n=t,(o=[{key:"keys",value:function(){var e=this;return{Tab:function(t){return Object(M.c)("\t")(t,e.editor.view.dispatch,e.editor.view),!0}}}},{key:"name",get:function(){return"doc"}},{key:"schema",get:function(){return{content:"block"}}}])&&T(n.prototype,o),i&&T(n,i),t}(),U=n(73),A=n.n(U),z=n(338); + */var D=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),R(this,N(t).apply(this,arguments))}var r,o,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&L(e,t)}(t,n["g"]),r=t,(o=[{key:"keys",value:function(){var e=this;return{Tab:function(t){return Object(I.c)("\t")(t,e.editor.view.dispatch,e.editor.view),!0}}}},{key:"name",get:function(){return"doc"}},{key:"schema",get:function(){return{content:"block"}}}])&&T(r.prototype,o),i&&T(r,i),t}(),U=r(73),A=r.n(U),z=r(338); /* * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net> * @@ -82,7 +82,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * - */function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function B(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(n,!0).forEach(function(t){G(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}n.d(t,"d",function(){return J}),n.d(t,"a",function(){return W}),n.d(t,"b",function(){return Y}),n.d(t,"e",function(){return Z}),n.d(t,"c",function(){return $}); + */function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function B(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(r,!0).forEach(function(t){G(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function G(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}r.d(t,"d",function(){return J}),r.d(t,"a",function(){return W}),r.d(t,"b",function(){return Y}),r.d(t,"e",function(){return Z}),r.d(t,"c",function(){return $}); /* * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net> * @@ -104,7 +104,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -var $=function(){var e,t=(e=regeneratorRuntime.mark(function e(t){var r,o,i,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=[t],o={},i=0;case 3:if(!(i<r.length)){e.next=17;break}return e.prev=4,e.next=7,n(339)("./"+r[i]);case 7:s=e.sent,o[r[i]]=s.default,e.next=14;break;case 11:return e.prev=11,e.t0=e.catch(4),e.abrupt("return",void 0);case 14:i++,e.next=3;break;case 17:if(0!==Object.keys(o).length||o.constructor!==Object){e.next=19;break}return e.abrupt("return",void 0);case 19:return e.abrupt("return",{languages:o});case 20:case"end":return e.stop()}},e,null,[[4,11]])}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){H(i,r,o,s,a,"next",e)}function a(e){H(i,r,o,s,a,"throw",e)}s(void 0)})});return function(e){return t.apply(this,arguments)}}(),W=function(e){var t=e.content,n=e.onInit,i=e.onUpdate,s=e.extensions,a=e.enableRichEditing,c=e.languages,l=[];return l=a?[new o.i,new o.d,new h,new f,new m,new o.h,new o.k,new o.c,new o.p,new o.a,new o.e,new o.o,new o.n,new C]:[new D,new r.j,new o.f(F({},c))],s=s||[],new r.a({content:t,onInit:n,onUpdate:i,extensions:[].concat(B(l),[new o.j]).concat(s),useBuiltInExtensions:a})},J=A()("commonmark",{html:!1,breaks:!1}).enable("strikethrough"),K=function(e){this.message=e},Y=function(e,t){var n=Object.entries(e).filter(function(e){return V(e,2)[1].toMarkdown}).reduce(function(e,t){var n=V(t,2);return F({},e,G({},n[0],n[1].toMarkdown))},{}),r=Object.entries(t).filter(function(e){return V(e,2)[1].toMarkdown}).reduce(function(e,t){var n=V(t,2);return F({},e,G({},n[0],n[1].toMarkdown))},{});return{serializer:new z.MarkdownSerializer(F({},z.defaultMarkdownSerializer.nodes,{},n),F({},z.defaultMarkdownSerializer.marks,{},r)),serialize:function(e,t){return this.serializer.serialize(e,t).split("\\[ \\]").join("[ ]").split("\\[x\\]").join("[x]")}}},Z=function(e){var t=e.getJSON();if(1!==t.content.length||void 0===t.content[0].content||1!==t.content[0].content.length){if("code_block"===t.content[0].type&&void 0===t.content[0].content)return"";throw new K("Failed to serialize document to plain text")}var n=t.content[0].content[0];if("text"!==n.type)throw new K("Failed to serialize document to plain text");return n.text}},281:function(e,t,n){"use strict";var r=n(58);n.n(r).a},282:function(e,t,n){(e.exports=n(44)(!1)).push([e.i,".image[data-v-3153cb96] {\n margin: 0;\n padding: 0;\n}\n.image__caption[data-v-3153cb96] {\n text-align: center;\n color: var(--color-text-lighter);\n}\n.image__caption input[type='text'][data-v-3153cb96] {\n width: 100%;\n border: none;\n text-align: center;\n}\n.icon-image[data-v-3153cb96] {\n margin-top: 10px;\n height: 32px;\n padding: 20px;\n background-size: contain;\n}\n.image__loading[data-v-3153cb96] {\n height: 100px;\n}\n.image__placeholder .image__main[data-v-3153cb96] {\n background-color: var(--color-background-dark);\n text-align: center;\n padding: 20px;\n border-radius: var(--border-radius);\n}\n.image__placeholder .image__main .icon-image[data-v-3153cb96] {\n opacity: 0.7;\n}\n.fade-enter-active[data-v-3153cb96] {\n transition: opacity .3s ease-in-out;\n}\n.fade-enter-to[data-v-3153cb96] {\n opacity: 1;\n}\n.fade-enter[data-v-3153cb96] {\n opacity: 0;\n}\n",""])},33:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s}),n.d(t,"c",function(){return c});var r=n(2),o=function(e){(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState)?setTimeout(e,0):document.addEventListener("DOMContentLoaded",e)},i=Object(r.generateUrl)("/apps/text"),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?"".concat(i,"/public/").concat(e):"".concat(i,"/").concat(e)},a=["Artichoke","Arugula","Asparagus","Avocado","Bamboo Shoot","Bean Sprout","Bean","Beet","Belgian Endive","Bell Pepper","Bitter Melon","Bitter Gourd","Bok Choy","Broccoli","Brussels Sprout","Burdock Root","Cabbage","Calabash","Caper","Carrot","Cassava","Cauliflower","Celery","Celery Root","Celtuce","Chayote","Chinese Broccoli","Corn","Baby Corn","Cucumber","English Cucumber","Gherkin","Pickling Cucumber","Daikon Radish","Edamame","Eggplant","Elephant Garlic","Endive","Curly","Escarole","Fennel","Fiddlehead","Galangal","Garlic","Ginger","Grape Leave","Green Bean","Wax Bean","Green","Amaranth Leave","Beet Green","Collard Green","Dandelion Green","Kale","Kohlrabi Green","Mustard Green","Rapini","Spinach","Swiss Chard","Turnip Green","Hearts of Palm","Horseradish","Jerusalem Artichoke","Jícama","Kale","Curly","Lacinato","Ornamental","Kohlrabi","Leeks","Lemongrass","Lettuce","Butterhead","Iceberg","Leaf","Romaine","Lotus Root","Lotus Seed","Mushroom","Napa Cabbage","Nopales","Okra","Olive","Onion","Green Onion","Parsley","Parsley Root","Parsnip","Pepper","Plantain","Potato","Pumpkin","Purslane","Radicchio","Radish","Rutabaga","Shallots","Spinach","Squash","Sweet Potato","Swiss Chard","Taro","Tomatillo","Tomato","Turnip","Water Chestnut","Water Spinach","Watercress","Winter Melon","Yams","Zucchini"],c=function(){return a[Math.floor(Math.random()*a.length)]}},339:function(e,t,n){var r={"./1c":[83,1],"./1c.js":[83,1],"./abnf":[84,2],"./abnf.js":[84,2],"./accesslog":[85,3],"./accesslog.js":[85,3],"./actionscript":[86,4],"./actionscript.js":[86,4],"./ada":[87,5],"./ada.js":[87,5],"./angelscript":[88,6],"./angelscript.js":[88,6],"./apache":[89,7],"./apache.js":[89,7],"./applescript":[90,8],"./applescript.js":[90,8],"./arcade":[91,9],"./arcade.js":[91,9],"./arduino":[92,10],"./arduino.js":[92,10],"./armasm":[93,11],"./armasm.js":[93,11],"./asciidoc":[94,12],"./asciidoc.js":[94,12],"./aspectj":[95,13],"./aspectj.js":[95,13],"./autohotkey":[96,14],"./autohotkey.js":[96,14],"./autoit":[97,15],"./autoit.js":[97,15],"./avrasm":[98,16],"./avrasm.js":[98,16],"./awk":[99,17],"./awk.js":[99,17],"./axapta":[100,18],"./axapta.js":[100,18],"./bash":[101,19],"./bash.js":[101,19],"./basic":[102,20],"./basic.js":[102,20],"./bnf":[103,21],"./bnf.js":[103,21],"./brainfuck":[104,22],"./brainfuck.js":[104,22],"./cal":[105,23],"./cal.js":[105,23],"./capnproto":[106,24],"./capnproto.js":[106,24],"./ceylon":[107,25],"./ceylon.js":[107,25],"./clean":[108,26],"./clean.js":[108,26],"./clojure":[110,27],"./clojure-repl":[109,28],"./clojure-repl.js":[109,28],"./clojure.js":[110,27],"./cmake":[111,29],"./cmake.js":[111,29],"./coffeescript":[112,30],"./coffeescript.js":[112,30],"./coq":[113,31],"./coq.js":[113,31],"./cos":[114,32],"./cos.js":[114,32],"./cpp":[115,33],"./cpp.js":[115,33],"./crmsh":[116,34],"./crmsh.js":[116,34],"./crystal":[117,35],"./crystal.js":[117,35],"./cs":[118,36],"./cs.js":[118,36],"./csp":[119,37],"./csp.js":[119,37],"./css":[120,38],"./css.js":[120,38],"./d":[121,39],"./d.js":[121,39],"./dart":[122,40],"./dart.js":[122,40],"./delphi":[123,41],"./delphi.js":[123,41],"./diff":[124,42],"./diff.js":[124,42],"./django":[125,43],"./django.js":[125,43],"./dns":[126,44],"./dns.js":[126,44],"./dockerfile":[127,45],"./dockerfile.js":[127,45],"./dos":[128,46],"./dos.js":[128,46],"./dsconfig":[129,47],"./dsconfig.js":[129,47],"./dts":[130,48],"./dts.js":[130,48],"./dust":[131,49],"./dust.js":[131,49],"./ebnf":[132,50],"./ebnf.js":[132,50],"./elixir":[133,51],"./elixir.js":[133,51],"./elm":[134,52],"./elm.js":[134,52],"./erb":[135,53],"./erb.js":[135,53],"./erlang":[137,54],"./erlang-repl":[136,55],"./erlang-repl.js":[136,55],"./erlang.js":[137,54],"./excel":[138,56],"./excel.js":[138,56],"./fix":[139,57],"./fix.js":[139,57],"./flix":[140,58],"./flix.js":[140,58],"./fortran":[141,59],"./fortran.js":[141,59],"./fsharp":[142,60],"./fsharp.js":[142,60],"./gams":[143,61],"./gams.js":[143,61],"./gauss":[144,62],"./gauss.js":[144,62],"./gcode":[145,63],"./gcode.js":[145,63],"./gherkin":[146,64],"./gherkin.js":[146,64],"./glsl":[147,65],"./glsl.js":[147,65],"./gml":[148,66],"./gml.js":[148,66],"./go":[149,67],"./go.js":[149,67],"./golo":[150,68],"./golo.js":[150,68],"./gradle":[151,69],"./gradle.js":[151,69],"./groovy":[152,70],"./groovy.js":[152,70],"./haml":[153,71],"./haml.js":[153,71],"./handlebars":[154,72],"./handlebars.js":[154,72],"./haskell":[155,73],"./haskell.js":[155,73],"./haxe":[156,74],"./haxe.js":[156,74],"./hsp":[157,75],"./hsp.js":[157,75],"./htmlbars":[158,76],"./htmlbars.js":[158,76],"./http":[159,77],"./http.js":[159,77],"./hy":[160,78],"./hy.js":[160,78],"./inform7":[161,79],"./inform7.js":[161,79],"./ini":[162,80],"./ini.js":[162,80],"./irpf90":[163,81],"./irpf90.js":[163,81],"./isbl":[164,82],"./isbl.js":[164,82],"./java":[165,83],"./java.js":[165,83],"./javascript":[166,84],"./javascript.js":[166,84],"./jboss-cli":[167,85],"./jboss-cli.js":[167,85],"./json":[168,86],"./json.js":[168,86],"./julia":[170,87],"./julia-repl":[169,88],"./julia-repl.js":[169,88],"./julia.js":[170,87],"./kotlin":[171,89],"./kotlin.js":[171,89],"./lasso":[172,90],"./lasso.js":[172,90],"./ldif":[173,91],"./ldif.js":[173,91],"./leaf":[174,92],"./leaf.js":[174,92],"./less":[175,93],"./less.js":[175,93],"./lisp":[176,94],"./lisp.js":[176,94],"./livecodeserver":[177,95],"./livecodeserver.js":[177,95],"./livescript":[178,96],"./livescript.js":[178,96],"./llvm":[179,97],"./llvm.js":[179,97],"./lsl":[180,98],"./lsl.js":[180,98],"./lua":[181,99],"./lua.js":[181,99],"./makefile":[182,100],"./makefile.js":[182,100],"./markdown":[183,101],"./markdown.js":[183,101],"./mathematica":[184,102],"./mathematica.js":[184,102],"./matlab":[185,103],"./matlab.js":[185,103],"./maxima":[186,104],"./maxima.js":[186,104],"./mel":[187,105],"./mel.js":[187,105],"./mercury":[188,106],"./mercury.js":[188,106],"./mipsasm":[189,107],"./mipsasm.js":[189,107],"./mizar":[190,108],"./mizar.js":[190,108],"./mojolicious":[191,109],"./mojolicious.js":[191,109],"./monkey":[192,110],"./monkey.js":[192,110],"./moonscript":[193,111],"./moonscript.js":[193,111],"./n1ql":[194,112],"./n1ql.js":[194,112],"./nginx":[195,113],"./nginx.js":[195,113],"./nimrod":[196,114],"./nimrod.js":[196,114],"./nix":[197,115],"./nix.js":[197,115],"./nsis":[198,116],"./nsis.js":[198,116],"./objectivec":[199,117],"./objectivec.js":[199,117],"./ocaml":[200,118],"./ocaml.js":[200,118],"./openscad":[201,119],"./openscad.js":[201,119],"./oxygene":[202,120],"./oxygene.js":[202,120],"./parser3":[203,121],"./parser3.js":[203,121],"./perl":[204,122],"./perl.js":[204,122],"./pf":[205,123],"./pf.js":[205,123],"./pgsql":[206,124],"./pgsql.js":[206,124],"./php":[207,125],"./php.js":[207,125],"./plaintext":[208,126],"./plaintext.js":[208,126],"./pony":[209,127],"./pony.js":[209,127],"./powershell":[210,128],"./powershell.js":[210,128],"./processing":[211,129],"./processing.js":[211,129],"./profile":[212,130],"./profile.js":[212,130],"./prolog":[213,131],"./prolog.js":[213,131],"./properties":[214,132],"./properties.js":[214,132],"./protobuf":[215,133],"./protobuf.js":[215,133],"./puppet":[216,134],"./puppet.js":[216,134],"./purebasic":[217,135],"./purebasic.js":[217,135],"./python":[218,136],"./python.js":[218,136],"./q":[219,137],"./q.js":[219,137],"./qml":[220,138],"./qml.js":[220,138],"./r":[221,139],"./r.js":[221,139],"./reasonml":[222,140],"./reasonml.js":[222,140],"./rib":[223,141],"./rib.js":[223,141],"./roboconf":[224,142],"./roboconf.js":[224,142],"./routeros":[225,143],"./routeros.js":[225,143],"./rsl":[226,144],"./rsl.js":[226,144],"./ruby":[227,145],"./ruby.js":[227,145],"./ruleslanguage":[228,146],"./ruleslanguage.js":[228,146],"./rust":[229,147],"./rust.js":[229,147],"./sas":[230,148],"./sas.js":[230,148],"./scala":[231,149],"./scala.js":[231,149],"./scheme":[232,150],"./scheme.js":[232,150],"./scilab":[233,151],"./scilab.js":[233,151],"./scss":[234,152],"./scss.js":[234,152],"./shell":[235,153],"./shell.js":[235,153],"./smali":[236,154],"./smali.js":[236,154],"./smalltalk":[237,155],"./smalltalk.js":[237,155],"./sml":[238,156],"./sml.js":[238,156],"./sqf":[239,157],"./sqf.js":[239,157],"./sql":[240,158],"./sql.js":[240,158],"./stan":[241,159],"./stan.js":[241,159],"./stata":[242,160],"./stata.js":[242,160],"./step21":[243,161],"./step21.js":[243,161],"./stylus":[244,162],"./stylus.js":[244,162],"./subunit":[245,163],"./subunit.js":[245,163],"./swift":[246,164],"./swift.js":[246,164],"./taggerscript":[247,165],"./taggerscript.js":[247,165],"./tap":[248,166],"./tap.js":[248,166],"./tcl":[249,167],"./tcl.js":[249,167],"./tex":[250,168],"./tex.js":[250,168],"./thrift":[251,169],"./thrift.js":[251,169],"./tp":[252,170],"./tp.js":[252,170],"./twig":[253,171],"./twig.js":[253,171],"./typescript":[254,172],"./typescript.js":[254,172],"./vala":[255,173],"./vala.js":[255,173],"./vbnet":[256,174],"./vbnet.js":[256,174],"./vbscript":[258,175],"./vbscript-html":[257,176],"./vbscript-html.js":[257,176],"./vbscript.js":[258,175],"./verilog":[259,177],"./verilog.js":[259,177],"./vhdl":[260,178],"./vhdl.js":[260,178],"./vim":[261,179],"./vim.js":[261,179],"./x86asm":[262,180],"./x86asm.js":[262,180],"./xl":[263,181],"./xl.js":[263,181],"./xml":[264,182],"./xml.js":[264,182],"./xquery":[265,183],"./xquery.js":[265,183],"./yaml":[266,184],"./yaml.js":[266,184],"./zephir":[267,185],"./zephir.js":[267,185]};function o(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],o=t[0];return n.e(t[1]).then(function(){return n.t(o,7)})}o.keys=function(){return Object.keys(r)},o.id=339,e.exports=o},340:function(e,t,n){"use strict";var r=n(62);n.n(r).a},341:function(e,t,n){(e.exports=n(44)(!1)).push([e.i,"#editor-container[data-v-2d1b43bf] {\n display: block;\n width: 100vw;\n max-width: 100%;\n height: calc(100% - 50px);\n top: 50px;\n left: 0;\n margin: 0 auto;\n position: relative;\n background-color: var(--color-main-background);\n}\n#editor-wrapper[data-v-2d1b43bf] {\n display: flex;\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: absolute;\n}\n#editor-wrapper .ProseMirror[data-v-2d1b43bf] {\n margin-top: 0 !important;\n}\n#editor-wrapper.icon-loading #editor[data-v-2d1b43bf] {\n opacity: 0.3;\n}\n#editor[data-v-2d1b43bf], .editor[data-v-2d1b43bf] {\n background: var(--color-main-background);\n color: var(--color-main-text);\n background-clip: padding-box;\n border-radius: var(--border-radius);\n padding: 0;\n position: relative;\n overflow-y: auto;\n overflow-x: hidden;\n width: 100%;\n}\n.msg.icon-error[data-v-2d1b43bf] {\n padding: 12px;\n border-bottom: 1px solid var(--color-error);\n padding-left: 30px;\n background-position: 8px center;\n}\n.save-status[data-v-2d1b43bf] {\n padding: 9px;\n text-overflow: ellipsis;\n color: var(--color-text-lighter);\n}\n.save-status.error[data-v-2d1b43bf] {\n background-color: var(--color-error);\n color: var(--color-main-background);\n border-radius: 3px;\n}\n#editor-container #editor-wrapper.has-conflicts[data-v-2d1b43bf] {\n height: calc(100% - 50px);\n}\n#editor-container #editor-wrapper.has-conflicts #editor[data-v-2d1b43bf], #editor-container #editor-wrapper.has-conflicts #read-only-editor[data-v-2d1b43bf] {\n width: 50%;\n height: 100%;\n}\n#editor-session-list[data-v-2d1b43bf] {\n padding: 9px;\n padding-right: 16px;\n display: flex;\n}\n#editor-session-list input[data-v-2d1b43bf], #editor-session-list div[data-v-2d1b43bf] {\n vertical-align: middle;\n margin-left: 3px;\n}\n.editor__content[data-v-2d1b43bf] {\n max-width: 670px;\n margin: auto;\n}\n#body-public[data-v-2d1b43bf] {\n height: auto;\n}\n#files-public-content[data-v-2d1b43bf] {\n height: auto;\n}\n#files-public-content #editor-wrapper[data-v-2d1b43bf] {\n position: relative;\n}\n#files-public-content #editor-container[data-v-2d1b43bf] {\n top: 0;\n width: 100%;\n}\n#files-public-content #editor-container #editor[data-v-2d1b43bf] .menubar {\n position: fixed;\n top: 50px;\n width: 100%;\n}\n#files-public-content #editor-container #editor[data-v-2d1b43bf] {\n padding-top: 50px;\n overflow: auto;\n}\n#files-public-content #editor-container .has-conflicts #editor[data-v-2d1b43bf] {\n padding-top: 0px;\n}\n.ie #editor[data-v-2d1b43bf] .menubar {\n position: fixed;\n top: 50px;\n width: 100%;\n}\n.ie .editor__content[data-v-2d1b43bf] .ProseMirror {\n padding-top: 50px;\n}\n",""])},342:function(e,t,n){"use strict";var r=n(63);n.n(r).a},343:function(e,t,n){(e.exports=n(44)(!1)).push([e.i,'.modal-container #editor-container {\n position: absolute;\n}\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n.ProseMirror-hideselection {\n caret-color: transparent;\n}\n.ProseMirror-selectednode {\n outline: 2px solid #8cf;\n}\n\n/* Make sure li selections wrap around markers */\nli.ProseMirror-selectednode {\n outline: none;\n}\nli.ProseMirror-selectednode:after {\n content: "";\n position: absolute;\n left: -32px;\n right: -2px;\n top: -2px;\n bottom: -2px;\n border: 2px solid #8cf;\n pointer-events: none;\n}\n.has-conflicts .ProseMirror-menubar,\n#editor-wrapper.icon-loading .ProseMirror-menubar {\n display: none;\n}\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid var(--color-main-text);\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n@keyframes ProseMirror-cursor-blink {\nto {\n visibility: hidden;\n}\n}\ndiv[contenteditable=true],\ndiv[contenteditable=false] {\n border: none !important;\n width: 100%;\n background-color: transparent;\n color: var(--color-main-text);\n opacity: 1;\n -webkit-user-select: text;\n user-select: text;\n}\n\n/* Document rendering styles */\n#editor-wrapper .ProseMirror {\n margin-top: 44px;\n height: 100%;\n position: relative;\n word-wrap: break-word;\n white-space: pre-wrap;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n padding: 4px 8px 200px 14px;\n line-height: 150%;\n font-size: 14px;\n outline: none;\n}\n#editor-wrapper .ProseMirror p:first-child,\n #editor-wrapper .ProseMirror h1:first-child,\n #editor-wrapper .ProseMirror h2:first-child,\n #editor-wrapper .ProseMirror h3:first-child,\n #editor-wrapper .ProseMirror h4:first-child,\n #editor-wrapper .ProseMirror h5:first-child,\n #editor-wrapper .ProseMirror h6:first-child {\n margin-top: 10px;\n}\n#editor-wrapper .ProseMirror a {\n color: var(--color-primary);\n text-decoration: underline;\n padding: .5em 0;\n}\n#editor-wrapper .ProseMirror p {\n margin-bottom: 1em;\n line-height: 150%;\n}\n#editor-wrapper .ProseMirror em {\n font-style: italic;\n}\n#editor-wrapper .ProseMirror h1 {\n font-size: 36px;\n}\n#editor-wrapper .ProseMirror h2 {\n font-size: 28px;\n}\n#editor-wrapper .ProseMirror h3 {\n font-size: 24px;\n}\n#editor-wrapper .ProseMirror h4 {\n font-size: 21px;\n}\n#editor-wrapper .ProseMirror h5 {\n font-size: 17px;\n}\n#editor-wrapper .ProseMirror h6 {\n font-size: 14px;\n}\n#editor-wrapper .ProseMirror h1,\n #editor-wrapper .ProseMirror h2,\n #editor-wrapper .ProseMirror h3,\n #editor-wrapper .ProseMirror h4,\n #editor-wrapper .ProseMirror h5,\n #editor-wrapper .ProseMirror h6 {\n font-weight: 600;\n line-height: 120%;\n margin-top: 24px;\n margin-bottom: 12px;\n color: var(--color-main-text);\n}\n#editor-wrapper .ProseMirror img {\n cursor: default;\n max-width: 100%;\n}\n#editor-wrapper .ProseMirror hr {\n padding: 2px 0;\n border: none;\n margin: 1em 0;\n width: 100%;\n}\n#editor-wrapper .ProseMirror hr:after {\n content: "";\n display: block;\n height: 1px;\n background-color: var(--color-border-dark);\n line-height: 2px;\n}\n#editor-wrapper .ProseMirror pre {\n white-space: pre-wrap;\n background-color: var(--color-background-dark);\n border-radius: var(--border-radius);\n padding: 1em 1.3em;\n margin-bottom: 1em;\n}\n#editor-wrapper .ProseMirror p code {\n background-color: var(--color-background-dark);\n border-radius: var(--border-radius);\n padding: .1em .3em;\n}\n#editor-wrapper .ProseMirror li {\n position: relative;\n}\n#editor-wrapper .ProseMirror ul, #editor-wrapper .ProseMirror ol {\n padding-left: 14px;\n}\n#editor-wrapper .ProseMirror ul li {\n list-style-type: disc;\n}\n#editor-wrapper .ProseMirror blockquote {\n padding-left: 1em;\n border-left: 4px solid var(--color-primary);\n color: var(--color-text-maxcontrast);\n margin-left: 0;\n margin-right: 0;\n}\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n#editor-wrapper:not(.richEditor) .ProseMirror pre {\n background-color: var(--color-main-background);\n}\n#editor-wrapper:not(.richEditor) .ProseMirror pre::before {\n content: attr(data-language);\n text-transform: uppercase;\n display: block;\n text-align: right;\n font-weight: bold;\n font-size: 0.6rem;\n}\n#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-comment,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-quote {\n color: #999999;\n}\n#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-variable,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-template-variable,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-attribute,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-tag,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-name,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-regexp,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-link,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-name,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-selector-id,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-selector-class {\n color: #f2777a;\n}\n#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-number,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-meta,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-built_in,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-builtin-name,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-literal,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-type,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-params {\n color: #f99157;\n}\n#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-string,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-symbol,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-bullet {\n color: #99cc99;\n}\n#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-title,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-section {\n color: #ffcc66;\n}\n#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-keyword,\n #editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-selector-tag {\n color: #6699cc;\n}\n#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-emphasis {\n font-style: italic;\n}\n#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-strong {\n font-weight: 700;\n}\n',""])},35:function(e,n,r){"use strict";r.r(n);var o=r(15),i=r(71),s=r.n(i),a=r(33),c=r(53);function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}} +var $=function(){var e,t=(e=regeneratorRuntime.mark(function e(t){var n,o,i,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=[t],o={},i=0;case 3:if(!(i<n.length)){e.next=17;break}return e.prev=4,e.next=7,r(339)("./"+n[i]);case 7:s=e.sent,o[n[i]]=s.default,e.next=14;break;case 11:return e.prev=11,e.t0=e.catch(4),e.abrupt("return",void 0);case 14:i++,e.next=3;break;case 17:if(0!==Object.keys(o).length||o.constructor!==Object){e.next=19;break}return e.abrupt("return",void 0);case 19:return e.abrupt("return",{languages:o});case 20:case"end":return e.stop()}},e,null,[[4,11]])}),function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){H(i,n,o,s,a,"next",e)}function a(e){H(i,n,o,s,a,"throw",e)}s(void 0)})});return function(e){return t.apply(this,arguments)}}(),W=function(e){var t=e.content,r=e.onInit,i=e.onUpdate,s=e.extensions,a=e.enableRichEditing,c=e.languages,l=[];return l=a?[new o.i,new o.d,new h,new f,new m,new o.h,new o.k,new o.c,new o.p,new o.a,new o.e,new o.o,new o.n,new C]:[new D,new n.j,new o.f(F({},c))],s=s||[],new n.a({content:t,onInit:r,onUpdate:i,extensions:[].concat(B(l),[new o.j]).concat(s),useBuiltInExtensions:a})},J=A()("commonmark",{html:!1,breaks:!1}).enable("strikethrough"),K=function(e){this.message=e},Y=function(e,t){var r=Object.entries(e).filter(function(e){return V(e,2)[1].toMarkdown}).reduce(function(e,t){var r=V(t,2);return F({},e,G({},r[0],r[1].toMarkdown))},{}),n=Object.entries(t).filter(function(e){return V(e,2)[1].toMarkdown}).reduce(function(e,t){var r=V(t,2);return F({},e,G({},r[0],r[1].toMarkdown))},{});return{serializer:new z.MarkdownSerializer(F({},z.defaultMarkdownSerializer.nodes,{},r),F({},z.defaultMarkdownSerializer.marks,{},n)),serialize:function(e,t){return this.serializer.serialize(e,F({},t,{tightLists:!0})).split("\\[ \\]").join("[ ]").split("\\[x\\]").join("[x]")}}},Z=function(e){var t=e.getJSON();if(1!==t.content.length||void 0===t.content[0].content||1!==t.content[0].content.length){if("code_block"===t.content[0].type&&void 0===t.content[0].content)return"";throw new K("Failed to serialize document to plain text")}var r=t.content[0].content[0];if("text"!==r.type)throw new K("Failed to serialize document to plain text");return r.text}},281:function(e,t,r){"use strict";var n=r(56);r.n(n).a},282:function(e,t,r){(e.exports=r(46)(!1)).push([e.i,".image[data-v-3153cb96]{margin:0;padding:0}.image__caption[data-v-3153cb96]{text-align:center;color:var(--color-text-lighter)}.image__caption input[type='text'][data-v-3153cb96]{width:100%;border:none;text-align:center}.icon-image[data-v-3153cb96]{margin-top:10px;height:32px;padding:20px;background-size:contain}.image__loading[data-v-3153cb96]{height:100px}.image__placeholder .image__main[data-v-3153cb96]{background-color:var(--color-background-dark);text-align:center;padding:20px;border-radius:var(--border-radius)}.image__placeholder .image__main .icon-image[data-v-3153cb96]{opacity:0.7}.fade-enter-active[data-v-3153cb96]{transition:opacity .3s ease-in-out}.fade-enter-to[data-v-3153cb96]{opacity:1}.fade-enter[data-v-3153cb96]{opacity:0}\n",""])},33:function(e,t,r){"use strict";r.d(t,"a",function(){return o}),r.d(t,"b",function(){return s}),r.d(t,"c",function(){return c});var n=r(2),o=function(e){(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState)?setTimeout(e,0):document.addEventListener("DOMContentLoaded",e)},i=Object(n.generateUrl)("/apps/text"),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?"".concat(i,"/public/").concat(e):"".concat(i,"/").concat(e)},a=["Artichoke","Arugula","Asparagus","Avocado","Bamboo Shoot","Bean Sprout","Bean","Beet","Belgian Endive","Bell Pepper","Bitter Melon","Bitter Gourd","Bok Choy","Broccoli","Brussels Sprout","Burdock Root","Cabbage","Calabash","Caper","Carrot","Cassava","Cauliflower","Celery","Celery Root","Celtuce","Chayote","Chinese Broccoli","Corn","Baby Corn","Cucumber","English Cucumber","Gherkin","Pickling Cucumber","Daikon Radish","Edamame","Eggplant","Elephant Garlic","Endive","Curly","Escarole","Fennel","Fiddlehead","Galangal","Garlic","Ginger","Grape Leave","Green Bean","Wax Bean","Green","Amaranth Leave","Beet Green","Collard Green","Dandelion Green","Kale","Kohlrabi Green","Mustard Green","Rapini","Spinach","Swiss Chard","Turnip Green","Hearts of Palm","Horseradish","Jerusalem Artichoke","Jícama","Kale","Curly","Lacinato","Ornamental","Kohlrabi","Leeks","Lemongrass","Lettuce","Butterhead","Iceberg","Leaf","Romaine","Lotus Root","Lotus Seed","Mushroom","Napa Cabbage","Nopales","Okra","Olive","Onion","Green Onion","Parsley","Parsley Root","Parsnip","Pepper","Plantain","Potato","Pumpkin","Purslane","Radicchio","Radish","Rutabaga","Shallots","Spinach","Squash","Sweet Potato","Swiss Chard","Taro","Tomatillo","Tomato","Turnip","Water Chestnut","Water Spinach","Watercress","Winter Melon","Yams","Zucchini"],c=function(){return a[Math.floor(Math.random()*a.length)]}},339:function(e,t,r){var n={"./1c":[83,1],"./1c.js":[83,1],"./abnf":[84,2],"./abnf.js":[84,2],"./accesslog":[85,3],"./accesslog.js":[85,3],"./actionscript":[86,4],"./actionscript.js":[86,4],"./ada":[87,5],"./ada.js":[87,5],"./angelscript":[88,6],"./angelscript.js":[88,6],"./apache":[89,7],"./apache.js":[89,7],"./applescript":[90,8],"./applescript.js":[90,8],"./arcade":[91,9],"./arcade.js":[91,9],"./arduino":[92,10],"./arduino.js":[92,10],"./armasm":[93,11],"./armasm.js":[93,11],"./asciidoc":[94,12],"./asciidoc.js":[94,12],"./aspectj":[95,13],"./aspectj.js":[95,13],"./autohotkey":[96,14],"./autohotkey.js":[96,14],"./autoit":[97,15],"./autoit.js":[97,15],"./avrasm":[98,16],"./avrasm.js":[98,16],"./awk":[99,17],"./awk.js":[99,17],"./axapta":[100,18],"./axapta.js":[100,18],"./bash":[101,19],"./bash.js":[101,19],"./basic":[102,20],"./basic.js":[102,20],"./bnf":[103,21],"./bnf.js":[103,21],"./brainfuck":[104,22],"./brainfuck.js":[104,22],"./cal":[105,23],"./cal.js":[105,23],"./capnproto":[106,24],"./capnproto.js":[106,24],"./ceylon":[107,25],"./ceylon.js":[107,25],"./clean":[108,26],"./clean.js":[108,26],"./clojure":[110,27],"./clojure-repl":[109,28],"./clojure-repl.js":[109,28],"./clojure.js":[110,27],"./cmake":[111,29],"./cmake.js":[111,29],"./coffeescript":[112,30],"./coffeescript.js":[112,30],"./coq":[113,31],"./coq.js":[113,31],"./cos":[114,32],"./cos.js":[114,32],"./cpp":[115,33],"./cpp.js":[115,33],"./crmsh":[116,34],"./crmsh.js":[116,34],"./crystal":[117,35],"./crystal.js":[117,35],"./cs":[118,36],"./cs.js":[118,36],"./csp":[119,37],"./csp.js":[119,37],"./css":[120,38],"./css.js":[120,38],"./d":[121,39],"./d.js":[121,39],"./dart":[122,40],"./dart.js":[122,40],"./delphi":[123,41],"./delphi.js":[123,41],"./diff":[124,42],"./diff.js":[124,42],"./django":[125,43],"./django.js":[125,43],"./dns":[126,44],"./dns.js":[126,44],"./dockerfile":[127,45],"./dockerfile.js":[127,45],"./dos":[128,46],"./dos.js":[128,46],"./dsconfig":[129,47],"./dsconfig.js":[129,47],"./dts":[130,48],"./dts.js":[130,48],"./dust":[131,49],"./dust.js":[131,49],"./ebnf":[132,50],"./ebnf.js":[132,50],"./elixir":[133,51],"./elixir.js":[133,51],"./elm":[134,52],"./elm.js":[134,52],"./erb":[135,53],"./erb.js":[135,53],"./erlang":[137,54],"./erlang-repl":[136,55],"./erlang-repl.js":[136,55],"./erlang.js":[137,54],"./excel":[138,56],"./excel.js":[138,56],"./fix":[139,57],"./fix.js":[139,57],"./flix":[140,58],"./flix.js":[140,58],"./fortran":[141,59],"./fortran.js":[141,59],"./fsharp":[142,60],"./fsharp.js":[142,60],"./gams":[143,61],"./gams.js":[143,61],"./gauss":[144,62],"./gauss.js":[144,62],"./gcode":[145,63],"./gcode.js":[145,63],"./gherkin":[146,64],"./gherkin.js":[146,64],"./glsl":[147,65],"./glsl.js":[147,65],"./gml":[148,66],"./gml.js":[148,66],"./go":[149,67],"./go.js":[149,67],"./golo":[150,68],"./golo.js":[150,68],"./gradle":[151,69],"./gradle.js":[151,69],"./groovy":[152,70],"./groovy.js":[152,70],"./haml":[153,71],"./haml.js":[153,71],"./handlebars":[154,72],"./handlebars.js":[154,72],"./haskell":[155,73],"./haskell.js":[155,73],"./haxe":[156,74],"./haxe.js":[156,74],"./hsp":[157,75],"./hsp.js":[157,75],"./htmlbars":[158,76],"./htmlbars.js":[158,76],"./http":[159,77],"./http.js":[159,77],"./hy":[160,78],"./hy.js":[160,78],"./inform7":[161,79],"./inform7.js":[161,79],"./ini":[162,80],"./ini.js":[162,80],"./irpf90":[163,81],"./irpf90.js":[163,81],"./isbl":[164,82],"./isbl.js":[164,82],"./java":[165,83],"./java.js":[165,83],"./javascript":[166,84],"./javascript.js":[166,84],"./jboss-cli":[167,85],"./jboss-cli.js":[167,85],"./json":[168,86],"./json.js":[168,86],"./julia":[170,87],"./julia-repl":[169,88],"./julia-repl.js":[169,88],"./julia.js":[170,87],"./kotlin":[171,89],"./kotlin.js":[171,89],"./lasso":[172,90],"./lasso.js":[172,90],"./ldif":[173,91],"./ldif.js":[173,91],"./leaf":[174,92],"./leaf.js":[174,92],"./less":[175,93],"./less.js":[175,93],"./lisp":[176,94],"./lisp.js":[176,94],"./livecodeserver":[177,95],"./livecodeserver.js":[177,95],"./livescript":[178,96],"./livescript.js":[178,96],"./llvm":[179,97],"./llvm.js":[179,97],"./lsl":[180,98],"./lsl.js":[180,98],"./lua":[181,99],"./lua.js":[181,99],"./makefile":[182,100],"./makefile.js":[182,100],"./markdown":[183,101],"./markdown.js":[183,101],"./mathematica":[184,102],"./mathematica.js":[184,102],"./matlab":[185,103],"./matlab.js":[185,103],"./maxima":[186,104],"./maxima.js":[186,104],"./mel":[187,105],"./mel.js":[187,105],"./mercury":[188,106],"./mercury.js":[188,106],"./mipsasm":[189,107],"./mipsasm.js":[189,107],"./mizar":[190,108],"./mizar.js":[190,108],"./mojolicious":[191,109],"./mojolicious.js":[191,109],"./monkey":[192,110],"./monkey.js":[192,110],"./moonscript":[193,111],"./moonscript.js":[193,111],"./n1ql":[194,112],"./n1ql.js":[194,112],"./nginx":[195,113],"./nginx.js":[195,113],"./nimrod":[196,114],"./nimrod.js":[196,114],"./nix":[197,115],"./nix.js":[197,115],"./nsis":[198,116],"./nsis.js":[198,116],"./objectivec":[199,117],"./objectivec.js":[199,117],"./ocaml":[200,118],"./ocaml.js":[200,118],"./openscad":[201,119],"./openscad.js":[201,119],"./oxygene":[202,120],"./oxygene.js":[202,120],"./parser3":[203,121],"./parser3.js":[203,121],"./perl":[204,122],"./perl.js":[204,122],"./pf":[205,123],"./pf.js":[205,123],"./pgsql":[206,124],"./pgsql.js":[206,124],"./php":[207,125],"./php.js":[207,125],"./plaintext":[208,126],"./plaintext.js":[208,126],"./pony":[209,127],"./pony.js":[209,127],"./powershell":[210,128],"./powershell.js":[210,128],"./processing":[211,129],"./processing.js":[211,129],"./profile":[212,130],"./profile.js":[212,130],"./prolog":[213,131],"./prolog.js":[213,131],"./properties":[214,132],"./properties.js":[214,132],"./protobuf":[215,133],"./protobuf.js":[215,133],"./puppet":[216,134],"./puppet.js":[216,134],"./purebasic":[217,135],"./purebasic.js":[217,135],"./python":[218,136],"./python.js":[218,136],"./q":[219,137],"./q.js":[219,137],"./qml":[220,138],"./qml.js":[220,138],"./r":[221,139],"./r.js":[221,139],"./reasonml":[222,140],"./reasonml.js":[222,140],"./rib":[223,141],"./rib.js":[223,141],"./roboconf":[224,142],"./roboconf.js":[224,142],"./routeros":[225,143],"./routeros.js":[225,143],"./rsl":[226,144],"./rsl.js":[226,144],"./ruby":[227,145],"./ruby.js":[227,145],"./ruleslanguage":[228,146],"./ruleslanguage.js":[228,146],"./rust":[229,147],"./rust.js":[229,147],"./sas":[230,148],"./sas.js":[230,148],"./scala":[231,149],"./scala.js":[231,149],"./scheme":[232,150],"./scheme.js":[232,150],"./scilab":[233,151],"./scilab.js":[233,151],"./scss":[234,152],"./scss.js":[234,152],"./shell":[235,153],"./shell.js":[235,153],"./smali":[236,154],"./smali.js":[236,154],"./smalltalk":[237,155],"./smalltalk.js":[237,155],"./sml":[238,156],"./sml.js":[238,156],"./sqf":[239,157],"./sqf.js":[239,157],"./sql":[240,158],"./sql.js":[240,158],"./stan":[241,159],"./stan.js":[241,159],"./stata":[242,160],"./stata.js":[242,160],"./step21":[243,161],"./step21.js":[243,161],"./stylus":[244,162],"./stylus.js":[244,162],"./subunit":[245,163],"./subunit.js":[245,163],"./swift":[246,164],"./swift.js":[246,164],"./taggerscript":[247,165],"./taggerscript.js":[247,165],"./tap":[248,166],"./tap.js":[248,166],"./tcl":[249,167],"./tcl.js":[249,167],"./tex":[250,168],"./tex.js":[250,168],"./thrift":[251,169],"./thrift.js":[251,169],"./tp":[252,170],"./tp.js":[252,170],"./twig":[253,171],"./twig.js":[253,171],"./typescript":[254,172],"./typescript.js":[254,172],"./vala":[255,173],"./vala.js":[255,173],"./vbnet":[256,174],"./vbnet.js":[256,174],"./vbscript":[258,175],"./vbscript-html":[257,176],"./vbscript-html.js":[257,176],"./vbscript.js":[258,175],"./verilog":[259,177],"./verilog.js":[259,177],"./vhdl":[260,178],"./vhdl.js":[260,178],"./vim":[261,179],"./vim.js":[261,179],"./x86asm":[262,180],"./x86asm.js":[262,180],"./xl":[263,181],"./xl.js":[263,181],"./xml":[264,182],"./xml.js":[264,182],"./xquery":[265,183],"./xquery.js":[265,183],"./yaml":[266,184],"./yaml.js":[266,184],"./zephir":[267,185],"./zephir.js":[267,185]};function o(e){if(!r.o(n,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=n[e],o=t[0];return r.e(t[1]).then(function(){return r.t(o,7)})}o.keys=function(){return Object.keys(n)},o.id=339,e.exports=o},340:function(e,t,r){"use strict";var n=r(60);r.n(n).a},341:function(e,t,r){(e.exports=r(46)(!1)).push([e.i,"#editor-container[data-v-2d1b43bf]{display:block;width:100vw;max-width:100%;height:calc(100% - 50px);top:50px;left:0;margin:0 auto;position:relative;background-color:var(--color-main-background)}#editor-wrapper[data-v-2d1b43bf]{display:flex;width:100%;height:100%;overflow:hidden;position:absolute}#editor-wrapper .ProseMirror[data-v-2d1b43bf]{margin-top:0 !important}#editor-wrapper.icon-loading #editor[data-v-2d1b43bf]{opacity:0.3}#editor[data-v-2d1b43bf],.editor[data-v-2d1b43bf]{background:var(--color-main-background);color:var(--color-main-text);background-clip:padding-box;border-radius:var(--border-radius);padding:0;position:relative;overflow-y:auto;overflow-x:hidden;width:100%}.msg.icon-error[data-v-2d1b43bf]{padding:12px;border-bottom:1px solid var(--color-error);padding-left:30px;background-position:8px center}.save-status[data-v-2d1b43bf]{padding:9px;text-overflow:ellipsis;color:var(--color-text-lighter)}.save-status.error[data-v-2d1b43bf]{background-color:var(--color-error);color:var(--color-main-background);border-radius:3px}#editor-container #editor-wrapper.has-conflicts[data-v-2d1b43bf]{height:calc(100% - 50px)}#editor-container #editor-wrapper.has-conflicts #editor[data-v-2d1b43bf],#editor-container #editor-wrapper.has-conflicts #read-only-editor[data-v-2d1b43bf]{width:50%;height:100%}#editor-session-list[data-v-2d1b43bf]{padding:9px;padding-right:16px;display:flex}#editor-session-list input[data-v-2d1b43bf],#editor-session-list div[data-v-2d1b43bf]{vertical-align:middle;margin-left:3px}.editor__content[data-v-2d1b43bf]{max-width:670px;margin:auto}#body-public[data-v-2d1b43bf]{height:auto}#files-public-content[data-v-2d1b43bf]{height:auto}#files-public-content #editor-wrapper[data-v-2d1b43bf]{position:relative}#files-public-content #editor-container[data-v-2d1b43bf]{top:0;width:100%}#files-public-content #editor-container #editor[data-v-2d1b43bf] .menubar{position:fixed;top:50px;width:100%}#files-public-content #editor-container #editor[data-v-2d1b43bf]{padding-top:50px;overflow:auto}#files-public-content #editor-container .has-conflicts #editor[data-v-2d1b43bf]{padding-top:0px}.ie #editor[data-v-2d1b43bf] .menubar{position:fixed;top:50px;width:100%}.ie .editor__content[data-v-2d1b43bf] .ProseMirror{padding-top:50px}\n",""])},342:function(e,t,r){"use strict";var n=r(61);r.n(n).a},343:function(e,t,r){(e.exports=r(46)(!1)).push([e.i,'.modal-container #editor-container{position:absolute}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-selectednode{outline:2px solid #8cf}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:"";position:absolute;left:-32px;right:-2px;top:-2px;bottom:-2px;border:2px solid #8cf;pointer-events:none}.has-conflicts .ProseMirror-menubar,#editor-wrapper.icon-loading .ProseMirror-menubar{display:none}.ProseMirror-gapcursor{display:none;pointer-events:none;position:absolute}.ProseMirror-gapcursor:after{content:"";display:block;position:absolute;top:-2px;width:20px;border-top:1px solid var(--color-main-text);animation:ProseMirror-cursor-blink 1.1s steps(2, start) infinite}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}div[contenteditable=true],div[contenteditable=false]{border:none !important;width:100%;background-color:transparent;color:var(--color-main-text);opacity:1;-webkit-user-select:text;user-select:text}#editor-wrapper .ProseMirror{margin-top:44px;height:100%;position:relative;word-wrap:break-word;white-space:pre-wrap;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;padding:4px 8px 200px 14px;line-height:150%;font-size:14px;outline:none}#editor-wrapper .ProseMirror p:first-child,#editor-wrapper .ProseMirror h1:first-child,#editor-wrapper .ProseMirror h2:first-child,#editor-wrapper .ProseMirror h3:first-child,#editor-wrapper .ProseMirror h4:first-child,#editor-wrapper .ProseMirror h5:first-child,#editor-wrapper .ProseMirror h6:first-child{margin-top:10px}#editor-wrapper .ProseMirror a{color:var(--color-primary-element);text-decoration:underline;padding:.5em 0}#editor-wrapper .ProseMirror p{margin-bottom:1em;line-height:150%}#editor-wrapper .ProseMirror em{font-style:italic}#editor-wrapper .ProseMirror h1{font-size:36px}#editor-wrapper .ProseMirror h2{font-size:28px}#editor-wrapper .ProseMirror h3{font-size:24px}#editor-wrapper .ProseMirror h4{font-size:21px}#editor-wrapper .ProseMirror h5{font-size:17px}#editor-wrapper .ProseMirror h6{font-size:14px}#editor-wrapper .ProseMirror h1,#editor-wrapper .ProseMirror h2,#editor-wrapper .ProseMirror h3,#editor-wrapper .ProseMirror h4,#editor-wrapper .ProseMirror h5,#editor-wrapper .ProseMirror h6{font-weight:600;line-height:120%;margin-top:24px;margin-bottom:12px;color:var(--color-main-text)}#editor-wrapper .ProseMirror img{cursor:default;max-width:100%}#editor-wrapper .ProseMirror hr{padding:2px 0;border:none;margin:1em 0;width:100%}#editor-wrapper .ProseMirror hr:after{content:"";display:block;height:1px;background-color:var(--color-border-dark);line-height:2px}#editor-wrapper .ProseMirror pre{white-space:pre-wrap;background-color:var(--color-background-dark);border-radius:var(--border-radius);padding:1em 1.3em;margin-bottom:1em}#editor-wrapper .ProseMirror p code{background-color:var(--color-background-dark);border-radius:var(--border-radius);padding:.1em .3em}#editor-wrapper .ProseMirror li{position:relative}#editor-wrapper .ProseMirror ul,#editor-wrapper .ProseMirror ol{padding-left:14px}#editor-wrapper .ProseMirror ul li{list-style-type:disc}#editor-wrapper .ProseMirror blockquote{padding-left:1em;border-left:4px solid var(--color-primary-element);color:var(--color-text-maxcontrast);margin-left:0;margin-right:0}.ProseMirror-focused .ProseMirror-gapcursor{display:block}#editor-wrapper:not(.richEditor) .ProseMirror pre{background-color:var(--color-main-background)}#editor-wrapper:not(.richEditor) .ProseMirror pre::before{content:attr(data-language);text-transform:uppercase;display:block;text-align:right;font-weight:bold;font-size:0.6rem}#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-comment,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-quote{color:#999999}#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-variable,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-template-variable,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-attribute,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-tag,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-name,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-regexp,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-link,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-name,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-selector-id,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-selector-class{color:#f2777a}#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-number,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-meta,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-built_in,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-builtin-name,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-literal,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-type,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-params{color:#f99157}#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-string,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-symbol,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-bullet{color:#99cc99}#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-title,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-section{color:#ffcc66}#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-keyword,#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-selector-tag{color:#6699cc}#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-emphasis{font-style:italic}#editor-wrapper:not(.richEditor) .ProseMirror pre code .hljs-strong{font-weight:700}\n',""])},35:function(e,r,n){"use strict";n.r(r);var o=n(15),i=n(69),s=n.n(i),a=n(33),c=n(54);function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}} /* * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net> * @@ -126,7 +126,7 @@ var $=function(){var e,t=(e=regeneratorRuntime.mark(function e(t){var r,o,i,s;re * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -var u=300,d=500,p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._authority=t,this.fetchInterval=u,this.retryTime=d,this.lock=!1,this.fetchRetryCounter=0}var t,n,r;return t=e,(n=[{key:"connect",value:function(){this.fetcher=setInterval(this._fetchSteps.bind(this),this.fetchInterval)}},{key:"_isPublic",value:function(){return!!this._authority.options.shareToken}},{key:"forceSave",value:function(){this._forcedSave=!0,this.fetchSteps()}},{key:"save",value:function(){this._manualSave=!0,this.fetchSteps()}},{key:"fetchSteps",value:function(){this._fetchSteps()}},{key:"_fetchSteps",value:function(){var e,t=this;!this.lock&&this.fetcher&&(this.lock=!0,(this._forcedSave||this._manualSave||!Object(c.sendableSteps)(this._authority.state)&&this._authority._getVersion()!==this._authority.document.lastSavedVersion)&&(e=this._authority._getContent()),s.a.post(Object(a.b)("session/sync",this._isPublic()),{documentId:this._authority.document.id,sessionId:this._authority.session.id,sessionToken:this._authority.session.token,version:this._authority.steps.length,autosaveContent:e,force:!!this._forcedSave,manualSave:!!this._manualSave,token:this._authority.options.shareToken,filePath:this._authority.options.filePath}).then(function(e){if(t.fetchRetryCounter=0,t._authority.document.lastSavedVersion<e.data.document.lastSavedVersion&&(console.debug("Saved document",e.data.document),t._authority.emit("save",{document:e.data.document,sessions:e.data.sessions})),t._authority.emit("change",{document:e.data.document,sessions:e.data.sessions}),t._authority.document=e.data.document,t._authority.sessions=e.data.sessions,0===e.data.steps.length)return t.lock=!1,e.data.sessions.filter(function(e){return e.lastContact>Date.now()/1e3-20}).length<2?t.maximumRefetchTimer():t.increaseRefetchTimer(),t._authority.emit("stateChange",{dirty:!1}),void t._authority.emit("stateChange",{initialLoading:!0});t._authority._receiveSteps(e.data),t.lock=!1,t._forcedSave=!1,t.resetRefetchTimer()}).catch(function(e){t.lock=!1,e.response&&"ECONNABORTED"!==e.code?409===e.response.status&&e.response.data.document.currentVersion===t._authority.document.currentVersion?(console.error("Conflict during file save, please resolve"),t._authority.emit("error",m.SAVE_COLLISSION,{outsideChange:e.response.data.outsideChange})):403===e.response.status?t._authority.emit("error",m.CONNECTION_FAILED,{}):console.error("Failed to fetch steps due to other reason",e):t.fetchRetryCounter++>=5?(console.error("[PollingBackend:fetchSteps] Network error when fetching steps, emitting CONNECTION_FAILED"),t._authority.emit("error",m.CONNECTION_FAILED,{})):console.error("[PollingBackend:fetchSteps] Network error when fetching steps, retry ".concat(t.fetchRetryCounter))}),this._manualSave=!1,this._forcedSave=!1)}},{key:"sendSteps",value:function(e){var t=this;if(this._authority.emit("stateChange",{dirty:!0}),this.lock)setTimeout(function(){t._authority.sendSteps()},100);else{this.lock=!0;var n="function"==typeof e?e():e,r=n.steps;s.a.post(Object(a.b)("session/push",!!this._authority.options.shareToken),{documentId:this._authority.document.id,sessionId:this._authority.session.id,sessionToken:this._authority.session.token,steps:r.map(function(e){return e.toJSON?e.toJSON():e})||[],version:n.version,token:this._authority.options.shareToken,filePath:this._authority.options.filePath}).then(function(e){t.carefulRetryReset(),t.lock=!1,t.fetchSteps()}).catch(function(e){console.error("failed to apply steps due to collission, retrying"),t.lock=!1,e.response&&"ECONNABORTED"!==e.code?(403===e.response.status&&e.response.data.document.currentVersion===t._authority.document.currentVersion&&(t._authority.emit("error",m.PUSH_FAILURE,{}),OC.Notification.showTemporary("Changes could not be sent yet")),t.fetchSteps(),t.carefulRetry()):t._authority.emit("error",m.CONNECTION_FAILED,{})})}}},{key:"disconnect",value:function(){clearInterval(this.fetcher),this.fetcher=0}},{key:"resetRefetchTimer",value:function(){0!==this.fetcher&&(this.fetchInverval=u,clearInterval(this.fetcher),this.fetcher=setInterval(this._fetchSteps.bind(this),this.fetchInverval))}},{key:"increaseRefetchTimer",value:function(){0!==this.fetcher&&(this.fetchInverval=Math.min(2*this.fetchInverval,5e3),clearInterval(this.fetcher),this.fetcher=setInterval(this._fetchSteps.bind(this),this.fetchInverval))}},{key:"maximumRefetchTimer",value:function(){0!==this.fetcher&&(this.fetchInverval=5e3,clearInterval(this.fetcher),this.fetcher=setInterval(this._fetchSteps.bind(this),this.fetchInverval))}},{key:"carefulRetry",value:function(){var e=this.retryTime?Math.min(2*this.retryTime,1e4):d;e>5e3&&this.retryTime<5e3&&(OC.Notification.showTemporary("Changes could not be sent yet"),this._authority.emit("error",m.PUSH_FAILURE,{})),this.retryTime=e}},{key:"carefulRetryReset",value:function(){this.retryTime=d}}])&&l(t.prototype,n),r&&l(t,r),e}();function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}} +var u=300,d=500,p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._authority=t,this.fetchInterval=u,this.retryTime=d,this.lock=!1,this.fetchRetryCounter=0}var t,r,n;return t=e,(r=[{key:"connect",value:function(){this.fetcher=setInterval(this._fetchSteps.bind(this),this.fetchInterval)}},{key:"_isPublic",value:function(){return!!this._authority.options.shareToken}},{key:"forceSave",value:function(){this._forcedSave=!0,this.fetchSteps()}},{key:"save",value:function(){this._manualSave=!0,this.fetchSteps()}},{key:"fetchSteps",value:function(){this._fetchSteps()}},{key:"_fetchSteps",value:function(){var e,t=this;!this.lock&&this.fetcher&&(this.lock=!0,(this._forcedSave||this._manualSave||!Object(c.sendableSteps)(this._authority.state)&&this._authority._getVersion()!==this._authority.document.lastSavedVersion)&&(e=this._authority._getContent()),s.a.post(Object(a.b)("session/sync",this._isPublic()),{documentId:this._authority.document.id,sessionId:this._authority.session.id,sessionToken:this._authority.session.token,version:this._authority._getVersion(),autosaveContent:e,force:!!this._forcedSave,manualSave:!!this._manualSave,token:this._authority.options.shareToken,filePath:this._authority.options.filePath}).then(function(e){if(t.fetchRetryCounter=0,t._authority.document.lastSavedVersion<e.data.document.lastSavedVersion&&(console.debug("Saved document",e.data.document),t._authority.emit("save",{document:e.data.document,sessions:e.data.sessions})),t._authority.emit("change",{document:e.data.document,sessions:e.data.sessions}),t._authority.document=e.data.document,t._authority.sessions=e.data.sessions,0===e.data.steps.length)return t.lock=!1,e.data.sessions.filter(function(e){return e.lastContact>Date.now()/1e3-20}).length<2?t.maximumRefetchTimer():t.increaseRefetchTimer(),t._authority.emit("stateChange",{dirty:!1}),void t._authority.emit("stateChange",{initialLoading:!0});t._authority._receiveSteps(e.data),t.lock=!1,t._forcedSave=!1,t.resetRefetchTimer()}).catch(function(e){t.lock=!1,e.response&&"ECONNABORTED"!==e.code?409===e.response.status&&e.response.data.document.currentVersion===t._authority.document.currentVersion?(console.error("Conflict during file save, please resolve"),t._authority.emit("error",m.SAVE_COLLISSION,{outsideChange:e.response.data.outsideChange})):403===e.response.status?t._authority.emit("error",m.CONNECTION_FAILED,{}):console.error("Failed to fetch steps due to other reason",e):t.fetchRetryCounter++>=5?(console.error("[PollingBackend:fetchSteps] Network error when fetching steps, emitting CONNECTION_FAILED"),t._authority.emit("error",m.CONNECTION_FAILED,{})):console.error("[PollingBackend:fetchSteps] Network error when fetching steps, retry ".concat(t.fetchRetryCounter))}),this._manualSave=!1,this._forcedSave=!1)}},{key:"sendSteps",value:function(e){var t=this;if(this._authority.emit("stateChange",{dirty:!0}),this.lock)setTimeout(function(){t._authority.sendSteps()},100);else{this.lock=!0;var r="function"==typeof e?e():e,n=r.steps;s.a.post(Object(a.b)("session/push",!!this._authority.options.shareToken),{documentId:this._authority.document.id,sessionId:this._authority.session.id,sessionToken:this._authority.session.token,steps:n.map(function(e){return e.toJSON?e.toJSON():e})||[],version:r.version,token:this._authority.options.shareToken,filePath:this._authority.options.filePath}).then(function(e){t.carefulRetryReset(),t.lock=!1,t.fetchSteps()}).catch(function(e){console.error("failed to apply steps due to collission, retrying"),t.lock=!1,e.response&&"ECONNABORTED"!==e.code?(403===e.response.status&&e.response.data.document.currentVersion===t._authority.document.currentVersion&&(t._authority.emit("error",m.PUSH_FAILURE,{}),OC.Notification.showTemporary("Changes could not be sent yet")),t.fetchSteps(),t.carefulRetry()):t._authority.emit("error",m.CONNECTION_FAILED,{})})}}},{key:"disconnect",value:function(){clearInterval(this.fetcher),this.fetcher=0}},{key:"resetRefetchTimer",value:function(){0!==this.fetcher&&(this.fetchInverval=u,clearInterval(this.fetcher),this.fetcher=setInterval(this._fetchSteps.bind(this),this.fetchInverval))}},{key:"increaseRefetchTimer",value:function(){0!==this.fetcher&&(this.fetchInverval=Math.min(2*this.fetchInverval,5e3),clearInterval(this.fetcher),this.fetcher=setInterval(this._fetchSteps.bind(this),this.fetchInverval))}},{key:"maximumRefetchTimer",value:function(){0!==this.fetcher&&(this.fetchInverval=5e3,clearInterval(this.fetcher),this.fetcher=setInterval(this._fetchSteps.bind(this),this.fetchInverval))}},{key:"carefulRetry",value:function(){var e=this.retryTime?Math.min(2*this.retryTime,1e4):d;e>5e3&&this.retryTime<5e3&&(OC.Notification.showTemporary("Changes could not be sent yet"),this._authority.emit("error",m.PUSH_FAILURE,{})),this.retryTime=e}},{key:"carefulRetryReset",value:function(){this.retryTime=d}}])&&l(t.prototype,r),n&&l(t,n),e}();function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}} /* * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net> * @@ -148,7 +148,7 @@ var u=300,d=500,p=function(){function e(t){!function(e,t){if(!(e instanceof t))t * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -var f={shareToken:null,forceRecreate:!1,serialize:function(e){return e}},m={SAVE_COLLISSION:0,PUSH_FAILURE:1,LOAD_ERROR:2,CONNECTION_FAILED:3,SOURCE_NOT_FOUND:4},v=function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.eventHandlers={opened:[],loaded:[],fetched:[],sync:[],stateChange:[],error:[],change:[],save:[]},this.backend=new p(this),this.options=Object.assign({},f,t),this.document=null,this.session=null,this.sessions=[],this.steps=[],this.stepClientIDs=[],this}var t,n,r;return t=e,(n=[{key:"open",value:function(e){var t=this,n=e.fileId,r=e.filePath;return this._openDocument({fileId:n,filePath:r}).then(function(){return t.emit("opened",{document:t.document,session:t.session}),t._fetchDocument().then(function(e){var n=e.data;t.emit("loaded",{document:t.document,session:t.session,documentSource:""+n})})}).catch(function(e){return e.response&&"ECONNABORTED"!==e.code?t.emit("error",m.LOAD_ERROR,e.response.status):t.emit("error",m.CONNECTION_FAILED,{}),Promise.reject(e)})}},{key:"startSync",value:function(){this.backend.connect()}},{key:"_openDocument",value:function(e){var t=this,n=e.fileId,r=e.filePath;return s.a.get(Object(a.b)("session/create",!!this.options.shareToken),{params:{fileId:n,filePath:r,token:this.options.shareToken,guestName:this.options.guestName,forceRecreate:this.options.forceRecreate}}).then(function(e){return t.document=e.data.document,t.document.readOnly=e.data.readOnly,t.session=e.data.session,e.data})}},{key:"_fetchDocument",value:function(){return s.a.get(Object(a.b)("session/fetch",!!this.options.shareToken),{params:{documentId:this.document.id,sessionId:this.session.id,sessionToken:this.session.token,token:this.options.shareToken}})}},{key:"updateSession",value:function(e){var t=this;if(this.isPublic())return s.a.post(Object(a.b)("session",!!this.options.shareToken),{documentId:this.document.id,sessionId:this.session.id,sessionToken:this.session.token,token:this.options.shareToken,guestName:e}).then(function(e){var n=e.data;return t.session=n,n}).catch(function(e){return console.error("Failed to update the session",e),Promise.reject(e)})}},{key:"sendSteps",value:function(e){var t=e||Object(c.sendableSteps)(this.state);if(t)return this.backend.sendSteps(t)}},{key:"stepsSince",value:function(e){return{steps:this.steps.slice(e),clientIDs:this.stepClientIDs.slice(e)}}},{key:"_receiveSteps",value:function(e){for(var t=this,n=e.steps,r=e.document,o=[],i=function(e){var r=n[e].data;if(!Array.isArray(r))return console.error("Invalid step data, skipping step",n[e]),"continue";r.forEach(function(r){t.steps.push(r),o.push({step:r,clientID:n[e].sessionId})})},s=0;s<n.length;s++)i(s);this.emit("sync",{steps:o,document:r}),console.debug("receivedSteps","newVersion",this._getVersion())}},{key:"_getVersion",value:function(){return this.state?Object(c.getVersion)(this.state):0}},{key:"_getDocument",value:function(){if(this.state)return this.state.doc}},{key:"_getContent",value:function(){return this.options.serialize(this._getDocument())}},{key:"save",value:function(){this.backend.save&&this.backend.save()}},{key:"forceSave",value:function(){this.backend.forceSave&&this.backend.forceSave()}},{key:"close",value:function(){var e=this,t=!1;return new Promise(function(n,r){e.on("save",function(){e._close().then(function(){t=!0,n()}).catch(function(){return n()})}),setTimeout(function(){t||e._close().then(function(){n()}).catch(function(){return n()})},2e3),e.save()})}},{key:"_close",value:function(){return null===this.document||null===this.session?Promise.resolve():(this.backend.disconnect(),s.a.get(Object(a.b)("session/close",!!this.options.shareToken),{params:{documentId:this.document.id,sessionId:this.session.id,sessionToken:this.session.token,token:this.options.shareToken}}))}},{key:"on",value:function(e,t,n){return this.eventHandlers[e].push(t.bind(n)),this}},{key:"emit",value:function(e,t,n){void 0!==this.eventHandlers[e]?this.eventHandlers[e].forEach(function(e){e(t,n)}):console.error("Event not found",e)}},{key:"isPublic",value:function(){return!!this.options.shareToken}}])&&h(t.prototype,n),r&&h(t,r),e}(),b={py:"python",gyp:"python",wsgi:"python",htm:"html",xhtml:"html",erl:"erlang",jsp:"java",pl:"perl",rss:"xml",atom:"xml",xsl:"xml",plist:"xml",rb:"ruby",builder:"ruby",gemspec:"ruby",podspec:"ruby",thor:"ruby",diff:"patch",hs:"haskell",icl:"haskell",php3:"php",php4:"php",php5:"php",php6:"php",sh:"bash",zsh:"bash",st:"smalltalk",as:"actionscript",apacheconf:"apache",osacript:"applescript",b:"brainfuck",bf:"brainfuck",clj:"clojure","cmake.in":"cmake",coffee:"coffeescript",cson:"coffescript",iced:"coffescript",c:"cpp","c++":"cpp","h++":"cpp",hh:"cpp",jinja:"django",bat:"dos",cmd:"dos",fs:"fsharp",hbs:"handlebars","html.hbs":"handlebars","html.handlebars":"handlebars",sublime_metrics:"json",sublime_session:"json","sublime-keymap":"json","sublime-mousemap":"json","sublime-project":"json","sublime-settings":"json","sublime-workspace":"json",mk:"makefile",mak:"makefile",md:"markdown",mkdown:"markdown",mkd:"markdown",nginxconf:"nginx",m:"objectivec",mm:"objectivec",ml:"ocaml",rs:"rust",sci:"scilab",vb:"vbnet",vbs:"vbscript"},y=r(268),g=r(46),j=r(52);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)} +var f={shareToken:null,forceRecreate:!1,serialize:function(e){return e}},m={SAVE_COLLISSION:0,PUSH_FAILURE:1,LOAD_ERROR:2,CONNECTION_FAILED:3,SOURCE_NOT_FOUND:4},v=function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.eventHandlers={opened:[],loaded:[],fetched:[],sync:[],stateChange:[],error:[],change:[],save:[]},this.backend=new p(this),this.options=Object.assign({},f,t),this.document=null,this.session=null,this.sessions=[],this.steps=[],this.stepClientIDs=[],this}var t,r,n;return t=e,(r=[{key:"open",value:function(e){var t=this,r=e.fileId,n=e.filePath;return this._openDocument({fileId:r,filePath:n}).then(function(){return t.emit("opened",{document:t.document,session:t.session}),t._fetchDocument().then(function(e){var r=e.data;t.emit("loaded",{document:t.document,session:t.session,documentSource:""+r})})}).catch(function(e){return e.response&&"ECONNABORTED"!==e.code?t.emit("error",m.LOAD_ERROR,e.response.status):t.emit("error",m.CONNECTION_FAILED,{}),Promise.reject(e)})}},{key:"startSync",value:function(){this.backend.connect()}},{key:"_openDocument",value:function(e){var t=this,r=e.fileId,n=e.filePath;return s.a.get(Object(a.b)("session/create",!!this.options.shareToken),{params:{fileId:r,filePath:n,token:this.options.shareToken,guestName:this.options.guestName,forceRecreate:this.options.forceRecreate}}).then(function(e){return t.document=e.data.document,t.document.readOnly=e.data.readOnly,t.session=e.data.session,e.data})}},{key:"_fetchDocument",value:function(){return s.a.get(Object(a.b)("session/fetch",!!this.options.shareToken),{transformResponse:[function(e){return e}],params:{documentId:this.document.id,sessionId:this.session.id,sessionToken:this.session.token,token:this.options.shareToken}})}},{key:"updateSession",value:function(e){var t=this;if(this.isPublic())return s.a.post(Object(a.b)("session",!!this.options.shareToken),{documentId:this.document.id,sessionId:this.session.id,sessionToken:this.session.token,token:this.options.shareToken,guestName:e}).then(function(e){var r=e.data;return t.session=r,r}).catch(function(e){return console.error("Failed to update the session",e),Promise.reject(e)})}},{key:"sendSteps",value:function(e){var t=e||Object(c.sendableSteps)(this.state);if(t)return this.backend.sendSteps(t)}},{key:"stepsSince",value:function(e){return{steps:this.steps.slice(e),clientIDs:this.stepClientIDs.slice(e)}}},{key:"_receiveSteps",value:function(e){for(var t=this,r=e.steps,n=e.document,o=[],i=function(e){var n=r[e].data;if(!Array.isArray(n))return console.error("Invalid step data, skipping step",r[e]),"continue";n.forEach(function(n){t.steps.push(n),o.push({step:n,clientID:r[e].sessionId})})},s=0;s<r.length;s++)i(s);this.emit("sync",{steps:o,document:n}),console.debug("receivedSteps","newVersion",this._getVersion())}},{key:"_getVersion",value:function(){return this.state?Object(c.getVersion)(this.state):0}},{key:"_getDocument",value:function(){if(this.state)return this.state.doc}},{key:"_getContent",value:function(){return this.options.serialize(this._getDocument())}},{key:"save",value:function(){this.backend.save&&this.backend.save()}},{key:"forceSave",value:function(){this.backend.forceSave&&this.backend.forceSave()}},{key:"close",value:function(){var e=this,t=!1;return new Promise(function(r,n){e.on("save",function(){e._close().then(function(){t=!0,r()}).catch(function(){return r()})}),setTimeout(function(){t||e._close().then(function(){r()}).catch(function(){return r()})},2e3),e.save()})}},{key:"_close",value:function(){return null===this.document||null===this.session?Promise.resolve():(this.backend.disconnect(),s.a.get(Object(a.b)("session/close",!!this.options.shareToken),{params:{documentId:this.document.id,sessionId:this.session.id,sessionToken:this.session.token,token:this.options.shareToken}}))}},{key:"on",value:function(e,t,r){return this.eventHandlers[e].push(t.bind(r)),this}},{key:"emit",value:function(e,t,r){void 0!==this.eventHandlers[e]?this.eventHandlers[e].forEach(function(e){e(t,r)}):console.error("Event not found",e)}},{key:"isPublic",value:function(){return!!this.options.shareToken}}])&&h(t.prototype,r),n&&h(t,n),e}(),b={py:"python",gyp:"python",wsgi:"python",htm:"html",xhtml:"html",erl:"erlang",jsp:"java",pl:"perl",rss:"xml",atom:"xml",xsl:"xml",plist:"xml",rb:"ruby",builder:"ruby",gemspec:"ruby",podspec:"ruby",thor:"ruby",diff:"patch",hs:"haskell",icl:"haskell",php3:"php",php4:"php",php5:"php",php6:"php",sh:"bash",zsh:"bash",st:"smalltalk",as:"actionscript",apacheconf:"apache",osacript:"applescript",b:"brainfuck",bf:"brainfuck",clj:"clojure","cmake.in":"cmake",coffee:"coffeescript",cson:"coffescript",iced:"coffescript",c:"cpp","c++":"cpp","h++":"cpp",hh:"cpp",jinja:"django",bat:"dos",cmd:"dos",fs:"fsharp",hbs:"handlebars","html.hbs":"handlebars","html.handlebars":"handlebars",sublime_metrics:"json",sublime_session:"json","sublime-keymap":"json","sublime-mousemap":"json","sublime-project":"json","sublime-settings":"json","sublime-workspace":"json",mk:"makefile",mak:"makefile",md:"markdown",mkdown:"markdown",mkd:"markdown",nginxconf:"nginx",m:"objectivec",mm:"objectivec",ml:"ocaml",rs:"rust",sci:"scilab",vb:"vbnet",vbs:"vbscript"},y=n(268),g=n(48),j=n(53);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function S(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)} /* * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net> * @@ -169,7 +169,7 @@ var f={shareToken:null,forceRecreate:!1,serialize:function(e){return e}},m={SAVE * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * - */var O=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),S(this,_(t).apply(this,arguments))}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}(t,g["e"]),n=t,(r=[{key:"keys",value:function(e){e.schema;return this.options}},{key:"name",get:function(){return"save"}}])&&k(n.prototype,r),o&&k(n,o),t}(),P={data:function(){return{isMobile:this._isMobile()}},beforeMount:function(){window.addEventListener("resize",this._onResize)},beforeDestroy:function(){window.removeEventListener("resize",this._onResize)},methods:{_onResize:function(){this.isMobile=this._isMobile()},_isMobile:function(){return document.documentElement.clientWidth<768}}},E=r(49),C=r.n(E),M={name:"EditorWrapper",components:{EditorContent:g.b,MenuBar:function(){return Promise.all([r.e(196),r.e(190)]).then(r.bind(null,360))},MenuBubble:function(){return Promise.all([r.e(196),r.e(190)]).then(r.bind(null,365))},ReadOnlyEditor:function(){return Promise.all([r.e(0),r.e(195),r.e(187)]).then(r.bind(null,363))},CollisionResolveDialog:function(){return Promise.all([r.e(0),r.e(195),r.e(187)]).then(r.bind(null,364))},GuestNameDialog:function(){return Promise.all([r.e(186),r.e(189)]).then(r.bind(null,362))},SessionList:function(){return Promise.all([r.e(186),r.e(188)]).then(r.bind(null,361))}},directives:{Tooltip:C.a},mixins:[P],props:{relativePath:{type:String,default:null},fileId:{type:Number,default:null},active:{type:Boolean,default:!1},shareToken:{type:String,default:null},mime:{type:String,default:null}},data:function(){return{tiptap:null,syncService:null,document:null,sessions:[],currentSession:null,filteredSessions:{},dirty:!1,initialLoading:!1,lastSavedString:"",syncError:null,hasConnectionIssue:!1,readOnly:!0,forceRecreate:!1,saveStatusPolling:null}},computed:{lastSavedStatus:function(){var e=this.dirtyStateIndicator?"*":"";return this.isMobile||(e+=this.lastSavedString),e},lastSavedStatusClass:function(){return this.syncError&&""!==this.lastSavedString?"error":""},dirtyStateIndicator:function(){return this.hasUnpushedChanges||this.hasUnsavedChanges},lastSavedStatusTooltip:function(){var e=t("text","Last save {lastSave}",{lastSave:this.lastSavedString});return this.hasSyncCollission&&(e=t("text","The document has been changed outside of the editor. The changes cannot be applied.")),this.hasUnpushedChanges&&(e+=" - "+t("text","Unpushed changes")),this.hasUnsavedChanges&&(e+=" - "+t("text","Unsaved changes")),{content:e,placement:"bottom"}},hasSyncCollission:function(){return this.syncError&&this.syncError.type===m.SAVE_COLLISSION},hasUnpushedChanges:function(){return this.dirty},hasUnsavedChanges:function(){return this.document&&this.document.lastSavedVersion<this.document.currentVersion},backendUrl:function(){var e=this;return function(t){return Object(a.b)(t,!!e.shareToken)}},hasDocumentParameters:function(){return this.fileId||this.shareToken},isPublic:function(){return document.getElementById("isPublic")&&"1"===document.getElementById("isPublic").value},isRichEditor:function(){return"text/markdown"===this.mime},fileExtension:function(){return this.relativePath?this.relativePath.split("/").pop().split(".").pop():"txt"}},watch:{lastSavedStatus:function(){this.$refs.menubar&&this.$refs.menubar.redrawMenuBar()}},mounted:function(){this.active&&this.hasDocumentParameters&&this.initSession(),this.$parent.$emit("update:loaded",!0)},created:function(){var e=this;this.saveStatusPolling=setInterval(function(){e.updateLastSavedStatus()},2e3),document.addEventListener("keydown",this._keyUpHandler,!0)},beforeDestroy:function(){document.removeEventListener("keydown",this._keyUpHandler,!0),clearInterval(this.saveStatusPolling),this.currentSession&&this.syncService&&(this.currentSession=null,this.syncService.close(),this.syncService=null)},methods:{updateLastSavedStatus:function(){this.document&&(this.lastSavedString=window.moment(1e3*this.document.lastSavedVersionTime).fromNow())},initSession:function(){var e=this;if(this.hasDocumentParameters){var t=localStorage.getItem("nick")?localStorage.getItem("nick"):Object(a.c)();this.syncService=new v({shareToken:this.shareToken,filePath:this.relativePath,guestName:t,forceRecreate:this.forceRecreate,serialize:function(t){if(e.isRichEditor){var n=Object(y.b)(e.tiptap.nodes,e.tiptap.marks).serialize(t);return console.debug("serialized document",{markdown:n}),n}var r=Object(y.e)(e.tiptap);return console.debug("serialized document",{file:r}),r}}).on("opened",function(t){var n=t.document,r=t.session;e.currentSession=r,e.document=n,e.readOnly=n.readOnly,localStorage.setItem("nick",e.currentSession.guestName)}).on("change",function(t){var n=t.document,r=t.sessions;""===e.document.baseVersionEtag||n.baseVersionEtag===e.document.baseVersionEtag?(e.updateSessions.bind(e)(r),e.document=n,e.syncError=null,e.tiptap.setOptions({editable:!e.readOnly})):e.resolveUseServerVersion()}).on("loaded",function(t){var n=t.documentSource;e.hasConnectionIssue=!1,Object(y.c)(b[e.fileExtension]?b[e.fileExtension]:e.fileExtension).then(function(t){e.tiptap=Object(y.a)({content:e.isRichEditor?y.d.render(n):"<pre>"+window.escapeHTML(n)+"</pre>",onInit:function(t){var n=t.state;e.syncService.state=n,e.syncService.startSync()},onUpdate:function(t){var n=t.state;e.syncService.state=n},extensions:[new j.g({version:e.document.initialVersion,clientID:e.currentSession.id,debounce:200,onSendable:function(t){t.sendable;e.syncService&&e.syncService.sendSteps()}}),new O({"Ctrl-s":function(){return e.syncService.save(),!0}})],enableRichEditing:e.isRichEditor,languages:t}),e.syncService.state=e.tiptap.state})}).on("sync",function(t){var n=t.steps,r=t.document;e.hasConnectionIssue=!1;try{e.tiptap.extensions.options.collaboration.update({version:r.currentVersion,steps:n}),e.syncService.state=e.tiptap.state,e.updateLastSavedStatus()}catch(e){console.error("Failed to update steps in collaboration plugin",e)}e.document=r}).on("error",function(t,n){e.tiptap.setOptions({editable:!1}),t!==m.SAVE_COLLISSION||e.syncError&&e.syncError.type===m.SAVE_COLLISSION||(e.initialLoading=!0,e.syncError={type:t,data:n}),t!==m.CONNECTION_FAILED||e.hasConnectionIssue||(e.hasConnectionIssue=!0,OC.Notification.showTemporary("Connection failed, reconnecting"),setTimeout(e.reconnect.bind(e),1e3)),t===m.SOURCE_NOT_FOUND&&(e.initialLoading=!1,OC.Notification.showTemporary("Source not found"),e.$emit("close"))}).on("stateChange",function(t){t.initialLoading&&!e.initialLoading&&(e.initialLoading=!0,e.tiptap.focus("start")),t.hasOwnProperty("dirty")&&(e.dirty=t.dirty)}),this.syncService.open({fileId:this.fileId,filePath:this.relativePath}).catch(function(t){e.hasConnectionIssue=!0}),this.forceRecreate=!1}else this.$parent.$emit("error","No valid file provided")},resolveUseThisVersion:function(){this.syncService.forceSave(),this.tiptap.setOptions({editable:!this.readOnly})},resolveUseServerVersion:function(){this.forceRecreate=!0,this.reconnect()},reconnect:function(){var e=this;this.syncService.close().then(function(){e.syncService=null,e.tiptap.destroy(),e.initSession()}).catch(function(e){})},updateSessions:function(e){this.sessions=e.sort(function(e,t){return t.lastContact-e.lastContact});var t=this.sessions.map(function(e){return e.userId}),n=this.sessions.map(function(e){return e.guestId}),r=Object.keys(this.filteredSessions).filter(function(e){return!t.includes(e)&&!n.includes(e)});for(var i in r)o.default.delete(this.filteredSessions,r[i]);for(var s in this.sessions){var a=this.sessions[s],c=a.displayName?a.userId:a.id;this.filteredSessions[c]?this.filteredSessions[c].lastContact<a.lastContact&&o.default.set(this.filteredSessions[c],"lastContact",a.lastContact):o.default.set(this.filteredSessions,c,a),a.id===this.currentSession.id&&o.default.set(this.filteredSessions[c],"isCurrent",!0)}},_keyUpHandler:function(e){var t=e.key||e.keyCode;if((e.ctrlKey||e.metaKey)&&!e.shiftKey&&("f"===t||70===t))return e.stopPropagation(),!0}}},I=(r(340),r(342),r(5)),T=Object(I.a)(M,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"editor-container"}},[e.currentSession&&e.active?n("div",[e.hasSyncCollission?n("p",{staticClass:"msg icon-error"},[e._v("\n\t\t\t"+e._s(e.t("text","The document has been changed outside of the editor. The changes cannot be applied."))+"\n\t\t")]):e._e(),e._v(" "),e.hasConnectionIssue?n("p",{staticClass:"msg icon-error"},[e._v("\n\t\t\t"+e._s(e.t("text","Network connection error: Could not connect to the document"))+" "),n("a",{staticClass:"button primary",on:{click:e.reconnect}},[e._v(e._s(e.t("text","Retry")))])]):e._e()]):e._e(),e._v(" "),e.currentSession&&e.active?n("div",{class:{"has-conflicts":e.hasSyncCollission,"icon-loading":!e.initialLoading,richEditor:e.isRichEditor},attrs:{id:"editor-wrapper"}},[n("div",{attrs:{id:"editor"}},[e.syncError||e.readOnly?e._e():n("menu-bar",{ref:"menubar",attrs:{editor:e.tiptap,"is-rich-editor":e.isRichEditor}},[e.currentSession&&e.active?n("div",{attrs:{id:"editor-session-list"}},[n("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.lastSavedStatusTooltip,expression:"lastSavedStatusTooltip"}],staticClass:"save-status",class:e.lastSavedStatusClass},[e._v("\n\t\t\t\t\t\t"+e._s(e.lastSavedStatus)+"\n\t\t\t\t\t")]),e._v(" "),n("session-list",{attrs:{sessions:e.filteredSessions}},[e.isPublic&&e.currentSession.guestName?n("guest-name-dialog",{attrs:{"sync-service":e.syncService}}):e._e()],1)],1):e._e()]),e._v(" "),!e.readOnly&&e.isRichEditor?n("menu-bubble",{attrs:{editor:e.tiptap}}):e._e(),e._v(" "),n("editor-content",{directives:[{name:"show",rawName:"v-show",value:e.initialLoading,expression:"initialLoading"}],staticClass:"editor__content",attrs:{editor:e.tiptap}})],1),e._v(" "),e.hasSyncCollission?n("read-only-editor",{attrs:{content:e.syncError.data.outsideChange,"is-rich-editor":e.isRichEditor}}):e._e()],1):e._e(),e._v(" "),e.hasSyncCollission&&!e.readOnly?n("collision-resolve-dialog",{on:{resolveUseThisVersion:e.resolveUseThisVersion,resolveUseServerVersion:e.resolveUseServerVersion}}):e._e()],1)},[],!1,null,"2d1b43bf",null); + */var O=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),S(this,_(t).apply(this,arguments))}var r,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}(t,g["e"]),r=t,(n=[{key:"keys",value:function(e){return e.schema,this.options}},{key:"name",get:function(){return"save"}}])&&k(r.prototype,n),o&&k(r,o),t}(),P={data:function(){return{isMobile:this._isMobile()}},beforeMount:function(){window.addEventListener("resize",this._onResize)},beforeDestroy:function(){window.removeEventListener("resize",this._onResize)},methods:{_onResize:function(){this.isMobile=this._isMobile()},_isMobile:function(){return document.documentElement.clientWidth<768}}},E=n(50),C=n.n(E),I={name:"EditorWrapper",components:{EditorContent:g.b,MenuBar:function(){return Promise.all([n.e(196),n.e(190)]).then(n.bind(null,360))},MenuBubble:function(){return Promise.all([n.e(196),n.e(190)]).then(n.bind(null,365))},ReadOnlyEditor:function(){return Promise.all([n.e(0),n.e(195),n.e(187)]).then(n.bind(null,364))},CollisionResolveDialog:function(){return Promise.all([n.e(0),n.e(195),n.e(187)]).then(n.bind(null,361))},GuestNameDialog:function(){return Promise.all([n.e(186),n.e(189)]).then(n.bind(null,363))},SessionList:function(){return Promise.all([n.e(186),n.e(188)]).then(n.bind(null,362))}},directives:{Tooltip:C.a},mixins:[P],props:{relativePath:{type:String,default:null},fileId:{type:Number,default:null},active:{type:Boolean,default:!1},shareToken:{type:String,default:null},mime:{type:String,default:null}},data:function(){return{tiptap:null,syncService:null,document:null,sessions:[],currentSession:null,filteredSessions:{},dirty:!1,initialLoading:!1,lastSavedString:"",syncError:null,hasConnectionIssue:!1,readOnly:!0,forceRecreate:!1,saveStatusPolling:null}},computed:{lastSavedStatus:function(){var e=this.dirtyStateIndicator?"*":"";return this.isMobile||(e+=this.lastSavedString),e},lastSavedStatusClass:function(){return this.syncError&&""!==this.lastSavedString?"error":""},dirtyStateIndicator:function(){return this.hasUnpushedChanges||this.hasUnsavedChanges},lastSavedStatusTooltip:function(){var e=t("text","Last save {lastSave}",{lastSave:this.lastSavedString});return this.hasSyncCollission&&(e=t("text","The document has been changed outside of the editor. The changes cannot be applied.")),this.hasUnpushedChanges&&(e+=" - "+t("text","Unpushed changes")),this.hasUnsavedChanges&&(e+=" - "+t("text","Unsaved changes")),{content:e,placement:"bottom"}},hasSyncCollission:function(){return this.syncError&&this.syncError.type===m.SAVE_COLLISSION},hasUnpushedChanges:function(){return this.dirty},hasUnsavedChanges:function(){return this.document&&this.document.lastSavedVersion<this.document.currentVersion},backendUrl:function(){var e=this;return function(t){return Object(a.b)(t,!!e.shareToken)}},hasDocumentParameters:function(){return this.fileId||this.shareToken},isPublic:function(){return document.getElementById("isPublic")&&"1"===document.getElementById("isPublic").value},isRichEditor:function(){return"text/markdown"===this.mime},fileExtension:function(){return this.relativePath?this.relativePath.split("/").pop().split(".").pop():"txt"}},watch:{lastSavedStatus:function(){this.$refs.menubar&&this.$refs.menubar.redrawMenuBar()}},mounted:function(){this.active&&this.hasDocumentParameters&&this.initSession(),this.$parent.$emit("update:loaded",!0)},created:function(){var e=this;this.saveStatusPolling=setInterval(function(){e.updateLastSavedStatus()},2e3),document.addEventListener("keydown",this._keyUpHandler,!0)},beforeDestroy:function(){document.removeEventListener("keydown",this._keyUpHandler,!0),clearInterval(this.saveStatusPolling),this.currentSession&&this.syncService&&(this.currentSession=null,this.syncService.close(),this.syncService=null)},methods:{updateLastSavedStatus:function(){this.document&&(this.lastSavedString=window.moment(1e3*this.document.lastSavedVersionTime).fromNow())},initSession:function(){var e=this;if(this.hasDocumentParameters){var t=localStorage.getItem("nick")?localStorage.getItem("nick"):Object(a.c)();this.syncService=new v({shareToken:this.shareToken,filePath:this.relativePath,guestName:t,forceRecreate:this.forceRecreate,serialize:function(t){if(e.isRichEditor){var r=Object(y.b)(e.tiptap.nodes,e.tiptap.marks).serialize(t);return console.debug("serialized document",{markdown:r}),r}var n=Object(y.e)(e.tiptap);return console.debug("serialized document",{file:n}),n}}).on("opened",function(t){var r=t.document,n=t.session;e.currentSession=n,e.document=r,e.readOnly=r.readOnly,localStorage.setItem("nick",e.currentSession.guestName)}).on("change",function(t){var r=t.document,n=t.sessions;""===e.document.baseVersionEtag||r.baseVersionEtag===e.document.baseVersionEtag?(e.updateSessions.bind(e)(n),e.document=r,e.syncError=null,e.tiptap.setOptions({editable:!e.readOnly})):e.resolveUseServerVersion()}).on("loaded",function(t){var r=t.documentSource;e.hasConnectionIssue=!1,Object(y.c)(b[e.fileExtension]?b[e.fileExtension]:e.fileExtension).then(function(t){e.tiptap=Object(y.a)({content:e.isRichEditor?y.d.render(r):"<pre>"+window.escapeHTML(r)+"</pre>",onInit:function(t){var r=t.state;e.syncService.state=r,e.syncService.startSync()},onUpdate:function(t){var r=t.state;e.syncService.state=r},extensions:[new j.g({version:e.document.initialVersion,clientID:e.currentSession.id,debounce:200,onSendable:function(t){t.sendable;e.syncService&&e.syncService.sendSteps()}}),new O({"Ctrl-s":function(){return e.syncService.save(),!0}})],enableRichEditing:e.isRichEditor,languages:t}),e.syncService.state=e.tiptap.state})}).on("sync",function(t){var r=t.steps,n=t.document;e.hasConnectionIssue=!1;try{e.tiptap.extensions.options.collaboration.update({version:n.currentVersion,steps:r}),e.syncService.state=e.tiptap.state,e.updateLastSavedStatus()}catch(e){console.error("Failed to update steps in collaboration plugin",e)}e.document=n}).on("error",function(t,r){e.tiptap.setOptions({editable:!1}),t!==m.SAVE_COLLISSION||e.syncError&&e.syncError.type===m.SAVE_COLLISSION||(e.initialLoading=!0,e.syncError={type:t,data:r}),t!==m.CONNECTION_FAILED||e.hasConnectionIssue||(e.hasConnectionIssue=!0,OC.Notification.showTemporary("Connection failed, reconnecting"),setTimeout(e.reconnect.bind(e),1e3)),t===m.SOURCE_NOT_FOUND&&(e.initialLoading=!1,OC.Notification.showTemporary("Source not found"),e.$emit("close"))}).on("stateChange",function(t){t.initialLoading&&!e.initialLoading&&(e.initialLoading=!0,e.tiptap.focus("start")),t.hasOwnProperty("dirty")&&(e.dirty=t.dirty)}),this.syncService.open({fileId:this.fileId,filePath:this.relativePath}).catch(function(t){e.hasConnectionIssue=!0}),this.forceRecreate=!1}else this.$parent.$emit("error","No valid file provided")},resolveUseThisVersion:function(){this.syncService.forceSave(),this.tiptap.setOptions({editable:!this.readOnly})},resolveUseServerVersion:function(){this.forceRecreate=!0,this.reconnect()},reconnect:function(){var e=this;this.syncService.close().then(function(){e.syncService=null,e.tiptap.destroy(),e.initSession()}).catch(function(e){})},updateSessions:function(e){this.sessions=e.sort(function(e,t){return t.lastContact-e.lastContact});var t=this.sessions.map(function(e){return e.userId}),r=this.sessions.map(function(e){return e.guestId}),n=Object.keys(this.filteredSessions).filter(function(e){return!t.includes(e)&&!r.includes(e)});for(var i in n)o.default.delete(this.filteredSessions,n[i]);for(var s in this.sessions){var a=this.sessions[s],c=a.displayName?a.userId:a.id;this.filteredSessions[c]?this.filteredSessions[c].lastContact<a.lastContact&&o.default.set(this.filteredSessions[c],"lastContact",a.lastContact):o.default.set(this.filteredSessions,c,a),a.id===this.currentSession.id&&o.default.set(this.filteredSessions[c],"isCurrent",!0)}},_keyUpHandler:function(e){var t=e.key||e.keyCode;if((e.ctrlKey||e.metaKey)&&!e.shiftKey&&("f"===t||70===t))return e.stopPropagation(),!0}}},M=(n(340),n(342),n(5)),T=Object(M.a)(I,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"editor-container"}},[e.currentSession&&e.active?r("div",[e.hasSyncCollission?r("p",{staticClass:"msg icon-error"},[e._v("\n\t\t\t"+e._s(e.t("text","The document has been changed outside of the editor. The changes cannot be applied."))+"\n\t\t")]):e._e(),e._v(" "),e.hasConnectionIssue?r("p",{staticClass:"msg icon-error"},[e._v("\n\t\t\t"+e._s(e.t("text","Network connection error: Could not connect to the document"))+" "),r("a",{staticClass:"button primary",on:{click:e.reconnect}},[e._v(e._s(e.t("text","Retry")))])]):e._e()]):e._e(),e._v(" "),e.currentSession&&e.active?r("div",{class:{"has-conflicts":e.hasSyncCollission,"icon-loading":!e.initialLoading,richEditor:e.isRichEditor},attrs:{id:"editor-wrapper"}},[r("div",{attrs:{id:"editor"}},[e.syncError||e.readOnly?e._e():r("menu-bar",{ref:"menubar",attrs:{editor:e.tiptap,"is-rich-editor":e.isRichEditor}},[e.currentSession&&e.active?r("div",{attrs:{id:"editor-session-list"}},[r("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.lastSavedStatusTooltip,expression:"lastSavedStatusTooltip"}],staticClass:"save-status",class:e.lastSavedStatusClass},[e._v("\n\t\t\t\t\t\t"+e._s(e.lastSavedStatus)+"\n\t\t\t\t\t")]),e._v(" "),r("session-list",{attrs:{sessions:e.filteredSessions}},[e.isPublic&&e.currentSession.guestName?r("guest-name-dialog",{attrs:{"sync-service":e.syncService}}):e._e()],1)],1):e._e()]),e._v(" "),!e.readOnly&&e.isRichEditor?r("menu-bubble",{attrs:{editor:e.tiptap}}):e._e(),e._v(" "),r("editor-content",{directives:[{name:"show",rawName:"v-show",value:e.initialLoading,expression:"initialLoading"}],staticClass:"editor__content",attrs:{editor:e.tiptap}})],1),e._v(" "),e.hasSyncCollission?r("read-only-editor",{attrs:{content:e.syncError.data.outsideChange,"is-rich-editor":e.isRichEditor}}):e._e()],1):e._e(),e._v(" "),e.hasSyncCollission&&!e.readOnly?r("collision-resolve-dialog",{on:{resolveUseThisVersion:e.resolveUseThisVersion,resolveUseServerVersion:e.resolveUseServerVersion}}):e._e()],1)},[],!1,null,"2d1b43bf",null); /* * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net> * @@ -211,5 +211,5 @@ var f={shareToken:null,forceRecreate:!1,serialize:function(e){return e}},m={SAVE * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * - */n.default=T.exports},352:function(e,t,n){"use strict";var r=n(67);n.n(r).a},353:function(e,t,n){(e.exports=n(44)(!1)).push([e.i,"#read-only-editor[data-v-7a012ea5] {\n overflow: scroll;\n}\n",""])},354:function(e,t,n){"use strict";var r=n(68);n.n(r).a},355:function(e,t,n){(e.exports=n(44)(!1)).push([e.i,"#resolve-conflicts[data-v-1c2d184a] {\n display: flex;\n position: fixed;\n z-index: 10000;\n bottom: 0;\n max-width: 900px;\n width: 100vw;\n margin: auto;\n padding: 20px 0;\n}\n#resolve-conflicts button[data-v-1c2d184a] {\n margin: auto;\n box-shadow: 0 0 10px var(--color-box-shadow);\n}\n",""])},363:function(e,t,n){"use strict";n.r(t);var r=n(46),o=n(268),i={name:"ReadOnlyEditor",components:{EditorContent:r.b},props:{content:{type:String,required:!0},isRichEditor:{type:Boolean,default:!1}},data:function(){return{editor:null}},mounted:function(){this.editor=Object(o.a)({content:this.isRichEditor?o.d.render(this.content):"<pre>"+window.escapeHTML(this.content)+"</pre>",enableRichEditing:this.isRichEditor}),this.editor.setOptions({editable:!1})},beforeDestroy:function(){this.editor.destroy()}},s=(n(352),n(5)),a=Object(s.a)(i,function(){var e=this.$createElement,t=this._self._c||e;return this.editor?t("editor-content",{attrs:{id:"read-only-editor",editor:this.editor}}):this._e()},[],!1,null,"7a012ea5",null);t.default=a.exports},364:function(e,t,n){"use strict";n.r(t);var r={name:"CollisionResolveDialog"},o=(n(354),n(5)),i=Object(o.a)(r,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"collision-resolve-dialog",attrs:{id:"resolve-conflicts"}},[n("button",{on:{click:function(t){return e.$emit("resolveUseThisVersion")}}},[e._v("\n\t\t"+e._s(e.t("text","Use current version"))+"\n\t")]),e._v(" "),n("button",{on:{click:function(t){return e.$emit("resolveUseServerVersion")}}},[e._v("\n\t\t"+e._s(e.t("text","Use the saved version"))+"\n\t")])])},[],!1,null,"1c2d184a",null);t.default=i.exports},58:function(e,t,n){var r=n(282);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(45).default)("0e73d06f",r,!0,{})},62:function(e,t,n){var r=n(341);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(45).default)("11ac88d0",r,!0,{})},63:function(e,t,n){var r=n(343);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(45).default)("de4c163c",r,!0,{})},67:function(e,t,n){var r=n(353);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(45).default)("e6d84634",r,!0,{})},68:function(e,t,n){var r=n(355);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(45).default)("724c1b66",r,!0,{})}}]); -//# sourceMappingURL=editor.js.map?v=d7f247c27c6a4ab1cc91
\ No newline at end of file + */r.default=T.exports},352:function(e,t,r){"use strict";var n=r(65);r.n(n).a},353:function(e,t,r){(e.exports=r(46)(!1)).push([e.i,"#read-only-editor[data-v-7a012ea5]{overflow:scroll}\n",""])},354:function(e,t,r){"use strict";var n=r(66);r.n(n).a},355:function(e,t,r){(e.exports=r(46)(!1)).push([e.i,"#resolve-conflicts[data-v-1c2d184a]{display:flex;position:fixed;z-index:10000;bottom:0;max-width:900px;width:100vw;margin:auto;padding:20px 0}#resolve-conflicts button[data-v-1c2d184a]{margin:auto;box-shadow:0 0 10px var(--color-box-shadow)}\n",""])},361:function(e,t,r){"use strict";r.r(t);var n={name:"CollisionResolveDialog"},o=(r(354),r(5)),i=Object(o.a)(n,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"collision-resolve-dialog",attrs:{id:"resolve-conflicts"}},[r("button",{on:{click:function(t){return e.$emit("resolveUseThisVersion")}}},[e._v("\n\t\t"+e._s(e.t("text","Use current version"))+"\n\t")]),e._v(" "),r("button",{on:{click:function(t){return e.$emit("resolveUseServerVersion")}}},[e._v("\n\t\t"+e._s(e.t("text","Use the saved version"))+"\n\t")])])},[],!1,null,"1c2d184a",null);t.default=i.exports},364:function(e,t,r){"use strict";r.r(t);var n=r(48),o=r(268),i={name:"ReadOnlyEditor",components:{EditorContent:n.b},props:{content:{type:String,required:!0},isRichEditor:{type:Boolean,default:!1}},data:function(){return{editor:null}},mounted:function(){this.editor=Object(o.a)({content:this.isRichEditor?o.d.render(this.content):"<pre>"+window.escapeHTML(this.content)+"</pre>",enableRichEditing:this.isRichEditor}),this.editor.setOptions({editable:!1})},beforeDestroy:function(){this.editor.destroy()}},s=(r(352),r(5)),a=Object(s.a)(i,function(){var e=this.$createElement,t=this._self._c||e;return this.editor?t("editor-content",{attrs:{id:"read-only-editor",editor:this.editor}}):this._e()},[],!1,null,"7a012ea5",null);t.default=a.exports},56:function(e,t,r){var n=r(282);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(47).default)("ead57056",n,!0,{})},60:function(e,t,r){var n=r(341);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(47).default)("0fbff9f2",n,!0,{})},61:function(e,t,r){var n=r(343);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(47).default)("5039213c",n,!0,{})},65:function(e,t,r){var n=r(353);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(47).default)("4ed82680",n,!0,{})},66:function(e,t,r){var n=r(355);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,r(47).default)("62f53740",n,!0,{})}}]); +//# sourceMappingURL=editor.js.map?v=a248d508b452bc1c32dd
\ No newline at end of file |