Comparing version 0.1.7 to 0.1.8
/*! | ||
* Vditor v0.1.7 - A markdown editor written in TypeScript. | ||
* Vditor v0.1.8 - A markdown editor written in TypeScript. | ||
* | ||
@@ -27,2 +27,2 @@ * MIT License | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Vditor=e():t.Vditor=e()}(window,function(){return function(t){function e(e){for(var n,i,r=e[0],s=e[1],l=0,c=[];l<r.length;l++)i=r[l],o[i]&&c.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n]);for(a&&a(e);c.length;)c.shift()()}var n={},o={1:0};function i(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.e=function(t){var e=[],n=o[t];if(0!==n)if(n)e.push(n[2]);else{var r=new Promise(function(e,i){n=o[t]=[e,i]});e.push(n[2]=r);var s,l=document.createElement("script");l.charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.src=function(t){return i.p+""+({0:"vendors~vditor",2:"vditor"}[t]||t)+".bundle.js"}(t),s=function(e){l.onerror=l.onload=null,clearTimeout(a);var n=o[t];if(0!==n){if(n){var i=e&&("load"===e.type?"missing":e.type),r=e&&e.target&&e.target.src,s=new Error("Loading chunk "+t+" failed.\n("+i+": "+r+")");s.type=i,s.request=r,n[1](s)}o[t]=void 0}};var a=setTimeout(function(){s({type:"timeout",target:l})},12e4);l.onerror=l.onload=s,document.head.appendChild(l)}return Promise.all(e)},i.m=t,i.c=n,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="https://vditor.b3log.org/0.1.7/",i.oe=function(t){throw console.error(t),t};var r=window.webpackJsonpVditor=window.webpackJsonpVditor||[],s=r.push.bind(r);r.push=e,r=r.slice();for(var l=0;l<r.length;l++)e(r[l]);var a=s;return i(i.s=24)}([function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M32 0v13l-5-5-6 6-3-3 6-6-5-5zM14 21l-6 6 5 5h-13v-13l5 5 6-6z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M16 24.789c-3.756 0-6.911-2.254-8.188-5.559h16.376c-1.277 3.305-4.432 5.559-8.188 5.559zM10.366 14.423c-1.352 0-2.404-1.052-2.404-2.404s1.052-2.404 2.404-2.404 2.404 1.052 2.404 2.404-1.052 2.404-2.404 2.404zM21.634 14.423c-1.352 0-2.404-1.052-2.404-2.404s1.052-2.404 2.404-2.404 2.404 1.052 2.404 2.404-1.052 2.404-2.404 2.404zM16 28.845c7.061 0 12.845-5.784 12.845-12.845s-5.784-12.845-12.845-12.845-12.845 5.784-12.845 12.845 5.784 12.845 12.845 12.845zM16 0c8.864 0 16 7.136 16 16s-7.136 16-16 16-16-7.136-16-16 7.136-16 16-16z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M22.996 15.023c1.339-1.591 2.147-3.643 2.147-5.88 0-5.041-4.102-9.143-9.143-9.143h-11.429v32h13.714c5.041 0 9.143-4.102 9.143-9.143 0-3.32-1.779-6.232-4.433-7.834zM11.429 4.571h3.625c1.999 0 3.625 2.051 3.625 4.571s-1.626 4.571-3.625 4.571h-3.625v-9.143zM17.107 27.429h-5.679v-9.143h5.679c2.087 0 3.786 2.051 3.786 4.571s-1.698 4.571-3.786 4.571z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M4.45 0h3.594c0.595 0 1.078 0.384 1.078 0.858v30.284c0 0.474-0.482 0.858-1.078 0.858h-3.594c-0.595 0-1.078-0.384-1.078-0.858v-30.284c-0-0.474 0.482-0.858 1.078-0.858zM23.888 0h3.673c0.59 0 1.068 0.384 1.068 0.858v30.284c0 0.474-0.478 0.858-1.068 0.858h-3.673c-0.59 0-1.068-0.384-1.068-0.858v-30.284c0-0.474 0.478-0.858 1.068-0.858z"></path> <path d="M25.069 14.167v3.667c0 0.589-0.384 1.065-0.858 1.065h-15.655c-0.474 0-0.858-0.477-0.858-1.065v-3.667c0-0.589 0.384-1.065 0.858-1.065h15.655c0.474 0 0.858 0.477 0.858 1.065z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M29.714 0v2.286h-4.571l-11.429 27.429h4.571v2.286h-16v-2.286h4.571l11.429-27.429h-4.571v-2.286z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M32 16v2h-7.328c0.86 1.203 1.328 2.584 1.328 4 0 2.215-1.146 4.345-3.143 5.843-1.855 1.391-4.29 2.157-6.857 2.157s-5.002-0.766-6.857-2.157c-1.998-1.498-3.143-3.628-3.143-5.843h4c0 2.168 2.748 4 6 4s6-1.832 6-4c0-2.168-2.748-4-6-4h-16v-2h9.36c-0.073-0.052-0.146-0.104-0.217-0.157-1.998-1.498-3.143-3.628-3.143-5.843s1.146-4.345 3.143-5.843c1.855-1.391 4.29-2.157 6.857-2.157s5.002 0.766 6.857 2.157c1.997 1.498 3.143 3.628 3.143 5.843h-4c0-2.168-2.748-4-6-4s-6 1.832-6 4c0 2.168 2.748 4 6 4 2.468 0 4.814 0.709 6.64 2h9.36z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M31.68 14.56h-31.36c-0.176 0-0.32 0.144-0.32 0.32v2.24c0 0.176 0.144 0.32 0.32 0.32h31.36c0.176 0 0.32-0.144 0.32-0.32v-2.24c0-0.176-0.144-0.32-0.32-0.32z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M7.024 13.003c3.862 0 6.993 3.131 6.993 6.993s-3.131 6.993-6.993 6.993-6.993-3.131-6.993-6.993l-0.031-0.999c0-7.724 6.262-13.986 13.986-13.986v3.996c-2.668 0-5.177 1.039-7.064 2.926-0.363 0.363-0.695 0.75-0.994 1.156 0.357-0.056 0.723-0.086 1.096-0.086zM25.007 13.003c3.862 0 6.993 3.131 6.993 6.993s-3.131 6.993-6.993 6.993-6.993-3.131-6.993-6.993l-0.031-0.999c0-7.724 6.262-13.986 13.986-13.986v3.996c-2.668 0-5.177 1.039-7.064 2.926-0.363 0.363-0.695 0.75-0.994 1.156 0.357-0.056 0.723-0.086 1.096-0.086z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M12 2h20v4h-20v-4zM12 14h20v4h-20v-4zM12 26h20v4h-20v-4zM0 4c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4zM0 16c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4zM0 28c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M11 26h20v4h-20zM11 14h20v4h-20zM11 2h20v4h-20zM5 0v8h-2v-6h-2v-2zM3 16.438v1.563h4v2h-6v-4.563l4-1.875v-1.563h-4v-2h6v4.563zM7 22v10h-6v-2h4v-2h-4v-2h4v-2h-4v-2z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M27.094 19.485v6.12c0 3.059-2.483 5.542-5.542 5.542h-16.010c-3.059 0-5.542-2.483-5.542-5.542v-16.010c0-3.059 2.483-5.542 5.542-5.542h16.010c0.769 0 1.54 0.154 2.251 0.481 0.174 0.077 0.308 0.25 0.346 0.443 0.039 0.211-0.019 0.404-0.174 0.558l-0.943 0.943c-0.115 0.115-0.289 0.193-0.443 0.193-0.058 0-0.115-0.019-0.174-0.039-0.289-0.077-0.578-0.115-0.866-0.115h-16.010c-1.693 0-3.079 1.386-3.079 3.079v16.010c0 1.693 1.386 3.079 3.079 3.079h16.010c1.693 0 3.079-1.386 3.079-3.079v-4.888c0-0.154 0.058-0.308 0.174-0.424l1.232-1.232c0.135-0.135 0.289-0.193 0.443-0.193 0.077 0 0.154 0.019 0.231 0.058 0.231 0.096 0.385 0.308 0.385 0.558zM31.54 10.076l-15.664 15.664c-0.615 0.615-1.578 0.615-2.194 0l-8.275-8.275c-0.615-0.615-0.615-1.578 0-2.194l2.116-2.116c0.615-0.615 1.578-0.615 2.194 0l5.060 5.060 12.451-12.451c0.615-0.615 1.578-0.615 2.194 0l2.116 2.116c0.615 0.615 0.615 1.578 0 2.194z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M12.417 9.75q8.667 1.25 13.375 6.625t6.208 12.958q-6.417-9.083-19.583-9.083v7.25l-12.417-12.417 12.417-12.417v7.083z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M19.583 9.75q-8.667 1.25-13.375 6.625t-6.208 12.958q6.417-9.083 19.583-9.083v7.25l12.417-12.417-12.417-12.417v7.083z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M18.133 23.467l3.2 3.2 10.667-10.667-10.667-10.667-3.2 3.2 7.467 7.467z"></path> <path d="M13.867 8.533l-3.2-3.2-10.667 10.667 10.667 10.667 3.2-3.2-7.467-7.467z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M21.053 21.895l2.526 2.526 8.421-8.421-8.421-8.421-2.526 2.526 5.895 5.895z"></path> <path d="M10.947 10.105l-2.526-2.526-8.421 8.421 8.421 8.421 2.526-2.526-5.895-5.895z"></path> <path d="M17.613 6.487l1.828 0.499-5.052 18.527-1.828-0.499 5.052-18.527z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M29.187 2.933l-0.12-0.121c-2.813-2.812-7.415-2.812-10.228 0l-6.516 6.517c-2.812 2.812-2.812 7.415 0 10.227l0.12 0.12c0.234 0.234 0.482 0.446 0.739 0.641l2.386-2.386c-0.278-0.164-0.542-0.361-0.78-0.599l-0.121-0.121c-1.527-1.527-1.527-4.012 0-5.539l6.517-6.516c1.527-1.527 4.012-1.527 5.539 0l0.121 0.12c1.527 1.527 1.527 4.012 0 5.539l-2.948 2.948c0.512 1.264 0.754 2.611 0.733 3.955l4.559-4.559c2.812-2.812 2.812-7.415-0-10.227zM19.557 12.323c-0.234-0.234-0.482-0.446-0.739-0.641l-2.386 2.385c0.278 0.164 0.542 0.361 0.78 0.599l0.121 0.121c1.527 1.527 1.527 4.012 0 5.539l-6.517 6.517c-1.527 1.527-4.012 1.527-5.539 0l-0.121-0.121c-1.527-1.527-1.527-4.012 0-5.539l2.948-2.948c-0.512-1.264-0.754-2.611-0.733-3.955l-4.559 4.559c-2.812 2.812-2.812 7.415 0 10.228l0.12 0.12c2.813 2.812 7.415 2.812 10.228 0l6.516-6.517c2.812-2.812 2.812-7.415 0-10.228l-0.12-0.12z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M19.652 25v6c0 0.55-0.45 1-1 1h-6c-0.55 0-1-0.45-1-1v-6c0-0.55 0.45-1 1-1h6c0.55 0 1 0.45 1 1zM27.552 10c0 4.75-3.225 6.575-5.6 7.9-1.475 0.85-2.4 2.575-2.4 3.3v0c0 0.55-0.425 1.2-1 1.2h-6c-0.55 0-0.9-0.85-0.9-1.4v-1.125c0-3.025 3-5.625 5.2-6.625 1.925-0.875 2.725-1.7 2.725-3.3 0-1.4-1.825-2.65-3.85-2.65-1.125 0-2.15 0.35-2.7 0.725-0.6 0.425-1.2 1.025-2.675 2.875-0.2 0.25-0.5 0.4-0.775 0.4-0.225 0-0.425-0.075-0.625-0.2l-4.1-3.125c-0.425-0.325-0.525-0.875-0.25-1.325 2.7-4.475 6.5-6.65 11.6-6.65 5.35 0 11.35 4.275 11.35 10z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M9.846 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM9.846 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM9.846 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM32 5.538v20.923c0 1.692-1.385 3.077-3.077 3.077h-25.846c-1.692 0-3.077-1.385-3.077-3.077v-20.923c0-1.692 1.385-3.077 3.077-3.077h25.846c1.692 0 3.077 1.385 3.077 3.077z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M0 16c3.037-5.864 9.058-9.802 16-9.802s12.963 3.938 15.953 9.703l0.047 0.1c-3.037 5.864-9.058 9.802-16 9.802s-12.963-3.938-15.953-9.703l-0.047-0.1zM16 22.531c3.607 0 6.531-2.924 6.531-6.531s-2.924-6.531-6.531-6.531v0c-3.607 0-6.531 2.924-6.531 6.531s2.924 6.531 6.531 6.531v0zM16 19.265c-1.804 0-3.265-1.461-3.265-3.265s1.461-3.265 3.265-3.265v0c1.804 0 3.265 1.461 3.265 3.265s-1.461 3.265-3.265 3.265v0z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M14 18v13l-5-5-6 6-3-3 6-6-5-5zM32 3l-6 6 5 5h-13v-13l5 5 6-6z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M21.334 16.532q0-0.233-0.15-0.384l-5.867-5.867q-0.15-0.15-0.384-0.15t-0.384 0.15l-5.85 5.85q-0.167 0.2-0.167 0.399 0 0.233 0.15 0.384t0.384 0.15h3.733v5.867q0 0.217 0.159 0.375t0.375 0.159h3.2q0.217 0 0.375-0.159t0.159-0.375v-5.867h3.734q0.217 0 0.375-0.159t0.159-0.375zM32 21.332q0 2.65-1.875 4.525t-4.525 1.875h-18.133q-3.083 0-5.275-2.192t-2.192-5.275q0-2.166 1.167-4t3.134-2.75q-0.034-0.5-0.034-0.717 0-3.533 2.5-6.033t6.033-2.5q2.6 0 4.759 1.45t3.142 3.849q1.184-1.033 2.767-1.033 1.767 0 3.017 1.25t1.25 3.017q0 1.267-0.683 2.3 2.166 0.516 3.558 2.258t1.392 3.975z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M4.571 16c0 6.312 5.117 11.429 11.429 11.429s11.429-5.117 11.429-11.429v0c0-6.312-5.117-11.429-11.429-11.429s-11.429 5.117-11.429 11.429v0z"></path> <path d="M16 30.857c-8.229 0-14.933-6.705-14.933-14.933s6.705-14.933 14.933-14.933 15.010 6.705 15.010 15.010c0 8.152-6.705 14.857-15.010 14.857zM16 0c-8.838 0-16 7.162-16 16s7.162 16 16 16 16-7.162 16-16-7.162-16-16-16z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M23.273 27.636v2.909c0 0.795-0.659 1.455-1.455 1.455h-11.636c-0.795 0-1.455-0.659-1.455-1.455v-2.909c0-0.795 0.659-1.455 1.455-1.455h1.455v-8.727h-1.455c-0.795 0-1.455-0.659-1.455-1.455v-2.909c0-0.795 0.659-1.455 1.455-1.455h8.727c0.795 0 1.455 0.659 1.455 1.455v13.091h1.455c0.795 0 1.455 0.659 1.455 1.455zM20.364 1.455v4.364c0 0.795-0.659 1.455-1.455 1.455h-5.818c-0.795 0-1.455-0.659-1.455-1.455v-4.364c0-0.795 0.659-1.455 1.455-1.455h5.818c0.795 0 1.455 0.659 1.455 1.455z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=128 height=32 viewBox="0 0 128 32"> <path d="M0 0h128v6.4h-128zM0 12.8h128v6.4h-128zM0 25.6h128v6.4h-128z"></path> </svg>'},function(t,e,n){"use strict";n.r(e);var o="0.1.7",i=n(1),r=n.n(i),s={en_US:{emoji:"Emoji",bold:"Blod",headings:"Headings",italic:"Italic",quote:"Quote",link:"Link","ordered-list":"Order List",list:"List",fullscreen:"Fullscreen",help:"Help",strike:"Strike",line:"Line",check:"Task List",code:"Code Block","inline-code":"Inline Code",redo:"Redo",undo:"Undo",table:"Table",record:"Start Record/End Record",upload:"Upload image or file",preview:"Preview",uploading:"uploading...",over:"over",uploadError:"upload error",recoding:"recoding...",info:"Info"},zh_CN:{emoji:"表情",bold:"粗体",headings:"标题",italic:"斜体",quote:"引用",link:"链接","ordered-list":"有序列表",list:"无序列表",fullscreen:"全屏",help:"帮助",strike:"删除线",line:"分隔线",check:"任务列表",code:"代码块","inline-code":"行内代码",redo:"重做",undo:"撤销",table:"表格",record:"开始录音/结束录音",upload:"上传图片或文件",preview:"预览",uploading:"上传中...",over:"超过",uploadError:"上传错误",recoding:"录音中...",info:"关于"}},l=/highlight-(?:text|source)-([a-z0-9]+)/;function a(t){t.addRule("highlightedCodeBlock",{filter:function(t){var e=t.firstChild;return"DIV"===t.nodeName&&l.test(t.className)&&e&&"PRE"===e.nodeName},replacement:function(t,e,n){var o=((e.className||"").match(l)||[null,""])[1];return"\n\n"+n.fence+o+"\n"+e.firstChild.textContent+"\n"+n.fence+"\n\n"}})}function c(t){t.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(t){return"~"+t+"~"}})}var p=Array.prototype.indexOf,u=Array.prototype.every,d={};function h(t){var e,n,o=t.parentNode;return"THEAD"===o.nodeName||o.firstChild===t&&("TABLE"===o.nodeName||(n=(e=o).previousSibling,"TBODY"===e.nodeName&&(!n||"THEAD"===n.nodeName&&/^\s*$/i.test(n.textContent))))&&u.call(t.childNodes,function(t){return"TH"===t.nodeName})}function v(t,e){var n=" ";return 0===p.call(e.parentNode.childNodes,e)&&(n="| "),n+t+" |"}function f(t){for(var e in t.keep(function(t){return"TABLE"===t.nodeName&&!h(t.rows[0])}),d)t.addRule(e,d[e])}function m(t){t.addRule("taskListItems",{filter:function(t){return"checkbox"===t.type&&"LI"===t.parentNode.nodeName},replacement:function(t,e){return(e.checked?"[x]":"[ ]")+" "}})}function g(t){t.use([a,c,f,m])}d.tableCell={filter:["th","td"],replacement:function(t,e){return v(t,e)}},d.tableRow={filter:"tr",replacement:function(t,e){var n="",o={left:":--",right:"--:",center:":-:"};if(h(e))for(var i=0;i<e.childNodes.length;i++){var r="---",s=(e.childNodes[i].getAttribute("align")||"").toLowerCase();s&&(r=o[s]||r),n+=v(r,e.childNodes[i])}return"\n"+t+(n?"\n"+n:"")}},d.table={filter:function(t){return"TABLE"===t.nodeName&&h(t.rows[0])},replacement:function(t){return"\n\n"+(t=t.replace("\n\n","\n"))+"\n\n"}},d.tableSection={filter:["thead","tbody","tfoot"],replacement:function(t){return t}};var y,w=function(){return function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload",this.element.innerHTML='<div class="vditor-upload__progress"></div><div class="vditor-upload__close">x</div>',this.element.children[1].addEventListener("click",function(){this.parentElement.style.opacity=0,this.parentElement.className="vditor-upload"})}}(),b=function(t,e,n){for(var o=new FormData,i=[],r=0;r<e.length;r++){var l=e[r].getAsFile?e[r].getAsFile():e[r];l.size<=t.options.upload.max&&(o.append("file[]",l),i.push(l))}if(_(t.editor.element,function(t,e){for(var n="",o=e.length,i=0;i<o;i++){var r=e[i].getAsFile?e[i].getAsFile():e[i],l=-1===r.type.indexOf("image")?"":"!";if(!r.name)return"";r.size>t.options.upload.max?n+=l+"["+r.name.replace(/\W/g,"")+"]("+s[t.options.lang].over+" "+t.options.upload.max/1024/1024+"M)\n":n+=l+"["+r.name.replace(/\W/g,"")+"]("+s[t.options.lang].uploading+")\n"}return n}(t,e),""),0!==i.length)if(t.options.upload.url&&t.upload){var a=new XMLHttpRequest;a.open("POST",t.options.upload.url),t.options.upload.token&&a.setRequestHeader("X-Upload-Token",t.options.upload.token),t.upload.isUploading=!0,t.editor.element.setAttribute("disabled","disabled"),a.onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&&(t.upload.isUploading=!1,n&&(n.value=""),t.editor.element.removeAttribute("disabled"),200===a.status?(t.options.upload.success?t.options.upload.success(t.editor.element,a.responseText):function(t,e,n,o){t.focus();var i=JSON.parse(e);1===i.code&&(o.className="vditor-upload vditor-upload--tip",o.children[0].innerHTML=i.msg),i.data.errFiles.forEach(function(e){var o="["+e.replace(/\W/g,"")+"]("+s[n].uploading+")";t.selectionStart=t.value.split(o)[0].length,t.selectionEnd=t.selectionStart+o.length,_(t,"["+e.replace(/\W/g,"")+"]("+s[n].uploadError+")","",!0)}),Object.keys(i.data.succMap).forEach(function(e){var o=i.data.succMap[e];if(o.indexOf(".weba")>-1)_(t,'<audio controls="controls" src="'+o+'"></audio>\n',"");else{var r="["+e.replace(/\W/g,"")+"]("+s[n].uploading+")";t.selectionStart=t.value.split(r)[0].length,t.selectionEnd=t.selectionStart+r.length,_(t,"["+e.replace(/\W/g,"")+"]("+o+")","",!0)}})}(t.editor.element,a.responseText,t.options.lang,t.upload.element),t.upload.element.style.opacity=0):t.options.upload.error?t.options.upload.error(a.responseText):(t.upload.element.className="vditor-upload vditor-upload--tip",t.upload.element.children[0].innerHTML=a.responseText||"401"))},a.upload.onprogress=function(e){if(e.lengthComputable){var n=e.loaded/e.total*100;t.upload.element.style.opacity=1,t.upload.element.children[0].style.width=n+"%"}},a.send(o)}else alert("please config: options.upload.url");else n&&(n.value="")},E=function(){function t(t){this.element=document.createElement("textarea"),this.element.className="vditor-textarea",this.element.setAttribute("placeholder",t.options.placeholder),t.options.cache&&(this.element.value=localStorage.getItem("vditor"+t.id),t.options.counter>0&&t.counter.render(this.element.value.length,t.options.counter)),this.bindEvent(t)}return t.prototype.html2md=function(t,e,n,o){var i=!1;t.prototype.escape=function(t){return t};var r=new t;r.addRule("strikethrough",{filter:["pre","code"],replacement:function(t,e){return"PRE"===e.parentElement.tagName?t:t.split("\n").length>1?(i=!0,"```\n"+t+"\n```"):"`"+t+"`"}}),r.addRule("strikethrough",{filter:["img"],replacement:function(t,n){if(!n.getAttribute("src"))return"";if(e.options.upload.linkToImgUrl){var o=new XMLHttpRequest;o.open("POST",e.options.upload.linkToImgUrl),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE&&200===o.status){var t=JSON.parse(o.responseText);if(0!==t.code)return void alert(t.msg);var i=n.getAttribute("src");e.editor.element.selectionStart=e.editor.element.value.split(i)[0].length,e.editor.element.selectionEnd=e.editor.element.selectionStart+i.length,_(e.editor.element,t.data.url,"",!0)}},o.send(JSON.stringify({url:n.getAttribute("src")}))}return"+")"}}),r.use(g);var s=r.turndown(n);if(i){var l=document.createElement("div");l.innerHTML=n,l.querySelectorAll("pre").length>1?i=!1:"```"===s.substr(0,3)&&"```"===s.substr(s.length-3,3)||(i=!1)}_(e.editor.element,i?"```\n"+o+"\n```":s,"",!0)},t.prototype.bindEvent=function(t){var e,o=this;this.element.addEventListener("input",function(){t.options.counter>0&&t.counter.render(o.element.value.length,t.options.counter),t.options.input&&t.options.input(o.element.value,t.preview&&t.preview.element),t.hint&&t.hint.render(),t.options.cache&&localStorage.setItem("vditor"+t.id,t.editor.element.value),t.preview&&t.preview.render(t)}),this.element.addEventListener("focus",function(){t.options.focus&&t.options.focus(o.element.value),t.toolbar.elements.emoji&&t.toolbar.elements.emoji.children[1]&&(t.toolbar.elements.emoji.children[1].style.display="none"),t.toolbar.elements.headings&&t.toolbar.elements.headings.children[1]&&(t.toolbar.elements.headings.children[1].style.display="none")}),this.element.addEventListener("blur",function(){t.options.blur&&t.options.blur(o.element.value)}),t.options.select&&(this.element.onselect=function(){t.options.select(o.element.value.substring(o.element.selectionStart,o.element.selectionEnd))}),this.element.addEventListener("scroll",function(){if("none"!==t.preview.element.style.display||t.preview){var e=o.element.scrollTop,n=o.element.clientHeight,i=o.element.scrollHeight,r=t.preview.element;r.scrollTop=e/n>.5?(e+n)*r.scrollHeight/i-n:e*r.scrollHeight/i}}),t.options.upload.url&&this.element.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault();var n=e.dataTransfer.items;0!==n.length&&b(t,n)});var i=this.html2md;this.element.addEventListener("paste",function(o){if(o.stopPropagation(),o.preventDefault(),""!==o.clipboardData.getData("text/html").replace(/(^\s*)|(\s*)$/g,"")){var r=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");if(!e)return void Promise.all([n.e(0),n.e(2)]).then(n.bind(null,28)).then(function(n){e=n.default,i(e,t,r,s)}).catch(function(t){console.log("Failed to load turndown",t)});i(e,t,r,s)}else if(""!==o.clipboardData.getData("text/plain").replace(/(^\s*)|(\s*)$/g,"")&&0===o.clipboardData.files.length)_(o.target,o.clipboardData.getData("text/plain"),"",!0);else if(o.clipboardData.files.length>0){if(!t.options.upload.url)return;b(t,o.clipboardData.files)}})},t}(),_=function(t,e,n,o){if("number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd){var i=t.selectionStart,r=t.selectionEnd,s=t.value;if(t.focus(),/firefox/i.test(navigator.userAgent)||/edge/i.test(navigator.userAgent)||/msie/i.test(navigator.userAgent)||/trident/i.test(navigator.userAgent)){i===r?(t.value=s.substring(0,i)+e+n+s.substring(r,s.length),t.selectionEnd=t.selectionStart=r+e.length):o?(t.value=s.substring(0,i)+e+n+s.substring(r,s.length),t.selectionEnd=i+e.length+n.length):s.substring(i-e.length,i)===e&&s.substring(r,r+n.length)===n?(t.value=s.substring(0,i-e.length)+s.substring(i,r)+s.substring(r+n.length,s.length),t.selectionStart=i-e.length,t.selectionEnd=r-e.length):(t.value=s.substring(0,i)+e+s.substring(i,r)+n+s.substring(r,s.length),t.selectionStart=i+e.length,t.selectionEnd=r+e.length);var l=document.createEvent("HTMLEvents");l.initEvent("input",!0,!1),t.dispatchEvent(l)}else if(i===r)document.execCommand("insertText",!1,e+n),t.selectionStart=t.selectionEnd=t.selectionStart-n.length;else if(o)document.execCommand("insertText",!1,e+n);else if(s.substring(i-e.length,i)===e&&s.substring(r,r+n.length)===n){document.execCommand("delete",!1);for(var a=0,c=e.length;a<c;a++)document.execCommand("delete",!1);for(var p=0,u=n.length;p<u;p++)document.execCommand("forwardDelete",!1);document.execCommand("insertText",!1,s.substring(i,r)),t.selectionStart=i-e.length,t.selectionEnd=r-e.length}else document.execCommand("insertText",!1,e+s.substring(i,r)+n),t.selectionStart=i+e.length,t.selectionEnd=r+e.length}},x=function(){function t(t,e){this.menuItem=e,this.editorElement=t.editor.element,this.element=document.createElement("div");var n=document.createElement("div");n.className="vditor-tooltipped vditor-tooltipped__"+e.tipPosition;var o=this.menuItem.hotkey?" <"+this.menuItem.hotkey+">":"";o=/Mac/.test(navigator.platform)?o.replace("ctrl","⌘"):o.replace("⌘","ctrl"),n.setAttribute("aria-label",this.menuItem.tip||s[t.options.lang][this.menuItem.name]+o),this.element.appendChild(n)}return t.prototype.bindEvent=function(){var t=this;this.element.children[0].addEventListener("click",function(){_(t.editorElement,t.menuItem.prefix||"",t.menuItem.suffix||"")})},t}(),O=(y=function(t,e){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),M=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.element.children[0].innerHTML=n.icon||r.a;var i=document.createElement("div");i.className="vditor-panel";var s="";Object.keys(e.options.hint.emoji).forEach(function(t){var n=e.options.hint.emoji[t];n.indexOf(".")>-1?s+='<span data-value=":'+t+': " title=":'+t+':"><img data-value=":'+t+': " src="'+n+'"/></span>':s+='<span data-value="'+n+' " title="'+t+'">'+n+"</span>"});var l=e.options.hint.emojiTail?'<div class="vditor-emojis__tail">'+e.options.hint.emojiTail+"</div>":"";return i.innerHTML='<div class="vditor-emojis">'+s+"</div>"+l,o.element.appendChild(i),o._bindEvent(i,e),o}return O(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){"block"===t.style.display?t.style.display="none":(t.style.display="block",e.toolbar.elements.headings&&(e.toolbar.elements.headings.children[1].style.display="none"))}),t.querySelectorAll(".vditor-emojis span").forEach(function(n){n.addEventListener("click",function(n){_(e.editor.element,n.target.getAttribute("data-value"),"",!0),t.style.display="none"})})},e}(x),k=n(2),j=n.n(k),P=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),T=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||j.a,o.bindEvent(),o}return P(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),z=n(3),L=n.n(z),S=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),H=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.element.children[0].innerHTML=n.icon||L.a;var i=document.createElement("div");return i.className="vditor-panel",i.innerHTML='<h1 data-value="# ">Heading 1</h1>\n<h2 data-value="## ">Heading 2</h2>\n<h3 data-value="### ">Heading 3</h3>\n<h4 data-value="#### ">Heading 4</h4>\n<h5 data-value="##### ">Heading 5</h5>\n<h6 data-value="###### ">Heading 6</h6>',o.element.appendChild(i),o._bindEvent(i,e),o}return S(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){"block"===t.style.display?t.style.display="none":(t.style.display="block",e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.children[1].style.display="none"))});for(var n=0;n<6;n++)t.children.item(n).addEventListener("click",function(n){_(e.editor.element,n.target.getAttribute("data-value"),""),t.style.display="none"})},e}(x),N=function(){return function(){this.element=document.createElement("div"),this.element.className="vditor-menu__divider"}}(),A=function(){return function(){this.element=document.createElement("div"),this.element.className="vditor-menu__br"}}(),C=n(4),q=n.n(C),B=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),I=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||q.a,o.bindEvent(),o}return B(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),D=n(5),R=n.n(D),F=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),U=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||R.a,o.bindEvent(),o}return F(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),V=n(6),W=n.n(V),X=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),J=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||W.a,o.bindEvent(),o}return X(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),K=n(7),Y=n.n(K),$=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Q=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Y.a,o.bindEvent(),o}return $(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),G=n(8),Z=n.n(G),tt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),et=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Z.a,o.bindEvent(),o}return tt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),nt=n(9),ot=n.n(nt),it=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),rt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ot.a,o.bindEvent(),o}return it(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),st=n(10),lt=n.n(st),at=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ct=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||lt.a,o.bindEvent(),o}return at(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),pt=n(11),ut=n.n(pt),dt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ht=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ut.a,o.bindEvent(),o}return dt(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){document.execCommand("undo")})},e}(x),vt=n(12),ft=n.n(vt),mt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),gt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ft.a,o.bindEvent(),o}return mt(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){document.execCommand("redo")})},e}(x),yt=n(13),wt=n.n(yt),bt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Et=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||wt.a,o.bindEvent(),o}return bt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),_t=n(14),xt=n.n(_t),Ot=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Mt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||xt.a,o.bindEvent(),o}return Ot(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),kt=n(15),jt=n.n(kt),Pt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Tt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||jt.a,o.bindEvent(),o}return Pt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),zt=n(16),Lt=n.n(zt),St=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ht=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Lt.a,o.bindEvent(),o}return St(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){window.open("https://hacpai.com/guide/markdown")})},e}(x),Nt=n(17),At=n.n(Nt),Ct=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),qt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||At.a,o.bindEvent(),o}return Ct(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),Bt=n(18),It=n.n(Bt),Dt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Rt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||It.a,e.options.preview.show&&(o.element.children[0].className="vditor-tooltipped vditor-tooltipped__"+n.tipPosition+" vditor-menu--current"),o._bindEvent(e,n),o}return Dt(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){"block"===t.preview.element.style.display?(t.preview.element.style.display="none",this.className="vditor-tooltipped vditor-tooltipped__"+e.tipPosition):(t.preview.element.style.display="block",this.className="vditor-tooltipped vditor-tooltipped__"+e.tipPosition+" vditor-menu--current",t.preview.render(t))})},e}(x),Ft=n(0),Ut=n.n(Ft),Vt=n(19),Wt=n.n(Vt),Xt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Jt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Ut.a,o._bindEvent(e,n),o}return Xt(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){var n=document.getElementById(t.id);n.className.indexOf("vditor--fullscreen")>-1?(this.innerHTML=e.icon||Ut.a,n.className=n.className.replace(" vditor--fullscreen",""),Object.keys(t.toolbar.elements).forEach(function(e){var n=t.toolbar.elements[e].firstChild;n&&(n.className=n.className.replace("__s","__n"))})):(this.innerHTML=e.icon||Wt.a,n.className=n.className+" vditor--fullscreen",Object.keys(t.toolbar.elements).forEach(function(e){var n=t.toolbar.elements[e].firstChild;n&&(n.className=n.className.replace("__n","__s"))}))})},e}(x),Kt=n(20),Yt=n.n(Kt),$t=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Qt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML="<label>"+(n.icon||Yt.a)+'<input multiple="multiple" type="file"></label>',o._bindEvent(e),o}return $t(e,t),e.prototype._bindEvent=function(t){this.element.querySelector("input").addEventListener("change",function(e){0!==e.target.files.length&&b(t,e.target.files,e.target)})},e}(x),Gt=n(21),Zt=n.n(Gt),te=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ee=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Zt.a,o._bindEvent(e),o}return te(e,t),e.prototype._bindEvent=function(t){var e;this.element.children[0].addEventListener("click",function(){e?"recording"===e.getState()?e.stopRecording(function(){var n=e.getBlob();t.upload.element.className="vditor-upload",b(t,[n])}):(t.upload.element.children[0].innerHTML=s[t.options.lang].recoding,t.upload.element.style.opacity=1,t.upload.element.className="vditor-upload vditor-upload--tip",t.editor.element.setAttribute("disabled","disabled"),e.startRecording()):Promise.all([n.e(0),n.e(2)]).then(n.t.bind(null,29,7)).then(function(n){navigator.mediaDevices.getUserMedia({audio:!0}).then(function(o){e=new n.default(o,{type:"audio",mimeType:"audio/wav"}),t.upload.element.children[0].innerHTML=s[t.options.lang].recoding,t.upload.element.style.opacity=1,t.upload.element.className="vditor-upload vditor-upload--tip",t.editor.element.setAttribute("disabled","disabled"),e.startRecording()}).catch(function(t){console.log("init media error:",t)})}).catch(function(t){console.log("Failed to load recordrtc",t)})})},e}(x),ne=n(22),oe=n.n(ne),ie=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),re=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||oe.a,o.bindEvent(),o}return ie(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){window.open("https://github.com/b3log/vditor")})},e}(x),se=function(){return function(t){var e=this,n=t.options;this.elements={},n.toolbar.forEach(function(n,o){var i;switch(n.name){case"emoji":i=new M(t,n);break;case"bold":i=new T(t,n);break;case"headings":i=new H(t,n);break;case"|":i=new N;break;case"br":i=new A;break;case"italic":i=new I(t,n);break;case"strike":i=new U(t,n);break;case"line":i=new J(t,n);break;case"quote":i=new Q(t,n);break;case"list":i=new et(t,n);break;case"ordered-list":i=new rt(t,n);break;case"check":i=new ct(t,n);break;case"undo":i=new ht(t,n);break;case"redo":i=new gt(t,n);break;case"code":i=new Mt(t,n);break;case"inline-code":i=new Et(t,n);break;case"link":i=new Tt(t,n);break;case"help":i=new Ht(t,n);break;case"table":i=new qt(t,n);break;case"preview":i=new Rt(t,n);break;case"fullscreen":i=new Jt(t,n);break;case"upload":i=new Qt(t,n);break;case"record":i=new ee(t,n);break;case"info":i=new re(t,n);break;default:console.log("menu item no matched")}var r=n.name;"br"!==r&&"|"!==r||(r+=o),e.elements[r]=i.element})}}(),le=function(){function t(t){this.defaultOptions={cache:!0,height:"auto",width:"auto",placeholder:"",lang:"zh_CN",resize:{enable:!1,position:"bottom"},preview:{delay:1e3,show:!1},hint:{delay:200,emoji:{"+1":"👍","-1":"👎",heart:"❤️",cold_sweat:"😰"}},counter:0,upload:{url:"",max:10485760,linkToImgUrl:""},classes:{preview:""},toolbar:[{name:"emoji",hotkey:"⌘-e",tipPosition:"ne"},{name:"headings",hotkey:"⌘-h",tipPosition:"ne"},{name:"bold",prefix:"**",suffix:"**",hotkey:"⌘-b",tipPosition:"ne"},{name:"italic",prefix:"*",suffix:"*",hotkey:"⌘-i",tipPosition:"ne"},{name:"strike",prefix:"~~",suffix:"~~",hotkey:"⌘-s",tipPosition:"ne"},{name:"|"},{name:"line",prefix:"---\n",hotkey:"⌘-d",tipPosition:"n"},{name:"quote",prefix:"> ",hotkey:"⌘-.",tipPosition:"n"},{name:"|"},{name:"list",prefix:"* ",hotkey:"⌘-l",tipPosition:"n"},{name:"ordered-list",prefix:"1. ",hotkey:"⌘-o",tipPosition:"n"},{name:"check",prefix:"* [ ] ",hotkey:"⌘-j",tipPosition:"n"},{name:"|"},{name:"code",prefix:"```\n",suffix:"\n```",hotkey:"⌘-u",tipPosition:"n"},{name:"inline-code",prefix:"`",suffix:"`",hotkey:"⌘-g",tipPosition:"n"},{name:"|"},{name:"undo",hotkey:"⌘-z",tipPosition:"n"},{name:"redo",hotkey:"⌘-y",tipPosition:"n"},{name:"|"},{name:"upload",tipPosition:"n"},{name:"link",prefix:"[",suffix:"](https://)",hotkey:"⌘-k",tipPosition:"n"},{name:"table",prefix:"| col1",suffix:" | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |",hotkey:"⌘-m",tipPosition:"n"},{name:"record",tipPosition:"n"},{name:"|"},{name:"preview",hotkey:"⌘-p",tipPosition:"nw"},{name:"fullscreen",hotkey:"⌘-f",tipPosition:"nw"},{name:"info",tipPosition:"nw"},{name:"help",tipPosition:"nw"},{name:"br"}]},this.options=t}return t.prototype.merge=function(){var t=this,e=[];this.options&&(this.options.toolbar&&this.options.toolbar.forEach(function(n){var o;t.defaultOptions.toolbar.forEach(function(t){"string"==typeof n&&t.name===n&&(o=t),"object"==typeof n&&t.name===n.name&&(o=Object.assign({},t,n))}),e.push(o)}),this.options.upload&&(this.options.upload=Object.assign({},this.defaultOptions.upload,this.options.upload)),this.options.classes&&(this.options.classes=Object.assign({},this.defaultOptions.classes,this.options.classes)),this.options.preview&&(this.options.preview=Object.assign({},this.defaultOptions.preview,this.options.preview)),this.options.hint&&(this.options.hint=Object.assign({},this.defaultOptions.hint,this.options.hint)),this.options.resize&&(this.options.resize=Object.assign({},this.defaultOptions.resize,this.options.resize)));var n=Object.assign({},this.defaultOptions,this.options);return e.length>0&&(n.toolbar=e),n},t}(),ae=function(){return function(t){var e=document.getElementById(t.id);e.className="vditor"+(e.className?" "+e.className:""),"number"==typeof t.options.height&&(e.style.height=t.options.height+"px"),"number"==typeof t.options.width?e.style.width=t.options.width+"px":e.style.width=t.options.width;var n=document.createElement("div");n.className="vditor-toolbar",Object.keys(t.toolbar.elements).forEach(function(e){n.appendChild(t.toolbar.elements[e])}),e.appendChild(n),t.options.resize.enable&&"top"===t.options.resize.position&&e.appendChild(t.resize.element);var o=document.createElement("div");o.className="vditor-content",o.appendChild(t.editor.element),t.preview&&o.appendChild(t.preview.element),t.options.counter>0&&o.appendChild(t.counter.element),t.upload&&o.appendChild(t.upload.element),e.appendChild(o),t.options.resize.enable&&"bottom"===t.options.resize.position&&e.appendChild(t.resize.element),document.onclick=function(t){var e=t.target.closest(".vditor-tooltipped");e&&e.nextSibling&&"vditor-panel"===e.nextSibling.className||(document.querySelectorAll(".vditor-hint").forEach(function(t){t.style.display="none"}),document.querySelectorAll(".vditor-panel").forEach(function(t){t.style.display="none"}))}}}(),ce=function(){function t(t){this.editorElement=t.editor.element,this.toolbarElements=t.toolbar.elements,this.options=t.options,this.hintElement=t.hint.element,this.bindHotkey()}return t.prototype.bindHotkey=function(){var t=this;this.editorElement.addEventListener("keydown",function(e){t.options.esc&&e.key.toLowerCase()==="Escape".toLowerCase()&&t.options.esc(t.editorElement.value),t.options.ctrlEnter&&(e.metaKey||e.ctrlKey)&&"enter"===e.key.toLowerCase()&&t.options.ctrlEnter(t.editorElement.value),t.options.toolbar.forEach(function(n){if(n.hotkey){var o=n.hotkey.split("-");"ctrl"!==o[0]&&"⌘"!==o[0]||!e.metaKey&&!e.ctrlKey||e.key===o[1]&&(t.toolbarElements[n.name].children[0].click(),e.preventDefault(),e.stopPropagation())}}),(t.options.hint.at||t.toolbarElements.emoji)&&t.hint(e)})},t.prototype.hint=function(t){if(0!==this.hintElement.querySelectorAll("li").length&&"none"!==this.hintElement.style.display){var e=this.hintElement.querySelector(".vditor-hint--current");if("arrowdown"===t.key.toLowerCase())t.preventDefault(),t.stopPropagation(),e.nextElementSibling?e.nextElementSibling.className="vditor-hint--current":this.hintElement.children[0].className="vditor-hint--current",e.removeAttribute("class");else if("arrowup"===t.key.toLowerCase()){if(t.preventDefault(),t.stopPropagation(),e.previousElementSibling)e.previousElementSibling.className="vditor-hint--current";else{var n=this.hintElement.children.length;this.hintElement.children[n-1].className="vditor-hint--current"}e.removeAttribute("class")}else if("enter"===t.key.toLowerCase()){t.preventDefault(),t.stopPropagation(),this.hintElement.style.display="none";var o=e.getAttribute("data-value"),i=0===o.indexOf("@")?"@":":";this.editorElement.selectionStart=this.editorElement.value.substr(0,this.editorElement.selectionEnd).lastIndexOf(i),_(this.editorElement,o,"",!0)}}},t}(),pe=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-preview"+(t.options.classes.preview?" "+t.options.classes.preview:""),t.options.preview.show||(this.element.style.display="none"),"none"!==this.element.style.display&&this.render(t)}return t.prototype.render=function(t,e){var n=this;"none"!==this.element.style.display&&(e?this.element.innerHTML=e:""!==t.editor.element.value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")?t.options.preview.url?(clearTimeout(t.mdTimeoutId),t.mdTimeoutId=setTimeout(function(){var e=new XMLHttpRequest;e.open("POST",t.options.preview.url),e.onreadystatechange=function(){if(e.readyState===XMLHttpRequest.DONE&&200===e.status){var o=JSON.parse(e.responseText);if(0!==o.code)return void alert(o.msg);n.element.innerHTML=o.data,t.options.preview.parse&&t.options.preview.parse(n.element)}},e.send(JSON.stringify({markdownText:t.editor.element.value}))},t.options.preview.delay)):this.element.innerHTML=t.editor.element.value:this.element.innerHTML="")},t}(),ue=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-counter",this.render(0,t.options.counter)}return t.prototype.render=function(t,e){this.element.className=t>e?"vditor-counter vditor-counter--error":"vditor-counter",this.element.innerHTML=t+"/"+e},t}(),de=n(23),he=n.n(de),ve=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-resize",this.element.innerHTML=he.a,this.bindEvent(t)}return t.prototype.bindEvent=function(t){this.element.addEventListener("mousedown",function(e){var n=document,o=document.getElementById(t.id);e||(e=window.event);var i=e.clientY,r=o.offsetHeight;n.ondragstart="return false;",n.onselectstart="return false;",n.onselect="document.selection.empty();",this.setCapture?this.setCapture():window.captureEvents&&window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP),n.onmousemove=function(e){e||(e=window.event),"top"===t.options.resize.position?o.style.height=Math.max(100,r+(i-e.clientY))+"px":o.style.height=Math.max(100,r+(e.clientY-i))+"px"},n.onmouseup=function(){this.releaseCapture?this.releaseCapture():window.captureEvents&&window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP),n.onmousemove=null,n.onmouseup=null,n.ondragstart=null,n.onselectstart=null,n.onselect=null}})},t}(),fe=function(t){var e=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n=document.querySelector(".vditor-position");n||((n=document.createElement("div")).className="vditor-position",document.body.appendChild(n));var o=n.style;o.whiteSpace="pre-wrap",o.wordWrap="break-word",o.position="absolute",o.overflow="hidden",o.left="-100%",["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"].forEach(function(t){o[t]=e[t]}),n.textContent=t.value.substring(0,t.selectionEnd);var i=document.createElement("span");return i.textContent=t.value.substring(t.selectionEnd)||".",n.appendChild(i),{top:i.offsetTop-t.scrollTop+parseInt(e.lineHeight),left:i.offsetLeft-t.scrollLeft}},me=function(){function t(t){this.timeId=-1,this.hintDelay=t.options.hint.delay,this.editorElement=t.editor.element,this.atUser=t.options.hint.at,this.commonEmoji=t.options.hint.emoji,this.element=document.createElement("ul"),this.element.className="vditor-hint",this.editorElement.parentElement.appendChild(this.element)}return t.prototype.render=function(){var t=this,e=this.editorElement.value.substr(0,this.editorElement.selectionStart).split("\n").slice(-1).pop(),o=this.getKey(e,"@"),i=this.getKey(e,":");void 0===o&&void 0===i?(this.element.style.display="none",clearTimeout(this.timeId)):(void 0!==o&&this.atUser&&(clearTimeout(this.timeId),this.timeId=setTimeout(function(){t.genHTML(t.atUser(o))},this.hintDelay)),void 0!==i&&n.e(0).then(n.bind(null,30)).then(function(e){var n=""===i?t.commonEmoji:e.allEmoji,o=[];Object.keys(n).forEach(function(t){0===t.indexOf(i.toLowerCase())&&(n[t].indexOf(".")>-1?o.push({value:":"+t+":",html:'<img src="'+n[t]+'" title=":'+t+':"/> :'+t+":"}):o.push({value:n[t],html:n[t]+" "+t}))}),t.genHTML(o)}).catch(function(t){console.log("Failed to load emoji",t)}))},t.prototype.getKey=function(t,e){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var n=t.split(e),o=void 0;if(n.length>1)if(2===n.length&&""===n[0])(""===n[1]||""!==n[1].trim())&&-1===n[1].indexOf(" ")&&n[1].length<33&&(o=n[1]);else{var i=n[n.length-2],r=n.slice(-1).pop();" "===i.slice(-1)&&-1===r.indexOf(" ")&&(""===r||""!==r.trim())&&r.length<33&&(o=r)}return o},t.prototype.genHTML=function(t){var e=this;if(0!==t.length){var n=fe(this.editorElement),o=n.left,i=n.top-4,r="";t.forEach(function(t,e){e>7||(r+='<li data-value="'+t.value+' " class="'+(e||"vditor-hint--current")+'"> '+t.html+"</li>")}),this.element.innerHTML=r,this.element.style.top=i+"px",this.element.style.left=o+"px",this.element.style.display="block",this.element.querySelectorAll("li").forEach(function(t){t.addEventListener("click",function(){e.element.style.display="none";var n=t.getAttribute("data-value"),o=0===n.indexOf("@")?"@":":";e.editorElement.selectionStart=e.editorElement.value.substr(0,e.editorElement.selectionEnd).lastIndexOf(o),_(e.editorElement,n,"",!0)})}),i+this.element.offsetHeight-this.editorElement.offsetHeight>window.innerHeight-(this.editorElement.parentElement.offsetHeight+this.editorElement.parentElement.offsetTop-document.documentElement.scrollTop)&&(this.element.style.top=i-this.element.offsetHeight+"px")}else this.element.style.display="none"},t}(),ge=function(){function t(t,e){this.version=o;var n=new le(e).merge();if(this.vditor={id:t,options:n,mdTimeoutId:-1},n.counter>0){var i=new ue(this.vditor);this.vditor.counter=i}var r=new E(this.vditor);if(this.vditor.editor=r,n.resize.enable){var s=new ve(this.vditor);this.vditor.resize=s}var l=new se(this.vditor);if(this.vditor.toolbar=l,l.elements.preview){var a=new pe(this.vditor);this.vditor.preview=a}if(n.upload.url){var c=new w;this.vditor.upload=c}if(new ae(this.vditor),this.vditor.options.atUser||this.vditor.toolbar.elements.emoji){var p=new me(this.vditor);this.vditor.hint=p}new ce(this.vditor)}return t.prototype.getValue=function(){return this.vditor.editor.element.value},t.prototype.insertVale=function(t){_(this.vditor.editor.element,t,"")},t.prototype.focus=function(){this.vditor.editor.element.focus()},t.prototype.blur=function(){this.vditor.editor.element.blur()},t.prototype.disabled=function(){this.vditor.editor.element.setAttribute("disabled","disabled")},t.prototype.enable=function(){this.vditor.editor.element.removeAttribute("disabled")},t.prototype.setSelection=function(t,e){this.vditor.editor.element.selectionStart=t,this.vditor.editor.element.selectionEnd=e,this.vditor.editor.element.focus()},t.prototype.getSelection=function(){this.vditor.editor.element.value.substring(this.vditor.editor.element.selectionStart,this.vditor.editor.element.selectionEnd)},t.prototype.setValue=function(t){this.vditor.editor.element.selectionStart=0,this.vditor.editor.element.selectionEnd=this.vditor.editor.element.value.length,_(this.vditor.editor.element,t,"",!0),t||localStorage.removeItem("vditor"+this.vditor.id)},t.prototype.renderPreview=function(t){this.vditor.preview.render(this.vditor,t)},t.prototype.getCursorPosition=function(){return fe(this.vditor.editor.element)},t.prototype.deleteValue=function(){_(this.vditor.editor.element,"","",!0)},t.prototype.updateValue=function(t){_(this.vditor.editor.element,t,"",!0)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){localStorage.removeItem("vditor"+this.vditor.id)},t.prototype.disabledCache=function(){this.vditor.options.cache=!1},t.prototype.enableCache=function(){this.vditor.options.cache=!0},t}();e.default=ge}]).default}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Vditor=e():t.Vditor=e()}(window,function(){return function(t){function e(e){for(var n,i,r=e[0],s=e[1],l=0,c=[];l<r.length;l++)i=r[l],o[i]&&c.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n]);for(a&&a(e);c.length;)c.shift()()}var n={},o={0:0};function i(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.e=function(t){var e=[],n=o[t];if(0!==n)if(n)e.push(n[2]);else{var r=new Promise(function(e,i){n=o[t]=[e,i]});e.push(n[2]=r);var s,l=document.createElement("script");l.charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.src=function(t){return i.p+""+({1:"vditor",2:"vendors~vditor"}[t]||t)+".bundle.js"}(t),s=function(e){l.onerror=l.onload=null,clearTimeout(a);var n=o[t];if(0!==n){if(n){var i=e&&("load"===e.type?"missing":e.type),r=e&&e.target&&e.target.src,s=new Error("Loading chunk "+t+" failed.\n("+i+": "+r+")");s.type=i,s.request=r,n[1](s)}o[t]=void 0}};var a=setTimeout(function(){s({type:"timeout",target:l})},12e4);l.onerror=l.onload=s,document.head.appendChild(l)}return Promise.all(e)},i.m=t,i.c=n,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="https://vditor.b3log.org/0.1.8/",i.oe=function(t){throw console.error(t),t};var r=window.webpackJsonpVditor=window.webpackJsonpVditor||[],s=r.push.bind(r);r.push=e,r=r.slice();for(var l=0;l<r.length;l++)e(r[l]);var a=s;return i(i.s=24)}([function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M32 0v13l-5-5-6 6-3-3 6-6-5-5zM14 21l-6 6 5 5h-13v-13l5 5 6-6z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M16 24.789c-3.756 0-6.911-2.254-8.188-5.559h16.376c-1.277 3.305-4.432 5.559-8.188 5.559zM10.366 14.423c-1.352 0-2.404-1.052-2.404-2.404s1.052-2.404 2.404-2.404 2.404 1.052 2.404 2.404-1.052 2.404-2.404 2.404zM21.634 14.423c-1.352 0-2.404-1.052-2.404-2.404s1.052-2.404 2.404-2.404 2.404 1.052 2.404 2.404-1.052 2.404-2.404 2.404zM16 28.845c7.061 0 12.845-5.784 12.845-12.845s-5.784-12.845-12.845-12.845-12.845 5.784-12.845 12.845 5.784 12.845 12.845 12.845zM16 0c8.864 0 16 7.136 16 16s-7.136 16-16 16-16-7.136-16-16 7.136-16 16-16z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M22.996 15.023c1.339-1.591 2.147-3.643 2.147-5.88 0-5.041-4.102-9.143-9.143-9.143h-11.429v32h13.714c5.041 0 9.143-4.102 9.143-9.143 0-3.32-1.779-6.232-4.433-7.834zM11.429 4.571h3.625c1.999 0 3.625 2.051 3.625 4.571s-1.626 4.571-3.625 4.571h-3.625v-9.143zM17.107 27.429h-5.679v-9.143h5.679c2.087 0 3.786 2.051 3.786 4.571s-1.698 4.571-3.786 4.571z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M4.45 0h3.594c0.595 0 1.078 0.384 1.078 0.858v30.284c0 0.474-0.482 0.858-1.078 0.858h-3.594c-0.595 0-1.078-0.384-1.078-0.858v-30.284c-0-0.474 0.482-0.858 1.078-0.858zM23.888 0h3.673c0.59 0 1.068 0.384 1.068 0.858v30.284c0 0.474-0.478 0.858-1.068 0.858h-3.673c-0.59 0-1.068-0.384-1.068-0.858v-30.284c0-0.474 0.478-0.858 1.068-0.858z"></path> <path d="M25.069 14.167v3.667c0 0.589-0.384 1.065-0.858 1.065h-15.655c-0.474 0-0.858-0.477-0.858-1.065v-3.667c0-0.589 0.384-1.065 0.858-1.065h15.655c0.474 0 0.858 0.477 0.858 1.065z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M29.714 0v2.286h-4.571l-11.429 27.429h4.571v2.286h-16v-2.286h4.571l11.429-27.429h-4.571v-2.286z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M32 16v2h-7.328c0.86 1.203 1.328 2.584 1.328 4 0 2.215-1.146 4.345-3.143 5.843-1.855 1.391-4.29 2.157-6.857 2.157s-5.002-0.766-6.857-2.157c-1.998-1.498-3.143-3.628-3.143-5.843h4c0 2.168 2.748 4 6 4s6-1.832 6-4c0-2.168-2.748-4-6-4h-16v-2h9.36c-0.073-0.052-0.146-0.104-0.217-0.157-1.998-1.498-3.143-3.628-3.143-5.843s1.146-4.345 3.143-5.843c1.855-1.391 4.29-2.157 6.857-2.157s5.002 0.766 6.857 2.157c1.997 1.498 3.143 3.628 3.143 5.843h-4c0-2.168-2.748-4-6-4s-6 1.832-6 4c0 2.168 2.748 4 6 4 2.468 0 4.814 0.709 6.64 2h9.36z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M31.68 14.56h-31.36c-0.176 0-0.32 0.144-0.32 0.32v2.24c0 0.176 0.144 0.32 0.32 0.32h31.36c0.176 0 0.32-0.144 0.32-0.32v-2.24c0-0.176-0.144-0.32-0.32-0.32z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M7.024 13.003c3.862 0 6.993 3.131 6.993 6.993s-3.131 6.993-6.993 6.993-6.993-3.131-6.993-6.993l-0.031-0.999c0-7.724 6.262-13.986 13.986-13.986v3.996c-2.668 0-5.177 1.039-7.064 2.926-0.363 0.363-0.695 0.75-0.994 1.156 0.357-0.056 0.723-0.086 1.096-0.086zM25.007 13.003c3.862 0 6.993 3.131 6.993 6.993s-3.131 6.993-6.993 6.993-6.993-3.131-6.993-6.993l-0.031-0.999c0-7.724 6.262-13.986 13.986-13.986v3.996c-2.668 0-5.177 1.039-7.064 2.926-0.363 0.363-0.695 0.75-0.994 1.156 0.357-0.056 0.723-0.086 1.096-0.086z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M12 2h20v4h-20v-4zM12 14h20v4h-20v-4zM12 26h20v4h-20v-4zM0 4c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4zM0 16c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4zM0 28c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M11 26h20v4h-20zM11 14h20v4h-20zM11 2h20v4h-20zM5 0v8h-2v-6h-2v-2zM3 16.438v1.563h4v2h-6v-4.563l4-1.875v-1.563h-4v-2h6v4.563zM7 22v10h-6v-2h4v-2h-4v-2h4v-2h-4v-2z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M27.094 19.485v6.12c0 3.059-2.483 5.542-5.542 5.542h-16.010c-3.059 0-5.542-2.483-5.542-5.542v-16.010c0-3.059 2.483-5.542 5.542-5.542h16.010c0.769 0 1.54 0.154 2.251 0.481 0.174 0.077 0.308 0.25 0.346 0.443 0.039 0.211-0.019 0.404-0.174 0.558l-0.943 0.943c-0.115 0.115-0.289 0.193-0.443 0.193-0.058 0-0.115-0.019-0.174-0.039-0.289-0.077-0.578-0.115-0.866-0.115h-16.010c-1.693 0-3.079 1.386-3.079 3.079v16.010c0 1.693 1.386 3.079 3.079 3.079h16.010c1.693 0 3.079-1.386 3.079-3.079v-4.888c0-0.154 0.058-0.308 0.174-0.424l1.232-1.232c0.135-0.135 0.289-0.193 0.443-0.193 0.077 0 0.154 0.019 0.231 0.058 0.231 0.096 0.385 0.308 0.385 0.558zM31.54 10.076l-15.664 15.664c-0.615 0.615-1.578 0.615-2.194 0l-8.275-8.275c-0.615-0.615-0.615-1.578 0-2.194l2.116-2.116c0.615-0.615 1.578-0.615 2.194 0l5.060 5.060 12.451-12.451c0.615-0.615 1.578-0.615 2.194 0l2.116 2.116c0.615 0.615 0.615 1.578 0 2.194z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M12.417 9.75q8.667 1.25 13.375 6.625t6.208 12.958q-6.417-9.083-19.583-9.083v7.25l-12.417-12.417 12.417-12.417v7.083z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M19.583 9.75q-8.667 1.25-13.375 6.625t-6.208 12.958q6.417-9.083 19.583-9.083v7.25l12.417-12.417-12.417-12.417v7.083z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M18.133 23.467l3.2 3.2 10.667-10.667-10.667-10.667-3.2 3.2 7.467 7.467z"></path> <path d="M13.867 8.533l-3.2-3.2-10.667 10.667 10.667 10.667 3.2-3.2-7.467-7.467z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M21.053 21.895l2.526 2.526 8.421-8.421-8.421-8.421-2.526 2.526 5.895 5.895z"></path> <path d="M10.947 10.105l-2.526-2.526-8.421 8.421 8.421 8.421 2.526-2.526-5.895-5.895z"></path> <path d="M17.613 6.487l1.828 0.499-5.052 18.527-1.828-0.499 5.052-18.527z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M29.187 2.933l-0.12-0.121c-2.813-2.812-7.415-2.812-10.228 0l-6.516 6.517c-2.812 2.812-2.812 7.415 0 10.227l0.12 0.12c0.234 0.234 0.482 0.446 0.739 0.641l2.386-2.386c-0.278-0.164-0.542-0.361-0.78-0.599l-0.121-0.121c-1.527-1.527-1.527-4.012 0-5.539l6.517-6.516c1.527-1.527 4.012-1.527 5.539 0l0.121 0.12c1.527 1.527 1.527 4.012 0 5.539l-2.948 2.948c0.512 1.264 0.754 2.611 0.733 3.955l4.559-4.559c2.812-2.812 2.812-7.415-0-10.227zM19.557 12.323c-0.234-0.234-0.482-0.446-0.739-0.641l-2.386 2.385c0.278 0.164 0.542 0.361 0.78 0.599l0.121 0.121c1.527 1.527 1.527 4.012 0 5.539l-6.517 6.517c-1.527 1.527-4.012 1.527-5.539 0l-0.121-0.121c-1.527-1.527-1.527-4.012 0-5.539l2.948-2.948c-0.512-1.264-0.754-2.611-0.733-3.955l-4.559 4.559c-2.812 2.812-2.812 7.415 0 10.228l0.12 0.12c2.813 2.812 7.415 2.812 10.228 0l6.516-6.517c2.812-2.812 2.812-7.415 0-10.228l-0.12-0.12z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M19.652 25v6c0 0.55-0.45 1-1 1h-6c-0.55 0-1-0.45-1-1v-6c0-0.55 0.45-1 1-1h6c0.55 0 1 0.45 1 1zM27.552 10c0 4.75-3.225 6.575-5.6 7.9-1.475 0.85-2.4 2.575-2.4 3.3v0c0 0.55-0.425 1.2-1 1.2h-6c-0.55 0-0.9-0.85-0.9-1.4v-1.125c0-3.025 3-5.625 5.2-6.625 1.925-0.875 2.725-1.7 2.725-3.3 0-1.4-1.825-2.65-3.85-2.65-1.125 0-2.15 0.35-2.7 0.725-0.6 0.425-1.2 1.025-2.675 2.875-0.2 0.25-0.5 0.4-0.775 0.4-0.225 0-0.425-0.075-0.625-0.2l-4.1-3.125c-0.425-0.325-0.525-0.875-0.25-1.325 2.7-4.475 6.5-6.65 11.6-6.65 5.35 0 11.35 4.275 11.35 10z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M9.846 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM9.846 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM9.846 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM32 5.538v20.923c0 1.692-1.385 3.077-3.077 3.077h-25.846c-1.692 0-3.077-1.385-3.077-3.077v-20.923c0-1.692 1.385-3.077 3.077-3.077h25.846c1.692 0 3.077 1.385 3.077 3.077z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M0 16c3.037-5.864 9.058-9.802 16-9.802s12.963 3.938 15.953 9.703l0.047 0.1c-3.037 5.864-9.058 9.802-16 9.802s-12.963-3.938-15.953-9.703l-0.047-0.1zM16 22.531c3.607 0 6.531-2.924 6.531-6.531s-2.924-6.531-6.531-6.531v0c-3.607 0-6.531 2.924-6.531 6.531s2.924 6.531 6.531 6.531v0zM16 19.265c-1.804 0-3.265-1.461-3.265-3.265s1.461-3.265 3.265-3.265v0c1.804 0 3.265 1.461 3.265 3.265s-1.461 3.265-3.265 3.265v0z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M14 18v13l-5-5-6 6-3-3 6-6-5-5zM32 3l-6 6 5 5h-13v-13l5 5 6-6z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M21.334 16.532q0-0.233-0.15-0.384l-5.867-5.867q-0.15-0.15-0.384-0.15t-0.384 0.15l-5.85 5.85q-0.167 0.2-0.167 0.399 0 0.233 0.15 0.384t0.384 0.15h3.733v5.867q0 0.217 0.159 0.375t0.375 0.159h3.2q0.217 0 0.375-0.159t0.159-0.375v-5.867h3.734q0.217 0 0.375-0.159t0.159-0.375zM32 21.332q0 2.65-1.875 4.525t-4.525 1.875h-18.133q-3.083 0-5.275-2.192t-2.192-5.275q0-2.166 1.167-4t3.134-2.75q-0.034-0.5-0.034-0.717 0-3.533 2.5-6.033t6.033-2.5q2.6 0 4.759 1.45t3.142 3.849q1.184-1.033 2.767-1.033 1.767 0 3.017 1.25t1.25 3.017q0 1.267-0.683 2.3 2.166 0.516 3.558 2.258t1.392 3.975z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M4.571 16c0 6.312 5.117 11.429 11.429 11.429s11.429-5.117 11.429-11.429v0c0-6.312-5.117-11.429-11.429-11.429s-11.429 5.117-11.429 11.429v0z"></path> <path d="M16 30.857c-8.229 0-14.933-6.705-14.933-14.933s6.705-14.933 14.933-14.933 15.010 6.705 15.010 15.010c0 8.152-6.705 14.857-15.010 14.857zM16 0c-8.838 0-16 7.162-16 16s7.162 16 16 16 16-7.162 16-16-7.162-16-16-16z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M23.273 27.636v2.909c0 0.795-0.659 1.455-1.455 1.455h-11.636c-0.795 0-1.455-0.659-1.455-1.455v-2.909c0-0.795 0.659-1.455 1.455-1.455h1.455v-8.727h-1.455c-0.795 0-1.455-0.659-1.455-1.455v-2.909c0-0.795 0.659-1.455 1.455-1.455h8.727c0.795 0 1.455 0.659 1.455 1.455v13.091h1.455c0.795 0 1.455 0.659 1.455 1.455zM20.364 1.455v4.364c0 0.795-0.659 1.455-1.455 1.455h-5.818c-0.795 0-1.455-0.659-1.455-1.455v-4.364c0-0.795 0.659-1.455 1.455-1.455h5.818c0.795 0 1.455 0.659 1.455 1.455z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=128 height=32 viewBox="0 0 128 32"> <path d="M0 0h128v6.4h-128zM0 12.8h128v6.4h-128zM0 25.6h128v6.4h-128z"></path> </svg>'},function(t,e,n){"use strict";n.r(e);var o="0.1.8",i=n(1),r=n.n(i),s={en_US:{emoji:"Emoji",bold:"Blod",headings:"Headings",italic:"Italic",quote:"Quote",link:"Link","ordered-list":"Order List",list:"List",fullscreen:"Fullscreen",help:"Help",strike:"Strike",line:"Line",check:"Task List",code:"Code Block","inline-code":"Inline Code",redo:"Redo",undo:"Undo",table:"Table",record:"Start Record/End Record",upload:"Upload image or file",preview:"Preview",uploading:"uploading...",over:"over",recoding:"recoding...",info:"Info"},zh_CN:{emoji:"表情",bold:"粗体",headings:"标题",italic:"斜体",quote:"引用",link:"链接","ordered-list":"有序列表",list:"无序列表",fullscreen:"全屏",help:"帮助",strike:"删除线",line:"分隔线",check:"任务列表",code:"代码块","inline-code":"行内代码",redo:"重做",undo:"撤销",table:"表格",record:"开始录音/结束录音",upload:"上传图片或文件",preview:"预览",uploading:"上传中...",over:"超过",recoding:"录音中...",info:"关于"}},l=/highlight-(?:text|source)-([a-z0-9]+)/;function a(t){t.addRule("highlightedCodeBlock",{filter:function(t){var e=t.firstChild;return"DIV"===t.nodeName&&l.test(t.className)&&e&&"PRE"===e.nodeName},replacement:function(t,e,n){var o=((e.className||"").match(l)||[null,""])[1];return"\n\n"+n.fence+o+"\n"+e.firstChild.textContent+"\n"+n.fence+"\n\n"}})}function c(t){t.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(t){return"~"+t+"~"}})}var p=Array.prototype.indexOf,u=Array.prototype.every,d={};function h(t){var e,n,o=t.parentNode;return"THEAD"===o.nodeName||o.firstChild===t&&("TABLE"===o.nodeName||(n=(e=o).previousSibling,"TBODY"===e.nodeName&&(!n||"THEAD"===n.nodeName&&/^\s*$/i.test(n.textContent))))&&u.call(t.childNodes,function(t){return"TH"===t.nodeName})}function f(t,e){var n=" ";return 0===p.call(e.parentNode.childNodes,e)&&(n="| "),n+t+" |"}function v(t){for(var e in t.keep(function(t){return"TABLE"===t.nodeName&&!h(t.rows[0])}),d)t.addRule(e,d[e])}function m(t){t.addRule("taskListItems",{filter:function(t){return"checkbox"===t.type&&"LI"===t.parentNode.nodeName},replacement:function(t,e){return(e.checked?"[x]":"[ ]")+" "}})}function g(t){t.use([a,c,v,m])}d.tableCell={filter:["th","td"],replacement:function(t,e){return f(t,e)}},d.tableRow={filter:"tr",replacement:function(t,e){var n="",o={left:":--",right:"--:",center:":-:"};if(h(e))for(var i=0;i<e.childNodes.length;i++){var r="---",s=(e.childNodes[i].getAttribute("align")||"").toLowerCase();s&&(r=o[s]||r),n+=f(r,e.childNodes[i])}return"\n"+t+(n?"\n"+n:"")}},d.table={filter:function(t){return"TABLE"===t.nodeName&&h(t.rows[0])},replacement:function(t){return"\n\n"+(t=t.replace("\n\n","\n"))+"\n\n"}},d.tableSection={filter:["thead","tbody","tfoot"],replacement:function(t){return t}};var y,w=function(){return function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload",this.element.innerHTML='<div class="vditor-upload__progress"></div><div class="vditor-upload__close">x</div>',this.element.children[1].addEventListener("click",function(){this.parentElement.style.opacity=0,this.parentElement.className="vditor-upload"})}}(),b=function(t,e,n){for(var o=new FormData,i=[],r=0;r<e.length;r++){var l=e[r];l instanceof DataTransferItem&&(l=l.getAsFile()),l.size<=t.options.upload.max&&(o.append("file[]",l),i.push(l))}if(t.upload.element.className="vditor-upload",t.upload.element.children[0].innerHTML="",_(t.editor.element,function(t,e){for(var n="",o=e.length,i=0;i<o;i++){var r=e[i].getAsFile?e[i].getAsFile():e[i],l=-1===r.type.indexOf("image")?"":"!";if(!r.name)return"";var a=r.name.lastIndexOf("."),c=t.options.upload.filename(r.name.substr(0,a))+r.name.substr(a);r.size>t.options.upload.max?(t.upload.element.className="vditor-upload vditor-upload--tip",t.upload.element.children[0].innerHTML=r.name+" "+s[t.options.lang].over+" "+t.options.upload.max/1024/1024+"M"):n+=l+"["+c+"]("+s[t.options.lang].uploading+")\n"}return n}(t,e),""),0!==i.length){if(!t.options.upload.url||!t.upload)return n&&(n.value=""),void alert("please config: options.upload.url");var a=new XMLHttpRequest;a.open("POST",t.options.upload.url),t.options.upload.token&&a.setRequestHeader("X-Upload-Token",t.options.upload.token),t.upload.isUploading=!0,t.editor.element.setAttribute("disabled","disabled"),a.onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&&(t.upload.isUploading=!1,n&&(n.value=""),t.editor.element.removeAttribute("disabled"),200===a.status?(t.options.upload.success?t.options.upload.success(t.editor.element,a.responseText):function(t,e,n,o){t.focus();var i=JSON.parse(e);1===i.code&&(o.className="vditor-upload vditor-upload--tip",o.children[0].innerHTML=i.msg),i.data.errFiles.forEach(function(e){var o=e.lastIndexOf("."),i="["+(n.upload.filename(e.substr(0,o))+e.substr(o))+"]("+s[n.lang].uploading+")";t.selectionStart=t.value.split(i)[0].length,t.selectionEnd=t.selectionStart+i.length,_(t,"","",!0)}),Object.keys(i.data.succMap).forEach(function(e){var o=i.data.succMap[e];if(o.indexOf(".wav")!==o.length-4){var r=e.lastIndexOf("."),l=n.upload.filename(e.substr(0,r))+e.substr(r),a="["+l+"]("+s[n.lang].uploading+")";t.selectionStart=t.value.split(a)[0].length,t.selectionEnd=t.selectionStart+a.length,_(t,"["+l+"]("+o+")","",!0)}else _(t,'<audio controls="controls" src="'+o+'"></audio>\n',"")})}(t.editor.element,a.responseText,t.options,t.upload.element),t.upload.element.style.opacity=0):t.options.upload.error?t.options.upload.error(a.responseText):(t.upload.element.className="vditor-upload vditor-upload--tip",t.upload.element.children[0].innerHTML=a.responseText||"401"))},a.upload.onprogress=function(e){if(e.lengthComputable){var n=e.loaded/e.total*100;t.upload.element.style.opacity=1,t.upload.element.children[0].style.width=n+"%"}},a.send(o)}else n&&(n.value="")},E=function(){function t(t){this.element=document.createElement("textarea"),this.element.className="vditor-textarea",this.element.setAttribute("placeholder",t.options.placeholder),t.options.cache&&(this.element.value=localStorage.getItem("vditor"+t.id),t.options.counter>0&&t.counter.render(this.element.value.length,t.options.counter)),this.bindEvent(t)}return t.prototype.html2md=function(t,e,n,o){var i=!1;t.prototype.escape=function(t){return t};var r=new t;r.addRule("strikethrough",{filter:["pre","code"],replacement:function(t,e){return"PRE"===e.parentElement.tagName?t:t.split("\n").length>1?(i=!0,"```\n"+t+"\n```"):"`"+t+"`"}}),r.addRule("strikethrough",{filter:["img"],replacement:function(t,n){if(!n.getAttribute("src"))return"";if(e.options.upload.linkToImgUrl){var o=new XMLHttpRequest;o.open("POST",e.options.upload.linkToImgUrl),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE&&200===o.status){var t=JSON.parse(o.responseText);if(0!==t.code)return void alert(t.msg);var i=n.getAttribute("src");e.editor.element.selectionStart=e.editor.element.value.split(i)[0].length,e.editor.element.selectionEnd=e.editor.element.selectionStart+i.length,_(e.editor.element,t.data.url,"",!0)}},o.send(JSON.stringify({url:n.getAttribute("src")}))}return"+")"}}),r.use(g);var s=r.turndown(n);if(i){var l=document.createElement("div");l.innerHTML=n,l.querySelectorAll("pre").length>1?i=!1:"```"===s.substr(0,3)&&"```"===s.substr(s.length-3,3)||(i=!1)}_(e.editor.element,i?"```\n"+o+"\n```":s,"",!0)},t.prototype.bindEvent=function(t){var e,o=this;this.element.addEventListener("input",function(){t.options.counter>0&&t.counter.render(o.element.value.length,t.options.counter),t.options.input&&t.options.input(o.element.value,t.preview&&t.preview.element),t.hint&&t.hint.render(),t.options.cache&&localStorage.setItem("vditor"+t.id,t.editor.element.value),t.preview&&t.preview.render(t)}),this.element.addEventListener("focus",function(){t.options.focus&&t.options.focus(o.element.value),t.toolbar.elements.emoji&&t.toolbar.elements.emoji.children[1]&&(t.toolbar.elements.emoji.children[1].style.display="none"),t.toolbar.elements.headings&&t.toolbar.elements.headings.children[1]&&(t.toolbar.elements.headings.children[1].style.display="none")}),this.element.addEventListener("blur",function(){t.options.blur&&t.options.blur(o.element.value)}),t.options.select&&(this.element.onselect=function(){t.options.select(o.element.value.substring(o.element.selectionStart,o.element.selectionEnd))}),this.element.addEventListener("scroll",function(){if("none"!==t.preview.element.style.display||t.preview){var e=o.element.scrollTop,n=o.element.clientHeight,i=o.element.scrollHeight,r=t.preview.element;r.scrollTop=e/n>.5?(e+n)*r.scrollHeight/i-n:e*r.scrollHeight/i}}),t.options.upload.url&&this.element.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault();var n=e.dataTransfer.items;0!==n.length&&b(t,n)});var i=this.html2md;this.element.addEventListener("paste",function(o){if(o.stopPropagation(),o.preventDefault(),""!==o.clipboardData.getData("text/html").replace(/(^\s*)|(\s*)$/g,"")){var r=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");if(!e)return void n.e(1).then(n.bind(null,26)).then(function(n){e=n.default,i(e,t,r,s)}).catch(function(t){console.log("Failed to load turndown",t)});i(e,t,r,s)}else if(""!==o.clipboardData.getData("text/plain").replace(/(^\s*)|(\s*)$/g,"")&&0===o.clipboardData.files.length)_(o.target,o.clipboardData.getData("text/plain"),"",!0);else if(o.clipboardData.files.length>0){if(!t.options.upload.url)return;b(t,o.clipboardData.files)}})},t}(),_=function(t,e,n,o){if("number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd){var i=t.selectionStart,r=t.selectionEnd,s=t.value;if(t.focus(),/firefox/i.test(navigator.userAgent)||/edge/i.test(navigator.userAgent)||/msie/i.test(navigator.userAgent)||/trident/i.test(navigator.userAgent)){i===r?(t.value=s.substring(0,i)+e+n+s.substring(r,s.length),t.selectionEnd=t.selectionStart=r+e.length):o?(t.value=s.substring(0,i)+e+n+s.substring(r,s.length),t.selectionEnd=i+e.length+n.length):s.substring(i-e.length,i)===e&&s.substring(r,r+n.length)===n?(t.value=s.substring(0,i-e.length)+s.substring(i,r)+s.substring(r+n.length,s.length),t.selectionStart=i-e.length,t.selectionEnd=r-e.length):(t.value=s.substring(0,i)+e+s.substring(i,r)+n+s.substring(r,s.length),t.selectionStart=i+e.length,t.selectionEnd=r+e.length);var l=document.createEvent("HTMLEvents");l.initEvent("input",!0,!1),t.dispatchEvent(l)}else if(i===r)document.execCommand("insertText",!1,e+n),t.selectionStart=t.selectionEnd=t.selectionStart-n.length;else if(o)document.execCommand("insertText",!1,e+n);else if(s.substring(i-e.length,i)===e&&s.substring(r,r+n.length)===n){document.execCommand("delete",!1);for(var a=0,c=e.length;a<c;a++)document.execCommand("delete",!1);for(var p=0,u=n.length;p<u;p++)document.execCommand("forwardDelete",!1);document.execCommand("insertText",!1,s.substring(i,r)),t.selectionStart=i-e.length,t.selectionEnd=r-e.length}else document.execCommand("insertText",!1,e+s.substring(i,r)+n),t.selectionStart=i+e.length,t.selectionEnd=r+e.length}},x=function(){function t(t,e){this.menuItem=e,this.editorElement=t.editor.element,this.element=document.createElement("div");var n=document.createElement("div");n.className="vditor-tooltipped vditor-tooltipped__"+e.tipPosition;var o=this.menuItem.hotkey?" <"+this.menuItem.hotkey+">":"";o=/Mac/.test(navigator.platform)?o.replace("ctrl","⌘"):o.replace("⌘","ctrl"),n.setAttribute("aria-label",this.menuItem.tip||s[t.options.lang][this.menuItem.name]+o),this.element.appendChild(n)}return t.prototype.bindEvent=function(){var t=this;this.element.children[0].addEventListener("click",function(){_(t.editorElement,t.menuItem.prefix||"",t.menuItem.suffix||"")})},t}(),O=(y=function(t,e){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),M=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.element.children[0].innerHTML=n.icon||r.a;var i=document.createElement("div");i.className="vditor-panel";var s="";Object.keys(e.options.hint.emoji).forEach(function(t){var n=e.options.hint.emoji[t];n.indexOf(".")>-1?s+='<span data-value=":'+t+': " title=":'+t+':"><img data-value=":'+t+': " src="'+n+'"/></span>':s+='<span data-value="'+n+' " title="'+t+'">'+n+"</span>"});var l=e.options.hint.emojiTail?'<div class="vditor-emojis__tail">'+e.options.hint.emojiTail+"</div>":"";return i.innerHTML='<div class="vditor-emojis">'+s+"</div>"+l,o.element.appendChild(i),o._bindEvent(i,e),o}return O(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){"block"===t.style.display?t.style.display="none":(t.style.display="block",e.toolbar.elements.headings&&(e.toolbar.elements.headings.children[1].style.display="none"))}),t.querySelectorAll(".vditor-emojis span").forEach(function(n){n.addEventListener("click",function(n){_(e.editor.element,n.target.getAttribute("data-value"),"",!0),t.style.display="none"})})},e}(x),k=n(2),T=n.n(k),L=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),A=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||T.a,o.bindEvent(),o}return L(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),P=n(3),j=n.n(P),z=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),S=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.element.children[0].innerHTML=n.icon||j.a;var i=document.createElement("div");return i.className="vditor-panel",i.innerHTML='<h1 data-value="# ">Heading 1</h1>\n<h2 data-value="## ">Heading 2</h2>\n<h3 data-value="### ">Heading 3</h3>\n<h4 data-value="#### ">Heading 4</h4>\n<h5 data-value="##### ">Heading 5</h5>\n<h6 data-value="###### ">Heading 6</h6>',o.element.appendChild(i),o._bindEvent(i,e),o}return z(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){"block"===t.style.display?t.style.display="none":(t.style.display="block",e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.children[1].style.display="none"))});for(var n=0;n<6;n++)t.children.item(n).addEventListener("click",function(n){_(e.editor.element,n.target.getAttribute("data-value"),""),t.style.display="none"})},e}(x),C=function(){return function(){this.element=document.createElement("div"),this.element.className="vditor-menu__divider"}}(),H=function(){return function(){this.element=document.createElement("div"),this.element.className="vditor-menu__br"}}(),N=n(4),B=n.n(N),F=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),D=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||B.a,o.bindEvent(),o}return F(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),R=n(5),U=n.n(R),I=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),q=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||U.a,o.bindEvent(),o}return I(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),V=n(6),W=n.n(V),X=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),J=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||W.a,o.bindEvent(),o}return X(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),K=n(7),Y=n.n(K),$=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),G=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Y.a,o.bindEvent(),o}return $(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),Q=n(8),Z=n.n(Q),tt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),et=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Z.a,o.bindEvent(),o}return tt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),nt=n(9),ot=n.n(nt),it=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),rt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ot.a,o.bindEvent(),o}return it(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),st=n(10),lt=n.n(st),at=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ct=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||lt.a,o.bindEvent(),o}return at(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),pt=n(11),ut=n.n(pt),dt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ht=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ut.a,o.bindEvent(),o}return dt(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){document.execCommand("undo")})},e}(x),ft=n(12),vt=n.n(ft),mt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),gt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||vt.a,o.bindEvent(),o}return mt(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){document.execCommand("redo")})},e}(x),yt=n(13),wt=n.n(yt),bt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Et=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||wt.a,o.bindEvent(),o}return bt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),_t=n(14),xt=n.n(_t),Ot=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Mt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||xt.a,o.bindEvent(),o}return Ot(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),kt=n(15),Tt=n.n(kt),Lt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),At=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Tt.a,o.bindEvent(),o}return Lt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),Pt=n(16),jt=n.n(Pt),zt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),St=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||jt.a,o.bindEvent(),o}return zt(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){window.open("https://hacpai.com/guide/markdown")})},e}(x),Ct=n(17),Ht=n.n(Ct),Nt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Bt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Ht.a,o.bindEvent(),o}return Nt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(x),Ft=n(18),Dt=n.n(Ft),Rt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ut=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Dt.a,e.options.preview.show&&(o.element.children[0].className="vditor-tooltipped vditor-tooltipped__"+n.tipPosition+" vditor-menu--current"),o._bindEvent(e,n),o}return Rt(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){var n,o=document.getElementById(t.id);"block"===t.preview.element.style.display?(t.preview.element.style.display="none",n="vditor-tooltipped vditor-tooltipped__"+e.tipPosition):(t.preview.element.style.display="block",n="vditor-tooltipped vditor-tooltipped__"+e.tipPosition+" vditor-menu--current",t.preview.render(t)),o.className.indexOf("vditor--fullscreen")>-1&&(n=n.replace("__n","__s")),this.className=n})},e}(x),It=n(0),qt=n.n(It),Vt=n(19),Wt=n.n(Vt),Xt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Jt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||qt.a,o._bindEvent(e,n),o}return Xt(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){var n=document.getElementById(t.id);n.className.indexOf("vditor--fullscreen")>-1?(this.innerHTML=e.icon||qt.a,n.className=n.className.replace(" vditor--fullscreen",""),Object.keys(t.toolbar.elements).forEach(function(e){var n=t.toolbar.elements[e].firstChild;n&&(n.className=n.className.replace("__s","__n"))})):(this.innerHTML=e.icon||Wt.a,n.className=n.className+" vditor--fullscreen",Object.keys(t.toolbar.elements).forEach(function(e){var n=t.toolbar.elements[e].firstChild;n&&(n.className=n.className.replace("__n","__s"))}))})},e}(x),Kt=n(20),Yt=n.n(Kt),$t=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Gt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML="<label>"+(n.icon||Yt.a)+'<input multiple="multiple" type="file"></label>',o._bindEvent(e),o}return $t(e,t),e.prototype._bindEvent=function(t){this.element.querySelector("input").addEventListener("change",function(e){0!==e.target.files.length&&b(t,e.target.files,e.target)})},e}(x),Qt=n(21),Zt=n.n(Qt),te=function(){function t(t){var e;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"undefined"!=typeof AudioContext)e=new AudioContext;else{if(!webkitAudioContext)return;e=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=e.sampleRate;var n=e.createGain();e.createMediaStreamSource(t).connect(n),this.recorder=e.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(e.destination),this.readyFlag=!0}return t.prototype.cloneChannelData=function(t,e){this.leftChannel.push(new Float32Array(t)),this.rightChannel.push(new Float32Array(e)),this.recordingLength+=2048},t.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},t.prototype.stopRecording=function(){this.isRecording=!1},t.prototype.buildWavFileBlob=function(){for(var t=this.mergeBuffers(this.leftChannel),e=this.mergeBuffers(this.rightChannel),n=new Float32Array(t.length),o=0;o<t.length;++o)n[o]=.5*(t[o]+e[o]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(n=this.downsampleBuffer(n,this.SAMPLE_RATE));var i=44+2*n.length,r=new ArrayBuffer(i),s=new DataView(r);this.writeUTFBytes(s,0,"RIFF"),s.setUint32(4,i,!0),this.writeUTFBytes(s,8,"WAVE"),this.writeUTFBytes(s,12,"fmt "),s.setUint32(16,16,!0),s.setUint16(20,1,!0),s.setUint16(22,1,!0),s.setUint32(24,this.SAMPLE_RATE,!0),s.setUint32(28,2*this.SAMPLE_RATE,!0),s.setUint16(32,2,!0),s.setUint16(34,16,!0);var l=2*n.length;this.writeUTFBytes(s,36,"data"),s.setUint32(40,l,!0);for(var a=n.length,c=44,p=0;p<a;p++)s.setInt16(c,32767*n[p],!0),c+=2;return new Blob([s],{type:"audio/wav"})},t.prototype.downsampleBuffer=function(t,e){if(e==this.DEFAULT_SAMPLE_RATE)return t;if(e>this.DEFAULT_SAMPLE_RATE)return t;for(var n=this.DEFAULT_SAMPLE_RATE/e,o=Math.round(t.length/n),i=new Float32Array(o),r=0,s=0;r<i.length;){for(var l=Math.round((r+1)*n),a=0,c=0,p=s;p<l&&p<t.length;p++)a+=t[p],c++;i[r]=a/c,r++,s=l}return i},t.prototype.mergeBuffers=function(t){for(var e=new Float32Array(this.recordingLength),n=0,o=t.length,i=0;i<o;++i){var r=t[i];e.set(r,n),n+=r.length}return e},t.prototype.writeUTFBytes=function(t,e,n){for(var o=n.length,i=0;i<o;i++)t.setUint8(e+i,n.charCodeAt(i))},t}(),ee=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ne=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Zt.a,o._bindEvent(e),o}return ee(e,t),e.prototype._bindEvent=function(t){var e;this.element.children[0].addEventListener("click",function(){if(e)if(e.isRecording){e.stopRecording(),t.upload.element.className="vditor-upload";var n=new File([e.buildWavFileBlob()],"record"+(new Date).getTime()+".wav",{type:"video/webm"});b(t,[n])}else t.upload.element.children[0].innerHTML=s[t.options.lang].recoding,t.upload.element.style.opacity=1,t.upload.element.className="vditor-upload vditor-upload--tip",t.editor.element.setAttribute("disabled","disabled"),e.startRecordingNewWavFile();else navigator.mediaDevices.getUserMedia({audio:!0}).then(function(n){(e=new te(n)).recorder.onaudioprocess=function(t){if(e.isRecording){var n=t.inputBuffer.getChannelData(0),o=t.inputBuffer.getChannelData(1);e.cloneChannelData(n,o)}},e.startRecordingNewWavFile(),t.upload.element.children[0].innerHTML=s[t.options.lang].recoding,t.upload.element.style.opacity=1,t.upload.element.className="vditor-upload vditor-upload--tip",t.editor.element.setAttribute("disabled","disabled")}).catch(function(t){console.log("init media error:",t)})})},e}(x),oe=n(22),ie=n.n(oe),re=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),se=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ie.a,o.bindEvent(),o}return re(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){window.open("https://github.com/b3log/vditor")})},e}(x),le=function(){return function(t){var e=this,n=t.options;this.elements={},n.toolbar.forEach(function(n,o){var i;switch(n.name){case"emoji":i=new M(t,n);break;case"bold":i=new A(t,n);break;case"headings":i=new S(t,n);break;case"|":i=new C;break;case"br":i=new H;break;case"italic":i=new D(t,n);break;case"strike":i=new q(t,n);break;case"line":i=new J(t,n);break;case"quote":i=new G(t,n);break;case"list":i=new et(t,n);break;case"ordered-list":i=new rt(t,n);break;case"check":i=new ct(t,n);break;case"undo":i=new ht(t,n);break;case"redo":i=new gt(t,n);break;case"code":i=new Mt(t,n);break;case"inline-code":i=new Et(t,n);break;case"link":i=new At(t,n);break;case"help":i=new St(t,n);break;case"table":i=new Bt(t,n);break;case"preview":i=new Ut(t,n);break;case"fullscreen":i=new Jt(t,n);break;case"upload":i=new Gt(t,n);break;case"record":i=new ne(t,n);break;case"info":i=new se(t,n);break;default:console.log("menu item no matched")}var r=n.name;"br"!==r&&"|"!==r||(r+=o),e.elements[r]=i.element})}}(),ae=function(){function t(t){this.defaultOptions={cache:!0,height:"auto",width:"auto",placeholder:"",lang:"zh_CN",resize:{enable:!1,position:"bottom"},preview:{delay:1e3,show:!1},hint:{delay:200,emoji:{"+1":"👍","-1":"👎",heart:"❤️",cold_sweat:"😰"}},counter:0,upload:{url:"",max:10485760,linkToImgUrl:"",filename:function(t){return t.replace(/\W/g,"")}},classes:{preview:""},toolbar:[{name:"emoji",hotkey:"⌘-e",tipPosition:"ne"},{name:"headings",hotkey:"⌘-h",tipPosition:"ne"},{name:"bold",prefix:"**",suffix:"**",hotkey:"⌘-b",tipPosition:"ne"},{name:"italic",prefix:"*",suffix:"*",hotkey:"⌘-i",tipPosition:"ne"},{name:"strike",prefix:"~~",suffix:"~~",hotkey:"⌘-s",tipPosition:"ne"},{name:"|"},{name:"line",prefix:"---\n",hotkey:"⌘-d",tipPosition:"n"},{name:"quote",prefix:"> ",hotkey:"⌘-.",tipPosition:"n"},{name:"|"},{name:"list",prefix:"* ",hotkey:"⌘-l",tipPosition:"n"},{name:"ordered-list",prefix:"1. ",hotkey:"⌘-o",tipPosition:"n"},{name:"check",prefix:"* [ ] ",hotkey:"⌘-j",tipPosition:"n"},{name:"|"},{name:"code",prefix:"```\n",suffix:"\n```",hotkey:"⌘-u",tipPosition:"n"},{name:"inline-code",prefix:"`",suffix:"`",hotkey:"⌘-g",tipPosition:"n"},{name:"|"},{name:"undo",hotkey:"⌘-z",tipPosition:"n"},{name:"redo",hotkey:"⌘-y",tipPosition:"n"},{name:"|"},{name:"upload",tipPosition:"n"},{name:"link",prefix:"[",suffix:"](https://)",hotkey:"⌘-k",tipPosition:"n"},{name:"table",prefix:"| col1",suffix:" | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |",hotkey:"⌘-m",tipPosition:"n"},{name:"record",tipPosition:"n"},{name:"|"},{name:"preview",hotkey:"⌘-p",tipPosition:"nw"},{name:"fullscreen",hotkey:"⌘-f",tipPosition:"nw"},{name:"info",tipPosition:"nw"},{name:"help",tipPosition:"nw"},{name:"br"}]},this.options=t}return t.prototype.merge=function(){var t=this,e=[];this.options&&(this.options.toolbar&&this.options.toolbar.forEach(function(n){var o;t.defaultOptions.toolbar.forEach(function(t){"string"==typeof n&&t.name===n&&(o=t),"object"==typeof n&&t.name===n.name&&(o=Object.assign({},t,n))}),e.push(o)}),this.options.upload&&(this.options.upload=Object.assign({},this.defaultOptions.upload,this.options.upload)),this.options.classes&&(this.options.classes=Object.assign({},this.defaultOptions.classes,this.options.classes)),this.options.preview&&(this.options.preview=Object.assign({},this.defaultOptions.preview,this.options.preview)),this.options.hint&&(this.options.hint=Object.assign({},this.defaultOptions.hint,this.options.hint)),this.options.resize&&(this.options.resize=Object.assign({},this.defaultOptions.resize,this.options.resize)));var n=Object.assign({},this.defaultOptions,this.options);return e.length>0&&(n.toolbar=e),n},t}(),ce=function(){return function(t){var e=document.getElementById(t.id);e.className="vditor"+(e.className?" "+e.className:""),"number"==typeof t.options.height&&(e.style.height=t.options.height+"px"),"number"==typeof t.options.width?e.style.width=t.options.width+"px":e.style.width=t.options.width;var n=document.createElement("div");n.className="vditor-toolbar",Object.keys(t.toolbar.elements).forEach(function(e){n.appendChild(t.toolbar.elements[e])}),e.appendChild(n),t.options.resize.enable&&"top"===t.options.resize.position&&e.appendChild(t.resize.element);var o=document.createElement("div");o.className="vditor-content",o.appendChild(t.editor.element),t.preview&&o.appendChild(t.preview.element),t.options.counter>0&&o.appendChild(t.counter.element),t.upload&&o.appendChild(t.upload.element),e.appendChild(o),t.options.resize.enable&&"bottom"===t.options.resize.position&&e.appendChild(t.resize.element),document.onclick=function(t){var e=t.target.closest(".vditor-tooltipped");e&&e.nextSibling&&"vditor-panel"===e.nextSibling.className||(document.querySelectorAll(".vditor-hint").forEach(function(t){t.style.display="none"}),document.querySelectorAll(".vditor-panel").forEach(function(t){t.style.display="none"}))}}}(),pe=function(){function t(t){this.editorElement=t.editor.element,this.toolbarElements=t.toolbar.elements,this.options=t.options,this.hintElement=t.hint.element,this.bindHotkey()}return t.prototype.bindHotkey=function(){var t=this;this.editorElement.addEventListener("keydown",function(e){t.options.esc&&e.key.toLowerCase()==="Escape".toLowerCase()&&t.options.esc(t.editorElement.value),t.options.ctrlEnter&&(e.metaKey||e.ctrlKey)&&"enter"===e.key.toLowerCase()&&t.options.ctrlEnter(t.editorElement.value),t.options.toolbar.forEach(function(n){if(n.hotkey){var o=n.hotkey.split("-");"ctrl"!==o[0]&&"⌘"!==o[0]||!e.metaKey&&!e.ctrlKey||e.key===o[1]&&(t.toolbarElements[n.name].children[0].click(),e.preventDefault(),e.stopPropagation())}}),(t.options.hint.at||t.toolbarElements.emoji)&&t.hint(e)})},t.prototype.hint=function(t){if(0!==this.hintElement.querySelectorAll("li").length&&"none"!==this.hintElement.style.display){var e=this.hintElement.querySelector(".vditor-hint--current");if("arrowdown"===t.key.toLowerCase())t.preventDefault(),t.stopPropagation(),e.nextElementSibling?e.nextElementSibling.className="vditor-hint--current":this.hintElement.children[0].className="vditor-hint--current",e.removeAttribute("class");else if("arrowup"===t.key.toLowerCase()){if(t.preventDefault(),t.stopPropagation(),e.previousElementSibling)e.previousElementSibling.className="vditor-hint--current";else{var n=this.hintElement.children.length;this.hintElement.children[n-1].className="vditor-hint--current"}e.removeAttribute("class")}else if("enter"===t.key.toLowerCase()){t.preventDefault(),t.stopPropagation(),this.hintElement.style.display="none";var o=e.getAttribute("data-value"),i=0===o.indexOf("@")?"@":":";this.editorElement.selectionStart=this.editorElement.value.substr(0,this.editorElement.selectionEnd).lastIndexOf(i),_(this.editorElement,o,"",!0)}}},t}(),ue=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-preview"+(t.options.classes.preview?" "+t.options.classes.preview:""),t.options.preview.show||(this.element.style.display="none"),"none"!==this.element.style.display&&this.render(t)}return t.prototype.render=function(t,e){var n=this;"none"!==this.element.style.display&&(e?this.element.innerHTML=e:""!==t.editor.element.value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")?t.options.preview.url?(clearTimeout(t.mdTimeoutId),t.mdTimeoutId=setTimeout(function(){var e=new XMLHttpRequest;e.open("POST",t.options.preview.url),e.onreadystatechange=function(){if(e.readyState===XMLHttpRequest.DONE&&200===e.status){var o=JSON.parse(e.responseText);if(0!==o.code)return void alert(o.msg);n.element.innerHTML=o.data,t.options.preview.parse&&t.options.preview.parse(n.element)}},e.send(JSON.stringify({markdownText:t.editor.element.value}))},t.options.preview.delay)):this.element.innerHTML=t.editor.element.value:this.element.innerHTML="")},t}(),de=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-counter",this.render(0,t.options.counter)}return t.prototype.render=function(t,e){this.element.className=t>e?"vditor-counter vditor-counter--error":"vditor-counter",this.element.innerHTML=t+"/"+e},t}(),he=n(23),fe=n.n(he),ve=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-resize",this.element.innerHTML=fe.a,this.bindEvent(t)}return t.prototype.bindEvent=function(t){this.element.addEventListener("mousedown",function(e){var n=document,o=document.getElementById(t.id);e||(e=window.event);var i=e.clientY,r=o.offsetHeight;n.ondragstart="return false;",n.onselectstart="return false;",n.onselect="document.selection.empty();",this.setCapture?this.setCapture():window.captureEvents&&window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP),n.onmousemove=function(e){e||(e=window.event),"top"===t.options.resize.position?o.style.height=Math.max(100,r+(i-e.clientY))+"px":o.style.height=Math.max(100,r+(e.clientY-i))+"px"},n.onmouseup=function(){t.options.resize.after&&t.options.resize.after(o.offsetHeight-r),this.releaseCapture?this.releaseCapture():window.captureEvents&&window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP),n.onmousemove=null,n.onmouseup=null,n.ondragstart=null,n.onselectstart=null,n.onselect=null}})},t}(),me=function(t){var e=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n=document.querySelector(".vditor-position");n||((n=document.createElement("div")).className="vditor-position",document.body.appendChild(n));var o=n.style;o.whiteSpace="pre-wrap",o.wordWrap="break-word",o.position="absolute",o.overflow="hidden",o.left="-100%",["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"].forEach(function(t){o[t]=e[t]}),n.textContent=t.value.substring(0,t.selectionEnd);var i=document.createElement("span");return i.textContent=t.value.substring(t.selectionEnd)||".",n.appendChild(i),{top:i.offsetTop-t.scrollTop+parseInt(e.lineHeight),left:i.offsetLeft-t.scrollLeft}},ge=function(){function t(t){this.timeId=-1,this.hintDelay=t.options.hint.delay,this.editorElement=t.editor.element,this.atUser=t.options.hint.at,this.commonEmoji=t.options.hint.emoji,this.element=document.createElement("ul"),this.element.className="vditor-hint",this.editorElement.parentElement.appendChild(this.element)}return t.prototype.render=function(){var t=this,e=this.editorElement.value.substr(0,this.editorElement.selectionStart).split("\n").slice(-1).pop(),o=this.getKey(e,"@"),i=this.getKey(e,":");void 0===o&&void 0===i?(this.element.style.display="none",clearTimeout(this.timeId)):(void 0!==o&&this.atUser&&(clearTimeout(this.timeId),this.timeId=setTimeout(function(){t.genHTML(t.atUser(o),o)},this.hintDelay)),void 0!==i&&n.e(2).then(n.bind(null,27)).then(function(e){var n=""===i?t.commonEmoji:e.allEmoji,o=[];Object.keys(n).forEach(function(t){0===t.indexOf(i.toLowerCase())&&(n[t].indexOf(".")>-1?o.push({value:":"+t+":",html:'<img src="'+n[t]+'" title=":'+t+':"/> :'+t+":"}):o.push({value:n[t],html:n[t]+" "+t}))}),t.genHTML(o,i)}).catch(function(t){console.log("Failed to load emoji",t)}))},t.prototype.getKey=function(t,e){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var n=t.split(e),o=void 0;if(n.length>1)if(2===n.length&&""===n[0])(""===n[1]||""!==n[1].trim())&&-1===n[1].indexOf(" ")&&n[1].length<33&&(o=n[1]);else{var i=n[n.length-2],r=n.slice(-1).pop();" "===i.slice(-1)&&-1===r.indexOf(" ")&&(""===r||""!==r.trim())&&r.length<33&&(o=r)}return o},t.prototype.genHTML=function(t,e){var n=this;if(0!==t.length){var o=me(this.editorElement),i=o.left,r=o.top-4,s="";t.forEach(function(t,n){if(!(n>7)){var o=t.html;if(""!==e){var i=o.lastIndexOf(">")+1,r=o.substr(i),l=r.toLowerCase().indexOf(e.toLowerCase());l>-1&&(r=r.substring(0,l)+"<b>"+r.substring(l,l+e.length)+"</b>"+r.substring(l+e.length),o=o.substr(0,i)+r)}s+='<li data-value="'+t.value+' " class="'+(n||"vditor-hint--current")+'"> '+o+"</li>"}}),this.element.innerHTML=s,this.element.style.top=r+"px",this.element.style.left=i+"px",this.element.style.display="block",this.element.querySelectorAll("li").forEach(function(t){t.addEventListener("click",function(){n.element.style.display="none";var e=t.getAttribute("data-value"),o=0===e.indexOf("@")?"@":":";n.editorElement.selectionStart=n.editorElement.value.substr(0,n.editorElement.selectionEnd).lastIndexOf(o),_(n.editorElement,e,"",!0)})}),r+this.element.offsetHeight-this.editorElement.offsetHeight>window.innerHeight-(this.editorElement.parentElement.offsetHeight+this.editorElement.parentElement.offsetTop-document.documentElement.scrollTop)&&(this.element.style.top=r-this.element.offsetHeight+"px")}else this.element.style.display="none"},t}(),ye=function(){function t(t,e){this.version=o;var n=new ae(e).merge();if(this.vditor={id:t,options:n,mdTimeoutId:-1},n.counter>0){var i=new de(this.vditor);this.vditor.counter=i}var r=new E(this.vditor);if(this.vditor.editor=r,n.resize.enable){var s=new ve(this.vditor);this.vditor.resize=s}var l=new le(this.vditor);if(this.vditor.toolbar=l,l.elements.preview){var a=new ue(this.vditor);this.vditor.preview=a}if(n.upload.url){var c=new w;this.vditor.upload=c}if(new ce(this.vditor),this.vditor.options.atUser||this.vditor.toolbar.elements.emoji){var p=new ge(this.vditor);this.vditor.hint=p}new pe(this.vditor)}return t.prototype.getValue=function(){return this.vditor.editor.element.value},t.prototype.insertValue=function(t){_(this.vditor.editor.element,t,"")},t.prototype.focus=function(){this.vditor.editor.element.focus()},t.prototype.blur=function(){this.vditor.editor.element.blur()},t.prototype.disabled=function(){this.vditor.editor.element.setAttribute("disabled","disabled")},t.prototype.enable=function(){this.vditor.editor.element.removeAttribute("disabled")},t.prototype.setSelection=function(t,e){this.vditor.editor.element.selectionStart=t,this.vditor.editor.element.selectionEnd=e,this.vditor.editor.element.focus()},t.prototype.getSelection=function(){return this.vditor.editor.element.value.substring(this.vditor.editor.element.selectionStart,this.vditor.editor.element.selectionEnd)},t.prototype.setValue=function(t){this.vditor.editor.element.selectionStart=0,this.vditor.editor.element.selectionEnd=this.vditor.editor.element.value.length,_(this.vditor.editor.element,t,"",!0),t||localStorage.removeItem("vditor"+this.vditor.id)},t.prototype.renderPreview=function(t){this.vditor.preview.render(this.vditor,t)},t.prototype.getCursorPosition=function(){return me(this.vditor.editor.element)},t.prototype.deleteValue=function(){_(this.vditor.editor.element,"","",!0)},t.prototype.updateValue=function(t){_(this.vditor.editor.element,t,"",!0)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){localStorage.removeItem("vditor"+this.vditor.id)},t.prototype.disabledCache=function(){this.vditor.options.cache=!1},t.prototype.enableCache=function(){this.vditor.options.cache=!0},t}();e.default=ye}]).default}); |
@@ -1,1 +0,1 @@ | ||
(window.webpackJsonpVditor=window.webpackJsonpVditor||[]).push([[2],{25:function(o,n){}}]); | ||
(window.webpackJsonpVditor=window.webpackJsonpVditor||[]).push([[1],{25:function(e,n){},26:function(e,n,t){"use strict";function r(e,n){return Array(n+1).join(e)}t.r(n);var i=["address","article","aside","audio","blockquote","body","canvas","center","dd","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","isindex","li","main","menu","nav","noframes","noscript","ol","output","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul"];function o(e){return-1!==i.indexOf(e.nodeName.toLowerCase())}var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function l(e){return-1!==a.indexOf(e.nodeName.toLowerCase())}var u=a.join();var c={};function s(e){for(var n in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[n])}function f(e,n,t){for(var r=0;r<e.length;r++){var i=e[r];if(d(i,n,t))return i}}function d(e,n,t){var r=e.filter;if("string"==typeof r){if(r===n.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(n.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof r)throw new TypeError("`filter` needs to be a string, array, or function");if(r.call(e,n,t))return!0}}function p(e){var n=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),n}function h(e,n,t){return e&&e.parentNode===n||t(n)?n.nextSibling||n.parentNode:n.firstChild||n.nextSibling||n.parentNode}c.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},c.lineBreak={filter:"br",replacement:function(e,n,t){return t.br+"\n"}},c.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,n,t){var i=Number(n.nodeName.charAt(1));return"setext"===t.headingStyle&&i<3?"\n\n"+e+"\n"+r(1===i?"=":"-",e.length)+"\n\n":"\n\n"+r("#",i)+" "+e+"\n\n"}},c.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},c.list={filter:["ul","ol"],replacement:function(e,n){var t=n.parentNode;return"LI"===t.nodeName&&t.lastElementChild===n?"\n"+e:"\n\n"+e+"\n\n"}},c.listItem={filter:"li",replacement:function(e,n,t){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var r=t.bulletListMarker+" ",i=n.parentNode;if("OL"===i.nodeName){var o=i.getAttribute("start"),a=Array.prototype.indexOf.call(i.children,n);r=(o?Number(o)+a:a+1)+". "}return r+e+(n.nextSibling&&!/\n$/.test(e)?"\n":"")}},c.indentedCodeBlock={filter:function(e,n){return"indented"===n.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,n,t){return"\n\n "+n.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},c.fencedCodeBlock={filter:function(e,n){return"fenced"===n.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,n,t){var r=((n.firstChild.className||"").match(/language-(\S+)/)||[null,""])[1];return"\n\n"+t.fence+r+"\n"+n.firstChild.textContent+"\n"+t.fence+"\n\n"}},c.horizontalRule={filter:"hr",replacement:function(e,n,t){return"\n\n"+t.hr+"\n\n"}},c.inlineLink={filter:function(e,n){return"inlined"===n.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,n){return"["+e+"]("+n.getAttribute("href")+(n.title?' "'+n.title+'"':"")+")"}},c.referenceLink={filter:function(e,n){return"referenced"===n.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,n,t){var r,i,o=n.getAttribute("href"),a=n.title?' "'+n.title+'"':"";switch(t.linkReferenceStyle){case"collapsed":r="["+e+"][]",i="["+e+"]: "+o+a;break;case"shortcut":r="["+e+"]",i="["+e+"]: "+o+a;break;default:var l=this.references.length+1;r="["+e+"]["+l+"]",i="["+l+"]: "+o+a}return this.references.push(i),r},references:[],append:function(e){var n="";return this.references.length&&(n="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),n}},c.emphasis={filter:["em","i"],replacement:function(e,n,t){return e.trim()?t.emDelimiter+e+t.emDelimiter:""}},c.strong={filter:["strong","b"],replacement:function(e,n,t){return e.trim()?t.strongDelimiter+e+t.strongDelimiter:""}},c.code={filter:function(e){var n=e.previousSibling||e.nextSibling,t="PRE"===e.parentNode.nodeName&&!n;return"CODE"===e.nodeName&&!t},replacement:function(e){if(!e.trim())return"";var n="`",t="",r="",i=e.match(/`+/gm);if(i)for(/^`/.test(e)&&(t=" "),/`$/.test(e)&&(r=" ");-1!==i.indexOf(n);)n+="`";return n+t+e+r+n}},c.image={filter:"img",replacement:function(e,n){var t=n.alt||"",r=n.getAttribute("src")||"",i=n.title||"";return r?"+")":""}},s.prototype={add:function(e,n){this.array.unshift(n)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(n=f(this.array,e,this.options))?n:(n=f(this._keep,e,this.options))?n:(n=f(this._remove,e,this.options))?n:this.defaultRule;var n},forEach:function(e){for(var n=0;n<this.array.length;n++)e(this.array[n],n)}};var m="undefined"!=typeof window?window:{};var g,y,v,k=function(){var e=m.DOMParser,n=!1;try{(new e).parseFromString("","text/html")&&(n=!0)}catch(e){}return n}()?m.DOMParser:(g=function(){},y=t(25).JSDOM,g.prototype.parseFromString=function(e){return new y(e).window.document},g);function b(e){var n;"string"==typeof e?n=(v=v||new k).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):n=e.cloneNode(!0);return function(e){var n=e.element,t=e.isBlock,r=e.isVoid,i=e.isPre||function(e){return"PRE"===e.nodeName};if(n.firstChild&&!i(n)){for(var o=null,a=!1,l=null,u=h(l,n,i);u!==n;){if(3===u.nodeType||4===u.nodeType){var c=u.data.replace(/[ \r\n\t]+/g," ");if(o&&!/ $/.test(o.data)||a||" "!==c[0]||(c=c.substr(1)),!c){u=p(u);continue}u.data=c,o=u}else{if(1!==u.nodeType){u=p(u);continue}t(u)||"BR"===u.nodeName?(o&&(o.data=o.data.replace(/ $/,"")),o=null,a=!1):r(u)&&(o=null,a=!0)}var s=h(l,u,i);l=u,u=s}o&&(o.data=o.data.replace(/ $/,""),o.data||p(o))}}({element:n,isBlock:o,isVoid:l}),n}function w(e){return e.isBlock=o(e),e.isCode="code"===e.nodeName.toLowerCase()||e.parentNode.isCode,e.isBlank=function(e){return-1===["A","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"].indexOf(e.nodeName)&&/^\s*$/i.test(e.textContent)&&!l(e)&&!function(e){return e.querySelector&&e.querySelector(u)}(e)}(e),e.flankingWhitespace=function(e){var n="",t="";if(!e.isBlock){var r=/^[ \r\n\t]/.test(e.textContent),i=/[ \r\n\t]$/.test(e.textContent);r&&!N("left",e)&&(n=" "),i&&!N("right",e)&&(t=" ")}return{leading:n,trailing:t}}(e),e}function N(e,n){var t,r,i;return"left"===e?(t=n.previousSibling,r=/ $/):(t=n.nextSibling,r=/^ /),t&&(3===t.nodeType?i=r.test(t.nodeValue):1!==t.nodeType||o(t)||(i=r.test(t.textContent))),i}var C=Array.prototype.reduce,S=/^\n*/,x=/\n*$/,R=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function A(e){if(!(this instanceof A))return new A(e);var n={rules:c,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",blankReplacement:function(e,n){return n.isBlock?"\n\n":""},keepReplacement:function(e,n){return n.isBlock?"\n\n"+n.outerHTML+"\n\n":n.outerHTML},defaultReplacement:function(e,n){return n.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}return e}({},n,e),this.rules=new s(this.options)}function T(e){var n=this;return C.call(e.childNodes,function(e,t){var r="";return 3===(t=new w(t)).nodeType?r=t.isCode?t.nodeValue:n.escape(t.nodeValue):1===t.nodeType&&(r=function(e){var n=this.rules.forNode(e),t=T.call(this,e),r=e.flankingWhitespace;(r.leading||r.trailing)&&(t=t.trim());return r.leading+n.replacement(t,e,this.options)+r.trailing}.call(n,t)),B(e,r)},"")}function B(e,n){var t,r,i,o=(t=n,r=[e.match(x)[0],t.match(S)[0]].sort(),(i=r[r.length-1]).length<2?i:"\n\n");return(e=e.replace(x,""))+o+(n=n.replace(S,""))}A.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var n=T.call(this,new b(e));return function(e){var n=this;return this.rules.forEach(function(t){"function"==typeof t.append&&(e=B(e,t.append(n.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}.call(this,n)},use:function(e){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.use(e[n]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,n){return this.rules.add(e,n),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return R.reduce(function(e,n){return e.replace(n[0],n[1])},e)}},n.default=A}}]); |
{ | ||
"name": "vditor", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "A markdown editor written in TypeScript", | ||
@@ -9,6 +9,6 @@ "author": " Vanessa <v@b3log.org> (http://vanessa.b3log.org)", | ||
"files": [ | ||
"dist/*" | ||
"dist/*", | ||
"src/*" | ||
], | ||
"dependencies": { | ||
"recordrtc": "^5.5.3", | ||
"turndown": "^5.0.3", | ||
@@ -50,5 +50,5 @@ "turndown-plugin-gfm": "^1.0.2" | ||
"build": "webpack", | ||
"demo": "webpack --config webpack.demo.js", | ||
"dev": "webpack --config webpack.demo.js", | ||
"start": "webpack-dev-server --config webpack.start.js", | ||
"release": "npm run build && cp -r dist deploy/0.1.7" | ||
"release": "npm run build && cp -r dist deploy/0.1.8" | ||
}, | ||
@@ -55,0 +55,0 @@ "keywords": [ |
@@ -5,2 +5,7 @@ <p align="center"> | ||
下一代的 Markdown 编辑器,为未来而构建 | ||
<br><br> | ||
<a title="MIT" target="_blank" href="https://opensource.org/licenses/MIT"><img src="http://img.shields.io/badge/license-MIT-orange.svg?style=flat-square"></a> | ||
<a title="Code Size" target="_blank" href="https://github.com/b3log/vditor"><img src="https://img.shields.io/github/languages/code-size/b3log/vditor.svg?style=flat-square"></a> | ||
<a title="Version" target="_blank" href="https://www.npmjs.com/package/vditor"><img src="https://img.shields.io/npm/v/vditor.svg?style=flat-square"></a> | ||
<a title="Downloads" target="_blank" href="https://www.npmjs.com/package/vditor"><img src="https://img.shields.io/npm/dt/vditor.svg?style=flat-square"></a> | ||
</p> | ||
@@ -31,19 +36,24 @@ | ||
* 插入原生 Emoji、可设置常用表情列表 | ||
* Markdown 语法排版、支持工具栏按钮、快捷键 | ||
* 上传图片、文件,实时进度显示 | ||
* 插入原生 Emoji、设置常用表情列表 | ||
* 自定义工具栏按钮、提示、插入文案及快捷键 | ||
* 可使用拖拽、剪切板粘贴上传,显示实时上传进度 | ||
* 支持 CORS 跨域上传 | ||
* 内容保存本地存储,防止意外丢失 | ||
* 录音支持,用户可直接发布语音 | ||
* 粘贴 HTML 自动转换为 Markdown | ||
* 全屏、分屏实时预览、滚动同步定位 | ||
* 提供实时预览、滚动同步定位 | ||
* 支持主窗口大小拖拽、字符计数 | ||
* 多主题支持、内置黑白两套 | ||
* 多语言支持、内置中英文 | ||
* 支持主流浏览器、支持移动端 | ||
* 支持主流浏览器和移动端 | ||
 | ||
 | ||
 | ||
## 案例 | ||
* [Sym](https://github.com/b3log/symphony):一款用 Java 实现的现代化社区(论坛/BBS/社交网络/博客)平台 | ||
* [Solo](https://github.com/b3log/solo):一款小而美的 Java 博客系统 | ||
* [Pipe](https://github.com/b3log/pipe):一款小而美的 Go 博客平台 | ||
* [Solo](https://github.com/b3log/solo):一款小而美的博客系统,使用 Java 实现 | ||
* [Pipe](https://github.com/b3log/pipe):一款小而美的博客平台,使用 Go 实现 | ||
@@ -53,3 +63,3 @@ ## 文档 | ||
* [《提问的智慧》精读注解版](https://hacpai.com/article/1536377163156) | ||
* Vditor 使用指南 TBD | ||
* [Vditor 使用指南](https://hacpai.com/article/1549638745630?r=Vanessa) | ||
@@ -69,3 +79,2 @@ ## 授权 | ||
* [TypeScript](https://github.com/Microsoft/TypeScript):类型化的 JavaScript 超集 | ||
* [Turndown](https://github.com/domchristie/turndown):HTML 到 Markdown 的转换器 | ||
* [RecordRTC](https://github.com/muaz-khan/RecordRTC):多媒体录制库 | ||
* [Turndown](https://github.com/domchristie/turndown):HTML 到 Markdown 的转换器 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
248168
2
85
2925
76
- Removedrecordrtc@^5.5.3
- Removedrecordrtc@5.6.2(transitive)