@zipify/wysiwyg 4.3.0 → 4.4.0-dev.1

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/cli.js CHANGED
@@ -1,24 +1,61 @@
1
- "use strict";var t=require("events"),e=require("child_process"),n=require("path"),r=require("fs"),o=require("process"),i=require("jsdom"),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a={},l={},c={};let u=class extends Error{constructor(t,e,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}};c.CommanderError=u,c.InvalidArgumentError=class extends u{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};const{InvalidArgumentError:h}=c;l.Argument=class{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?e.concat(t):[t]}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{if(!this.argChoices.includes(t))throw new h(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,e):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},l.humanReadableArgName=function(t){const e=t.name()+(!0===t.variadic?"...":"");return t.required?"<"+e+">":"["+e+"]"};var p={},d={};const{humanReadableArgName:f}=l;d.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(t){const e=t.commands.filter((t=>!t._hidden)),n=t._getHelpCommand();return n&&!n._hidden&&e.push(n),this.sortSubcommands&&e.sort(((t,e)=>t.name().localeCompare(e.name()))),e}compareOptions(t,e){const n=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");return n(t).localeCompare(n(e))}visibleOptions(t){const e=t.options.filter((t=>!t.hidden)),n=t._getHelpOption();if(n&&!n.hidden){const r=n.short&&t._findOption(n.short),o=n.long&&t._findOption(n.long);r||o?n.long&&!o?e.push(t.createOption(n.long,n.description)):n.short&&!r&&e.push(t.createOption(n.short,n.description)):e.push(n)}return this.sortOptions&&e.sort(this.compareOptions),e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];const e=[];for(let n=t.parent;n;n=n.parent){const t=n.options.filter((t=>!t.hidden));e.push(...t)}return this.sortOptions&&e.sort(this.compareOptions),e}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach((e=>{e.description=e.description||t._argsDescription[e.name()]||""})),t.registeredArguments.find((t=>t.description))?t.registeredArguments:[]}subcommandTerm(t){const e=t.registeredArguments.map((t=>f(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce(((t,n)=>Math.max(t,e.subcommandTerm(n).length)),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce(((t,n)=>Math.max(t,e.optionTerm(n).length)),0)}longestGlobalOptionTermLength(t,e){return e.visibleGlobalOptions(t).reduce(((t,n)=>Math.max(t,e.optionTerm(n).length)),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce(((t,n)=>Math.max(t,e.argumentTerm(n).length)),0)}commandUsage(t){let e=t._name;t._aliases[0]&&(e=e+"|"+t._aliases[0]);let n="";for(let e=t.parent;e;e=e.parent)n=e.name()+" "+n;return n+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`),void 0!==t.defaultValue){(t.required||t.optional||t.isBoolean()&&"boolean"==typeof t.defaultValue)&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}return void 0!==t.presetArg&&t.optional&&e.push(`preset: ${JSON.stringify(t.presetArg)}`),void 0!==t.envVar&&e.push(`env: ${t.envVar}`),e.length>0?`${t.description} (${e.join(", ")})`:t.description}argumentDescription(t){const e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`),void 0!==t.defaultValue&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){const n=`(${e.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatHelp(t,e){const n=e.padWidth(t,e),r=e.helpWidth||80;function o(t,o){if(o){const i=`${t.padEnd(n+2)}${o}`;return e.wrap(i,r-2,n+2)}return t}function i(t){return t.join("\n").replace(/^/gm," ".repeat(2))}let s=[`Usage: ${e.commandUsage(t)}`,""];const a=e.commandDescription(t);a.length>0&&(s=s.concat([e.wrap(a,r,0),""]));const l=e.visibleArguments(t).map((t=>o(e.argumentTerm(t),e.argumentDescription(t))));l.length>0&&(s=s.concat(["Arguments:",i(l),""]));const c=e.visibleOptions(t).map((t=>o(e.optionTerm(t),e.optionDescription(t))));if(c.length>0&&(s=s.concat(["Options:",i(c),""])),this.showGlobalOptions){const n=e.visibleGlobalOptions(t).map((t=>o(e.optionTerm(t),e.optionDescription(t))));n.length>0&&(s=s.concat(["Global Options:",i(n),""]))}const u=e.visibleCommands(t).map((t=>o(e.subcommandTerm(t),e.subcommandDescription(t))));return u.length>0&&(s=s.concat(["Commands:",i(u),""])),s.join("\n")}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestGlobalOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}wrap(t,e,n,r=40){const o=new RegExp("[\\n][ \\f\\t\\v   -    \ufeff]+");if(t.match(o))return t;const i=e-n;if(i<r)return t;const s=t.slice(0,n),a=t.slice(n).replace("\r\n","\n"),l=" ".repeat(n),c="\\s​",u=new RegExp(`\n|.{1,${i-1}}([${c}]|$)|[^${c}]+?([${c}]|$)`,"g");return s+(a.match(u)||[]).map(((t,e)=>"\n"===t?"":(e>0?l:"")+t.trimEnd())).join("\n")}};var m={};const{InvalidArgumentError:g}=c;m.Option=class{constructor(t,e){this.flags=t,this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;const n=function(t){let e,n;const r=t.split(/[ |,]+/);r.length>1&&!/^[[<]/.test(r[1])&&(e=r.shift());n=r.shift(),!e&&/^-[^-]$/.test(n)&&(e=n,n=void 0);return{shortFlag:e,longFlag:n}}(t);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let e=t;return"string"==typeof t&&(e={[t]:!0}),this.implied=Object.assign(this.implied||{},e),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?e.concat(t):[t]}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{if(!this.argChoices.includes(t))throw new g(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,e):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((t,e)=>t+e[0].toUpperCase()+e.slice(1)))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},m.DualOptions=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach((t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)})),this.negativeOptions.forEach(((t,e)=>{this.positiveOptions.has(e)&&this.dualOptions.add(e)}))}valueFromOption(t,e){const n=e.attributeName();if(!this.dualOptions.has(n))return!0;const r=this.negativeOptions.get(n).presetArg,o=void 0!==r&&r;return e.negate===(o===t)}};var y={};const v=3;y.suggestSimilar=function(t,e){if(!e||0===e.length)return"";e=Array.from(new Set(e));const n=t.startsWith("--");n&&(t=t.slice(2),e=e.map((t=>t.slice(2))));let r=[],o=v;return e.forEach((e=>{if(e.length<=1)return;const n=function(t,e){if(Math.abs(t.length-e.length)>v)return Math.max(t.length,e.length);const n=[];for(let e=0;e<=t.length;e++)n[e]=[e];for(let t=0;t<=e.length;t++)n[0][t]=t;for(let r=1;r<=e.length;r++)for(let o=1;o<=t.length;o++){let i=1;i=t[o-1]===e[r-1]?0:1,n[o][r]=Math.min(n[o-1][r]+1,n[o][r-1]+1,n[o-1][r-1]+i),o>1&&r>1&&t[o-1]===e[r-2]&&t[o-2]===e[r-1]&&(n[o][r]=Math.min(n[o][r],n[o-2][r-2]+1))}return n[t.length][e.length]}(t,e),i=Math.max(t.length,e.length);(i-n)/i>.4&&(n<o?(o=n,r=[e]):n===o&&r.push(e))})),r.sort(((t,e)=>t.localeCompare(e))),n&&(r=r.map((t=>`--${t}`))),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""};const b=t.EventEmitter,_=e,w=n,k=r,x=o,{Argument:S,humanReadableArgName:E}=l,{CommanderError:O}=c,{Help:C}=d,{Option:A,DualOptions:M}=m,{suggestSimilar:T}=y;function N(t){return t.map((t=>{if(!t.startsWith("--inspect"))return t;let e,n,r="127.0.0.1",o="9229";return null!==(n=t.match(/^(--inspect(-brk)?)$/))?e=n[1]:null!==(n=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(e=n[1],/^\d+$/.test(n[3])?o=n[3]:r=n[3]):null!==(n=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(e=n[1],r=n[3],o=n[4]),e&&"0"!==o?`${e}=${r}:${parseInt(o)+1}`:t}))}p.Command=class t extends b{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>x.stdout.write(t),writeErr:t=>x.stderr.write(t),getOutHelpWidth:()=>x.stdout.isTTY?x.stdout.columns:void 0,getErrHelpWidth:()=>x.stderr.isTTY?x.stderr.columns:void 0,outputError:(t,e)=>e(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){const t=[];for(let e=this;e;e=e.parent)t.push(e);return t}command(t,e,n){let r=e,o=n;"object"==typeof r&&null!==r&&(o=r,r=null),o=o||{};const[,i,s]=t.match(/([^ ]+) *(.*)/),a=this.createCommand(i);return r&&(a.description(r),a._executableHandler=!0),o.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!o.noHelp&&!o.hidden),a._executableFile=o.executableFile||null,s&&a.arguments(s),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(e){return new t(e)}createHelp(){return Object.assign(new C,this.configureHelp())}configureHelp(t){return void 0===t?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return void 0===t?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return"string"!=typeof t&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){if(!t._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(e=e||{}).isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,e){return new S(t,e)}argument(t,e,n,r){const o=this.createArgument(t,e);return"function"==typeof n?o.default(r).argParser(n):o.default(n),this.addArgument(o),this}arguments(t){return t.trim().split(/ +/).forEach((t=>{this.argument(t)})),this}addArgument(t){const e=this.registeredArguments.slice(-1)[0];if(e&&e.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`);if(t.required&&void 0!==t.defaultValue&&void 0===t.parseArg)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,e){if("boolean"==typeof t)return this._addImplicitHelpCommand=t,this;t=t??"help [command]";const[,n,r]=t.match(/([^ ]+) *(.*)/),o=e??"display help for command",i=this.createCommand(n);return i.helpOption(!1),r&&i.arguments(r),o&&i.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=i,this}addHelpCommand(t,e){return"object"!=typeof t?(this.helpCommand(t,e),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(void 0===this._helpCommand&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,e){const n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){return this._exitCallback=t||(t=>{if("commander.executeSubCommandAsync"!==t.code)throw t}),this}_exit(t,e,n){this._exitCallback&&this._exitCallback(new O(t,e,n)),x.exit(t)}action(t){return this._actionHandler=e=>{const n=this.registeredArguments.length,r=e.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),t.apply(this,r)},this}createOption(t,e){return new A(t,e)}_callParseArg(t,e,n,r){try{return t.parseArg(e,n)}catch(t){if("commander.invalidArgument"===t.code){const e=`${r} ${t.message}`;this.error(e,{exitCode:t.exitCode,code:t.code})}throw t}}_registerOption(t){const e=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(e){const n=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'\n- already used by option '${e.flags}'`)}this.options.push(t)}_registerCommand(t){const e=t=>[t.name()].concat(t.aliases()),n=e(t).find((t=>this._findCommand(t)));if(n){const r=e(this._findCommand(n)).join("|"),o=e(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${r}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);const e=t.name(),n=t.attributeName();if(t.negate){const e=t.long.replace(/^--no-/,"--");this._findOption(e)||this.setOptionValueWithSource(n,void 0===t.defaultValue||t.defaultValue,"default")}else void 0!==t.defaultValue&&this.setOptionValueWithSource(n,t.defaultValue,"default");const r=(e,r,o)=>{null==e&&void 0!==t.presetArg&&(e=t.presetArg);const i=this.getOptionValue(n);null!==e&&t.parseArg?e=this._callParseArg(t,e,i,r):null!==e&&t.variadic&&(e=t._concatValue(e,i)),null==e&&(e=!t.negate&&(!(!t.isBoolean()&&!t.optional)||"")),this.setOptionValueWithSource(n,e,o)};return this.on("option:"+e,(e=>{const n=`error: option '${t.flags}' argument '${e}' is invalid.`;r(e,n,"cli")})),t.envVar&&this.on("optionEnv:"+e,(e=>{const n=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;r(e,n,"env")})),this}_optionEx(t,e,n,r,o){if("object"==typeof e&&e instanceof A)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(e,n);if(i.makeOptionMandatory(!!t.mandatory),"function"==typeof r)i.default(o).argParser(r);else if(r instanceof RegExp){const t=r;r=(e,n)=>{const r=t.exec(e);return r?r[0]:n},i.default(o).argParser(r)}else i.default(r);return this.addOption(i)}option(t,e,n,r){return this._optionEx({},t,e,n,r)}requiredOption(t,e,n,r){return this._optionEx({mandatory:!0},t,e,n,r)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,e){return this.setOptionValueWithSource(t,e,void 0)}setOptionValueWithSource(t,e,n){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[t]=e,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let e;return this._getCommandAndAncestors().forEach((n=>{void 0!==n.getOptionValueSource(t)&&(e=n.getOptionValueSource(t))})),e}_prepareUserArgs(t,e){if(void 0!==t&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");let n;switch(e=e||{},void 0===t&&(t=x.argv,x.versions&&x.versions.electron&&(e.from="electron")),this.rawArgs=t.slice(),e.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":x.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(t,e){const n=this._prepareUserArgs(t,e);return this._parseCommand([],n),this}async parseAsync(t,e){const n=this._prepareUserArgs(t,e);return await this._parseCommand([],n),this}_executeSubCommand(t,e){e=e.slice();let n=!1;const r=[".js",".ts",".tsx",".mjs",".cjs"];function o(t,e){const n=w.resolve(t,e);if(k.existsSync(n))return n;if(r.includes(w.extname(e)))return;const o=r.find((t=>k.existsSync(`${n}${t}`)));return o?`${n}${o}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i,s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let t;try{t=k.realpathSync(this._scriptPath)}catch(e){t=this._scriptPath}a=w.resolve(w.dirname(t),a)}if(a){let e=o(a,s);if(!e&&!t._executableFile&&this._scriptPath){const n=w.basename(this._scriptPath,w.extname(this._scriptPath));n!==this._name&&(e=o(a,`${n}-${t._name}`))}s=e||s}if(n=r.includes(w.extname(s)),"win32"!==x.platform?n?(e.unshift(s),e=N(x.execArgv).concat(e),i=_.spawn(x.argv[0],e,{stdio:"inherit"})):i=_.spawn(s,e,{stdio:"inherit"}):(e.unshift(s),e=N(x.execArgv).concat(e),i=_.spawn(x.execPath,e,{stdio:"inherit"})),!i.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((t=>{x.on(t,(()=>{!1===i.killed&&null===i.exitCode&&i.kill(t)}))}))}const l=this._exitCallback;i.on("close",((t,e)=>{t=t??1,l?l(new O(t,"commander.executeSubCommandAsync","(close)")):x.exit(t)})),i.on("error",(e=>{if("ENOENT"===e.code){const e=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${s}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${e}`;throw new Error(n)}if("EACCES"===e.code)throw new Error(`'${s}' not executable`);if(l){const t=new O(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e,l(t)}else x.exit(1)})),this.runningCommand=i}_dispatchSubcommand(t,e,n){const r=this._findCommand(t);let o;return r||this.help({error:!0}),o=this._chainOrCallSubCommandHook(o,r,"preSubcommand"),o=this._chainOrCall(o,(()=>{if(!r._executableHandler)return r._parseCommand(e,n);this._executeSubCommand(r,e.concat(n))})),o}_dispatchHelpCommand(t){t||this.help();const e=this._findCommand(t);return e&&!e._executableHandler&&e.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((t,e)=>{t.required&&null==this.args[e]&&this.missingArgument(t.name())})),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const t=(t,e,n)=>{let r=e;if(null!==e&&t.parseArg){const o=`error: command-argument value '${e}' is invalid for argument '${t.name()}'.`;r=this._callParseArg(t,e,n,o)}return r};this._checkNumberOfArguments();const e=[];this.registeredArguments.forEach(((n,r)=>{let o=n.defaultValue;n.variadic?r<this.args.length?(o=this.args.slice(r),n.parseArg&&(o=o.reduce(((e,r)=>t(n,r,e)),n.defaultValue))):void 0===o&&(o=[]):r<this.args.length&&(o=this.args[r],n.parseArg&&(o=t(n,o,n.defaultValue))),e[r]=o})),this.processedArgs=e}_chainOrCall(t,e){return t&&t.then&&"function"==typeof t.then?t.then((()=>e())):e()}_chainOrCallHooks(t,e){let n=t;const r=[];return this._getCommandAndAncestors().reverse().filter((t=>void 0!==t._lifeCycleHooks[e])).forEach((t=>{t._lifeCycleHooks[e].forEach((e=>{r.push({hookedCommand:t,callback:e})}))})),"postAction"===e&&r.reverse(),r.forEach((t=>{n=this._chainOrCall(n,(()=>t.callback(t.hookedCommand,this)))})),n}_chainOrCallSubCommandHook(t,e,n){let r=t;return void 0!==this._lifeCycleHooks[n]&&this._lifeCycleHooks[n].forEach((t=>{r=this._chainOrCall(r,(()=>t(this,e)))})),r}_parseCommand(t,e){const n=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),e=n.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(e),this._dispatchSubcommand(this._defaultCommandName,t,e);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,(()=>this._actionHandler(this.processedArgs))),this.parent&&(n=this._chainOrCall(n,(()=>{this.parent.emit(o,t,e)}))),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(o))r(),this._processArguments(),this.parent.emit(o,t,e);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e);this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(t){if(t)return this.commands.find((e=>e._name===t||e._aliases.includes(t)))}_findOption(t){return this.options.find((e=>e.is(t)))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((t=>{t.options.forEach((e=>{e.mandatory&&void 0===t.getOptionValue(e.attributeName())&&t.missingMandatoryOptionValue(e)}))}))}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const e=t.attributeName();return void 0!==this.getOptionValue(e)&&"default"!==this.getOptionValueSource(e)})),e=t.filter((t=>t.conflictsWith.length>0));e.forEach((e=>{const n=t.find((t=>e.conflictsWith.includes(t.attributeName())));n&&this._conflictingOption(e,n)}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((t=>{t._checkForConflictingLocalOptions()}))}parseOptions(t){const e=[],n=[];let r=e;const o=t.slice();function i(t){return t.length>1&&"-"===t[0]}let s=null;for(;o.length;){const t=o.shift();if("--"===t){r===n&&r.push(t),r.push(...o);break}if(!s||i(t)){if(s=null,i(t)){const e=this._findOption(t);if(e){if(e.required){const t=o.shift();void 0===t&&this.optionMissingArgument(e),this.emit(`option:${e.name()}`,t)}else if(e.optional){let t=null;o.length>0&&!i(o[0])&&(t=o.shift()),this.emit(`option:${e.name()}`,t)}else this.emit(`option:${e.name()}`);s=e.variadic?e:null;continue}}if(t.length>2&&"-"===t[0]&&"-"!==t[1]){const e=this._findOption(`-${t[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,t.slice(2)):(this.emit(`option:${e.name()}`),o.unshift(`-${t.slice(2)}`));continue}}if(/^--[^=]+=/.test(t)){const e=t.indexOf("="),n=this._findOption(t.slice(0,e));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,t.slice(e+1));continue}}if(i(t)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===e.length&&0===n.length){if(this._findCommand(t)){e.push(t),o.length>0&&n.push(...o);break}if(this._getHelpCommand()&&t===this._getHelpCommand().name()){e.push(t),o.length>0&&e.push(...o);break}if(this._defaultCommandName){n.push(t),o.length>0&&n.push(...o);break}}if(this._passThroughOptions){r.push(t),o.length>0&&r.push(...o);break}r.push(t)}else this.emit(`option:${s.name()}`,t)}return{operands:e,unknown:n}}opts(){if(this._storeOptionsAsProperties){const t={},e=this.options.length;for(let n=0;n<e;n++){const e=this.options[n].attributeName();t[e]=e===this._versionOptionName?this._version:this[e]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((t,e)=>Object.assign(t,e.opts())),{})}error(t,e){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const n=e||{},r=n.exitCode||1,o=n.code||"commander.error";this._exit(r,o,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in x.env){const e=t.attributeName();(void 0===this.getOptionValue(e)||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,x.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}}))}_parseOptionsImplied(){const t=new M(this.options),e=t=>void 0!==this.getOptionValue(t)&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((n=>void 0!==n.implied&&e(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n))).forEach((t=>{Object.keys(t.implied).filter((t=>!e(t))).forEach((e=>{this.setOptionValueWithSource(e,t.implied[e],"implied")}))}))}missingArgument(t){const e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){const e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){const n=t=>{const e=t.attributeName(),n=this.getOptionValue(e),r=this.options.find((t=>t.negate&&e===t.attributeName())),o=this.options.find((t=>!t.negate&&e===t.attributeName()));return r&&(void 0===r.presetArg&&!1===n||void 0!==r.presetArg&&n===r.presetArg)?r:o||t},r=t=>{const e=n(t),r=e.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${e.envVar}'`:`option '${e.flags}'`},o=`error: ${r(t)} cannot be used with ${r(e)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const t=r.createHelp().visibleOptions(r).filter((t=>t.long)).map((t=>t.long));n=n.concat(t),r=r.parent}while(r&&!r._enablePositionalOptions);e=T(t,n)}const n=`error: unknown option '${t}'${e}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const e=this.registeredArguments.length,n=1===e?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${n} but got ${t.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let e="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach((t=>{n.push(t.name()),t.alias()&&n.push(t.alias())})),e=T(t,n)}const n=`error: unknown command '${t}'${e}`;this.error(n,{code:"commander.unknownCommand"})}version(t,e,n){if(void 0===t)return this._version;this._version=t,e=e||"-V, --version",n=n||"output the version number";const r=this.createOption(e,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`),this._exit(0,"commander.version",t)})),this}description(t,e){return void 0===t&&void 0===e?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){return void 0===t?this._summary:(this._summary=t,this)}alias(t){if(void 0===t)return this._aliases[0];let e=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(e=this.commands[this.commands.length-1]),t===e._name)throw new Error("Command alias can't be the same as its name");const n=this.parent?._findCommand(t);if(n){const e=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${e}'`)}return e._aliases.push(t),this}aliases(t){return void 0===t?this._aliases:(t.forEach((t=>this.alias(t))),this)}usage(t){if(void 0===t){if(this._usage)return this._usage;const t=this.registeredArguments.map((t=>E(t)));return[].concat(this.options.length||null!==this._helpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=t,this}name(t){return void 0===t?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=w.basename(t,w.extname(t)),this}executableDir(t){return void 0===t?this._executableDir:(this._executableDir=t,this)}helpInformation(t){const e=this.createHelp();return void 0===e.helpWidth&&(e.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),e.formatHelp(this,e)}_getHelpContext(t){const e={error:!!(t=t||{}).error};let n;return n=e.error?t=>this._outputConfiguration.writeErr(t):t=>this._outputConfiguration.writeOut(t),e.write=t.write||n,e.command=this,e}outputHelp(t){let e;"function"==typeof t&&(e=t,t=void 0);const n=this._getHelpContext(t);this._getCommandAndAncestors().reverse().forEach((t=>t.emit("beforeAllHelp",n))),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(e&&(r=e(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach((t=>t.emit("afterAllHelp",n)))}helpOption(t,e){return"boolean"==typeof t?(this._helpOption=t?this._helpOption??void 0:null,this):(t=t??"-h, --help",e=e??"display help for command",this._helpOption=this.createOption(t,e),this)}_getHelpOption(){return void 0===this._helpOption&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let e=x.exitCode||0;0===e&&t&&"function"!=typeof t&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){const n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${t}Help`;return this.on(r,(t=>{let n;n="function"==typeof e?e({error:t.error,command:t.command}):e,n&&t.write(`${n}\n`)})),this}_outputHelpIfRequested(t){const e=this._getHelpOption();e&&t.find((t=>e.is(t)))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};const{Argument:I}=l,{Command:R}=p,{CommanderError:L,InvalidArgumentError:D}=c,{Help:$}=d,{Option:P}=m;a.program=new R,a.createCommand=t=>new R(t),a.createOption=(t,e)=>new P(t,e),a.createArgument=(t,e)=>new I(t,e),a.Command=R,a.Option=P,a.Argument=I,a.Help=$,a.CommanderError=L,a.InvalidArgumentError=D,a.InvalidOptionArgumentError=D;const{program:z,createCommand:j,createArgument:F,createOption:H,CommanderError:B,InvalidArgumentError:V,InvalidOptionArgumentError:W,Command:q,Argument:U,Option:K,Help:J}=a;
2
- /**
3
- * @vue/shared v3.4.21
4
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
- * @license MIT
6
- **/function G(t,e){const n=new Set(t.split(","));return e?t=>n.has(t.toLowerCase()):t=>n.has(t)}const Y="production"!==process.env.NODE_ENV?Object.freeze({}):{};"production"===process.env.NODE_ENV||Object.freeze([]);const X=()=>{},Z=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Q=Object.assign,tt=Object.prototype.hasOwnProperty,et=(t,e)=>tt.call(t,e),nt=Array.isArray,rt=t=>"[object Map]"===ht(t),ot=t=>"[object Set]"===ht(t),it=t=>"function"==typeof t,st=t=>"string"==typeof t,at=t=>"symbol"==typeof t,lt=t=>null!==t&&"object"==typeof t,ct=t=>(lt(t)||it(t))&&it(t.then)&&it(t.catch),ut=Object.prototype.toString,ht=t=>ut.call(t),pt=t=>ht(t).slice(8,-1),dt=t=>"[object Object]"===ht(t),ft=t=>st(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,mt=(t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))})((t=>t.charAt(0).toUpperCase()+t.slice(1))),gt=(t,e)=>!Object.is(t,e),yt=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})};let vt;const bt=()=>vt||(vt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function _t(t){if(nt(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],o=st(r)?St(r):_t(r);if(o)for(const t in o)e[t]=o[t]}return e}if(st(t)||lt(t))return t}const wt=/;(?![^(]*\))/g,kt=/:([^]+)/,xt=/\/\*[^]*?\*\//g;function St(t){const e={};return t.replace(xt,"").split(wt).forEach((t=>{if(t){const n=t.split(kt);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function Et(t){let e="";if(st(t))e=t;else if(nt(t))for(let n=0;n<t.length;n++){const r=Et(t[n]);r&&(e+=r+" ")}else if(lt(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}
7
- /**
8
- * @vue/reactivity v3.4.21
9
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
10
- * @license MIT
11
- **/function Ot(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let Ct;class At{constructor(t,e,n,r){this.fn=t,this.trigger=e,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,function(t,e){e&&e.active&&e.effects.push(t)}(this,r)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,$t();for(let t=0;t<this._depsLength;t++){const e=this.deps[t];if(e.computed&&(Mt(e.computed),this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),Pt()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=Rt,e=Ct;try{return Rt=!0,Ct=this,this._runnings++,Tt(this),this.fn()}finally{Nt(this),this._runnings--,Ct=e,Rt=t}}stop(){var t;this.active&&(Tt(this),Nt(this),null==(t=this.onStop)||t.call(this),this.active=!1)}}function Mt(t){return t.value}function Tt(t){t._trackId++,t._depsLength=0}function Nt(t){if(t.deps.length>t._depsLength){for(let e=t._depsLength;e<t.deps.length;e++)It(t.deps[e],t);t.deps.length=t._depsLength}}function It(t,e){const n=t.get(e);void 0!==n&&e._trackId!==n&&(t.delete(e),0===t.size&&t.cleanup())}let Rt=!0,Lt=0;const Dt=[];function $t(){Dt.push(Rt),Rt=!1}function Pt(){const t=Dt.pop();Rt=void 0===t||t}function zt(){Lt++}function jt(){for(Lt--;!Lt&&Ht.length;)Ht.shift()()}function Ft(t,e,n){var r;if(e.get(t)!==t._trackId){e.set(t,t._trackId);const o=t.deps[t._depsLength];o!==e?(o&&It(o,t),t.deps[t._depsLength++]=e):t._depsLength++,"production"!==process.env.NODE_ENV&&(null==(r=t.onTrack)||r.call(t,Q({effect:t},n)))}}const Ht=[];function Bt(t,e,n){var r;zt();for(const o of t.keys()){let i;o._dirtyLevel<e&&(null!=i?i:i=t.get(o)===o._trackId)&&(o._shouldSchedule||(o._shouldSchedule=0===o._dirtyLevel),o._dirtyLevel=e),o._shouldSchedule&&(null!=i?i:i=t.get(o)===o._trackId)&&("production"!==process.env.NODE_ENV&&(null==(r=o.onTrigger)||r.call(o,Q({effect:o},n))),o.trigger(),o._runnings&&!o.allowRecurse||2===o._dirtyLevel||(o._shouldSchedule=!1,o.scheduler&&Ht.push(o.scheduler)))}jt()}const Vt=(t,e)=>{const n=new Map;return n.cleanup=t,n.computed=e,n},Wt=new WeakMap,qt=Symbol("production"!==process.env.NODE_ENV?"iterate":""),Ut=Symbol("production"!==process.env.NODE_ENV?"Map key iterate":"");function Kt(t,e,n){if(Rt&&Ct){let r=Wt.get(t);r||Wt.set(t,r=new Map);let o=r.get(n);o||r.set(n,o=Vt((()=>r.delete(n)))),Ft(Ct,o,"production"!==process.env.NODE_ENV?{target:t,type:e,key:n}:void 0)}}function Jt(t,e,n,r,o,i){const s=Wt.get(t);if(!s)return;let a=[];if("clear"===e)a=[...s.values()];else if("length"===n&&nt(t)){const t=Number(r);s.forEach(((e,n)=>{("length"===n||!at(n)&&n>=t)&&a.push(e)}))}else switch(void 0!==n&&a.push(s.get(n)),e){case"add":nt(t)?ft(n)&&a.push(s.get("length")):(a.push(s.get(qt)),rt(t)&&a.push(s.get(Ut)));break;case"delete":nt(t)||(a.push(s.get(qt)),rt(t)&&a.push(s.get(Ut)));break;case"set":rt(t)&&a.push(s.get(qt))}zt();for(const s of a)s&&Bt(s,4,"production"!==process.env.NODE_ENV?{target:t,type:e,key:n,newValue:r,oldValue:o,oldTarget:i}:void 0);jt()}const Gt=G("__proto__,__v_isRef,__isVue"),Yt=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(at)),Xt=Zt();function Zt(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const n=Fe(this);for(let t=0,e=this.length;t<e;t++)Kt(n,"get",t+"");const r=n[e](...t);return-1===r||!1===r?n[e](...t.map(Fe)):r}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){$t(),zt();const n=Fe(this)[e].apply(this,t);return jt(),Pt(),n}})),t}function Qt(t){const e=Fe(this);return Kt(e,"has",t),e.hasOwnProperty(t)}class te{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,n){const r=this._isReadonly,o=this._isShallow;if("__v_isReactive"===e)return!r;if("__v_isReadonly"===e)return r;if("__v_isShallow"===e)return o;if("__v_raw"===e)return n===(r?o?Ne:Te:o?Me:Ae).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const i=nt(t);if(!r){if(i&&et(Xt,e))return Reflect.get(Xt,e,n);if("hasOwnProperty"===e)return Qt}const s=Reflect.get(t,e,n);return(at(e)?Yt.has(e):Gt(e))?s:(r||Kt(t,"get",e),o?s:Ue(s)?i&&ft(e)?s:s.value:lt(s)?r?Re(s):Ie(s):s)}}class ee extends te{constructor(t=!1){super(!1,t)}set(t,e,n,r){let o=t[e];if(!this._isShallow){const e=Pe(o);if(ze(n)||Pe(n)||(o=Fe(o),n=Fe(n)),!nt(t)&&Ue(o)&&!Ue(n))return!e&&(o.value=n,!0)}const i=nt(t)&&ft(e)?Number(e)<t.length:et(t,e),s=Reflect.set(t,e,n,r);return t===Fe(r)&&(i?gt(n,o)&&Jt(t,"set",e,n,o):Jt(t,"add",e,n)),s}deleteProperty(t,e){const n=et(t,e),r=t[e],o=Reflect.deleteProperty(t,e);return o&&n&&Jt(t,"delete",e,void 0,r),o}has(t,e){const n=Reflect.has(t,e);return at(e)&&Yt.has(e)||Kt(t,"has",e),n}ownKeys(t){return Kt(t,"iterate",nt(t)?"length":qt),Reflect.ownKeys(t)}}class ne extends te{constructor(t=!1){super(!0,t)}set(t,e){return"production"!==process.env.NODE_ENV&&Ot(`Set operation on key "${String(e)}" failed: target is readonly.`,t),!0}deleteProperty(t,e){return"production"!==process.env.NODE_ENV&&Ot(`Delete operation on key "${String(e)}" failed: target is readonly.`,t),!0}}const re=new ee,oe=new ne,ie=new ne(!0),se=t=>t,ae=t=>Reflect.getPrototypeOf(t);function le(t,e,n=!1,r=!1){const o=Fe(t=t.__v_raw),i=Fe(e);n||(gt(e,i)&&Kt(o,"get",e),Kt(o,"get",i));const{has:s}=ae(o),a=r?se:n?Be:He;return s.call(o,e)?a(t.get(e)):s.call(o,i)?a(t.get(i)):void(t!==o&&t.get(e))}function ce(t,e=!1){const n=this.__v_raw,r=Fe(n),o=Fe(t);return e||(gt(t,o)&&Kt(r,"has",t),Kt(r,"has",o)),t===o?n.has(t):n.has(t)||n.has(o)}function ue(t,e=!1){return t=t.__v_raw,!e&&Kt(Fe(t),"iterate",qt),Reflect.get(t,"size",t)}function he(t){t=Fe(t);const e=Fe(this);return ae(e).has.call(e,t)||(e.add(t),Jt(e,"add",t,t)),this}function pe(t,e){e=Fe(e);const n=Fe(this),{has:r,get:o}=ae(n);let i=r.call(n,t);i?"production"!==process.env.NODE_ENV&&Ce(n,r,t):(t=Fe(t),i=r.call(n,t));const s=o.call(n,t);return n.set(t,e),i?gt(e,s)&&Jt(n,"set",t,e,s):Jt(n,"add",t,e),this}function de(t){const e=Fe(this),{has:n,get:r}=ae(e);let o=n.call(e,t);o?"production"!==process.env.NODE_ENV&&Ce(e,n,t):(t=Fe(t),o=n.call(e,t));const i=r?r.call(e,t):void 0,s=e.delete(t);return o&&Jt(e,"delete",t,void 0,i),s}function fe(){const t=Fe(this),e=0!==t.size,n="production"!==process.env.NODE_ENV?rt(t)?new Map(t):new Set(t):void 0,r=t.clear();return e&&Jt(t,"clear",void 0,void 0,n),r}function me(t,e){return function(n,r){const o=this,i=o.__v_raw,s=Fe(i),a=e?se:t?Be:He;return!t&&Kt(s,"iterate",qt),i.forEach(((t,e)=>n.call(r,a(t),a(e),o)))}}function ge(t,e,n){return function(...r){const o=this.__v_raw,i=Fe(o),s=rt(i),a="entries"===t||t===Symbol.iterator&&s,l="keys"===t&&s,c=o[t](...r),u=n?se:e?Be:He;return!e&&Kt(i,"iterate",l?Ut:qt),{next(){const{value:t,done:e}=c.next();return e?{value:t,done:e}:{value:a?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function ye(t){return function(...e){if("production"!==process.env.NODE_ENV){const n=e[0]?`on key "${e[0]}" `:"";Ot(`${mt(t)} operation ${n}failed: target is readonly.`,Fe(this))}return"delete"!==t&&("clear"===t?void 0:this)}}function ve(){const t={get(t){return le(this,t)},get size(){return ue(this)},has:ce,add:he,set:pe,delete:de,clear:fe,forEach:me(!1,!1)},e={get(t){return le(this,t,!1,!0)},get size(){return ue(this)},has:ce,add:he,set:pe,delete:de,clear:fe,forEach:me(!1,!0)},n={get(t){return le(this,t,!0)},get size(){return ue(this,!0)},has(t){return ce.call(this,t,!0)},add:ye("add"),set:ye("set"),delete:ye("delete"),clear:ye("clear"),forEach:me(!0,!1)},r={get(t){return le(this,t,!0,!0)},get size(){return ue(this,!0)},has(t){return ce.call(this,t,!0)},add:ye("add"),set:ye("set"),delete:ye("delete"),clear:ye("clear"),forEach:me(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((o=>{t[o]=ge(o,!1,!1),n[o]=ge(o,!0,!1),e[o]=ge(o,!1,!0),r[o]=ge(o,!0,!0)})),[t,n,e,r]}const[be,_e,we,ke]=ve();function xe(t,e){const n=e?t?ke:we:t?_e:be;return(e,r,o)=>"__v_isReactive"===r?!t:"__v_isReadonly"===r?t:"__v_raw"===r?e:Reflect.get(et(n,r)&&r in e?n:e,r,o)}const Se={get:xe(!1,!1)},Ee={get:xe(!0,!1)},Oe={get:xe(!0,!0)};function Ce(t,e,n){const r=Fe(n);if(r!==n&&e.call(t,r)){const e=pt(t);Ot(`Reactive ${e} contains both the raw and reactive versions of the same object${"Map"===e?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Ae=new WeakMap,Me=new WeakMap,Te=new WeakMap,Ne=new WeakMap;function Ie(t){return Pe(t)?t:De(t,!1,re,Se,Ae)}function Re(t){return De(t,!0,oe,Ee,Te)}function Le(t){return De(t,!0,ie,Oe,Ne)}function De(t,e,n,r,o){if(!lt(t))return"production"!==process.env.NODE_ENV&&Ot(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const i=o.get(t);if(i)return i;const s=(a=t).__v_skip||!Object.isExtensible(a)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(pt(a));var a;if(0===s)return t;const l=new Proxy(t,2===s?r:n);return o.set(t,l),l}function $e(t){return Pe(t)?$e(t.__v_raw):!(!t||!t.__v_isReactive)}function Pe(t){return!(!t||!t.__v_isReadonly)}function ze(t){return!(!t||!t.__v_isShallow)}function je(t){return $e(t)||Pe(t)}function Fe(t){const e=t&&t.__v_raw;return e?Fe(e):t}const He=t=>lt(t)?Ie(t):t,Be=t=>lt(t)?Re(t):t;class Ve{constructor(t,e,n,r){this.getter=t,this._setter=e,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new At((()=>t(this._value)),(()=>qe(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=n}get value(){const t=Fe(this);return t._cacheable&&!t.effect.dirty||!gt(t._value,t._value=t.effect.run())||qe(t,4),We(t),t.effect._dirtyLevel>=2&&("production"!==process.env.NODE_ENV&&this._warnRecursive&&Ot("Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free","\n\ngetter: ",this.getter),qe(t,2)),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function We(t){var e;Rt&&Ct&&(t=Fe(t),Ft(Ct,null!=(e=t.dep)?e:t.dep=Vt((()=>t.dep=void 0),t instanceof Ve?t:void 0),"production"!==process.env.NODE_ENV?{target:t,type:"get",key:"value"}:void 0))}function qe(t,e=4,n){const r=(t=Fe(t)).dep;r&&Bt(r,e,"production"!==process.env.NODE_ENV?{target:t,type:"set",key:"value",newValue:n}:void 0)}function Ue(t){return!(!t||!0!==t.__v_isRef)}function Ke(t){return function(t,e){if(Ue(t))return t;return new Je(t,e)}(t,!1)}class Je{constructor(t,e){this.__v_isShallow=e,this.dep=void 0,this.__v_isRef=!0,this._rawValue=e?t:Fe(t),this._value=e?t:He(t)}get value(){return We(this),this._value}set value(t){const e=this.__v_isShallow||ze(t)||Pe(t);t=e?t:Fe(t),gt(t,this._rawValue)&&(this._rawValue=t,this._value=e?t:He(t),qe(this,4,t))}}function Ge(t){return Ue(t)?t.value:t}const Ye={get:(t,e,n)=>Ge(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const o=t[e];return Ue(o)&&!Ue(n)?(o.value=n,!0):Reflect.set(t,e,n,r)}};class Xe{constructor(t,e,n){this._object=t,this._key=e,this._defaultValue=n,this.__v_isRef=!0}get value(){const t=this._object[this._key];return void 0===t?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return t=Fe(this._object),e=this._key,null==(n=Wt.get(t))?void 0:n.get(e);var t,e,n}}class Ze{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Qe(t,e,n){return Ue(t)?t:it(t)?new Ze(t):lt(t)&&arguments.length>1?function(t,e,n){const r=t[e];return Ue(r)?r:new Xe(t,e,n)}
12
- /**
13
- * @vue/runtime-core v3.4.21
14
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
15
- * @license MIT
16
- **/(t,e,n):Ke(t)}const tn=[];function en(t,...e){$t();const n=tn.length?tn[tn.length-1].component:null,r=n&&n.appContext.config.warnHandler,o=function(){let t=tn[tn.length-1];if(!t)return[];const e=[];for(;t;){const n=e[0];n&&n.vnode===t?n.recurseCount++:e.push({vnode:t,recurseCount:0});const r=t.component&&t.component.parent;t=r&&r.vnode}return e}();if(r)sn(r,n,11,[t+e.map((t=>{var e,n;return null!=(n=null==(e=t.toString)?void 0:e.call(t))?n:JSON.stringify(t)})).join(""),n&&n.proxy,o.map((({vnode:t})=>`at <${kr(n,t.type)}>`)).join("\n"),o]);else{const n=[`[Vue warn]: ${t}`,...e];o.length&&n.push("\n",...function(t){const e=[];return t.forEach(((t,n)=>{e.push(...0===n?[]:["\n"],...function({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",r=!!t.component&&null==t.component.parent,o=` at <${kr(t.component,t.type,r)}`,i=">"+n;return t.props?[o,...nn(t.props),i]:[o+i]}(t))})),e}(o)),console.warn(...n)}Pt()}function nn(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach((n=>{e.push(...rn(n,t[n]))})),n.length>3&&e.push(" ..."),e}function rn(t,e,n){return st(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):"number"==typeof e||"boolean"==typeof e||null==e?n?e:[`${t}=${e}`]:Ue(e)?(e=rn(t,Fe(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):it(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=Fe(e),n?e:[`${t}=`,e])}const on={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."};function sn(t,e,n,r){try{return r?t(...r):t()}catch(t){ln(t,e,n)}}function an(t,e,n,r){if(it(t)){const o=sn(t,e,n,r);return o&&ct(o)&&o.catch((t=>{ln(t,e,n)})),o}const o=[];for(let i=0;i<t.length;i++)o.push(an(t[i],e,n,r));return o}function ln(t,e,n,r=!0){const o=e?e.vnode:null;if(e){let r=e.parent;const o=e.proxy,i="production"!==process.env.NODE_ENV?on[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){const e=r.ec;if(e)for(let n=0;n<e.length;n++)if(!1===e[n](t,o,i))return;r=r.parent}const s=e.appContext.config.errorHandler;if(s)return void sn(s,null,10,[t,o,i])}!function(t,e,n,r=!0){if("production"!==process.env.NODE_ENV){const i=on[e];if(n&&(o=n,tn.push(o)),en("Unhandled error"+(i?` during execution of ${i}`:"")),n&&tn.pop(),r)throw t;console.error(t)}else console.error(t);var o}(t,n,o,r)}let cn=!1,un=!1;const hn=[];let pn=0;const dn=[];let fn=null,mn=0;const gn=Promise.resolve();let yn=null;const vn=100;function bn(t){const e=yn||gn;return t?e.then(this?t.bind(this):t):e}function _n(t){hn.length&&hn.includes(t,cn&&t.allowRecurse?pn+1:pn)||(null==t.id?hn.push(t):hn.splice(function(t){let e=pn+1,n=hn.length;for(;e<n;){const r=e+n>>>1,o=hn[r],i=xn(o);i<t||i===t&&o.pre?e=r+1:n=r}return e}(t.id),0,t),wn())}function wn(){cn||un||(un=!0,yn=gn.then(En))}function kn(t){nt(t)?dn.push(...t):fn&&fn.includes(t,t.allowRecurse?mn+1:mn)||dn.push(t),wn()}const xn=t=>null==t.id?1/0:t.id,Sn=(t,e)=>{const n=xn(t)-xn(e);if(0===n){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function En(t){un=!1,cn=!0,"production"!==process.env.NODE_ENV&&(t=t||new Map),hn.sort(Sn);const e="production"!==process.env.NODE_ENV?e=>On(t,e):X;try{for(pn=0;pn<hn.length;pn++){const t=hn[pn];if(t&&!1!==t.active){if("production"!==process.env.NODE_ENV&&e(t))continue;sn(t,null,14)}}}finally{pn=0,hn.length=0,function(t){if(dn.length){const e=[...new Set(dn)].sort(((t,e)=>xn(t)-xn(e)));if(dn.length=0,fn)return void fn.push(...e);for(fn=e,"production"!==process.env.NODE_ENV&&(t=t||new Map),mn=0;mn<fn.length;mn++)"production"!==process.env.NODE_ENV&&On(t,fn[mn])||fn[mn]();fn=null,mn=0}}(t),cn=!1,yn=null,(hn.length||dn.length)&&En(t)}}function On(t,e){if(t.has(e)){const n=t.get(e);if(n>vn){const t=e.ownerInstance,n=t&&wr(t.type);return ln(`Maximum recursive updates exceeded${n?` in component <${n}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}t.set(e,n+1)}else t.set(e,1)}const Cn=new Set;"production"!==process.env.NODE_ENV&&(bt().__VUE_HMR_RUNTIME__={createRecord:Nn((function(t,e){if(An.has(t))return!1;return An.set(t,{initialDef:Mn(e),instances:new Set}),!0})),rerender:Nn((function(t,e){const n=An.get(t);if(!n)return;n.initialDef.render=e,[...n.instances].forEach((t=>{e&&(t.render=e,Mn(t.type).render=e),t.renderCache=[],t.effect.dirty=!0,t.update()}))})),reload:Nn((function(t,e){const n=An.get(t);if(!n)return;e=Mn(e),Tn(n.initialDef,e);const r=[...n.instances];for(const t of r){const r=Mn(t.type);Cn.has(r)||(r!==n.initialDef&&Tn(r,e),Cn.add(r)),t.appContext.propsCache.delete(t.type),t.appContext.emitsCache.delete(t.type),t.appContext.optionsCache.delete(t.type),t.ceReload?(Cn.add(r),t.ceReload(e.styles),Cn.delete(r)):t.parent?(t.parent.effect.dirty=!0,_n(t.parent.update)):t.appContext.reload?t.appContext.reload():"undefined"!=typeof window?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}kn((()=>{for(const t of r)Cn.delete(Mn(t.type))}))}))});const An=new Map;function Mn(t){return xr(t)?t.__vccOpts:t}function Tn(t,e){Q(t,e);for(const n in t)"__file"===n||n in e||delete t[n]}function Nn(t){return(e,n)=>{try{return t(e,n)}catch(t){console.error(t),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let In=null,Rn=null;const Ln=Symbol.for("v-ndc");const Dn=Symbol.for("v-scx"),$n=()=>{{const t=function(t,e,n=!1){const r=mr||In;if(r||tr){const o=r?null==r.parent?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:tr._context.provides;if(o&&t in o)return o[t];if(arguments.length>1)return n&&it(e)?e.call(r&&r.proxy):e;"production"!==process.env.NODE_ENV&&en(`injection "${String(t)}" not found.`)}else"production"!==process.env.NODE_ENV&&en("inject() can only be used inside setup() or functional components.")}(Dn);return t||"production"!==process.env.NODE_ENV&&en("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),t}},Pn={};function zn(t,e,{immediate:n,deep:r,flush:o,once:i,onTrack:s,onTrigger:a}=Y){if(e&&i){const t=e;e=(...e)=>{t(...e),w()}}"production"!==process.env.NODE_ENV&&void 0!==r&&"number"==typeof r&&en('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),"production"===process.env.NODE_ENV||e||(void 0!==n&&en('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==r&&en('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==i&&en('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const l=t=>{en("Invalid watch source: ",t,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=mr,u=t=>!0===r?t:Fn(t,!1===r?1:void 0);let h,p,d=!1,f=!1;if(Ue(t)?(h=()=>t.value,d=ze(t)):$e(t)?(h=()=>u(t),d=!0):nt(t)?(f=!0,d=t.some((t=>$e(t)||ze(t))),h=()=>t.map((t=>Ue(t)?t.value:$e(t)?u(t):it(t)?sn(t,c,2):void("production"!==process.env.NODE_ENV&&l(t))))):it(t)?h=e?()=>sn(t,c,2):()=>(p&&p(),an(t,c,3,[g])):(h=X,"production"!==process.env.NODE_ENV&&l(t)),e&&r){const t=h;h=()=>Fn(t())}let m,g=t=>{p=_.onStop=()=>{sn(t,c,4),p=_.onStop=void 0}};if(vr){if(g=X,e?n&&an(e,c,3,[h(),f?[]:void 0,g]):h(),"sync"!==o)return X;{const t=$n();m=t.__watcherHandles||(t.__watcherHandles=[])}}let y=f?new Array(t.length).fill(Pn):Pn;const v=()=>{if(_.active&&_.dirty)if(e){const t=_.run();(r||d||(f?t.some(((t,e)=>gt(t,y[e]))):gt(t,y)))&&(p&&p(),an(e,c,3,[t,y===Pn?void 0:f&&y[0]===Pn?[]:y,g]),y=t)}else _.run()};let b;v.allowRecurse=!!e,"sync"===o?b=v:"post"===o?b=()=>er(v,c&&c.suspense):(v.pre=!0,c&&(v.id=c.uid),b=()=>_n(v));const _=new At(h,X,b),w=()=>{_.stop()};return"production"!==process.env.NODE_ENV&&(_.onTrack=s,_.onTrigger=a),e?n?v():y=_.run():"post"===o?er(_.run.bind(_),c&&c.suspense):_.run(),m&&m.push(w),w}function jn(t,e,n){const r=this.proxy,o=st(t)?t.includes(".")?function(t,e){const n=e.split(".");return()=>{let e=t;for(let t=0;t<n.length&&e;t++)e=e[n[t]];return e}}(r,t):()=>r[t]:t.bind(r,r);let i;it(e)?i=e:(i=e.handler,n=e);const s=yr(this),a=zn(o,i.bind(r),n);return s(),a}function Fn(t,e,n=0,r){if(!lt(t)||t.__v_skip)return t;if(e&&e>0){if(n>=e)return t;n++}if((r=r||new Set).has(t))return t;if(r.add(t),Ue(t))Fn(t.value,e,n,r);else if(nt(t))for(let o=0;o<t.length;o++)Fn(t[o],e,n,r);else if(ot(t)||rt(t))t.forEach((t=>{Fn(t,e,n,r)}));else if(dt(t))for(const o in t)Fn(t[o],e,n,r);return t}const Hn=t=>t?4&t.vnode.shapeFlag?function(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy((n=t.exposed,Object.isExtensible(n)&&yt(n,"__v_skip",!0),$e(e=n)?e:new Proxy(e,Ye)),{get:(e,n)=>n in e?e[n]:n in Bn?Bn[n](t):void 0,has:(t,e)=>e in t||e in Bn}));var e;var n}(t)||t.proxy:Hn(t.parent):null,Bn=Q(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>"production"!==process.env.NODE_ENV?Le(t.props):t.props,$attrs:t=>"production"!==process.env.NODE_ENV?Le(t.attrs):t.attrs,$slots:t=>"production"!==process.env.NODE_ENV?Le(t.slots):t.slots,$refs:t=>"production"!==process.env.NODE_ENV?Le(t.refs):t.refs,$parent:t=>Hn(t.parent),$root:t=>Hn(t.root),$emit:t=>t.emit,$options:t=>__VUE_OPTIONS_API__?function(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=t.appContext,a=i.get(e);let l;a?l=a:o.length||n||r?(l={},o.length&&o.forEach((t=>Kn(l,t,s,!0))),Kn(l,e,s)):l=e;lt(e)&&i.set(e,l);return l}(t):t.type,$forceUpdate:t=>t.f||(t.f=()=>{t.effect.dirty=!0,_n(t.update)}),$nextTick:t=>t.n||(t.n=bn.bind(t.proxy)),$watch:t=>__VUE_OPTIONS_API__?jn.bind(t):X}),Vn=(t,e)=>t!==Y&&!t.__isScriptSetup&&et(t,e),Wn={get({_:t},e){const{ctx:n,setupState:r,data:o,props:i,accessCache:s,type:a,appContext:l}=t;if("production"!==process.env.NODE_ENV&&"__isVue"===e)return!0;let c;if("$"!==e[0]){const a=s[e];if(void 0!==a)switch(a){case 1:return r[e];case 2:return o[e];case 4:return n[e];case 3:return i[e]}else{if(Vn(r,e))return s[e]=1,r[e];if(o!==Y&&et(o,e))return s[e]=2,o[e];if((c=t.propsOptions[0])&&et(c,e))return s[e]=3,i[e];if(n!==Y&&et(n,e))return s[e]=4,n[e];__VUE_OPTIONS_API__&&!Un||(s[e]=0)}}const u=Bn[e];let h,p;return u?("$attrs"===e?(Kt(t,"get",e),process.env.NODE_ENV):"production"!==process.env.NODE_ENV&&"$slots"===e&&Kt(t,"get",e),u(t)):(h=a.__cssModules)&&(h=h[e])?h:n!==Y&&et(n,e)?(s[e]=4,n[e]):(p=l.config.globalProperties,et(p,e)?p[e]:void("production"===process.env.NODE_ENV||!In||st(e)&&0===e.indexOf("__v")||(o!==Y&&(t=>"_"===t||"$"===t)(e[0])&&et(o,e)?en(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):t===In&&en(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))))},set({_:t},e,n){const{data:r,setupState:o,ctx:i}=t;return Vn(o,e)?(o[e]=n,!0):"production"!==process.env.NODE_ENV&&o.__isScriptSetup&&et(o,e)?(en(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==Y&&et(r,e)?(r[e]=n,!0):et(t.props,e)?("production"!==process.env.NODE_ENV&&en(`Attempting to mutate prop "${e}". Props are readonly.`),!1):"$"===e[0]&&e.slice(1)in t?("production"!==process.env.NODE_ENV&&en(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):("production"!==process.env.NODE_ENV&&e in t.appContext.config.globalProperties?Object.defineProperty(i,e,{enumerable:!0,configurable:!0,value:n}):i[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:o,propsOptions:i}},s){let a;return!!n[s]||t!==Y&&et(t,s)||Vn(e,s)||(a=i[0])&&et(a,s)||et(r,s)||et(Bn,s)||et(o.config.globalProperties,s)},defineProperty(t,e,n){return null!=n.get?t._.accessCache[e]=0:et(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function qn(t){return nt(t)?t.reduce(((t,e)=>(t[e]=null,t)),{}):t}"production"!==process.env.NODE_ENV&&(Wn.ownKeys=t=>(en("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(t)));let Un=!0;function Kn(t,e,n,r=!1){const{mixins:o,extends:i}=e;i&&Kn(t,i,n,!0),o&&o.forEach((e=>Kn(t,e,n,!0)));for(const o in e)if(r&&"expose"===o)"production"!==process.env.NODE_ENV&&en('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const r=Jn[o]||n&&n[o];t[o]=r?r(t[o],e[o]):e[o]}return t}const Jn={data:Gn,props:Qn,emits:Qn,methods:Zn,computed:Zn,beforeCreate:Xn,created:Xn,beforeMount:Xn,mounted:Xn,beforeUpdate:Xn,updated:Xn,beforeDestroy:Xn,beforeUnmount:Xn,destroyed:Xn,unmounted:Xn,activated:Xn,deactivated:Xn,errorCaptured:Xn,serverPrefetch:Xn,components:Zn,directives:Zn,watch:function(t,e){if(!t)return e;if(!e)return t;const n=Q(Object.create(null),t);for(const r in e)n[r]=Xn(t[r],e[r]);return n},provide:Gn,inject:function(t,e){return Zn(Yn(t),Yn(e))}};function Gn(t,e){return e?t?function(){return Q(it(t)?t.call(this,this):t,it(e)?e.call(this,this):e)}:e:t}function Yn(t){if(nt(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Xn(t,e){return t?[...new Set([].concat(t,e))]:e}function Zn(t,e){return t?Q(Object.create(null),t,e):e}function Qn(t,e){return t?nt(t)&&nt(e)?[...new Set([...t,...e])]:Q(Object.create(null),qn(t),qn(null!=e?e:{})):e}let tr=null;const er=function(t,e){e&&e.pendingBranch?nt(t)?e.effects.push(...t):e.effects.push(t):kn(t)},nr=Symbol.for("v-fgt"),rr=Symbol.for("v-txt"),or=Symbol.for("v-cmt");let ir=null;const sr="__vInternal",ar=({key:t})=>null!=t?t:null,lr=({ref:t,ref_key:e,ref_for:n})=>("number"==typeof t&&(t=""+t),null!=t?st(t)||Ue(t)||it(t)?{i:In,r:t,k:e,f:!!n}:t:null);const cr="production"!==process.env.NODE_ENV?(...t)=>ur(...t):ur;function ur(t,e=null,n=null,r=0,o=null,i=!1){if(t&&t!==Ln||("production"===process.env.NODE_ENV||t||en(`Invalid vnode type when creating vnode: ${t}.`),t=or),(s=t)&&!0===s.__v_isVNode){const r=hr(t,e,!0);return n&&fr(r,n),!i&&ir&&(6&r.shapeFlag?ir[ir.indexOf(t)]=r:ir.push(r)),r.patchFlag|=-2,r}var s;if(xr(t)&&(t=t.__vccOpts),e){e=function(t){return t?je(t)||sr in t?Q({},t):t:null}(e);let{class:t,style:n}=e;t&&!st(t)&&(e.class=Et(t)),lt(n)&&(je(n)&&!nt(n)&&(n=Q({},n)),e.style=_t(n))}const a=st(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:lt(t)?4:it(t)?2:0;return"production"!==process.env.NODE_ENV&&4&a&&je(t)&&en("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.","\nComponent that was made reactive: ",t=Fe(t)),function(t,e=null,n=null,r=0,o=null,i=(t===nr?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&ar(e),ref:e&&lr(e),scopeId:Rn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:In};return a?(fr(l,n),128&i&&t.normalize(l)):n&&(l.shapeFlag|=st(n)?8:16),"production"!==process.env.NODE_ENV&&l.key!=l.key&&en("VNode created with invalid key (NaN). VNode type:",l.type),!s&&ir&&(l.patchFlag>0||6&i)&&32!==l.patchFlag&&ir.push(l),l}(t,e,n,r,o,a,i,!0)}function hr(t,e,n=!1){const{props:r,ref:o,patchFlag:i,children:s}=t,a=e?function(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];for(const t in r)if("class"===t)e.class!==r.class&&(e.class=Et([e.class,r.class]));else if("style"===t)e.style=_t([e.style,r.style]);else if(Z(t)){const n=e[t],o=r[t];!o||n===o||nt(n)&&n.includes(o)||(e[t]=n?[].concat(n,o):o)}else""!==t&&(e[t]=r[t])}return e}(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:a,key:a&&ar(a),ref:e&&e.ref?n&&o?nt(o)?o.concat(lr(e)):[o,lr(e)]:lr(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:"production"!==process.env.NODE_ENV&&-1===i&&nt(s)?s.map(pr):s,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==nr?-1===i?16:16|i:i,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&hr(t.ssContent),ssFallback:t.ssFallback&&hr(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function pr(t){const e=hr(t);return nt(t.children)&&(e.children=t.children.map(pr)),e}function dr(t=" ",e=0){return cr(rr,null,t,e)}function fr(t,e){let n=0;const{shapeFlag:r}=t;if(null==e)e=null;else if(nt(e))n=16;else if("object"==typeof e){if(65&r){const n=e.default;return void(n&&(n._c&&(n._d=!1),fr(t,n()),n._c&&(n._d=!0)))}{n=32;const r=e._;r||sr in e?3===r&&In&&(1===In.slots._?e._=1:(e._=2,t.patchFlag|=1024)):e._ctx=In}}else it(e)?(e={default:e,_ctx:In},n=32):(e=String(e),64&r?(n=16,e=[dr(e)]):n=8);t.children=e,t.shapeFlag|=n}let mr=null;let gr;{const t=bt(),e=(e,n)=>{let r;return(r=t[e])||(r=t[e]=[]),r.push(n),t=>{r.length>1?r.forEach((e=>e(t))):r[0](t)}};gr=e("__VUE_INSTANCE_SETTERS__",(t=>mr=t)),e("__VUE_SSR_SETTERS__",(t=>vr=t))}const yr=t=>{const e=mr;return gr(t),t.scope.on(),()=>{t.scope.off(),gr(e)}};let vr=!1;const br=/(?:^|[-_])(\w)/g,_r=t=>t.replace(br,(t=>t.toUpperCase())).replace(/[-_]/g,"");function wr(t,e=!0){return it(t)?t.displayName||t.name:t.name||e&&t.__name}function kr(t,e,n=!1){let r=wr(e);if(!r&&e.__file){const t=e.__file.match(/([^/\\]+)\.\w+$/);t&&(r=t[1])}if(!r&&t&&t.parent){const n=t=>{for(const n in t)if(t[n]===e)return n};r=n(t.components||t.parent.type.components)||n(t.appContext.components)}return r?_r(r):n?"App":"Anonymous"}function xr(t){return it(t)&&"__vccOpts"in t}const Sr=(t,e)=>{const n=function(t,e,n=!1){let r,o;const i=it(t);i?(r=t,o="production"!==process.env.NODE_ENV?()=>{Ot("Write operation failed: computed value is readonly")}:X):(r=t.get,o=t.set);const s=new Ve(r,o,i||!o,n);return"production"!==process.env.NODE_ENV&&e&&!n&&(s.effect.onTrack=e.onTrack,s.effect.onTrigger=e.onTrigger),s}(t,e,vr);if("production"!==process.env.NODE_ENV){const t=mr||In;t&&t.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function Er(t){this.content=t}function Or(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let t=0;o.text[t]==i.text[t];t++)n++;return n}if(o.content.size||i.content.size){let t=Or(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function Cr(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=0,e=Math.min(s.text.length,a.text.length);for(;t<e&&s.text[s.text.length-t-1]==a.text[a.text.length-t-1];)t++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let t=Cr(s.content,a.content,n-1,r-1);if(t)return t}n-=l,r-=l}else n-=l,r-=l}}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV,"production"!==process.env.NODE_ENV&&function(){if("production"===process.env.NODE_ENV||"undefined"==typeof window)return;const t={style:"color:#3ba776"},e={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},o={header:e=>lt(e)?e.__isVue?["div",t,"VueInstance"]:Ue(e)?["div",{},["span",t,u(e)],"<",a(e.value),">"]:$e(e)?["div",{},["span",t,ze(e)?"ShallowReactive":"Reactive"],"<",a(e),">"+(Pe(e)?" (readonly)":"")]:Pe(e)?["div",{},["span",t,ze(e)?"ShallowReadonly":"Readonly"],"<",a(e),">"]:null:null,hasBody:t=>t&&t.__isVue,body(t){if(t&&t.__isVue)return["div",{},...i(t.$)]}};function i(t){const e=[];t.type.props&&t.props&&e.push(s("props",Fe(t.props))),t.setupState!==Y&&e.push(s("setup",t.setupState)),t.data!==Y&&e.push(s("data",Fe(t.data)));const n=l(t,"computed");n&&e.push(s("computed",n));const o=l(t,"inject");return o&&e.push(s("injected",o)),e.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:t}]]),e}function s(t,e){return e=Q({},e),Object.keys(e).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},t],["div",{style:"padding-left:1.25em"},...Object.keys(e).map((t=>["div",{},["span",r,t+": "],a(e[t],!1)]))]]:["span",{}]}function a(t,o=!0){return"number"==typeof t?["span",e,t]:"string"==typeof t?["span",n,JSON.stringify(t)]:"boolean"==typeof t?["span",r,t]:lt(t)?["object",{object:o?Fe(t):t}]:["span",n,String(t)]}function l(t,e){const n=t.type;if(it(n))return;const r={};for(const o in t.ctx)c(n,o,e)&&(r[o]=t.ctx[o]);return r}function c(t,e,n){const r=t[n];return!!(nt(r)&&r.includes(e)||lt(r)&&e in r)||!(!t.extends||!c(t.extends,e,n))||!(!t.mixins||!t.mixins.some((t=>c(t,e,n))))||void 0}function u(t){return ze(t)?"ShallowRef":t.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}(),Er.prototype={constructor:Er,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return-1==o?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Er(i)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new Er(n)},addToStart:function(t,e){return new Er([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Er(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(-1==i?o.length:i,0,e,n),new Er(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=Er.from(t)).size?new Er(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Er.from(t)).size?new Er(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Er.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},Er.from=function(t){if(t instanceof Er)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Er(e)};class Ar{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,o){for(let i=0,s=0;s<e;i++){let a=this.content[i],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new Ar(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let o=0,i=0;i<e;o++){let s=this.content[o],a=i+s.nodeSize;a>t&&((i<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new Ar(n,r)}cutByIndex(t,e){return t==e?Ar.empty:0==t&&e==this.content.length?this:new Ar(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new Ar(r,o)}addToStart(t){return new Ar([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Ar(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return Or(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return Cr(this,t,e,n)}findIndex(t,e=-1){if(0==t)return Tr(0,t);if(t==this.size)return Tr(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?Tr(n+1,o):Tr(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return Ar.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ar(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Ar.empty;let e,n=0;for(let r=0;r<t.length;r++){let o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new Ar(e||t,n)}static from(t){if(!t)return Ar.empty;if(t instanceof Ar)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Ar([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ar.empty=new Ar([],0);const Mr={index:0,offset:0};function Tr(t,e){return Mr.index=t,Mr.offset=e,Mr}function Nr(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Nr(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Nr(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let Ir=class t{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Nr(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return t.none;if(e instanceof t)return[e];let n=e.slice();return n.sort(((t,e)=>t.type.rank-e.type.rank)),n}};Ir.none=[];class Rr extends Error{}class Lr{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=$r(this.content,t+this.openStart,e);return n&&new Lr(n,this.openStart,this.openEnd)}removeBetween(t,e){return new Lr(Dr(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return Lr.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new Lr(Ar.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new Lr(t,n,r)}}function Dr(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Dr(i.content,e-o-1,n-o-1)))}function $r(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=$r(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function Pr(t,e,n){if(n.openStart>t.depth)throw new Rr("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Rr("Inconsistent open depths");return zr(t,e,n,0)}function zr(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=zr(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:o,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(Ar.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return Vr(i,Wr(t,o,s,e,r))}{let r=t.parent,o=r.content;return Vr(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return Vr(i,qr(t,e,r))}function jr(t,e){if(!e.type.compatibleContent(t.type))throw new Rr("Cannot join "+e.type.name+" onto "+t.type.name)}function Fr(t,e,n){let r=t.node(n);return jr(r,e.node(n)),r}function Hr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Br(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Hr(t.nodeAfter,r),i++));for(let t=i;t<s;t++)Hr(o.child(t),r);e&&e.depth==n&&e.textOffset&&Hr(e.nodeBefore,r)}function Vr(t,e){return t.type.checkContent(e),t.copy(e)}function Wr(t,e,n,r,o){let i=t.depth>o&&Fr(t,e,o+1),s=r.depth>o&&Fr(n,r,o+1),a=[];return Br(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(jr(i,s),Hr(Vr(i,Wr(t,e,n,r,o+1)),a)):(i&&Hr(Vr(i,qr(t,e,o+1)),a),Br(e,n,o,a),s&&Hr(Vr(s,qr(n,r,o+1)),a)),Br(r,null,o,a),new Ar(a)}function qr(t,e,n){let r=[];if(Br(null,t,n,r),t.depth>n){Hr(Vr(Fr(t,e,n+1),qr(t,e,n+1)),r)}return Br(e,null,n,r),new Ar(r)}Lr.empty=new Lr(Ar.empty,0,0);class Ur{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return Ir.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new Yr(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let e=t;;){let{index:t,offset:i}=e.content.findIndex(o),s=o-i;if(n.push(e,t,r+i),!s)break;if(e=e.child(t),e.isText)break;o=s-1,r+=i+1}return new Ur(e,n,o)}static resolveCached(t,e){for(let n=0;n<Kr.length;n++){let r=Kr[n];if(r.pos==e&&r.doc==t)return r}let n=Kr[Jr]=Ur.resolve(t,e);return Jr=(Jr+1)%Gr,n}}let Kr=[],Jr=0,Gr=12;class Yr{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Xr=Object.create(null);let Zr=class t{constructor(t,e,n,r=Ir.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||Ar.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&Nr(this.attrs,e||t.defaultAttrs||Xr)&&Ir.sameSet(this.marks,n||Ir.none)}copy(e=null){return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return Lr.empty;let r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new Lr(a,r.depth-i,o.depth-i)}replace(t,e,n){return Pr(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return Ur.resolveCached(this,t)}resolveNoCache(t){return Ur.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),to(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=Ar.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=Ir.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!Ir.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((t=>t.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=Ar.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}};Zr.prototype.text=void 0;class Qr extends Zr{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):to(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Qr(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Qr(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function to(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class eo{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new no(t,e);if(null==n.next)return eo.empty;let r=ro(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return n(co(t,0));function n(r){let o=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);co(t,n).forEach((t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new eo(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(lo);i.next.push({type:o[t][0],next:e[r.join(",")]||n(r)})}return i}}(function(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((t=>t.to=e))}function i(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(i(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),o(i(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(i(t.expr,e),s),o(i(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){let s=e;for(let e=0;e<t.min;e++){let e=n();o(i(t.expr,s),e),s=e}if(-1==t.max)o(i(t.expr,s),s);else for(let e=t.min;e<t.max;e++){let e=n();r(s,e),o(i(t.expr,s),e),s=e}return[r(s)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(t.exprs[r],e);if(r==t.exprs.length-1)return s;o(s,e=n())}}}(r));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],o=!t.validEnd,i=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(t,n);if(a&&(!e||a.validEnd))return Ar.from(s.map((t=>t.createAndFill())));for(let t=0;t<i.next.length;t++){let{type:e,next:n}=i.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=o(n,s.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<o.next.length;t++){let{type:i,next:s}=o.next[t];i.isLeaf||i.hasRequiredAttrs()||i.name in e||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r})).join("\n")}}eo.empty=new eo(!0);class no{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function ro(t){let e=[];do{e.push(oo(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function oo(t){let e=[];do{e.push(io(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function io(t){let e=function(t){if(t.eat("(")){let e=ro(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&o.push(r)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=ao(t,e)}return e}function so(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function ao(t,e){let n=so(t),r=n;return t.eat(",")&&(r="}"!=t.next?so(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function lo(t,e){return e-t}function co(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t<o.length;t++){let{term:r,to:i}=o[t];r||-1!=n.indexOf(i)||e(i)}}(e),n.sort(lo)}function uo(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function ho(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(void 0===o){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=e.default}n[r]=o}return n}function po(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new mo(t[n]);return e}let fo=class t{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=po(n.attrs),this.defaultAttrs=uo(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==eo.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:ho(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Zr(this,this.computeAttrs(t),Ar.from(e),Ir.setFrom(n))}createChecked(t=null,e,n){return e=Ar.from(e),this.checkContent(e),new Zr(this,this.computeAttrs(t),e,Ir.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=Ar.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(Ar.empty,!0);return o?new Zr(this,t,e.append(o),Ir.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:Ir.none:t}static compile(e,n){let r=Object.create(null);e.forEach(((e,o)=>r[e]=new t(e,n,o)));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let t in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class mo{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class go{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=po(r.attrs),this.excluded=null;let o=uo(this.attrs);this.instance=o?new Ir(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ir(this,ho(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new go(t,r++,e,o))),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class yo{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=Er.from(t.nodes),e.marks=Er.from(t.marks||{}),this.nodes=fo.compile(this.spec.nodes,this),this.marks=go.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",o=e.spec.marks;e.contentMatch=n[r]||(n[r]=eo.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==o?null:o?vo(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:vo(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof fo))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new Qr(n,n.defaultAttrs,t,Ir.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return Zr.fromJSON(this,t)}markFromJSON(t){return Ir.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function vo(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let e in t.marks){let r=t.marks[e];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}let bo=class t{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new Eo(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new Eo(this,e,!0);return n.addAll(t,e.from,e.to),Lr.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Oo(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(t)||r.context&&!n.matchesContext(r.context)||i.length>t.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach((t=>{n(t=Co(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)}))}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach((t=>{n(t=Co(t)),t.node||t.ignore||t.mark||(t.node=e)}))}return e}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}};const _o={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},wo={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ko={ol:!0,ul:!0};function xo(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class So{constructor(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Ir.none,this.stashMarks=[],this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(Ar.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=Ar.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(Ar.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):Ao(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!_o.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Eo{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,o=e.topNode,i=xo(null,e.preserveWhitespace,0)|(n?4:0);r=o?new So(o.type,o.attrs,Ir.none,Ir.none,!0,e.topMatch||o.type.contentMatch,i):new So(n?null:t.schema.topNodeType,null,Ir.none,Ir.none,!0,null,i),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let e=t.getAttribute("style");if(e){let n=this.readStyles(function(t){let e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e));if(!n)return;let[r,o]=n,i=this.top;for(let t=0;t<o.length;t++)this.removePendingMark(o[t],i);for(let t=0;t<r.length;t++)this.addPendingMark(r[t]);this.addElement(t);for(let t=0;t<r.length;t++)this.removePendingMark(r[t],i);for(let t=0;t<o.length;t++)this.addPendingMark(o[t])}else this.addElement(t)}}addTextNode(t){let e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}addElement(t,e){let n,r=t.nodeName.toLowerCase();ko.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&ko.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:wo.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let e,n=this.top,i=this.needsBlock;if(_o.hasOwnProperty(r))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),e=!0,n.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),e&&this.sync(n),this.needsBlock=i}else this.addElementByRule(t,o,!1===o.consuming?n:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=Ir.none,n=Ir.none;t:for(let r=0;r<t.length;r+=2)for(let o;;){let i=this.parser.matchStyle(t[r],t[r+1],this,o);if(!i)continue t;if(i.ignore)return null;if(i.clearMark?this.top.pendingMarks.forEach((t=>{i.clearMark(t)&&(n=t.addToSet(n))})):e=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(e),!1!==i.consuming)break;o=i}return[e,n]}addElementByRule(t,e,n){let r,o,i;if(e.node)o=this.parser.schema.nodes[e.node],o.isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs||null,e.preserveWhitespace);else{i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i)}let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(t,e,n){let r=e||0;for(let o=e?t.childNodes[e]:t.firstChild,i=null==n?null:t.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(o);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(let t=0;t<e.length;t++)this.enterInner(e[t],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(t)){this.closeExtra();let e=this.top;e.applyPending(t.type),e.match&&(e.match=e.match.matchType(t.type));let n=e.activeMarks;for(let r=0;r<t.marks.length;r++)e.type&&!e.type.allowsMarkType(t.marks[r].type)||(n=t.marks[r].addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n){let r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}enterInner(t,e=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let i=xo(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new So(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)){e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,e){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function Oo(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Co(t){let e={};for(let n in t)e[n]=t[n];return e}function Ao(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:o}=t.edge(n);if(r==e)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class Mo{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=No(e).createDocumentFragment());let r=n,o=[];return t.forEach((t=>{if(o.length||t.marks.length){let n=0,i=0;for(;n<o.length&&i<t.marks.length;){let e=t.marks[i];if(this.marks[e.type.name]){if(!e.eq(o[n][0])||!1===e.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<t.marks.length;){let n=t.marks[i++],s=this.serializeMark(n,t.isInline,e);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))})),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=Mo.renderSpec(No(e),this.nodes[t.type.name](t));if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&Mo.renderSpec(No(n),r(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let r,o=e[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?t.createElementNS(n,o):t.createElement(o),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let o=l;o<e.length;o++){let i=e[o];if(0===i){if(o<e.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=Mo.renderSpec(t,i,n);if(s.appendChild(e),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Mo(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=To(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return To(t.marks)}}function To(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function No(t){return t.document||window.document}const Io=Math.pow(2,16);function Ro(t){return 65535&t}class Lo{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Do{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&Do.empty)return Do.empty}recover(t){let e=0,n=Ro(t);if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/Io}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;let l=this.ranges[s+o],c=this.ranges[s+i],u=a+l;if(t<=u){let o=a+r+((l?t==a?-1:t==u?1:e:e)<0?0:c);if(n)return o;let i=t==(e<0?a:u)?null:s/3+(t-a)*Io,h=t==a?2:t==u?1:4;return(e<0?t!=a:t!=u)&&(h|=8),new Lo(o,h,i)}r+=c-l}return n?t+r:new Lo(t+r,0,null)}touches(t,e){let n=0,r=Ro(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+o];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+e],c=this.ranges[r+n];t(s,s+l,a,a+c),o+=c-l}}invert(){return new Do(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?Do.empty:new Do(t<0?[0,-t,0]:[0,0,t])}}Do.empty=new Do([]);class $o{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new $o(this.maps,this.mirror,t,e)}copy(){return new $o(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new $o;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(t,e);if(null!=o.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(o.recover);continue}}r|=o.delInfo,t=o.pos}return n?t:new Lo(t,r,null)}}const Po=Object.create(null);class zo{getMap(){return Do.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Po[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Po)throw new RangeError("Duplicate use of step JSON ID "+t);return Po[t]=e,e.prototype.jsonID=t,e}}class jo{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new jo(t,null)}static fail(t){return new jo(null,t)}static fromReplace(t,e,n,r){try{return jo.ok(t.replace(e,n,r))}catch(t){if(t instanceof Rr)return jo.fail(t.message);throw t}}}function Fo(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(Fo(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return Ar.fromArray(r)}class Ho extends zo{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new Lr(Fo(e.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return jo.fromReplace(t,this.from,this.to,o)}invert(){return new Bo(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new Ho(e.pos,n.pos,this.mark)}merge(t){return t instanceof Ho&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ho(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ho(e.from,e.to,t.markFromJSON(e.mark))}}zo.jsonID("addMark",Ho);class Bo extends zo{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new Lr(Fo(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return jo.fromReplace(t,this.from,this.to,n)}invert(){return new Ho(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new Bo(e.pos,n.pos,this.mark)}merge(t){return t instanceof Bo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Bo(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Bo(e.from,e.to,t.markFromJSON(e.mark))}}zo.jsonID("removeMark",Bo);class Vo extends zo{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return jo.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return jo.fromReplace(t,this.pos,this.pos+1,new Lr(Ar.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new Vo(this.pos,e.marks[n]);return new Vo(this.pos,this.mark)}}return new Wo(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Vo(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Vo(e.pos,t.markFromJSON(e.mark))}}zo.jsonID("addNodeMark",Vo);class Wo extends zo{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return jo.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return jo.fromReplace(t,this.pos,this.pos+1,new Lr(Ar.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new Vo(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Wo(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Wo(e.pos,t.markFromJSON(e.mark))}}zo.jsonID("removeNodeMark",Wo);class qo extends zo{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&Ko(t,this.from,this.to)?jo.fail("Structure replace would overwrite content"):jo.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Do([this.from,this.to-this.from,this.slice.size])}invert(t){return new qo(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new qo(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof qo)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?Lr.empty:new Lr(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new qo(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?Lr.empty:new Lr(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new qo(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new qo(e.from,e.to,Lr.fromJSON(t,e.slice),!!e.structure)}}zo.jsonID("replace",qo);class Uo extends zo{constructor(t,e,n,r,o,i,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(Ko(t,this.from,this.gapFrom)||Ko(t,this.gapTo,this.to)))return jo.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return jo.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?jo.fromReplace(t,this.from,this.to,n):jo.fail("Content does not fit in gap")}getMap(){return new Do([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new Uo(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||o>n.pos?null:new Uo(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Uo(e.from,e.to,e.gapFrom,e.gapTo,Lr.fromJSON(t,e.slice),e.insert,!!e.structure)}}function Ko(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function Jo(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Go(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!Jo(r,o,i))break}return null}function Yo(t,e,n=null,r=t){let o=function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<o;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(Xo).concat({type:e,attrs:n}).concat(i.map(Xo)):null}function Xo(t){return{type:t,attrs:null}}function Zo(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let t=o.depth-1,e=n-2;t>i;t--,e--){let n=o.node(t),i=o.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[e]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function Qo(t,e){let n=t.resolve(e),r=n.index();return ti(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ti(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}function ei(t,e,n=-1){let r=t.resolve(e);for(let t=r.depth;;t--){let o,i,s=r.index(t);if(t==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(t+1),s++,i=r.node(t).maybeChild(s)):(o=r.node(t).maybeChild(s-1),i=r.node(t+1)),o&&!o.isTextblock&&ti(o,i)&&r.node(t).canReplace(s,s+1))return e;if(0==t)break;e=n<0?r.before(t):r.after(t)}}function ni(t,e,n=e,r=Lr.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return ri(o,i,r)?new qo(e,n,r):new oi(o,i,r).fit()}function ri(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}zo.jsonID("replaceAround",Uo);class oi{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=Ar.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=Ar.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new Lr(o,i,s);return t>-1?new Uo(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new qo(n.pos,r.pos,a):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=ai(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let i,{type:s,match:a}=this.frontier[n],l=null;if(1==t&&(o?a.matchType(o.type)||(l=a.fillBefore(Ar.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:n,parent:r,inject:l};if(2==t&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:n,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=ai(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new Lr(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=ai(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new Lr(ii(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new Lr(ii(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-t,l=0,c=[],{match:u,type:h}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)c.push(r.child(t));u=u.matchFragment(r)}let p=s.size+t-(i.content.size-i.openEnd);for(;l<s.childCount;){let t=s.child(l),e=u.matchType(t.type);if(!e)break;l++,(l>1||0==a||t.content.size)&&(u=e,c.push(li(t.mark(h.allowedMarks(t.marks)),1==l?a:0,l==s.childCount?p:-1)))}let d=l==s.childCount;d||(p=-1),this.placed=si(this.placed,e,Ar.from(c)),this.frontier[e].match=u,d&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=s;t<p;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=d?0==t?Lr.empty:new Lr(ii(i.content,t-1,1),t-1,p<0?i.openEnd:t-1):new Lr(ii(i.content,t,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!ci(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),i=ci(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=ci(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=si(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=si(this.placed,this.depth,Ar.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Ar.empty,!0);t.childCount&&(this.placed=si(this.placed,this.frontier.length,t))}}function ii(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ii(t.firstChild.content,e-1,n)))}function si(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(si(t.lastChild.content,e-1,n)))}function ai(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function li(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,li(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Ar.empty,!0)))),t.copy(r)}function ci(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function ui(t){return t.spec.defining||t.spec.definingForContent}function hi(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(hi(o.content,e+1,n,r,o)))}if(e>r){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(Ar.empty,!0))}return t}function pi(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}class di extends zo{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return jo.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return jo.fromReplace(t,this.pos,this.pos+1,new Lr(Ar.from(r),0,e.isLeaf?0:1))}getMap(){return Do.empty}invert(t){return new di(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new di(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new di(e.pos,e.attr,e.value)}}zo.jsonID("attr",di);let fi=class extends Error{};fi=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(fi.prototype=Object.create(Error.prototype)).constructor=fi,fi.prototype.name="TransformError";class mi{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new $o}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new fi(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=Lr.empty){let r=ni(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new Lr(Ar.from(n),0,0))}delete(t,e){return this.replace(t,e,Lr.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(ri(o,i,r))return t.step(new qo(e,n,r));let s=pi(o,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(t)>-1?a=t:o.before(t)==e&&s.splice(1,0,-t)}let l=s.indexOf(a),c=[],u=r.openStart;for(let t=r.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==r.openStart)break;t=n.content}for(let t=u-1;t>=0;t--){let e=c[t].type,n=ui(e);if(n&&o.node(l).type!=e)u=t;else if(n||!e.isTextblock)break}for(let e=r.openStart;e>=0;e--){let a=(e+u+1)%(r.openStart+1),h=c[a];if(h)for(let e=0;e<s.length;e++){let c=s[(e+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let p=o.node(c-1),d=o.index(c-1);if(p.canReplaceWith(d,d,h.type,h.marks))return t.replace(o.before(c),u?i.after(c):n,new Lr(hi(r.content,0,r.openStart,a),a,r.openEnd))}}let h=t.steps.length;for(let a=s.length-1;a>=0&&(t.replace(e,n,r),!(t.steps.length>h));a--){let t=s[a];t<0||(e=o.before(t),n=i.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)return null}return null}(t.doc,e,r.type);null!=o&&(e=n=o)}t.replaceRange(e,n,new Lr(Ar.from(r),0,0))}(this,t,e,n),this}deleteRange(t,e){return function(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=pi(r,o);for(let e=0;e<i.length;e++){let n=i[e],s=e==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return t.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return t.delete(r.before(i),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=Ar.empty,h=0;for(let t=i,e=!1;t>n;t--)e||r.index(t)>0?(e=!0,u=Ar.from(r.node(t).copy(u)),h++):l--;let p=Ar.empty,d=0;for(let t=i,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,p=Ar.from(o.node(t).copy(p)),d++):c++;t.step(new Uo(l,c,s,a,new Lr(u.append(p),h,d),u.size-h,!0))}(this,t,e),this}join(t,e=1){return function(t,e,n){let r=new qo(e-n,e+n,Lr.empty,!0);t.step(r)}(this,t,e),this}wrap(t,e){return function(t,e,n){let r=Ar.empty;for(let t=n.length-1;t>=0;t--){if(r.size){let e=n[t].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Ar.from(n[t].type.create(n[t].attrs,r))}let o=e.start,i=e.end;t.step(new Uo(o,i,o,i,new Lr(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,o)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(i).map(n),r)){t.clearIncompatible(t.mapping.slice(i).map(n,1),r);let s=t.mapping.slice(i),a=s.map(n,1),l=s.map(n+e.nodeSize,1);return t.step(new Uo(a,l,a+1,l-1,new Lr(Ar.from(r.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Uo(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new Lr(Ar.from(s),0,0),1,!0))}(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new di(t,e,n)),this}addNodeMark(t,e){return this.step(new Vo(t,e)),this}removeNodeMark(t,e){if(!(e instanceof Ir)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new Wo(t,e)),this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=Ar.empty,s=Ar.empty;for(let t=o.depth,e=o.depth-n,a=n-1;t>e;t--,a--){i=Ar.from(o.node(t).copy(i));let e=r&&r[a];s=Ar.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new qo(e,e,new Lr(i.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let u=t.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),h=Math.min(l+t.nodeSize,n),p=r.addToSet(u);for(let t=0;t<u.length;t++)u[t].isInSet(p)||(o&&o.to==c&&o.mark.eq(u[t])?o.to=h:s.push(o=new Bo(c,h,u[t])));i&&i.to==c?i.to=h:a.push(i=new Ho(c,h,r))}})),s.forEach((e=>t.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof go){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;t<a.length;t++){let n,l=a[t];for(let t=0;t<o.length;t++){let e=o[t];e.step==i-1&&l.eq(o[t].style)&&(n=e)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,e),to:r,step:i})}}})),o.forEach((e=>t.step(new Bo(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let e=0;e<o.childCount;e++){let a=o.child(e),l=s+a.nodeSize,c=r.matchType(a.type);if(c){r=c;for(let e=0;e<a.marks.length;e++)n.allowsMarkType(a.marks[e].type)||t.step(new Bo(s,l,a.marks[e]))}else i.push(new qo(s,l,Lr.empty));s=l}if(!r.validEnd){let e=r.fillBefore(Ar.empty,!0);t.replace(s,s,new Lr(e,0,0))}for(let e=i.length-1;e>=0;e--)t.step(i[e])}(this,t,e,n),this}}const gi=Object.create(null);class yi{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new vi(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=Lr.empty){let n=e.content.lastChild,r=null;for(let t=0;t<e.openEnd;t++)r=n,n=n.lastChild;let o=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=t.mapping.slice(o);t.replaceRange(c.map(a.pos),c.map(l.pos),s?Lr.empty:e),0==s&&Ai(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=t.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?t.deleteRange(l,c):(t.replaceRangeWith(l,c,e),Ai(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new wi(t):Ci(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let o=e<0?Ci(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):Ci(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Ei(t.node(0))}static atStart(t){return Ci(t,t,0,0,1)||new Ei(t)}static atEnd(t){return Ci(t,t,t.content.size,t.childCount,-1)||new Ei(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=gi[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in gi)throw new RangeError("Duplicate use of selection JSON ID "+t);return gi[t]=e,e.prototype.jsonID=t,e}getBookmark(){return wi.between(this.$anchor,this.$head).getBookmark()}}yi.prototype.visible=!0;class vi{constructor(t,e){this.$from=t,this.$to=e}}let bi=!1;function _i(t){bi||t.parent.inlineContent||(bi=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class wi extends yi{constructor(t,e=t){_i(t),_i(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return yi.near(n);let r=t.resolve(e.map(this.anchor));return new wi(r.parent.inlineContent?r:n,n)}replace(t,e=Lr.empty){if(super.replace(t,e),e==Lr.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof wi&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new ki(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new wi(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=yi.findFrom(e,n,!0)||yi.findFrom(e,-n,!0);if(!t)return yi.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(yi.findFrom(t,-n,!0)||yi.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new wi(t,e)}}yi.jsonID("text",wi);class ki{constructor(t,e){this.anchor=t,this.head=e}map(t){return new ki(t.map(this.anchor),t.map(this.head))}resolve(t){return wi.between(t.resolve(this.anchor),t.resolve(this.head))}}class xi extends yi{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),o=t.resolve(r);return n?yi.near(o):new xi(o)}content(){return new Lr(Ar.from(this.node),0,0)}eq(t){return t instanceof xi&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Si(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new xi(t.resolve(e.anchor))}static create(t,e){return new xi(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}xi.prototype.visible=!1,yi.jsonID("node",xi);class Si{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new ki(n,n):new Si(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&xi.isSelectable(n)?new xi(e):yi.near(e)}}class Ei extends yi{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=Lr.empty){if(e==Lr.empty){t.delete(0,t.doc.content.size);let e=yi.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ei(t)}map(t){return new Ei(t)}eq(t){return t instanceof Ei}getBookmark(){return Oi}}yi.jsonID("all",Ei);const Oi={map(){return this},resolve:t=>new Ei(t)};function Ci(t,e,n,r,o,i=!1){if(e.inlineContent)return wi.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&xi.isSelectable(r))return xi.create(t,n-(o<0?r.nodeSize:0))}else{let e=Ci(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function Ai(t,e,n){let r=t.steps.length-1;if(r<e)return;let o,i=t.steps[r];(i instanceof qo||i instanceof Uo)&&(t.mapping.maps[r].forEach(((t,e,n,r)=>{null==o&&(o=r)})),t.setSelection(yi.near(t.doc.resolve(o),n)))}function Mi(t,e){return e&&t?t.bind(e):t}class Ti{constructor(t,e,n){this.name=t,this.init=Mi(e.init,n),this.apply=Mi(e.apply,n)}}function Ni(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=Ni(o,e,{})),n[r]=o}return n}new Ti("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Ti("selection",{init:(t,e)=>t.selection||yi.atStart(e.doc),apply:t=>t.selection}),new Ti("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new Ti("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e});class Ii{constructor(t){this.spec=t,this.props={},t.props&&Ni(t.props,this,this.props),this.key=t.key?t.key.key:Li("plugin")}getState(t){return t[this.key]}}const Ri=Object.create(null);function Li(t){return t in Ri?t+"$"+ ++Ri[t]:(Ri[t]=0,t+"$")}class Di{constructor(t="key"){this.key=Li(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const $i=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},Pi=function(t,e,n,r){return n&&(ji(t,e,n,r,-1)||ji(t,e,n,r,1))},zi=/^(img|br|input|textarea|hr)$/i;function ji(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Fi(t))){let n=t.parentNode;if(!n||1!=n.nodeType||Hi(t)||zi.test(t.nodeName)||"false"==t.contentEditable)return!1;e=$i(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?Fi(t):0}}}function Fi(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Hi(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Bi=function(t){return t.focusNode&&Pi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Vi(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const Wi="undefined"!=typeof navigator?navigator:null,qi="undefined"!=typeof document?document:null,Ui=Wi&&Wi.userAgent||"",Ki=/Edge\/(\d+)/.exec(Ui),Ji=/MSIE \d/.exec(Ui),Gi=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ui),Yi=!!(Ji||Gi||Ki),Xi=Ji?document.documentMode:Gi?+Gi[1]:Ki?+Ki[1]:0,Zi=!Yi&&/gecko\/(\d+)/i.test(Ui);Zi&&(/Firefox\/(\d+)/.exec(Ui)||[0,0])[1];const Qi=!Yi&&/Chrome\/(\d+)/.exec(Ui),ts=!!Qi,es=Qi?+Qi[1]:0,ns=!Yi&&!!Wi&&/Apple Computer/.test(Wi.vendor),rs=ns&&(/Mobile\/\w+/.test(Ui)||!!Wi&&Wi.maxTouchPoints>2),is=rs||!!Wi&&/Mac/.test(Wi.platform),ss=/Android \d/.test(Ui),as=!!qi&&"webkitFontSmoothing"in qi.documentElement.style,ls=as?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function cs(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(Bi(n)){for(a=c;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&xi.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==Fi(t);r||o;){if(t==n)return!0;let e=$i(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==Fi(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;l=new xi(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;a=r.resolve(e)}if(!l){l=ys(t,a,c,"pointer"==e||t.state.selection.head<c.pos&&!i?1:-1)}return l}function us(t){return t.editable?t.hasFocus():function(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function hs(t,e=!1){let n=t.state.selection;if(function(t,e){if(e instanceof xi){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(gs(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else gs(t)}(t,n),us(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ts){let e=t.domSelectionRange(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&Pi(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,$i(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&Yi&&Xi<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{let r,o,{anchor:i,head:s}=n;!ps||n instanceof wi||(n.$from.parent.inlineContent||(r=ds(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=ds(t,n.to))),t.docView.setSelection(i,s,t.root,e),ps&&(r&&ms(r),o&&ms(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{us(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const ps=ns||ts&&es<63;function ds(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(ns&&o&&"false"==o.contentEditable)return fs(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return fs(o);if(i)return fs(i)}}function fs(t){return t.contentEditable="true",ns&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function ms(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function gs(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function ys(t,e,n,r){return t.someProp("createSelectionBetween",(r=>r(t,e,n)))||wi.between(e,n,r)}function vs(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&yi.findFrom(i,e)}function bs(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function _s(t,e,n){let r=t.state.selection;if(!(r instanceof wi)){if(r instanceof xi&&r.node.isInline)return bs(t,new wi(e>0?r.$to:r.$from));{let n=vs(t.state,e);return!!n&&bs(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=vs(t.state,e);return!!(n&&n instanceof xi)&&bs(t,n)}if(!(is&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(xi.isSelectable(i)?bs(t,new xi(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!as&&bs(t,new wi(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function ws(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function ks(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function xs(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(Zi&&1==n.nodeType&&r<ws(n)&&ks(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(ks(t))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(Es(n))break;{let e=n.previousSibling;for(;e&&ks(e);)o=n.parentNode,i=$i(e),e=e.previousSibling;if(e)n=e,r=ws(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Os(t,n,r):o&&Os(t,o,i)}function Ss(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=ws(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!ks(n.childNodes[r]))break;o=n,i=++r}else{if(Es(n))break;{let e=n.nextSibling;for(;e&&ks(e);)o=e.parentNode,i=$i(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=ws(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&Os(t,o,i)}function Es(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Os(t,e,n){let r=t.domSelection();if(Bi(r)){let t=document.createRange();t.setEnd(e,n),t.setStart(e,n),r.removeAllRanges(),r.addRange(t)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout((()=>{t.state==o&&hs(t)}),50)}function Cs(t,e,n){let r=t.state.selection;if(r instanceof wi&&!r.empty||n.indexOf("s")>-1)return!1;if(is&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=vs(t.state,e);if(n&&n instanceof xi)return bs(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof Ei?yi.near(n,e):yi.findFrom(n,e);return!!s&&bs(t,s)}return!1}function As(t,e){if(!(t.state.selection instanceof wi))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function Ms(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Ts(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||is&&72==n&&"c"==r?As(t,-1)||xs(t):46==n||is&&68==n&&"c"==r?As(t,1)||Ss(t):13==n||27==n||(37==n||is&&66==n&&"c"==r?_s(t,-1,r)||xs(t):39==n||is&&70==n&&"c"==r?_s(t,1,r)||Ss(t):38==n||is&&80==n&&"c"==r?Cs(t,-1,r)||xs(t):40==n||is&&78==n&&"c"==r?function(t){if(!ns||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Ms(t,n,"true"),setTimeout((()=>Ms(t,n,"false")),20)}return!1}(t)||Cs(t,1,r)||Ss(t):r==(is?"m":"c")&&(66==n||73==n||89==n||90==n))}function Ns(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||Mo.fromSchema(t.state.schema),a=Hs(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,h=0;for(;u&&1==u.nodeType&&(c=js[u.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=a.createElement(c[t]);for(;l.firstChild;)e.appendChild(l.firstChild);l.appendChild(e),h++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`),{dom:l,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n")}}function Is(t,e,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!e)return null;let l=e&&(r||a||!n);if(l){if(t.someProp("transformPastedText",(n=>{e=n(e,a||r,t)})),a)return e?new Lr(Ar.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):Lr.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,o,r,t)));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=Mo.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),i=function(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=Hs().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&js[o[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"</"+t+">")).reverse().join(""));if(r.innerHTML=t,n)for(let t=0;t<n.length;t++)r=r.querySelector(n[t])||r;return r}(n),as&&function(t){let e=t.querySelectorAll(ts?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let t=+u[3];t>0;t--){let t=i.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;i=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||bo.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!l&&!u),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Rs.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}let{content:o,openStart:i,openEnd:s}=t;for(let t=n.length-2;t>=0;t-=2){let e=r.nodes[n[t]];if(!e||e.hasRequiredAttrs())break;o=Ar.from(e.create(n[t+1],o)),i++,s++}return new Lr(o,i,s)}(zs(s,+u[1],+u[2]),u[4]);else if(s=Lr.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n).contentMatchAt(e.index(n)),i=[];if(t.forEach((t=>{if(!i)return;let e,n=o.findWrapping(t.type);if(!n)return i=null;if(e=i.length&&r.length&&Ds(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=$s(i[i.length-1],r.length));let e=Ls(t,n);i.push(e),o=o.matchType(e.type),r=n}})),i)return Ar.from(i)}return t}(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let e=s.content.firstChild;t<s.openStart&&!e.type.spec.isolating;t++,e=e.firstChild);for(let t=s.content.lastChild;e<s.openEnd&&!t.type.spec.isolating;e++,t=t.lastChild);s=zs(s,t,e)}return t.someProp("transformPasted",(e=>{s=e(s,t)})),s}const Rs=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Ls(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Ar.from(t));return t}function Ds(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Ds(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(Ar.from(Ls(n,t,o+1))))}}function $s(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,$s(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(Ar.empty,!0);return t.copy(n.append(r))}function Ps(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return o<r-1&&(a=Ps(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,t.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Ar.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function zs(t,e,n){return e<t.openStart&&(t=new Lr(Ps(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Lr(Ps(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const js={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Fs=null;function Hs(){return Fs||(Fs=document.implementation.createHTMLDocument("title"))}const Bs={},Vs={};function Ws(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function qs(t){return{left:t.clientX,top:t.clientY}}function Us(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(t.someProp(e,(e=>r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function Ks(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Js(t,e,n,r,o){return Us(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(o?function(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof xi&&(n=o.node);let i=t.state.doc.resolve(e);for(let t=i.depth+1;t>0;t--){let e=t>i.depth?i.nodeAfter:i.node(t);if(xi.isSelectable(e)){r=n&&o.$from.depth>0&&t>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(t);break}}return null!=r&&(Ks(t,xi.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&xi.isSelectable(r))&&(Ks(t,new xi(n),"pointer"),!0)}(t,n))}function Gs(t,e,n,r){return Us(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function Ys(t,e,n,r){return Us(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(Ks(t,wi.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(e);for(let e=o.depth+1;e>0;e--){let n=e>o.depth?o.nodeAfter:o.node(e),i=o.before(e);if(n.inlineContent)Ks(t,wi.create(r,i+1,i+1+n.content.size),"pointer");else{if(!xi.isSelectable(n))continue;Ks(t,xi.create(r,i),"pointer")}return!0}}(t,n,r)}function Xs(t){return oa(t)}Vs.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!ta(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!ss||!ts||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!rs||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||Ts(t,n)?n.preventDefault():Ws(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,Vi(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},Vs.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},Vs.keypress=(t,e)=>{let n=e;if(ta(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||is&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof wi&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const Zs=is?"metaKey":"ctrlKey";Bs.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Xs(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[Zs]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(qs(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Qs(t,s,n,!!r)):("doubleClick"==i?Gs:Ys)(t,s.pos,s.inside,n)?n.preventDefault():Ws(t,"pointer"))};class Qs{constructor(t,e,n,r){let o,i;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[Zs],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=t.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof xi&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Zi||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ws(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>hs(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(qs(t))),this.updateAllowDefault(t),this.allowDefault||!e?Ws(this.view,"pointer"):Js(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||ns&&this.mightDrag&&!this.mightDrag.node.isAtom||ts&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(Ks(this.view,yi.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Ws(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ws(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function ta(t,e){return!!t.composing||!!(ns&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}Bs.touchstart=t=>{t.input.lastTouch=Date.now(),Xs(t),Ws(t,"pointer")},Bs.touchmove=t=>{t.input.lastTouch=Date.now(),Ws(t,"pointer")},Bs.contextmenu=t=>Xs(t);const ea=ss?5e3:-1;function na(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>oa(t)),e))}function ra(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function oa(t,e=!1){if(!(ss&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ra(t),e||t.docView&&t.docView.dirty){let e=cs(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}Vs.compositionstart=Vs.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),oa(t,!0),t.markCursor=null;else if(oa(t),Zi&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}na(t,ea)},Vs.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,na(t,20))};const ia=Yi&&Xi<15||rs&&ls<604;function sa(t,e,n,r){let o=Is(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,o||Lr.empty))))return!0;if(!o)return!1;let i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Bs.copy=Vs.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=ia?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Ns(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Vs.paste=(t,e)=>{let n=e;if(t.composing&&!ss)return;let r=ia?null:n.clipboardData;r&&sa(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?sa(t,r.value,null,e):sa(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class aa{constructor(t,e){this.slice=t,this.move=e}}const la=is?"altKey":"ctrlKey";Bs.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(qs(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof xi?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(xi.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(xi.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:l}=Ns(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(ia?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",ia||n.dataTransfer.setData("text/plain",l),t.dragging=new aa(s,!n[la])},Bs.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},Vs.dragover=Vs.dragenter=(t,e)=>e.preventDefault(),Vs.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(qs(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=Is(t,n.dataTransfer.getData(ia?"Text":"text/plain"),ia?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[la]);if(t.someProp("handleDrop",(e=>e(t,n,s||Lr.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let t=0;t<n.openStart;t++)o=o.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,i=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(i,i,o);else{let t=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(i,i,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}(t.state.doc,i.pos,s):i.pos;null==l&&(l=i.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),h=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=c.doc;if(h?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let d=c.doc.resolve(u);if(h&&xi.isSelectable(s.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new xi(d));else{let e=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),c.setSelection(ys(t,d,c.doc.resolve(e)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Bs.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&hs(t)}),20))},Bs.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Bs.beforeinput=(t,e)=>{if(ts&&ss&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,Vi(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let t in Vs)Bs[t]=Vs[t];function ca(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class ua{constructor(t,e){this.toDOM=t,this.spec=e||ma,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new da(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof ua&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ca(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ha{constructor(t,e){this.attrs=t,this.spec=e||ma}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new da(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof ha&&ca(this.attrs,t.attrs)&&ca(this.spec,t.spec)}static is(t){return t.type instanceof ha}destroy(){}}class pa{constructor(t,e){this.attrs=t,this.spec=e||ma}map(t,e,n,r){let o=t.mapResult(e.from+r,1);if(o.deleted)return null;let i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new da(o.pos-n,i.pos-n,this)}valid(t,e){let n,{index:r,offset:o}=t.content.findIndex(e.from);return o==e.from&&!(n=t.child(r)).isText&&o+n.nodeSize==e.to}eq(t){return this==t||t instanceof pa&&ca(this.attrs,t.attrs)&&ca(this.spec,t.spec)}destroy(){}}class da{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new da(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new da(t,t,new ua(e,n))}static inline(t,e,n,r){return new da(t,e,new ha(n,r))}static node(t,e,n,r){return new da(t,e,new pa(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof ha}}const fa=[],ma={};class ga{constructor(t,e){this.local=t.length?t:fa,this.children=e.length?e:fa}static create(t,e){return e.length?ka(e,t,0,ma):ya}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<e&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==ya||0==t.maps.length?this:this.mapInner(t,e,0,0,n||ma)}mapInner(t,e,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){let a=t.slice();for(let t=0,e=i;t<n.maps.length;t++){let r=0;n.maps[t].forEach(((t,n,i,s)=>{let l=s-i-(n-t);for(let s=0;s<a.length;s+=3){let c=a[s+1];if(c<0||t>c+e-r)continue;let u=a[s]+e-r;n>=u?a[s+1]=t<=u?-2:-1:i>=o&&l&&(a[s]+=l,a[s+1]+=l)}r+=l})),e=n.maps[t].map(e,-1)}let l=!1;for(let e=0;e<a.length;e+=3)if(a[e+1]<0){if(-2==a[e+1]){l=!0,a[e+1]=-1;continue}let c=n.map(t[e]+i),u=c-o;if(u<0||u>=r.content.size){l=!0;continue}let h=n.map(t[e+1]+i,-1)-o,{index:p,offset:d}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&d==u&&d+f.nodeSize==h){let r=a[e+2].mapInner(n,f,c+1,t[e]+i+1,s);r!=ya?(a[e]=u,a[e+1]=h,a[e+2]=r):(a[e+1]=-2,l=!0)}else l=!0}if(l){let l=function(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i<t.local.length;i++){let a=t.local[i].map(r,o,e);a?n.push(a):s.onRemove&&s.onRemove(t.local[i].spec)}for(let n=0;n<t.children.length;n+=3)a(t.children[n+2],t.children[n]+e+1)}for(let n=0;n<t.length;n+=3)-1==t[n+1]&&a(t[n+2],e[n]+i+1);return n}(a,t,e,n,o,i,s),c=ka(l,r,0,s);e=c.local;for(let t=0;t<a.length;t+=3)a[t+1]<0&&(a.splice(t,3),t-=3);for(let t=0,e=0;t<c.children.length;t+=3){let n=c.children[t];for(;e<a.length&&a[e]<n;)e+=3;a.splice(e,0,c.children[t],c.children[t+1],c.children[t+2])}}return new ga(e.sort(xa),a)}(this.children,i||[],t,e,n,r,o):i?new ga(i.sort(xa),fa):ya}add(t,e){return e.length?this==ya?ga.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,o=0;t.forEach(((t,i)=>{let s,a=i+n;if(s=_a(e,t,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(t,s,a+1):r.splice(o,0,i,i+t.nodeSize,ka(s,t,a+1,ma)),o+=3}}));let i=ba(o?wa(e):e,-n);for(let e=0;e<i.length;e++)i[e].type.valid(t,i[e])||i.splice(e--,1);return new ga(i.length?this.local.concat(i).sort(xa):this.local,r||this.children)}remove(t){return 0==t.length||this==ya?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+e,s=n[r+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(o||(o=[])).push(e));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=ya?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<t.length;o++)if(n=t[o])for(let t=0;t<r.length;t++)r[t].eq(n,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new ga(r,n):ya}forChild(t,e){if(this==ya)return this;if(e.isLeaf)return ga.empty;let n,r;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(n=this.children[e+2]);break}let o=t+1,i=o+e.content.size;for(let t=0;t<this.local.length;t++){let e=this.local[t];if(e.from<i&&e.to>o&&e.type instanceof ha){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let t=new ga(r.sort(xa),fa);return n?new va([t,n]):t}return n||ya}eq(t){if(this==t)return!0;if(!(t instanceof ga)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Sa(this.localsInner(t))}localsInner(t){if(this==ya)return fa;if(t.inlineContent||!this.local.some(ha.is))return this.local;let e=[];for(let t=0;t<this.local.length;t++)this.local[t].type instanceof ha||e.push(this.local[t]);return e}}ga.empty=new ga([],[]),ga.removeOverlap=Sa;const ya=ga.empty;class va{constructor(t){this.members=t}map(t,e){const n=this.members.map((n=>n.map(t,e,ma)));return va.from(n)}forChild(t,e){if(e.isLeaf)return ga.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=ya&&(o instanceof va?n=n.concat(o.members):n.push(o))}return va.from(n)}eq(t){if(!(t instanceof va)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<o.length;t++)e.push(o[t])}else e=o}return e?Sa(n?e:e.sort(xa)):fa}static from(t){switch(t.length){case 0:return ya;case 1:return t[0];default:return new va(t.every((t=>t instanceof ga))?t:t.reduce(((t,e)=>t.concat(e instanceof ga?e:e.members)),[]))}}}function ba(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new da(o.from+e,o.to+e,o.type))}return n}function _a(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let e,i=0;i<t.length;i++)(e=t[i])&&e.from>n&&e.to<r&&((o||(o=[])).push(e),t[i]=null);return o}function wa(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function ka(t,e,n,r){let o=[],i=!1;e.forEach(((e,s)=>{let a=_a(t,e,s+n);if(a){i=!0;let t=ka(a,e,n+s+1,r);t!=ya&&o.push(s,s+e.nodeSize,t)}}));let s=ba(i?wa(t):t,-n).sort(xa);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||(r.onRemove&&r.onRemove(s[t].spec),s.splice(t--,1));return s.length||o.length?new ga(s,o):ya}function xa(t,e){return t.from-e.from||t.to-e.to}function Sa(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Ea(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Ea(e,o+1,i.copy(r.to,i.to)))}}return e}function Ea(t,e,n){for(;e<t.length&&xa(n,t[e])>0;)e++;t.splice(e,0,n)}for(var Oa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ca={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Aa="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Ma="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ta="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Na=Ma||Aa&&+Aa[1]<57,Ia=0;Ia<10;Ia++)Oa[48+Ia]=Oa[96+Ia]=String(Ia);for(Ia=1;Ia<=24;Ia++)Oa[Ia+111]="F"+Ia;for(Ia=65;Ia<=90;Ia++)Oa[Ia]=String.fromCharCode(Ia+32),Ca[Ia]=String.fromCharCode(Ia);for(var Ra in Oa)Ca.hasOwnProperty(Ra)||(Ca[Ra]=Oa[Ra]);const La="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Da(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let t=0;t<i.length-1;t++){let s=i[t];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);La?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function $a(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function Pa(t){let e=function(t){let e=Object.create(null);for(let n in t)e[Da(n)]=t[n];return e}(t);return function(t,n){let r,o=function(t){var e=!(Na&&(t.ctrlKey||t.altKey||t.metaKey)||Ta&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Ca:Oa)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==o.length&&" "!=o,s=e[$a(o,n,!i)];if(s&&s(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=Oa[n.keyCode])&&r!=o){let o=e[$a(r,n,!0)];if(o&&o(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){let r=e[$a(o,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}function za(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function ja(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Fa(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function Ha(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Ba(t,e,n){let r,o,i=e.nodeBefore,s=e.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!Qo(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=e.pos+s.nodeSize,a=Ar.empty;for(let t=r.length-1;t>=0;t--)a=Ar.from(r[t].create(null,a));a=Ar.from(i.copy(a));let l=t.tr.step(new Uo(e.pos-1,o,e.pos,o,new Lr(a,1,0),r.length,!0)),c=o+2*r.length;Qo(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=yi.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&Go(c);if(null!=u&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&za(s,"start",!0)&&za(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=Ar.empty;for(let t=o.length-1;t>=0;t--)r=Ar.from(o[t].copy(r));n(t.tr.step(new Uo(e.pos-o.length,e.pos+s.nodeSize,e.pos+l,e.pos+s.nodeSize-l,new Lr(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Va(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(wi.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const Wa=Va(-1),qa=Va(1);function Ua(t,e=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)o=!0;else{let e=n.doc.resolve(i),r=e.index();o=e.parent.canReplaceWith(r,r+1,t)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,t,e)}r(o.scrollIntoView())}return!0}}function Ka(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);l=new Yr(t,t,s.depth),s.endIndex<s.parent.childCount&&(s=new Yr(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=Yo(l,t,e,s);return!!c&&(r&&r(function(t,e,n,r,o){let i=Ar.empty;for(let t=n.length-1;t>=0;t--)i=Ar.from(n[t].type.create(n[t].attrs,i));t.step(new Uo(e.start-(r?2:0),e.end,e.start,e.end,new Lr(i,0,0),n.length,!0));let s=0;for(let t=0;t<n.length;t++)n[t].type==o&&(s=t+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let n=e.startIndex,r=e.endIndex,o=!0;n<r;n++,o=!1)!o&&Zo(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(n).nodeSize;return t}(n.tr,s,c,a,t).scrollIntoView()),!0)}}function Ja(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));return!!i&&(!n||(r.node(i.depth-1).type==t?function(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new Uo(i-1,s,i,s,new Lr(Ar.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Yr(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=Go(r);if(null==a)return!1;o.lift(r,a);let l=o.mapping.map(i,-1)-1;Qo(o.doc,l)&&o.join(l);return e(o.scrollIntoView()),!0}(e,n,t,i):function(t,e,n){let r=t.tr,o=n.parent;for(let t=n.end,e=n.endIndex-1,i=n.startIndex;e>i;e--)t-=o.child(e).nodeSize,r.delete(t-1,t+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?Ar.empty:Ar.from(o))))return!1;let h=i.pos,p=h+s.nodeSize;return r.step(new Uo(h-(a?1:0),p+(l?1:0),h+1,p-1,new Lr((a?Ar.empty:Ar.from(o.copy(Ar.empty))).append(l?Ar.empty:Ar.from(o.copy(Ar.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,n,i)))}}function Ga(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class Ya{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!t,l=t||o.tr,c={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const r=this.buildProps(l,e),o=n(...t)(r);return s.push(o),c}]))),run:()=>(a||!e||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every((t=>!0===t)))};return c}createCan(t){const{rawCommands:e,state:n}=this,r=t||n.tr,o=this.buildProps(r,false),i=Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...o,dispatch:void 0})])));return{...i,chain:()=>this.createChain(r,false)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:t,editor:r,view:i,state:Ga({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}}function Xa(t,e,n){if(void 0===t.config[e]&&t.parent)return Xa(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?Xa(t.parent,e,n):null})}return t.config[e]}function Za(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function Qa(t){const e=[],{nodeExtensions:n,markExtensions:r}=Za(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=Xa(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage});if(!n)return;n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,r])=>{e.push({type:n,name:t,attribute:{...i,...r}})}))}))}))})),o.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},r=Xa(t,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,e.push({type:t.name,name:n,attribute:o})}))})),e}function tl(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function el(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{if(n[t])if("class"===t){const r=e?e.split(" "):[],o=n[t]?n[t].split(" "):[],i=r.filter((t=>!o.includes(t)));n[t]=[...o,...i].join(" ")}else n[t]="style"===t?[n[t],e].join("; "):e;else n[t]=e})),n}),{})}function nl(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>el(t,e)),{})}function rl(t,e=void 0,...n){return function(t){return"function"==typeof t}(t)?e?t.bind(e)(...n):t(...n):t}function ol(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;const o=e.reduce(((t,e)=>{const r=e.attribute.parseHTML?e.attribute.parseHTML(n):function(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}(n.getAttribute(e.name));return null==r?t:{...t,[e.name]:r}}),{});return{...r,...o}}}}function il(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(e))&&null!=e)))}function sl(t,e){var n;const r=Qa(t),{nodeExtensions:o,markExtensions:i}=Za(t),s=null===(n=o.find((t=>Xa(t,"topNode"))))||void 0===n?void 0:n.name,a=Object.fromEntries(o.map((n=>{const o=r.filter((t=>t.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:e},s=il({...t.reduce(((t,e)=>{const r=Xa(e,"extendNodeSchema",i);return{...t,...r?r(n):{}}}),{}),content:rl(Xa(n,"content",i)),marks:rl(Xa(n,"marks",i)),group:rl(Xa(n,"group",i)),inline:rl(Xa(n,"inline",i)),atom:rl(Xa(n,"atom",i)),selectable:rl(Xa(n,"selectable",i)),draggable:rl(Xa(n,"draggable",i)),code:rl(Xa(n,"code",i)),defining:rl(Xa(n,"defining",i)),isolating:rl(Xa(n,"isolating",i)),attrs:Object.fromEntries(o.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=rl(Xa(n,"parseHTML",i));a&&(s.parseDOM=a.map((t=>ol(t,o))));const l=Xa(n,"renderHTML",i);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:nl(t,o)}));const c=Xa(n,"renderText",i);return c&&(s.toText=c),[n.name,s]}))),l=Object.fromEntries(i.map((n=>{const o=r.filter((t=>t.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:e},s=il({...t.reduce(((t,e)=>{const r=Xa(e,"extendMarkSchema",i);return{...t,...r?r(n):{}}}),{}),inclusive:rl(Xa(n,"inclusive",i)),excludes:rl(Xa(n,"excludes",i)),group:rl(Xa(n,"group",i)),spanning:rl(Xa(n,"spanning",i)),code:rl(Xa(n,"code",i)),attrs:Object.fromEntries(o.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=rl(Xa(n,"parseHTML",i));a&&(s.parseDOM=a.map((t=>ol(t,o))));const l=Xa(n,"renderHTML",i);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:nl(t,o)})),[n.name,s]})));return new yo({topNode:s,nodes:a,marks:l})}function al(t,e){return e.nodes[t]||e.marks[t]||null}function ll(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}const cl=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,((t,e,o,i)=>{var s,a;const l=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:e,parent:o,index:i}))||t.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-e))})),n};function ul(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class hl{constructor(t){this.find=t.find,this.handler=t.handler}}const pl=(t,e)=>{if(ul(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function dl(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(e=c.nodeBefore||c.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let u=!1;const h=cl(c)+i;return s.forEach((t=>{if(u)return;const e=pl(h,t.find);if(!e)return;const s=l.state.tr,c=Ga({state:l.state,transaction:s}),p={from:r-(e[0].length-i.length),to:o},{commands:d,chain:f,can:m}=new Ya({editor:n,state:c});null!==t.handler({state:c,range:p,match:e,commands:d,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),u=!0)})),u}function fl(t){const{editor:e,rules:n}=t,r=new Ii({state:{init:()=>null,apply(t,e){const n=t.getMeta(r);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(t,o,i,s)=>dl({editor:e,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&dl({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:i}=t.state.selection;return!!i&&dl({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class ml{constructor(t){this.find=t.find,this.handler=t.handler}}const gl=(t,e)=>{if(ul(e))return[...t.matchAll(e)];const n=e(t);return n?n.map((e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]};function yl(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1,s=new ClipboardEvent("paste"),a=new DragEvent("drop");const l=n.map((t=>new Ii({view(t){const e=e=>{var n;r=(null===(n=t.dom.parentElement)||void 0===n?void 0:n.contains(e.target))?t.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:(t,e)=>(i=r===t.dom.parentElement,a=e,!1),paste:(t,e)=>{var n;const r=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return s=e,o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,l)=>{const c=n[0],u="paste"===c.getMeta("uiEvent")&&!o,h="drop"===c.getMeta("uiEvent")&&!i;if(!u&&!h)return;const p=r.doc.content.findDiffStart(l.doc.content),d=r.doc.content.findDiffEnd(l.doc.content);if("number"!=typeof p||!d||p===d.b)return;const f=l.tr,m=Ga({state:l,transaction:f}),g=function(t){const{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new Ya({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,o,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const p=Math.max(r,e),d=Math.min(o,e+t.content.size),f=t.textBetween(p-e,d-e,void 0,"");gl(f,i.find).forEach((t=>{if(void 0===t.index)return;const e=p+t.index+1,r=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},d=i.handler({state:n,range:o,match:t,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});h.push(d)}))})),h.every((t=>null!==t))}({editor:e,state:m,from:Math.max(p-1,0),to:d.b-1,rule:t,pasteEvent:s,dropEvent:a});return g&&f.steps.length?(a=new DragEvent("drop"),s=new ClipboardEvent("paste"),f):void 0}})));return l}class vl{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=vl.resolve(t),this.schema=sl(this.extensions,e),this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:al(t.name,this.schema)};if("mark"===t.type){(null===(e=rl(Xa(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const r=Xa(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=Xa(t,"onCreate",n);o&&this.editor.on("create",o);const i=Xa(t,"onUpdate",n);i&&this.editor.on("update",i);const s=Xa(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=Xa(t,"onTransaction",n);a&&this.editor.on("transaction",a);const l=Xa(t,"onFocus",n);l&&this.editor.on("focus",l);const c=Xa(t,"onBlur",n);c&&this.editor.on("blur",c);const u=Xa(t,"onDestroy",n);u&&this.editor.on("destroy",u)}))}static resolve(t){const e=vl.sort(vl.flatten(t)),n=function(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return[...new Set(e)]}(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=Xa(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=Xa(t,"priority")||100,r=Xa(e,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((t,e)=>{const n=Xa(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:al(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=vl.sort([...this.extensions].reverse()),n=[],r=[],o=e.map((e=>{const o={name:e.name,options:e.options,storage:e.storage,editor:t,type:al(e.name,this.schema)},i=[],s=Xa(e,"addKeyboardShortcuts",o);let a={};if("mark"===e.type&&e.config.exitable&&(a.ArrowRight=()=>Kl.handleExit({editor:t,mark:e})),s){const e=Object.fromEntries(Object.entries(s()).map((([e,n])=>[e,()=>n({editor:t})])));a={...a,...e}}const l=new Ii({props:{handleKeyDown:Pa(a)}});i.push(l);const c=Xa(e,"addInputRules",o);ll(e,t.options.enableInputRules)&&c&&n.push(...c());const u=Xa(e,"addPasteRules",o);ll(e,t.options.enablePasteRules)&&u&&r.push(...u());const h=Xa(e,"addProseMirrorPlugins",o);if(h){const t=h();i.push(...t)}return i})).flat();return[fl({editor:t,rules:n}),...yl({editor:t,rules:r}),...o]}get attributes(){return Qa(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Za(this.extensions);return Object.fromEntries(e.filter((t=>!!Xa(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,storage:e.storage,editor:t,type:tl(e.name,this.schema)},o=Xa(e,"addNodeView",r);if(!o)return[];return[e.name,(r,i,s,a)=>{const l=nl(r,n);return o()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:e})}]})))}}function bl(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function _l(t,e){const n={...t};return bl(t)&&bl(e)&&Object.keys(e).forEach((r=>{bl(e[r])?r in t?n[r]=_l(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class wl{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=rl(Xa(this,"addOptions",{name:this.name}))),this.storage=rl(Xa(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new wl(t)}configure(t={}){const e=this.extend();return e.options=_l(this.options,t),e.storage=rl(Xa(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new wl(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=rl(Xa(e,"addOptions",{name:e.name})),e.storage=rl(Xa(e,"addStorage",{name:e.name,options:e.options})),e}}wl.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ii({key:new Di("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map((t=>t.$from.pos))),a=Math.max(...i.map((t=>t.$to.pos))),l=function(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}(n);return function(t,e,n){const{from:r,to:o}=e,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return t.nodesBetween(r,o,((t,n,c,u)=>{var h;const p=null==s?void 0:s[t.type.name];p?(t.isBlock&&!l&&(a+=i,l=!0),c&&(a+=p({node:t,pos:n,parent:c,index:u,range:e}))):t.isText?(a+=null===(h=null==t?void 0:t.text)||void 0===h?void 0:h.slice(Math.max(r,n)-n,o-n),l=!1):t.isBlock&&!l&&(a+=i,l=!0)})),a}(r,{from:s,to:a},{textSerializers:l})}}})]}});function kl(t,e,n={strict:!0}){const r=Object.keys(e);return!r.length||r.every((r=>n.strict?e[r]===t[r]:ul(e[r])?e[r].test(t[r]):e[r]===t[r]))}function xl(t,e,n={}){return t.find((t=>t.type===e&&kl(t.attrs,n)))}function Sl(t,e,n={}){return!!xl(t,e,n)}function El(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&0!==r.offset&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=xl([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(xl([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&Sl([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Ol(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Cl(t){return t instanceof wi}function Al(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Ml(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Tl(t){const e=`<body>${t}</body>`;return(new window.DOMParser).parseFromString(e,"text/html").body}function Nl(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?Ar.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Nl("",e,n)}if("string"==typeof t){const r=bo.fromSchema(e);return n.slice?r.parseSlice(Tl(t),n.parseOptions).content:r.parse(Tl(t),n.parseOptions)}return Nl("",e,n)}function Il(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Rl(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?tl(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,((t,e)=>{if(t.isText)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a.push({node:t,from:n,to:i})}));const l=o-r,c=a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>kl(t.node.attrs,n,{strict:!1})));if(i)return!!c.length;return c.reduce(((t,e)=>t+e.to-e.from),0)>=l}function Ll(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Dl(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{})}function $l(t,e){const n=Ol(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,(t=>{s.push(...t.marks)}));const a=s.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function Pl(t){return e=>function(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}(e.$from,t)}function zl(t,e){const n=Ll("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=tl(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,(t=>{i.push(t)}));const s=i.reverse().find((t=>t.type.name===n.name));return s?{...s.attrs}:{}}(t,e):"mark"===n?$l(t,e):{}}function jl(t){const e=function(t,e=JSON.stringify){const n={};return t.filter((t=>{const r=e(t);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(t);return 1===e.length?e:e.filter(((t,n)=>{const r=e.filter(((t,e)=>e!==n));return!r.some((e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))}))}function Fl(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach((e=>{const o=El(n.resolve(t-1),e.type);o&&r.push({mark:e,...o})})):n.nodesBetween(t,e,((t,e)=>{r.push(...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n}))))})),r}function Hl(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=t.find((t=>t.type===e&&t.name===n));return!!r&&r.attribute.keepOnSplit})))}function Bl(t,e){const{nodeExtensions:n}=Za(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=rl(Xa(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function Vl(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(r)}}const Wl=(t,e)=>{const n=Pl((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Qo(t.doc,n.pos)||(t.join(n.pos),!0)},ql=(t,e)=>{const n=Pl((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Qo(t.doc,r)||(t.join(r),!0)};var Ul=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{t.doc.nodesBetween(n.pos,r.pos,((t,n)=>{if(t.type.isText)return;const{doc:r,mapping:o}=e,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+t.nodeSize)),a=i.blockRange(s);if(!a)return;const l=Go(a);if(t.type.isTextblock){const{defaultType:t}=i.parent.contentMatchAt(i.index());e.setNodeMarkup(a.start,t)}(l||0===l)&&e.lift(a,l)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>((t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Ei||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Ha(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(n,i.createAndFill());s.setSelection(wi.create(s.doc,n+1)),e(s.scrollIntoView())}return!0})(t,e),cut:(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new wi(r.doc.resolve(s-1))),!0},deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let n=o.depth;n>0;n-=1){if(o.node(n).type===r.type){if(e){const e=o.before(n),r=o.after(n);t.delete(e,r).scrollIntoView()}return!0}}return!1},deleteNode:t=>({tr:e,state:n,dispatch:r})=>{const o=tl(t,n.schema),i=e.selection.$anchor;for(let t=i.depth;t>0;t-=1){if(i.node(t).type===o){if(r){const n=i.before(t),r=i.after(t);e.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},deleteSelection:()=>({state:t,dispatch:e})=>((t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0))(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>((t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=Ha(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(yi.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0})(t,e),extendMarkRange:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Ol(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const t=El(l,i,e);if(t&&t.from<=c&&t.to>=u){const e=wi.create(s,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{Ml()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===t||!1===t)return!0;if(i&&null===t&&!Cl(n.state.selection))return s(),!0;const a=function(t,e=null){if(!e)return null;const n=yi.atStart(t),r=yi.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?wi.create(t,Al(0,o,i),Al(t.content.size,o,i)):wi.create(t,Al(e,o,i),Al(e,o,i))}(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},forEach:(t,e)=>n=>t.every(((t,r)=>e(t,{...n,index:r}))),insertContent:(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Nl(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},l=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((t=>{t.check(),l=!!l&&(t.isText&&0===t.marks.length),c=!!c&&t.isBlock})),s===a&&c){const{parent:t}=r.doc.resolve(s);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(s-=1,a+=1)}l?Array.isArray(e)?r.insertText(e.map((t=>t.text||"")).join(""),s,a):"object"==typeof e&&e&&e.text?r.insertText(e.text,s,a):r.insertText(e,s,a):r.replaceWith(s,a,o),n.updateSelection&&function(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof qo||o instanceof Uo))return;const i=t.mapping.maps[r];let s=0;i.forEach(((t,e,n,r)=>{0===s&&(s=r)})),t.setSelection(yi.near(t.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinUp:()=>({state:t,dispatch:e})=>((t,e)=>{let n,r=t.selection,o=r instanceof xi;if(o){if(r.node.isTextblock||!Qo(t.doc,r.from))return!1;n=r.from}else if(n=ei(t.doc,r.from,-1),null==n)return!1;if(e){let r=t.tr.join(n);o&&r.setSelection(xi.create(r.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(r.scrollIntoView())}return!0})(t,e),joinDown:()=>({state:t,dispatch:e})=>((t,e)=>{let n,r=t.selection;if(r instanceof xi){if(r.node.isTextblock||!Qo(t.doc,r.to))return!1;n=r.to}else if(n=ei(t.doc,r.to,1),null==n)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0})(t,e),joinBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!r)return!1;let o=ja(r);if(!o){let n=r.blockRange(),o=n&&Go(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&Ba(t,o,e))return!0;if(0==r.parent.content.size&&(za(i,"end")||xi.isSelectable(i))){let n=ni(t.doc,r.before(),r.after(),Lr.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(za(i,"end")?yi.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):xi.create(r.doc,o.pos-i.nodeSize)),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))})(t,e),joinForward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}(t,n);if(!r)return!1;let o=Fa(r);if(!o)return!1;let i=o.nodeAfter;if(Ba(t,o,e))return!0;if(0==r.parent.content.size&&(za(i,"start")||xi.isSelectable(i))){let n=ni(t.doc,r.before(),r.after(),Lr.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(za(i,"start")?yi.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):xi.create(r.doc,r.mapping.map(o.pos))),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))})(t,e),joinItemBackward:()=>({tr:t,state:e,dispatch:n})=>{try{const r=ei(e.doc,e.selection.$from.pos,-1);return null!=r&&(t.join(r,2),n&&n(t),!0)}catch{return!1}},joinItemForward:()=>({state:t,dispatch:e,tr:n})=>{try{const r=ei(t.doc,t.selection.$from.pos,1);return null!=r&&(n.join(r,2),e&&e(n),!0)}catch(t){return!1}},keyboardShortcut:t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let t=0;t<e.length-1;t+=1){const s=e[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Ml()||Il()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(t).split(/-(?!$)/),s=i.find((t=>!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==l||l.steps.forEach((t=>{const e=t.map(r.mapping);e&&o&&r.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:r})=>!!Rl(n,tl(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Go(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:t,dispatch:e})=>((t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Zo(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Go(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)})(t,e),liftListItem:t=>({state:e,dispatch:n})=>Ja(tl(t,e.schema))(e,n),newlineInCode:()=>({state:t,dispatch:e})=>((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(e&&e(t.tr.insertText("\n").scrollIntoView()),0))})(t,e),resetAttributes:(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Ll("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=tl(t,r.schema)),"mark"===a&&(s=Ol(t,r.schema)),o&&n.selection.ranges.forEach((t=>{r.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,Dl(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(Dl(o.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),selectNodeBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=ja(r)}let s=i&&i.nodeBefore;return!(!s||!xi.isSelectable(s)||(e&&e(t.tr.setSelection(xi.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),0))})(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Fa(r)}let s=i&&i.nodeAfter;return!(!s||!xi.isSelectable(s)||(e&&e(t.tr.setSelection(xi.create(t.doc,i.pos)).scrollIntoView()),0))})(t,e),selectParentNode:()=>({state:t,dispatch:e})=>((t,e)=>{let n,{$from:r,to:o}=t.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),e&&e(t.tr.setSelection(xi.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>qa(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>Wa(t,e),setContent:(t,e=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=function(t,e,n={}){return Nl(t,e,{slice:!1,parseOptions:n})}(t,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0},setMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Ol(t,r.schema);if(o)if(s){const t=$l(r,l);n.addStoredMark(l.create({...t,...e}))}else a.forEach((t=>{const o=t.$from.pos,i=t.$to.pos;r.doc.nodesBetween(o,i,((t,r)=>{const s=Math.max(r,o),a=Math.min(r+t.nodeSize,i);t.marks.find((t=>t.type===l))?t.marks.forEach((t=>{l===t.type&&n.addMark(s,a,l.create({...t.attrs,...e}))})):n.addMark(s,a,l.create(e))}))}));return function(t,e,n){var r;const{selection:o}=e;let i=null;if(Cl(o)&&(i=o.$cursor),i){const e=null!==(r=t.storedMarks)&&void 0!==r?r:i.marks();return!!n.isInSet(e)||!e.some((t=>t.type.excludes(n)))}const{ranges:s}=o;return s.some((({$from:e,$to:r})=>{let o=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,r.pos,((t,e,r)=>{if(o)return!1;if(t.isInline){const e=!r||r.type.allowsMarkType(n),i=!!n.isInSet(t.marks)||!t.marks.some((t=>t.type.excludes(n)));o=e&&i}return!o})),o}))}(r,n,l)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=tl(t,n.schema);return i.isTextblock?o().command((({commands:t})=>!!Ua(i,e)(n)||t.clearNodes())).command((({state:t})=>Ua(i,e)(t,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,r=Al(t,0,n.content.size),o=xi.create(n,r);e.setSelection(o)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:r,to:o}="number"==typeof t?{from:t,to:t}:t,i=wi.atStart(n).from,s=wi.atEnd(n).to,a=Al(r,i,s),l=Al(o,i,s),c=wi.create(n,a,l);e.setSelection(c)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const r=tl(t,e.schema);return(o=r,function(t,e){let{$from:n,$to:r}=t.selection,i=n.blockRange(r,(t=>t.childCount>0&&t.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=o)return!1;if(e){let n=l.lastChild&&l.lastChild.type==a.type,r=Ar.from(n?o.create():null),s=new Lr(Ar.from(o.create(null,Ar.from(a.type.create(null,r)))),n?3:1,0),c=i.start,u=i.end;e(t.tr.step(new Uo(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0})(e,n);var o},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=Hl(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof xi&&i.node.isBlock)return!(!a.parentOffset||!Zo(s,a.pos))&&(r&&(t&&Vl(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;i instanceof wi&&e.deleteSelection();const s=0===a.depth?void 0:function(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=r&&s?[{type:s,attrs:c}]:void 0,h=Zo(e.doc,e.mapping.map(a.pos),1,u);if(u||h||!Zo(e.doc,e.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(h=!0,u=s?[{type:s,attrs:c}]:void 0),h&&(e.split(e.mapping.map(a.pos),1,u),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const t=e.mapping.map(a.before()),n=e.doc.resolve(t);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&e.setNodeMarkup(e.mapping.map(a.before()),s)}t&&Vl(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:r,editor:o})=>{var i;const s=tl(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const h=o.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let t=Ar.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let e=a.depth-n;e>=a.depth-3;e-=1)t=Ar.from(a.node(e).copy(t));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,o=Hl(h,a.node().type.name,a.node().attrs),l=(null===(i=s.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;t=t.append(Ar.from(s.createAndFill(null,l)||void 0));const c=a.before(a.depth-(n-1));e.replace(c,a.after(-r),new Lr(t,4-n,0));let u=-1;e.doc.nodesBetween(c,e.doc.content.size,((t,e)=>{if(u>-1)return!1;t.isTextblock&&0===t.content.size&&(u=e+1)})),u>-1&&e.setSelection(wi.near(e.doc.resolve(u))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,d=Hl(h,u.type.name,u.attrs),f=Hl(h,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=p?[{type:s,attrs:d},{type:p,attrs:f}]:[{type:s,attrs:d}];if(!Zo(e.doc,a.pos,2))return!1;if(r){const{selection:t,storedMarks:i}=n,{splittableMarks:s}=o.extensionManager,l=i||t.$to.parentOffset&&t.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!l||!r)return!0;const c=l.filter((t=>s.includes(t.type.name)));e.ensureMarks(c)}return!0},toggleList:(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:h,splittableMarks:p}=o.extensionManager,d=tl(t,s.schema),f=tl(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:v}=m,b=y.blockRange(v),_=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const w=Pl((t=>Bl(t.type.name,h)))(m);if(b.depth>=1&&w&&b.depth-w.depth<=1){if(w.node.type===d)return c.liftListItem(f);if(Bl(w.node.type.name,h)&&d.validContent(w.node.content)&&a)return l().command((()=>(i.setNodeMarkup(w.pos,d),!0))).command((()=>Wl(i,d))).command((()=>ql(i,d))).run()}return n&&_&&a?l().command((()=>{const t=u().wrapInList(d,r),e=_.filter((t=>p.includes(t.type.name)));return i.ensureMarks(e),!!t||c.clearNodes()})).wrapInList(d,r).command((()=>Wl(i,d))).command((()=>ql(i,d))).run():l().command((()=>!!u().wrapInList(d,r)||c.clearNodes())).wrapInList(d,r).command((()=>Wl(i,d))).command((()=>ql(i,d))).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Ol(t,r.schema),a=function(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Ol(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!i||i.name===t.type.name)).find((t=>kl(t.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:e,$to:n})=>{const r=e.pos,o=n.pos;t.doc.nodesBetween(r,o,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);s+=i-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:i}))))}))})),0===s)return!1;const l=a.filter((t=>!i||i.name===t.mark.type.name)).filter((t=>kl(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),c=a.filter((t=>!i||t.mark.type!==i&&t.mark.type.excludes(i))).reduce(((t,e)=>t+e.to-e.from),0);return(l>0?l+c:l)>=s}(r,s,e);return a?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=tl(t,r.schema),s=tl(e,r.schema);return Rl(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=tl(t,n.schema);return Rl(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const e=t.tr,n=i.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(i.text){const n=e.doc.resolve(i.from).marks();e.replaceWith(i.from,i.to,t.schema.text(i.text,n))}else e.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Ol(t,r.schema),{$from:c,empty:u,ranges:h}=a;if(!o)return!0;if(u&&s){let{from:t,to:e}=a;const r=null===(i=c.marks().find((t=>t.type===l)))||void 0===i?void 0:i.attrs,o=El(c,l,r);o&&(t=o.from,e=o.to),n.removeMark(t,e,l)}else h.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Ll("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=tl(t,r.schema)),"mark"===a&&(s=Ol(t,r.schema)),o&&n.selection.ranges.forEach((t=>{const o=t.$from.pos,a=t.$to.pos;r.doc.nodesBetween(o,a,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,{...t.attrs,...e}),s&&t.marks.length&&t.marks.forEach((i=>{if(s===i.type){const l=Math.max(r,o),c=Math.min(r+t.nodeSize,a);n.addMark(l,c,s.create({...i.attrs,...e}))}}))}))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:r})=>function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Yo(s,t,e);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(tl(t,n.schema),e)(n,r),wrapInList:(t,e={})=>({state:n,dispatch:r})=>Ka(tl(t,n.schema),e)(n,r)});wl.create({name:"commands",addCommands:()=>({...Ul})}),wl.create({name:"editable",addProseMirrorPlugins(){return[new Ii({key:new Di("editable"),props:{editable:()=>this.editor.options.editable}})]}}),wl.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ii({key:new Di("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),wl.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.command((({tr:e})=>{const{selection:n,doc:r}=e,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,l=i.parent.isTextblock?e.doc.resolve(s-1):i,c=l.parent.type.spec.isolating,u=i.pos-i.parentOffset,h=c&&1===l.parent.childCount?u===i.pos:yi.atStart(r).from===s;return!(!(o&&h&&a.type.isTextblock)||a.textContent.length)&&t.clearNodes()})),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ml()||Il()?o:r},addProseMirrorPlugins(){return[new Ii({key:new Di("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some((t=>t.docChanged))&&!e.doc.eq(n.doc)))return;const{empty:r,from:o,to:i}=e.selection,s=yi.atStart(e.doc).from,a=yi.atEnd(e.doc).to;if(r||!(o===s&&i===a))return;if(!(0===n.doc.textBetween(0,n.doc.content.size," "," ").length))return;const l=n.tr,c=Ga({state:n,transaction:l}),{commands:u}=new Ya({editor:this.editor,state:c});return u.clearNodes(),l.steps.length?l:void 0}})]}}),wl.create({name:"tabindex",addProseMirrorPlugins(){return[new Ii({key:new Di("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Kl{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=rl(Xa(this,"addOptions",{name:this.name}))),this.storage=rl(Xa(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Kl(t)}configure(t={}){const e=this.extend();return e.options=_l(this.options,t),e.storage=rl(Xa(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Kl(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=rl(Xa(e,"addOptions",{name:e.name})),e.storage=rl(Xa(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find((t=>(null==t?void 0:t.type.name)===e.name)))return!1;const i=o.find((t=>(null==t?void 0:t.type.name)===e.name));return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),t.view.dispatch(n),!0}return!1}}class Jl{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=rl(Xa(this,"addOptions",{name:this.name}))),this.storage=rl(Xa(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Jl(t)}configure(t={}){const e=this.extend();return e.options=_l(this.options,t),e.storage=rl(Xa(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Jl(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=rl(Xa(e,"addOptions",{name:e.name})),e.storage=rl(Xa(e,"addStorage",{name:e.name,options:e.options})),e}}const Gl=Jl.create({name:"text",group:"inline"});var Yl=200,Xl=function(){};Xl.prototype.append=function(t){return t.length?(t=Xl.from(t),!this.length&&t||t.length<Yl&&this.leafAppend(t)||this.length<Yl&&t.leafPrepend(this)||this.appendInner(t)):this},Xl.prototype.prepend=function(t){return t.length?Xl.from(t).append(this):this},Xl.prototype.appendInner=function(t){return new Ql(this,t)},Xl.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Xl.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Xl.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Xl.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Xl.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Xl.from=function(t){return t instanceof Xl?t:t&&t.length?new Zl(t):Xl.empty};var Zl=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=Yl)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=Yl)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Xl);Xl.empty=new Zl([]);var Ql=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Xl),tc=Xl;class ec{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new nc(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new nc(e,void 0,void 0,l.length+c.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new ec(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<t.steps.length;n++){let l,c=t.steps[n].invert(t.docs[n]),u=new nc(t.mapping.maps[n],c,e);(l=a&&a.merge(u))&&(u=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(u),e&&(i++,e=void 0),r||(a=u)}let l=i-n.depth;return l>oc&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),i-=l),new ec(s.append(o),i)}remapping(t,e){let n=new $o;return this.items.forEach(((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new ec(this.items.append(t.map((t=>new nc(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(o.slice(a+1,r));c&&s++,n.push(new nc(l,i,c))}else n.push(new nc(l))}),r);let l=[];for(let t=e;t<i;t++)l.push(new nc(o.maps[t]));let c=this.items.slice(0,r).append(l).append(n),u=new ec(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let l,c=new nc(s.invert(),t,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new ec(tc.from(r.reverse()),o)}}ec.empty=new ec(tc.empty,0);class nc{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new nc(e.getMap().invert(),e,this.selection)}}}class rc{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const oc=20;function ic(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function sc(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function ac(t,e,n,r){let o=uc(e),i=hc.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),c=new rc(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(hc,{redo:r,historyState:c}).scrollIntoView())}let lc=!1,cc=null;function uc(t){let e=t.plugins;if(cc!=e){lc=!1,cc=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){lc=!0;break}}return lc}const hc=new Di("history"),pc=new Di("closeHistory");function dc(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ii({key:hc,state:{init:()=>new rc(ec.empty,ec.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(hc);if(i)return i.historyState;n.getMeta(pc)&&(t=new rc(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(hc))return s.getMeta(hc).redo?new rc(t.done.addTransform(n,void 0,r,uc(e)),t.undone,ic(n.mapping.maps[n.steps.length-1]),t.prevTime):new rc(t.done,t.undone.addTransform(n,void 0,r,uc(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new rc(t.done.rebased(n,o),t.undone.rebased(n,o),sc(t.prevRanges,n.mapping),t.prevTime):new rc(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),sc(t.prevRanges,n.mapping),t.prevTime);{let o=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),i=s?sc(t.prevRanges,n.mapping):ic(n.mapping.maps[n.steps.length-1]);return new rc(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,uc(e)),ec.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?fc:"historyRedo"==n?mc:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const fc=(t,e)=>{let n=hc.getState(t);return!(!n||0==n.done.eventCount)&&(e&&ac(n,t,e,!1),!0)},mc=(t,e)=>{let n=hc.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&ac(n,t,e,!0),!0)},gc=wl.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>fc(t,e),redo:()=>({state:t,dispatch:e})=>mc(t,e)}),addProseMirrorPlugins(){return[dc(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),yc=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),vc=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),bc=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),_c=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),wc=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),kc=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",SUPERSCRIPT:"superscript",MARGIN:"margin",LINK:"link",STYLE_PRESET:"style_preset",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT,this.MARGIN]},get presetAttributes(){return[this.LINE_HEIGHT]},get inlineMarks(){return[this.TEXT_DECORATION,this.LINK,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),xc=Object.freeze({SETTINGS:"settings",ALL:"_"}),Sc=Object.freeze({BLANK:"_blank",SELF:"_self"}),Ec=Object.freeze({URL:"url",BLOCK:"block"});class Oc{static create(t,e){const n=new this(t,e||{});return new Ii({key:new Di(this.name),props:n._buildProps()})}constructor(t,e){this.options=e,this.editor=t}_buildProps(){const t=Object.entries(this.addProps()).map((([t,e])=>[t,e.bind(this)]));return Object.fromEntries(t)}addProps(){return{}}}class Cc extends Oc{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(t){if(t.includes("data-pm-slice")&&t.includes("zw-style"))return t;const e=Dp.build(t);return e.normalizeHTML(),this._removeDeprecatedStyles(e),e.normalizedHTML}_removeDeprecatedStyles(t){const e=t.dom.querySelectorAll('[style*="margin"]');for(const t of Array.from(e))t.style.removeProperty("margin"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-right"),t.style.removeProperty("margin-bottom"),t.style.removeProperty("margin-left")}_handlePaste(t,e,n){const r=this._insertPastedContent(t,n).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return t.dispatch(r),!0}_insertPastedContent({state:t},e){return this._isFullBlockSelected(t)?t.tr.replaceSelectionWith(e.content,!1):t.tr.replaceSelection(e)}_isFullBlockSelected(t){const e=this._expandSelectionToBlocks(t),n=this._isMatchPosition(e.from,t.selection.from),r=this._isMatchPosition(e.to,t.selection.to);return n&&r}_expandSelectionToBlocks({selection:t,doc:e}){let n=t.from,r=t.to;return e.nodesBetween(n,r,((t,e,o)=>{o.type.name===_c.DOCUMENT&&(n=Math.min(n,e+1),r=Math.max(r,e+t.nodeSize-1))})),{from:n,to:r}}_isMatchPosition(t,e){return Math.abs(t-e)<5}}class Ac extends Oc{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:t}){const e=[];return this.editor.isEditable?t.childCount>1?void 0:(t.descendants(((t,n)=>{if(!t.childCount){const r=da.node(n,n+t.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});e.push(r)}return!1})),ga.create(t,e)):null}}const Mc="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Tc="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Nc=(t,e)=>{for(const n in e)t[n]=e[n];return t},Ic="numeric",Rc="ascii",Lc="alpha",Dc="asciinumeric",$c="alphanumeric",Pc="domain",zc="emoji",jc="scheme",Fc="slashscheme",Hc="whitespace";function Bc(t,e){return t in e||(e[t]=[]),e[t]}function Vc(t,e,n){e[Ic]&&(e[Dc]=!0,e[$c]=!0),e[Rc]&&(e[Dc]=!0,e[Lc]=!0),e[Dc]&&(e[$c]=!0),e[Lc]&&(e[$c]=!0),e[$c]&&(e[Pc]=!0),e[zc]&&(e[Pc]=!0);for(const r in e){const e=Bc(r,n);e.indexOf(t)<0&&e.push(t)}}function Wc(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}Wc.groups={},Wc.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let n=0;n<e.jr.length;n++){const r=e.jr[n][0],o=e.jr[n][1];if(o&&r.test(t))return o}return e.jd},has(t,e){return void 0===e&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){let o;return r=r||Wc.groups,e&&e.j?o=e:(o=new Wc(e),n&&r&&Vc(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let e=0;e<i-1;e++)o=o.tt(t[e]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||Wc.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new Wc,Nc(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Wc,i){if(r)if(s.t&&"string"==typeof s.t){const t=Nc(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);Vc(i,t,r)}else n&&Vc(i,n,r);s.t=i}return o.j[t]=s,s}};const qc=(t,e,n,r,o)=>t.ta(e,n,r,o),Uc=(t,e,n,r,o)=>t.tr(e,n,r,o),Kc=(t,e,n,r,o)=>t.ts(e,n,r,o),Jc=(t,e,n,r,o)=>t.tt(e,n,r,o),Gc="WORD",Yc="UWORD",Xc="LOCALHOST",Zc="TLD",Qc="UTLD",tu="SCHEME",eu="SLASH_SCHEME",nu="NUM",ru="WS",ou="NL",iu="OPENBRACE",su="OPENBRACKET",au="OPENANGLEBRACKET",lu="OPENPAREN",cu="CLOSEBRACE",uu="CLOSEBRACKET",hu="CLOSEANGLEBRACKET",pu="CLOSEPAREN",du="AMPERSAND",fu="APOSTROPHE",mu="ASTERISK",gu="AT",yu="BACKSLASH",vu="BACKTICK",bu="CARET",_u="COLON",wu="COMMA",ku="DOLLAR",xu="DOT",Su="EQUALS",Eu="EXCLAMATION",Ou="HYPHEN",Cu="PERCENT",Au="PIPE",Mu="PLUS",Tu="POUND",Nu="QUERY",Iu="QUOTE",Ru="SEMI",Lu="SLASH",Du="TILDE",$u="UNDERSCORE",Pu="EMOJI",zu="SYM";var ju=Object.freeze({__proto__:null,WORD:Gc,UWORD:Yc,LOCALHOST:Xc,TLD:Zc,UTLD:Qc,SCHEME:tu,SLASH_SCHEME:eu,NUM:nu,WS:ru,NL:ou,OPENBRACE:iu,OPENBRACKET:su,OPENANGLEBRACKET:au,OPENPAREN:lu,CLOSEBRACE:cu,CLOSEBRACKET:uu,CLOSEANGLEBRACKET:hu,CLOSEPAREN:pu,AMPERSAND:du,APOSTROPHE:fu,ASTERISK:mu,AT:gu,BACKSLASH:yu,BACKTICK:vu,CARET:bu,COLON:_u,COMMA:wu,DOLLAR:ku,DOT:xu,EQUALS:Su,EXCLAMATION:Eu,HYPHEN:Ou,PERCENT:Cu,PIPE:Au,PLUS:Mu,POUND:Tu,QUERY:Nu,QUOTE:Iu,SEMI:Ru,SLASH:Lu,TILDE:Du,UNDERSCORE:$u,EMOJI:Pu,SYM:zu});const Fu=/[a-z]/,Hu=/\p{L}/u,Bu=/\p{Emoji}/u,Vu=/\d/,Wu=/\s/,qu="\n",Uu="️",Ku="‍";let Ju=null,Gu=null;function Yu(t,e,n,r,o){let i;const s=e.length;for(let n=0;n<s-1;n++){const s=e[n];t.j[s]?i=t.j[s]:(i=new Wc(r),i.jr=o.slice(),t.j[s]=i),t=i}return i=new Wc(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function Xu(t){const e=[],n=[];let r=0;for(;r<t.length;){let o=0;for(;"0123456789".indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let e=parseInt(t.substring(r,r+o),10);e>0;e--)n.pop();r+=o}else n.push(t[r]),r++}return e}const Zu={defaultProtocol:"http",events:null,format:th,formatHref:th,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Qu(t,e){void 0===e&&(e=null);let n=Nc({},Zu);t&&(n=Nc(n,t instanceof Qu?t.o:t));const r=n.ignoreTags,o=[];for(let t=0;t<r.length;t++)o.push(r[t].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}function th(t){return t}function eh(t,e){this.t="token",this.v=t,this.tk=e}function nh(t,e){class n extends eh{constructor(e,n){super(e,n),this.t=t}}for(const t in e)n.prototype[t]=e[t];return n.t=t,n}Qu.prototype={o:Zu,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=null!=e;let o=this.o[t];return o?("object"==typeof o?(o=n.t in o?o[n.t]:Zu[t],"function"==typeof o&&r&&(o=o(e,n))):"function"==typeof o&&r&&(o=o(e,n.t,n)),o):o},getObj(t,e,n){let r=this.o[t];return"function"==typeof r&&null!=e&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},eh.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return void 0===t&&(t=Zu.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&Nc(s,u),{tagName:o,attributes:s,content:i,eventListeners:h}}};const rh=nh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),oh=nh("text"),ih=nh("nl"),sh=nh("url",{isLink:!0,toHref(t){return void 0===t&&(t=Zu.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Xc&&t[1].t===_u}}),ah=t=>new Wc(t);function lh(t,e,n){const r=n[0].s,o=n[n.length-1].e;return new t(e.slice(r,o),n)}const ch="undefined"!=typeof console&&console&&console.warn||(()=>{}),uh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function hh(t,e){if(void 0===e&&(e=!1),uh.initialized&&ch(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error('linkifyjs: incorrect scheme format.\n 1. Must only contain digits, lowercase ASCII letters or "-"\n 2. Cannot start or end with "-"\n 3. "-" cannot repeat');uh.customSchemes.push([t,e])}function ph(){uh.scanner=function(t){void 0===t&&(t=[]);const e={};Wc.groups=e;const n=new Wc;null==Ju&&(Ju=Xu(Mc)),null==Gu&&(Gu=Xu(Tc)),Jc(n,"'",fu),Jc(n,"{",iu),Jc(n,"[",su),Jc(n,"<",au),Jc(n,"(",lu),Jc(n,"}",cu),Jc(n,"]",uu),Jc(n,">",hu),Jc(n,")",pu),Jc(n,"&",du),Jc(n,"*",mu),Jc(n,"@",gu),Jc(n,"`",vu),Jc(n,"^",bu),Jc(n,":",_u),Jc(n,",",wu),Jc(n,"$",ku),Jc(n,".",xu),Jc(n,"=",Su),Jc(n,"!",Eu),Jc(n,"-",Ou),Jc(n,"%",Cu),Jc(n,"|",Au),Jc(n,"+",Mu),Jc(n,"#",Tu),Jc(n,"?",Nu),Jc(n,'"',Iu),Jc(n,"/",Lu),Jc(n,";",Ru),Jc(n,"~",Du),Jc(n,"_",$u),Jc(n,"\\",yu);const r=Uc(n,Vu,nu,{[Ic]:!0});Uc(r,Vu,r);const o=Uc(n,Fu,Gc,{[Rc]:!0});Uc(o,Fu,o);const i=Uc(n,Hu,Yc,{[Lc]:!0});Uc(i,Fu),Uc(i,Hu,i);const s=Uc(n,Wu,ru,{[Hc]:!0});Jc(n,qu,ou,{[Hc]:!0}),Jc(s,qu),Uc(s,Wu,s);const a=Uc(n,Bu,Pu,{[zc]:!0});Uc(a,Bu,a),Jc(a,Uu,a);const l=Jc(a,Ku);Uc(l,Bu,a);const c=[[Fu,o]],u=[[Fu,null],[Hu,i]];for(let t=0;t<Ju.length;t++)Yu(n,Ju[t],Zc,Gc,c);for(let t=0;t<Gu.length;t++)Yu(n,Gu[t],Qc,Yc,u);Vc(Zc,{tld:!0,ascii:!0},e),Vc(Qc,{utld:!0,alpha:!0},e),Yu(n,"file",tu,Gc,c),Yu(n,"mailto",tu,Gc,c),Yu(n,"http",eu,Gc,c),Yu(n,"https",eu,Gc,c),Yu(n,"ftp",eu,Gc,c),Yu(n,"ftps",eu,Gc,c),Vc(tu,{scheme:!0,ascii:!0},e),Vc(eu,{slashscheme:!0,ascii:!0},e),t=t.sort(((t,e)=>t[0]>e[0]?1:-1));for(let e=0;e<t.length;e++){const r=t[e][0],o=t[e][1]?{[jc]:!0}:{[Fc]:!0};r.indexOf("-")>=0?o[Pc]=!0:Fu.test(r)?Vu.test(r)?o[Dc]=!0:o[Rc]=!0:o[Ic]=!0,Kc(n,r,r,o)}return Kc(n,"localhost",Xc,{ascii:!0}),n.jd=new Wc(zu),{start:n,tokens:Nc({groups:e},ju)}}(uh.customSchemes);for(let t=0;t<uh.tokenQueue.length;t++)uh.tokenQueue[t][1]({scanner:uh.scanner});uh.parser=function(t){let{groups:e}=t;const n=e.domain.concat([du,mu,gu,yu,vu,bu,ku,Su,Ou,nu,Cu,Au,Mu,Tu,Lu,zu,Du,$u]),r=[fu,hu,cu,uu,pu,_u,wu,xu,Eu,au,iu,su,lu,Nu,Iu,Ru],o=[du,fu,mu,yu,vu,bu,cu,ku,Su,Ou,iu,Cu,Au,Mu,Tu,Nu,Lu,zu,Du,$u],i=ah(),s=Jc(i,Du);qc(s,o,s),qc(s,e.domain,s);const a=ah(),l=ah(),c=ah();qc(i,e.domain,a),qc(i,e.scheme,l),qc(i,e.slashscheme,c),qc(a,o,s),qc(a,e.domain,a);const u=Jc(a,gu);Jc(s,gu,u),Jc(l,gu,u),Jc(c,gu,u);const h=Jc(s,xu);qc(h,o,s),qc(h,e.domain,s);const p=ah();qc(u,e.domain,p),qc(p,e.domain,p);const d=Jc(p,xu);qc(d,e.domain,p);const f=ah(rh);qc(d,e.tld,f),qc(d,e.utld,f),Jc(u,Xc,f);const m=Jc(p,Ou);qc(m,e.domain,p),qc(f,e.domain,p),Jc(f,xu,d),Jc(f,Ou,m);const g=Jc(f,_u);qc(g,e.numeric,rh);const y=Jc(a,Ou),v=Jc(a,xu);qc(y,e.domain,a),qc(v,o,s),qc(v,e.domain,a);const b=ah(sh);qc(v,e.tld,b),qc(v,e.utld,b),qc(b,e.domain,a),qc(b,o,s),Jc(b,xu,v),Jc(b,Ou,y),Jc(b,gu,u);const _=Jc(b,_u),w=ah(sh);qc(_,e.numeric,w);const k=ah(sh),x=ah();qc(k,n,k),qc(k,r,x),qc(x,n,k),qc(x,r,x),Jc(b,Lu,k),Jc(w,Lu,k);const S=Jc(l,_u),E=Jc(c,_u),O=Jc(E,Lu),C=Jc(O,Lu);qc(l,e.domain,a),Jc(l,xu,v),Jc(l,Ou,y),qc(c,e.domain,a),Jc(c,xu,v),Jc(c,Ou,y),qc(S,e.domain,k),Jc(S,Lu,k),qc(C,e.domain,k),qc(C,n,k),Jc(C,Lu,k);const A=Jc(k,iu),M=Jc(k,su),T=Jc(k,au),N=Jc(k,lu);Jc(x,iu,A),Jc(x,su,M),Jc(x,au,T),Jc(x,lu,N),Jc(A,cu,k),Jc(M,uu,k),Jc(T,hu,k),Jc(N,pu,k),Jc(A,cu,k);const I=ah(sh),R=ah(sh),L=ah(sh),D=ah(sh);qc(A,n,I),qc(M,n,R),qc(T,n,L),qc(N,n,D);const $=ah(),P=ah(),z=ah(),j=ah();return qc(A,r),qc(M,r),qc(T,r),qc(N,r),qc(I,n,I),qc(R,n,R),qc(L,n,L),qc(D,n,D),qc(I,r,I),qc(R,r,R),qc(L,r,L),qc(D,r,D),qc($,n,$),qc(P,n,R),qc(z,n,L),qc(j,n,D),qc($,r,$),qc(P,r,P),qc(z,r,z),qc(j,r,j),Jc(R,uu,k),Jc(L,hu,k),Jc(D,pu,k),Jc(I,cu,k),Jc(P,uu,k),Jc(z,hu,k),Jc(j,pu,k),Jc($,pu,k),Jc(i,Xc,b),Jc(i,ou,ih),{start:i,tokens:ju}}(uh.scanner.tokens);for(let t=0;t<uh.pluginQueue.length;t++)uh.pluginQueue[t][1]({scanner:uh.scanner,parser:uh.parser});uh.initialized=!0}function dh(t){return uh.initialized||ph(),function(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,u=0,h=null,p=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(p=0,h=a):p>=0&&p++,o++,u++;if(p<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(lh(oh,e,s)),s=[]),o-=p,u-=p;const t=h.t,r=n.slice(o-u,o);i.push(lh(t,e,r))}}return s.length>0&&i.push(lh(oh,e,s)),i}(uh.parser.start,t,function(t,e){const n=function(t){const e=[],n=t.length;let r=0;for(;r<n;){let o,i=t.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}(e.replace(/[A-Z]/g,(t=>t.toLowerCase()))),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,u=null,h=-1,p=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(h=0,p=0,u=a):h>=0&&(h+=n[s].length,p++),c+=n[s].length,i+=n[s].length,s++;i-=h,s-=p,c-=h,o.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}(uh.scanner.start,t))}function fh(t,e,n){if(void 0===e&&(e=null),void 0===n&&(n=null),e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Qu(n),o=dh(t),i=[];for(let t=0;t<o.length;t++){const n=o[t];!n.isLink||e&&n.t!==e||i.push(n.toFormattedObject(r))}return i}class mh extends Oc{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(t,e,n){if(t.state.selection.empty)return!1;const r=n.content.textBetween(0,n.content.size).trim(),o=function(t,e){void 0===e&&(e=null);const n=dh(t);return 1===n.length&&n[0].isLink&&(!e||n[0].t===e)}(r);if(!r||!o)return!1;const i=this._createLinkAttrs(r,n.content);return this.editor.commands.applyLink(i),!0}_createLinkAttrs(t,e){const n=Fp.query(e,{typeName:_c.TEXT,mark:{typeName:kc.LINK},getMark:{typeName:kc.LINK}});return n?.attrs||{href:t}}}function gh(t){return(...e)=>n=>t(n,...e)}function yh(t){const e=Object.entries(t).reduce(((t,[e,n])=>{if(!n)return t;return`${t}--zw-${e.replace(/_/g,"-")}:${n};`}),"");return e?{style:e}:null}function vh(t){const e=yh(t);return["span",e?{...e,class:"zw-style"}:{},0]}function bh(t,...e){return({editor:n})=>(n.commands[t](...e),!0)}var _h=Object.defineProperty,wh=(t,e,n)=>(((t,e,n)=>{e in t?_h(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);const kh=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}),xh="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",Sh=`[\\s|\\(]+(${xh})[,|\\s]+(${xh})[,|\\s]+(${xh})\\s*\\)?`,Eh=`[\\s|\\(]+(${xh})[,|\\s]+(${xh})[,|\\s]+(${xh})[,|\\s]+(${xh})\\s*\\)?`,Oh=Object.freeze({CSS_UNIT:new RegExp(xh),RGB:new RegExp(`rgb${Sh}`),RGBA:new RegExp(`rgba${Eh}`),HSL:new RegExp(`hsl${Sh}`),HSLA:new RegExp(`hsla${Eh}`),HSV:new RegExp(`hsv${Sh}`),HSVA:new RegExp(`hsva${Eh}`),HEX3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,HEX4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}),Ch=Object.freeze({WINDOW:Symbol("window")});function Ah(t,e){let n=!1;return function(){n||(t.apply(this,arguments),n=!0,setTimeout((function(){n=!1}),e))}}function Mh(t){return t>1||t<-1?t/100:t}const Th=3;function Nh(t){return Number.parseFloat(t.toFixed(Th+2).substr(0,Th+2))}function Ih(t){const e=function(t,e=1){const n=[];let r=0;for(;r<t.length;)n.push(t.substr(r,e)),r+=e;return n}(t.slice(1),2).map((t=>parseInt(t,16))),n=void 0!==e[3]?Math.round(e[3]/255*100)/100:1;return{r:e[0],g:e[1],b:e[2],a:n}}function Rh({h:t,s:e,v:n,a:r}){const o=r=>{const o=(r+t/60)%6;return n-n*e*Math.max(Math.min(o,4-o,1),0)},i=[o(5),o(3),o(1)].map((t=>Math.round(255*t)));return{r:i[0],g:i[1],b:i[2],a:r}}function Lh(t){if(!t)return{h:0,s:1,v:1,a:1};const e=t.r/255,n=t.g/255,r=t.b/255,o=Math.max(e,n,r),i=Math.min(e,n,r);let s=0;o!==i&&(o===e?s=60*(0+(n-r)/(o-i)):o===n?s=60*(2+(r-e)/(o-i)):o===r&&(s=60*(4+(e-n)/(o-i)))),s<0&&(s+=360);const a=[s,0===o?0:(o-i)/o,o],l=Nh(a[1]),c=Nh(a[2]);return{h:Math.floor(a[0]),s:l,v:c,a:t.a}}function Dh(t){const e=Lh(Ih(t));const n=function({h:t,s:e,v:n,a:r}){const o=n-n*e/2;return{h:t,s:Nh(1===o||0===o?0:(n-o)/Math.min(o,1-o)),l:Nh(o),a:r}}(e),r=Ih(t);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:n,hsva:e,hue:e.h,rgba:r}}function $h(t,e,n="0"){return t+n.repeat(Math.max(0,e-t.length))}function Ph(t){return Dh(function(t){let e=t;return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),3!==e.length&&4!==e.length||(e=e.split("").map((t=>t+t)).join("")),e=6===e.length?$h(e,8,"F"):$h($h(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}(t))}const zh=class t{constructor(t){wh(this,"rgba"),wh(this,"hsva"),wh(this,"alpha"),this.rgba=t,this.hsva=this.calcHsva(),this.alpha=t.a}static create(e){if(!e)return t.fromBlack();let n=e.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if((t=>t in kh)(n))n=kh[n];else if(n===this.TRANSPARENT)return t.fromTransparent();const r=Oh.RGB.exec(n)||Oh.RGBA.exec(n);if(r){const e=void 0===r[4]?1:r[4];return t.fromRgba({r:Number.parseInt(r[1]),g:Number.parseInt(r[2]),b:Number.parseInt(r[3]),a:Number.parseFloat(e.toString())})}const o=Oh.HSL.exec(n)||Oh.HSLA.exec(n);if(o){const e=void 0===o[4]?1:o[4];return t.fromHsla({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),l:Number.parseFloat(o[3]),a:Number.parseFloat(e.toString())})}const i=Oh.HSV.exec(n)||Oh.HSVA.exec(n);if(i){const e=void 0===i[4]?1:i[4];return t.fromHsva({h:Number.parseInt(i[1]),s:Number.parseFloat(i[2]),v:Number.parseFloat(i[3]),a:Number.parseFloat(e.toString())})}return Oh.HEX8.exec(n)||Oh.HEX6.exec(n)||Oh.HEX4.exec(n)||Oh.HEX3.exec(n)?t.fromHex(n):t.fromBlack()}static fromHex(e){const{rgba:n}=Ph(e);return new t(n)}static fromRgba({r:e,g:n,b:r,a:o}){const i=Mh(o);return new t({r:e,g:n,b:r,a:i})}static fromHsla({h:e,s:n,l:r,a:o}){const i=Mh(n),s=Mh(r),a=Mh(o);return t.fromHsva(function({h:t,s:e,l:n,a:r}){const o=n+e*Math.min(n,1-n);return{h:t,s:Nh(0===o?0:2-2*n/o),v:Nh(o),a:r}}({h:e,s:i,l:s,a:a}))}static fromHsva({h:e,s:n,v:r,a:o}){const i=Rh({h:e,s:Mh(n),v:Mh(r),a:Mh(o)});return new t(i)}static fromTransparent(){return new t({r:0,g:0,b:0,a:0})}static fromWhite(){return new t({r:255,g:255,b:255,a:1})}static fromBlack(){return new t({r:0,g:0,b:0,a:1})}static isTransparent(e){return t.create(e).isTransparent()}static isDark(e){return t.create(e).isDark()}get hex(){return this.toHexString()}get r(){return this.rgba.r}get b(){return this.rgba.b}get g(){return this.rgba.g}get h(){return this.hsva.h}get s(){return this.hsva.s}get v(){return this.hsva.v}setAlpha(t){return this.alpha=t,this}toHexString(){return function(t){const e=t=>{const e=Math.round(t).toString(16);return("00".substr(0,2-e.length)+e).toUpperCase()};return`#${[e(t.r),e(t.g),e(t.b)].join("")}`}({r:this.r,g:this.g,b:this.b})}toRgbaString(){const t=`${Math.floor(100*this.alpha)}%`;return`rgba(${[this.r,this.g,this.b,t].join(", ")})`}updateRgb(t){this.rgba={...this.rgba,...t},this.hsva=this.calcHsva()}updateHsv(t){this.hsva={...this.hsva,...t},this.rgba=this.calcRgba()}isTransparent(){return 0===this.alpha}isDark(){return this.getBrightness()<128}getBrightness(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3}calcHsva(){return Lh(this.rgba)}calcRgba(){return Rh(this.hsva)}};wh(zh,"TRANSPARENT","transparent"),wh(zh,"NONE","none");let jh=zh;Ch.WINDOW;function Fh(t){const e=jh.create(t);return 1===e.alpha?e.toHexString():e.toRgbaString()}function Hh(t,e){if(!t.includes("em"))return parseInt(t);const n=$p.getComputedStyle(e).fontSize,r=parseFloat(t)*parseFloat(n);return Math.round(r)}function Bh(t,e,n){if(!t.includes("px"))return t;const r=function(t,e){return(t.firstElementChild||t).style.fontSize||$p.getComputedStyle(e).fontSize}(e,n),o=Hh(r,n);return o?(parseInt(t)/o).toFixed(2):null}Ch.WINDOW,Ch.WINDOW,Ah(((t,e)=>{t(e)}),20);const Vh={start:bc.LEFT,end:bc.RIGHT};const Wh=(t,e,n,r)=>({from:Math.max(r,t.pos),to:Math.min(r+n.nodeSize,e.pos)});function qh(t,e){return t.resolve(e).depth+1}const Uh=(t,e)=>t.eq(e);var Kh,Jh,Gh={exports:{}};
17
- /**
18
- * @license
19
- * Lodash <https://lodash.com/>
20
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
21
- * Released under MIT license <https://lodash.com/license>
22
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
23
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
24
- */Kh=Gh,Jh=Gh.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",o=16,i=32,a=64,l=128,c=256,u=1/0,h=9007199254740991,p=NaN,d=4294967295,f=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",i],["partialRight",a],["rearg",c]],m="[object Arguments]",g="[object Array]",y="[object Boolean]",v="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",k="[object Map]",x="[object Number]",S="[object Object]",E="[object Promise]",O="[object RegExp]",C="[object Set]",A="[object String]",M="[object Symbol]",T="[object WeakMap]",N="[object ArrayBuffer]",I="[object DataView]",R="[object Float32Array]",L="[object Float64Array]",D="[object Int8Array]",$="[object Int16Array]",P="[object Int32Array]",z="[object Uint8Array]",j="[object Uint8ClampedArray]",F="[object Uint16Array]",H="[object Uint32Array]",B=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,U=/[&<>"']/g,K=RegExp(q.source),J=RegExp(U.source),G=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,ot=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ut=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,ft=/^0b[01]+$/i,mt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,vt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Ot="\\ufe0e\\ufe0f",Ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",At="['’]",Mt="["+wt+"]",Tt="["+Ct+"]",Nt="["+kt+"]",It="\\d+",Rt="["+xt+"]",Lt="["+St+"]",Dt="[^"+wt+Ct+It+xt+St+Et+"]",$t="\\ud83c[\\udffb-\\udfff]",Pt="[^"+wt+"]",zt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Et+"]",Ht="\\u200d",Bt="(?:"+Lt+"|"+Dt+")",Vt="(?:"+Ft+"|"+Dt+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",qt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ut="(?:"+Nt+"|"+$t+")?",Kt="["+Ot+"]?",Jt=Kt+Ut+"(?:"+Ht+"(?:"+[Pt,zt,jt].join("|")+")"+Kt+Ut+")*",Gt="(?:"+[Rt,zt,jt].join("|")+")"+Jt,Yt="(?:"+[Pt+Nt+"?",Nt,zt,jt,Mt].join("|")+")",Xt=RegExp(At,"g"),Zt=RegExp(Nt,"g"),Qt=RegExp($t+"(?="+$t+")|"+Yt+Jt,"g"),te=RegExp([Ft+"?"+Lt+"+"+Wt+"(?="+[Tt,Ft,"$"].join("|")+")",Vt+"+"+qt+"(?="+[Tt,Ft+Bt,"$"].join("|")+")",Ft+"?"+Bt+"+"+Wt,Ft+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",It,Gt].join("|"),"g"),ee=RegExp("["+Ht+wt+kt+Ot+"]"),ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ie={};ie[R]=ie[L]=ie[D]=ie[$]=ie[P]=ie[z]=ie[j]=ie[F]=ie[H]=!0,ie[m]=ie[g]=ie[N]=ie[y]=ie[I]=ie[v]=ie[b]=ie[_]=ie[k]=ie[x]=ie[S]=ie[O]=ie[C]=ie[A]=ie[T]=!1;var se={};se[m]=se[g]=se[N]=se[I]=se[y]=se[v]=se[R]=se[L]=se[D]=se[$]=se[P]=se[k]=se[x]=se[S]=se[O]=se[C]=se[A]=se[M]=se[z]=se[j]=se[F]=se[H]=!0,se[b]=se[_]=se[T]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,ce=parseInt,ue="object"==typeof s&&s&&s.Object===Object&&s,he="object"==typeof self&&self&&self.Object===Object&&self,pe=ue||he||Function("return this")(),de=Jh&&!Jh.nodeType&&Jh,fe=de&&Kh&&!Kh.nodeType&&Kh,me=fe&&fe.exports===de,ge=me&&ue.process,ye=function(){try{var t=fe&&fe.require&&fe.require("util").types;return t||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ve=ye&&ye.isArrayBuffer,be=ye&&ye.isDate,_e=ye&&ye.isMap,we=ye&&ye.isRegExp,ke=ye&&ye.isSet,xe=ye&&ye.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(r,s,n(s),t)}return r}function Oe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ce(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Me(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function Te(t,e){return!(null==t||!t.length)&&Fe(t,e,0)>-1}function Ne(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Ie(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function Re(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function Le(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function De(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function $e(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Pe=We("length");function ze(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function je(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Fe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):je(t,Be,n)}function He(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function Be(t){return t!=t}function Ve(t,e){var n=null==t?0:t.length;return n?Ke(t,e)/n:p}function We(e){return function(n){return null==n?t:n[e]}}function qe(e){return function(n){return null==e?t:e[n]}}function Ue(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function Ke(e,n){for(var r,o=-1,i=e.length;++o<i;){var s=n(e[o]);s!==t&&(r=r===t?s:r+s)}return r}function Je(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ge(t){return t?t.slice(0,dn(t)+1).replace(rt,""):t}function Ye(t){return function(e){return t(e)}}function Xe(t,e){return Ie(e,(function(e){return t[e]}))}function Ze(t,e){return t.has(e)}function Qe(t,e){for(var n=-1,r=t.length;++n<r&&Fe(e,t[n],0)>-1;);return n}function tn(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}var en=qe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=qe({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rn(t){return"\\"+ae[t]}function on(t){return ee.test(t)}function sn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function an(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,o=t.length,i=0,s=[];++n<o;){var a=t[n];a!==e&&a!==r||(t[n]=r,s[i++]=n)}return s}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function hn(t){return on(t)?function(t){for(var e=Qt.lastIndex=0;Qt.test(t);)++e;return e}(t):Pe(t)}function pn(t){return on(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.split("")}(t)}function dn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var fn=qe({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),mn=function s(ot){var wt,kt=(ot=null==ot?pe:mn.defaults(pe.Object(),ot,mn.pick(pe,re))).Array,xt=ot.Date,St=ot.Error,Et=ot.Function,Ot=ot.Math,Ct=ot.Object,At=ot.RegExp,Mt=ot.String,Tt=ot.TypeError,Nt=kt.prototype,It=Et.prototype,Rt=Ct.prototype,Lt=ot["__core-js_shared__"],Dt=It.toString,$t=Rt.hasOwnProperty,Pt=0,zt=(wt=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||""))?"Symbol(src)_1."+wt:"",jt=Rt.toString,Ft=Dt.call(Ct),Ht=pe._,Bt=At("^"+Dt.call($t).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=me?ot.Buffer:t,Wt=ot.Symbol,qt=ot.Uint8Array,Ut=Vt?Vt.allocUnsafe:t,Kt=an(Ct.getPrototypeOf,Ct),Jt=Ct.create,Gt=Rt.propertyIsEnumerable,Yt=Nt.splice,Qt=Wt?Wt.isConcatSpreadable:t,ee=Wt?Wt.iterator:t,ae=Wt?Wt.toStringTag:t,ue=function(){try{var t=di(Ct,"defineProperty");return t({},"",{}),t}catch(t){}}(),he=ot.clearTimeout!==pe.clearTimeout&&ot.clearTimeout,de=xt&&xt.now!==pe.Date.now&&xt.now,fe=ot.setTimeout!==pe.setTimeout&&ot.setTimeout,ge=Ot.ceil,ye=Ot.floor,Pe=Ct.getOwnPropertySymbols,qe=Vt?Vt.isBuffer:t,gn=ot.isFinite,yn=Nt.join,vn=an(Ct.keys,Ct),bn=Ot.max,_n=Ot.min,wn=xt.now,kn=ot.parseInt,xn=Ot.random,Sn=Nt.reverse,En=di(ot,"DataView"),On=di(ot,"Map"),Cn=di(ot,"Promise"),An=di(ot,"Set"),Mn=di(ot,"WeakMap"),Tn=di(Ct,"create"),Nn=Mn&&new Mn,In={},Rn=ji(En),Ln=ji(On),Dn=ji(Cn),$n=ji(An),Pn=ji(Mn),zn=Wt?Wt.prototype:t,jn=zn?zn.valueOf:t,Fn=zn?zn.toString:t;function Hn(t){if(na(t)&&!qs(t)&&!(t instanceof qn)){if(t instanceof Wn)return t;if($t.call(t,"__wrapped__"))return Fi(t)}return new Wn(t)}var Bn=function(){function e(){}return function(n){if(!ea(n))return{};if(Jt)return Jt(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function Vn(){}function Wn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function qn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Un(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Kn(t);this.size=e.size}function Xn(t,e){var n=qs(t),r=!n&&Ws(t),o=!n&&!r&&Gs(t),i=!n&&!r&&!o&&ua(t),s=n||r||o||i,a=s?Je(t.length,Mt):[],l=a.length;for(var c in t)!e&&!$t.call(t,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||_i(c,l))||a.push(c);return a}function Zn(e){var n=e.length;return n?e[Gr(0,n-1)]:t}function Qn(t,e){return $i(No(t),lr(e,0,t.length))}function tr(t){return $i(No(t))}function er(e,n,r){(r!==t&&!Hs(e[n],r)||r===t&&!(n in e))&&sr(e,n,r)}function nr(e,n,r){var o=e[n];$t.call(e,n)&&Hs(o,r)&&(r!==t||n in e)||sr(e,n,r)}function rr(t,e){for(var n=t.length;n--;)if(Hs(t[n][0],e))return n;return-1}function or(t,e,n,r){return dr(t,(function(t,o,i){e(r,t,n(t),i)})),r}function ir(t,e){return t&&Io(e,Ia(e),t)}function sr(t,e,n){"__proto__"==e&&ue?ue(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ar(e,n){for(var r=-1,o=n.length,i=kt(o),s=null==e;++r<o;)i[r]=s?t:Ca(e,n[r]);return i}function lr(e,n,r){return e==e&&(r!==t&&(e=e<=r?e:r),n!==t&&(e=e>=n?e:n)),e}function cr(e,n,r,o,i,s){var a,l=1&n,c=2&n,u=4&n;if(r&&(a=i?r(e,o,i,s):r(e)),a!==t)return a;if(!ea(e))return e;var h=qs(e);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&$t.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return No(e,a)}else{var p=gi(e),d=p==_||p==w;if(Gs(e))return Eo(e,l);if(p==S||p==m||d&&!i){if(a=c||d?{}:vi(e),!l)return c?function(t,e){return Io(t,mi(t),e)}(e,function(t,e){return t&&Io(e,Ra(e),t)}(a,e)):function(t,e){return Io(t,fi(t),e)}(e,ir(a,e))}else{if(!se[p])return i?e:{};a=function(t,e,n){var r,o=t.constructor;switch(e){case N:return Oo(t);case y:case v:return new o(+t);case I:return function(t,e){var n=e?Oo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case R:case L:case D:case $:case P:case z:case j:case F:case H:return Co(t,n);case k:return new o;case x:case A:return new o(t);case O:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case C:return new o;case M:return r=t,jn?Ct(jn.call(r)):{}}}(e,p,l)}}s||(s=new Yn);var f=s.get(e);if(f)return f;s.set(e,a),aa(e)?e.forEach((function(t){a.add(cr(t,n,r,t,e,s))})):ra(e)&&e.forEach((function(t,o){a.set(o,cr(t,n,r,o,e,s))}));var g=h?t:(u?c?si:ii:c?Ra:Ia)(e);return Oe(g||e,(function(t,o){g&&(t=e[o=t]),nr(a,o,cr(t,n,r,o,e,s))})),a}function ur(e,n,r){var o=r.length;if(null==e)return!o;for(e=Ct(e);o--;){var i=r[o],s=n[i],a=e[i];if(a===t&&!(i in e)||!s(a))return!1}return!0}function hr(n,r,o){if("function"!=typeof n)throw new Tt(e);return Ii((function(){n.apply(t,o)}),r)}function pr(t,e,n,r){var o=-1,i=Te,s=!0,a=t.length,l=[],c=e.length;if(!a)return l;n&&(e=Ie(e,Ye(n))),r?(i=Ne,s=!1):e.length>=200&&(i=Ze,s=!1,e=new Gn(e));t:for(;++o<a;){var u=t[o],h=null==n?u:n(u);if(u=r||0!==u?u:0,s&&h==h){for(var p=c;p--;)if(e[p]===h)continue t;l.push(u)}else i(e,h,r)||l.push(u)}return l}Hn.templateSettings={escape:G,evaluate:Y,interpolate:X,variable:"",imports:{_:Hn}},Hn.prototype=Vn.prototype,Hn.prototype.constructor=Hn,Wn.prototype=Bn(Vn.prototype),Wn.prototype.constructor=Wn,qn.prototype=Bn(Vn.prototype),qn.prototype.constructor=qn,Un.prototype.clear=function(){this.__data__=Tn?Tn(null):{},this.size=0},Un.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Un.prototype.get=function(e){var r=this.__data__;if(Tn){var o=r[e];return o===n?t:o}return $t.call(r,e)?r[e]:t},Un.prototype.has=function(e){var n=this.__data__;return Tn?n[e]!==t:$t.call(n,e)},Un.prototype.set=function(e,r){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Tn&&r===t?n:r,this},Kn.prototype.clear=function(){this.__data__=[],this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=rr(e,t);return!(n<0||(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,0))},Kn.prototype.get=function(e){var n=this.__data__,r=rr(n,e);return r<0?t:n[r][1]},Kn.prototype.has=function(t){return rr(this.__data__,t)>-1},Kn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new Un,map:new(On||Kn),string:new Un}},Jn.prototype.delete=function(t){var e=hi(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return hi(this,t).get(t)},Jn.prototype.has=function(t){return hi(this,t).has(t)},Jn.prototype.set=function(t,e){var n=hi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(t){return this.__data__.set(t,n),this},Gn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Kn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Kn){var r=n.__data__;if(!On||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var dr=Do(wr),fr=Do(kr,!0);function mr(t,e){var n=!0;return dr(t,(function(t,r,o){return n=!!e(t,r,o)})),n}function gr(e,n,r){for(var o=-1,i=e.length;++o<i;){var s=e[o],a=n(s);if(null!=a&&(l===t?a==a&&!ca(a):r(a,l)))var l=a,c=s}return c}function yr(t,e){var n=[];return dr(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function vr(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=bi),o||(o=[]);++i<s;){var a=t[i];e>0&&n(a)?e>1?vr(a,e-1,n,r,o):Re(o,a):r||(o[o.length]=a)}return o}var br=$o(),_r=$o(!0);function wr(t,e){return t&&br(t,e,Ia)}function kr(t,e){return t&&_r(t,e,Ia)}function xr(t,e){return Me(e,(function(e){return Zs(t[e])}))}function Sr(e,n){for(var r=0,o=(n=wo(n,e)).length;null!=e&&r<o;)e=e[zi(n[r++])];return r&&r==o?e:t}function Er(t,e,n){var r=e(t);return qs(t)?r:Re(r,n(t))}function Or(e){return null==e?e===t?"[object Undefined]":"[object Null]":ae&&ae in Ct(e)?function(e){var n=$t.call(e,ae),r=e[ae];try{e[ae]=t;var o=!0}catch(t){}var i=jt.call(e);return o&&(n?e[ae]=r:delete e[ae]),i}(e):function(t){return jt.call(t)}(e)}function Cr(t,e){return t>e}function Ar(t,e){return null!=t&&$t.call(t,e)}function Mr(t,e){return null!=t&&e in Ct(t)}function Tr(e,n,r){for(var o=r?Ne:Te,i=e[0].length,s=e.length,a=s,l=kt(s),c=1/0,u=[];a--;){var h=e[a];a&&n&&(h=Ie(h,Ye(n))),c=_n(h.length,c),l[a]=!r&&(n||i>=120&&h.length>=120)?new Gn(a&&h):t}h=e[0];var p=-1,d=l[0];t:for(;++p<i&&u.length<c;){var f=h[p],m=n?n(f):f;if(f=r||0!==f?f:0,!(d?Ze(d,m):o(u,m,r))){for(a=s;--a;){var g=l[a];if(!(g?Ze(g,m):o(e[a],m,r)))continue t}d&&d.push(m),u.push(f)}}return u}function Nr(e,n,r){var o=null==(e=Mi(e,n=wo(n,e)))?e:e[zi(Xi(n))];return null==o?t:Se(o,e,r)}function Ir(t){return na(t)&&Or(t)==m}function Rr(e,n,r,o,i){return e===n||(null==e||null==n||!na(e)&&!na(n)?e!=e&&n!=n:function(e,n,r,o,i,s){var a=qs(e),l=qs(n),c=a?g:gi(e),u=l?g:gi(n),h=(c=c==m?S:c)==S,p=(u=u==m?S:u)==S,d=c==u;if(d&&Gs(e)){if(!Gs(n))return!1;a=!0,h=!1}if(d&&!h)return s||(s=new Yn),a||ua(e)?ri(e,n,r,o,i,s):function(t,e,n,r,o,i,s){switch(n){case I:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case N:return!(t.byteLength!=e.byteLength||!i(new qt(t),new qt(e)));case y:case v:case x:return Hs(+t,+e);case b:return t.name==e.name&&t.message==e.message;case O:case A:return t==e+"";case k:var a=sn;case C:var l=1&r;if(a||(a=cn),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;r|=2,s.set(t,e);var u=ri(a(t),a(e),r,o,i,s);return s.delete(t),u;case M:if(jn)return jn.call(t)==jn.call(e)}return!1}(e,n,c,r,o,i,s);if(!(1&r)){var f=h&&$t.call(e,"__wrapped__"),_=p&&$t.call(n,"__wrapped__");if(f||_){var w=f?e.value():e,E=_?n.value():n;return s||(s=new Yn),i(w,E,r,o,s)}}return!!d&&(s||(s=new Yn),function(e,n,r,o,i,s){var a=1&r,l=ii(e),c=l.length,u=ii(n),h=u.length;if(c!=h&&!a)return!1;for(var p=c;p--;){var d=l[p];if(!(a?d in n:$t.call(n,d)))return!1}var f=s.get(e),m=s.get(n);if(f&&m)return f==n&&m==e;var g=!0;s.set(e,n),s.set(n,e);for(var y=a;++p<c;){var v=e[d=l[p]],b=n[d];if(o)var _=a?o(b,v,d,n,e,s):o(v,b,d,e,n,s);if(!(_===t?v===b||i(v,b,r,o,s):_)){g=!1;break}y||(y="constructor"==d)}if(g&&!y){var w=e.constructor,k=n.constructor;w==k||!("constructor"in e)||!("constructor"in n)||"function"==typeof w&&w instanceof w&&"function"==typeof k&&k instanceof k||(g=!1)}return s.delete(e),s.delete(n),g}(e,n,r,o,i,s))}(e,n,r,o,Rr,i))}function Lr(e,n,r,o){var i=r.length,s=i,a=!o;if(null==e)return!s;for(e=Ct(e);i--;){var l=r[i];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){var c=(l=r[i])[0],u=e[c],h=l[1];if(a&&l[2]){if(u===t&&!(c in e))return!1}else{var p=new Yn;if(o)var d=o(u,h,c,e,n,p);if(!(d===t?Rr(h,u,3,o,p):d))return!1}}return!0}function Dr(t){return!(!ea(t)||(e=t,zt&&zt in e))&&(Zs(t)?Bt:mt).test(ji(t));var e}function $r(t){return"function"==typeof t?t:null==t?ol:"object"==typeof t?qs(t)?Br(t[0],t[1]):Hr(t):dl(t)}function Pr(t){if(!Ei(t))return vn(t);var e=[];for(var n in Ct(t))$t.call(t,n)&&"constructor"!=n&&e.push(n);return e}function zr(t){if(!ea(t))return function(t){var e=[];if(null!=t)for(var n in Ct(t))e.push(n);return e}(t);var e=Ei(t),n=[];for(var r in t)("constructor"!=r||!e&&$t.call(t,r))&&n.push(r);return n}function jr(t,e){return t<e}function Fr(t,e){var n=-1,r=Ks(t)?kt(t.length):[];return dr(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function Hr(t){var e=pi(t);return 1==e.length&&e[0][2]?Ci(e[0][0],e[0][1]):function(n){return n===t||Lr(n,t,e)}}function Br(e,n){return ki(e)&&Oi(n)?Ci(zi(e),n):function(r){var o=Ca(r,e);return o===t&&o===n?Aa(r,e):Rr(n,o,3)}}function Vr(e,n,r,o,i){e!==n&&br(n,(function(s,a){if(i||(i=new Yn),ea(s))!function(e,n,r,o,i,s,a){var l=Ti(e,r),c=Ti(n,r),u=a.get(c);if(u)er(e,r,u);else{var h=s?s(l,c,r+"",e,n,a):t,p=h===t;if(p){var d=qs(c),f=!d&&Gs(c),m=!d&&!f&&ua(c);h=c,d||f||m?qs(l)?h=l:Js(l)?h=No(l):f?(p=!1,h=Eo(c,!0)):m?(p=!1,h=Co(c,!0)):h=[]:ia(c)||Ws(c)?(h=l,Ws(l)?h=va(l):ea(l)&&!Zs(l)||(h=vi(c))):p=!1}p&&(a.set(c,h),i(h,c,o,s,a),a.delete(c)),er(e,r,h)}}(e,n,a,r,Vr,o,i);else{var l=o?o(Ti(e,a),s,a+"",e,n,i):t;l===t&&(l=s),er(e,a,l)}}),Ra)}function Wr(e,n){var r=e.length;if(r)return _i(n+=n<0?r:0,r)?e[n]:t}function qr(t,e,n){e=e.length?Ie(e,(function(t){return qs(t)?function(e){return Sr(e,1===t.length?t[0]:t)}:t})):[ol];var r=-1;e=Ie(e,Ye(ui()));var o=Fr(t,(function(t,n,o){var i=Ie(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,s=o.length,a=n.length;++r<s;){var l=Ao(o[r],i[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Ur(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var s=e[r],a=Sr(t,s);n(a,s)&&to(i,wo(s,t),a)}return i}function Kr(t,e,n,r){var o=r?He:Fe,i=-1,s=e.length,a=t;for(t===e&&(e=No(e)),n&&(a=Ie(t,Ye(n)));++i<s;)for(var l=0,c=e[i],u=n?n(c):c;(l=o(a,u,l,r))>-1;)a!==t&&Yt.call(a,l,1),Yt.call(t,l,1);return t}function Jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;_i(o)?Yt.call(t,o,1):po(t,o)}}return t}function Gr(t,e){return t+ye(xn()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>h)return n;do{e%2&&(n+=t),(e=ye(e/2))&&(t+=t)}while(e);return n}function Xr(t,e){return Ri(Ai(t,e,ol),t+"")}function Zr(t){return Zn(Ha(t))}function Qr(t,e){var n=Ha(t);return $i(n,lr(e,0,n.length))}function to(e,n,r,o){if(!ea(e))return e;for(var i=-1,s=(n=wo(n,e)).length,a=s-1,l=e;null!=l&&++i<s;){var c=zi(n[i]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=a){var h=l[c];(u=o?o(h,c,l):t)===t&&(u=ea(h)?h:_i(n[i+1])?[]:{})}nr(l,c,u),l=l[c]}return e}var eo=Nn?function(t,e){return Nn.set(t,e),t}:ol,no=ue?function(t,e){return ue(t,"toString",{configurable:!0,enumerable:!1,value:el(e),writable:!0})}:ol;function ro(t){return $i(Ha(t))}function oo(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=kt(o);++r<o;)i[r]=t[r+e];return i}function io(t,e){var n;return dr(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}function so(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,s=t[i];null!==s&&!ca(s)&&(n?s<=e:s<e)?r=i+1:o=i}return o}return ao(t,e,ol,n)}function ao(e,n,r,o){var i=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(n=r(n))!=n,l=null===n,c=ca(n),u=n===t;i<s;){var h=ye((i+s)/2),p=r(e[h]),d=p!==t,f=null===p,m=p==p,g=ca(p);if(a)var y=o||m;else y=u?m&&(o||d):l?m&&d&&(o||!f):c?m&&d&&!f&&(o||!g):!f&&!g&&(o?p<=n:p<n);y?i=h+1:s=h}return _n(s,4294967294)}function lo(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Hs(a,l)){var l=a;i[o++]=0===s?0:s}}return i}function co(t){return"number"==typeof t?t:ca(t)?p:+t}function uo(t){if("string"==typeof t)return t;if(qs(t))return Ie(t,uo)+"";if(ca(t))return Fn?Fn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ho(t,e,n){var r=-1,o=Te,i=t.length,s=!0,a=[],l=a;if(n)s=!1,o=Ne;else if(i>=200){var c=e?null:Xo(t);if(c)return cn(c);s=!1,o=Ze,l=new Gn}else l=e?[]:a;t:for(;++r<i;){var u=t[r],h=e?e(u):u;if(u=n||0!==u?u:0,s&&h==h){for(var p=l.length;p--;)if(l[p]===h)continue t;e&&l.push(h),a.push(u)}else o(l,h,n)||(l!==a&&l.push(h),a.push(u))}return a}function po(t,e){return null==(t=Mi(t,e=wo(e,t)))||delete t[zi(Xi(e))]}function fo(t,e,n,r){return to(t,e,n(Sr(t,e)),r)}function mo(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?oo(t,r?0:i,r?i+1:o):oo(t,r?i+1:0,r?o:i)}function go(t,e){var n=t;return n instanceof qn&&(n=n.value()),Le(e,(function(t,e){return e.func.apply(e.thisArg,Re([t],e.args))}),n)}function yo(t,e,n){var r=t.length;if(r<2)return r?ho(t[0]):[];for(var o=-1,i=kt(r);++o<r;)for(var s=t[o],a=-1;++a<r;)a!=o&&(i[o]=pr(i[o]||s,t[a],e,n));return ho(vr(i,1),e,n)}function vo(e,n,r){for(var o=-1,i=e.length,s=n.length,a={};++o<i;){var l=o<s?n[o]:t;r(a,e[o],l)}return a}function bo(t){return Js(t)?t:[]}function _o(t){return"function"==typeof t?t:ol}function wo(t,e){return qs(t)?t:ki(t,e)?[t]:Pi(ba(t))}var ko=Xr;function xo(e,n,r){var o=e.length;return r=r===t?o:r,!n&&r>=o?e:oo(e,n,r)}var So=he||function(t){return pe.clearTimeout(t)};function Eo(t,e){if(e)return t.slice();var n=t.length,r=Ut?Ut(n):new t.constructor(n);return t.copy(r),r}function Oo(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function Co(t,e){var n=e?Oo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ao(e,n){if(e!==n){var r=e!==t,o=null===e,i=e==e,s=ca(e),a=n!==t,l=null===n,c=n==n,u=ca(n);if(!l&&!u&&!s&&e>n||s&&a&&c&&!l&&!u||o&&a&&c||!r&&c||!i)return 1;if(!o&&!s&&!u&&e<n||u&&r&&i&&!o&&!s||l&&r&&i||!a&&i||!c)return-1}return 0}function Mo(t,e,n,r){for(var o=-1,i=t.length,s=n.length,a=-1,l=e.length,c=bn(i-s,0),u=kt(l+c),h=!r;++a<l;)u[a]=e[a];for(;++o<s;)(h||o<i)&&(u[n[o]]=t[o]);for(;c--;)u[a++]=t[o++];return u}function To(t,e,n,r){for(var o=-1,i=t.length,s=-1,a=n.length,l=-1,c=e.length,u=bn(i-a,0),h=kt(u+c),p=!r;++o<u;)h[o]=t[o];for(var d=o;++l<c;)h[d+l]=e[l];for(;++s<a;)(p||o<i)&&(h[d+n[s]]=t[o++]);return h}function No(t,e){var n=-1,r=t.length;for(e||(e=kt(r));++n<r;)e[n]=t[n];return e}function Io(e,n,r,o){var i=!r;r||(r={});for(var s=-1,a=n.length;++s<a;){var l=n[s],c=o?o(r[l],e[l],l,r,e):t;c===t&&(c=e[l]),i?sr(r,l,c):nr(r,l,c)}return r}function Ro(t,e){return function(n,r){var o=qs(n)?Ee:or,i=e?e():{};return o(n,t,ui(r,2),i)}}function Lo(e){return Xr((function(n,r){var o=-1,i=r.length,s=i>1?r[i-1]:t,a=i>2?r[2]:t;for(s=e.length>3&&"function"==typeof s?(i--,s):t,a&&wi(r[0],r[1],a)&&(s=i<3?t:s,i=1),n=Ct(n);++o<i;){var l=r[o];l&&e(n,l,o,s)}return n}))}function Do(t,e){return function(n,r){if(null==n)return n;if(!Ks(n))return t(n,r);for(var o=n.length,i=e?o:-1,s=Ct(n);(e?i--:++i<o)&&!1!==r(s[i],i,s););return n}}function $o(t){return function(e,n,r){for(var o=-1,i=Ct(e),s=r(e),a=s.length;a--;){var l=s[t?a:++o];if(!1===n(i[l],l,i))break}return e}}function Po(e){return function(n){var r=on(n=ba(n))?pn(n):t,o=r?r[0]:n.charAt(0),i=r?xo(r,1).join(""):n.slice(1);return o[e]()+i}}function zo(t){return function(e){return Le(Za(Wa(e).replace(Xt,"")),t,"")}}function jo(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Bn(t.prototype),r=t.apply(n,e);return ea(r)?r:n}}function Fo(e){return function(n,r,o){var i=Ct(n);if(!Ks(n)){var s=ui(r,3);n=Ia(n),r=function(t){return s(i[t],t,i)}}var a=e(n,r,o);return a>-1?i[s?n[a]:a]:t}}function Ho(n){return oi((function(r){var o=r.length,i=o,s=Wn.prototype.thru;for(n&&r.reverse();i--;){var a=r[i];if("function"!=typeof a)throw new Tt(e);if(s&&!l&&"wrapper"==li(a))var l=new Wn([],!0)}for(i=l?i:o;++i<o;){var c=li(a=r[i]),u="wrapper"==c?ai(a):t;l=u&&xi(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[li(u[0])].apply(l,u[3]):1==a.length&&xi(a)?l[c]():l.thru(a)}return function(){var t=arguments,e=t[0];if(l&&1==t.length&&qs(e))return l.plant(e).value();for(var n=0,i=o?r[n].apply(this,t):e;++n<o;)i=r[n].call(this,i);return i}}))}function Bo(e,n,r,o,i,s,a,c,u,h){var p=n&l,d=1&n,f=2&n,m=24&n,g=512&n,y=f?t:jo(e);return function l(){for(var v=arguments.length,b=kt(v),_=v;_--;)b[_]=arguments[_];if(m)var w=ci(l),k=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(b,w);if(o&&(b=Mo(b,o,i,m)),s&&(b=To(b,s,a,m)),v-=k,m&&v<h){var x=ln(b,w);return Go(e,n,Bo,l.placeholder,r,b,x,c,u,h-v)}var S=d?r:this,E=f?S[e]:e;return v=b.length,c?b=function(e,n){for(var r=e.length,o=_n(n.length,r),i=No(e);o--;){var s=n[o];e[o]=_i(s,r)?i[s]:t}return e}(b,c):g&&v>1&&b.reverse(),p&&u<v&&(b.length=u),this&&this!==pe&&this instanceof l&&(E=y||jo(E)),E.apply(S,b)}}function Vo(t,e){return function(n,r){return function(t,e,n,r){return wr(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}function Wo(e,n){return function(r,o){var i;if(r===t&&o===t)return n;if(r!==t&&(i=r),o!==t){if(i===t)return o;"string"==typeof r||"string"==typeof o?(r=uo(r),o=uo(o)):(r=co(r),o=co(o)),i=e(r,o)}return i}}function qo(t){return oi((function(e){return e=Ie(e,Ye(ui())),Xr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function Uo(e,n){var r=(n=n===t?" ":uo(n)).length;if(r<2)return r?Yr(n,e):n;var o=Yr(n,ge(e/hn(n)));return on(n)?xo(pn(o),0,e).join(""):o.slice(0,e)}function Ko(e){return function(n,r,o){return o&&"number"!=typeof o&&wi(n,r,o)&&(r=o=t),n=fa(n),r===t?(r=n,n=0):r=fa(r),function(t,e,n,r){for(var o=-1,i=bn(ge((e-t)/(n||1)),0),s=kt(i);i--;)s[r?i:++o]=t,t+=n;return s}(n,r,o=o===t?n<r?1:-1:fa(o),e)}}function Jo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ya(e),n=ya(n)),t(e,n)}}function Go(e,n,r,o,s,l,c,u,h,p){var d=8&n;n|=d?i:a,4&(n&=~(d?a:i))||(n&=-4);var f=[e,n,s,d?l:t,d?c:t,d?t:l,d?t:c,u,h,p],m=r.apply(t,f);return xi(e)&&Ni(m,f),m.placeholder=o,Li(m,e,n)}function Yo(t){var e=Ot[t];return function(t,n){if(t=ya(t),(n=null==n?0:_n(ma(n),292))&&gn(t)){var r=(ba(t)+"e").split("e");return+((r=(ba(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Xo=An&&1/cn(new An([,-0]))[1]==u?function(t){return new An(t)}:cl;function Zo(t){return function(e){var n=gi(e);return n==k?sn(e):n==C?un(e):function(t,e){return Ie(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Qo(n,s,u,h,p,d,f,m){var g=2&s;if(!g&&"function"!=typeof n)throw new Tt(e);var y=h?h.length:0;if(y||(s&=-97,h=p=t),f=f===t?f:bn(ma(f),0),m=m===t?m:ma(m),y-=p?p.length:0,s&a){var v=h,b=p;h=p=t}var _=g?t:ai(n),w=[n,s,u,h,p,v,b,d,f,m];if(_&&function(t,e){var n=t[1],o=e[1],i=n|o,s=i<131,a=o==l&&8==n||o==l&&n==c&&t[7].length<=e[8]||384==o&&e[7].length<=e[8]&&8==n;if(!s&&!a)return t;1&o&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var h=t[3];t[3]=h?Mo(h,u,e[4]):u,t[4]=h?ln(t[3],r):e[4]}(u=e[5])&&(h=t[5],t[5]=h?To(h,u,e[6]):u,t[6]=h?ln(t[5],r):e[6]),(u=e[7])&&(t[7]=u),o&l&&(t[8]=null==t[8]?e[8]:_n(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(w,_),n=w[0],s=w[1],u=w[2],h=w[3],p=w[4],!(m=w[9]=w[9]===t?g?0:n.length:bn(w[9]-y,0))&&24&s&&(s&=-25),s&&1!=s)k=8==s||s==o?function(e,n,r){var o=jo(e);return function i(){for(var s=arguments.length,a=kt(s),l=s,c=ci(i);l--;)a[l]=arguments[l];var u=s<3&&a[0]!==c&&a[s-1]!==c?[]:ln(a,c);return(s-=u.length)<r?Go(e,n,Bo,i.placeholder,t,a,u,t,t,r-s):Se(this&&this!==pe&&this instanceof i?o:e,this,a)}}(n,s,m):s!=i&&33!=s||p.length?Bo.apply(t,w):function(t,e,n,r){var o=1&e,i=jo(t);return function e(){for(var s=-1,a=arguments.length,l=-1,c=r.length,u=kt(c+a),h=this&&this!==pe&&this instanceof e?i:t;++l<c;)u[l]=r[l];for(;a--;)u[l++]=arguments[++s];return Se(h,o?n:this,u)}}(n,s,u,h);else var k=function(t,e,n){var r=1&e,o=jo(t);return function e(){return(this&&this!==pe&&this instanceof e?o:t).apply(r?n:this,arguments)}}(n,s,u);return Li((_?eo:Ni)(k,w),n,s)}function ti(e,n,r,o){return e===t||Hs(e,Rt[r])&&!$t.call(o,r)?n:e}function ei(e,n,r,o,i,s){return ea(e)&&ea(n)&&(s.set(n,e),Vr(e,n,t,ei,s),s.delete(n)),e}function ni(e){return ia(e)?t:e}function ri(e,n,r,o,i,s){var a=1&r,l=e.length,c=n.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),h=s.get(n);if(u&&h)return u==n&&h==e;var p=-1,d=!0,f=2&r?new Gn:t;for(s.set(e,n),s.set(n,e);++p<l;){var m=e[p],g=n[p];if(o)var y=a?o(g,m,p,n,e,s):o(m,g,p,e,n,s);if(y!==t){if(y)continue;d=!1;break}if(f){if(!$e(n,(function(t,e){if(!Ze(f,e)&&(m===t||i(m,t,r,o,s)))return f.push(e)}))){d=!1;break}}else if(m!==g&&!i(m,g,r,o,s)){d=!1;break}}return s.delete(e),s.delete(n),d}function oi(e){return Ri(Ai(e,t,Ui),e+"")}function ii(t){return Er(t,Ia,fi)}function si(t){return Er(t,Ra,mi)}var ai=Nn?function(t){return Nn.get(t)}:cl;function li(t){for(var e=t.name+"",n=In[e],r=$t.call(In,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function ci(t){return($t.call(Hn,"placeholder")?Hn:t).placeholder}function ui(){var t=Hn.iteratee||il;return t=t===il?$r:t,arguments.length?t(arguments[0],arguments[1]):t}function hi(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function pi(t){for(var e=Ia(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Oi(o)]}return e}function di(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return Dr(r)?r:t}var fi=Pe?function(t){return null==t?[]:(t=Ct(t),Me(Pe(t),(function(e){return Gt.call(t,e)})))}:gl,mi=Pe?function(t){for(var e=[];t;)Re(e,fi(t)),t=Kt(t);return e}:gl,gi=Or;function yi(t,e,n){for(var r=-1,o=(e=wo(e,t)).length,i=!1;++r<o;){var s=zi(e[r]);if(!(i=null!=t&&n(t,s)))break;t=t[s]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&ta(o)&&_i(s,o)&&(qs(t)||Ws(t))}function vi(t){return"function"!=typeof t.constructor||Ei(t)?{}:Bn(Kt(t))}function bi(t){return qs(t)||Ws(t)||!!(Qt&&t&&t[Qt])}function _i(t,e){var n=typeof t;return!!(e=null==e?h:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function wi(t,e,n){if(!ea(n))return!1;var r=typeof e;return!!("number"==r?Ks(n)&&_i(e,n.length):"string"==r&&e in n)&&Hs(n[e],t)}function ki(t,e){if(qs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ca(t))||Q.test(t)||!Z.test(t)||null!=e&&t in Ct(e)}function xi(t){var e=li(t),n=Hn[e];if("function"!=typeof n||!(e in qn.prototype))return!1;if(t===n)return!0;var r=ai(n);return!!r&&t===r[0]}(En&&gi(new En(new ArrayBuffer(1)))!=I||On&&gi(new On)!=k||Cn&&gi(Cn.resolve())!=E||An&&gi(new An)!=C||Mn&&gi(new Mn)!=T)&&(gi=function(e){var n=Or(e),r=n==S?e.constructor:t,o=r?ji(r):"";if(o)switch(o){case Rn:return I;case Ln:return k;case Dn:return E;case $n:return C;case Pn:return T}return n});var Si=Lt?Zs:yl;function Ei(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Rt)}function Oi(t){return t==t&&!ea(t)}function Ci(e,n){return function(r){return null!=r&&r[e]===n&&(n!==t||e in Ct(r))}}function Ai(e,n,r){return n=bn(n===t?e.length-1:n,0),function(){for(var t=arguments,o=-1,i=bn(t.length-n,0),s=kt(i);++o<i;)s[o]=t[n+o];o=-1;for(var a=kt(n+1);++o<n;)a[o]=t[o];return a[n]=r(s),Se(e,this,a)}}function Mi(t,e){return e.length<2?t:Sr(t,oo(e,0,-1))}function Ti(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ni=Di(eo),Ii=fe||function(t,e){return pe.setTimeout(t,e)},Ri=Di(no);function Li(t,e,n){var r=e+"";return Ri(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Oe(f,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(r),n)))}function Di(e){var n=0,r=0;return function(){var o=wn(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function $i(e,n){var r=-1,o=e.length,i=o-1;for(n=n===t?o:n;++r<n;){var s=Gr(r,i),a=e[s];e[s]=e[r],e[r]=a}return e.length=n,e}var Pi=function(t){var e=Ds(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,o){e.push(r?o.replace(ut,"$1"):n||t)})),e}));function zi(t){if("string"==typeof t||ca(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ji(t){if(null!=t){try{return Dt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Fi(t){if(t instanceof qn)return t.clone();var e=new Wn(t.__wrapped__,t.__chain__);return e.__actions__=No(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Hi=Xr((function(t,e){return Js(t)?pr(t,vr(e,1,Js,!0)):[]})),Bi=Xr((function(e,n){var r=Xi(n);return Js(r)&&(r=t),Js(e)?pr(e,vr(n,1,Js,!0),ui(r,2)):[]})),Vi=Xr((function(e,n){var r=Xi(n);return Js(r)&&(r=t),Js(e)?pr(e,vr(n,1,Js,!0),t,r):[]}));function Wi(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ma(n);return o<0&&(o=bn(r+o,0)),je(t,ui(e,3),o)}function qi(e,n,r){var o=null==e?0:e.length;if(!o)return-1;var i=o-1;return r!==t&&(i=ma(r),i=r<0?bn(o+i,0):_n(i,o-1)),je(e,ui(n,3),i,!0)}function Ui(t){return null!=t&&t.length?vr(t,1):[]}function Ki(e){return e&&e.length?e[0]:t}var Ji=Xr((function(t){var e=Ie(t,bo);return e.length&&e[0]===t[0]?Tr(e):[]})),Gi=Xr((function(e){var n=Xi(e),r=Ie(e,bo);return n===Xi(r)?n=t:r.pop(),r.length&&r[0]===e[0]?Tr(r,ui(n,2)):[]})),Yi=Xr((function(e){var n=Xi(e),r=Ie(e,bo);return(n="function"==typeof n?n:t)&&r.pop(),r.length&&r[0]===e[0]?Tr(r,t,n):[]}));function Xi(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Zi=Xr(Qi);function Qi(t,e){return t&&t.length&&e&&e.length?Kr(t,e):t}var ts=oi((function(t,e){var n=null==t?0:t.length,r=ar(t,e);return Jr(t,Ie(e,(function(t){return _i(t,n)?+t:t})).sort(Ao)),r}));function es(t){return null==t?t:Sn.call(t)}var ns=Xr((function(t){return ho(vr(t,1,Js,!0))})),rs=Xr((function(e){var n=Xi(e);return Js(n)&&(n=t),ho(vr(e,1,Js,!0),ui(n,2))})),os=Xr((function(e){var n=Xi(e);return n="function"==typeof n?n:t,ho(vr(e,1,Js,!0),t,n)}));function is(t){if(!t||!t.length)return[];var e=0;return t=Me(t,(function(t){if(Js(t))return e=bn(t.length,e),!0})),Je(e,(function(e){return Ie(t,We(e))}))}function ss(e,n){if(!e||!e.length)return[];var r=is(e);return null==n?r:Ie(r,(function(e){return Se(n,t,e)}))}var as=Xr((function(t,e){return Js(t)?pr(t,e):[]})),ls=Xr((function(t){return yo(Me(t,Js))})),cs=Xr((function(e){var n=Xi(e);return Js(n)&&(n=t),yo(Me(e,Js),ui(n,2))})),us=Xr((function(e){var n=Xi(e);return n="function"==typeof n?n:t,yo(Me(e,Js),t,n)})),hs=Xr(is),ps=Xr((function(e){var n=e.length,r=n>1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,ss(e,r)}));function ds(t){var e=Hn(t);return e.__chain__=!0,e}function fs(t,e){return e(t)}var ms=oi((function(e){var n=e.length,r=n?e[0]:0,o=this.__wrapped__,i=function(t){return ar(t,e)};return!(n>1||this.__actions__.length)&&o instanceof qn&&_i(r)?((o=o.slice(r,+r+(n?1:0))).__actions__.push({func:fs,args:[i],thisArg:t}),new Wn(o,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(i)})),gs=Ro((function(t,e,n){$t.call(t,n)?++t[n]:sr(t,n,1)})),ys=Fo(Wi),vs=Fo(qi);function bs(t,e){return(qs(t)?Oe:dr)(t,ui(e,3))}function _s(t,e){return(qs(t)?Ce:fr)(t,ui(e,3))}var ws=Ro((function(t,e,n){$t.call(t,n)?t[n].push(e):sr(t,n,[e])})),ks=Xr((function(t,e,n){var r=-1,o="function"==typeof e,i=Ks(t)?kt(t.length):[];return dr(t,(function(t){i[++r]=o?Se(e,t,n):Nr(t,e,n)})),i})),xs=Ro((function(t,e,n){sr(t,n,e)}));function Ss(t,e){return(qs(t)?Ie:Fr)(t,ui(e,3))}var Es=Ro((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Os=Xr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&wi(t,e[0],e[1])?e=[]:n>2&&wi(e[0],e[1],e[2])&&(e=[e[0]]),qr(t,vr(e,1),[])})),Cs=de||function(){return pe.Date.now()};function As(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,Qo(e,l,t,t,t,t,n)}function Ms(n,r){var o;if("function"!=typeof r)throw new Tt(e);return n=ma(n),function(){return--n>0&&(o=r.apply(this,arguments)),n<=1&&(r=t),o}}var Ts=Xr((function(t,e,n){var r=1;if(n.length){var o=ln(n,ci(Ts));r|=i}return Qo(t,r,e,n,o)})),Ns=Xr((function(t,e,n){var r=3;if(n.length){var o=ln(n,ci(Ns));r|=i}return Qo(e,r,t,n,o)}));function Is(n,r,o){var i,s,a,l,c,u,h=0,p=!1,d=!1,f=!0;if("function"!=typeof n)throw new Tt(e);function m(e){var r=i,o=s;return i=s=t,h=e,l=n.apply(o,r)}function g(e){var n=e-u;return u===t||n>=r||n<0||d&&e-h>=a}function y(){var t=Cs();if(g(t))return v(t);c=Ii(y,function(t){var e=r-(t-u);return d?_n(e,a-(t-h)):e}(t))}function v(e){return c=t,f&&i?m(e):(i=s=t,l)}function b(){var e=Cs(),n=g(e);if(i=arguments,s=this,u=e,n){if(c===t)return function(t){return h=t,c=Ii(y,r),p?m(t):l}(u);if(d)return So(c),c=Ii(y,r),m(u)}return c===t&&(c=Ii(y,r)),l}return r=ya(r)||0,ea(o)&&(p=!!o.leading,a=(d="maxWait"in o)?bn(ya(o.maxWait)||0,r):a,f="trailing"in o?!!o.trailing:f),b.cancel=function(){c!==t&&So(c),h=0,i=u=s=c=t},b.flush=function(){return c===t?l:v(Cs())},b}var Rs=Xr((function(t,e){return hr(t,1,e)})),Ls=Xr((function(t,e,n){return hr(t,ya(e)||0,n)}));function Ds(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Tt(e);var r=function(){var e=arguments,o=n?n.apply(this,e):e[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,e);return r.cache=i.set(o,s)||i,s};return r.cache=new(Ds.Cache||Jn),r}function $s(t){if("function"!=typeof t)throw new Tt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ds.Cache=Jn;var Ps=ko((function(t,e){var n=(e=1==e.length&&qs(e[0])?Ie(e[0],Ye(ui())):Ie(vr(e,1),Ye(ui()))).length;return Xr((function(r){for(var o=-1,i=_n(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Se(t,this,r)}))})),zs=Xr((function(e,n){var r=ln(n,ci(zs));return Qo(e,i,t,n,r)})),js=Xr((function(e,n){var r=ln(n,ci(js));return Qo(e,a,t,n,r)})),Fs=oi((function(e,n){return Qo(e,c,t,t,t,n)}));function Hs(t,e){return t===e||t!=t&&e!=e}var Bs=Jo(Cr),Vs=Jo((function(t,e){return t>=e})),Ws=Ir(function(){return arguments}())?Ir:function(t){return na(t)&&$t.call(t,"callee")&&!Gt.call(t,"callee")},qs=kt.isArray,Us=ve?Ye(ve):function(t){return na(t)&&Or(t)==N};function Ks(t){return null!=t&&ta(t.length)&&!Zs(t)}function Js(t){return na(t)&&Ks(t)}var Gs=qe||yl,Ys=be?Ye(be):function(t){return na(t)&&Or(t)==v};function Xs(t){if(!na(t))return!1;var e=Or(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ia(t)}function Zs(t){if(!ea(t))return!1;var e=Or(t);return e==_||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qs(t){return"number"==typeof t&&t==ma(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function na(t){return null!=t&&"object"==typeof t}var ra=_e?Ye(_e):function(t){return na(t)&&gi(t)==k};function oa(t){return"number"==typeof t||na(t)&&Or(t)==x}function ia(t){if(!na(t)||Or(t)!=S)return!1;var e=Kt(t);if(null===e)return!0;var n=$t.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dt.call(n)==Ft}var sa=we?Ye(we):function(t){return na(t)&&Or(t)==O},aa=ke?Ye(ke):function(t){return na(t)&&gi(t)==C};function la(t){return"string"==typeof t||!qs(t)&&na(t)&&Or(t)==A}function ca(t){return"symbol"==typeof t||na(t)&&Or(t)==M}var ua=xe?Ye(xe):function(t){return na(t)&&ta(t.length)&&!!ie[Or(t)]},ha=Jo(jr),pa=Jo((function(t,e){return t<=e}));function da(t){if(!t)return[];if(Ks(t))return la(t)?pn(t):No(t);if(ee&&t[ee])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ee]());var e=gi(t);return(e==k?sn:e==C?cn:Ha)(t)}function fa(t){return t?(t=ya(t))===u||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ma(t){var e=fa(t),n=e%1;return e==e?n?e-n:e:0}function ga(t){return t?lr(ma(t),0,d):0}function ya(t){if("number"==typeof t)return t;if(ca(t))return p;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var n=ft.test(t);return n||gt.test(t)?ce(t.slice(2),n?2:8):dt.test(t)?p:+t}function va(t){return Io(t,Ra(t))}function ba(t){return null==t?"":uo(t)}var _a=Lo((function(t,e){if(Ei(e)||Ks(e))Io(e,Ia(e),t);else for(var n in e)$t.call(e,n)&&nr(t,n,e[n])})),wa=Lo((function(t,e){Io(e,Ra(e),t)})),ka=Lo((function(t,e,n,r){Io(e,Ra(e),t,r)})),xa=Lo((function(t,e,n,r){Io(e,Ia(e),t,r)})),Sa=oi(ar),Ea=Xr((function(e,n){e=Ct(e);var r=-1,o=n.length,i=o>2?n[2]:t;for(i&&wi(n[0],n[1],i)&&(o=1);++r<o;)for(var s=n[r],a=Ra(s),l=-1,c=a.length;++l<c;){var u=a[l],h=e[u];(h===t||Hs(h,Rt[u])&&!$t.call(e,u))&&(e[u]=s[u])}return e})),Oa=Xr((function(e){return e.push(t,ei),Se(Da,t,e)}));function Ca(e,n,r){var o=null==e?t:Sr(e,n);return o===t?r:o}function Aa(t,e){return null!=t&&yi(t,e,Mr)}var Ma=Vo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),t[e]=n}),el(ol)),Ta=Vo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),$t.call(t,e)?t[e].push(n):t[e]=[n]}),ui),Na=Xr(Nr);function Ia(t){return Ks(t)?Xn(t):Pr(t)}function Ra(t){return Ks(t)?Xn(t,!0):zr(t)}var La=Lo((function(t,e,n){Vr(t,e,n)})),Da=Lo((function(t,e,n,r){Vr(t,e,n,r)})),$a=oi((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ie(e,(function(e){return e=wo(e,t),r||(r=e.length>1),e})),Io(t,si(t),n),r&&(n=cr(n,7,ni));for(var o=e.length;o--;)po(n,e[o]);return n})),Pa=oi((function(t,e){return null==t?{}:function(t,e){return Ur(t,e,(function(e,n){return Aa(t,n)}))}(t,e)}));function za(t,e){if(null==t)return{};var n=Ie(si(t),(function(t){return[t]}));return e=ui(e),Ur(t,n,(function(t,n){return e(t,n[0])}))}var ja=Zo(Ia),Fa=Zo(Ra);function Ha(t){return null==t?[]:Xe(t,Ia(t))}var Ba=zo((function(t,e,n){return e=e.toLowerCase(),t+(n?Va(e):e)}));function Va(t){return Xa(ba(t).toLowerCase())}function Wa(t){return(t=ba(t))&&t.replace(vt,en).replace(Zt,"")}var qa=zo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ua=zo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ka=Po("toLowerCase"),Ja=zo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ga=zo((function(t,e,n){return t+(n?" ":"")+Xa(e)})),Ya=zo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Xa=Po("toUpperCase");function Za(e,n,r){return e=ba(e),(n=r?t:n)===t?function(t){return ne.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(lt)||[]}(e):e.match(n)||[]}var Qa=Xr((function(e,n){try{return Se(e,t,n)}catch(t){return Xs(t)?t:new St(t)}})),tl=oi((function(t,e){return Oe(e,(function(e){e=zi(e),sr(t,e,Ts(t[e],t))})),t}));function el(t){return function(){return t}}var nl=Ho(),rl=Ho(!0);function ol(t){return t}function il(t){return $r("function"==typeof t?t:cr(t,1))}var sl=Xr((function(t,e){return function(n){return Nr(n,t,e)}})),al=Xr((function(t,e){return function(n){return Nr(t,n,e)}}));function ll(t,e,n){var r=Ia(e),o=xr(e,r);null!=n||ea(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=xr(e,Ia(e)));var i=!(ea(n)&&"chain"in n&&!n.chain),s=Zs(t);return Oe(o,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=No(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Re([this.value()],arguments))})})),t}function cl(){}var ul=qo(Ie),hl=qo(Ae),pl=qo($e);function dl(t){return ki(t)?We(zi(t)):function(t){return function(e){return Sr(e,t)}}(t)}var fl=Ko(),ml=Ko(!0);function gl(){return[]}function yl(){return!1}var vl,bl=Wo((function(t,e){return t+e}),0),_l=Yo("ceil"),wl=Wo((function(t,e){return t/e}),1),kl=Yo("floor"),xl=Wo((function(t,e){return t*e}),1),Sl=Yo("round"),El=Wo((function(t,e){return t-e}),0);return Hn.after=function(t,n){if("function"!=typeof n)throw new Tt(e);return t=ma(t),function(){if(--t<1)return n.apply(this,arguments)}},Hn.ary=As,Hn.assign=_a,Hn.assignIn=wa,Hn.assignInWith=ka,Hn.assignWith=xa,Hn.at=Sa,Hn.before=Ms,Hn.bind=Ts,Hn.bindAll=tl,Hn.bindKey=Ns,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qs(t)?t:[t]},Hn.chain=ds,Hn.chunk=function(e,n,r){n=(r?wi(e,n,r):n===t)?1:bn(ma(n),0);var o=null==e?0:e.length;if(!o||n<1)return[];for(var i=0,s=0,a=kt(ge(o/n));i<o;)a[s++]=oo(e,i,i+=n);return a},Hn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},Hn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=kt(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Re(qs(n)?No(n):[n],vr(e,1))},Hn.cond=function(t){var n=null==t?0:t.length,r=ui();return t=n?Ie(t,(function(t){if("function"!=typeof t[1])throw new Tt(e);return[r(t[0]),t[1]]})):[],Xr((function(e){for(var r=-1;++r<n;){var o=t[r];if(Se(o[0],this,e))return Se(o[1],this,e)}}))},Hn.conforms=function(t){return function(t){var e=Ia(t);return function(n){return ur(n,t,e)}}(cr(t,1))},Hn.constant=el,Hn.countBy=gs,Hn.create=function(t,e){var n=Bn(t);return null==e?n:ir(n,e)},Hn.curry=function e(n,r,o){var i=Qo(n,8,t,t,t,t,t,r=o?t:r);return i.placeholder=e.placeholder,i},Hn.curryRight=function e(n,r,i){var s=Qo(n,o,t,t,t,t,t,r=i?t:r);return s.placeholder=e.placeholder,s},Hn.debounce=Is,Hn.defaults=Ea,Hn.defaultsDeep=Oa,Hn.defer=Rs,Hn.delay=Ls,Hn.difference=Hi,Hn.differenceBy=Bi,Hn.differenceWith=Vi,Hn.drop=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,(n=r||n===t?1:ma(n))<0?0:n,o):[]},Hn.dropRight=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,0,(n=o-(n=r||n===t?1:ma(n)))<0?0:n):[]},Hn.dropRightWhile=function(t,e){return t&&t.length?mo(t,ui(e,3),!0,!0):[]},Hn.dropWhile=function(t,e){return t&&t.length?mo(t,ui(e,3),!0):[]},Hn.fill=function(e,n,r,o){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&wi(e,n,r)&&(r=0,o=i),function(e,n,r,o){var i=e.length;for((r=ma(r))<0&&(r=-r>i?0:i+r),(o=o===t||o>i?i:ma(o))<0&&(o+=i),o=r>o?0:ga(o);r<o;)e[r++]=n;return e}(e,n,r,o)):[]},Hn.filter=function(t,e){return(qs(t)?Me:yr)(t,ui(e,3))},Hn.flatMap=function(t,e){return vr(Ss(t,e),1)},Hn.flatMapDeep=function(t,e){return vr(Ss(t,e),u)},Hn.flatMapDepth=function(e,n,r){return r=r===t?1:ma(r),vr(Ss(e,n),r)},Hn.flatten=Ui,Hn.flattenDeep=function(t){return null!=t&&t.length?vr(t,u):[]},Hn.flattenDepth=function(e,n){return null!=e&&e.length?vr(e,n=n===t?1:ma(n)):[]},Hn.flip=function(t){return Qo(t,512)},Hn.flow=nl,Hn.flowRight=rl,Hn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},Hn.functions=function(t){return null==t?[]:xr(t,Ia(t))},Hn.functionsIn=function(t){return null==t?[]:xr(t,Ra(t))},Hn.groupBy=ws,Hn.initial=function(t){return null!=t&&t.length?oo(t,0,-1):[]},Hn.intersection=Ji,Hn.intersectionBy=Gi,Hn.intersectionWith=Yi,Hn.invert=Ma,Hn.invertBy=Ta,Hn.invokeMap=ks,Hn.iteratee=il,Hn.keyBy=xs,Hn.keys=Ia,Hn.keysIn=Ra,Hn.map=Ss,Hn.mapKeys=function(t,e){var n={};return e=ui(e,3),wr(t,(function(t,r,o){sr(n,e(t,r,o),t)})),n},Hn.mapValues=function(t,e){var n={};return e=ui(e,3),wr(t,(function(t,r,o){sr(n,r,e(t,r,o))})),n},Hn.matches=function(t){return Hr(cr(t,1))},Hn.matchesProperty=function(t,e){return Br(t,cr(e,1))},Hn.memoize=Ds,Hn.merge=La,Hn.mergeWith=Da,Hn.method=sl,Hn.methodOf=al,Hn.mixin=ll,Hn.negate=$s,Hn.nthArg=function(t){return t=ma(t),Xr((function(e){return Wr(e,t)}))},Hn.omit=$a,Hn.omitBy=function(t,e){return za(t,$s(ui(e)))},Hn.once=function(t){return Ms(2,t)},Hn.orderBy=function(e,n,r,o){return null==e?[]:(qs(n)||(n=null==n?[]:[n]),qs(r=o?t:r)||(r=null==r?[]:[r]),qr(e,n,r))},Hn.over=ul,Hn.overArgs=Ps,Hn.overEvery=hl,Hn.overSome=pl,Hn.partial=zs,Hn.partialRight=js,Hn.partition=Es,Hn.pick=Pa,Hn.pickBy=za,Hn.property=dl,Hn.propertyOf=function(e){return function(n){return null==e?t:Sr(e,n)}},Hn.pull=Zi,Hn.pullAll=Qi,Hn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Kr(t,e,ui(n,2)):t},Hn.pullAllWith=function(e,n,r){return e&&e.length&&n&&n.length?Kr(e,n,t,r):e},Hn.pullAt=ts,Hn.range=fl,Hn.rangeRight=ml,Hn.rearg=Fs,Hn.reject=function(t,e){return(qs(t)?Me:yr)(t,$s(ui(e,3)))},Hn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=ui(e,3);++r<i;){var s=t[r];e(s,r,t)&&(n.push(s),o.push(r))}return Jr(t,o),n},Hn.rest=function(n,r){if("function"!=typeof n)throw new Tt(e);return Xr(n,r=r===t?r:ma(r))},Hn.reverse=es,Hn.sampleSize=function(e,n,r){return n=(r?wi(e,n,r):n===t)?1:ma(n),(qs(e)?Qn:Qr)(e,n)},Hn.set=function(t,e,n){return null==t?t:to(t,e,n)},Hn.setWith=function(e,n,r,o){return o="function"==typeof o?o:t,null==e?e:to(e,n,r,o)},Hn.shuffle=function(t){return(qs(t)?tr:ro)(t)},Hn.slice=function(e,n,r){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&wi(e,n,r)?(n=0,r=o):(n=null==n?0:ma(n),r=r===t?o:ma(r)),oo(e,n,r)):[]},Hn.sortBy=Os,Hn.sortedUniq=function(t){return t&&t.length?lo(t):[]},Hn.sortedUniqBy=function(t,e){return t&&t.length?lo(t,ui(e,2)):[]},Hn.split=function(e,n,r){return r&&"number"!=typeof r&&wi(e,n,r)&&(n=r=t),(r=r===t?d:r>>>0)?(e=ba(e))&&("string"==typeof n||null!=n&&!sa(n))&&!(n=uo(n))&&on(e)?xo(pn(e),0,r):e.split(n,r):[]},Hn.spread=function(t,n){if("function"!=typeof t)throw new Tt(e);return n=null==n?0:bn(ma(n),0),Xr((function(e){var r=e[n],o=xo(e,0,n);return r&&Re(o,r),Se(t,this,o)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?oo(t,1,e):[]},Hn.take=function(e,n,r){return e&&e.length?oo(e,0,(n=r||n===t?1:ma(n))<0?0:n):[]},Hn.takeRight=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,(n=o-(n=r||n===t?1:ma(n)))<0?0:n,o):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?mo(t,ui(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?mo(t,ui(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,n,r){var o=!0,i=!0;if("function"!=typeof t)throw new Tt(e);return ea(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),Is(t,n,{leading:o,maxWait:n,trailing:i})},Hn.thru=fs,Hn.toArray=da,Hn.toPairs=ja,Hn.toPairsIn=Fa,Hn.toPath=function(t){return qs(t)?Ie(t,zi):ca(t)?[t]:No(Pi(ba(t)))},Hn.toPlainObject=va,Hn.transform=function(t,e,n){var r=qs(t),o=r||Gs(t)||ua(t);if(e=ui(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:ea(t)&&Zs(i)?Bn(Kt(t)):{}}return(o?Oe:wr)(t,(function(t,r,o){return e(n,t,r,o)})),n},Hn.unary=function(t){return As(t,1)},Hn.union=ns,Hn.unionBy=rs,Hn.unionWith=os,Hn.uniq=function(t){return t&&t.length?ho(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?ho(t,ui(e,2)):[]},Hn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?ho(e,t,n):[]},Hn.unset=function(t,e){return null==t||po(t,e)},Hn.unzip=is,Hn.unzipWith=ss,Hn.update=function(t,e,n){return null==t?t:fo(t,e,_o(n))},Hn.updateWith=function(e,n,r,o){return o="function"==typeof o?o:t,null==e?e:fo(e,n,_o(r),o)},Hn.values=Ha,Hn.valuesIn=function(t){return null==t?[]:Xe(t,Ra(t))},Hn.without=as,Hn.words=Za,Hn.wrap=function(t,e){return zs(_o(e),t)},Hn.xor=ls,Hn.xorBy=cs,Hn.xorWith=us,Hn.zip=hs,Hn.zipObject=function(t,e){return vo(t||[],e||[],nr)},Hn.zipObjectDeep=function(t,e){return vo(t||[],e||[],to)},Hn.zipWith=ps,Hn.entries=ja,Hn.entriesIn=Fa,Hn.extend=wa,Hn.extendWith=ka,ll(Hn,Hn),Hn.add=bl,Hn.attempt=Qa,Hn.camelCase=Ba,Hn.capitalize=Va,Hn.ceil=_l,Hn.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=ya(r))==r?r:0),n!==t&&(n=(n=ya(n))==n?n:0),lr(ya(e),n,r)},Hn.clone=function(t){return cr(t,4)},Hn.cloneDeep=function(t){return cr(t,5)},Hn.cloneDeepWith=function(e,n){return cr(e,5,n="function"==typeof n?n:t)},Hn.cloneWith=function(e,n){return cr(e,4,n="function"==typeof n?n:t)},Hn.conformsTo=function(t,e){return null==e||ur(t,e,Ia(e))},Hn.deburr=Wa,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=wl,Hn.endsWith=function(e,n,r){e=ba(e),n=uo(n);var o=e.length,i=r=r===t?o:lr(ma(r),0,o);return(r-=n.length)>=0&&e.slice(r,i)==n},Hn.eq=Hs,Hn.escape=function(t){return(t=ba(t))&&J.test(t)?t.replace(U,nn):t},Hn.escapeRegExp=function(t){return(t=ba(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Hn.every=function(e,n,r){var o=qs(e)?Ae:mr;return r&&wi(e,n,r)&&(n=t),o(e,ui(n,3))},Hn.find=ys,Hn.findIndex=Wi,Hn.findKey=function(t,e){return ze(t,ui(e,3),wr)},Hn.findLast=vs,Hn.findLastIndex=qi,Hn.findLastKey=function(t,e){return ze(t,ui(e,3),kr)},Hn.floor=kl,Hn.forEach=bs,Hn.forEachRight=_s,Hn.forIn=function(t,e){return null==t?t:br(t,ui(e,3),Ra)},Hn.forInRight=function(t,e){return null==t?t:_r(t,ui(e,3),Ra)},Hn.forOwn=function(t,e){return t&&wr(t,ui(e,3))},Hn.forOwnRight=function(t,e){return t&&kr(t,ui(e,3))},Hn.get=Ca,Hn.gt=Bs,Hn.gte=Vs,Hn.has=function(t,e){return null!=t&&yi(t,e,Ar)},Hn.hasIn=Aa,Hn.head=Ki,Hn.identity=ol,Hn.includes=function(t,e,n,r){t=Ks(t)?t:Ha(t),n=n&&!r?ma(n):0;var o=t.length;return n<0&&(n=bn(o+n,0)),la(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Fe(t,e,n)>-1},Hn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ma(n);return o<0&&(o=bn(r+o,0)),Fe(t,e,o)},Hn.inRange=function(e,n,r){return n=fa(n),r===t?(r=n,n=0):r=fa(r),function(t,e,n){return t>=_n(e,n)&&t<bn(e,n)}(e=ya(e),n,r)},Hn.invoke=Na,Hn.isArguments=Ws,Hn.isArray=qs,Hn.isArrayBuffer=Us,Hn.isArrayLike=Ks,Hn.isArrayLikeObject=Js,Hn.isBoolean=function(t){return!0===t||!1===t||na(t)&&Or(t)==y},Hn.isBuffer=Gs,Hn.isDate=Ys,Hn.isElement=function(t){return na(t)&&1===t.nodeType&&!ia(t)},Hn.isEmpty=function(t){if(null==t)return!0;if(Ks(t)&&(qs(t)||"string"==typeof t||"function"==typeof t.splice||Gs(t)||ua(t)||Ws(t)))return!t.length;var e=gi(t);if(e==k||e==C)return!t.size;if(Ei(t))return!Pr(t).length;for(var n in t)if($t.call(t,n))return!1;return!0},Hn.isEqual=function(t,e){return Rr(t,e)},Hn.isEqualWith=function(e,n,r){var o=(r="function"==typeof r?r:t)?r(e,n):t;return o===t?Rr(e,n,t,r):!!o},Hn.isError=Xs,Hn.isFinite=function(t){return"number"==typeof t&&gn(t)},Hn.isFunction=Zs,Hn.isInteger=Qs,Hn.isLength=ta,Hn.isMap=ra,Hn.isMatch=function(t,e){return t===e||Lr(t,e,pi(e))},Hn.isMatchWith=function(e,n,r){return r="function"==typeof r?r:t,Lr(e,n,pi(n),r)},Hn.isNaN=function(t){return oa(t)&&t!=+t},Hn.isNative=function(t){if(Si(t))throw new St("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dr(t)},Hn.isNil=function(t){return null==t},Hn.isNull=function(t){return null===t},Hn.isNumber=oa,Hn.isObject=ea,Hn.isObjectLike=na,Hn.isPlainObject=ia,Hn.isRegExp=sa,Hn.isSafeInteger=function(t){return Qs(t)&&t>=-9007199254740991&&t<=h},Hn.isSet=aa,Hn.isString=la,Hn.isSymbol=ca,Hn.isTypedArray=ua,Hn.isUndefined=function(e){return e===t},Hn.isWeakMap=function(t){return na(t)&&gi(t)==T},Hn.isWeakSet=function(t){return na(t)&&"[object WeakSet]"==Or(t)},Hn.join=function(t,e){return null==t?"":yn.call(t,e)},Hn.kebabCase=qa,Hn.last=Xi,Hn.lastIndexOf=function(e,n,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==t&&(i=(i=ma(r))<0?bn(o+i,0):_n(i,o-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(e,n,i):je(e,Be,i,!0)},Hn.lowerCase=Ua,Hn.lowerFirst=Ka,Hn.lt=ha,Hn.lte=pa,Hn.max=function(e){return e&&e.length?gr(e,ol,Cr):t},Hn.maxBy=function(e,n){return e&&e.length?gr(e,ui(n,2),Cr):t},Hn.mean=function(t){return Ve(t,ol)},Hn.meanBy=function(t,e){return Ve(t,ui(e,2))},Hn.min=function(e){return e&&e.length?gr(e,ol,jr):t},Hn.minBy=function(e,n){return e&&e.length?gr(e,ui(n,2),jr):t},Hn.stubArray=gl,Hn.stubFalse=yl,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=xl,Hn.nth=function(e,n){return e&&e.length?Wr(e,ma(n)):t},Hn.noConflict=function(){return pe._===this&&(pe._=Ht),this},Hn.noop=cl,Hn.now=Cs,Hn.pad=function(t,e,n){t=ba(t);var r=(e=ma(e))?hn(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return Uo(ye(o),n)+t+Uo(ge(o),n)},Hn.padEnd=function(t,e,n){t=ba(t);var r=(e=ma(e))?hn(t):0;return e&&r<e?t+Uo(e-r,n):t},Hn.padStart=function(t,e,n){t=ba(t);var r=(e=ma(e))?hn(t):0;return e&&r<e?Uo(e-r,n)+t:t},Hn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),kn(ba(t).replace(rt,""),e||0)},Hn.random=function(e,n,r){if(r&&"boolean"!=typeof r&&wi(e,n,r)&&(n=r=t),r===t&&("boolean"==typeof n?(r=n,n=t):"boolean"==typeof e&&(r=e,e=t)),e===t&&n===t?(e=0,n=1):(e=fa(e),n===t?(n=e,e=0):n=fa(n)),e>n){var o=e;e=n,n=o}if(r||e%1||n%1){var i=xn();return _n(e+i*(n-e+le("1e-"+((i+"").length-1))),n)}return Gr(e,n)},Hn.reduce=function(t,e,n){var r=qs(t)?Le:Ue,o=arguments.length<3;return r(t,ui(e,4),n,o,dr)},Hn.reduceRight=function(t,e,n){var r=qs(t)?De:Ue,o=arguments.length<3;return r(t,ui(e,4),n,o,fr)},Hn.repeat=function(e,n,r){return n=(r?wi(e,n,r):n===t)?1:ma(n),Yr(ba(e),n)},Hn.replace=function(){var t=arguments,e=ba(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(e,n,r){var o=-1,i=(n=wo(n,e)).length;for(i||(i=1,e=t);++o<i;){var s=null==e?t:e[zi(n[o])];s===t&&(o=i,s=r),e=Zs(s)?s.call(e):s}return e},Hn.round=Sl,Hn.runInContext=s,Hn.sample=function(t){return(qs(t)?Zn:Zr)(t)},Hn.size=function(t){if(null==t)return 0;if(Ks(t))return la(t)?hn(t):t.length;var e=gi(t);return e==k||e==C?t.size:Pr(t).length},Hn.snakeCase=Ja,Hn.some=function(e,n,r){var o=qs(e)?$e:io;return r&&wi(e,n,r)&&(n=t),o(e,ui(n,3))},Hn.sortedIndex=function(t,e){return so(t,e)},Hn.sortedIndexBy=function(t,e,n){return ao(t,e,ui(n,2))},Hn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=so(t,e);if(r<n&&Hs(t[r],e))return r}return-1},Hn.sortedLastIndex=function(t,e){return so(t,e,!0)},Hn.sortedLastIndexBy=function(t,e,n){return ao(t,e,ui(n,2),!0)},Hn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=so(t,e,!0)-1;if(Hs(t[n],e))return n}return-1},Hn.startCase=Ga,Hn.startsWith=function(t,e,n){return t=ba(t),n=null==n?0:lr(ma(n),0,t.length),e=uo(e),t.slice(n,n+e.length)==e},Hn.subtract=El,Hn.sum=function(t){return t&&t.length?Ke(t,ol):0},Hn.sumBy=function(t,e){return t&&t.length?Ke(t,ui(e,2)):0},Hn.template=function(e,n,r){var o=Hn.templateSettings;r&&wi(e,n,r)&&(n=t),e=ba(e),n=ka({},n,o,ti);var i,s,a=ka({},n.imports,o.imports,ti),l=Ia(a),c=Xe(a,l),u=0,h=n.interpolate||bt,p="__p += '",d=At((n.escape||bt).source+"|"+h.source+"|"+(h===X?ht:bt).source+"|"+(n.evaluate||bt).source+"|$","g"),f="//# sourceURL="+($t.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";e.replace(d,(function(t,n,r,o,a,l){return r||(r=o),p+=e.slice(u,l).replace(_t,rn),n&&(i=!0,p+="' +\n__e("+n+") +\n'"),a&&(s=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),p+="';\n";var m=$t.call(n,"variable")&&n.variable;if(m){if(ct.test(m))throw new St("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(s?p.replace(B,""):p).replace(V,"$1").replace(W,"$1;"),p="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Qa((function(){return Et(l,f+"return "+p).apply(t,c)}));if(g.source=p,Xs(g))throw g;return g},Hn.times=function(t,e){if((t=ma(t))<1||t>h)return[];var n=d,r=_n(t,d);e=ui(e),t-=d;for(var o=Je(r,e);++n<t;)e(n);return o},Hn.toFinite=fa,Hn.toInteger=ma,Hn.toLength=ga,Hn.toLower=function(t){return ba(t).toLowerCase()},Hn.toNumber=ya,Hn.toSafeInteger=function(t){return t?lr(ma(t),-9007199254740991,h):0===t?t:0},Hn.toString=ba,Hn.toUpper=function(t){return ba(t).toUpperCase()},Hn.trim=function(e,n,r){if((e=ba(e))&&(r||n===t))return Ge(e);if(!e||!(n=uo(n)))return e;var o=pn(e),i=pn(n);return xo(o,Qe(o,i),tn(o,i)+1).join("")},Hn.trimEnd=function(e,n,r){if((e=ba(e))&&(r||n===t))return e.slice(0,dn(e)+1);if(!e||!(n=uo(n)))return e;var o=pn(e);return xo(o,0,tn(o,pn(n))+1).join("")},Hn.trimStart=function(e,n,r){if((e=ba(e))&&(r||n===t))return e.replace(rt,"");if(!e||!(n=uo(n)))return e;var o=pn(e);return xo(o,Qe(o,pn(n))).join("")},Hn.truncate=function(e,n){var r=30,o="...";if(ea(n)){var i="separator"in n?n.separator:i;r="length"in n?ma(n.length):r,o="omission"in n?uo(n.omission):o}var s=(e=ba(e)).length;if(on(e)){var a=pn(e);s=a.length}if(r>=s)return e;var l=r-hn(o);if(l<1)return o;var c=a?xo(a,0,l).join(""):e.slice(0,l);if(i===t)return c+o;if(a&&(l+=c.length-l),sa(i)){if(e.slice(l).search(i)){var u,h=c;for(i.global||(i=At(i.source,ba(pt.exec(i))+"g")),i.lastIndex=0;u=i.exec(h);)var p=u.index;c=c.slice(0,p===t?l:p)}}else if(e.indexOf(uo(i),l)!=l){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+o},Hn.unescape=function(t){return(t=ba(t))&&K.test(t)?t.replace(q,fn):t},Hn.uniqueId=function(t){var e=++Pt;return ba(t)+e},Hn.upperCase=Ya,Hn.upperFirst=Xa,Hn.each=bs,Hn.eachRight=_s,Hn.first=Ki,ll(Hn,(vl={},wr(Hn,(function(t,e){$t.call(Hn.prototype,e)||(vl[e]=t)})),vl),{chain:!1}),Hn.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),Oe(["drop","take"],(function(e,n){qn.prototype[e]=function(r){r=r===t?1:bn(ma(r),0);var o=this.__filtered__&&!n?new qn(this):this.clone();return o.__filtered__?o.__takeCount__=_n(r,o.__takeCount__):o.__views__.push({size:_n(r,d),type:e+(o.__dir__<0?"Right":"")}),o},qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Oe(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;qn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ui(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Oe(["head","last"],(function(t,e){var n="take"+(e?"Right":"");qn.prototype[t]=function(){return this[n](1).value()[0]}})),Oe(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");qn.prototype[t]=function(){return this.__filtered__?new qn(this):this[n](1)}})),qn.prototype.compact=function(){return this.filter(ol)},qn.prototype.find=function(t){return this.filter(t).head()},qn.prototype.findLast=function(t){return this.reverse().find(t)},qn.prototype.invokeMap=Xr((function(t,e){return"function"==typeof t?new qn(this):this.map((function(n){return Nr(n,t,e)}))})),qn.prototype.reject=function(t){return this.filter($s(ui(t)))},qn.prototype.slice=function(e,n){e=ma(e);var r=this;return r.__filtered__&&(e>0||n<0)?new qn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=ma(n))<0?r.dropRight(-n):r.take(n-e)),r)},qn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},qn.prototype.toArray=function(){return this.take(d)},wr(qn.prototype,(function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),o=/^(?:head|last)$/.test(n),i=Hn[o?"take"+("last"==n?"Right":""):n],s=o||/^find/.test(n);i&&(Hn.prototype[n]=function(){var n=this.__wrapped__,a=o?[1]:arguments,l=n instanceof qn,c=a[0],u=l||qs(n),h=function(t){var e=i.apply(Hn,Re([t],a));return o&&p?e[0]:e};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var p=this.__chain__,d=!!this.__actions__.length,f=s&&!p,m=l&&!d;if(!s&&u){n=m?n:new qn(this);var g=e.apply(n,a);return g.__actions__.push({func:fs,args:[h],thisArg:t}),new Wn(g,p)}return f&&m?e.apply(this,a):(g=this.thru(h),f?o?g.value()[0]:g.value():g)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Nt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(qs(o)?o:[],t)}return this[n]((function(n){return e.apply(qs(n)?n:[],t)}))}})),wr(qn.prototype,(function(t,e){var n=Hn[e];if(n){var r=n.name+"";$t.call(In,r)||(In[r]=[]),In[r].push({name:e,func:n})}})),In[Bo(t,2).name]=[{name:"wrapper",func:t}],qn.prototype.clone=function(){var t=new qn(this.__wrapped__);return t.__actions__=No(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=No(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=No(this.__views__),t},qn.prototype.reverse=function(){if(this.__filtered__){var t=new qn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},qn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=qs(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],s=i.size;switch(i.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=_n(e,t+s);break;case"takeRight":t=bn(t,e-s)}}return{start:t,end:e}}(0,o,this.__views__),s=i.start,a=i.end,l=a-s,c=r?a:s-1,u=this.__iteratees__,h=u.length,p=0,d=_n(l,this.__takeCount__);if(!n||!r&&o==l&&d==l)return go(t,this.__actions__);var f=[];t:for(;l--&&p<d;){for(var m=-1,g=t[c+=e];++m<h;){var y=u[m],v=y.iteratee,b=y.type,_=v(g);if(2==b)g=_;else if(!_){if(1==b)continue t;break t}}f[p++]=g}return f},Hn.prototype.at=ms,Hn.prototype.chain=function(){return ds(this)},Hn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},Hn.prototype.next=function(){this.__values__===t&&(this.__values__=da(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Hn.prototype.plant=function(e){for(var n,r=this;r instanceof Vn;){var o=Fi(r);o.__index__=0,o.__values__=t,n?i.__wrapped__=o:n=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,n},Hn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof qn){var n=e;return this.__actions__.length&&(n=new qn(this)),(n=n.reverse()).__actions__.push({func:fs,args:[es],thisArg:t}),new Wn(n,this.__chain__)}return this.thru(es)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,ee&&(Hn.prototype[ee]=function(){return this}),Hn}();fe?((fe.exports=mn)._=mn,de._=mn):pe._=mn}.call(s);var Yh=Gh.exports;function Xh(t){return t.type.create(Yh.cloneDeep(t.attrs))}const Zh=wl.create({name:"node_processor",addCommands:()=>({setBlockAttributes:gh((({commands:t,state:e},n,r,o={})=>{const i=Ge(t.getBlockAttributes(n))??{},{doc:s,tr:a}=e,{from:l,to:c}=a.selection;s.nodesBetween(l,c,((t,e)=>{_c.blocks.includes(t.type.name)&&a.setNodeAttribute(e,n,{...o,...i,...r})}))})),getBlockAttributes:gh((({editor:t},e,n)=>Sr((()=>{let r=Object.assign({},n||{});for(const n of _c.blocks)Object.assign(r,t.getAttributes(n)?.[e]||{});return Object.keys(r).length?r:null})))),removeBlockAttributes:gh((({commands:t},e)=>{for(const n of _c.blocks)t.resetAttributes(n,e)})),applyMark:gh((({state:t,commands:e},n,r,o={})=>{const{tr:i,doc:s,schema:a}=t,{$from:l,$to:c}=i.selection,u=Ol(kc.LINK,a),h=Ol(n,a);if(!(h.spec.group||"").includes(xc.SETTINGS))return e.setMark(n,r);if(l.pos===c.pos)return;s.nodesBetween(l.pos,c.pos,((t,s)=>{if(t.type.name===_c.LIST)return;const a=function(t,e){const n="string"==typeof e?e:e.name;return t.find((t=>t.type.name===n))}(t.marks,n),p=h.create({...a?.attrs||{},...r}),d=Wh(l,c,t,s),f=!u.isInSet(t.marks)&&function(t,e,n,r=Uh){const o=t.resolve(e).path.reverse();for(const t of o)if("number"!=typeof t)for(const e of t.marks)if(r(e,n))return!0;return!1}(i.doc,s,p,o.isAppliedToParent);if(f)return(t=>{if(!o.onAppliedToParent||!1===o.onAppliedToParent(t)){const{tr:n,node:r,position:o,mark:i}=t;e._removeNodeMark({tr:n,node:r,position:o,mark:i.type})}})({tr:i,node:t,position:s,mark:p});t.isText?i.addMark(d.from,d.to,p):function(t,e,n,r){const o=qh(t,r),i=e.from-o<=r,s=e.to+o>=n.nodeSize+r;return i&&s}(i.doc,i.selection,t,s)&&i.addNodeMark(s,p)}))})),getMarks:gh((({editor:t},e)=>{const n=Qe(t,"state");return Sr((()=>{const{selection:t,doc:r}=Ge(n),{from:o,to:i}=Ge(t),s=[];return r.nodesBetween(o,i,(t=>{for(const n of t.marks)n.type.name===e&&s.unshift(n.attrs)})),s}))})),getMark:gh((({commands:t},e)=>{const n=t.getMarks(e);return Sr((()=>Ge(n)[0]??null))})),hasMark:gh((({commands:t},e)=>{const n=t.getMark(e);return Sr((()=>!!Ge(n)))})),getCommonSettingMark:gh((({commands:t},e,n)=>{const r=t.getMark(e);return Sr((()=>Ge(r)?.value??Ge(n)))})),getDeviceSettingMark:gh((({commands:t},e,n)=>{const r=t.getMarks(e),o=t.getDevice();return Sr((()=>{for(const t of Ge(r)){const e=t[Ge(o)];if(e)return e}return Ge(n)}))})),removeAllMarks:gh((({state:t,commands:e})=>{const{tr:n,doc:r}=t,{from:o,to:i}=n.selection;r.nodesBetween(o,i,((t,r)=>{for(const o of t.marks)e._removeNodeMark({tr:n,node:t,position:r,mark:o})}))})),removeMarks:gh((({state:t,commands:e},n)=>{const{tr:r,doc:o}=t,{from:i,to:s}=r.selection;o.nodesBetween(i,s,((t,o)=>{const i=t.marks.filter((t=>n.includes(t.type.name)));for(const n of i)e._removeNodeMark({tr:r,node:t,position:o,mark:n})}))})),_removeNodeMark:gh(((t,{tr:e,node:n,position:r,mark:o})=>n.isText?e.removeMark(r,r+n.nodeSize,o):e.removeNodeMark(r,o)))})}),Qh=wl.create({name:"text_processor",addCommands:()=>({getSelectedText:gh((({state:t})=>{const{from:e,to:n}=t.selection;return t.doc.textBetween(e,n," ")})),transformText:gh((({state:t},e)=>{const{$from:n,$to:r}=t.tr.selection;n.pos!==r.pos&&t.doc.nodesBetween(n.pos,r.pos,((o,i)=>{if(!o.isText)return;const s=Wh(n,r,o,i),a=Math.max(0,n.pos-i),l=Math.max(0,r.pos-i),c=e({text:o.textContent.substring(a,l)}),u=t.schema.text(c,o.marks);t.tr.replaceWith(s.from,s.to,u)}))}))})}),tp=wl.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:gh((({state:t})=>{this.storage.selection=t.selection})),restoreSelection:gh((({commands:t})=>{this.storage.selection&&t.setTextSelection(this.storage.selection)})),expandSelection:gh((({tr:t,commands:e},n)=>{let r=t.selection.from,o=t.selection.to;t.doc.nodesBetween(r,o,((e,i,s)=>{if(n({node:e,parent:s})){const n=e.isText?0:qh(t.doc,i);r=Math.min(r,i+n),o=Math.max(o,i+e.nodeSize-n)}})),e.setTextSelection({from:r,to:o})})),expandSelectionToBlock:gh((({commands:t})=>{t.expandSelection((({parent:t})=>t.type.name===_c.DOCUMENT))}))}}}),ep=Jl.create({name:"doc",topNode:!0,content:"block+"});class np extends zo{constructor(t,e,n,r="SetDocAttr"){super(),this.key=t,this.value=e,this.schema=n,this.stepType=r}apply(t){this.prevValue=t.attrs.meta[this.key];const e=Zr.fromJSON(this.schema,t.toJSON());return e.attrs.meta[this.key]=this.value,jo.ok(e)}invert(){return new np(this.key,this.prevValue,this.schema,"revertSetDocAttr")}map(){return null}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}static fromJSON(t){return new np(t.key,t.value,t.stepType)}}zo.jsonID("setDocAttr",np);const rp=ep.extend({marks:xc.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",(t=>{t.target.closest("a")&&t.preventDefault()}))},addCommands:()=>({setDocMetaAttributes:gh((({state:t},e,n)=>{t.tr.step(new np(e,n,t.schema))}))})}),op=Jl.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",el(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ip=op.extend({marks:xc.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),sp=Jl.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,el(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>{return e={find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}},new hl({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=rl(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}});var e}))}}),ap=sp.extend({marks:xc.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),lp=wl.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[Cc.create(this.editor),Ac.create(this.editor)]}}),cp=Kl.create({name:kc.FONT_FAMILY,group:xc.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:gh((({commands:t},e)=>{t.applyMark(this.name,{value:e});const n=t.findFontByName(e);let r=Ge(t.getFontWeight());n.isWeightSupported(r)||(r=n.findClosestWeight(r),t.applyFontWeight(r));const o=t.isSettingCustomized(kc.FONT_STYLE).value;!n.isItalicSupported(r)&&o&&t.removeItalic()})),getFont:gh((({commands:t})=>{const e=Ge(this.options.defaultPreset),n=t.findFontByName(e.common.font_family),r=t.getFontFamily();return Sr((()=>t.findFontByName(Ge(r))||n))})),findFontByName:gh(((t,e)=>Ge(this.options.fonts).find((t=>t.name===e)))),getFontFamily:gh((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontFamily()))),getDefaultFontFamily:gh((({commands:t})=>{const e=t.getPreset();return Sr((()=>Ge(e).common.font_family))}))}},parseHTML(){const t=t=>({value:t.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:t},{style:"font-family",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>vh({font_family:t.value?`"${t.value}"`:null})}),up=wl.create({name:kc.STYLE_PRESET,addGlobalAttributes(){return[{types:[_c.PARAGRAPH,_c.HEADING],attributes:{preset:{isRequired:!1,default:{id:Ge(this.options.defaultId)},parseHTML:t=>{const e=Ge(this.options.presets);if("LI"===t.parentElement.tagName)return null;for(const{id:n,node:r,fallbackClass:o}of e){if(o&&t.classList.contains(o))return{id:n};const e=Ge(this.options.styleRenderer).makePresetCssClass({id:n});if(t.matches(e))return{id:n};if(t.tagName===`H${r?.level}`)return{id:n}}return"P"===t.tagName?{id:Ge(this.options.defaultId)}:null},renderHTML:t=>t.preset?{class:Ge(this.options.styleRenderer).makePresetHtmlClass(t.preset)}:null}}}]},addCommands(){function t(t,e){return t.find((t=>e===t.id))}function e(t,e){const n={};for(const r of Object.keys(t)){const o=t[r],i=e[r],s=!i||"inherit"===i.toLowerCase();n[r]=s?o:i}return n}return{getPresetList:gh((()=>Sr((()=>Ge(this.options.presets).filter((t=>!t.hidden)))))),getPreset:gh((({commands:n})=>{const r=n.getBlockAttributes("preset",{id:Ge(this.options.defaultId)}),o=n.getPresetList(),i=n.isLink(),s=n.getLinkPreset();return Sr((()=>{const n=t(Ge(o),Ge(r).id);if(!Ge(i))return n;const a=Ge(s);return{id:n.id,common:e(n.common,a.common),mobile:e(n.mobile,a.mobile),tablet:e(n.tablet,a.tablet),desktop:e(n.desktop,a.desktop)}}))})),applyPreset:gh((({commands:e,chain:n},r)=>{const o=t(Ge(e.getPresetList()),r),i=o.node?.type??_c.PARAGRAPH,s={preset:{id:r}};o.node&&(s.level=o.node.level);for(const t of kc.attributes)s[t]=Ge(e.getBlockAttributes(t));n().removeList().setNode(i,s).run()})),applyDefaultPreset:gh((({commands:t})=>{t.applyPreset(Ge(this.options.defaultId))})),removePreset:gh((({commands:t})=>{t.setNode(_c.PARAGRAPH,{preset:null})})),getPresetCustomization:gh((({editor:t,commands:e})=>{const n=Qe(t,"state");return Sr((()=>{const{selection:t,doc:r}=Ge(n),{from:o,to:i}=t;return e._getSettingCustomization(r,o,i)}))})),isSettingCustomized:gh((({commands:t},e)=>{const n=t.getPresetCustomization(),r=kc.presetAttributes.includes(e)?"attributes":"marks";return Sr((()=>Ge(n)[r]?.includes(e)??!1))})),getContentCustomization:gh((({editor:t,commands:e})=>{const n=Qe(t,"state");return Sr((()=>{const{doc:t}=Ge(n);return e._getSettingCustomization(t,0,t.content.size)}))})),_getSettingCustomization:gh(((t,e,n,r)=>{const o=new Set,i=new Set;return e.nodesBetween(n,r,(t=>{for(const[e,n]of Object.entries(t.attrs)){kc.presetAttributes.includes(e)&&n&&i.add(e)}for(const{type:e}of t.marks)kc.marks.includes(e.name)&&o.add(e.name)})),{attributes:Array.from(i),marks:Array.from(o)}})),removePresetCustomization:gh((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(kc.marks).resetAttributes(_c.PARAGRAPH,kc.presetAttributes).resetAttributes(_c.HEADING,kc.presetAttributes).restoreSelection().run()})),removeFormat:gh((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()}))}},onCreate(){this.options.styleRenderer.inject($p.head,Ge(this.options.presets))}}),hp=Kl.create({name:kc.FONT_WEIGHT,group:xc.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:gh((({commands:t},e)=>{t.applyMark(this.name,{value:e});Ge(t.getFont()).isItalicSupported(e)||t.removeItalic()})),toggleBold:gh((({commands:t})=>{const e=Ge(t.getFontWeight()),n=Ge(t.getFont()),r=Number(e)>=600?"400":"700",o=n.findClosestWeight(r);t.applyFontWeight(o)})),getFontWeight:gh((({commands:t})=>{const e=t.getCommonSettingMark(this.name,t.getDefaultFontWeight()),n=t.getFont();return Sr((()=>{const t=Ge(e),r=Ge(n);return r.isWeightSupported(t)?t:r.findClosestWeight(t)}))})),getDefaultFontWeight:gh((({commands:t})=>{const e=t.getPreset();return Sr((()=>Ge(e).common.font_weight))}))}},addKeyboardShortcuts:()=>({"Mod-b":bh("toggleBold"),"Mod-B":bh("toggleBold")}),parseHTML(){const t=t=>"bold"===t?{value:"700"}:!!Number(t)&&{value:t};return[{style:"--zw-font-weight",getAttrs:t},{style:"font-weight",getAttrs:t},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML:({HTMLAttributes:t})=>vh({font_weight:t.value})}),pp=Kl.create({name:kc.FONT_SIZE,group:xc.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getFontSize:gh((({commands:t})=>t.getDeviceSettingMark(this.name,t.getDefaultFontSize()))),getDefaultFontSize:gh((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Sr((()=>Ge(n)[Ge(e)].font_size.replace("px","")))})),applyFontSize:gh((({commands:t},e)=>{const n=Ge(t.getDevice());t.applyMark(this.name,{[n]:e},{isAppliedToParent:(t,e)=>t.type.name===e.type.name&&t.attrs[n]===e.attrs[n],onAppliedToParent:({tr:t,node:e,position:r,mark:o})=>{const i={...o.attrs,[n]:null};if(!Object.values(i).some((t=>!!t)))return!1;const s=o.type.create(i);e.isText?t.addMark(r,r+e.nodeSize,s):t.addNodeMark(r,s)}})})),increaseFontSize:gh((({commands:t})=>{const e=Number(Ge(t.getFontSize())),n=Math.min(e+1,Ge(this.options.maxSize));t.applyFontSize(String(n))})),decreaseFontSize:gh((({commands:t})=>{const e=Number(Ge(t.getFontSize())),n=Math.max(e-1,Ge(this.options.minSize));t.applyFontSize(String(n))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-=":bh("increaseFontSize"),"Mod-Shift--":bh("decreaseFontSize")}),parseHTML(){const t=t=>{if(!t)return null;const e=Hh(t,Ge(this.options.wrapperRef));return String(e)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:t(e.getPropertyValue("--zw-font-size-mobile")),tablet:t(e.getPropertyValue("--zw-font-size-tablet")),desktop:t(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const n=t(e);return{desktop:n,tablet:n,mobile:null}}}]},renderHTML({HTMLAttributes:t}){const e=t=>t?`${t}px`:null;return vh({font_size_mobile:e(t.mobile),font_size_tablet:e(t.tablet),font_size_desktop:e(t.desktop)})}}),dp=Kl.create({name:kc.FONT_COLOR,group:xc.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:gh((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontColor()))),getDefaultFontColor:gh((({commands:t})=>{const e=t.getPreset();return Sr((()=>Ge(e).common.color))})),applyFontColor:gh((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:Fh(t)});return[{style:"--zw-font-color",getAttrs:t},{style:"color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>vh({font_color:t.value})}),fp=Kl.create({name:kc.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:gh((({commands:t})=>t.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)"))),applyBackgroundColor:gh((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:Fh(t)});return[{style:"--zw-background-color",getAttrs:t},{style:"background-color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>vh({background_color:t.value})}),mp=wl.create({name:"device_manager",addCommands(){return{getDevice:gh((()=>Qe(this.options,"device")))}}}),gp=Kl.create({name:kc.FONT_STYLE,group:xc.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:gh((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultFontStyle();return Sr((()=>Ge(e)?.italic??Ge(n).italic))})),isItalicAvailable:gh((({commands:t})=>{const e=t.getFont(),n=t.getFontWeight();return Sr((()=>{const t=Ge(e),r=Ge(n);return t.isItalicSupported(r)&&!t.isWeightItalicOnly(r)}))})),getDefaultFontStyle:gh((({commands:t})=>{const e=t.getPreset();return Sr((()=>({italic:"italic"===Ge(e).common.font_style})))})),toggleItalic:gh((({commands:t})=>{Ge(t.isItalicAvailable())&&(Ge(t.isItalic())?t.removeItalic():t.applyItalic())})),applyItalic:gh((({commands:t})=>{t.applyMark(this.name,{italic:!0})})),removeItalic:gh((({commands:t})=>{t.applyMark(this.name,{italic:!1})}))}},addKeyboardShortcuts:()=>({"Mod-i":bh("toggleItalic"),"Mod-I":bh("toggleItalic")}),parseHTML(){const t=t=>({italic:t.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:t},{style:"font-style",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>vh({font_style:t.italic?"italic":"normal"})}),yp=Kl.create({name:kc.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:gh((({commands:t})=>{const e=t.getTextDecoration();return Sr((()=>Ge(e).underline))})),isStrikeThrough:gh((({commands:t})=>{const e=t.getTextDecoration();return Sr((()=>Ge(e).strike_through))})),getTextDecoration:gh((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultTextDecoration();return Sr((()=>{const t=Ge(e)??{},r=Ge(n);return{underline:t.underline||r.underline,strike_through:t.strike_through||r.strike_through}}))})),isUnderlineCustomized:gh((({commands:t})=>{const e=t.isUnderline(),n=t.getDefaultTextDecoration();return Sr((()=>Ge(e)!==Ge(n).underline))})),getDefaultTextDecoration:gh((({commands:t})=>{const e=t.getPreset();return Sr((()=>{const{text_decoration:t}=Ge(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}))})),toggleUnderline:gh((({commands:t})=>{t.toggleTextDecoration("underline")})),toggleStrikeThrough:gh((({commands:t})=>{t.toggleTextDecoration("strike_through")})),toggleTextDecoration:gh((({commands:t},e,n=null)=>{const r=Ge(t.getTextDecoration()),o=n??!r[e];t.applyMark(this.name,{[e]:o})})),applyTextDecoration:gh((({commands:t},e)=>{t.toggleTextDecoration(e,!0)})),removeTextDecoration:gh((({commands:t},e)=>{t.toggleTextDecoration(e,!1)}))}},addKeyboardShortcuts:()=>({"Mod-u":bh("toggleUnderline"),"Mod-U":bh("toggleUnderline")}),parseHTML(){const t=t=>{const e=t.includes("underline"),n=t.includes("line-through");return!(!e&&!n)&&{underline:e,strike_through:n}};return[{style:"--zw-text-decoration",getAttrs:t},{style:"text-decoration-line",getAttrs:t},{style:"text-decoration",getAttrs:t},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:t}){const e=[];return t.underline&&e.push("underline"),t.strike_through&&e.push("line-through"),e.length||e.push("none"),vh({text_decoration:e.join(" ")})}}),vp=wl.create({name:"case_style",addCommands:()=>({applyCaseStyle:gh((({commands:t},e)=>{switch(e){case vc.CAPITALIZE:return t.applyCapitalize();case vc.LOWERCASE:return t.applyLowerCase();case vc.UPPERCASE:return t.applyUpperCase()}})),applyCapitalize:gh((({commands:t})=>{t.transformText((({text:t})=>function(t){return t.toLowerCase().replace(/(?:^|\s)\S/g,(t=>t.toUpperCase()))}(t)))})),applyLowerCase:gh((({commands:t})=>{t.transformText((({text:t})=>t.toLowerCase()))})),applyUpperCase:gh((({commands:t})=>{t.transformText((({text:t})=>t.toUpperCase()))}))})}),bp={mobile:null,tablet:null,desktop:null},_p=wl.create({name:kc.ALIGNMENT,addGlobalAttributes:()=>[{types:[_c.PARAGRAPH,_c.HEADING],attributes:{[kc.ALIGNMENT]:{isRequired:!1,parseHTML({style:t}){const e=function(t){const e=Vh[t]||t;return bc.values.includes(e)?e:null}(t.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const n=t.getPropertyValue("--zw-alignment-mobile")||null,r=t.getPropertyValue("--zw-alignment-tablet")||null,o=t.getPropertyValue("--zw-alignment-desktop")||null;return n||r||o?{desktop:o,tablet:r,mobile:n}:null},renderHTML:t=>t.alignment?yh({alignment_mobile:t.alignment.mobile,alignment_tablet:t.alignment.tablet,alignment_desktop:t.alignment.desktop}):null}}}],addCommands(){return{applyAlignment:gh((({commands:t},e)=>{const n=Ge(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},bp)})),removeAlignment:gh((({commands:t})=>t.removeBlockAttributes(this.name))),getAlignment:gh((({commands:t})=>{const e=t.getBlockAttributes(this.name,bp),n=t.getDevice(),r=t.getDefaultAlignment();return Sr((()=>Ge(e)?.[Ge(n)]??Ge(r)))})),getDefaultAlignment:gh((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Sr((()=>Ge(n)[Ge(e)].alignment??bc.LEFT))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-l":bh("applyAlignment",bc.LEFT),"Mod-Shift-e":bh("applyAlignment",bc.CENTER),"Mod-Shift-r":bh("applyAlignment",bc.RIGHT),"Mod-Shift-j":bh("applyAlignment",bc.JUSTIFY)})}),wp={mobile:null,tablet:null,desktop:null},kp=wl.create({name:kc.LINE_HEIGHT,addGlobalAttributes(){return[{types:[_c.PARAGRAPH,_c.HEADING],attributes:{[kc.LINE_HEIGHT]:{isRequired:!1,parseHTML:t=>{if(t.matches('[style*="--zw-line-height"]')){return{mobile:null,tablet:t.style.getPropertyValue("--zw-line-height-tablet")||null,desktop:t.style.getPropertyValue("--zw-line-height-desktop")||null}}const e=t.style.lineHeight;if(!e)return null;const n=Bh(e,t,Ge(this.options.wrapperRef));return n?{desktop:n,tablet:n,mobile:null}:null},renderHTML:t=>t.line_height?yh({line_height_mobile:t.line_height.mobile,line_height_tablet:t.line_height.tablet,line_height_desktop:t.line_height.desktop}):null}}}]},addCommands(){return{getLineHeight:gh((({commands:t})=>{const e=t.getBlockAttributes(this.name,wp),n=t.getDevice(),r=t.getDefaultLineHeight();return Sr((()=>Ge(e)?.[Ge(n)]??Ge(r)))})),getDefaultLineHeight:gh((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Sr((()=>Ge(n)[Ge(e)].line_height))})),applyLineHeight:gh((({commands:t},e)=>{const n=Ge(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},wp)}))}}}),xp=Jl.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",el(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:_c.LIST_ITEM,marks:xc.SETTINGS,addCommands(){const t=({selection:t})=>t.$cursor.before(t.$cursor.depth-1);return{listItemNewline:gh((({commands:e,tr:n})=>{const r=n.doc.nodeAt(t(n));if(!n.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=t(n);for(const t of r.marks)n.addNodeMark(o,Xh(t));return!0}))}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:t=>{const{state:e,commands:n}=t.editor,r=e.selection.$cursor?.path.some((t=>t.type?.name===_c.LIST));if(r)return n.listItemNewline()}})}),Sp=Jl.create({name:_c.LIST,content:`${_c.LIST_ITEM}+`,group:"block list",marks:xc.SETTINGS,addExtensions:()=>[xp],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:wc.DISC}}}),parseHTML(){const t={a:wc.ROMAN,i:wc.LATIN,1:wc.DECIMAL},e=e=>{for(const n of wc.values){const r=`.${Ge(this.options.baseClass)}${n}`;if(e.matches(r))return n;if(t[e.type.toLowerCase()]===n)return n}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||wc.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||wc.DISC}})}]},renderHTML({HTMLAttributes:t}){const e=[Ge(this.options.baseClass)+t.bullet.type,Ge(this.options.presetClass)];return[wc.ordered.includes(t.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands:()=>({getListType:gh((({commands:t})=>{const e=t.getBlockAttributes("bullet",{type:null});return Sr((()=>Ge(e).type??null))})),applyList:gh((({commands:t,chain:e},n)=>{if(Ge(t.getListType())!==n)return e().applyDefaultPreset().toggleList(_c.LIST,_c.LIST_ITEM).setBlockAttributes("bullet",{type:n}).command((({commands:t,tr:e})=>t._bubbleListItemMarks(e))).run();t.removeList()})),_bubbleListItemMarks:gh(((t,e)=>{const{doc:n,selection:r}=e,o=r.$from.start(),i=r.$to.end();function s(t,e){if(kc.inlineMarks.includes(e.type))return!1;if(e.type.isInSet(t.marks))return!1;for(const n of t.content.content)if(n.childCount){if(!n.marks)return!1;if(!e.isInSet(n.marks))return!1}return!0}n.nodesBetween(o,i,((t,n)=>{if(t.type.name===_c.LIST)return;if(t.type.name!==_c.LIST_ITEM)return!1;const r=[];return t.forEach((o=>{for(const i of o.marks)i.isInSet(r)?e.removeNodeMark(n+1,i):s(t,i)&&(e.removeNodeMark(n+1,i),e.addNodeMark(n,Xh(i)),r.push(i))})),!1}))})),removeList:gh((({commands:t,state:e})=>{const{tr:n,doc:r,selection:o}=e,i=o.$from.start(),s=o.$to.end();r.nodesBetween(i,s,((t,e,r)=>{if([_c.LIST,_c.LIST_ITEM].includes(t.type.name))return;if(r.type.name!==_c.LIST_ITEM)return!1;const o=r.marks.filter((function(e){return!e.type.isInSet(t.marks)}));for(const t of o)n.addNodeMark(e,Xh(t));return!1})),t.liftListItem(_c.LIST_ITEM)}))}),addInputRules(){const t=(t,e)=>{return n={find:e,type:this.type,getAttributes:{bullet:{type:t}},joinPredicate:(e,{attrs:n})=>n.bullet.type===t},new hl({find:n.find,handler:({state:t,range:e,match:r,chain:o})=>{const i=rl(n.getAttributes,void 0,r)||{},s=t.tr.delete(e.from,e.to),a=s.doc.resolve(e.from).blockRange(),l=a&&Yo(a,n.type,i);if(!l)return null;if(s.wrap(a,l),n.keepMarks&&n.editor){const{selection:e,storedMarks:r}=t,{splittableMarks:o}=n.editor.extensionManager,i=r||e.$to.parentOffset&&e.$from.marks();if(i){const t=i.filter((t=>o.includes(t.type.name)));s.ensureMarks(t)}}if(n.keepAttributes){const t="bulletList"===n.type.name||"orderedList"===n.type.name?"listItem":"taskList";o().updateAttributes(t,i).run()}const c=s.doc.resolve(e.from-1).nodeBefore;c&&c.type===n.type&&Qo(s.doc,e.from-1)&&(!n.joinPredicate||n.joinPredicate(r,c))&&s.join(e.from-1)}});var n};return[t(wc.DISC,/^\s*([-+*])\s$/),t(wc.DECIMAL,/^(\d+)\.\s$/),t(wc.LATIN,/^([ivx]{1,3})\.\s$/i),t(wc.ROMAN,/^([a-z])\.\s$/i)]}});function Ep(t){return new Ii({key:new Di("autolink"),appendTransaction:(e,n,r)=>{const o=e.some((t=>t.docChanged))&&!n.doc.eq(r.doc),i=e.some((t=>t.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=r,a=function(t,e){const n=new mi(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}(n.doc,[...e]),l=function(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach(((t,o)=>{const i=[];if(t.ranges.length)t.forEach(((t,e)=>{i.push({from:t,to:e})}));else{const{from:t,to:e}=n[o];if(void 0===t||void 0===e)return;i.push({from:t,to:e})}i.forEach((({from:t,to:n})=>{const i=e.slice(o).map(t,-1),s=e.slice(o).map(n),a=e.invert().map(i,-1),l=e.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})}))})),jl(r)}(a);return l.forEach((({newRange:e})=>{const n=function(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&r.push({node:t,pos:e})})),r}(r.doc,e,(t=>t.isTextblock));let o,i;if(n.length>1?(o=n[0],i=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ")):n.length&&r.doc.textBetween(e.from,e.to," "," ").endsWith(" ")&&(o=n[0],i=r.doc.textBetween(o.pos,e.to,void 0," ")),o&&i){const e=i.split(" ").filter((t=>""!==t));if(e.length<=0)return!1;const n=e[e.length-1],a=o.pos+i.lastIndexOf(n);if(!n)return!1;fh(n).filter((t=>t.isLink)).map((t=>({...t,from:a+t.start+1,to:a+t.end+1}))).filter((t=>!r.schema.marks.code||!r.doc.rangeHasMark(t.from,t.to,r.schema.marks.code))).filter((e=>!t.validate||t.validate(e.value))).forEach((e=>{Fl(e.from,e.to,r.doc).some((e=>e.mark.type===t.type))||s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}})),s.steps.length?s:void 0}})}const Op=Kl.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach((t=>{"string"!=typeof t?hh(t.scheme,t.optionalSlashes):hh(t)}))},onDestroy(){Wc.groups={},uh.scanner=null,uh.parser=null,uh.tokenQueue=[],uh.pluginQueue=[],uh.customSchemes=[],uh.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){var e;return(null===(e=t.href)||void 0===e?void 0:e.startsWith("javascript:"))?["a",el(this.options.HTMLAttributes,{...t,href:""}),0]:["a",el(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(t={find:t=>fh(t).filter((t=>!this.options.validate||this.options.validate(t.value))).filter((t=>t.isLink)).map((t=>({text:t.value,index:t.start,data:t}))),type:this.type,getAttributes:(t,e)=>{var n,r;const o=null===(n=null==e?void 0:e.clipboardData)||void 0===n?void 0:n.getData("text/html"),i=null==o?void 0:o.match(/href="([^"]*)"/);return i?{href:i[1]}:{href:null===(r=t.data)||void 0===r?void 0:r.href}}},new ml({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const i=rl(t.getAttributes,void 0,r,o);if(!1===i||null===i)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const r=l.search(/\S/),o=n.from+l.indexOf(a),u=o+a.length;if(Fl(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>o)).length)return null;u<n.to&&s.delete(u,n.to),o>n.from&&s.delete(n.from+r,o),c=n.from+r+a.length,s.addMark(n.from+r,c,t.type.create(i||{})),s.removeStoredMark(t.type)}}}))];var t},addProseMirrorPlugins(){const t=[];var e;return this.options.autolink&&t.push(Ep({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new Ii({key:new Di("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(0!==r.button)return!1;if("A"!==r.target.nodeName)return!1;const s=zl(t.state,e.type.name),a=r.target,l=null!==(o=null==a?void 0:a.href)&&void 0!==o?o:s.href,c=null!==(i=null==a?void 0:a.target)&&void 0!==i?i:s.target;return!(!a||!l||(t.editable&&window.open(l,c),0))}}}))),this.options.linkOnPaste&&t.push(function(t){return new Ii({key:new Di("handlePasteLink"),props:{handlePaste:(e,n,r)=>{var o;const{state:i}=e,{selection:s}=i,{empty:a}=s;if(a)return!1;let l="";r.content.forEach((t=>{l+=t.textContent}));const c=fh(l).find((t=>t.isLink&&t.value===l));if(!l||!c)return!1;const u=null===(o=n.clipboardData)||void 0===o?void 0:o.getData("text/html"),h=null==u?void 0:u.match(/href="([^"]*)"/),p=h?h[1]:c.href;return t.editor.commands.setMark(t.type,{href:p}),!0}}})}({editor:this.editor,type:this.type})),t}}),Cp=Op.extend({name:kc.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:t=>{const e=t.getAttribute("href");return e.startsWith("#")?parseFloat(t.getAttribute("href").replace("#","")):e}},target:{default:Sc.SELF,parseHTML:t=>t.getAttribute("target")||Sc.SELF},destination:{default:Ec.URL,parseHTML:t=>{const e=t.getAttribute("href");if(!e.startsWith("#"))return Ec.URL;const n=e.replace("#","");return Ge(this.options.pageBlocks).find((t=>t.id===parseInt(n)))?Ec.BLOCK:Ec.URL}}}},addCommands(){const{unsetLink:t}=this.parent();return{removeLink:t,applyLink:gh((({commands:t,chain:e},n)=>(t.setMeta("preventAutolink",!0),t.getSelectedText()?e().applyMark(this.name,n).expandSelectionToLink().command((({tr:t})=>(n.text&&t.insertText(n.text,t.selection.from,t.selection.to),!0))).run():t.insertContent(zp.text(n.text,[zp.mark(kc.LINK,n)]))))),expandSelectionToLink:gh((({commands:t})=>{t.expandSelection((({node:t})=>this.type.isInSet(t.marks)))})),isLink:gh((({commands:t})=>t.hasMark(this.name))),getLinkPreset:gh((()=>Sr((()=>Ge(this.options.preset)))))}},addProseMirrorPlugins(){return[...this.parent(),mh.create(this.editor)]},renderHTML({HTMLAttributes:t}){const e=t.destination===Ec.BLOCK?`#${t.href}`:t.href,n=Ge(this.options.basePresetClass)+Ge(this.options.preset).id;return["a",{href:e,target:t.target,class:`${n} zw-style`},0]}}),Ap=Kl.create({name:kc.SUPERSCRIPT,addCommands(){return{applySuperscript:gh((({commands:t})=>{t.setMark(this.name)})),removeSuperscript:gh((({commands:t})=>{t.unsetMark(this.name)})),toggleSuperscript:gh((({commands:t})=>{Ge(t.isSuperscript())?t.removeSuperscript():t.applySuperscript()})),isSuperscript:gh((({commands:t})=>{const e=t.getMark(this.name);return Sr((()=>!!Ge(e)))}))}},parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:t=>"super"===t&&null}],renderHTML:()=>["sup",{class:"zw-superscript"},0]}),Mp=wl.create({name:kc.MARGIN,addGlobalAttributes:()=>[{types:[_c.PARAGRAPH,_c.HEADING],attributes:{[kc.MARGIN]:{isRequired:!1,parseHTML(t){const{margin:e,marginTop:n,marginRight:r,marginBottom:o,marginLeft:i}=t.style;if(![e,n,r,o,i].some((t=>!!t)))return null;if(e)return{value:e};return{value:[n||0,r||0,o||0,i||0].join(" ")}},renderHTML:t=>t.margin?yh({margin:t.margin.value}):null}}}]});function Tp(t){const e=e=>t.presetsRef.value.find((t=>t.id===e)),n=Ie({default:null,link:null});return function(t,e,n){"production"===process.env.NODE_ENV||it(e)||en("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),zn(t,e,n)}(t.presetsRef,(()=>{n.default=e(t.defaultPresetId),n.link=e(t.linkPresetId)}),{immediate:!0,deep:!0}),[rp,ip,ap,Gl,gc,Zh,Qh,tp,lp].concat([up.configure({presets:t.presetsRef,defaultId:t.defaultPresetId,styleRenderer:new jp({baseClass:t.basePresetClass,makeVariable:t.makePresetVariable,linkPresetId:t.linkPresetId})}),Sp.configure({baseClass:t.baseListClass,presetClass:t.basePresetClass+t.defaultPresetId}),mp.configure({device:t.deviceRef}),pp.configure({minSize:t.minFontSize,maxSize:t.maxFontSize,wrapperRef:t.wrapperRef}),cp.configure({fonts:t.fonts,defaultPreset:Qe(n,"default")}),hp,dp,fp,gp,yp,vp,Ap,_p,kp.configure({wrapperRef:t.wrapperRef}),Cp.configure({preset:Qe(n,"link"),basePresetClass:t.basePresetClass,pageBlocks:t.pageBlocksRef}),Mp])}class Np{_domParser=new DOMParser;types=window;parse(t){return this._domParser.parseFromString(t,"text/html")}}class Ip{content;constructor({content:t}){this.content=t}normalize(){throw new Error("Implement abstract method")}}class Rp extends Ip{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=Rp.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:t,parser:e}){super({content:t}),this._parser=e,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,(t=>"BR"===t.tagName)),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,(t=>"LI"===t.tagName)),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const t=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(t,(t=>t.remove()))}_normalizeRootTags(){const t=Array.from(this.dom.body.childNodes),e=this.dom.createDocumentFragment();let n;for(const r of t)this._isRootNode(r)?(e.append(r),n=null):(n||(n=this.dom.createElement("p"),e.append(n)),n.append(r));this.dom.body.innerHTML="",this.dom.body.append(e)}_createNodeIterator(t,e){return this.dom.createNodeIterator(this.dom.body,t,e)}_iterateNodes(t,e=(()=>!0)){const n=t=>"BODY"!==t.tagName&&e.call(this,t),r=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:t=>n(t)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(r,t)}_runIterator(t,e){let n=t.nextNode();for(;n;)e.call(this,n),n=t.nextNode()}_removeEmptyNodes(t){t.innerHTML.trim()||t.remove()}_normalizeListItems(t){const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes);let r,o;const i=n=>{this._assignElementProperties(n,t,Rp.BLOCK_STYLES),e.append(n)};this._assignElementProperties(t,t.parentElement,Rp.BLOCK_STYLES);for(const t of n)if(this._isBlockNode(t))i(t),r=null,o=t;else if("BR"===t.tagName&&o&&"BR"!==o?.tagName)t.remove(),o=t;else if("BR"!==t.tagName)r||(r=this.dom.createElement("p"),i(r)),r.append(t),o=t;else{const e=this.dom.createElement("p");e.append(t),i(e),r=null,o=t}t.append(e),this._removeStyleProperties(t,Rp.BLOCK_STYLES),this._removeStyleProperties(t.parentElement,Rp.BLOCK_STYLES),this._assignElementProperties(t,t.parentElement),t.parentElement.lastElementChild===t&&this._removeStyleProperties(t.parentElement)}_isBlockNode(t){return Rp.BLOCK_NODE_NAMES.includes(t.tagName)}_isRootNode(t){return Rp.ROOT_NODE_NAMES.includes(t.tagName)}_assignElementProperties(t,e,n=Array.from(e.style)){for(const r of n){const n=e.style.getPropertyValue(r);n&&!t.style.getPropertyValue(r)&&t.style.setProperty(r,n)}}_removeStyleProperties(t,e=Array.from(t.style)){for(const n of e)t.style.removeProperty(n);0===t.style.length&&t.removeAttribute("style")}_normalizeBreakLines({parentElement:t}){if(!this._isBlockNode(t))return;if(!t.textContent)return;const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes),r=t.cloneNode(!0);r.innerHTML="";let o=r.cloneNode();const i=n=>{this._assignElementProperties(n,t,Rp.BLOCK_STYLES),e.append(n)};for(const t of n)"BR"!==t.tagName?o.append(t):(i(o),o=r.cloneNode());e.append(o),t.replaceWith(e)}_normalizeBlockTextDecoration(){const t=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this._moveTextDecorationToChildren(e)}_moveTextDecorationToChildren(t){const e=this._parseTextDecoration(t);if(t.style.removeProperty("text-decoration-line"),t.style.removeProperty("text-decoration"),t.style.cssText||t.removeAttribute("style"),!e.none)for(const n of t.childNodes){const r=this._wrapTextNode(t,n),o=this._parseTextDecoration(r),i={underline:o.underline||e.underline,line_through:o.line_through||e.line_through};r.style.removeProperty("text-decoration-line"),r.style.removeProperty("text-decoration"),r.style.textDecoration=Object.entries(i).filter((([,t])=>t)).map((([t])=>t.replace("_","-"))).join(" ")}}_parseTextDecoration(t){const{textDecoration:e,textDecorationLine:n}=t.style,r=e||n||"";return{none:r.includes("none"),underline:r.includes("underline"),line_through:r.includes("line-through")}}_normalizeBlockBackgroundColor(){const t=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this._moveBackgroundColorToChildren(e)}_moveBackgroundColorToChildren(t){const e=t.style.backgroundColor;t.style.removeProperty("background-color"),t.style.cssText||t.removeAttribute("style");for(const n of t.childNodes){const r=this._wrapTextNode(t,n),o=r.style.backgroundColor||e;r.style.backgroundColor=o}}_wrapTextNode(t,e){if(e.nodeType!==this._Node.TEXT_NODE)return e;const n=this.dom.createElement("span");return n.append(e.cloneNode()),t.replaceChild(n,e),n}}class Lp extends Ip{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(t){this._iterateChildNodes(this.content,t)}_iterateChildNodes(t,e){for(const n of t.content)n.content&&this._iterateChildNodes(n,e),e.call(this,n)}_bubbleMarks(t){if(t.content&&t.type!==_c.LIST)for(const e of t.content)if(!this._isLink(e)&&e.marks)for(const n of e.marks.slice())this._includesMark(t,n)?this._removeMark(e,n):this._canBubbleMark(t,n)&&(this._removeMark(e,n),this._addMark(t,n))}_canBubbleMark(t,e){if(kc.inlineMarks.includes(e.type))return!1;if(this._includesMarkType(t,e.type))return!1;for(const n of t.content)if(n.content||t.type!==_c.LIST_ITEM){if(!n.marks)return!1;if(!this._includesMark(n,e))return!1}return!0}_includesMark(t,e){return t.marks?.some((t=>Yh.isEqual(t,e)))??!1}_includesMarkType(t,e){return t.marks?.some((t=>t.type===e))??!1}_isLink(t){return t.type===_c.TEXT&&this._includesMarkType(t,kc.LINK)}_removeMark(t,e){if(!t.marks)return;const n=this._findMarkIndexByType(t,e.type);n>=0&&t.marks.splice(n,1),t.marks.length||delete t.marks}_addMark(t,e){this._removeMark(t,e),t.marks??=[],t.marks.push(e)}_findMarkIndexByType(t,e){return t.marks?.findIndex((t=>t.type===e))??null}}class Dp{static build(t,e={}){return"string"==typeof t?this._buildHtml(t,e):this._buildJson(t)}static _buildHtml(t,e){return new Rp({content:t,parser:e.parser||new Np})}static _buildJson(t){return new Lp({content:t})}static normalize(t,e={}){return Dp.build(t,e).normalize()}}class $p{static window=globalThis.window;static use(t){this.window=t}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(t){return this.window.getComputedStyle(t)}}class Pp{static build({config:t,nodeDomParser:e}){const n=function(t,e){return sl(vl.resolve(t),e)}(Tp({fonts:t.fonts,minFontSize:0,maxFontSize:0,presetsRef:Ke(t.presets),defaultPresetId:t.defaultPresetId,linkPresetId:t.linkPresetId,makePresetVariable:()=>"",basePresetClass:t.basePresetClass,baseListClass:t.baseListClass,deviceRef:Ke(yc.DESKTOP),pageBlocksRef:Ke([]),wrapperRef:$p.document.createElement("p")}));return new Pp({schema:n,domParser:bo.fromSchema(n),nodeDomParser:e})}_schema;_domParser;_nodeDomParser;constructor({schema:t,domParser:e,nodeDomParser:n}){this._schema=t,this._domParser=e,this._nodeDomParser=n}toJSON(t){const e=Dp.build(t,{parser:this._nodeDomParser});return e.normalizeHTML(),this._domParser.parse(e.dom.body).toJSON()}}class zp{static doc(t){return{type:_c.DOCUMENT,content:t}}static list(t,e){return{type:_c.LIST,attrs:{bullet:{type:t}},content:e.map((t=>t.type===_c.LIST_ITEM?t:this.listItem([].concat(t))))}}static listItem(...t){const{attrs:e,content:n,marks:r}=this._normalizeTextBlockArgs(t);return{type:_c.LIST_ITEM,...e?{attrs:e}:{},...r?{marks:r}:{},content:[].concat(n).map((t=>"string"==typeof t?this.paragraph(t):t))}}static heading(t,...e){const n=this._textBlock(e,this.text);return n.attrs??={},n.attrs.level=t,{type:_c.HEADING,...n}}static paragraph(...t){return{type:_c.PARAGRAPH,...this._textBlock(t,this.text)}}static _textBlock(t){const{attrs:e,content:n,marks:r}=this._normalizeTextBlockArgs(t);return{content:"string"==typeof n?[this.text(n)]:n,...e?{attrs:e}:{},...r?{marks:r}:{}}}static _normalizeTextBlockArgs(t){return 1===t.length?{attrs:null,marks:null,content:t[0]}:2===t.length?{attrs:t[0],marks:null,content:t[1]}:{attrs:t[0],marks:t[1],content:t[2]}}static text(t,e){return{type:_c.TEXT,...e?{marks:e}:{},text:t}}static link(t,e,n=[]){return this.text(t,[this.mark(kc.LINK,e),...n])}static mark(t,e){return{type:t,attrs:e}}static populateAllDevices(t){return{mobile:t,tablet:t,desktop:t}}}class jp{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:t,makeVariable:e,linkPresetId:n}){this._baseClass=t,this._makeVariable=e,this._linkPresetId=n}inject(t,e){let n=t.querySelector("[data-zw-styles]");n||(n=$p.document.createElement("style"),n.dataset.zwStyles="",n.innerHTML=this.render(e),t.append(n))}render(t){let e="";for(const n of t){const t=n.id===this._linkPresetId;e+=` ${this.makePresetCssClass(n)} {`;for(const r of yc.values)for(const o of Object.keys(n[r])){const i=this._makeVariable({device:r,preset:n,property:o}),s=this._makeInternalVariableName(o,r);if(e+=`${s}: var(${i}, inherit);`,t&&!kc.attributes.includes(o)){e+=`${s.replace("preset-","")}: var(${s});`}}e+="}"}return e}_makeInternalVariableName(t,e){return`--zw-preset-${"color"===t?"font-color":t.replace(/_/i,"-")}${e===yc.COMMON?"":`-${e}`}`}makePresetHtmlClass(t){return this._baseClass+t.id}makePresetCssClass(t){return this.makePresetHtmlClass(t).split(" ").map((t=>`.${t}`)).join("")}}class Fp{static _instance;static get instance(){return this._instance??=new Fp,this._instance}static query(t,e){return this.instance.query(t,e)}query(t,e){let n=null;return t.descendants((t=>!n&&(this.matchNode(t,e)?(n=t,!1):void 0))),n?e.getMark?this.getMark(n,e.getMark):n:null}matchNode(t,e){return(!e.typeName||e.typeName===t.type.name)&&!(e.mark&&!this.getMark(t,e.mark))}getMark(t,e){return t.marks.find((t=>this.matchMark(t,e)))||null}matchMark(t,e){return t.type.name===e.typeName}}class Hp{static createWindow(){return(new i.JSDOM).window}types;parse(t){const{window:e}=new i.JSDOM(t);return this.types=e,e.document}}class Bp{name;description;argument;options=[];doCommand(){throw new Error('Command "doCommand" is required')}install(t){if(!this.name)throw new Error('Command "name" is required');let e=t.command(this.name);if(this.description&&(e=e.description(this.description)),this.argument&&(e=e.argument(this.argument)),this.options.length)for(const t of this.options)e=e.option(t.flags,t.description,t.default);e.action(this.doCommand.bind(this))}output(t){console.log(t)}}const Vp=new q,Wp=[class extends Bp{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:n.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(t,{config:e,format:r}){$p.use(Hp.createWindow());const o=n.resolve(process.cwd(),e),i=Pp.build({config:require(o).editor,nodeDomParser:new Hp}),s=t.map((t=>i.toJSON(this._formatInputHtml(t)))),a=1===s.length?s[0]:s,l=this._stringifyContent(a);this.output("rb"===r?this._formatOutputRb(l):l)}_formatInputHtml(t){return t.replace(/\\(["'])/g,"$1").replace(/rgba\(\d{1,3}, ?\d{1,3}, ?\d{1,3}, (\d{1,2}%)\)/g,((t,e)=>t.replace(e,parseFloat(e)/100)))}_stringifyContent(t){return JSON.stringify(t,((t,e)=>null===e?void 0:e),2)}_formatOutputRb(t){return t.replace(/\\"/g,'"').replace(/font-family: ?'(.+)'/g,'font-family: "$1"').replace(/'/g,"\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,(t=>t.replace(/"/g,""))).replace(/: "(.+)"([,\n])/g,": '$1'$2")}},class extends Bp{name="version";description="display cli version";doCommand(){this.output("4.3.0")}}];for(const t of Wp)(new t).install(Vp);Vp.parse();
1
+ "use strict";var Lx=require("events"),Px=require("child_process"),_u=require("path"),Dx=require("fs"),Fx=require("process"),ap=require("jsdom"),cs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Nt={},fs={},ci={};let up=class extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},$x=class extends up{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};ci.CommanderError=up,ci.InvalidArgumentError=$x;const{InvalidArgumentError:Bx}=ci;let Hx=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new Bx(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function zx(n){const e=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+e+">":"["+e+"]"}fs.Argument=Hx,fs.humanReadableArgName=zx;var cp={},vu={};const{humanReadableArgName:Vx}=fs;let Wx=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){const t=e.commands.filter(i=>!i._hidden),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((i,o)=>i.name().localeCompare(o.name())),t}compareOptions(e,t){const r=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){const t=e.options.filter(i=>!i.hidden),r=e._getHelpOption();if(r&&!r.hidden){const i=r.short&&e._findOption(r.short),o=r.long&&e._findOption(r.long);!i&&!o?t.push(r):r.long&&!o?t.push(e.createOption(r.long,r.description)):r.short&&!i&&t.push(e.createOption(r.short,r.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let r=e.parent;r;r=r.parent){const i=r.options.filter(o=>!o.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){const t=e.registeredArguments.map(r=>Vx(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,i)=>Math.max(r,t.subcommandTerm(i).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,i)=>Math.max(r,t.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,i)=>Math.max(r,t.optionTerm(i).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,i)=>Math.max(r,t.argumentTerm(i).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let i=e.parent;i;i=i.parent)r=i.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatHelp(e,t){const r=t.padWidth(e,t),i=t.helpWidth||80,o=2,a=2;function u(S,C){if(C){const O=`${S.padEnd(r+a)}${C}`;return t.wrap(O,i-o,r+a)}return S}function f(S){return S.join(`
2
+ `).replace(/^/gm," ".repeat(o))}let d=[`Usage: ${t.commandUsage(e)}`,""];const p=t.commandDescription(e);p.length>0&&(d=d.concat([t.wrap(p,i,0),""]));const m=t.visibleArguments(e).map(S=>u(t.argumentTerm(S),t.argumentDescription(S)));m.length>0&&(d=d.concat(["Arguments:",f(m),""]));const y=t.visibleOptions(e).map(S=>u(t.optionTerm(S),t.optionDescription(S)));if(y.length>0&&(d=d.concat(["Options:",f(y),""])),this.showGlobalOptions){const S=t.visibleGlobalOptions(e).map(C=>u(t.optionTerm(C),t.optionDescription(C)));S.length>0&&(d=d.concat(["Global Options:",f(S),""]))}const v=t.visibleCommands(e).map(S=>u(t.subcommandTerm(S),t.subcommandDescription(S)));return v.length>0&&(d=d.concat(["Commands:",f(v),""])),d.join(`
3
+ `)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,r,i=40){const o=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",a=new RegExp(`[\\n][${o}]+`);if(e.match(a))return e;const u=t-r;if(u<i)return e;const f=e.slice(0,r),d=e.slice(r).replace(`\r
4
+ `,`
5
+ `),p=" ".repeat(r),y="\\s\u200B",v=new RegExp(`
6
+ |.{1,${u-1}}([${y}]|$)|[^${y}]+?([${y}]|$)`,"g"),S=d.match(v)||[];return f+S.map((C,O)=>C===`
7
+ `?"":(O>0?p:"")+C.trimEnd()).join(`
8
+ `)}};vu.Help=Wx;var Io={};const{InvalidArgumentError:Ux}=ci;let Kx=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const r=jx(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new Ux(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,r):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return Gx(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},qx=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,r)=>{this.positiveOptions.has(r)&&this.dualOptions.add(r)})}valueFromOption(e,t){const r=t.attributeName();if(!this.dualOptions.has(r))return!0;const i=this.negativeOptions.get(r).presetArg,o=i!==void 0?i:!1;return t.negate===(o===e)}};function Gx(n){return n.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function jx(n){let e,t;const r=n.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(e=r.shift()),t=r.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}Io.Option=Kx,Io.DualOptions=qx;var fp={};const hp=3;function Jx(n,e){if(Math.abs(n.length-e.length)>hp)return Math.max(n.length,e.length);const t=[];for(let r=0;r<=n.length;r++)t[r]=[r];for(let r=0;r<=e.length;r++)t[0][r]=r;for(let r=1;r<=e.length;r++)for(let i=1;i<=n.length;i++){let o=1;n[i-1]===e[r-1]?o=0:o=1,t[i][r]=Math.min(t[i-1][r]+1,t[i][r-1]+1,t[i-1][r-1]+o),i>1&&r>1&&n[i-1]===e[r-2]&&n[i-2]===e[r-1]&&(t[i][r]=Math.min(t[i][r],t[i-2][r-2]+1))}return t[n.length][e.length]}function Yx(n,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));const t=n.startsWith("--");t&&(n=n.slice(2),e=e.map(a=>a.slice(2)));let r=[],i=hp;const o=.4;return e.forEach(a=>{if(a.length<=1)return;const u=Jx(n,a),f=Math.max(n.length,a.length);(f-u)/f>o&&(u<i?(i=u,r=[a]):u===i&&r.push(a))}),r.sort((a,u)=>a.localeCompare(u)),t&&(r=r.map(a=>`--${a}`)),r.length>1?`
9
+ (Did you mean one of ${r.join(", ")}?)`:r.length===1?`
10
+ (Did you mean ${r[0]}?)`:""}fp.suggestSimilar=Yx;const Xx=Lx.EventEmitter,wu=Px,kn=_u,Su=Dx,Ae=Fx,{Argument:Zx,humanReadableArgName:Qx}=fs,{CommanderError:xu}=ci,{Help:eE}=vu,{Option:dp,DualOptions:tE}=Io,{suggestSimilar:pp}=fp;let nE=class q0 extends Xx{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>Ae.stdout.write(t),writeErr:t=>Ae.stderr.write(t),getOutHelpWidth:()=>Ae.stdout.isTTY?Ae.stdout.columns:void 0,getErrHelpWidth:()=>Ae.stderr.isTTY?Ae.stderr.columns:void 0,outputError:(t,r)=>r(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){const e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let i=t,o=r;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};const[,a,u]=e.match(/([^ ]+) *(.*)/),f=this.createCommand(a);return i&&(f.description(i),f._executableHandler=!0),o.isDefault&&(this._defaultCommandName=f._name),f._hidden=!!(o.noHelp||o.hidden),f._executableFile=o.executableFile||null,u&&f.arguments(u),this._registerCommand(f),f.parent=this,f.copyInheritedSettings(this),i?this:f}createCommand(e){return new q0(e)}createHelp(){return Object.assign(new eE,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
11
+ - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new Zx(e,t)}argument(e,t,r,i){const o=this.createArgument(e,t);return typeof r=="function"?o.default(i).argParser(r):o.default(r),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){const t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";const[,r,i]=e.match(/([^ ]+) *(.*)/),o=t??"display help for command",a=this.createCommand(r);return a.helpOption(!1),i&&a.arguments(i),o&&a.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=a,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){const r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
12
+ Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new xu(e,t,r)),Ae.exit(e)}action(e){const t=r=>{const i=this.registeredArguments.length,o=r.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=t,this}createOption(e,t){return new dp(e,t)}_callParseArg(e,t,r,i){try{return e.parseArg(t,r)}catch(o){if(o.code==="commander.invalidArgument"){const a=`${i} ${o.message}`;this.error(a,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){const t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){const r=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
13
+ - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){const t=i=>[i.name()].concat(i.aliases()),r=t(e).find(i=>this._findCommand(i));if(r){const i=t(this._findCommand(r)).join("|"),o=t(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);const t=e.name(),r=e.attributeName();if(e.negate){const o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(r,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(r,e.defaultValue,"default");const i=(o,a,u)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);const f=this.getOptionValue(r);o!==null&&e.parseArg?o=this._callParseArg(e,o,f,a):o!==null&&e.variadic&&(o=e._concatValue(o,f)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(r,o,u)};return this.on("option:"+t,o=>{const a=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,a,"cli")}),e.envVar&&this.on("optionEnv:"+t,o=>{const a=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,a,"env")}),this}_optionEx(e,t,r,i,o){if(typeof t=="object"&&t instanceof dp)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const a=this.createOption(t,r);if(a.makeOptionMandatory(!!e.mandatory),typeof i=="function")a.default(o).argParser(i);else if(i instanceof RegExp){const u=i;i=(f,d)=>{const p=u.exec(f);return p?p[0]:d},a.default(o).argParser(i)}else a.default(i);return this.addOption(a)}option(e,t,r,i){return this._optionEx({},e,t,r,i)}requiredOption(e,t,r,i){return this._optionEx({mandatory:!0},e,t,r,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(r=>{r.getOptionValueSource(e)!==void 0&&(t=r.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");t=t||{},e===void 0&&(e=Ae.argv,Ae.versions&&Ae.versions.electron&&(t.from="electron")),this.rawArgs=e.slice();let r;switch(t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":Ae.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){const r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){const r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_executeSubCommand(e,t){t=t.slice();let r=!1;const i=[".js",".ts",".tsx",".mjs",".cjs"];function o(p,m){const y=kn.resolve(p,m);if(Su.existsSync(y))return y;if(i.includes(kn.extname(m)))return;const v=i.find(S=>Su.existsSync(`${y}${S}`));if(v)return`${y}${v}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||"";if(this._scriptPath){let p;try{p=Su.realpathSync(this._scriptPath)}catch{p=this._scriptPath}u=kn.resolve(kn.dirname(p),u)}if(u){let p=o(u,a);if(!p&&!e._executableFile&&this._scriptPath){const m=kn.basename(this._scriptPath,kn.extname(this._scriptPath));m!==this._name&&(p=o(u,`${m}-${e._name}`))}a=p||a}r=i.includes(kn.extname(a));let f;Ae.platform!=="win32"?r?(t.unshift(a),t=mp(Ae.execArgv).concat(t),f=wu.spawn(Ae.argv[0],t,{stdio:"inherit"})):f=wu.spawn(a,t,{stdio:"inherit"}):(t.unshift(a),t=mp(Ae.execArgv).concat(t),f=wu.spawn(Ae.execPath,t,{stdio:"inherit"})),f.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(m=>{Ae.on(m,()=>{f.killed===!1&&f.exitCode===null&&f.kill(m)})});const d=this._exitCallback;f.on("close",(p,m)=>{p=p??1,d?d(new xu(p,"commander.executeSubCommandAsync","(close)")):Ae.exit(p)}),f.on("error",p=>{if(p.code==="ENOENT"){const m=u?`searched for local subcommand relative to directory '${u}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",y=`'${a}' does not exist
14
+ - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
15
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
16
+ - ${m}`;throw new Error(y)}else if(p.code==="EACCES")throw new Error(`'${a}' not executable`);if(!d)Ae.exit(1);else{const m=new xu(1,"commander.executeSubCommandAsync","(error)");m.nestedError=p,d(m)}}),this.runningCommand=f}_dispatchSubcommand(e,t,r){const i=this._findCommand(e);i||this.help({error:!0});let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,t.concat(r));else return i._parseCommand(t,r)}),o}_dispatchHelpCommand(e){e||this.help();const t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const e=(r,i,o)=>{let a=i;if(i!==null&&r.parseArg){const u=`error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;a=this._callParseArg(r,i,o,u)}return a};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach((r,i)=>{let o=r.defaultValue;r.variadic?i<this.args.length?(o=this.args.slice(i),r.parseArg&&(o=o.reduce((a,u)=>e(r,u,a),r.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],r.parseArg&&(o=e(r,o,r.defaultValue))),t[i]=o}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let r=e;const i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[t]!==void 0).forEach(o=>{o._lifeCycleHooks[t].forEach(a=>{i.push({hookedCommand:o,callback:a})})}),t==="postAction"&&i.reverse(),i.forEach(o=>{r=this._chainOrCall(r,()=>o.callback(o.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let i=e;return this._lifeCycleHooks[r]!==void 0&&this._lifeCycleHooks[r].forEach(o=>{i=this._chainOrCall(i,()=>o(this,t))}),i}_parseCommand(e,t){const r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const i=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(o,e,t)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent&&this.parent.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){const e=this.options.filter(r=>{const i=r.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(r=>r.conflictsWith.length>0).forEach(r=>{const i=e.find(o=>r.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(r,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){const t=[],r=[];let i=t;const o=e.slice();function a(f){return f.length>1&&f[0]==="-"}let u=null;for(;o.length;){const f=o.shift();if(f==="--"){i===r&&i.push(f),i.push(...o);break}if(u&&!a(f)){this.emit(`option:${u.name()}`,f);continue}if(u=null,a(f)){const d=this._findOption(f);if(d){if(d.required){const p=o.shift();p===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,p)}else if(d.optional){let p=null;o.length>0&&!a(o[0])&&(p=o.shift()),this.emit(`option:${d.name()}`,p)}else this.emit(`option:${d.name()}`);u=d.variadic?d:null;continue}}if(f.length>2&&f[0]==="-"&&f[1]!=="-"){const d=this._findOption(`-${f[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,f.slice(2)):(this.emit(`option:${d.name()}`),o.unshift(`-${f.slice(2)}`));continue}}if(/^--[^=]+=/.test(f)){const d=f.indexOf("="),p=this._findOption(f.slice(0,d));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,f.slice(d+1));continue}}if(a(f)&&(i=r),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(f)){t.push(f),o.length>0&&r.push(...o);break}else if(this._getHelpCommand()&&f===this._getHelpCommand().name()){t.push(f),o.length>0&&t.push(...o);break}else if(this._defaultCommandName){r.push(f),o.length>0&&r.push(...o);break}}if(this._passThroughOptions){i.push(f),o.length>0&&i.push(...o);break}i.push(f)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let r=0;r<t;r++){const i=this.options[r].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
17
+ `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
18
+ `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
19
+ `),this.outputHelp({error:!0}));const r=t||{},i=r.exitCode||1,o=r.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ae.env){const t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Ae.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){const e=new tE(this.options),t=r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter(r=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,r.implied[i],"implied")})})}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const r=a=>{const u=a.attributeName(),f=this.getOptionValue(u),d=this.options.find(m=>m.negate&&u===m.attributeName()),p=this.options.find(m=>!m.negate&&u===m.attributeName());return d&&(d.presetArg===void 0&&f===!1||d.presetArg!==void 0&&f===d.presetArg)?d:p||a},i=a=>{const u=r(a),f=u.attributeName();return this.getOptionValueSource(f)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},o=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{const a=o.createHelp().visibleOptions(o).filter(u=>u.long).map(u=>u.long);i=i.concat(a),o=o.parent}while(o&&!o._enablePositionalOptions);t=pp(e,i)}const r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this.registeredArguments.length,r=t===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),t=pp(e,i)}const r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";const i=this.createOption(t,r);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
20
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");const r=this.parent?._findCommand(e);if(r){const i=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;const t=this.registeredArguments.map(r=>Qx(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=kn.basename(e,kn.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};const t={error:!!e.error};let r;return t.error?r=i=>this._outputConfiguration.writeErr(i):r=i=>this._outputConfiguration.writeOut(i),t.write=e.write||r,t.command=this,t}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);const r=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let i=this.helpInformation(r);if(t&&(i=t(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",r),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",r))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=Ae.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.
21
+ Expecting one of '${r.join("', '")}'`);const i=`${e}Help`;return this.on(i,o=>{let a;typeof t=="function"?a=t({error:o.error,command:o.command}):a=t,a&&o.write(`${a}
22
+ `)}),this}_outputHelpIfRequested(e){const t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function mp(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?t=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=o[1],/^\d+$/.test(o[3])?i=o[3]:r=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=o[1],r=o[3],i=o[4]),t&&i!=="0"?`${t}=${r}:${parseInt(i)+1}`:e})}cp.Command=nE;const{Argument:gp}=fs,{Command:Eu}=cp,{CommanderError:rE,InvalidArgumentError:yp}=ci,{Help:iE}=vu,{Option:bp}=Io;Nt.program=new Eu,Nt.createCommand=n=>new Eu(n),Nt.createOption=(n,e)=>new bp(n,e),Nt.createArgument=(n,e)=>new gp(n,e),Nt.Command=Eu,Nt.Option=bp,Nt.Argument=gp,Nt.Help=iE,Nt.CommanderError=rE,Nt.InvalidArgumentError=yp,Nt.InvalidOptionArgumentError=yp;const{program:BI,createCommand:HI,createArgument:zI,createOption:VI,CommanderError:WI,InvalidArgumentError:UI,InvalidOptionArgumentError:KI,Command:sE,Argument:qI,Option:GI,Help:jI}=Nt;function oE(n,e){const t=new Set(n.split(","));return r=>t.has(r)}const nn=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Bn=()=>{},lE=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Ut=Object.assign,aE=Object.prototype.hasOwnProperty,Ie=(n,e)=>aE.call(n,e),xe=Array.isArray,fi=n=>Ro(n)==="[object Map]",uE=n=>Ro(n)==="[object Set]",Ne=n=>typeof n=="function",Kt=n=>typeof n=="string",No=n=>typeof n=="symbol",it=n=>n!==null&&typeof n=="object",cE=n=>(it(n)||Ne(n))&&Ne(n.then)&&Ne(n.catch),fE=Object.prototype.toString,Ro=n=>fE.call(n),_p=n=>Ro(n).slice(8,-1),hE=n=>Ro(n)==="[object Object]",ku=n=>Kt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,dE=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},pE=dE(n=>n.charAt(0).toUpperCase()+n.slice(1)),Hn=(n,e)=>!Object.is(n,e),mE=(n,e,t)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value:t})};let vp;const wp=()=>vp||(vp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Cu(n){if(xe(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Kt(r)?_E(r):Cu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(Kt(n)||it(n))return n}const gE=/;(?![^(]*\))/g,yE=/:([^]+)/,bE=/\/\*[^]*?\*\//g;function _E(n){const e={};return n.replace(bE,"").split(gE).forEach(t=>{if(t){const r=t.split(yE);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Au(n){let e="";if(Kt(n))e=n;else if(xe(n))for(let t=0;t<n.length;t++){const r=Au(n[t]);r&&(e+=r+" ")}else if(it(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function _r(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let vE;function wE(n,e=vE){e&&e.active&&e.effects.push(n)}let vr;class Sp{constructor(e,t,r,i){this.fn=e,this.trigger=t,this.scheduler=r,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,wE(this,i)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,Tu();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(SE(t.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),Mu()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=zn,t=vr;try{return zn=!0,vr=this,this._runnings++,xp(this),this.fn()}finally{Ep(this),this._runnings--,vr=t,zn=e}}stop(){var e;this.active&&(xp(this),Ep(this),(e=this.onStop)==null||e.call(this),this.active=!1)}}function SE(n){return n.value}function xp(n){n._trackId++,n._depsLength=0}function Ep(n){if(n.deps.length>n._depsLength){for(let e=n._depsLength;e<n.deps.length;e++)kp(n.deps[e],n);n.deps.length=n._depsLength}}function kp(n,e){const t=n.get(e);t!==void 0&&e._trackId!==t&&(n.delete(e),n.size===0&&n.cleanup())}let zn=!0,Ou=0;const Cp=[];function Tu(){Cp.push(zn),zn=!1}function Mu(){const n=Cp.pop();zn=n===void 0?!0:n}function Iu(){Ou++}function Nu(){for(Ou--;!Ou&&Ru.length;)Ru.shift()()}function Ap(n,e,t){var r;if(e.get(n)!==n._trackId){e.set(n,n._trackId);const i=n.deps[n._depsLength];i!==e?(i&&kp(i,n),n.deps[n._depsLength++]=e):n._depsLength++,process.env.NODE_ENV!=="production"&&((r=n.onTrack)==null||r.call(n,Ut({effect:n},t)))}}const Ru=[];function Op(n,e,t){var r;Iu();for(const i of n.keys()){let o;i._dirtyLevel<e&&(o??(o=n.get(i)===i._trackId))&&(i._shouldSchedule||(i._shouldSchedule=i._dirtyLevel===0),i._dirtyLevel=e),i._shouldSchedule&&(o??(o=n.get(i)===i._trackId))&&(process.env.NODE_ENV!=="production"&&((r=i.onTrigger)==null||r.call(i,Ut({effect:i},t))),i.trigger(),(!i._runnings||i.allowRecurse)&&i._dirtyLevel!==2&&(i._shouldSchedule=!1,i.scheduler&&Ru.push(i.scheduler)))}Nu()}const Tp=(n,e)=>{const t=new Map;return t.cleanup=n,t.computed=e,t},Lo=new WeakMap,wr=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Lu=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function dt(n,e,t){if(zn&&vr){let r=Lo.get(n);r||Lo.set(n,r=new Map);let i=r.get(t);i||r.set(t,i=Tp(()=>r.delete(t))),Ap(vr,i,process.env.NODE_ENV!=="production"?{target:n,type:e,key:t}:void 0)}}function Vn(n,e,t,r,i,o){const a=Lo.get(n);if(!a)return;let u=[];if(e==="clear")u=[...a.values()];else if(t==="length"&&xe(n)){const f=Number(r);a.forEach((d,p)=>{(p==="length"||!No(p)&&p>=f)&&u.push(d)})}else switch(t!==void 0&&u.push(a.get(t)),e){case"add":xe(n)?ku(t)&&u.push(a.get("length")):(u.push(a.get(wr)),fi(n)&&u.push(a.get(Lu)));break;case"delete":xe(n)||(u.push(a.get(wr)),fi(n)&&u.push(a.get(Lu)));break;case"set":fi(n)&&u.push(a.get(wr));break}Iu();for(const f of u)f&&Op(f,4,process.env.NODE_ENV!=="production"?{target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}:void 0);Nu()}function xE(n,e){var t;return(t=Lo.get(n))==null?void 0:t.get(e)}const EE=oE("__proto__,__v_isRef,__isVue"),Mp=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(No)),Ip=kE();function kE(){const n={};return["includes","indexOf","lastIndexOf"].forEach(e=>{n[e]=function(...t){const r=ie(this);for(let o=0,a=this.length;o<a;o++)dt(r,"get",o+"");const i=r[e](...t);return i===-1||i===!1?r[e](...t.map(ie)):i}}),["push","pop","shift","unshift","splice"].forEach(e=>{n[e]=function(...t){Tu(),Iu();const r=ie(this)[e].apply(this,t);return Nu(),Mu(),r}}),n}function CE(n){const e=ie(this);return dt(e,"has",n),e.hasOwnProperty(n)}class Np{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){const i=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return o;if(t==="__v_raw")return r===(i?o?zp:Hp:o?BE:Bp).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=xe(e);if(!i){if(a&&Ie(Ip,t))return Reflect.get(Ip,t,r);if(t==="hasOwnProperty")return CE}const u=Reflect.get(e,t,r);return(No(t)?Mp.has(t):EE(t))||(i||dt(e,"get",t),o)?u:st(u)?a&&ku(t)?u:u.value:it(u)?i?Vp(u):Fu(u):u}}class AE extends Np{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Un(o);if(!xr(r)&&!Un(r)&&(o=ie(o),r=ie(r)),!xe(e)&&st(o)&&!st(r))return f?!1:(o.value=r,!0)}const a=xe(e)&&ku(t)?Number(t)<e.length:Ie(e,t),u=Reflect.set(e,t,r,i);return e===ie(i)&&(a?Hn(r,o)&&Vn(e,"set",t,r,o):Vn(e,"add",t,r)),u}deleteProperty(e,t){const r=Ie(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&Vn(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!No(t)||!Mp.has(t))&&dt(e,"has",t),r}ownKeys(e){return dt(e,"iterate",xe(e)?"length":wr),Reflect.ownKeys(e)}}class Rp extends Np{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&_r(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&_r(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const OE=new AE,TE=new Rp,ME=new Rp(!0),Pu=n=>n,Po=n=>Reflect.getPrototypeOf(n);function Do(n,e,t=!1,r=!1){n=n.__v_raw;const i=ie(n),o=ie(e);t||(Hn(e,o)&&dt(i,"get",e),dt(i,"get",o));const{has:a}=Po(i),u=r?Pu:t?Hu:hs;if(a.call(i,e))return u(n.get(e));if(a.call(i,o))return u(n.get(o));n!==i&&n.get(e)}function Fo(n,e=!1){const t=this.__v_raw,r=ie(t),i=ie(n);return e||(Hn(n,i)&&dt(r,"has",n),dt(r,"has",i)),n===i?t.has(n):t.has(n)||t.has(i)}function $o(n,e=!1){return n=n.__v_raw,!e&&dt(ie(n),"iterate",wr),Reflect.get(n,"size",n)}function Lp(n){n=ie(n);const e=ie(this);return Po(e).has.call(e,n)||(e.add(n),Vn(e,"add",n,n)),this}function Pp(n,e){e=ie(e);const t=ie(this),{has:r,get:i}=Po(t);let o=r.call(t,n);o?process.env.NODE_ENV!=="production"&&$p(t,r,n):(n=ie(n),o=r.call(t,n));const a=i.call(t,n);return t.set(n,e),o?Hn(e,a)&&Vn(t,"set",n,e,a):Vn(t,"add",n,e),this}function Dp(n){const e=ie(this),{has:t,get:r}=Po(e);let i=t.call(e,n);i?process.env.NODE_ENV!=="production"&&$p(e,t,n):(n=ie(n),i=t.call(e,n));const o=r?r.call(e,n):void 0,a=e.delete(n);return i&&Vn(e,"delete",n,void 0,o),a}function Fp(){const n=ie(this),e=n.size!==0,t=process.env.NODE_ENV!=="production"?fi(n)?new Map(n):new Set(n):void 0,r=n.clear();return e&&Vn(n,"clear",void 0,void 0,t),r}function Bo(n,e){return function(r,i){const o=this,a=o.__v_raw,u=ie(a),f=e?Pu:n?Hu:hs;return!n&&dt(u,"iterate",wr),a.forEach((d,p)=>r.call(i,f(d),f(p),o))}}function Ho(n,e,t){return function(...r){const i=this.__v_raw,o=ie(i),a=fi(o),u=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,d=i[n](...r),p=t?Pu:e?Hu:hs;return!e&&dt(o,"iterate",f?Lu:wr),{next(){const{value:m,done:y}=d.next();return y?{value:m,done:y}:{value:u?[p(m[0]),p(m[1])]:p(m),done:y}},[Symbol.iterator](){return this}}}}function Wn(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";_r(`${pE(n)} operation ${t}failed: target is readonly.`,ie(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function IE(){const n={get(o){return Do(this,o)},get size(){return $o(this)},has:Fo,add:Lp,set:Pp,delete:Dp,clear:Fp,forEach:Bo(!1,!1)},e={get(o){return Do(this,o,!1,!0)},get size(){return $o(this)},has:Fo,add:Lp,set:Pp,delete:Dp,clear:Fp,forEach:Bo(!1,!0)},t={get(o){return Do(this,o,!0)},get size(){return $o(this,!0)},has(o){return Fo.call(this,o,!0)},add:Wn("add"),set:Wn("set"),delete:Wn("delete"),clear:Wn("clear"),forEach:Bo(!0,!1)},r={get(o){return Do(this,o,!0,!0)},get size(){return $o(this,!0)},has(o){return Fo.call(this,o,!0)},add:Wn("add"),set:Wn("set"),delete:Wn("delete"),clear:Wn("clear"),forEach:Bo(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Ho(o,!1,!1),t[o]=Ho(o,!0,!1),e[o]=Ho(o,!1,!0),r[o]=Ho(o,!0,!0)}),[n,t,e,r]}const[NE,RE,LE,PE]=IE();function Du(n,e){const t=e?n?PE:LE:n?RE:NE;return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Ie(t,i)&&i in r?t:r,i,o)}const DE={get:Du(!1,!1)},FE={get:Du(!0,!1)},$E={get:Du(!0,!0)};function $p(n,e,t){const r=ie(t);if(r!==t&&e.call(n,r)){const i=_p(n);_r(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Bp=new WeakMap,BE=new WeakMap,Hp=new WeakMap,zp=new WeakMap;function HE(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function zE(n){return n.__v_skip||!Object.isExtensible(n)?0:HE(_p(n))}function Fu(n){return Un(n)?n:$u(n,!1,OE,DE,Bp)}function Vp(n){return $u(n,!0,TE,FE,Hp)}function zo(n){return $u(n,!0,ME,$E,zp)}function $u(n,e,t,r,i){if(!it(n))return process.env.NODE_ENV!=="production"&&_r(`value cannot be made reactive: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=i.get(n);if(o)return o;const a=zE(n);if(a===0)return n;const u=new Proxy(n,a===2?r:t);return i.set(n,u),u}function Sr(n){return Un(n)?Sr(n.__v_raw):!!(n&&n.__v_isReactive)}function Un(n){return!!(n&&n.__v_isReadonly)}function xr(n){return!!(n&&n.__v_isShallow)}function Bu(n){return Sr(n)||Un(n)}function ie(n){const e=n&&n.__v_raw;return e?ie(e):n}function VE(n){return Object.isExtensible(n)&&mE(n,"__v_skip",!0),n}const hs=n=>it(n)?Fu(n):n,Hu=n=>it(n)?Vp(n):n,WE="Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free";class Wp{constructor(e,t,r,i){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Sp(()=>e(this._value),()=>Vo(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}get value(){const e=ie(this);return(!e._cacheable||e.effect.dirty)&&Hn(e._value,e._value=e.effect.run())&&Vo(e,4),Up(e),e.effect._dirtyLevel>=2&&(process.env.NODE_ENV!=="production"&&this._warnRecursive&&_r(WE,`
23
+
24
+ getter: `,this.getter),Vo(e,2)),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function UE(n,e,t=!1){let r,i;const o=Ne(n);o?(r=n,i=process.env.NODE_ENV!=="production"?()=>{_r("Write operation failed: computed value is readonly")}:Bn):(r=n.get,i=n.set);const a=new Wp(r,i,o||!i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(a.effect.onTrack=e.onTrack,a.effect.onTrigger=e.onTrigger),a}function Up(n){var e;zn&&vr&&(n=ie(n),Ap(vr,(e=n.dep)!=null?e:n.dep=Tp(()=>n.dep=void 0,n instanceof Wp?n:void 0),process.env.NODE_ENV!=="production"?{target:n,type:"get",key:"value"}:void 0))}function Vo(n,e=4,t){n=ie(n);const r=n.dep;r&&Op(r,e,process.env.NODE_ENV!=="production"?{target:n,type:"set",key:"value",newValue:t}:void 0)}function st(n){return!!(n&&n.__v_isRef===!0)}function Wo(n){return KE(n,!1)}function KE(n,e){return st(n)?n:new qE(n,e)}class qE{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:ie(e),this._value=t?e:hs(e)}get value(){return Up(this),this._value}set value(e){const t=this.__v_isShallow||xr(e)||Un(e);e=t?e:ie(e),Hn(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:hs(e),Vo(this,4,e))}}function F(n){return st(n)?n.value:n}const GE={get:(n,e,t)=>F(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const i=n[e];return st(i)&&!st(t)?(i.value=t,!0):Reflect.set(n,e,t,r)}};function jE(n){return Sr(n)?n:new Proxy(n,GE)}class JE{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return xE(ie(this._object),this._key)}}class YE{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function hi(n,e,t){return st(n)?n:Ne(n)?new YE(n):it(n)&&arguments.length>1?XE(n,e,t):Wo(n)}function XE(n,e,t){const r=n[e];return st(r)?r:new JE(n,e,t)}const Er=[];function ZE(n){Er.push(n)}function QE(){Er.pop()}function Me(n,...e){Tu();const t=Er.length?Er[Er.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=ek();if(r)kr(r,t,11,[n+e.map(o=>{var a,u;return(u=(a=o.toString)==null?void 0:a.call(o))!=null?u:JSON.stringify(o)}).join(""),t&&t.proxy,i.map(({vnode:o})=>`at <${dm(t,o.type)}>`).join(`
25
+ `),i]);else{const o=[`[Vue warn]: ${n}`,...e];i.length&&o.push(`
26
+ `,...tk(i)),console.warn(...o)}Mu()}function ek(){let n=Er[Er.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const r=n.component&&n.component.parent;n=r&&r.vnode}return e}function tk(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
27
+ `],...nk(t))}),e}function nk({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${dm(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...rk(n.props),o]:[i+o]}function rk(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...Kp(r,n[r]))}),t.length>3&&e.push(" ..."),e}function Kp(n,e,t){return Kt(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:st(e)?(e=Kp(n,ie(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Ne(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ie(e),t?e:[`${n}=`,e])}const qp={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."};function kr(n,e,t,r){try{return r?n(...r):n()}catch(i){zu(i,e,t)}}function Uo(n,e,t,r){if(Ne(n)){const o=kr(n,e,t,r);return o&&cE(o)&&o.catch(a=>{zu(a,e,t)}),o}const i=[];for(let o=0;o<n.length;o++)i.push(Uo(n[o],e,t,r));return i}function zu(n,e,t,r=!0){const i=e?e.vnode:null;if(e){let o=e.parent;const a=e.proxy,u=process.env.NODE_ENV!=="production"?qp[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;o;){const d=o.ec;if(d){for(let p=0;p<d.length;p++)if(d[p](n,a,u)===!1)return}o=o.parent}const f=e.appContext.config.errorHandler;if(f){kr(f,null,10,[n,a,u]);return}}ik(n,t,i,r)}function ik(n,e,t,r=!0){if(process.env.NODE_ENV!=="production"){const i=qp[e];if(t&&ZE(t),Me(`Unhandled error${i?` during execution of ${i}`:""}`),t&&QE(),r)throw n;console.error(n)}else console.error(n)}let Ko=!1,Vu=!1;const qt=[];let Kn=0;const di=[];let Cn=null,qn=0;const Gp=Promise.resolve();let Wu=null;const sk=100;function ok(n){const e=Wu||Gp;return n?e.then(this?n.bind(this):n):e}function lk(n){let e=Kn+1,t=qt.length;for(;e<t;){const r=e+t>>>1,i=qt[r],o=ds(i);o<n||o===n&&i.pre?e=r+1:t=r}return e}function Uu(n){(!qt.length||!qt.includes(n,Ko&&n.allowRecurse?Kn+1:Kn))&&(n.id==null?qt.push(n):qt.splice(lk(n.id),0,n),jp())}function jp(){!Ko&&!Vu&&(Vu=!0,Wu=Gp.then(Yp))}function Jp(n){xe(n)?di.push(...n):(!Cn||!Cn.includes(n,n.allowRecurse?qn+1:qn))&&di.push(n),jp()}function ak(n){if(di.length){const e=[...new Set(di)].sort((t,r)=>ds(t)-ds(r));if(di.length=0,Cn){Cn.push(...e);return}for(Cn=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),qn=0;qn<Cn.length;qn++)process.env.NODE_ENV!=="production"&&Xp(n,Cn[qn])||Cn[qn]();Cn=null,qn=0}}const ds=n=>n.id==null?1/0:n.id,uk=(n,e)=>{const t=ds(n)-ds(e);if(t===0){if(n.pre&&!e.pre)return-1;if(e.pre&&!n.pre)return 1}return t};function Yp(n){Vu=!1,Ko=!0,process.env.NODE_ENV!=="production"&&(n=n||new Map),qt.sort(uk);const e=process.env.NODE_ENV!=="production"?t=>Xp(n,t):Bn;try{for(Kn=0;Kn<qt.length;Kn++){const t=qt[Kn];if(t&&t.active!==!1){if(process.env.NODE_ENV!=="production"&&e(t))continue;kr(t,null,14)}}}finally{Kn=0,qt.length=0,ak(n),Ko=!1,Wu=null,(qt.length||di.length)&&Yp(n)}}function Xp(n,e){if(!n.has(e))n.set(e,1);else{const t=n.get(e);if(t>sk){const r=e.ownerInstance,i=r&&hm(r.type);return zu(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}else n.set(e,t+1)}}const ps=new Set;process.env.NODE_ENV!=="production"&&(wp().__VUE_HMR_RUNTIME__={createRecord:Ku(ck),rerender:Ku(fk),reload:Ku(hk)});const qo=new Map;function ck(n,e){return qo.has(n)?!1:(qo.set(n,{initialDef:ms(e),instances:new Set}),!0)}function ms(n){return pm(n)?n.__vccOpts:n}function fk(n,e){const t=qo.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,ms(r.type).render=e),r.renderCache=[],r.effect.dirty=!0,r.update()}))}function hk(n,e){const t=qo.get(n);if(!t)return;e=ms(e),Zp(t.initialDef,e);const r=[...t.instances];for(const i of r){const o=ms(i.type);ps.has(o)||(o!==t.initialDef&&Zp(o,e),ps.add(o)),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(ps.add(o),i.ceReload(e.styles),ps.delete(o)):i.parent?(i.parent.effect.dirty=!0,Uu(i.parent.update)):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}Jp(()=>{for(const i of r)ps.delete(ms(i.type))})}function Zp(n,e){Ut(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function Ku(n){return(e,t)=>{try{return n(e,t)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let pi,Go=[];function Qp(n,e){var t,r;pi=n,pi?(pi.enabled=!0,Go.forEach(({event:i,args:o})=>pi.emit(i,...o)),Go=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{Qp(o,e)}),setTimeout(()=>{pi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Go=[])},3e3)):Go=[]}let rn=null,dk=null;function JI(){}const pk=Symbol.for("v-ndc"),mk=n=>n.__isSuspense;function gk(n,e){e&&e.pendingBranch?xe(n)?e.effects.push(...n):e.effects.push(n):Jp(n)}const yk=Symbol.for("v-scx"),bk=()=>{{const n=Tk(yk);return n||process.env.NODE_ENV!=="production"&&Me("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}},jo={};function _k(n,e,t){return process.env.NODE_ENV!=="production"&&!Ne(e)&&Me("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),em(n,e,t)}function em(n,e,{immediate:t,deep:r,flush:i,once:o,onTrack:a,onTrigger:u}=nn){if(e&&o){const $=e;e=(...ue)=>{$(...ue),pe()}}process.env.NODE_ENV!=="production"&&r!==void 0&&typeof r=="number"&&Me('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),process.env.NODE_ENV!=="production"&&!e&&(t!==void 0&&Me('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),r!==void 0&&Me('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&Me('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const f=$=>{Me("Invalid watch source: ",$,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},d=bs,p=$=>r===!0?$:mi($,r===!1?1:void 0);let m,y=!1,v=!1;if(st(n)?(m=()=>n.value,y=xr(n)):Sr(n)?(m=()=>p(n),y=!0):xe(n)?(v=!0,y=n.some($=>Sr($)||xr($)),m=()=>n.map($=>{if(st($))return $.value;if(Sr($))return p($);if(Ne($))return kr($,d,2);process.env.NODE_ENV!=="production"&&f($)})):Ne(n)?e?m=()=>kr(n,d,2):m=()=>(S&&S(),Uo(n,d,3,[C])):(m=Bn,process.env.NODE_ENV!=="production"&&f(n)),e&&r){const $=m;m=()=>mi($())}let S,C=$=>{S=oe.onStop=()=>{kr($,d,4),S=oe.onStop=void 0}},O;if(Yu)if(C=Bn,e?t&&Uo(e,d,3,[m(),v?[]:void 0,C]):m(),i==="sync"){const $=bk();O=$.__watcherHandles||($.__watcherHandles=[])}else return Bn;let N=v?new Array(n.length).fill(jo):jo;const q=()=>{if(!(!oe.active||!oe.dirty))if(e){const $=oe.run();(r||y||(v?$.some((ue,at)=>Hn(ue,N[at])):Hn($,N)))&&(S&&S(),Uo(e,d,3,[$,N===jo?void 0:v&&N[0]===jo?[]:N,C]),N=$)}else oe.run()};q.allowRecurse=!!e;let K;i==="sync"?K=q:i==="post"?K=()=>om(q,d&&d.suspense):(q.pre=!0,d&&(q.id=d.uid),K=()=>Uu(q));const oe=new Sp(m,Bn,K),pe=()=>{oe.stop()};return process.env.NODE_ENV!=="production"&&(oe.onTrack=a,oe.onTrigger=u),e?t?q():N=oe.run():i==="post"?om(oe.run.bind(oe),d&&d.suspense):oe.run(),O&&O.push(pe),pe}function vk(n,e,t){const r=this.proxy,i=Kt(n)?n.includes(".")?wk(r,n):()=>r[n]:n.bind(r,r);let o;Ne(e)?o=e:(o=e.handler,t=e);const a=zk(this),u=em(i,o.bind(r),t);return a(),u}function wk(n,e){const t=e.split(".");return()=>{let r=n;for(let i=0;i<t.length&&r;i++)r=r[t[i]];return r}}function mi(n,e,t=0,r){if(!it(n)||n.__v_skip)return n;if(e&&e>0){if(t>=e)return n;t++}if(r=r||new Set,r.has(n))return n;if(r.add(n),st(n))mi(n.value,e,t,r);else if(xe(n))for(let i=0;i<n.length;i++)mi(n[i],e,t,r);else if(uE(n)||fi(n))n.forEach(i=>{mi(i,e,t,r)});else if(hE(n))for(const i in n)mi(n[i],e,t,r);return n}const qu=n=>n?Vk(n)?Wk(n)||n.proxy:qu(n.parent):null,gs=Ut(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>process.env.NODE_ENV!=="production"?zo(n.props):n.props,$attrs:n=>process.env.NODE_ENV!=="production"?zo(n.attrs):n.attrs,$slots:n=>process.env.NODE_ENV!=="production"?zo(n.slots):n.slots,$refs:n=>process.env.NODE_ENV!=="production"?zo(n.refs):n.refs,$parent:n=>qu(n.parent),$root:n=>qu(n.root),$emit:n=>n.emit,$options:n=>__VUE_OPTIONS_API__?kk(n):n.type,$forceUpdate:n=>n.f||(n.f=()=>{n.effect.dirty=!0,Uu(n.update)}),$nextTick:n=>n.n||(n.n=ok.bind(n.proxy)),$watch:n=>__VUE_OPTIONS_API__?vk.bind(n):Bn}),Sk=n=>n==="_"||n==="$",Gu=(n,e)=>n!==nn&&!n.__isScriptSetup&&Ie(n,e),xk={get({_:n},e){const{ctx:t,setupState:r,data:i,props:o,accessCache:a,type:u,appContext:f}=n;if(process.env.NODE_ENV!=="production"&&e==="__isVue")return!0;let d;if(e[0]!=="$"){const v=a[e];if(v!==void 0)switch(v){case 1:return r[e];case 2:return i[e];case 4:return t[e];case 3:return o[e]}else{if(Gu(r,e))return a[e]=1,r[e];if(i!==nn&&Ie(i,e))return a[e]=2,i[e];if((d=n.propsOptions[0])&&Ie(d,e))return a[e]=3,o[e];if(t!==nn&&Ie(t,e))return a[e]=4,t[e];(!__VUE_OPTIONS_API__||Ek)&&(a[e]=0)}}const p=gs[e];let m,y;if(p)return e==="$attrs"?(dt(n,"get",e),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&e==="$slots"&&dt(n,"get",e),p(n);if((m=u.__cssModules)&&(m=m[e]))return m;if(t!==nn&&Ie(t,e))return a[e]=4,t[e];if(y=f.config.globalProperties,Ie(y,e))return y[e];process.env.NODE_ENV!=="production"&&rn&&(!Kt(e)||e.indexOf("__v")!==0)&&(i!==nn&&Sk(e[0])&&Ie(i,e)?Me(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):n===rn&&Me(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))},set({_:n},e,t){const{data:r,setupState:i,ctx:o}=n;return Gu(i,e)?(i[e]=t,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&Ie(i,e)?(Me(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==nn&&Ie(r,e)?(r[e]=t,!0):Ie(n.props,e)?(process.env.NODE_ENV!=="production"&&Me(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in n?(process.env.NODE_ENV!=="production"&&Me(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&e in n.appContext.config.globalProperties?Object.defineProperty(o,e,{enumerable:!0,configurable:!0,value:t}):o[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:r,appContext:i,propsOptions:o}},a){let u;return!!t[a]||n!==nn&&Ie(n,a)||Gu(e,a)||(u=o[0])&&Ie(u,a)||Ie(r,a)||Ie(gs,a)||Ie(i.config.globalProperties,a)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Ie(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};process.env.NODE_ENV!=="production"&&(xk.ownKeys=n=>(Me("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(n)));function tm(n){return xe(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let Ek=!0;function kk(n){const e=n.type,{mixins:t,extends:r}=e,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=n.appContext,u=o.get(e);let f;return u?f=u:!i.length&&!t&&!r?f=e:(f={},i.length&&i.forEach(d=>Jo(f,d,a,!0)),Jo(f,e,a)),it(e)&&o.set(e,f),f}function Jo(n,e,t,r=!1){const{mixins:i,extends:o}=e;o&&Jo(n,o,t,!0),i&&i.forEach(a=>Jo(n,a,t,!0));for(const a in e)if(r&&a==="expose")process.env.NODE_ENV!=="production"&&Me('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=Ck[a]||t&&t[a];n[a]=u?u(n[a],e[a]):e[a]}return n}const Ck={data:nm,props:im,emits:im,methods:ys,computed:ys,beforeCreate:ot,created:ot,beforeMount:ot,mounted:ot,beforeUpdate:ot,updated:ot,beforeDestroy:ot,beforeUnmount:ot,destroyed:ot,unmounted:ot,activated:ot,deactivated:ot,errorCaptured:ot,serverPrefetch:ot,components:ys,directives:ys,watch:Ok,provide:nm,inject:Ak};function nm(n,e){return e?n?function(){return Ut(Ne(n)?n.call(this,this):n,Ne(e)?e.call(this,this):e)}:e:n}function Ak(n,e){return ys(rm(n),rm(e))}function rm(n){if(xe(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function ot(n,e){return n?[...new Set([].concat(n,e))]:e}function ys(n,e){return n?Ut(Object.create(null),n,e):e}function im(n,e){return n?xe(n)&&xe(e)?[...new Set([...n,...e])]:Ut(Object.create(null),tm(n),tm(e??{})):e}function Ok(n,e){if(!n)return e;if(!e)return n;const t=Ut(Object.create(null),n);for(const r in e)t[r]=ot(n[r],e[r]);return t}let sm=null;function Tk(n,e,t=!1){const r=bs||rn;if(r||sm){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:sm._context.provides;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Ne(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&Me(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&Me("inject() can only be used inside setup() or functional components.")}const om=gk,Mk=n=>n.__isTeleport,lm=Symbol.for("v-fgt"),Ik=Symbol.for("v-txt"),Nk=Symbol.for("v-cmt");let gi=null;function Rk(n){return n?n.__v_isVNode===!0:!1}const Lk=(...n)=>cm(...n),am="__vInternal",um=({key:n})=>n??null,Yo=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Kt(n)||st(n)||Ne(n)?{i:rn,r:n,k:e,f:!!t}:n:null);function Pk(n,e=null,t=null,r=0,i=null,o=n===lm?0:1,a=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&um(e),ref:e&&Yo(e),scopeId:dk,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:rn};return u?(ju(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=Kt(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&Me("VNode created with invalid key (NaN). VNode type:",f.type),!a&&gi&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&gi.push(f),f}const Dk=process.env.NODE_ENV!=="production"?Lk:cm;function cm(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===pk)&&(process.env.NODE_ENV!=="production"&&!n&&Me(`Invalid vnode type when creating vnode: ${n}.`),n=Nk),Rk(n)){const u=Xo(n,e,!0);return t&&ju(u,t),!o&&gi&&(u.shapeFlag&6?gi[gi.indexOf(n)]=u:gi.push(u)),u.patchFlag|=-2,u}if(pm(n)&&(n=n.__vccOpts),e){e=Fk(e);let{class:u,style:f}=e;u&&!Kt(u)&&(e.class=Au(u)),it(f)&&(Bu(f)&&!xe(f)&&(f=Ut({},f)),e.style=Cu(f))}const a=Kt(n)?1:mk(n)?128:Mk(n)?64:it(n)?4:Ne(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&Bu(n)&&(n=ie(n),Me("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
28
+ Component that was made reactive: `,n)),Pk(n,e,t,r,i,a,o,!0)}function Fk(n){return n?Bu(n)||am in n?Ut({},n):n:null}function Xo(n,e,t=!1){const{props:r,ref:i,patchFlag:o,children:a}=n,u=e?Bk(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:n.type,props:u,key:u&&um(u),ref:e&&e.ref?t&&i?xe(i)?i.concat(Yo(e)):[i,Yo(e)]:Yo(e):i,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&xe(a)?a.map(fm):a,target:n.target,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==lm?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:n.transition,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Xo(n.ssContent),ssFallback:n.ssFallback&&Xo(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce}}function fm(n){const e=Xo(n);return xe(n.children)&&(e.children=n.children.map(fm)),e}function $k(n=" ",e=0){return Dk(Ik,null,n,e)}function ju(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(xe(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),ju(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!(am in e)?e._ctx=rn:i===3&&rn&&(rn.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Ne(e)?(e={default:e,_ctx:rn},t=32):(e=String(e),r&64?(t=16,e=[$k(e)]):t=8);n.children=e,n.shapeFlag|=t}function Bk(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=Au([e.class,r.class]));else if(i==="style")e.style=Cu([e.style,r.style]);else if(lE(i)){const o=e[i],a=r[i];a&&o!==a&&!(xe(o)&&o.includes(a))&&(e[i]=o?[].concat(o,a):a)}else i!==""&&(e[i]=r[i])}return e}let bs=null;const Hk=()=>bs||rn;let Ju;{const n=wp(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};Ju=e("__VUE_INSTANCE_SETTERS__",t=>bs=t),e("__VUE_SSR_SETTERS__",t=>Yu=t)}const zk=n=>{const e=bs;return Ju(n),n.scope.on(),()=>{n.scope.off(),Ju(e)}};function Vk(n){return n.vnode.shapeFlag&4}let Yu=!1;function Wk(n){if(n.exposed)return n.exposeProxy||(n.exposeProxy=new Proxy(jE(VE(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in gs)return gs[t](n)},has(e,t){return t in e||t in gs}}))}const Uk=/(?:^|[-_])(\w)/g,Kk=n=>n.replace(Uk,e=>e.toUpperCase()).replace(/[-_]/g,"");function hm(n,e=!0){return Ne(n)?n.displayName||n.name:n.name||e&&n.__name}function dm(n,e,t=!1){let r=hm(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=o=>{for(const a in o)if(o[a]===e)return a};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?Kk(r):t?"App":"Anonymous"}function pm(n){return Ne(n)&&"__vccOpts"in n}const fe=(n,e)=>{const t=UE(n,e,Yu);if(process.env.NODE_ENV!=="production"){const r=Hk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function qk(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const n={style:"color:#3ba776"},e={style:"color:#1677ff"},t={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={header(m){return it(m)?m.__isVue?["div",n,"VueInstance"]:st(m)?["div",{},["span",n,p(m)],"<",u(m.value),">"]:Sr(m)?["div",{},["span",n,xr(m)?"ShallowReactive":"Reactive"],"<",u(m),`>${Un(m)?" (readonly)":""}`]:Un(m)?["div",{},["span",n,xr(m)?"ShallowReadonly":"Readonly"],"<",u(m),">"]:null:null},hasBody(m){return m&&m.__isVue},body(m){if(m&&m.__isVue)return["div",{},...o(m.$)]}};function o(m){const y=[];m.type.props&&m.props&&y.push(a("props",ie(m.props))),m.setupState!==nn&&y.push(a("setup",m.setupState)),m.data!==nn&&y.push(a("data",ie(m.data)));const v=f(m,"computed");v&&y.push(a("computed",v));const S=f(m,"inject");return S&&y.push(a("injected",S)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:m}]]),y}function a(m,y){return y=Ut({},y),Object.keys(y).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},m],["div",{style:"padding-left:1.25em"},...Object.keys(y).map(v=>["div",{},["span",r,v+": "],u(y[v],!1)])]]:["span",{}]}function u(m,y=!0){return typeof m=="number"?["span",e,m]:typeof m=="string"?["span",t,JSON.stringify(m)]:typeof m=="boolean"?["span",r,m]:it(m)?["object",{object:y?ie(m):m}]:["span",t,String(m)]}function f(m,y){const v=m.type;if(Ne(v))return;const S={};for(const C in m.ctx)d(v,C,y)&&(S[C]=m.ctx[C]);return S}function d(m,y,v){const S=m[v];if(xe(S)&&S.includes(y)||it(S)&&y in S||m.extends&&d(m.extends,y,v)||m.mixins&&m.mixins.some(C=>d(C,y,v)))return!0}function p(m){return xr(m)?"ShallowRef":m.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Gk(){qk()}process.env.NODE_ENV!=="production"&&Gk();function Ue(n){this.content=n}Ue.prototype={constructor:Ue,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Ue(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ue(t)},addToStart:function(n,e){return new Ue([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Ue(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Ue(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Ue.from(n),n.size?new Ue(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Ue.from(n),n.size?new Ue(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Ue.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},get size(){return this.content.length>>1}},Ue.from=function(n){if(n instanceof Ue)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ue(e)};function mm(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=mm(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function gm(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let a=n.child(--i),u=e.child(--o),f=a.nodeSize;if(a==u){t-=f,r-=f;continue}if(!a.sameMarkup(u))return{a:t,b:r};if(a.isText&&a.text!=u.text){let d=0,p=Math.min(a.text.length,u.text.length);for(;d<p&&a.text[a.text.length-d-1]==u.text[u.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(a.content.size||u.content.size){let d=gm(a.content,u.content,t-1,r-1);if(d)return d}t-=f,r-=f}}class L{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let a=0,u=0;u<t;a++){let f=this.content[a],d=u+f.nodeSize;if(d>e&&r(f,i+u,o||null,a)!==!1&&f.content.size){let p=u+1;f.nodesBetween(Math.max(0,e-p),Math.min(f.content.size,t-p),r,i+p)}u=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",a=!0;return this.nodesBetween(e,t,(u,f)=>{u.isText?(o+=u.text.slice(Math.max(e,f)-f,t-f),a=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new L(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let u=this.content[o],f=a+u.nodeSize;f>e&&((a<e||f>t)&&(u.isText?u=u.cut(Math.max(0,e-a),Math.min(u.text.length,t-a)):u=u.cut(Math.max(0,e-a-1),Math.min(u.content.size,t-a-1))),r.push(u),i+=u.nodeSize),a=f}return new L(r,i)}cutByIndex(e,t){return e==t?L.empty:e==0&&t==this.content.length?this:new L(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new L(i,o)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return mm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return gm(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Zo(0,e);if(e==this.size)return Zo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||t>0?Zo(r+1,a):Zo(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return L.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new L(t||e,r)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const Xu={index:0,offset:0};function Zo(n,e){return Xu.index=n,Xu.offset=e,Xu}function Qo(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qo(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qo(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let we=class xf{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qo(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return xf.none;if(e instanceof xf)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};we.none=[];class el extends Error{}class z{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=bm(this.content,e+this.openStart,t);return r&&new z(r,this.openStart,this.openEnd)}removeBetween(e,t){return new z(ym(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return z.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new z(L.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new z(e,r,i)}}z.empty=new z(L.empty,0,0);function ym(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:a,offset:u}=n.findIndex(t);if(i==e||o.isText){if(u!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(ym(o.content,e-i-1,t-i-1)))}function bm(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),a=n.maybeChild(i);if(o==e||a.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=bm(a.content,e-o-1,t);return u&&n.replaceChild(i,a.copy(u))}function jk(n,e,t){if(t.openStart>n.depth)throw new el("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new el("Inconsistent open depths");return _m(n,e,t,0)}function _m(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=_m(n,e,t,r+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,u=a.content;return Ar(a,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:a,end:u}=Jk(t,n);return Ar(o,wm(n,a,u,e,r))}else return Ar(o,tl(n,e,r))}function vm(n,e){if(!e.type.compatibleContent(n.type))throw new el("Cannot join "+e.type.name+" onto "+n.type.name)}function Zu(n,e,t){let r=n.node(t);return vm(r,e.node(t)),r}function Cr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function _s(n,e,t,r){let i=(e||n).node(t),o=0,a=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Cr(n.nodeAfter,r),o++));for(let u=o;u<a;u++)Cr(i.child(u),r);e&&e.depth==t&&e.textOffset&&Cr(e.nodeBefore,r)}function Ar(n,e){return n.type.checkContent(e),n.copy(e)}function wm(n,e,t,r,i){let o=n.depth>i&&Zu(n,e,i+1),a=r.depth>i&&Zu(t,r,i+1),u=[];return _s(null,n,i,u),o&&a&&e.index(i)==t.index(i)?(vm(o,a),Cr(Ar(o,wm(n,e,t,r,i+1)),u)):(o&&Cr(Ar(o,tl(n,e,i+1)),u),_s(e,t,i,u),a&&Cr(Ar(a,tl(t,r,i+1)),u)),_s(r,null,i,u),new L(u)}function tl(n,e,t){let r=[];if(_s(null,n,t,r),n.depth>t){let i=Zu(n,e,t+1);Cr(Ar(i,tl(n,e,t+1)),r)}return _s(e,null,t,r),new L(r)}function Jk(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(L.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Ds{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return we.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new nl(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let a=e;;){let{index:u,offset:f}=a.content.findIndex(o),d=o-f;if(r.push(a,u,i+f),!d||(a=a.child(u),a.isText))break;o=d-1,i+=f+1}return new Ds(t,r,o)}static resolveCached(e,t){for(let i=0;i<Qu.length;i++){let o=Qu[i];if(o.pos==t&&o.doc==e)return o}let r=Qu[ec]=Ds.resolve(e,t);return ec=(ec+1)%Yk,r}}let Qu=[],ec=0,Yk=12;class nl{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Xk=Object.create(null);let Or=class Ef{constructor(e,t,r,i=we.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||L.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Qo(this.attrs,t||e.defaultAttrs||Xk)&&we.sameSet(this.marks,r||we.none)}copy(e=null){return e==this.content?this:new Ef(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ef(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return z.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),u=i.start(a),d=i.node(a).content.cut(i.pos-u,o.pos-u);return new z(d,i.depth-a,o.depth-a)}replace(e,t,r){return jk(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Ds.resolveCached(this,e)}resolveNoCache(e){return Ds.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Sm(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=L.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,t);if(!u||!u.validEnd)return!1;for(let f=i;f<o;f++)if(!this.type.allowsMarks(r.child(f).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=we.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!we.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=L.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Or.prototype.text=void 0;class Gl extends Or{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Sm(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Gl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Gl(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Sm(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class zr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Zk(e,t);if(r.next==null)return zr.empty;let i=xm(r);r.next&&r.err("Unexpected trailing text");let o=sC(iC(i));return oC(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(a,u){let f=a.matchFragment(e,r);if(f&&(!t||f.validEnd))return L.from(u.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:p,next:m}=a.next[d];if(!(p.isText||p.hasRequiredAttrs())&&i.indexOf(m)==-1){i.push(m);let y=o(m,u.concat(p));if(y)return y}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:u,next:f}=o.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in t)&&(!i.type||f.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),t[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
29
+ `)}}zr.empty=new zr(!0);class Zk{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function xm(n){let e=[];do e.push(Qk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Qk(n){let e=[];do e.push(eC(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function eC(n){let e=rC(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=tC(n,e);else break;return e}function Em(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function tC(n,e){let t=Em(n),r=t;return n.eat(",")&&(n.next!="}"?r=Em(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function nC(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let a=t[o];a.groups.indexOf(e)>-1&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function rC(n){if(n.eat("(")){let e=xm(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=nC(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function iC(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,u,f){let d={term:f,to:u};return e[a].push(d),d}function i(a,u){a.forEach(f=>f.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((f,d)=>f.concat(o(d,u)),[]);if(a.type=="seq")for(let f=0;;f++){let d=o(a.exprs[f],u);if(f==a.exprs.length-1)return d;i(d,u=t())}else if(a.type=="star"){let f=t();return r(u,f),i(o(a.expr,f),f),[r(f)]}else if(a.type=="plus"){let f=t();return i(o(a.expr,u),f),i(o(a.expr,f),f),[r(f)]}else{if(a.type=="opt")return[r(u)].concat(o(a.expr,u));if(a.type=="range"){let f=u;for(let d=0;d<a.min;d++){let p=t();i(o(a.expr,f),p),f=p}if(a.max==-1)i(o(a.expr,f),f);else for(let d=a.min;d<a.max;d++){let p=t();r(f,p),i(o(a.expr,f),p),f=p}return[r(f)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function km(n,e){return e-n}function Cm(n,e){let t=[];return r(e),t.sort(km);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:u,to:f}=o[a];!u&&t.indexOf(f)==-1&&r(f)}}}function sC(n){let e=Object.create(null);return t(Cm(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:u,to:f})=>{if(!u)return;let d;for(let p=0;p<i.length;p++)i[p][0]==u&&(d=i[p][1]);Cm(n,f).forEach(p=>{d||i.push([u,d=[]]),d.indexOf(p)==-1&&d.push(p)})})});let o=e[r.join(",")]=new zr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(km);o.next.push({type:i[a][0],next:e[u.join(",")]||t(u)})}return o}}function oC(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:f,next:d}=i.next[u];a.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Am(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Om(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function Tm(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new lC(n[t]);return e}let Mm=class G0{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Tm(r.attrs),this.defaultAttrs=Am(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==zr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Om(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Or(this,this.computeAttrs(e),L.from(t),we.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new Or(this,this.computeAttrs(e),t,we.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=L.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(L.empty,!0);return o?new Or(this,e,t.append(o),we.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:we.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new G0(o,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class lC{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class jl{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Tm(i.attrs),this.excluded=null;let o=Am(this.attrs);this.instance=o?new we(this,o):null}create(e=null){return!e&&this.instance?this.instance:new we(this,Om(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new jl(o,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class aC{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Ue.from(e.nodes),t.marks=Ue.from(e.marks||{}),this.nodes=Mm.compile(this.spec.nodes,this),this.marks=jl.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[a]||(r[a]=zr.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?Im(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:Im(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Mm){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Gl(r,r.defaultAttrs,e,we.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Or.fromJSON(this,e)}markFromJSON(e){return we.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Im(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],a=o;if(o)t.push(o);else for(let u in n.marks){let f=n.marks[u];(i=="_"||f.spec.group&&f.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=f)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}let tc=class kf{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Pm(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Pm(this,t,!0);return r.addAll(e,t.from,t.to),z.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(fC(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],u=a.style;if(!(u.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=t))){if(a.getAttrs){let f=a.getAttrs(t);if(f===!1)continue;a.attrs=f||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let u=t[a];if((u.priority==null?50:u.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Dm(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Dm(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new kf(e,kf.schemaRules(e)))}};const Nm={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},uC={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Rm={ol:!0,ul:!0},rl=1,il=2,vs=4;function Lm(n,e,t){return e!=null?(e?rl:0)|(e==="full"?il:0):n&&n.whitespace=="pre"?rl|il:t&~vs}class sl{constructor(e,t,r,i,o,a,u){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=we.none,this.stashMarks=[],this.match=a||(u&vs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(L.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&rl)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=L.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):dC(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Nm.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Pm{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=Lm(null,t.preserveWhitespace,0)|(r?vs:0);i?o=new sl(i.type,i.attrs,we.none,we.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new sl(null,null,we.none,we.none,!0,null,a):o=new sl(e.schema.topNodeType,null,we.none,we.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(e.nodeType==3)this.addTextNode(e);else if(e.nodeType==1){let t=e.getAttribute("style");if(!t)this.addElement(e);else{let r=this.readStyles(hC(t));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(e);for(let u=0;u<i.length;u++)this.removePendingMark(i[u],a);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&il||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&rl)r.options&il?t=t.replace(/\r\n?/g,`
30
+ `):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;Rm.hasOwnProperty(r)&&this.parser.normalizeLists&&cC(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:uC.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let a,u=this.top,f=this.needsBlock;if(Nm.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),a=!0,u.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),a&&this.sync(u),this.needsBlock=f}else this.addElementByRule(e,o,o.consuming===!1?i:void 0)}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
31
+ `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=we.none,r=we.none;e:for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(e[i],e[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(u=>{a.clearMark(u)&&(r=u.addToSet(r))}):t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),a.consuming===!1)o=a;else break}return[t,r]}addElementByRule(e,t,r){let i,o,a;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(f=>this.insertNode(f));else{let f=e;typeof t.contentElement=="string"?f=e.querySelector(t.contentElement):typeof t.contentElement=="function"?f=t.contentElement(e):t.contentElement&&(f=t.contentElement),this.findAround(e,f,!0),this.addAll(f)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,a=r==null?null:e.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,r=o,!a.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let a=Lm(e,i,o.options);o.options&vs&&o.content.length==0&&(a|=vs),this.nodes.push(new sl(e,t,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(u,f)=>{for(;u>=0;u--){let d=t[u];if(d==""){if(u==t.length-1||u==0)continue;for(;f>=o;f--)if(a(u-1,f))return!0;return!1}else{let p=f>0||f==0&&i?this.nodes[f].type:r&&f>=o?r.node(f-o).type:null;if(!p||p.name!=d&&p.groups.indexOf(d)==-1)return!1;f--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=pC(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let a=i.popFromStashMark(e);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==t)break}}}function cC(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Rm.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function fC(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function hC(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function Dm(n){let e={};for(let t in n)e[t]=n[t];return e}function dC(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],a=u=>{o.push(u);for(let f=0;f<u.edgeCount;f++){let{type:d,next:p}=u.edge(f);if(d==e||o.indexOf(p)<0&&a(p))return!0}};if(a(i.contentMatch))return!0}}function pC(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class Wr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=nc(t).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let u=0,f=0;for(;u<o.length&&f<a.marks.length;){let d=a.marks[f];if(!this.marks[d.type.name]){f++;continue}if(!d.eq(o[u][0])||d.type.spec.spanning===!1)break;u++,f++}for(;u<o.length;)i=o.pop()[1];for(;f<a.marks.length;){let d=a.marks[f++],p=this.serializeMark(d,a.isInline,t);p&&(o.push([d,i]),i.appendChild(p.dom),i=p.contentDOM||p.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Wr.renderSpec(nc(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Wr.renderSpec(nc(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?e.createElementNS(r,i):e.createElement(i),f=t[1],d=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){d=2;for(let p in f)if(f[p]!=null){let m=p.indexOf(" ");m>0?u.setAttributeNS(p.slice(0,m),p.slice(m+1),f[p]):u.setAttribute(p,f[p])}}for(let p=d;p<t.length;p++){let m=t[p];if(m===0){if(p<t.length-1||p>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:y,contentDOM:v}=Wr.renderSpec(e,m,r);if(u.appendChild(y),v){if(a)throw new RangeError("Multiple content holes");a=v}}}return{dom:u,contentDOM:a}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Wr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Fm(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Fm(e.marks)}}function Fm(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function nc(n){return n.document||window.document}const $m=65535,Bm=Math.pow(2,16);function mC(n,e){return n+e*Bm}function Hm(n){return n&$m}function gC(n){return(n-(n&$m))/Bm}const zm=1,Vm=2,ol=4,Wm=8;class rc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Wm)>0}get deletedBefore(){return(this.delInfo&(zm|ol))>0}get deletedAfter(){return(this.delInfo&(Vm|ol))>0}get deletedAcross(){return(this.delInfo&ol)>0}}class Ft{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ft.empty)return Ft.empty}recover(e){let t=0,r=Hm(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+gC(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let f=this.ranges[u]-(this.inverted?i:0);if(f>e)break;let d=this.ranges[u+o],p=this.ranges[u+a],m=f+d;if(e<=m){let y=d?e==f?-1:e==m?1:t:t,v=f+i+(y<0?0:p);if(r)return v;let S=e==(t<0?f:m)?null:mC(u/3,e-f),C=e==f?Vm:e==m?zm:ol;return(t<0?e!=f:e!=m)&&(C|=Wm),new rc(v,C,S)}i+=p-d}return r?e+i:new rc(e+i,0,null)}touches(e,t){let r=0,i=Hm(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let f=this.ranges[u]-(this.inverted?r:0);if(f>e)break;let d=this.ranges[u+o],p=f+d;if(e<=p&&u==i*3)return!0;r+=this.ranges[u+a]-d}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),f=a+(this.inverted?0:o),d=this.ranges[i+t],p=this.ranges[i+r];e(u,u+d,f,f+p),o+=p-d}}invert(){return new Ft(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ft.empty:new Ft(e<0?[0,-e,0]:[0,0,e])}}Ft.empty=new Ft([]);class Di{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Di(this.maps,this.mirror,e,t)}copy(){return new Di(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Di;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],u=a.mapResult(e,t);if(u.recover!=null){let f=this.getMirror(o);if(f!=null&&f>o&&f<this.to){o=f,e=this.maps[f].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new rc(e,i,null)}}const ic=Object.create(null);class Xe{getMap(){return Ft.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ic[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in ic)throw new RangeError("Duplicate use of step JSON ID "+e);return ic[e]=t,t.prototype.jsonID=e,t}}class Le{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Le(e,null)}static fail(e){return new Le(null,e)}static fromReplace(e,t,r,i){try{return Le.ok(e.replace(t,r,i))}catch(o){if(o instanceof el)return Le.fail(o.message);throw o}}}function sc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(sc(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return L.fromArray(r)}class or extends Xe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new z(sc(t.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return Le.fromReplace(e,this.from,this.to,o)}invert(){return new hn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new or(t.pos,r.pos,this.mark)}merge(e){return e instanceof or&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new or(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new or(t.from,t.to,e.markFromJSON(t.mark))}}Xe.jsonID("addMark",or);class hn extends Xe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new z(sc(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Le.fromReplace(e,this.from,this.to,r)}invert(){return new or(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new hn(t.pos,r.pos,this.mark)}merge(e){return e instanceof hn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new hn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new hn(t.from,t.to,e.markFromJSON(t.mark))}}Xe.jsonID("removeMark",hn);class lr extends Xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Le.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Le.fromReplace(e,this.pos,this.pos+1,new z(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new lr(this.pos,t.marks[i]);return new lr(this.pos,this.mark)}}return new Fi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new lr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new lr(t.pos,e.markFromJSON(t.mark))}}Xe.jsonID("addNodeMark",lr);class Fi extends Xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Le.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Le.fromReplace(e,this.pos,this.pos+1,new z(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new lr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Fi(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Fi(t.pos,e.markFromJSON(t.mark))}}Xe.jsonID("removeNodeMark",Fi);class Ze extends Xe{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&oc(e,this.from,this.to)?Le.fail("Structure replace would overwrite content"):Le.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ft([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ze(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new Ze(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ze)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?z.empty:new z(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ze(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?z.empty:new z(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ze(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ze(t.from,t.to,z.fromJSON(e,t.slice),!!t.structure)}}Xe.jsonID("replace",Ze);class He extends Xe{constructor(e,t,r,i,o,a,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=u}apply(e){if(this.structure&&(oc(e,this.from,this.gapFrom)||oc(e,this.gapTo,this.to)))return Le.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Le.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Le.fromReplace(e,this.from,this.to,r):Le.fail("Content does not fit in gap")}getMap(){return new Ft([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new He(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new He(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new He(t.from,t.to,t.gapFrom,t.gapTo,z.fromJSON(e,t.slice),t.insert,!!t.structure)}}Xe.jsonID("replaceAround",He);function oc(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function yC(n,e,t,r){let i=[],o=[],a,u;n.doc.nodesBetween(e,t,(f,d,p)=>{if(!f.isInline)return;let m=f.marks;if(!r.isInSet(m)&&p.type.allowsMarkType(r.type)){let y=Math.max(d,e),v=Math.min(d+f.nodeSize,t),S=r.addToSet(m);for(let C=0;C<m.length;C++)m[C].isInSet(S)||(a&&a.to==y&&a.mark.eq(m[C])?a.to=v:i.push(a=new hn(y,v,m[C])));u&&u.to==y?u.to=v:o.push(u=new or(y,v,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function bC(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(a,u)=>{if(!a.isInline)return;o++;let f=null;if(r instanceof jl){let d=a.marks,p;for(;p=r.isInSet(d);)(f||(f=[])).push(p),d=p.removeFromSet(d)}else r?r.isInSet(a.marks)&&(f=[r]):f=a.marks;if(f&&f.length){let d=Math.min(u+a.nodeSize,t);for(let p=0;p<f.length;p++){let m=f[p],y;for(let v=0;v<i.length;v++){let S=i[v];S.step==o-1&&m.eq(i[v].style)&&(y=S)}y?(y.to=d,y.step=o):i.push({style:m,from:Math.max(u,e),to:d,step:o})}}}),i.forEach(a=>n.step(new hn(a.from,a.to,a.style)))}function _C(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],a=e+1;for(let u=0;u<i.childCount;u++){let f=i.child(u),d=a+f.nodeSize,p=r.matchType(f.type);if(!p)o.push(new Ze(a,d,z.empty));else{r=p;for(let m=0;m<f.marks.length;m++)t.allowsMarkType(f.marks[m].type)||n.step(new hn(a,d,f.marks[m]))}a=d}if(!r.validEnd){let u=r.fillBefore(L.empty,!0);n.replace(a,a,new z(u,0,0))}for(let u=o.length-1;u>=0;u--)n.step(o[u])}function vC(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function yi(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,a,t))return r;if(r==0||i.type.spec.isolating||!vC(i,o,a))break}return null}function wC(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),u=i.after(o+1),f=a,d=u,p=L.empty,m=0;for(let S=o,C=!1;S>t;S--)C||r.index(S)>0?(C=!0,p=L.from(r.node(S).copy(p)),m++):f--;let y=L.empty,v=0;for(let S=o,C=!1;S>t;S--)C||i.after(S+1)<i.end(S)?(C=!0,y=L.from(i.node(S).copy(y)),v++):d++;n.step(new He(f,d,a,u,new z(p.append(y),m,v),p.size-m,!0))}function lc(n,e,t=null,r=n){let i=SC(n,e),o=i&&xC(r,e);return o?i.map(Um).concat({type:e,attrs:t}).concat(o.map(Um)):null}function Um(n){return{type:n,attrs:null}}function SC(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(r,i,a)?o:null}function xC(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let f=(a.length?a[a.length-1]:e).contentMatch;for(let d=r;f&&d<i;d++)f=f.matchType(t.child(d).type);return!f||!f.validEnd?null:a}function EC(n,e,t){let r=L.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let u=t[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=L.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new He(i,o,i,o,new z(r,0,0),t.length,!0))}function kC(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(a,u)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&CC(n.doc,n.mapping.slice(o).map(u),r)){n.clearIncompatible(n.mapping.slice(o).map(u,1),r);let f=n.mapping.slice(o),d=f.map(u,1),p=f.map(u+a.nodeSize,1);return n.step(new He(d,p,d+1,p-1,new z(L.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function CC(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function AC(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let a=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new He(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new z(L.from(a),0,0),1,!0))}function bi(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,p=t-2;d>o;d--,p--){let m=i.node(d),y=i.index(d);if(m.type.spec.isolating)return!1;let v=m.content.cutByIndex(y,m.childCount),S=r&&r[p]||m;if(S!=m&&(v=v.replaceChild(0,S.type.create(S.attrs))),!m.canReplace(y+1,m.childCount)||!S.type.validContent(v))return!1}let u=i.indexAfter(o),f=r&&r[0];return i.node(o).canReplaceWith(u,u,f?f.type:i.node(o+1).type)}function OC(n,e,t=1,r){let i=n.doc.resolve(e),o=L.empty,a=L.empty;for(let u=i.depth,f=i.depth-t,d=t-1;u>f;u--,d--){o=L.from(i.node(u).copy(o));let p=r&&r[d];a=L.from(p?p.type.create(p.attrs,a):i.node(u).copy(a))}n.step(new Ze(e,e,new z(o.append(a),t,t),!0))}function Gn(n,e){let t=n.resolve(e),r=t.index();return Km(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Km(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function ll(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):t>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&Km(o,a)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function TC(n,e,t){let r=new Ze(e-t,e+t,z.empty,!0);n.step(r)}function MC(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function IC(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,f=r.index(a)+(u>0?1:0),d=r.node(a),p=!1;if(o==1)p=d.canReplace(f,f,i);else{let m=d.contentMatchAt(f).findWrapping(i.firstChild.type);p=m&&d.canReplaceWith(f,f,m[0])}if(p)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function ac(n,e,t=e,r=z.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return qm(i,o,r)?new Ze(e,t,r):new NC(i,o,r).fit()}function qm(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class NC{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=L.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=L.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,u=i.depth;for(;a&&u&&o.childCount==1;)o=o.firstChild.content,a--,u--;let f=new z(o,a,u);return e>-1?new He(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new Ze(r.pos,i.pos,f):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let r,i=null;t?(i=uc(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:u,match:f}=this.frontier[a],d,p=null;if(e==1&&(o?f.matchType(o.type)||(p=f.fillBefore(L.from(o),!1)):i&&u.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:a,parent:i,inject:p};if(e==2&&o&&(d=f.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:a,parent:i,wrap:d};if(i&&f.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=uc(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new z(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=uc(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new z(ws(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new z(ws(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let C=0;C<o.length;C++)this.openFrontierNode(o[C]);let a=this.unplaced,u=r?r.content:a.content,f=a.openStart-e,d=0,p=[],{match:m,type:y}=this.frontier[t];if(i){for(let C=0;C<i.childCount;C++)p.push(i.child(C));m=m.matchFragment(i)}let v=u.size+e-(a.content.size-a.openEnd);for(;d<u.childCount;){let C=u.child(d),O=m.matchType(C.type);if(!O)break;d++,(d>1||f==0||C.content.size)&&(m=O,p.push(Gm(C.mark(y.allowedMarks(C.marks)),d==1?f:0,d==u.childCount?v:-1)))}let S=d==u.childCount;S||(v=-1),this.placed=Ss(this.placed,t,L.from(p)),this.frontier[t].match=m,S&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let C=0,O=u;C<v;C++){let N=O.lastChild;this.frontier.push({type:N.type,match:N.contentMatchAt(N.childCount)}),O=N.content}this.unplaced=S?e==0?z.empty:new z(ws(a.content,e-1,1),e-1,v<0?a.openEnd:e-1):new z(ws(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!cc(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=cc(e,t,i,r,o);if(a){for(let u=t-1;u>=0;u--){let{match:f,type:d}=this.frontier[u],p=cc(e,u,d,f,!0);if(!p||p.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ss(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ss(this.placed,this.depth,L.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(L.empty,!0);t.childCount&&(this.placed=Ss(this.placed,this.frontier.length,t))}}function ws(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(ws(n.firstChild.content,e-1,t)))}function Ss(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ss(n.lastChild.content,e-1,t)))}function uc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Gm(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Gm(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(L.empty,!0)))),n.copy(r)}function cc(n,e,t,r,i){let o=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==o.childCount&&!t.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,a);return u&&!RC(t,o.content,a)?u:null}function RC(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function LC(n){return n.spec.defining||n.spec.definingForContent}function PC(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(qm(i,o,r))return n.step(new Ze(e,t,r));let a=Jm(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let y=i.depth,v=i.pos-1;y>0;y--,v--){let S=i.node(y).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(y)>-1?u=y:i.before(y)==v&&a.splice(1,0,-y)}let f=a.indexOf(u),d=[],p=r.openStart;for(let y=r.content,v=0;;v++){let S=y.firstChild;if(d.push(S),v==r.openStart)break;y=S.content}for(let y=p-1;y>=0;y--){let v=d[y].type,S=LC(v);if(S&&i.node(f).type!=v)p=y;else if(S||!v.isTextblock)break}for(let y=r.openStart;y>=0;y--){let v=(y+p+1)%(r.openStart+1),S=d[v];if(S)for(let C=0;C<a.length;C++){let O=a[(C+f)%a.length],N=!0;O<0&&(N=!1,O=-O);let q=i.node(O-1),K=i.index(O-1);if(q.canReplaceWith(K,K,S.type,S.marks))return n.replace(i.before(O),N?o.after(O):t,new z(jm(r.content,0,r.openStart,v),v,r.openEnd))}}let m=n.steps.length;for(let y=a.length-1;y>=0&&(n.replace(e,t,r),!(n.steps.length>m));y--){let v=a[y];v<0||(e=i.before(v),t=o.after(v))}}function jm(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(jm(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(n).append(n);n=a.append(o.matchFragment(a).fillBefore(L.empty,!0))}return n}function DC(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=MC(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new z(L.from(r),0,0))}function FC(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Jm(r,i);for(let a=0;a<o.length;a++){let u=o[a],f=a==o.length-1;if(f&&u==0||r.node(u).type.contentMatch.validEnd)return n.delete(r.start(u),i.end(u));if(u>0&&(f||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return n.delete(r.before(u),i.after(u))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a)return n.delete(r.before(a),t);n.delete(e,t)}function Jm(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class $i extends Xe{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Le.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Le.fromReplace(e,this.pos,this.pos+1,new z(L.from(i),0,t.isLeaf?0:1))}getMap(){return Ft.empty}invert(e){return new $i(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $i(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new $i(t.pos,t.attr,t.value)}}Xe.jsonID("attr",$i);let _i=class extends Error{};_i=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},_i.prototype=Object.create(Error.prototype),_i.prototype.constructor=_i,_i.prototype.name="TransformError";class $C{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Di}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new _i(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=z.empty){let i=ac(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new z(L.from(r),0,0))}delete(e,t){return this.replace(e,t,z.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return PC(this,e,t,r),this}replaceRangeWith(e,t,r){return DC(this,e,t,r),this}deleteRange(e,t){return FC(this,e,t),this}lift(e,t){return wC(this,e,t),this}join(e,t=1){return TC(this,e,t),this}wrap(e,t){return EC(this,e,t),this}setBlockType(e,t=e,r,i=null){return kC(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return AC(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new $i(e,t,r)),this}addNodeMark(e,t){return this.step(new lr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof we)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Fi(e,t)),this}split(e,t=1,r){return OC(this,e,t,r),this}addMark(e,t,r){return yC(this,e,t,r),this}removeMark(e,t,r){return bC(this,e,t,r),this}clearIncompatible(e,t,r){return _C(this,e,t,r),this}}const fc=Object.create(null);class he{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new BC(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=z.empty){let r=t.content.lastChild,i=null;for(let u=0;u<t.openEnd;u++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:f,$to:d}=a[u],p=e.mapping.slice(o);e.replaceRange(p.map(f.pos),p.map(d.pos),u?z.empty:t),u==0&&Zm(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],f=e.mapping.slice(r),d=f.map(a.pos),p=f.map(u.pos);o?e.deleteRange(d,p):(e.replaceRangeWith(d,p,t),Zm(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new de(e):vi(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=t<0?vi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):vi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Yt(e.node(0))}static atStart(e){return vi(e,e,0,0,1)||new Yt(e)}static atEnd(e){return vi(e,e,e.content.size,e.childCount,-1)||new Yt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=fc[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in fc)throw new RangeError("Duplicate use of selection JSON ID "+e);return fc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return de.between(this.$anchor,this.$head).getBookmark()}}he.prototype.visible=!0;class BC{constructor(e,t){this.$from=e,this.$to=t}}let Ym=!1;function Xm(n){!Ym&&!n.parent.inlineContent&&(Ym=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class de extends he{constructor(e,t=e){Xm(e),Xm(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return he.near(r);let i=e.resolve(t.map(this.anchor));return new de(i.parent.inlineContent?i:r,r)}replace(e,t=z.empty){if(super.replace(e,t),t==z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof de&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Jl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new de(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=he.findFrom(t,r,!0)||he.findFrom(t,-r,!0);if(o)t=o.$head;else return he.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(he.findFrom(e,-r,!0)||he.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new de(e,t)}}he.jsonID("text",de);class Jl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Jl(e.map(this.anchor),e.map(this.head))}resolve(e){return de.between(e.resolve(this.anchor),e.resolve(this.head))}}class Y extends he{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?he.near(o):new Y(o)}content(){return new z(L.from(this.node),0,0)}eq(e){return e instanceof Y&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Cf(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Y(e.resolve(t.anchor))}static create(e,t){return new Y(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Y.prototype.visible=!1,he.jsonID("node",Y);class Cf{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Jl(r,r):new Cf(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Y.isSelectable(r)?new Y(t):he.near(t)}}class Yt extends he{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=z.empty){if(t==z.empty){e.delete(0,e.doc.content.size);let r=he.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Yt(e)}map(e){return new Yt(e)}eq(e){return e instanceof Yt}getBookmark(){return HC}}he.jsonID("all",Yt);const HC={map(){return this},resolve(n){return new Yt(n)}};function vi(n,e,t,r,i,o=!1){if(e.inlineContent)return de.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let u=e.child(a);if(u.isAtom){if(!o&&Y.isSelectable(u))return Y.create(n,t-(i<0?u.nodeSize:0))}else{let f=vi(n,u,t+i,i<0?u.childCount:0,i,o);if(f)return f}t+=u.nodeSize*i}return null}function Zm(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof Ze||i instanceof He))return;let o=n.mapping.maps[r],a;o.forEach((u,f,d,p)=>{a==null&&(a=p)}),n.setSelection(he.near(n.doc.resolve(a),t))}function Qm(n,e){return!e||!n?n:n.bind(e)}class al{constructor(e,t,r){this.name=e,this.init=Qm(t.init,r),this.apply=Qm(t.apply,r)}}new al("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new al("selection",{init(n,e){return n.selection||he.atStart(e.doc)},apply(n){return n.selection}}),new al("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new al("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function eg(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=eg(i,e,{})),t[r]=i}return t}class wt{constructor(e){this.spec=e,this.props={},e.props&&eg(e.props,this,this.props),this.key=e.key?e.key.key:tg("plugin")}getState(e){return e[this.key]}}const hc=Object.create(null);function tg(n){return n in hc?n+"$"+ ++hc[n]:(hc[n]=0,n+"$")}class Gt{constructor(e="key"){this.key=tg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const xs=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},ng=function(n,e,t,r){return t&&(rg(n,e,t,r,-1)||rg(n,e,t,r,1))},zC=/^(img|br|input|textarea|hr)$/i;function rg(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:ul(n))){let o=n.parentNode;if(!o||o.nodeType!=1||WC(n)||zC.test(n.nodeName)||n.contentEditable=="false")return!1;e=xs(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?ul(n):0}else return!1}}function ul(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function VC(n,e,t){for(let r=e==0,i=e==ul(n);r||i;){if(n==t)return!0;let o=xs(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==ul(n)}}function WC(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const ig=function(n){return n.focusNode&&ng(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function sg(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const jn=typeof navigator<"u"?navigator:null,og=typeof document<"u"?document:null,Jn=jn&&jn.userAgent||"",dc=/Edge\/(\d+)/.exec(Jn),lg=/MSIE \d/.exec(Jn),pc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Jn),Es=!!(lg||pc||dc),ag=lg?document.documentMode:pc?+pc[1]:dc?+dc[1]:0,cl=!Es&&/gecko\/(\d+)/i.test(Jn);cl&&+(/Firefox\/(\d+)/.exec(Jn)||[0,0])[1];const mc=!Es&&/Chrome\/(\d+)/.exec(Jn),wi=!!mc,UC=mc?+mc[1]:0,Tr=!Es&&!!jn&&/Apple Computer/.test(jn.vendor),gc=Tr&&(/Mobile\/\w+/.test(Jn)||!!jn&&jn.maxTouchPoints>2),Rt=gc||(jn?/Mac/.test(jn.platform):!1),ks=/Android \d/.test(Jn),yc=!!og&&"webkitFontSmoothing"in og.documentElement.style,KC=yc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function qC(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let u=r.resolve(a),f,d;if(ig(t)){for(f=u;i&&!i.node;)i=i.parent;let p=i.node;if(i&&p.isAtom&&Y.isSelectable(p)&&i.parent&&!(p.isInline&&VC(t.focusNode,t.focusOffset,i.dom))){let m=i.posBefore;d=new Y(a==m?u:r.resolve(m))}}else{let p=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(p<0)return null;f=r.resolve(p)}if(!d){let p=e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1;d=pg(n,f,u,p)}return d}function ug(n){return n.editable?n.hasFocus():YC(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function bc(n,e=!1){let t=n.state.selection;if(JC(n,t),!!ug(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&wi){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&ng(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)jC(n);else{let{anchor:r,head:i}=t,o,a;cg&&!(t instanceof de)&&(t.$from.parent.inlineContent||(o=fg(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=fg(n,t.to))),n.docView.setSelection(r,i,n.root,e),cg&&(o&&hg(o),a&&hg(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&GC(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const cg=Tr||wi&&UC<63;function fg(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Tr&&i&&i.contentEditable=="false")return _c(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return _c(i);if(o)return _c(o)}}function _c(n){return n.contentEditable="true",Tr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function hg(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function GC(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!ug(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function jC(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,xs(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Es&&ag<=11&&(r.disabled=!0,r.disabled=!1)}function JC(n,e){if(e instanceof Y){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(dg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else dg(n)}function dg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function pg(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||de.between(e,t,r)}function YC(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function vc(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&he.findFrom(o,e)}function Mr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function mg(n,e,t){let r=n.state.selection;if(r instanceof de){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=vc(n.state,e);return i&&i instanceof Y?Mr(n,i):!1}else if(!(Rt&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let u=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=n.docView.descAt(u))&&!a.contentDOM?Y.isSelectable(o)?Mr(n,new Y(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):yc?Mr(n,new de(n.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof Y&&r.node.isInline)return Mr(n,new de(e>0?r.$to:r.$from));{let i=vc(n.state,e);return i?Mr(n,i):!1}}}function fl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Cs(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function wc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(cl&&t.nodeType==1&&r<fl(t)&&Cs(t.childNodes[r])&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(Cs(u))i=t,o=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(gg(t))break;{let u=t.previousSibling;for(;u&&Cs(u);)i=t.parentNode,o=xs(u),u=u.previousSibling;if(u)t=u,r=fl(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?xc(n,t,r):i&&xc(n,i,o)}function Sc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=fl(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(Cs(u))o=t,a=++r;else break}else{if(gg(t))break;{let u=t.nextSibling;for(;u&&Cs(u);)o=u.parentNode,a=xs(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=fl(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&xc(n,o,a)}function gg(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function xc(n,e,t){let r=n.domSelection();if(ig(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&bc(n)},50)}function yg(n,e,t){let r=n.state.selection;if(r instanceof de&&!r.empty||t.indexOf("s")>-1||Rt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=vc(n.state,e);if(a&&a instanceof Y)return Mr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,u=r instanceof Yt?he.near(a,e):he.findFrom(a,e);return u?Mr(n,u):!1}return!1}function bg(n,e){if(!(n.state.selection instanceof de))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let a=n.state.tr;return e<0?a.delete(t.pos-o.nodeSize,t.pos):a.delete(t.pos,t.pos+o.nodeSize),n.dispatch(a),!0}return!1}function _g(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function XC(n){if(!Tr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;_g(n,r,"true"),setTimeout(()=>_g(n,r,"false"),20)}return!1}function ZC(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function QC(n,e){let t=e.keyCode,r=ZC(e);return t==8||Rt&&t==72&&r=="c"?bg(n,-1)||wc(n):t==46||Rt&&t==68&&r=="c"?bg(n,1)||Sc(n):t==13||t==27?!0:t==37||Rt&&t==66&&r=="c"?mg(n,-1,r)||wc(n):t==39||Rt&&t==70&&r=="c"?mg(n,1,r)||Sc(n):t==38||Rt&&t==80&&r=="c"?yg(n,-1,r)||wc(n):t==40||Rt&&t==78&&r=="c"?XC(n)||yg(n,1,r)||Sc(n):r==(Rt?"m":"c")&&(t==66||t==73||t==89||t==90)}function vg(n,e){n.someProp("transformCopied",v=>{e=v(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let v=r.firstChild;t.push(v.type.name,v.attrs!=v.type.defaultAttrs?v.attrs:null),r=v.content}let a=n.someProp("clipboardSerializer")||Wr.fromSchema(n.state.schema),u=Og(),f=u.createElement("div");f.appendChild(a.serializeFragment(r,{document:u}));let d=f.firstChild,p,m=0;for(;d&&d.nodeType==1&&(p=Cg[d.nodeName.toLowerCase()]);){for(let v=p.length-1;v>=0;v--){let S=u.createElement(p[v]);for(;f.firstChild;)S.appendChild(f.firstChild);f.appendChild(S),m++}d=f.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${m?` -${m}`:""} ${JSON.stringify(t)}`);let y=n.someProp("clipboardTextSerializer",v=>v(e,n))||e.content.textBetween(0,e.content.size,`
32
+
33
+ `);return{dom:f,text:y}}function wg(n,e,t,r,i){let o=i.parent.type.spec.code,a,u;if(!t&&!e)return null;let f=e&&(r||o||!t);if(f){if(n.someProp("transformPastedText",y=>{e=y(e,o||r,n)}),o)return e?new z(L.from(n.state.schema.text(e.replace(/\r\n?/g,`
34
+ `))),0,0):z.empty;let m=n.someProp("clipboardTextParser",y=>y(e,i,r,n));if(m)u=m;else{let y=i.marks(),{schema:v}=n.state,S=Wr.fromSchema(v);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(C=>{let O=a.appendChild(document.createElement("p"));C&&O.appendChild(S.serializeNode(v.text(C,y)))})}}else n.someProp("transformPastedHTML",m=>{t=m(t,n)}),a=nA(t),yc&&rA(a);let d=a&&a.querySelector("[data-pm-slice]"),p=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let m=+p[3];m>0;m--){let y=a.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;a=y}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||tc.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||p),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!eA.test(y.parentNode.nodeName)?{ignore:!0}:null}})),p)u=iA(kg(u,+p[1],+p[2]),p[4]);else if(u=z.maxOpen(tA(u.content,i),!0),u.openStart||u.openEnd){let m=0,y=0;for(let v=u.content.firstChild;m<u.openStart&&!v.type.spec.isolating;m++,v=v.firstChild);for(let v=u.content.lastChild;y<u.openEnd&&!v.type.spec.isolating;y++,v=v.lastChild);u=kg(u,m,y)}return n.someProp("transformPasted",m=>{u=m(u,n)}),u}const eA=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function tA(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,a=[];if(n.forEach(u=>{if(!a)return;let f=i.findWrapping(u.type),d;if(!f)return a=null;if(d=a.length&&o.length&&xg(f,o,u,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=Eg(a[a.length-1],o.length));let p=Sg(u,f);a.push(p),i=i.matchType(p.type),o=f}}),a)return L.from(a)}return n}function Sg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,L.from(n));return n}function xg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=xg(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(L.from(Sg(t,n,i+1))))}}function Eg(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Eg(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(L.empty,!0);return n.copy(t.append(r))}function Ec(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,u=a.content;return i<r-1&&(u=Ec(u,e,t,r,i+1,o)),i>=t&&(u=e<0?a.contentMatchAt(0).fillBefore(u,n.childCount>1||o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(L.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(u))}function kg(n,e,t){return e<n.openStart&&(n=new z(Ec(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new z(Ec(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const Cg={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ag=null;function Og(){return Ag||(Ag=document.implementation.createHTMLDocument("title"))}function nA(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Og().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&Cg[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=n,i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function rA(n){let e=n.querySelectorAll(wi?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function iA(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:a}=n;for(let u=r.length-2;u>=0;u-=2){let f=t.nodes[r[u]];if(!f||f.hasRequiredAttrs())break;i=L.from(f.create(r[u+1],i)),o++,a++}return new z(i,o,a)}const jt={},St={};function Yn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}St.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Mg(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ks&&wi&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),gc&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,sg(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||QC(n,t)?t.preventDefault():Yn(n,"key")},St.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},St.keypress=(n,e)=>{let t=e;if(Mg(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Rt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof de)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))||n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function hl(n){return{left:n.clientX,top:n.clientY}}function sA(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function kc(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(n.someProp(e,u=>a>o.depth?u(n,t,o.nodeAfter,o.before(a),i,!0):u(n,t,o.node(a),o.before(a),i,!1)))return!0;return!1}function Si(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function oA(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(Si(n,new Y(t)),!0):!1}function lA(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Y&&(r=t.node);let o=n.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a);if(Y.isSelectable(u)){r&&t.$from.depth>0&&a>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(a);break}}return i!=null?(Si(n,Y.create(n.state.doc,i)),!0):!1}function aA(n,e,t,r,i){return kc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?lA(n,t):oA(n,t))}function uA(n,e,t,r){return kc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function cA(n,e,t,r){return kc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||fA(n,t,r)}function fA(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Si(n,de.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(a.inlineContent)Si(n,de.create(r,u+1,u+1+a.content.size));else if(Y.isSelectable(a))Si(n,Y.create(r,u));else continue;return!0}}function Cc(n){return dl(n)}const Tg=Rt?"metaKey":"ctrlKey";jt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Cc(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&sA(t,n.input.lastClick)&&!t[Tg]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let a=n.posAtCoords(hl(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new hA(n,a,t,!!r)):(o=="doubleClick"?uA:cA)(n,a.pos,a.inside,t)?t.preventDefault():Yn(n,"pointer"))};class hA{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Tg],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let p=e.state.doc.resolve(t.pos);o=p.parent,a=p.depth?p.before():0}const u=i?null:r.target,f=u?e.docView.nearestDesc(u,!0):null;this.target=f?f.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof Y&&d.from<=a&&d.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&cl&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Yn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>bc(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(hl(e))),this.updateAllowDefault(e),this.allowDefault||!t?Yn(this.view,"pointer"):aA(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Tr&&this.mightDrag&&!this.mightDrag.node.isAtom||wi&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Si(this.view,he.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Yn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Yn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}jt.touchstart=n=>{n.input.lastTouch=Date.now(),Cc(n),Yn(n,"pointer")},jt.touchmove=n=>{n.input.lastTouch=Date.now(),Yn(n,"pointer")},jt.contextmenu=n=>Cc(n);function Mg(n,e){return n.composing?!0:Tr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const dA=ks?5e3:-1;St.compositionstart=St.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),dl(n,!0),n.markCursor=null;else if(dl(n),cl&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){n.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}n.input.composing=!0}Ig(n,dA)},St.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,Ig(n,20))};function Ig(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>dl(n),e))}function pA(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=mA());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function mA(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function dl(n,e=!1){if(!(ks&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),pA(n),e||n.docView&&n.docView.dirty){let t=qC(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function gA(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const xi=Es&&ag<15||gc&&KC<604;jt.copy=St.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=xi?null:t.clipboardData,a=r.content(),{dom:u,text:f}=vg(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",f)):gA(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function yA(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function bA(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?Ac(n,r.value,null,e):Ac(n,r.textContent,r.innerHTML,e)},50)}function Ac(n,e,t,r){let i=wg(n,e,t,n.input.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",u=>u(n,r,i||z.empty)))return!0;if(!i)return!1;let o=yA(i),a=o?n.state.tr.replaceSelectionWith(o,n.input.shiftKey):n.state.tr.replaceSelection(i);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}St.paste=(n,e)=>{let t=e;if(n.composing&&!ks)return;let r=xi?null:t.clipboardData;r&&Ac(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():bA(n,t)};class _A{constructor(e,t){this.slice=e,this.move=t}}const Ng=Rt?"altKey":"ctrlKey";jt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(hl(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(Y.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&n.dispatch(n.state.tr.setSelection(Y.create(n.state.doc,d.posBefore)))}}let a=n.state.selection.content(),{dom:u,text:f}=vg(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(xi?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",xi||t.dataTransfer.setData("text/plain",f),n.dragging=new _A(a,!t[Ng])},jt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},St.dragover=St.dragenter=(n,e)=>e.preventDefault(),St.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(hl(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",S=>{a=S(a,n)}):a=wg(n,t.dataTransfer.getData(xi?"Text":"text/plain"),xi?null:t.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!t[Ng]);if(n.someProp("handleDrop",S=>S(n,t,a||z.empty,u))){t.preventDefault();return}if(!a)return;t.preventDefault();let f=a?IC(n.state.doc,o.pos,a):o.pos;f==null&&(f=o.pos);let d=n.state.tr;u&&d.deleteSelection();let p=d.mapping.map(f),m=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,y=d.doc;if(m?d.replaceRangeWith(p,p,a.content.firstChild):d.replaceRange(p,p,a),d.doc.eq(y))return;let v=d.doc.resolve(p);if(m&&Y.isSelectable(a.content.firstChild)&&v.nodeAfter&&v.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new Y(v));else{let S=d.mapping.map(f);d.mapping.maps[d.mapping.maps.length-1].forEach((C,O,N,q)=>S=q),d.setSelection(pg(n,v,d.doc.resolve(S)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))},jt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&bc(n)},20))},jt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},jt.beforeinput=(n,e)=>{if(wi&&ks&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,sg(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in St)jt[n]=St[n];function As(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Af{constructor(e,t){this.toDOM=e,this.spec=t||Ir,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new dn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Af&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&As(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class sr{constructor(e,t){this.attrs=e,this.spec=t||Ir}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new dn(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof sr&&As(this.attrs,e.attrs)&&As(this.spec,e.spec)}static is(e){return e.type instanceof sr}destroy(){}}class Of{constructor(e,t){this.attrs=e,this.spec=t||Ir}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=o.pos?null:new dn(o.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof Of&&As(this.attrs,e.attrs)&&As(this.spec,e.spec)}destroy(){}}class dn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new dn(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new dn(e,e,new Af(t,r))}static inline(e,t,r,i){return new dn(e,t,new sr(r,i))}static node(e,t,r,i){return new dn(e,t,new Of(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof sr}}const Ei=[],Ir={};class ze{constructor(e,t){this.local=e.length?e:Ei,this.children=t.length?t:Ei}static create(e,t){return t.length?pl(t,e,0,Ir):lt}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=t&&u.to>=e&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let u=this.children[a]+1;this.children[a+2].findInner(e-u,t-u,r,i+u,o)}}map(e,t,r){return this==lt||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ir)}mapInner(e,t,r,i,o){let a;for(let u=0;u<this.local.length;u++){let f=this.local[u].map(e,r,i);f&&f.type.valid(t,f)?(a||(a=[])).push(f):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?vA(this.children,a||[],e,t,r,i,o):a?new ze(a.sort(Nr),Ei):lt}add(e,t){return t.length?this==lt?ze.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((u,f)=>{let d=f+r,p;if(p=Lg(t,u,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<f;)o+=3;i[o]==f?i[o+2]=i[o+2].addInner(u,p,d+1):i.splice(o,0,f,f+u.nodeSize,pl(p,u,d+1,Ir)),o+=3}});let a=Rg(o?Pg(t):t,-r);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||a.splice(u--,1);return new ze(a.length?this.local.concat(a).sort(Nr):this.local,i||this.children)}remove(e){return e.length==0||this==lt?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,u=r[o]+t,f=r[o+1]+t;for(let p=0,m;p<e.length;p++)(m=e[p])&&m.from>u&&m.to<f&&(e[p]=null,(a||(a=[])).push(m));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(a,u+1);d!=lt?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<e.length;o++)if(a=e[o])for(let u=0;u<i.length;u++)i[u].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new ze(i,r):lt}forChild(e,t){if(this==lt)return this;if(t.isLeaf)return ze.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=e){this.children[u]==e&&(r=this.children[u+2]);break}let o=e+1,a=o+t.content.size;for(let u=0;u<this.local.length;u++){let f=this.local[u];if(f.from<a&&f.to>o&&f.type instanceof sr){let d=Math.max(o,f.from)-o,p=Math.min(a,f.to)-o;d<p&&(i||(i=[])).push(f.copy(d,p))}}if(i){let u=new ze(i.sort(Nr),Ei);return r?new Vr([u,r]):u}return r||lt}eq(e){if(this==e)return!0;if(!(e instanceof ze)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Oc(this.localsInner(e))}localsInner(e){if(this==lt)return Ei;if(e.inlineContent||!this.local.some(sr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof sr||t.push(this.local[r]);return t}}ze.empty=new ze([],[]),ze.removeOverlap=Oc;const lt=ze.empty;class Vr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Ir));return Vr.from(r)}forChild(e,t){if(t.isLeaf)return ze.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=lt&&(o instanceof Vr?r=r.concat(o.members):r.push(o))}return Vr.from(r)}eq(e){if(!(e instanceof Vr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let a=0;a<o.length;a++)t.push(o[a])}}return t?Oc(r?t:t.sort(Nr)):Ei}static from(e){switch(e.length){case 0:return lt;case 1:return e[0];default:return new Vr(e.every(t=>t instanceof ze)?e:e.reduce((t,r)=>t.concat(r instanceof ze?r:r.members),[]))}}}function vA(n,e,t,r,i,o,a){let u=n.slice();for(let d=0,p=o;d<t.maps.length;d++){let m=0;t.maps[d].forEach((y,v,S,C)=>{let O=C-S-(v-y);for(let N=0;N<u.length;N+=3){let q=u[N+1];if(q<0||y>q+p-m)continue;let K=u[N]+p-m;v>=K?u[N+1]=y<=K?-2:-1:S>=i&&O&&(u[N]+=O,u[N+1]+=O)}m+=O}),p=t.maps[d].map(p,-1)}let f=!1;for(let d=0;d<u.length;d+=3)if(u[d+1]<0){if(u[d+1]==-2){f=!0,u[d+1]=-1;continue}let p=t.map(n[d]+o),m=p-i;if(m<0||m>=r.content.size){f=!0;continue}let y=t.map(n[d+1]+o,-1),v=y-i,{index:S,offset:C}=r.content.findIndex(m),O=r.maybeChild(S);if(O&&C==m&&C+O.nodeSize==v){let N=u[d+2].mapInner(t,O,p+1,n[d]+o+1,a);N!=lt?(u[d]=m,u[d+1]=v,u[d+2]=N):(u[d+1]=-2,f=!0)}else f=!0}if(f){let d=wA(u,n,e,t,i,o,a),p=pl(d,r,0,a);e=p.local;for(let m=0;m<u.length;m+=3)u[m+1]<0&&(u.splice(m,3),m-=3);for(let m=0,y=0;m<p.children.length;m+=3){let v=p.children[m];for(;y<u.length&&u[y]<v;)y+=3;u.splice(y,0,p.children[m],p.children[m+1],p.children[m+2])}}return new ze(e.sort(Nr),u)}function Rg(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new dn(i.from+e,i.to+e,i.type))}return t}function wA(n,e,t,r,i,o,a){function u(f,d){for(let p=0;p<f.local.length;p++){let m=f.local[p].map(r,i,d);m?t.push(m):a.onRemove&&a.onRemove(f.local[p].spec)}for(let p=0;p<f.children.length;p+=3)u(f.children[p+2],f.children[p]+d+1)}for(let f=0;f<n.length;f+=3)n[f+1]==-1&&u(n[f+2],e[f]+o+1);return t}function Lg(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,a;o<n.length;o++)(a=n[o])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[o]=null);return i}function Pg(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function pl(n,e,t,r){let i=[],o=!1;e.forEach((u,f)=>{let d=Lg(n,u,f+t);if(d){o=!0;let p=pl(d,u,t+f+1,r);p!=lt&&i.push(f,f+u.nodeSize,p)}});let a=Rg(o?Pg(n):n,-t).sort(Nr);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new ze(a,i):lt}function Nr(n,e){return n.from-e.from||n.to-e.to}function Oc(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),Dg(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),Dg(e,i,r.copy(o.from,r.to)));break}}}return e}function Dg(n,e,t){for(;e<n.length&&Nr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var Xn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ml={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Fg=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),SA=typeof navigator<"u"&&/Mac/.test(navigator.platform),xA=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),EA=SA||Fg&&+Fg[1]<57,Ge=0;Ge<10;Ge++)Xn[48+Ge]=Xn[96+Ge]=String(Ge);for(var Ge=1;Ge<=24;Ge++)Xn[Ge+111]="F"+Ge;for(var Ge=65;Ge<=90;Ge++)Xn[Ge]=String.fromCharCode(Ge+32),ml[Ge]=String.fromCharCode(Ge);for(var Tc in Xn)ml.hasOwnProperty(Tc)||(ml[Tc]=Xn[Tc]);function kA(n){var e=EA&&(n.ctrlKey||n.altKey||n.metaKey)||xA&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ml:Xn)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const CA=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function AA(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,a;for(let u=0;u<e.length-1;u++){let f=e[u];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))CA?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function OA(n){let e=Object.create(null);for(let t in n)e[AA(t)]=n[t];return e}function Mc(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}function TA(n){return new wt({props:{handleKeyDown:MA(n)}})}function MA(n){let e=OA(n);return function(t,r){let i=kA(r),o=i.length==1&&i!=" ",a,u=e[Mc(i,r,!o)];if(u&&u(t.state,t.dispatch,t))return!0;if(o&&(r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(a=Xn[r.keyCode])&&a!=i){let f=e[Mc(a,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[Mc(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const IA=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function NA(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const RA=(n,e,t)=>{let r=NA(n,t);if(!r)return!1;let i=$g(r);if(!i){let a=r.blockRange(),u=a&&yi(a);return u==null?!1:(e&&e(n.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&zg(n,i,e))return!0;if(r.parent.content.size==0&&(ki(o,"end")||Y.isSelectable(o))){let a=ac(n.doc,r.before(),r.after(),z.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(ki(o,"end")?he.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):Y.create(u.doc,i.pos-o.nodeSize)),e(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function ki(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const LA=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=$g(r)}let a=o&&o.nodeBefore;return!a||!Y.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Y.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function $g(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function PA(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const DA=(n,e,t)=>{let r=PA(n,t);if(!r)return!1;let i=Bg(r);if(!i)return!1;let o=i.nodeAfter;if(zg(n,i,e))return!0;if(r.parent.content.size==0&&(ki(o,"start")||Y.isSelectable(o))){let a=ac(n.doc,r.before(),r.after(),z.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(ki(o,"start")?he.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Y.create(u.doc,u.mapping.map(i.pos))),e(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},FA=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=Bg(r)}let a=o&&o.nodeAfter;return!a||!Y.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Y.create(n.doc,o.pos)).scrollIntoView()),!0)};function Bg(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const $A=(n,e)=>{let t=n.selection,r=t instanceof Y,i;if(r){if(t.node.isTextblock||!Gn(n.doc,t.from))return!1;i=t.from}else if(i=ll(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(Y.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},BA=(n,e)=>{let t=n.selection,r;if(t instanceof Y){if(t.node.isTextblock||!Gn(n.doc,t.to))return!1;r=t.to}else if(r=ll(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},HA=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&yi(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},zA=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
35
+ `).scrollIntoView()),!0)};function Hg(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const VA=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),a=Hg(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let u=t.after(),f=n.tr.replaceWith(u,u,a.createAndFill());f.setSelection(he.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},WA=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Yt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Hg(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(a,o.createAndFill());u.setSelection(de.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},UA=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(bi(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&yi(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},KA=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(Y.create(n.doc,i))),!0)};function qA(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Gn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function zg(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(qA(n,e,t))return!0;let u=e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(t){let m=e.pos+i.nodeSize,y=L.empty;for(let C=o.length-1;C>=0;C--)y=L.from(o[C].create(null,y));y=L.from(r.copy(y));let v=n.tr.step(new He(e.pos-1,m,e.pos,m,new z(y,1,0),o.length,!0)),S=m+2*o.length;Gn(v.doc,S)&&v.join(S),t(v.scrollIntoView())}return!0}let f=he.findFrom(e,1),d=f&&f.$from.blockRange(f.$to),p=d&&yi(d);if(p!=null&&p>=e.depth)return t&&t(n.tr.lift(d,p).scrollIntoView()),!0;if(u&&ki(i,"start",!0)&&ki(r,"end")){let m=r,y=[];for(;y.push(m),!m.isTextblock;)m=m.lastChild;let v=i,S=1;for(;!v.isTextblock;v=v.firstChild)S++;if(m.canReplace(m.childCount,m.childCount,v.content)){if(t){let C=L.empty;for(let N=y.length-1;N>=0;N--)C=L.from(y[N].copy(C));let O=n.tr.step(new He(e.pos-y.length,e.pos+i.nodeSize,e.pos+S,e.pos+i.nodeSize-S,new z(C,y.length,0),0,!0));t(O.scrollIntoView())}return!0}}return!1}function Vg(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(de.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const GA=Vg(-1),jA=Vg(1);function JA(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),u=a&&lc(a,n,e);return u?(r&&r(t.tr.wrap(a,u).scrollIntoView()),!0):!1}}function Wg(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:u}}=t.selection.ranges[o];t.doc.nodesBetween(a,u,(f,d)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let p=t.doc.resolve(d),m=p.index();i=p.parent.canReplaceWith(m,m+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:f}}=t.selection.ranges[a];o.setBlockType(u,f,n,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function YA(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),u=!1,f=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(n)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let p=t.doc.resolve(a.start-2);f=new nl(p,p,a.depth),a.endIndex<a.parent.childCount&&(a=new nl(i,t.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let d=lc(f,n,e,a);return d?(r&&r(XA(t.tr,a,d,u,n).scrollIntoView()),!0):!1}}function XA(n,e,t,r,i){let o=L.empty;for(let p=t.length-1;p>=0;p--)o=L.from(t[p].type.create(t[p].attrs,o));n.step(new He(e.start-(r?2:0),e.end,e.start,e.end,new z(o,0,0),t.length,!0));let a=0;for(let p=0;p<t.length;p++)t[p].type==i&&(a=p+1);let u=t.length-a,f=e.start+t.length-(r?2:0),d=e.parent;for(let p=e.startIndex,m=e.endIndex,y=!0;p<m;p++,y=!1)!y&&bi(n.doc,f,u)&&(n.split(f,u),f+=2*u),f+=d.child(p).nodeSize;return n}function ZA(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?QA(e,t,n,o):eO(e,t,o):!0:!1}}function QA(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new He(o-1,a,o,a,new z(L.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new nl(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=yi(r);if(u==null)return!1;i.lift(r,u);let f=i.mapping.map(o,-1)-1;return Gn(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function eO(n,e,t){let r=n.tr,i=t.parent;for(let v=t.end,S=t.endIndex-1,C=t.startIndex;S>C;S--)v-=i.child(S).nodeSize,r.delete(v-1,v+1);let o=r.doc.resolve(t.start),a=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let u=t.startIndex==0,f=t.endIndex==i.childCount,d=o.node(-1),p=o.index(-1);if(!d.canReplace(p+(u?0:1),p+1,a.content.append(f?L.empty:L.from(i))))return!1;let m=o.pos,y=m+a.nodeSize;return r.step(new He(m-(u?1:0),y+(f?1:0),m+1,y-1,new z((u?L.empty:L.from(i.copy(L.empty))).append(f?L.empty:L.from(i.copy(L.empty))),u?0:1,f?0:1),u?0:1)),e(r.scrollIntoView()),!0}function tO(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==n);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let u=o.parent,f=u.child(a-1);if(f.type!=n)return!1;if(t){let d=f.lastChild&&f.lastChild.type==u.type,p=L.from(d?n.create():null),m=new z(L.from(n.create(null,L.from(u.type.create(null,p)))),d?3:1,0),y=o.start,v=o.end;t(e.tr.step(new He(y-(d?3:1),v,y,v,m,1,!0)).scrollIntoView())}return!0}}function gl(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class Ic{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([u,f])=>[u,(...p)=>{const m=f(...p)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],f=!!e,d=e||o.tr,p=()=>(!f&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(d),u.every(y=>y===!0)),m={...Object.fromEntries(Object.entries(r).map(([y,v])=>[y,(...C)=>{const O=this.buildProps(d,t),N=v(...C)(O);return u.push(N),m}])),run:p};return m}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([f,d])=>[f,(...p)=>d(...p)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u={tr:e,editor:i,view:a,state:gl({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([f,d])=>[f,(...p)=>d(...p)(u)]))}};return u}}function V(n,e,t){return n.config[e]===void 0&&n.parent?V(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?V(n.parent,e,t):null}):n.config[e]}function yl(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Ug(n){const e=[],{nodeExtensions:t,markExtensions:r}=yl(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},f=V(a,"addGlobalAttributes",u);if(!f)return;f().forEach(p=>{p.types.forEach(m=>{Object.entries(p.attributes).forEach(([y,v])=>{e.push({type:m,name:y,attribute:{...o,...v}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},f=V(a,"addAttributes",u);if(!f)return;const d=f();Object.entries(d).forEach(([p,m])=>{const y={...o,...m};typeof y?.default=="function"&&(y.default=y.default()),y?.isRequired&&y?.default===void 0&&delete y.default,e.push({type:a.name,name:p,attribute:y})})}),e}function $e(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Ci(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const u=o?o.split(" "):[],f=r[i]?r[i].split(" "):[],d=u.filter(p=>!f.includes(p));r[i]=[...f,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Nc(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Ci(t,r),{})}function nO(n){return typeof n=="function"}function se(n,e=void 0,...t){return nO(n)?e?n.bind(e)(...t):n(...t):n}function rO(n={}){return Object.keys(n).length===0&&n.constructor===Object}function iO(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Kg(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(t):iO(t.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function qg(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&rO(t)?!1:t!=null))}function Gg(n,e){var t;const r=Ug(n),{nodeExtensions:i,markExtensions:o}=yl(n),a=(t=i.find(d=>V(d,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(d=>{const p=r.filter(N=>N.type===d.name),m={name:d.name,options:d.options,storage:d.storage,editor:e},y=n.reduce((N,q)=>{const K=V(q,"extendNodeSchema",m);return{...N,...K?K(d):{}}},{}),v=qg({...y,content:se(V(d,"content",m)),marks:se(V(d,"marks",m)),group:se(V(d,"group",m)),inline:se(V(d,"inline",m)),atom:se(V(d,"atom",m)),selectable:se(V(d,"selectable",m)),draggable:se(V(d,"draggable",m)),code:se(V(d,"code",m)),defining:se(V(d,"defining",m)),isolating:se(V(d,"isolating",m)),attrs:Object.fromEntries(p.map(N=>{var q;return[N.name,{default:(q=N?.attribute)===null||q===void 0?void 0:q.default}]}))}),S=se(V(d,"parseHTML",m));S&&(v.parseDOM=S.map(N=>Kg(N,p)));const C=V(d,"renderHTML",m);C&&(v.toDOM=N=>C({node:N,HTMLAttributes:Nc(N,p)}));const O=V(d,"renderText",m);return O&&(v.toText=O),[d.name,v]})),f=Object.fromEntries(o.map(d=>{const p=r.filter(O=>O.type===d.name),m={name:d.name,options:d.options,storage:d.storage,editor:e},y=n.reduce((O,N)=>{const q=V(N,"extendMarkSchema",m);return{...O,...q?q(d):{}}},{}),v=qg({...y,inclusive:se(V(d,"inclusive",m)),excludes:se(V(d,"excludes",m)),group:se(V(d,"group",m)),spanning:se(V(d,"spanning",m)),code:se(V(d,"code",m)),attrs:Object.fromEntries(p.map(O=>{var N;return[O.name,{default:(N=O?.attribute)===null||N===void 0?void 0:N.default}]}))}),S=se(V(d,"parseHTML",m));S&&(v.parseDOM=S.map(O=>Kg(O,p)));const C=V(d,"renderHTML",m);return C&&(v.toDOM=O=>C({mark:O,HTMLAttributes:Nc(O,p)})),[d.name,v]}));return new aC({topNode:a,nodes:u,marks:f})}function Rc(n,e){return e.nodes[n]||e.marks[n]||null}function jg(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const sO=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,a,u)=>{var f,d;const p=((d=(f=i.type.spec).toText)===null||d===void 0?void 0:d.call(f,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";t+=p.slice(0,Math.max(0,r-o))}),t};function Lc(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Jg{constructor(e){this.find=e.find,this.handler=e.handler}}const oO=(n,e)=>{if(Lc(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Pc(n){var e;const{editor:t,from:r,to:i,text:o,rules:a,plugin:u}=n,{view:f}=t;if(f.composing)return!1;const d=f.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(y=>y.type.spec.code))return!1;let p=!1;const m=sO(d)+o;return a.forEach(y=>{if(p)return;const v=oO(m,y.find);if(!v)return;const S=f.state.tr,C=gl({state:f.state,transaction:S}),O={from:r-(v[0].length-o.length),to:i},{commands:N,chain:q,can:K}=new Ic({editor:t,state:C});y.handler({state:C,range:O,match:v,commands:N,chain:q,can:K})===null||!S.steps.length||(S.setMeta(u,{transform:S,from:r,to:i,text:o}),f.dispatch(S),p=!0)}),p}function lO(n){const{editor:e,rules:t}=n,r=new wt({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,u){return Pc({editor:e,from:o,to:a,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Pc({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Pc({editor:e,from:a.pos,to:a.pos,text:`
36
+ `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function aO(n){return typeof n=="number"}class uO{constructor(e){this.find=e.find,this.handler=e.handler}}const cO=(n,e)=>{if(Lc(e))return[...n.matchAll(e)];const t=e(n);return t?t.map(r=>{const i=[r.text];return i.index=r.index,i.input=n,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function fO(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:u}=n,{commands:f,chain:d,can:p}=new Ic({editor:e,state:t}),m=[];return t.doc.nodesBetween(r,i,(v,S)=>{if(!v.isTextblock||v.type.spec.code)return;const C=Math.max(r,S),O=Math.min(i,S+v.content.size),N=v.textBetween(C-S,O-S,void 0,"\uFFFC");cO(N,o.find).forEach(K=>{if(K.index===void 0)return;const oe=C+K.index+1,pe=oe+K[0].length,$={from:t.tr.mapping.map(oe),to:t.tr.mapping.map(pe)},ue=o.handler({state:t,range:$,match:K,commands:f,chain:d,can:p,pasteEvent:a,dropEvent:u});m.push(ue)})}),m.every(v=>v!==null)}function hO(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,a=new ClipboardEvent("paste"),u=new DragEvent("drop");return t.map(d=>new wt({view(p){const m=y=>{var v;r=!((v=p.dom.parentElement)===null||v===void 0)&&v.contains(y.target)?p.dom.parentElement:null};return window.addEventListener("dragstart",m),{destroy(){window.removeEventListener("dragstart",m)}}},props:{handleDOMEvents:{drop:(p,m)=>(o=r===p.dom.parentElement,u=m,!1),paste:(p,m)=>{var y;const v=(y=m.clipboardData)===null||y===void 0?void 0:y.getData("text/html");return a=m,i=!!v?.includes("data-pm-slice"),!1}}},appendTransaction:(p,m,y)=>{const v=p[0],S=v.getMeta("uiEvent")==="paste"&&!i,C=v.getMeta("uiEvent")==="drop"&&!o;if(!S&&!C)return;const O=m.doc.content.findDiffStart(y.doc.content),N=m.doc.content.findDiffEnd(y.doc.content);if(!aO(O)||!N||O===N.b)return;const q=y.tr,K=gl({state:y,transaction:q});if(!(!fO({editor:e,state:K,from:Math.max(O-1,0),to:N.b-1,rule:d,pasteEvent:a,dropEvent:u})||!q.steps.length))return u=new DragEvent("drop"),a=new ClipboardEvent("paste"),q}}))}function dO(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class Pi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Pi.resolve(e),this.schema=Gg(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:Rc(r.name,this.schema)};r.type==="mark"&&(!((i=se(V(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=V(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=V(r,"onCreate",o);u&&this.editor.on("create",u);const f=V(r,"onUpdate",o);f&&this.editor.on("update",f);const d=V(r,"onSelectionUpdate",o);d&&this.editor.on("selectionUpdate",d);const p=V(r,"onTransaction",o);p&&this.editor.on("transaction",p);const m=V(r,"onFocus",o);m&&this.editor.on("focus",m);const y=V(r,"onBlur",o);y&&this.editor.on("blur",y);const v=V(r,"onDestroy",o);v&&this.editor.on("destroy",v)})}static resolve(e){const t=Pi.sort(Pi.flatten(e)),r=dO(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=V(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=V(r,"priority")||100,a=V(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Rc(t.name,this.schema)},i=V(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Pi.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:e,type:Rc(a.name,this.schema)},f=[],d=V(a,"addKeyboardShortcuts",u);let p={};if(a.type==="mark"&&a.config.exitable&&(p.ArrowRight=()=>xt.handleExit({editor:e,mark:a})),d){const C=Object.fromEntries(Object.entries(d()).map(([O,N])=>[O,()=>N({editor:e})]));p={...p,...C}}const m=TA(p);f.push(m);const y=V(a,"addInputRules",u);jg(a,e.options.enableInputRules)&&y&&r.push(...y());const v=V(a,"addPasteRules",u);jg(a,e.options.enablePasteRules)&&v&&i.push(...v());const S=V(a,"addProseMirrorPlugins",u);if(S){const C=S();f.push(...C)}return f}).flat();return[lO({editor:e,rules:r}),...hO({editor:e,rules:i}),...o]}get attributes(){return Ug(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=yl(this.extensions);return Object.fromEntries(t.filter(r=>!!V(r,"addNodeView")).map(r=>{const i=this.attributes.filter(f=>f.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:$e(r.name,this.schema)},a=V(r,"addNodeView",o);if(!a)return[];const u=(f,d,p,m)=>{const y=Nc(f,i);return a()({editor:e,node:f,getPos:p,decorations:m,HTMLAttributes:y,extension:r})};return[r.name,u]}))}}function pO(n){return Object.prototype.toString.call(n).slice(8,-1)}function Dc(n){return pO(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function bl(n,e){const t={...n};return Dc(n)&&Dc(e)&&Object.keys(e).forEach(r=>{Dc(e[r])?r in n?t[r]=bl(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class Re{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(V(this,"addOptions",{name:this.name}))),this.storage=se(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Re(e)}configure(e={}){const t=this.extend();return t.options=bl(this.options,e),t.storage=se(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Re(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=se(V(t,"addOptions",{name:t.name})),t.storage=se(V(t,"addStorage",{name:t.name,options:t.options})),t}}function mO(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
37
+
38
+ `,textSerializers:a={}}=t||{};let u="",f=!0;return n.nodesBetween(r,i,(d,p,m,y)=>{var v;const S=a?.[d.type.name];S?(d.isBlock&&!f&&(u+=o,f=!0),m&&(u+=S({node:d,pos:p,parent:m,index:y,range:e}))):d.isText?(u+=(v=d?.text)===null||v===void 0?void 0:v.slice(Math.max(r,p)-p,i-p),f=!1):d.isBlock&&!f&&(u+=o,f=!0)}),u}function gO(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Re.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new wt({key:new Gt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,a=Math.min(...o.map(p=>p.$from.pos)),u=Math.max(...o.map(p=>p.$to.pos)),f=gO(t);return mO(r,{from:a,to:u},{textSerializers:f})}}})]}});const yO=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),bO=(n=!1)=>({commands:e})=>e.setContent("",n),_O=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:a})=>{n.doc.nodesBetween(o.pos,a.pos,(u,f)=>{if(u.type.isText)return;const{doc:d,mapping:p}=e,m=d.resolve(p.map(f)),y=d.resolve(p.map(f+u.nodeSize)),v=m.blockRange(y);if(!v)return;const S=yi(v);if(u.type.isTextblock){const{defaultType:C}=m.parent.contentMatchAt(m.index());e.setNodeMarkup(v.start,C)}(S||S===0)&&e.lift(v,S)})}),!0},vO=n=>e=>n(e),wO=()=>({state:n,dispatch:e})=>WA(n,e),SO=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,o.content),r.setSelection(new de(r.doc.resolve(a-1))),!0},xO=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const u=i.before(o),f=i.after(o);n.delete(u,f).scrollIntoView()}return!0}return!1},EO=n=>({tr:e,state:t,dispatch:r})=>{const i=$e(n,t.schema),o=e.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const f=o.before(a),d=o.after(a);e.delete(f,d).scrollIntoView()}return!0}return!1},kO=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},CO=()=>({state:n,dispatch:e})=>IA(n,e),AO=()=>({commands:n})=>n.keyboardShortcut("Enter"),OO=()=>({state:n,dispatch:e})=>VA(n,e);function _l(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Lc(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Fc(n,e,t={}){return n.find(r=>r.type===e&&_l(r.attrs,t))}function TO(n,e,t={}){return!!Fc(n,e,t)}function $c(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=Fc([...r.node.marks],e,t);if(!i)return;let o=r.index,a=n.start()+r.offset,u=o+1,f=a+r.node.nodeSize;for(Fc([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,a-=n.parent.child(o).nodeSize;for(;u<n.parent.childCount&&TO([...n.parent.child(u).marks],e,t);)f+=n.parent.child(u).nodeSize,u+=1;return{from:a,to:f}}function sn(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const MO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=sn(n,r.schema),{doc:a,selection:u}=t,{$from:f,from:d,to:p}=u;if(i){const m=$c(f,o,e);if(m&&m.from<=d&&m.to>=p){const y=de.create(a,m.from,m.to);t.setSelection(y)}}return!0},IO=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Yg(n){return n instanceof de}function Rr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function NO(n,e=null){if(!e)return null;const t=he.atStart(n),r=he.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?de.create(n,Rr(0,i,o),Rr(n.content.size,i,o)):de.create(n,Rr(e,i,o),Rr(e,i,o))}function Bc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const RO=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{Bc()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Yg(t.state.selection))return a(),!0;const u=NO(i.doc,n)||t.state.selection,f=t.state.selection.eq(u);return o&&(f||i.setSelection(u),f&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},LO=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),PO=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function Xg(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function vl(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?L.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),vl("",e,t)}if(typeof n=="string"){const r=tc.fromSchema(e);return t.slice?r.parseSlice(Xg(n),t.parseOptions).content:r.parse(Xg(n),t.parseOptions)}return vl("",e,t)}function DO(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof Ze||i instanceof He))return;const o=n.mapping.maps[r];let a=0;o.forEach((u,f,d,p)=>{a===0&&(a=p)}),n.setSelection(he.near(n.doc.resolve(a),t))}const FO=n=>n.toString().startsWith("<"),$O=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=vl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(a.toString()==="<>")return!0;let{from:u,to:f}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},d=!0,p=!0;if((FO(a)?a:[a]).forEach(y=>{y.check(),d=d?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),u===f&&p){const{parent:y}=r.doc.resolve(u);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(u-=1,f+=1)}d?Array.isArray(e)?r.insertText(e.map(y=>y.text||"").join(""),u,f):typeof e=="object"&&e&&e.text?r.insertText(e.text,u,f):r.insertText(e,u,f):r.replaceWith(u,f,a),t.updateSelection&&DO(r,r.steps.length-1,-1)}return!0},BO=()=>({state:n,dispatch:e})=>$A(n,e),HO=()=>({state:n,dispatch:e})=>BA(n,e),zO=()=>({state:n,dispatch:e})=>RA(n,e),VO=()=>({state:n,dispatch:e})=>DA(n,e),WO=()=>({tr:n,state:e,dispatch:t})=>{try{const r=ll(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},UO=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ll(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function Zg(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function KO(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,a;for(let u=0;u<e.length-1;u+=1){const f=e[u];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))Bc()||Zg()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const qO=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=KO(n).split(/-(?!$)/),a=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),f=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,u))});return f?.steps.forEach(d=>{const p=d.map(r.mapping);p&&i&&r.maybeStep(p)}),!0};function Hc(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?$e(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(m,y)=>{if(m.isText)return;const v=Math.max(r,y),S=Math.min(i,y+m.nodeSize);u.push({node:m,from:v,to:S})});const f=i-r,d=u.filter(m=>a?a.name===m.node.type.name:!0).filter(m=>_l(m.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((m,y)=>m+y.to-y.from,0)>=f}const GO=(n,e={})=>({state:t,dispatch:r})=>{const i=$e(n,t.schema);return Hc(t,i,e)?HA(t,r):!1},jO=()=>({state:n,dispatch:e})=>UA(n,e),JO=n=>({state:e,dispatch:t})=>{const r=$e(n,e.schema);return ZA(r)(e,t)},YO=()=>({state:n,dispatch:e})=>zA(n,e);function zc(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Qg(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const XO=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=zc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=$e(n,r.schema)),u==="mark"&&(a=sn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(d,p)=>{o&&o===d.type&&t.setNodeMarkup(p,void 0,Qg(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(m=>{a===m.type&&t.addMark(p,p+d.nodeSize,a.create(Qg(m.attrs,e)))})})}),!0):!1},ZO=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),QO=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),eT=()=>({state:n,dispatch:e})=>LA(n,e),tT=()=>({state:n,dispatch:e})=>FA(n,e),nT=()=>({state:n,dispatch:e})=>KA(n,e),rT=()=>({state:n,dispatch:e})=>jA(n,e),iT=()=>({state:n,dispatch:e})=>GA(n,e);function sT(n,e,t={}){return vl(n,e,{slice:!1,parseOptions:t})}const oT=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=sT(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!e),!0};function e0(n,e){const t=sn(e,n.schema),{from:r,to:i,empty:o}=n.selection,a=[];o?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,f=>{a.push(...f.marks)});const u=a.find(f=>f.type.name===t.name);return u?{...u.attrs}:{}}function lT(n,e){const t=new $C(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function aT(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function uT(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function cT(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Vc(n){return e=>cT(e.$from,n)}function fT(n,e){const t=Pi.resolve(n);return Gg(t,e)}function hT(n,e){const t=$e(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,u=>{o.push(u)});const a=o.reverse().find(u=>u.type.name===t.name);return a?{...a.attrs}:{}}function dT(n,e){const t=zc(typeof e=="string"?e:e.name,n.schema);return t==="node"?hT(n,e):t==="mark"?e0(n,e):{}}function pT(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function mT(n){const e=pT(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,a)=>a!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function gT(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const a=[];if(i.ranges.length)i.forEach((u,f)=>{a.push({from:u,to:f})});else{const{from:u,to:f}=t[o];if(u===void 0||f===void 0)return;a.push({from:u,to:f})}a.forEach(({from:u,to:f})=>{const d=e.slice(o).map(u,-1),p=e.slice(o).map(f),m=e.invert().map(d,-1),y=e.invert().map(p);r.push({oldRange:{from:m,to:y},newRange:{from:d,to:p}})})}),mT(r)}function t0(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=$c(o,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function wl(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function yT(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?sn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(m=>o?o.name===m.type.name:!0).find(m=>_l(m.attrs,t,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:m,$to:y})=>{const v=m.pos,S=y.pos;n.doc.nodesBetween(v,S,(C,O)=>{if(!C.isText&&!C.marks.length)return;const N=Math.max(v,O),q=Math.min(S,O+C.nodeSize),K=q-N;a+=K,u.push(...C.marks.map(oe=>({mark:oe,from:N,to:q})))})}),a===0)return!1;const f=u.filter(m=>o?o.name===m.mark.type.name:!0).filter(m=>_l(m.mark.attrs,t,{strict:!1})).reduce((m,y)=>m+y.to-y.from,0),d=u.filter(m=>o?m.mark.type!==o&&m.mark.type.excludes(o):!0).reduce((m,y)=>m+y.to-y.from,0);return(f>0?f+d:f)>=a}function n0(n,e){const{nodeExtensions:t}=yl(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=se(V(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function bT(n,e,t){var r;const{selection:i}=e;let o=null;if(Yg(i)&&(o=i.$cursor),o){const u=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(u)||!u.some(f=>f.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:u,$to:f})=>{let d=u.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(u.pos,f.pos,(p,m,y)=>{if(d)return!1;if(p.isInline){const v=!y||y.type.allowsMarkType(t),S=!!t.isInSet(p.marks)||!p.marks.some(C=>C.type.excludes(t));d=v&&S}return!d}),d})}const _T=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:u}=o,f=sn(n,r.schema);if(i)if(a){const d=e0(r,f);t.addStoredMark(f.create({...d,...e}))}else u.forEach(d=>{const p=d.$from.pos,m=d.$to.pos;r.doc.nodesBetween(p,m,(y,v)=>{const S=Math.max(v,p),C=Math.min(v+y.nodeSize,m);y.marks.find(N=>N.type===f)?y.marks.forEach(N=>{f===N.type&&t.addMark(S,C,f.create({...N.attrs,...e}))}):t.addMark(S,C,f.create(e))})});return bT(r,t,f)},vT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),wT=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=$e(n,t.schema);return o.isTextblock?i().command(({commands:a})=>Wg(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>Wg(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ST=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Rr(n,0,r.content.size),o=Y.create(r,i);e.setSelection(o)}return!0},xT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=de.atStart(r).from,u=de.atEnd(r).to,f=Rr(i,a,u),d=Rr(o,a,u),p=de.create(r,f,d);e.setSelection(p)}return!0},ET=n=>({state:e,dispatch:t})=>{const r=$e(n,e.schema);return tO(r)(e,t)};function r0(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const kT=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:u,$to:f}=o,d=i.extensionManager.attributes,p=wl(d,u.node().type.name,u.node().attrs);if(o instanceof Y&&o.node.isBlock)return!u.parentOffset||!bi(a,u.pos)?!1:(r&&(n&&r0(t,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const m=f.parentOffset===f.parent.content.size;o instanceof de&&e.deleteSelection();const y=u.depth===0?void 0:aT(u.node(-1).contentMatchAt(u.indexAfter(-1)));let v=m&&y?[{type:y,attrs:p}]:void 0,S=bi(e.doc,e.mapping.map(u.pos),1,v);if(!v&&!S&&bi(e.doc,e.mapping.map(u.pos),1,y?[{type:y}]:void 0)&&(S=!0,v=y?[{type:y,attrs:p}]:void 0),S&&(e.split(e.mapping.map(u.pos),1,v),y&&!m&&!u.parentOffset&&u.parent.type!==y)){const C=e.mapping.map(u.before()),O=e.doc.resolve(C);u.node(-1).canReplaceWith(O.index(),O.index()+1,y)&&e.setNodeMarkup(e.mapping.map(u.before()),y)}n&&r0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},CT=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=$e(n,t.schema),{$from:u,$to:f}=t.selection,d=t.selection.node;if(d&&d.isBlock||u.depth<2||!u.sameParent(f))return!1;const p=u.node(-1);if(p.type!==a)return!1;const m=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let O=L.empty;const N=u.index(-1)?1:u.index(-2)?2:3;for(let ue=u.depth-N;ue>=u.depth-3;ue-=1)O=L.from(u.node(ue).copy(O));const q=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,K=wl(m,u.node().type.name,u.node().attrs),oe=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(K))||void 0;O=O.append(L.from(a.createAndFill(null,oe)||void 0));const pe=u.before(u.depth-(N-1));e.replace(pe,u.after(-q),new z(O,4-N,0));let $=-1;e.doc.nodesBetween(pe,e.doc.content.size,(ue,at)=>{if($>-1)return!1;ue.isTextblock&&ue.content.size===0&&($=at+1)}),$>-1&&e.setSelection(de.near(e.doc.resolve($))),e.scrollIntoView()}return!0}const y=f.pos===u.end()?p.contentMatchAt(0).defaultType:null,v=wl(m,p.type.name,p.attrs),S=wl(m,u.node().type.name,u.node().attrs);e.delete(u.pos,f.pos);const C=y?[{type:a,attrs:v},{type:y,attrs:S}]:[{type:a,attrs:v}];if(!bi(e.doc,u.pos,2))return!1;if(r){const{selection:O,storedMarks:N}=t,{splittableMarks:q}=i.extensionManager,K=N||O.$to.parentOffset&&O.$from.marks();if(e.split(u.pos,2,C).scrollIntoView(),!K||!r)return!0;const oe=K.filter(pe=>q.includes(pe.type.name));e.ensureMarks(oe)}return!0},Wc=(n,e)=>{const t=Vc(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&Gn(n.doc,t.pos)&&n.join(t.pos),!0},Uc=(n,e)=>{const t=Vc(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&Gn(n.doc,r)&&n.join(r),!0},AT=(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:u,chain:f,commands:d,can:p})=>{const{extensions:m,splittableMarks:y}=i.extensionManager,v=$e(n,a.schema),S=$e(e,a.schema),{selection:C,storedMarks:O}=a,{$from:N,$to:q}=C,K=N.blockRange(q),oe=O||C.$to.parentOffset&&C.$from.marks();if(!K)return!1;const pe=Vc($=>n0($.type.name,m))(C);if(K.depth>=1&&pe&&K.depth-pe.depth<=1){if(pe.node.type===v)return d.liftListItem(S);if(n0(pe.node.type.name,m)&&v.validContent(pe.node.content)&&u)return f().command(()=>(o.setNodeMarkup(pe.pos,v),!0)).command(()=>Wc(o,v)).command(()=>Uc(o,v)).run()}return!t||!oe||!u?f().command(()=>p().wrapInList(v,r)?!0:d.clearNodes()).wrapInList(v,r).command(()=>Wc(o,v)).command(()=>Uc(o,v)).run():f().command(()=>{const $=p().wrapInList(v,r),ue=oe.filter(at=>y.includes(at.type.name));return o.ensureMarks(ue),$?!0:d.clearNodes()}).wrapInList(v,r).command(()=>Wc(o,v)).command(()=>Uc(o,v)).run()},OT=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=sn(n,r.schema);return yT(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},TT=(n,e,t={})=>({state:r,commands:i})=>{const o=$e(n,r.schema),a=$e(e,r.schema);return Hc(r,o,t)?i.setNode(a):i.setNode(o,t)},MT=(n,e={})=>({state:t,commands:r})=>{const i=$e(n,t.schema);return Hc(t,i,e)?r.lift(i):r.wrapIn(i,e)},IT=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const a=n.tr,u=o.transform;for(let f=u.steps.length-1;f>=0;f-=1)a.step(u.steps[f].invert(u.docs[f]));if(o.text){const f=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,n.schema.text(o.text,f))}else a.delete(o.from,o.to)}return!0}}return!1},NT=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},RT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=t,f=sn(n,r.schema),{$from:d,empty:p,ranges:m}=u;if(!i)return!0;if(p&&a){let{from:y,to:v}=u;const S=(o=d.marks().find(O=>O.type===f))===null||o===void 0?void 0:o.attrs,C=$c(d,f,S);C&&(y=C.from,v=C.to),t.removeMark(y,v,f)}else m.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,f)});return t.removeStoredMark(f),!0},LT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=zc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=$e(n,r.schema)),u==="mark"&&(a=sn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const d=f.$from.pos,p=f.$to.pos;r.doc.nodesBetween(d,p,(m,y)=>{o&&o===m.type&&t.setNodeMarkup(y,void 0,{...m.attrs,...e}),a&&m.marks.length&&m.marks.forEach(v=>{if(a===v.type){const S=Math.max(y,d),C=Math.min(y+m.nodeSize,p);t.addMark(S,C,a.create({...v.attrs,...e}))}})})}),!0):!1},PT=(n,e={})=>({state:t,dispatch:r})=>{const i=$e(n,t.schema);return JA(i,e)(t,r)},DT=(n,e={})=>({state:t,dispatch:r})=>{const i=$e(n,t.schema);return YA(i,e)(t,r)};var FT=Object.freeze({__proto__:null,blur:yO,clearContent:bO,clearNodes:_O,command:vO,createParagraphNear:wO,cut:SO,deleteCurrentNode:xO,deleteNode:EO,deleteRange:kO,deleteSelection:CO,enter:AO,exitCode:OO,extendMarkRange:MO,first:IO,focus:RO,forEach:LO,insertContent:PO,insertContentAt:$O,joinUp:BO,joinDown:HO,joinBackward:zO,joinForward:VO,joinItemBackward:WO,joinItemForward:UO,keyboardShortcut:qO,lift:GO,liftEmptyBlock:jO,liftListItem:JO,newlineInCode:YO,resetAttributes:XO,scrollIntoView:ZO,selectAll:QO,selectNodeBackward:eT,selectNodeForward:tT,selectParentNode:nT,selectTextblockEnd:rT,selectTextblockStart:iT,setContent:oT,setMark:_T,setMeta:vT,setNode:wT,setNodeSelection:ST,setTextSelection:xT,sinkListItem:ET,splitBlock:kT,splitListItem:CT,toggleList:AT,toggleMark:OT,toggleNode:TT,toggleWrap:MT,undoInputRule:IT,unsetAllMarks:NT,unsetMark:RT,updateAttributes:LT,wrapIn:PT,wrapInList:DT});Re.create({name:"commands",addCommands(){return{...FT}}}),Re.create({name:"editable",addProseMirrorPlugins(){return[new wt({key:new Gt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Re.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new wt({key:new Gt("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Re.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:f,doc:d}=u,{empty:p,$anchor:m}=f,{pos:y,parent:v}=m,S=m.parent.isTextblock?u.doc.resolve(y-1):m,C=S.parent.type.spec.isolating,O=m.pos-m.parentOffset,N=C&&S.parent.childCount===1?O===m.pos:he.atStart(d).from===y;return!p||!N||!v.type.isTextblock||v.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Bc()||Zg()?o:i},addProseMirrorPlugins(){return[new wt({key:new Gt("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(S=>S.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,u=he.atStart(e.doc).from,f=he.atEnd(e.doc).to;if(i||!(o===u&&a===f)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const m=t.tr,y=gl({state:t,transaction:m}),{commands:v}=new Ic({editor:this.editor,state:y});if(v.clearNodes(),!!m.steps.length)return m}})]}}),Re.create({name:"tabindex",addProseMirrorPlugins(){return[new wt({key:new Gt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function $T(n){return new Jg({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=se(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function BT(n){return new Jg({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=se(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),f=a.doc.resolve(t.from).blockRange(),d=f&&lc(f,n.type,o);if(!d)return null;if(a.wrap(f,d),n.keepMarks&&n.editor){const{selection:m,storedMarks:y}=e,{splittableMarks:v}=n.editor.extensionManager,S=y||m.$to.parentOffset&&m.$from.marks();if(S){const C=S.filter(O=>v.includes(O.type.name));a.ensureMarks(C)}}if(n.keepAttributes){const m=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(m,o).run()}const p=a.doc.resolve(t.from-1).nodeBefore;p&&p.type===n.type&&Gn(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,p))&&a.join(t.from-1)}})}class xt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(V(this,"addOptions",{name:this.name}))),this.storage=se(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new xt(e)}configure(e={}){const t=this.extend();return t.options=bl(this.options,e),t.storage=se(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new xt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=se(V(t,"addOptions",{name:t.name})),t.storage=se(V(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(d=>d?.type.name===t.name))return!1;const f=a.find(d=>d?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class On{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(V(this,"addOptions",{name:this.name}))),this.storage=se(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new On(e)}configure(e={}){const t=this.extend();return t.options=bl(this.options,e),t.storage=se(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new On(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=se(V(t,"addOptions",{name:t.name})),t.storage=se(V(t,"addStorage",{name:t.name,options:t.options})),t}}function HT(n){return new uO({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=se(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=e,u=r[r.length-1],f=r[0];let d=t.to;if(u){const p=f.search(/\S/),m=t.from+f.indexOf(u),y=m+u.length;if(t0(t.from,t.to,e.doc).filter(S=>S.mark.type.excluded.find(O=>O===n.type&&O!==S.mark.type)).filter(S=>S.to>m).length)return null;y<t.to&&a.delete(y,t.to),m>t.from&&a.delete(t.from+p,m),d=t.from+p+u.length,a.addMark(t.from+p,d,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}const zT=On.create({name:"text",group:"inline"});var Sl=200,Ke=function(){};Ke.prototype.append=function(e){return e.length?(e=Ke.from(e),!this.length&&e||e.length<Sl&&this.leafAppend(e)||this.length<Sl&&e.leafPrepend(this)||this.appendInner(e)):this},Ke.prototype.prepend=function(e){return e.length?Ke.from(e).append(this):this},Ke.prototype.appendInner=function(e){return new VT(this,e)},Ke.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ke.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ke.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ke.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ke.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},Ke.from=function(e){return e instanceof Ke?e:e&&e.length?new i0(e):Ke.empty};var i0=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,u){for(var f=o;f<a;f++)if(i(this.values[f],u+f)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,u){for(var f=o-1;f>=a;f--)if(i(this.values[f],u+f)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Sl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Sl)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ke);Ke.empty=new i0([]);var VT=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),a)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,a+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,a+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ke),s0=Ke;const WT=500;class Xt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,u,f,d=[],p=[];return this.items.forEach((m,y)=>{if(!m.step){i||(i=this.remapping(r,y+1),o=i.maps.length),o--,p.push(m);return}if(i){p.push(new cn(m.map));let v=m.step.map(i.slice(o)),S;v&&a.maybeStep(v).doc&&(S=a.mapping.maps[a.mapping.maps.length-1],d.push(new cn(S,void 0,void 0,d.length+p.length))),o--,S&&i.appendMap(S,o)}else a.maybeStep(m.step);if(m.selection)return u=i?m.selection.map(i.slice(o)):m.selection,f=new Xt(this.items.slice(0,r).append(p.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:a,selection:u}}addTransform(e,t,r,i){let o=[],a=this.eventCount,u=this.items,f=!i&&u.length?u.get(u.length-1):null;for(let p=0;p<e.steps.length;p++){let m=e.steps[p].invert(e.docs[p]),y=new cn(e.mapping.maps[p],m,t),v;(v=f&&f.merge(y))&&(y=v,p?o.pop():u=u.slice(0,u.length-1)),o.push(y),t&&(a++,t=void 0),i||(f=y)}let d=a-r.depth;return d>KT&&(u=UT(u,d),a-=d),new Xt(u.append(o),a)}remapping(e,t){let r=new Di;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new Xt(this.items.append(e.map(t=>new cn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,u=this.eventCount;this.items.forEach(y=>{y.selection&&u--},i);let f=t;this.items.forEach(y=>{let v=o.getMirror(--f);if(v==null)return;a=Math.min(a,v);let S=o.maps[v];if(y.step){let C=e.steps[v].invert(e.docs[v]),O=y.selection&&y.selection.map(o.slice(f+1,v));O&&u++,r.push(new cn(S,C,O))}else r.push(new cn(S))},i);let d=[];for(let y=t;y<a;y++)d.push(new cn(o.maps[y]));let p=this.items.slice(0,i).append(d).append(r),m=new Xt(p,u);return m.emptyItemCount()>WT&&(m=m.compress(this.items.length-r.length)),m}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,u)=>{if(u>=e)i.push(a),a.selection&&o++;else if(a.step){let f=a.step.map(t.slice(r)),d=f&&f.getMap();if(r--,d&&t.appendMap(d,r),f){let p=a.selection&&a.selection.map(t.slice(r));p&&o++;let m=new cn(d.invert(),f,p),y,v=i.length-1;(y=i.length&&i[v].merge(m))?i[v]=y:i.push(m)}}else a.map&&r--},this.items.length,0),new Xt(s0.from(i.reverse()),o)}}Xt.empty=new Xt(s0.empty,0);function UT(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class cn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new cn(t.getMap().invert(),t,this.selection)}}}class Zn{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const KT=20;function qT(n,e,t,r){let i=t.getMeta(Qn),o;if(i)return i.historyState;t.getMeta(jT)&&(n=new Zn(n.done,n.undone,null,0));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Qn))return a.getMeta(Qn).redo?new Zn(n.done.addTransform(t,void 0,r,xl(e)),n.undone,o0(t.mapping.maps[t.steps.length-1]),n.prevTime):new Zn(n.done,n.undone.addTransform(t,void 0,r,xl(e)),null,n.prevTime);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=n.prevTime==0||!a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!GT(t,n.prevRanges)),f=a?Kc(n.prevRanges,t.mapping):o0(t.mapping.maps[t.steps.length-1]);return new Zn(n.done.addTransform(t,u?e.selection.getBookmark():void 0,r,xl(e)),Xt.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new Zn(n.done.rebased(t,o),n.undone.rebased(t,o),Kc(n.prevRanges,t.mapping),n.prevTime):new Zn(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Kc(n.prevRanges,t.mapping),n.prevTime)}function GT(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function o0(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function Kc(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function l0(n,e,t,r){let i=xl(e),o=Qn.get(e).spec.config,a=(r?n.undone:n.done).popEvent(e,i);if(!a)return;let u=a.selection.resolve(a.transform.doc),f=(r?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),d=new Zn(r?f:a.remaining,r?a.remaining:f,null,0);t(a.transform.setSelection(u).setMeta(Qn,{redo:r,historyState:d}).scrollIntoView())}let qc=!1,a0=null;function xl(n){let e=n.plugins;if(a0!=e){qc=!1,a0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){qc=!0;break}}return qc}const Qn=new Gt("history"),jT=new Gt("closeHistory");function JT(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new wt({key:Qn,state:{init(){return new Zn(Xt.empty,Xt.empty,null,0)},apply(e,t,r){return qT(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?u0:r=="historyRedo"?c0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const u0=(n,e)=>{let t=Qn.getState(n);return!t||t.done.eventCount==0?!1:(e&&l0(t,n,e,!1),!0)},c0=(n,e)=>{let t=Qn.getState(n);return!t||t.undone.eventCount==0?!1:(e&&l0(t,n,e,!0),!0)},YT=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>u0(n,e),redo:()=>({state:n,dispatch:e})=>c0(n,e)}},addProseMirrorPlugins(){return[JT(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),Gc=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),jc=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),er=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),ee=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Lt=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),ce=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",SUPERSCRIPT:"superscript",MARGIN:"margin",LINK:"link",STYLE_PRESET:"style_preset",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT,this.MARGIN]},get presetAttributes(){return[this.LINE_HEIGHT]},get inlineMarks(){return[this.TEXT_DECORATION,this.LINK,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),Jt=Object.freeze({SETTINGS:"settings",ALL:"_"}),f0=Object.freeze({BLANK:"_blank",SELF:"_self"}),Os=Object.freeze({URL:"url",BLOCK:"block"});class Jc{static create(e,t){const r=new this(e,t||{});return new wt({key:new Gt(this.name),props:r._buildProps()})}constructor(e,t){this.options=t,this.editor=e}_buildProps(){const t=Object.entries(this.addProps()).map(([r,i])=>[r,i.bind(this)]);return Object.fromEntries(t)}addProps(){return{}}}class XT extends Jc{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=Yl.build(e);return t.normalizeHTML(),this._removeDeprecatedStyles(t),t.normalizedHTML}_removeDeprecatedStyles(e){const t=e.dom.querySelectorAll('[style*="margin"]');for(const r of Array.from(t))r.style.removeProperty("margin"),r.style.removeProperty("margin-top"),r.style.removeProperty("margin-right"),r.style.removeProperty("margin-bottom"),r.style.removeProperty("margin-left")}_handlePaste(e,t,r){const i=this._insertPastedContent(e,r).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return e.dispatch(i),!0}_insertPastedContent({state:e},t){return this._isFullBlockSelected(e)?e.tr.replaceSelectionWith(t.content,!1):e.tr.replaceSelection(t)}_isFullBlockSelected(e){const t=this._expandSelectionToBlocks(e),r=this._isMatchPosition(t.from,e.selection.from),i=this._isMatchPosition(t.to,e.selection.to);return r&&i}_expandSelectionToBlocks({selection:e,doc:t}){let r=e.from,i=e.to;return t.nodesBetween(r,i,(o,a,u)=>{u.type.name===ee.DOCUMENT&&(r=Math.min(r,a+1),i=Math.max(i,a+o.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class ZT extends Jc{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:e}){const t=[];if(!this.editor.isEditable)return null;if(!(e.childCount>1))return e.descendants((r,i)=>{if(!r.childCount){const o=dn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),ze.create(e,t)}}const QT="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",eM="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u062A\u0635\u0627\u0644\u0627\u062A6\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",Ai=(n,e)=>{for(const t in e)n[t]=e[t];return n},Yc="numeric",Xc="ascii",Zc="alpha",El="asciinumeric",kl="alphanumeric",Qc="domain",h0="emoji",tM="scheme",nM="slashscheme",d0="whitespace";function rM(n,e){return n in e||(e[n]=[]),e[n]}function Lr(n,e,t){e[Yc]&&(e[El]=!0,e[kl]=!0),e[Xc]&&(e[El]=!0,e[Zc]=!0),e[El]&&(e[kl]=!0),e[Zc]&&(e[kl]=!0),e[kl]&&(e[Qc]=!0),e[h0]&&(e[Qc]=!0);for(const r in e){const i=rM(r,t);i.indexOf(n)<0&&i.push(n)}}function iM(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function pt(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}pt.groups={},pt.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(n))return o}return e.jd},has(n,e){return e===void 0&&(e=!1),e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||pt.groups;let i;return e&&e.j?i=e:(i=new pt(e),t&&r&&Lr(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const o=n.length;if(!o)return i;for(let a=0;a<o-1;a++)i=i.tt(n[a]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||pt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let a,u=i.go(n);if(u?(a=new pt,Ai(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new pt,o){if(r)if(a.t&&typeof a.t=="string"){const f=Ai(iM(a.t,r),t);Lr(o,f,r)}else t&&Lr(o,t,r);a.t=o}return i.j[n]=a,a}};const U=(n,e,t,r,i)=>n.ta(e,t,r,i),Pt=(n,e,t,r,i)=>n.tr(e,t,r,i),p0=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),An="WORD",ef="UWORD",Ts="LOCALHOST",tf="TLD",nf="UTLD",Cl="SCHEME",Oi="SLASH_SCHEME",rf="NUM",m0="WS",sf="NL",Ti="OPENBRACE",Ms="OPENBRACKET",Is="OPENANGLEBRACKET",Ns="OPENPAREN",Pr="CLOSEBRACE",Mi="CLOSEBRACKET",Ii="CLOSEANGLEBRACKET",Dr="CLOSEPAREN",Al="AMPERSAND",Ol="APOSTROPHE",Tl="ASTERISK",tr="AT",Ml="BACKSLASH",Il="BACKTICK",Nl="CARET",nr="COLON",of="COMMA",Rl="DOLLAR",on="DOT",Ll="EQUALS",lf="EXCLAMATION",ln="HYPHEN",Pl="PERCENT",Dl="PIPE",Fl="PLUS",$l="POUND",Bl="QUERY",af="QUOTE",uf="SEMI",an="SLASH",Rs="TILDE",Hl="UNDERSCORE",g0="EMOJI",zl="SYM";var y0=Object.freeze({__proto__:null,WORD:An,UWORD:ef,LOCALHOST:Ts,TLD:tf,UTLD:nf,SCHEME:Cl,SLASH_SCHEME:Oi,NUM:rf,WS:m0,NL:sf,OPENBRACE:Ti,OPENBRACKET:Ms,OPENANGLEBRACKET:Is,OPENPAREN:Ns,CLOSEBRACE:Pr,CLOSEBRACKET:Mi,CLOSEANGLEBRACKET:Ii,CLOSEPAREN:Dr,AMPERSAND:Al,APOSTROPHE:Ol,ASTERISK:Tl,AT:tr,BACKSLASH:Ml,BACKTICK:Il,CARET:Nl,COLON:nr,COMMA:of,DOLLAR:Rl,DOT:on,EQUALS:Ll,EXCLAMATION:lf,HYPHEN:ln,PERCENT:Pl,PIPE:Dl,PLUS:Fl,POUND:$l,QUERY:Bl,QUOTE:af,SEMI:uf,SLASH:an,TILDE:Rs,UNDERSCORE:Hl,EMOJI:g0,SYM:zl});const Ni=/[a-z]/,cf=/\p{L}/u,ff=/\p{Emoji}/u,hf=/\d/,b0=/\s/,_0=`
39
+ `,sM="\uFE0F",oM="\u200D";let Vl=null,Wl=null;function lM(n){n===void 0&&(n=[]);const e={};pt.groups=e;const t=new pt;Vl==null&&(Vl=v0(QT)),Wl==null&&(Wl=v0(eM)),D(t,"'",Ol),D(t,"{",Ti),D(t,"[",Ms),D(t,"<",Is),D(t,"(",Ns),D(t,"}",Pr),D(t,"]",Mi),D(t,">",Ii),D(t,")",Dr),D(t,"&",Al),D(t,"*",Tl),D(t,"@",tr),D(t,"`",Il),D(t,"^",Nl),D(t,":",nr),D(t,",",of),D(t,"$",Rl),D(t,".",on),D(t,"=",Ll),D(t,"!",lf),D(t,"-",ln),D(t,"%",Pl),D(t,"|",Dl),D(t,"+",Fl),D(t,"#",$l),D(t,"?",Bl),D(t,'"',af),D(t,"/",an),D(t,";",uf),D(t,"~",Rs),D(t,"_",Hl),D(t,"\\",Ml);const r=Pt(t,hf,rf,{[Yc]:!0});Pt(r,hf,r);const i=Pt(t,Ni,An,{[Xc]:!0});Pt(i,Ni,i);const o=Pt(t,cf,ef,{[Zc]:!0});Pt(o,Ni),Pt(o,cf,o);const a=Pt(t,b0,m0,{[d0]:!0});D(t,_0,sf,{[d0]:!0}),D(a,_0),Pt(a,b0,a);const u=Pt(t,ff,g0,{[h0]:!0});Pt(u,ff,u),D(u,sM,u);const f=D(u,oM);Pt(f,ff,u);const d=[[Ni,i]],p=[[Ni,null],[cf,o]];for(let m=0;m<Vl.length;m++)rr(t,Vl[m],tf,An,d);for(let m=0;m<Wl.length;m++)rr(t,Wl[m],nf,ef,p);Lr(tf,{tld:!0,ascii:!0},e),Lr(nf,{utld:!0,alpha:!0},e),rr(t,"file",Cl,An,d),rr(t,"mailto",Cl,An,d),rr(t,"http",Oi,An,d),rr(t,"https",Oi,An,d),rr(t,"ftp",Oi,An,d),rr(t,"ftps",Oi,An,d),Lr(Cl,{scheme:!0,ascii:!0},e),Lr(Oi,{slashscheme:!0,ascii:!0},e),n=n.sort((m,y)=>m[0]>y[0]?1:-1);for(let m=0;m<n.length;m++){const y=n[m][0],S=n[m][1]?{[tM]:!0}:{[nM]:!0};y.indexOf("-")>=0?S[Qc]=!0:Ni.test(y)?hf.test(y)?S[El]=!0:S[Xc]=!0:S[Yc]=!0,p0(t,y,y,S)}return p0(t,"localhost",Ts,{ascii:!0}),t.jd=new pt(zl),{start:t,tokens:Ai({groups:e},y0)}}function aM(n,e){const t=uM(e.replace(/[A-Z]/g,u=>u.toLowerCase())),r=t.length,i=[];let o=0,a=0;for(;a<r;){let u=n,f=null,d=0,p=null,m=-1,y=-1;for(;a<r&&(f=u.go(t[a]));)u=f,u.accepts()?(m=0,y=0,p=u):m>=0&&(m+=t[a].length,y++),d+=t[a].length,o+=t[a].length,a++;o-=m,a-=y,d-=m,i.push({t:p.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function uM(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),o,a=i<55296||i>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(a),r+=a.length}return e}function rr(n,e,t,r,i){let o;const a=e.length;for(let u=0;u<a-1;u++){const f=e[u];n.j[f]?o=n.j[f]:(o=new pt(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new pt(t),o.jr=i.slice(),n.j[e[a-1]]=o,o}function v0(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let o=0;for(;i.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let a=parseInt(n.substring(r,r+o),10);a>0;a--)t.pop();r+=o}else t.push(n[r]),r++}return e}const Ls={defaultProtocol:"http",events:null,format:w0,formatHref:w0,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function df(n,e){e===void 0&&(e=null);let t=Ai({},Ls);n&&(t=Ai(t,n instanceof df?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}df.prototype={o:Ls,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:Ls[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function w0(n){return n}function S0(n,e){this.t="token",this.v=n,this.tk=e}S0.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"\u2026":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n){return n===void 0&&(n=Ls.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),a={},u=n.get("className",t,e),f=n.get("target",t,e),d=n.get("rel",t,e),p=n.getObj("attributes",t,e),m=n.getObj("events",t,e);return a.href=r,u&&(a.class=u),f&&(a.target=f),d&&(a.rel=d),p&&Ai(a,p),{tagName:i,attributes:a,content:o,eventListeners:m}}};function Ul(n,e){class t extends S0{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const x0=Ul("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),E0=Ul("text"),cM=Ul("nl"),Fr=Ul("url",{isLink:!0,toHref(n){return n===void 0&&(n=Ls.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Ts&&n[1].t===nr}}),Be=n=>new pt(n);function fM(n){let{groups:e}=n;const t=e.domain.concat([Al,Tl,tr,Ml,Il,Nl,Rl,Ll,ln,rf,Pl,Dl,Fl,$l,an,zl,Rs,Hl]),r=[Ol,Ii,Pr,Mi,Dr,nr,of,on,lf,Is,Ti,Ms,Ns,Bl,af,uf],i=[Al,Ol,Tl,Ml,Il,Nl,Pr,Rl,Ll,ln,Ti,Pl,Dl,Fl,$l,Bl,an,zl,Rs,Hl],o=Be(),a=D(o,Rs);U(a,i,a),U(a,e.domain,a);const u=Be(),f=Be(),d=Be();U(o,e.domain,u),U(o,e.scheme,f),U(o,e.slashscheme,d),U(u,i,a),U(u,e.domain,u);const p=D(u,tr);D(a,tr,p),D(f,tr,p),D(d,tr,p);const m=D(a,on);U(m,i,a),U(m,e.domain,a);const y=Be();U(p,e.domain,y),U(y,e.domain,y);const v=D(y,on);U(v,e.domain,y);const S=Be(x0);U(v,e.tld,S),U(v,e.utld,S),D(p,Ts,S);const C=D(y,ln);U(C,e.domain,y),U(S,e.domain,y),D(S,on,v),D(S,ln,C);const O=D(S,nr);U(O,e.numeric,x0);const N=D(u,ln),q=D(u,on);U(N,e.domain,u),U(q,i,a),U(q,e.domain,u);const K=Be(Fr);U(q,e.tld,K),U(q,e.utld,K),U(K,e.domain,u),U(K,i,a),D(K,on,q),D(K,ln,N),D(K,tr,p);const oe=D(K,nr),pe=Be(Fr);U(oe,e.numeric,pe);const $=Be(Fr),ue=Be();U($,t,$),U($,r,ue),U(ue,t,$),U(ue,r,ue),D(K,an,$),D(pe,an,$);const at=D(f,nr),Bi=D(d,nr),Xl=D(Bi,an),Hi=D(Xl,an);U(f,e.domain,u),D(f,on,q),D(f,ln,N),U(d,e.domain,u),D(d,on,q),D(d,ln,N),U(at,e.domain,$),D(at,an,$),U(Hi,e.domain,$),U(Hi,t,$),D(Hi,an,$);const ar=D($,Ti),Ur=D($,Ms),ur=D($,Is),Kr=D($,Ns);D(ue,Ti,ar),D(ue,Ms,Ur),D(ue,Is,ur),D(ue,Ns,Kr),D(ar,Pr,$),D(Ur,Mi,$),D(ur,Ii,$),D(Kr,Dr,$),D(ar,Pr,$);const Tn=Be(Fr),Qe=Be(Fr),je=Be(Fr),pn=Be(Fr);U(ar,t,Tn),U(Ur,t,Qe),U(ur,t,je),U(Kr,t,pn);const Zt=Be(),et=Be(),qr=Be(),Gr=Be();return U(ar,r),U(Ur,r),U(ur,r),U(Kr,r),U(Tn,t,Tn),U(Qe,t,Qe),U(je,t,je),U(pn,t,pn),U(Tn,r,Tn),U(Qe,r,Qe),U(je,r,je),U(pn,r,pn),U(Zt,t,Zt),U(et,t,Qe),U(qr,t,je),U(Gr,t,pn),U(Zt,r,Zt),U(et,r,et),U(qr,r,qr),U(Gr,r,Gr),D(Qe,Mi,$),D(je,Ii,$),D(pn,Dr,$),D(Tn,Pr,$),D(et,Mi,$),D(qr,Ii,$),D(Gr,Dr,$),D(Zt,Dr,$),D(o,Ts,K),D(o,sf,cM),{start:o,tokens:y0}}function hM(n,e,t){let r=t.length,i=0,o=[],a=[];for(;i<r;){let u=n,f=null,d=null,p=0,m=null,y=-1;for(;i<r&&!(f=u.go(t[i].t));)a.push(t[i++]);for(;i<r&&(d=f||u.go(t[i].t));)f=null,u=d,u.accepts()?(y=0,m=u):y>=0&&y++,i++,p++;if(y<0)i-=p,i<r&&(a.push(t[i]),i++);else{a.length>0&&(o.push(pf(E0,e,a)),a=[]),i-=y,p-=y;const v=m.t,S=t.slice(i-p,i);o.push(pf(v,e,S))}}return a.length>0&&o.push(pf(E0,e,a)),o}function pf(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const dM=typeof console<"u"&&console&&console.warn||(()=>{}),pM="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ke={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function mM(){pt.groups={},ke.scanner=null,ke.parser=null,ke.tokenQueue=[],ke.pluginQueue=[],ke.customSchemes=[],ke.initialized=!1}function k0(n,e){if(e===void 0&&(e=!1),ke.initialized&&dM(`linkifyjs: already initialized - will not register custom scheme "${n}" ${pM}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
40
+ 1. Must only contain digits, lowercase ASCII letters or "-"
41
+ 2. Cannot start or end with "-"
42
+ 3. "-" cannot repeat`);ke.customSchemes.push([n,e])}function gM(){ke.scanner=lM(ke.customSchemes);for(let n=0;n<ke.tokenQueue.length;n++)ke.tokenQueue[n][1]({scanner:ke.scanner});ke.parser=fM(ke.scanner.tokens);for(let n=0;n<ke.pluginQueue.length;n++)ke.pluginQueue[n][1]({scanner:ke.scanner,parser:ke.parser});ke.initialized=!0}function C0(n){return ke.initialized||gM(),hM(ke.parser.start,n,aM(ke.scanner.start,n))}function mf(n,e,t){if(e===void 0&&(e=null),t===void 0&&(t=null),e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new df(t),i=C0(n),o=[];for(let a=0;a<i.length;a++){const u=i[a];u.isLink&&(!e||u.t===e)&&o.push(u.toFormattedObject(r))}return o}function yM(n,e){e===void 0&&(e=null);const t=C0(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class bM extends Jc{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(e,t,r){if(e.state.selection.empty)return!1;const i=r.content.textBetween(0,r.content.size).trim(),o=yM(i);if(!i||!o)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return Mf.query(t,{typeName:ee.TEXT,mark:{typeName:ce.LINK},getMark:{typeName:ce.LINK}})?.attrs||{href:e}}}function P(n){return(...e)=>t=>n(t,...e)}function Kl(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const o=r.replace(/_/g,"-");return`${t}--zw-${o}:${i};`},"");return e?{style:e}:null}function $r(n){const e=Kl(n);return["span",e?{...e,class:"zw-style"}:{},0]}function _M(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Dt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var vM=Object.defineProperty,wM=(n,e,t)=>e in n?vM(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ps=(n,e,t)=>(wM(n,typeof e!="symbol"?e+"":e,t),t);const A0=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}),SM=n=>n in A0,xM="[-\\+]?\\d+%?",EM="[-\\+]?\\d*\\.\\d+%?",ir=`(?:${EM})|(?:${xM})`,gf=`[\\s|\\(]+(${ir})[,|\\s]+(${ir})[,|\\s]+(${ir})\\s*\\)?`,yf=`[\\s|\\(]+(${ir})[,|\\s]+(${ir})[,|\\s]+(${ir})[,|\\s]+(${ir})\\s*\\)?`,un=Object.freeze({CSS_UNIT:new RegExp(ir),RGB:new RegExp(`rgb${gf}`),RGBA:new RegExp(`rgba${yf}`),HSL:new RegExp(`hsl${gf}`),HSLA:new RegExp(`hsla${yf}`),HSV:new RegExp(`hsv${gf}`),HSVA:new RegExp(`hsva${yf}`),HEX3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,HEX4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}),bf=Object.freeze({WINDOW:Symbol("window")});function _f(n,e=0,t=1){return Math.max(e,Math.min(t,n))}function O0(n,e){let t=!1;return function(){t||(n.apply(this,arguments),t=!0,setTimeout(function(){t=!1},e))}}function Br(n){return n>1||n<-1?n/100:n}const Hr=8,kM="#fff",CM="#e6e6e6";function AM(){const n=document.createElement("canvas");n.width=n.height=Hr*2;const e=n.getContext("2d");return e?(e.fillStyle=kM,e.fillRect(0,0,n.width,n.height),e.fillStyle=CM,e.fillRect(0,0,Hr,Hr),e.translate(Hr,Hr),e.fillRect(0,0,Hr,Hr),n.toDataURL()):null}const T0=3;function Ri(n){return Number.parseFloat(n.toFixed(T0+2).substr(0,T0+2))}function OM(n,e=1){const t=[];let r=0;for(;r<n.length;)t.push(n.substr(r,e)),r+=e;return t}function M0(n){const e=OM(n.slice(1),2).map(r=>parseInt(r,16)),t=e[3]!==void 0?Math.round(e[3]/255*100)/100:1;return{r:e[0],g:e[1],b:e[2],a:t}}function I0({h:n,s:e,v:t,a:r}){const i=a=>{const u=(a+n/60)%6;return t-t*e*Math.max(Math.min(u,4-u,1),0)},o=[i(5),i(3),i(1)].map(a=>Math.round(a*255));return{r:o[0],g:o[1],b:o[2],a:r}}function TM({h:n,s:e,l:t,a:r}){const i=t+e*Math.min(t,1-t),o=i===0?0:2-2*t/i,a=Ri(o),u=Ri(i);return{h:n,s:a,v:u,a:r}}function MM(n){const e=r=>{const i=Math.round(r).toString(16);return("00".substr(0,2-i.length)+i).toUpperCase()};return`#${[e(n.r),e(n.g),e(n.b)].join("")}`}function N0(n){if(!n)return{h:0,s:1,v:1,a:1};const e=n.r/255,t=n.g/255,r=n.b/255,i=Math.max(e,t,r),o=Math.min(e,t,r);let a=0;i!==o&&(i===e?a=60*(0+(t-r)/(i-o)):i===t?a=60*(2+(r-e)/(i-o)):i===r&&(a=60*(4+(e-t)/(i-o)))),a<0&&(a=a+360);const u=i===0?0:(i-o)/i,f=[a,u,i],d=Ri(f[1]),p=Ri(f[2]);return{h:Math.floor(f[0]),s:d,v:p,a:n.a}}function IM(n){return N0(M0(n))}function NM({h:n,s:e,v:t,a:r}){const i=t-t*e/2,o=i===1||i===0?0:(t-i)/Math.min(i,1-i),a=Ri(o),u=Ri(i);return{h:n,s:a,l:u,a:r}}function RM(n){const e=IM(n),t=NM(e),r=M0(n);return{alpha:e.a,hex:n.substr(0,7),hexa:n,hsla:t,hsva:e,hue:e.h,rgba:r}}function vf(n,e,t="0"){return n+t.repeat(Math.max(0,e-n.length))}function LM(n){let e=n;return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),(e.length===3||e.length===4)&&(e=e.split("").map(t=>t+t).join("")),e.length===6?e=vf(e,8,"F"):e=vf(vf(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}function PM(n){return RM(LM(n))}const wf=class qe{constructor(e){Ps(this,"rgba"),Ps(this,"hsva"),Ps(this,"alpha"),this.rgba=e,this.hsva=this.calcHsva(),this.alpha=e.a}static create(e){if(!e)return qe.fromBlack();let t=e.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(SM(t))t=A0[t];else if(t===this.TRANSPARENT)return qe.fromTransparent();const r=un.RGB.exec(t)||un.RGBA.exec(t);if(r){const u=r[4]===void 0?1:r[4];return qe.fromRgba({r:Number.parseInt(r[1]),g:Number.parseInt(r[2]),b:Number.parseInt(r[3]),a:Number.parseFloat(u.toString())})}const i=un.HSL.exec(t)||un.HSLA.exec(t);if(i){const u=i[4]===void 0?1:i[4];return qe.fromHsla({h:Number.parseInt(i[1]),s:Number.parseFloat(i[2]),l:Number.parseFloat(i[3]),a:Number.parseFloat(u.toString())})}const o=un.HSV.exec(t)||un.HSVA.exec(t);if(o){const u=o[4]===void 0?1:o[4];return qe.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(u.toString())})}return un.HEX8.exec(t)||un.HEX6.exec(t)||un.HEX4.exec(t)||un.HEX3.exec(t)?qe.fromHex(t):qe.fromBlack()}static fromHex(e){const{rgba:t}=PM(e);return new qe(t)}static fromRgba({r:e,g:t,b:r,a:i}){const o=Br(i);return new qe({r:e,g:t,b:r,a:o})}static fromHsla({h:e,s:t,l:r,a:i}){const o=Br(t),a=Br(r),u=Br(i);return qe.fromHsva(TM({h:e,s:o,l:a,a:u}))}static fromHsva({h:e,s:t,v:r,a:i}){const o=Br(t),a=Br(r),u=Br(i),f=I0({h:e,s:o,v:a,a:u});return new qe(f)}static fromTransparent(){return new qe({r:0,g:0,b:0,a:0})}static fromWhite(){return new qe({r:255,g:255,b:255,a:1})}static fromBlack(){return new qe({r:0,g:0,b:0,a:1})}static isTransparent(e){return qe.create(e).isTransparent()}static isDark(e){return qe.create(e).isDark()}get hex(){return this.toHexString()}get r(){return this.rgba.r}get b(){return this.rgba.b}get g(){return this.rgba.g}get h(){return this.hsva.h}get s(){return this.hsva.s}get v(){return this.hsva.v}setAlpha(e){return this.alpha=e,this}toHexString(){return MM({r:this.r,g:this.g,b:this.b})}toRgbaString(){const e=`${Math.floor(this.alpha*100)}%`;return`rgba(${[this.r,this.g,this.b,e].join(", ")})`}updateRgb(e){this.rgba={...this.rgba,...e},this.hsva=this.calcHsva()}updateHsv(e){this.hsva={...this.hsva,...e},this.rgba=this.calcRgba()}isTransparent(){return this.alpha===0}isDark(){return this.getBrightness()<128}getBrightness(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3}calcHsva(){return N0(this.rgba)}calcRgba(){return I0(this.hsva)}};Ps(wf,"TRANSPARENT","transparent"),Ps(wf,"NONE","none");let DM=wf;bf.WINDOW;const R0=3,FM=n=>Number.parseFloat(n.toFixed(R0+2).substr(0,R0+2));bf.WINDOW,bf.WINDOW,O0((n,e)=>{n(e)},20);function L0(n){const e=DM.create(n);return e.alpha===1?e.toHexString():e.toRgbaString()}function P0(n,e){if(!n.includes("em"))return parseInt(n);const t=Li.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function $M(n,e){return(n.firstElementChild||n).style.fontSize||Li.getComputedStyle(e).fontSize}function BM(n,e,t){if(!n.includes("px"))return n;const r=$M(e,t),i=P0(r,t);return i?(parseInt(n)/i).toFixed(2):null}const HM={start:er.LEFT,end:er.RIGHT};function zM(n){const e=HM[n]||n;return er.values.includes(e)?e:null}const D0=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function F0(n,e){return n.resolve(e).depth+1}function VM(n,e,t,r){const i=F0(n,r),o=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return o&&a}const WM=(n,e)=>n.eq(e);function UM(n,e,t,r=WM){const i=n.resolve(e).path.reverse();for(const o of i)if(typeof o!="number"){for(const a of o.marks)if(r(a,t))return!0}return!1}function KM(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var ql={exports:{}};ql.exports,function(n,e){(function(){var t,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",d=500,p="__lodash_placeholder__",m=1,y=2,v=4,S=1,C=2,O=1,N=2,q=4,K=8,oe=16,pe=32,$=64,ue=128,at=256,Bi=512,Xl=30,Hi="...",ar=800,Ur=16,ur=1,Kr=2,Tn=3,Qe=1/0,je=9007199254740991,pn=17976931348623157e292,Zt=NaN,et=4294967295,qr=et-1,Gr=et>>>1,j0=[["ary",ue],["bind",O],["bindKey",N],["curry",K],["curryRight",oe],["flip",Bi],["partial",pe],["partialRight",$],["rearg",at]],jr="[object Arguments]",$s="[object Array]",J0="[object AsyncFunction]",zi="[object Boolean]",Vi="[object Date]",Y0="[object DOMException]",Bs="[object Error]",Hs="[object Function]",If="[object GeneratorFunction]",$t="[object Map]",Wi="[object Number]",X0="[object Null]",mn="[object Object]",Nf="[object Promise]",Z0="[object Proxy]",Ui="[object RegExp]",Bt="[object Set]",Ki="[object String]",zs="[object Symbol]",Q0="[object Undefined]",qi="[object WeakMap]",ey="[object WeakSet]",Gi="[object ArrayBuffer]",Jr="[object DataView]",Zl="[object Float32Array]",Ql="[object Float64Array]",ea="[object Int8Array]",ta="[object Int16Array]",na="[object Int32Array]",ra="[object Uint8Array]",ia="[object Uint8ClampedArray]",sa="[object Uint16Array]",oa="[object Uint32Array]",ty=/\b__p \+= '';/g,ny=/\b(__p \+=) '' \+/g,ry=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Rf=/&(?:amp|lt|gt|quot|#39);/g,Lf=/[&<>"']/g,iy=RegExp(Rf.source),sy=RegExp(Lf.source),oy=/<%-([\s\S]+?)%>/g,ly=/<%([\s\S]+?)%>/g,Pf=/<%=([\s\S]+?)%>/g,ay=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uy=/^\w*$/,cy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,la=/[\\^$.*+?()[\]{}|]/g,fy=RegExp(la.source),aa=/^\s+/,hy=/\s/,dy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,py=/\{\n\/\* \[wrapped with (.+)\] \*/,my=/,? & /,gy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yy=/[()=,{}\[\]\/\s]/,by=/\\(\\)?/g,_y=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Df=/\w*$/,vy=/^[-+]0x[0-9a-f]+$/i,wy=/^0b[01]+$/i,Sy=/^\[object .+?Constructor\]$/,xy=/^0o[0-7]+$/i,Ey=/^(?:0|[1-9]\d*)$/,ky=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vs=/($^)/,Cy=/['\n\r\u2028\u2029\\]/g,Ws="\\ud800-\\udfff",Ay="\\u0300-\\u036f",Oy="\\ufe20-\\ufe2f",Ty="\\u20d0-\\u20ff",Ff=Ay+Oy+Ty,$f="\\u2700-\\u27bf",Bf="a-z\\xdf-\\xf6\\xf8-\\xff",My="\\xac\\xb1\\xd7\\xf7",Iy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ny="\\u2000-\\u206f",Ry=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Hf="A-Z\\xc0-\\xd6\\xd8-\\xde",zf="\\ufe0e\\ufe0f",Vf=My+Iy+Ny+Ry,ua="['\u2019]",Ly="["+Ws+"]",Wf="["+Vf+"]",Us="["+Ff+"]",Uf="\\d+",Py="["+$f+"]",Kf="["+Bf+"]",qf="[^"+Ws+Vf+Uf+$f+Bf+Hf+"]",ca="\\ud83c[\\udffb-\\udfff]",Dy="(?:"+Us+"|"+ca+")",Gf="[^"+Ws+"]",fa="(?:\\ud83c[\\udde6-\\uddff]){2}",ha="[\\ud800-\\udbff][\\udc00-\\udfff]",Yr="["+Hf+"]",jf="\\u200d",Jf="(?:"+Kf+"|"+qf+")",Fy="(?:"+Yr+"|"+qf+")",Yf="(?:"+ua+"(?:d|ll|m|re|s|t|ve))?",Xf="(?:"+ua+"(?:D|LL|M|RE|S|T|VE))?",Zf=Dy+"?",Qf="["+zf+"]?",$y="(?:"+jf+"(?:"+[Gf,fa,ha].join("|")+")"+Qf+Zf+")*",By="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",eh=Qf+Zf+$y,zy="(?:"+[Py,fa,ha].join("|")+")"+eh,Vy="(?:"+[Gf+Us+"?",Us,fa,ha,Ly].join("|")+")",Wy=RegExp(ua,"g"),Uy=RegExp(Us,"g"),da=RegExp(ca+"(?="+ca+")|"+Vy+eh,"g"),Ky=RegExp([Yr+"?"+Kf+"+"+Yf+"(?="+[Wf,Yr,"$"].join("|")+")",Fy+"+"+Xf+"(?="+[Wf,Yr+Jf,"$"].join("|")+")",Yr+"?"+Jf+"+"+Yf,Yr+"+"+Xf,Hy,By,Uf,zy].join("|"),"g"),qy=RegExp("["+jf+Ws+Ff+zf+"]"),Gy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,jy=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Jy=-1,ve={};ve[Zl]=ve[Ql]=ve[ea]=ve[ta]=ve[na]=ve[ra]=ve[ia]=ve[sa]=ve[oa]=!0,ve[jr]=ve[$s]=ve[Gi]=ve[zi]=ve[Jr]=ve[Vi]=ve[Bs]=ve[Hs]=ve[$t]=ve[Wi]=ve[mn]=ve[Ui]=ve[Bt]=ve[Ki]=ve[qi]=!1;var _e={};_e[jr]=_e[$s]=_e[Gi]=_e[Jr]=_e[zi]=_e[Vi]=_e[Zl]=_e[Ql]=_e[ea]=_e[ta]=_e[na]=_e[$t]=_e[Wi]=_e[mn]=_e[Ui]=_e[Bt]=_e[Ki]=_e[zs]=_e[ra]=_e[ia]=_e[sa]=_e[oa]=!0,_e[Bs]=_e[Hs]=_e[qi]=!1;var Yy={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Xy={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zy={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Qy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},e1=parseFloat,t1=parseInt,th=typeof cs=="object"&&cs&&cs.Object===Object&&cs,n1=typeof self=="object"&&self&&self.Object===Object&&self,Ve=th||n1||Function("return this")(),pa=e&&!e.nodeType&&e,cr=pa&&!0&&n&&!n.nodeType&&n,nh=cr&&cr.exports===pa,ma=nh&&th.process,Et=function(){try{var E=cr&&cr.require&&cr.require("util").types;return E||ma&&ma.binding&&ma.binding("util")}catch{}}(),rh=Et&&Et.isArrayBuffer,ih=Et&&Et.isDate,sh=Et&&Et.isMap,oh=Et&&Et.isRegExp,lh=Et&&Et.isSet,ah=Et&&Et.isTypedArray;function mt(E,T,A){switch(A.length){case 0:return E.call(T);case 1:return E.call(T,A[0]);case 2:return E.call(T,A[0],A[1]);case 3:return E.call(T,A[0],A[1],A[2])}return E.apply(T,A)}function r1(E,T,A,H){for(var X=-1,me=E==null?0:E.length;++X<me;){var Pe=E[X];T(H,Pe,A(Pe),E)}return H}function kt(E,T){for(var A=-1,H=E==null?0:E.length;++A<H&&T(E[A],A,E)!==!1;);return E}function i1(E,T){for(var A=E==null?0:E.length;A--&&T(E[A],A,E)!==!1;);return E}function uh(E,T){for(var A=-1,H=E==null?0:E.length;++A<H;)if(!T(E[A],A,E))return!1;return!0}function Mn(E,T){for(var A=-1,H=E==null?0:E.length,X=0,me=[];++A<H;){var Pe=E[A];T(Pe,A,E)&&(me[X++]=Pe)}return me}function Ks(E,T){var A=E==null?0:E.length;return!!A&&Xr(E,T,0)>-1}function ga(E,T,A){for(var H=-1,X=E==null?0:E.length;++H<X;)if(A(T,E[H]))return!0;return!1}function Se(E,T){for(var A=-1,H=E==null?0:E.length,X=Array(H);++A<H;)X[A]=T(E[A],A,E);return X}function In(E,T){for(var A=-1,H=T.length,X=E.length;++A<H;)E[X+A]=T[A];return E}function ya(E,T,A,H){var X=-1,me=E==null?0:E.length;for(H&&me&&(A=E[++X]);++X<me;)A=T(A,E[X],X,E);return A}function s1(E,T,A,H){var X=E==null?0:E.length;for(H&&X&&(A=E[--X]);X--;)A=T(A,E[X],X,E);return A}function ba(E,T){for(var A=-1,H=E==null?0:E.length;++A<H;)if(T(E[A],A,E))return!0;return!1}var o1=_a("length");function l1(E){return E.split("")}function a1(E){return E.match(gy)||[]}function ch(E,T,A){var H;return A(E,function(X,me,Pe){if(T(X,me,Pe))return H=me,!1}),H}function qs(E,T,A,H){for(var X=E.length,me=A+(H?1:-1);H?me--:++me<X;)if(T(E[me],me,E))return me;return-1}function Xr(E,T,A){return T===T?v1(E,T,A):qs(E,fh,A)}function u1(E,T,A,H){for(var X=A-1,me=E.length;++X<me;)if(H(E[X],T))return X;return-1}function fh(E){return E!==E}function hh(E,T){var A=E==null?0:E.length;return A?wa(E,T)/A:Zt}function _a(E){return function(T){return T==null?t:T[E]}}function va(E){return function(T){return E==null?t:E[T]}}function dh(E,T,A,H,X){return X(E,function(me,Pe,be){A=H?(H=!1,me):T(A,me,Pe,be)}),A}function c1(E,T){var A=E.length;for(E.sort(T);A--;)E[A]=E[A].value;return E}function wa(E,T){for(var A,H=-1,X=E.length;++H<X;){var me=T(E[H]);me!==t&&(A=A===t?me:A+me)}return A}function Sa(E,T){for(var A=-1,H=Array(E);++A<E;)H[A]=T(A);return H}function f1(E,T){return Se(T,function(A){return[A,E[A]]})}function ph(E){return E&&E.slice(0,bh(E)+1).replace(aa,"")}function gt(E){return function(T){return E(T)}}function xa(E,T){return Se(T,function(A){return E[A]})}function ji(E,T){return E.has(T)}function mh(E,T){for(var A=-1,H=E.length;++A<H&&Xr(T,E[A],0)>-1;);return A}function gh(E,T){for(var A=E.length;A--&&Xr(T,E[A],0)>-1;);return A}function h1(E,T){for(var A=E.length,H=0;A--;)E[A]===T&&++H;return H}var d1=va(Yy),p1=va(Xy);function m1(E){return"\\"+Qy[E]}function g1(E,T){return E==null?t:E[T]}function Zr(E){return qy.test(E)}function y1(E){return Gy.test(E)}function b1(E){for(var T,A=[];!(T=E.next()).done;)A.push(T.value);return A}function Ea(E){var T=-1,A=Array(E.size);return E.forEach(function(H,X){A[++T]=[X,H]}),A}function yh(E,T){return function(A){return E(T(A))}}function Nn(E,T){for(var A=-1,H=E.length,X=0,me=[];++A<H;){var Pe=E[A];(Pe===T||Pe===p)&&(E[A]=p,me[X++]=A)}return me}function Gs(E){var T=-1,A=Array(E.size);return E.forEach(function(H){A[++T]=H}),A}function _1(E){var T=-1,A=Array(E.size);return E.forEach(function(H){A[++T]=[H,H]}),A}function v1(E,T,A){for(var H=A-1,X=E.length;++H<X;)if(E[H]===T)return H;return-1}function w1(E,T,A){for(var H=A+1;H--;)if(E[H]===T)return H;return H}function Qr(E){return Zr(E)?x1(E):o1(E)}function Ht(E){return Zr(E)?E1(E):l1(E)}function bh(E){for(var T=E.length;T--&&hy.test(E.charAt(T)););return T}var S1=va(Zy);function x1(E){for(var T=da.lastIndex=0;da.test(E);)++T;return T}function E1(E){return E.match(da)||[]}function k1(E){return E.match(Ky)||[]}var C1=function E(T){T=T==null?Ve:ei.defaults(Ve.Object(),T,ei.pick(Ve,jy));var A=T.Array,H=T.Date,X=T.Error,me=T.Function,Pe=T.Math,be=T.Object,ka=T.RegExp,A1=T.String,Ct=T.TypeError,js=A.prototype,O1=me.prototype,ti=be.prototype,Js=T["__core-js_shared__"],Ys=O1.toString,ye=ti.hasOwnProperty,T1=0,_h=function(){var s=/[^.]+$/.exec(Js&&Js.keys&&Js.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Xs=ti.toString,M1=Ys.call(be),I1=Ve._,N1=ka("^"+Ys.call(ye).replace(la,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zs=nh?T.Buffer:t,Rn=T.Symbol,Qs=T.Uint8Array,vh=Zs?Zs.allocUnsafe:t,eo=yh(be.getPrototypeOf,be),wh=be.create,Sh=ti.propertyIsEnumerable,to=js.splice,xh=Rn?Rn.isConcatSpreadable:t,Ji=Rn?Rn.iterator:t,fr=Rn?Rn.toStringTag:t,no=function(){try{var s=gr(be,"defineProperty");return s({},"",{}),s}catch{}}(),R1=T.clearTimeout!==Ve.clearTimeout&&T.clearTimeout,L1=H&&H.now!==Ve.Date.now&&H.now,P1=T.setTimeout!==Ve.setTimeout&&T.setTimeout,ro=Pe.ceil,io=Pe.floor,Ca=be.getOwnPropertySymbols,D1=Zs?Zs.isBuffer:t,Eh=T.isFinite,F1=js.join,$1=yh(be.keys,be),De=Pe.max,Je=Pe.min,B1=H.now,H1=T.parseInt,kh=Pe.random,z1=js.reverse,Aa=gr(T,"DataView"),Yi=gr(T,"Map"),Oa=gr(T,"Promise"),ni=gr(T,"Set"),Xi=gr(T,"WeakMap"),Zi=gr(be,"create"),so=Xi&&new Xi,ri={},V1=yr(Aa),W1=yr(Yi),U1=yr(Oa),K1=yr(ni),q1=yr(Xi),oo=Rn?Rn.prototype:t,Qi=oo?oo.valueOf:t,Ch=oo?oo.toString:t;function b(s){if(Ce(s)&&!Z(s)&&!(s instanceof le)){if(s instanceof At)return s;if(ye.call(s,"__wrapped__"))return Ad(s)}return new At(s)}var ii=function(){function s(){}return function(l){if(!Ee(l))return{};if(wh)return wh(l);s.prototype=l;var c=new s;return s.prototype=t,c}}();function lo(){}function At(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}b.templateSettings={escape:oy,evaluate:ly,interpolate:Pf,variable:"",imports:{_:b}},b.prototype=lo.prototype,b.prototype.constructor=b,At.prototype=ii(lo.prototype),At.prototype.constructor=At;function le(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=et,this.__views__=[]}function G1(){var s=new le(this.__wrapped__);return s.__actions__=ut(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ut(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ut(this.__views__),s}function j1(){if(this.__filtered__){var s=new le(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function J1(){var s=this.__wrapped__.value(),l=this.__dir__,c=Z(s),h=l<0,g=c?s.length:0,_=l_(0,g,this.__views__),w=_.start,x=_.end,k=x-w,M=h?x:w-1,I=this.__iteratees__,R=I.length,B=0,W=Je(k,this.__takeCount__);if(!c||!h&&g==k&&W==k)return Yh(s,this.__actions__);var j=[];e:for(;k--&&B<W;){M+=l;for(var te=-1,J=s[M];++te<R;){var re=I[te],ae=re.iteratee,_t=re.type,rt=ae(J);if(_t==Kr)J=rt;else if(!rt){if(_t==ur)continue e;break e}}j[B++]=J}return j}le.prototype=ii(lo.prototype),le.prototype.constructor=le;function hr(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var h=s[l];this.set(h[0],h[1])}}function Y1(){this.__data__=Zi?Zi(null):{},this.size=0}function X1(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function Z1(s){var l=this.__data__;if(Zi){var c=l[s];return c===f?t:c}return ye.call(l,s)?l[s]:t}function Q1(s){var l=this.__data__;return Zi?l[s]!==t:ye.call(l,s)}function eb(s,l){var c=this.__data__;return this.size+=this.has(s)?0:1,c[s]=Zi&&l===t?f:l,this}hr.prototype.clear=Y1,hr.prototype.delete=X1,hr.prototype.get=Z1,hr.prototype.has=Q1,hr.prototype.set=eb;function gn(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var h=s[l];this.set(h[0],h[1])}}function tb(){this.__data__=[],this.size=0}function nb(s){var l=this.__data__,c=ao(l,s);if(c<0)return!1;var h=l.length-1;return c==h?l.pop():to.call(l,c,1),--this.size,!0}function rb(s){var l=this.__data__,c=ao(l,s);return c<0?t:l[c][1]}function ib(s){return ao(this.__data__,s)>-1}function sb(s,l){var c=this.__data__,h=ao(c,s);return h<0?(++this.size,c.push([s,l])):c[h][1]=l,this}gn.prototype.clear=tb,gn.prototype.delete=nb,gn.prototype.get=rb,gn.prototype.has=ib,gn.prototype.set=sb;function yn(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var h=s[l];this.set(h[0],h[1])}}function ob(){this.size=0,this.__data__={hash:new hr,map:new(Yi||gn),string:new hr}}function lb(s){var l=wo(this,s).delete(s);return this.size-=l?1:0,l}function ab(s){return wo(this,s).get(s)}function ub(s){return wo(this,s).has(s)}function cb(s,l){var c=wo(this,s),h=c.size;return c.set(s,l),this.size+=c.size==h?0:1,this}yn.prototype.clear=ob,yn.prototype.delete=lb,yn.prototype.get=ab,yn.prototype.has=ub,yn.prototype.set=cb;function dr(s){var l=-1,c=s==null?0:s.length;for(this.__data__=new yn;++l<c;)this.add(s[l])}function fb(s){return this.__data__.set(s,f),this}function hb(s){return this.__data__.has(s)}dr.prototype.add=dr.prototype.push=fb,dr.prototype.has=hb;function zt(s){var l=this.__data__=new gn(s);this.size=l.size}function db(){this.__data__=new gn,this.size=0}function pb(s){var l=this.__data__,c=l.delete(s);return this.size=l.size,c}function mb(s){return this.__data__.get(s)}function gb(s){return this.__data__.has(s)}function yb(s,l){var c=this.__data__;if(c instanceof gn){var h=c.__data__;if(!Yi||h.length<i-1)return h.push([s,l]),this.size=++c.size,this;c=this.__data__=new yn(h)}return c.set(s,l),this.size=c.size,this}zt.prototype.clear=db,zt.prototype.delete=pb,zt.prototype.get=mb,zt.prototype.has=gb,zt.prototype.set=yb;function Ah(s,l){var c=Z(s),h=!c&&br(s),g=!c&&!h&&$n(s),_=!c&&!h&&!g&&ai(s),w=c||h||g||_,x=w?Sa(s.length,A1):[],k=x.length;for(var M in s)(l||ye.call(s,M))&&!(w&&(M=="length"||g&&(M=="offset"||M=="parent")||_&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||wn(M,k)))&&x.push(M);return x}function Oh(s){var l=s.length;return l?s[Ba(0,l-1)]:t}function bb(s,l){return So(ut(s),pr(l,0,s.length))}function _b(s){return So(ut(s))}function Ta(s,l,c){(c!==t&&!Vt(s[l],c)||c===t&&!(l in s))&&bn(s,l,c)}function es(s,l,c){var h=s[l];(!(ye.call(s,l)&&Vt(h,c))||c===t&&!(l in s))&&bn(s,l,c)}function ao(s,l){for(var c=s.length;c--;)if(Vt(s[c][0],l))return c;return-1}function vb(s,l,c,h){return Ln(s,function(g,_,w){l(h,g,c(g),w)}),h}function Th(s,l){return s&&en(l,Fe(l),s)}function wb(s,l){return s&&en(l,ft(l),s)}function bn(s,l,c){l=="__proto__"&&no?no(s,l,{configurable:!0,enumerable:!0,value:c,writable:!0}):s[l]=c}function Ma(s,l){for(var c=-1,h=l.length,g=A(h),_=s==null;++c<h;)g[c]=_?t:cu(s,l[c]);return g}function pr(s,l,c){return s===s&&(c!==t&&(s=s<=c?s:c),l!==t&&(s=s>=l?s:l)),s}function Ot(s,l,c,h,g,_){var w,x=l&m,k=l&y,M=l&v;if(c&&(w=g?c(s,h,g,_):c(s)),w!==t)return w;if(!Ee(s))return s;var I=Z(s);if(I){if(w=u_(s),!x)return ut(s,w)}else{var R=Ye(s),B=R==Hs||R==If;if($n(s))return Qh(s,x);if(R==mn||R==jr||B&&!g){if(w=k||B?{}:bd(s),!x)return k?Zb(s,wb(w,s)):Xb(s,Th(w,s))}else{if(!_e[R])return g?s:{};w=c_(s,R,x)}}_||(_=new zt);var W=_.get(s);if(W)return W;_.set(s,w),Gd(s)?s.forEach(function(J){w.add(Ot(J,l,c,J,s,_))}):Kd(s)&&s.forEach(function(J,re){w.set(re,Ot(J,l,c,re,s,_))});var j=M?k?Ya:Ja:k?ft:Fe,te=I?t:j(s);return kt(te||s,function(J,re){te&&(re=J,J=s[re]),es(w,re,Ot(J,l,c,re,s,_))}),w}function Sb(s){var l=Fe(s);return function(c){return Mh(c,s,l)}}function Mh(s,l,c){var h=c.length;if(s==null)return!h;for(s=be(s);h--;){var g=c[h],_=l[g],w=s[g];if(w===t&&!(g in s)||!_(w))return!1}return!0}function Ih(s,l,c){if(typeof s!="function")throw new Ct(a);return as(function(){s.apply(t,c)},l)}function ts(s,l,c,h){var g=-1,_=Ks,w=!0,x=s.length,k=[],M=l.length;if(!x)return k;c&&(l=Se(l,gt(c))),h?(_=ga,w=!1):l.length>=i&&(_=ji,w=!1,l=new dr(l));e:for(;++g<x;){var I=s[g],R=c==null?I:c(I);if(I=h||I!==0?I:0,w&&R===R){for(var B=M;B--;)if(l[B]===R)continue e;k.push(I)}else _(l,R,h)||k.push(I)}return k}var Ln=id(Qt),Nh=id(Na,!0);function xb(s,l){var c=!0;return Ln(s,function(h,g,_){return c=!!l(h,g,_),c}),c}function uo(s,l,c){for(var h=-1,g=s.length;++h<g;){var _=s[h],w=l(_);if(w!=null&&(x===t?w===w&&!bt(w):c(w,x)))var x=w,k=_}return k}function Eb(s,l,c,h){var g=s.length;for(c=Q(c),c<0&&(c=-c>g?0:g+c),h=h===t||h>g?g:Q(h),h<0&&(h+=g),h=c>h?0:Jd(h);c<h;)s[c++]=l;return s}function Rh(s,l){var c=[];return Ln(s,function(h,g,_){l(h,g,_)&&c.push(h)}),c}function We(s,l,c,h,g){var _=-1,w=s.length;for(c||(c=h_),g||(g=[]);++_<w;){var x=s[_];l>0&&c(x)?l>1?We(x,l-1,c,h,g):In(g,x):h||(g[g.length]=x)}return g}var Ia=sd(),Lh=sd(!0);function Qt(s,l){return s&&Ia(s,l,Fe)}function Na(s,l){return s&&Lh(s,l,Fe)}function co(s,l){return Mn(l,function(c){return Sn(s[c])})}function mr(s,l){l=Dn(l,s);for(var c=0,h=l.length;s!=null&&c<h;)s=s[tn(l[c++])];return c&&c==h?s:t}function Ph(s,l,c){var h=l(s);return Z(s)?h:In(h,c(s))}function tt(s){return s==null?s===t?Q0:X0:fr&&fr in be(s)?o_(s):__(s)}function Ra(s,l){return s>l}function kb(s,l){return s!=null&&ye.call(s,l)}function Cb(s,l){return s!=null&&l in be(s)}function Ab(s,l,c){return s>=Je(l,c)&&s<De(l,c)}function La(s,l,c){for(var h=c?ga:Ks,g=s[0].length,_=s.length,w=_,x=A(_),k=1/0,M=[];w--;){var I=s[w];w&&l&&(I=Se(I,gt(l))),k=Je(I.length,k),x[w]=!c&&(l||g>=120&&I.length>=120)?new dr(w&&I):t}I=s[0];var R=-1,B=x[0];e:for(;++R<g&&M.length<k;){var W=I[R],j=l?l(W):W;if(W=c||W!==0?W:0,!(B?ji(B,j):h(M,j,c))){for(w=_;--w;){var te=x[w];if(!(te?ji(te,j):h(s[w],j,c)))continue e}B&&B.push(j),M.push(W)}}return M}function Ob(s,l,c,h){return Qt(s,function(g,_,w){l(h,c(g),_,w)}),h}function ns(s,l,c){l=Dn(l,s),s=Sd(s,l);var h=s==null?s:s[tn(Mt(l))];return h==null?t:mt(h,s,c)}function Dh(s){return Ce(s)&&tt(s)==jr}function Tb(s){return Ce(s)&&tt(s)==Gi}function Mb(s){return Ce(s)&&tt(s)==Vi}function rs(s,l,c,h,g){return s===l?!0:s==null||l==null||!Ce(s)&&!Ce(l)?s!==s&&l!==l:Ib(s,l,c,h,rs,g)}function Ib(s,l,c,h,g,_){var w=Z(s),x=Z(l),k=w?$s:Ye(s),M=x?$s:Ye(l);k=k==jr?mn:k,M=M==jr?mn:M;var I=k==mn,R=M==mn,B=k==M;if(B&&$n(s)){if(!$n(l))return!1;w=!0,I=!1}if(B&&!I)return _||(_=new zt),w||ai(s)?md(s,l,c,h,g,_):i_(s,l,k,c,h,g,_);if(!(c&S)){var W=I&&ye.call(s,"__wrapped__"),j=R&&ye.call(l,"__wrapped__");if(W||j){var te=W?s.value():s,J=j?l.value():l;return _||(_=new zt),g(te,J,c,h,_)}}return B?(_||(_=new zt),s_(s,l,c,h,g,_)):!1}function Nb(s){return Ce(s)&&Ye(s)==$t}function Pa(s,l,c,h){var g=c.length,_=g,w=!h;if(s==null)return!_;for(s=be(s);g--;){var x=c[g];if(w&&x[2]?x[1]!==s[x[0]]:!(x[0]in s))return!1}for(;++g<_;){x=c[g];var k=x[0],M=s[k],I=x[1];if(w&&x[2]){if(M===t&&!(k in s))return!1}else{var R=new zt;if(h)var B=h(M,I,k,s,l,R);if(!(B===t?rs(I,M,S|C,h,R):B))return!1}}return!0}function Fh(s){if(!Ee(s)||p_(s))return!1;var l=Sn(s)?N1:Sy;return l.test(yr(s))}function Rb(s){return Ce(s)&&tt(s)==Ui}function Lb(s){return Ce(s)&&Ye(s)==Bt}function Pb(s){return Ce(s)&&Oo(s.length)&&!!ve[tt(s)]}function $h(s){return typeof s=="function"?s:s==null?ht:typeof s=="object"?Z(s)?zh(s[0],s[1]):Hh(s):op(s)}function Da(s){if(!ls(s))return $1(s);var l=[];for(var c in be(s))ye.call(s,c)&&c!="constructor"&&l.push(c);return l}function Db(s){if(!Ee(s))return b_(s);var l=ls(s),c=[];for(var h in s)h=="constructor"&&(l||!ye.call(s,h))||c.push(h);return c}function Fa(s,l){return s<l}function Bh(s,l){var c=-1,h=ct(s)?A(s.length):[];return Ln(s,function(g,_,w){h[++c]=l(g,_,w)}),h}function Hh(s){var l=Za(s);return l.length==1&&l[0][2]?vd(l[0][0],l[0][1]):function(c){return c===s||Pa(c,s,l)}}function zh(s,l){return eu(s)&&_d(l)?vd(tn(s),l):function(c){var h=cu(c,s);return h===t&&h===l?fu(c,s):rs(l,h,S|C)}}function fo(s,l,c,h,g){s!==l&&Ia(l,function(_,w){if(g||(g=new zt),Ee(_))Fb(s,l,w,c,fo,h,g);else{var x=h?h(nu(s,w),_,w+"",s,l,g):t;x===t&&(x=_),Ta(s,w,x)}},ft)}function Fb(s,l,c,h,g,_,w){var x=nu(s,c),k=nu(l,c),M=w.get(k);if(M){Ta(s,c,M);return}var I=_?_(x,k,c+"",s,l,w):t,R=I===t;if(R){var B=Z(k),W=!B&&$n(k),j=!B&&!W&&ai(k);I=k,B||W||j?Z(x)?I=x:Oe(x)?I=ut(x):W?(R=!1,I=Qh(k,!0)):j?(R=!1,I=ed(k,!0)):I=[]:us(k)||br(k)?(I=x,br(x)?I=Yd(x):(!Ee(x)||Sn(x))&&(I=bd(k))):R=!1}R&&(w.set(k,I),g(I,k,h,_,w),w.delete(k)),Ta(s,c,I)}function Vh(s,l){var c=s.length;if(c)return l+=l<0?c:0,wn(l,c)?s[l]:t}function Wh(s,l,c){l.length?l=Se(l,function(_){return Z(_)?function(w){return mr(w,_.length===1?_[0]:_)}:_}):l=[ht];var h=-1;l=Se(l,gt(G()));var g=Bh(s,function(_,w,x){var k=Se(l,function(M){return M(_)});return{criteria:k,index:++h,value:_}});return c1(g,function(_,w){return Yb(_,w,c)})}function $b(s,l){return Uh(s,l,function(c,h){return fu(s,h)})}function Uh(s,l,c){for(var h=-1,g=l.length,_={};++h<g;){var w=l[h],x=mr(s,w);c(x,w)&&is(_,Dn(w,s),x)}return _}function Bb(s){return function(l){return mr(l,s)}}function $a(s,l,c,h){var g=h?u1:Xr,_=-1,w=l.length,x=s;for(s===l&&(l=ut(l)),c&&(x=Se(s,gt(c)));++_<w;)for(var k=0,M=l[_],I=c?c(M):M;(k=g(x,I,k,h))>-1;)x!==s&&to.call(x,k,1),to.call(s,k,1);return s}function Kh(s,l){for(var c=s?l.length:0,h=c-1;c--;){var g=l[c];if(c==h||g!==_){var _=g;wn(g)?to.call(s,g,1):Va(s,g)}}return s}function Ba(s,l){return s+io(kh()*(l-s+1))}function Hb(s,l,c,h){for(var g=-1,_=De(ro((l-s)/(c||1)),0),w=A(_);_--;)w[h?_:++g]=s,s+=c;return w}function Ha(s,l){var c="";if(!s||l<1||l>je)return c;do l%2&&(c+=s),l=io(l/2),l&&(s+=s);while(l);return c}function ne(s,l){return ru(wd(s,l,ht),s+"")}function zb(s){return Oh(ui(s))}function Vb(s,l){var c=ui(s);return So(c,pr(l,0,c.length))}function is(s,l,c,h){if(!Ee(s))return s;l=Dn(l,s);for(var g=-1,_=l.length,w=_-1,x=s;x!=null&&++g<_;){var k=tn(l[g]),M=c;if(k==="__proto__"||k==="constructor"||k==="prototype")return s;if(g!=w){var I=x[k];M=h?h(I,k,x):t,M===t&&(M=Ee(I)?I:wn(l[g+1])?[]:{})}es(x,k,M),x=x[k]}return s}var qh=so?function(s,l){return so.set(s,l),s}:ht,Wb=no?function(s,l){return no(s,"toString",{configurable:!0,enumerable:!1,value:du(l),writable:!0})}:ht;function Ub(s){return So(ui(s))}function Tt(s,l,c){var h=-1,g=s.length;l<0&&(l=-l>g?0:g+l),c=c>g?g:c,c<0&&(c+=g),g=l>c?0:c-l>>>0,l>>>=0;for(var _=A(g);++h<g;)_[h]=s[h+l];return _}function Kb(s,l){var c;return Ln(s,function(h,g,_){return c=l(h,g,_),!c}),!!c}function ho(s,l,c){var h=0,g=s==null?h:s.length;if(typeof l=="number"&&l===l&&g<=Gr){for(;h<g;){var _=h+g>>>1,w=s[_];w!==null&&!bt(w)&&(c?w<=l:w<l)?h=_+1:g=_}return g}return za(s,l,ht,c)}function za(s,l,c,h){var g=0,_=s==null?0:s.length;if(_===0)return 0;l=c(l);for(var w=l!==l,x=l===null,k=bt(l),M=l===t;g<_;){var I=io((g+_)/2),R=c(s[I]),B=R!==t,W=R===null,j=R===R,te=bt(R);if(w)var J=h||j;else M?J=j&&(h||B):x?J=j&&B&&(h||!W):k?J=j&&B&&!W&&(h||!te):W||te?J=!1:J=h?R<=l:R<l;J?g=I+1:_=I}return Je(_,qr)}function Gh(s,l){for(var c=-1,h=s.length,g=0,_=[];++c<h;){var w=s[c],x=l?l(w):w;if(!c||!Vt(x,k)){var k=x;_[g++]=w===0?0:w}}return _}function jh(s){return typeof s=="number"?s:bt(s)?Zt:+s}function yt(s){if(typeof s=="string")return s;if(Z(s))return Se(s,yt)+"";if(bt(s))return Ch?Ch.call(s):"";var l=s+"";return l=="0"&&1/s==-Qe?"-0":l}function Pn(s,l,c){var h=-1,g=Ks,_=s.length,w=!0,x=[],k=x;if(c)w=!1,g=ga;else if(_>=i){var M=l?null:n_(s);if(M)return Gs(M);w=!1,g=ji,k=new dr}else k=l?[]:x;e:for(;++h<_;){var I=s[h],R=l?l(I):I;if(I=c||I!==0?I:0,w&&R===R){for(var B=k.length;B--;)if(k[B]===R)continue e;l&&k.push(R),x.push(I)}else g(k,R,c)||(k!==x&&k.push(R),x.push(I))}return x}function Va(s,l){return l=Dn(l,s),s=Sd(s,l),s==null||delete s[tn(Mt(l))]}function Jh(s,l,c,h){return is(s,l,c(mr(s,l)),h)}function po(s,l,c,h){for(var g=s.length,_=h?g:-1;(h?_--:++_<g)&&l(s[_],_,s););return c?Tt(s,h?0:_,h?_+1:g):Tt(s,h?_+1:0,h?g:_)}function Yh(s,l){var c=s;return c instanceof le&&(c=c.value()),ya(l,function(h,g){return g.func.apply(g.thisArg,In([h],g.args))},c)}function Wa(s,l,c){var h=s.length;if(h<2)return h?Pn(s[0]):[];for(var g=-1,_=A(h);++g<h;)for(var w=s[g],x=-1;++x<h;)x!=g&&(_[g]=ts(_[g]||w,s[x],l,c));return Pn(We(_,1),l,c)}function Xh(s,l,c){for(var h=-1,g=s.length,_=l.length,w={};++h<g;){var x=h<_?l[h]:t;c(w,s[h],x)}return w}function Ua(s){return Oe(s)?s:[]}function Ka(s){return typeof s=="function"?s:ht}function Dn(s,l){return Z(s)?s:eu(s,l)?[s]:Cd(ge(s))}var qb=ne;function Fn(s,l,c){var h=s.length;return c=c===t?h:c,!l&&c>=h?s:Tt(s,l,c)}var Zh=R1||function(s){return Ve.clearTimeout(s)};function Qh(s,l){if(l)return s.slice();var c=s.length,h=vh?vh(c):new s.constructor(c);return s.copy(h),h}function qa(s){var l=new s.constructor(s.byteLength);return new Qs(l).set(new Qs(s)),l}function Gb(s,l){var c=l?qa(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.byteLength)}function jb(s){var l=new s.constructor(s.source,Df.exec(s));return l.lastIndex=s.lastIndex,l}function Jb(s){return Qi?be(Qi.call(s)):{}}function ed(s,l){var c=l?qa(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.length)}function td(s,l){if(s!==l){var c=s!==t,h=s===null,g=s===s,_=bt(s),w=l!==t,x=l===null,k=l===l,M=bt(l);if(!x&&!M&&!_&&s>l||_&&w&&k&&!x&&!M||h&&w&&k||!c&&k||!g)return 1;if(!h&&!_&&!M&&s<l||M&&c&&g&&!h&&!_||x&&c&&g||!w&&g||!k)return-1}return 0}function Yb(s,l,c){for(var h=-1,g=s.criteria,_=l.criteria,w=g.length,x=c.length;++h<w;){var k=td(g[h],_[h]);if(k){if(h>=x)return k;var M=c[h];return k*(M=="desc"?-1:1)}}return s.index-l.index}function nd(s,l,c,h){for(var g=-1,_=s.length,w=c.length,x=-1,k=l.length,M=De(_-w,0),I=A(k+M),R=!h;++x<k;)I[x]=l[x];for(;++g<w;)(R||g<_)&&(I[c[g]]=s[g]);for(;M--;)I[x++]=s[g++];return I}function rd(s,l,c,h){for(var g=-1,_=s.length,w=-1,x=c.length,k=-1,M=l.length,I=De(_-x,0),R=A(I+M),B=!h;++g<I;)R[g]=s[g];for(var W=g;++k<M;)R[W+k]=l[k];for(;++w<x;)(B||g<_)&&(R[W+c[w]]=s[g++]);return R}function ut(s,l){var c=-1,h=s.length;for(l||(l=A(h));++c<h;)l[c]=s[c];return l}function en(s,l,c,h){var g=!c;c||(c={});for(var _=-1,w=l.length;++_<w;){var x=l[_],k=h?h(c[x],s[x],x,c,s):t;k===t&&(k=s[x]),g?bn(c,x,k):es(c,x,k)}return c}function Xb(s,l){return en(s,Qa(s),l)}function Zb(s,l){return en(s,gd(s),l)}function mo(s,l){return function(c,h){var g=Z(c)?r1:vb,_=l?l():{};return g(c,s,G(h,2),_)}}function si(s){return ne(function(l,c){var h=-1,g=c.length,_=g>1?c[g-1]:t,w=g>2?c[2]:t;for(_=s.length>3&&typeof _=="function"?(g--,_):t,w&&nt(c[0],c[1],w)&&(_=g<3?t:_,g=1),l=be(l);++h<g;){var x=c[h];x&&s(l,x,h,_)}return l})}function id(s,l){return function(c,h){if(c==null)return c;if(!ct(c))return s(c,h);for(var g=c.length,_=l?g:-1,w=be(c);(l?_--:++_<g)&&h(w[_],_,w)!==!1;);return c}}function sd(s){return function(l,c,h){for(var g=-1,_=be(l),w=h(l),x=w.length;x--;){var k=w[s?x:++g];if(c(_[k],k,_)===!1)break}return l}}function Qb(s,l,c){var h=l&O,g=ss(s);function _(){var w=this&&this!==Ve&&this instanceof _?g:s;return w.apply(h?c:this,arguments)}return _}function od(s){return function(l){l=ge(l);var c=Zr(l)?Ht(l):t,h=c?c[0]:l.charAt(0),g=c?Fn(c,1).join(""):l.slice(1);return h[s]()+g}}function oi(s){return function(l){return ya(ip(rp(l).replace(Wy,"")),s,"")}}function ss(s){return function(){var l=arguments;switch(l.length){case 0:return new s;case 1:return new s(l[0]);case 2:return new s(l[0],l[1]);case 3:return new s(l[0],l[1],l[2]);case 4:return new s(l[0],l[1],l[2],l[3]);case 5:return new s(l[0],l[1],l[2],l[3],l[4]);case 6:return new s(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new s(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var c=ii(s.prototype),h=s.apply(c,l);return Ee(h)?h:c}}function e_(s,l,c){var h=ss(s);function g(){for(var _=arguments.length,w=A(_),x=_,k=li(g);x--;)w[x]=arguments[x];var M=_<3&&w[0]!==k&&w[_-1]!==k?[]:Nn(w,k);if(_-=M.length,_<c)return fd(s,l,go,g.placeholder,t,w,M,t,t,c-_);var I=this&&this!==Ve&&this instanceof g?h:s;return mt(I,this,w)}return g}function ld(s){return function(l,c,h){var g=be(l);if(!ct(l)){var _=G(c,3);l=Fe(l),c=function(x){return _(g[x],x,g)}}var w=s(l,c,h);return w>-1?g[_?l[w]:w]:t}}function ad(s){return vn(function(l){var c=l.length,h=c,g=At.prototype.thru;for(s&&l.reverse();h--;){var _=l[h];if(typeof _!="function")throw new Ct(a);if(g&&!w&&vo(_)=="wrapper")var w=new At([],!0)}for(h=w?h:c;++h<c;){_=l[h];var x=vo(_),k=x=="wrapper"?Xa(_):t;k&&tu(k[0])&&k[1]==(ue|K|pe|at)&&!k[4].length&&k[9]==1?w=w[vo(k[0])].apply(w,k[3]):w=_.length==1&&tu(_)?w[x]():w.thru(_)}return function(){var M=arguments,I=M[0];if(w&&M.length==1&&Z(I))return w.plant(I).value();for(var R=0,B=c?l[R].apply(this,M):I;++R<c;)B=l[R].call(this,B);return B}})}function go(s,l,c,h,g,_,w,x,k,M){var I=l&ue,R=l&O,B=l&N,W=l&(K|oe),j=l&Bi,te=B?t:ss(s);function J(){for(var re=arguments.length,ae=A(re),_t=re;_t--;)ae[_t]=arguments[_t];if(W)var rt=li(J),vt=h1(ae,rt);if(h&&(ae=nd(ae,h,g,W)),_&&(ae=rd(ae,_,w,W)),re-=vt,W&&re<M){var Te=Nn(ae,rt);return fd(s,l,go,J.placeholder,c,ae,Te,x,k,M-re)}var Wt=R?c:this,En=B?Wt[s]:s;return re=ae.length,x?ae=v_(ae,x):j&&re>1&&ae.reverse(),I&&k<re&&(ae.length=k),this&&this!==Ve&&this instanceof J&&(En=te||ss(En)),En.apply(Wt,ae)}return J}function ud(s,l){return function(c,h){return Ob(c,s,l(h),{})}}function yo(s,l){return function(c,h){var g;if(c===t&&h===t)return l;if(c!==t&&(g=c),h!==t){if(g===t)return h;typeof c=="string"||typeof h=="string"?(c=yt(c),h=yt(h)):(c=jh(c),h=jh(h)),g=s(c,h)}return g}}function Ga(s){return vn(function(l){return l=Se(l,gt(G())),ne(function(c){var h=this;return s(l,function(g){return mt(g,h,c)})})})}function bo(s,l){l=l===t?" ":yt(l);var c=l.length;if(c<2)return c?Ha(l,s):l;var h=Ha(l,ro(s/Qr(l)));return Zr(l)?Fn(Ht(h),0,s).join(""):h.slice(0,s)}function t_(s,l,c,h){var g=l&O,_=ss(s);function w(){for(var x=-1,k=arguments.length,M=-1,I=h.length,R=A(I+k),B=this&&this!==Ve&&this instanceof w?_:s;++M<I;)R[M]=h[M];for(;k--;)R[M++]=arguments[++x];return mt(B,g?c:this,R)}return w}function cd(s){return function(l,c,h){return h&&typeof h!="number"&&nt(l,c,h)&&(c=h=t),l=xn(l),c===t?(c=l,l=0):c=xn(c),h=h===t?l<c?1:-1:xn(h),Hb(l,c,h,s)}}function _o(s){return function(l,c){return typeof l=="string"&&typeof c=="string"||(l=It(l),c=It(c)),s(l,c)}}function fd(s,l,c,h,g,_,w,x,k,M){var I=l&K,R=I?w:t,B=I?t:w,W=I?_:t,j=I?t:_;l|=I?pe:$,l&=~(I?$:pe),l&q||(l&=~(O|N));var te=[s,l,g,W,R,j,B,x,k,M],J=c.apply(t,te);return tu(s)&&xd(J,te),J.placeholder=h,Ed(J,s,l)}function ja(s){var l=Pe[s];return function(c,h){if(c=It(c),h=h==null?0:Je(Q(h),292),h&&Eh(c)){var g=(ge(c)+"e").split("e"),_=l(g[0]+"e"+(+g[1]+h));return g=(ge(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return l(c)}}var n_=ni&&1/Gs(new ni([,-0]))[1]==Qe?function(s){return new ni(s)}:gu;function hd(s){return function(l){var c=Ye(l);return c==$t?Ea(l):c==Bt?_1(l):f1(l,s(l))}}function _n(s,l,c,h,g,_,w,x){var k=l&N;if(!k&&typeof s!="function")throw new Ct(a);var M=h?h.length:0;if(M||(l&=~(pe|$),h=g=t),w=w===t?w:De(Q(w),0),x=x===t?x:Q(x),M-=g?g.length:0,l&$){var I=h,R=g;h=g=t}var B=k?t:Xa(s),W=[s,l,c,h,g,I,R,_,w,x];if(B&&y_(W,B),s=W[0],l=W[1],c=W[2],h=W[3],g=W[4],x=W[9]=W[9]===t?k?0:s.length:De(W[9]-M,0),!x&&l&(K|oe)&&(l&=~(K|oe)),!l||l==O)var j=Qb(s,l,c);else l==K||l==oe?j=e_(s,l,x):(l==pe||l==(O|pe))&&!g.length?j=t_(s,l,c,h):j=go.apply(t,W);var te=B?qh:xd;return Ed(te(j,W),s,l)}function dd(s,l,c,h){return s===t||Vt(s,ti[c])&&!ye.call(h,c)?l:s}function pd(s,l,c,h,g,_){return Ee(s)&&Ee(l)&&(_.set(l,s),fo(s,l,t,pd,_),_.delete(l)),s}function r_(s){return us(s)?t:s}function md(s,l,c,h,g,_){var w=c&S,x=s.length,k=l.length;if(x!=k&&!(w&&k>x))return!1;var M=_.get(s),I=_.get(l);if(M&&I)return M==l&&I==s;var R=-1,B=!0,W=c&C?new dr:t;for(_.set(s,l),_.set(l,s);++R<x;){var j=s[R],te=l[R];if(h)var J=w?h(te,j,R,l,s,_):h(j,te,R,s,l,_);if(J!==t){if(J)continue;B=!1;break}if(W){if(!ba(l,function(re,ae){if(!ji(W,ae)&&(j===re||g(j,re,c,h,_)))return W.push(ae)})){B=!1;break}}else if(!(j===te||g(j,te,c,h,_))){B=!1;break}}return _.delete(s),_.delete(l),B}function i_(s,l,c,h,g,_,w){switch(c){case Jr:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case Gi:return!(s.byteLength!=l.byteLength||!_(new Qs(s),new Qs(l)));case zi:case Vi:case Wi:return Vt(+s,+l);case Bs:return s.name==l.name&&s.message==l.message;case Ui:case Ki:return s==l+"";case $t:var x=Ea;case Bt:var k=h&S;if(x||(x=Gs),s.size!=l.size&&!k)return!1;var M=w.get(s);if(M)return M==l;h|=C,w.set(s,l);var I=md(x(s),x(l),h,g,_,w);return w.delete(s),I;case zs:if(Qi)return Qi.call(s)==Qi.call(l)}return!1}function s_(s,l,c,h,g,_){var w=c&S,x=Ja(s),k=x.length,M=Ja(l),I=M.length;if(k!=I&&!w)return!1;for(var R=k;R--;){var B=x[R];if(!(w?B in l:ye.call(l,B)))return!1}var W=_.get(s),j=_.get(l);if(W&&j)return W==l&&j==s;var te=!0;_.set(s,l),_.set(l,s);for(var J=w;++R<k;){B=x[R];var re=s[B],ae=l[B];if(h)var _t=w?h(ae,re,B,l,s,_):h(re,ae,B,s,l,_);if(!(_t===t?re===ae||g(re,ae,c,h,_):_t)){te=!1;break}J||(J=B=="constructor")}if(te&&!J){var rt=s.constructor,vt=l.constructor;rt!=vt&&"constructor"in s&&"constructor"in l&&!(typeof rt=="function"&&rt instanceof rt&&typeof vt=="function"&&vt instanceof vt)&&(te=!1)}return _.delete(s),_.delete(l),te}function vn(s){return ru(wd(s,t,Md),s+"")}function Ja(s){return Ph(s,Fe,Qa)}function Ya(s){return Ph(s,ft,gd)}var Xa=so?function(s){return so.get(s)}:gu;function vo(s){for(var l=s.name+"",c=ri[l],h=ye.call(ri,l)?c.length:0;h--;){var g=c[h],_=g.func;if(_==null||_==s)return g.name}return l}function li(s){var l=ye.call(b,"placeholder")?b:s;return l.placeholder}function G(){var s=b.iteratee||pu;return s=s===pu?$h:s,arguments.length?s(arguments[0],arguments[1]):s}function wo(s,l){var c=s.__data__;return d_(l)?c[typeof l=="string"?"string":"hash"]:c.map}function Za(s){for(var l=Fe(s),c=l.length;c--;){var h=l[c],g=s[h];l[c]=[h,g,_d(g)]}return l}function gr(s,l){var c=g1(s,l);return Fh(c)?c:t}function o_(s){var l=ye.call(s,fr),c=s[fr];try{s[fr]=t;var h=!0}catch{}var g=Xs.call(s);return h&&(l?s[fr]=c:delete s[fr]),g}var Qa=Ca?function(s){return s==null?[]:(s=be(s),Mn(Ca(s),function(l){return Sh.call(s,l)}))}:yu,gd=Ca?function(s){for(var l=[];s;)In(l,Qa(s)),s=eo(s);return l}:yu,Ye=tt;(Aa&&Ye(new Aa(new ArrayBuffer(1)))!=Jr||Yi&&Ye(new Yi)!=$t||Oa&&Ye(Oa.resolve())!=Nf||ni&&Ye(new ni)!=Bt||Xi&&Ye(new Xi)!=qi)&&(Ye=function(s){var l=tt(s),c=l==mn?s.constructor:t,h=c?yr(c):"";if(h)switch(h){case V1:return Jr;case W1:return $t;case U1:return Nf;case K1:return Bt;case q1:return qi}return l});function l_(s,l,c){for(var h=-1,g=c.length;++h<g;){var _=c[h],w=_.size;switch(_.type){case"drop":s+=w;break;case"dropRight":l-=w;break;case"take":l=Je(l,s+w);break;case"takeRight":s=De(s,l-w);break}}return{start:s,end:l}}function a_(s){var l=s.match(py);return l?l[1].split(my):[]}function yd(s,l,c){l=Dn(l,s);for(var h=-1,g=l.length,_=!1;++h<g;){var w=tn(l[h]);if(!(_=s!=null&&c(s,w)))break;s=s[w]}return _||++h!=g?_:(g=s==null?0:s.length,!!g&&Oo(g)&&wn(w,g)&&(Z(s)||br(s)))}function u_(s){var l=s.length,c=new s.constructor(l);return l&&typeof s[0]=="string"&&ye.call(s,"index")&&(c.index=s.index,c.input=s.input),c}function bd(s){return typeof s.constructor=="function"&&!ls(s)?ii(eo(s)):{}}function c_(s,l,c){var h=s.constructor;switch(l){case Gi:return qa(s);case zi:case Vi:return new h(+s);case Jr:return Gb(s,c);case Zl:case Ql:case ea:case ta:case na:case ra:case ia:case sa:case oa:return ed(s,c);case $t:return new h;case Wi:case Ki:return new h(s);case Ui:return jb(s);case Bt:return new h;case zs:return Jb(s)}}function f_(s,l){var c=l.length;if(!c)return s;var h=c-1;return l[h]=(c>1?"& ":"")+l[h],l=l.join(c>2?", ":" "),s.replace(dy,`{
43
+ /* [wrapped with `+l+`] */
44
+ `)}function h_(s){return Z(s)||br(s)||!!(xh&&s&&s[xh])}function wn(s,l){var c=typeof s;return l=l??je,!!l&&(c=="number"||c!="symbol"&&Ey.test(s))&&s>-1&&s%1==0&&s<l}function nt(s,l,c){if(!Ee(c))return!1;var h=typeof l;return(h=="number"?ct(c)&&wn(l,c.length):h=="string"&&l in c)?Vt(c[l],s):!1}function eu(s,l){if(Z(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||bt(s)?!0:uy.test(s)||!ay.test(s)||l!=null&&s in be(l)}function d_(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function tu(s){var l=vo(s),c=b[l];if(typeof c!="function"||!(l in le.prototype))return!1;if(s===c)return!0;var h=Xa(c);return!!h&&s===h[0]}function p_(s){return!!_h&&_h in s}var m_=Js?Sn:bu;function ls(s){var l=s&&s.constructor,c=typeof l=="function"&&l.prototype||ti;return s===c}function _d(s){return s===s&&!Ee(s)}function vd(s,l){return function(c){return c==null?!1:c[s]===l&&(l!==t||s in be(c))}}function g_(s){var l=Co(s,function(h){return c.size===d&&c.clear(),h}),c=l.cache;return l}function y_(s,l){var c=s[1],h=l[1],g=c|h,_=g<(O|N|ue),w=h==ue&&c==K||h==ue&&c==at&&s[7].length<=l[8]||h==(ue|at)&&l[7].length<=l[8]&&c==K;if(!(_||w))return s;h&O&&(s[2]=l[2],g|=c&O?0:q);var x=l[3];if(x){var k=s[3];s[3]=k?nd(k,x,l[4]):x,s[4]=k?Nn(s[3],p):l[4]}return x=l[5],x&&(k=s[5],s[5]=k?rd(k,x,l[6]):x,s[6]=k?Nn(s[5],p):l[6]),x=l[7],x&&(s[7]=x),h&ue&&(s[8]=s[8]==null?l[8]:Je(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=g,s}function b_(s){var l=[];if(s!=null)for(var c in be(s))l.push(c);return l}function __(s){return Xs.call(s)}function wd(s,l,c){return l=De(l===t?s.length-1:l,0),function(){for(var h=arguments,g=-1,_=De(h.length-l,0),w=A(_);++g<_;)w[g]=h[l+g];g=-1;for(var x=A(l+1);++g<l;)x[g]=h[g];return x[l]=c(w),mt(s,this,x)}}function Sd(s,l){return l.length<2?s:mr(s,Tt(l,0,-1))}function v_(s,l){for(var c=s.length,h=Je(l.length,c),g=ut(s);h--;){var _=l[h];s[h]=wn(_,c)?g[_]:t}return s}function nu(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var xd=kd(qh),as=P1||function(s,l){return Ve.setTimeout(s,l)},ru=kd(Wb);function Ed(s,l,c){var h=l+"";return ru(s,f_(h,w_(a_(h),c)))}function kd(s){var l=0,c=0;return function(){var h=B1(),g=Ur-(h-c);if(c=h,g>0){if(++l>=ar)return arguments[0]}else l=0;return s.apply(t,arguments)}}function So(s,l){var c=-1,h=s.length,g=h-1;for(l=l===t?h:l;++c<l;){var _=Ba(c,g),w=s[_];s[_]=s[c],s[c]=w}return s.length=l,s}var Cd=g_(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(cy,function(c,h,g,_){l.push(g?_.replace(by,"$1"):h||c)}),l});function tn(s){if(typeof s=="string"||bt(s))return s;var l=s+"";return l=="0"&&1/s==-Qe?"-0":l}function yr(s){if(s!=null){try{return Ys.call(s)}catch{}try{return s+""}catch{}}return""}function w_(s,l){return kt(j0,function(c){var h="_."+c[0];l&c[1]&&!Ks(s,h)&&s.push(h)}),s.sort()}function Ad(s){if(s instanceof le)return s.clone();var l=new At(s.__wrapped__,s.__chain__);return l.__actions__=ut(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function S_(s,l,c){(c?nt(s,l,c):l===t)?l=1:l=De(Q(l),0);var h=s==null?0:s.length;if(!h||l<1)return[];for(var g=0,_=0,w=A(ro(h/l));g<h;)w[_++]=Tt(s,g,g+=l);return w}function x_(s){for(var l=-1,c=s==null?0:s.length,h=0,g=[];++l<c;){var _=s[l];_&&(g[h++]=_)}return g}function E_(){var s=arguments.length;if(!s)return[];for(var l=A(s-1),c=arguments[0],h=s;h--;)l[h-1]=arguments[h];return In(Z(c)?ut(c):[c],We(l,1))}var k_=ne(function(s,l){return Oe(s)?ts(s,We(l,1,Oe,!0)):[]}),C_=ne(function(s,l){var c=Mt(l);return Oe(c)&&(c=t),Oe(s)?ts(s,We(l,1,Oe,!0),G(c,2)):[]}),A_=ne(function(s,l){var c=Mt(l);return Oe(c)&&(c=t),Oe(s)?ts(s,We(l,1,Oe,!0),t,c):[]});function O_(s,l,c){var h=s==null?0:s.length;return h?(l=c||l===t?1:Q(l),Tt(s,l<0?0:l,h)):[]}function T_(s,l,c){var h=s==null?0:s.length;return h?(l=c||l===t?1:Q(l),l=h-l,Tt(s,0,l<0?0:l)):[]}function M_(s,l){return s&&s.length?po(s,G(l,3),!0,!0):[]}function I_(s,l){return s&&s.length?po(s,G(l,3),!0):[]}function N_(s,l,c,h){var g=s==null?0:s.length;return g?(c&&typeof c!="number"&&nt(s,l,c)&&(c=0,h=g),Eb(s,l,c,h)):[]}function Od(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=c==null?0:Q(c);return g<0&&(g=De(h+g,0)),qs(s,G(l,3),g)}function Td(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=h-1;return c!==t&&(g=Q(c),g=c<0?De(h+g,0):Je(g,h-1)),qs(s,G(l,3),g,!0)}function Md(s){var l=s==null?0:s.length;return l?We(s,1):[]}function R_(s){var l=s==null?0:s.length;return l?We(s,Qe):[]}function L_(s,l){var c=s==null?0:s.length;return c?(l=l===t?1:Q(l),We(s,l)):[]}function P_(s){for(var l=-1,c=s==null?0:s.length,h={};++l<c;){var g=s[l];h[g[0]]=g[1]}return h}function Id(s){return s&&s.length?s[0]:t}function D_(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=c==null?0:Q(c);return g<0&&(g=De(h+g,0)),Xr(s,l,g)}function F_(s){var l=s==null?0:s.length;return l?Tt(s,0,-1):[]}var $_=ne(function(s){var l=Se(s,Ua);return l.length&&l[0]===s[0]?La(l):[]}),B_=ne(function(s){var l=Mt(s),c=Se(s,Ua);return l===Mt(c)?l=t:c.pop(),c.length&&c[0]===s[0]?La(c,G(l,2)):[]}),H_=ne(function(s){var l=Mt(s),c=Se(s,Ua);return l=typeof l=="function"?l:t,l&&c.pop(),c.length&&c[0]===s[0]?La(c,t,l):[]});function z_(s,l){return s==null?"":F1.call(s,l)}function Mt(s){var l=s==null?0:s.length;return l?s[l-1]:t}function V_(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=h;return c!==t&&(g=Q(c),g=g<0?De(h+g,0):Je(g,h-1)),l===l?w1(s,l,g):qs(s,fh,g,!0)}function W_(s,l){return s&&s.length?Vh(s,Q(l)):t}var U_=ne(Nd);function Nd(s,l){return s&&s.length&&l&&l.length?$a(s,l):s}function K_(s,l,c){return s&&s.length&&l&&l.length?$a(s,l,G(c,2)):s}function q_(s,l,c){return s&&s.length&&l&&l.length?$a(s,l,t,c):s}var G_=vn(function(s,l){var c=s==null?0:s.length,h=Ma(s,l);return Kh(s,Se(l,function(g){return wn(g,c)?+g:g}).sort(td)),h});function j_(s,l){var c=[];if(!(s&&s.length))return c;var h=-1,g=[],_=s.length;for(l=G(l,3);++h<_;){var w=s[h];l(w,h,s)&&(c.push(w),g.push(h))}return Kh(s,g),c}function iu(s){return s==null?s:z1.call(s)}function J_(s,l,c){var h=s==null?0:s.length;return h?(c&&typeof c!="number"&&nt(s,l,c)?(l=0,c=h):(l=l==null?0:Q(l),c=c===t?h:Q(c)),Tt(s,l,c)):[]}function Y_(s,l){return ho(s,l)}function X_(s,l,c){return za(s,l,G(c,2))}function Z_(s,l){var c=s==null?0:s.length;if(c){var h=ho(s,l);if(h<c&&Vt(s[h],l))return h}return-1}function Q_(s,l){return ho(s,l,!0)}function ev(s,l,c){return za(s,l,G(c,2),!0)}function tv(s,l){var c=s==null?0:s.length;if(c){var h=ho(s,l,!0)-1;if(Vt(s[h],l))return h}return-1}function nv(s){return s&&s.length?Gh(s):[]}function rv(s,l){return s&&s.length?Gh(s,G(l,2)):[]}function iv(s){var l=s==null?0:s.length;return l?Tt(s,1,l):[]}function sv(s,l,c){return s&&s.length?(l=c||l===t?1:Q(l),Tt(s,0,l<0?0:l)):[]}function ov(s,l,c){var h=s==null?0:s.length;return h?(l=c||l===t?1:Q(l),l=h-l,Tt(s,l<0?0:l,h)):[]}function lv(s,l){return s&&s.length?po(s,G(l,3),!1,!0):[]}function av(s,l){return s&&s.length?po(s,G(l,3)):[]}var uv=ne(function(s){return Pn(We(s,1,Oe,!0))}),cv=ne(function(s){var l=Mt(s);return Oe(l)&&(l=t),Pn(We(s,1,Oe,!0),G(l,2))}),fv=ne(function(s){var l=Mt(s);return l=typeof l=="function"?l:t,Pn(We(s,1,Oe,!0),t,l)});function hv(s){return s&&s.length?Pn(s):[]}function dv(s,l){return s&&s.length?Pn(s,G(l,2)):[]}function pv(s,l){return l=typeof l=="function"?l:t,s&&s.length?Pn(s,t,l):[]}function su(s){if(!(s&&s.length))return[];var l=0;return s=Mn(s,function(c){if(Oe(c))return l=De(c.length,l),!0}),Sa(l,function(c){return Se(s,_a(c))})}function Rd(s,l){if(!(s&&s.length))return[];var c=su(s);return l==null?c:Se(c,function(h){return mt(l,t,h)})}var mv=ne(function(s,l){return Oe(s)?ts(s,l):[]}),gv=ne(function(s){return Wa(Mn(s,Oe))}),yv=ne(function(s){var l=Mt(s);return Oe(l)&&(l=t),Wa(Mn(s,Oe),G(l,2))}),bv=ne(function(s){var l=Mt(s);return l=typeof l=="function"?l:t,Wa(Mn(s,Oe),t,l)}),_v=ne(su);function vv(s,l){return Xh(s||[],l||[],es)}function wv(s,l){return Xh(s||[],l||[],is)}var Sv=ne(function(s){var l=s.length,c=l>1?s[l-1]:t;return c=typeof c=="function"?(s.pop(),c):t,Rd(s,c)});function Ld(s){var l=b(s);return l.__chain__=!0,l}function xv(s,l){return l(s),s}function xo(s,l){return l(s)}var Ev=vn(function(s){var l=s.length,c=l?s[0]:0,h=this.__wrapped__,g=function(_){return Ma(_,s)};return l>1||this.__actions__.length||!(h instanceof le)||!wn(c)?this.thru(g):(h=h.slice(c,+c+(l?1:0)),h.__actions__.push({func:xo,args:[g],thisArg:t}),new At(h,this.__chain__).thru(function(_){return l&&!_.length&&_.push(t),_}))});function kv(){return Ld(this)}function Cv(){return new At(this.value(),this.__chain__)}function Av(){this.__values__===t&&(this.__values__=jd(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function Ov(){return this}function Tv(s){for(var l,c=this;c instanceof lo;){var h=Ad(c);h.__index__=0,h.__values__=t,l?g.__wrapped__=h:l=h;var g=h;c=c.__wrapped__}return g.__wrapped__=s,l}function Mv(){var s=this.__wrapped__;if(s instanceof le){var l=s;return this.__actions__.length&&(l=new le(this)),l=l.reverse(),l.__actions__.push({func:xo,args:[iu],thisArg:t}),new At(l,this.__chain__)}return this.thru(iu)}function Iv(){return Yh(this.__wrapped__,this.__actions__)}var Nv=mo(function(s,l,c){ye.call(s,c)?++s[c]:bn(s,c,1)});function Rv(s,l,c){var h=Z(s)?uh:xb;return c&&nt(s,l,c)&&(l=t),h(s,G(l,3))}function Lv(s,l){var c=Z(s)?Mn:Rh;return c(s,G(l,3))}var Pv=ld(Od),Dv=ld(Td);function Fv(s,l){return We(Eo(s,l),1)}function $v(s,l){return We(Eo(s,l),Qe)}function Bv(s,l,c){return c=c===t?1:Q(c),We(Eo(s,l),c)}function Pd(s,l){var c=Z(s)?kt:Ln;return c(s,G(l,3))}function Dd(s,l){var c=Z(s)?i1:Nh;return c(s,G(l,3))}var Hv=mo(function(s,l,c){ye.call(s,c)?s[c].push(l):bn(s,c,[l])});function zv(s,l,c,h){s=ct(s)?s:ui(s),c=c&&!h?Q(c):0;var g=s.length;return c<0&&(c=De(g+c,0)),To(s)?c<=g&&s.indexOf(l,c)>-1:!!g&&Xr(s,l,c)>-1}var Vv=ne(function(s,l,c){var h=-1,g=typeof l=="function",_=ct(s)?A(s.length):[];return Ln(s,function(w){_[++h]=g?mt(l,w,c):ns(w,l,c)}),_}),Wv=mo(function(s,l,c){bn(s,c,l)});function Eo(s,l){var c=Z(s)?Se:Bh;return c(s,G(l,3))}function Uv(s,l,c,h){return s==null?[]:(Z(l)||(l=l==null?[]:[l]),c=h?t:c,Z(c)||(c=c==null?[]:[c]),Wh(s,l,c))}var Kv=mo(function(s,l,c){s[c?0:1].push(l)},function(){return[[],[]]});function qv(s,l,c){var h=Z(s)?ya:dh,g=arguments.length<3;return h(s,G(l,4),c,g,Ln)}function Gv(s,l,c){var h=Z(s)?s1:dh,g=arguments.length<3;return h(s,G(l,4),c,g,Nh)}function jv(s,l){var c=Z(s)?Mn:Rh;return c(s,Ao(G(l,3)))}function Jv(s){var l=Z(s)?Oh:zb;return l(s)}function Yv(s,l,c){(c?nt(s,l,c):l===t)?l=1:l=Q(l);var h=Z(s)?bb:Vb;return h(s,l)}function Xv(s){var l=Z(s)?_b:Ub;return l(s)}function Zv(s){if(s==null)return 0;if(ct(s))return To(s)?Qr(s):s.length;var l=Ye(s);return l==$t||l==Bt?s.size:Da(s).length}function Qv(s,l,c){var h=Z(s)?ba:Kb;return c&&nt(s,l,c)&&(l=t),h(s,G(l,3))}var ew=ne(function(s,l){if(s==null)return[];var c=l.length;return c>1&&nt(s,l[0],l[1])?l=[]:c>2&&nt(l[0],l[1],l[2])&&(l=[l[0]]),Wh(s,We(l,1),[])}),ko=L1||function(){return Ve.Date.now()};function tw(s,l){if(typeof l!="function")throw new Ct(a);return s=Q(s),function(){if(--s<1)return l.apply(this,arguments)}}function Fd(s,l,c){return l=c?t:l,l=s&&l==null?s.length:l,_n(s,ue,t,t,t,t,l)}function $d(s,l){var c;if(typeof l!="function")throw new Ct(a);return s=Q(s),function(){return--s>0&&(c=l.apply(this,arguments)),s<=1&&(l=t),c}}var ou=ne(function(s,l,c){var h=O;if(c.length){var g=Nn(c,li(ou));h|=pe}return _n(s,h,l,c,g)}),Bd=ne(function(s,l,c){var h=O|N;if(c.length){var g=Nn(c,li(Bd));h|=pe}return _n(l,h,s,c,g)});function Hd(s,l,c){l=c?t:l;var h=_n(s,K,t,t,t,t,t,l);return h.placeholder=Hd.placeholder,h}function zd(s,l,c){l=c?t:l;var h=_n(s,oe,t,t,t,t,t,l);return h.placeholder=zd.placeholder,h}function Vd(s,l,c){var h,g,_,w,x,k,M=0,I=!1,R=!1,B=!0;if(typeof s!="function")throw new Ct(a);l=It(l)||0,Ee(c)&&(I=!!c.leading,R="maxWait"in c,_=R?De(It(c.maxWait)||0,l):_,B="trailing"in c?!!c.trailing:B);function W(Te){var Wt=h,En=g;return h=g=t,M=Te,w=s.apply(En,Wt),w}function j(Te){return M=Te,x=as(re,l),I?W(Te):w}function te(Te){var Wt=Te-k,En=Te-M,lp=l-Wt;return R?Je(lp,_-En):lp}function J(Te){var Wt=Te-k,En=Te-M;return k===t||Wt>=l||Wt<0||R&&En>=_}function re(){var Te=ko();if(J(Te))return ae(Te);x=as(re,te(Te))}function ae(Te){return x=t,B&&h?W(Te):(h=g=t,w)}function _t(){x!==t&&Zh(x),M=0,h=k=g=x=t}function rt(){return x===t?w:ae(ko())}function vt(){var Te=ko(),Wt=J(Te);if(h=arguments,g=this,k=Te,Wt){if(x===t)return j(k);if(R)return Zh(x),x=as(re,l),W(k)}return x===t&&(x=as(re,l)),w}return vt.cancel=_t,vt.flush=rt,vt}var nw=ne(function(s,l){return Ih(s,1,l)}),rw=ne(function(s,l,c){return Ih(s,It(l)||0,c)});function iw(s){return _n(s,Bi)}function Co(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Ct(a);var c=function(){var h=arguments,g=l?l.apply(this,h):h[0],_=c.cache;if(_.has(g))return _.get(g);var w=s.apply(this,h);return c.cache=_.set(g,w)||_,w};return c.cache=new(Co.Cache||yn),c}Co.Cache=yn;function Ao(s){if(typeof s!="function")throw new Ct(a);return function(){var l=arguments;switch(l.length){case 0:return!s.call(this);case 1:return!s.call(this,l[0]);case 2:return!s.call(this,l[0],l[1]);case 3:return!s.call(this,l[0],l[1],l[2])}return!s.apply(this,l)}}function sw(s){return $d(2,s)}var ow=qb(function(s,l){l=l.length==1&&Z(l[0])?Se(l[0],gt(G())):Se(We(l,1),gt(G()));var c=l.length;return ne(function(h){for(var g=-1,_=Je(h.length,c);++g<_;)h[g]=l[g].call(this,h[g]);return mt(s,this,h)})}),lu=ne(function(s,l){var c=Nn(l,li(lu));return _n(s,pe,t,l,c)}),Wd=ne(function(s,l){var c=Nn(l,li(Wd));return _n(s,$,t,l,c)}),lw=vn(function(s,l){return _n(s,at,t,t,t,l)});function aw(s,l){if(typeof s!="function")throw new Ct(a);return l=l===t?l:Q(l),ne(s,l)}function uw(s,l){if(typeof s!="function")throw new Ct(a);return l=l==null?0:De(Q(l),0),ne(function(c){var h=c[l],g=Fn(c,0,l);return h&&In(g,h),mt(s,this,g)})}function cw(s,l,c){var h=!0,g=!0;if(typeof s!="function")throw new Ct(a);return Ee(c)&&(h="leading"in c?!!c.leading:h,g="trailing"in c?!!c.trailing:g),Vd(s,l,{leading:h,maxWait:l,trailing:g})}function fw(s){return Fd(s,1)}function hw(s,l){return lu(Ka(l),s)}function dw(){if(!arguments.length)return[];var s=arguments[0];return Z(s)?s:[s]}function pw(s){return Ot(s,v)}function mw(s,l){return l=typeof l=="function"?l:t,Ot(s,v,l)}function gw(s){return Ot(s,m|v)}function yw(s,l){return l=typeof l=="function"?l:t,Ot(s,m|v,l)}function bw(s,l){return l==null||Mh(s,l,Fe(l))}function Vt(s,l){return s===l||s!==s&&l!==l}var _w=_o(Ra),vw=_o(function(s,l){return s>=l}),br=Dh(function(){return arguments}())?Dh:function(s){return Ce(s)&&ye.call(s,"callee")&&!Sh.call(s,"callee")},Z=A.isArray,ww=rh?gt(rh):Tb;function ct(s){return s!=null&&Oo(s.length)&&!Sn(s)}function Oe(s){return Ce(s)&&ct(s)}function Sw(s){return s===!0||s===!1||Ce(s)&&tt(s)==zi}var $n=D1||bu,xw=ih?gt(ih):Mb;function Ew(s){return Ce(s)&&s.nodeType===1&&!us(s)}function kw(s){if(s==null)return!0;if(ct(s)&&(Z(s)||typeof s=="string"||typeof s.splice=="function"||$n(s)||ai(s)||br(s)))return!s.length;var l=Ye(s);if(l==$t||l==Bt)return!s.size;if(ls(s))return!Da(s).length;for(var c in s)if(ye.call(s,c))return!1;return!0}function Cw(s,l){return rs(s,l)}function Aw(s,l,c){c=typeof c=="function"?c:t;var h=c?c(s,l):t;return h===t?rs(s,l,t,c):!!h}function au(s){if(!Ce(s))return!1;var l=tt(s);return l==Bs||l==Y0||typeof s.message=="string"&&typeof s.name=="string"&&!us(s)}function Ow(s){return typeof s=="number"&&Eh(s)}function Sn(s){if(!Ee(s))return!1;var l=tt(s);return l==Hs||l==If||l==J0||l==Z0}function Ud(s){return typeof s=="number"&&s==Q(s)}function Oo(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=je}function Ee(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Ce(s){return s!=null&&typeof s=="object"}var Kd=sh?gt(sh):Nb;function Tw(s,l){return s===l||Pa(s,l,Za(l))}function Mw(s,l,c){return c=typeof c=="function"?c:t,Pa(s,l,Za(l),c)}function Iw(s){return qd(s)&&s!=+s}function Nw(s){if(m_(s))throw new X(o);return Fh(s)}function Rw(s){return s===null}function Lw(s){return s==null}function qd(s){return typeof s=="number"||Ce(s)&&tt(s)==Wi}function us(s){if(!Ce(s)||tt(s)!=mn)return!1;var l=eo(s);if(l===null)return!0;var c=ye.call(l,"constructor")&&l.constructor;return typeof c=="function"&&c instanceof c&&Ys.call(c)==M1}var uu=oh?gt(oh):Rb;function Pw(s){return Ud(s)&&s>=-je&&s<=je}var Gd=lh?gt(lh):Lb;function To(s){return typeof s=="string"||!Z(s)&&Ce(s)&&tt(s)==Ki}function bt(s){return typeof s=="symbol"||Ce(s)&&tt(s)==zs}var ai=ah?gt(ah):Pb;function Dw(s){return s===t}function Fw(s){return Ce(s)&&Ye(s)==qi}function $w(s){return Ce(s)&&tt(s)==ey}var Bw=_o(Fa),Hw=_o(function(s,l){return s<=l});function jd(s){if(!s)return[];if(ct(s))return To(s)?Ht(s):ut(s);if(Ji&&s[Ji])return b1(s[Ji]());var l=Ye(s),c=l==$t?Ea:l==Bt?Gs:ui;return c(s)}function xn(s){if(!s)return s===0?s:0;if(s=It(s),s===Qe||s===-Qe){var l=s<0?-1:1;return l*pn}return s===s?s:0}function Q(s){var l=xn(s),c=l%1;return l===l?c?l-c:l:0}function Jd(s){return s?pr(Q(s),0,et):0}function It(s){if(typeof s=="number")return s;if(bt(s))return Zt;if(Ee(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Ee(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=ph(s);var c=wy.test(s);return c||xy.test(s)?t1(s.slice(2),c?2:8):vy.test(s)?Zt:+s}function Yd(s){return en(s,ft(s))}function zw(s){return s?pr(Q(s),-je,je):s===0?s:0}function ge(s){return s==null?"":yt(s)}var Vw=si(function(s,l){if(ls(l)||ct(l)){en(l,Fe(l),s);return}for(var c in l)ye.call(l,c)&&es(s,c,l[c])}),Xd=si(function(s,l){en(l,ft(l),s)}),Mo=si(function(s,l,c,h){en(l,ft(l),s,h)}),Ww=si(function(s,l,c,h){en(l,Fe(l),s,h)}),Uw=vn(Ma);function Kw(s,l){var c=ii(s);return l==null?c:Th(c,l)}var qw=ne(function(s,l){s=be(s);var c=-1,h=l.length,g=h>2?l[2]:t;for(g&&nt(l[0],l[1],g)&&(h=1);++c<h;)for(var _=l[c],w=ft(_),x=-1,k=w.length;++x<k;){var M=w[x],I=s[M];(I===t||Vt(I,ti[M])&&!ye.call(s,M))&&(s[M]=_[M])}return s}),Gw=ne(function(s){return s.push(t,pd),mt(Zd,t,s)});function jw(s,l){return ch(s,G(l,3),Qt)}function Jw(s,l){return ch(s,G(l,3),Na)}function Yw(s,l){return s==null?s:Ia(s,G(l,3),ft)}function Xw(s,l){return s==null?s:Lh(s,G(l,3),ft)}function Zw(s,l){return s&&Qt(s,G(l,3))}function Qw(s,l){return s&&Na(s,G(l,3))}function eS(s){return s==null?[]:co(s,Fe(s))}function tS(s){return s==null?[]:co(s,ft(s))}function cu(s,l,c){var h=s==null?t:mr(s,l);return h===t?c:h}function nS(s,l){return s!=null&&yd(s,l,kb)}function fu(s,l){return s!=null&&yd(s,l,Cb)}var rS=ud(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=Xs.call(l)),s[l]=c},du(ht)),iS=ud(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=Xs.call(l)),ye.call(s,l)?s[l].push(c):s[l]=[c]},G),sS=ne(ns);function Fe(s){return ct(s)?Ah(s):Da(s)}function ft(s){return ct(s)?Ah(s,!0):Db(s)}function oS(s,l){var c={};return l=G(l,3),Qt(s,function(h,g,_){bn(c,l(h,g,_),h)}),c}function lS(s,l){var c={};return l=G(l,3),Qt(s,function(h,g,_){bn(c,g,l(h,g,_))}),c}var aS=si(function(s,l,c){fo(s,l,c)}),Zd=si(function(s,l,c,h){fo(s,l,c,h)}),uS=vn(function(s,l){var c={};if(s==null)return c;var h=!1;l=Se(l,function(_){return _=Dn(_,s),h||(h=_.length>1),_}),en(s,Ya(s),c),h&&(c=Ot(c,m|y|v,r_));for(var g=l.length;g--;)Va(c,l[g]);return c});function cS(s,l){return Qd(s,Ao(G(l)))}var fS=vn(function(s,l){return s==null?{}:$b(s,l)});function Qd(s,l){if(s==null)return{};var c=Se(Ya(s),function(h){return[h]});return l=G(l),Uh(s,c,function(h,g){return l(h,g[0])})}function hS(s,l,c){l=Dn(l,s);var h=-1,g=l.length;for(g||(g=1,s=t);++h<g;){var _=s==null?t:s[tn(l[h])];_===t&&(h=g,_=c),s=Sn(_)?_.call(s):_}return s}function dS(s,l,c){return s==null?s:is(s,l,c)}function pS(s,l,c,h){return h=typeof h=="function"?h:t,s==null?s:is(s,l,c,h)}var ep=hd(Fe),tp=hd(ft);function mS(s,l,c){var h=Z(s),g=h||$n(s)||ai(s);if(l=G(l,4),c==null){var _=s&&s.constructor;g?c=h?new _:[]:Ee(s)?c=Sn(_)?ii(eo(s)):{}:c={}}return(g?kt:Qt)(s,function(w,x,k){return l(c,w,x,k)}),c}function gS(s,l){return s==null?!0:Va(s,l)}function yS(s,l,c){return s==null?s:Jh(s,l,Ka(c))}function bS(s,l,c,h){return h=typeof h=="function"?h:t,s==null?s:Jh(s,l,Ka(c),h)}function ui(s){return s==null?[]:xa(s,Fe(s))}function _S(s){return s==null?[]:xa(s,ft(s))}function vS(s,l,c){return c===t&&(c=l,l=t),c!==t&&(c=It(c),c=c===c?c:0),l!==t&&(l=It(l),l=l===l?l:0),pr(It(s),l,c)}function wS(s,l,c){return l=xn(l),c===t?(c=l,l=0):c=xn(c),s=It(s),Ab(s,l,c)}function SS(s,l,c){if(c&&typeof c!="boolean"&&nt(s,l,c)&&(l=c=t),c===t&&(typeof l=="boolean"?(c=l,l=t):typeof s=="boolean"&&(c=s,s=t)),s===t&&l===t?(s=0,l=1):(s=xn(s),l===t?(l=s,s=0):l=xn(l)),s>l){var h=s;s=l,l=h}if(c||s%1||l%1){var g=kh();return Je(s+g*(l-s+e1("1e-"+((g+"").length-1))),l)}return Ba(s,l)}var xS=oi(function(s,l,c){return l=l.toLowerCase(),s+(c?np(l):l)});function np(s){return hu(ge(s).toLowerCase())}function rp(s){return s=ge(s),s&&s.replace(ky,d1).replace(Uy,"")}function ES(s,l,c){s=ge(s),l=yt(l);var h=s.length;c=c===t?h:pr(Q(c),0,h);var g=c;return c-=l.length,c>=0&&s.slice(c,g)==l}function kS(s){return s=ge(s),s&&sy.test(s)?s.replace(Lf,p1):s}function CS(s){return s=ge(s),s&&fy.test(s)?s.replace(la,"\\$&"):s}var AS=oi(function(s,l,c){return s+(c?"-":"")+l.toLowerCase()}),OS=oi(function(s,l,c){return s+(c?" ":"")+l.toLowerCase()}),TS=od("toLowerCase");function MS(s,l,c){s=ge(s),l=Q(l);var h=l?Qr(s):0;if(!l||h>=l)return s;var g=(l-h)/2;return bo(io(g),c)+s+bo(ro(g),c)}function IS(s,l,c){s=ge(s),l=Q(l);var h=l?Qr(s):0;return l&&h<l?s+bo(l-h,c):s}function NS(s,l,c){s=ge(s),l=Q(l);var h=l?Qr(s):0;return l&&h<l?bo(l-h,c)+s:s}function RS(s,l,c){return c||l==null?l=0:l&&(l=+l),H1(ge(s).replace(aa,""),l||0)}function LS(s,l,c){return(c?nt(s,l,c):l===t)?l=1:l=Q(l),Ha(ge(s),l)}function PS(){var s=arguments,l=ge(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var DS=oi(function(s,l,c){return s+(c?"_":"")+l.toLowerCase()});function FS(s,l,c){return c&&typeof c!="number"&&nt(s,l,c)&&(l=c=t),c=c===t?et:c>>>0,c?(s=ge(s),s&&(typeof l=="string"||l!=null&&!uu(l))&&(l=yt(l),!l&&Zr(s))?Fn(Ht(s),0,c):s.split(l,c)):[]}var $S=oi(function(s,l,c){return s+(c?" ":"")+hu(l)});function BS(s,l,c){return s=ge(s),c=c==null?0:pr(Q(c),0,s.length),l=yt(l),s.slice(c,c+l.length)==l}function HS(s,l,c){var h=b.templateSettings;c&&nt(s,l,c)&&(l=t),s=ge(s),l=Mo({},l,h,dd);var g=Mo({},l.imports,h.imports,dd),_=Fe(g),w=xa(g,_),x,k,M=0,I=l.interpolate||Vs,R="__p += '",B=ka((l.escape||Vs).source+"|"+I.source+"|"+(I===Pf?_y:Vs).source+"|"+(l.evaluate||Vs).source+"|$","g"),W="//# sourceURL="+(ye.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jy+"]")+`
45
+ `;s.replace(B,function(J,re,ae,_t,rt,vt){return ae||(ae=_t),R+=s.slice(M,vt).replace(Cy,m1),re&&(x=!0,R+=`' +
46
+ __e(`+re+`) +
47
+ '`),rt&&(k=!0,R+=`';
48
+ `+rt+`;
49
+ __p += '`),ae&&(R+=`' +
50
+ ((__t = (`+ae+`)) == null ? '' : __t) +
51
+ '`),M=vt+J.length,J}),R+=`';
52
+ `;var j=ye.call(l,"variable")&&l.variable;if(!j)R=`with (obj) {
53
+ `+R+`
54
+ }
55
+ `;else if(yy.test(j))throw new X(u);R=(k?R.replace(ty,""):R).replace(ny,"$1").replace(ry,"$1;"),R="function("+(j||"obj")+`) {
56
+ `+(j?"":`obj || (obj = {});
57
+ `)+"var __t, __p = ''"+(x?", __e = _.escape":"")+(k?`, __j = Array.prototype.join;
58
+ function print() { __p += __j.call(arguments, '') }
59
+ `:`;
60
+ `)+R+`return __p
61
+ }`;var te=sp(function(){return me(_,W+"return "+R).apply(t,w)});if(te.source=R,au(te))throw te;return te}function zS(s){return ge(s).toLowerCase()}function VS(s){return ge(s).toUpperCase()}function WS(s,l,c){if(s=ge(s),s&&(c||l===t))return ph(s);if(!s||!(l=yt(l)))return s;var h=Ht(s),g=Ht(l),_=mh(h,g),w=gh(h,g)+1;return Fn(h,_,w).join("")}function US(s,l,c){if(s=ge(s),s&&(c||l===t))return s.slice(0,bh(s)+1);if(!s||!(l=yt(l)))return s;var h=Ht(s),g=gh(h,Ht(l))+1;return Fn(h,0,g).join("")}function KS(s,l,c){if(s=ge(s),s&&(c||l===t))return s.replace(aa,"");if(!s||!(l=yt(l)))return s;var h=Ht(s),g=mh(h,Ht(l));return Fn(h,g).join("")}function qS(s,l){var c=Xl,h=Hi;if(Ee(l)){var g="separator"in l?l.separator:g;c="length"in l?Q(l.length):c,h="omission"in l?yt(l.omission):h}s=ge(s);var _=s.length;if(Zr(s)){var w=Ht(s);_=w.length}if(c>=_)return s;var x=c-Qr(h);if(x<1)return h;var k=w?Fn(w,0,x).join(""):s.slice(0,x);if(g===t)return k+h;if(w&&(x+=k.length-x),uu(g)){if(s.slice(x).search(g)){var M,I=k;for(g.global||(g=ka(g.source,ge(Df.exec(g))+"g")),g.lastIndex=0;M=g.exec(I);)var R=M.index;k=k.slice(0,R===t?x:R)}}else if(s.indexOf(yt(g),x)!=x){var B=k.lastIndexOf(g);B>-1&&(k=k.slice(0,B))}return k+h}function GS(s){return s=ge(s),s&&iy.test(s)?s.replace(Rf,S1):s}var jS=oi(function(s,l,c){return s+(c?" ":"")+l.toUpperCase()}),hu=od("toUpperCase");function ip(s,l,c){return s=ge(s),l=c?t:l,l===t?y1(s)?k1(s):a1(s):s.match(l)||[]}var sp=ne(function(s,l){try{return mt(s,t,l)}catch(c){return au(c)?c:new X(c)}}),JS=vn(function(s,l){return kt(l,function(c){c=tn(c),bn(s,c,ou(s[c],s))}),s});function YS(s){var l=s==null?0:s.length,c=G();return s=l?Se(s,function(h){if(typeof h[1]!="function")throw new Ct(a);return[c(h[0]),h[1]]}):[],ne(function(h){for(var g=-1;++g<l;){var _=s[g];if(mt(_[0],this,h))return mt(_[1],this,h)}})}function XS(s){return Sb(Ot(s,m))}function du(s){return function(){return s}}function ZS(s,l){return s==null||s!==s?l:s}var QS=ad(),ex=ad(!0);function ht(s){return s}function pu(s){return $h(typeof s=="function"?s:Ot(s,m))}function tx(s){return Hh(Ot(s,m))}function nx(s,l){return zh(s,Ot(l,m))}var rx=ne(function(s,l){return function(c){return ns(c,s,l)}}),ix=ne(function(s,l){return function(c){return ns(s,c,l)}});function mu(s,l,c){var h=Fe(l),g=co(l,h);c==null&&!(Ee(l)&&(g.length||!h.length))&&(c=l,l=s,s=this,g=co(l,Fe(l)));var _=!(Ee(c)&&"chain"in c)||!!c.chain,w=Sn(s);return kt(g,function(x){var k=l[x];s[x]=k,w&&(s.prototype[x]=function(){var M=this.__chain__;if(_||M){var I=s(this.__wrapped__),R=I.__actions__=ut(this.__actions__);return R.push({func:k,args:arguments,thisArg:s}),I.__chain__=M,I}return k.apply(s,In([this.value()],arguments))})}),s}function sx(){return Ve._===this&&(Ve._=I1),this}function gu(){}function ox(s){return s=Q(s),ne(function(l){return Vh(l,s)})}var lx=Ga(Se),ax=Ga(uh),ux=Ga(ba);function op(s){return eu(s)?_a(tn(s)):Bb(s)}function cx(s){return function(l){return s==null?t:mr(s,l)}}var fx=cd(),hx=cd(!0);function yu(){return[]}function bu(){return!1}function dx(){return{}}function px(){return""}function mx(){return!0}function gx(s,l){if(s=Q(s),s<1||s>je)return[];var c=et,h=Je(s,et);l=G(l),s-=et;for(var g=Sa(h,l);++c<s;)l(c);return g}function yx(s){return Z(s)?Se(s,tn):bt(s)?[s]:ut(Cd(ge(s)))}function bx(s){var l=++T1;return ge(s)+l}var _x=yo(function(s,l){return s+l},0),vx=ja("ceil"),wx=yo(function(s,l){return s/l},1),Sx=ja("floor");function xx(s){return s&&s.length?uo(s,ht,Ra):t}function Ex(s,l){return s&&s.length?uo(s,G(l,2),Ra):t}function kx(s){return hh(s,ht)}function Cx(s,l){return hh(s,G(l,2))}function Ax(s){return s&&s.length?uo(s,ht,Fa):t}function Ox(s,l){return s&&s.length?uo(s,G(l,2),Fa):t}var Tx=yo(function(s,l){return s*l},1),Mx=ja("round"),Ix=yo(function(s,l){return s-l},0);function Nx(s){return s&&s.length?wa(s,ht):0}function Rx(s,l){return s&&s.length?wa(s,G(l,2)):0}return b.after=tw,b.ary=Fd,b.assign=Vw,b.assignIn=Xd,b.assignInWith=Mo,b.assignWith=Ww,b.at=Uw,b.before=$d,b.bind=ou,b.bindAll=JS,b.bindKey=Bd,b.castArray=dw,b.chain=Ld,b.chunk=S_,b.compact=x_,b.concat=E_,b.cond=YS,b.conforms=XS,b.constant=du,b.countBy=Nv,b.create=Kw,b.curry=Hd,b.curryRight=zd,b.debounce=Vd,b.defaults=qw,b.defaultsDeep=Gw,b.defer=nw,b.delay=rw,b.difference=k_,b.differenceBy=C_,b.differenceWith=A_,b.drop=O_,b.dropRight=T_,b.dropRightWhile=M_,b.dropWhile=I_,b.fill=N_,b.filter=Lv,b.flatMap=Fv,b.flatMapDeep=$v,b.flatMapDepth=Bv,b.flatten=Md,b.flattenDeep=R_,b.flattenDepth=L_,b.flip=iw,b.flow=QS,b.flowRight=ex,b.fromPairs=P_,b.functions=eS,b.functionsIn=tS,b.groupBy=Hv,b.initial=F_,b.intersection=$_,b.intersectionBy=B_,b.intersectionWith=H_,b.invert=rS,b.invertBy=iS,b.invokeMap=Vv,b.iteratee=pu,b.keyBy=Wv,b.keys=Fe,b.keysIn=ft,b.map=Eo,b.mapKeys=oS,b.mapValues=lS,b.matches=tx,b.matchesProperty=nx,b.memoize=Co,b.merge=aS,b.mergeWith=Zd,b.method=rx,b.methodOf=ix,b.mixin=mu,b.negate=Ao,b.nthArg=ox,b.omit=uS,b.omitBy=cS,b.once=sw,b.orderBy=Uv,b.over=lx,b.overArgs=ow,b.overEvery=ax,b.overSome=ux,b.partial=lu,b.partialRight=Wd,b.partition=Kv,b.pick=fS,b.pickBy=Qd,b.property=op,b.propertyOf=cx,b.pull=U_,b.pullAll=Nd,b.pullAllBy=K_,b.pullAllWith=q_,b.pullAt=G_,b.range=fx,b.rangeRight=hx,b.rearg=lw,b.reject=jv,b.remove=j_,b.rest=aw,b.reverse=iu,b.sampleSize=Yv,b.set=dS,b.setWith=pS,b.shuffle=Xv,b.slice=J_,b.sortBy=ew,b.sortedUniq=nv,b.sortedUniqBy=rv,b.split=FS,b.spread=uw,b.tail=iv,b.take=sv,b.takeRight=ov,b.takeRightWhile=lv,b.takeWhile=av,b.tap=xv,b.throttle=cw,b.thru=xo,b.toArray=jd,b.toPairs=ep,b.toPairsIn=tp,b.toPath=yx,b.toPlainObject=Yd,b.transform=mS,b.unary=fw,b.union=uv,b.unionBy=cv,b.unionWith=fv,b.uniq=hv,b.uniqBy=dv,b.uniqWith=pv,b.unset=gS,b.unzip=su,b.unzipWith=Rd,b.update=yS,b.updateWith=bS,b.values=ui,b.valuesIn=_S,b.without=mv,b.words=ip,b.wrap=hw,b.xor=gv,b.xorBy=yv,b.xorWith=bv,b.zip=_v,b.zipObject=vv,b.zipObjectDeep=wv,b.zipWith=Sv,b.entries=ep,b.entriesIn=tp,b.extend=Xd,b.extendWith=Mo,mu(b,b),b.add=_x,b.attempt=sp,b.camelCase=xS,b.capitalize=np,b.ceil=vx,b.clamp=vS,b.clone=pw,b.cloneDeep=gw,b.cloneDeepWith=yw,b.cloneWith=mw,b.conformsTo=bw,b.deburr=rp,b.defaultTo=ZS,b.divide=wx,b.endsWith=ES,b.eq=Vt,b.escape=kS,b.escapeRegExp=CS,b.every=Rv,b.find=Pv,b.findIndex=Od,b.findKey=jw,b.findLast=Dv,b.findLastIndex=Td,b.findLastKey=Jw,b.floor=Sx,b.forEach=Pd,b.forEachRight=Dd,b.forIn=Yw,b.forInRight=Xw,b.forOwn=Zw,b.forOwnRight=Qw,b.get=cu,b.gt=_w,b.gte=vw,b.has=nS,b.hasIn=fu,b.head=Id,b.identity=ht,b.includes=zv,b.indexOf=D_,b.inRange=wS,b.invoke=sS,b.isArguments=br,b.isArray=Z,b.isArrayBuffer=ww,b.isArrayLike=ct,b.isArrayLikeObject=Oe,b.isBoolean=Sw,b.isBuffer=$n,b.isDate=xw,b.isElement=Ew,b.isEmpty=kw,b.isEqual=Cw,b.isEqualWith=Aw,b.isError=au,b.isFinite=Ow,b.isFunction=Sn,b.isInteger=Ud,b.isLength=Oo,b.isMap=Kd,b.isMatch=Tw,b.isMatchWith=Mw,b.isNaN=Iw,b.isNative=Nw,b.isNil=Lw,b.isNull=Rw,b.isNumber=qd,b.isObject=Ee,b.isObjectLike=Ce,b.isPlainObject=us,b.isRegExp=uu,b.isSafeInteger=Pw,b.isSet=Gd,b.isString=To,b.isSymbol=bt,b.isTypedArray=ai,b.isUndefined=Dw,b.isWeakMap=Fw,b.isWeakSet=$w,b.join=z_,b.kebabCase=AS,b.last=Mt,b.lastIndexOf=V_,b.lowerCase=OS,b.lowerFirst=TS,b.lt=Bw,b.lte=Hw,b.max=xx,b.maxBy=Ex,b.mean=kx,b.meanBy=Cx,b.min=Ax,b.minBy=Ox,b.stubArray=yu,b.stubFalse=bu,b.stubObject=dx,b.stubString=px,b.stubTrue=mx,b.multiply=Tx,b.nth=W_,b.noConflict=sx,b.noop=gu,b.now=ko,b.pad=MS,b.padEnd=IS,b.padStart=NS,b.parseInt=RS,b.random=SS,b.reduce=qv,b.reduceRight=Gv,b.repeat=LS,b.replace=PS,b.result=hS,b.round=Mx,b.runInContext=E,b.sample=Jv,b.size=Zv,b.snakeCase=DS,b.some=Qv,b.sortedIndex=Y_,b.sortedIndexBy=X_,b.sortedIndexOf=Z_,b.sortedLastIndex=Q_,b.sortedLastIndexBy=ev,b.sortedLastIndexOf=tv,b.startCase=$S,b.startsWith=BS,b.subtract=Ix,b.sum=Nx,b.sumBy=Rx,b.template=HS,b.times=gx,b.toFinite=xn,b.toInteger=Q,b.toLength=Jd,b.toLower=zS,b.toNumber=It,b.toSafeInteger=zw,b.toString=ge,b.toUpper=VS,b.trim=WS,b.trimEnd=US,b.trimStart=KS,b.truncate=qS,b.unescape=GS,b.uniqueId=bx,b.upperCase=jS,b.upperFirst=hu,b.each=Pd,b.eachRight=Dd,b.first=Id,mu(b,function(){var s={};return Qt(b,function(l,c){ye.call(b.prototype,c)||(s[c]=l)}),s}(),{chain:!1}),b.VERSION=r,kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){b[s].placeholder=b}),kt(["drop","take"],function(s,l){le.prototype[s]=function(c){c=c===t?1:De(Q(c),0);var h=this.__filtered__&&!l?new le(this):this.clone();return h.__filtered__?h.__takeCount__=Je(c,h.__takeCount__):h.__views__.push({size:Je(c,et),type:s+(h.__dir__<0?"Right":"")}),h},le.prototype[s+"Right"]=function(c){return this.reverse()[s](c).reverse()}}),kt(["filter","map","takeWhile"],function(s,l){var c=l+1,h=c==ur||c==Tn;le.prototype[s]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:G(g,3),type:c}),_.__filtered__=_.__filtered__||h,_}}),kt(["head","last"],function(s,l){var c="take"+(l?"Right":"");le.prototype[s]=function(){return this[c](1).value()[0]}}),kt(["initial","tail"],function(s,l){var c="drop"+(l?"":"Right");le.prototype[s]=function(){return this.__filtered__?new le(this):this[c](1)}}),le.prototype.compact=function(){return this.filter(ht)},le.prototype.find=function(s){return this.filter(s).head()},le.prototype.findLast=function(s){return this.reverse().find(s)},le.prototype.invokeMap=ne(function(s,l){return typeof s=="function"?new le(this):this.map(function(c){return ns(c,s,l)})}),le.prototype.reject=function(s){return this.filter(Ao(G(s)))},le.prototype.slice=function(s,l){s=Q(s);var c=this;return c.__filtered__&&(s>0||l<0)?new le(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),l!==t&&(l=Q(l),c=l<0?c.dropRight(-l):c.take(l-s)),c)},le.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},le.prototype.toArray=function(){return this.take(et)},Qt(le.prototype,function(s,l){var c=/^(?:filter|find|map|reject)|While$/.test(l),h=/^(?:head|last)$/.test(l),g=b[h?"take"+(l=="last"?"Right":""):l],_=h||/^find/.test(l);g&&(b.prototype[l]=function(){var w=this.__wrapped__,x=h?[1]:arguments,k=w instanceof le,M=x[0],I=k||Z(w),R=function(re){var ae=g.apply(b,In([re],x));return h&&B?ae[0]:ae};I&&c&&typeof M=="function"&&M.length!=1&&(k=I=!1);var B=this.__chain__,W=!!this.__actions__.length,j=_&&!B,te=k&&!W;if(!_&&I){w=te?w:new le(this);var J=s.apply(w,x);return J.__actions__.push({func:xo,args:[R],thisArg:t}),new At(J,B)}return j&&te?s.apply(this,x):(J=this.thru(R),j?h?J.value()[0]:J.value():J)})}),kt(["pop","push","shift","sort","splice","unshift"],function(s){var l=js[s],c=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",h=/^(?:pop|shift)$/.test(s);b.prototype[s]=function(){var g=arguments;if(h&&!this.__chain__){var _=this.value();return l.apply(Z(_)?_:[],g)}return this[c](function(w){return l.apply(Z(w)?w:[],g)})}}),Qt(le.prototype,function(s,l){var c=b[l];if(c){var h=c.name+"";ye.call(ri,h)||(ri[h]=[]),ri[h].push({name:l,func:c})}}),ri[go(t,N).name]=[{name:"wrapper",func:t}],le.prototype.clone=G1,le.prototype.reverse=j1,le.prototype.value=J1,b.prototype.at=Ev,b.prototype.chain=kv,b.prototype.commit=Cv,b.prototype.next=Av,b.prototype.plant=Tv,b.prototype.reverse=Mv,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=Iv,b.prototype.first=b.prototype.head,Ji&&(b.prototype[Ji]=Ov),b},ei=C1();cr?((cr.exports=ei)._=ei,pa._=ei):Ve._=ei}).call(cs)}(ql,ql.exports);var $0=ql.exports;function Sf(n){return n.type.create($0.cloneDeep(n.attrs))}const qM=Re.create({name:"node_processor",addCommands(){return{setBlockAttributes:P(({commands:n,state:e},t,r,i={})=>{const o=F(n.getBlockAttributes(t))??{},{doc:a,tr:u}=e,{from:f,to:d}=u.selection;a.nodesBetween(f,d,(p,m)=>{ee.blocks.includes(p.type.name)&&u.setNodeAttribute(m,t,{...i,...o,...r})})}),getBlockAttributes:P(({editor:n},e,t)=>fe(()=>{let r=Object.assign({},t||{});for(const i of ee.blocks)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:P(({commands:n},e)=>{for(const t of ee.blocks)n.resetAttributes(t,e)}),applyMark:P(({state:n,commands:e},t,r,i={})=>{const{tr:o,doc:a,schema:u}=n,{$from:f,$to:d}=o.selection,p=sn(ce.LINK,u),m=sn(t,u);if(!(m.spec.group||"").includes(Jt.SETTINGS))return e.setMark(t,r);if(f.pos===d.pos)return;const v=S=>{if(!i.onAppliedToParent||i.onAppliedToParent(S)===!1){const{tr:C,node:O,position:N,mark:q}=S;e._removeNodeMark({tr:C,node:O,position:N,mark:q.type})}};a.nodesBetween(f.pos,d.pos,(S,C)=>{if(S.type.name===ee.LIST)return;const O=KM(S.marks,t),N=m.create({...O?.attrs||{},...r}),q=D0(f,d,S,C);if(!p.isInSet(S.marks)&&UM(o.doc,C,N,i.isAppliedToParent))return v({tr:o,node:S,position:C,mark:N});if(S.isText){o.addMark(q.from,q.to,N);return}VM(o.doc,o.selection,S,C)&&o.addNodeMark(C,N)})}),getMarks:P(({editor:n},e)=>{const t=hi(n,"state");return fe(()=>{const{selection:r,doc:i}=F(t),{from:o,to:a}=F(r),u=[];return i.nodesBetween(o,a,f=>{for(const d of f.marks)d.type.name===e&&u.unshift(d.attrs)}),u})}),getMark:P(({commands:n},e)=>{const t=n.getMarks(e);return fe(()=>F(t)[0]??null)}),hasMark:P(({commands:n},e)=>{const t=n.getMark(e);return fe(()=>!!F(t))}),getCommonSettingMark:P(({commands:n},e,t)=>{const r=n.getMark(e);return fe(()=>F(r)?.value??F(t))}),getDeviceSettingMark:P(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return fe(()=>{for(const o of F(r)){const a=o[F(i)];if(a)return a}return F(t)})}),removeAllMarks:P(({state:n,commands:e})=>{const{tr:t,doc:r}=n,{from:i,to:o}=t.selection;r.nodesBetween(i,o,(a,u)=>{for(const f of a.marks)e._removeNodeMark({tr:t,node:a,position:u,mark:f})})}),removeMarks:P(({state:n,commands:e},t)=>{const{tr:r,doc:i}=n,{from:o,to:a}=r.selection;i.nodesBetween(o,a,(u,f)=>{const d=u.marks.filter(p=>t.includes(p.type.name));for(const p of d)e._removeNodeMark({tr:r,node:u,position:f,mark:p})})}),_removeNodeMark:P((n,{tr:e,node:t,position:r,mark:i})=>t.isText?e.removeMark(r,r+t.nodeSize,i):e.removeNodeMark(r,i))}}}),GM=Re.create({name:"text_processor",addCommands(){return{getSelectedText:P(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:P(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,o)=>{if(!i.isText)return;const a=D0(t,r,i,o),u=Math.max(0,t.pos-o),f=Math.max(0,r.pos-o),d=e({text:i.textContent.substring(u,f)}),p=n.schema.text(d,i.marks);n.tr.replaceWith(a.from,a.to,p)})})}}}),jM=Re.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:P(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:P(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:P(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;n.doc.nodesBetween(r,i,(o,a,u)=>{if(t({node:o,parent:u})){const f=o.isText?0:F0(n.doc,a);r=Math.min(r,a+f),i=Math.max(i,a+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:P(({commands:n})=>{n.expandSelection(({parent:e})=>e.type.name===ee.DOCUMENT)})}}}),JM=On.create({name:"doc",topNode:!0,content:"block+"});class Fs extends Xe{constructor(e,t,r,i="SetDocAttr"){super(),this.key=e,this.value=t,this.schema=r,this.stepType=i}apply(e){this.prevValue=e.attrs.meta[this.key];const t=Or.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Le.ok(t)}invert(){return new Fs(this.key,this.prevValue,this.schema,"revertSetDocAttr")}map(){return null}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}static fromJSON(e){return new Fs(e.key,e.value,e.stepType)}}Xe.jsonID("setDocAttr",Fs);const YM=JM.extend({marks:Jt.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:P(({state:n},e,t)=>{n.tr.step(new Fs(e,t,n.schema))})}}}),XM=On.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ci(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ZM=XM.extend({marks:Jt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),QM=On.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ci(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>$T({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),eI=QM.extend({marks:Jt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),tI=Re.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[XT.create(this.editor),ZT.create(this.editor)]}}),nI=()=>[YM,ZM,eI,zT,YT,qM,GM,jM,tI],rI=xt.create({name:ce.FONT_FAMILY,group:Jt.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:P(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=F(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(ce.FONT_STYLE).value;!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:P(({commands:n})=>{const e=F(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return fe(()=>n.findFontByName(F(r))||t)}),findFontByName:P((n,e)=>F(this.options.fonts).find(t=>t.name===e)),getFontFamily:P(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:P(({commands:n})=>{const e=n.getPreset();return fe(()=>F(e).common.font_family)})}},parseHTML(){const n=e=>({value:e.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:n},{style:"font-family",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.value?`"${n.value}"`:null;return $r({font_family:e})}}),iI=Re.create({name:ce.STYLE_PRESET,addGlobalAttributes(){return[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{preset:{isRequired:!1,default:{id:F(this.options.defaultId)},parseHTML:n=>{const e=F(this.options.presets);if(n.parentElement.tagName==="LI")return null;for(const{id:t,node:r,fallbackClass:i}of e){if(i&&n.classList.contains(i))return{id:t};const o=F(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(o))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:F(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:F(this.options.styleRenderer).makePresetHtmlClass(n.preset)}:null}}}]},addCommands(){function n(t,r){return t.find(i=>r===i.id)}function e(t,r){const i={};for(const o of Object.keys(t)){const a=t[o],u=r[o],f=!u||u.toLowerCase()==="inherit";i[o]=f?a:u}return i}return{getPresetList:P(()=>fe(()=>F(this.options.presets).filter(t=>!t.hidden))),getPreset:P(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:F(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),a=t.getLinkPreset();return fe(()=>{const u=n(F(i),F(r).id);if(!F(o))return u;const f=F(a);return{id:u.id,common:e(u.common,f.common),mobile:e(u.mobile,f.mobile),tablet:e(u.tablet,f.tablet),desktop:e(u.desktop,f.desktop)}})}),applyPreset:P(({commands:t,chain:r},i)=>{const o=F(t.getPresetList()),a=n(o,i),u=a.node?.type??ee.PARAGRAPH,f={preset:{id:i}};a.node&&(f.level=a.node.level);for(const d of ce.attributes)f[d]=F(t.getBlockAttributes(d));r().removeList().setNode(u,f).run()}),applyDefaultPreset:P(({commands:t})=>{t.applyPreset(F(this.options.defaultId))}),removePreset:P(({commands:t})=>{t.setNode(ee.PARAGRAPH,{preset:null})}),getPresetCustomization:P(({editor:t,commands:r})=>{const i=hi(t,"state");return fe(()=>{const{selection:o,doc:a}=F(i),{from:u,to:f}=o;return r._getSettingCustomization(a,u,f)})}),isSettingCustomized:P(({commands:t},r)=>{const i=t.getPresetCustomization(),o=ce.presetAttributes.includes(r)?"attributes":"marks";return fe(()=>F(i)[o]?.includes(r)??!1)}),getContentCustomization:P(({editor:t,commands:r})=>{const i=hi(t,"state");return fe(()=>{const{doc:o}=F(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:P((t,r,i,o)=>{const a=new Set,u=new Set;return r.nodesBetween(i,o,f=>{for(const[d,p]of Object.entries(f.attrs))ce.presetAttributes.includes(d)&&p&&u.add(d);for(const{type:d}of f.marks)ce.marks.includes(d.name)&&a.add(d.name)}),{attributes:Array.from(u),marks:Array.from(a)}}),removePresetCustomization:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(ce.marks).resetAttributes(ee.PARAGRAPH,ce.presetAttributes).resetAttributes(ee.HEADING,ce.presetAttributes).restoreSelection().run()}),removeFormat:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Li.head,F(this.options.presets))}}),sI=xt.create({name:ce.FONT_WEIGHT,group:Jt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:P(({commands:n},e)=>{n.applyMark(this.name,{value:e}),F(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:P(({commands:n})=>{const e=F(n.getFontWeight()),t=F(n.getFont()),i=Number(e)>=600?"400":"700",o=t.findClosestWeight(i);n.applyFontWeight(o)}),getFontWeight:P(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return fe(()=>{const r=F(e),i=F(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:P(({commands:n})=>{const e=n.getPreset();return fe(()=>F(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Dt("toggleBold"),"Mod-B":Dt("toggleBold")}),parseHTML(){const n=e=>e==="bold"?{value:"700"}:Number(e)?{value:e}:!1;return[{style:"--zw-font-weight",getAttrs:n},{style:"font-weight",getAttrs:n},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML({HTMLAttributes:n}){return $r({font_weight:n.value})}}),oI=xt.create({name:ce.FONT_SIZE,group:Jt.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:P(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return fe(()=>F(t)[F(e)].font_size.replace("px",""))}),applyFontSize:P(({commands:n},e)=>{const t=F(n.getDevice());n.applyMark(this.name,{[t]:e},{isAppliedToParent:(r,i)=>r.type.name!==i.type.name?!1:r.attrs[t]===i.attrs[t],onAppliedToParent:({tr:r,node:i,position:o,mark:a})=>{const u={...a.attrs,[t]:null};if(!Object.values(u).some(p=>!!p))return!1;const d=a.type.create(u);if(i.isText){r.addMark(o,o+i.nodeSize,d);return}r.addNodeMark(o,d)}})}),increaseFontSize:P(({commands:n})=>{const e=Number(F(n.getFontSize())),t=Math.min(e+1,F(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:P(({commands:n})=>{const e=Number(F(n.getFontSize())),t=Math.max(e-1,F(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Dt("increaseFontSize"),"Mod-Shift--":Dt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=F(this.options.wrapperRef),r=P0(e,t);return String(r)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-font-size-mobile")),tablet:n(e.getPropertyValue("--zw-font-size-tablet")),desktop:n(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:null}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return $r({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),lI=xt.create({name:ce.FONT_COLOR,group:Jt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:P(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:P(({commands:n})=>{const e=n.getPreset();return fe(()=>F(e).common.color)}),applyFontColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:L0(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return $r({font_color:n.value})}}),aI=xt.create({name:ce.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:P(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:L0(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return $r({background_color:n.value})}}),uI=Re.create({name:"device_manager",addCommands(){return{getDevice:P(()=>hi(this.options,"device"))}}}),cI=xt.create({name:ce.FONT_STYLE,group:Jt.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return fe(()=>F(e)?.italic??F(t).italic)}),isItalicAvailable:P(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return fe(()=>{const r=F(e),i=F(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:P(({commands:n})=>{const e=n.getPreset();return fe(()=>({italic:F(e).common.font_style==="italic"}))}),toggleItalic:P(({commands:n})=>{F(n.isItalicAvailable())&&(F(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:P(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:P(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Dt("toggleItalic"),"Mod-I":Dt("toggleItalic")}),parseHTML(){const n=e=>({italic:e.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:n},{style:"font-style",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.italic?"italic":"normal";return $r({font_style:e})}}),fI=xt.create({name:ce.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:P(({commands:n})=>{const e=n.getTextDecoration();return fe(()=>F(e).underline)}),isStrikeThrough:P(({commands:n})=>{const e=n.getTextDecoration();return fe(()=>F(e).strike_through)}),getTextDecoration:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return fe(()=>{const r=F(e)??{},i=F(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:P(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return fe(()=>F(e)!==F(t).underline)}),getDefaultTextDecoration:P(({commands:n})=>{const e=n.getPreset();return fe(()=>{const{text_decoration:t}=F(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:P(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:P(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:P(({commands:n},e,t=null)=>{const r=F(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:P(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:P(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Dt("toggleUnderline"),"Mod-U":Dt("toggleUnderline")}),parseHTML(){const n=e=>{const t=e.includes("underline"),r=e.includes("line-through");return!t&&!r?!1:{underline:t,strike_through:r}};return[{style:"--zw-text-decoration",getAttrs:n},{style:"text-decoration-line",getAttrs:n},{style:"text-decoration",getAttrs:n},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:n}){const e=[];return n.underline&&e.push("underline"),n.strike_through&&e.push("line-through"),e.length||e.push("none"),$r({text_decoration:e.join(" ")})}}),hI=Re.create({name:"case_style",addCommands(){return{applyCaseStyle:P(({commands:n},e)=>{switch(e){case jc.CAPITALIZE:return n.applyCapitalize();case jc.LOWERCASE:return n.applyLowerCase();case jc.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:P(({commands:n})=>{n.transformText(({text:e})=>_M(e))}),applyLowerCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),B0={mobile:null,tablet:null,desktop:null},dI=Re.create({name:ce.ALIGNMENT,addGlobalAttributes:()=>[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{[ce.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=zM(n.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const t=n.getPropertyValue("--zw-alignment-mobile")||null,r=n.getPropertyValue("--zw-alignment-tablet")||null,i=n.getPropertyValue("--zw-alignment-desktop")||null;return!t&&!r&&!i?null:{desktop:i,tablet:r,mobile:t}},renderHTML(n){return n.alignment?Kl({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:P(({commands:n},e)=>{const t=F(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},B0)}),removeAlignment:P(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,B0),t=n.getDevice(),r=n.getDefaultAlignment();return fe(()=>F(e)?.[F(t)]??F(r))}),getDefaultAlignment:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return fe(()=>F(t)[F(e)].alignment??er.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Dt("applyAlignment",er.LEFT),"Mod-Shift-e":Dt("applyAlignment",er.CENTER),"Mod-Shift-r":Dt("applyAlignment",er.RIGHT),"Mod-Shift-j":Dt("applyAlignment",er.JUSTIFY)})}),H0={mobile:null,tablet:null,desktop:null},pI=Re.create({name:ce.LINE_HEIGHT,addGlobalAttributes(){return[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{[ce.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const o=n.style.getPropertyValue("--zw-line-height-tablet")||null,a=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:o,desktop:a}}const e=n.style.lineHeight;if(!e)return null;const t=F(this.options.wrapperRef),r=BM(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?Kl({line_height_mobile:n.line_height.mobile,line_height_tablet:n.line_height.tablet,line_height_desktop:n.line_height.desktop}):null}}}}]},addCommands(){return{getLineHeight:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,H0),t=n.getDevice(),r=n.getDefaultLineHeight();return fe(()=>F(e)?.[F(t)]??F(r))}),getDefaultLineHeight:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return fe(()=>F(t)[F(e)].line_height)}),applyLineHeight:P(({commands:n},e)=>{const t=F(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},H0)})}}}),mI=On.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ci(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),gI=mI.extend({name:ee.LIST_ITEM,marks:Jt.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:P(({commands:e,tr:t})=>{const r=t.doc.nodeAt(n(t));if(!t.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=n(t);for(const a of r.marks)t.addNodeMark(o,Sf(a));return!0})}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:n=>{const{state:e,commands:t}=n.editor;if(e.selection.$cursor?.path.some(i=>i.type?.name===ee.LIST))return t.listItemNewline()}})}),yI=On.create({name:ee.LIST,content:`${ee.LIST_ITEM}+`,group:"block list",marks:Jt.SETTINGS,addExtensions:()=>[gI],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:Lt.DISC}}}),parseHTML(){const n={a:Lt.ROMAN,i:Lt.LATIN,1:Lt.DECIMAL},e=t=>{for(const r of Lt.values){const i=`.${F(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Lt.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Lt.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[F(this.options.baseClass)+n.bullet.type,F(this.options.presetClass)];return[Lt.ordered.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:P(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return fe(()=>F(e).type??null)}),applyList:P(({commands:n,chain:e},t)=>{if(F(n.getListType())===t){n.removeList();return}return e().applyDefaultPreset().toggleList(ee.LIST,ee.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({commands:i,tr:o})=>i._bubbleListItemMarks(o)).run()}),_bubbleListItemMarks:P((n,e)=>{const{doc:t,selection:r}=e,i=r.$from.start(),o=r.$to.end();function a(u,f){if(ce.inlineMarks.includes(f.type)||f.type.isInSet(u.marks))return!1;for(const d of u.content.content)if(d.childCount&&(!d.marks||!f.isInSet(d.marks)))return!1;return!0}t.nodesBetween(i,o,(u,f)=>{if(u.type.name===ee.LIST)return;if(u.type.name!==ee.LIST_ITEM)return!1;const d=[];return u.forEach(p=>{for(const m of p.marks){if(m.isInSet(d)){e.removeNodeMark(f+1,m);continue}a(u,m)&&(e.removeNodeMark(f+1,m),e.addNodeMark(f,Sf(m)),d.push(m))}}),!1})}),removeList:P(({commands:n,state:e})=>{const{tr:t,doc:r,selection:i}=e,o=i.$from.start(),a=i.$to.end();r.nodesBetween(o,a,(u,f,d)=>{if([ee.LIST,ee.LIST_ITEM].includes(u.type.name))return;if(d.type.name!==ee.LIST_ITEM)return!1;const p=d.marks.filter(function(m){return!m.type.isInSet(u.marks)});for(const m of p)t.addNodeMark(f,Sf(m));return!1}),n.liftListItem(ee.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>BT({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(Lt.DISC,/^\s*([-+*])\s$/),n(Lt.DECIMAL,/^(\d+)\.\s$/),n(Lt.LATIN,/^([ivx]{1,3})\.\s$/i),n(Lt.ROMAN,/^([a-z])\.\s$/i)]}});function bI(n){return new wt({key:new Gt("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(d=>d.docChanged)&&!t.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=r,u=lT(t.doc,[...e]);if(gT(u).forEach(({newRange:d})=>{const p=uT(r.doc,d,v=>v.isTextblock);let m,y;if(p.length>1?(m=p[0],y=r.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ")):p.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(m=p[0],y=r.doc.textBetween(m.pos,d.to,void 0," ")),m&&y){const v=y.split(" ").filter(O=>O!=="");if(v.length<=0)return!1;const S=v[v.length-1],C=m.pos+y.lastIndexOf(S);if(!S)return!1;mf(S).filter(O=>O.isLink).map(O=>({...O,from:C+O.start+1,to:C+O.end+1})).filter(O=>r.schema.marks.code?!r.doc.rangeHasMark(O.from,O.to,r.schema.marks.code):!0).filter(O=>n.validate?n.validate(O.value):!0).forEach(O=>{t0(O.from,O.to,r.doc).some(N=>N.mark.type===n.type)||a.addMark(O.from,O.to,n.type.create({href:O.href}))})}}),!!a.steps.length)return a}})}function _I(n){return new wt({key:new Gt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const u=dT(e.state,n.type.name),f=r.target,d=(i=f?.href)!==null&&i!==void 0?i:u.href,p=(o=f?.target)!==null&&o!==void 0?o:u.target;return f&&d?(e.editable&&window.open(d,p),!0):!1}}})}function vI(n){return new wt({key:new Gt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{var i;const{state:o}=e,{selection:a}=o,{empty:u}=a;if(u)return!1;let f="";r.content.forEach(S=>{f+=S.textContent});const d=mf(f).find(S=>S.isLink&&S.value===f);if(!f||!d)return!1;const p=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/html"),m=/href="([^"]*)"/,y=p?.match(m),v=y?y[1]:d.href;return n.editor.commands.setMark(n.type,{href:v}),!0}}})}const wI=xt.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){k0(n);return}k0(n.scheme,n.optionalSlashes)})},onDestroy(){mM()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){var e;return!((e=n.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",Ci(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Ci(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[HT({find:n=>mf(n).filter(e=>this.options.validate?this.options.validate(e.value):!0).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:(n,e)=>{var t,r;const i=(t=e?.clipboardData)===null||t===void 0?void 0:t.getData("text/html"),o=/href="([^"]*)"/,a=i?.match(o);return a?{href:a[1]}:{href:(r=n.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(bI({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(_I({type:this.type})),this.options.linkOnPaste&&n.push(vI({editor:this.editor,type:this.type})),n}}),SI=wI.extend({name:ce.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:n=>{const e=n.getAttribute("href");return e.startsWith("#")?parseFloat(n.getAttribute("href").replace("#","")):e}},target:{default:f0.SELF,parseHTML:n=>n.getAttribute("target")||f0.SELF},destination:{default:Os.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Os.URL;const t=e.replace("#","");return F(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Os.BLOCK:Os.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:P(({commands:e,chain:t},r)=>(e.setMeta("preventAutolink",!0),e.getSelectedText()?t().applyMark(this.name,r).expandSelectionToLink().command(({tr:i})=>(r.text&&i.insertText(r.text,i.selection.from,i.selection.to),!0)).run():e.insertContent(V0.text(r.text,[V0.mark(ce.LINK,r)])))),expandSelectionToLink:P(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:P(({commands:e})=>e.hasMark(this.name)),getLinkPreset:P(()=>fe(()=>F(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),bM.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Os.BLOCK?`#${n.href}`:n.href,t=F(this.options.basePresetClass)+F(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),xI=xt.create({name:ce.SUPERSCRIPT,addCommands(){return{applySuperscript:P(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:P(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:P(({commands:n})=>{F(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:P(({commands:n})=>{const e=n.getMark(this.name);return fe(()=>!!F(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),EI=Re.create({name:ce.MARGIN,addGlobalAttributes:()=>[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{[ce.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:o}=n.style;return[e,t,r,i,o].some(f=>!!f)?e?{value:e}:{value:[t||0,r||0,i||0,o||0].join(" ")}:null},renderHTML(n){return n.margin?Kl({margin:n.margin.value}):null}}}}]});function kI(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=Fu({default:null,link:null});return _k(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),nI().concat([iI.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new OI({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),yI.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),uI.configure({device:n.deviceRef}),oI.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),rI.configure({fonts:n.fonts,defaultPreset:hi(t,"default")}),sI,lI,aI,cI,fI,hI,xI,dI,pI.configure({wrapperRef:n.wrapperRef}),SI.configure({preset:hi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),EI])}class CI{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class z0{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class fn extends z0{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=fn.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:e,parser:t}){super({content:e}),this._parser=t,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,e=>e.tagName==="BR"),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,e=>e.tagName==="LI"),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const e=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(e,t=>t.remove())}_normalizeRootTags(){const e=Array.from(this.dom.body.childNodes),t=this.dom.createDocumentFragment();let r;for(const i of e){if(this._isRootNode(i)){t.append(i),r=null;continue}r||(r=this.dom.createElement("p"),t.append(r)),r.append(i)}this.dom.body.innerHTML="",this.dom.body.append(t)}_createNodeIterator(e,t){return this.dom.createNodeIterator(this.dom.body,e,t)}_iterateNodes(e,t=()=>!0){const r=o=>o.tagName!=="BODY"&&t.call(this,o),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:o=>r(o)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(i,e)}_runIterator(e,t){let r=e.nextNode();for(;r;)t.call(this,r),r=e.nextNode()}_removeEmptyNodes(e){e.innerHTML.trim()||e.remove()}_normalizeListItems(e){const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes);let i,o;const a=u=>{this._assignElementProperties(u,e,fn.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,fn.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){a(u),i=null,o=u;continue}if(u.tagName==="BR"&&o&&o?.tagName!=="BR"){u.remove(),o=u;continue}if(u.tagName==="BR"){const f=this.dom.createElement("p");f.append(u),a(f),i=null,o=u;continue}i||(i=this.dom.createElement("p"),a(i)),i.append(u),o=u}e.append(t),this._removeStyleProperties(e,fn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,fn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return fn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return fn.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const o=t.style.getPropertyValue(i);o&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,o)}}_removeStyleProperties(e,t=Array.from(e.style)){for(const r of t)e.style.removeProperty(r);e.style.length===0&&e.removeAttribute("style")}_normalizeBreakLines({parentElement:e}){if(!this._isBlockNode(e)||!e.textContent)return;const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes),i=e.cloneNode(!0);i.innerHTML="";let o=i.cloneNode();const a=u=>{this._assignElementProperties(u,e,fn.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){a(o),o=i.cloneNode();continue}o.append(u)}t.append(o),e.replaceWith(t)}_normalizeBlockTextDecoration(){const e=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveTextDecorationToChildren(t)}_moveTextDecorationToChildren(e){const t=this._parseTextDecoration(e);if(e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration"),e.style.cssText||e.removeAttribute("style"),!t.none)for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=this._parseTextDecoration(i),a={underline:o.underline||t.underline,line_through:o.line_through||t.line_through};i.style.removeProperty("text-decoration-line"),i.style.removeProperty("text-decoration"),i.style.textDecoration=Object.entries(a).filter(([,u])=>u).map(([u])=>u.replace("_","-")).join(" ")}}_parseTextDecoration(e){const{textDecoration:t,textDecorationLine:r}=e.style,i=t||r||"";return{none:i.includes("none"),underline:i.includes("underline"),line_through:i.includes("line-through")}}_normalizeBlockBackgroundColor(){const e=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveBackgroundColorToChildren(t)}_moveBackgroundColorToChildren(e){const t=e.style.backgroundColor;e.style.removeProperty("background-color"),e.style.cssText||e.removeAttribute("style");for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=i.style.backgroundColor||t;i.style.backgroundColor=o}}_wrapTextNode(e,t){if(t.nodeType!==this._Node.TEXT_NODE)return t;const r=this.dom.createElement("span");return r.append(t.cloneNode()),e.replaceChild(r,t),r}}class AI extends z0{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(e){this._iterateChildNodes(this.content,e)}_iterateChildNodes(e,t){for(const r of e.content)r.content&&this._iterateChildNodes(r,t),t.call(this,r)}_bubbleMarks(e){if(e.content&&e.type!==ee.LIST){for(const t of e.content)if(!this._isLink(t)&&t.marks)for(const r of t.marks.slice()){if(this._includesMark(e,r)){this._removeMark(t,r);continue}this._canBubbleMark(e,r)&&(this._removeMark(t,r),this._addMark(e,r))}}}_canBubbleMark(e,t){if(ce.inlineMarks.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===ee.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>$0.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===ee.TEXT&&this._includesMarkType(e,ce.LINK)}_removeMark(e,t){if(!e.marks)return;const r=this._findMarkIndexByType(e,t.type);r>=0&&e.marks.splice(r,1),e.marks.length||delete e.marks}_addMark(e,t){this._removeMark(e,t),e.marks??=[],e.marks.push(t)}_findMarkIndexByType(e,t){return e.marks?.findIndex(r=>r.type===t)??null}}class Yl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new fn({content:e,parser:t.parser||new CI})}static _buildJson(e){return new AI({content:e})}static normalize(e,t={}){return Yl.build(e,t).normalize()}}class Li{static window=globalThis.window;static use(e){this.window=e}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(e){return this.window.getComputedStyle(e)}}class Tf{static build({config:e,nodeDomParser:t}){const r=kI({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:Wo(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:Wo(Gc.DESKTOP),pageBlocksRef:Wo([]),wrapperRef:Li.document.createElement("p")}),i=fT(r);return new Tf({schema:i,domParser:tc.fromSchema(i),nodeDomParser:t})}_schema;_domParser;_nodeDomParser;constructor({schema:e,domParser:t,nodeDomParser:r}){this._schema=e,this._domParser=t,this._nodeDomParser=r}toJSON(e){const t=Yl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class V0{static doc(e){return{type:ee.DOCUMENT,content:e}}static list(e,t){return{type:ee.LIST,attrs:{bullet:{type:e}},content:t.map(r=>r.type===ee.LIST_ITEM?r:this.listItem([].concat(r)))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{type:ee.LIST_ITEM,...t?{attrs:t}:{},...i?{marks:i}:{},content:[].concat(r).map(o=>typeof o=="string"?this.paragraph(o):o)}}static heading(e,...t){const r=this._textBlock(t,this.text);return r.attrs??={},r.attrs.level=e,{type:ee.HEADING,...r}}static paragraph(...e){return{type:ee.PARAGRAPH,...this._textBlock(e,this.text)}}static _textBlock(e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:r,...t?{attrs:t}:{},...i?{marks:i}:{}}}static _normalizeTextBlockArgs(e){return e.length===1?{attrs:null,marks:null,content:e[0]}:e.length===2?{attrs:e[0],marks:null,content:e[1]}:{attrs:e[0],marks:e[1],content:e[2]}}static text(e,t){return{type:ee.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(ce.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class OI{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:e,makeVariable:t,linkPresetId:r}){this._baseClass=e,this._makeVariable=t,this._linkPresetId=r}inject(e,t){let r=e.querySelector("[data-zw-styles]");r||(r=Li.document.createElement("style"),r.dataset.zwStyles="",r.innerHTML=this.render(t),e.append(r))}render(e){let t="";for(const r of e){const i=r.id===this._linkPresetId,o=this.makePresetCssClass(r);t+=` ${o} {`;for(const a of Gc.values)for(const u of Object.keys(r[a])){const f=this._makeVariable({device:a,preset:r,property:u}),d=this._makeInternalVariableName(u,a);if(t+=`${d}: var(${f}, inherit);`,i&&!ce.attributes.includes(u)){const p=d.replace("preset-","");t+=`${p}: var(${d});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===Gc.COMMON?"":`-${t}`;return`--zw-preset-${r}${i}`}makePresetHtmlClass(e){return this._baseClass+e.id}makePresetCssClass(e){return this.makePresetHtmlClass(e).split(" ").map(t=>`.${t}`).join("")}}class Mf{static _instance;static get instance(){return this._instance??=new Mf,this._instance}static query(e,t){return this.instance.query(e,t)}query(e,t){let r=null;return e.descendants(i=>{if(r)return!1;if(this.matchNode(i,t))return r=i,!1}),r?t.getMark?this.getMark(r,t.getMark):r:null}matchNode(e,t){return!(t.typeName&&t.typeName!==e.type.name||t.mark&&!this.getMark(e,t.mark))}getMark(e,t){return e.marks.find(r=>this.matchMark(r,t))||null}matchMark(e,t){return e.type.name===t.typeName}}class W0{static createWindow(){return new ap.JSDOM().window}types;parse(e){const{window:t}=new ap.JSDOM(e);return this.types=t,t.document}}class U0{name;description;argument;options=[];doCommand(){throw new Error('Command "doCommand" is required')}install(e){if(!this.name)throw new Error('Command "name" is required');let t=e.command(this.name);if(this.description&&(t=t.description(this.description)),this.argument&&(t=t.argument(this.argument)),this.options.length)for(const r of this.options)t=t.option(r.flags,r.description,r.default);t.action(this.doCommand.bind(this))}output(e){console.log(e)}}class TI extends U0{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:_u.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(e,{config:t,format:r}){Li.use(W0.createWindow());const i=_u.resolve(process.cwd(),t),o=Tf.build({config:require(i).editor,nodeDomParser:new W0}),a=e.map(d=>o.toJSON(this._formatInputHtml(d))),u=a.length===1?a[0]:a,f=this._stringifyContent(u);this.output(r==="rb"?this._formatOutputRb(f):f)}_formatInputHtml(e){return e.replace(/\\(["'])/g,"$1").replace(/rgba\(\d{1,3}, ?\d{1,3}, ?\d{1,3}, (\d{1,2}%)\)/g,(t,r)=>t.replace(r,parseFloat(r)/100))}_stringifyContent(e){return JSON.stringify(e,(r,i)=>i===null?void 0:i,2)}_formatOutputRb(e){return e.replace(/\\"/g,'"').replace(/font-family: ?'(.+)'/g,'font-family: "$1"').replace(/'/g,"\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,t=>t.replace(/"/g,"")).replace(/: "(.+)"([,\n])/g,": '$1'$2")}}var MI="4.4.0-dev.1";class II extends U0{name="version";description="display cli version";doCommand(){this.output(MI)}}const K0=new sE,NI=[TI,II];for(const n of NI)new n().install(K0);K0.parse();