travel/admin/node_modules/tui-editor/dist/tui-editor-Viewer.min.js

7 lines
37 KiB
JavaScript
Raw Normal View History

2024-06-24 11:28:18 +08:00
/*!
* tui-editor
* @version 1.3.3
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery"),require("tui-code-snippet"),require("markdown-it"),require("to-mark"),require("highlight.js")):"function"==typeof define&&define.amd?define(["jquery","tui-code-snippet","markdown-it","to-mark","highlight.js"],t):"object"==typeof exports?exports.Editor=t(require("jquery"),require("tui-code-snippet"),require("markdown-it"),require("to-mark"),require("highlight.js")):(e.tui=e.tui||{},e.tui.Editor=t(e.$,e.tui&&e.tui.util,e.markdownit,e.toMark,e.hljs))}("undefined"!=typeof self?self:this,function(e,t,n,r,o){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=145)}({0:function(t,n){t.exports=e},1:function(e,n){e.exports=t},12:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(r)},s=n(13),l=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,n,a,i){r(this,t);var u=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,a,i));return u._initEvent(),u}return a(t,e),i(t,[{key:"_initEvent",value:function(){var e=this,t="";this.eventManager.listen("contentChangedFromMarkdown",function(n){t=n.getValue(),e.isVisible()&&e.lazyRunner.run("refresh",t.replace(/<br>\n/g,"<br>"))}),this.eventManager.listen("previewNeedsRefresh",function(n){e.refresh(n||t)}),this.$el.on("scroll",function(t){e.eventManager.emit("scroll",{source:"preview",data:t})})}},{key:"render",value:function(e){u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"render",this).call(this,e),this.eventManager.emit("previewRenderAfter",this)}},{key:"remove",value:function(){this.$el.off("scroll"),this.$el=null}}]),t}(l.default);t.default=c},13:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),u=r(i),s=n(20),l=r(s),c=function(){function e(t,n,r,a){o(this,e),this.eventManager=n,this.convertor=r,this.$el=t,this.isViewer=!!a,this._initContentSection(),this.lazyRunner=new l.default,this.lazyRunner.registerLazyRunFunction("refresh",this.refresh,800,this)}return a(e,[{key:"_initContentSection",value:function(){this._$previewContent=(0,u.default)('<div class="tui-editor-contents" />'),this.$el.append(this._$previewContent)}},{key:"refresh"