"use strict";(self["webpackChunklin_cms_vue"]=self["webpackChunklin_cms_vue"]||[]).push([[3868],{61445:function(n,e,t){t.d(e,{A:function(){return D}});var o=t(20641),i=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],r=function(n){return-1!==i.map((function(n){return n.toLowerCase()})).indexOf(n.toLowerCase())},a=function(n,e,t){Object.keys(e).filter(r).forEach((function(o){var i=e[o];"function"===typeof i&&("onInit"===o?i(n,t):t.on(o.substring(2),(function(n){return i(n,t)})))}))},u=function(n,e,t,i){var r=n.modelEvents?n.modelEvents:null,a=Array.isArray(r)?r.join(" "):r;(0,o.wB)(i,(function(e,o){t&&"string"===typeof e&&e!==o&&e!==t.getContent({format:n.outputFormat})&&t.setContent(e)})),t.on(a||"change input undo redo",(function(){e.emit("update:modelValue",t.getContent({format:n.outputFormat}))}))},l=function(n,e,t,o,i,r){o.setContent(r()),t.attrs["onUpdate:modelValue"]&&u(e,t,o,i),a(n,t.attrs,o)},c=0,s=function(n){var e=Date.now(),t=Math.floor(1e9*Math.random());return c++,n+"_"+t+c+String(e)},d=function(n){return null!==n&&"textarea"===n.tagName.toLowerCase()},f=function(n){return"undefined"===typeof n||""===n?[]:Array.isArray(n)?n:n.split(" ")},p=function(n,e){return f(n).concat(f(e))},m=function(n){return null===n||void 0===n},g=function(){return{listeners:[],scriptId:s("tiny-script"),scriptLoaded:!1}},v=function(){var n=g(),e=function(n,e,t,o){var i=e.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=n,i.src=t;var r=function(){i.removeEventListener("load",r),o()};i.addEventListener("load",r),e.head&&e.head.appendChild(i)},t=function(t,o,i){n.scriptLoaded?i():(n.listeners.push(i),t.getElementById(n.scriptId)||e(n.scriptId,t,o,(function(){n.listeners.forEach((function(n){return n()})),n.scriptLoaded=!0})))},o=function(){n=g()};return{load:t,reinitialize:o}},h=v(),y=function(){return"undefined"!==typeof window?window:t.g},b=function(){var n=y();return n&&n.tinymce?n.tinymce:null},C={apiKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],modelValue:String,disabled:Boolean,tinymceScriptSrc:String,outputFormat:{type:String,validator:function(n){return"html"===n||"text"===n}}},S=t(50953),w=function(){return w=Object.assign||function(n){for(var e,t=1,o=arguments.length;tr.content=n),key:r.tinymceFlag},null,8,["init","modelValue"]))])}var r=t(61445),a=t(96557),u={name:"TinymceEditor",props:{defaultContent:{type:String,default:""},height:{type:Number,default:500},width:{type:Number,default:void 0},showMenubar:{type:Boolean,default:!0},toolbar:{type:String,default:" undo redo\n | formatselect fontselect fontsizeselect lineheight\n | bold italic underline strikethrough forecolor backcolor formatpainter\n | insertdatetime superscript subscript hr\n | link image | alignleft aligncenter alignright alignjustify\n | numlist bullist outdent indent\n | removeformat\n | preview fullscreen code"}},components:{Editor:r.A},data(){return{content:"",tinymceFlag:1,tinymceInit:{}}},created(){this.tinymceInit={language:"zh_CN",height:this.height,branding:!0,statusbar:!1,elementpath:!1,toolbar:this.toolbar,paste_data_images:!0,browser_spellcheck:!0,menubar:this.showMenubar,plugins:"print fullpage searchreplace autolink directionality visualblocks\n visualchars template codesample charmap hr pagebreak nonbreaking anchor toc insertdatetime\n wordcount textpattern help advlist table lists paste preview fullscreen image imagetools code link",async images_upload_handler(n,e,t){const o=new File([n.blob()],n.filename(),{type:"image/*"});(0,a.post)("cms/file",{file:o}).then((n=>{var t;n.length&&null!==(t=n[0])&&void 0!==t&&t.url&&e(n[0].url)})).catch((n=>t(n)))}}},mounted(){this.defaultContent&&(this.content=this.defaultContent)},watch:{content:{handler(){this.$emit("change",this.content)}},defaultContent:{handler(){this.content=this.defaultContent},immediate:!0}},activated(){this.tinymceFlag++}},l=t(66262);const c=(0,l.A)(u,[["render",i]]);var s=c}}]); //# sourceMappingURL=3868.cbd42c78.js.map