@wangeditor-next/editor 5.6.23 → 5.6.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ function e(e){return"[object Object]"===Object.prototype.toString.call(e)}return
|
|
|
16
16
|
* @param {string} phrase that needs interpolation, with placeholders
|
|
17
17
|
* @param {object} options with values that will be used to replace placeholders
|
|
18
18
|
* @returns {any[]} interpolated
|
|
19
|
-
*/function i(e,t){const n=/\$/g;let r=[e];if(null==t)return r;for(const e of Object.keys(t))if("_"!==e){let i=t[e];"string"==typeof i&&(i=n[Symbol.replace](i,"$$$$")),r=o(r,new RegExp(`%\\{${e}\\}`,"g"),i)}return r}var a=n("apply");function s(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}return Ub=class{constructor(t){Object.defineProperty(this,a,{value:s}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(t)?t.forEach(e(this,a)[a],this):e(this,a)[a](t)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!r(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return i(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return i(n,t)}},Ub}function mE(){return Wb||(Wb=1,Gb=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,o,i,a,s){var u=function(e){var n=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(t),a=0,s=i.length;for(;a<s;a++){var u=i[a];if("*"===u&&(n=n.concat(t[u])),2===o.length&&o[0]===u){n=n.concat(t[u]);break}}return n}(e);u.length&&function(e,t,n){var r=0,o=t.length;for(;r<o&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,u,[n,r,o,i,a,s])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,(function r(){n.apply(this,arguments),e.off(t,r)}))},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],o=0,i=r?r.length:0;o<i;o++)r[o]!==t&&n.push(r[o]);n.length?this._fns[e]=n:delete this._fns[e]},e}),Gb}function yE(){if(Kb)return qb;Kb=1;var e=0;function t(t){return"__private_"+e+++"_"+t}var n=t("publish");class r{constructor(){Object.defineProperty(this,n,{value:o}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},r={...this.state,...e};this.state=r,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,n)[n](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach((e=>{e(...t)}))}return r.VERSION="2.1.1",qb=function(){return new r}}function bE(){if(Xb)return Yb;return Xb=1,Yb=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}}function EE(){return Jb?Zb:(Jb=1,Zb={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"})}function CE(){if(cE)return lE;cE=1;var e=Pb(),t=Fb(),n=hE();let r,o;function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var a=0;function s(e){return"__private_"+a+++"_"+e}const u=vE(),l=mE(),c=Oy(),d=yE(),f=function(){if(eE)return Qb;eE=1;const e=bE(),t=EE();return Qb=function(n){var r;if(n.type)return n.type;const o=n.name?null==(r=e(n.name).extension)?void 0:r.toLowerCase():null;return o&&o in t?t[o]:"application/octet-stream"}}(),p=bE(),h=function(){if(nE)return tE;function e(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}return nE=1,tE=function(t){let n="uppy";return"string"==typeof t.name&&(n+=`-${e(t.name.toLowerCase())}`),void 0!==t.type&&(n+=`-${t.type}`),t.meta&&"string"==typeof t.meta.relativePath&&(n+=`-${e(t.meta.relativePath.toLowerCase())}`),void 0!==t.data.size&&(n+=`-${t.data.size}`),void 0!==t.data.lastModified&&(n+=`-${t.data.lastModified}`),n}}(),g=(oE||(oE=1,rE=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[r,o]=n.split(".");return r=parseInt(r,10),o=parseInt(o,10),r<15||15===r&&o<15063||r>18||18===r&&o>=18218}),rE),v=aE?iE:(aE=1,iE=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}),m=uE?sE:(uE=1,sE={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}});var y=s("plugins"),b=s("restricter"),E=s("storeUnsubscribe"),C=s("emitter"),D=s("preProcessors"),w=s("uploaders"),A=s("postProcessors"),S=s("informAndEmit"),x=s("checkRequiredMetaFieldsOnFile"),O=s("checkRequiredMetaFields"),T=s("assertNewUploadAllowed"),N=s("checkAndCreateFileStateObject"),B=s("startIfAutoProceed"),k=s("addListeners"),F=s("updateOnlineStatus"),P=s("createUpload"),I=s("getUpload"),R=s("removeUpload"),L=s("runUpload");r=Symbol.for("uppy test: getPlugins"),o=Symbol.for("uppy test: createUpload");class _{constructor(e){Object.defineProperty(this,L,{value:K}),Object.defineProperty(this,R,{value:q}),Object.defineProperty(this,I,{value:W}),Object.defineProperty(this,P,{value:G}),Object.defineProperty(this,k,{value:V}),Object.defineProperty(this,B,{value:U}),Object.defineProperty(this,N,{value:$}),Object.defineProperty(this,T,{value:z}),Object.defineProperty(this,O,{value:H}),Object.defineProperty(this,x,{value:j}),Object.defineProperty(this,S,{value:M}),Object.defineProperty(this,y,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,b,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:l()}),Object.defineProperty(this,D,{writable:!0,value:new Set}),Object.defineProperty(this,w,{writable:!0,value:new Set}),Object.defineProperty(this,A,{writable:!0,value:new Set}),Object.defineProperty(this,F,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=m;const r={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:n.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:d(),logger:t.justErrorsLogger,infoTimeout:5e3};this.opts={...r,...e,restrictions:{...r.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=t.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=c(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:g(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),i(this,b)[b]=new n.Restricter((()=>this.opts),this.i18n),i(this,E)[E]=this.store.subscribe(((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),i(this,k)[k]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i(this,C)[C].emit(e,...n)}on(e,t){return i(this,C)[C].on(e,t),this}once(e,t){return i(this,C)[C].once(e,t),this}off(e,t){return i(this,C)[C].off(e,t),this}updateAll(e){this.iteratePlugins((t=>{t.update(e)}))}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new u([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((e=>{e.setOptions()})),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach((r=>{const o={...t[r]};o.progress={...o.progress,...e},n[r]=o})),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){i(this,D)[D].add(e)}removePreProcessor(e){return i(this,D)[D].delete(e)}addPostProcessor(e){i(this,A)[A].add(e)}removePostProcessor(e){return i(this,A)[A].delete(e)}addUploader(e){i(this,w)[w].add(e)}removeUploader(e){return i(this,w)[w].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach((t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const r={...n[e].meta,...t};n[e]={...n[e],meta:r},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=r.filter((e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted})),i=r.filter((e=>!e.progress.uploadStarted)),a=r.filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess)),s=r.filter((e=>e.progress.uploadStarted)),u=r.filter((e=>e.isPaused)),l=r.filter((e=>e.progress.uploadComplete)),c=r.filter((e=>e.error)),d=o.filter((e=>!e.isPaused)),f=r.filter((e=>e.progress.preprocess||e.progress.postprocess));return{newFiles:i,startedFiles:a,uploadStartedFiles:s,pausedFiles:u,completeFiles:l,erroredFiles:c,inProgressFiles:o,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:s.length>0,isAllComplete:100===t&&l.length===r.length&&0===f.length,isAllErrored:!!n&&c.length===r.length,isAllPaused:0!==o.length&&u.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some((e=>e.isGhost))}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return i(this,b)[b].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){i(this,T)[T](e);const{files:t}=this.getState();let n=i(this,N)[N](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),i(this,B)[B](),n.id}addFiles(e){i(this,T)[T]();const t={...this.getState().files},n=[],r=[];for(let o=0;o<e.length;o++)try{let r=i(this,N)[N](t,e[o]);t[r.id]&&t[r.id].isGhost&&(r={...t[r.id],data:e[o].data,isGhost:!1},this.log(`Replaced blob in a ghost file: ${r.name}, ${r.id}`)),t[r.id]=r,n.push(r)}catch(e){e.isRestriction||r.push(e)}if(this.setState({files:t}),n.forEach((e=>{this.emit("file-added",e)})),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach((e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)})),n.length>0&&i(this,B)[B](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}}removeFiles(e,t){const{files:n,currentUploads:r}=this.getState(),o={...n},i={...r},a=Object.create(null);function s(e){return void 0===a[e]}e.forEach((e=>{n[e]&&(a[e]=n[e],delete o[e])})),Object.keys(i).forEach((e=>{const t=r[e].fileIDs.filter(s);if(0===t.length)return void delete i[e];const{capabilities:n}=this.getState();if(t.length!==r[e].fileIDs.length&&!n.individualCancellation)throw new Error("individualCancellation is disabled");i[e]={...r[e],fileIDs:t}}));const u={currentUploads:i,files:o};0===Object.keys(o).length&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),this.calculateTotalProgress();const l=Object.keys(a);l.forEach((e=>{this.emit("file-removed",a[e],t)})),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!0};e[t]=n})),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>e[t].error));if(t.forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=i(this,P)[P](t,{forceAllowNewUpload:!0});return i(this,L)[L](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=i(this,P)[P]([e],{forceAllowNewUpload:!0});return i(this,L)[L](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins((e=>{e.provider&&e.provider.logout&&e.provider.logout()}))}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess));if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter((e=>null!=e.progress.bytesTotal)),n=e.filter((e=>null==e.progress.bytesTotal));if(0===t.length){const t=100*e.length,r=n.reduce(((e,t)=>e+t.progress.percentage),0),o=Math.round(r/t*100);return void this.setState({totalProgress:o})}let r=t.reduce(((e,t)=>e+t.progress.bytesTotal),0);const o=r/t.length;r+=o*n.length;let i=0;t.forEach((e=>{i+=e.progress.bytesUploaded})),n.forEach((e=>{i+=o*(e.progress.percentage||0)/100}));let a=0===r?0:Math.round(i/r*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`)}const n=new e(this,t),r=n.id;if(!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(r);if(o){const e=`Already found a plugin named '${o.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in i(this,y)[y]?i(this,y)[y][n.type].push(n):i(this,y)[y][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(i(this,y)[y])){const n=t.find((t=>t.id===e));if(null!=n)return n}}[r](e){return i(this,y)[y][e]}iteratePlugins(e){Object.values(i(this,y)[y]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=i(this,y)[y][e.type],n=t.findIndex((t=>t.id===e.id));-1!==n&&t.splice(n,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),i(this,E)[E](),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",i(this,F)[F]),window.removeEventListener("offline",i(this,F)[F]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout((()=>this.hideInfo()),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?i(this,L)[L](e):(i(this,R)[R](e),Promise.reject(new Error("Nonexistent upload")))}[o](){return i(this,P)[P](...arguments)}addResultData(e,t){if(!i(this,I)[I](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),r={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:r}})}upload(){var e;null!=(e=i(this,y)[y].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const r=this.opts.onBeforeUpload(t);return!1===r?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&"object"==typeof r&&(t=r,this.setState({files:t})),Promise.resolve().then((()=>i(this,b)[b].validateMinNumberOfFiles(t))).catch((e=>{throw i(this,S)[S](e),e})).then((()=>{if(!i(this,O)[O](t))throw new n.RestrictionError(this.i18n("missingRequiredMetaField"))})).catch((e=>{throw e})).then((()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap((e=>e.fileIDs)),r=[];Object.keys(t).forEach((e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||r.push(t.id)}));const o=i(this,P)[P](r);return i(this,L)[L](o)})).catch((e=>{throw this.emit("error",e),this.log(e,"error"),e})))}}function M(e,t){const{message:n,details:r=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:r},"error",this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),"error")}function j(e){const{missingFields:t,error:n}=i(this,b)[b].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),!1)}function H(e){let t=!0;for(const n of Object.values(e))i(this,x)[x](n)||(t=!1);return t}function z(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new n.RestrictionError(this.i18n("noMoreFilesAllowed"));throw i(this,S)[S](t,e),t}}function $(e,t){const r=f(t),o=v(r,t),a=p(o).extension,s=Boolean(t.isRemote),u=h({...t,type:r});if(this.checkIfFileAlreadyExists(u)){const e=new n.RestrictionError(this.i18n("noDuplicates",{fileName:o}));throw i(this,S)[S](e,t),e}const l=t.meta||{};l.name=o,l.type=r;const c=Number.isFinite(t.data.size)?t.data.size:null;let d={source:t.source||"",id:u,name:o,extension:a||"",meta:{...this.getState().meta,...l},type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:c,uploadComplete:!1,uploadStarted:null},size:c,isRemote:s,remote:t.remote||"",preview:t.preview};const g=this.opts.onBeforeFileAdded(d,e);if(!1===g){const e=new n.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof g&&null!==g&&(d=g);try{const t=Object.keys(e).map((t=>e[t]));i(this,b)[b].validate(d,t)}catch(e){throw i(this,S)[S](e,d),e}return d}function U(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((()=>{this.scheduledAutoProceed=null,this.upload().catch((e=>{e.isRestriction||this.log(e.stack||e.message||e)}))}),4))}function V(){const e=(e,t,n)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on("error",e),this.on("upload-error",((t,n,r)=>{if(e(n,t,r),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),i(this,S)[S](e)}else i(this,S)[S](n)})),this.on("upload",(()=>{this.setState({error:null})})),this.on("upload-started",(e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("upload-progress",this.calculateProgress),this.on("upload-success",((e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:i(this,A)[A].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()})),this.on("preprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("preprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})})),this.on("postprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("postprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})})),this.on("restored",(()=>{this.calculateTotalProgress()})),this.on("dashboard:file-edit-complete",(e=>{e&&i(this,x)[x](e)})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",i(this,F)[F]),window.addEventListener("offline",i(this,F)[F]),setTimeout(i(this,F)[F],3e3))}function G(t,n){void 0===n&&(n={});const{forceAllowNewUpload:r=!1}=n,{allowNewUpload:o,currentUploads:i}=this.getState();if(!o&&!r)throw new Error("Cannot create a new upload: already uploading.");const a=(0,e.nanoid)();return this.emit("upload",{id:a,fileIDs:t}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...i,[a]:{fileIDs:t,step:0,result:{}}}}),a}function W(e){const{currentUploads:t}=this.getState();return t[e]}function q(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function K(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,o=[...i(this,D)[D],...i(this,w)[w],...i(this,A)[A]];try{for(let i=r;i<o.length&&n;i++){const r=o[i],a={...n,step:i};this.setState({currentUploads:{...t,[e]:a}}),await r(a.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw i(this,R)[R](e),t}if(n){n.fileIDs.forEach((e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)}));const r=n.fileIDs.map((e=>this.getFile(e))),o=r.filter((e=>!e.error)),i=r.filter((e=>e.error));await this.addResultData(e,{successful:o,failed:i,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let a;return n&&(a=n.result,this.emit("complete",a),i(this,R)[R](e)),null==a&&this.log(`Not setting result for an upload that has been removed: ${e}`),a}return _.VERSION="2.3.4",lE=_}var DE,wE,AE,SE,xE,OE,TE,NE,BE={},kE=[],FE=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function PE(e,t){for(var n in t)e[n]=t[n];return e}function IE(e){var t=e.parentNode;t&&t.removeChild(e)}function RE(e,t,n){var r,o,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?DE.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return LE(e,a,r,o,null)}function LE(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++AE:o};return null==o&&null!=wE.vnode&&wE.vnode(i),i}function _E(e){return e.children}function ME(e,t){this.props=e,this.context=t}function jE(e,t){if(null==t)return e.__?jE(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?jE(e):null}function HE(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return HE(e)}}function zE(e){(!e.__d&&(e.__d=!0)&&xE.push(e)&&!$E.__r++||TE!==wE.debounceRendering)&&((TE=wE.debounceRendering)||OE)($E)}function $E(){for(var e;$E.__r=xE.length;)e=xE.sort((function(e,t){return e.__v.__b-t.__v.__b})),xE=[],e.some((function(e){var t,n,r,o,i,a;e.__d&&(i=(o=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=PE({},o)).__v=o.__v+1,XE(a,o,r,t.__n,void 0!==a.ownerSVGElement,null!=o.__h?[i]:null,n,null==i?jE(o):i,o.__h),ZE(n,o),o.__e!=i&&HE(o)))}))}function UE(e,t,n,r,o,i,a,s,u,l){var c,d,f,p,h,g,v,m=r&&r.__k||kE,y=m.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(p=n.__k[c]=null==(p=t[c])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?LE(null,p,null,null,p):Array.isArray(p)?LE(_E,{children:p},null,null,null):p.__b>0?LE(p.type,p.props,p.key,null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(f=m[c])||f&&p.key==f.key&&p.type===f.type)m[c]=void 0;else for(d=0;d<y;d++){if((f=m[d])&&p.key==f.key&&p.type===f.type){m[d]=void 0;break}f=null}XE(e,p,f=f||BE,o,i,a,s,u,l),h=p.__e,(d=p.ref)&&f.ref!=d&&(v||(v=[]),f.ref&&v.push(f.ref,null,p),v.push(d,p.__c||h,p)),null!=h?(null==g&&(g=h),"function"==typeof p.type&&p.__k===f.__k?p.__d=u=VE(p,u,e):u=GE(e,p,f,m,h,u),"function"==typeof n.type&&(n.__d=u)):u&&f.__e==u&&u.parentNode!=e&&(u=jE(f))}for(n.__e=g,c=y;c--;)null!=m[c]&&("function"==typeof n.type&&null!=m[c].__e&&m[c].__e==n.__d&&(n.__d=jE(r,c+1)),eC(m[c],m[c]));if(v)for(c=0;c<v.length;c++)QE(v[c],v[++c],v[++c])}function VE(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t="function"==typeof r.type?VE(r,t,n):GE(n,r,r,o,r.__e,t));return t}function GE(e,t,n,r,o,i){var a,s,u;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),a=null;else{for(s=i,u=0;(s=s.nextSibling)&&u<r.length;u+=2)if(s==o)break e;e.insertBefore(o,i),a=i}return void 0!==a?a:o.nextSibling}function WE(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||FE.test(t)?n:n+"px"}function qE(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||WE(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||WE(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?YE:KE,i):e.removeEventListener(t,i?YE:KE,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function KE(e){this.l[e.type+!1](wE.event?wE.event(e):e)}function YE(e){this.l[e.type+!0](wE.event?wE.event(e):e)}function XE(e,t,n,r,o,i,a,s,u){var l,c,d,f,p,h,g,v,m,y,b,E=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(u=n.__h,s=t.__e=n.__e,t.__h=null,i=[s]),(l=wE.__b)&&l(t);try{e:if("function"==typeof E){if(v=t.props,m=(l=E.contextType)&&r[l.__c],y=l?m?m.props.value:l.__:r,n.__c?g=(c=t.__c=n.__c).__=c.__E:("prototype"in E&&E.prototype.render?t.__c=c=new E(v,y):(t.__c=c=new ME(v,y),c.constructor=E,c.render=tC),m&&m.sub(c),c.props=v,c.state||(c.state={}),c.context=y,c.__n=r,d=c.__d=!0,c.__h=[]),null==c.__s&&(c.__s=c.state),null!=E.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=PE({},c.__s)),PE(c.__s,E.getDerivedStateFromProps(v,c.__s))),f=c.props,p=c.state,d)null==E.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==E.getDerivedStateFromProps&&v!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(v,y),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(v,c.__s,y)||t.__v===n.__v){c.props=v,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),c.__h.length&&a.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(v,c.__s,y),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,h)}))}c.context=y,c.props=v,c.state=c.__s,(l=wE.__r)&&l(t),c.__d=!1,c.__v=t,c.__P=e,l=c.render(c.props,c.state,c.context),c.state=c.__s,null!=c.getChildContext&&(r=PE(PE({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(h=c.getSnapshotBeforeUpdate(f,p)),b=null!=l&&l.type===_E&&null==l.key?l.props.children:l,UE(e,Array.isArray(b)?b:[b],t,n,r,o,i,a,s,u),c.base=t.__e,t.__h=null,c.__h.length&&a.push(c),g&&(c.__E=c.__=null),c.__e=!1}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=JE(n.__e,t,n,r,o,i,a,u);(l=wE.diffed)&&l(t)}catch(e){t.__v=null,(u||null!=i)&&(t.__e=s,t.__h=!!u,i[i.indexOf(s)]=null),wE.__e(e,t,n)}}function ZE(e,t){wE.__c&&wE.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){wE.__e(e,t.__v)}}))}function JE(e,t,n,r,o,i,a,s){var u,l,c,d=n.props,f=t.props,p=t.type,h=0;if("svg"===p&&(o=!0),null!=i)for(;h<i.length;h++)if((u=i[h])&&"setAttribute"in u==!!p&&(p?u.localName===p:3===u.nodeType)){e=u,i[h]=null;break}if(null==e){if(null===p)return document.createTextNode(f);e=o?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,f.is&&f),i=null,s=!1}if(null===p)d===f||s&&e.data===f||(e.data=f);else{if(i=i&&DE.call(e.childNodes),l=(d=n.props||BE).dangerouslySetInnerHTML,c=f.dangerouslySetInnerHTML,!s){if(null!=i)for(d={},h=0;h<e.attributes.length;h++)d[e.attributes[h].name]=e.attributes[h].value;(c||l)&&(c&&(l&&c.__html==l.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(function(e,t,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in t||qE(e,i,null,n[i],r);for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||qE(e,i,t[i],n[i],r)}(e,f,d,o,s),c)t.__k=[];else if(h=t.props.children,UE(e,Array.isArray(h)?h:[h],t,n,r,o&&"foreignObject"!==p,i,a,i?i[0]:n.__k&&jE(n,0),s),null!=i)for(h=i.length;h--;)null!=i[h]&&IE(i[h]);s||("value"in f&&void 0!==(h=f.value)&&(h!==d.value||h!==e.value||"progress"===p&&!h)&&qE(e,"value",h,d.value,!1),"checked"in f&&void 0!==(h=f.checked)&&h!==e.checked&&qE(e,"checked",h,d.checked,!1))}return e}function QE(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){wE.__e(e,n)}}function eC(e,t,n){var r,o;if(wE.unmount&&wE.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||QE(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){wE.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&eC(r[o],t,"function"!=typeof e.type);n||null==e.__e||IE(e.__e),e.__e=e.__d=void 0}function tC(e,t,n){return this.constructor(e,n)}function nC(e,t,n){var r,o,i;wE.__&&wE.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],XE(t,e=(!r&&n||t).__k=RE(_E,null,[e]),o||BE,BE,void 0!==t.ownerSVGElement,!r&&n?[n]:o?null:t.firstChild?DE.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r),ZE(i,e)}DE=kE.slice,wE={__e:function(e,t){for(var n,r,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},AE=0,SE=function(e){return null!=e&&void 0===e.constructor},ME.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=PE({},this.state),"function"==typeof e&&(e=e(PE({},n),this.props)),e&&PE(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),zE(this))},ME.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),zE(this))},ME.prototype.render=_E,xE=[],OE="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,$E.__r=0,NE=0;var rC,oC,iC,aC,sC,uC,lC,cC,dC,fC,pC,hC=Object.freeze({__proto__:null,Component:ME,Fragment:_E,cloneElement:function(e,t,n){var r,o,i,a=PE({},e.props);for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];return arguments.length>2&&(a.children=arguments.length>3?DE.call(arguments,2):n),LE(e.type,a,r||e.key,o||e.ref,null)},createContext:function(e,t){var n={__c:t="__cC"+NE++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(zE)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},createElement:RE,createRef:function(){return{current:null}},h:RE,hydrate:function e(t,n){nC(t,n,e)},get isValidElement(){return SE},get options(){return wE},render:nC,toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n}}),gC=C(hC);function vC(){if(aC)return iC;aC=1;const e=oC?rC:(oC=1,rC=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE});return iC=function(t,n){return void 0===n&&(n=document),"string"==typeof t?n.querySelector(t):e(t)?t:null}}function mC(){if(cC)return lC;cC=1;const e=vE();return lC=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const t=new e([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}}}function yC(){if(fC)return dC;fC=1;var e=gC;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var n=0;function r(e){return"__private_"+n+++"_"+e}const o=vC(),i=uC?sC:(uC=1,sC=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir}),a=mC();var s=r("updateUI");class u extends a{constructor(){super(...arguments),Object.defineProperty(this,s,{writable:!0,value:void 0})}mount(n,r){const a=r.id,l=o(n);if(l){this.isTargetDOMEl=!0;const r=document.createElement("div");return r.classList.add("uppy-Root"),t(this,s)[s]=function(e){let t=null,n=null;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=o,t||(t=Promise.resolve().then((()=>(t=null,e(...n))))),t}}((t=>{this.uppy.getPlugin(this.id)&&((0,e.render)(this.render(t),r),this.afterUpdate())})),this.uppy.log(`Installing ${a} to a DOM element '${n}'`),this.opts.replaceTargetContent&&(l.innerHTML=""),(0,e.render)(this.render(this.uppy.getState()),r),this.el=r,l.appendChild(r),r.dir=this.opts.direction||i(r)||"ltr",this.onMount(),this.el}let c;if("object"==typeof n&&n instanceof u)c=n;else if("function"==typeof n){const e=n;this.uppy.iteratePlugins((t=>{t instanceof e&&(c=t)}))}if(c)return this.uppy.log(`Installing ${a} to ${c.id}`),this.parent=c,this.el=c.addTarget(r),this.onMount(),this.el;this.uppy.log(`Not installing ${a}`);let d=`Invalid target option given to ${a}.`;throw d+="function"==typeof n?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(d)}update(e){var n,r;null!=this.el&&(null==(n=(r=t(this,s))[s])||n.call(r,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}return dC=u}var bC,EC,CC=(pC||(pC=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Uppy=t.UIPlugin=t.BasePlugin=void 0,Object.defineProperty(t,"debugLogger",{enumerable:!0,get:function(){return n.debugLogger}});var n=Fb();e.exports=CE();const r=yC();t.UIPlugin=r;const o=mC();t.BasePlugin=o;const i=CE();t.Uppy=i;const a=yC(),s=mC();i.Uppy=i,i.UIPlugin=a,i.BasePlugin=s,i.debugLogger=n.debugLogger}(Bb,Bb.exports)),Bb.exports),DC=E(CC);function wC(){if(EC)return bC;EC=1;return bC={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t)=>()=>{let n="",r=t;for(;r--;)n+=e[Math.random()*e.length|0];return n}},bC}var AC,SC,xC,OC,TC,NC,BC,kC,FC,PC,IC={};function RC(){if(SC)return AC;SC=1;class e extends Error{constructor(e,t){void 0===t&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}return AC=e}function LC(){if(PC)return FC;let e;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}PC=1;var n=0;function r(e){return"__private_"+n+++"_"+e}const o=function(){if(OC)return xC;OC=1;const e=RC();return xC=function(){return fetch(...arguments).catch((t=>{throw"AbortError"===t.name?t:new e(t)}))},xC}(),i=function(){if(NC)return TC;NC=1;const e=gE();class t extends Error{constructor(t,n){void 0===n&&(n={}),super(t),this.cause=n.cause,this.cause&&e(this.cause,"isNetworkError")&&(this.isNetworkError=this.cause.isNetworkError)}}return TC=t}(),a=function(){if(kC)return BC;kC=1;class e extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}return BC=e}();async function s(e){if(401===e.status)throw new a;const t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{const e=await t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw new Error(n)}}return t}var u=r("companionHeaders"),l=r("getPostResponseFunc"),c=r("getUrl"),d=r("errorHandler");e=Symbol.for("uppy test: getCompanionHeaders");class f{constructor(e,n){Object.defineProperty(this,d,{value:h}),Object.defineProperty(this,c,{value:p}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=n,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1,t(this,u)[u]=null==n?void 0:n.companionHeaders}setCompanionHeaders(e){t(this,u)[u]=e}[e](){return t(this,u)[u]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}headers(){return Promise.resolve({...f.defaultHeaders,...t(this,u)[u]})}onReceiveResponse(e){const t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:r}=e;return r.has("i-am")&&r.get("i-am")!==t[n]&&this.uppy.setState({companion:{...t,[n]:r.get("i-am")}}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(t(this,c)[c](e),{method:"OPTIONS"}).then((e=>(e.headers.has("access-control-allow-headers")&&(this.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map((e=>e.trim().toLowerCase()))),this.preflightDone=!0,this.allowedHeaders.slice()))).catch((e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,"warning"),this.preflightDone=!0,this.allowedHeaders.slice())))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then((e=>{let[t,n]=e;return Object.keys(n).forEach((e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])})),n}))}get(e,n){return this.preflightAndHeaders(e).then((n=>o(t(this,c)[c](e),{method:"get",headers:n,credentials:this.opts.companionCookiesRule||"same-origin"}))).then(t(this,l)[l](n)).then(s).catch(t(this,d)[d]("get",e))}post(e,n,r){const i="post";return this.preflightAndHeaders(e).then((r=>o(t(this,c)[c](e),{method:i,headers:r,credentials:this.opts.companionCookiesRule||"same-origin",body:JSON.stringify(n)}))).then(t(this,l)[l](r)).then(s).catch(t(this,d)[d](i,e))}delete(e,n,r){const i="delete";return this.preflightAndHeaders(e).then((t=>o(`${this.hostname}/${e}`,{method:i,headers:t,credentials:this.opts.companionCookiesRule||"same-origin",body:n?JSON.stringify(n):null}))).then(t(this,l)[l](r)).then(s).catch(t(this,d)[d](i,e))}}function p(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function h(e,n){return r=>{var o;return null!=(o=r)&&o.isAuthError||(r=new i(`Could not ${e} ${t(this,c)[c](n)}`,{cause:r})),Promise.reject(r)}}return f.VERSION="2.2.2",f.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Uppy-Versions":`@uppy/companion-client=${f.VERSION}`},FC=f}var _C,MC,jC,HC,zC,$C,UC,VC,GC={};function WC(){if(_C)return GC;return _C=1,Object.defineProperty(GC,"__esModule",{value:!0}),GC.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},GC.removeItem=function(e){return new Promise((t=>{localStorage.removeItem(e),t()}))},GC.setItem=function(e,t){return new Promise((n=>{localStorage.setItem(e,t),n()}))},GC}function qC(){if(VC)return IC;VC=1,Object.defineProperty(IC,"__esModule",{value:!0}),IC.Socket=IC.SearchProvider=IC.RequestClient=IC.Provider=void 0;const e=LC();IC.RequestClient=e;const t=function(){if(jC)return MC;jC=1;var e=WC();const t=LC();return MC=class extends t{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then((e=>{let[t,n]=e;const r={};return n&&(r["uppy-auth-token"]=n),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...r}}))}onReceiveResponse(e){e=super.onReceiveResponse(e);const t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authUrl(e){void 0===e&&(e={});const t=new URLSearchParams(e);return this.preAuthToken&&t.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async fetchPreAuthToken(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e){return this.get(`${this.id}/list/${e||""}`)}logout(){return this.get(`${this.id}/logout`).then((e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)]))).then((e=>{let[t]=e;return t}))}static initPlugin(t,n,r){if(t.type="acquirer",t.files=[],r&&(t.opts={...r,...n}),n.serverUrl||n.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(n.companionAllowedHosts){const e=n.companionAllowedHosts;if(!("string"==typeof e||Array.isArray(e)||e instanceof RegExp))throw new TypeError(`${t.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);t.opts.companionAllowedHosts=e}else/^(?!https?:\/\/).*$/i.test(n.companionUrl)?t.opts.companionAllowedHosts=`https://${n.companionUrl.replace(/^\/\//,"")}`:t.opts.companionAllowedHosts=new URL(n.companionUrl).origin;t.storage=t.opts.storage||e}},MC}();IC.Provider=t;const n=function(){if(zC)return HC;zC=1;const e=LC();return HC=class extends e{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}},HC}();IC.SearchProvider=n;const r=function(){if(UC)return $C;let e,t;function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}UC=1;var r=0;function o(e){return"__private_"+r+++"_"+e}const i=mE();var a=o("queued"),s=o("emitter"),u=o("isOpen"),l=o("socket"),c=o("handleMessage");return e=Symbol.for("uppy test: getSocket"),t=Symbol.for("uppy test: getQueued"),$C=class{constructor(e){Object.defineProperty(this,a,{writable:!0,value:[]}),Object.defineProperty(this,s,{writable:!0,value:i()}),Object.defineProperty(this,u,{writable:!0,value:!1}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:e=>{try{const t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,e&&!1===e.autoOpen||this.open()}get isOpen(){return n(this,u)[u]}[e](){return n(this,l)[l]}[t](){return n(this,a)[a]}open(){n(this,l)[l]=new WebSocket(this.opts.target),n(this,l)[l].onopen=()=>{for(n(this,u)[u]=!0;n(this,a)[a].length>0&&n(this,u)[u];){const e=n(this,a)[a].shift();this.send(e.action,e.payload)}},n(this,l)[l].onclose=()=>{n(this,u)[u]=!1},n(this,l)[l].onmessage=n(this,c)[c]}close(){var e;null==(e=n(this,l)[l])||e.close()}send(e,t){n(this,u)[u]?n(this,l)[l].send(JSON.stringify({action:e,payload:t})):n(this,a)[a].push({action:e,payload:t})}on(e,t){n(this,s)[s].on(e,t)}emit(e,t){n(this,s)[s].emit(e,t)}once(e,t){n(this,s)[s].once(e,t)}},$C}();return IC.Socket=r,IC}var KC,YC,XC,ZC,JC,QC,eD,tD,nD,rD,oD,iD,aD,sD,uD,lD,cD,dD={};function fD(){if(KC)return dD;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}KC=1,Object.defineProperty(dD,"__esModule",{value:!0}),dD.internalRateLimitedQueue=dD.RateLimitedQueue=void 0;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("activeRequests"),o=n("queuedHandlers"),i=n("paused"),a=n("pauseTimer"),s=n("downLimit"),u=n("upperLimit"),l=n("rateLimitingTimer"),c=n("call"),d=n("queueNext"),f=n("next"),p=n("queue"),h=n("dequeue"),g=n("resume"),v=n("increaseLimit");function m(t){e(this,r)[r]+=1;let n,o=!1;try{n=t()}catch(t){throw e(this,r)[r]-=1,t}return{abort:()=>{o||(o=!0,e(this,r)[r]-=1,n(),e(this,d)[d]())},done:()=>{o||(o=!0,e(this,r)[r]-=1,e(this,d)[d]())}}}function y(){queueMicrotask((()=>e(this,f)[f]()))}function b(){if(e(this,i)[i]||e(this,r)[r]>=this.limit)return;if(0===e(this,o)[o].length)return;const t=e(this,o)[o].shift(),n=e(this,c)[c](t.fn);t.abort=n.abort,t.done=n.done}function E(t,n){void 0===n&&(n={});const r={fn:t,priority:n.priority||0,abort:()=>{e(this,h)[h](r)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=e(this,o)[o].findIndex((e=>r.priority>e.priority));return-1===i?e(this,o)[o].push(r):e(this,o)[o].splice(i,0,r),r}function C(t){const n=e(this,o)[o].indexOf(t);-1!==n&&e(this,o)[o].splice(n,1)}dD.RateLimitedQueue=class{constructor(t){Object.defineProperty(this,h,{value:C}),Object.defineProperty(this,p,{value:E}),Object.defineProperty(this,f,{value:b}),Object.defineProperty(this,d,{value:y}),Object.defineProperty(this,c,{value:m}),Object.defineProperty(this,r,{writable:!0,value:0}),Object.defineProperty(this,o,{writable:!0,value:[]}),Object.defineProperty(this,i,{writable:!0,value:!1}),Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,s,{writable:!0,value:1}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,g,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,v,{writable:!0,value:()=>{if(e(this,i)[i])e(this,l)[l]=setTimeout(e(this,v)[v],0);else{e(this,s)[s]=this.limit,this.limit=Math.ceil((e(this,u)[u]+e(this,s)[s])/2);for(let t=e(this,s)[s];t<=this.limit;t++)e(this,d)[d]();e(this,u)[u]-e(this,s)[s]>3?e(this,l)[l]=setTimeout(e(this,v)[v],2e3):e(this,s)[s]=Math.floor(e(this,s)[s]/2)}}}),this.limit="number"!=typeof t||0===t?1/0:t}run(t,n){return!e(this,i)[i]&&e(this,r)[r]<this.limit?e(this,c)[c](t):e(this,p)[p](t,n)}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];let a;const s=new Promise(((r,i)=>{a=n.run((()=>{let t,n;try{n=Promise.resolve(e(...o))}catch(e){n=Promise.reject(e)}return n.then((e=>{t?i(t):(a.done(),r(e))}),(e=>{t?i(t):(a.done(),i(e))})),()=>{t=new Error("Cancelled")}}),t)}));return s.abort=()=>{a.abort()},s}}resume(){e(this,i)[i]=!1,clearTimeout(e(this,a)[a]);for(let t=0;t<this.limit;t++)e(this,d)[d]()}pause(t){void 0===t&&(t=null),e(this,i)[i]=!0,clearTimeout(e(this,a)[a]),null!=t&&(e(this,a)[a]=setTimeout(e(this,g)[g],t))}rateLimit(t){clearTimeout(e(this,l)[l]),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(e(this,u)[u]=this.limit-1,this.limit=e(this,s)[s],e(this,l)[l]=setTimeout(e(this,v)[v],t))}get isPaused(){return e(this,i)[i]}};const D=Symbol("__queue");return dD.internalRateLimitedQueue=D,dD}function pD(){return uD?sD:(uD=1,sD={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}})}var hD=function(){if(cD)return lD;cD=1;var e=wC(),t=qC(),n=fD();const r=mC(),o=function(){if(XC)return YC;XC=1;const e=Oy();return YC=e((function(e,t,n){const{progress:r,bytesUploaded:o,bytesTotal:i}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",n,{uploader:e,bytesUploaded:o,bytesTotal:i}))}),300,{leading:!0,trailing:!0})}(),i=JC?ZC:(JC=1,ZC=function(e){const t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return`${/^http:\/\//i.test(e)?"ws":"wss"}://${t}`}),a=eD?QC:(eD=1,QC=function(e){const t=[],n=[];function r(e){t.push(e)}function o(e){n.push(e)}return Promise.all(e.map((e=>e.then(r,o)))).then((()=>({successful:t,failed:n})))}),s=function(){if(nD)return tD;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}nD=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("emitter"),o=n("events");return tD=class{constructor(t){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:[]}),e(this,r)[r]=t}on(t,n){return e(this,o)[o].push([t,n]),e(this,r)[r].on(t,n)}remove(){for(const[t,n]of e(this,o)[o].splice(0))e(this,r)[r].off(t,n)}}}(),u=function(){if(oD)return rD;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}oD=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("aliveTimer"),o=n("isDone"),i=n("onTimedOut"),a=n("timeout");return rD=class{constructor(t,n){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:!1}),Object.defineProperty(this,i,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),e(this,a)[a]=t,e(this,i)[i]=n}progress(){e(this,o)[o]||e(this,a)[a]>0&&(clearTimeout(e(this,r)[r]),e(this,r)[r]=setTimeout(e(this,i)[i],e(this,a)[a]))}done(){e(this,o)[o]||(clearTimeout(e(this,r)[r]),e(this,r)[r]=null,e(this,o)[o]=!0)}}}(),l=RC(),c=aD?iD:(aD=1,iD=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)}),d=pD();function f(e,t){let n=t;return n||(n=new Error("Upload error")),"string"==typeof n&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),c(e)?(n=new l(n,e),n):(n.request=e,n)}function p(e){return e.data.slice(0,e.data.size,e.meta.type)}class h extends r{constructor(e,t){super(e,t),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.title="XHRUpload",this.defaultLocale=d;const r={formData:!0,fieldName:t.bundle?"files[]":"file",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:"",getResponseData(t){let n={};try{n=JSON.parse(t)}catch(t){e.log(t)}return n},getResponseError(e,t){let n=new Error("Upload error");return c(t)&&(n=new l(n,t)),n},validateStatus:e=>e>=200&&e<300};if(this.opts={...r,...t},this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),n.internalRateLimitedQueue in this.opts?this.requests=this.opts[n.internalRateLimitedQueue]:this.requests=new n.RateLimitedQueue(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:n}=this.opts,r={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof n?r.headers=n(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach((n=>{e.append(n,t[n])}))}createFormDataUpload(e,t){const n=new FormData;this.addMetadata(n,e.meta,t);const r=p(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n}createBundledUpload(e,t){const n=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(n,r,t),e.forEach((e=>{const t=this.getOptions(e),r=p(e);e.name?n.append(t.fieldName,r,e.name):n.append(t.fieldName,r)})),n}upload(t,n,r){const o=this.getOptions(t);return this.uppy.log(`uploading ${n} of ${r}`),new Promise(((n,r)=>{this.uppy.emit("upload-started",t);const i=o.formData?this.createFormDataUpload(t,o):t.data,a=new XMLHttpRequest;let l;this.uploaderEvents[t.id]=new s(this.uppy);const c=new u(o.timeout,(()=>{a.abort(),l.done();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(o.timeout/1e3)}));this.uppy.emit("upload-error",t,e),r(e)})),d=(0,e.nanoid)();a.upload.addEventListener("loadstart",(()=>{this.uppy.log(`[XHRUpload] ${d} started`)})),a.upload.addEventListener("progress",(e=>{this.uppy.log(`[XHRUpload] ${d} progress: ${e.loaded} / ${e.total}`),c.progress(),e.lengthComputable&&this.uppy.emit("upload-progress",t,{uploader:this,bytesUploaded:e.loaded,bytesTotal:e.total})})),a.addEventListener("load",(()=>{if(this.uppy.log(`[XHRUpload] ${d} finished`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null),o.validateStatus(a.status,a.responseText,a)){const e=o.getResponseData(a.responseText,a),r=e[o.responseUrlFieldName],i={status:a.status,body:e,uploadURL:r};return this.uppy.emit("upload-success",t,i),r&&this.uppy.log(`Download ${t.name} from ${r}`),n(t)}const e=o.getResponseData(a.responseText,a),i=f(a,o.getResponseError(a.responseText,a)),s={status:a.status,body:e};return this.uppy.emit("upload-error",t,i,s),r(i)})),a.addEventListener("error",(()=>{this.uppy.log(`[XHRUpload] ${d} errored`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null);const e=f(a,o.getResponseError(a.responseText,a));return this.uppy.emit("upload-error",t,e),r(e)})),a.open(o.method.toUpperCase(),o.endpoint,!0),a.withCredentials=o.withCredentials,""!==o.responseType&&(a.responseType=o.responseType),l=this.requests.run((()=>{this.uppy.emit("upload-started",t);const e=this.getOptions(t);return Object.keys(e.headers).forEach((t=>{a.setRequestHeader(t,e.headers[t])})),a.send(i),()=>{c.done(),a.abort()}})),this.onFileRemove(t.id,(()=>{l.abort(),r(new Error("File removed"))})),this.onCancelAll(t.id,(e=>{let{reason:t}=e;"user"===t&&l.abort(),r(new Error("Upload cancelled"))}))}))}uploadRemote(e){const n=this.getOptions(e);return new Promise(((r,a)=>{this.uppy.emit("upload-started",e);const u={};(Array.isArray(n.metaFields)?n.metaFields:Object.keys(e.meta)).forEach((t=>{u[t]=e.meta[t]}));new(e.remote.providerOptions.provider?t.Provider:t.RequestClient)(this.uppy,e.remote.providerOptions).post(e.remote.url,{...e.remote.body,endpoint:n.endpoint,size:e.data.size,fieldname:n.fieldName,metadata:u,httpMethod:n.method,useFormData:n.formData,headers:n.headers}).then((u=>{const{token:l}=u,c=i(e.remote.companionUrl),d=new t.Socket({target:`${c}/api/${l}`,autoOpen:!1});let f;this.uploaderEvents[e.id]=new s(this.uppy),this.onFileRemove(e.id,(()=>{d.send("cancel",{}),f.abort(),r(`upload ${e.id} was removed`)})),this.onCancelAll(e.id,(function(t){let{reason:n}=void 0===t?{}:t;"user"===n&&(d.send("cancel",{}),f.abort()),r(`upload ${e.id} was canceled`)})),this.onRetry(e.id,(()=>{d.send("pause",{}),d.send("resume",{})})),this.onRetryAll(e.id,(()=>{d.send("pause",{}),d.send("resume",{})})),d.on("progress",(t=>o(this,t,e))),d.on("success",(t=>{const o=n.getResponseData(t.response.responseText,t.response),i=o[n.responseUrlFieldName],a={status:t.response.status,body:o,uploadURL:i};return this.uppy.emit("upload-success",e,a),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r()})),d.on("error",(t=>{const r=t.response,o=r?n.getResponseError(r.responseText,r):Object.assign(new Error(t.error.message),{cause:t.error});this.uppy.emit("upload-error",e,o),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),a(o)})),f=this.requests.run((()=>(d.open(),e.isPaused&&d.send("pause",{}),()=>d.close())))})).catch((t=>{this.uppy.emit("upload-error",e,t),a(t)}))}))}uploadBundle(e){return new Promise(((t,n)=>{const{endpoint:r}=this.opts,{method:o}=this.opts,i=this.uppy.getState().xhrUpload,a=this.createBundledUpload(e,{...this.opts,...i||{}}),s=new XMLHttpRequest,l=t=>{e.forEach((e=>{this.uppy.emit("upload-error",e,t)}))},c=new u(this.opts.timeout,(()=>{s.abort();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(this.opts.timeout/1e3)}));l(e),n(e)}));s.upload.addEventListener("loadstart",(()=>{this.uppy.log("[XHRUpload] started uploading bundle"),c.progress()})),s.upload.addEventListener("progress",(t=>{c.progress(),t.lengthComputable&&e.forEach((e=>{this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})}))})),s.addEventListener("load",(r=>{if(c.done(),this.opts.validateStatus(r.target.status,s.responseText,s)){const n=this.opts.getResponseData(s.responseText,s),o={status:r.target.status,body:n};return e.forEach((e=>{this.uppy.emit("upload-success",e,o)})),t()}const o=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return o.request=s,l(o),n(o)})),s.addEventListener("error",(()=>{c.done();const e=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return l(e),n(e)})),this.uppy.on("cancel-all",(function(e){let{reason:t}=void 0===e?{}:e;"user"===t&&(c.done(),s.abort())})),s.open(o.toUpperCase(),r,!0),s.withCredentials=this.opts.withCredentials,""!==this.opts.responseType&&(s.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach((e=>{s.setRequestHeader(e,this.opts.headers[e])})),s.send(a),e.forEach((e=>{this.uppy.emit("upload-started",e)}))}))}uploadFiles(e){const t=e.map(((t,n)=>{const r=parseInt(n,10)+1,o=e.length;return t.error?Promise.reject(new Error(t.error)):t.isRemote?this.uploadRemote(t,r,o):this.upload(t,r,o)}));return a(t)}onFileRemove(e,t){this.uploaderEvents[e].on("file-removed",(n=>{e===n.id&&t(n.id)}))}onRetry(e,t){this.uploaderEvents[e].on("upload-retry",(n=>{e===n&&t()}))}onRetryAll(e,t){this.uploaderEvents[e].on("retry-all",(()=>{this.uppy.getFile(e)&&t()}))}onCancelAll(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",(function(){n.uppy.getFile(e)&&t(...arguments)}))}handleUpload(e){if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts[n.internalRateLimitedQueue]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=e.map((e=>this.uppy.getFile(e)));if(this.opts.bundle){if(t.some((e=>e.isRemote)))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then((()=>null))}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.handleUpload)}}return h.VERSION="2.1.3",lD=h}(),gD=E(hD);function vD(e){var t=e.server,n=void 0===t?"":t,r=e.fieldName,o=void 0===r?"":r,i=e.maxFileSize,a=void 0===i?10485760:i,s=e.maxNumberOfFiles,u=void 0===s?100:s,l=e.meta,c=void 0===l?{}:l,d=e.metaWithUrl,f=void 0!==d&&d,p=e.headers,h=void 0===p?{}:p,g=e.withCredentials,v=void 0!==g&&g,m=e.timeout,y=void 0===m?1e4:m,b=e.onBeforeUpload,E=void 0===b?function(e){return e}:b,C=e.onSuccess,D=void 0===C?function(e,t){}:C,w=e.onError,A=void 0===w?function(e,t,n){console.error("".concat(e.name," upload error"),t,n)}:w,S=e.onProgress,x=void 0===S?function(e){}:S;if(!n)throw new Error("Cannot get upload server address\n没有配置上传地址");if(!o)throw new Error("Cannot get fieldName\n没有配置 fieldName");var O=n;f&&(O=function(e,t){var n=vp(e.split("#"),2),r=n[0],o=n[1],i=[];xp(t,(function(e,t){i.push("".concat(t,"=").concat(e))}));var a=i.join("&");return r=r.indexOf("?")>0?"".concat(r,"&").concat(a):"".concat(r,"?").concat(a),o?"".concat(r,"#").concat(o):r}(O,c));var T=new DC({onBeforeUpload:E,restrictions:{maxFileSize:a,maxNumberOfFiles:u},meta:c}).use(gD,{endpoint:O,headers:h,formData:!0,fieldName:o,bundle:!0,withCredentials:v,timeout:y});return T.on("complete",(function(e){var t=e.successful[0],n=t.response,r=(null!=n?n:{}).body,o=void 0===r?{}:r;try{D(t,o)}catch(e){console.error("wangEditor upload file - onSuccess error",e)}})),T.on("progress",(function(e){e<1||x(e)})),T.on("upload-error",(function(e,t,n){try{A(e,t,n)}catch(e){console.error("wangEditor upload file - onError error",e)}})),T.on("restriction-failed",(function(e,t){try{A(e,t)}catch(e){console.error("wangEditor upload file - onError error",e)}})),T}ty("en",{editor:{more:"More",justify:"Justify",indent:"Indent",image:"Image",video:"Video"}}),ty("zh-CN",{editor:{more:"更多",justify:"对齐",indent:"缩进",image:"图片",video:"视频"}});var mD,yD,bD,ED,CD,DD,wD,AD,SD,xD,OD,TD,ND,BD,kD,FD={};function PD(){if(yD)return mD;yD=1;var e=S();return mD=Array.isArray||function(t){return"Array"===e(t)}}function ID(){if(ED)return bD;ED=1;var e=A(),t=D(),n=ye(),r=kr(),o=$t(),i=xn(),a=function(){},s=o("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=e(u.exec),c=!u.test(a),d=function(e){if(!n(e))return!1;try{return s(a,[],e),!0}catch(e){return!1}},f=function(e){if(!n(e))return!1;switch(r(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(e))}catch(e){return!0}};return f.sham=!0,bD=!s||t((function(){var e;return d(d.call)||!d(Object)||!d((function(){e=!0}))||e}))?f:d}function RD(){if(DD)return CD;DD=1;var e=PD(),t=ID(),n=be(),r=me()("species"),o=Array;return CD=function(i){var a;return e(i)&&(a=i.constructor,(t(a)&&(a===o||e(a.prototype))||n(a)&&null===(a=a[r]))&&(a=void 0)),void 0===a?o:a},CD}function LD(){if(AD)return wD;AD=1;var e=RD();return wD=function(t,n){return new(e(t))(0===n?0:n)}}function _D(){if(TD)return OD;TD=1;var e=D();return OD=function(t,n){var r=[][t];return!!r&&e((function(){r.call(null,n||function(){return 1},1)}))}}function MD(){if(BD)return ND;BD=1;var e=function(){if(xD)return SD;xD=1;var e=$o(),t=A(),n=x(),r=de(),o=Qt(),i=LD(),a=t([].push),s=function(t){var s=1===t,u=2===t,l=3===t,c=4===t,d=6===t,f=7===t,p=5===t||d;return function(h,g,v,m){for(var y,b,E=r(h),C=n(E),D=o(C),w=e(g,v),A=0,S=m||i,x=s?S(h,D):u||f?S(h,0):void 0;D>A;A++)if((p||A in C)&&(b=w(y=C[A],A,E),t))if(s)x[A]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return A;case 2:a(x,y)}else switch(t){case 4:return!1;case 7:a(x,y)}return d?-1:l||c?c:x}};return SD={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)}}().forEach,t=_D()("forEach");return ND=t?[].forEach:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)},ND}!function(){if(kD)return FD;kD=1;var e=B(),t=ai(),n=si(),r=MD(),o=cn(),i=function(e){if(e&&e.forEach!==r)try{o(e,"forEach",r)}catch(t){e.forEach=r}};for(var a in t)t[a]&&i(e[a]&&e[a].prototype);i(n)}();ty("en",{common:{ok:"OK",delete:"Delete",enter:"Enter"},blockQuote:{title:"Quote"},codeBlock:{title:"Code block"},color:{color:"Font color",bgColor:"Back color",default:"Default color",clear:"Clear back color"},divider:{title:"Divider"},emotion:{title:"Emotion"},fontSize:{title:"Font size",default:"Default"},fontFamily:{title:"Font family",default:"Default"},fullScreen:{title:"Full screen",cancelTitle:"Cancel full screen"},header:{title:"Header",text:"Text"},image:{netImage:"Net image",delete:"Delete image",edit:"Edit image",editSize:"Edit size",viewLink:"View link",src:"Image src",desc:"Description",link:"Image link",ok:"Ok",width:"Width",height:"Height"},indent:{decrease:"Decrease",increase:"Increase"},justify:{left:"Left",right:"Right",center:"Center",justify:"Justify"},lineHeight:{title:"Line height",default:"Default"},link:{insert:"Insert link",text:"Link text",url:"Link source",unLink:"Unlink",edit:"Edit link",view:"View link"},textStyle:{bold:"Bold",clear:"Clear styles",code:"Inline code",italic:"Italic",sub:"Sub",sup:"Sup",through:"Through",underline:"Underline"},undo:{undo:"undo",redo:"Redo"},todo:{todo:"Todo"},formatPainter:{title:"Format Painter"}}),ty("zh-CN",{common:{ok:"确定",delete:"删除",enter:"回车"},blockQuote:{title:"引用"},codeBlock:{title:"代码块"},color:{color:"文字颜色",bgColor:"背景色",default:"默认颜色",clear:"清除背景色"},divider:{title:"分割线"},emotion:{title:"表情"},fontSize:{title:"字号",default:"默认字号"},fontFamily:{title:"字体",default:"默认字体"},fullScreen:{title:"全屏",cancelTitle:"取消全屏"},header:{title:"标题",text:"正文"},image:{netImage:"网络图片",delete:"删除图片",edit:"编辑图片",editSize:"修改尺寸",viewLink:"查看链接",src:"图片地址",desc:"图片描述",link:"图片链接",ok:"确定",width:"宽度",height:"高度"},indent:{decrease:"减少缩进",increase:"增加缩进"},justify:{left:"左对齐",right:"右对齐",center:"居中对齐",justify:"两端对齐"},lineHeight:{title:"行高",default:"默认行高"},link:{insert:"插入链接",text:"链接文本",url:"链接地址",unLink:"取消链接",edit:"修改链接",view:"查看链接"},textStyle:{bold:"粗体",clear:"清除格式",code:"行内代码",italic:"斜体",sub:"下标",sup:"上标",through:"删除线",underline:"下划线"},undo:{undo:"撤销",redo:"重做"},todo:{todo:"待办"},formatPainter:{title:"格式刷"}});var jD={type:"blockquote",elemToHtml:function(e,t){return"<blockquote>".concat(t,"</blockquote>")}},HD='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',zD='<svg viewBox="0 0 1024 1024"><path d="M924.402464 1023.068211H0.679665V99.345412h461.861399v98.909208H99.596867v725.896389h725.896389V561.206811h98.909208z" p-id="10909"></path><path d="M930.805104 22.977336l69.965436 69.965436-453.492405 453.492404-69.965435-69.901489z" p-id="10910"></path><path d="M1022.464381 304.030081h-98.917201V99.345412H709.230573V0.428211h313.233808z"></path></svg>',$D='<svg viewBox="0 0 1024 1024"><path d="M133.705143 335.433143V133.851429h201.581714a29.622857 29.622857 0 0 0 29.622857-29.549715V68.754286a29.622857 29.622857 0 0 0-29.622857-29.622857H61.732571A22.893714 22.893714 0 0 0 38.765714 62.025143V335.725714c0 16.310857 13.238857 29.622857 29.622857 29.622857h35.547429a29.842286 29.842286 0 0 0 29.696-29.842285zM690.980571 133.851429h201.581715v201.654857c0 16.310857 13.238857 29.549714 29.622857 29.549714h35.547428a29.622857 29.622857 0 0 0 29.549715-29.549714V61.952a22.893714 22.893714 0 0 0-22.820572-22.893714h-273.554285a29.622857 29.622857 0 0 0-29.549715 29.622857v35.547428c0 16.310857 13.238857 29.696 29.622857 29.696zM335.286857 892.781714H133.705143V691.2a29.622857 29.622857 0 0 0-29.622857-29.622857H68.534857a29.622857 29.622857 0 0 0-29.549714 29.622857v273.554286c0 12.653714 10.24 22.893714 22.820571 22.893714h273.554286a29.622857 29.622857 0 0 0 29.696-29.622857v-35.547429a29.769143 29.769143 0 0 0-29.769143-29.696z m557.348572-201.581714v201.581714H690.907429a29.622857 29.622857 0 0 0-29.622858 29.622857v35.547429c0 16.310857 13.238857 29.622857 29.622858 29.622857h273.554285c12.580571 0 22.893714-10.313143 22.893715-22.893714V691.2a29.622857 29.622857 0 0 0-29.622858-29.622857h-35.547428a29.622857 29.622857 0 0 0-29.696 29.622857z"></path></svg>',UD=function(){function e(){this.title=ry("blockQuote.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M894.6 907.1H605.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C752.7 180.4 711.3 315.8 711.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z m-472 0H133.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C280.7 180.4 239.3 315.8 239.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!!$g.getSelectedNodeByType(e,"blockquote")},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=vp(ap.Editor.nodes(e,{match:function(e){var t=$g.getNodeType(e);return"paragraph"===t||"blockquote"===t},universal:!0,mode:"highest"}),1);return!t[0]},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=this.isActive(e)?"paragraph":"blockquote";ap.Transforms.setNodes(e,{type:n},{mode:"highest"})}},e}(),VD={key:"blockquote",factory:function(){return new UD}};function GD(e){return 0===ph("<div>".concat(e,"</div>")).children().filter((function(e){return"BR"!==e.tagName})).length}function WD(e){return 0===e.length?"":e[0].outerHTML}function qD(e){return e.length?e[0].tagName.toLowerCase():""}function KD(e,t){for(var n="",r=(e.attr("style")||"").split(";"),o=r.length,i=0;i<o;i+=1){var a=r[i];if(a){var s=a.split(":");s[0].trim()===t&&(n=s[1].trim())}}return n}Nh&&(ph.fn.css=Nh),Rh&&(ph.fn.append=Rh),Lh&&(ph.fn.prepend=Lh),hh&&(ph.fn.addClass=hh),gh&&(ph.fn.removeClass=gh),vh&&(ph.fn.hasClass=vh),Dh&&(ph.fn.on=Dh),wh&&(ph.fn.off=wh),Wh&&(ph.fn.focus=Wh),mh&&(ph.fn.attr=mh),yh&&(ph.fn.removeAttr=yh),Oh&&(ph.fn.hide=Oh),Th&&(ph.fn.show=Th),Mh&&(ph.fn.parents=Mh),Eh&&(ph.fn.dataset=Eh),Ch&&(ph.fn.val=Ch),Ph&&(ph.fn.text=Ph),Fh&&(ph.fn.html=Fh),Hh&&(ph.fn.children=Hh),zh&&(ph.fn.remove=zh),jh&&(ph.fn.find=jh),Ah&&(ph.fn.width=Ah),Sh&&(ph.fn.height=Sh),kh&&(ph.fn.filter=kh),$h&&(ph.fn.empty=$h);var YD={selector:"blockquote:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);return 0===(t=t.filter((function(e){return!!ap.Text.isText(e)||!!n.isInline(e)}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"blockquote",children:t}}};function XD(e){e.deleteBackward("character");ap.Transforms.insertNodes(e,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}var ZD={type:"blockquote",renderElem:function(e,t,n){return rb.jsx("blockquote",null,t)}},JD={renderElems:[ZD],elemsToHtml:[jD],parseElemsHtml:[YD],menus:[VD],editorPlugin:function(e){var t=e.insertBreak,n=e.insertText,r=e;return r.insertBreak=function(){var o=r.selection;if(null==o)return t();var i=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"blockquote")},universal:!0}),1),a=i[0];if(!a)return t();var s=a[0];if($g.getParentNode(e,s)){var u=$g.findPath(e,s),l=ap.Editor.end(e,u);if(ap.Point.equals(l,o.focus)){var c=ap.Node.string(s);if(c&&"\n"===c.slice(-1))return void XD(r)}n("\n")}else XD(r)},r}};var QD={type:"code",elemToHtml:function(e,t){return"<code>".concat(t,"</code>")}};var ew={type:"pre",elemToHtml:function(e,t){return"<pre>".concat(t,"</pre>")}},tw=function(){function e(){this.title=ry("codeBlock.title"),this.iconSvg='<svg viewBox="0 0 1280 1024"><path d="M832 736l96 96 320-320L928 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224zM701.312 150.528l69.472 18.944-192 704.032-69.472-18.944 192-704.032z"></path></svg>',this.tag="button"}return e.prototype.getSelectCodeElem=function(e){var t=$g.getSelectedNodeByType(e,"code");if(null==t)return null;var n=$g.getParentNode(e,t);return null==n||"pre"!==$g.getNodeType(n)?null:t},e.prototype.getValue=function(e){var t=this.getSelectCodeElem(e);return null==t?"":t.language||""},e.prototype.isActive=function(e){return!!this.getSelectCodeElem(e)},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=$g.getSelectedElems(e);return!!t.some((function(t){return e.isVoid(t)}))||!t.some((function(e){var t=$g.getNodeType(e);return"pre"===t||"paragraph"===t}))},e.prototype.exec=function(e,t){this.isActive(e)?this.changeToPlainText(e):this.changeToCodeBlock(e,t.toString())},e.prototype.changeToPlainText=function(e){var t=this.getSelectCodeElem(e);if(null!=t){var n=ap.Node.string(t);ap.Transforms.removeNodes(e,{mode:"highest"});var r=n.split("\n").map((function(e){return{type:"paragraph",children:[{text:e}]}}));ap.Transforms.insertNodes(e,r,{mode:"highest"})}},e.prototype.changeToCodeBlock=function(e,t){var n,r,o=[],i=ap.Editor.nodes(e,{match:function(t){return e.children.includes(t)},universal:!0});try{for(var a=gp(i),s=a.next();!s.done;s=a.next()){var u=vp(s.value,1)[0];u&&o.push(ap.Node.string(u))}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}ap.Transforms.removeNodes(e,{mode:"highest"});var l={type:"pre",children:[{type:"code",language:t,children:[{text:o.join("\n")}]}]};ap.Transforms.insertNodes(e,l,{mode:"highest"})},e}();var nw={selector:"pre:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);return 0===(t=t.filter((function(e){return"code"===$g.getNodeType(e)}))).length&&(t=[{type:"code",language:"",children:[{text:r[0].textContent||""}]}]),{type:"pre",children:t.filter((function(e){return"code"===$g.getNodeType(e)}))}}};var rw={type:"pre",renderElem:function(e,t,n){return rb.jsx("pre",null,t)}},ow={type:"code",renderElem:function(e,t,n){return rb.jsx("code",null,t)}},iw={menus:[{key:"codeBlock",factory:function(){return new tw}}],editorPlugin:function(e){var t=e.insertBreak,n=e.normalizeNode,r=e.insertData,o=e.handleTab,i=e;return i.insertBreak=function(){var e=$g.getSelectedNodeByType(i,"code");if(null!=e){var n=function(e,t){var n=t.selection;if(null==n)return"";var r=ap.Node.string(e),o=n.anchor.offset,i=r.slice(0,o).split("\n"),a=i.length;return 0===a?"":i[a-1]}(e,i);if(n){var r=n.match(/^\s+/);if(null!=r&&null!=r[0]){var o=r[0];return void i.insertText("\n".concat(o))}}i.insertText("\n")}else t()},e.handleTab=function(){var t=e.selection;if(t){var n=$g.getSelectedNodeByType(e,"code");if(n&&!ap.Range.isCollapsed(t)){var r=vp([t.anchor,t.focus].sort((function(e,t){return e.offset-t.offset})),2),i=r[0],a=r[1],s=n.children[0].text,u=s.split("\n"),l=s.slice(0,i.offset).split("\n").length-1,c=s.slice(0,a.offset).split("\n").length-1,d=u.map((function(e,t){return t>=l&&t<=c?" ".concat(e):e})),f=d.join("\n"),p={anchor:{path:i.path,offset:i.offset+2},focus:{path:a.path,offset:a.offset+2}};ap.Transforms.insertText(e,f,{at:{anchor:{path:i.path,offset:0},focus:{path:a.path,offset:s.length}}}),ap.Transforms.select(e,p)}else o()}},i.normalizeNode=function(e){var t=vp(e,2),r=t[0],o=t[1],a=$g.getNodeType(r);("code"===a&&o.length<=1&&ap.Transforms.setNodes(i,{type:"paragraph"},{at:o}),"pre"===a)&&($g.isLastNode(i,r)&&ap.Transforms.insertNodes(i,$g.genEmptyParagraph(),{at:[o[0]+1]}),"code"!==$g.getNodeType(r.children[0])&&(ap.Transforms.unwrapNodes(i),ap.Transforms.setNodes(i,{type:"paragraph"},{mode:"highest"})));return n([r,o])},i.insertData=function(e){if(null!=$g.getSelectedNodeByType(i,"code")){var t=e.getData("text/plain");ap.Editor.insertText(i,t)}else r(e)},i},renderElems:[rw,ow],elemsToHtml:[QD,ew],preParseHtml:[{selector:"pre>code",preParseHtml:function(e){var t=ph(e);if("code"!==qD(t))return e;var n=t.find("xmp");if(0===n.length)return e;var r=n.text();return n.remove(),t.text(r),t[0]}}],parseElemsHtml:[{selector:"pre:not([data-w-e-type])>code",parseElemHtml:function(e,t,n){return{type:"code",language:"",children:[{text:ph(e)[0].textContent||""}]}}},nw]},aw=function(){function e(){this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(e,t){},e.prototype.getValue=function(e){var t=this.mark,n=ap.Editor.marks(e);return n&&n[t]?n[t]:""},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=vp(ap.Editor.nodes(e,{match:function(t){return"pre"===$g.getNodeType(t)||!!ap.Editor.isVoid(e,t)},universal:!0}),1);return!!t[0]},e.prototype.getPanelContentElem=function(e){var t=this.mark;if(null==this.$content){var n=ph('<ul class="w-e-panel-content-color"></ul>');n.on("click","li",(function(n){var r=n.target;if(null!=r&&(n.preventDefault(),null!=e.selection)){var o=ph(r).attr("data-value");"0"===o?ap.Editor.removeMark(e,t):ap.Editor.addMark(e,t,o)}})),this.$content=n}var r=this.$content;if(null==r)return document.createElement("ul");r.empty();var o=this.getValue(e),i=e.getMenuConfig(t).colors;(void 0===i?[]:i).forEach((function(e){var t=ph('<div class="color-block" data-value="'.concat(e,'"></div>'));t.css("background-color",e);var n=ph('<li data-value="'.concat(e,'"></li>'));o===e&&n.addClass("active"),n.append(t),r.append(n)}));var a="";"color"===t&&(a=ry("color.default")),"bgColor"===t&&(a=ry("color.clear"));var s=ph('\n <li data-value="0" class="clear">\n '.concat('<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>',"\n ").concat(a,"\n </li>\n "));return r.prepend(s),r[0]},e}(),sw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("color.bgColor"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M510.030769 315.076923l84.676923 196.923077h-177.230769l76.8-196.923077h15.753846zM945.230769 157.538462v708.923076c0 43.323077-35.446154 78.769231-78.769231 78.769231H157.538462c-43.323077 0-78.769231-35.446154-78.769231-78.769231V157.538462c0-43.323077 35.446154-78.769231 78.769231-78.769231h708.923076c43.323077 0 78.769231 35.446154 78.769231 78.769231z m-108.307692 643.938461L600.615385 216.615385c-5.907692-11.815385-15.753846-19.692308-29.538462-19.692308h-139.815385c-11.815385 0-23.630769 7.876923-27.56923 19.692308l-216.615385 584.861538c-3.938462 11.815385 3.938462 25.6 17.723077 25.6h80.738462c11.815385 0 23.630769-9.846154 27.56923-21.661538l63.015385-175.261539h263.876923l68.923077 175.261539c3.938462 11.815385 15.753846 21.661538 27.569231 21.661538h80.738461c13.784615 0 23.630769-13.784615 19.692308-25.6z"></path></svg>',t.mark="bgColor",t}return dp(t,e),t}(aw),uw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("color.color"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 864h896v96H64zM360.58 576h302.85l81.53 224h102.16L579.24 64H444.77L176.89 800h102.16l81.53-224zM512 159.96L628.49 480H395.52L512 159.96z"></path></svg>',t.mark="color",t}return dp(t,e),t}(aw),lw=["rgb(0, 0, 0)","rgb(38, 38, 38)","rgb(89, 89, 89)","rgb(140, 140, 140)","rgb(191, 191, 191)","rgb(217, 217, 217)","rgb(233, 233, 233)","rgb(245, 245, 245)","rgb(250, 250, 250)","rgb(255, 255, 255)","rgb(225, 60, 57)","rgb(231, 95, 51)","rgb(235, 144, 58)","rgb(245, 219, 77)","rgb(114, 192, 64)","rgb(89, 191, 192)","rgb(66, 144, 247)","rgb(54, 88, 226)","rgb(106, 57, 201)","rgb(216, 68, 147)","rgb(251, 233, 230)","rgb(252, 237, 225)","rgb(252, 239, 212)","rgb(252, 251, 207)","rgb(231, 246, 213)","rgb(218, 244, 240)","rgb(217, 237, 250)","rgb(224, 232, 250)","rgb(237, 225, 248)","rgb(246, 226, 234)","rgb(255, 163, 158)","rgb(255, 187, 150)","rgb(255, 213, 145)","rgb(255, 251, 143)","rgb(183, 235, 143)","rgb(135, 232, 222)","rgb(145, 213, 255)","rgb(173, 198, 255)","rgb(211, 173, 247)","rgb(255, 173, 210)","rgb(255, 77, 79)","rgb(255, 122, 69)","rgb(255, 169, 64)","rgb(255, 236, 61)","rgb(115, 209, 61)","rgb(54, 207, 201)","rgb(64, 169, 255)","rgb(89, 126, 247)","rgb(146, 84, 222)","rgb(247, 89, 171)","rgb(207, 19, 34)","rgb(212, 56, 13)","rgb(212, 107, 8)","rgb(212, 177, 6)","rgb(56, 158, 13)","rgb(8, 151, 156)","rgb(9, 109, 217)","rgb(29, 57, 196)","rgb(83, 29, 171)","rgb(196, 29, 127)","rgb(130, 0, 20)","rgb(135, 20, 0)","rgb(135, 56, 0)","rgb(97, 71, 0)","rgb(19, 82, 0)","rgb(0, 71, 79)","rgb(0, 58, 140)","rgb(6, 17, 120)","rgb(34, 7, 94)","rgb(120, 6, 80)"];var cw={selector:"font",preParseHtml:function(e){var t=ph(e);if("font"!==qD(t))return e;var n=t.attr("color")||"";return n&&(t.removeAttr("color"),t.css("color",n)),t[0]}};function dw(e,t){null==e.data&&(e.data={});var n=e.data;null==n.style&&(n.style={}),Object.assign(n.style,t)}var fw={renderStyle:function(e,t){var n=e,r=n.color,o=n.bgColor,i=t;return r&&dw(i,{color:r}),o&&dw(i,{backgroundColor:o}),i},styleToHtml:function(e,t){if(!ap.Text.isText(e))return t;var n,r=e,o=r.color,i=r.bgColor;return o||i?((GD(t)||"span"!==qD(n=ph(t)))&&(n=ph("<span>".concat(t,"</span>"))),o&&n.css("color",o),i&&n.css("background-color",i),WD(n)):t},preParseHtml:[cw],parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Text.isText(t))return t;var o=t,i=KD(r,"color");i&&(o.color=i);var a=KD(r,"background-color");return a||(a=KD(r,"background")),a&&(o.bgColor=a),o},menus:[{key:"color",factory:function(){return new uw},config:{colors:lw}},{key:"bgColor",factory:function(){return new sw},config:{colors:lw}}]},pw=function(){function e(){this.title=ry("common.enter"),this.iconSvg='<svg viewBox="0 0 1255 1024"><path d="M1095.111111 731.477333h-625.777778V1024L0 658.318222 469.333333 292.408889v292.636444h625.777778V0h156.444445v731.477333z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||!!ap.Range.isExpanded(t)},e.prototype.exec=function(e,t){var n=e.selection;if(null!=n){var r=[n.anchor.path[0]];ap.Transforms.insertNodes(e,{type:"paragraph",children:[{text:""}]},{at:r}),e.select(ap.Editor.start(e,r))}},e}(),hw={menus:[{key:"enter",factory:function(){return new pw}}]};var gw={type:"divider",elemToHtml:function(e,t){return"<hr/>"}},vw=function(){function e(){this.title=ry("divider.title"),this.iconSvg='<svg viewBox="0 0 1092 1024"><path d="M0 51.2m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M819.2 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M409.6 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 870.4m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!!$g.getSelectedElems(e).some((function(t){if(e.isVoid(t))return!0;var n=$g.getNodeType(t);return"table"===n||"pre"===n}))},e.prototype.exec=function(e,t){$g.isSelectedEmptyParagraph(e)&&ap.Transforms.removeNodes(e,{mode:"highest"}),ap.Transforms.insertNodes(e,{type:"divider",children:[{text:""}]},{mode:"highest"})},e}();var mw={renderElems:[{type:"divider",renderElem:function(e,t,n){var r=$g.isNodeSelected(n,e);return rb.h("div",{props:{contentEditable:!1,className:"w-e-textarea-divider"},dataset:{selected:r?"true":""},style:{},on:{mousedown:function(e){return e.preventDefault()}}},[rb.h("hr")])}}],elemsToHtml:[gw],parseElemsHtml:[{selector:"hr:not([data-w-e-type])",parseElemHtml:function(e,t,n){return{type:"divider",children:[{text:""}]}}}],menus:[{key:"divider",factory:function(){return new vw}}],editorPlugin:function(e){var t=e.isVoid,n=e.normalizeNode,r=e;return r.isVoid=function(e){return"divider"===e.type||t(e)},r.normalizeNode=function(e){var t=vp(e,2),o=t[0],i=t[1];if("divider"!==$g.getNodeType(o))return n([o,i]);$g.isLastNode(r,o)&&ap.Transforms.insertNodes(r,$g.genEmptyParagraph(),{at:[i[0]+1]})},r}};var yw=function(){function e(){this.title=ry("emotion.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m0-102.4c226.742857 0 409.6-182.857143 409.6-409.6S738.742857 102.4 512 102.4 102.4 285.257143 102.4 512s182.857143 409.6 409.6 409.6z m-204.8-358.4h409.6c0 113.371429-91.428571 204.8-204.8 204.8s-204.8-91.428571-204.8-204.8z m0-102.4c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8 76.8 32.914286 76.8 76.8-32.914286 76.8-76.8 76.8z m409.6 0c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8c43.885714 0 76.8 32.914286 76.8 76.8s-32.914286 76.8-76.8 76.8z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(e,t){},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=vp(ap.Editor.nodes(e,{match:function(t){return"pre"===$g.getNodeType(t)||!!ap.Editor.isVoid(e,t)},universal:!0}),1);return!!t[0]},e.prototype.getPanelContentElem=function(e){if(null==this.$content){var t=ph('<ul class="w-e-panel-content-emotion"></ul>');t.on("click","li",(function(t){var n=t.target;if(null!=n){t.preventDefault();var r=ph(n).text();e.insertText(r)}})),this.$content=t}var n=this.$content;if(null==n)return document.createElement("ul");n.empty();var r=e.getMenuConfig("emotion").emotions;return(void 0===r?[]:r).forEach((function(e){var t=ph("<li>".concat(e,"</li>"));n.append(t)})),n[0]},e}(),bw={menus:[{key:"emotion",factory:function(){return new yw},config:{emotions:"😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 😘 😗 😙 😚 😋 😛 😝 😜 🤓 😎 😏 😒 😞 😔 😟 😕 🙁 😣 😖 😫 😩 😢 😭 😤 😠 😡 😳 😱 😨 🤗 🤔 😶 😑 😬 🙄 😯 😴 😷 🤑 😈 🤡 💩 👻 💀 👀 👣 👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏".split(" ")}}]};var Ew=function(){function e(){this.tag="select",this.width=80}return e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.mark,n=ap.Editor.marks(e);return n&&n[t]?n[t]:""},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=vp(ap.Editor.nodes(e,{match:function(t){return"pre"===$g.getNodeType(t)||!!ap.Editor.isVoid(e,t)},universal:!0}),1);return!!t[0]},e.prototype.exec=function(e,t){var n=this.mark;t?e.addMark(n,t):e.removeMark(n)},e}(),Cw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("fontFamily.title"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M956.788364 152.110545h-24.110546l23.924364 9.029819 0.186182 121.018181h-65.070546l-86.574545-130.048H566.551273v650.14691l130.048 64.977454v65.163636h-390.050909v-65.163636l129.954909-64.977454V152.110545H198.283636L111.429818 282.065455H46.545455V69.259636C46.545455 33.792 82.664727 22.062545 98.955636 22.062545h812.683637c23.738182 0 45.056 15.173818 45.056 41.053091V169.425455v-17.221819z"></path></svg>',t.mark="fontFamily",t.selectPanelWidth=150,t}return dp(t,e),t.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig(this.mark).fontFamilyList,r=void 0===n?[]:n;t.push({text:ry("fontFamily.default"),value:""}),r.forEach((function(e){if("string"==typeof e)t.push({text:e,value:e,styleForRenderMenuList:{"font-family":e}});else if("object"==typeof e){var n=e.name,r=e.value;t.push({text:n,value:r,styleForRenderMenuList:{"font-family":r}})}}));var o=this.getValue(e),i=!1;return t.forEach((function(e){e.value===o?(i=!0,e.selected=!0):e.selected=void 0})),i||"string"!=typeof o||t.push({text:o,value:o,selected:!0}),t},t}(Ew),Dw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("fontSize.title"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 512h384v128h-128V1024h-128V640h-128z m896-256H708.2496v768h-136.4992V256H320V128h640z"></path></svg>',t.mark="fontSize",t}return dp(t,e),t.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig(this.mark).fontSizeList,r=void 0===n?[]:n;t.push({text:ry("fontSize.default"),value:""}),r.forEach((function(e){if("string"==typeof e)t.push({text:e,value:e});else if("object"==typeof e){var n=e.name,r=e.value;t.push({text:n,value:r})}}));var o=this.getValue(e),i=!1;return t.forEach((function(e){e.value===o?(i=!0,e.selected=!0):e.selected=void 0})),i||"string"!=typeof o||t.push({text:o,value:o,selected:!0}),t},t}(Ew);var ww={1:"12px",2:"14px",3:"16px",4:"19px",5:"24px",6:"32px",7:"48px"};var Aw={renderStyle:function(e,t){var n=e,r=n.fontSize,o=n.fontFamily,i=t;return r&&dw(i,{fontSize:r}),o&&dw(i,{fontFamily:o}),i},styleToHtml:function(e,t){if(!ap.Text.isText(e))return t;var n,r=e,o=r.fontSize,i=r.fontFamily;return o||i?((GD(t)||"span"!==qD(n=ph(t)))&&(n=ph("<span>".concat(t,"</span>"))),o&&n.css("font-size",o),i&&n.css("font-family",i),WD(n)):t},preParseHtml:[{selector:"font",preParseHtml:function(e){var t=ph(e);if("font"!==qD(t))return e;var n=t.attr("size")||"";n&&(t.removeAttr("size"),t.css("font-size",ww[n]));var r=t.attr("face")||"";return r&&(t.removeAttr("face"),t.css("font-family",r)),t[0]}}],parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Text.isText(t))return t;var o=t,i=KD(r,"font-size");i&&(o.fontSize=i);var a=KD(r,"font-family").replace(/"/g,"");return a&&(o.fontFamily=a),o},menus:[{key:"fontSize",factory:function(){return new Dw},config:{fontSizeList:["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"]}},{key:"fontFamily",factory:function(){return new Cw},config:{fontFamilyList:["黑体",{name:"仿宋",value:"仿宋"},"楷体","标楷体","华文仿宋","华文楷体",{name:"宋体",value:"宋体"},"微软雅黑","Arial","Tahoma","Verdana","Times New Roman","Courier New"]}}]};var Sw=function(){function e(){this.title=ry("formatPainter.title"),this.iconSvg='<svg viewBox="0 0 24 24"><path d="M8 19.997v-5h2v5h9v-7H5v7zm-4-9h16v-3h-6v-4h-4v4H4zm-1 10v-8H2v-6a1 1 0 0 1 1-1h5v-3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v3h5a1 1 0 0 1 1 1v6h-1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1"/></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(t){return e.attrs.isSelect},e.prototype.isDisabled=function(e){return!1},e.prototype.setFormatHtml=function(t){var n,r;if(t.getSelectionText().length){if(e.attrs.formatStyle){!function(e){var t=ap.Editor.marks(e);t&&Object.keys(t).forEach((function(t){e.removeMark(t)}))}(t);try{for(var o=gp(Object.entries(e.attrs.formatStyle)),i=o.next();!i.done;i=o.next()){var a=vp(i.value,2),s=a[0],u=a[1];t.addMark(s,u)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}e.attrs.formatStyle=null,e.attrs.isSelect=!1}},e.prototype.exec=function(t){e.attrs.isSelect?(e.attrs.isSelect=!1,e.attrs.formatStyle=null):t.getSelectionText().length&&(e.attrs.formatStyle=ap.Editor.marks(t),e.attrs.isSelect=!0);t.blur(),t.focus()},e.attrs={isSelect:!1,formatStyle:null},e}();var xw={menus:[{key:"formatPainter",factory:function(){return new Sw}}],editorPlugin:function(e){var t=new Sw,n=e.onChange,r=e,o=function(){t.setFormatHtml(r),document.removeEventListener("mouseup",o)};return r.onChange=function(){n(),Sw.attrs.isSelect&&(document.removeEventListener("mouseup",o),document.addEventListener("mouseup",o))},r}},Ow=function(){function e(){this.title=ry("fullScreen.title"),this.iconSvg=$D,this.tag="button",this.alwaysEnable=!0}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return e.isFullScreen},e.prototype.isDisabled=function(e){return!1},e.prototype.getIcon=function(e){return e.isFullScreen?$D:'<svg t="1723361745825" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8705" width="200" height="200"><path d="M703.926857 362.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V128a42.642286 42.642286 0 1 1 85.357715 0v149.357714h149.357714c21.211429 0 38.765714 15.433143 42.057143 35.693715l0.585143 6.948571a42.642286 42.642286 0 0 1-42.642286 42.642286H703.926857zM703.926857 938.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V704c0-23.552 19.090286-42.642286 42.642286-42.642286h192.073143a42.642286 42.642286 0 1 1 0 85.284572l-149.357714 0.073143v149.284571c0 21.211429-15.506286 38.765714-35.84 42.130286l-6.875429 0.512zM319.853714 938.642286a42.642286 42.642286 0 0 1-42.642285-42.642286v-149.284571H127.853714a42.642286 42.642286 0 0 1-42.130285-35.84l-0.585143-6.875429c0-23.552 19.163429-42.642286 42.715428-42.642286h192c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286zM127.853714 362.642286a42.642286 42.642286 0 1 1 0-85.284572H277.211429V128c0-21.211429 15.433143-38.765714 35.766857-42.130286l6.875428-0.512c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286H127.853714z" fill="#333333" p-id="8706"></path></svg>'},e.prototype.getTitle=function(e){return e.isFullScreen?ry("fullScreen.title"):ry("fullScreen.cancelTitle")},e.prototype.exec=function(e,t){e.isFullScreen?e.unFullScreen():e.fullScreen()},e}(),Tw={menus:[{key:"fullScreen",factory:function(){return new Ow}}]};function Nw(e){return function(t,n){return"<h".concat(e,">").concat(n,"</h").concat(e,">")}}var Bw={type:"header1",elemToHtml:Nw(1)},kw={type:"header2",elemToHtml:Nw(2)},Fw={type:"header3",elemToHtml:Nw(3)},Pw={type:"header4",elemToHtml:Nw(4)},Iw={type:"header5",elemToHtml:Nw(5)},Rw={type:"header6",elemToHtml:Nw(6)};function Lw(e){var t=vp(ap.Editor.nodes(e,{match:function(e){return $g.getNodeType(e).startsWith("header")},universal:!0}),1),n=t[0];if(null==n)return"paragraph";var r=vp(n,1)[0];return $g.getNodeType(r)}function _w(e){if(null==e.selection)return!0;var t=vp(ap.Editor.nodes(e,{match:function(e){var t=$g.getNodeType(e);return"paragraph"===t||!!t.startsWith("header")},universal:!0,mode:"highest"}),1);return!t[0]}function Mw(e,t){t&&ap.Transforms.setNodes(e,{type:t})}var jw=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return Lw(e)},e.prototype.isActive=function(e){return this.getValue(e)===this.type},e.prototype.isDisabled=function(e){return _w(e)},e.prototype.exec=function(e,t){var n=this.type;Mw(e,t===n?"paragraph":n)},e}(),Hw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H1",t.type="header1",t}return dp(t,e),t}(jw),zw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H2",t.type="header2",t}return dp(t,e),t}(jw),$w=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H3",t.type="header3",t}return dp(t,e),t}(jw),Uw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H4",t.type="header4",t}return dp(t,e),t}(jw),Vw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H5",t.type="header5",t}return dp(t,e),t}(jw),Gw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H6",t.type="header6",t}return dp(t,e),t}(jw),Ww=function(){function e(){this.title=ry("header.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M960 960c-51.2 0-102.4-3.2-153.6-3.2-51.2 0-99.2 3.2-150.4 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 57.6-28.8 86.4-48 19.2-12.8 19.2-60.8 19.2-80v-224-19.2c-9.6-3.2-19.2-3.2-28.8-3.2H320c-9.6 0-19.2 0-28.8 3.2V780.8c0 22.4 0 80 22.4 92.8 28.8 19.2 96-6.4 96 44.8 0 16-9.6 41.6-28.8 41.6-54.4 0-105.6-3.2-160-3.2-48 0-96 3.2-147.2 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 51.2-28.8 80-48 19.2-12.8 19.2-60.8 19.2-83.2V294.4c0-28.8 3.2-115.2-22.4-131.2-25.6-16-86.4 9.6-86.4-41.6 0-16 6.4-41.6 28.8-41.6 51.2 0 105.6 3.2 156.8 3.2 48 0 96-3.2 144-3.2 19.2 0 28.8 22.4 28.8 41.6 0 48-57.6 25.6-83.2 41.6-19.2 12.8-19.2 73.6-19.2 92.8v201.6c6.4 3.2 16 3.2 22.4 3.2h400c6.4 0 12.8 0 22.4-3.2V256c0-22.4 0-80-19.2-92.8-28.8-16-86.4 6.4-86.4-41.6 0-16 9.6-41.6 28.8-41.6 51.2 0 99.2 3.2 150.4 3.2 48 0 99.2-3.2 147.2-3.2 19.2 0 28.8 22.4 28.8 41.6 0 51.2-57.6 25.6-86.4 41.6-19.2 12.8-19.2 70.4-19.2 92.8v537.6c0 19.2 0 67.2 19.2 80 28.8 19.2 89.6-6.4 89.6 44.8 0 19.2-6.4 41.6-28.8 41.6z"></path></svg>',this.tag="select",this.width=60}return e.prototype.getOptions=function(e){var t=[{value:"header1",text:"H1",styleForRenderMenuList:{"font-size":"32px","font-weight":"bold"}},{value:"header2",text:"H2",styleForRenderMenuList:{"font-size":"24px","font-weight":"bold"}},{value:"header3",text:"H3",styleForRenderMenuList:{"font-size":"18px","font-weight":"bold"}},{value:"header4",text:"H4",styleForRenderMenuList:{"font-size":"16px","font-weight":"bold"}},{value:"header5",text:"H5",styleForRenderMenuList:{"font-size":"13px","font-weight":"bold"}},{value:"header6",text:"H6",styleForRenderMenuList:{"font-size":"11px","font-weight":"bold"}},{value:"paragraph",text:ry("header.text")}],n=this.getValue(e).toString();return t.forEach((function(e){e.value===n?e.selected=!0:e.selected=void 0})),t},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){return Lw(e)},e.prototype.isDisabled=function(e){return _w(e)},e.prototype.exec=function(e,t){Mw(e,t.toString())},e}(),qw={key:"headerSelect",factory:function(){return new Ww}},Kw={key:"header1",factory:function(){return new Hw}},Yw={key:"header2",factory:function(){return new zw}},Xw={key:"header3",factory:function(){return new $w}},Zw={key:"header4",factory:function(){return new Uw}},Jw={key:"header5",factory:function(){return new Vw}},Qw={key:"header6",factory:function(){return new Gw}};function eA(e){return function(t,n,r){var o=ph(t);return 0===(n=n.filter((function(e){return!!ap.Text.isText(e)||!!r.isInline(e)}))).length&&(n=[{text:o.text().replace(/\s+/gm," ")}]),{type:"header".concat(e),children:n}}}var tA={selector:"h1:not([data-w-e-type])",parseElemHtml:eA(1)},nA={selector:"h2:not([data-w-e-type])",parseElemHtml:eA(2)},rA={selector:"h3:not([data-w-e-type])",parseElemHtml:eA(3)},oA={selector:"h4:not([data-w-e-type])",parseElemHtml:eA(4)},iA={selector:"h5:not([data-w-e-type])",parseElemHtml:eA(5)},aA={selector:"h6:not([data-w-e-type])",parseElemHtml:eA(6)};function sA(e){return function(t,n,r){var o="h".concat(e);return rb.jsx(o,null,n)}}var uA={renderElems:[{type:"header1",renderElem:sA(1)},{type:"header2",renderElem:sA(2)},{type:"header3",renderElem:sA(3)},{type:"header4",renderElem:sA(4)},{type:"header5",renderElem:sA(5)},{type:"header6",renderElem:sA(6)}],elemsToHtml:[Bw,kw,Fw,Pw,Iw,Rw],parseElemsHtml:[tA,nA,rA,oA,iA,aA],menus:[qw,Kw,Yw,Xw,Zw,Jw,Qw],editorPlugin:function(e){var t=e.insertBreak,n=e;return n.insertBreak=function(){var r=vp(ap.Editor.nodes(n,{match:function(e){return $g.getNodeType(e).startsWith("header")},universal:!0}),1),o=r[0];if(o)if($g.isSelectionAtLineEnd(e,o[1])){ap.Transforms.insertNodes(n,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}else t();else t()},n}};var lA={type:"image",elemToHtml:function(e,t){var n=e,r=n.src,o=n.alt,i=void 0===o?"":o,a=n.href,s=void 0===a?"":a,u=n.width,l=void 0===u?"":u,c=n.height,d=void 0===c?"":c,f=n.style,p=void 0===f?{}:f,h=p.width,g=void 0===h?"":h,v=p.height,m=void 0===v?"":v,y="";return g&&(y+="width: ".concat(g,";")),m&&(y+="height: ".concat(m,";")),'<img src="'.concat(r,'" alt="').concat(i,'" data-href="').concat(s,'" width="').concat(l,'" height="').concat(d,'" style="').concat(y,'"/>')}};var cA=function(){function e(){this.title=ry("image.delete"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==$g.getSelectedNodeByType(e,"image")},e.prototype.exec=function(e,t){this.isDisabled(e)||ap.Transforms.removeNodes(e,{match:function(e){return $g.checkNodeType(e,"image")}})},e}();function dA(e){return void 0===e&&(e="r"),"".concat(e,"-").concat(Kh())}function fA(e){return e.replace(/</g,"<").replace(/>/g,">")}function pA(e){var t=e.selection;if(null==t)return!0;if(!ap.Range.isCollapsed(t))return!0;var n=vp(ap.Editor.nodes(e,{match:function(t){var n=$g.getNodeType(t);return"code"===n||("pre"===n||("link"===n||("list-item"===n||(!!n.startsWith("header")||("blockquote"===n||!!ap.Editor.isVoid(e,t))))))},universal:!0}),1);return!!n[0]}function hA(e,t,n){return pp(this,arguments,void 0,(function(e,t,n,r,o){var i,a;return void 0===r&&(r=""),void 0===o&&(o=""),hp(this,(function(s){switch(s.label){case 0:return(i=t.getMenuConfig(e).checkImage)?[4,i(n,r,o)]:[3,2];case 1:if("string"==typeof(a=s.sent()))return t.alert(a,"error"),[2,!1];if(null==a)return[2,!1];s.label=2;case 2:return[2,!0]}}))}))}function gA(e,t,n){return pp(this,void 0,void 0,(function(){var r;return hp(this,(function(o){switch(o.label){case 0:return(r=t.getMenuConfig(e).parseImageSrc)?[4,r(n)]:[3,2];case 1:return[2,o.sent()];case 2:return[2,n]}}))}))}function vA(e,t){return pp(this,arguments,void 0,(function(e,t,n,r){var o,i,a;return void 0===n&&(n=""),void 0===r&&(r=""),hp(this,(function(s){switch(s.label){case 0:return[4,hA("insertImage",e,t,n,r)];case 1:return s.sent()?[4,gA("insertImage",e,t)]:[2];case 2:return o=s.sent(),i={type:"image",src:fA(o),href:r,alt:n,style:{},children:[{text:""}]},null===e.selection&&e.restoreSelection(),$g.getSelectedNodeByType(e,"image")&&e.move(1),pA(e)?[2]:(ap.Transforms.insertNodes(e,i),(a=e.getMenuConfig("insertImage").onInsertedImage)&&a(i),[2])}}))}))}function mA(){return dA("w-e-edit-image")}var yA=function(){function e(){this.title=ry("image.edit"),this.iconSvg=HD,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=mA(),this.altInputId=mA(),this.hrefInputId=mA(),this.buttonId=mA()}return e.prototype.getValue=function(e){return""},e.prototype.getImageNode=function(e){return $g.getSelectedNodeByType(e,"image")},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"image"))},e.prototype.getModalPositionNode=function(e){return this.getImageNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.altInputId,i=n.hrefInputId,a=n.buttonId,s=this.getImageNode(e);if(null==s)throw new Error("Not found selected image node");var u=vp(hy(ry("image.src"),r),2),l=u[0],c=ph(u[1]),d=vp(hy(ry("image.desc"),o),2),f=d[0],p=ph(d[1]),h=vp(hy(ry("image.link"),i),2),g=h[0],v=ph(h[1]),m=vp(gy(a,ry("common.ok")),1)[0];if(null==this.$content){var y=ph("<div></div>");y.on("click","#".concat(a),(function(n){n.preventDefault();var a=y.find("#".concat(r)).val(),s=y.find("#".concat(o)).val(),u=y.find("#".concat(i)).val();t.updateImage(e,a,s,u),e.hidePanelOrModal()})),this.$content=y}var b=this.$content;b.empty(),b.append(l),b.append(f),b.append(g),b.append(m);var E=s,C=E.src,D=E.alt,w=void 0===D?"":D,A=E.href,S=void 0===A?"":A;return c.val(C),p.val(w),v.val(S),setTimeout((function(){c.focus()})),b[0]},e.prototype.updateImage=function(e,t,n,r,o){void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={}),t&&(e.restoreSelection(),this.isDisabled(e)||function(e,t){pp(this,arguments,void 0,(function(e,t,n,r,o){var i,a,s,u,l,c;return void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={}),hp(this,(function(d){switch(d.label){case 0:return[4,hA("editImage",e,t,n,r)];case 1:return d.sent()?[4,gA("editImage",e,t)]:[2];case 2:return i=d.sent(),null==(a=$g.getSelectedNodeByType(e,"image"))||(s=a.style,u={src:i,alt:n,href:r,style:fp(fp({},void 0===s?{}:s),o)},ap.Transforms.setNodes(e,u,{match:function(e){return $g.checkNodeType(e,"image")}}),l=$g.getSelectedNodeByType(e,"image"),(c=e.getMenuConfig("editImage").onUpdatedImage)&&c(l)),[2]}}))}))}(e,t,n,r,o))},e}();function bA(){return dA("w-e-insert-image")}var EA=function(){function e(){this.title=ry("image.editSize"),this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=bA(),this.heightInputId=bA(),this.buttonId=bA()}return e.prototype.getSelectedImageNode=function(e){return $g.getSelectedNodeByType(e,"image")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedImageNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedImageNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=t.widthInputId,r=t.heightInputId,o=t.buttonId,i=vp(hy(ry("image.width"),n,"auto"),2),a=i[0],s=ph(i[1]),u=vp(hy(ry("image.height"),r,"auto"),2),l=u[0],c=ph(u[1]),d=vp(gy(o,ry("image.ok")),1)[0],f=this.getSelectedImageNode(e);if(null==this.$content){var p=ph("<div></div>");p.on("click","#".concat(o),(function(t){t.preventDefault();var o=p.find("#".concat(n)).val().trim(),i=p.find("#".concat(r)).val().trim(),a=function(e){return/^\d+(\.\d+)?%$/.test(e)},s=function(e){return/^\d+(\.\d+)?$/.test(e)},u=function(e){return/^\d+(\.\d+)?px$/.test(e)},l="auto",c="auto";a(o)?l=o:s(o)?l="".concat(parseInt(o,10),"px"):u(o)&&(l=o),a(i)?c=i:s(i)?c="".concat(parseInt(i,10),"px"):u(i)&&(c=i);var d=f.style,h=void 0===d?{}:d;e.restoreSelection();var g=fp(fp({},h),{style:{width:l,height:c}});ap.Transforms.setNodes(e,g,{match:function(e){return $g.checkNodeType(e,"image")}}),e.hidePanelOrModal()})),this.$content=p}var h=this.$content;if(h.empty(),h.append(a),h.append(l),h.append(d),null==f)return h[0];var g=f.style,v=void 0===g?{}:g,m=v.width,y=void 0===m?"auto":m,b=v.height,E=void 0===b?"auto":b;return s.val(y),c.val(E),setTimeout((function(){s.focus()})),h[0]},e}();function CA(){return dA("w-e-insert-image")}var DA=function(){function e(){this.title=ry("image.netImage"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=CA(),this.altInputId=CA(),this.hrefInputId=CA(),this.buttonId=CA()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return pA(e)},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.altInputId,i=n.hrefInputId,a=n.buttonId,s=vp(hy(ry("image.src"),r),2),u=s[0],l=ph(s[1]),c=vp(hy(ry("image.desc"),o),2),d=c[0],f=ph(c[1]),p=vp(hy(ry("image.link"),i),2),h=p[0],g=ph(p[1]),v=vp(gy(a,ry("common.ok")),1)[0];if(null==this.$content){var m=ph("<div></div>");m.on("click","#".concat(a),(function(n){n.preventDefault();var a=m.find("#".concat(r)).val().trim(),s=m.find("#".concat(o)).val().trim(),u=m.find("#".concat(i)).val().trim();t.insertImage(e,a,s,u),e.hidePanelOrModal()})),this.$content=m}var y=this.$content;return y.empty(),y.append(u),y.append(d),y.append(h),y.append(v),l.val(""),f.val(""),g.val(""),setTimeout((function(){l.focus()})),y[0]},e.prototype.insertImage=function(e,t,n,r){void 0===n&&(n=""),void 0===r&&(r=""),t&&(e.restoreSelection(),this.isDisabled(e)||vA(e,t,n,r))},e}(),wA=function(){function e(){this.title=ry("image.viewLink"),this.iconSvg=zD,this.tag="button"}return e.prototype.getValue=function(e){var t=$g.getSelectedNodeByType(e,"image");return t&&t.href||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!this.getValue(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("View image link failed, image.href is '".concat(t,"'"));window.open(t,"_blank")}},e}(),AA=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.getSelectedNode=function(e){return $g.getSelectedNodeByType(e,"image")},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedNode(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=this.getSelectedNode(e);if(null!=n){var r=$g.getHoverbar(e);r&&r.hideAndClean();var o=n.style,i={style:fp(fp({},void 0===o?{}:o),{width:this.value,height:""})};ap.Transforms.setNodes(e,i,{match:function(e){return $g.checkNodeType(e,"image")}})}}},e}(),SA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="30%",t.value="30%",t}return dp(t,e),t}(AA),xA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="50%",t.value="50%",t}return dp(t,e),t}(AA),OA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="100%",t.value="100%",t}return dp(t,e),t}(AA),TA={onInsertedImage:function(e){},onUpdatedImage:function(e){},checkImage:function(e,t,n){return!0},parseImageSrc:function(e){return e}};function NA(e,t){var n=$g.findKey(e,t).id;return"w-e-image-container-".concat(n)}function BA(e,t,n,r){var o=ph("body"),i=NA(e,t),a=r.width,s=r.height,u=0,l=0,c=0,d=0,f=!1,p=null;var h=Ty((function(e){e.preventDefault();var t=e.clientX,n=l+(f?u-t:t-u),r=c*(n/l);n>d-6||null!=p&&(n<=15||r<=15||(p.css("width","".concat(n,"px")),p.css("height","".concat(r,"px"))))}),100);function g(n){if(o.off("mousemove",h),null!=p){var r=p.width().toFixed(2),i=p.height().toFixed(2),a={style:fp(fp({},t.style),{width:"".concat(r,"px"),height:"".concat(i,"px")})};ap.Transforms.setNodes(e,a,{at:$g.findPath(e,t)}),o.off("mouseup",g)}}function v(t,n){p=function(){var e=ph("#".concat(i));if(0===e.length)throw new Error("Cannot find image container elem");return e}(),u=t,d=n;var r=p.find("img");if(0===r.length)throw new Error("Cannot find image elem");l=r.width(),c=r.height(),o.on("mousemove",h),o.on("mouseup",g);var a=$g.getHoverbar(e);a&&a.hideAndClean()}var m={};return a&&(m.width=a),s&&(m.height=s),m.boxShadow="0 0 0 1px #B4D5FF",rb.jsx("div",{id:i,style:m,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(n){var r=ph(n.target);if(r.hasClass("w-e-image-dragger")){n.preventDefault(),(r.hasClass("left-top")||r.hasClass("left-bottom"))&&(f=!0);var o=$g.getParentNode(e,t);if(null!=o){var i=$g.toDOMNode(e,o),a=i.getBoundingClientRect?i.getBoundingClientRect():{width:0},s=window.getComputedStyle(i),u=parseFloat(s.paddingLeft),l=parseFloat(s.paddingRight),c=parseFloat(s.borderLeftWidth),d=parseFloat(s.borderRightWidth);v(n.clientX,a.width-u-l-c-d)}}}}},n,rb.jsx("div",{className:"w-e-image-dragger left-top"}),rb.jsx("div",{className:"w-e-image-dragger right-top"}),rb.jsx("div",{className:"w-e-image-dragger left-bottom"}),rb.jsx("div",{className:"w-e-image-dragger right-bottom"}))}var kA={type:"image",renderElem:function(e,t,n){var r=e,o=r.src,i=r.alt,a=void 0===i?"":i,s=r.href,u=void 0===s?"":s,l=r.style,c=void 0===l?{}:l,d=c.width,f=void 0===d?"":d,p=c.height,h=void 0===p?"":p,g=$g.isNodeSelected(n,e),v={maxWidth:"100%"};f&&(v.width="100%"),h&&(v.height="100%");var m=rb.jsx("img",{style:v,src:o,alt:a,"data-href":u}),y=n.isDisabled();return g&&!y?BA(n,e,m,{width:f,height:h}):function(e,t,n,r){var o=r.width,i=r.height,a={};o&&(a.width=o),i&&(a.height=i);var s=NA(e,t);return rb.jsx("div",{id:s,style:a,className:"w-e-image-container"},n)}(n,e,m,{width:f,height:h})}},FA={renderElems:[kA],elemsToHtml:[lA],parseElemsHtml:[{selector:"img:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e),o=r.attr("data-href")||"";return o=decodeURIComponent(o),{type:"image",src:r.attr("src")||"",alt:r.attr("alt")||"",href:o,style:{width:KD(r,"width"),height:KD(r,"height")},width:r.attr("width")||"",height:r.attr("height")||"",children:[{text:""}]}}}],menus:[{key:"insertImage",factory:function(){return new DA},config:TA},{key:"deleteImage",factory:function(){return new cA}},{key:"editImage",factory:function(){return new yA},config:TA},{key:"viewImageLink",factory:function(){return new wA}},{key:"imageWidth30",factory:function(){return new SA}},{key:"imageWidth50",factory:function(){return new xA}},{key:"imageWidth100",factory:function(){return new OA}},{key:"editorImageSizeMenu",factory:function(){return new EA}}],editorPlugin:function(e){var t=e.isInline,n=e.isVoid,r=e;return r.isInline=function(e){return"image"===e.type||t(e)},r.isVoid=function(e){return"image"===e.type||n(e)},r}},PA=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){var t=vp(ap.Editor.nodes(e,{match:function(e){return!!e.indent},universal:!0}),1),n=t[0];return null==n?"":vp(n,1)[0].indent||""},e.prototype.isActive=function(e){return!1},e.prototype.getMatchNode=function(e){var t=vp(ap.Editor.nodes(e,{match:function(e){var t=$g.getNodeType(e);return"paragraph"===t||!!t.startsWith("header")},universal:!0,mode:"highest"}),1),n=t[0];return null==n?null:n[0]},e}(),IA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("indent.decrease"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m256-512v384l-256-192z"></path></svg>',t}return dp(t,e),t.prototype.isDisabled=function(e){var t=this.getMatchNode(e);return null==t||!t.indent},t.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{indent:null},{match:function(e){return ap.Element.isElement(e)}})},t}(PA),RA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("indent.increase"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',t.DEFAULT_INDENT_VALUE="2em",t}return dp(t,e),t.prototype.isDisabled=function(e){var t=this.getMatchNode(e);return null==t||!!t.indent},t.prototype.getIndentValue=function(e){var t=this.getMatchNode(e);if(!t)return this.DEFAULT_INDENT_VALUE;var n=t.children.filter(ap.Text.isText)[0];if(!n||!n.fontSize)return this.DEFAULT_INDENT_VALUE;var r=n.fontSize,o=parseInt(n.fontSize,10),i=r.replace("".concat(o),"");return"".concat(2*o).concat(i)},t.prototype.exec=function(e,t){var n=this.getIndentValue(e);ap.Transforms.setNodes(e,{indent:n},{match:function(e){return ap.Element.isElement(e)},mode:"highest"})},t}(PA);var LA={renderStyle:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.indent,r=t;return n&&dw(r,{textIndent:n}),r},styleToHtml:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.indent;if(!n)return t;var r=ph(t);return r.css("text-indent",n),WD(r)},preParseHtml:[{selector:"p,h1,h2,h3,h4,h5",preParseHtml:function(e){var t=ph(e),n=KD(t,"padding-left");return/\dem/.test(n)&&t.css("text-indent","2em"),/\dpx/.test(n)&&parseInt(n,10)%32==0&&t.css("text-indent","2em"),t[0]}}],parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Element.isElement(t))return t;var o=t,i=KD(r,"text-indent"),a=parseInt(i,10);return i&&a>0&&(o.indent=i),o},menus:[{key:"indent",factory:function(){return new RA}},{key:"delIndent",factory:function(){return new IA}}]},_A=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!!$g.getSelectedElems(e).some((function(t){var n=t.type;return!(!ap.Editor.isVoid(e,t)||!ap.Editor.isBlock(e,t)||"video"===n)||!!["pre","code"].includes(n)}))},e}(),MA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("justify.center"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return dp(t,e),t.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{textAlign:"center"},{match:function(t){return ap.Element.isElement(t)&&!e.isInline(t)}})},t}(_A),jA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("justify.justify"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>',t}return dp(t,e),t.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{textAlign:"justify"},{match:function(t){return ap.Element.isElement(t)&&!e.isInline(t)}})},t}(_A),HA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("justify.left"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return dp(t,e),t.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{textAlign:"left"},{match:function(t){return ap.Element.isElement(t)&&!e.isInline(t)}})},t}(_A),zA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("justify.right"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return dp(t,e),t.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{textAlign:"right"},{match:function(t){return ap.Element.isElement(t)&&!e.isInline(t)}})},t}(_A);var $A={renderStyle:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.textAlign,r=t;return n&&dw(r,{textAlign:n}),r},styleToHtml:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.textAlign;if(!n)return t;var r=ph(t);return r.css("text-align",n),WD(r)},parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Element.isElement(t))return t;var o=t,i=KD(r,"text-align");return i&&(o.textAlign=i),o},menus:[{key:"justifyLeft",factory:function(){return new HA}},{key:"justifyRight",factory:function(){return new zA}},{key:"justifyCenter",factory:function(){return new MA}},{key:"justifyJustify",factory:function(){return new jA}}]};var UA=function(){function e(){this.title=ry("lineHeight.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M964 788a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526zM198.93 144.306c6.668-5.798 16.774-5.094 22.573 1.574l122.26 140.582a16 16 0 0 1 3.927 10.5c0 8.836-7.164 16-16 16h-61.8a8 8 0 0 0-8 8v390.077h69.819a16 16 0 0 1 10.502 3.928c6.666 5.8 7.37 15.906 1.57 22.573L221.476 878.123a16 16 0 0 1-1.57 1.57c-6.668 5.8-16.774 5.097-22.574-1.57L75.051 737.538a16 16 0 0 1-3.928-10.5c0-8.837 7.163-16 16-16h69.822V312.96H87.127a16 16 0 0 1-10.502-3.928c-6.666-5.8-7.37-15.906-1.57-22.573l122.303-140.582a16 16 0 0 1 1.572-1.572zM964 465a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z m0-323a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z"></path></svg>',this.tag="select",this.width=80}return e.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig("lineHeight").lineHeightList,r=void 0===n?[]:n;t.push({text:ry("lineHeight.default"),value:""}),r.forEach((function(e){t.push({text:e,value:e})}));var o=this.getValue(e);return t.forEach((function(e){e.value===o?e.selected=!0:e.selected=void 0})),t},e.prototype.getMatchNode=function(e){var t=vp(ap.Editor.nodes(e,{match:function(e){var t=$g.getNodeType(e);return!!t.startsWith("header")||!!["paragraph","blockquote","list-item"].includes(t)},universal:!0,mode:"highest"}),1),n=t[0];return null==n?null:n[0]},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.getMatchNode(e);return null==t?"":ap.Element.isElement(t)&&t.lineHeight||""},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getMatchNode(e)},e.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{lineHeight:t.toString()},{mode:"highest"})},e}();var VA={renderStyle:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.lineHeight,r=t;return n&&dw(r,{lineHeight:n}),r},styleToHtml:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.lineHeight;if(!n)return t;var r=ph(t);return r.css("line-height",n),WD(r)},parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Element.isElement(t))return t;var o=t,i=n.getMenuConfig("lineHeight").lineHeightList,a=void 0===i?[]:i,s=KD(r,"line-height");return s&&a.includes(s)&&(o.lineHeight=s),o},menus:[{key:"lineHeight",factory:function(){return new UA},config:{lineHeightList:["1","1.15","1.5","2","2.5","3"]}}]};var GA={type:"link",elemToHtml:function(e,t){var n=e,r=n.url,o=n.target,i=void 0===o?"_blank":o;return'<a href="'.concat(r,'" target="').concat(i,'">').concat(t,"</a>")}};function WA(e,t,n,r){return pp(this,void 0,void 0,(function(){var o,i;return hp(this,(function(a){switch(a.label){case 0:return(o=t.getMenuConfig(e).checkLink)?[4,o(n,r)]:[3,2];case 1:if("string"==typeof(i=a.sent()))return t.alert(i,"error"),[2,!1];if(null==i)return[2,!1];a.label=2;case 2:return[2,!0]}}))}))}function qA(e,t,n){return pp(this,void 0,void 0,(function(){var r;return hp(this,(function(o){switch(o.label){case 0:return(r=t.getMenuConfig(e).parseLinkUrl)?[4,r(n)]:[3,2];case 1:return[2,o.sent()];case 2:return[2,n]}}))}))}function KA(e){return null==e.selection||!!$g.getSelectedElems(e).some((function(t){var n=t.type;return!!e.isVoid(t)||!!["pre","code","link"].includes(n)}))}function YA(e,t){return{type:"link",url:fA(e),children:t?[{text:t}]:[]}}function XA(e,t,n){return pp(this,void 0,void 0,(function(){var r,o,i,a,s;return hp(this,(function(u){switch(u.label){case 0:return n?(t||(t=n),e.restoreSelection(),KA(e)?[2]:[4,WA("insertLink",e,t,n)]):[2];case 1:return u.sent()?[4,qA("insertLink",e,n)]:[2];case 2:if(r=u.sent(),null==(o=e.selection))return[2];if(ap.Range.isCollapsed(o)){if((a=$g.getLeftLengthOfMaxLength(e))<=0)return[2];e.insertText(" "),a<t.length+1&&(t=t.slice(0,a-1)),s=YA(r,t),ap.Transforms.insertNodes(e,s),e.insertFragment([{text:" "}])}else if((i=ap.Editor.string(e,o))!==t){if((a=$g.getLeftLengthOfMaxLength(e))<=0)return[2];a<i.length-t.length&&(t=t.slice(0,a)),e.deleteFragment(),s=YA(r,t),ap.Transforms.insertNodes(e,s)}else s=YA(r),ap.Transforms.wrapNodes(e,s,{split:!0}),ap.Transforms.collapse(e,{edge:"end"});return[2]}}))}))}function ZA(){return dA("w-e-update-link")}var JA=function(){function e(){this.title=ry("link.edit"),this.iconSvg=HD,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.urlInputId=ZA(),this.buttonId=ZA()}return e.prototype.getSelectedLinkElem=function(e){var t=$g.getSelectedNodeByType(e,"link");return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectedLinkElem(e);return t&&t.url||""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedLinkElem(e)},e.prototype.getModalPositionNode=function(e){return $g.getSelectedNodeByType(e,"link")},e.prototype.getModalContentElem=function(e){var t=this.urlInputId,n=this.buttonId,r=vp(hy(ry("link.url"),t),2),o=r[0],i=ph(r[1]),a=vp(gy(n,ry("common.ok")),1)[0];if(null==this.$content){var s=ph("<div></div>");s.on("click","#".concat(n),(function(n){n.preventDefault(),e.restoreSelection();var r=$g.getSelectedNodeByType(e,"link"),o=r?ap.Node.string(r):"",i=s.find("#".concat(t)).val();!function(e,t,n){pp(this,void 0,void 0,(function(){var r,o;return hp(this,(function(i){switch(i.label){case 0:return n?[4,WA("editLink",e,t,n)]:[2];case 1:return i.sent()?[4,qA("editLink",e,n)]:[2];case 2:return r=i.sent(),o={url:fA(r)},ap.Transforms.setNodes(e,o,{match:function(e){return $g.checkNodeType(e,"link")}}),[2]}}))}))}(e,o,i),e.hidePanelOrModal()})),this.$content=s}var u=this.$content;u.empty(),u.append(o),u.append(a);var l=this.getValue(e);return i.val(l),setTimeout((function(){i.focus()})),u[0]},e}();function QA(){return dA("w-e-insert-link")}var eS=function(){function e(){this.title=ry("link.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M440.224 635.776a51.84 51.84 0 0 1-36.768-15.232c-95.136-95.136-95.136-249.92 0-345.056l192-192C641.536 37.408 702.816 12.032 768 12.032s126.432 25.376 172.544 71.456c95.136 95.136 95.136 249.92 0 345.056l-87.776 87.776a51.968 51.968 0 1 1-73.536-73.536l87.776-87.776a140.16 140.16 0 0 0 0-197.984c-26.432-26.432-61.6-40.992-99.008-40.992s-72.544 14.56-99.008 40.992l-192 192a140.16 140.16 0 0 0 0 197.984 51.968 51.968 0 0 1-36.768 88.768z"></path><path d="M256 1012a242.4 242.4 0 0 1-172.544-71.456c-95.136-95.136-95.136-249.92 0-345.056l87.776-87.776a51.968 51.968 0 1 1 73.536 73.536l-87.776 87.776a140.16 140.16 0 0 0 0 197.984c26.432 26.432 61.6 40.992 99.008 40.992s72.544-14.56 99.008-40.992l192-192a140.16 140.16 0 0 0 0-197.984 51.968 51.968 0 1 1 73.536-73.536c95.136 95.136 95.136 249.92 0 345.056l-192 192A242.4 242.4 0 0 1 256 1012z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=QA(),this.urlInputId=QA(),this.buttonId=QA()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return KA(e)},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=e.selection,n=this,r=n.textInputId,o=n.urlInputId,i=n.buttonId,a=vp(hy(ry("link.text"),r),2),s=a[0],u=ph(a[1]),l=vp(hy(ry("link.url"),o),2),c=l[0],d=ph(l[1]),f=vp(gy(i,ry("common.ok")),1)[0];if(null==this.$content){var p=ph("<div></div>");p.on("click","#".concat(i),(function(t){t.preventDefault();var n=p.find("#".concat(r)).val(),i=p.find("#".concat(o)).val();XA(e,n,i),e.hidePanelOrModal()})),this.$content=p}var h=this.$content;if(h.empty(),h.append(s),h.append(c),h.append(f),null==t||ap.Range.isCollapsed(t))u.val("");else{var g=ap.Editor.string(e,t);u.val(g)}return d.val(""),setTimeout((function(){u.focus()})),h[0]},e}(),tS=function(){function e(){this.title=ry("link.unLink"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M608.16328 811.815036c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.347563 89.347564c-118.525421 118.523421-311.38448 118.531421-429.919901 0-118.527421-118.529421-118.527421-311.39048 0-429.917901l89.349564-89.349563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.195613 79.195613c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.349563 89.347564c-56.143726 56.145726-56.143726 147.49928 0 203.645005 56.143726 56.143726 147.49928 56.145726 203.647005 0l89.347564-89.347563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.193613 79.195613z m-113.135447-520.429459c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.347564-89.347564c56.143726-56.149726 147.49928-56.145726 203.647006 0 56.143726 56.145726 56.143726 147.49928 0 203.645006l-89.349564 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.195613 79.195613c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.349564-89.349563c118.529421-118.529421 118.529421-311.38848 0-429.917901-118.531421-118.527421-311.38848-118.527421-429.919901 0l-89.347563 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.193613 79.195613z m469.653707 718.556492l45.253779-45.253779c18.745908-18.745908 18.745908-49.13776 0-67.881669L127.195629 14.062931c-18.745908-18.745908-49.13776-18.745908-67.881669 0L14.058181 59.31871c-18.745908 18.745908-18.745908 49.13776 0 67.881669l882.74169 882.74169c18.745908 18.743908 49.13776 18.743908 67.881669 0z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==$g.getSelectedNodeByType(e,"link")},e.prototype.exec=function(e,t){this.isDisabled(e)||ap.Transforms.unwrapNodes(e,{match:function(e){return $g.checkNodeType(e,"link")}})},e}(),nS=function(){function e(){this.title=ry("link.view"),this.iconSvg=zD,this.tag="button"}return e.prototype.getSelectedLinkElem=function(e){var t=$g.getSelectedNodeByType(e,"link");return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectedLinkElem(e);return t&&t.url||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedLinkElem(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("View link failed, link url is '".concat(t,"'"));window.open(t,"_blank")}},e}(),rS={checkLink:function(e,t){return!0},parseLinkUrl:function(e){return e}},oS={key:"insertLink",factory:function(){return new eS},config:rS},iS={key:"editLink",factory:function(){return new JA},config:rS},aS={key:"unLink",factory:function(){return new tS}},sS={key:"viewLink",factory:function(){return new nS}};var uS,lS,cS={selector:"a:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);return 0===(t=t.filter((function(e){return!!ap.Text.isText(e)||!!n.isInline(e)}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"link",url:r.attr("href")||"",target:r.attr("target")||"",children:t}}};var dS=E(function(){if(lS)return uS;lS=1,uS=function(r){if("string"!=typeof r)return!1;var o=r.match(e);if(!o)return!1;var i=o[1];if(!i)return!1;if(t.test(i)||n.test(i))return!0;return!1};var e=/^(?:\w+:)?\/\/(\S+)$/,t=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;return uS}());var fS={type:"link",renderElem:function(e,t,n){var r=e,o=r.url,i=r.target,a=void 0===i?"_blank":i;return rb.jsx("a",{href:o,target:a},t)}},pS={renderElems:[fS],elemsToHtml:[GA],parseElemsHtml:[cS],menus:[oS,iS,aS,sS],editorPlugin:function(e){var t=e.isInline,n=e.insertData,r=e.normalizeNode,o=e;return o.isInline=function(e){return"link"===e.type||t(e)},o.insertData=function(e){var t=e.getData("text/plain");if(dS(t)){if(/<img[^>]+>/.test(e.getData("text/html")))n(e);else if(!KA(o)){var r=o.selection;if(null!=r){var i=ap.Editor.string(o,r);XA(o,i,t)}}}else n(e)},o.normalizeNode=function(e){var t=vp(e,2),n=t[0],i=t[1];return"link"!==$g.getNodeType(n)?r([n,i]):""===ap.Node.string(n)?ap.Transforms.removeNodes(o,{at:i}):r([n,i])},o}};var hS={selector:"p:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);return 0===(t=t.filter((function(e){return!!ap.Text.isText(e)||!!n.isInline(e)}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"paragraph",children:t}}};function gS(e){var t=vp(ap.Editor.nodes(e,{match:function(t){return e.children[0]===t},mode:"highest"}),1),n=t[0];if(null==n)return!1;var r=n[0];if(!ap.Element.isElement(r))return!1;if("paragraph"===r.type)return!1;if(""!==ap.Node.string(r))return!1;var o=r.children,i=void 0===o?[]:o;return!!ap.Text.isText(i[0])&&(ap.Transforms.setNodes(e,{type:"paragraph"}),!0)}var vS={type:"paragraph",renderElem:function(e,t,n){return rb.jsx("p",null,t)}},mS={renderElems:[vS],elemsToHtml:[{type:"paragraph",elemToHtml:function(e,t){return""===t?"<p><br></p>":"<p>".concat(t,"</p>")}}],parseElemsHtml:[hS],editorPlugin:function(e){var t=e.deleteBackward,n=e.deleteForward,r=e;return r.deleteBackward=function(e){gS(r)||t(e)},r.deleteForward=function(e){gS(r)||n(e)},r}};function yS(e,t){if(null==e.selection)return!0;var n=vp(ap.Editor.nodes(e,{match:function(t){return"pre"===$g.getNodeType(t)||!!ap.Editor.isVoid(e,t)},universal:!0}),1);return!!n[0]}function bS(e,t){Object.keys(t).forEach((function(t){"text"!==t&&ap.Editor.removeMark(e,t)}))}var ES=function(){function e(){this.marksNeedToRemove=[],this.tag="button"}return e.prototype.getValue=function(e){var t=this.mark,n=ap.Editor.marks(e);if(n)return n[t];var r=vp(ap.Editor.nodes(e,{match:function(e){return!0===e[t]}}),1);return!!r[0]},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){return yS(e,this.mark)},e.prototype.exec=function(e,t){var n=this.mark,r=this.marksNeedToRemove;t?e.removeMark(n):(e.addMark(n,!0),r&&r.forEach((function(t){return e.removeMark(t)})))},e}(),CS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="bold",t.title=ry("textStyle.bold"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M707.872 484.64A254.88 254.88 0 0 0 768 320c0-141.152-114.848-256-256-256H192v896h384c141.152 0 256-114.848 256-256a256.096 256.096 0 0 0-124.128-219.36zM384 192h101.504c55.968 0 101.504 57.408 101.504 128s-45.536 128-101.504 128H384V192z m159.008 640H384v-256h159.008c58.464 0 106.016 57.408 106.016 128s-47.552 128-106.016 128z"></path></svg>',t.hotkey="mod+b",t}return dp(t,e),t}(ES),DS=function(){function e(){this.title=ry("textStyle.clear"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M969.382408 288.738615l-319.401123-270.852152a67.074236 67.074236 0 0 0-96.459139 5.74922l-505.931379 574.922021a68.35184 68.35184 0 0 0-17.886463 47.910169 74.101061 74.101061 0 0 0 24.274486 47.910168l156.50655 132.232065h373.060512L975.131628 383.281347a67.074236 67.074236 0 0 0-5.74922-96.459139z m-440.134747 433.746725H264.144729l-90.071117-78.572676c-5.74922-5.74922-12.137243-12.137243-12.137243-17.886463a36.411728 36.411728 0 0 1 5.749221-24.274485l210.804741-240.828447 265.102932 228.691204z m-439.495945 180.781036h843.218964a60.047411 60.047411 0 1 1 0 120.733624H89.751716a60.047411 60.047411 0 1 1 0-120.733624z m0 0"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return yS(e)},e.prototype.exec=function(e,t){var n,r,o=ap.Editor.nodes(e,{match:function(e){return ap.Text.isText(e)},universal:!0});try{for(var i=gp(o),a=i.next();!a.done;a=i.next()){bS(e,a.value[0])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e}(),wS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="code",t.title=ry("textStyle.code"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M576 736l96 96 320-320L672 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224z"></path></svg>',t.hotkey="mod+e",t}return dp(t,e),t}(ES),AS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="italic",t.title=ry("textStyle.italic"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M896 64v64h-128L448 896h128v64H128v-64h128L576 128h-128V64z"></path></svg>',t.hotkey="mod+i",t}return dp(t,e),t}(ES),SS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="sub",t.marksNeedToRemove=["sup"],t.title=ry("textStyle.sub"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 910.016v50.016h128v64h-192v-146.016l128-60V768h-128v-64h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',t.hotkey="",t}return dp(t,e),t}(ES),xS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="sup",t.marksNeedToRemove=["sub"],t.title=ry("textStyle.sup"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 206.016v50.016h128v64h-192V174.016l128-60V64h-128V0h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',t.hotkey="",t}return dp(t,e),t}(ES),OS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="through",t.title=ry("textStyle.through"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M1024 512v64h-234.496c27.52 38.496 42.496 82.688 42.496 128 0 70.88-36.672 139.04-100.576 186.976C672.064 935.488 594.144 960 512 960s-160.064-24.512-219.424-69.024C228.64 843.04 192 774.88 192 704h128c0 69.376 87.936 128 192 128s192-58.624 192-128-87.936-128-192-128H0v-64h299.52a385.984 385.984 0 0 1-6.944-5.024C228.64 459.04 192 390.88 192 320s36.672-139.04 100.576-186.976C351.936 88.512 429.856 64 512 64s160.064 24.512 219.424 69.024C795.328 180.96 832 249.12 832 320h-128c0-69.376-87.936-128-192-128s-192 58.624-192 128 87.936 128 192 128c78.976 0 154.048 22.688 212.48 64H1024z"></path></svg>',t.hotkey="mod+shift+x",t}return dp(t,e),t}(ES),TS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="underline",t.title=ry("textStyle.underline"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M704 64l128 0 0 416c0 159.072-143.264 288-320 288s-320-128.928-320-288l0-416 128 0 0 416c0 40.16 18.24 78.688 51.36 108.512 36.896 33.216 86.848 51.488 140.64 51.488s103.744-18.304 140.64-51.488c33.12-29.792 51.36-68.352 51.36-108.512l0-416zM192 832l640 0 0 128-640 0z"></path></svg>',t.hotkey="mod+u",t}return dp(t,e),t}(ES);function NS(e,t){return 0!==e.length&&(!!e[0].matches(t)||e.find(t).length>0)}function BS(e,t){var n=t,r=e,o=r.bold,i=r.italic,a=r.underline,s=r.code,u=r.through,l=r.sub,c=r.sup;return o&&(n="<strong>".concat(n,"</strong>")),s&&(n="<code>".concat(n,"</code>")),i&&(n="<em>".concat(n,"</em>")),a&&(n="<u>".concat(n,"</u>")),u&&(n="<s>".concat(n,"</s>")),l&&(n="<sub>".concat(n,"</sub>")),c&&(n="<sup>".concat(n,"</sup>")),n}var kS={renderStyle:function(e,t){var n=e,r=n.bold,o=n.italic,i=n.underline,a=n.code,s=n.through,u=n.sub,l=n.sup,c=t;return r&&(c=rb.jsx("strong",null,c)),a&&(c=rb.jsx("code",null,c)),o&&(c=rb.jsx("em",null,c)),i&&(c=rb.jsx("u",null,c)),s&&(c=rb.jsx("s",null,c)),u&&(c=rb.jsx("sub",null,c)),l&&(c=rb.jsx("sup",null,c)),c},menus:[{key:"bold",factory:function(){return new CS}},{key:"underline",factory:function(){return new TS}},{key:"italic",factory:function(){return new AS}},{key:"through",factory:function(){return new OS}},{key:"code",factory:function(){return new wS}},{key:"sub",factory:function(){return new SS}},{key:"sup",factory:function(){return new xS}},{key:"clearStyle",factory:function(){return new DS}}],styleToHtml:function(e,t){if(!ap.Text.isText(e))return t;if(GD(t))return BS(e,t);var n=ph(t),r=n.html();return r=BS(e,r),n.html(r),WD(n)},parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Text.isText(t))return t;var o=t;return NS(r,"b,strong")&&(o.bold=!0),NS(r,"i,em")&&(o.italic=!0),NS(r,"u")&&(o.underline=!0),NS(r,"s,strike")&&(o.through=!0),NS(r,"sub")&&(o.sub=!0),NS(r,"sup")&&(o.sup=!0),NS(r,"code")&&(o.code=!0),o}};var FS={type:"todo",elemToHtml:function(e,t){var n=e.checked;return'<div data-w-e-type="todo"><input type="checkbox" disabled '.concat(n?"checked":"",">").concat(t,"</div>")}},PS=function(){function e(){this.title=ry("todo.todo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M278.755556 403.911111l-79.644445 79.644445L455.111111 739.555556l568.888889-568.888889-79.644444-79.644445L455.111111 580.266667l-176.355555-176.355556zM910.222222 910.222222H113.777778V113.777778h568.888889V0H113.777778C51.2 0 0 51.2 0 113.777778v796.444444c0 62.577778 51.2 113.777778 113.777778 113.777778h796.444444c62.577778 0 113.777778-51.2 113.777778-113.777778V455.111111h-113.777778v455.111111z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!!$g.getSelectedNodeByType(e,"todo")},e.prototype.isDisabled=function(e){return null==e.selection||!!$g.getSelectedElems(e).some((function(t){if(ap.Editor.isVoid(e,t)&&ap.Editor.isBlock(e,t))return!0;var n=t.type;return!!["pre","table","list-item"].includes(n)}))},e.prototype.exec=function(e,t){var n=this.isActive(e);ap.Transforms.setNodes(e,{type:n?"paragraph":"todo"})},e}();var IS={selector:'div[data-w-e-type="todo"]',parseElemHtml:function(e,t,n){var r=ph(e);0===(t=t.filter((function(e){return!!ap.Text.isText(e)||!!n.isInline(e)}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]);var o=!1;return null!=r.find('input[type="checkbox"]').attr("checked")&&(o=!0),{type:"todo",checked:o,children:t}}};var RS={type:"todo",renderElem:function(e,t,n){var r=!1;n.isDisabled()&&(r=!0);var o=e.checked,i=rb.jsx("div",{style:{margin:"5px 0"}},rb.jsx("span",{contentEditable:!1,style:{marginRight:"0.5em"}},rb.jsx("input",{type:"checkbox",checked:o,disabled:r,on:{change:function(t){var r=$g.findPath(n,e),o={checked:t.target.checked};ap.Transforms.setNodes(n,o,{at:r})}}})),rb.jsx("span",null,t));return i}},LS={renderElems:[RS],elemsToHtml:[FS],preParseHtml:[{selector:"ul.w-e-todo",preParseHtml:function(e){var t=ph(e).find("li"),n=ph('<div data-w-e-type="todo"></div>'),r=t.find("input[type]");return n.append(r),t.children()[0].remove(),n[0].innerHTML+=t[0].innerHTML,n[0]}}],parseElemsHtml:[IS],menus:[{key:"todo",factory:function(){return new PS}}],editorPlugin:function(e){var t=e.deleteBackward,n=e;return n.deleteBackward=function(n){var r=e.selection;if(r&&ap.Range.isCollapsed(r)){var o=$g.getSelectedNodeByType(e,"todo");if(o&&0===ap.Node.string(o).length)return void ap.Transforms.setNodes(e,{type:"paragraph"},{mode:"highest"})}t(n)},n}},_S=function(){function e(){this.title=ry("undo.redo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0.00032 576a510.72 510.72 0 0 0 173.344 384l84.672-96A383.136 383.136 0 0 1 128.00032 576C128.00032 363.936 299.93632 192 512.00032 192c106.048 0 202.048 42.976 271.52 112.48L640.00032 448h384V64l-149.984 149.984A510.272 510.272 0 0 0 512.00032 64C229.21632 64 0.00032 293.216 0.00032 576z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection},e.prototype.exec=function(e,t){"function"==typeof e.redo&&e.redo()},e}(),MS=function(){function e(){this.title=ry("undo.undo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 64A510.272 510.272 0 0 0 149.984 213.984L0.032 64v384h384L240.512 304.48A382.784 382.784 0 0 1 512.032 192c212.064 0 384 171.936 384 384 0 114.688-50.304 217.632-130.016 288l84.672 96a510.72 510.72 0 0 0 173.344-384c0-282.784-229.216-512-512-512z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection},e.prototype.exec=function(e,t){"function"==typeof e.undo&&e.undo()},e}(),jS=[kS,fw,Aw,LA,$A,VA,FA,mw,bw,pS,iw,JD,uA,mS,LS,xw,{menus:[{key:"redo",factory:function(){return new _S}},{key:"undo",factory:function(){return new MS}}]},Tw,hw];ty("en",{listModule:{unOrderedList:"Unordered list",orderedList:"Ordered list"}}),ty("zh-CN",{listModule:{unOrderedList:"无序列表",orderedList:"有序列表"}});var HS=new WeakMap;function zS(e){var t,n=e.children||[],r=n.length;if(0===r)return"";for(var o=0;o<r&&!t;o+=1){var i=n[o];ap.Text.isText(i)&&(t=i)}return null==t?"":t.color||""}function $S(e,t,n){for(var r=t.type,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["type"]),i=void 0!==n?n:o.level||0,a=$g.findPath(e,t),s=a;;){if(0===s.length||0===a[a.length-1])return null;s=ap.Path.previous(s);var u=ap.Editor.node(e,s);if(!u)return null;var l=vp(u,1)[0],c=l.level,d=void 0===c?0:c;if($g.getNodeType(l)!==r)return null;if(d===i)return l}}function US(e,t,n){var r=$S(e,t,n);return!!r&&r.ordered===t.ordered}var VS=[];var GS={type:"list-item",elemToHtml:function(e,t){var n="",r="",o=e.ordered,i=void 0!==o&&o?"ol":"ul",a=function(e){var t=HS.get(e);if(null==t)return 0;var n=e,r=n.type,o=n.ordered,i=void 0!==o&&o,a=n.level,s=void 0===a?0:a,u=$g.findPath(t,e);if(0===u[0])return s+1;var l=ap.Path.previous(u),c=ap.Editor.node(t,l);if(!c)return 0;var d=vp(c,1)[0];if($g.getNodeType(d)!==r)return s+1;var f=d,p=f.ordered,h=void 0!==p&&p,g=f.level,v=void 0===g?0:g;return v<s?s-v:v>s?US(t,e)?0:1:v===s?h===i?0:1:0}(e);if(a>0)for(var s=0;s<a;s+=1)n+="<".concat(i,">"),VS.push(i);var u=function(e){var t=HS.get(e);if(null==t)return 0;var n=e,r=n.type,o=n.ordered,i=void 0!==o&&o,a=n.level,s=void 0===a?0:a,u=$g.findPath(t,e);if(u[0]===t.children.length-1)return s+1;var l=ap.Path.next(u),c=ap.Editor.node(t,l);if(!c)return 0;var d=vp(c,1)[0];if($g.getNodeType(d)!==r)return s+1;var f=d,p=f.ordered,h=void 0!==p&&p,g=f.level,v=void 0===g?0:g;return v<s?US(t,d)?s-v:s-v+1:v>s?0:v===s?h===i?0:1:0}(e);if(u>0)for(s=0;s<u;s+=1){var l=VS.pop();r+="</".concat(l,">")}var c=zS(e),d=c?' style="color:'.concat(c,'"'):"";return{html:"<li".concat(d,">").concat(t,"</li>"),prefix:n,suffix:r}}},WS=function(){function e(){this.type="list-item",this.tag="button"}return e.prototype.getListNode=function(e){var t=this.type;return $g.getSelectedNodeByType(e,t)},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){var t=this.getListNode(e);if(null==t)return!1;var n=t.ordered;return(void 0!==n&&n)===this.ordered},e.prototype.isDisabled=function(e){return null==e.selection||!!$g.getSelectedElems(e).some((function(t){if(ap.Editor.isVoid(e,t)&&ap.Editor.isBlock(e,t))return!0;var n=t.type;return!!["pre","code","table"].includes(n)}))},e.prototype.exec=function(e,t){this.isActive(e)?ap.Transforms.setNodes(e,{type:"paragraph",ordered:void 0,level:void 0}):ap.Transforms.setNodes(e,{type:"list-item",ordered:this.ordered,indent:void 0})},e}(),qS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.ordered=!1,t.title=ry("listModule.unOrderedList"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M384 64h640v128H384V64z m0 384h640v128H384v-128z m0 384h640v128H384v-128zM0 128a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z"></path></svg>',t}return dp(t,e),t}(WS),KS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.ordered=!0,t.title=ry("listModule.orderedList"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M384 832h640v128H384z m0-384h640v128H384z m0-384h640v128H384zM192 0v256H128V64H64V0zM128 526.016v50.016h128v64H64v-146.016l128-60V384H64v-64h192v146.016zM256 704v320H64v-64h128v-64H64v-64h128v-64H64v-64z"></path></svg>',t}return dp(t,e),t}(WS),YS={key:"bulletedList",factory:function(){return new qS}},XS={key:"numberedList",factory:function(){return new KS}};function ZS(e){return e.length?e[0].tagName.toLowerCase():""}Rh&&(ph.fn.append=Rh),mh&&(ph.fn.attr=mh),_h&&(ph.fn.parent=_h);var JS={selector:"li:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);0===(t=t.filter((function(e){return!!ap.Text.isText(e)||!!n.isInline(e)}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]);var o=function(e){return"ol"===ZS(e.parent())}(r),i=function(e){for(var t=0,n=e.parent(),r=ZS(n);"ul"===r||"ol"===r;)r=ZS(n=n.parent()),t+=1;return t-1}(r);return{type:"list-item",ordered:o,level:i,children:t}}};var QS={selector:"ul:not([data-w-e-type]),ol:not([data-w-e-type])",parseElemHtml:function(e,t,n){return t.flat(1/0)}};function ex(e){return ap.Editor.nodes(e,{at:e.selection||void 0,match:function(t){return 1===$g.findPath(e,t).length}})}var tx={type:"list-item",renderElem:function(e,t,n){HS.set(e,n);var r=e,o=r.level,i=void 0===o?0:o,a=r.ordered,s=void 0!==a&&a,u={margin:"5px 0 5px ".concat(20*i,"px"),display:"flex",alignItems:"flex-start"},l="";if(s){var c=function(e,t){var n=t,r=n.type,o=n.level,i=void 0===o?0:o,a=n.ordered,s=void 0!==a&&a,u=1,l=t,c=$g.findPath(e,l);if(0===c[0])return 1;for(;c[0]>0;){var d=ap.Path.previous(c),f=ap.Editor.node(e,d);if(null==f)break;var p=f[0],h=p.level,g=void 0===h?0:h,v=p.type,m=p.ordered;if(v!==r)break;if(g<i)break;if(g===i){if(m!==s)break;u+=1}l=p,c=d}return u}(n,e);l="".concat(c,".")}else l=function(e){void 0===e&&(e=0);var t="";switch(e){case 0:t="•";break;case 1:t="◦";break;default:t="▪"}return t}(i);var d=zS(e);return rb.jsx("div",{style:u},rb.jsx("span",{contentEditable:!1,style:{marginRight:"0.5em",color:d},"data-w-e-reserve":!0},l),rb.jsx("span",{style:{flex:"1",wordBreak:"break-word"}},t))}},nx={renderElems:[tx],editorPlugin:function(e){var t=e.deleteBackward,n=e.handleTab,r=e.normalizeNode,o=e.insertBreak,i=e;return i.insertBreak=function(){var t=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"list-item")},universal:!0}),1),n=t[0];return n?""!==n[0].children[0].text?o():void ap.Transforms.setNodes(i,{type:"paragraph",ordered:void 0,level:void 0}):o()},i.deleteBackward=function(n){var r=i.selection;if(null!=r)if(ap.Range.isExpanded(r))t(n);else{var o=$g.getSelectedNodeByType(i,"list-item");if(null!=o)if(0!==r.focus.offset)t(n);else{var a=o,s=a.level,u=void 0===s?0:s,l=a.ordered,c=void 0!==l&&l;if(u>0){var d=$S(e,o,u-1);d&&d.ordered!==c?ap.Transforms.setNodes(i,{level:u-1,ordered:!c}):ap.Transforms.setNodes(i,{level:u-1})}else ap.Transforms.setNodes(i,{type:"paragraph",ordered:void 0,level:void 0})}else t(n)}else t(n)},i.handleTab=function(){var e,t,r,o,a=i.selection;if(null!=a){if(ap.Range.isCollapsed(a)){var s=$g.getSelectedNodeByType(i,"list-item");if(null==s)return void n();if(0===a.focus.offset){var u=s.level,l=void 0===u?0:u;return void ap.Transforms.setNodes(i,{level:l+1})}}if(ap.Range.isExpanded(a)){var c=0,d=!1;try{for(var f=gp(ex(i)),p=f.next();!p.done;p=f.next()){var h=vp(p.value,1)[0];"list-item"===$g.getNodeType(h)?c+=1:d=!0}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}if(d||c<=1)return void n();try{for(var g=gp(ex(i)),v=g.next();!v.done;v=g.next()){var m=vp(v.value,2),y=(h=m[0],m[1]),b=h.level;l=void 0===b?0:b;ap.Transforms.setNodes(i,{level:l+1},{at:y})}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}finally{if(r)throw r.error}}}else n()}else n()},i.normalizeNode=function(e){var t=vp(e,2),n=t[0],o=t[1],a=$g.getNodeType(n);return"bulleted-list"!==a&&"numbered-list"!==a||ap.Transforms.unwrapNodes(i,{at:o}),r([n,o])},i},menus:[YS,XS],elemsToHtml:[GS],parseElemsHtml:[QS,JS]};ty("en",{tableModule:{modal:{border:"Border",borderWidth:"Width",bgColor:"Back color",align:"Text Align",ok:"OK"},color:{default:"Default color",clear:"Clear back color"},borderStyle:{none:"None",solid:"Solid",dotted:"Dotted",dashed:"Dashed",double:"Double",groove:"Groove",ridge:"Ridge",inset:"Inset",outset:"Outset"},deleteCol:"Delete column",deleteRow:"Delete row",deleteTable:"Delete table",widthAuto:"Width auto",insertCol:"Insert column",insertRow:"Insert row",insertTable:"Insert table",header:"Header",mergeCell:"merge cell",splitCell:"split cell",tableProperty:"Table property",cellProperty:"Cell property"}}),ty("zh-CN",{tableModule:{modal:{border:"边框",borderWidth:"宽度",bgColor:"背景色",align:"对齐方式",ok:"确定"},color:{default:"默认颜色",clear:"清除背景色"},borderStyle:{none:"无样式",solid:"实线",dotted:"点状虚线",dashed:"虚线",double:"双线",groove:"凹槽边框",ridge:"菱形边框",inset:"凹边框",outset:"凸边框"},deleteCol:"删除列",deleteRow:"删除行",deleteTable:"删除表格",widthAuto:"宽度自适应",insertCol:"插入列",insertRow:"插入行",insertTable:"插入表格",header:"表头",mergeCell:"合并单元格",splitCell:"拆分单元格",tableProperty:"表格属性",cellProperty:"单元格属性"}});var rx={type:"table",elemToHtml:function(e,t){var n=e,r=n.width,o=void 0===r?"auto":r,i=n.columnWidths,a=n.height,s=void 0===a?"auto":a,u=null==i?void 0:i.map((function(e){return"<col width=".concat(e,"></col>")})).join(""),l=u?'<colgroup contentEditable="false">'.concat(u,"</colgroup>"):"";return'<table style="width: '.concat(o,";table-layout: fixed;height:").concat(s,'">').concat(l,"<tbody>").concat(t,"</tbody></table>")}},ox={type:"table-row",elemToHtml:function(e,t){return"<tr>".concat(t,"</tr>")}},ix={type:"table-cell",elemToHtml:function(e,t){var n=e,r=n.colSpan,o=void 0===r?1:r,i=n.rowSpan,a=void 0===i?1:i,s=n.isHeader,u=void 0!==s&&s,l=n.width,c=void 0===l?"auto":l,d=n.hidden,f=u?"th":"td",p=void 0!==d&&d?"display:none":"";return"<".concat(f,' colSpan="').concat(o,'" rowSpan="').concat(a,'" width="').concat(c,'" style="').concat(p,'">').concat(t,"</").concat(f,">")}},ax='<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>',sx={blocks:{td:"table-cell",th:"table-cell",content:"paragraph",tr:"table-row",table:"table",tbody:"table-body"}};function ux(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=sx,o=t.map((function(e){var t;return null===(t=null==r?void 0:r.blocks)||void 0===t?void 0:t[e]}));return function(e){return function(e){return!ap.Editor.isEditor(e)&&ap.Element.isElement(e)&&"type"in e}(e)&&o.includes(e.type)}}function lx(e,t){for(var n=vp(t,2),r=n[0],o=n[1],i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var s=vp(ap.Node.common(e,r,o),2),u=s[0],l=s[1];return!!ux.apply(void 0,mp([e],vp(i),!1))(u,l)||!!ap.Editor.above(e,{match:ux.apply(void 0,mp([e],vp(i),!1)),at:l})}function cx(e,t){var n,r;void 0===t&&(t={});var o=[];try{for(var i=gp(function(e,t){var n,r,o,i,a,s,u,l,c,d,f,p,h,g,v,m,y,b;return void 0===t&&(t={}),hp(this,(function(E){switch(E.label){case 0:if(n=vp(ap.Editor.nodes(e,{match:ux(e,"table"),at:t.at}),1),!(r=n[0]))return[2,[]];o=vp(r,2),i=o[1],E.label=1;case 1:E.trys.push([1,6,7,8]),a=gp(ap.Editor.nodes(e,{match:ux(e,"table"),at:i})),s=a.next(),E.label=2;case 2:if(s.done)return[3,5];u=vp(s.value,2),l=u[1],c=[];try{for(y=void 0,d=gp(ap.Editor.nodes(e,{match:ux(e,"tr"),at:l})),f=d.next();!f.done;f=d.next())p=vp(f.value,2),h=p[1],c.push(mp([],vp(ap.Editor.nodes(e,{match:ux(e,"th","td"),at:h})),!1))}catch(e){y={error:e}}finally{try{f&&!f.done&&(b=d.return)&&b.call(d)}finally{if(y)throw y.error}}return[4,c];case 3:E.sent(),E.label=4;case 4:return s=a.next(),[3,2];case 5:return[3,8];case 6:return g=E.sent(),v={error:g},[3,8];case 7:try{s&&!s.done&&(m=a.return)&&m.call(a)}finally{if(v)throw v.error}return[7];case 8:return[2]}}))}(e,{at:t.at})),a=i.next();!a.done;a=i.next()){for(var s=a.value,u=[],l=0;l<s.length;l+=1){u[l]||(u[l]=[]);for(var c=0;c<s[l].length;c+=1)for(var d=vp(s[l][c],1)[0],f=d.rowSpan,p=void 0===f?1:f,h=d.colSpan,g=void 0===h?1:h,v=0;v<g+0;v+=1)for(var m=0;m<p;m+=1)u[l+m]||(u[l+m]=[]),u[l+m][c+v]||(u[l+m][c+v]=[s[l+m][c+v],{rtl:v-0+1,ltr:g-v+0,ttb:m+1,btt:p-m}])}o.push.apply(o,mp([],vp(u),!1))}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}var dx=function(){function e(e,t){this.x=e,this.y=t}return e.valueOf=function(e,t){return new this(e,t)},e.equals=function(e,t){return e.x===t.x&&e.y===t.y},e}();function fx(e){return e.length?e[0].tagName.toLowerCase():""}function px(e,t){for(var n="",r=(e.attr("style")||"").split(";"),o=r.length,i=0;i<o;i+=1){var a=r[i];if(a){var s=a.split(":");s[0].trim()===t&&(n=s[1].trim())}}return n}Rh&&ph.fn&&(ph.fn.append=Rh),Dh&&ph.fn&&(ph.fn.on=Dh),Wh&&ph.fn&&(ph.fn.focus=Wh),mh&&ph.fn&&(ph.fn.attr=mh),Ch&&ph.fn&&(ph.fn.val=Ch),Fh&&ph.fn&&(ph.fn.html=Fh),Eh&&ph.fn&&(ph.fn.dataset=Eh),hh&&ph.fn&&(ph.fn.addClass=hh),gh&&ph.fn&&(ph.fn.removeClass=gh),Hh&&ph.fn&&(ph.fn.children=Hh),Bh&&ph.fn&&(ph.fn.each=Bh),jh&&ph.fn&&(ph.fn.find=jh),bh&&ph.fn&&(ph.fn.data=bh),Oh&&ph.fn&&(ph.fn.hide=Oh),Th&&ph.fn&&(ph.fn.show=Th);var hx=new WeakMap,gx=new WeakMap,vx=function(){function e(){this.title=ry("tableModule.tableProperty"),this.iconSvg='<svg viewBox="0 0 20 20"><path d="M8 2v5h4V2h1v5h5v1h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5H7v-5H2v-1h5V8H2V7h5V2h1zm4 6H8v4h4V8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM17 1a2 2 0 0 1 2 2v9.475l-.85-.124-.857-1.736a2.048 2.048 0 0 0-.292-.44L17 3H3v14h7.808l.402.392L10.935 19H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14z"/></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.menu="table",this.borderStyle=[{value:"none",label:ry("tableModule.borderStyle.none")},{value:"solid",label:ry("tableModule.borderStyle.solid")},{value:"dotted",label:ry("tableModule.borderStyle.dotted")},{value:"dashed",label:ry("tableModule.borderStyle.dashed")},{value:"double",label:ry("tableModule.borderStyle.double")},{value:"groove",label:ry("tableModule.borderStyle.groove")},{value:"ridge",label:ry("tableModule.borderStyle.ridge")},{value:"inset",label:ry("tableModule.borderStyle.inset")},{value:"outset",label:ry("tableModule.borderStyle.outset")}],this.textAlignOptions=[{value:"left",label:ry("justify.left"),svg:'<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>'},{value:"center",label:ry("justify.center"),svg:'<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>'},{value:"right",label:ry("justify.right"),svg:'<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>'},{value:"justify",label:ry("justify.justify"),svg:'<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>'}]}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==$g.getSelectedNodeByType(e,"table")},e.prototype.exec=function(e,t){},e.prototype.getModalContentNode=function(e){return vp(ap.Editor.nodes(e,{match:ux(e,"table")}),1)[0]},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=this,n=this.getModalContentNode(e);if(!n)return null;var r=vp(n,2),o=r[0],i=r[1],a=ph('<div>\n <label class="babel-container">\n <span>'.concat(ry("tableModule.modal.border"),'</span>\n <span class="babel-container-border">\n <select name="borderStyle">\n ').concat(this.borderStyle.map((function(e){return'<option value="'.concat(e.value,'">').concat(e.label,"</option>")})).join(""),'\n </select>\n <span class="color-group" data-mark="color">\n <span class="color-group-block"></span>\n <input name="borderColor" type="hidden">\n </span>\n <input name="borderWidth" type="number" placeholder="').concat(ry("tableModule.modal.borderWidth"),'">\n </span>\n </label>\n <div class="babel-container">\n <span>').concat(ry("tableModule.modal.bgColor"),'</span>\n <span class="babel-container-background">\n <span class="color-group" data-mark="bgColor">\n <span class="color-group-block"></span>\n <input name="backgroundColor" type="hidden">\n </span>\n </span>\n </div>\n <label class="babel-container">\n <span>').concat(ry("tableModule.modal.align"),'</span>\n <span class="babel-container-align">\n <select name="textAlign">\n ').concat(this.textAlignOptions.map((function(e){return'<option value="'.concat(e.value,'">').concat(e.label,"</option>")})).join(""),'\n </select>\n </span>\n </label>\n <div class="button-container">\n <button type="button">').concat(ry("tableModule.modal.ok"),"</button>\n </div>\n </div>"));a.find("[name]").each((function(e){ph(e).val(o[ph(e).attr("name")])}));var s=function(e,t){t?ph(".color-group-block",e).css("background-color",t).empty():ph(".color-group-block",e).css("background-color","").html(ax)};return a.find(".color-group").each((function(n){var r=ph('[type="hidden"]',n).val()||"";s(n,r);var o=ph(n);o.on("click",(function(){a.find(".color-group .w-e-drop-panel").hide();var i=o.data("panel");i?i.show():(i=t.getPanelContentElem(e,{mark:o.data("mark"),selectedColor:r,callback:function(e){ph('[type="hidden"]',n).val(e||""),s(n,e),i.hide()}}),o.append(i),o.data("panel",i))}))})),a.find("button").on("click",(function(){var n=Array.from(a.find("[name]")).reduce((function(e,t){return e[ph(t).attr("name")]=ph(t).val(),e}),{}),r=hx.get(e);"cell"===t.menu&&(null==r?void 0:r.length)?r.forEach((function(t){t.forEach((function(t){ap.Transforms.setNodes(e,n,{at:t[0][1]})}))})):ap.Transforms.setNodes(e,n,{at:i}),setTimeout((function(){e.focus()}))})),a[0]},e.prototype.getPanelContentElem=function(e,t){var n=t.mark,r=t.selectedColor,o=t.callback,i=ph('<ul class="w-e-panel-content-color"></ul>');i.on("click","li",(function(e){var t=e.target;if(t){e.preventDefault(),e.stopPropagation();var n=ph(t).attr("data-value");o(n)}}));var a=e.getMenuConfig(n).colors;(void 0===a?[]:a).forEach((function(e){var t=ph('<div class="color-block" data-value="'.concat(e,'"></div>'));t.css("background-color",e);var n=ph('<li data-value="'.concat(e,'"></li>'));r===e&&n.addClass("active"),n.append(t),i.append(n)}));var s="";"color"===n&&(s=ry("tableModule.color.default")),"bgColor"===n&&(s=ry("tableModule.color.clear"));var u=ph('\n <li data-value="" class="clear">\n '.concat(ax,"\n ").concat(s,"\n </li>\n "));i.prepend(u);var l=ph('<div class="w-e-drop-panel"></div>');return l.append(i),l},e}(),mx=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("tableModule.cellProperty"),t.iconSvg='<svg viewBox="0 0 20 20"><path d="m11.105 18-.17 1H2.5A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1h15A1.5 1.5 0 0 1 19 2.5v9.975l-.85-.124-.15-.302V8h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5h3.105zM2 12h5V8H2v4zm10-4H8v4h4V8zM2 2v5h5V2H2zm0 16h5v-5H2v5zM13 7h5V2h-5v5zM8 2v5h4V2H8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM13 6a1 1 0 0 1 1 1v3.172a2.047 2.047 0 0 0-.293.443l-.858 1.736-1.916.28-.151.027A1.976 1.976 0 0 0 9.315 14H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm-1 2H8v4h4V8z"/></svg>',t.tag="button",t.showModal=!0,t.modalWidth=300,t.menu="cell",t}return dp(t,e),t.prototype.getModalContentNode=function(e){return vp(ap.Editor.nodes(e,{match:ux(e,"td")}),1)[0]},t}(vx),yx=function(){function e(){this.title=ry("tableModule.deleteCol"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M327.68 510.976L393.216 445.44v-13.1072L327.68 366.7968V510.976z m327.68-78.4384l65.536-65.536V507.904L655.36 442.368v-9.8304z m393.216 484.9664V0H0v917.504h1048.576z m-65.536-131.072h-262.144v-52.4288l-13.1072 13.1072-52.4288-52.4288v91.7504H393.216v-91.7504l-52.4288 52.4288-13.1072-13.1072v52.4288H65.536V65.536H327.68v121.2416l36.0448-36.0448 29.4912 29.4912V62.2592h262.144V180.224l49.152-49.152 16.384 16.384V62.2592h262.144V786.432z m-294.912-108.1344l-160.5632-160.5632-167.1168 167.1168-78.6432-78.6432 167.1168-167.1168L288.3584 278.528l78.6432-78.6432 160.5632 160.5632 163.84-163.84 78.6432 78.6432-163.84 163.84 160.5632 160.5632-78.6432 78.6432z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table-cell"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")},universal:!0}),1),r=vp(n[0],2),o=r[0],i=r[1],a=$g.getParentNode(e,o),s=(null==a?void 0:a.children.length)||0;if(!a||s<=1)ap.Transforms.removeNodes(e,{mode:"highest"});else if(null!=$g.getParentNode(e,a)){var u=cx(e),l=0;e:for(var c=0;c<u.length;c+=1)for(var d=0;d<u[c].length;d+=1){var f=vp(u[c][d],1),p=vp(f[0],2)[1];if(ap.Path.equals(i,p)){l=d;break e}}ap.Editor.withoutNormalizing(e,(function(){for(var t,n,r=0;r<u.length;r+=1){var o=vp(u[r][l],2),i=vp(o[0],1)[0].hidden,a=o[1],s=a.rtl,c=a.ltr;if(s>1||c>1){var d=vp(u[r][l-(s-1)],1),f=vp(d[0],2),p=f[0],h=p.rowSpan,g=void 0===h?1:h,v=p.colSpan,m=void 0===v?1:v,y=f[1];if(i)ap.Transforms.setNodes(e,{rowSpan:g,colSpan:Math.max(m-1,1)},{at:y});else{var b=vp(u[r][l+1],1),E=vp(b[0],2)[1];ap.Transforms.setNodes(e,{rowSpan:g,colSpan:m-1,hidden:!1},{at:E});try{for(var C=(t=void 0,gp(ap.Node.children(e,y,{reverse:!0}))),D=C.next();!D.done;D=C.next()){var w=vp(D.value,2)[1];ap.Transforms.moveNodes(e,{to:mp(mp([],vp(E),!1),[0],!1),at:w})}}catch(e){t={error:e}}finally{try{D&&!D.done&&(n=C.return)&&n.call(C)}finally{if(t)throw t.error}}}}}for(r=0;r<u.length;r+=1){var A=vp(u[r][l],1);y=vp(A[0],2)[1];ap.Transforms.removeNodes(e,{at:y})}var S=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table")},universal:!0}),1),x=S[0];if(x){var O=vp(x,2),T=O[0],N=O[1],B=T.columnWidths,k=mp([],vp(void 0===B?[]:B),!1);k.splice(l,1),ap.Transforms.setNodes(e,{columnWidths:k},{at:N})}}))}}},e}(),bx=function(){function e(){this.title=ry("tableModule.deleteRow"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M907.6736 586.5472L747.1104 425.984l163.84-163.84-78.6432-78.6432-163.84 163.84L507.904 186.7776 429.2608 262.144l163.84 163.84-167.1168 167.1168 78.6432 78.6432 167.1168-167.1168 160.5632 160.5632 75.3664-78.6432zM0 917.504V0h1048.576v917.504H0z m983.04-327.68h-22.9376l-65.536-65.536H983.04V327.68h-91.7504l65.536-65.536h26.2144V65.536H65.536v196.608h317.8496l65.536 65.536H65.536v196.608h380.1088l-65.536 65.536H65.536v196.608H983.04v-196.608z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table-row"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-row")},universal:!0}),1),r=vp(n[0],2),o=r[0],i=r[1],a=$g.getParentNode(e,o);if(((null==a?void 0:a.children.length)||0)<=1)ap.Transforms.removeNodes(e,{mode:"highest"});else{var s=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")},universal:!0}),1),u=vp(s[0],2)[1],l=cx(e),c=0;e:for(var d=0;d<l.length;d+=1)for(var f=0;f<l[d].length;f+=1){var p=vp(l[d][f],1),h=vp(p[0],2)[1];if(ap.Path.equals(u,h)){c=d;break e}}ap.Editor.withoutNormalizing(e,(function(){for(var t,n,r=0;r<l[c].length;r+=1){var o=vp(l[c][r],2),a=vp(o[0],1)[0].hidden,s=o[1],u=s.ttb,d=s.btt;if(u>1||d>1){var f=vp(l[c-(u-1)][r],1),p=vp(f[0],2),h=p[0],g=h.rowSpan,v=void 0===g?1:g,m=h.colSpan,y=void 0===m?1:m,b=p[1];if(a)ap.Transforms.setNodes(e,{rowSpan:Math.max(v-1,1),colSpan:y},{at:b});else{var E=vp(l[c+1][r],1),C=vp(E[0],2)[1];ap.Transforms.setNodes(e,{rowSpan:v-1,colSpan:y,hidden:!1},{at:C});try{for(var D=(t=void 0,gp(ap.Node.children(e,b,{reverse:!0}))),w=D.next();!w.done;w=D.next()){var A=vp(w.value,2)[1];ap.Transforms.moveNodes(e,{to:mp(mp([],vp(C),!1),[0],!1),at:A})}}catch(e){t={error:e}}finally{try{w&&!w.done&&(n=D.return)&&n.call(D)}finally{if(t)throw t.error}}}}}ap.Transforms.removeNodes(e,{at:i})}))}}},e}(),Ex=function(){function e(){this.title=ry("tableModule.deleteTable"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==$g.getSelectedNodeByType(e,"table")},e.prototype.exec=function(e,t){this.isDisabled(e)||ap.Transforms.removeNodes(e,{mode:"highest"})},e}(),Cx=function(){function e(){this.title=ry("tableModule.widthAuto"),this.iconSvg='<svg viewBox="0 0 1228 1024"><path d="M862.514337 563.200461H404.581995v121.753478a13.311987 13.311987 0 0 1-6.655993 11.468789 10.23999 10.23999 0 0 1-12.083188-1.433599l-204.799795-179.199821a13.721586 13.721586 0 0 1 0-20.479979l204.799795-179.302221a10.23999 10.23999 0 0 1 12.185588-1.535998 13.209587 13.209587 0 0 1 6.553593 11.673588v115.097485h457.932342V319.693504a11.571188 11.571188 0 0 1 18.841582-10.239989l204.799795 179.19982a13.721586 13.721586 0 0 1 0 20.47998l-204.799795 179.199821a10.23999 10.23999 0 0 1-12.185588 1.535998 13.311987 13.311987 0 0 1-6.655994-11.571188V563.200461zM136.499064 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785H15.155185A15.155185 15.155185 0 0 1 0 1008.844815V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086294a15.155185 15.155185 0 0 1 15.257585 15.155185zM1228.798771 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785h-106.188693a15.155185 15.155185 0 0 1-15.155185-15.052785V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086293A15.155185 15.155185 0 0 1 1228.798771 15.053809z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){var t=$g.getSelectedNodeByType(e,"table");return null!=t&&"100%"===t.width},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n={width:t?"auto":"100%"};ap.Transforms.setNodes(e,n,{mode:"highest"})}},e}();function Dx(e){var t=e.children||[];return 0===t.length?[]:(t[0]||{}).children||[]}function wx(e){return Dx(e).every((function(e){return!!e.isHeader}))}var Ax=function(){function e(){this.title=ry("tableModule.insertCol"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M327.68 193.3312v186.7776H140.9024v91.7504H327.68v186.7776h88.4736V471.8592h190.0544V380.1088H416.1536V193.3312zM0 917.504V0h1048.576v917.504H0zM655.36 65.536H65.536v720.896H655.36V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 262.144h-262.144v196.608h262.144V327.68z m0 262.144h-262.144v196.608h262.144v-196.608z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")},universal:!0}),1),r=vp(n[0],2),o=r[0],i=r[1],a=$g.getParentNode(e,o);if(null!=a){var s=$g.getParentNode(e,a);if(null!=s){for(var u=cx(e),l=0,c=0;c<u.length;c+=1)for(var d=0;d<u[c].length;d+=1){var f=vp(u[c][d],1),p=vp(f[0],2)[1];if(ap.Path.equals(i,p)){l=d;break}}ap.Editor.withoutNormalizing(e,(function(){for(var t=[],n=0;n<u.length;n+=1){var r=vp(u[n][l],2)[1],o=r.ltr,i=r.rtl;if(o>1||i>1){if(1===i)continue;var a=vp(u[n][l-(i-1)],1),c=vp(a[0],2),d=c[0],f=c[1],p=d.colSpan||1;t.push(n),d.hidden||ap.Transforms.setNodes(e,{colSpan:p+1},{at:f})}}for(n=0;n<u.length;n+=1){var h={type:"table-cell",hidden:t.includes(n),children:[{text:""}]};0===n&&wx(s)&&(h.isHeader=!0);var g=vp(u[n][l],1),v=vp(g[0],2)[1];ap.Transforms.insertNodes(e,h,{at:v})}var m=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table")},universal:!0}),1),y=m[0];if(y){var b=vp(y,2),E=b[0],C=b[1],D=E.columnWidths,w=mp([],vp(void 0===D?[]:D),!1),A=e.getMenuConfig("insertTable").minWidth,S=void 0===A?60:A;w.splice(l,0,parseInt(S,10)||60),ap.Transforms.setNodes(e,{columnWidths:w},{at:C})}}))}}}},e}(),Sx=function(){function e(){this.title=ry("tableModule.insertRow"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M707.7888 521.0112h-147.456v-147.456H488.2432v147.456h-147.456v68.8128h147.456v147.456h72.0896v-147.456h147.456zM0 917.504V0h1048.576v917.504H0zM327.68 65.536H65.536v196.608H327.68V65.536z m327.68 0H393.216v196.608h262.144V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 258.8672H65.536v462.0288H983.04V324.4032z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")},universal:!0}),1),r=vp(n[0],2),o=r[0],i=r[1],a=$g.getParentNode(e,o),s=(null==a?void 0:a.children.length)||0;if(0!==s){var u=cx(e),l=0;e:for(var c=0;c<u.length;c+=1)for(var d=0;d<u[c].length;d+=1){var f=vp(u[c][d],1),p=vp(f[0],2)[1];if(ap.Path.equals(i,p)){l=c;break e}}ap.Editor.withoutNormalizing(e,(function(){for(var t=l+1,n=t>=0&&t<u.length,r=[],o=0;n&&o<u[l].length;o+=1){var a=vp(u[l][o],2)[1],c=a.ttb,d=a.btt;if(c>1||d>1){if(1===d)continue;var f=vp(u[l-(c-1)][o],1),p=vp(f[0],2),h=p[0],g=p[1],v=h.rowSpan||1;r.push(o),h.hidden||ap.Transforms.setNodes(e,{rowSpan:v+1},{at:g})}}for(var m={type:"table-row",children:[]},y=0;y<s;y+=1){var b={type:"table-cell",hidden:r.includes(y),children:[{text:""}]};m.children.push(b)}var E=ap.Path.parent(i),C=ap.Path.next(E);ap.Transforms.insertNodes(e,m,{at:C})}))}}},e}();var xx=function(){function e(){this.title=ry("tableModule.insertTable"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64v896h1024V64H0z m384 576v-192h256v192h-256z m256 64v192h-256v-192h256z m0-512v192h-256V192h256zM320 192v192H64V192h256z m-256 256h256v192H64v-192z m640 0h256v192h-256v-192z m0-64V192h256v192h-256zM64 704h256v192H64v-192z m640 192v-192h256v192h-256z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||!!$g.getSelectedElems(e).some((function(t){var n=$g.getNodeType(t);return"pre"===n||("table"===n||("list-item"===n||!!e.isVoid(t)))})))},e.prototype.getPanelContentElem=function(e){var t=this;if(this.$content)return this.$content[0];for(var n=ph('<div class="w-e-panel-content-table"></div>'),r=ph("<span>0 × 0</span>"),o=ph("<table></table>"),i=0;i<10;i+=1){for(var a=ph("<tr></tr>"),s=0;s<10;s+=1){var u=ph("<td></td>");u.attr("data-x",s.toString()),u.attr("data-y",i.toString()),a.append(u),u.on("mouseenter",(function(e){var t=e.target;if(null!=t){var n=ph(t).dataset(),i=n.x,a=n.y;r[0].innerHTML="".concat(i+1," × ").concat(a+1),o.children().each((function(e){ph(e).children().each((function(e){var t=ph(e),n=t.dataset(),r=n.x,o=n.y;r<=i&&o<=a?t.addClass("active"):t.removeClass("active")}))}))}})),u.on("click",(function(n){n.preventDefault();var r=n.target;if(null!=r){var o=ph(r).dataset(),i=o.x,a=o.y;t.insertTable(e,a+1,i+1)}}))}o.append(a)}return n.append(o),n.append(r),this.$content=n,n[0]},e.prototype.insertTable=function(e,t,n){var r=parseInt(t,10),o=parseInt(n,10);if(r&&o&&!(r<=0||o<=0)){if($g.isSelectedEmptyParagraph(e)&&ap.Transforms.removeNodes(e,{mode:"highest"}),0===e.children.length){ap.Transforms.insertNodes(e,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}var i=function(e,t,n){for(var r,o=[],i=e.getMenuConfig("insertTable"),a=i.minWidth,s=void 0===a?60:a,u=i.tableFullWidth,l=i.tableHeader,c=Array(n).fill(parseInt(s,10)||60),d=0;d<t;d+=1){for(var f=[],p=0;p<n;p+=1){var h={type:"table-cell",children:[{text:""}]};0===d&&(h.isHeader=null===(r=null==l?void 0:l.selected)||void 0===r||r),f.push(h)}o.push({type:"table-row",children:f})}return{type:"table",width:(null==u?void 0:u.selected)?"100%":"auto",children:o,columnWidths:c}}(e,r,o);ap.Transforms.insertNodes(e,i,{mode:"highest"})}},e}(),Ox={isInTable:function(e,t){return void 0===t&&(t={}),!!vp(ap.Editor.nodes(e,{match:ux(e,"table"),at:t.at}),1)[0]},selection:function(e){var t,n,r,o,i,a,s,u;return hp(this,(function(l){switch(l.label){case 0:t=hx.get(e),n=0,l.label=1;case 1:if(!(t&&n<t.length))return[3,4];for(r=[],o=0;o<t[n].length;o+=1)i=vp(t[n][o],2),a=i[0],s=i[1],u=s.ltr,1===s.ttb&&r.push(a),o+=u-1;return[4,r];case 2:l.sent(),l.label=3;case 3:return n+=1,[3,1];case 4:return[2]}}))},unselect:function(e){gx.delete(e),hx.delete(e)},isSelected:function(e,t){var n=gx.get(e);return!!n&&n.has(t)}},Tx=function(){function e(){this.title=ry("tableModule.mergeCell"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M482.2 508.4 331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4c2.4-1.8 2.4-5.4 0-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4c-2.3 1.8-2.3 5.3 0 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"/></svg>',this.tag="button"}return e.prototype.needKeepCell=function(e,t){var n=vp(ap.Node.children(e,t),2)[1],r=ap.Editor.parent(e,t)[0].children.length>1;return!!n||r},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return!this.canMerge(e)},e.prototype.exec=function(e,t){this.isDisabled(e)||(this.merge(e),Ox.unselect(e))},e.prototype.canMerge=function(e){var t=hx.get(e);if(!t||!t.length)return!1;var n=vp(t[t.length-1][t[t.length-1].length-1],1),r=vp(n[0],2)[1],o=vp(t[0][0],1);return!!lx(e,[vp(o[0],2)[1],r],"table")},e.prototype.merge=function(e){var t=this;if(this.canMerge(e)){var n=hx.get(e);if(n&&n.length){var r=vp(n[0][0],1),o=vp(r[0],2)[1],i=vp(ap.Node.children(e,o,{reverse:!0}),1),a=vp(i[0],2)[1];ap.Editor.withoutNormalizing(e,(function(){for(var r,i,s=0,u=0,l=n.length-1;l>=0;l-=1,s+=1){u=0;for(var c=n[l].length-1;c>=0;c-=1,u+=1){var d=vp(n[l][c],2),f=vp(d[0],2)[1],p=d[1].ttb;if(!(ap.Path.equals(o,f)||p>1)){try{for(var h=(r=void 0,gp(ap.Node.children(e,f,{reverse:!0}))),g=h.next();!g.done;g=h.next()){var v=vp(g.value,2)[1];ap.Transforms.moveNodes(e,{to:ap.Path.next(a),at:v})}}catch(e){r={error:e}}finally{try{g&&!g.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}var m=vp(ap.Editor.nodes(e,{match:ux(e,"tr"),at:f}),1),y=vp(m[0],2)[1];t.needKeepCell(e,y)&&ap.Transforms.setNodes(e,{hidden:!0},{at:f})}}}ap.Transforms.setNodes(e,{rowSpan:s,colSpan:u},{at:o})}))}}},e}(),Nx=function(){function e(){this.title=ry("tableModule.splitCell"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M362.667 494.933v53.334l25.6-25.6zm0-241.066L460.8 352V78.933H57.6v98.134h305.067zm0 535.466v57.6H57.6v98.134h403.2V691.2zM661.333 494.933v53.334l-25.6-25.6zm0-241.066L563.2 352V78.933h403.2v98.134H661.333zm0 535.466v57.6H966.4v98.134H563.2V691.2z"/><path d="M753.067 341.333 693.333 281.6 512 460.8 330.667 281.6l-59.734 59.733 181.334 181.334L270.933 704l59.734 59.733L512 582.4l181.333 181.333L753.067 704 571.733 522.667z"/></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=vp(ap.Editor.nodes(e,{match:ux(e,"td")}),1),n=vp(t[0],1)[0],r=n.rowSpan,o=void 0===r?1:r,i=n.colSpan;return!(o>1||(void 0===i?1:i)>1)},e.prototype.exec=function(e,t){this.isDisabled(e)||this.split(e)},e.prototype.split=function(e,t){void 0===t&&(t={});var n=vp(ap.Editor.nodes(e,{match:ux(e,"table","th","td"),at:t.at}),2),r=n[0],o=n[1];if(r&&o){var i=hx.get(e)||[],a=cx(e,{at:t.at});ap.Editor.withoutNormalizing(e,(function(){for(var n=a.length-1;n>=0;n-=1)for(var r=a[n].length-1;r>=0;r-=1){var s=vp(a[n][r],2),u=vp(s[0],2)[1],l=s[1],c=l.ltr,d=l.rtl,f=l.btt,p=l.ttb;if(d>1)r-=d-2;else if(!(p>1||1===f&&1===c)){var h=!!t.all;if(i.length)e:for(var g=0;!t.all&&g<i.length;g+=1)for(var v=0;v<i[g].length;v+=1){var m=vp(i[g][v],1),y=vp(m[0],2)[1];if(ap.Path.equals(y,u)){h=!0;break e}}else{y=vp(o,2)[1];ap.Path.equals(y,u)&&(h=!0)}if(h){e:for(var b=1;b<f;b+=1)for(g=r;g>=0;g-=1){if(1!==vp(a[n+b][g],2)[1].ttb){for(var E=0;E<c;E+=1){var C=vp(a[n+b][g+E],1),D=vp(C[0],2)[1];ap.Transforms.unsetNodes(e,["hidden","colSpan","rowSpan"],{at:D})}continue e}}for(E=1;E<c;E+=1){var w=vp(a[n][r+E],1);D=vp(w[0],2)[1];ap.Transforms.unsetNodes(e,["hidden","colSpan","rowSpan"],{at:D})}ap.Transforms.setNodes(e,{rowSpan:1,colSpan:1},{at:u})}}}}))}},e}(),Bx=function(){function e(){this.title=ry("tableModule.header"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M704 128l-64 0L384 128 320 128 0 128l0 256 0 64 0 192 0 64 0 256 320 0 64 0 256 0 64 0 320 0 0-256 0-64L1024 448 1024 384 1024 128 704 128zM640 640 384 640 384 448l256 0L640 640zM64 448l256 0 0 192L64 640 64 448zM320 896 64 896l0-192 256 0L320 896zM640 896 384 896l0-192 256 0L640 896zM960 896l-256 0 0-192 256 0L960 896zM960 640l-256 0L704 448l256 0L960 640z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){var t=$g.getSelectedNodeByType(e,"table");return null!=t&&wx(t)},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=!t,r=$g.getSelectedNodeByType(e,"table");if(null!=r)Dx(r).forEach((function(t){return ap.Transforms.setNodes(e,{isHeader:n},{at:$g.findPath(e,t)})}))}},e}(),kx={key:"insertTable",factory:function(){return new xx}},Fx={key:"deleteTable",factory:function(){return new Ex}},Px={key:"insertTableRow",factory:function(){return new Sx}},Ix={key:"deleteTableRow",factory:function(){return new bx}},Rx={key:"insertTableCol",factory:function(){return new Ax}},Lx={key:"deleteTableCol",factory:function(){return new yx}},_x={key:"tableHeader",factory:function(){return new Bx}},Mx={key:"tableFullWidth",factory:function(){return new Cx}},jx={key:"mergeTableCell",factory:function(){return new Tx}},Hx={key:"splitTableCell",factory:function(){return new Nx}},zx={key:"setTableProperty",factory:function(){return new vx}},$x={key:"setTableCellProperty",factory:function(){return new mx}};var Ux={selector:"td:not([data-w-e-type]),th:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);0===(t=t.filter((function(e){return"paragraph"===$g.getNodeType(e)||(!!ap.Text.isText(e)||!!n.isInline(e))}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]);var o=parseInt(r.attr("colSpan")||"1",10),i=parseInt(r.attr("rowSpan")||"1",10),a="none"===px(r,"display"),s=r.attr("width")||"auto";return{type:"table-cell",isHeader:"th"===fx(r),colSpan:o,rowSpan:i,width:s,children:t,hidden:a}}};var Vx={selector:"tr:not([data-w-e-type])",parseElemHtml:function(e,t,n){for(var r,o=[],i=0;i<t.length;i+=1){var a=t[i];if("table-cell"===$g.getNodeType(a)){var s=a.colSpan||1;o.push(a);for(var u=1;u<s;u+=1){var l=t[i+u];l&&"table-cell"===$g.getNodeType(l)&&"none"===(null===(r=l.style)||void 0===r?void 0:r.display)||o.push({type:"table-cell",children:[{text:""}],hidden:!0})}}}return{type:"table-row",children:o}}};var Gx,Wx={selector:"table:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r,o,i=ph(e),a="auto";"100%"===px(i,"width")&&(a="100%"),"100%"===i.attr("width")&&(a="100%");var s={type:"table",width:a,height:parseInt(px(i,"height")||"0",10),children:t.filter((function(e){return"table-row"===$g.getNodeType(e)}))},u=(null===(r=i.find("tr")[0])||void 0===r?void 0:r.children)||[],l=(null===(o=i.find("colgroup")[0])||void 0===o?void 0:o.children)||null;if(u.length>0){var c=[];Array.from(u).forEach((function(e){var t=parseInt(ph(e).attr("colSpan")||"1",10),n=parseInt(px(ph(e),"width")||"90",10);c[0]=n;for(var r=1;r<t;r+=1)c.push(90)})),s.columnWidths=c}else l&&(s.columnWidths=Array.from(l).map((function(e){return parseInt(e.getAttribute("width"),10)})));return s}},qx=null===(Gx=null===window||void 0===window?void 0:window.getComputedStyle(document.documentElement))||void 0===Gx?void 0:Gx.getPropertyValue("--w-e-textarea-border-color");function Kx(e){var t=e.selection;if(null==t)return!1;var n=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")}}),1),r=n[0];if(r){var o=vp(r,2)[1],i=ap.Editor.start(e,o);if(ap.Point.equals(t.anchor,i))return!0}return!1}function Yx(e,t){var n=t.offset;if(0===n)return!1;var r=ap.Editor.node(e,t);if(!ap.Text.isText(r[0]))return!1;var o=ap.Node.string(r[0]);return!(n>=o.length)&&("\n"===o[n-1]&&"\r"===o[n])}function Xx(e,t,n){var r=e.selection;if(null==r||"line"===t)return!1;var o=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")}}),1),i=o[0],a=r.anchor;if("backward"===n&&0===r.anchor.offset&&(a=ap.Editor.before(e,r)),"forward"===n&&ap.Editor.isEnd(e,r.anchor,r.anchor.path)&&(a=ap.Editor.after(e,r)),null==a)return!1;var s=ap.Editor.above(e,{at:a,match:function(e){return $g.checkNodeType(e,"table-cell")}});if(null==s||null==i||!ap.Path.equals(s[1],i[1]))return!1;var u=ap.Editor.node(e,a);if(!ap.Text.isText(u[0])||u[0].text.length<2)return!1;var l="backward"===n?[a.offset-2,a.offset]:[a.offset,a.offset+2],c=ap.Node.string(u[0]);return"\n\r"===c.slice.apply(c,mp([],vp(l),!1))?(ap.Transforms.insertText(e,c.slice(0,l[0])+c.slice(l[1]),{at:{anchor:ap.Editor.start(e,a.path),focus:ap.Editor.end(e,a.path)}}),!0):!!Yx(e,a)&&(ap.Transforms.insertText(e,c.slice(0,r.anchor.offset-1)+c.slice(r.anchor.offset+1),{at:{anchor:ap.Editor.start(e,a.path),focus:ap.Editor.end(e,a.path)}}),!0)}function Zx(e,t){var n=ap.Editor.nodes(e,{at:t,match:function(e){return"table"===$g.getNodeType(e)}});return!!mp([],vp(n),!1).find((function(){return!0}))}var Jx={selector:"table",preParseHtml:function(e){var t=ph(e);if("table"!==fx(t))return e;var n=t.find("tbody");if(0===n.length)return e;var r=t.find("tr");return t.append(r),n.remove(),t[0]}};function Qx(e){var t,n,r=[],o=e.reduce((function(e,t){return e+t}),0);try{for(var i=gp(e),a=i.next();!a.done;a=i.next()){var s=a.value;r.push(s/o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}var eO=null;var tO=!1,nO=!1,rO=0,oO=0,iO=null,aO=ph(window);aO.on("mousedown",(function(e){var t=e.target;if(t.closest('[data-block-type="table-cell"]'))tO=!0;else if("DIV"===t.tagName&&t.closest(".column-resizer-item")){if(null===iO)return;var n=vp(ap.Editor.nodes(iO,{match:ux(iO,"table")}),1),r=vp(n[0],1)[0],o=r.columnWidths,i=void 0===o?[]:o,a=r.resizingIndex,s=void 0===a?-1:a;nO=!0;var u=e.clientX;rO=u,oO=i[s],document.body.style.cursor="col-resize",e.preventDefault()}aO.on("mousemove",sO),aO.on("mouseup",uO)}));var sO=Ty((function(e){if(nO&&null!==iO){e.preventDefault();var t=e.clientX,n=oO+(t-rO);(n=Math.floor(100*n)/100)<30&&(n=30);var r=vp(ap.Editor.nodes(iO,{match:ux(iO,"table")}),1),o=vp(r[0],1)[0],i=o.columnWidths,a=void 0===i?[]:i,s=o.resizingIndex,u=void 0===s?-1:s,l=a.reduce((function(e,t){return e+t}),0),c=l-a[u],d=document.querySelector(".table-container");d&&n>oO&&c+n>d.clientWidth&&(n=Math.max(30,oO));var f=mp([],vp(a),!1).map((function(e){return Math.floor(e)}));f[u]=n,ap.Transforms.setNodes(iO,{columnWidths:f},{mode:"highest"})}}),100);function uO(e){tO=!1,nO=!1,iO=null,document.body.style.cursor="",aO.off("mousemove",sO),aO.off("mouseup",uO)}function lO(e,t,n,r){if(!e.isDisabled()&&!tO&&!nO){var o=t,i=o.width,a=void 0===i?"auto":i,s=o.columnWidths,u=void 0===s?[]:s,l=o.isHoverCellBorder,c=o.resizingIndex,d=n.clientX,f=n.target;if(Qh(f))if(d>(g=f.getBoundingClientRect()).x+5&&d<g.x+g.width-5)return void(l&&ap.Transforms.setNodes(e,{isHoverCellBorder:!1,resizingIndex:-1},{mode:"highest"}));if(Qh(f)){var p=f.closest(".table");if(p)for(var h=n.clientX,g=p.getBoundingClientRect(),v="100%"===a?Qx(u).map((function(e){return e*r})):u,m=function(e){var t,n,r=[],o=0;try{for(var i=gp(e),a=i.next();!a.done;a=i.next())o+=a.value,r.push(o)}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(v),y=0;y<m.length;y+=1)if(h-g.x>=m[y]-5&&h-g.x<m[y]+5){if(c===y)return;return void ap.Transforms.setNodes(e,{isHoverCellBorder:!0,resizingIndex:y},{mode:"highest"})}}!0===l&&ap.Transforms.setNodes(e,{isHoverCellBorder:!1,resizingIndex:-1},{mode:"highest"})}}function cO(e,t){"mouseenter"===t.type?ap.Transforms.setNodes(e,{isResizing:!0},{mode:"highest"}):ap.Transforms.setNodes(e,{isResizing:!1},{mode:"highest"})}var dO={type:"table",renderElem:function(e,t,n){var r=function(e,t){if(e.isDisabled())return!1;var n=e.selection;if(null==n)return!0;if(ap.Range.isCollapsed(n))return!0;var r=n.anchor,o=n.focus,i=$g.findPath(e,t),a=ap.Editor.start(e,i),s=ap.Editor.end(e,i),u=ap.Point.compare(r,s)<=0&&ap.Point.compare(r,a)>=0,l=ap.Point.compare(o,s)<=0&&ap.Point.compare(o,a)>=0;return!!(u&&l&&ap.Path.equals(r.path.slice(0,3),o.path.slice(0,3)))}(n,e),o=e,i=o.width,a=void 0===i?"auto":i,s=o.height,u=o.columnWidths,l=void 0===u?[]:u,c=o.scrollWidth,d=void 0===c?0:c,f=o.isHoverCellBorder,p=o.resizingIndex,h=o.isResizing,g=$g.isNodeSelected(n,e),v=vp(Ox.selection(n),1)[0],m=Qx(l),y=rb.jsx("div",{className:"table-container","data-selected":g,on:{mousedown:function(t){if("DIV"===t.target.tagName&&t.preventDefault(),!n.isDisabled()){t.target.closest('[data-block-type="table-cell"]')&&Ox.unselect(n);var r=$g.findPath(n,e),o=ap.Editor.start(n,r),i=n.selection;if(null!=i)i.anchor.path[0]!==r[0]&&"DIV"===t.target.tagName&&n.select(o);else n.select(o)}}}},rb.jsx("table",{width:a,contentEditable:r,className:"table ".concat(v?"table-selection-none":""),style:{width:"100%"===a?a:"".concat(l.reduce((function(e,t){return e+t}),0),"px")},on:{mousemove:cm((function(t){return lO(n,e,t,d)}),25)}},rb.jsx("colgroup",{contentEditable:!1},l.map((function(e){return rb.jsx("col",{width:e})}))),rb.jsx("tbody",null,t)),rb.jsx("div",{className:"column-resizer",contentEditable:!1},l.map((function(e,t){var r=e;return"100%"===a&&(r=m[t]*d),rb.jsx("div",{className:"column-resizer-item",style:{minWidth:"".concat(r,"px")}},rb.jsx("div",{className:"resizer-line-hotzone ".concat(f&&t===p?"visible ":"").concat(h&&t===p?"highlight":""),style:{height:"".concat(s,"px")},on:{mouseenter:function(e){return cO(n,e)},mouseleave:function(e){return cO(n,e)},mousedown:function(e){return function(e){nO||(iO=e)}(n)}}},rb.jsx("div",{className:"resizer-line"})))})))),b=rb.h("div",{hook:{insert:function(e){var t=e.elm;return function(e,t){if(Qh(t)){var n=t.querySelector("table");n&&(eO=new ResizeObserver((function(t){var n=vp(t,1)[0].contentRect;ap.Transforms.setNodes(e,{scrollWidth:n.width,height:n.height},{mode:"highest"})})),eO.observe(n))}}(n,t)},destroy:function(){eO&&(null==eO||eO.disconnect(),eO=null)}}},y);return b}},fO={type:"table-row",renderElem:function(e,t,n){return rb.jsx("tr",null,t)}},pO={type:"table-cell",renderElem:function(e,t,n){var r=function(e,t){var n=$g.getParentNode(e,t);if(null==n)return!1;var r=$g.getParentNode(e,n);return null!=r&&Dx(r).some((function(e){return e===t}))}(n,e),o=e,i=o.colSpan,a=void 0===i?1:i,s=o.rowSpan,u=void 0===s?1:s,l=o.isHeader,c=void 0!==l&&l,d=o.hidden,f=void 0!==d&&d,p=Ox.isSelected(n,e);if(!r)return rb.jsx("td",{colSpan:a,rowSpan:u,"data-block-type":"table-cell",className:p?"w-e-selected":"",style:{display:f?"none":""}},t);var h=c?"th":"td";return rb.jsx(h,{colSpan:a,rowSpan:u,"data-block-type":"table-cell",className:p?"w-e-selected":"",style:{display:f?"none":""}},t)}};function hO(e,t){null==e.data&&(e.data={});var n=e.data;null==n.style&&(n.style={}),Object.assign(n.style,t)}var gO={renderStyle:function(e,t){var n,r;if(!ap.Element.isElement(e))return t;var o=e,i=o.backgroundColor,a=o.borderWidth,s=o.borderStyle,u=o.borderColor,l=o.textAlign,c={};i&&(c.backgroundColor=i),a&&(c.borderWidth="".concat(a,"px")),s&&(c.borderStyle="none"===s?"":s),u&&(c.borderColor=u),l&&(c.textAlign=l);var d=t;return"table"===e.type?hO(null===(r=(null===(n=d.children)||void 0===n?void 0:n[0]).children)||void 0===r?void 0:r[0],c):hO(d,c),d},styleToHtml:function(e,t){if("table"!==e.type&&"table-cell"!==e.type)return t;var n=e.backgroundColor,r=e.borderWidth,o=e.borderStyle,i=e.borderColor,a=e.textAlign;if(!(n||r||o||i||a))return t;var s=ph(t);return n&&s.css("background-color",n),r&&s.css("border-width","".concat(r,"px")),o&&s.css("border-style","none"===o?"":o),i&&s.css("border-color",i),a&&s.css("text-align",a),function(e){return 0===e.length?"":e[0].outerHTML}(s)},parseStyleHtml:function(e,t,n){if("TABLE"!==e.tagName&&"TD"!==e.tagName)return t;var r=ph(e),o=t,i=px(r,"background-color");i||(i=px(r,"background")),i&&(o.backgroundColor=i);var a=px(r,"border");a||"TD"!==e.tagName||(a="1px solid ".concat(qx));var s=vp((null==a?void 0:a.split(" "))||[],3),u=s[0],l=s[1],c=s[2];(u=px(r,"border-width")||u)&&(o.borderWidth=u.replace(/[^\d]/g,"")),(l=px(r,"border-style")||l)&&(o.borderStyle="none"===l?"":l),(c=px(r,"border-color")||c)&&(o.borderColor=c);var d=px(r,"text-align");return(d=px(r,"text-align")||d)&&(o.textAlign=d),t},renderElems:[dO,fO,pO],elemsToHtml:[rx,ox,ix],preParseHtml:[Jx],parseElemsHtml:[Ux,Vx,Wx],menus:[kx,Fx,Px,Ix,Rx,Lx,_x,Mx,jx,Hx,zx,$x],editorPlugin:function(e){var t=e.insertBreak,n=e.deleteBackward,r=e.deleteForward,o=e.deleteFragment,i=e.normalizeNode,a=e.insertData,s=e.handleTab,u=e.selectAll,l=e;return l.insertBreak=function(){null==$g.getSelectedNodeByType(l,"table")?t():l.insertText("\n\r")},l.deleteBackward=function(e){if(!Kx(l)&&!Xx(l,e,"backward")){var t=l.selection;if(t){var r=ap.Editor.before(l,t),o=ap.Editor.above(l,{at:t,match:function(e){return $g.checkNodeType(e,"table-cell")}});if(r){var i=Zx(l,r);if(!o&&i&&$g.getSelectedNodeByType(l,"paragraph"))return}}n(e)}},l.handleTab=function(){var t;if($g.getSelectedNodeByType(l,"table")){var n=ap.Editor.above(e);$g.checkNodeType(n[0],"table-cell")&&ap.Transforms.select(e,n[1]);var r=ap.Editor.next(e);if(r)r[0]&&r[0].text&&(r=null!==(t=ap.Editor.above(e,{at:r[1]}))&&void 0!==t?t:r),ap.Transforms.select(e,r[1]);else{var o=l.children||[],i=o.length;if($g.checkNodeType(o[i-1],"table")){var a=$g.genEmptyParagraph();ap.Transforms.insertNodes(l,a,{at:[i]}),l.handleTab()}}}else s()},l.deleteForward=function(e){if(!Kx(l)&&!Xx(l,e,"forward")){var t=l.selection;if(t){var n=ap.Editor.after(l,t),o=ap.Editor.above(l,{at:t,match:function(e){return $g.checkNodeType(e,"table-cell")}});if(n){var i=Zx(l,n);if(!o&&i&&$g.getSelectedNodeByType(l,"paragraph"))return}}r(e)}},l.deleteFragment=function(e){var t=l.selection;if(t){var n,r=!1,i={anchor:t.anchor,focus:t.focus},a=ap.Point.isBefore(i.anchor,i.focus);if(Yx(l,t.anchor))(n=ap.Editor[a?"before":"after"](l,t.anchor))&&(i.anchor=n),r=!0;if(Yx(l,t.focus))(n=ap.Editor[a?"after":"before"](l,t.focus))&&(i.focus=n),r=!0;r&&ap.Transforms.setSelection(l,i),o(e)}},l.normalizeNode=function(e){var t=vp(e,2),n=t[0],r=t[1];if("table"!==$g.getNodeType(n))return i([n,r]);if($g.isLastNode(l,n)){var o=$g.genEmptyParagraph();ap.Transforms.insertNodes(l,o,{at:[r[0]+1]})}},l.insertData=function(e){if(null!=$g.getSelectedNodeByType(l,"table")){var t=e.getData("text/plain");"\n"===t||/<img[^>]+>/.test(e.getData("text/html"))?a(e):ap.Editor.insertText(l,t)}else a(e)},l.selectAll=function(){var e=l.selection;if(null!=e){var t=$g.getSelectedNodeByType(l,"table-cell");if(null!=t){var n=e.anchor,r=e.focus;if(ap.Path.equals(n.path.slice(0,3),r.path.slice(0,3)))if(0!==ap.Node.string(t).length){var o=$g.findPath(l,t),i={anchor:ap.Editor.start(l,o),focus:ap.Editor.end(l,o)};l.select(i)}else u();else u()}else u()}else u()},function(e){var t=e.apply;e.apply=function(n){if(!ap.Operation.isSelectionOperation(n)||!n.newProperties)return t(n);var r=fp(fp({},e.selection),n.newProperties);if(!ap.Range.isRange(r))return Ox.unselect(e),t(n);var o=vp(ap.Editor.nodes(e,{match:ux(e,"th","td"),at:ap.Range.start(r)}),1)[0],i=vp(ap.Editor.nodes(e,{match:ux(e,"th","td"),at:ap.Range.end(r)}),1)[0];if(!o||!i)return Ox.unselect(e),t(n);var a=vp(o,2)[1],s=vp(i,2)[1];if(ap.Path.equals(a,s)||!lx(e,[a,s],"table"))return Ox.unselect(e),t(n);for(var u=cx(e,{at:a}),l=dx.valueOf(0,0),c=dx.valueOf(0,0),d=0;d<u.length;d+=1)for(var f=0;f<u[d].length;f+=1){var p=vp(u[d][f],1),h=vp(p[0],2)[1];if(ap.Path.equals(a,h)&&(l.x=d,l.y=f),ap.Path.equals(s,h)){c.x=d,c.y=f;break}}for(var g=dx.valueOf(Math.min(l.x,c.x),Math.min(l.y,c.y)),v=dx.valueOf(Math.max(l.x,c.x),Math.max(l.y,c.y));;){var m=dx.valueOf(g.x,g.y),y=dx.valueOf(v.x,v.y);for(d=m.x;d<=y.x;d+=1)for(f=m.y;f<=y.y;f+=1){var b=vp(u[d][f],2)[1],E=b.rtl,C=b.ltr,D=b.btt,w=b.ttb;m.x=Math.min(m.x,d-(w-1)),m.y=Math.min(m.y,f-(E-1)),y.x=Math.max(y.x,d+(D-1)),y.y=Math.max(y.y,f+(C-1))}if(dx.equals(g,m)&&dx.equals(v,y))break;g=m,v=y}var A=[],S=new WeakSet;for(d=g.x;d<=v.x;d+=1){var x=[];for(f=g.y;f<=v.y;f+=1){var O=vp(u[d][f],1),T=vp(O[0],1)[0];S.add(T),x.push(u[d][f])}A.push(x)}hx.set(e,A),gx.set(e,S),t(n)}}(l),l}};function vO(e){return e.length?e[0].tagName.toLowerCase():""}function mO(e,t,n,r){void 0===t&&(t="auto"),void 0===n&&(n="auto"),void 0===r&&(r={});var o=ph(e),i=r.width,a=void 0===i?"":i,s=r.height,u=void 0===s?"":s,l="";return a&&(l+="width: ".concat(a,";")),u&&(l+="height: ".concat(u,";")),o.attr("width",t),o.attr("height",n),o.attr("style",l),o[0].outerHTML}ty("en",{videoModule:{delete:"Delete",uploadVideo:"Upload video",insertVideo:"Insert video",videoSrc:"Video source",videoSrcPlaceHolder:"Video file url, or third-party <iframe>",videoPoster:"Video poster",videoPosterPlaceHolder:"Poster image url",ok:"Ok",editSize:"Edit size",edit:"Edit video",width:"Width",height:"Height"}}),ty("zh-CN",{videoModule:{delete:"删除视频",uploadVideo:"上传视频",insertVideo:"插入视频",videoSrc:"视频地址",videoSrcPlaceHolder:"视频文件 url 或第三方 <iframe>",videoPoster:"视频封面",videoPosterPlaceHolder:"封面图片 url",ok:"确定",editSize:"修改尺寸",edit:"编辑视频",width:"宽度",height:"高度"}}),Rh&&(ph.fn.append=Rh),Dh&&(ph.fn.on=Dh),Wh&&(ph.fn.focus=Wh),mh&&(ph.fn.attr=mh),Ch&&(ph.fn.val=Ch),Fh&&(ph.fn.html=Fh),_h&&(ph.fn.parent=_h),vh&&(ph.fn.hasClass=vh),$h&&(ph.fn.empty=$h);var yO={type:"video",elemToHtml:function(e,t){var n=e,r=n.src,o=void 0===r?"":r,i=n.poster,a=void 0===i?"":i,s=n.width,u=void 0===s?"auto":s,l=n.height,c=void 0===l?"auto":l,d=n.style,f=void 0===d?{}:d,p=n.textAlign,h='<div data-w-e-type="video" data-w-e-is-void style="text-align: '.concat(void 0===p?"center":p,';">\n');if(0===o.trim().indexOf("<iframe ")){h+=mO(o,u,c,f)}else{var g=f.width,v=void 0===g?"":g,m=f.height,y=void 0===m?"":m,b="";v&&(b+="width: ".concat(v,";")),y&&(b+="height: ".concat(y,";")),h+='<video poster="'.concat(a,'" controls="true" width="').concat(u,'" height="').concat(c,'" style="').concat(b,'"><source src="').concat(o,'" type="video/mp4"/></video>')}return h+="\n</div>"}};function bO(e){return void 0===e&&(e="r"),"".concat(e,"-").concat(Kh())}function EO(e){var t={};return e.trim().split(";").forEach((function(e){if(e){var n=vp(e.split(":"),2),r=n[0],o=n[1];r&&o&&(t[r.trim()]=o.trim())}})),t}function CO(){return bO("w-e-insert-video")}var DO=function(){function e(){this.title=ry("videoModule.editSize"),this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=CO(),this.heightInputId=CO(),this.buttonId=CO()}return e.prototype.getSelectedVideoNode=function(e){return $g.getSelectedNodeByType(e,"video")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedVideoNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedVideoNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=t.widthInputId,r=t.heightInputId,o=t.buttonId,i=vp(hy(ry("videoModule.width"),n,"auto"),2),a=i[0],s=ph(i[1]),u=vp(hy(ry("videoModule.height"),r,"auto"),2),l=u[0],c=ph(u[1]),d=vp(gy(o,ry("videoModule.ok")),1)[0],f=this.getSelectedVideoNode(e);if(null==this.$content){var p=ph("<div></div>");p.on("click","#".concat(o),(function(t){t.preventDefault();var o=p.find("#".concat(n)).val().trim(),i=p.find("#".concat(r)).val().trim(),a=function(e){return/^\d+(\.\d+)?%$/.test(e)},s=function(e){return/^\d+(\.\d+)?$/.test(e)},u="auto",l="auto";a(o)?u=o:s(o)&&(u="".concat(parseInt(o,10),"px")),a(i)?l=i:s(i)&&(l="".concat(parseInt(i,10),"px"));var c=f.style,d=void 0===c?{}:c;e.restoreSelection();var h={style:fp(fp({},d),{width:u,height:l})};ap.Transforms.setNodes(e,h,{match:function(e){return $g.checkNodeType(e,"video")}}),e.hidePanelOrModal()})),this.$content=p}var h=this.$content;if(h.empty(),h.append(a),h.append(l),h.append(d),null==f)return h[0];var g=f.style,v=void 0===g?{}:g,m=v.width,y=void 0===m?"":m,b=v.height,E=void 0===b?"":b;return s.val(y),c.val(E),setTimeout((function(){s.focus()})),h[0]},e}();function wO(){return bO("w-e-edit-video")}var AO=function(){function e(){this.title=ry("videoModule.edit"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=wO(),this.posterInputId=wO(),this.buttonId=wO()}return e.prototype.getSelectedVideoNode=function(e){return $g.getSelectedNodeByType(e,"video")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedVideoNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedVideoNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.posterInputId,i=n.buttonId,a=vp(hy(ry("videoModule.videoSrc"),r,ry("videoModule.videoSrcPlaceHolder")),2),s=a[0],u=a[1],l=vp(hy(ry("videoModule.videoPoster"),o,ry("videoModule.videoPosterPlaceHolder")),2),c=l[0],d=l[1],f=ph(u),p=ph(d),h=vp(gy(i,ry("videoModule.ok")),1)[0];if(null==this.$content){var g=ph("<div></div>");g.on("click","#".concat(i),(function(n){return pp(t,void 0,void 0,(function(){var t,i,a,s;return hp(this,(function(u){return n.preventDefault(),t=g.find("#".concat(r)).val().trim(),i=g.find("#".concat(o)).val().trim(),a=bO("video-"),s={src:t,poster:i,key:a},e.restoreSelection(),ap.Transforms.setNodes(e,s,{match:function(e){return $g.checkNodeType(e,"video")}}),e.hidePanelOrModal(),[2]}))}))})),this.$content=g}var v=this.$content;v.empty(),v.append(s),v.append(c),v.append(h);var m=this.getSelectedVideoNode(e);if(null==m)return v[0];var y=m.src,b=void 0===y?"":y,E=m.poster,C=void 0===E?"":E;return f.val(b),p.val(C),setTimeout((function(){f.focus()})),v[0]},e}();function SO(e,t){return pp(this,arguments,void 0,(function(e,t,n,r,o){var i,a,s,u,l,c,d;return void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o=""),hp(this,(function(f){switch(f.label){case 0:return t?(e.restoreSelection(),i=e.getMenuConfig("insertVideo"),a=i.onInsertedVideo,s=i.checkVideo,u=i.parseVideoSrc,[4,s(t,n)]):[2];case 1:return"string"==typeof(l=f.sent())?(e.alert(l,"error"),[2]):null==l?[2]:[4,u(t)];case 2:return 0!==(c=f.sent()).trim().indexOf("<iframe ")&&(c=function(e){return e.replace(/</g,"<").replace(/>/g,">")}(c)),d={type:"video",src:c,poster:n,children:[{text:""}],style:{width:r,height:o}},Promise.resolve().then((function(){$g.isSelectedEmptyParagraph(e)&&ap.Transforms.removeNodes(e,{mode:"highest"}),ap.Transforms.insertNodes(e,d,{mode:"highest"})})),a(d),[2]}}))}))}function xO(){return bO("w-e-insert-video")}var OO=function(){function e(){this.title=ry("videoModule.insertVideo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.srcInputId=xO(),this.posterInputId=xO(),this.buttonId=xO()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||!!$g.getSelectedElems(e).some((function(t){var n=$g.getNodeType(t);return"pre"===n||("list-item"===n||!!e.isVoid(t))})))},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.posterInputId,i=n.buttonId,a=vp(hy(ry("videoModule.videoSrc"),r,ry("videoModule.videoSrcPlaceHolder")),2),s=a[0],u=a[1],l=vp(hy(ry("videoModule.videoPoster"),o,ry("videoModule.videoPosterPlaceHolder")),2),c=l[0],d=l[1],f=ph(u),p=ph(d),h=vp(gy(i,ry("videoModule.ok")),1)[0];if(null==this.$content){var g=ph("<div></div>");g.on("click","#".concat(i),(function(n){return pp(t,void 0,void 0,(function(){var t,i;return hp(this,(function(a){switch(a.label){case 0:return n.preventDefault(),t=g.find("#".concat(r)).val().trim(),i=g.find("#".concat(o)).val().trim(),[4,SO(e,t,i)];case 1:return a.sent(),e.hidePanelOrModal(),[2]}}))}))})),this.$content=g}var v=this.$content;return v.empty(),v.append(s),v.append(c),v.append(h),f.val(""),p.val(""),setTimeout((function(){f.focus()})),v[0]},e}();function TO(e){return e.getMenuConfig("uploadVideo")}var NO=new WeakMap;function BO(e,t){return pp(this,void 0,void 0,(function(){var n,r;return hp(this,(function(o){switch(o.label){case 0:return n=function(e){var t=NO.get(e);if(null!=t)return t;var n=TO(e),r=n.onSuccess,o=n.onProgress,i=n.onFailed,a=n.customInsert,s=n.onError;return t=vD(fp(fp({},n),{onProgress:function(t){e.showProgressBar(t),o&&o(t)},onSuccess:function(t,n){if(a)return a(n,(function(t,n){return SO(e,t,n)})),void r(t,n);var o=n.errno,s=void 0===o?1:o,u=n.data,l=void 0===u?{}:u;if(0===s){var c=l.url,d=void 0===c?"":c,f=l.poster;SO(e,d,void 0===f?"":f),r(t,n)}else i(t,n)},onError:function(e,t,n){s(e,t,n)}})),NO.set(e,t),t}(e),r=t.map((function(e){return{name:e.name,type:e.type,size:e.size,data:e}})),n.addFiles(r),[4,n.upload()];case 1:return o.sent(),[2]}}))}))}var kO=function(){function e(){this.title=ry("videoModule.uploadVideo"),this.iconSvg='<svg viewBox="0 0 1056 1024"><path d="M805.902261 521.819882a251.441452 251.441452 0 0 0-251.011972 246.600033 251.051015 251.051015 0 1 0 502.023944 8.823877 253.237463 253.237463 0 0 0-251.011972-255.42391z m59.463561 240.001647v129.898403h-116.701631v-129.898403h-44.041298l101.279368-103.504859 101.279368 103.504859z" p-id="6802"></path><path d="M788.254507 0.000781H99.094092A98.663439 98.663439 0 0 0 0.001171 99.093701v590.067495a98.663439 98.663439 0 0 0 99.092921 99.092921h411.7549a266.434235 266.434235 0 0 1-2.186448-41.815807 275.843767 275.843767 0 0 1 275.180024-270.729042 270.650955 270.650955 0 0 1 103.504859 19.834201V99.093701A101.51363 101.51363 0 0 0 788.254507 0.000781zM295.054441 640.747004V147.507894l394.146189 246.600033z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){var n=this.getMenuConfig(e),r=n.allowedFileTypes,o=void 0===r?[]:r,i=n.customBrowseAndUpload;if(i)i((function(t,n){return SO(e,t,n)}));else{var a="";o.length>0&&(a='accept="'.concat(o.join(", "),'"'));var s=ph("body"),u=ph('<input type="file" '.concat(a," multiple/>"));u.hide(),s.append(u),u.click(),u.on("change",(function(){var t=u[0].files;!function(e,t){pp(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,l,c,d,f,p;return hp(this,(function(h){switch(h.label){case 0:if(null==t)return[2];n=Array.prototype.slice.call(t),r=[],o=TO(e).customUpload,h.label=1;case 1:h.trys.push([1,8,9,14]),i=!0,a=yp(n),h.label=2;case 2:return[4,a.next()];case 3:return s=h.sent(),(c=s.done)?[3,7]:(p=s.value,i=!1,u=p,o?[4,o(u,(function(t,n){return SO(e,t,n)}))]:[3,5]);case 4:return h.sent(),[3,6];case 5:r.push(u),h.label=6;case 6:return i=!0,[3,2];case 7:return[3,14];case 8:return l=h.sent(),d={error:l},[3,14];case 9:return h.trys.push([9,,12,13]),i||c||!(f=a.return)?[3,11]:[4,f.call(a)];case 10:h.sent(),h.label=11;case 11:return[3,13];case 12:if(d)throw d.error;return[7];case 13:return[7];case 14:return r.length>0?[4,BO(e,r)]:[3,16];case 15:h.sent(),h.label=16;case 16:return[2]}}))}))}(e,t)}))}},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||!!$g.getSelectedElems(e).some((function(t){var n=$g.getNodeType(t);return"pre"===n||("list-item"===n||!!e.isVoid(t))})))},e.prototype.getMenuConfig=function(e){return e.getMenuConfig("uploadVideo")},e}();function FO(e,t,n,r,o,i){return void 0===t&&(t=""),void 0===n&&(n="auto"),void 0===r&&(r="auto"),void 0===o&&(o={}),void 0===i&&(i="center"),{type:"video",src:e,poster:t,width:n,height:r,style:o,children:[{text:""}],textAlign:i}}var PO={selector:'div[data-w-e-type="video"]',parseElemHtml:function(e,t,n){var r=ph(e),o="",i="",a="auto",s="auto",u={},l=r.find("iframe");if(l.length>0)return a=l.attr("width")||"auto",s=l.attr("height")||"auto",u=EO(u=l.attr("style")||""),FO(o=l[0].outerHTML,i,a,s,u,EO(r.attr("style")||"")["text-align"]||"center");var c=r.find("video");return(o=c.attr("src")||"")||c.length>0&&(o=c.find("source").attr("src")||""),a=c.attr("width")||"auto",s=c.attr("height")||"auto",FO(o,i=c.attr("poster")||"",a,s,u=EO(u=c.attr("style")||""),EO(r.attr("style")||"")["text-align"]||"center")}};var IO={selector:"iframe,video,p",preParseHtml:function(e){var t=ph(e),n=t;if("p"===vO(t)){var r=t.children();if(1===r.length){var o=r[0],i=o.tagName.toLowerCase();["iframe","video"].includes(i)&&(n=ph(o))}}var a=vO(n);if("iframe"!==a&&"video"!==a)return n[0];if("video"===n.parent().attr("data-w-e-type"))return n[0];var s=ph('<div data-w-e-type="video" data-w-e-is-void style="text-align: center;"></div>');return s.append(n),s[0]}};var RO={type:"video",renderElem:function(e,t,n){var r,o=e,i=o.src,a=void 0===i?"":i,s=o.poster,u=void 0===s?"":s,l=o.key,c=void 0===l?"":l,d=o.width,f=void 0===d?"auto":d,p=o.height,h=void 0===p?"auto":p,g=o.style,v=void 0===g?{}:g,m=o.textAlign,y=void 0===m?"center":m,b=$g.isNodeSelected(n,e);if(0===a.trim().indexOf("<iframe ")){var E=mO(a,f,h,v);r=rb.jsx("div",{className:"w-e-textarea-video-container","data-selected":b?"true":"",style:{textAlign:y},innerHTML:E})}else{var C=rb.jsx("video",{key:c,poster:u,controls:!0,style:v},rb.jsx("source",{src:a,type:"video/mp4"}),"Sorry, your browser doesn't support embedded videos.\n 抱歉,浏览器不支持 video 视频");"auto"!==f&&(C.data.width=f),"auto"!==h&&(C.data.height=h),r=rb.jsx("div",{className:"w-e-textarea-video-container","data-selected":b?"true":"",style:{textAlign:y}},C)}var D=rb.h("div",{props:{contentEditable:!1},on:{mousedown:function(e){return e.preventDefault()}}},r);return D}},LO={renderElems:[RO],elemsToHtml:[yO],preParseHtml:[IO],parseElemsHtml:[PO],menus:[{key:"insertVideo",factory:function(){return new OO},config:{onInsertedVideo:function(e){},checkVideo:function(e,t){return!0},parseVideoSrc:function(e){return e}}},{key:"uploadVideo",factory:function(){return new kO},config:{server:"",fieldName:"wangeditor-uploaded-video",maxFileSize:10485760,maxNumberOfFiles:5,allowedFileTypes:["video/*"],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:3e4,onBeforeUpload:function(e){return e},onProgress:function(e){},onSuccess:function(e,t){},onFailed:function(e,t){console.error("'".concat(e.name,"' upload failed"),t)},onError:function(e,t,n){console.error("'".concat(e.name," upload error"),t,n)}}},{key:"editVideoSize",factory:function(){return new DO}},{key:"editVideoSrc",factory:function(){return new AO}}],editorPlugin:function(e){var t=e.isVoid,n=e.normalizeNode,r=e;return r.isVoid=function(e){return"video"===e.type||t(e)},r.normalizeNode=function(e){var t=vp(e,2),o=t[0],i=t[1];"video"===$g.getNodeType(o)&&($g.isLastNode(r,o)&&ap.Transforms.insertNodes(r,$g.genEmptyParagraph(),{at:[i[0]+1]}));return n([o,i])},r}};ty("en",{uploadImgModule:{uploadImage:"Upload Image",uploadError:"{{fileName}} upload error"}}),ty("zh-CN",{uploadImgModule:{uploadImage:"上传图片",uploadError:"{{fileName}} 上传出错"}});Rh&&(ph.fn.append=Rh),Dh&&(ph.fn.on=Dh),zh&&(ph.fn.remove=zh),Ch&&(ph.fn.val=Ch),Gh&&(ph.fn.click=Gh),Oh&&(ph.fn.hide=Oh);var _O=new WeakMap;function MO(e){return e.getMenuConfig("uploadImage")}function jO(e,t){return pp(this,void 0,void 0,(function(){return hp(this,(function(n){return[2,new Promise((function(n){var r=new FileReader;r.readAsDataURL(t),r.onload=function(){var o=r.result;if(o){var i=o.toString(),a=0===i.indexOf("data:image")?"":i;vA(e,i,t.name,a),n("ok")}}}))]}))}))}function HO(e,t){return pp(this,void 0,void 0,(function(){var n,r;return hp(this,(function(o){switch(o.label){case 0:return n=function(e){var t=_O.get(e);if(null!=t)return t;var n=MO(e),r=n.onSuccess,o=n.onProgress,i=n.onFailed,a=n.customInsert,s=n.onError;return t=vD(fp(fp({},n),{onProgress:function(t){e.showProgressBar(t),o&&o(t)},onSuccess:function(t,n){if(a)return a(n,(function(t,n,r){return vA(e,t,n,r)})),void r(t,n);var o=n.errno,s=void 0===o?1:o,u=n.data,l=void 0===u?{}:u;if(0===s){if(Array.isArray(l))l.forEach((function(t){var n=t.url,r=void 0===n?"":n,o=t.alt,i=void 0===o?"":o,a=t.href;vA(e,r,i,void 0===a?"":a)}));else{var c=l.url,d=void 0===c?"":c,f=l.alt,p=void 0===f?"":f,h=l.href;vA(e,d,p,void 0===h?"":h)}r(t,n)}else i(t,n)},onError:function(e,t,n){s(e,t,n)}})),_O.set(e,t),t}(e),r=t.map((function(e){return{name:e.name,type:e.type,size:e.size,data:e}})),n.addFiles(r),[4,n.upload()];case 1:return o.sent(),[2]}}))}))}function zO(e,t){return pp(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,l,c,d,f,p,h,g,v;return hp(this,(function(m){switch(m.label){case 0:if(null==t)return[2];n=Array.prototype.slice.call(t),r=MO(e),o=r.customUpload,i=r.base64LimitSize,a=[],m.label=1;case 1:m.trys.push([1,10,11,16]),s=!0,u=yp(n),m.label=2;case 2:return[4,u.next()];case 3:return l=m.sent(),(p=l.done)?[3,9]:(v=l.value,s=!1,d=(c=v).size,i&&d<=i?[4,jO(e,c)]:[3,5]);case 4:return m.sent(),[3,8];case 5:return o?[4,o(c,(function(t,n,r){return vA(e,t,n,r)}))]:[3,7];case 6:return m.sent(),[3,8];case 7:a.push(c),m.label=8;case 8:return s=!0,[3,2];case 9:return[3,16];case 10:return f=m.sent(),h={error:f},[3,16];case 11:return m.trys.push([11,,14,15]),s||p||!(g=u.return)?[3,13]:[4,g.call(u)];case 12:m.sent(),m.label=13;case 13:return[3,15];case 14:if(h)throw h.error;return[7];case 15:return[7];case 16:return a.length>0?[4,HO(e,a)]:[3,18];case 17:m.sent(),m.label=18;case 18:return[2]}}))}))}var $O=function(){function e(){this.title=ry("uploadImgModule.uploadImage"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M828.708571 585.045333a48.761905 48.761905 0 0 0-48.737523 48.761905v18.529524l-72.143238-72.167619a135.972571 135.972571 0 0 0-191.585524 0l-34.133334 34.133333-120.880762-120.953905a138.898286 138.898286 0 0 0-191.585523 0l-72.167619 72.167619V292.400762a48.786286 48.786286 0 0 1 48.761904-48.761905h341.23581a48.737524 48.737524 0 0 0 34.474667-83.285333 48.737524 48.737524 0 0 0-34.474667-14.287238H146.236952A146.212571 146.212571 0 0 0 0 292.400762v585.289143A146.358857 146.358857 0 0 0 146.236952 1024h584.996572a146.212571 146.212571 0 0 0 146.236952-146.310095V633.807238a48.786286 48.786286 0 0 0-48.761905-48.761905zM146.261333 926.45181a48.737524 48.737524 0 0 1-48.761904-48.761905v-174.128762l141.409523-141.458286a38.497524 38.497524 0 0 1 53.126096 0l154.526476 154.624 209.627428 209.724953H146.236952z m633.734096-48.761905c-0.073143 9.337905-3.145143 18.383238-8.777143 25.843809l-219.843048-220.94019 34.133333-34.133334a37.546667 37.546667 0 0 1 53.613715 0l140.873143 141.897143V877.714286zM1009.615238 160.231619L863.329524 13.897143a48.737524 48.737524 0 0 0-16.091429-10.24c-11.849143-4.87619-25.161143-4.87619-37.059047 0a48.761905 48.761905 0 0 0-16.067048 10.24l-146.236952 146.334476a49.005714 49.005714 0 0 0 69.217523 69.241905l62.902858-63.390476v272.627809a48.761905 48.761905 0 1 0 97.475047 0V166.083048l62.902857 63.390476a48.737524 48.737524 0 0 0 69.217524 0 48.761905 48.761905 0 0 0 0-69.241905z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return pA(e)},e.prototype.getMenuConfig=function(e){return e.getMenuConfig("uploadImage")},e.prototype.exec=function(e,t){var n=this.getMenuConfig(e),r=n.allowedFileTypes,o=void 0===r?[]:r,i=n.customBrowseAndUpload;if(i)i((function(t,n,r){return vA(e,t,n,r)}));else{var a="";o.length>0&&(a='accept="'.concat(o.join(", "),'"'));var s=ph("body"),u=ph('<input type="file" '.concat(a," multiple/>"));u.hide(),s.append(u),u.click(),u.on("change",(function(){var t=u[0].files;zO(e,t)}))}},e}();var UO={menus:[{key:"uploadImage",factory:function(){return new $O},config:{server:"",fieldName:"wangeditor-uploaded-image",maxFileSize:2097152,maxNumberOfFiles:100,allowedFileTypes:["image/*"],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:1e4,onBeforeUpload:function(e){return e},onProgress:function(e){},onSuccess:function(e,t){},onFailed:function(e,t){console.error("'".concat(e.name,"' upload failed"),t)},onError:function(e,t,n){console.error("'".concat(e.name,"' upload error"),n)},base64LimitSize:0}}],editorPlugin:function(e){var t=e.insertData,n=e;return n.insertData=function(r){if(pA(n))t(r);else if(r.getData("text/plain"))t(r);else{var o=r.files;if(o.length<=0)t(r);else Array.prototype.slice.call(o).some((function(e){return"image"===vp(e.type.split("/"),1)[0]}))?zO(e,o):t(r)}},n}};ty("en",{highLightModule:{selectLang:"Language"}}),ty("zh-CN",{highLightModule:{selectLang:"选择语言"}});var VO,GO={exports:{}};var WO=(VO||(VO=1,function(e){var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},o.util.type(t)){case"Object":if(i=o.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=o.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach((function(t,o){r[o]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var o=e.classList;if(o.contains(t))return!0;if(o.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=o.util.clone(o.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||o.languages)[e],a={};for(var s in i)if(i.hasOwnProperty(s)){if(s==t)for(var u in n)n.hasOwnProperty(u)&&(a[u]=n[u]);n.hasOwnProperty(s)||(a[s]=i[s])}var l=r[e];return r[e]=a,o.languages.DFS(o.languages,(function(t,n){n===l&&t!=e&&(this[t]=a)})),a},DFS:function e(t,n,r,i){i=i||{};var a=o.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var u=t[s],l=o.util.type(u);"Object"!==l||i[a(u)]?"Array"!==l||i[a(u)]||(i[a(u)]=!0,e(u,n,s,i)):(i[a(u)]=!0,e(u,n,null,i))}}},plugins:{},highlightAll:function(e,t){o.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),o.hooks.run("before-all-elements-highlight",r);for(var i,a=0;i=r.elements[a++];)o.highlightElement(i,!0===t,r.callback)},highlightElement:function(t,n,r){var i=o.util.getLanguage(t),a=o.languages[i];o.util.setLanguage(t,i);var s=t.parentElement;s&&"pre"===s.nodeName.toLowerCase()&&o.util.setLanguage(s,i);var u={element:t,language:i,grammar:a,code:t.textContent};function l(e){u.highlightedCode=e,o.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,o.hooks.run("after-highlight",u),o.hooks.run("complete",u),r&&r.call(u.element)}if(o.hooks.run("before-sanity-check",u),(s=u.element.parentElement)&&"pre"===s.nodeName.toLowerCase()&&!s.hasAttribute("tabindex")&&s.setAttribute("tabindex","0"),!u.code)return o.hooks.run("complete",u),void(r&&r.call(u.element));if(o.hooks.run("before-highlight",u),u.grammar)if(n&&e.Worker){var c=new Worker(o.filename);c.onmessage=function(e){l(e.data)},c.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else l(o.highlight(u.code,u.grammar,u.language));else l(o.util.encode(u.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(o.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=o.tokenize(r.code,r.grammar),o.hooks.run("after-tokenize",r),i.stringify(o.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new u;return l(o,o.head,e),s(e,o,t,o.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=o.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=o.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function a(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function s(e,t,n,r,u,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var h=0;h<p.length;++h){if(d&&d.cause==f+","+h)return;var g=p[h],v=g.inside,m=!!g.lookbehind,y=!!g.greedy,b=g.alias;if(y&&!g.pattern.global){var E=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,E+"g")}for(var C=g.pattern||g,D=r.next,w=u;D!==t.tail&&!(d&&w>=d.reach);w+=D.value.length,D=D.next){var A=D.value;if(t.length>e.length)return;if(!(A instanceof i)){var S,x=1;if(y){if(!(S=a(C,w,e,m))||S.index>=e.length)break;var O=S.index,T=S.index+S[0].length,N=w;for(N+=D.value.length;O>=N;)N+=(D=D.next).value.length;if(w=N-=D.value.length,D.value instanceof i)continue;for(var B=D;B!==t.tail&&(N<T||"string"==typeof B.value);B=B.next)x++,N+=B.value.length;x--,A=e.slice(w,N),S.index-=w}else if(!(S=a(C,0,A,m)))continue;O=S.index;var k=S[0],F=A.slice(0,O),P=A.slice(O+k.length),I=w+A.length;d&&I>d.reach&&(d.reach=I);var R=D.prev;if(F&&(R=l(t,R,F),w+=F.length),c(t,R,x),D=l(t,R,new i(f,v?o.tokenize(k,v):k,b,k)),P&&l(t,D,P),x>1){var L={cause:f+","+h,reach:I};s(e,t,n,D.prev,w,L),d&&L.reach>d.reach&&(d.reach=L.reach)}}}}}}function u(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function c(e,t,n){for(var r=t.next,o=0;o<n&&r!==e.tail;o++)r=r.next;t.next=r,r.prev=t,e.length-=o}if(e.Prism=o,i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var i={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},a=t.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(i.classes,a):i.classes.push(a)),o.hooks.run("wrap",i);var s="";for(var u in i.attributes)s+=" "+u+'="'+(i.attributes[u]||"").replace(/"/g,""")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+s+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,a=n.immediateClose;e.postMessage(o.highlight(i,o.languages[r],r)),a&&e.close()}),!1),o):o;var d=o.util.currentScript();function f(){o.manual||o.highlightAll()}if(d&&(o.filename=d.src,d.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});
|
|
19
|
+
*/function i(e,t){const n=/\$/g;let r=[e];if(null==t)return r;for(const e of Object.keys(t))if("_"!==e){let i=t[e];"string"==typeof i&&(i=n[Symbol.replace](i,"$$$$")),r=o(r,new RegExp(`%\\{${e}\\}`,"g"),i)}return r}var a=n("apply");function s(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}return Ub=class{constructor(t){Object.defineProperty(this,a,{value:s}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(t)?t.forEach(e(this,a)[a],this):e(this,a)[a](t)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!r(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return i(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return i(n,t)}},Ub}function mE(){return Wb||(Wb=1,Gb=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,o,i,a,s){var u=function(e){var n=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(t),a=0,s=i.length;for(;a<s;a++){var u=i[a];if("*"===u&&(n=n.concat(t[u])),2===o.length&&o[0]===u){n=n.concat(t[u]);break}}return n}(e);u.length&&function(e,t,n){var r=0,o=t.length;for(;r<o&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,u,[n,r,o,i,a,s])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,(function r(){n.apply(this,arguments),e.off(t,r)}))},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],o=0,i=r?r.length:0;o<i;o++)r[o]!==t&&n.push(r[o]);n.length?this._fns[e]=n:delete this._fns[e]},e}),Gb}function yE(){if(Kb)return qb;Kb=1;var e=0;function t(t){return"__private_"+e+++"_"+t}var n=t("publish");class r{constructor(){Object.defineProperty(this,n,{value:o}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},r={...this.state,...e};this.state=r,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,n)[n](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach((e=>{e(...t)}))}return r.VERSION="2.1.1",qb=function(){return new r}}function bE(){if(Xb)return Yb;return Xb=1,Yb=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}}function EE(){return Jb?Zb:(Jb=1,Zb={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"})}function CE(){if(cE)return lE;cE=1;var e=Pb(),t=Fb(),n=hE();let r,o;function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var a=0;function s(e){return"__private_"+a+++"_"+e}const u=vE(),l=mE(),c=Oy(),d=yE(),f=function(){if(eE)return Qb;eE=1;const e=bE(),t=EE();return Qb=function(n){var r;if(n.type)return n.type;const o=n.name?null==(r=e(n.name).extension)?void 0:r.toLowerCase():null;return o&&o in t?t[o]:"application/octet-stream"}}(),p=bE(),h=function(){if(nE)return tE;function e(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}return nE=1,tE=function(t){let n="uppy";return"string"==typeof t.name&&(n+=`-${e(t.name.toLowerCase())}`),void 0!==t.type&&(n+=`-${t.type}`),t.meta&&"string"==typeof t.meta.relativePath&&(n+=`-${e(t.meta.relativePath.toLowerCase())}`),void 0!==t.data.size&&(n+=`-${t.data.size}`),void 0!==t.data.lastModified&&(n+=`-${t.data.lastModified}`),n}}(),g=(oE||(oE=1,rE=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[r,o]=n.split(".");return r=parseInt(r,10),o=parseInt(o,10),r<15||15===r&&o<15063||r>18||18===r&&o>=18218}),rE),v=aE?iE:(aE=1,iE=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}),m=uE?sE:(uE=1,sE={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}});var y=s("plugins"),b=s("restricter"),E=s("storeUnsubscribe"),C=s("emitter"),D=s("preProcessors"),w=s("uploaders"),A=s("postProcessors"),S=s("informAndEmit"),x=s("checkRequiredMetaFieldsOnFile"),O=s("checkRequiredMetaFields"),T=s("assertNewUploadAllowed"),N=s("checkAndCreateFileStateObject"),B=s("startIfAutoProceed"),k=s("addListeners"),F=s("updateOnlineStatus"),P=s("createUpload"),I=s("getUpload"),R=s("removeUpload"),L=s("runUpload");r=Symbol.for("uppy test: getPlugins"),o=Symbol.for("uppy test: createUpload");class _{constructor(e){Object.defineProperty(this,L,{value:K}),Object.defineProperty(this,R,{value:q}),Object.defineProperty(this,I,{value:W}),Object.defineProperty(this,P,{value:G}),Object.defineProperty(this,k,{value:V}),Object.defineProperty(this,B,{value:U}),Object.defineProperty(this,N,{value:$}),Object.defineProperty(this,T,{value:z}),Object.defineProperty(this,O,{value:H}),Object.defineProperty(this,x,{value:j}),Object.defineProperty(this,S,{value:M}),Object.defineProperty(this,y,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,b,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:l()}),Object.defineProperty(this,D,{writable:!0,value:new Set}),Object.defineProperty(this,w,{writable:!0,value:new Set}),Object.defineProperty(this,A,{writable:!0,value:new Set}),Object.defineProperty(this,F,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=m;const r={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:n.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:d(),logger:t.justErrorsLogger,infoTimeout:5e3};this.opts={...r,...e,restrictions:{...r.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=t.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=c(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:g(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),i(this,b)[b]=new n.Restricter((()=>this.opts),this.i18n),i(this,E)[E]=this.store.subscribe(((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),i(this,k)[k]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i(this,C)[C].emit(e,...n)}on(e,t){return i(this,C)[C].on(e,t),this}once(e,t){return i(this,C)[C].once(e,t),this}off(e,t){return i(this,C)[C].off(e,t),this}updateAll(e){this.iteratePlugins((t=>{t.update(e)}))}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new u([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((e=>{e.setOptions()})),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach((r=>{const o={...t[r]};o.progress={...o.progress,...e},n[r]=o})),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){i(this,D)[D].add(e)}removePreProcessor(e){return i(this,D)[D].delete(e)}addPostProcessor(e){i(this,A)[A].add(e)}removePostProcessor(e){return i(this,A)[A].delete(e)}addUploader(e){i(this,w)[w].add(e)}removeUploader(e){return i(this,w)[w].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach((t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const r={...n[e].meta,...t};n[e]={...n[e],meta:r},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=r.filter((e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted})),i=r.filter((e=>!e.progress.uploadStarted)),a=r.filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess)),s=r.filter((e=>e.progress.uploadStarted)),u=r.filter((e=>e.isPaused)),l=r.filter((e=>e.progress.uploadComplete)),c=r.filter((e=>e.error)),d=o.filter((e=>!e.isPaused)),f=r.filter((e=>e.progress.preprocess||e.progress.postprocess));return{newFiles:i,startedFiles:a,uploadStartedFiles:s,pausedFiles:u,completeFiles:l,erroredFiles:c,inProgressFiles:o,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:s.length>0,isAllComplete:100===t&&l.length===r.length&&0===f.length,isAllErrored:!!n&&c.length===r.length,isAllPaused:0!==o.length&&u.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some((e=>e.isGhost))}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return i(this,b)[b].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){i(this,T)[T](e);const{files:t}=this.getState();let n=i(this,N)[N](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),i(this,B)[B](),n.id}addFiles(e){i(this,T)[T]();const t={...this.getState().files},n=[],r=[];for(let o=0;o<e.length;o++)try{let r=i(this,N)[N](t,e[o]);t[r.id]&&t[r.id].isGhost&&(r={...t[r.id],data:e[o].data,isGhost:!1},this.log(`Replaced blob in a ghost file: ${r.name}, ${r.id}`)),t[r.id]=r,n.push(r)}catch(e){e.isRestriction||r.push(e)}if(this.setState({files:t}),n.forEach((e=>{this.emit("file-added",e)})),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach((e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)})),n.length>0&&i(this,B)[B](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}}removeFiles(e,t){const{files:n,currentUploads:r}=this.getState(),o={...n},i={...r},a=Object.create(null);function s(e){return void 0===a[e]}e.forEach((e=>{n[e]&&(a[e]=n[e],delete o[e])})),Object.keys(i).forEach((e=>{const t=r[e].fileIDs.filter(s);if(0===t.length)return void delete i[e];const{capabilities:n}=this.getState();if(t.length!==r[e].fileIDs.length&&!n.individualCancellation)throw new Error("individualCancellation is disabled");i[e]={...r[e],fileIDs:t}}));const u={currentUploads:i,files:o};0===Object.keys(o).length&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),this.calculateTotalProgress();const l=Object.keys(a);l.forEach((e=>{this.emit("file-removed",a[e],t)})),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!0};e[t]=n})),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>e[t].error));if(t.forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=i(this,P)[P](t,{forceAllowNewUpload:!0});return i(this,L)[L](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=i(this,P)[P]([e],{forceAllowNewUpload:!0});return i(this,L)[L](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins((e=>{e.provider&&e.provider.logout&&e.provider.logout()}))}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess));if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter((e=>null!=e.progress.bytesTotal)),n=e.filter((e=>null==e.progress.bytesTotal));if(0===t.length){const t=100*e.length,r=n.reduce(((e,t)=>e+t.progress.percentage),0),o=Math.round(r/t*100);return void this.setState({totalProgress:o})}let r=t.reduce(((e,t)=>e+t.progress.bytesTotal),0);const o=r/t.length;r+=o*n.length;let i=0;t.forEach((e=>{i+=e.progress.bytesUploaded})),n.forEach((e=>{i+=o*(e.progress.percentage||0)/100}));let a=0===r?0:Math.round(i/r*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`)}const n=new e(this,t),r=n.id;if(!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(r);if(o){const e=`Already found a plugin named '${o.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in i(this,y)[y]?i(this,y)[y][n.type].push(n):i(this,y)[y][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(i(this,y)[y])){const n=t.find((t=>t.id===e));if(null!=n)return n}}[r](e){return i(this,y)[y][e]}iteratePlugins(e){Object.values(i(this,y)[y]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=i(this,y)[y][e.type],n=t.findIndex((t=>t.id===e.id));-1!==n&&t.splice(n,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),i(this,E)[E](),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",i(this,F)[F]),window.removeEventListener("offline",i(this,F)[F]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout((()=>this.hideInfo()),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?i(this,L)[L](e):(i(this,R)[R](e),Promise.reject(new Error("Nonexistent upload")))}[o](){return i(this,P)[P](...arguments)}addResultData(e,t){if(!i(this,I)[I](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),r={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:r}})}upload(){var e;null!=(e=i(this,y)[y].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const r=this.opts.onBeforeUpload(t);return!1===r?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&"object"==typeof r&&(t=r,this.setState({files:t})),Promise.resolve().then((()=>i(this,b)[b].validateMinNumberOfFiles(t))).catch((e=>{throw i(this,S)[S](e),e})).then((()=>{if(!i(this,O)[O](t))throw new n.RestrictionError(this.i18n("missingRequiredMetaField"))})).catch((e=>{throw e})).then((()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap((e=>e.fileIDs)),r=[];Object.keys(t).forEach((e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||r.push(t.id)}));const o=i(this,P)[P](r);return i(this,L)[L](o)})).catch((e=>{throw this.emit("error",e),this.log(e,"error"),e})))}}function M(e,t){const{message:n,details:r=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:r},"error",this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),"error")}function j(e){const{missingFields:t,error:n}=i(this,b)[b].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),!1)}function H(e){let t=!0;for(const n of Object.values(e))i(this,x)[x](n)||(t=!1);return t}function z(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new n.RestrictionError(this.i18n("noMoreFilesAllowed"));throw i(this,S)[S](t,e),t}}function $(e,t){const r=f(t),o=v(r,t),a=p(o).extension,s=Boolean(t.isRemote),u=h({...t,type:r});if(this.checkIfFileAlreadyExists(u)){const e=new n.RestrictionError(this.i18n("noDuplicates",{fileName:o}));throw i(this,S)[S](e,t),e}const l=t.meta||{};l.name=o,l.type=r;const c=Number.isFinite(t.data.size)?t.data.size:null;let d={source:t.source||"",id:u,name:o,extension:a||"",meta:{...this.getState().meta,...l},type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:c,uploadComplete:!1,uploadStarted:null},size:c,isRemote:s,remote:t.remote||"",preview:t.preview};const g=this.opts.onBeforeFileAdded(d,e);if(!1===g){const e=new n.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof g&&null!==g&&(d=g);try{const t=Object.keys(e).map((t=>e[t]));i(this,b)[b].validate(d,t)}catch(e){throw i(this,S)[S](e,d),e}return d}function U(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((()=>{this.scheduledAutoProceed=null,this.upload().catch((e=>{e.isRestriction||this.log(e.stack||e.message||e)}))}),4))}function V(){const e=(e,t,n)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on("error",e),this.on("upload-error",((t,n,r)=>{if(e(n,t,r),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),i(this,S)[S](e)}else i(this,S)[S](n)})),this.on("upload",(()=>{this.setState({error:null})})),this.on("upload-started",(e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("upload-progress",this.calculateProgress),this.on("upload-success",((e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:i(this,A)[A].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()})),this.on("preprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("preprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})})),this.on("postprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("postprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})})),this.on("restored",(()=>{this.calculateTotalProgress()})),this.on("dashboard:file-edit-complete",(e=>{e&&i(this,x)[x](e)})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",i(this,F)[F]),window.addEventListener("offline",i(this,F)[F]),setTimeout(i(this,F)[F],3e3))}function G(t,n){void 0===n&&(n={});const{forceAllowNewUpload:r=!1}=n,{allowNewUpload:o,currentUploads:i}=this.getState();if(!o&&!r)throw new Error("Cannot create a new upload: already uploading.");const a=(0,e.nanoid)();return this.emit("upload",{id:a,fileIDs:t}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...i,[a]:{fileIDs:t,step:0,result:{}}}}),a}function W(e){const{currentUploads:t}=this.getState();return t[e]}function q(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function K(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,o=[...i(this,D)[D],...i(this,w)[w],...i(this,A)[A]];try{for(let i=r;i<o.length&&n;i++){const r=o[i],a={...n,step:i};this.setState({currentUploads:{...t,[e]:a}}),await r(a.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw i(this,R)[R](e),t}if(n){n.fileIDs.forEach((e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)}));const r=n.fileIDs.map((e=>this.getFile(e))),o=r.filter((e=>!e.error)),i=r.filter((e=>e.error));await this.addResultData(e,{successful:o,failed:i,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let a;return n&&(a=n.result,this.emit("complete",a),i(this,R)[R](e)),null==a&&this.log(`Not setting result for an upload that has been removed: ${e}`),a}return _.VERSION="2.3.4",lE=_}var DE,wE,AE,SE,xE,OE,TE,NE,BE={},kE=[],FE=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function PE(e,t){for(var n in t)e[n]=t[n];return e}function IE(e){var t=e.parentNode;t&&t.removeChild(e)}function RE(e,t,n){var r,o,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?DE.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return LE(e,a,r,o,null)}function LE(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++AE:o};return null==o&&null!=wE.vnode&&wE.vnode(i),i}function _E(e){return e.children}function ME(e,t){this.props=e,this.context=t}function jE(e,t){if(null==t)return e.__?jE(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?jE(e):null}function HE(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return HE(e)}}function zE(e){(!e.__d&&(e.__d=!0)&&xE.push(e)&&!$E.__r++||TE!==wE.debounceRendering)&&((TE=wE.debounceRendering)||OE)($E)}function $E(){for(var e;$E.__r=xE.length;)e=xE.sort((function(e,t){return e.__v.__b-t.__v.__b})),xE=[],e.some((function(e){var t,n,r,o,i,a;e.__d&&(i=(o=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=PE({},o)).__v=o.__v+1,XE(a,o,r,t.__n,void 0!==a.ownerSVGElement,null!=o.__h?[i]:null,n,null==i?jE(o):i,o.__h),ZE(n,o),o.__e!=i&&HE(o)))}))}function UE(e,t,n,r,o,i,a,s,u,l){var c,d,f,p,h,g,v,m=r&&r.__k||kE,y=m.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(p=n.__k[c]=null==(p=t[c])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?LE(null,p,null,null,p):Array.isArray(p)?LE(_E,{children:p},null,null,null):p.__b>0?LE(p.type,p.props,p.key,null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(f=m[c])||f&&p.key==f.key&&p.type===f.type)m[c]=void 0;else for(d=0;d<y;d++){if((f=m[d])&&p.key==f.key&&p.type===f.type){m[d]=void 0;break}f=null}XE(e,p,f=f||BE,o,i,a,s,u,l),h=p.__e,(d=p.ref)&&f.ref!=d&&(v||(v=[]),f.ref&&v.push(f.ref,null,p),v.push(d,p.__c||h,p)),null!=h?(null==g&&(g=h),"function"==typeof p.type&&p.__k===f.__k?p.__d=u=VE(p,u,e):u=GE(e,p,f,m,h,u),"function"==typeof n.type&&(n.__d=u)):u&&f.__e==u&&u.parentNode!=e&&(u=jE(f))}for(n.__e=g,c=y;c--;)null!=m[c]&&("function"==typeof n.type&&null!=m[c].__e&&m[c].__e==n.__d&&(n.__d=jE(r,c+1)),eC(m[c],m[c]));if(v)for(c=0;c<v.length;c++)QE(v[c],v[++c],v[++c])}function VE(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t="function"==typeof r.type?VE(r,t,n):GE(n,r,r,o,r.__e,t));return t}function GE(e,t,n,r,o,i){var a,s,u;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),a=null;else{for(s=i,u=0;(s=s.nextSibling)&&u<r.length;u+=2)if(s==o)break e;e.insertBefore(o,i),a=i}return void 0!==a?a:o.nextSibling}function WE(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||FE.test(t)?n:n+"px"}function qE(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||WE(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||WE(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?YE:KE,i):e.removeEventListener(t,i?YE:KE,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function KE(e){this.l[e.type+!1](wE.event?wE.event(e):e)}function YE(e){this.l[e.type+!0](wE.event?wE.event(e):e)}function XE(e,t,n,r,o,i,a,s,u){var l,c,d,f,p,h,g,v,m,y,b,E=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(u=n.__h,s=t.__e=n.__e,t.__h=null,i=[s]),(l=wE.__b)&&l(t);try{e:if("function"==typeof E){if(v=t.props,m=(l=E.contextType)&&r[l.__c],y=l?m?m.props.value:l.__:r,n.__c?g=(c=t.__c=n.__c).__=c.__E:("prototype"in E&&E.prototype.render?t.__c=c=new E(v,y):(t.__c=c=new ME(v,y),c.constructor=E,c.render=tC),m&&m.sub(c),c.props=v,c.state||(c.state={}),c.context=y,c.__n=r,d=c.__d=!0,c.__h=[]),null==c.__s&&(c.__s=c.state),null!=E.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=PE({},c.__s)),PE(c.__s,E.getDerivedStateFromProps(v,c.__s))),f=c.props,p=c.state,d)null==E.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==E.getDerivedStateFromProps&&v!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(v,y),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(v,c.__s,y)||t.__v===n.__v){c.props=v,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),c.__h.length&&a.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(v,c.__s,y),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,h)}))}c.context=y,c.props=v,c.state=c.__s,(l=wE.__r)&&l(t),c.__d=!1,c.__v=t,c.__P=e,l=c.render(c.props,c.state,c.context),c.state=c.__s,null!=c.getChildContext&&(r=PE(PE({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(h=c.getSnapshotBeforeUpdate(f,p)),b=null!=l&&l.type===_E&&null==l.key?l.props.children:l,UE(e,Array.isArray(b)?b:[b],t,n,r,o,i,a,s,u),c.base=t.__e,t.__h=null,c.__h.length&&a.push(c),g&&(c.__E=c.__=null),c.__e=!1}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=JE(n.__e,t,n,r,o,i,a,u);(l=wE.diffed)&&l(t)}catch(e){t.__v=null,(u||null!=i)&&(t.__e=s,t.__h=!!u,i[i.indexOf(s)]=null),wE.__e(e,t,n)}}function ZE(e,t){wE.__c&&wE.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){wE.__e(e,t.__v)}}))}function JE(e,t,n,r,o,i,a,s){var u,l,c,d=n.props,f=t.props,p=t.type,h=0;if("svg"===p&&(o=!0),null!=i)for(;h<i.length;h++)if((u=i[h])&&"setAttribute"in u==!!p&&(p?u.localName===p:3===u.nodeType)){e=u,i[h]=null;break}if(null==e){if(null===p)return document.createTextNode(f);e=o?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,f.is&&f),i=null,s=!1}if(null===p)d===f||s&&e.data===f||(e.data=f);else{if(i=i&&DE.call(e.childNodes),l=(d=n.props||BE).dangerouslySetInnerHTML,c=f.dangerouslySetInnerHTML,!s){if(null!=i)for(d={},h=0;h<e.attributes.length;h++)d[e.attributes[h].name]=e.attributes[h].value;(c||l)&&(c&&(l&&c.__html==l.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(function(e,t,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in t||qE(e,i,null,n[i],r);for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||qE(e,i,t[i],n[i],r)}(e,f,d,o,s),c)t.__k=[];else if(h=t.props.children,UE(e,Array.isArray(h)?h:[h],t,n,r,o&&"foreignObject"!==p,i,a,i?i[0]:n.__k&&jE(n,0),s),null!=i)for(h=i.length;h--;)null!=i[h]&&IE(i[h]);s||("value"in f&&void 0!==(h=f.value)&&(h!==d.value||h!==e.value||"progress"===p&&!h)&&qE(e,"value",h,d.value,!1),"checked"in f&&void 0!==(h=f.checked)&&h!==e.checked&&qE(e,"checked",h,d.checked,!1))}return e}function QE(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){wE.__e(e,n)}}function eC(e,t,n){var r,o;if(wE.unmount&&wE.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||QE(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){wE.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&eC(r[o],t,"function"!=typeof e.type);n||null==e.__e||IE(e.__e),e.__e=e.__d=void 0}function tC(e,t,n){return this.constructor(e,n)}function nC(e,t,n){var r,o,i;wE.__&&wE.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],XE(t,e=(!r&&n||t).__k=RE(_E,null,[e]),o||BE,BE,void 0!==t.ownerSVGElement,!r&&n?[n]:o?null:t.firstChild?DE.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r),ZE(i,e)}DE=kE.slice,wE={__e:function(e,t){for(var n,r,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},AE=0,SE=function(e){return null!=e&&void 0===e.constructor},ME.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=PE({},this.state),"function"==typeof e&&(e=e(PE({},n),this.props)),e&&PE(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),zE(this))},ME.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),zE(this))},ME.prototype.render=_E,xE=[],OE="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,$E.__r=0,NE=0;var rC,oC,iC,aC,sC,uC,lC,cC,dC,fC,pC,hC=Object.freeze({__proto__:null,Component:ME,Fragment:_E,cloneElement:function(e,t,n){var r,o,i,a=PE({},e.props);for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];return arguments.length>2&&(a.children=arguments.length>3?DE.call(arguments,2):n),LE(e.type,a,r||e.key,o||e.ref,null)},createContext:function(e,t){var n={__c:t="__cC"+NE++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(zE)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},createElement:RE,createRef:function(){return{current:null}},h:RE,hydrate:function e(t,n){nC(t,n,e)},get isValidElement(){return SE},get options(){return wE},render:nC,toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n}}),gC=C(hC);function vC(){if(aC)return iC;aC=1;const e=oC?rC:(oC=1,rC=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE});return iC=function(t,n){return void 0===n&&(n=document),"string"==typeof t?n.querySelector(t):e(t)?t:null}}function mC(){if(cC)return lC;cC=1;const e=vE();return lC=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const t=new e([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}}}function yC(){if(fC)return dC;fC=1;var e=gC;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var n=0;function r(e){return"__private_"+n+++"_"+e}const o=vC(),i=uC?sC:(uC=1,sC=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir}),a=mC();var s=r("updateUI");class u extends a{constructor(){super(...arguments),Object.defineProperty(this,s,{writable:!0,value:void 0})}mount(n,r){const a=r.id,l=o(n);if(l){this.isTargetDOMEl=!0;const r=document.createElement("div");return r.classList.add("uppy-Root"),t(this,s)[s]=function(e){let t=null,n=null;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=o,t||(t=Promise.resolve().then((()=>(t=null,e(...n))))),t}}((t=>{this.uppy.getPlugin(this.id)&&((0,e.render)(this.render(t),r),this.afterUpdate())})),this.uppy.log(`Installing ${a} to a DOM element '${n}'`),this.opts.replaceTargetContent&&(l.innerHTML=""),(0,e.render)(this.render(this.uppy.getState()),r),this.el=r,l.appendChild(r),r.dir=this.opts.direction||i(r)||"ltr",this.onMount(),this.el}let c;if("object"==typeof n&&n instanceof u)c=n;else if("function"==typeof n){const e=n;this.uppy.iteratePlugins((t=>{t instanceof e&&(c=t)}))}if(c)return this.uppy.log(`Installing ${a} to ${c.id}`),this.parent=c,this.el=c.addTarget(r),this.onMount(),this.el;this.uppy.log(`Not installing ${a}`);let d=`Invalid target option given to ${a}.`;throw d+="function"==typeof n?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(d)}update(e){var n,r;null!=this.el&&(null==(n=(r=t(this,s))[s])||n.call(r,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}return dC=u}var bC,EC,CC=(pC||(pC=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Uppy=t.UIPlugin=t.BasePlugin=void 0,Object.defineProperty(t,"debugLogger",{enumerable:!0,get:function(){return n.debugLogger}});var n=Fb();e.exports=CE();const r=yC();t.UIPlugin=r;const o=mC();t.BasePlugin=o;const i=CE();t.Uppy=i;const a=yC(),s=mC();i.Uppy=i,i.UIPlugin=a,i.BasePlugin=s,i.debugLogger=n.debugLogger}(Bb,Bb.exports)),Bb.exports),DC=E(CC);function wC(){if(EC)return bC;EC=1;return bC={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t)=>()=>{let n="",r=t;for(;r--;)n+=e[Math.random()*e.length|0];return n}},bC}var AC,SC,xC,OC,TC,NC,BC,kC,FC,PC,IC={};function RC(){if(SC)return AC;SC=1;class e extends Error{constructor(e,t){void 0===t&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}return AC=e}function LC(){if(PC)return FC;let e;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}PC=1;var n=0;function r(e){return"__private_"+n+++"_"+e}const o=function(){if(OC)return xC;OC=1;const e=RC();return xC=function(){return fetch(...arguments).catch((t=>{throw"AbortError"===t.name?t:new e(t)}))},xC}(),i=function(){if(NC)return TC;NC=1;const e=gE();class t extends Error{constructor(t,n){void 0===n&&(n={}),super(t),this.cause=n.cause,this.cause&&e(this.cause,"isNetworkError")&&(this.isNetworkError=this.cause.isNetworkError)}}return TC=t}(),a=function(){if(kC)return BC;kC=1;class e extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}return BC=e}();async function s(e){if(401===e.status)throw new a;const t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{const e=await t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw new Error(n)}}return t}var u=r("companionHeaders"),l=r("getPostResponseFunc"),c=r("getUrl"),d=r("errorHandler");e=Symbol.for("uppy test: getCompanionHeaders");class f{constructor(e,n){Object.defineProperty(this,d,{value:h}),Object.defineProperty(this,c,{value:p}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=n,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1,t(this,u)[u]=null==n?void 0:n.companionHeaders}setCompanionHeaders(e){t(this,u)[u]=e}[e](){return t(this,u)[u]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}headers(){return Promise.resolve({...f.defaultHeaders,...t(this,u)[u]})}onReceiveResponse(e){const t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:r}=e;return r.has("i-am")&&r.get("i-am")!==t[n]&&this.uppy.setState({companion:{...t,[n]:r.get("i-am")}}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(t(this,c)[c](e),{method:"OPTIONS"}).then((e=>(e.headers.has("access-control-allow-headers")&&(this.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map((e=>e.trim().toLowerCase()))),this.preflightDone=!0,this.allowedHeaders.slice()))).catch((e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,"warning"),this.preflightDone=!0,this.allowedHeaders.slice())))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then((e=>{let[t,n]=e;return Object.keys(n).forEach((e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])})),n}))}get(e,n){return this.preflightAndHeaders(e).then((n=>o(t(this,c)[c](e),{method:"get",headers:n,credentials:this.opts.companionCookiesRule||"same-origin"}))).then(t(this,l)[l](n)).then(s).catch(t(this,d)[d]("get",e))}post(e,n,r){const i="post";return this.preflightAndHeaders(e).then((r=>o(t(this,c)[c](e),{method:i,headers:r,credentials:this.opts.companionCookiesRule||"same-origin",body:JSON.stringify(n)}))).then(t(this,l)[l](r)).then(s).catch(t(this,d)[d](i,e))}delete(e,n,r){const i="delete";return this.preflightAndHeaders(e).then((t=>o(`${this.hostname}/${e}`,{method:i,headers:t,credentials:this.opts.companionCookiesRule||"same-origin",body:n?JSON.stringify(n):null}))).then(t(this,l)[l](r)).then(s).catch(t(this,d)[d](i,e))}}function p(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function h(e,n){return r=>{var o;return null!=(o=r)&&o.isAuthError||(r=new i(`Could not ${e} ${t(this,c)[c](n)}`,{cause:r})),Promise.reject(r)}}return f.VERSION="2.2.2",f.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Uppy-Versions":`@uppy/companion-client=${f.VERSION}`},FC=f}var _C,MC,jC,HC,zC,$C,UC,VC,GC={};function WC(){if(_C)return GC;return _C=1,Object.defineProperty(GC,"__esModule",{value:!0}),GC.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},GC.removeItem=function(e){return new Promise((t=>{localStorage.removeItem(e),t()}))},GC.setItem=function(e,t){return new Promise((n=>{localStorage.setItem(e,t),n()}))},GC}function qC(){if(VC)return IC;VC=1,Object.defineProperty(IC,"__esModule",{value:!0}),IC.Socket=IC.SearchProvider=IC.RequestClient=IC.Provider=void 0;const e=LC();IC.RequestClient=e;const t=function(){if(jC)return MC;jC=1;var e=WC();const t=LC();return MC=class extends t{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then((e=>{let[t,n]=e;const r={};return n&&(r["uppy-auth-token"]=n),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...r}}))}onReceiveResponse(e){e=super.onReceiveResponse(e);const t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authUrl(e){void 0===e&&(e={});const t=new URLSearchParams(e);return this.preAuthToken&&t.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async fetchPreAuthToken(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e){return this.get(`${this.id}/list/${e||""}`)}logout(){return this.get(`${this.id}/logout`).then((e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)]))).then((e=>{let[t]=e;return t}))}static initPlugin(t,n,r){if(t.type="acquirer",t.files=[],r&&(t.opts={...r,...n}),n.serverUrl||n.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(n.companionAllowedHosts){const e=n.companionAllowedHosts;if(!("string"==typeof e||Array.isArray(e)||e instanceof RegExp))throw new TypeError(`${t.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);t.opts.companionAllowedHosts=e}else/^(?!https?:\/\/).*$/i.test(n.companionUrl)?t.opts.companionAllowedHosts=`https://${n.companionUrl.replace(/^\/\//,"")}`:t.opts.companionAllowedHosts=new URL(n.companionUrl).origin;t.storage=t.opts.storage||e}},MC}();IC.Provider=t;const n=function(){if(zC)return HC;zC=1;const e=LC();return HC=class extends e{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}},HC}();IC.SearchProvider=n;const r=function(){if(UC)return $C;let e,t;function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}UC=1;var r=0;function o(e){return"__private_"+r+++"_"+e}const i=mE();var a=o("queued"),s=o("emitter"),u=o("isOpen"),l=o("socket"),c=o("handleMessage");return e=Symbol.for("uppy test: getSocket"),t=Symbol.for("uppy test: getQueued"),$C=class{constructor(e){Object.defineProperty(this,a,{writable:!0,value:[]}),Object.defineProperty(this,s,{writable:!0,value:i()}),Object.defineProperty(this,u,{writable:!0,value:!1}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:e=>{try{const t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,e&&!1===e.autoOpen||this.open()}get isOpen(){return n(this,u)[u]}[e](){return n(this,l)[l]}[t](){return n(this,a)[a]}open(){n(this,l)[l]=new WebSocket(this.opts.target),n(this,l)[l].onopen=()=>{for(n(this,u)[u]=!0;n(this,a)[a].length>0&&n(this,u)[u];){const e=n(this,a)[a].shift();this.send(e.action,e.payload)}},n(this,l)[l].onclose=()=>{n(this,u)[u]=!1},n(this,l)[l].onmessage=n(this,c)[c]}close(){var e;null==(e=n(this,l)[l])||e.close()}send(e,t){n(this,u)[u]?n(this,l)[l].send(JSON.stringify({action:e,payload:t})):n(this,a)[a].push({action:e,payload:t})}on(e,t){n(this,s)[s].on(e,t)}emit(e,t){n(this,s)[s].emit(e,t)}once(e,t){n(this,s)[s].once(e,t)}},$C}();return IC.Socket=r,IC}var KC,YC,XC,ZC,JC,QC,eD,tD,nD,rD,oD,iD,aD,sD,uD,lD,cD,dD={};function fD(){if(KC)return dD;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}KC=1,Object.defineProperty(dD,"__esModule",{value:!0}),dD.internalRateLimitedQueue=dD.RateLimitedQueue=void 0;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("activeRequests"),o=n("queuedHandlers"),i=n("paused"),a=n("pauseTimer"),s=n("downLimit"),u=n("upperLimit"),l=n("rateLimitingTimer"),c=n("call"),d=n("queueNext"),f=n("next"),p=n("queue"),h=n("dequeue"),g=n("resume"),v=n("increaseLimit");function m(t){e(this,r)[r]+=1;let n,o=!1;try{n=t()}catch(t){throw e(this,r)[r]-=1,t}return{abort:()=>{o||(o=!0,e(this,r)[r]-=1,n(),e(this,d)[d]())},done:()=>{o||(o=!0,e(this,r)[r]-=1,e(this,d)[d]())}}}function y(){queueMicrotask((()=>e(this,f)[f]()))}function b(){if(e(this,i)[i]||e(this,r)[r]>=this.limit)return;if(0===e(this,o)[o].length)return;const t=e(this,o)[o].shift(),n=e(this,c)[c](t.fn);t.abort=n.abort,t.done=n.done}function E(t,n){void 0===n&&(n={});const r={fn:t,priority:n.priority||0,abort:()=>{e(this,h)[h](r)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=e(this,o)[o].findIndex((e=>r.priority>e.priority));return-1===i?e(this,o)[o].push(r):e(this,o)[o].splice(i,0,r),r}function C(t){const n=e(this,o)[o].indexOf(t);-1!==n&&e(this,o)[o].splice(n,1)}dD.RateLimitedQueue=class{constructor(t){Object.defineProperty(this,h,{value:C}),Object.defineProperty(this,p,{value:E}),Object.defineProperty(this,f,{value:b}),Object.defineProperty(this,d,{value:y}),Object.defineProperty(this,c,{value:m}),Object.defineProperty(this,r,{writable:!0,value:0}),Object.defineProperty(this,o,{writable:!0,value:[]}),Object.defineProperty(this,i,{writable:!0,value:!1}),Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,s,{writable:!0,value:1}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,g,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,v,{writable:!0,value:()=>{if(e(this,i)[i])e(this,l)[l]=setTimeout(e(this,v)[v],0);else{e(this,s)[s]=this.limit,this.limit=Math.ceil((e(this,u)[u]+e(this,s)[s])/2);for(let t=e(this,s)[s];t<=this.limit;t++)e(this,d)[d]();e(this,u)[u]-e(this,s)[s]>3?e(this,l)[l]=setTimeout(e(this,v)[v],2e3):e(this,s)[s]=Math.floor(e(this,s)[s]/2)}}}),this.limit="number"!=typeof t||0===t?1/0:t}run(t,n){return!e(this,i)[i]&&e(this,r)[r]<this.limit?e(this,c)[c](t):e(this,p)[p](t,n)}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];let a;const s=new Promise(((r,i)=>{a=n.run((()=>{let t,n;try{n=Promise.resolve(e(...o))}catch(e){n=Promise.reject(e)}return n.then((e=>{t?i(t):(a.done(),r(e))}),(e=>{t?i(t):(a.done(),i(e))})),()=>{t=new Error("Cancelled")}}),t)}));return s.abort=()=>{a.abort()},s}}resume(){e(this,i)[i]=!1,clearTimeout(e(this,a)[a]);for(let t=0;t<this.limit;t++)e(this,d)[d]()}pause(t){void 0===t&&(t=null),e(this,i)[i]=!0,clearTimeout(e(this,a)[a]),null!=t&&(e(this,a)[a]=setTimeout(e(this,g)[g],t))}rateLimit(t){clearTimeout(e(this,l)[l]),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(e(this,u)[u]=this.limit-1,this.limit=e(this,s)[s],e(this,l)[l]=setTimeout(e(this,v)[v],t))}get isPaused(){return e(this,i)[i]}};const D=Symbol("__queue");return dD.internalRateLimitedQueue=D,dD}function pD(){return uD?sD:(uD=1,sD={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}})}var hD=function(){if(cD)return lD;cD=1;var e=wC(),t=qC(),n=fD();const r=mC(),o=function(){if(XC)return YC;XC=1;const e=Oy();return YC=e((function(e,t,n){const{progress:r,bytesUploaded:o,bytesTotal:i}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",n,{uploader:e,bytesUploaded:o,bytesTotal:i}))}),300,{leading:!0,trailing:!0})}(),i=JC?ZC:(JC=1,ZC=function(e){const t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return`${/^http:\/\//i.test(e)?"ws":"wss"}://${t}`}),a=eD?QC:(eD=1,QC=function(e){const t=[],n=[];function r(e){t.push(e)}function o(e){n.push(e)}return Promise.all(e.map((e=>e.then(r,o)))).then((()=>({successful:t,failed:n})))}),s=function(){if(nD)return tD;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}nD=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("emitter"),o=n("events");return tD=class{constructor(t){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:[]}),e(this,r)[r]=t}on(t,n){return e(this,o)[o].push([t,n]),e(this,r)[r].on(t,n)}remove(){for(const[t,n]of e(this,o)[o].splice(0))e(this,r)[r].off(t,n)}}}(),u=function(){if(oD)return rD;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}oD=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("aliveTimer"),o=n("isDone"),i=n("onTimedOut"),a=n("timeout");return rD=class{constructor(t,n){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:!1}),Object.defineProperty(this,i,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),e(this,a)[a]=t,e(this,i)[i]=n}progress(){e(this,o)[o]||e(this,a)[a]>0&&(clearTimeout(e(this,r)[r]),e(this,r)[r]=setTimeout(e(this,i)[i],e(this,a)[a]))}done(){e(this,o)[o]||(clearTimeout(e(this,r)[r]),e(this,r)[r]=null,e(this,o)[o]=!0)}}}(),l=RC(),c=aD?iD:(aD=1,iD=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)}),d=pD();function f(e,t){let n=t;return n||(n=new Error("Upload error")),"string"==typeof n&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),c(e)?(n=new l(n,e),n):(n.request=e,n)}function p(e){return e.data.slice(0,e.data.size,e.meta.type)}class h extends r{constructor(e,t){super(e,t),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.title="XHRUpload",this.defaultLocale=d;const r={formData:!0,fieldName:t.bundle?"files[]":"file",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:"",getResponseData(t){let n={};try{n=JSON.parse(t)}catch(t){e.log(t)}return n},getResponseError(e,t){let n=new Error("Upload error");return c(t)&&(n=new l(n,t)),n},validateStatus:e=>e>=200&&e<300};if(this.opts={...r,...t},this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),n.internalRateLimitedQueue in this.opts?this.requests=this.opts[n.internalRateLimitedQueue]:this.requests=new n.RateLimitedQueue(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:n}=this.opts,r={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof n?r.headers=n(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach((n=>{e.append(n,t[n])}))}createFormDataUpload(e,t){const n=new FormData;this.addMetadata(n,e.meta,t);const r=p(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n}createBundledUpload(e,t){const n=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(n,r,t),e.forEach((e=>{const t=this.getOptions(e),r=p(e);e.name?n.append(t.fieldName,r,e.name):n.append(t.fieldName,r)})),n}upload(t,n,r){const o=this.getOptions(t);return this.uppy.log(`uploading ${n} of ${r}`),new Promise(((n,r)=>{this.uppy.emit("upload-started",t);const i=o.formData?this.createFormDataUpload(t,o):t.data,a=new XMLHttpRequest;let l;this.uploaderEvents[t.id]=new s(this.uppy);const c=new u(o.timeout,(()=>{a.abort(),l.done();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(o.timeout/1e3)}));this.uppy.emit("upload-error",t,e),r(e)})),d=(0,e.nanoid)();a.upload.addEventListener("loadstart",(()=>{this.uppy.log(`[XHRUpload] ${d} started`)})),a.upload.addEventListener("progress",(e=>{this.uppy.log(`[XHRUpload] ${d} progress: ${e.loaded} / ${e.total}`),c.progress(),e.lengthComputable&&this.uppy.emit("upload-progress",t,{uploader:this,bytesUploaded:e.loaded,bytesTotal:e.total})})),a.addEventListener("load",(()=>{if(this.uppy.log(`[XHRUpload] ${d} finished`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null),o.validateStatus(a.status,a.responseText,a)){const e=o.getResponseData(a.responseText,a),r=e[o.responseUrlFieldName],i={status:a.status,body:e,uploadURL:r};return this.uppy.emit("upload-success",t,i),r&&this.uppy.log(`Download ${t.name} from ${r}`),n(t)}const e=o.getResponseData(a.responseText,a),i=f(a,o.getResponseError(a.responseText,a)),s={status:a.status,body:e};return this.uppy.emit("upload-error",t,i,s),r(i)})),a.addEventListener("error",(()=>{this.uppy.log(`[XHRUpload] ${d} errored`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null);const e=f(a,o.getResponseError(a.responseText,a));return this.uppy.emit("upload-error",t,e),r(e)})),a.open(o.method.toUpperCase(),o.endpoint,!0),a.withCredentials=o.withCredentials,""!==o.responseType&&(a.responseType=o.responseType),l=this.requests.run((()=>{this.uppy.emit("upload-started",t);const e=this.getOptions(t);return Object.keys(e.headers).forEach((t=>{a.setRequestHeader(t,e.headers[t])})),a.send(i),()=>{c.done(),a.abort()}})),this.onFileRemove(t.id,(()=>{l.abort(),r(new Error("File removed"))})),this.onCancelAll(t.id,(e=>{let{reason:t}=e;"user"===t&&l.abort(),r(new Error("Upload cancelled"))}))}))}uploadRemote(e){const n=this.getOptions(e);return new Promise(((r,a)=>{this.uppy.emit("upload-started",e);const u={};(Array.isArray(n.metaFields)?n.metaFields:Object.keys(e.meta)).forEach((t=>{u[t]=e.meta[t]}));new(e.remote.providerOptions.provider?t.Provider:t.RequestClient)(this.uppy,e.remote.providerOptions).post(e.remote.url,{...e.remote.body,endpoint:n.endpoint,size:e.data.size,fieldname:n.fieldName,metadata:u,httpMethod:n.method,useFormData:n.formData,headers:n.headers}).then((u=>{const{token:l}=u,c=i(e.remote.companionUrl),d=new t.Socket({target:`${c}/api/${l}`,autoOpen:!1});let f;this.uploaderEvents[e.id]=new s(this.uppy),this.onFileRemove(e.id,(()=>{d.send("cancel",{}),f.abort(),r(`upload ${e.id} was removed`)})),this.onCancelAll(e.id,(function(t){let{reason:n}=void 0===t?{}:t;"user"===n&&(d.send("cancel",{}),f.abort()),r(`upload ${e.id} was canceled`)})),this.onRetry(e.id,(()=>{d.send("pause",{}),d.send("resume",{})})),this.onRetryAll(e.id,(()=>{d.send("pause",{}),d.send("resume",{})})),d.on("progress",(t=>o(this,t,e))),d.on("success",(t=>{const o=n.getResponseData(t.response.responseText,t.response),i=o[n.responseUrlFieldName],a={status:t.response.status,body:o,uploadURL:i};return this.uppy.emit("upload-success",e,a),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r()})),d.on("error",(t=>{const r=t.response,o=r?n.getResponseError(r.responseText,r):Object.assign(new Error(t.error.message),{cause:t.error});this.uppy.emit("upload-error",e,o),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),a(o)})),f=this.requests.run((()=>(d.open(),e.isPaused&&d.send("pause",{}),()=>d.close())))})).catch((t=>{this.uppy.emit("upload-error",e,t),a(t)}))}))}uploadBundle(e){return new Promise(((t,n)=>{const{endpoint:r}=this.opts,{method:o}=this.opts,i=this.uppy.getState().xhrUpload,a=this.createBundledUpload(e,{...this.opts,...i||{}}),s=new XMLHttpRequest,l=t=>{e.forEach((e=>{this.uppy.emit("upload-error",e,t)}))},c=new u(this.opts.timeout,(()=>{s.abort();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(this.opts.timeout/1e3)}));l(e),n(e)}));s.upload.addEventListener("loadstart",(()=>{this.uppy.log("[XHRUpload] started uploading bundle"),c.progress()})),s.upload.addEventListener("progress",(t=>{c.progress(),t.lengthComputable&&e.forEach((e=>{this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})}))})),s.addEventListener("load",(r=>{if(c.done(),this.opts.validateStatus(r.target.status,s.responseText,s)){const n=this.opts.getResponseData(s.responseText,s),o={status:r.target.status,body:n};return e.forEach((e=>{this.uppy.emit("upload-success",e,o)})),t()}const o=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return o.request=s,l(o),n(o)})),s.addEventListener("error",(()=>{c.done();const e=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return l(e),n(e)})),this.uppy.on("cancel-all",(function(e){let{reason:t}=void 0===e?{}:e;"user"===t&&(c.done(),s.abort())})),s.open(o.toUpperCase(),r,!0),s.withCredentials=this.opts.withCredentials,""!==this.opts.responseType&&(s.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach((e=>{s.setRequestHeader(e,this.opts.headers[e])})),s.send(a),e.forEach((e=>{this.uppy.emit("upload-started",e)}))}))}uploadFiles(e){const t=e.map(((t,n)=>{const r=parseInt(n,10)+1,o=e.length;return t.error?Promise.reject(new Error(t.error)):t.isRemote?this.uploadRemote(t,r,o):this.upload(t,r,o)}));return a(t)}onFileRemove(e,t){this.uploaderEvents[e].on("file-removed",(n=>{e===n.id&&t(n.id)}))}onRetry(e,t){this.uploaderEvents[e].on("upload-retry",(n=>{e===n&&t()}))}onRetryAll(e,t){this.uploaderEvents[e].on("retry-all",(()=>{this.uppy.getFile(e)&&t()}))}onCancelAll(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",(function(){n.uppy.getFile(e)&&t(...arguments)}))}handleUpload(e){if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts[n.internalRateLimitedQueue]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=e.map((e=>this.uppy.getFile(e)));if(this.opts.bundle){if(t.some((e=>e.isRemote)))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then((()=>null))}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.handleUpload)}}return h.VERSION="2.1.3",lD=h}(),gD=E(hD);function vD(e){var t=e.server,n=void 0===t?"":t,r=e.fieldName,o=void 0===r?"":r,i=e.maxFileSize,a=void 0===i?10485760:i,s=e.maxNumberOfFiles,u=void 0===s?100:s,l=e.meta,c=void 0===l?{}:l,d=e.metaWithUrl,f=void 0!==d&&d,p=e.headers,h=void 0===p?{}:p,g=e.withCredentials,v=void 0!==g&&g,m=e.timeout,y=void 0===m?1e4:m,b=e.onBeforeUpload,E=void 0===b?function(e){return e}:b,C=e.onSuccess,D=void 0===C?function(e,t){}:C,w=e.onError,A=void 0===w?function(e,t,n){console.error("".concat(e.name," upload error"),t,n)}:w,S=e.onProgress,x=void 0===S?function(e){}:S;if(!n)throw new Error("Cannot get upload server address\n没有配置上传地址");if(!o)throw new Error("Cannot get fieldName\n没有配置 fieldName");var O=n;f&&(O=function(e,t){var n=vp(e.split("#"),2),r=n[0],o=n[1],i=[];xp(t,(function(e,t){i.push("".concat(t,"=").concat(e))}));var a=i.join("&");return r=r.indexOf("?")>0?"".concat(r,"&").concat(a):"".concat(r,"?").concat(a),o?"".concat(r,"#").concat(o):r}(O,c));var T=new DC({onBeforeUpload:E,restrictions:{maxFileSize:a,maxNumberOfFiles:u},meta:c}).use(gD,{endpoint:O,headers:h,formData:!0,fieldName:o,bundle:!0,withCredentials:v,timeout:y});return T.on("complete",(function(e){var t=e.successful[0],n=t.response,r=(null!=n?n:{}).body,o=void 0===r?{}:r;try{D(t,o)}catch(e){console.error("wangEditor upload file - onSuccess error",e)}})),T.on("progress",(function(e){e<1||x(e)})),T.on("upload-error",(function(e,t,n){try{A(e,t,n)}catch(e){console.error("wangEditor upload file - onError error",e)}})),T.on("restriction-failed",(function(e,t){try{A(e,t)}catch(e){console.error("wangEditor upload file - onError error",e)}})),T}ty("en",{editor:{more:"More",justify:"Justify",indent:"Indent",image:"Image",video:"Video"}}),ty("zh-CN",{editor:{more:"更多",justify:"对齐",indent:"缩进",image:"图片",video:"视频"}});var mD,yD,bD,ED,CD,DD,wD,AD,SD,xD,OD,TD,ND,BD,kD,FD={};function PD(){if(yD)return mD;yD=1;var e=S();return mD=Array.isArray||function(t){return"Array"===e(t)}}function ID(){if(ED)return bD;ED=1;var e=A(),t=D(),n=ye(),r=kr(),o=$t(),i=xn(),a=function(){},s=o("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=e(u.exec),c=!u.test(a),d=function(e){if(!n(e))return!1;try{return s(a,[],e),!0}catch(e){return!1}},f=function(e){if(!n(e))return!1;switch(r(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(e))}catch(e){return!0}};return f.sham=!0,bD=!s||t((function(){var e;return d(d.call)||!d(Object)||!d((function(){e=!0}))||e}))?f:d}function RD(){if(DD)return CD;DD=1;var e=PD(),t=ID(),n=be(),r=me()("species"),o=Array;return CD=function(i){var a;return e(i)&&(a=i.constructor,(t(a)&&(a===o||e(a.prototype))||n(a)&&null===(a=a[r]))&&(a=void 0)),void 0===a?o:a},CD}function LD(){if(AD)return wD;AD=1;var e=RD();return wD=function(t,n){return new(e(t))(0===n?0:n)}}function _D(){if(TD)return OD;TD=1;var e=D();return OD=function(t,n){var r=[][t];return!!r&&e((function(){r.call(null,n||function(){return 1},1)}))}}function MD(){if(BD)return ND;BD=1;var e=function(){if(xD)return SD;xD=1;var e=$o(),t=A(),n=x(),r=de(),o=Qt(),i=LD(),a=t([].push),s=function(t){var s=1===t,u=2===t,l=3===t,c=4===t,d=6===t,f=7===t,p=5===t||d;return function(h,g,v,m){for(var y,b,E=r(h),C=n(E),D=o(C),w=e(g,v),A=0,S=m||i,x=s?S(h,D):u||f?S(h,0):void 0;D>A;A++)if((p||A in C)&&(b=w(y=C[A],A,E),t))if(s)x[A]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return A;case 2:a(x,y)}else switch(t){case 4:return!1;case 7:a(x,y)}return d?-1:l||c?c:x}};return SD={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)}}().forEach,t=_D()("forEach");return ND=t?[].forEach:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)},ND}!function(){if(kD)return FD;kD=1;var e=B(),t=ai(),n=si(),r=MD(),o=cn(),i=function(e){if(e&&e.forEach!==r)try{o(e,"forEach",r)}catch(t){e.forEach=r}};for(var a in t)t[a]&&i(e[a]&&e[a].prototype);i(n)}();ty("en",{common:{ok:"OK",delete:"Delete",enter:"Enter"},blockQuote:{title:"Quote"},codeBlock:{title:"Code block"},color:{color:"Font color",bgColor:"Back color",default:"Default color",clear:"Clear back color"},divider:{title:"Divider"},emotion:{title:"Emotion"},fontSize:{title:"Font size",default:"Default"},fontFamily:{title:"Font family",default:"Default"},fullScreen:{title:"Full screen",cancelTitle:"Cancel full screen"},header:{title:"Header",text:"Text"},image:{netImage:"Net image",delete:"Delete image",edit:"Edit image",editSize:"Edit size",viewLink:"View link",src:"Image src",desc:"Description",link:"Image link",ok:"Ok",width:"Width",height:"Height"},indent:{decrease:"Decrease",increase:"Increase"},justify:{left:"Left",right:"Right",center:"Center",justify:"Justify"},lineHeight:{title:"Line height",default:"Default"},link:{insert:"Insert link",text:"Link text",url:"Link source",unLink:"Unlink",edit:"Edit link",view:"View link"},textStyle:{bold:"Bold",clear:"Clear styles",code:"Inline code",italic:"Italic",sub:"Sub",sup:"Sup",through:"Through",underline:"Underline"},undo:{undo:"undo",redo:"Redo"},todo:{todo:"Todo"},formatPainter:{title:"Format Painter"}}),ty("zh-CN",{common:{ok:"确定",delete:"删除",enter:"回车"},blockQuote:{title:"引用"},codeBlock:{title:"代码块"},color:{color:"文字颜色",bgColor:"背景色",default:"默认颜色",clear:"清除背景色"},divider:{title:"分割线"},emotion:{title:"表情"},fontSize:{title:"字号",default:"默认字号"},fontFamily:{title:"字体",default:"默认字体"},fullScreen:{title:"全屏",cancelTitle:"取消全屏"},header:{title:"标题",text:"正文"},image:{netImage:"网络图片",delete:"删除图片",edit:"编辑图片",editSize:"修改尺寸",viewLink:"查看链接",src:"图片地址",desc:"图片描述",link:"图片链接",ok:"确定",width:"宽度",height:"高度"},indent:{decrease:"减少缩进",increase:"增加缩进"},justify:{left:"左对齐",right:"右对齐",center:"居中对齐",justify:"两端对齐"},lineHeight:{title:"行高",default:"默认行高"},link:{insert:"插入链接",text:"链接文本",url:"链接地址",unLink:"取消链接",edit:"修改链接",view:"查看链接"},textStyle:{bold:"粗体",clear:"清除格式",code:"行内代码",italic:"斜体",sub:"下标",sup:"上标",through:"删除线",underline:"下划线"},undo:{undo:"撤销",redo:"重做"},todo:{todo:"待办"},formatPainter:{title:"格式刷"}});var jD={type:"blockquote",elemToHtml:function(e,t){return"<blockquote>".concat(t,"</blockquote>")}},HD='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',zD='<svg viewBox="0 0 1024 1024"><path d="M924.402464 1023.068211H0.679665V99.345412h461.861399v98.909208H99.596867v725.896389h725.896389V561.206811h98.909208z" p-id="10909"></path><path d="M930.805104 22.977336l69.965436 69.965436-453.492405 453.492404-69.965435-69.901489z" p-id="10910"></path><path d="M1022.464381 304.030081h-98.917201V99.345412H709.230573V0.428211h313.233808z"></path></svg>',$D='<svg viewBox="0 0 1024 1024"><path d="M133.705143 335.433143V133.851429h201.581714a29.622857 29.622857 0 0 0 29.622857-29.549715V68.754286a29.622857 29.622857 0 0 0-29.622857-29.622857H61.732571A22.893714 22.893714 0 0 0 38.765714 62.025143V335.725714c0 16.310857 13.238857 29.622857 29.622857 29.622857h35.547429a29.842286 29.842286 0 0 0 29.696-29.842285zM690.980571 133.851429h201.581715v201.654857c0 16.310857 13.238857 29.549714 29.622857 29.549714h35.547428a29.622857 29.622857 0 0 0 29.549715-29.549714V61.952a22.893714 22.893714 0 0 0-22.820572-22.893714h-273.554285a29.622857 29.622857 0 0 0-29.549715 29.622857v35.547428c0 16.310857 13.238857 29.696 29.622857 29.696zM335.286857 892.781714H133.705143V691.2a29.622857 29.622857 0 0 0-29.622857-29.622857H68.534857a29.622857 29.622857 0 0 0-29.549714 29.622857v273.554286c0 12.653714 10.24 22.893714 22.820571 22.893714h273.554286a29.622857 29.622857 0 0 0 29.696-29.622857v-35.547429a29.769143 29.769143 0 0 0-29.769143-29.696z m557.348572-201.581714v201.581714H690.907429a29.622857 29.622857 0 0 0-29.622858 29.622857v35.547429c0 16.310857 13.238857 29.622857 29.622858 29.622857h273.554285c12.580571 0 22.893714-10.313143 22.893715-22.893714V691.2a29.622857 29.622857 0 0 0-29.622858-29.622857h-35.547428a29.622857 29.622857 0 0 0-29.696 29.622857z"></path></svg>',UD=function(){function e(){this.title=ry("blockQuote.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M894.6 907.1H605.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C752.7 180.4 711.3 315.8 711.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z m-472 0H133.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C280.7 180.4 239.3 315.8 239.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!!$g.getSelectedNodeByType(e,"blockquote")},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=vp(ap.Editor.nodes(e,{match:function(e){var t=$g.getNodeType(e);return"paragraph"===t||"blockquote"===t},universal:!0,mode:"highest"}),1);return!t[0]},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=this.isActive(e)?"paragraph":"blockquote";ap.Transforms.setNodes(e,{type:n},{mode:"highest"})}},e}(),VD={key:"blockquote",factory:function(){return new UD}};function GD(e){return 0===ph("<div>".concat(e,"</div>")).children().filter((function(e){return"BR"!==e.tagName})).length}function WD(e){return 0===e.length?"":e[0].outerHTML}function qD(e){return e.length?e[0].tagName.toLowerCase():""}function KD(e,t){for(var n="",r=(e.attr("style")||"").split(";"),o=r.length,i=0;i<o;i+=1){var a=r[i];if(a){var s=a.split(":");s[0].trim()===t&&(n=s[1].trim())}}return n}Nh&&(ph.fn.css=Nh),Rh&&(ph.fn.append=Rh),Lh&&(ph.fn.prepend=Lh),hh&&(ph.fn.addClass=hh),gh&&(ph.fn.removeClass=gh),vh&&(ph.fn.hasClass=vh),Dh&&(ph.fn.on=Dh),wh&&(ph.fn.off=wh),Wh&&(ph.fn.focus=Wh),mh&&(ph.fn.attr=mh),yh&&(ph.fn.removeAttr=yh),Oh&&(ph.fn.hide=Oh),Th&&(ph.fn.show=Th),Mh&&(ph.fn.parents=Mh),Eh&&(ph.fn.dataset=Eh),Ch&&(ph.fn.val=Ch),Ph&&(ph.fn.text=Ph),Fh&&(ph.fn.html=Fh),Hh&&(ph.fn.children=Hh),zh&&(ph.fn.remove=zh),jh&&(ph.fn.find=jh),Ah&&(ph.fn.width=Ah),Sh&&(ph.fn.height=Sh),kh&&(ph.fn.filter=kh),$h&&(ph.fn.empty=$h);var YD={selector:"blockquote:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);return 0===(t=t.filter((function(e){return!!ap.Text.isText(e)||!!n.isInline(e)}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"blockquote",children:t}}};function XD(e){e.deleteBackward("character");ap.Transforms.insertNodes(e,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}var ZD={type:"blockquote",renderElem:function(e,t,n){return rb.jsx("blockquote",null,t)}},JD={renderElems:[ZD],elemsToHtml:[jD],parseElemsHtml:[YD],menus:[VD],editorPlugin:function(e){var t=e.insertBreak,n=e.insertText,r=e;return r.insertBreak=function(){var o=r.selection;if(null==o)return t();var i=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"blockquote")},universal:!0}),1),a=i[0];if(!a)return t();var s=a[0];if($g.getParentNode(e,s)){var u=$g.findPath(e,s),l=ap.Editor.end(e,u);if(ap.Point.equals(l,o.focus)){var c=ap.Node.string(s);if(c&&"\n"===c.slice(-1))return void XD(r)}n("\n")}else XD(r)},r}};var QD={type:"code",elemToHtml:function(e,t){return"<code>".concat(t,"</code>")}};var ew={type:"pre",elemToHtml:function(e,t){return"<pre>".concat(t,"</pre>")}},tw=function(){function e(){this.title=ry("codeBlock.title"),this.iconSvg='<svg viewBox="0 0 1280 1024"><path d="M832 736l96 96 320-320L928 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224zM701.312 150.528l69.472 18.944-192 704.032-69.472-18.944 192-704.032z"></path></svg>',this.tag="button"}return e.prototype.getSelectCodeElem=function(e){var t=$g.getSelectedNodeByType(e,"code");if(null==t)return null;var n=$g.getParentNode(e,t);return null==n||"pre"!==$g.getNodeType(n)?null:t},e.prototype.getValue=function(e){var t=this.getSelectCodeElem(e);return null==t?"":t.language||""},e.prototype.isActive=function(e){return!!this.getSelectCodeElem(e)},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=$g.getSelectedElems(e);return!!t.some((function(t){return e.isVoid(t)}))||!t.some((function(e){var t=$g.getNodeType(e);return"pre"===t||"paragraph"===t}))},e.prototype.exec=function(e,t){this.isActive(e)?this.changeToPlainText(e):this.changeToCodeBlock(e,t.toString())},e.prototype.changeToPlainText=function(e){var t=this.getSelectCodeElem(e);if(null!=t){var n=ap.Node.string(t);ap.Transforms.removeNodes(e,{mode:"highest"});var r=n.split("\n").map((function(e){return{type:"paragraph",children:[{text:e}]}}));ap.Transforms.insertNodes(e,r,{mode:"highest"})}},e.prototype.changeToCodeBlock=function(e,t){var n,r,o=[],i=ap.Editor.nodes(e,{match:function(t){return e.children.includes(t)},universal:!0});try{for(var a=gp(i),s=a.next();!s.done;s=a.next()){var u=vp(s.value,1)[0];u&&o.push(ap.Node.string(u))}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}ap.Transforms.removeNodes(e,{mode:"highest"});var l={type:"pre",children:[{type:"code",language:t,children:[{text:o.join("\n")}]}]};ap.Transforms.insertNodes(e,l,{mode:"highest"})},e}();var nw={selector:"pre:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);return 0===(t=t.filter((function(e){return"code"===$g.getNodeType(e)}))).length&&(t=[{type:"code",language:"",children:[{text:r[0].textContent||""}]}]),{type:"pre",children:t.filter((function(e){return"code"===$g.getNodeType(e)}))}}};var rw={type:"pre",renderElem:function(e,t,n){return rb.jsx("pre",null,t)}},ow={type:"code",renderElem:function(e,t,n){return rb.jsx("code",null,t)}},iw={menus:[{key:"codeBlock",factory:function(){return new tw}}],editorPlugin:function(e){var t=e.insertBreak,n=e.normalizeNode,r=e.insertData,o=e.handleTab,i=e;return i.insertBreak=function(){var e=$g.getSelectedNodeByType(i,"code");if(null!=e){var n=function(e,t){var n=t.selection;if(null==n)return"";var r=ap.Node.string(e),o=n.anchor.offset,i=r.slice(0,o).split("\n"),a=i.length;return 0===a?"":i[a-1]}(e,i);if(n){var r=n.match(/^\s+/);if(null!=r&&null!=r[0]){var o=r[0];return void i.insertText("\n".concat(o))}}i.insertText("\n")}else t()},e.handleTab=function(){var t=e.selection;if(t){var n=$g.getSelectedNodeByType(e,"code");if(n&&!ap.Range.isCollapsed(t)){var r=vp([t.anchor,t.focus].sort((function(e,t){return e.offset-t.offset})),2),i=r[0],a=r[1],s=n.children[0].text,u=s.split("\n"),l=s.slice(0,i.offset).split("\n").length-1,c=s.slice(0,a.offset).split("\n").length-1,d=u.map((function(e,t){return t>=l&&t<=c?" ".concat(e):e})),f=d.join("\n"),p={anchor:{path:i.path,offset:i.offset+2},focus:{path:a.path,offset:a.offset+2}};ap.Transforms.insertText(e,f,{at:{anchor:{path:i.path,offset:0},focus:{path:a.path,offset:s.length}}}),ap.Transforms.select(e,p)}else o()}},i.normalizeNode=function(e){var t=vp(e,2),r=t[0],o=t[1],a=$g.getNodeType(r);("code"===a&&o.length<=1&&ap.Transforms.setNodes(i,{type:"paragraph"},{at:o}),"pre"===a)&&($g.isLastNode(i,r)&&ap.Transforms.insertNodes(i,$g.genEmptyParagraph(),{at:[o[0]+1]}),"code"!==$g.getNodeType(r.children[0])&&(ap.Transforms.unwrapNodes(i),ap.Transforms.setNodes(i,{type:"paragraph"},{mode:"highest"})));return n([r,o])},i.insertData=function(e){if(null!=$g.getSelectedNodeByType(i,"code")){var t=e.getData("text/plain");ap.Editor.insertText(i,t)}else r(e)},i},renderElems:[rw,ow],elemsToHtml:[QD,ew],preParseHtml:[{selector:"pre>code",preParseHtml:function(e){var t=ph(e);if("code"!==qD(t))return e;var n=t.find("xmp");if(0===n.length)return e;var r=n.text();return n.remove(),t.text(r),t[0]}}],parseElemsHtml:[{selector:"pre:not([data-w-e-type])>code",parseElemHtml:function(e,t,n){return{type:"code",language:"",children:[{text:ph(e)[0].textContent||""}]}}},nw]},aw=function(){function e(){this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(e,t){},e.prototype.getValue=function(e){var t=this.mark,n=ap.Editor.marks(e);return n&&n[t]?n[t]:""},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=vp(ap.Editor.nodes(e,{match:function(t){return"pre"===$g.getNodeType(t)||!!ap.Editor.isVoid(e,t)},universal:!0}),1);return!!t[0]},e.prototype.getPanelContentElem=function(e){var t=this.mark;if(null==this.$content){var n=ph('<ul class="w-e-panel-content-color"></ul>');n.on("click","li",(function(n){var r=n.target;if(null!=r&&(n.preventDefault(),null!=e.selection)){var o=ph(r).attr("data-value");"0"===o?ap.Editor.removeMark(e,t):ap.Editor.addMark(e,t,o)}})),this.$content=n}var r=this.$content;if(null==r)return document.createElement("ul");r.empty();var o=this.getValue(e),i=e.getMenuConfig(t).colors;(void 0===i?[]:i).forEach((function(e){var t=ph('<div class="color-block" data-value="'.concat(e,'"></div>'));t.css("background-color",e);var n=ph('<li data-value="'.concat(e,'"></li>'));o===e&&n.addClass("active"),n.append(t),r.append(n)}));var a="";"color"===t&&(a=ry("color.default")),"bgColor"===t&&(a=ry("color.clear"));var s=ph('\n <li data-value="0" class="clear">\n '.concat('<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>',"\n ").concat(a,"\n </li>\n "));return r.prepend(s),r[0]},e}(),sw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("color.bgColor"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M510.030769 315.076923l84.676923 196.923077h-177.230769l76.8-196.923077h15.753846zM945.230769 157.538462v708.923076c0 43.323077-35.446154 78.769231-78.769231 78.769231H157.538462c-43.323077 0-78.769231-35.446154-78.769231-78.769231V157.538462c0-43.323077 35.446154-78.769231 78.769231-78.769231h708.923076c43.323077 0 78.769231 35.446154 78.769231 78.769231z m-108.307692 643.938461L600.615385 216.615385c-5.907692-11.815385-15.753846-19.692308-29.538462-19.692308h-139.815385c-11.815385 0-23.630769 7.876923-27.56923 19.692308l-216.615385 584.861538c-3.938462 11.815385 3.938462 25.6 17.723077 25.6h80.738462c11.815385 0 23.630769-9.846154 27.56923-21.661538l63.015385-175.261539h263.876923l68.923077 175.261539c3.938462 11.815385 15.753846 21.661538 27.569231 21.661538h80.738461c13.784615 0 23.630769-13.784615 19.692308-25.6z"></path></svg>',t.mark="bgColor",t}return dp(t,e),t}(aw),uw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("color.color"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 864h896v96H64zM360.58 576h302.85l81.53 224h102.16L579.24 64H444.77L176.89 800h102.16l81.53-224zM512 159.96L628.49 480H395.52L512 159.96z"></path></svg>',t.mark="color",t}return dp(t,e),t}(aw),lw=["rgb(0, 0, 0)","rgb(38, 38, 38)","rgb(89, 89, 89)","rgb(140, 140, 140)","rgb(191, 191, 191)","rgb(217, 217, 217)","rgb(233, 233, 233)","rgb(245, 245, 245)","rgb(250, 250, 250)","rgb(255, 255, 255)","rgb(225, 60, 57)","rgb(231, 95, 51)","rgb(235, 144, 58)","rgb(245, 219, 77)","rgb(114, 192, 64)","rgb(89, 191, 192)","rgb(66, 144, 247)","rgb(54, 88, 226)","rgb(106, 57, 201)","rgb(216, 68, 147)","rgb(251, 233, 230)","rgb(252, 237, 225)","rgb(252, 239, 212)","rgb(252, 251, 207)","rgb(231, 246, 213)","rgb(218, 244, 240)","rgb(217, 237, 250)","rgb(224, 232, 250)","rgb(237, 225, 248)","rgb(246, 226, 234)","rgb(255, 163, 158)","rgb(255, 187, 150)","rgb(255, 213, 145)","rgb(255, 251, 143)","rgb(183, 235, 143)","rgb(135, 232, 222)","rgb(145, 213, 255)","rgb(173, 198, 255)","rgb(211, 173, 247)","rgb(255, 173, 210)","rgb(255, 77, 79)","rgb(255, 122, 69)","rgb(255, 169, 64)","rgb(255, 236, 61)","rgb(115, 209, 61)","rgb(54, 207, 201)","rgb(64, 169, 255)","rgb(89, 126, 247)","rgb(146, 84, 222)","rgb(247, 89, 171)","rgb(207, 19, 34)","rgb(212, 56, 13)","rgb(212, 107, 8)","rgb(212, 177, 6)","rgb(56, 158, 13)","rgb(8, 151, 156)","rgb(9, 109, 217)","rgb(29, 57, 196)","rgb(83, 29, 171)","rgb(196, 29, 127)","rgb(130, 0, 20)","rgb(135, 20, 0)","rgb(135, 56, 0)","rgb(97, 71, 0)","rgb(19, 82, 0)","rgb(0, 71, 79)","rgb(0, 58, 140)","rgb(6, 17, 120)","rgb(34, 7, 94)","rgb(120, 6, 80)"];var cw={selector:"font",preParseHtml:function(e){var t=ph(e);if("font"!==qD(t))return e;var n=t.attr("color")||"";return n&&(t.removeAttr("color"),t.css("color",n)),t[0]}};function dw(e,t){null==e.data&&(e.data={});var n=e.data;null==n.style&&(n.style={}),Object.assign(n.style,t)}var fw={renderStyle:function(e,t){var n=e,r=n.color,o=n.bgColor,i=t;return r&&dw(i,{color:r}),o&&dw(i,{backgroundColor:o}),i},styleToHtml:function(e,t){if(!ap.Text.isText(e))return t;var n,r=e,o=r.color,i=r.bgColor;return o||i?((GD(t)||"span"!==qD(n=ph(t)))&&(n=ph("<span>".concat(t,"</span>"))),o&&n.css("color",o),i&&n.css("background-color",i),WD(n)):t},preParseHtml:[cw],parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Text.isText(t))return t;var o=t,i=KD(r,"color");i&&(o.color=i);var a=KD(r,"background-color");return a||(a=KD(r,"background")),a&&(o.bgColor=a),o},menus:[{key:"color",factory:function(){return new uw},config:{colors:lw}},{key:"bgColor",factory:function(){return new sw},config:{colors:lw}}]},pw=function(){function e(){this.title=ry("common.enter"),this.iconSvg='<svg viewBox="0 0 1255 1024"><path d="M1095.111111 731.477333h-625.777778V1024L0 658.318222 469.333333 292.408889v292.636444h625.777778V0h156.444445v731.477333z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||!!ap.Range.isExpanded(t)},e.prototype.exec=function(e,t){var n=e.selection;if(null!=n){var r=[n.anchor.path[0]];ap.Transforms.insertNodes(e,{type:"paragraph",children:[{text:""}]},{at:r}),e.select(ap.Editor.start(e,r))}},e}(),hw={menus:[{key:"enter",factory:function(){return new pw}}]};var gw={type:"divider",elemToHtml:function(e,t){return"<hr/>"}},vw=function(){function e(){this.title=ry("divider.title"),this.iconSvg='<svg viewBox="0 0 1092 1024"><path d="M0 51.2m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M819.2 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M409.6 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 870.4m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!!$g.getSelectedElems(e).some((function(t){if(e.isVoid(t))return!0;var n=$g.getNodeType(t);return"table"===n||"pre"===n}))},e.prototype.exec=function(e,t){$g.isSelectedEmptyParagraph(e)&&ap.Transforms.removeNodes(e,{mode:"highest"}),ap.Transforms.insertNodes(e,{type:"divider",children:[{text:""}]},{mode:"highest"})},e}();var mw={renderElems:[{type:"divider",renderElem:function(e,t,n){var r=$g.isNodeSelected(n,e);return rb.h("div",{props:{contentEditable:!1,className:"w-e-textarea-divider"},dataset:{selected:r?"true":""},style:{},on:{mousedown:function(e){return e.preventDefault()}}},[rb.h("hr")])}}],elemsToHtml:[gw],parseElemsHtml:[{selector:"hr:not([data-w-e-type])",parseElemHtml:function(e,t,n){return{type:"divider",children:[{text:""}]}}}],menus:[{key:"divider",factory:function(){return new vw}}],editorPlugin:function(e){var t=e.isVoid,n=e.normalizeNode,r=e;return r.isVoid=function(e){return"divider"===e.type||t(e)},r.normalizeNode=function(e){var t=vp(e,2),o=t[0],i=t[1];if("divider"!==$g.getNodeType(o))return n([o,i]);$g.isLastNode(r,o)&&ap.Transforms.insertNodes(r,$g.genEmptyParagraph(),{at:[i[0]+1]})},r}};var yw=function(){function e(){this.title=ry("emotion.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m0-102.4c226.742857 0 409.6-182.857143 409.6-409.6S738.742857 102.4 512 102.4 102.4 285.257143 102.4 512s182.857143 409.6 409.6 409.6z m-204.8-358.4h409.6c0 113.371429-91.428571 204.8-204.8 204.8s-204.8-91.428571-204.8-204.8z m0-102.4c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8 76.8 32.914286 76.8 76.8-32.914286 76.8-76.8 76.8z m409.6 0c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8c43.885714 0 76.8 32.914286 76.8 76.8s-32.914286 76.8-76.8 76.8z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(e,t){},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=vp(ap.Editor.nodes(e,{match:function(t){return"pre"===$g.getNodeType(t)||!!ap.Editor.isVoid(e,t)},universal:!0}),1);return!!t[0]},e.prototype.getPanelContentElem=function(e){if(null==this.$content){var t=ph('<ul class="w-e-panel-content-emotion"></ul>');t.on("click","li",(function(t){var n=t.target;if(null!=n){t.preventDefault();var r=ph(n).text();e.insertText(r)}})),this.$content=t}var n=this.$content;if(null==n)return document.createElement("ul");n.empty();var r=e.getMenuConfig("emotion").emotions;return(void 0===r?[]:r).forEach((function(e){var t=ph("<li>".concat(e,"</li>"));n.append(t)})),n[0]},e}(),bw={menus:[{key:"emotion",factory:function(){return new yw},config:{emotions:"😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 😘 😗 😙 😚 😋 😛 😝 😜 🤓 😎 😏 😒 😞 😔 😟 😕 🙁 😣 😖 😫 😩 😢 😭 😤 😠 😡 😳 😱 😨 🤗 🤔 😶 😑 😬 🙄 😯 😴 😷 🤑 😈 🤡 💩 👻 💀 👀 👣 👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏".split(" ")}}]};var Ew=function(){function e(){this.tag="select",this.width=80}return e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.mark,n=ap.Editor.marks(e);return n&&n[t]?n[t]:""},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=vp(ap.Editor.nodes(e,{match:function(t){return"pre"===$g.getNodeType(t)||!!ap.Editor.isVoid(e,t)},universal:!0}),1);return!!t[0]},e.prototype.exec=function(e,t){var n=this.mark;t?e.addMark(n,t):e.removeMark(n)},e}(),Cw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("fontFamily.title"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M956.788364 152.110545h-24.110546l23.924364 9.029819 0.186182 121.018181h-65.070546l-86.574545-130.048H566.551273v650.14691l130.048 64.977454v65.163636h-390.050909v-65.163636l129.954909-64.977454V152.110545H198.283636L111.429818 282.065455H46.545455V69.259636C46.545455 33.792 82.664727 22.062545 98.955636 22.062545h812.683637c23.738182 0 45.056 15.173818 45.056 41.053091V169.425455v-17.221819z"></path></svg>',t.mark="fontFamily",t.selectPanelWidth=150,t}return dp(t,e),t.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig(this.mark).fontFamilyList,r=void 0===n?[]:n;t.push({text:ry("fontFamily.default"),value:""}),r.forEach((function(e){if("string"==typeof e)t.push({text:e,value:e,styleForRenderMenuList:{"font-family":e}});else if("object"==typeof e){var n=e.name,r=e.value;t.push({text:n,value:r,styleForRenderMenuList:{"font-family":r}})}}));var o=this.getValue(e),i=!1;return t.forEach((function(e){e.value===o?(i=!0,e.selected=!0):e.selected=void 0})),i||"string"!=typeof o||t.push({text:o,value:o,selected:!0}),t},t}(Ew),Dw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("fontSize.title"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 512h384v128h-128V1024h-128V640h-128z m896-256H708.2496v768h-136.4992V256H320V128h640z"></path></svg>',t.mark="fontSize",t}return dp(t,e),t.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig(this.mark).fontSizeList,r=void 0===n?[]:n;t.push({text:ry("fontSize.default"),value:""}),r.forEach((function(e){if("string"==typeof e)t.push({text:e,value:e});else if("object"==typeof e){var n=e.name,r=e.value;t.push({text:n,value:r})}}));var o=this.getValue(e),i=!1;return t.forEach((function(e){e.value===o?(i=!0,e.selected=!0):e.selected=void 0})),i||"string"!=typeof o||t.push({text:o,value:o,selected:!0}),t},t}(Ew);var ww={1:"12px",2:"14px",3:"16px",4:"19px",5:"24px",6:"32px",7:"48px"};var Aw={renderStyle:function(e,t){var n=e,r=n.fontSize,o=n.fontFamily,i=t;return r&&dw(i,{fontSize:r}),o&&dw(i,{fontFamily:o}),i},styleToHtml:function(e,t){if(!ap.Text.isText(e))return t;var n,r=e,o=r.fontSize,i=r.fontFamily;return o||i?((GD(t)||"span"!==qD(n=ph(t)))&&(n=ph("<span>".concat(t,"</span>"))),o&&n.css("font-size",o),i&&n.css("font-family",i),WD(n)):t},preParseHtml:[{selector:"font",preParseHtml:function(e){var t=ph(e);if("font"!==qD(t))return e;var n=t.attr("size")||"";n&&(t.removeAttr("size"),t.css("font-size",ww[n]));var r=t.attr("face")||"";return r&&(t.removeAttr("face"),t.css("font-family",r)),t[0]}}],parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Text.isText(t))return t;var o=t,i=KD(r,"font-size");i&&(o.fontSize=i);var a=KD(r,"font-family").replace(/"/g,"");return a&&(o.fontFamily=a),o},menus:[{key:"fontSize",factory:function(){return new Dw},config:{fontSizeList:["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"]}},{key:"fontFamily",factory:function(){return new Cw},config:{fontFamilyList:["黑体",{name:"仿宋",value:"仿宋"},"楷体","标楷体","华文仿宋","华文楷体",{name:"宋体",value:"宋体"},"微软雅黑","Arial","Tahoma","Verdana","Times New Roman","Courier New"]}}]};var Sw=function(){function e(){this.title=ry("formatPainter.title"),this.iconSvg='<svg viewBox="0 0 24 24"><path d="M8 19.997v-5h2v5h9v-7H5v7zm-4-9h16v-3h-6v-4h-4v4H4zm-1 10v-8H2v-6a1 1 0 0 1 1-1h5v-3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v3h5a1 1 0 0 1 1 1v6h-1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1"/></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(t){return e.attrs.isSelect},e.prototype.isDisabled=function(e){return!1},e.prototype.setFormatHtml=function(t){var n,r;if(t.getSelectionText().length){if(e.attrs.formatStyle){!function(e){var t=ap.Editor.marks(e);t&&Object.keys(t).forEach((function(t){e.removeMark(t)}))}(t);try{for(var o=gp(Object.entries(e.attrs.formatStyle)),i=o.next();!i.done;i=o.next()){var a=vp(i.value,2),s=a[0],u=a[1];t.addMark(s,u)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}e.attrs.formatStyle=null,e.attrs.isSelect=!1}},e.prototype.exec=function(t){e.attrs.isSelect?(e.attrs.isSelect=!1,e.attrs.formatStyle=null):t.getSelectionText().length&&(e.attrs.formatStyle=ap.Editor.marks(t),e.attrs.isSelect=!0);t.blur(),t.focus()},e.attrs={isSelect:!1,formatStyle:null},e}();var xw={menus:[{key:"formatPainter",factory:function(){return new Sw}}],editorPlugin:function(e){var t=new Sw,n=e.onChange,r=e,o=function(){t.setFormatHtml(r),document.removeEventListener("mouseup",o)};return r.onChange=function(){n(),Sw.attrs.isSelect&&(document.removeEventListener("mouseup",o),document.addEventListener("mouseup",o))},r}},Ow=function(){function e(){this.title=ry("fullScreen.title"),this.iconSvg=$D,this.tag="button",this.alwaysEnable=!0}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return e.isFullScreen},e.prototype.isDisabled=function(e){return!1},e.prototype.getIcon=function(e){return e.isFullScreen?$D:'<svg t="1723361745825" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8705" width="200" height="200"><path d="M703.926857 362.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V128a42.642286 42.642286 0 1 1 85.357715 0v149.357714h149.357714c21.211429 0 38.765714 15.433143 42.057143 35.693715l0.585143 6.948571a42.642286 42.642286 0 0 1-42.642286 42.642286H703.926857zM703.926857 938.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V704c0-23.552 19.090286-42.642286 42.642286-42.642286h192.073143a42.642286 42.642286 0 1 1 0 85.284572l-149.357714 0.073143v149.284571c0 21.211429-15.506286 38.765714-35.84 42.130286l-6.875429 0.512zM319.853714 938.642286a42.642286 42.642286 0 0 1-42.642285-42.642286v-149.284571H127.853714a42.642286 42.642286 0 0 1-42.130285-35.84l-0.585143-6.875429c0-23.552 19.163429-42.642286 42.715428-42.642286h192c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286zM127.853714 362.642286a42.642286 42.642286 0 1 1 0-85.284572H277.211429V128c0-21.211429 15.433143-38.765714 35.766857-42.130286l6.875428-0.512c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286H127.853714z" fill="#333333" p-id="8706"></path></svg>'},e.prototype.getTitle=function(e){return e.isFullScreen?ry("fullScreen.title"):ry("fullScreen.cancelTitle")},e.prototype.exec=function(e,t){e.isFullScreen?e.unFullScreen():e.fullScreen()},e}(),Tw={menus:[{key:"fullScreen",factory:function(){return new Ow}}]};function Nw(e){return function(t,n){return"<h".concat(e,">").concat(n,"</h").concat(e,">")}}var Bw={type:"header1",elemToHtml:Nw(1)},kw={type:"header2",elemToHtml:Nw(2)},Fw={type:"header3",elemToHtml:Nw(3)},Pw={type:"header4",elemToHtml:Nw(4)},Iw={type:"header5",elemToHtml:Nw(5)},Rw={type:"header6",elemToHtml:Nw(6)};function Lw(e){var t=vp(ap.Editor.nodes(e,{match:function(e){return $g.getNodeType(e).startsWith("header")},universal:!0}),1),n=t[0];if(null==n)return"paragraph";var r=vp(n,1)[0];return $g.getNodeType(r)}function _w(e){if(null==e.selection)return!0;var t=vp(ap.Editor.nodes(e,{match:function(e){var t=$g.getNodeType(e);return"paragraph"===t||!!t.startsWith("header")},universal:!0,mode:"highest"}),1);return!t[0]}function Mw(e,t){t&&ap.Transforms.setNodes(e,{type:t})}var jw=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return Lw(e)},e.prototype.isActive=function(e){return this.getValue(e)===this.type},e.prototype.isDisabled=function(e){return _w(e)},e.prototype.exec=function(e,t){var n=this.type;Mw(e,t===n?"paragraph":n)},e}(),Hw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H1",t.type="header1",t}return dp(t,e),t}(jw),zw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H2",t.type="header2",t}return dp(t,e),t}(jw),$w=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H3",t.type="header3",t}return dp(t,e),t}(jw),Uw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H4",t.type="header4",t}return dp(t,e),t}(jw),Vw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H5",t.type="header5",t}return dp(t,e),t}(jw),Gw=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="H6",t.type="header6",t}return dp(t,e),t}(jw),Ww=function(){function e(){this.title=ry("header.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M960 960c-51.2 0-102.4-3.2-153.6-3.2-51.2 0-99.2 3.2-150.4 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 57.6-28.8 86.4-48 19.2-12.8 19.2-60.8 19.2-80v-224-19.2c-9.6-3.2-19.2-3.2-28.8-3.2H320c-9.6 0-19.2 0-28.8 3.2V780.8c0 22.4 0 80 22.4 92.8 28.8 19.2 96-6.4 96 44.8 0 16-9.6 41.6-28.8 41.6-54.4 0-105.6-3.2-160-3.2-48 0-96 3.2-147.2 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 51.2-28.8 80-48 19.2-12.8 19.2-60.8 19.2-83.2V294.4c0-28.8 3.2-115.2-22.4-131.2-25.6-16-86.4 9.6-86.4-41.6 0-16 6.4-41.6 28.8-41.6 51.2 0 105.6 3.2 156.8 3.2 48 0 96-3.2 144-3.2 19.2 0 28.8 22.4 28.8 41.6 0 48-57.6 25.6-83.2 41.6-19.2 12.8-19.2 73.6-19.2 92.8v201.6c6.4 3.2 16 3.2 22.4 3.2h400c6.4 0 12.8 0 22.4-3.2V256c0-22.4 0-80-19.2-92.8-28.8-16-86.4 6.4-86.4-41.6 0-16 9.6-41.6 28.8-41.6 51.2 0 99.2 3.2 150.4 3.2 48 0 99.2-3.2 147.2-3.2 19.2 0 28.8 22.4 28.8 41.6 0 51.2-57.6 25.6-86.4 41.6-19.2 12.8-19.2 70.4-19.2 92.8v537.6c0 19.2 0 67.2 19.2 80 28.8 19.2 89.6-6.4 89.6 44.8 0 19.2-6.4 41.6-28.8 41.6z"></path></svg>',this.tag="select",this.width=60}return e.prototype.getOptions=function(e){var t=[{value:"header1",text:"H1",styleForRenderMenuList:{"font-size":"32px","font-weight":"bold"}},{value:"header2",text:"H2",styleForRenderMenuList:{"font-size":"24px","font-weight":"bold"}},{value:"header3",text:"H3",styleForRenderMenuList:{"font-size":"18px","font-weight":"bold"}},{value:"header4",text:"H4",styleForRenderMenuList:{"font-size":"16px","font-weight":"bold"}},{value:"header5",text:"H5",styleForRenderMenuList:{"font-size":"13px","font-weight":"bold"}},{value:"header6",text:"H6",styleForRenderMenuList:{"font-size":"11px","font-weight":"bold"}},{value:"paragraph",text:ry("header.text")}],n=this.getValue(e).toString();return t.forEach((function(e){e.value===n?e.selected=!0:e.selected=void 0})),t},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){return Lw(e)},e.prototype.isDisabled=function(e){return _w(e)},e.prototype.exec=function(e,t){Mw(e,t.toString())},e}(),qw={key:"headerSelect",factory:function(){return new Ww}},Kw={key:"header1",factory:function(){return new Hw}},Yw={key:"header2",factory:function(){return new zw}},Xw={key:"header3",factory:function(){return new $w}},Zw={key:"header4",factory:function(){return new Uw}},Jw={key:"header5",factory:function(){return new Vw}},Qw={key:"header6",factory:function(){return new Gw}};function eA(e){return function(t,n,r){var o=ph(t);return 0===(n=n.filter((function(e){return!!ap.Text.isText(e)||!!r.isInline(e)}))).length&&(n=[{text:o.text().replace(/\s+/gm," ")}]),{type:"header".concat(e),children:n}}}var tA={selector:"h1:not([data-w-e-type])",parseElemHtml:eA(1)},nA={selector:"h2:not([data-w-e-type])",parseElemHtml:eA(2)},rA={selector:"h3:not([data-w-e-type])",parseElemHtml:eA(3)},oA={selector:"h4:not([data-w-e-type])",parseElemHtml:eA(4)},iA={selector:"h5:not([data-w-e-type])",parseElemHtml:eA(5)},aA={selector:"h6:not([data-w-e-type])",parseElemHtml:eA(6)};function sA(e){return function(t,n,r){var o="h".concat(e);return rb.jsx(o,null,n)}}var uA={renderElems:[{type:"header1",renderElem:sA(1)},{type:"header2",renderElem:sA(2)},{type:"header3",renderElem:sA(3)},{type:"header4",renderElem:sA(4)},{type:"header5",renderElem:sA(5)},{type:"header6",renderElem:sA(6)}],elemsToHtml:[Bw,kw,Fw,Pw,Iw,Rw],parseElemsHtml:[tA,nA,rA,oA,iA,aA],menus:[qw,Kw,Yw,Xw,Zw,Jw,Qw],editorPlugin:function(e){var t=e.insertBreak,n=e;return n.insertBreak=function(){var r=vp(ap.Editor.nodes(n,{match:function(e){return $g.getNodeType(e).startsWith("header")},universal:!0}),1),o=r[0];if(o)if($g.isSelectionAtLineEnd(e,o[1])){ap.Transforms.insertNodes(n,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}else t();else t()},n}};var lA={type:"image",elemToHtml:function(e,t){var n=e,r=n.src,o=n.alt,i=void 0===o?"":o,a=n.href,s=void 0===a?"":a,u=n.width,l=void 0===u?"":u,c=n.height,d=void 0===c?"":c,f=n.style,p=void 0===f?{}:f,h=p.width,g=void 0===h?"":h,v=p.height,m=void 0===v?"":v,y="";return g&&(y+="width: ".concat(g,";")),m&&(y+="height: ".concat(m,";")),'<img src="'.concat(r,'" alt="').concat(i,'" data-href="').concat(s,'" width="').concat(l,'" height="').concat(d,'" style="').concat(y,'"/>')}};var cA=function(){function e(){this.title=ry("image.delete"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==$g.getSelectedNodeByType(e,"image")},e.prototype.exec=function(e,t){this.isDisabled(e)||ap.Transforms.removeNodes(e,{match:function(e){return $g.checkNodeType(e,"image")}})},e}();function dA(e){return void 0===e&&(e="r"),"".concat(e,"-").concat(Kh())}function fA(e){return e.replace(/</g,"<").replace(/>/g,">")}function pA(e){var t=e.selection;if(null==t)return!0;if(!ap.Range.isCollapsed(t))return!0;var n=vp(ap.Editor.nodes(e,{match:function(t){var n=$g.getNodeType(t);return"code"===n||("pre"===n||("link"===n||("list-item"===n||(!!n.startsWith("header")||("blockquote"===n||!!ap.Editor.isVoid(e,t))))))},universal:!0}),1);return!!n[0]}function hA(e,t,n){return pp(this,arguments,void 0,(function(e,t,n,r,o){var i,a;return void 0===r&&(r=""),void 0===o&&(o=""),hp(this,(function(s){switch(s.label){case 0:return(i=t.getMenuConfig(e).checkImage)?[4,i(n,r,o)]:[3,2];case 1:if("string"==typeof(a=s.sent()))return t.alert(a,"error"),[2,!1];if(null==a)return[2,!1];s.label=2;case 2:return[2,!0]}}))}))}function gA(e,t,n){return pp(this,void 0,void 0,(function(){var r;return hp(this,(function(o){switch(o.label){case 0:return(r=t.getMenuConfig(e).parseImageSrc)?[4,r(n)]:[3,2];case 1:return[2,o.sent()];case 2:return[2,n]}}))}))}function vA(e,t){return pp(this,arguments,void 0,(function(e,t,n,r){var o,i,a;return void 0===n&&(n=""),void 0===r&&(r=""),hp(this,(function(s){switch(s.label){case 0:return[4,hA("insertImage",e,t,n,r)];case 1:return s.sent()?[4,gA("insertImage",e,t)]:[2];case 2:return o=s.sent(),i={type:"image",src:fA(o),href:r,alt:n,style:{},children:[{text:""}]},null===e.selection&&e.restoreSelection(),$g.getSelectedNodeByType(e,"image")&&e.move(1),pA(e)?[2]:(ap.Transforms.insertNodes(e,i),(a=e.getMenuConfig("insertImage").onInsertedImage)&&a(i),[2])}}))}))}function mA(){return dA("w-e-edit-image")}var yA=function(){function e(){this.title=ry("image.edit"),this.iconSvg=HD,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=mA(),this.altInputId=mA(),this.hrefInputId=mA(),this.buttonId=mA()}return e.prototype.getValue=function(e){return""},e.prototype.getImageNode=function(e){return $g.getSelectedNodeByType(e,"image")},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"image"))},e.prototype.getModalPositionNode=function(e){return this.getImageNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.altInputId,i=n.hrefInputId,a=n.buttonId,s=this.getImageNode(e);if(null==s)throw new Error("Not found selected image node");var u=vp(hy(ry("image.src"),r),2),l=u[0],c=ph(u[1]),d=vp(hy(ry("image.desc"),o),2),f=d[0],p=ph(d[1]),h=vp(hy(ry("image.link"),i),2),g=h[0],v=ph(h[1]),m=vp(gy(a,ry("common.ok")),1)[0];if(null==this.$content){var y=ph("<div></div>");y.on("click","#".concat(a),(function(n){n.preventDefault();var a=y.find("#".concat(r)).val(),s=y.find("#".concat(o)).val(),u=y.find("#".concat(i)).val();t.updateImage(e,a,s,u),e.hidePanelOrModal()})),this.$content=y}var b=this.$content;b.empty(),b.append(l),b.append(f),b.append(g),b.append(m);var E=s,C=E.src,D=E.alt,w=void 0===D?"":D,A=E.href,S=void 0===A?"":A;return c.val(C),p.val(w),v.val(S),setTimeout((function(){c.focus()})),b[0]},e.prototype.updateImage=function(e,t,n,r,o){void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={}),t&&(e.restoreSelection(),this.isDisabled(e)||function(e,t){pp(this,arguments,void 0,(function(e,t,n,r,o){var i,a,s,u,l,c;return void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={}),hp(this,(function(d){switch(d.label){case 0:return[4,hA("editImage",e,t,n,r)];case 1:return d.sent()?[4,gA("editImage",e,t)]:[2];case 2:return i=d.sent(),null==(a=$g.getSelectedNodeByType(e,"image"))||(s=a.style,u={src:i,alt:n,href:r,style:fp(fp({},void 0===s?{}:s),o)},ap.Transforms.setNodes(e,u,{match:function(e){return $g.checkNodeType(e,"image")}}),l=$g.getSelectedNodeByType(e,"image"),(c=e.getMenuConfig("editImage").onUpdatedImage)&&c(l)),[2]}}))}))}(e,t,n,r,o))},e}();function bA(){return dA("w-e-insert-image")}var EA=function(){function e(){this.title=ry("image.editSize"),this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=bA(),this.heightInputId=bA(),this.buttonId=bA()}return e.prototype.getSelectedImageNode=function(e){return $g.getSelectedNodeByType(e,"image")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedImageNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedImageNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=t.widthInputId,r=t.heightInputId,o=t.buttonId,i=vp(hy(ry("image.width"),n,"auto"),2),a=i[0],s=ph(i[1]),u=vp(hy(ry("image.height"),r,"auto"),2),l=u[0],c=ph(u[1]),d=vp(gy(o,ry("image.ok")),1)[0],f=this.getSelectedImageNode(e);if(null==this.$content){var p=ph("<div></div>");p.on("click","#".concat(o),(function(t){t.preventDefault();var o=p.find("#".concat(n)).val().trim(),i=p.find("#".concat(r)).val().trim(),a=function(e){return/^\d+(\.\d+)?%$/.test(e)},s=function(e){return/^\d+(\.\d+)?$/.test(e)},u=function(e){return/^\d+(\.\d+)?px$/.test(e)},l="auto",c="auto";a(o)?l=o:s(o)?l="".concat(parseInt(o,10),"px"):u(o)&&(l=o),a(i)?c=i:s(i)?c="".concat(parseInt(i,10),"px"):u(i)&&(c=i);var d=f.style,h=void 0===d?{}:d;e.restoreSelection();var g=fp(fp({},h),{style:{width:l,height:c}});ap.Transforms.setNodes(e,g,{match:function(e){return $g.checkNodeType(e,"image")}}),e.hidePanelOrModal()})),this.$content=p}var h=this.$content;if(h.empty(),h.append(a),h.append(l),h.append(d),null==f)return h[0];var g=f.style,v=void 0===g?{}:g,m=v.width,y=void 0===m?"auto":m,b=v.height,E=void 0===b?"auto":b;return s.val(y),c.val(E),setTimeout((function(){s.focus()})),h[0]},e}();function CA(){return dA("w-e-insert-image")}var DA=function(){function e(){this.title=ry("image.netImage"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=CA(),this.altInputId=CA(),this.hrefInputId=CA(),this.buttonId=CA()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return pA(e)},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.altInputId,i=n.hrefInputId,a=n.buttonId,s=vp(hy(ry("image.src"),r),2),u=s[0],l=ph(s[1]),c=vp(hy(ry("image.desc"),o),2),d=c[0],f=ph(c[1]),p=vp(hy(ry("image.link"),i),2),h=p[0],g=ph(p[1]),v=vp(gy(a,ry("common.ok")),1)[0];if(null==this.$content){var m=ph("<div></div>");m.on("click","#".concat(a),(function(n){n.preventDefault();var a=m.find("#".concat(r)).val().trim(),s=m.find("#".concat(o)).val().trim(),u=m.find("#".concat(i)).val().trim();t.insertImage(e,a,s,u),e.hidePanelOrModal()})),this.$content=m}var y=this.$content;return y.empty(),y.append(u),y.append(d),y.append(h),y.append(v),l.val(""),f.val(""),g.val(""),setTimeout((function(){l.focus()})),y[0]},e.prototype.insertImage=function(e,t,n,r){void 0===n&&(n=""),void 0===r&&(r=""),t&&(e.restoreSelection(),this.isDisabled(e)||vA(e,t,n,r))},e}(),wA=function(){function e(){this.title=ry("image.viewLink"),this.iconSvg=zD,this.tag="button"}return e.prototype.getValue=function(e){var t=$g.getSelectedNodeByType(e,"image");return t&&t.href||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!this.getValue(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("View image link failed, image.href is '".concat(t,"'"));window.open(t,"_blank")}},e}(),AA=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.getSelectedNode=function(e){return $g.getSelectedNodeByType(e,"image")},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedNode(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=this.getSelectedNode(e);if(null!=n){var r=$g.getHoverbar(e);r&&r.hideAndClean();var o=n.style,i={style:fp(fp({},void 0===o?{}:o),{width:this.value,height:""})};ap.Transforms.setNodes(e,i,{match:function(e){return $g.checkNodeType(e,"image")}})}}},e}(),SA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="30%",t.value="30%",t}return dp(t,e),t}(AA),xA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="50%",t.value="50%",t}return dp(t,e),t}(AA),OA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title="100%",t.value="100%",t}return dp(t,e),t}(AA),TA={onInsertedImage:function(e){},onUpdatedImage:function(e){},checkImage:function(e,t,n){return!0},parseImageSrc:function(e){return e}};function NA(e,t){var n=$g.findKey(e,t).id;return"w-e-image-container-".concat(n)}function BA(e,t,n,r){var o=ph("body"),i=NA(e,t),a=r.width,s=r.height,u=0,l=0,c=0,d=0,f=!1,p=null;var h=Ty((function(e){e.preventDefault();var t=e.clientX,n=l+(f?u-t:t-u),r=c*(n/l);n>d-6||null!=p&&(n<=15||r<=15||(p.css("width","".concat(n,"px")),p.css("height","".concat(r,"px"))))}),100);function g(n){if(o.off("mousemove",h),null!=p){var r=p.width().toFixed(2),i=p.height().toFixed(2),a={style:fp(fp({},t.style),{width:"".concat(r,"px"),height:"".concat(i,"px")})};ap.Transforms.setNodes(e,a,{at:$g.findPath(e,t)}),o.off("mouseup",g)}}function v(t,n){p=function(){var e=ph("#".concat(i));if(0===e.length)throw new Error("Cannot find image container elem");return e}(),u=t,d=n;var r=p.find("img");if(0===r.length)throw new Error("Cannot find image elem");l=r.width(),c=r.height(),o.on("mousemove",h),o.on("mouseup",g);var a=$g.getHoverbar(e);a&&a.hideAndClean()}var m={};return a&&(m.width=a),s&&(m.height=s),m.boxShadow="0 0 0 1px #B4D5FF",rb.jsx("div",{id:i,style:m,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(n){var r=ph(n.target);if(r.hasClass("w-e-image-dragger")){n.preventDefault(),(r.hasClass("left-top")||r.hasClass("left-bottom"))&&(f=!0);var o=$g.getParentNode(e,t);if(null!=o){var i=$g.toDOMNode(e,o),a=i.getBoundingClientRect?i.getBoundingClientRect():{width:0},s=window.getComputedStyle(i),u=parseFloat(s.paddingLeft),l=parseFloat(s.paddingRight),c=parseFloat(s.borderLeftWidth),d=parseFloat(s.borderRightWidth);v(n.clientX,a.width-u-l-c-d)}}}}},n,rb.jsx("div",{className:"w-e-image-dragger left-top"}),rb.jsx("div",{className:"w-e-image-dragger right-top"}),rb.jsx("div",{className:"w-e-image-dragger left-bottom"}),rb.jsx("div",{className:"w-e-image-dragger right-bottom"}))}var kA={type:"image",renderElem:function(e,t,n){var r=e,o=r.src,i=r.alt,a=void 0===i?"":i,s=r.href,u=void 0===s?"":s,l=r.style,c=void 0===l?{}:l,d=c.width,f=void 0===d?"":d,p=c.height,h=void 0===p?"":p,g=$g.isNodeSelected(n,e),v={maxWidth:"100%"};f&&(v.width="100%"),h&&(v.height="100%");var m=rb.jsx("img",{style:v,src:o,alt:a,"data-href":u}),y=n.isDisabled();return g&&!y?BA(n,e,m,{width:f,height:h}):function(e,t,n,r){var o=r.width,i=r.height,a={};o&&(a.width=o),i&&(a.height=i);var s=NA(e,t);return rb.jsx("div",{id:s,style:a,className:"w-e-image-container"},n)}(n,e,m,{width:f,height:h})}},FA={renderElems:[kA],elemsToHtml:[lA],parseElemsHtml:[{selector:"img:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e),o=r.attr("data-href")||"";return o=decodeURIComponent(o),{type:"image",src:r.attr("src")||"",alt:r.attr("alt")||"",href:o,style:{width:KD(r,"width"),height:KD(r,"height")},width:r.attr("width")||"",height:r.attr("height")||"",children:[{text:""}]}}}],menus:[{key:"insertImage",factory:function(){return new DA},config:TA},{key:"deleteImage",factory:function(){return new cA}},{key:"editImage",factory:function(){return new yA},config:TA},{key:"viewImageLink",factory:function(){return new wA}},{key:"imageWidth30",factory:function(){return new SA}},{key:"imageWidth50",factory:function(){return new xA}},{key:"imageWidth100",factory:function(){return new OA}},{key:"editorImageSizeMenu",factory:function(){return new EA}}],editorPlugin:function(e){var t=e.isInline,n=e.isVoid,r=e;return r.isInline=function(e){return"image"===e.type||t(e)},r.isVoid=function(e){return"image"===e.type||n(e)},r}},PA=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){var t=vp(ap.Editor.nodes(e,{match:function(e){return!!e.indent},universal:!0}),1),n=t[0];return null==n?"":vp(n,1)[0].indent||""},e.prototype.isActive=function(e){return!1},e.prototype.getMatchNode=function(e){var t=vp(ap.Editor.nodes(e,{match:function(e){var t=$g.getNodeType(e);return"paragraph"===t||!!t.startsWith("header")},universal:!0,mode:"highest"}),1),n=t[0];return null==n?null:n[0]},e}(),IA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("indent.decrease"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m256-512v384l-256-192z"></path></svg>',t}return dp(t,e),t.prototype.isDisabled=function(e){var t=this.getMatchNode(e);return null==t||!t.indent},t.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{indent:null},{match:function(e){return ap.Element.isElement(e)}})},t}(PA),RA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("indent.increase"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',t.DEFAULT_INDENT_VALUE="2em",t}return dp(t,e),t.prototype.isDisabled=function(e){var t=this.getMatchNode(e);return null==t||!!t.indent},t.prototype.getIndentValue=function(e){var t=this.getMatchNode(e);if(!t)return this.DEFAULT_INDENT_VALUE;var n=t.children.filter(ap.Text.isText)[0];if(!n||!n.fontSize)return this.DEFAULT_INDENT_VALUE;var r=n.fontSize,o=parseInt(n.fontSize,10),i=r.replace("".concat(o),"");return"".concat(2*o).concat(i)},t.prototype.exec=function(e,t){var n=this.getIndentValue(e);ap.Transforms.setNodes(e,{indent:n},{match:function(e){return ap.Element.isElement(e)},mode:"highest"})},t}(PA);var LA={renderStyle:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.indent,r=t;return n&&dw(r,{textIndent:n}),r},styleToHtml:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.indent;if(!n)return t;var r=ph(t);return r.css("text-indent",n),WD(r)},preParseHtml:[{selector:"p,h1,h2,h3,h4,h5",preParseHtml:function(e){var t=ph(e),n=KD(t,"padding-left");return/\dem/.test(n)&&t.css("text-indent","2em"),/\dpx/.test(n)&&parseInt(n,10)%32==0&&t.css("text-indent","2em"),t[0]}}],parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Element.isElement(t))return t;var o=t,i=KD(r,"text-indent"),a=parseInt(i,10);return i&&a>0&&(o.indent=i),o},menus:[{key:"indent",factory:function(){return new RA}},{key:"delIndent",factory:function(){return new IA}}]},_A=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!!$g.getSelectedElems(e).some((function(t){var n=t.type;return!(!ap.Editor.isVoid(e,t)||!ap.Editor.isBlock(e,t)||"video"===n)||!!["pre","code"].includes(n)}))},e}(),MA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("justify.center"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return dp(t,e),t.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{textAlign:"center"},{match:function(t){return ap.Element.isElement(t)&&!e.isInline(t)}})},t}(_A),jA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("justify.justify"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>',t}return dp(t,e),t.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{textAlign:"justify"},{match:function(t){return ap.Element.isElement(t)&&!e.isInline(t)}})},t}(_A),HA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("justify.left"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return dp(t,e),t.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{textAlign:"left"},{match:function(t){return ap.Element.isElement(t)&&!e.isInline(t)}})},t}(_A),zA=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("justify.right"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return dp(t,e),t.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{textAlign:"right"},{match:function(t){return ap.Element.isElement(t)&&!e.isInline(t)}})},t}(_A);var $A={renderStyle:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.textAlign,r=t;return n&&dw(r,{textAlign:n}),r},styleToHtml:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.textAlign;if(!n)return t;var r=ph(t);return r.css("text-align",n),WD(r)},parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Element.isElement(t))return t;var o=t,i=KD(r,"text-align");return i&&(o.textAlign=i),o},menus:[{key:"justifyLeft",factory:function(){return new HA}},{key:"justifyRight",factory:function(){return new zA}},{key:"justifyCenter",factory:function(){return new MA}},{key:"justifyJustify",factory:function(){return new jA}}]};var UA=function(){function e(){this.title=ry("lineHeight.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M964 788a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526zM198.93 144.306c6.668-5.798 16.774-5.094 22.573 1.574l122.26 140.582a16 16 0 0 1 3.927 10.5c0 8.836-7.164 16-16 16h-61.8a8 8 0 0 0-8 8v390.077h69.819a16 16 0 0 1 10.502 3.928c6.666 5.8 7.37 15.906 1.57 22.573L221.476 878.123a16 16 0 0 1-1.57 1.57c-6.668 5.8-16.774 5.097-22.574-1.57L75.051 737.538a16 16 0 0 1-3.928-10.5c0-8.837 7.163-16 16-16h69.822V312.96H87.127a16 16 0 0 1-10.502-3.928c-6.666-5.8-7.37-15.906-1.57-22.573l122.303-140.582a16 16 0 0 1 1.572-1.572zM964 465a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z m0-323a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z"></path></svg>',this.tag="select",this.width=80}return e.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig("lineHeight").lineHeightList,r=void 0===n?[]:n;t.push({text:ry("lineHeight.default"),value:""}),r.forEach((function(e){t.push({text:e,value:e})}));var o=this.getValue(e);return t.forEach((function(e){e.value===o?e.selected=!0:e.selected=void 0})),t},e.prototype.getMatchNode=function(e){var t=vp(ap.Editor.nodes(e,{match:function(e){var t=$g.getNodeType(e);return!!t.startsWith("header")||!!["paragraph","blockquote","list-item"].includes(t)},universal:!0,mode:"highest"}),1),n=t[0];return null==n?null:n[0]},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.getMatchNode(e);return null==t?"":ap.Element.isElement(t)&&t.lineHeight||""},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getMatchNode(e)},e.prototype.exec=function(e,t){ap.Transforms.setNodes(e,{lineHeight:t.toString()},{mode:"highest"})},e}();var VA={renderStyle:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.lineHeight,r=t;return n&&dw(r,{lineHeight:n}),r},styleToHtml:function(e,t){if(!ap.Element.isElement(e))return t;var n=e.lineHeight;if(!n)return t;var r=ph(t);return r.css("line-height",n),WD(r)},parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Element.isElement(t))return t;var o=t,i=n.getMenuConfig("lineHeight").lineHeightList,a=void 0===i?[]:i,s=KD(r,"line-height");return s&&a.includes(s)&&(o.lineHeight=s),o},menus:[{key:"lineHeight",factory:function(){return new UA},config:{lineHeightList:["1","1.15","1.5","2","2.5","3"]}}]};var GA={type:"link",elemToHtml:function(e,t){var n=e,r=n.url,o=n.target,i=void 0===o?"_blank":o;return'<a href="'.concat(r,'" target="').concat(i,'">').concat(t,"</a>")}};function WA(e,t,n,r){return pp(this,void 0,void 0,(function(){var o,i;return hp(this,(function(a){switch(a.label){case 0:return(o=t.getMenuConfig(e).checkLink)?[4,o(n,r)]:[3,2];case 1:if("string"==typeof(i=a.sent()))return t.alert(i,"error"),[2,!1];if(null==i)return[2,!1];a.label=2;case 2:return[2,!0]}}))}))}function qA(e,t,n){return pp(this,void 0,void 0,(function(){var r;return hp(this,(function(o){switch(o.label){case 0:return(r=t.getMenuConfig(e).parseLinkUrl)?[4,r(n)]:[3,2];case 1:return[2,o.sent()];case 2:return[2,n]}}))}))}function KA(e){return null==e.selection||!!$g.getSelectedElems(e).some((function(t){var n=t.type;return!!e.isVoid(t)||!!["pre","code","link"].includes(n)}))}function YA(e,t){return{type:"link",url:fA(e),children:t?[{text:t}]:[]}}function XA(e,t,n){return pp(this,void 0,void 0,(function(){var r,o,i,a,s;return hp(this,(function(u){switch(u.label){case 0:return n?(t||(t=n),e.restoreSelection(),KA(e)?[2]:[4,WA("insertLink",e,t,n)]):[2];case 1:return u.sent()?[4,qA("insertLink",e,n)]:[2];case 2:if(r=u.sent(),null==(o=e.selection))return[2];if(ap.Range.isCollapsed(o)){if((a=$g.getLeftLengthOfMaxLength(e))<=0)return[2];e.insertText(" "),a<t.length+1&&(t=t.slice(0,a-1)),s=YA(r,t),ap.Transforms.insertNodes(e,s),e.insertFragment([{text:" "}])}else if((i=ap.Editor.string(e,o))!==t){if((a=$g.getLeftLengthOfMaxLength(e))<=0)return[2];a<i.length-t.length&&(t=t.slice(0,a)),e.deleteFragment(),s=YA(r,t),ap.Transforms.insertNodes(e,s)}else s=YA(r),ap.Transforms.wrapNodes(e,s,{split:!0}),ap.Transforms.collapse(e,{edge:"end"});return[2]}}))}))}function ZA(){return dA("w-e-update-link")}var JA=function(){function e(){this.title=ry("link.edit"),this.iconSvg=HD,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.urlInputId=ZA(),this.buttonId=ZA()}return e.prototype.getSelectedLinkElem=function(e){var t=$g.getSelectedNodeByType(e,"link");return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectedLinkElem(e);return t&&t.url||""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedLinkElem(e)},e.prototype.getModalPositionNode=function(e){return $g.getSelectedNodeByType(e,"link")},e.prototype.getModalContentElem=function(e){var t=this.urlInputId,n=this.buttonId,r=vp(hy(ry("link.url"),t),2),o=r[0],i=ph(r[1]),a=vp(gy(n,ry("common.ok")),1)[0];if(null==this.$content){var s=ph("<div></div>");s.on("click","#".concat(n),(function(n){n.preventDefault(),e.restoreSelection();var r=$g.getSelectedNodeByType(e,"link"),o=r?ap.Node.string(r):"",i=s.find("#".concat(t)).val();!function(e,t,n){pp(this,void 0,void 0,(function(){var r,o;return hp(this,(function(i){switch(i.label){case 0:return n?[4,WA("editLink",e,t,n)]:[2];case 1:return i.sent()?[4,qA("editLink",e,n)]:[2];case 2:return r=i.sent(),o={url:fA(r)},ap.Transforms.setNodes(e,o,{match:function(e){return $g.checkNodeType(e,"link")}}),[2]}}))}))}(e,o,i),e.hidePanelOrModal()})),this.$content=s}var u=this.$content;u.empty(),u.append(o),u.append(a);var l=this.getValue(e);return i.val(l),setTimeout((function(){i.focus()})),u[0]},e}();function QA(){return dA("w-e-insert-link")}var eS=function(){function e(){this.title=ry("link.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M440.224 635.776a51.84 51.84 0 0 1-36.768-15.232c-95.136-95.136-95.136-249.92 0-345.056l192-192C641.536 37.408 702.816 12.032 768 12.032s126.432 25.376 172.544 71.456c95.136 95.136 95.136 249.92 0 345.056l-87.776 87.776a51.968 51.968 0 1 1-73.536-73.536l87.776-87.776a140.16 140.16 0 0 0 0-197.984c-26.432-26.432-61.6-40.992-99.008-40.992s-72.544 14.56-99.008 40.992l-192 192a140.16 140.16 0 0 0 0 197.984 51.968 51.968 0 0 1-36.768 88.768z"></path><path d="M256 1012a242.4 242.4 0 0 1-172.544-71.456c-95.136-95.136-95.136-249.92 0-345.056l87.776-87.776a51.968 51.968 0 1 1 73.536 73.536l-87.776 87.776a140.16 140.16 0 0 0 0 197.984c26.432 26.432 61.6 40.992 99.008 40.992s72.544-14.56 99.008-40.992l192-192a140.16 140.16 0 0 0 0-197.984 51.968 51.968 0 1 1 73.536-73.536c95.136 95.136 95.136 249.92 0 345.056l-192 192A242.4 242.4 0 0 1 256 1012z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=QA(),this.urlInputId=QA(),this.buttonId=QA()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return KA(e)},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=e.selection,n=this,r=n.textInputId,o=n.urlInputId,i=n.buttonId,a=vp(hy(ry("link.text"),r),2),s=a[0],u=ph(a[1]),l=vp(hy(ry("link.url"),o),2),c=l[0],d=ph(l[1]),f=vp(gy(i,ry("common.ok")),1)[0];if(null==this.$content){var p=ph("<div></div>");p.on("click","#".concat(i),(function(t){t.preventDefault();var n=p.find("#".concat(r)).val(),i=p.find("#".concat(o)).val();XA(e,n,i),e.hidePanelOrModal()})),this.$content=p}var h=this.$content;if(h.empty(),h.append(s),h.append(c),h.append(f),null==t||ap.Range.isCollapsed(t))u.val("");else{var g=ap.Editor.string(e,t);u.val(g)}return d.val(""),setTimeout((function(){u.focus()})),h[0]},e}(),tS=function(){function e(){this.title=ry("link.unLink"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M608.16328 811.815036c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.347563 89.347564c-118.525421 118.523421-311.38448 118.531421-429.919901 0-118.527421-118.529421-118.527421-311.39048 0-429.917901l89.349564-89.349563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.195613 79.195613c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.349563 89.347564c-56.143726 56.145726-56.143726 147.49928 0 203.645005 56.143726 56.143726 147.49928 56.145726 203.647005 0l89.347564-89.347563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.193613 79.195613z m-113.135447-520.429459c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.347564-89.347564c56.143726-56.149726 147.49928-56.145726 203.647006 0 56.143726 56.145726 56.143726 147.49928 0 203.645006l-89.349564 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.195613 79.195613c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.349564-89.349563c118.529421-118.529421 118.529421-311.38848 0-429.917901-118.531421-118.527421-311.38848-118.527421-429.919901 0l-89.347563 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.193613 79.195613z m469.653707 718.556492l45.253779-45.253779c18.745908-18.745908 18.745908-49.13776 0-67.881669L127.195629 14.062931c-18.745908-18.745908-49.13776-18.745908-67.881669 0L14.058181 59.31871c-18.745908 18.745908-18.745908 49.13776 0 67.881669l882.74169 882.74169c18.745908 18.743908 49.13776 18.743908 67.881669 0z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==$g.getSelectedNodeByType(e,"link")},e.prototype.exec=function(e,t){this.isDisabled(e)||ap.Transforms.unwrapNodes(e,{match:function(e){return $g.checkNodeType(e,"link")}})},e}(),nS=function(){function e(){this.title=ry("link.view"),this.iconSvg=zD,this.tag="button"}return e.prototype.getSelectedLinkElem=function(e){var t=$g.getSelectedNodeByType(e,"link");return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectedLinkElem(e);return t&&t.url||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedLinkElem(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("View link failed, link url is '".concat(t,"'"));window.open(t,"_blank")}},e}(),rS={checkLink:function(e,t){return!0},parseLinkUrl:function(e){return e}},oS={key:"insertLink",factory:function(){return new eS},config:rS},iS={key:"editLink",factory:function(){return new JA},config:rS},aS={key:"unLink",factory:function(){return new tS}},sS={key:"viewLink",factory:function(){return new nS}};var uS,lS,cS={selector:"a:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);return 0===(t=t.filter((function(e){return!!ap.Text.isText(e)||!!n.isInline(e)}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"link",url:r.attr("href")||"",target:r.attr("target")||"",children:t}}};var dS=E(function(){if(lS)return uS;lS=1,uS=function(r){if("string"!=typeof r)return!1;var o=r.match(e);if(!o)return!1;var i=o[1];if(!i)return!1;if(t.test(i)||n.test(i))return!0;return!1};var e=/^(?:\w+:)?\/\/(\S+)$/,t=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;return uS}());var fS={type:"link",renderElem:function(e,t,n){var r=e,o=r.url,i=r.target,a=void 0===i?"_blank":i;return rb.jsx("a",{href:o,target:a},t)}},pS={renderElems:[fS],elemsToHtml:[GA],parseElemsHtml:[cS],menus:[oS,iS,aS,sS],editorPlugin:function(e){var t=e.isInline,n=e.insertData,r=e.normalizeNode,o=e;return o.isInline=function(e){return"link"===e.type||t(e)},o.insertData=function(e){var t=e.getData("text/plain");if(dS(t)){if(/<img[^>]+>/.test(e.getData("text/html")))n(e);else if(!KA(o)){var r=o.selection;if(null!=r){var i=ap.Editor.string(o,r);XA(o,i,t)}}}else n(e)},o.normalizeNode=function(e){var t=vp(e,2),n=t[0],i=t[1];return"link"!==$g.getNodeType(n)?r([n,i]):""===ap.Node.string(n)?ap.Transforms.removeNodes(o,{at:i}):r([n,i])},o}};var hS={selector:"p:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);return 0===(t=t.filter((function(e){return!!ap.Text.isText(e)||!!n.isInline(e)}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"paragraph",children:t}}};function gS(e){var t=vp(ap.Editor.nodes(e,{match:function(t){return e.children[0]===t},mode:"highest"}),1),n=t[0];if(null==n)return!1;var r=n[0];if(!ap.Element.isElement(r))return!1;if("paragraph"===r.type)return!1;if(""!==ap.Node.string(r))return!1;var o=r.children,i=void 0===o?[]:o;return!!ap.Text.isText(i[0])&&(ap.Transforms.setNodes(e,{type:"paragraph"}),!0)}var vS={type:"paragraph",renderElem:function(e,t,n){return rb.jsx("p",null,t)}},mS={renderElems:[vS],elemsToHtml:[{type:"paragraph",elemToHtml:function(e,t){return""===t?"<p><br></p>":"<p>".concat(t,"</p>")}}],parseElemsHtml:[hS],editorPlugin:function(e){var t=e.deleteBackward,n=e.deleteForward,r=e;return r.deleteBackward=function(e){gS(r)||t(e)},r.deleteForward=function(e){gS(r)||n(e)},r}};function yS(e,t){if(null==e.selection)return!0;var n=vp(ap.Editor.nodes(e,{match:function(t){return"pre"===$g.getNodeType(t)||!!ap.Editor.isVoid(e,t)},universal:!0}),1);return!!n[0]}function bS(e,t){Object.keys(t).forEach((function(t){"text"!==t&&ap.Editor.removeMark(e,t)}))}var ES=function(){function e(){this.marksNeedToRemove=[],this.tag="button"}return e.prototype.getValue=function(e){var t=this.mark,n=ap.Editor.marks(e);if(n)return n[t];var r=vp(ap.Editor.nodes(e,{match:function(e){return!0===e[t]}}),1);return!!r[0]},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){return yS(e,this.mark)},e.prototype.exec=function(e,t){var n=this.mark,r=this.marksNeedToRemove;t?e.removeMark(n):(e.addMark(n,!0),r&&r.forEach((function(t){return e.removeMark(t)})))},e}(),CS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="bold",t.title=ry("textStyle.bold"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M707.872 484.64A254.88 254.88 0 0 0 768 320c0-141.152-114.848-256-256-256H192v896h384c141.152 0 256-114.848 256-256a256.096 256.096 0 0 0-124.128-219.36zM384 192h101.504c55.968 0 101.504 57.408 101.504 128s-45.536 128-101.504 128H384V192z m159.008 640H384v-256h159.008c58.464 0 106.016 57.408 106.016 128s-47.552 128-106.016 128z"></path></svg>',t.hotkey="mod+b",t}return dp(t,e),t}(ES),DS=function(){function e(){this.title=ry("textStyle.clear"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M969.382408 288.738615l-319.401123-270.852152a67.074236 67.074236 0 0 0-96.459139 5.74922l-505.931379 574.922021a68.35184 68.35184 0 0 0-17.886463 47.910169 74.101061 74.101061 0 0 0 24.274486 47.910168l156.50655 132.232065h373.060512L975.131628 383.281347a67.074236 67.074236 0 0 0-5.74922-96.459139z m-440.134747 433.746725H264.144729l-90.071117-78.572676c-5.74922-5.74922-12.137243-12.137243-12.137243-17.886463a36.411728 36.411728 0 0 1 5.749221-24.274485l210.804741-240.828447 265.102932 228.691204z m-439.495945 180.781036h843.218964a60.047411 60.047411 0 1 1 0 120.733624H89.751716a60.047411 60.047411 0 1 1 0-120.733624z m0 0"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return yS(e)},e.prototype.exec=function(e,t){var n,r,o=ap.Editor.nodes(e,{match:function(e){return ap.Text.isText(e)},universal:!0});try{for(var i=gp(o),a=i.next();!a.done;a=i.next()){bS(e,a.value[0])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e}(),wS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="code",t.title=ry("textStyle.code"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M576 736l96 96 320-320L672 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224z"></path></svg>',t.hotkey="mod+e",t}return dp(t,e),t}(ES),AS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="italic",t.title=ry("textStyle.italic"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M896 64v64h-128L448 896h128v64H128v-64h128L576 128h-128V64z"></path></svg>',t.hotkey="mod+i",t}return dp(t,e),t}(ES),SS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="sub",t.marksNeedToRemove=["sup"],t.title=ry("textStyle.sub"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 910.016v50.016h128v64h-192v-146.016l128-60V768h-128v-64h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',t.hotkey="",t}return dp(t,e),t}(ES),xS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="sup",t.marksNeedToRemove=["sub"],t.title=ry("textStyle.sup"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 206.016v50.016h128v64h-192V174.016l128-60V64h-128V0h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',t.hotkey="",t}return dp(t,e),t}(ES),OS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="through",t.title=ry("textStyle.through"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M1024 512v64h-234.496c27.52 38.496 42.496 82.688 42.496 128 0 70.88-36.672 139.04-100.576 186.976C672.064 935.488 594.144 960 512 960s-160.064-24.512-219.424-69.024C228.64 843.04 192 774.88 192 704h128c0 69.376 87.936 128 192 128s192-58.624 192-128-87.936-128-192-128H0v-64h299.52a385.984 385.984 0 0 1-6.944-5.024C228.64 459.04 192 390.88 192 320s36.672-139.04 100.576-186.976C351.936 88.512 429.856 64 512 64s160.064 24.512 219.424 69.024C795.328 180.96 832 249.12 832 320h-128c0-69.376-87.936-128-192-128s-192 58.624-192 128 87.936 128 192 128c78.976 0 154.048 22.688 212.48 64H1024z"></path></svg>',t.hotkey="mod+shift+x",t}return dp(t,e),t}(ES),TS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.mark="underline",t.title=ry("textStyle.underline"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M704 64l128 0 0 416c0 159.072-143.264 288-320 288s-320-128.928-320-288l0-416 128 0 0 416c0 40.16 18.24 78.688 51.36 108.512 36.896 33.216 86.848 51.488 140.64 51.488s103.744-18.304 140.64-51.488c33.12-29.792 51.36-68.352 51.36-108.512l0-416zM192 832l640 0 0 128-640 0z"></path></svg>',t.hotkey="mod+u",t}return dp(t,e),t}(ES);function NS(e,t){return 0!==e.length&&(!!e[0].matches(t)||e.find(t).length>0)}function BS(e,t){var n=t,r=e,o=r.bold,i=r.italic,a=r.underline,s=r.code,u=r.through,l=r.sub,c=r.sup;return o&&(n="<strong>".concat(n,"</strong>")),s&&(n="<code>".concat(n,"</code>")),i&&(n="<em>".concat(n,"</em>")),a&&(n="<u>".concat(n,"</u>")),u&&(n="<s>".concat(n,"</s>")),l&&(n="<sub>".concat(n,"</sub>")),c&&(n="<sup>".concat(n,"</sup>")),n}var kS={renderStyle:function(e,t){var n=e,r=n.bold,o=n.italic,i=n.underline,a=n.code,s=n.through,u=n.sub,l=n.sup,c=t;return r&&(c=rb.jsx("strong",null,c)),a&&(c=rb.jsx("code",null,c)),o&&(c=rb.jsx("em",null,c)),i&&(c=rb.jsx("u",null,c)),s&&(c=rb.jsx("s",null,c)),u&&(c=rb.jsx("sub",null,c)),l&&(c=rb.jsx("sup",null,c)),c},menus:[{key:"bold",factory:function(){return new CS}},{key:"underline",factory:function(){return new TS}},{key:"italic",factory:function(){return new AS}},{key:"through",factory:function(){return new OS}},{key:"code",factory:function(){return new wS}},{key:"sub",factory:function(){return new SS}},{key:"sup",factory:function(){return new xS}},{key:"clearStyle",factory:function(){return new DS}}],styleToHtml:function(e,t){if(!ap.Text.isText(e))return t;if(GD(t))return BS(e,t);var n=ph(t),r=n.html();return r=BS(e,r),n.html(r),WD(n)},parseStyleHtml:function(e,t,n){var r=ph(e);if(!ap.Text.isText(t))return t;var o=t;return NS(r,"b,strong")&&(o.bold=!0),NS(r,"i,em")&&(o.italic=!0),NS(r,"u")&&(o.underline=!0),NS(r,"s,strike")&&(o.through=!0),NS(r,"sub")&&(o.sub=!0),NS(r,"sup")&&(o.sup=!0),NS(r,"code")&&(o.code=!0),o}};var FS={type:"todo",elemToHtml:function(e,t){var n=e.checked;return'<div data-w-e-type="todo"><input type="checkbox" disabled '.concat(n?"checked":"",">").concat(t,"</div>")}},PS=function(){function e(){this.title=ry("todo.todo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M278.755556 403.911111l-79.644445 79.644445L455.111111 739.555556l568.888889-568.888889-79.644444-79.644445L455.111111 580.266667l-176.355555-176.355556zM910.222222 910.222222H113.777778V113.777778h568.888889V0H113.777778C51.2 0 0 51.2 0 113.777778v796.444444c0 62.577778 51.2 113.777778 113.777778 113.777778h796.444444c62.577778 0 113.777778-51.2 113.777778-113.777778V455.111111h-113.777778v455.111111z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!!$g.getSelectedNodeByType(e,"todo")},e.prototype.isDisabled=function(e){return null==e.selection||!!$g.getSelectedElems(e).some((function(t){if(ap.Editor.isVoid(e,t)&&ap.Editor.isBlock(e,t))return!0;var n=t.type;return!!["pre","table","list-item"].includes(n)}))},e.prototype.exec=function(e,t){var n=this.isActive(e);ap.Transforms.setNodes(e,{type:n?"paragraph":"todo"})},e}();var IS={selector:'div[data-w-e-type="todo"]',parseElemHtml:function(e,t,n){var r=ph(e);0===(t=t.filter((function(e){return!!ap.Text.isText(e)||!!n.isInline(e)}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]);var o=!1;return null!=r.find('input[type="checkbox"]').attr("checked")&&(o=!0),{type:"todo",checked:o,children:t}}};var RS={type:"todo",renderElem:function(e,t,n){var r=!1;n.isDisabled()&&(r=!0);var o=e.checked,i=rb.jsx("div",{style:{margin:"5px 0"}},rb.jsx("span",{contentEditable:!1,style:{marginRight:"0.5em"}},rb.jsx("input",{type:"checkbox",checked:o,disabled:r,on:{change:function(t){var r=$g.findPath(n,e),o={checked:t.target.checked};ap.Transforms.setNodes(n,o,{at:r})}}})),rb.jsx("span",null,t));return i}},LS={renderElems:[RS],elemsToHtml:[FS],preParseHtml:[{selector:"ul.w-e-todo",preParseHtml:function(e){var t=ph(e).find("li"),n=ph('<div data-w-e-type="todo"></div>'),r=t.find("input[type]");return n.append(r),t.children()[0].remove(),n[0].innerHTML+=t[0].innerHTML,n[0]}}],parseElemsHtml:[IS],menus:[{key:"todo",factory:function(){return new PS}}],editorPlugin:function(e){var t=e.deleteBackward,n=e;return n.deleteBackward=function(n){var r=e.selection;if(r&&ap.Range.isCollapsed(r)){var o=$g.getSelectedNodeByType(e,"todo");if(o&&0===ap.Node.string(o).length)return void ap.Transforms.setNodes(e,{type:"paragraph"},{mode:"highest"})}t(n)},n}},_S=function(){function e(){this.title=ry("undo.redo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0.00032 576a510.72 510.72 0 0 0 173.344 384l84.672-96A383.136 383.136 0 0 1 128.00032 576C128.00032 363.936 299.93632 192 512.00032 192c106.048 0 202.048 42.976 271.52 112.48L640.00032 448h384V64l-149.984 149.984A510.272 510.272 0 0 0 512.00032 64C229.21632 64 0.00032 293.216 0.00032 576z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection},e.prototype.exec=function(e,t){"function"==typeof e.redo&&e.redo()},e}(),MS=function(){function e(){this.title=ry("undo.undo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 64A510.272 510.272 0 0 0 149.984 213.984L0.032 64v384h384L240.512 304.48A382.784 382.784 0 0 1 512.032 192c212.064 0 384 171.936 384 384 0 114.688-50.304 217.632-130.016 288l84.672 96a510.72 510.72 0 0 0 173.344-384c0-282.784-229.216-512-512-512z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection},e.prototype.exec=function(e,t){"function"==typeof e.undo&&e.undo()},e}(),jS=[kS,fw,Aw,LA,$A,VA,FA,mw,bw,pS,iw,JD,uA,mS,LS,xw,{menus:[{key:"redo",factory:function(){return new _S}},{key:"undo",factory:function(){return new MS}}]},Tw,hw];ty("en",{listModule:{unOrderedList:"Unordered list",orderedList:"Ordered list"}}),ty("zh-CN",{listModule:{unOrderedList:"无序列表",orderedList:"有序列表"}});var HS=new WeakMap;function zS(e){var t,n=e.children||[],r=n.length;if(0===r)return"";for(var o=0;o<r&&!t;o+=1){var i=n[o];ap.Text.isText(i)&&(t=i)}return null==t?"":t.color||""}function $S(e,t,n){for(var r=t.type,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["type"]),i=void 0!==n?n:o.level||0,a=$g.findPath(e,t),s=a;;){if(0===s.length||0===a[a.length-1])return null;s=ap.Path.previous(s);var u=ap.Editor.node(e,s);if(!u)return null;var l=vp(u,1)[0],c=l.level,d=void 0===c?0:c;if($g.getNodeType(l)!==r)return null;if(d===i)return l}}function US(e,t,n){var r=$S(e,t,n);return!!r&&r.ordered===t.ordered}var VS=[];var GS={type:"list-item",elemToHtml:function(e,t){var n="",r="",o=e.ordered,i=void 0!==o&&o?"ol":"ul",a=function(e){var t=HS.get(e);if(null==t)return 0;var n=e,r=n.type,o=n.ordered,i=void 0!==o&&o,a=n.level,s=void 0===a?0:a,u=$g.findPath(t,e);if(0===u[0])return s+1;var l=ap.Path.previous(u),c=ap.Editor.node(t,l);if(!c)return 0;var d=vp(c,1)[0];if($g.getNodeType(d)!==r)return s+1;var f=d,p=f.ordered,h=void 0!==p&&p,g=f.level,v=void 0===g?0:g;return v<s?s-v:v>s?US(t,e)?0:1:v===s?h===i?0:1:0}(e);if(a>0)for(var s=0;s<a;s+=1)n+="<".concat(i,">"),VS.push(i);var u=function(e){var t=HS.get(e);if(null==t)return 0;var n=e,r=n.type,o=n.ordered,i=void 0!==o&&o,a=n.level,s=void 0===a?0:a,u=$g.findPath(t,e);if(u[0]===t.children.length-1)return s+1;var l=ap.Path.next(u),c=ap.Editor.node(t,l);if(!c)return 0;var d=vp(c,1)[0];if($g.getNodeType(d)!==r)return s+1;var f=d,p=f.ordered,h=void 0!==p&&p,g=f.level,v=void 0===g?0:g;return v<s?US(t,d)?s-v:s-v+1:v>s?0:v===s?h===i?0:1:0}(e);if(u>0)for(s=0;s<u;s+=1){var l=VS.pop();r+="</".concat(l,">")}var c=zS(e),d=c?' style="color:'.concat(c,'"'):"";return{html:"<li".concat(d,">").concat(t,"</li>"),prefix:n,suffix:r}}},WS=function(){function e(){this.type="list-item",this.tag="button"}return e.prototype.getListNode=function(e){var t=this.type;return $g.getSelectedNodeByType(e,t)},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){var t=this.getListNode(e);if(null==t)return!1;var n=t.ordered;return(void 0!==n&&n)===this.ordered},e.prototype.isDisabled=function(e){return null==e.selection||!!$g.getSelectedElems(e).some((function(t){if(ap.Editor.isVoid(e,t)&&ap.Editor.isBlock(e,t))return!0;var n=t.type;return!!["pre","code","table"].includes(n)}))},e.prototype.exec=function(e,t){this.isActive(e)?ap.Transforms.setNodes(e,{type:"paragraph",ordered:void 0,level:void 0}):ap.Transforms.setNodes(e,{type:"list-item",ordered:this.ordered,indent:void 0})},e}(),qS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.ordered=!1,t.title=ry("listModule.unOrderedList"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M384 64h640v128H384V64z m0 384h640v128H384v-128z m0 384h640v128H384v-128zM0 128a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z"></path></svg>',t}return dp(t,e),t}(WS),KS=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.ordered=!0,t.title=ry("listModule.orderedList"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M384 832h640v128H384z m0-384h640v128H384z m0-384h640v128H384zM192 0v256H128V64H64V0zM128 526.016v50.016h128v64H64v-146.016l128-60V384H64v-64h192v146.016zM256 704v320H64v-64h128v-64H64v-64h128v-64H64v-64z"></path></svg>',t}return dp(t,e),t}(WS),YS={key:"bulletedList",factory:function(){return new qS}},XS={key:"numberedList",factory:function(){return new KS}};function ZS(e){return e.length?e[0].tagName.toLowerCase():""}Rh&&(ph.fn.append=Rh),mh&&(ph.fn.attr=mh),_h&&(ph.fn.parent=_h);var JS={selector:"li:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);0===(t=t.filter((function(e){return!!ap.Text.isText(e)||!!n.isInline(e)}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]);var o=function(e){return"ol"===ZS(e.parent())}(r),i=function(e){for(var t=0,n=e.parent(),r=ZS(n);"ul"===r||"ol"===r;)r=ZS(n=n.parent()),t+=1;return t-1}(r);return{type:"list-item",ordered:o,level:i,children:t}}};var QS={selector:"ul:not([data-w-e-type]),ol:not([data-w-e-type])",parseElemHtml:function(e,t,n){return t.flat(1/0)}};function ex(e){return ap.Editor.nodes(e,{at:e.selection||void 0,match:function(t){return 1===$g.findPath(e,t).length}})}var tx={type:"list-item",renderElem:function(e,t,n){HS.set(e,n);var r=e,o=r.level,i=void 0===o?0:o,a=r.ordered,s=void 0!==a&&a,u={margin:"5px 0 5px ".concat(20*i,"px"),display:"flex",alignItems:"flex-start"},l="";if(s){var c=function(e,t){var n=t,r=n.type,o=n.level,i=void 0===o?0:o,a=n.ordered,s=void 0!==a&&a,u=1,l=t,c=$g.findPath(e,l);if(0===c[0])return 1;for(;c[0]>0;){var d=ap.Path.previous(c),f=ap.Editor.node(e,d);if(null==f)break;var p=f[0],h=p.level,g=void 0===h?0:h,v=p.type,m=p.ordered;if(v!==r)break;if(g<i)break;if(g===i){if(m!==s)break;u+=1}l=p,c=d}return u}(n,e);l="".concat(c,".")}else l=function(e){void 0===e&&(e=0);var t="";switch(e){case 0:t="•";break;case 1:t="◦";break;default:t="▪"}return t}(i);var d=zS(e);return rb.jsx("div",{style:u},rb.jsx("span",{contentEditable:!1,style:{marginRight:"0.5em",color:d},"data-w-e-reserve":!0},l),rb.jsx("span",{style:{flex:"1",wordBreak:"break-word"}},t))}},nx={renderElems:[tx],editorPlugin:function(e){var t=e.deleteBackward,n=e.handleTab,r=e.normalizeNode,o=e.insertBreak,i=e;return i.insertBreak=function(){var t=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"list-item")},universal:!0}),1),n=t[0];return n?""!==n[0].children[0].text?o():void ap.Transforms.setNodes(i,{type:"paragraph",ordered:void 0,level:void 0}):o()},i.deleteBackward=function(n){var r=i.selection;if(null!=r)if(ap.Range.isExpanded(r))t(n);else{var o=$g.getSelectedNodeByType(i,"list-item");if(null!=o)if(0!==r.focus.offset)t(n);else{var a=o,s=a.level,u=void 0===s?0:s,l=a.ordered,c=void 0!==l&&l;if(u>0){var d=$S(e,o,u-1);d&&d.ordered!==c?ap.Transforms.setNodes(i,{level:u-1,ordered:!c}):ap.Transforms.setNodes(i,{level:u-1})}else ap.Transforms.setNodes(i,{type:"paragraph",ordered:void 0,level:void 0})}else t(n)}else t(n)},i.handleTab=function(){var e,t,r,o,a=i.selection;if(null!=a){if(ap.Range.isCollapsed(a)){var s=$g.getSelectedNodeByType(i,"list-item");if(null==s)return void n();if(0===a.focus.offset){var u=s.level,l=void 0===u?0:u;return void ap.Transforms.setNodes(i,{level:l+1})}}if(ap.Range.isExpanded(a)){var c=0,d=!1;try{for(var f=gp(ex(i)),p=f.next();!p.done;p=f.next()){var h=vp(p.value,1)[0];"list-item"===$g.getNodeType(h)?c+=1:d=!0}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}if(d||c<=1)return void n();try{for(var g=gp(ex(i)),v=g.next();!v.done;v=g.next()){var m=vp(v.value,2),y=(h=m[0],m[1]),b=h.level;l=void 0===b?0:b;ap.Transforms.setNodes(i,{level:l+1},{at:y})}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}finally{if(r)throw r.error}}}else n()}else n()},i.normalizeNode=function(e){var t=vp(e,2),n=t[0],o=t[1],a=$g.getNodeType(n);return"bulleted-list"!==a&&"numbered-list"!==a||ap.Transforms.unwrapNodes(i,{at:o}),r([n,o])},i},menus:[YS,XS],elemsToHtml:[GS],parseElemsHtml:[QS,JS]};ty("en",{tableModule:{modal:{border:"Border",borderWidth:"Width",bgColor:"Back color",align:"Text Align",ok:"OK"},color:{default:"Default color",clear:"Clear back color"},borderStyle:{none:"None",solid:"Solid",dotted:"Dotted",dashed:"Dashed",double:"Double",groove:"Groove",ridge:"Ridge",inset:"Inset",outset:"Outset"},deleteCol:"Delete column",deleteRow:"Delete row",deleteTable:"Delete table",widthAuto:"Width auto",insertCol:"Insert column",insertRow:"Insert row",insertTable:"Insert table",header:"Header",mergeCell:"merge cell",splitCell:"split cell",tableProperty:"Table property",cellProperty:"Cell property"}}),ty("zh-CN",{tableModule:{modal:{border:"边框",borderWidth:"宽度",bgColor:"背景色",align:"对齐方式",ok:"确定"},color:{default:"默认颜色",clear:"清除背景色"},borderStyle:{none:"无样式",solid:"实线",dotted:"点状虚线",dashed:"虚线",double:"双线",groove:"凹槽边框",ridge:"菱形边框",inset:"凹边框",outset:"凸边框"},deleteCol:"删除列",deleteRow:"删除行",deleteTable:"删除表格",widthAuto:"宽度自适应",insertCol:"插入列",insertRow:"插入行",insertTable:"插入表格",header:"表头",mergeCell:"合并单元格",splitCell:"拆分单元格",tableProperty:"表格属性",cellProperty:"单元格属性"}});var rx={type:"table",elemToHtml:function(e,t){var n=e,r=n.width,o=void 0===r?"auto":r,i=n.columnWidths,a=n.height,s=void 0===a?"auto":a,u=null==i?void 0:i.map((function(e){return"<col width=".concat(e,"></col>")})).join(""),l=u?'<colgroup contentEditable="false">'.concat(u,"</colgroup>"):"";return'<table style="width: '.concat(o,";table-layout: fixed;height:").concat(s,'">').concat(l,"<tbody>").concat(t,"</tbody></table>")}},ox={type:"table-row",elemToHtml:function(e,t){return"<tr>".concat(t,"</tr>")}},ix={type:"table-cell",elemToHtml:function(e,t){var n=e,r=n.colSpan,o=void 0===r?1:r,i=n.rowSpan,a=void 0===i?1:i,s=n.isHeader,u=void 0!==s&&s,l=n.width,c=void 0===l?"auto":l,d=n.hidden,f=u?"th":"td",p=void 0!==d&&d?"display:none":"";return"<".concat(f,' colSpan="').concat(o,'" rowSpan="').concat(a,'" width="').concat(c,'" style="').concat(p,'">').concat(t,"</").concat(f,">")}},ax='<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>',sx={blocks:{td:"table-cell",th:"table-cell",content:"paragraph",tr:"table-row",table:"table",tbody:"table-body"}};function ux(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=sx,o=t.map((function(e){var t;return null===(t=null==r?void 0:r.blocks)||void 0===t?void 0:t[e]}));return function(e){return function(e){return!ap.Editor.isEditor(e)&&ap.Element.isElement(e)&&"type"in e}(e)&&o.includes(e.type)}}function lx(e,t){for(var n=vp(t,2),r=n[0],o=n[1],i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var s=vp(ap.Node.common(e,r,o),2),u=s[0],l=s[1];return!!ux.apply(void 0,mp([e],vp(i),!1))(u,l)||!!ap.Editor.above(e,{match:ux.apply(void 0,mp([e],vp(i),!1)),at:l})}function cx(e,t){var n,r;void 0===t&&(t={});var o=[];try{for(var i=gp(function(e,t){var n,r,o,i,a,s,u,l,c,d,f,p,h,g,v,m,y,b;return void 0===t&&(t={}),hp(this,(function(E){switch(E.label){case 0:if(n=vp(ap.Editor.nodes(e,{match:ux(e,"table"),at:t.at}),1),!(r=n[0]))return[2,[]];o=vp(r,2),i=o[1],E.label=1;case 1:E.trys.push([1,6,7,8]),a=gp(ap.Editor.nodes(e,{match:ux(e,"table"),at:i})),s=a.next(),E.label=2;case 2:if(s.done)return[3,5];u=vp(s.value,2),l=u[1],c=[];try{for(y=void 0,d=gp(ap.Editor.nodes(e,{match:ux(e,"tr"),at:l})),f=d.next();!f.done;f=d.next())p=vp(f.value,2),h=p[1],c.push(mp([],vp(ap.Editor.nodes(e,{match:ux(e,"th","td"),at:h})),!1))}catch(e){y={error:e}}finally{try{f&&!f.done&&(b=d.return)&&b.call(d)}finally{if(y)throw y.error}}return[4,c];case 3:E.sent(),E.label=4;case 4:return s=a.next(),[3,2];case 5:return[3,8];case 6:return g=E.sent(),v={error:g},[3,8];case 7:try{s&&!s.done&&(m=a.return)&&m.call(a)}finally{if(v)throw v.error}return[7];case 8:return[2]}}))}(e,{at:t.at})),a=i.next();!a.done;a=i.next()){for(var s=a.value,u=[],l=0;l<s.length;l+=1){u[l]||(u[l]=[]);for(var c=0;c<s[l].length;c+=1)for(var d=vp(s[l][c],1)[0],f=d.rowSpan,p=void 0===f?1:f,h=d.colSpan,g=void 0===h?1:h,v=0;v<g+0;v+=1)for(var m=0;m<p;m+=1)u[l+m]||(u[l+m]=[]),u[l+m][c+v]||(u[l+m][c+v]=[s[l+m][c+v],{rtl:v-0+1,ltr:g-v+0,ttb:m+1,btt:p-m}])}o.push.apply(o,mp([],vp(u),!1))}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}var dx=function(){function e(e,t){this.x=e,this.y=t}return e.valueOf=function(e,t){return new this(e,t)},e.equals=function(e,t){return e.x===t.x&&e.y===t.y},e}();function fx(e){return e.length?e[0].tagName.toLowerCase():""}function px(e,t){for(var n="",r=(e.attr("style")||"").split(";"),o=r.length,i=0;i<o;i+=1){var a=r[i];if(a){var s=a.split(":");s[0].trim()===t&&(n=s[1].trim())}}return n}Rh&&ph.fn&&(ph.fn.append=Rh),Dh&&ph.fn&&(ph.fn.on=Dh),Wh&&ph.fn&&(ph.fn.focus=Wh),mh&&ph.fn&&(ph.fn.attr=mh),Ch&&ph.fn&&(ph.fn.val=Ch),Fh&&ph.fn&&(ph.fn.html=Fh),Eh&&ph.fn&&(ph.fn.dataset=Eh),hh&&ph.fn&&(ph.fn.addClass=hh),gh&&ph.fn&&(ph.fn.removeClass=gh),Hh&&ph.fn&&(ph.fn.children=Hh),Bh&&ph.fn&&(ph.fn.each=Bh),jh&&ph.fn&&(ph.fn.find=jh),bh&&ph.fn&&(ph.fn.data=bh),Oh&&ph.fn&&(ph.fn.hide=Oh),Th&&ph.fn&&(ph.fn.show=Th);var hx=new WeakMap,gx=new WeakMap,vx=function(){function e(){this.title=ry("tableModule.tableProperty"),this.iconSvg='<svg viewBox="0 0 20 20"><path d="M8 2v5h4V2h1v5h5v1h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5H7v-5H2v-1h5V8H2V7h5V2h1zm4 6H8v4h4V8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM17 1a2 2 0 0 1 2 2v9.475l-.85-.124-.857-1.736a2.048 2.048 0 0 0-.292-.44L17 3H3v14h7.808l.402.392L10.935 19H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14z"/></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.menu="table",this.borderStyle=[{value:"none",label:ry("tableModule.borderStyle.none")},{value:"solid",label:ry("tableModule.borderStyle.solid")},{value:"dotted",label:ry("tableModule.borderStyle.dotted")},{value:"dashed",label:ry("tableModule.borderStyle.dashed")},{value:"double",label:ry("tableModule.borderStyle.double")},{value:"groove",label:ry("tableModule.borderStyle.groove")},{value:"ridge",label:ry("tableModule.borderStyle.ridge")},{value:"inset",label:ry("tableModule.borderStyle.inset")},{value:"outset",label:ry("tableModule.borderStyle.outset")}],this.textAlignOptions=[{value:"left",label:ry("justify.left"),svg:'<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>'},{value:"center",label:ry("justify.center"),svg:'<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>'},{value:"right",label:ry("justify.right"),svg:'<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>'},{value:"justify",label:ry("justify.justify"),svg:'<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>'}]}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==$g.getSelectedNodeByType(e,"table")},e.prototype.exec=function(e,t){},e.prototype.getModalContentNode=function(e){return vp(ap.Editor.nodes(e,{match:ux(e,"table")}),1)[0]},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=this,n=this.getModalContentNode(e);if(!n)return null;var r=vp(n,2),o=r[0],i=r[1],a=ph('<div>\n <label class="babel-container">\n <span>'.concat(ry("tableModule.modal.border"),'</span>\n <span class="babel-container-border">\n <select name="borderStyle">\n ').concat(this.borderStyle.map((function(e){return'<option value="'.concat(e.value,'">').concat(e.label,"</option>")})).join(""),'\n </select>\n <span class="color-group" data-mark="color">\n <span class="color-group-block"></span>\n <input name="borderColor" type="hidden">\n </span>\n <input name="borderWidth" type="number" placeholder="').concat(ry("tableModule.modal.borderWidth"),'">\n </span>\n </label>\n <div class="babel-container">\n <span>').concat(ry("tableModule.modal.bgColor"),'</span>\n <span class="babel-container-background">\n <span class="color-group" data-mark="bgColor">\n <span class="color-group-block"></span>\n <input name="backgroundColor" type="hidden">\n </span>\n </span>\n </div>\n <label class="babel-container">\n <span>').concat(ry("tableModule.modal.align"),'</span>\n <span class="babel-container-align">\n <select name="textAlign">\n ').concat(this.textAlignOptions.map((function(e){return'<option value="'.concat(e.value,'">').concat(e.label,"</option>")})).join(""),'\n </select>\n </span>\n </label>\n <div class="button-container">\n <button type="button">').concat(ry("tableModule.modal.ok"),"</button>\n </div>\n </div>"));a.find("[name]").each((function(e){ph(e).val(o[ph(e).attr("name")])}));var s=function(e,t){t?ph(".color-group-block",e).css("background-color",t).empty():ph(".color-group-block",e).css("background-color","").html(ax)};return a.find(".color-group").each((function(n){var r=ph('[type="hidden"]',n).val()||"";s(n,r);var o=ph(n);o.on("click",(function(){a.find(".color-group .w-e-drop-panel").hide();var i=o.data("panel");i?i.show():(i=t.getPanelContentElem(e,{mark:o.data("mark"),selectedColor:r,callback:function(e){ph('[type="hidden"]',n).val(e||""),s(n,e),i.hide()}}),o.append(i),o.data("panel",i))}))})),a.find("button").on("click",(function(){var n=Array.from(a.find("[name]")).reduce((function(e,t){return e[ph(t).attr("name")]=ph(t).val(),e}),{}),r=hx.get(e);"cell"===t.menu&&(null==r?void 0:r.length)?r.forEach((function(t){t.forEach((function(t){ap.Transforms.setNodes(e,n,{at:t[0][1]})}))})):ap.Transforms.setNodes(e,n,{at:i}),setTimeout((function(){e.focus()}))})),a[0]},e.prototype.getPanelContentElem=function(e,t){var n=t.mark,r=t.selectedColor,o=t.callback,i=ph('<ul class="w-e-panel-content-color"></ul>');i.on("click","li",(function(e){var t=e.target;if(t){e.preventDefault(),e.stopPropagation();var n=ph(t).attr("data-value");o(n)}}));var a=e.getMenuConfig(n).colors;(void 0===a?[]:a).forEach((function(e){var t=ph('<div class="color-block" data-value="'.concat(e,'"></div>'));t.css("background-color",e);var n=ph('<li data-value="'.concat(e,'"></li>'));r===e&&n.addClass("active"),n.append(t),i.append(n)}));var s="";"color"===n&&(s=ry("tableModule.color.default")),"bgColor"===n&&(s=ry("tableModule.color.clear"));var u=ph('\n <li data-value="" class="clear">\n '.concat(ax,"\n ").concat(s,"\n </li>\n "));i.prepend(u);var l=ph('<div class="w-e-drop-panel"></div>');return l.append(i),l},e}(),mx=function(e){function t(){var t=e.apply(this,mp([],vp(arguments),!1))||this;return t.title=ry("tableModule.cellProperty"),t.iconSvg='<svg viewBox="0 0 20 20"><path d="m11.105 18-.17 1H2.5A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1h15A1.5 1.5 0 0 1 19 2.5v9.975l-.85-.124-.15-.302V8h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5h3.105zM2 12h5V8H2v4zm10-4H8v4h4V8zM2 2v5h5V2H2zm0 16h5v-5H2v5zM13 7h5V2h-5v5zM8 2v5h4V2H8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM13 6a1 1 0 0 1 1 1v3.172a2.047 2.047 0 0 0-.293.443l-.858 1.736-1.916.28-.151.027A1.976 1.976 0 0 0 9.315 14H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm-1 2H8v4h4V8z"/></svg>',t.tag="button",t.showModal=!0,t.modalWidth=300,t.menu="cell",t}return dp(t,e),t.prototype.getModalContentNode=function(e){return vp(ap.Editor.nodes(e,{match:ux(e,"td")}),1)[0]},t}(vx),yx=function(){function e(){this.title=ry("tableModule.deleteCol"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M327.68 510.976L393.216 445.44v-13.1072L327.68 366.7968V510.976z m327.68-78.4384l65.536-65.536V507.904L655.36 442.368v-9.8304z m393.216 484.9664V0H0v917.504h1048.576z m-65.536-131.072h-262.144v-52.4288l-13.1072 13.1072-52.4288-52.4288v91.7504H393.216v-91.7504l-52.4288 52.4288-13.1072-13.1072v52.4288H65.536V65.536H327.68v121.2416l36.0448-36.0448 29.4912 29.4912V62.2592h262.144V180.224l49.152-49.152 16.384 16.384V62.2592h262.144V786.432z m-294.912-108.1344l-160.5632-160.5632-167.1168 167.1168-78.6432-78.6432 167.1168-167.1168L288.3584 278.528l78.6432-78.6432 160.5632 160.5632 163.84-163.84 78.6432 78.6432-163.84 163.84 160.5632 160.5632-78.6432 78.6432z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table-cell"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")},universal:!0}),1),r=vp(n[0],2),o=r[0],i=r[1],a=$g.getParentNode(e,o),s=(null==a?void 0:a.children.length)||0;if(!a||s<=1)ap.Transforms.removeNodes(e,{mode:"highest"});else if(null!=$g.getParentNode(e,a)){var u=cx(e),l=0;e:for(var c=0;c<u.length;c+=1)for(var d=0;d<u[c].length;d+=1){var f=vp(u[c][d],1),p=vp(f[0],2)[1];if(ap.Path.equals(i,p)){l=d;break e}}ap.Editor.withoutNormalizing(e,(function(){for(var t,n,r=0;r<u.length;r+=1){var o=vp(u[r][l],2),i=vp(o[0],1)[0].hidden,a=o[1],s=a.rtl,c=a.ltr;if(s>1||c>1){var d=vp(u[r][l-(s-1)],1),f=vp(d[0],2),p=f[0],h=p.rowSpan,g=void 0===h?1:h,v=p.colSpan,m=void 0===v?1:v,y=f[1];if(i)ap.Transforms.setNodes(e,{rowSpan:g,colSpan:Math.max(m-1,1)},{at:y});else{var b=vp(u[r][l+1],1),E=vp(b[0],2)[1];ap.Transforms.setNodes(e,{rowSpan:g,colSpan:m-1,hidden:!1},{at:E});try{for(var C=(t=void 0,gp(ap.Node.children(e,y,{reverse:!0}))),D=C.next();!D.done;D=C.next()){var w=vp(D.value,2)[1];ap.Transforms.moveNodes(e,{to:mp(mp([],vp(E),!1),[0],!1),at:w})}}catch(e){t={error:e}}finally{try{D&&!D.done&&(n=C.return)&&n.call(C)}finally{if(t)throw t.error}}}}}for(r=0;r<u.length;r+=1){var A=vp(u[r][l],1);y=vp(A[0],2)[1];ap.Transforms.removeNodes(e,{at:y})}var S=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table")},universal:!0}),1),x=S[0];if(x){var O=vp(x,2),T=O[0],N=O[1],B=T.columnWidths,k=mp([],vp(void 0===B?[]:B),!1);k.splice(l,1),ap.Transforms.setNodes(e,{columnWidths:k},{at:N})}}))}}},e}(),bx=function(){function e(){this.title=ry("tableModule.deleteRow"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M907.6736 586.5472L747.1104 425.984l163.84-163.84-78.6432-78.6432-163.84 163.84L507.904 186.7776 429.2608 262.144l163.84 163.84-167.1168 167.1168 78.6432 78.6432 167.1168-167.1168 160.5632 160.5632 75.3664-78.6432zM0 917.504V0h1048.576v917.504H0z m983.04-327.68h-22.9376l-65.536-65.536H983.04V327.68h-91.7504l65.536-65.536h26.2144V65.536H65.536v196.608h317.8496l65.536 65.536H65.536v196.608h380.1088l-65.536 65.536H65.536v196.608H983.04v-196.608z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table-row"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-row")},universal:!0}),1),r=vp(n[0],2),o=r[0],i=r[1],a=$g.getParentNode(e,o);if(((null==a?void 0:a.children.length)||0)<=1)ap.Transforms.removeNodes(e,{mode:"highest"});else{var s=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")},universal:!0}),1),u=vp(s[0],2)[1],l=cx(e),c=0;e:for(var d=0;d<l.length;d+=1)for(var f=0;f<l[d].length;f+=1){var p=vp(l[d][f],1),h=vp(p[0],2)[1];if(ap.Path.equals(u,h)){c=d;break e}}ap.Editor.withoutNormalizing(e,(function(){for(var t,n,r=0;r<l[c].length;r+=1){var o=vp(l[c][r],2),a=vp(o[0],1)[0].hidden,s=o[1],u=s.ttb,d=s.btt;if(u>1||d>1){var f=vp(l[c-(u-1)][r],1),p=vp(f[0],2),h=p[0],g=h.rowSpan,v=void 0===g?1:g,m=h.colSpan,y=void 0===m?1:m,b=p[1];if(a)ap.Transforms.setNodes(e,{rowSpan:Math.max(v-1,1),colSpan:y},{at:b});else{var E=vp(l[c+1][r],1),C=vp(E[0],2)[1];ap.Transforms.setNodes(e,{rowSpan:v-1,colSpan:y,hidden:!1},{at:C});try{for(var D=(t=void 0,gp(ap.Node.children(e,b,{reverse:!0}))),w=D.next();!w.done;w=D.next()){var A=vp(w.value,2)[1];ap.Transforms.moveNodes(e,{to:mp(mp([],vp(C),!1),[0],!1),at:A})}}catch(e){t={error:e}}finally{try{w&&!w.done&&(n=D.return)&&n.call(D)}finally{if(t)throw t.error}}}}}ap.Transforms.removeNodes(e,{at:i})}))}}},e}(),Ex=function(){function e(){this.title=ry("tableModule.deleteTable"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==$g.getSelectedNodeByType(e,"table")},e.prototype.exec=function(e,t){this.isDisabled(e)||ap.Transforms.removeNodes(e,{mode:"highest"})},e}(),Cx=function(){function e(){this.title=ry("tableModule.widthAuto"),this.iconSvg='<svg viewBox="0 0 1228 1024"><path d="M862.514337 563.200461H404.581995v121.753478a13.311987 13.311987 0 0 1-6.655993 11.468789 10.23999 10.23999 0 0 1-12.083188-1.433599l-204.799795-179.199821a13.721586 13.721586 0 0 1 0-20.479979l204.799795-179.302221a10.23999 10.23999 0 0 1 12.185588-1.535998 13.209587 13.209587 0 0 1 6.553593 11.673588v115.097485h457.932342V319.693504a11.571188 11.571188 0 0 1 18.841582-10.239989l204.799795 179.19982a13.721586 13.721586 0 0 1 0 20.47998l-204.799795 179.199821a10.23999 10.23999 0 0 1-12.185588 1.535998 13.311987 13.311987 0 0 1-6.655994-11.571188V563.200461zM136.499064 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785H15.155185A15.155185 15.155185 0 0 1 0 1008.844815V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086294a15.155185 15.155185 0 0 1 15.257585 15.155185zM1228.798771 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785h-106.188693a15.155185 15.155185 0 0 1-15.155185-15.052785V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086293A15.155185 15.155185 0 0 1 1228.798771 15.053809z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){var t=$g.getSelectedNodeByType(e,"table");return null!=t&&"100%"===t.width},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n={width:t?"auto":"100%"};ap.Transforms.setNodes(e,n,{mode:"highest"})}},e}();function Dx(e){var t=e.children||[];return 0===t.length?[]:(t[0]||{}).children||[]}function wx(e){return Dx(e).every((function(e){return!!e.isHeader}))}var Ax=function(){function e(){this.title=ry("tableModule.insertCol"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M327.68 193.3312v186.7776H140.9024v91.7504H327.68v186.7776h88.4736V471.8592h190.0544V380.1088H416.1536V193.3312zM0 917.504V0h1048.576v917.504H0zM655.36 65.536H65.536v720.896H655.36V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 262.144h-262.144v196.608h262.144V327.68z m0 262.144h-262.144v196.608h262.144v-196.608z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")},universal:!0}),1),r=vp(n[0],2),o=r[0],i=r[1],a=$g.getParentNode(e,o);if(null!=a){var s=$g.getParentNode(e,a);if(null!=s){for(var u=cx(e),l=0,c=0;c<u.length;c+=1)for(var d=0;d<u[c].length;d+=1){var f=vp(u[c][d],1),p=vp(f[0],2)[1];if(ap.Path.equals(i,p)){l=d;break}}ap.Editor.withoutNormalizing(e,(function(){for(var t=[],n=0;n<u.length;n+=1){var r=vp(u[n][l],2)[1],o=r.ltr,i=r.rtl;if(o>1||i>1){if(1===i)continue;var a=vp(u[n][l-(i-1)],1),c=vp(a[0],2),d=c[0],f=c[1],p=d.colSpan||1;t.push(n),d.hidden||ap.Transforms.setNodes(e,{colSpan:p+1},{at:f})}}for(n=0;n<u.length;n+=1){var h={type:"table-cell",hidden:t.includes(n),children:[{text:""}]};0===n&&wx(s)&&(h.isHeader=!0);var g=vp(u[n][l],1),v=vp(g[0],2)[1];ap.Transforms.insertNodes(e,h,{at:v})}var m=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table")},universal:!0}),1),y=m[0];if(y){var b=vp(y,2),E=b[0],C=b[1],D=E.columnWidths,w=mp([],vp(void 0===D?[]:D),!1),A=e.getMenuConfig("insertTable").minWidth,S=void 0===A?60:A;w.splice(l,0,parseInt(S,10)||60),ap.Transforms.setNodes(e,{columnWidths:w},{at:C})}}))}}}},e}(),Sx=function(){function e(){this.title=ry("tableModule.insertRow"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M707.7888 521.0112h-147.456v-147.456H488.2432v147.456h-147.456v68.8128h147.456v147.456h72.0896v-147.456h147.456zM0 917.504V0h1048.576v917.504H0zM327.68 65.536H65.536v196.608H327.68V65.536z m327.68 0H393.216v196.608h262.144V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 258.8672H65.536v462.0288H983.04V324.4032z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")},universal:!0}),1),r=vp(n[0],2),o=r[0],i=r[1],a=$g.getParentNode(e,o),s=(null==a?void 0:a.children.length)||0;if(0!==s){var u=cx(e),l=0;e:for(var c=0;c<u.length;c+=1)for(var d=0;d<u[c].length;d+=1){var f=vp(u[c][d],1),p=vp(f[0],2)[1];if(ap.Path.equals(i,p)){l=c;break e}}ap.Editor.withoutNormalizing(e,(function(){for(var t=l+1,n=t>=0&&t<u.length,r=[],o=0;n&&o<u[l].length;o+=1){var a=vp(u[l][o],2)[1],c=a.ttb,d=a.btt;if(c>1||d>1){if(1===d)continue;var f=vp(u[l-(c-1)][o],1),p=vp(f[0],2),h=p[0],g=p[1],v=h.rowSpan||1;r.push(o),h.hidden||ap.Transforms.setNodes(e,{rowSpan:v+1},{at:g})}}for(var m={type:"table-row",children:[]},y=0;y<s;y+=1){var b={type:"table-cell",hidden:r.includes(y),children:[{text:""}]};m.children.push(b)}var E=ap.Path.parent(i),C=ap.Path.next(E);ap.Transforms.insertNodes(e,m,{at:C})}))}}},e}();var xx=function(){function e(){this.title=ry("tableModule.insertTable"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64v896h1024V64H0z m384 576v-192h256v192h-256z m256 64v192h-256v-192h256z m0-512v192h-256V192h256zM320 192v192H64V192h256z m-256 256h256v192H64v-192z m640 0h256v192h-256v-192z m0-64V192h256v192h-256zM64 704h256v192H64v-192z m640 192v-192h256v192h-256z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||!!$g.getSelectedElems(e).some((function(t){var n=$g.getNodeType(t);return"pre"===n||("table"===n||("list-item"===n||!!e.isVoid(t)))})))},e.prototype.getPanelContentElem=function(e){var t=this;if(this.$content)return this.$content[0];for(var n=ph('<div class="w-e-panel-content-table"></div>'),r=ph("<span>0 × 0</span>"),o=ph("<table></table>"),i=0;i<10;i+=1){for(var a=ph("<tr></tr>"),s=0;s<10;s+=1){var u=ph("<td></td>");u.attr("data-x",s.toString()),u.attr("data-y",i.toString()),a.append(u),u.on("mouseenter",(function(e){var t=e.target;if(null!=t){var n=ph(t).dataset(),i=n.x,a=n.y;r[0].innerHTML="".concat(i+1," × ").concat(a+1),o.children().each((function(e){ph(e).children().each((function(e){var t=ph(e),n=t.dataset(),r=n.x,o=n.y;r<=i&&o<=a?t.addClass("active"):t.removeClass("active")}))}))}})),u.on("click",(function(n){n.preventDefault();var r=n.target;if(null!=r){var o=ph(r).dataset(),i=o.x,a=o.y;t.insertTable(e,a+1,i+1)}}))}o.append(a)}return n.append(o),n.append(r),this.$content=n,n[0]},e.prototype.insertTable=function(e,t,n){var r=parseInt(t,10),o=parseInt(n,10);if(r&&o&&!(r<=0||o<=0)){if($g.isSelectedEmptyParagraph(e)&&ap.Transforms.removeNodes(e,{mode:"highest"}),0===e.children.length){ap.Transforms.insertNodes(e,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}var i=function(e,t,n){for(var r,o=[],i=e.getMenuConfig("insertTable"),a=i.minWidth,s=void 0===a?60:a,u=i.tableFullWidth,l=i.tableHeader,c=Array(n).fill(parseInt(s,10)||60),d=0;d<t;d+=1){for(var f=[],p=0;p<n;p+=1){var h={type:"table-cell",children:[{text:""}]};0===d&&(h.isHeader=null===(r=null==l?void 0:l.selected)||void 0===r||r),f.push(h)}o.push({type:"table-row",children:f})}return{type:"table",width:(null==u?void 0:u.selected)?"100%":"auto",children:o,columnWidths:c}}(e,r,o);ap.Transforms.insertNodes(e,i,{mode:"highest"})}},e}(),Ox={isInTable:function(e,t){return void 0===t&&(t={}),!!vp(ap.Editor.nodes(e,{match:ux(e,"table"),at:t.at}),1)[0]},selection:function(e){var t,n,r,o,i,a,s,u;return hp(this,(function(l){switch(l.label){case 0:t=hx.get(e),n=0,l.label=1;case 1:if(!(t&&n<t.length))return[3,4];for(r=[],o=0;o<t[n].length;o+=1)i=vp(t[n][o],2),a=i[0],s=i[1],u=s.ltr,1===s.ttb&&r.push(a),o+=u-1;return[4,r];case 2:l.sent(),l.label=3;case 3:return n+=1,[3,1];case 4:return[2]}}))},unselect:function(e){gx.delete(e),hx.delete(e)},isSelected:function(e,t){var n=gx.get(e);return!!n&&n.has(t)}},Tx=function(){function e(){this.title=ry("tableModule.mergeCell"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M482.2 508.4 331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4c2.4-1.8 2.4-5.4 0-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4c-2.3 1.8-2.3 5.3 0 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"/></svg>',this.tag="button"}return e.prototype.needKeepCell=function(e,t){var n=vp(ap.Node.children(e,t),2)[1],r=ap.Editor.parent(e,t)[0].children.length>1;return!!n||r},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return!this.canMerge(e)},e.prototype.exec=function(e,t){this.isDisabled(e)||(this.merge(e),Ox.unselect(e))},e.prototype.canMerge=function(e){var t=hx.get(e);if(!t||!t.length)return!1;var n=vp(t[t.length-1][t[t.length-1].length-1],1),r=vp(n[0],2)[1],o=vp(t[0][0],1);return!!lx(e,[vp(o[0],2)[1],r],"table")},e.prototype.merge=function(e){var t=this;if(this.canMerge(e)){var n=hx.get(e);if(n&&n.length){var r=vp(n[0][0],1),o=vp(r[0],2)[1],i=vp(ap.Node.children(e,o,{reverse:!0}),1),a=vp(i[0],2)[1];ap.Editor.withoutNormalizing(e,(function(){for(var r,i,s=0,u=0,l=n.length-1;l>=0;l-=1,s+=1){u=0;for(var c=n[l].length-1;c>=0;c-=1,u+=1){var d=vp(n[l][c],2),f=vp(d[0],2)[1],p=d[1].ttb;if(!(ap.Path.equals(o,f)||p>1)){try{for(var h=(r=void 0,gp(ap.Node.children(e,f,{reverse:!0}))),g=h.next();!g.done;g=h.next()){var v=vp(g.value,2)[1];ap.Transforms.moveNodes(e,{to:ap.Path.next(a),at:v})}}catch(e){r={error:e}}finally{try{g&&!g.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}var m=vp(ap.Editor.nodes(e,{match:ux(e,"tr"),at:f}),1),y=vp(m[0],2)[1];t.needKeepCell(e,y)&&ap.Transforms.setNodes(e,{hidden:!0},{at:f})}}}ap.Transforms.setNodes(e,{rowSpan:s,colSpan:u},{at:o})}))}}},e}(),Nx=function(){function e(){this.title=ry("tableModule.splitCell"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M362.667 494.933v53.334l25.6-25.6zm0-241.066L460.8 352V78.933H57.6v98.134h305.067zm0 535.466v57.6H57.6v98.134h403.2V691.2zM661.333 494.933v53.334l-25.6-25.6zm0-241.066L563.2 352V78.933h403.2v98.134H661.333zm0 535.466v57.6H966.4v98.134H563.2V691.2z"/><path d="M753.067 341.333 693.333 281.6 512 460.8 330.667 281.6l-59.734 59.733 181.334 181.334L270.933 704l59.734 59.733L512 582.4l181.333 181.333L753.067 704 571.733 522.667z"/></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=vp(ap.Editor.nodes(e,{match:ux(e,"td")}),1),n=vp(t[0],1)[0],r=n.rowSpan,o=void 0===r?1:r,i=n.colSpan;return!(o>1||(void 0===i?1:i)>1)},e.prototype.exec=function(e,t){this.isDisabled(e)||this.split(e)},e.prototype.split=function(e,t){void 0===t&&(t={});var n=vp(ap.Editor.nodes(e,{match:ux(e,"table","th","td"),at:t.at}),2),r=n[0],o=n[1];if(r&&o){var i=hx.get(e)||[],a=cx(e,{at:t.at});ap.Editor.withoutNormalizing(e,(function(){for(var n=a.length-1;n>=0;n-=1)for(var r=a[n].length-1;r>=0;r-=1){var s=vp(a[n][r],2),u=vp(s[0],2)[1],l=s[1],c=l.ltr,d=l.rtl,f=l.btt,p=l.ttb;if(d>1)r-=d-2;else if(!(p>1||1===f&&1===c)){var h=!!t.all;if(i.length)e:for(var g=0;!t.all&&g<i.length;g+=1)for(var v=0;v<i[g].length;v+=1){var m=vp(i[g][v],1),y=vp(m[0],2)[1];if(ap.Path.equals(y,u)){h=!0;break e}}else{y=vp(o,2)[1];ap.Path.equals(y,u)&&(h=!0)}if(h){e:for(var b=1;b<f;b+=1)for(g=r;g>=0;g-=1){if(1!==vp(a[n+b][g],2)[1].ttb){for(var E=0;E<c;E+=1){var C=vp(a[n+b][g+E],1),D=vp(C[0],2)[1];ap.Transforms.unsetNodes(e,["hidden","colSpan","rowSpan"],{at:D})}continue e}}for(E=1;E<c;E+=1){var w=vp(a[n][r+E],1);D=vp(w[0],2)[1];ap.Transforms.unsetNodes(e,["hidden","colSpan","rowSpan"],{at:D})}ap.Transforms.setNodes(e,{rowSpan:1,colSpan:1},{at:u})}}}}))}},e}(),Bx=function(){function e(){this.title=ry("tableModule.header"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M704 128l-64 0L384 128 320 128 0 128l0 256 0 64 0 192 0 64 0 256 320 0 64 0 256 0 64 0 320 0 0-256 0-64L1024 448 1024 384 1024 128 704 128zM640 640 384 640 384 448l256 0L640 640zM64 448l256 0 0 192L64 640 64 448zM320 896 64 896l0-192 256 0L320 896zM640 896 384 896l0-192 256 0L640 896zM960 896l-256 0 0-192 256 0L960 896zM960 640l-256 0L704 448l256 0L960 640z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){var t=$g.getSelectedNodeByType(e,"table");return null!=t&&wx(t)},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||null==$g.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=!t,r=$g.getSelectedNodeByType(e,"table");if(null!=r)Dx(r).forEach((function(t){return ap.Transforms.setNodes(e,{isHeader:n},{at:$g.findPath(e,t)})}))}},e}(),kx={key:"insertTable",factory:function(){return new xx}},Fx={key:"deleteTable",factory:function(){return new Ex}},Px={key:"insertTableRow",factory:function(){return new Sx}},Ix={key:"deleteTableRow",factory:function(){return new bx}},Rx={key:"insertTableCol",factory:function(){return new Ax}},Lx={key:"deleteTableCol",factory:function(){return new yx}},_x={key:"tableHeader",factory:function(){return new Bx}},Mx={key:"tableFullWidth",factory:function(){return new Cx}},jx={key:"mergeTableCell",factory:function(){return new Tx}},Hx={key:"splitTableCell",factory:function(){return new Nx}},zx={key:"setTableProperty",factory:function(){return new vx}},$x={key:"setTableCellProperty",factory:function(){return new mx}};var Ux={selector:"td:not([data-w-e-type]),th:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=ph(e);0===(t=t.filter((function(e){return"paragraph"===$g.getNodeType(e)||(!!ap.Text.isText(e)||!!n.isInline(e))}))).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]);var o=parseInt(r.attr("colSpan")||"1",10),i=parseInt(r.attr("rowSpan")||"1",10),a="none"===px(r,"display"),s=r.attr("width")||"auto";return{type:"table-cell",isHeader:"th"===fx(r),colSpan:o,rowSpan:i,width:s,children:t,hidden:a}}};var Vx={selector:"tr:not([data-w-e-type])",parseElemHtml:function(e,t,n){for(var r,o=[],i=0;i<t.length;i+=1){var a=t[i];if("table-cell"===$g.getNodeType(a)){var s=a.colSpan||1;o.push(a);for(var u=1;u<s;u+=1){var l=t[i+u];l&&"table-cell"===$g.getNodeType(l)&&"none"===(null===(r=l.style)||void 0===r?void 0:r.display)||o.push({type:"table-cell",children:[{text:""}],hidden:!0})}}}return{type:"table-row",children:o}}};var Gx,Wx={selector:"table:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r,o,i=ph(e),a="auto";"100%"===px(i,"width")&&(a="100%"),"100%"===i.attr("width")&&(a="100%");var s={type:"table",width:a,height:parseInt(px(i,"height")||"0",10),children:t.filter((function(e){return"table-row"===$g.getNodeType(e)}))},u=(null===(r=i.find("tr")[0])||void 0===r?void 0:r.children)||[],l=(null===(o=i.find("colgroup")[0])||void 0===o?void 0:o.children)||null,c=t[t.length-1].children.length;if(l&&l.length===c)s.columnWidths=Array.from(l).map((function(e){return parseInt(e.getAttribute("width"),10)}));else if(u.length>0){var d=[];Array.from(u).forEach((function(e){var t=parseInt(ph(e).attr("colSpan")||"1",10),n=parseInt(px(ph(e),"width")||"90",10);d.push(n);for(var r=1;r<t;r+=1)d.push(90)})),s.columnWidths=d}return s}},qx=null===(Gx=null===window||void 0===window?void 0:window.getComputedStyle(document.documentElement))||void 0===Gx?void 0:Gx.getPropertyValue("--w-e-textarea-border-color");function Kx(e){var t=e.selection;if(null==t)return!1;var n=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")}}),1),r=n[0];if(r){var o=vp(r,2)[1],i=ap.Editor.start(e,o);if(ap.Point.equals(t.anchor,i))return!0}return!1}function Yx(e,t){var n=t.offset;if(0===n)return!1;var r=ap.Editor.node(e,t);if(!ap.Text.isText(r[0]))return!1;var o=ap.Node.string(r[0]);return!(n>=o.length)&&("\n"===o[n-1]&&"\r"===o[n])}function Xx(e,t,n){var r=e.selection;if(null==r||"line"===t)return!1;var o=vp(ap.Editor.nodes(e,{match:function(e){return $g.checkNodeType(e,"table-cell")}}),1),i=o[0],a=r.anchor;if("backward"===n&&0===r.anchor.offset&&(a=ap.Editor.before(e,r)),"forward"===n&&ap.Editor.isEnd(e,r.anchor,r.anchor.path)&&(a=ap.Editor.after(e,r)),null==a)return!1;var s=ap.Editor.above(e,{at:a,match:function(e){return $g.checkNodeType(e,"table-cell")}});if(null==s||null==i||!ap.Path.equals(s[1],i[1]))return!1;var u=ap.Editor.node(e,a);if(!ap.Text.isText(u[0])||u[0].text.length<2)return!1;var l="backward"===n?[a.offset-2,a.offset]:[a.offset,a.offset+2],c=ap.Node.string(u[0]);return"\n\r"===c.slice.apply(c,mp([],vp(l),!1))?(ap.Transforms.insertText(e,c.slice(0,l[0])+c.slice(l[1]),{at:{anchor:ap.Editor.start(e,a.path),focus:ap.Editor.end(e,a.path)}}),!0):!!Yx(e,a)&&(ap.Transforms.insertText(e,c.slice(0,r.anchor.offset-1)+c.slice(r.anchor.offset+1),{at:{anchor:ap.Editor.start(e,a.path),focus:ap.Editor.end(e,a.path)}}),!0)}function Zx(e,t){var n=ap.Editor.nodes(e,{at:t,match:function(e){return"table"===$g.getNodeType(e)}});return!!mp([],vp(n),!1).find((function(){return!0}))}var Jx={selector:"table",preParseHtml:function(e){var t=ph(e);if("table"!==fx(t))return e;var n=t.find("tbody");if(0===n.length)return e;var r=t.find("tr");return t.append(r),n.remove(),t[0]}};function Qx(e){var t,n,r=[],o=e.reduce((function(e,t){return e+t}),0);try{for(var i=gp(e),a=i.next();!a.done;a=i.next()){var s=a.value;r.push(s/o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}var eO=null;var tO=!1,nO=!1,rO=0,oO=0,iO=null,aO=ph(window);aO.on("mousedown",(function(e){var t=e.target;if(t.closest('[data-block-type="table-cell"]'))tO=!0;else if("DIV"===t.tagName&&t.closest(".column-resizer-item")){if(null===iO)return;var n=vp(ap.Editor.nodes(iO,{match:ux(iO,"table")}),1),r=vp(n[0],1)[0],o=r.columnWidths,i=void 0===o?[]:o,a=r.resizingIndex,s=void 0===a?-1:a;nO=!0;var u=e.clientX;rO=u,oO=i[s],document.body.style.cursor="col-resize",e.preventDefault()}aO.on("mousemove",sO),aO.on("mouseup",uO)}));var sO=Ty((function(e){if(nO&&null!==iO){e.preventDefault();var t=e.clientX,n=oO+(t-rO);(n=Math.floor(100*n)/100)<30&&(n=30);var r=vp(ap.Editor.nodes(iO,{match:ux(iO,"table")}),1),o=vp(r[0],1)[0],i=o.columnWidths,a=void 0===i?[]:i,s=o.resizingIndex,u=void 0===s?-1:s,l=a.reduce((function(e,t){return e+t}),0),c=l-a[u],d=document.querySelector(".table-container");d&&n>oO&&c+n>d.clientWidth&&(n=Math.max(30,oO));var f=mp([],vp(a),!1).map((function(e){return Math.floor(e)}));f[u]=n,ap.Transforms.setNodes(iO,{columnWidths:f},{mode:"highest"})}}),100);function uO(e){tO=!1,nO=!1,iO=null,document.body.style.cursor="",aO.off("mousemove",sO),aO.off("mouseup",uO)}function lO(e,t,n,r){if(!e.isDisabled()&&!tO&&!nO){var o=t,i=o.width,a=void 0===i?"auto":i,s=o.columnWidths,u=void 0===s?[]:s,l=o.isHoverCellBorder,c=o.resizingIndex,d=n.clientX,f=n.target;if(Qh(f))if(d>(g=f.getBoundingClientRect()).x+5&&d<g.x+g.width-5)return void(l&&ap.Transforms.setNodes(e,{isHoverCellBorder:!1,resizingIndex:-1},{mode:"highest"}));if(Qh(f)){var p=f.closest(".table");if(p)for(var h=n.clientX,g=p.getBoundingClientRect(),v="100%"===a?Qx(u).map((function(e){return e*r})):u,m=function(e){var t,n,r=[],o=0;try{for(var i=gp(e),a=i.next();!a.done;a=i.next())o+=a.value,r.push(o)}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(v),y=0;y<m.length;y+=1)if(h-g.x>=m[y]-5&&h-g.x<m[y]+5){if(c===y)return;return void ap.Transforms.setNodes(e,{isHoverCellBorder:!0,resizingIndex:y},{mode:"highest"})}}!0===l&&ap.Transforms.setNodes(e,{isHoverCellBorder:!1,resizingIndex:-1},{mode:"highest"})}}function cO(e,t){"mouseenter"===t.type?ap.Transforms.setNodes(e,{isResizing:!0},{mode:"highest"}):ap.Transforms.setNodes(e,{isResizing:!1},{mode:"highest"})}var dO={type:"table",renderElem:function(e,t,n){var r=function(e,t){if(e.isDisabled())return!1;var n=e.selection;if(null==n)return!0;if(ap.Range.isCollapsed(n))return!0;var r=n.anchor,o=n.focus,i=$g.findPath(e,t),a=ap.Editor.start(e,i),s=ap.Editor.end(e,i),u=ap.Point.compare(r,s)<=0&&ap.Point.compare(r,a)>=0,l=ap.Point.compare(o,s)<=0&&ap.Point.compare(o,a)>=0;return!!(u&&l&&ap.Path.equals(r.path.slice(0,3),o.path.slice(0,3)))}(n,e),o=e,i=o.width,a=void 0===i?"auto":i,s=o.height,u=o.columnWidths,l=void 0===u?[]:u,c=o.scrollWidth,d=void 0===c?0:c,f=o.isHoverCellBorder,p=o.resizingIndex,h=o.isResizing,g=$g.isNodeSelected(n,e),v=vp(Ox.selection(n),1)[0],m=Qx(l),y=rb.jsx("div",{className:"table-container","data-selected":g,on:{mousedown:function(t){if("DIV"===t.target.tagName&&t.preventDefault(),!n.isDisabled()){t.target.closest('[data-block-type="table-cell"]')&&Ox.unselect(n);var r=$g.findPath(n,e),o=ap.Editor.start(n,r),i=n.selection;if(null!=i)i.anchor.path[0]!==r[0]&&"DIV"===t.target.tagName&&n.select(o);else n.select(o)}}}},rb.jsx("table",{width:a,contentEditable:r,className:"table ".concat(v?"table-selection-none":""),style:{width:"100%"===a?a:"".concat(l.reduce((function(e,t){return e+t}),0),"px")},on:{mousemove:cm((function(t){return lO(n,e,t,d)}),25)}},rb.jsx("colgroup",{contentEditable:!1},l.map((function(e){return rb.jsx("col",{width:e})}))),rb.jsx("tbody",null,t)),rb.jsx("div",{className:"column-resizer",contentEditable:!1},l.map((function(e,t){var r=e;return"100%"===a&&(r=m[t]*d),rb.jsx("div",{className:"column-resizer-item",style:{minWidth:"".concat(r,"px")}},rb.jsx("div",{className:"resizer-line-hotzone ".concat(f&&t===p?"visible ":"").concat(h&&t===p?"highlight":""),style:{height:"".concat(s,"px")},on:{mouseenter:function(e){return cO(n,e)},mouseleave:function(e){return cO(n,e)},mousedown:function(e){return function(e){nO||(iO=e)}(n)}}},rb.jsx("div",{className:"resizer-line"})))})))),b=rb.h("div",{hook:{insert:function(e){var t=e.elm;return function(e,t){if(Qh(t)){var n=t.querySelector("table");n&&(eO=new ResizeObserver((function(t){var n=vp(t,1)[0].contentRect;ap.Transforms.setNodes(e,{scrollWidth:n.width,height:n.height},{mode:"highest"})})),eO.observe(n))}}(n,t)},destroy:function(){eO&&(null==eO||eO.disconnect(),eO=null)}}},y);return b}},fO={type:"table-row",renderElem:function(e,t,n){return rb.jsx("tr",null,t)}},pO={type:"table-cell",renderElem:function(e,t,n){var r=function(e,t){var n=$g.getParentNode(e,t);if(null==n)return!1;var r=$g.getParentNode(e,n);return null!=r&&Dx(r).some((function(e){return e===t}))}(n,e),o=e,i=o.colSpan,a=void 0===i?1:i,s=o.rowSpan,u=void 0===s?1:s,l=o.isHeader,c=void 0!==l&&l,d=o.hidden,f=void 0!==d&&d,p=Ox.isSelected(n,e);if(!r)return rb.jsx("td",{colSpan:a,rowSpan:u,"data-block-type":"table-cell",className:p?"w-e-selected":"",style:{display:f?"none":""}},t);var h=c?"th":"td";return rb.jsx(h,{colSpan:a,rowSpan:u,"data-block-type":"table-cell",className:p?"w-e-selected":"",style:{display:f?"none":""}},t)}};function hO(e,t){null==e.data&&(e.data={});var n=e.data;null==n.style&&(n.style={}),Object.assign(n.style,t)}var gO={renderStyle:function(e,t){var n,r;if(!ap.Element.isElement(e))return t;var o=e,i=o.backgroundColor,a=o.borderWidth,s=o.borderStyle,u=o.borderColor,l=o.textAlign,c={};i&&(c.backgroundColor=i),a&&(c.borderWidth="".concat(a,"px")),s&&(c.borderStyle="none"===s?"":s),u&&(c.borderColor=u),l&&(c.textAlign=l);var d=t;return"table"===e.type?hO(null===(r=(null===(n=d.children)||void 0===n?void 0:n[0]).children)||void 0===r?void 0:r[0],c):hO(d,c),d},styleToHtml:function(e,t){if("table"!==e.type&&"table-cell"!==e.type)return t;var n=e.backgroundColor,r=e.borderWidth,o=e.borderStyle,i=e.borderColor,a=e.textAlign;if(!(n||r||o||i||a))return t;var s=ph(t);return n&&s.css("background-color",n),r&&s.css("border-width","".concat(r,"px")),o&&s.css("border-style","none"===o?"":o),i&&s.css("border-color",i),a&&s.css("text-align",a),function(e){return 0===e.length?"":e[0].outerHTML}(s)},parseStyleHtml:function(e,t,n){if("TABLE"!==e.tagName&&"TD"!==e.tagName)return t;var r=ph(e),o=t,i=px(r,"background-color");i||(i=px(r,"background")),i&&(o.backgroundColor=i);var a=px(r,"border");a||"TD"!==e.tagName||(a="1px solid ".concat(qx));var s=vp((null==a?void 0:a.split(" "))||[],3),u=s[0],l=s[1],c=s[2];(u=px(r,"border-width")||u)&&(o.borderWidth=u.replace(/[^\d]/g,"")),(l=px(r,"border-style")||l)&&(o.borderStyle="none"===l?"":l),(c=px(r,"border-color")||c)&&(o.borderColor=c);var d=px(r,"text-align");return(d=px(r,"text-align")||d)&&(o.textAlign=d),t},renderElems:[dO,fO,pO],elemsToHtml:[rx,ox,ix],preParseHtml:[Jx],parseElemsHtml:[Ux,Vx,Wx],menus:[kx,Fx,Px,Ix,Rx,Lx,_x,Mx,jx,Hx,zx,$x],editorPlugin:function(e){var t=e.insertBreak,n=e.deleteBackward,r=e.deleteForward,o=e.deleteFragment,i=e.normalizeNode,a=e.insertData,s=e.handleTab,u=e.selectAll,l=e;return l.insertBreak=function(){null==$g.getSelectedNodeByType(l,"table")?t():l.insertText("\n\r")},l.deleteBackward=function(e){if(!Kx(l)&&!Xx(l,e,"backward")){var t=l.selection;if(t){var r=ap.Editor.before(l,t),o=ap.Editor.above(l,{at:t,match:function(e){return $g.checkNodeType(e,"table-cell")}});if(r){var i=Zx(l,r);if(!o&&i&&$g.getSelectedNodeByType(l,"paragraph"))return}}n(e)}},l.handleTab=function(){var t;if($g.getSelectedNodeByType(l,"table")){var n=ap.Editor.above(e);$g.checkNodeType(n[0],"table-cell")&&ap.Transforms.select(e,n[1]);var r=ap.Editor.next(e);if(r)r[0]&&r[0].text&&(r=null!==(t=ap.Editor.above(e,{at:r[1]}))&&void 0!==t?t:r),ap.Transforms.select(e,r[1]);else{var o=l.children||[],i=o.length;if($g.checkNodeType(o[i-1],"table")){var a=$g.genEmptyParagraph();ap.Transforms.insertNodes(l,a,{at:[i]}),l.handleTab()}}}else s()},l.deleteForward=function(e){if(!Kx(l)&&!Xx(l,e,"forward")){var t=l.selection;if(t){var n=ap.Editor.after(l,t),o=ap.Editor.above(l,{at:t,match:function(e){return $g.checkNodeType(e,"table-cell")}});if(n){var i=Zx(l,n);if(!o&&i&&$g.getSelectedNodeByType(l,"paragraph"))return}}r(e)}},l.deleteFragment=function(e){var t=l.selection;if(t){var n,r=!1,i={anchor:t.anchor,focus:t.focus},a=ap.Point.isBefore(i.anchor,i.focus);if(Yx(l,t.anchor))(n=ap.Editor[a?"before":"after"](l,t.anchor))&&(i.anchor=n),r=!0;if(Yx(l,t.focus))(n=ap.Editor[a?"after":"before"](l,t.focus))&&(i.focus=n),r=!0;r&&ap.Transforms.setSelection(l,i),o(e)}},l.normalizeNode=function(e){var t=vp(e,2),n=t[0],r=t[1];if("table"!==$g.getNodeType(n))return i([n,r]);if($g.isLastNode(l,n)){var o=$g.genEmptyParagraph();ap.Transforms.insertNodes(l,o,{at:[r[0]+1]})}},l.insertData=function(e){if(null!=$g.getSelectedNodeByType(l,"table")){var t=e.getData("text/plain");"\n"===t||/<img[^>]+>/.test(e.getData("text/html"))?a(e):ap.Editor.insertText(l,t)}else a(e)},l.selectAll=function(){var e=l.selection;if(null!=e){var t=$g.getSelectedNodeByType(l,"table-cell");if(null!=t){var n=e.anchor,r=e.focus;if(ap.Path.equals(n.path.slice(0,3),r.path.slice(0,3)))if(0!==ap.Node.string(t).length){var o=$g.findPath(l,t),i={anchor:ap.Editor.start(l,o),focus:ap.Editor.end(l,o)};l.select(i)}else u();else u()}else u()}else u()},function(e){var t=e.apply;e.apply=function(n){if(!ap.Operation.isSelectionOperation(n)||!n.newProperties)return t(n);var r=fp(fp({},e.selection),n.newProperties);if(!ap.Range.isRange(r))return Ox.unselect(e),t(n);var o=vp(ap.Editor.nodes(e,{match:ux(e,"th","td"),at:ap.Range.start(r)}),1)[0],i=vp(ap.Editor.nodes(e,{match:ux(e,"th","td"),at:ap.Range.end(r)}),1)[0];if(!o||!i)return Ox.unselect(e),t(n);var a=vp(o,2)[1],s=vp(i,2)[1];if(ap.Path.equals(a,s)||!lx(e,[a,s],"table"))return Ox.unselect(e),t(n);for(var u=cx(e,{at:a}),l=dx.valueOf(0,0),c=dx.valueOf(0,0),d=0;d<u.length;d+=1)for(var f=0;f<u[d].length;f+=1){var p=vp(u[d][f],1),h=vp(p[0],2)[1];if(ap.Path.equals(a,h)&&(l.x=d,l.y=f),ap.Path.equals(s,h)){c.x=d,c.y=f;break}}for(var g=dx.valueOf(Math.min(l.x,c.x),Math.min(l.y,c.y)),v=dx.valueOf(Math.max(l.x,c.x),Math.max(l.y,c.y));;){var m=dx.valueOf(g.x,g.y),y=dx.valueOf(v.x,v.y);for(d=m.x;d<=y.x;d+=1)for(f=m.y;f<=y.y;f+=1){var b=vp(u[d][f],2)[1],E=b.rtl,C=b.ltr,D=b.btt,w=b.ttb;m.x=Math.min(m.x,d-(w-1)),m.y=Math.min(m.y,f-(E-1)),y.x=Math.max(y.x,d+(D-1)),y.y=Math.max(y.y,f+(C-1))}if(dx.equals(g,m)&&dx.equals(v,y))break;g=m,v=y}var A=[],S=new WeakSet;for(d=g.x;d<=v.x;d+=1){var x=[];for(f=g.y;f<=v.y;f+=1){var O=vp(u[d][f],1),T=vp(O[0],1)[0];S.add(T),x.push(u[d][f])}A.push(x)}hx.set(e,A),gx.set(e,S),t(n)}}(l),l}};function vO(e){return e.length?e[0].tagName.toLowerCase():""}function mO(e,t,n,r){void 0===t&&(t="auto"),void 0===n&&(n="auto"),void 0===r&&(r={});var o=ph(e),i=r.width,a=void 0===i?"":i,s=r.height,u=void 0===s?"":s,l="";return a&&(l+="width: ".concat(a,";")),u&&(l+="height: ".concat(u,";")),o.attr("width",t),o.attr("height",n),o.attr("style",l),o[0].outerHTML}ty("en",{videoModule:{delete:"Delete",uploadVideo:"Upload video",insertVideo:"Insert video",videoSrc:"Video source",videoSrcPlaceHolder:"Video file url, or third-party <iframe>",videoPoster:"Video poster",videoPosterPlaceHolder:"Poster image url",ok:"Ok",editSize:"Edit size",edit:"Edit video",width:"Width",height:"Height"}}),ty("zh-CN",{videoModule:{delete:"删除视频",uploadVideo:"上传视频",insertVideo:"插入视频",videoSrc:"视频地址",videoSrcPlaceHolder:"视频文件 url 或第三方 <iframe>",videoPoster:"视频封面",videoPosterPlaceHolder:"封面图片 url",ok:"确定",editSize:"修改尺寸",edit:"编辑视频",width:"宽度",height:"高度"}}),Rh&&(ph.fn.append=Rh),Dh&&(ph.fn.on=Dh),Wh&&(ph.fn.focus=Wh),mh&&(ph.fn.attr=mh),Ch&&(ph.fn.val=Ch),Fh&&(ph.fn.html=Fh),_h&&(ph.fn.parent=_h),vh&&(ph.fn.hasClass=vh),$h&&(ph.fn.empty=$h);var yO={type:"video",elemToHtml:function(e,t){var n=e,r=n.src,o=void 0===r?"":r,i=n.poster,a=void 0===i?"":i,s=n.width,u=void 0===s?"auto":s,l=n.height,c=void 0===l?"auto":l,d=n.style,f=void 0===d?{}:d,p=n.textAlign,h='<div data-w-e-type="video" data-w-e-is-void style="text-align: '.concat(void 0===p?"center":p,';">\n');if(0===o.trim().indexOf("<iframe ")){h+=mO(o,u,c,f)}else{var g=f.width,v=void 0===g?"":g,m=f.height,y=void 0===m?"":m,b="";v&&(b+="width: ".concat(v,";")),y&&(b+="height: ".concat(y,";")),h+='<video poster="'.concat(a,'" controls="true" width="').concat(u,'" height="').concat(c,'" style="').concat(b,'"><source src="').concat(o,'" type="video/mp4"/></video>')}return h+="\n</div>"}};function bO(e){return void 0===e&&(e="r"),"".concat(e,"-").concat(Kh())}function EO(e){var t={};return e.trim().split(";").forEach((function(e){if(e){var n=vp(e.split(":"),2),r=n[0],o=n[1];r&&o&&(t[r.trim()]=o.trim())}})),t}function CO(){return bO("w-e-insert-video")}var DO=function(){function e(){this.title=ry("videoModule.editSize"),this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=CO(),this.heightInputId=CO(),this.buttonId=CO()}return e.prototype.getSelectedVideoNode=function(e){return $g.getSelectedNodeByType(e,"video")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedVideoNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedVideoNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=t.widthInputId,r=t.heightInputId,o=t.buttonId,i=vp(hy(ry("videoModule.width"),n,"auto"),2),a=i[0],s=ph(i[1]),u=vp(hy(ry("videoModule.height"),r,"auto"),2),l=u[0],c=ph(u[1]),d=vp(gy(o,ry("videoModule.ok")),1)[0],f=this.getSelectedVideoNode(e);if(null==this.$content){var p=ph("<div></div>");p.on("click","#".concat(o),(function(t){t.preventDefault();var o=p.find("#".concat(n)).val().trim(),i=p.find("#".concat(r)).val().trim(),a=function(e){return/^\d+(\.\d+)?%$/.test(e)},s=function(e){return/^\d+(\.\d+)?$/.test(e)},u="auto",l="auto";a(o)?u=o:s(o)&&(u="".concat(parseInt(o,10),"px")),a(i)?l=i:s(i)&&(l="".concat(parseInt(i,10),"px"));var c=f.style,d=void 0===c?{}:c;e.restoreSelection();var h={style:fp(fp({},d),{width:u,height:l})};ap.Transforms.setNodes(e,h,{match:function(e){return $g.checkNodeType(e,"video")}}),e.hidePanelOrModal()})),this.$content=p}var h=this.$content;if(h.empty(),h.append(a),h.append(l),h.append(d),null==f)return h[0];var g=f.style,v=void 0===g?{}:g,m=v.width,y=void 0===m?"":m,b=v.height,E=void 0===b?"":b;return s.val(y),c.val(E),setTimeout((function(){s.focus()})),h[0]},e}();function wO(){return bO("w-e-edit-video")}var AO=function(){function e(){this.title=ry("videoModule.edit"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=wO(),this.posterInputId=wO(),this.buttonId=wO()}return e.prototype.getSelectedVideoNode=function(e){return $g.getSelectedNodeByType(e,"video")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedVideoNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedVideoNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.posterInputId,i=n.buttonId,a=vp(hy(ry("videoModule.videoSrc"),r,ry("videoModule.videoSrcPlaceHolder")),2),s=a[0],u=a[1],l=vp(hy(ry("videoModule.videoPoster"),o,ry("videoModule.videoPosterPlaceHolder")),2),c=l[0],d=l[1],f=ph(u),p=ph(d),h=vp(gy(i,ry("videoModule.ok")),1)[0];if(null==this.$content){var g=ph("<div></div>");g.on("click","#".concat(i),(function(n){return pp(t,void 0,void 0,(function(){var t,i,a,s;return hp(this,(function(u){return n.preventDefault(),t=g.find("#".concat(r)).val().trim(),i=g.find("#".concat(o)).val().trim(),a=bO("video-"),s={src:t,poster:i,key:a},e.restoreSelection(),ap.Transforms.setNodes(e,s,{match:function(e){return $g.checkNodeType(e,"video")}}),e.hidePanelOrModal(),[2]}))}))})),this.$content=g}var v=this.$content;v.empty(),v.append(s),v.append(c),v.append(h);var m=this.getSelectedVideoNode(e);if(null==m)return v[0];var y=m.src,b=void 0===y?"":y,E=m.poster,C=void 0===E?"":E;return f.val(b),p.val(C),setTimeout((function(){f.focus()})),v[0]},e}();function SO(e,t){return pp(this,arguments,void 0,(function(e,t,n,r,o){var i,a,s,u,l,c,d;return void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o=""),hp(this,(function(f){switch(f.label){case 0:return t?(e.restoreSelection(),i=e.getMenuConfig("insertVideo"),a=i.onInsertedVideo,s=i.checkVideo,u=i.parseVideoSrc,[4,s(t,n)]):[2];case 1:return"string"==typeof(l=f.sent())?(e.alert(l,"error"),[2]):null==l?[2]:[4,u(t)];case 2:return 0!==(c=f.sent()).trim().indexOf("<iframe ")&&(c=function(e){return e.replace(/</g,"<").replace(/>/g,">")}(c)),d={type:"video",src:c,poster:n,children:[{text:""}],style:{width:r,height:o}},Promise.resolve().then((function(){$g.isSelectedEmptyParagraph(e)&&ap.Transforms.removeNodes(e,{mode:"highest"}),ap.Transforms.insertNodes(e,d,{mode:"highest"})})),a(d),[2]}}))}))}function xO(){return bO("w-e-insert-video")}var OO=function(){function e(){this.title=ry("videoModule.insertVideo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.srcInputId=xO(),this.posterInputId=xO(),this.buttonId=xO()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||!!$g.getSelectedElems(e).some((function(t){var n=$g.getNodeType(t);return"pre"===n||("list-item"===n||!!e.isVoid(t))})))},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.posterInputId,i=n.buttonId,a=vp(hy(ry("videoModule.videoSrc"),r,ry("videoModule.videoSrcPlaceHolder")),2),s=a[0],u=a[1],l=vp(hy(ry("videoModule.videoPoster"),o,ry("videoModule.videoPosterPlaceHolder")),2),c=l[0],d=l[1],f=ph(u),p=ph(d),h=vp(gy(i,ry("videoModule.ok")),1)[0];if(null==this.$content){var g=ph("<div></div>");g.on("click","#".concat(i),(function(n){return pp(t,void 0,void 0,(function(){var t,i;return hp(this,(function(a){switch(a.label){case 0:return n.preventDefault(),t=g.find("#".concat(r)).val().trim(),i=g.find("#".concat(o)).val().trim(),[4,SO(e,t,i)];case 1:return a.sent(),e.hidePanelOrModal(),[2]}}))}))})),this.$content=g}var v=this.$content;return v.empty(),v.append(s),v.append(c),v.append(h),f.val(""),p.val(""),setTimeout((function(){f.focus()})),v[0]},e}();function TO(e){return e.getMenuConfig("uploadVideo")}var NO=new WeakMap;function BO(e,t){return pp(this,void 0,void 0,(function(){var n,r;return hp(this,(function(o){switch(o.label){case 0:return n=function(e){var t=NO.get(e);if(null!=t)return t;var n=TO(e),r=n.onSuccess,o=n.onProgress,i=n.onFailed,a=n.customInsert,s=n.onError;return t=vD(fp(fp({},n),{onProgress:function(t){e.showProgressBar(t),o&&o(t)},onSuccess:function(t,n){if(a)return a(n,(function(t,n){return SO(e,t,n)})),void r(t,n);var o=n.errno,s=void 0===o?1:o,u=n.data,l=void 0===u?{}:u;if(0===s){var c=l.url,d=void 0===c?"":c,f=l.poster;SO(e,d,void 0===f?"":f),r(t,n)}else i(t,n)},onError:function(e,t,n){s(e,t,n)}})),NO.set(e,t),t}(e),r=t.map((function(e){return{name:e.name,type:e.type,size:e.size,data:e}})),n.addFiles(r),[4,n.upload()];case 1:return o.sent(),[2]}}))}))}var kO=function(){function e(){this.title=ry("videoModule.uploadVideo"),this.iconSvg='<svg viewBox="0 0 1056 1024"><path d="M805.902261 521.819882a251.441452 251.441452 0 0 0-251.011972 246.600033 251.051015 251.051015 0 1 0 502.023944 8.823877 253.237463 253.237463 0 0 0-251.011972-255.42391z m59.463561 240.001647v129.898403h-116.701631v-129.898403h-44.041298l101.279368-103.504859 101.279368 103.504859z" p-id="6802"></path><path d="M788.254507 0.000781H99.094092A98.663439 98.663439 0 0 0 0.001171 99.093701v590.067495a98.663439 98.663439 0 0 0 99.092921 99.092921h411.7549a266.434235 266.434235 0 0 1-2.186448-41.815807 275.843767 275.843767 0 0 1 275.180024-270.729042 270.650955 270.650955 0 0 1 103.504859 19.834201V99.093701A101.51363 101.51363 0 0 0 788.254507 0.000781zM295.054441 640.747004V147.507894l394.146189 246.600033z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){var n=this.getMenuConfig(e),r=n.allowedFileTypes,o=void 0===r?[]:r,i=n.customBrowseAndUpload;if(i)i((function(t,n){return SO(e,t,n)}));else{var a="";o.length>0&&(a='accept="'.concat(o.join(", "),'"'));var s=ph("body"),u=ph('<input type="file" '.concat(a," multiple/>"));u.hide(),s.append(u),u.click(),u.on("change",(function(){var t=u[0].files;!function(e,t){pp(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,l,c,d,f,p;return hp(this,(function(h){switch(h.label){case 0:if(null==t)return[2];n=Array.prototype.slice.call(t),r=[],o=TO(e).customUpload,h.label=1;case 1:h.trys.push([1,8,9,14]),i=!0,a=yp(n),h.label=2;case 2:return[4,a.next()];case 3:return s=h.sent(),(c=s.done)?[3,7]:(p=s.value,i=!1,u=p,o?[4,o(u,(function(t,n){return SO(e,t,n)}))]:[3,5]);case 4:return h.sent(),[3,6];case 5:r.push(u),h.label=6;case 6:return i=!0,[3,2];case 7:return[3,14];case 8:return l=h.sent(),d={error:l},[3,14];case 9:return h.trys.push([9,,12,13]),i||c||!(f=a.return)?[3,11]:[4,f.call(a)];case 10:h.sent(),h.label=11;case 11:return[3,13];case 12:if(d)throw d.error;return[7];case 13:return[7];case 14:return r.length>0?[4,BO(e,r)]:[3,16];case 15:h.sent(),h.label=16;case 16:return[2]}}))}))}(e,t)}))}},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!ap.Range.isCollapsed(t)||!!$g.getSelectedElems(e).some((function(t){var n=$g.getNodeType(t);return"pre"===n||("list-item"===n||!!e.isVoid(t))})))},e.prototype.getMenuConfig=function(e){return e.getMenuConfig("uploadVideo")},e}();function FO(e,t,n,r,o,i){return void 0===t&&(t=""),void 0===n&&(n="auto"),void 0===r&&(r="auto"),void 0===o&&(o={}),void 0===i&&(i="center"),{type:"video",src:e,poster:t,width:n,height:r,style:o,children:[{text:""}],textAlign:i}}var PO={selector:'div[data-w-e-type="video"]',parseElemHtml:function(e,t,n){var r=ph(e),o="",i="",a="auto",s="auto",u={},l=r.find("iframe");if(l.length>0)return a=l.attr("width")||"auto",s=l.attr("height")||"auto",u=EO(u=l.attr("style")||""),FO(o=l[0].outerHTML,i,a,s,u,EO(r.attr("style")||"")["text-align"]||"center");var c=r.find("video");return(o=c.attr("src")||"")||c.length>0&&(o=c.find("source").attr("src")||""),a=c.attr("width")||"auto",s=c.attr("height")||"auto",FO(o,i=c.attr("poster")||"",a,s,u=EO(u=c.attr("style")||""),EO(r.attr("style")||"")["text-align"]||"center")}};var IO={selector:"iframe,video,p",preParseHtml:function(e){var t=ph(e),n=t;if("p"===vO(t)){var r=t.children();if(1===r.length){var o=r[0],i=o.tagName.toLowerCase();["iframe","video"].includes(i)&&(n=ph(o))}}var a=vO(n);if("iframe"!==a&&"video"!==a)return n[0];if("video"===n.parent().attr("data-w-e-type"))return n[0];var s=ph('<div data-w-e-type="video" data-w-e-is-void style="text-align: center;"></div>');return s.append(n),s[0]}};var RO={type:"video",renderElem:function(e,t,n){var r,o=e,i=o.src,a=void 0===i?"":i,s=o.poster,u=void 0===s?"":s,l=o.key,c=void 0===l?"":l,d=o.width,f=void 0===d?"auto":d,p=o.height,h=void 0===p?"auto":p,g=o.style,v=void 0===g?{}:g,m=o.textAlign,y=void 0===m?"center":m,b=$g.isNodeSelected(n,e);if(0===a.trim().indexOf("<iframe ")){var E=mO(a,f,h,v);r=rb.jsx("div",{className:"w-e-textarea-video-container","data-selected":b?"true":"",style:{textAlign:y},innerHTML:E})}else{var C=rb.jsx("video",{key:c,poster:u,controls:!0,style:v},rb.jsx("source",{src:a,type:"video/mp4"}),"Sorry, your browser doesn't support embedded videos.\n 抱歉,浏览器不支持 video 视频");"auto"!==f&&(C.data.width=f),"auto"!==h&&(C.data.height=h),r=rb.jsx("div",{className:"w-e-textarea-video-container","data-selected":b?"true":"",style:{textAlign:y}},C)}var D=rb.h("div",{props:{contentEditable:!1},on:{mousedown:function(e){return e.preventDefault()}}},r);return D}},LO={renderElems:[RO],elemsToHtml:[yO],preParseHtml:[IO],parseElemsHtml:[PO],menus:[{key:"insertVideo",factory:function(){return new OO},config:{onInsertedVideo:function(e){},checkVideo:function(e,t){return!0},parseVideoSrc:function(e){return e}}},{key:"uploadVideo",factory:function(){return new kO},config:{server:"",fieldName:"wangeditor-uploaded-video",maxFileSize:10485760,maxNumberOfFiles:5,allowedFileTypes:["video/*"],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:3e4,onBeforeUpload:function(e){return e},onProgress:function(e){},onSuccess:function(e,t){},onFailed:function(e,t){console.error("'".concat(e.name,"' upload failed"),t)},onError:function(e,t,n){console.error("'".concat(e.name," upload error"),t,n)}}},{key:"editVideoSize",factory:function(){return new DO}},{key:"editVideoSrc",factory:function(){return new AO}}],editorPlugin:function(e){var t=e.isVoid,n=e.normalizeNode,r=e;return r.isVoid=function(e){return"video"===e.type||t(e)},r.normalizeNode=function(e){var t=vp(e,2),o=t[0],i=t[1];"video"===$g.getNodeType(o)&&($g.isLastNode(r,o)&&ap.Transforms.insertNodes(r,$g.genEmptyParagraph(),{at:[i[0]+1]}));return n([o,i])},r}};ty("en",{uploadImgModule:{uploadImage:"Upload Image",uploadError:"{{fileName}} upload error"}}),ty("zh-CN",{uploadImgModule:{uploadImage:"上传图片",uploadError:"{{fileName}} 上传出错"}});Rh&&(ph.fn.append=Rh),Dh&&(ph.fn.on=Dh),zh&&(ph.fn.remove=zh),Ch&&(ph.fn.val=Ch),Gh&&(ph.fn.click=Gh),Oh&&(ph.fn.hide=Oh);var _O=new WeakMap;function MO(e){return e.getMenuConfig("uploadImage")}function jO(e,t){return pp(this,void 0,void 0,(function(){return hp(this,(function(n){return[2,new Promise((function(n){var r=new FileReader;r.readAsDataURL(t),r.onload=function(){var o=r.result;if(o){var i=o.toString(),a=0===i.indexOf("data:image")?"":i;vA(e,i,t.name,a),n("ok")}}}))]}))}))}function HO(e,t){return pp(this,void 0,void 0,(function(){var n,r;return hp(this,(function(o){switch(o.label){case 0:return n=function(e){var t=_O.get(e);if(null!=t)return t;var n=MO(e),r=n.onSuccess,o=n.onProgress,i=n.onFailed,a=n.customInsert,s=n.onError;return t=vD(fp(fp({},n),{onProgress:function(t){e.showProgressBar(t),o&&o(t)},onSuccess:function(t,n){if(a)return a(n,(function(t,n,r){return vA(e,t,n,r)})),void r(t,n);var o=n.errno,s=void 0===o?1:o,u=n.data,l=void 0===u?{}:u;if(0===s){if(Array.isArray(l))l.forEach((function(t){var n=t.url,r=void 0===n?"":n,o=t.alt,i=void 0===o?"":o,a=t.href;vA(e,r,i,void 0===a?"":a)}));else{var c=l.url,d=void 0===c?"":c,f=l.alt,p=void 0===f?"":f,h=l.href;vA(e,d,p,void 0===h?"":h)}r(t,n)}else i(t,n)},onError:function(e,t,n){s(e,t,n)}})),_O.set(e,t),t}(e),r=t.map((function(e){return{name:e.name,type:e.type,size:e.size,data:e}})),n.addFiles(r),[4,n.upload()];case 1:return o.sent(),[2]}}))}))}function zO(e,t){return pp(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,l,c,d,f,p,h,g,v;return hp(this,(function(m){switch(m.label){case 0:if(null==t)return[2];n=Array.prototype.slice.call(t),r=MO(e),o=r.customUpload,i=r.base64LimitSize,a=[],m.label=1;case 1:m.trys.push([1,10,11,16]),s=!0,u=yp(n),m.label=2;case 2:return[4,u.next()];case 3:return l=m.sent(),(p=l.done)?[3,9]:(v=l.value,s=!1,d=(c=v).size,i&&d<=i?[4,jO(e,c)]:[3,5]);case 4:return m.sent(),[3,8];case 5:return o?[4,o(c,(function(t,n,r){return vA(e,t,n,r)}))]:[3,7];case 6:return m.sent(),[3,8];case 7:a.push(c),m.label=8;case 8:return s=!0,[3,2];case 9:return[3,16];case 10:return f=m.sent(),h={error:f},[3,16];case 11:return m.trys.push([11,,14,15]),s||p||!(g=u.return)?[3,13]:[4,g.call(u)];case 12:m.sent(),m.label=13;case 13:return[3,15];case 14:if(h)throw h.error;return[7];case 15:return[7];case 16:return a.length>0?[4,HO(e,a)]:[3,18];case 17:m.sent(),m.label=18;case 18:return[2]}}))}))}var $O=function(){function e(){this.title=ry("uploadImgModule.uploadImage"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M828.708571 585.045333a48.761905 48.761905 0 0 0-48.737523 48.761905v18.529524l-72.143238-72.167619a135.972571 135.972571 0 0 0-191.585524 0l-34.133334 34.133333-120.880762-120.953905a138.898286 138.898286 0 0 0-191.585523 0l-72.167619 72.167619V292.400762a48.786286 48.786286 0 0 1 48.761904-48.761905h341.23581a48.737524 48.737524 0 0 0 34.474667-83.285333 48.737524 48.737524 0 0 0-34.474667-14.287238H146.236952A146.212571 146.212571 0 0 0 0 292.400762v585.289143A146.358857 146.358857 0 0 0 146.236952 1024h584.996572a146.212571 146.212571 0 0 0 146.236952-146.310095V633.807238a48.786286 48.786286 0 0 0-48.761905-48.761905zM146.261333 926.45181a48.737524 48.737524 0 0 1-48.761904-48.761905v-174.128762l141.409523-141.458286a38.497524 38.497524 0 0 1 53.126096 0l154.526476 154.624 209.627428 209.724953H146.236952z m633.734096-48.761905c-0.073143 9.337905-3.145143 18.383238-8.777143 25.843809l-219.843048-220.94019 34.133333-34.133334a37.546667 37.546667 0 0 1 53.613715 0l140.873143 141.897143V877.714286zM1009.615238 160.231619L863.329524 13.897143a48.737524 48.737524 0 0 0-16.091429-10.24c-11.849143-4.87619-25.161143-4.87619-37.059047 0a48.761905 48.761905 0 0 0-16.067048 10.24l-146.236952 146.334476a49.005714 49.005714 0 0 0 69.217523 69.241905l62.902858-63.390476v272.627809a48.761905 48.761905 0 1 0 97.475047 0V166.083048l62.902857 63.390476a48.737524 48.737524 0 0 0 69.217524 0 48.761905 48.761905 0 0 0 0-69.241905z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return pA(e)},e.prototype.getMenuConfig=function(e){return e.getMenuConfig("uploadImage")},e.prototype.exec=function(e,t){var n=this.getMenuConfig(e),r=n.allowedFileTypes,o=void 0===r?[]:r,i=n.customBrowseAndUpload;if(i)i((function(t,n,r){return vA(e,t,n,r)}));else{var a="";o.length>0&&(a='accept="'.concat(o.join(", "),'"'));var s=ph("body"),u=ph('<input type="file" '.concat(a," multiple/>"));u.hide(),s.append(u),u.click(),u.on("change",(function(){var t=u[0].files;zO(e,t)}))}},e}();var UO={menus:[{key:"uploadImage",factory:function(){return new $O},config:{server:"",fieldName:"wangeditor-uploaded-image",maxFileSize:2097152,maxNumberOfFiles:100,allowedFileTypes:["image/*"],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:1e4,onBeforeUpload:function(e){return e},onProgress:function(e){},onSuccess:function(e,t){},onFailed:function(e,t){console.error("'".concat(e.name,"' upload failed"),t)},onError:function(e,t,n){console.error("'".concat(e.name,"' upload error"),n)},base64LimitSize:0}}],editorPlugin:function(e){var t=e.insertData,n=e;return n.insertData=function(r){if(pA(n))t(r);else if(r.getData("text/plain"))t(r);else{var o=r.files;if(o.length<=0)t(r);else Array.prototype.slice.call(o).some((function(e){return"image"===vp(e.type.split("/"),1)[0]}))?zO(e,o):t(r)}},n}};ty("en",{highLightModule:{selectLang:"Language"}}),ty("zh-CN",{highLightModule:{selectLang:"选择语言"}});var VO,GO={exports:{}};var WO=(VO||(VO=1,function(e){var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},o.util.type(t)){case"Object":if(i=o.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=o.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach((function(t,o){r[o]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var o=e.classList;if(o.contains(t))return!0;if(o.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=o.util.clone(o.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||o.languages)[e],a={};for(var s in i)if(i.hasOwnProperty(s)){if(s==t)for(var u in n)n.hasOwnProperty(u)&&(a[u]=n[u]);n.hasOwnProperty(s)||(a[s]=i[s])}var l=r[e];return r[e]=a,o.languages.DFS(o.languages,(function(t,n){n===l&&t!=e&&(this[t]=a)})),a},DFS:function e(t,n,r,i){i=i||{};var a=o.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var u=t[s],l=o.util.type(u);"Object"!==l||i[a(u)]?"Array"!==l||i[a(u)]||(i[a(u)]=!0,e(u,n,s,i)):(i[a(u)]=!0,e(u,n,null,i))}}},plugins:{},highlightAll:function(e,t){o.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),o.hooks.run("before-all-elements-highlight",r);for(var i,a=0;i=r.elements[a++];)o.highlightElement(i,!0===t,r.callback)},highlightElement:function(t,n,r){var i=o.util.getLanguage(t),a=o.languages[i];o.util.setLanguage(t,i);var s=t.parentElement;s&&"pre"===s.nodeName.toLowerCase()&&o.util.setLanguage(s,i);var u={element:t,language:i,grammar:a,code:t.textContent};function l(e){u.highlightedCode=e,o.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,o.hooks.run("after-highlight",u),o.hooks.run("complete",u),r&&r.call(u.element)}if(o.hooks.run("before-sanity-check",u),(s=u.element.parentElement)&&"pre"===s.nodeName.toLowerCase()&&!s.hasAttribute("tabindex")&&s.setAttribute("tabindex","0"),!u.code)return o.hooks.run("complete",u),void(r&&r.call(u.element));if(o.hooks.run("before-highlight",u),u.grammar)if(n&&e.Worker){var c=new Worker(o.filename);c.onmessage=function(e){l(e.data)},c.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else l(o.highlight(u.code,u.grammar,u.language));else l(o.util.encode(u.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(o.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=o.tokenize(r.code,r.grammar),o.hooks.run("after-tokenize",r),i.stringify(o.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new u;return l(o,o.head,e),s(e,o,t,o.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=o.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=o.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function a(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function s(e,t,n,r,u,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var h=0;h<p.length;++h){if(d&&d.cause==f+","+h)return;var g=p[h],v=g.inside,m=!!g.lookbehind,y=!!g.greedy,b=g.alias;if(y&&!g.pattern.global){var E=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,E+"g")}for(var C=g.pattern||g,D=r.next,w=u;D!==t.tail&&!(d&&w>=d.reach);w+=D.value.length,D=D.next){var A=D.value;if(t.length>e.length)return;if(!(A instanceof i)){var S,x=1;if(y){if(!(S=a(C,w,e,m))||S.index>=e.length)break;var O=S.index,T=S.index+S[0].length,N=w;for(N+=D.value.length;O>=N;)N+=(D=D.next).value.length;if(w=N-=D.value.length,D.value instanceof i)continue;for(var B=D;B!==t.tail&&(N<T||"string"==typeof B.value);B=B.next)x++,N+=B.value.length;x--,A=e.slice(w,N),S.index-=w}else if(!(S=a(C,0,A,m)))continue;O=S.index;var k=S[0],F=A.slice(0,O),P=A.slice(O+k.length),I=w+A.length;d&&I>d.reach&&(d.reach=I);var R=D.prev;if(F&&(R=l(t,R,F),w+=F.length),c(t,R,x),D=l(t,R,new i(f,v?o.tokenize(k,v):k,b,k)),P&&l(t,D,P),x>1){var L={cause:f+","+h,reach:I};s(e,t,n,D.prev,w,L),d&&L.reach>d.reach&&(d.reach=L.reach)}}}}}}function u(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function c(e,t,n){for(var r=t.next,o=0;o<n&&r!==e.tail;o++)r=r.next;t.next=r,r.prev=t,e.length-=o}if(e.Prism=o,i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var i={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},a=t.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(i.classes,a):i.classes.push(a)),o.hooks.run("wrap",i);var s="";for(var u in i.attributes)s+=" "+u+'="'+(i.attributes[u]||"").replace(/"/g,""")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+s+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,a=n.immediateClose;e.postMessage(o.highlight(i,o.languages[r],r)),a&&e.close()}),!1),o):o;var d=o.util.currentScript();function f(){o.manual||o.highlightAll()}if(d&&(o.filename=d.src,d.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});
|
|
20
20
|
/**
|
|
21
21
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
22
22
|
*
|