(function(e){function t(t){for(var i,r,a=t[0],l=t[1],c=t[2],u=0,m=[];u ${e.join("\n")}[${e[0]}]
: ${e[1]}
`:`[${e[0]}]
${e[1]}: ${e[2]}
`);return e.length?`引用链接
${e}
`;case 2:return`${e}
`;case 3:return`${e}
`;default:return`${e}
`}},n.paragraph=e=>-1!=e.indexOf("
`),`
${e}`),n.code=(e,t)=>(t=f.a.getLanguage(t)?t:"plaintext",e=f.a.highlight(e,{language:t}).value,e=e.replace(/\r\n/g,"
${e}
`),n.codespan=(e,t)=>`${e}
`,n.listitem=e=>`{this.cssEditor||this.cssEditor.refresh()}),setTimeout(()=>{this.cssEditor.refresh()},50);let e=localStorage.getItem("__css_content");e||this.setCssEditorValue(y)},confirmReset(){this.showResetConfirm=!1,localStorage.clear(),this.cssEditor.setValue(y),this.citeStatus=!1,this.statusChanged(!1),this.fontChanged(this.config.builtinFonts[0].value),this.colorChanged(this.config.colorOption[0].value),this.sizeChanged(this.config.sizeOption[2].value),this.codeThemeChanged(this.config.codeThemeOption[2].value),this.$emit("cssChanged"),this.selectFont=this.currentFont,this.selectSize=this.currentSize,this.selectColor=this.currentColor,this.selectCodeTheme=this.codeTheme,this.isMacCodeBlock=!1,this.codeBlockChanged()},cancelReset(){this.showResetConfirm=!1,this.editor.focus()},...Object(d["b"])(["setCurrentColor","setCiteStatus","themeChanged","setCurrentFont","setCurrentSize","setCssEditorValue","setCurrentCodeTheme","setWxRendererOptions","setIsMacCodeBlock"])},mounted(){this.selectFont=this.currentFont,this.selectSize=this.currentSize,this.selectColor=this.currentColor,this.selectCodeTheme=this.codeTheme,this.citeStatus=this.currentCiteStatus,this.isMacCodeBlock=this.currentIsMacCodeBlock;const e=this.$refs.fileInput;e.onchange=()=>{const t=e.files[0];if(null==t)return;const o=new FileReader;o.readAsText(t),o.onload=()=>{this.$emit("import-md",o.result)}}}},$e=xe,Ee=(o("7c21"),Object(r["a"])($e,oe,ie,!1,null,"4e99727f",null)),Me=Ee.exports,Te=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"about__dialog",attrs:{title:"关于",visible:e.visible,width:"30%",center:""},on:{close:function(t){return e.$emit("close")}}},[t("div",{staticStyle:{"text-align":"center"}},[t("h3",[e._v("一款高度简洁的微信 Markdown 编辑器")]),t("p",[e._v("扫码关注公众号 Doocs,原创技术文章第一时间推送!")]),t("img",{staticStyle:{width:"40%"},attrs:{src:"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/1648303220922-7e14aefa-816e-44c1-8604-ade709ca1c69.png"}})]),t("template",{slot:"footer"},[t("el-button",{attrs:{type:"primary",plain:""},on:{click:function(t){return e.onRedirect("https://github.com/doocs/md")}}},[e._v(" GitHub 仓库 ")]),t("el-button",{attrs:{type:"primary",plain:""},on:{click:function(t){return e.onRedirect("https://gitee.com/doocs/md")}}},[e._v(" Gitee 仓库 ")])],1)],2)},Ie=[],De={props:{visible:{type:Boolean,default:!1}},methods:{onRedirect(e){window.open(e)}}},Ae=De,Pe=(o("7f25"),Object(r["a"])(Ae,Te,Ie,!1,null,"314554b5",null)),Re=Pe.exports,Ke=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"insert__dialog",attrs:{title:"插入表格",visible:e.visible,border:""},on:{close:function(t){return e.$emit("close")}}},[t("el-row",{staticClass:"tb-options",attrs:{type:"flex",align:"middle",gutter:10}},[t("el-col",[e._v(" 行数: "),t("el-input-number",{attrs:{"controls-position":"right",min:1,max:100,size:"small"},model:{value:e.rowNum,callback:function(t){e.rowNum=t},expression:"rowNum"}})],1),t("el-col",[e._v(" 列数: "),t("el-input-number",{attrs:{"controls-position":"right",min:1,max:100,size:"small"},model:{value:e.colNum,callback:function(t){e.colNum=t},expression:"colNum"}})],1)],1),t("table",{staticClass:"input-table",staticStyle:{"border-collapse":"collapse"}},e._l(e.rowNum+1,(function(o){return t("tr",{key:o,class:{"head-style":1===o}},e._l(e.colNum,(function(i){return t("td",{key:i},[t("el-input",{attrs:{align:"center",placeholder:1===o?"表头":""},model:{value:e.tableData[`k_${o-1}_${i-1}`],callback:function(t){e.$set(e.tableData,`k_${o-1}_${i-1}`,t)},expression:"tableData[`k_${row - 1}_${col - 1}`]"}})],1)})),0)})),0),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:e.btnType,plain:""},on:{click:function(t){return e.$emit("close")}}},[e._v(" 取 消 ")]),t("el-button",{attrs:{type:e.btnType,plain:""},on:{click:e.insertTable}},[e._v(" 确 定 ")])],1)],1)},je=[],Be={props:{visible:{type:Boolean,default:!1}},data(){return{config:u,rowNum:3,colNum:3,tableData:{}}},computed:{btnType(){return this.nightMode?"default":"primary"},...Object(d["c"])({nightMode:e=>e.nightMode,editor:e=>e.editor})},methods:{insertTable(){this.editor.getCursor();const e=F({data:this.tableData,rows:this.rowNum,cols:this.colNum});this.tableData={},this.rowNum=3,this.colNum=3,this.editor.replaceSelection(`\n${e}\n`,"end"),this.$emit("close"),this.editorRefresh()},...Object(d["b"])(["editorRefresh"])}},Le=Be,Ue=(o("5ae1"),Object(r["a"])(Le,Ke,je,!1,null,"015ce7b9",null)),qe=Ue.exports,Fe=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"menu",style:`left: ${e.left}px;top: ${e.top}px;`,attrs:{id:"menu"}},e._l(e.menu,(function(o,i){return t("ul",{key:i,staticClass:"menu__group"},e._l(o,(function({key:o,text:i}){return t("li",{key:o,staticClass:"menu_item",on:{mousedown:function(t){return e.onMouseDown(o)}}},[e._v(" "+e._s(i)+" ")])})),0)})),0)},ze=[],He={props:{visible:{type:Boolean,default:!1},top:{type:Number,default:0},left:{type:Number,default:0}},data(){return{menu:[[{text:"上传图片",key:"insertPic"},{text:"插入表格",key:"insertTable"},{text:"恢复默认样式",key:"resetStyle"}],[{text:"导入 .md 文档",key:"importMarkdown"},{text:"导出 .md 文档",key:"download"},{text:"导出 .html",key:"export"},{text:"格式化",key:"formatMarkdown"}]]}},methods:{onMouseDown(e){this.$emit("menuTick",e),this.$emit("closeMenu")}}},Ge=He,Ne=(o("ebc0"),Object(r["a"])(Ge,Fe,ze,!1,null,"283cf1ee",null)),We=Ne.exports,Ve=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"upload__dialog",attrs:{title:"本地上传",visible:e.visible},on:{close:function(t){return e.$emit("close")}}},[t("el-tabs",{attrs:{type:"activeName"},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[t("el-tab-pane",{staticClass:"upload-panel",attrs:{label:"选择上传",name:"upload"}},[t("el-select",{attrs:{placeholder:"请选择",size:"small"},on:{change:e.changeImgHost},model:{value:e.imgHost,callback:function(t){e.imgHost=t},expression:"imgHost"}},e._l(e.options,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),t("el-upload",{attrs:{drag:"",action:"",headers:{"Content-Type":"multipart/form-data"},"show-file-list":!1,multiple:!0,accept:".jpg, .jpeg, .png, .gif",name:"file","before-upload":e.beforeImageUpload,"http-request":e.uploadImage}},[t("i",{staticClass:"el-icon-upload"}),t("div",{staticClass:"el-upload__text"},[e._v(" 将图片拖到此处,或 "),t("em",[e._v("点击上传")])])])],1),t("el-tab-pane",{staticClass:"github-panel",attrs:{label:"GitHub 图床",name:"github"}},[t("el-form",{staticClass:"setting-form",attrs:{model:e.formGitHub,"label-position":"right","label-width":"140px"}},[t("el-form-item",{attrs:{label:"GitHub 仓库",required:!0}},[t("el-input",{attrs:{placeholder:"如:github.com/yanglbme/resource"},model:{value:e.formGitHub.repo,callback:function(t){e.$set(e.formGitHub,"repo","string"===typeof t?t.trim():t)},expression:"formGitHub.repo"}})],1),t("el-form-item",{attrs:{label:"分支"}},[t("el-input",{attrs:{placeholder:"如:release,可不填,默认 master"},model:{value:e.formGitHub.branch,callback:function(t){e.$set(e.formGitHub,"branch","string"===typeof t?t.trim():t)},expression:"formGitHub.branch"}})],1),t("el-form-item",{attrs:{label:"Token",required:!0}},[t("el-input",{attrs:{"show-password":"",placeholder:"如:cc1d0c1426d0fd0902bd2d7184b14da61b8abc46"},model:{value:e.formGitHub.accessToken,callback:function(t){e.$set(e.formGitHub,"accessToken","string"===typeof t?t.trim():t)},expression:"formGitHub.accessToken"}}),t("el-link",{attrs:{type:"primary",href:"https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token",target:"_blank"}},[e._v("如何获取 GitHub Token? ")])],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.saveGitHubConfiguration}},[e._v("保存配置 ")])],1)],1)],1),t("el-tab-pane",{staticClass:"github-panel",attrs:{label:"阿里云 OSS",name:"aliOSS"}},[t("el-form",{staticClass:"setting-form",attrs:{model:e.formAliOSS,"label-position":"right","label-width":"140px"}},[t("el-form-item",{attrs:{label:"AccessKey ID",required:!0}},[t("el-input",{attrs:{placeholder:"如:LTAI4GdoocsmdoxUf13ylbaNHk"},model:{value:e.formAliOSS.accessKeyId,callback:function(t){e.$set(e.formAliOSS,"accessKeyId","string"===typeof t?t.trim():t)},expression:"formAliOSS.accessKeyId"}})],1),t("el-form-item",{attrs:{label:"AccessKey Secret",required:!0}},[t("el-input",{attrs:{"show-password":"",placeholder:"如:cc1d0c142doocs0902bd2d7md4b14da6ylbabc46"},model:{value:e.formAliOSS.accessKeySecret,callback:function(t){e.$set(e.formAliOSS,"accessKeySecret","string"===typeof t?t.trim():t)},expression:"formAliOSS.accessKeySecret"}})],1),t("el-form-item",{attrs:{label:"Bucket",required:!0}},[t("el-input",{attrs:{placeholder:"如:doocs"},model:{value:e.formAliOSS.bucket,callback:function(t){e.$set(e.formAliOSS,"bucket","string"===typeof t?t.trim():t)},expression:"formAliOSS.bucket"}})],1),t("el-form-item",{attrs:{label:"Bucket 所在区域",required:!0}},[t("el-input",{attrs:{placeholder:"如:oss-cn-shenzhen"},model:{value:e.formAliOSS.region,callback:function(t){e.$set(e.formAliOSS,"region","string"===typeof t?t.trim():t)},expression:"formAliOSS.region"}})],1),t("el-form-item",{attrs:{label:"自定义 CDN 域名",required:!1}},[t("el-input",{attrs:{placeholder:"如:https://imagecdn.alidaodao.com,可不填"},model:{value:e.formAliOSS.cdnHost,callback:function(t){e.$set(e.formAliOSS,"cdnHost","string"===typeof t?t.trim():t)},expression:"formAliOSS.cdnHost"}})],1),t("el-form-item",{attrs:{label:"存储路径"}},[t("el-input",{attrs:{placeholder:"如:img,可不填,默认为根目录"},model:{value:e.formAliOSS.path,callback:function(t){e.$set(e.formAliOSS,"path","string"===typeof t?t.trim():t)},expression:"formAliOSS.path"}}),t("el-link",{attrs:{type:"primary",href:"https://help.aliyun.com/document_detail/31883.html",target:"_blank"}},[e._v("如何使用阿里云 OSS? ")])],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.saveAliOSSConfiguration}},[e._v(" 保存配置 ")])],1)],1)],1),t("el-tab-pane",{staticClass:"github-panel",attrs:{label:"腾讯云 COS",name:"txCOS"}},[t("el-form",{staticClass:"setting-form",attrs:{model:e.formTxCOS,"label-position":"right","label-width":"140px"}},[t("el-form-item",{attrs:{label:"SecretId",required:!0}},[t("el-input",{attrs:{placeholder:"如:AKIDnQp1w3DOOCSs8F5MDp9tdoocsmdUPonW3"},model:{value:e.formTxCOS.secretId,callback:function(t){e.$set(e.formTxCOS,"secretId","string"===typeof t?t.trim():t)},expression:"formTxCOS.secretId"}})],1),t("el-form-item",{attrs:{label:"SecretKey",required:!0}},[t("el-input",{attrs:{"show-password":"",placeholder:"如:ukLmdtEJ9271f3DOocsMDsCXdS3YlbW0"},model:{value:e.formTxCOS.secretKey,callback:function(t){e.$set(e.formTxCOS,"secretKey","string"===typeof t?t.trim():t)},expression:"formTxCOS.secretKey"}})],1),t("el-form-item",{attrs:{label:"Bucket",required:!0}},[t("el-input",{attrs:{placeholder:"如:doocs-3212520134"},model:{value:e.formTxCOS.bucket,callback:function(t){e.$set(e.formTxCOS,"bucket","string"===typeof t?t.trim():t)},expression:"formTxCOS.bucket"}})],1),t("el-form-item",{attrs:{label:"Bucket 所在区域",required:!0}},[t("el-input",{attrs:{placeholder:"如:ap-guangzhou"},model:{value:e.formTxCOS.region,callback:function(t){e.$set(e.formTxCOS,"region","string"===typeof t?t.trim():t)},expression:"formTxCOS.region"}})],1),t("el-form-item",{attrs:{label:"自定义 CDN 域名",required:!1}},[t("el-input",{attrs:{placeholder:"如:https://imagecdn.alidaodao.com,可不填"},model:{value:e.formTxCOS.cdnHost,callback:function(t){e.$set(e.formTxCOS,"cdnHost","string"===typeof t?t.trim():t)},expression:"formTxCOS.cdnHost"}})],1),t("el-form-item",{attrs:{label:"存储路径"}},[t("el-input",{attrs:{placeholder:"如:img,可不填,默认根目录"},model:{value:e.formTxCOS.path,callback:function(t){e.$set(e.formTxCOS,"path","string"===typeof t?t.trim():t)},expression:"formTxCOS.path"}}),t("el-link",{attrs:{type:"primary",href:"https://cloud.tencent.com/document/product/436/38484",target:"_blank"}},[e._v("如何使用腾讯云 COS? ")])],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.saveTxCOSConfiguration}},[e._v(" 保存配置 ")])],1)],1)],1),t("el-tab-pane",{staticClass:"github-panel",attrs:{label:"七牛云 Kodo",name:"qiniu"}},[t("el-form",{staticClass:"setting-form",attrs:{model:e.formQiniu,"label-position":"right","label-width":"140px"}},[t("el-form-item",{attrs:{label:"AccessKey",required:!0}},[t("el-input",{attrs:{placeholder:"如:6DD3VaLJ_SQgOdoocsyTV_YWaDmdnL2n8EGx7kG"},model:{value:e.formQiniu.accessKey,callback:function(t){e.$set(e.formQiniu,"accessKey","string"===typeof t?t.trim():t)},expression:"formQiniu.accessKey"}})],1),t("el-form-item",{attrs:{label:"SecretKey",required:!0}},[t("el-input",{attrs:{"show-password":"",placeholder:"如:qgZa5qrvDOOcsmdKStD1oCjZ9nB7MDvJUs_34SIm"},model:{value:e.formQiniu.secretKey,callback:function(t){e.$set(e.formQiniu,"secretKey","string"===typeof t?t.trim():t)},expression:"formQiniu.secretKey"}})],1),t("el-form-item",{attrs:{label:"Bucket",required:!0}},[t("el-input",{attrs:{placeholder:"如:md"},model:{value:e.formQiniu.bucket,callback:function(t){e.$set(e.formQiniu,"bucket","string"===typeof t?t.trim():t)},expression:"formQiniu.bucket"}})],1),t("el-form-item",{attrs:{label:"Bucket 对应域名",required:!0}},[t("el-input",{attrs:{placeholder:"如:https://images.123ylb.cn"},model:{value:e.formQiniu.domain,callback:function(t){e.$set(e.formQiniu,"domain","string"===typeof t?t.trim():t)},expression:"formQiniu.domain"}})],1),t("el-form-item",{attrs:{label:"存储区域",required:!0}},[t("el-input",{attrs:{placeholder:"如:z2"},model:{value:e.formQiniu.region,callback:function(t){e.$set(e.formQiniu,"region","string"===typeof t?t.trim():t)},expression:"formQiniu.region"}})],1),t("el-form-item",{attrs:{label:"存储路径",required:!1}},[t("el-input",{attrs:{placeholder:"如:img,可不填,默认为根目录"},model:{value:e.formQiniu.path,callback:function(t){e.$set(e.formQiniu,"path","string"===typeof t?t.trim():t)},expression:"formQiniu.path"}}),t("el-link",{attrs:{type:"primary",href:"https://developer.qiniu.com/kodo",target:"_blank"}},[e._v("如何使用七牛云 Kodo? ")])],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.saveQiniuConfiguration}},[e._v(" 保存配置 ")])],1)],1)],1),t("el-tab-pane",{staticClass:"github-panel",attrs:{label:"MinIO",name:"minio"}},[t("el-form",{staticClass:"setting-form",attrs:{model:e.minioOSS,"label-position":"right","label-width":"140px"}},[t("el-form-item",{attrs:{label:"Endpoint",required:!0}},[t("el-input",{attrs:{placeholder:"如:play.min.io"},model:{value:e.minioOSS.endpoint,callback:function(t){e.$set(e.minioOSS,"endpoint","string"===typeof t?t.trim():t)},expression:"minioOSS.endpoint"}})],1),t("el-form-item",{attrs:{label:"Port",required:!1}},[t("el-input",{attrs:{type:"number",placeholder:"如:9000,可不填,http 默认为 80,https 默认为 443"},model:{value:e.minioOSS.port,callback:function(t){e.$set(e.minioOSS,"port","string"===typeof t?t.trim():t)},expression:"minioOSS.port"}})],1),t("el-form-item",{attrs:{label:"UseSSL",required:!0}},[t("el-switch",{attrs:{"active-text":"是","inactive-text":"否"},model:{value:e.minioOSS.useSSL,callback:function(t){e.$set(e.minioOSS,"useSSL",t)},expression:"minioOSS.useSSL"}})],1),t("el-form-item",{attrs:{label:"Bucket",required:!0}},[t("el-input",{attrs:{placeholder:"如:doocs"},model:{value:e.minioOSS.bucket,callback:function(t){e.$set(e.minioOSS,"bucket","string"===typeof t?t.trim():t)},expression:"minioOSS.bucket"}})],1),t("el-form-item",{attrs:{label:"AccessKey",required:!0}},[t("el-input",{attrs:{placeholder:"如:zhangsan"},model:{value:e.minioOSS.accessKey,callback:function(t){e.$set(e.minioOSS,"accessKey","string"===typeof t?t.trim():t)},expression:"minioOSS.accessKey"}})],1),t("el-form-item",{attrs:{label:"SecretKey",required:!0}},[t("el-input",{attrs:{placeholder:"如:asdasdasd"},model:{value:e.minioOSS.secretKey,callback:function(t){e.$set(e.minioOSS,"secretKey","string"===typeof t?t.trim():t)},expression:"minioOSS.secretKey"}}),t("el-link",{attrs:{type:"primary",href:"http://docs.minio.org.cn/docs/master/minio-client-complete-guide",target:"_blank"}},[e._v("如何使用 MinIO? ")])],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.saveMinioOSSConfiguration}},[e._v(" 保存配置 ")])],1)],1)],1),t("el-tab-pane",{staticClass:"github-panel formCustom",attrs:{label:"自定义代码",name:"formCustom"}},[t("el-form",{staticClass:"setting-form",attrs:{model:e.formCustom,"label-position":"right"}},[t("el-form-item",{attrs:{label:"",required:!0}},[t("el-input",{ref:"formCustomElInput",staticClass:"formCustomElInput",attrs:{type:"textarea",resize:"none",placeholder:"Your custom code here."},model:{value:e.formCustom.code,callback:function(t){e.$set(e.formCustom,"code",t)},expression:"formCustom.code"}}),t("el-link",{attrs:{type:"primary",href:"https://github.com/doocs/md#自定义上传逻辑",target:"_blank"}},[e._v("参数详情? ")])],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.formCustomSave}},[e._v(" 保存配置 ")])],1)],1)],1)],1)],1)},Qe=[],Je={props:{visible:{type:Boolean,default:!1}},data(){return{activeName:"upload",formGitHub:{repo:"",branch:"",accessToken:""},formAliOSS:{accessKeyId:"",accessKeySecret:"",bucket:"",region:"",path:"",cdnHost:""},minioOSS:{endpoint:"",port:"",useSSL:!0,bucket:"",accessKey:"",secretKey:""},formTxCOS:{secretId:"",secretKey:"",bucket:"",region:"",path:"",cdnHost:""},formQiniu:{accessKey:"",secretKey:"",bucket:"",domain:"",region:""},formCustom:{code:localStorage.getItem("formCustomConfig")||G(`\n const {file, util, okCb, errCb} = CUSTOM_ARG\n const param = new FormData()\n param.append('file', file)\n util.axios.post('${window.location.origin}/upload', param, {\n headers: { 'Content-Type': 'multipart/form-data' }\n }).then(res => {\n okCb(res.url)\n }).catch(err => {\n errCb(err)\n })\n `).trim(),editor:void 0},options:[{value:"default",label:"默认"},{value:"github",label:"GitHub"},{value:"aliOSS",label:"阿里云"},{value:"txCOS",label:"腾讯云"},{value:"qiniu",label:"七牛云"},{value:"minio",label:"MinIO"},{value:"formCustom",label:"自定义代码"}],imgHost:"default"}},created(){localStorage.getItem("githubConfig")&&(this.formGitHub=JSON.parse(localStorage.getItem("githubConfig"))),localStorage.getItem("aliOSSConfig")&&(this.formAliOSS=JSON.parse(localStorage.getItem("aliOSSConfig"))),localStorage.getItem("minioConfig")&&(this.minioOSS=JSON.parse(localStorage.getItem("minioConfig"))),localStorage.getItem("txCOSConfig")&&(this.formTxCOS=JSON.parse(localStorage.getItem("txCOSConfig"))),localStorage.getItem("imgHost")&&(this.imgHost=localStorage.getItem("imgHost"))},methods:{changeImgHost(){localStorage.setItem("imgHost",this.imgHost),this.$message.success("已成功切换图床")},saveGitHubConfiguration(){if(this.formGitHub.repo&&this.formGitHub.accessToken)localStorage.setItem("githubConfig",JSON.stringify(this.formGitHub)),this.$message.success("保存成功");else{const e=this.formGitHub.repo?"token":"GitHub 仓库";this.$message.error(`参数「${e}」不能为空`)}},saveAliOSSConfiguration(){this.formAliOSS.accessKeyId&&this.formAliOSS.accessKeySecret&&this.formAliOSS.bucket&&this.formAliOSS.region?(localStorage.setItem("aliOSSConfig",JSON.stringify(this.formAliOSS)),this.$message.success("保存成功")):this.$message.error("阿里云 OSS 参数配置不全")},saveMinioOSSConfiguration(){this.minioOSS.endpoint&&this.minioOSS.bucket&&this.minioOSS.accessKey&&this.minioOSS.secretKey?(localStorage.setItem("minioConfig",JSON.stringify(this.minioOSS)),this.$message.success("保存成功")):this.$message.error("MinIO 参数配置不全")},saveTxCOSConfiguration(){this.formTxCOS.secretId&&this.formTxCOS.secretKey&&this.formTxCOS.bucket&&this.formTxCOS.region?(localStorage.setItem("txCOSConfig",JSON.stringify(this.formTxCOS)),this.$message.success("保存成功")):this.$message.error("腾讯云 COS 参数配置不全")},saveQiniuConfiguration(){this.formQiniu.accessKey&&this.formQiniu.secretKey&&this.formQiniu.bucket&&this.formQiniu.domain&&this.formQiniu.region?(localStorage.setItem("qiniuConfig",JSON.stringify(this.formQiniu)),this.$message.success("保存成功")):this.$message.error("七牛云 Kodo 参数配置不全")},formCustomSave(){const e=this.formCustom.editor.getValue();localStorage.setItem("formCustomConfig",e),this.$message.success("保存成功")},beforeImageUpload(e){const t=H(e);if(!t.ok)return this.$message.error(t.msg),!1;let o=localStorage.getItem("imgHost");o=o||"default",localStorage.setItem("imgHost",o);const i=localStorage.getItem(o+"Config"),n="default"==o||i;return!!n||(this.$message.error(`请先配置 ${o} 图床参数`),!1)},uploadImage(e){this.$emit("uploadImage",e.file)}},watch:{activeName:{immediate:!0,handler(e){"formCustom"===e&&this.$nextTick(()=>{const e=this.$refs.formCustomElInput.$el.querySelector("textarea");this.formCustom.editor=this.formCustom.editor||_.a.fromTextArea(e,{mode:"javascript"}),this.formCustom.editor.setValue(this.formCustom.code)})}}},mounted(){}},Ye=Je,Ze=(o("65e4"),Object(r["a"])(Ye,Ve,Qe,!1,null,"5641adf4",null)),Xe=Ze.exports,et=function(){var e=this,t=e._self._c;return t("transition",{attrs:{"enter-active-class":"bounceInRight"}},[t("el-col",{directives:[{name:"show",rawName:"v-show",value:e.showCssEditor,expression:"showCssEditor"}],staticClass:"cssEditor-wrapper",attrs:{span:12}},[t("textarea",{attrs:{id:"cssEditor",type:"textarea",placeholder:"Your custom css here."}})])],1)},tt=[],ot={name:"CssEditor",props:{showCssEditor:{type:Boolean,default:!1}}},it=ot,nt=(o("6bdb"),Object(r["a"])(it,et,tt,!1,null,"912bf7ea",null)),st=nt.exports,rt=function(){var e=this,t=e._self._c;return e.loading?t("transition",{attrs:{name:"fade"}},[t("div",{staticClass:"loading",class:{loading_night:e.nightMode}},[t("strong",[e._v("致力于让 Markdown 编辑更简单")])])]):e._e()},at=[],lt={name:"RunLoading",data(){return{loading:!0}},mounted(){setTimeout(()=>{this.loading=!1},100)},computed:{...Object(d["c"])({nightMode:({nightMode:e})=>e})}},ct=lt,dt=(o("a873"),Object(r["a"])(ct,rt,at,!1,null,"19553015",null)),ut=dt.exports,mt=o("557f");o("e480");var pt={data(){return{showCssEditor:!1,aboutDialogVisible:!1,dialogUploadImgVisible:!1,insertFormDialogVisible:!1,isCoping:!1,isImgLoading:!1,backLight:!1,timeout:null,changeTimer:null,source:"",mouseLeft:0,mouseTop:0,rightClickMenuVisible:!1}},components:{CssEditor:st,RunLoading:ut,EditorHeader:Me,AboutDialog:Re,InsertFormDialog:qe,RightClickMenu:We,UploadImgDialog:Xe},computed:{...Object(d["c"])({wxRenderer:e=>e.wxRenderer,output:e=>e.output,editor:e=>e.editor,cssEditor:e=>e.cssEditor,currentSize:e=>e.currentSize,currentColor:e=>e.currentColor,nightMode:e=>e.nightMode,codeTheme:e=>e.codeTheme})},created(){this.initEditorState(),this.$nextTick(()=>{this.initEditor(),this.initCssEditor(),this.onEditorRefresh(),this.mdLocalToRemote()})},methods:{mdLocalToRemote(){const e=this,t=this.$refs.codeMirrorWrapper.$el;async function o({list:e}){return new Promise((t,o)=>{const{path:i,file:n}=e.find(e=>e.path.match(/\.md$/)),s=new FileReader;s.readAsText(n,"UTF-8"),s.onload=e=>{t({str:e.target.result,file:n,path:i})}})}async function i({md:t,list:o}){const i=[...t.str.matchAll(/!\[(.*?)\]\((.*?)\)/gm)||[]].filter(e=>e),n=t.path.match(/.+?\//)[0],s=await Promise.all(i.map(t=>new Promise((i,s)=>{let[,,r]=t;r=r.replace(/^.\//,"");const{file:a}=o.find(e=>e.path===`${n}${r}`)||{};e.uploadImage(a,e=>{i({matchStr:r,url:e})})})));s.forEach(e=>{t.str=t.str.replace(`](./${e.matchStr})`,`](${e.url})`).replace(`](${e.matchStr})`,`](${e.url})`)}),e.editor.setValue(t.str),console.log("resList",s,t.str)}async function n(e){const t=[];let o="";try{const i=[e];for(const e of i){o+=e.name+"/";for await(const[,n]of e)"file"===n.kind?t.push({path:o+n.name,file:await n.getFile()}):(t.push({path:o+n.name+"/"}),i.push(n))}}catch(i){console.error(i)}return t}t.ondragover=e=>e.preventDefault(),t.ondrop=async e=>{e.preventDefault();for(const t of e.dataTransfer.items)t.getAsFileSystemHandle().then(async e=>{if("directory"===e.kind){const t=await n(e),s=await o({list:t});i({md:s,list:t})}else{const t=await e.getFile();console.log("file",t)}})}},initEditor(){this.initEditorEntity(),this.editor.on("change",(e,t)=>{this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=setTimeout(()=>{this.onEditorRefresh(),j(this.editor,"__editor_content")},300)}),this.editor.on("paste",(e,t)=>{if(t.clipboardData&&t.clipboardData.items&&!this.isImgLoading)for(let o=0,i=t.clipboardData.items.length;o{this.rightClickMenuVisible=!1}),this.editor.on("blur",()=>{
//!影响到右键菜单的点击事件,右键菜单的点击事件在组件内通过mousedown触发
this.rightClickMenuVisible=!1}),this.editor.on("scroll",()=>{this.rightClickMenuVisible=!1})},initCssEditor(){this.initCssEditorEntity(),this.cssEditor.on("keyup",(e,t)=>{(t.keyCode>=65&&t.keyCode<=90||189===t.keyCode)&&e.showHint(t)}),this.cssEditor.on("update",e=>{this.cssChanged(),j(this.cssEditor,"__css_content")})},cssChanged(){let e=K(this.cssEditor.getValue(0)),t=P(this.currentSize.replace("px",""));t=R(e,this.currentColor,t),this.setWxRendererOptions({theme:t}),this.onEditorRefresh()},codeThemeChanged(){let e=this.codeTheme,t=document.getElementById("hljs");if(void 0!=t)t.setAttribute("href",e);else{const t=document.createElement("link");t.setAttribute("type","text/css"),t.setAttribute("rel","stylesheet"),t.setAttribute("href",e),t.setAttribute("id","hljs"),document.head.appendChild(t)}},beforeUpload(e){const t=H(e);if(!t.ok)return this.$message.error(t.msg),!1;let o=localStorage.getItem("imgHost");o=o||"default",localStorage.setItem("imgHost",o);const i=localStorage.getItem(o+"Config"),n="default"==o||i;return!!n||(this.$message.error(`请先配置 ${o} 图床参数`),!1)},uploadImage(e,t){this.isImgLoading=!0,z(e).then(o=>{mt["a"].fileUpload(o,e).then(e=>{console.log(e),t?t(e):this.uploaded(e)}).catch(e=>{this.$message.error(e.message)})}).catch(e=>{this.$message.error(e.message)}),this.isImgLoading=!1},uploaded(e){if(console.log("图片上传之后: ",e),!e)return void this.$message.error("上传图片未知异常");this.dialogUploadImgVisible=!1;const t=this.editor.getCursor(),o=e,i=`![](${o})`;this.editor.replaceSelection(`\n${i}\n`,t),this.$message.success("图片上传成功"),this.onEditorRefresh()},leftAndRightScroll(){const e=e=>{let i,n;clearTimeout(this.timeout),"preview"===e?(i=this.$refs.preview.$el,n=document.getElementsByClassName("CodeMirror-scroll")[0],this.editor.off("scroll",t),this.timeout=setTimeout(()=>{this.editor.on("scroll",t)},300)):"editor"===e&&(i=document.getElementsByClassName("CodeMirror-scroll")[0],n=this.$refs.preview.$el,n.removeEventListener("scroll",o,!1),this.timeout=setTimeout(()=>{n.addEventListener("scroll",o,!1)},300));let s=i.scrollTop/(i.scrollHeight-i.offsetHeight),r=s*(n.scrollHeight-n.offsetHeight);n.scrollTo(0,r)},t=()=>{e("editor")},o=()=>{e("preview")};this.$refs.preview.$el.addEventListener("scroll",o,!1),this.editor.on("scroll",t)},onEditorRefresh(){this.codeThemeChanged(this.codeTheme),this.editorRefresh(),setTimeout(()=>window.PR.prettyPrint(),0)},endCopy(){this.backLight=!1,setTimeout(()=>{this.isCoping=!1},800)},addFormat(e,t=e){const{head:o,anchor:i}=this.editor.doc.sel.ranges[0];let n,s;o.line===i.line?o.ch{q(),document.getElementById("output").innerHTML=this.output})},importMarkdownContent(){let e=document.getElementById("menu"),t=document.createElement("input");t.type="file",t.name="filename",t.accept=".txt,.md",e.appendChild(t),t.onchange=()=>{if(!t.files)return;const e=t.files[0];if(!/\.(txt|TXT|MD|md)$/.test(e.name))return void this.$message.error("不支持的文档格式");const o=new FileReader;o.readAsText(e),o.onload=e=>{let t=e.target.result;t=B(t),t&&(localStorage.setItem("__editor_content",t),this.editor.setValue(t),this.$message.success("文档导入成功"))}},t.click(),e.removeChild(t)},formatContent(){const e=B(this.editor.getValue(0));localStorage.setItem("__editor_content",e),this.editor.setValue(e)},openMenu(e){const t=105,o=this.$el.getBoundingClientRect().left,i=this.$el.offsetWidth,n=i-t,s=e.clientX-o;this.mouseLeft=Math.min(n,s),this.mouseTop=e.clientY+10,this.rightClickMenuVisible=!0},onMenuEvent(e){switch(e){case"resetStyle":this.$refs.header.showResetConfirm=!0;break;case"insertPic":this.dialogUploadImgVisible=!0;break;case"download":this.downloadEditorContent();break;case"export":this.exportEditorContent();break;case"insertTable":this.insertFormDialogVisible=!0;break;case"importMarkdown":this.importMarkdownContent();break;case"formatMarkdown":this.formatContent();break;default:break}},...Object(d["b"])(["initEditorState","initEditorEntity","setWxRendererOptions","editorRefresh","initCssEditorEntity"])},mounted(){setTimeout(()=>{this.leftAndRightScroll(),window.PR.prettyPrint()},300)}},ft=pt,ht=(o("3ddd"),o("daeb"),o("9c0d"),Object(r["a"])(ft,ee,te,!1,null,"b4e935ba",null)),gt=ht.exports,bt={name:"App",components:{CodemirrorEditor:gt}},_t=bt,Ct=Object(r["a"])(_t,Z,X,!1,null,"821a8f8c",null),yt=Ct.exports;i["default"].use(Y["a"]);const St=[{path:"/",name:"index",component:yt}],kt=new Y["a"]({mode:"history",base:"/md/",routes:St});var Ot=kt;i["default"].use(J.a),i["default"].config.productionTip=!1,c.mpType="app";const wt=new i["default"]({router:Ot,store:V,...c});wt.$mount("#app")},"37a4":function(e,t,o){},"3ddd":function(e,t,o){"use strict";o("b888")},4:function(e,t){},"4f8e":function(e,t,o){"use strict";o.d(t,"b",(function(){return i})),o.d(t,"a",(function(){return n}));const i={username:"filess",repoList:Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],e=>"img"+e),branch:"main",accessTokenList:["7715d7ca67b5d3837cfdoocsmde8c38421815aa423510af","c411415bf95dbe39625doocsmd5047ba9b7a2a6c9642abe","2821cd8819fa345c053doocsmdca86ac653f8bc20db1f1b","445f0dae46ef1f2a4d6doocsmdc797301e94797b4750a4c","cc1d0c1426d0fd0902bdoocsmdd2d7184b14da61b86ec46","b67e9d15cb6f910492fdoocsmdac6b44d379c953bb19eff","618c4dc2244ccbbc088doocsmd125d17fd31b7d06a50cf3","a4b581732e1c1507458doocsmdc5b223b27dae5e2e16a55","77904db41aee57ad79bdoocsmd760f848201dac9c96fd5e","02f251cb14ac62ab100doocsmdddbfc8527d773f1f04ce1","eb321079a95ba7028d9doocsmde2e84c502dac70de7cf08","22f74fcfb071a961fa2doocsmde28dabc746f0503a15e5d","85124c2bfe7abba0938doocsmd0af7f67918b99d085a5fd","0a561b4d4bbecb2de7edoocsmdd9ba3833d11dbc5e430f5","e8a01491188d8d5a097doocsmd03ede0aad1fe9e3af24e9","36e1f420d7e5bdebd67doocsmd65463562f5f25b20b8377"]},n={username:"filesss",repoList:Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],e=>"img"+e),branch:"main",accessTokenList:["ed5fc9866bd6c2fdoocsmddd433f806fd2f399c","5448ffebbbf1151doocsmdc4e337cf814fc8a62","25b05efd2557ca2doocsmd75b5c0835e3395911","11628c7a5aef015doocsmd2eeff9fb9566f0458","cb2f5145ed938dedoocsmdbd063b4ed244eecf8","d8c0b57500672c1doocsmd55f48b866b5ebcd98","78c56eadb88e453doocsmd43ddd95753351771a","03e1a688003948fdoocsmda16fcf41e6f03f1f0","c49121cf4d191fbdoocsmdd6a7877ed537e474a","adfeb2fadcdc4aadoocsmdfe1ee869ac9c968ff","116c94549ca4a0ddoocsmd192653af5c0694616","ecf30ed7f2eb184doocsmd51ea4ec8300371d9e","5837cf2bd5afd93doocsmd73904bed31934949e","b5b7e1c7d57e01fdoocsmd5266f552574297d78","684d55564ffbd0bdoocsmd7d747e5cc23aed6d6","3fc04a9d272ab71doocsmd010c56cb57d88d2ba"]}},5:function(e,t){},"557f":function(module,__webpack_exports__,__webpack_require__){"use strict";var _fetch__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("1cd3"),_config__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("4f8e"),crypto_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("02fe"),crypto_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(crypto_js__WEBPACK_IMPORTED_MODULE_2__),ali_oss__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("fd9d"),ali_oss__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(ali_oss__WEBPACK_IMPORTED_MODULE_3__),minio__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("8890"),minio__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(minio__WEBPACK_IMPORTED_MODULE_4__),cos_js_sdk_v5__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("bd88"),cos_js_sdk_v5__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(cos_js_sdk_v5__WEBPACK_IMPORTED_MODULE_5__),buffer_from__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("8113"),buffer_from__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(buffer_from__WEBPACK_IMPORTED_MODULE_6__),uuid__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("78ac"),qiniu_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("b114"),_assets_scripts_tokenTools__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("8f11");function getConfig(e,t){if(e){const e="github"===t?_config__WEBPACK_IMPORTED_MODULE_1__["b"]:_config__WEBPACK_IMPORTED_MODULE_1__["a"],{username:o,repoList:i,branch:n,accessTokenList:s}=e,r=Math.floor(Math.random()*s.length),a=s[r].replace("doocsmd",""),l=Math.floor(Math.random()*i.length),c=i[l];return{username:o,repo:c,branch:n,accessToken:a}}const o=JSON.parse(localStorage.getItem(t+"Config")),i=o.repo.replace(`https://${t}.com/`,"").replace(`http://${t}.com/`,"").replace(t+".com/","").split("/");return{username:i[0],repo:i[1],branch:o.branch||"master",accessToken:o.accessToken}}function getDir(){const e=new Date,t=e.getFullYear(),o=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0");return`${t}/${o}/${i}`}function getDateFilename(e){const t=(new Date).getTime(),o=e.split(".")[1];return`${t}-${Object(uuid__WEBPACK_IMPORTED_MODULE_7__["a"])()}.${o}`}async function ghFileUpload(e,t){var o;const i="default"===localStorage.getItem("imgHost"),{username:n,repo:s,branch:r,accessToken:a}=getConfig(i,"github"),l=getDir(),c=`https://api.github.com/repos/${n}/${s}/contents/${l}/`,d=getDateFilename(t),u=await Object(_fetch__WEBPACK_IMPORTED_MODULE_0__["a"])({url:c+d,method:"put",headers:{Authorization:"token "+a},data:{content:e,branch:r,message:"Upload by "+window.location.href}}),m=`raw.githubusercontent.com/${n}/${s}/${r}/`,p=`fastly.jsdelivr.net/gh/${n}/${s}@${r}/`;return u.content=(null===(o=u.data)||void 0===o?void 0:o.content)||u.content,i?u.content.download_url.replace(m,p):u.content.download_url}async function giteeUpload(e,t){var o;const i="default"===localStorage.getItem("imgHost"),{username:n,repo:s,branch:r,accessToken:a}=getConfig(i,"gitee"),l=getDir(),c=getDateFilename(t),d=`https://gitee.com/api/v5/repos/${n}/${s}/contents/${l}/${c}`,u=await Object(_fetch__WEBPACK_IMPORTED_MODULE_0__["a"])({url:d,method:"POST",data:{content:e,branch:r,access_token:a,message:"Upload by "+window.location.href}});return u.content=(null===(o=u.data)||void 0===o?void 0:o.content)||u.content,encodeURI(u.content.download_url)}function getQiniuToken(e,t,o){const i=JSON.stringify(o),n=Object(_assets_scripts_tokenTools__WEBPACK_IMPORTED_MODULE_9__["base64encode"])(Object(_assets_scripts_tokenTools__WEBPACK_IMPORTED_MODULE_9__["utf16to8"])(i)),s=crypto_js__WEBPACK_IMPORTED_MODULE_2___default.a.HmacSHA1(n,t),r=s.toString(crypto_js__WEBPACK_IMPORTED_MODULE_2___default.a.enc.Base64);return`${e}:${Object(_assets_scripts_tokenTools__WEBPACK_IMPORTED_MODULE_9__["safe64"])(r)}:${n}`}async function qiniuUpload(e){const{accessKey:t,secretKey:o,bucket:i,region:n,path:s,domain:r}=JSON.parse(localStorage.getItem("qiniuConfig")),a=getQiniuToken(t,o,{scope:i,deadline:Math.trunc((new Date).getTime()/1e3)+3600}),l=s?s+"/":"",c=l+getDateFilename(e.name),d=qiniu_js__WEBPACK_IMPORTED_MODULE_8__["upload"](e,c,a,{},{region:n});return new Promise((e,t)=>{d.subscribe({next:e=>{console.log(e)},error:e=>{t(e.message)},complete:t=>{e(`${r}/${t.key}`)}})})}async function aliOSSFileUpload(e,t){const o=getDateFilename(t),{region:i,bucket:n,accessKeyId:s,accessKeySecret:r,cdnHost:a,path:l}=JSON.parse(localStorage.getItem("aliOSSConfig")),c=buffer_from__WEBPACK_IMPORTED_MODULE_6___default()(e,"base64"),d=`${l}/${o}`,u=new ali_oss__WEBPACK_IMPORTED_MODULE_3___default.a({region:i,bucket:n,accessKeyId:s,accessKeySecret:r});try{const e=await u.put(d,c);return""===a?e.url:`${a}/${""===l?o:d}`}catch(m){return Promise.reject(m)}}async function txCOSFileUpload(e){const t=getDateFilename(e.name),{secretId:o,secretKey:i,bucket:n,region:s,path:r,cdnHost:a}=JSON.parse(localStorage.getItem("txCOSConfig")),l=new cos_js_sdk_v5__WEBPACK_IMPORTED_MODULE_5___default.a({SecretId:o,SecretKey:i});return new Promise((o,i)=>{l.putObject({Bucket:n,Region:s,Key:`${r}/${t}`,Body:e},(function(e,n){e?i(e):o(a?""==r?`${a}/${t}`:`${a}/${r}/${t}`:"https://"+n.Location)}))})}async function minioFileUpload(e,t){const o=getDateFilename(t),{endpoint:i,port:n,useSSL:s,bucket:r,accessKey:a,secretKey:l}=JSON.parse(localStorage.getItem("minioConfig")),c=buffer_from__WEBPACK_IMPORTED_MODULE_6___default()(e,"base64"),d={endPoint:i,useSSL:s,accessKey:a,secretKey:l},u=Number(n||0),m=u>0&&80!==u&&443!==u;return m&&(d.port=u),new Promise((e,t)=>{const a=new minio__WEBPACK_IMPORTED_MODULE_4__["Client"](d);try{a.putObject(r,o,c,(function(a){a&&t(a);const l=`${s?"https://":"http://"}${i}${m?":"+n:""}`,c=`${l}/${r}/${o}`;e(c)}))}catch(l){t(l)}})}async function formCustomUpload(content,file){const str=`\n async (CUSTOM_ARG) => {\n ${localStorage.getItem("formCustomConfig")}\n }\n `;return new Promise((resolve,reject)=>{const exportObj={content:content,file:file,util:{axios:_fetch__WEBPACK_IMPORTED_MODULE_0__["a"],CryptoJS:crypto_js__WEBPACK_IMPORTED_MODULE_2___default(),OSS:ali_oss__WEBPACK_IMPORTED_MODULE_3___default(),COS:cos_js_sdk_v5__WEBPACK_IMPORTED_MODULE_5___default(),Buffer:buffer_from__WEBPACK_IMPORTED_MODULE_6___default(),uuidv4:uuid__WEBPACK_IMPORTED_MODULE_7__["a"],qiniu:qiniu_js__WEBPACK_IMPORTED_MODULE_8__,tokenTools:_assets_scripts_tokenTools__WEBPACK_IMPORTED_MODULE_9__,getDir:getDir,getDateFilename:getDateFilename},okCb:resolve,errCb:reject};eval(str)(exportObj).catch(e=>{console.error(e),reject(e)})})}function fileUpload(e,t){const o=localStorage.getItem("imgHost");switch(!o&&localStorage.setItem("imgHost","default"),o){case"aliOSS":return aliOSSFileUpload(e,t.name);case"minio":return minioFileUpload(e,t.name);case"txCOS":return txCOSFileUpload(t);case"qiniu":return qiniuUpload(t);case"gitee":return giteeUpload(e,t.name);case"github":return ghFileUpload(e,t.name);case"formCustom":return formCustomUpload(e,t);default:return ghFileUpload(e,t.name)}}__webpack_exports__["a"]={fileUpload:fileUpload}},"5ae1":function(e,t,o){"use strict";o("890c")},6:function(e,t){},"65e4":function(e,t,o){"use strict";o("f691")},"6bdb":function(e,t,o){"use strict";o("c2d6")},7:function(e,t){},"7c21":function(e,t,o){"use strict";o("adf2")},"7f25":function(e,t,o){"use strict";o("8af6")},8:function(e,t){},"890c":function(e,t,o){},"898f":function(e,t,o){},"8af6":function(e,t,o){},"8f11":function(e,t,o){"use strict";function i(e){var t,o,i,n;for(t="",i=e.length,o=0;o=1&&n<=127?t+=e.charAt(o):n>2047?(t+=String.fromCharCode(224|n>>12&15),t+=String.fromCharCode(128|n>>6&63),t+=String.fromCharCode(128|n>>0&63)):(t+=String.fromCharCode(192|n>>6&31),t+=String.fromCharCode(128|n>>0&63));return t}function n(e){var t,o,i,n,s,r;t="",i=e.length,o=0;while(o>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=e.charAt(o-1);break;case 12:case 13:s=e.charCodeAt(o++),t+=String.fromCharCode((31&n)<<6|63&s);break;case 14:s=e.charCodeAt(o++),r=e.charCodeAt(o++),t+=String.fromCharCode((15&n)<<12|(63&s)<<6|(63&r)<<0);break}return t}o.r(t),o.d(t,"utf16to8",(function(){return i})),o.d(t,"utf8to16",(function(){return n})),o.d(t,"base64encode",(function(){return a})),o.d(t,"base64decode",(function(){return l})),o.d(t,"safe64",(function(){return c}));const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",r=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1);function a(e){var t,o,i,n,r,a;i=e.length,o=0,t="";while(o>2),t+=s.charAt((3&n)<<4),t+="==";break}if(r=e.charCodeAt(o++),o==i){t+=s.charAt(n>>2),t+=s.charAt((3&n)<<4|(240&r)>>4),t+=s.charAt((15&r)<<2),t+="=";break}a=e.charCodeAt(o++),t+=s.charAt(n>>2),t+=s.charAt((3&n)<<4|(240&r)>>4),t+=s.charAt((15&r)<<2|(192&a)>>6),t+=s.charAt(63&a)}return t}function l(e){var t,o,i,n,s,a,l;a=e.length,s=0,l="";while(s>4);do{if(i=255&e.charCodeAt(s++),61==i)return l;i=r[i]}while(s>2);do{if(n=255&e.charCodeAt(s++),61==n)return l;n=r[n]}while(s