@zipify/wysiwyg 4.7.0-0 → 4.8.0-beta.0
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 +45 -45
- package/dist/node.js +28 -28
- package/dist/wysiwyg.mjs +3 -3
- package/lib/components/base/colorPicker/ColorPicker.vue +1 -0
- package/lib/utils/convertColor.js +2 -4
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`).replace(/^/gm," ".repeat(u))}let p=[`Usage: ${i.commandUsage(r)}`,""];const
|
|
3
|
-
`)}padWidth(r,i){return Math.max(i.longestOptionTermLength(r,i),i.longestGlobalOptionTermLength(r,i),i.longestSubcommandTermLength(r,i),i.longestArgumentTermLength(r,i))}wrap(r,i,o,
|
|
1
|
+
"use strict";var t5=require("node:events"),n5=require("node:child_process"),r5=require("node:path"),i5=require("node:fs"),s5=require("node:process"),qp=require("path"),Kp=require("jsdom"),qo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o5(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var It={},Ko={},Go={},Gp;function Jo(){if(Gp)return Go;Gp=1;class n extends Error{constructor(r,i,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=i,this.exitCode=r,this.nestedError=void 0}}class e extends n{constructor(r){super(1,"commander.invalidArgument",r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}return Go.CommanderError=n,Go.InvalidArgumentError=e,Go}var Jp;function Gu(){if(Jp)return Ko;Jp=1;const{InvalidArgumentError:n}=Jo();class e{constructor(i,o){switch(this.description=o||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,i[0]){case"<":this.required=!0,this._name=i.slice(1,-1);break;case"[":this.required=!1,this._name=i.slice(1,-1);break;default:this.required=!0,this._name=i;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(i,o){return o===this.defaultValue||!Array.isArray(o)?[i]:o.concat(i)}default(i,o){return this.defaultValue=i,this.defaultValueDescription=o,this}argParser(i){return this.parseArg=i,this}choices(i){return this.argChoices=i.slice(),this.parseArg=(o,a)=>{if(!this.argChoices.includes(o))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(o,a):o},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function t(r){const i=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+i+">":"["+i+"]"}return Ko.Argument=e,Ko.humanReadableArgName=t,Ko}var Ju={},ju={},jp;function Yp(){if(jp)return ju;jp=1;const{humanReadableArgName:n}=Gu();class e{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(r){const i=r.commands.filter(a=>!a._hidden),o=r._getHelpCommand();return o&&!o._hidden&&i.push(o),this.sortSubcommands&&i.sort((a,u)=>a.name().localeCompare(u.name())),i}compareOptions(r,i){const o=a=>a.short?a.short.replace(/^-/,""):a.long.replace(/^--/,"");return o(r).localeCompare(o(i))}visibleOptions(r){const i=r.options.filter(a=>!a.hidden),o=r._getHelpOption();if(o&&!o.hidden){const a=o.short&&r._findOption(o.short),u=o.long&&r._findOption(o.long);!a&&!u?i.push(o):o.long&&!u?i.push(r.createOption(o.long,o.description)):o.short&&!a&&i.push(r.createOption(o.short,o.description))}return this.sortOptions&&i.sort(this.compareOptions),i}visibleGlobalOptions(r){if(!this.showGlobalOptions)return[];const i=[];for(let o=r.parent;o;o=o.parent){const a=o.options.filter(u=>!u.hidden);i.push(...a)}return this.sortOptions&&i.sort(this.compareOptions),i}visibleArguments(r){return r._argsDescription&&r.registeredArguments.forEach(i=>{i.description=i.description||r._argsDescription[i.name()]||""}),r.registeredArguments.find(i=>i.description)?r.registeredArguments:[]}subcommandTerm(r){const i=r.registeredArguments.map(o=>n(o)).join(" ");return r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(i?" "+i:"")}optionTerm(r){return r.flags}argumentTerm(r){return r.name()}longestSubcommandTermLength(r,i){return i.visibleCommands(r).reduce((o,a)=>Math.max(o,i.subcommandTerm(a).length),0)}longestOptionTermLength(r,i){return i.visibleOptions(r).reduce((o,a)=>Math.max(o,i.optionTerm(a).length),0)}longestGlobalOptionTermLength(r,i){return i.visibleGlobalOptions(r).reduce((o,a)=>Math.max(o,i.optionTerm(a).length),0)}longestArgumentTermLength(r,i){return i.visibleArguments(r).reduce((o,a)=>Math.max(o,i.argumentTerm(a).length),0)}commandUsage(r){let i=r._name;r._aliases[0]&&(i=i+"|"+r._aliases[0]);let o="";for(let a=r.parent;a;a=a.parent)o=a.name()+" "+o;return o+i+" "+r.usage()}commandDescription(r){return r.description()}subcommandDescription(r){return r.summary()||r.description()}optionDescription(r){const i=[];return r.argChoices&&i.push(`choices: ${r.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),r.defaultValue!==void 0&&(r.required||r.optional||r.isBoolean()&&typeof r.defaultValue=="boolean")&&i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),r.presetArg!==void 0&&r.optional&&i.push(`preset: ${JSON.stringify(r.presetArg)}`),r.envVar!==void 0&&i.push(`env: ${r.envVar}`),i.length>0?`${r.description} (${i.join(", ")})`:r.description}argumentDescription(r){const i=[];if(r.argChoices&&i.push(`choices: ${r.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),r.defaultValue!==void 0&&i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),i.length>0){const o=`(${i.join(", ")})`;return r.description?`${r.description} ${o}`:o}return r.description}formatHelp(r,i){const o=i.padWidth(r,i),a=i.helpWidth||80,u=2,f=2;function h(_,x){if(x){const k=`${_.padEnd(o+f)}${x}`;return i.wrap(k,a-u,o+f)}return _}function m(_){return _.join(`
|
|
2
|
+
`).replace(/^/gm," ".repeat(u))}let p=[`Usage: ${i.commandUsage(r)}`,""];const b=i.commandDescription(r);b.length>0&&(p=p.concat([i.wrap(b,a,0),""]));const S=i.visibleArguments(r).map(_=>h(i.argumentTerm(_),i.argumentDescription(_)));S.length>0&&(p=p.concat(["Arguments:",m(S),""]));const C=i.visibleOptions(r).map(_=>h(i.optionTerm(_),i.optionDescription(_)));if(C.length>0&&(p=p.concat(["Options:",m(C),""])),this.showGlobalOptions){const _=i.visibleGlobalOptions(r).map(x=>h(i.optionTerm(x),i.optionDescription(x)));_.length>0&&(p=p.concat(["Global Options:",m(_),""]))}const g=i.visibleCommands(r).map(_=>h(i.subcommandTerm(_),i.subcommandDescription(_)));return g.length>0&&(p=p.concat(["Commands:",m(g),""])),p.join(`
|
|
3
|
+
`)}padWidth(r,i){return Math.max(i.longestOptionTermLength(r,i),i.longestGlobalOptionTermLength(r,i),i.longestSubcommandTermLength(r,i),i.longestArgumentTermLength(r,i))}wrap(r,i,o,a=40){const u=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",f=new RegExp(`[\\n][${u}]+`);if(r.match(f))return r;const h=i-o;if(h<a)return r;const m=r.slice(0,o),p=r.slice(o).replace(`\r
|
|
4
4
|
`,`
|
|
5
|
-
`),
|
|
6
|
-
|.{1,${
|
|
7
|
-
`?"":(
|
|
8
|
-
`)}}return
|
|
9
|
-
(Did you mean one of ${
|
|
10
|
-
(Did you mean ${
|
|
11
|
-
- specify the name in Command constructor or using .name()`);return
|
|
12
|
-
Expecting one of '${x.join("', '")}'`);return this._lifeCycleHooks[
|
|
13
|
-
- already used by option '${
|
|
14
|
-
- if '${
|
|
5
|
+
`),b=" ".repeat(o),C="\\s\u200B",g=new RegExp(`
|
|
6
|
+
|.{1,${h-1}}([${C}]|$)|[^${C}]+?([${C}]|$)`,"g"),_=p.match(g)||[];return m+_.map((x,k)=>x===`
|
|
7
|
+
`?"":(k>0?b:"")+x.trimEnd()).join(`
|
|
8
|
+
`)}}return ju.Help=e,ju}var jo={},Xp;function Zp(){if(Xp)return jo;Xp=1;const{InvalidArgumentError:n}=Jo();class e{constructor(a,u){this.flags=a,this.description=u||"",this.required=a.includes("<"),this.optional=a.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(a),this.mandatory=!1;const f=i(a);this.short=f.shortFlag,this.long=f.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(a,u){return this.defaultValue=a,this.defaultValueDescription=u,this}preset(a){return this.presetArg=a,this}conflicts(a){return this.conflictsWith=this.conflictsWith.concat(a),this}implies(a){let u=a;return typeof a=="string"&&(u={[a]:!0}),this.implied=Object.assign(this.implied||{},u),this}env(a){return this.envVar=a,this}argParser(a){return this.parseArg=a,this}makeOptionMandatory(a=!0){return this.mandatory=!!a,this}hideHelp(a=!0){return this.hidden=!!a,this}_concatValue(a,u){return u===this.defaultValue||!Array.isArray(u)?[a]:u.concat(a)}choices(a){return this.argChoices=a.slice(),this.parseArg=(u,f)=>{if(!this.argChoices.includes(u))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(u,f):u},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return r(this.name().replace(/^no-/,""))}is(a){return this.short===a||this.long===a}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class t{constructor(a){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,a.forEach(u=>{u.negate?this.negativeOptions.set(u.attributeName(),u):this.positiveOptions.set(u.attributeName(),u)}),this.negativeOptions.forEach((u,f)=>{this.positiveOptions.has(f)&&this.dualOptions.add(f)})}valueFromOption(a,u){const f=u.attributeName();if(!this.dualOptions.has(f))return!0;const h=this.negativeOptions.get(f).presetArg,m=h!==void 0?h:!1;return u.negate===(m===a)}}function r(o){return o.split("-").reduce((a,u)=>a+u[0].toUpperCase()+u.slice(1))}function i(o){let a,u;const f=o.split(/[ |,]+/);return f.length>1&&!/^[[<]/.test(f[1])&&(a=f.shift()),u=f.shift(),!a&&/^-[^-]$/.test(u)&&(a=u,u=void 0),{shortFlag:a,longFlag:u}}return jo.Option=e,jo.DualOptions=t,jo}var Yu={},Qp;function a5(){if(Qp)return Yu;Qp=1;const n=3;function e(r,i){if(Math.abs(r.length-i.length)>n)return Math.max(r.length,i.length);const o=[];for(let a=0;a<=r.length;a++)o[a]=[a];for(let a=0;a<=i.length;a++)o[0][a]=a;for(let a=1;a<=i.length;a++)for(let u=1;u<=r.length;u++){let f=1;r[u-1]===i[a-1]?f=0:f=1,o[u][a]=Math.min(o[u-1][a]+1,o[u][a-1]+1,o[u-1][a-1]+f),u>1&&a>1&&r[u-1]===i[a-2]&&r[u-2]===i[a-1]&&(o[u][a]=Math.min(o[u][a],o[u-2][a-2]+1))}return o[r.length][i.length]}function t(r,i){if(!i||i.length===0)return"";i=Array.from(new Set(i));const o=r.startsWith("--");o&&(r=r.slice(2),i=i.map(h=>h.slice(2)));let a=[],u=n;const f=.4;return i.forEach(h=>{if(h.length<=1)return;const m=e(r,h),p=Math.max(r.length,h.length);(p-m)/p>f&&(m<u?(u=m,a=[h]):m===u&&a.push(h))}),a.sort((h,m)=>h.localeCompare(m)),o&&(a=a.map(h=>`--${h}`)),a.length>1?`
|
|
9
|
+
(Did you mean one of ${a.join(", ")}?)`:a.length===1?`
|
|
10
|
+
(Did you mean ${a[0]}?)`:""}return Yu.suggestSimilar=t,Yu}var em;function l5(){if(em)return Ju;em=1;const n=t5.EventEmitter,e=n5,t=r5,r=i5,i=s5,{Argument:o,humanReadableArgName:a}=Gu(),{CommanderError:u}=Jo(),{Help:f}=Yp(),{Option:h,DualOptions:m}=Zp(),{suggestSimilar:p}=a5();class b extends n{constructor(g){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=g||"",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:_=>i.stdout.write(_),writeErr:_=>i.stderr.write(_),getOutHelpWidth:()=>i.stdout.isTTY?i.stdout.columns:void 0,getErrHelpWidth:()=>i.stderr.isTTY?i.stderr.columns:void 0,outputError:(_,x)=>x(_)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(g){return this._outputConfiguration=g._outputConfiguration,this._helpOption=g._helpOption,this._helpCommand=g._helpCommand,this._helpConfiguration=g._helpConfiguration,this._exitCallback=g._exitCallback,this._storeOptionsAsProperties=g._storeOptionsAsProperties,this._combineFlagAndOptionalValue=g._combineFlagAndOptionalValue,this._allowExcessArguments=g._allowExcessArguments,this._enablePositionalOptions=g._enablePositionalOptions,this._showHelpAfterError=g._showHelpAfterError,this._showSuggestionAfterError=g._showSuggestionAfterError,this}_getCommandAndAncestors(){const g=[];for(let _=this;_;_=_.parent)g.push(_);return g}command(g,_,x){let k=_,A=x;typeof k=="object"&&k!==null&&(A=k,k=null),A=A||{};const[,N,W]=g.match(/([^ ]+) *(.*)/),L=this.createCommand(N);return k&&(L.description(k),L._executableHandler=!0),A.isDefault&&(this._defaultCommandName=L._name),L._hidden=!!(A.noHelp||A.hidden),L._executableFile=A.executableFile||null,W&&L.arguments(W),this._registerCommand(L),L.parent=this,L.copyInheritedSettings(this),k?this:L}createCommand(g){return new b(g)}createHelp(){return Object.assign(new f,this.configureHelp())}configureHelp(g){return g===void 0?this._helpConfiguration:(this._helpConfiguration=g,this)}configureOutput(g){return g===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,g),this)}showHelpAfterError(g=!0){return typeof g!="string"&&(g=!!g),this._showHelpAfterError=g,this}showSuggestionAfterError(g=!0){return this._showSuggestionAfterError=!!g,this}addCommand(g,_){if(!g._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
11
|
+
- specify the name in Command constructor or using .name()`);return _=_||{},_.isDefault&&(this._defaultCommandName=g._name),(_.noHelp||_.hidden)&&(g._hidden=!0),this._registerCommand(g),g.parent=this,g._checkForBrokenPassThrough(),this}createArgument(g,_){return new o(g,_)}argument(g,_,x,k){const A=this.createArgument(g,_);return typeof x=="function"?A.default(k).argParser(x):A.default(x),this.addArgument(A),this}arguments(g){return g.trim().split(/ +/).forEach(_=>{this.argument(_)}),this}addArgument(g){const _=this.registeredArguments.slice(-1)[0];if(_&&_.variadic)throw new Error(`only the last argument can be variadic '${_.name()}'`);if(g.required&&g.defaultValue!==void 0&&g.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${g.name()}'`);return this.registeredArguments.push(g),this}helpCommand(g,_){if(typeof g=="boolean")return this._addImplicitHelpCommand=g,this;g=g??"help [command]";const[,x,k]=g.match(/([^ ]+) *(.*)/),A=_??"display help for command",N=this.createCommand(x);return N.helpOption(!1),k&&N.arguments(k),A&&N.description(A),this._addImplicitHelpCommand=!0,this._helpCommand=N,this}addHelpCommand(g,_){return typeof g!="object"?(this.helpCommand(g,_),this):(this._addImplicitHelpCommand=!0,this._helpCommand=g,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(g,_){const x=["preSubcommand","preAction","postAction"];if(!x.includes(g))throw new Error(`Unexpected value for event passed to hook : '${g}'.
|
|
12
|
+
Expecting one of '${x.join("', '")}'`);return this._lifeCycleHooks[g]?this._lifeCycleHooks[g].push(_):this._lifeCycleHooks[g]=[_],this}exitOverride(g){return g?this._exitCallback=g:this._exitCallback=_=>{if(_.code!=="commander.executeSubCommandAsync")throw _},this}_exit(g,_,x){this._exitCallback&&this._exitCallback(new u(g,_,x)),i.exit(g)}action(g){const _=x=>{const k=this.registeredArguments.length,A=x.slice(0,k);return this._storeOptionsAsProperties?A[k]=this:A[k]=this.opts(),A.push(this),g.apply(this,A)};return this._actionHandler=_,this}createOption(g,_){return new h(g,_)}_callParseArg(g,_,x,k){try{return g.parseArg(_,x)}catch(A){if(A.code==="commander.invalidArgument"){const N=`${k} ${A.message}`;this.error(N,{exitCode:A.exitCode,code:A.code})}throw A}}_registerOption(g){const _=g.short&&this._findOption(g.short)||g.long&&this._findOption(g.long);if(_){const x=g.long&&this._findOption(g.long)?g.long:g.short;throw new Error(`Cannot add option '${g.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${x}'
|
|
13
|
+
- already used by option '${_.flags}'`)}this.options.push(g)}_registerCommand(g){const _=k=>[k.name()].concat(k.aliases()),x=_(g).find(k=>this._findCommand(k));if(x){const k=_(this._findCommand(x)).join("|"),A=_(g).join("|");throw new Error(`cannot add command '${A}' as already have command '${k}'`)}this.commands.push(g)}addOption(g){this._registerOption(g);const _=g.name(),x=g.attributeName();if(g.negate){const A=g.long.replace(/^--no-/,"--");this._findOption(A)||this.setOptionValueWithSource(x,g.defaultValue===void 0?!0:g.defaultValue,"default")}else g.defaultValue!==void 0&&this.setOptionValueWithSource(x,g.defaultValue,"default");const k=(A,N,W)=>{A==null&&g.presetArg!==void 0&&(A=g.presetArg);const L=this.getOptionValue(x);A!==null&&g.parseArg?A=this._callParseArg(g,A,L,N):A!==null&&g.variadic&&(A=g._concatValue(A,L)),A==null&&(g.negate?A=!1:g.isBoolean()||g.optional?A=!0:A=""),this.setOptionValueWithSource(x,A,W)};return this.on("option:"+_,A=>{const N=`error: option '${g.flags}' argument '${A}' is invalid.`;k(A,N,"cli")}),g.envVar&&this.on("optionEnv:"+_,A=>{const N=`error: option '${g.flags}' value '${A}' from env '${g.envVar}' is invalid.`;k(A,N,"env")}),this}_optionEx(g,_,x,k,A){if(typeof _=="object"&&_ instanceof h)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const N=this.createOption(_,x);if(N.makeOptionMandatory(!!g.mandatory),typeof k=="function")N.default(A).argParser(k);else if(k instanceof RegExp){const W=k;k=(L,U)=>{const j=W.exec(L);return j?j[0]:U},N.default(A).argParser(k)}else N.default(k);return this.addOption(N)}option(g,_,x,k){return this._optionEx({},g,_,x,k)}requiredOption(g,_,x,k){return this._optionEx({mandatory:!0},g,_,x,k)}combineFlagAndOptionalValue(g=!0){return this._combineFlagAndOptionalValue=!!g,this}allowUnknownOption(g=!0){return this._allowUnknownOption=!!g,this}allowExcessArguments(g=!0){return this._allowExcessArguments=!!g,this}enablePositionalOptions(g=!0){return this._enablePositionalOptions=!!g,this}passThroughOptions(g=!0){return this._passThroughOptions=!!g,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(g=!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=!!g,this}getOptionValue(g){return this._storeOptionsAsProperties?this[g]:this._optionValues[g]}setOptionValue(g,_){return this.setOptionValueWithSource(g,_,void 0)}setOptionValueWithSource(g,_,x){return this._storeOptionsAsProperties?this[g]=_:this._optionValues[g]=_,this._optionValueSources[g]=x,this}getOptionValueSource(g){return this._optionValueSources[g]}getOptionValueSourceWithGlobals(g){let _;return this._getCommandAndAncestors().forEach(x=>{x.getOptionValueSource(g)!==void 0&&(_=x.getOptionValueSource(g))}),_}_prepareUserArgs(g,_){if(g!==void 0&&!Array.isArray(g))throw new Error("first parameter to parse must be array or undefined");if(_=_||{},g===void 0&&_.from===void 0){i.versions?.electron&&(_.from="electron");const k=i.execArgv??[];(k.includes("-e")||k.includes("--eval")||k.includes("-p")||k.includes("--print"))&&(_.from="eval")}g===void 0&&(g=i.argv),this.rawArgs=g.slice();let x;switch(_.from){case void 0:case"node":this._scriptPath=g[1],x=g.slice(2);break;case"electron":i.defaultApp?(this._scriptPath=g[1],x=g.slice(2)):x=g.slice(1);break;case"user":x=g.slice(0);break;case"eval":x=g.slice(1);break;default:throw new Error(`unexpected parse option { from: '${_.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",x}parse(g,_){const x=this._prepareUserArgs(g,_);return this._parseCommand([],x),this}async parseAsync(g,_){const x=this._prepareUserArgs(g,_);return await this._parseCommand([],x),this}_executeSubCommand(g,_){_=_.slice();let x=!1;const k=[".js",".ts",".tsx",".mjs",".cjs"];function A(j,pe){const Ct=t.resolve(j,pe);if(r.existsSync(Ct))return Ct;if(k.includes(t.extname(pe)))return;const yt=k.find(Ft=>r.existsSync(`${Ct}${Ft}`));if(yt)return`${Ct}${yt}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let N=g._executableFile||`${this._name}-${g._name}`,W=this._executableDir||"";if(this._scriptPath){let j;try{j=r.realpathSync(this._scriptPath)}catch{j=this._scriptPath}W=t.resolve(t.dirname(j),W)}if(W){let j=A(W,N);if(!j&&!g._executableFile&&this._scriptPath){const pe=t.basename(this._scriptPath,t.extname(this._scriptPath));pe!==this._name&&(j=A(W,`${pe}-${g._name}`))}N=j||N}x=k.includes(t.extname(N));let L;i.platform!=="win32"?x?(_.unshift(N),_=S(i.execArgv).concat(_),L=e.spawn(i.argv[0],_,{stdio:"inherit"})):L=e.spawn(N,_,{stdio:"inherit"}):(_.unshift(N),_=S(i.execArgv).concat(_),L=e.spawn(i.execPath,_,{stdio:"inherit"})),L.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(pe=>{i.on(pe,()=>{L.killed===!1&&L.exitCode===null&&L.kill(pe)})});const U=this._exitCallback;L.on("close",j=>{j=j??1,U?U(new u(j,"commander.executeSubCommandAsync","(close)")):i.exit(j)}),L.on("error",j=>{if(j.code==="ENOENT"){const pe=W?`searched for local subcommand relative to directory '${W}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",Ct=`'${N}' does not exist
|
|
14
|
+
- if '${g._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
15
15
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
16
|
-
- ${
|
|
16
|
+
- ${pe}`;throw new Error(Ct)}else if(j.code==="EACCES")throw new Error(`'${N}' not executable`);if(!U)i.exit(1);else{const pe=new u(1,"commander.executeSubCommandAsync","(error)");pe.nestedError=j,U(pe)}}),this.runningCommand=L}_dispatchSubcommand(g,_,x){const k=this._findCommand(g);k||this.help({error:!0});let A;return A=this._chainOrCallSubCommandHook(A,k,"preSubcommand"),A=this._chainOrCall(A,()=>{if(k._executableHandler)this._executeSubCommand(k,_.concat(x));else return k._parseCommand(_,x)}),A}_dispatchHelpCommand(g){g||this.help();const _=this._findCommand(g);return _&&!_._executableHandler&&_.help(),this._dispatchSubcommand(g,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((g,_)=>{g.required&&this.args[_]==null&&this.missingArgument(g.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const g=(x,k,A)=>{let N=k;if(k!==null&&x.parseArg){const W=`error: command-argument value '${k}' is invalid for argument '${x.name()}'.`;N=this._callParseArg(x,k,A,W)}return N};this._checkNumberOfArguments();const _=[];this.registeredArguments.forEach((x,k)=>{let A=x.defaultValue;x.variadic?k<this.args.length?(A=this.args.slice(k),x.parseArg&&(A=A.reduce((N,W)=>g(x,W,N),x.defaultValue))):A===void 0&&(A=[]):k<this.args.length&&(A=this.args[k],x.parseArg&&(A=g(x,A,x.defaultValue))),_[k]=A}),this.processedArgs=_}_chainOrCall(g,_){return g&&g.then&&typeof g.then=="function"?g.then(()=>_()):_()}_chainOrCallHooks(g,_){let x=g;const k=[];return this._getCommandAndAncestors().reverse().filter(A=>A._lifeCycleHooks[_]!==void 0).forEach(A=>{A._lifeCycleHooks[_].forEach(N=>{k.push({hookedCommand:A,callback:N})})}),_==="postAction"&&k.reverse(),k.forEach(A=>{x=this._chainOrCall(x,()=>A.callback(A.hookedCommand,this))}),x}_chainOrCallSubCommandHook(g,_,x){let k=g;return this._lifeCycleHooks[x]!==void 0&&this._lifeCycleHooks[x].forEach(A=>{k=this._chainOrCall(k,()=>A(this,_))}),k}_parseCommand(g,_){const x=this.parseOptions(_);if(this._parseOptionsEnv(),this._parseOptionsImplied(),g=g.concat(x.operands),_=x.unknown,this.args=g.concat(_),g&&this._findCommand(g[0]))return this._dispatchSubcommand(g[0],g.slice(1),_);if(this._getHelpCommand()&&g[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(g[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(_),this._dispatchSubcommand(this._defaultCommandName,g,_);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(x.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const k=()=>{x.unknown.length>0&&this.unknownOption(x.unknown[0])},A=`command:${this.name()}`;if(this._actionHandler){k(),this._processArguments();let N;return N=this._chainOrCallHooks(N,"preAction"),N=this._chainOrCall(N,()=>this._actionHandler(this.processedArgs)),this.parent&&(N=this._chainOrCall(N,()=>{this.parent.emit(A,g,_)})),N=this._chainOrCallHooks(N,"postAction"),N}if(this.parent&&this.parent.listenerCount(A))k(),this._processArguments(),this.parent.emit(A,g,_);else if(g.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",g,_);this.listenerCount("command:*")?this.emit("command:*",g,_):this.commands.length?this.unknownCommand():(k(),this._processArguments())}else this.commands.length?(k(),this.help({error:!0})):(k(),this._processArguments())}_findCommand(g){if(g)return this.commands.find(_=>_._name===g||_._aliases.includes(g))}_findOption(g){return this.options.find(_=>_.is(g))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(g=>{g.options.forEach(_=>{_.mandatory&&g.getOptionValue(_.attributeName())===void 0&&g.missingMandatoryOptionValue(_)})})}_checkForConflictingLocalOptions(){const g=this.options.filter(x=>{const k=x.attributeName();return this.getOptionValue(k)===void 0?!1:this.getOptionValueSource(k)!=="default"});g.filter(x=>x.conflictsWith.length>0).forEach(x=>{const k=g.find(A=>x.conflictsWith.includes(A.attributeName()));k&&this._conflictingOption(x,k)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(g=>{g._checkForConflictingLocalOptions()})}parseOptions(g){const _=[],x=[];let k=_;const A=g.slice();function N(L){return L.length>1&&L[0]==="-"}let W=null;for(;A.length;){const L=A.shift();if(L==="--"){k===x&&k.push(L),k.push(...A);break}if(W&&!N(L)){this.emit(`option:${W.name()}`,L);continue}if(W=null,N(L)){const U=this._findOption(L);if(U){if(U.required){const j=A.shift();j===void 0&&this.optionMissingArgument(U),this.emit(`option:${U.name()}`,j)}else if(U.optional){let j=null;A.length>0&&!N(A[0])&&(j=A.shift()),this.emit(`option:${U.name()}`,j)}else this.emit(`option:${U.name()}`);W=U.variadic?U:null;continue}}if(L.length>2&&L[0]==="-"&&L[1]!=="-"){const U=this._findOption(`-${L[1]}`);if(U){U.required||U.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${U.name()}`,L.slice(2)):(this.emit(`option:${U.name()}`),A.unshift(`-${L.slice(2)}`));continue}}if(/^--[^=]+=/.test(L)){const U=L.indexOf("="),j=this._findOption(L.slice(0,U));if(j&&(j.required||j.optional)){this.emit(`option:${j.name()}`,L.slice(U+1));continue}}if(N(L)&&(k=x),(this._enablePositionalOptions||this._passThroughOptions)&&_.length===0&&x.length===0){if(this._findCommand(L)){_.push(L),A.length>0&&x.push(...A);break}else if(this._getHelpCommand()&&L===this._getHelpCommand().name()){_.push(L),A.length>0&&_.push(...A);break}else if(this._defaultCommandName){x.push(L),A.length>0&&x.push(...A);break}}if(this._passThroughOptions){k.push(L),A.length>0&&k.push(...A);break}k.push(L)}return{operands:_,unknown:x}}opts(){if(this._storeOptionsAsProperties){const g={},_=this.options.length;for(let x=0;x<_;x++){const k=this.options[x].attributeName();g[k]=k===this._versionOptionName?this._version:this[k]}return g}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((g,_)=>Object.assign(g,_.opts()),{})}error(g,_){this._outputConfiguration.outputError(`${g}
|
|
17
17
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
18
18
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
19
|
-
`),this.outputHelp({error:!0}));const x=
|
|
20
|
-
`),this._exit(0,"commander.version",
|
|
21
|
-
Expecting one of '${x.join("', '")}'`);const
|
|
22
|
-
`)}),this}_outputHelpIfRequested(m){const b=this._getHelpOption();b&&m.find(A=>b.is(A))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function S(k){return k.map(m=>{if(!m.startsWith("--inspect"))return m;let b,x="127.0.0.1",A="9229",O;return(O=m.match(/^(--inspect(-brk)?)$/))!==null?b=O[1]:(O=m.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(b=O[1],/^\d+$/.test(O[3])?A=O[3]:x=O[3]):(O=m.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(b=O[1],x=O[3],A=O[4]),b&&A!=="0"?`${b}=${x}:${parseInt(A)+1}`:m})}return ku.Command=_,ku}var Sp;function Hx(){if(Sp)return Et;Sp=1;const{Argument:n}=Eu(),{Command:e}=Bx(),{CommanderError:t,InvalidArgumentError:r}=Do(),{Help:i}=yp(),{Option:o}=_p();return Et.program=new e,Et.createCommand=l=>new e(l),Et.createOption=(l,u)=>new o(l,u),Et.createArgument=(l,u)=>new n(l,u),Et.Command=e,Et.Option=o,Et.Argument=n,Et.Help=i,Et.CommanderError=t,Et.InvalidArgumentError=r,Et.InvalidOptionArgumentError=r,Et}var $x=Hx(),zx=Dx($x);const{program:vI,createCommand:wI,createArgument:SI,createOption:xI,CommanderError:EI,InvalidArgumentError:kI,InvalidOptionArgumentError:CI,Command:Vx,Argument:AI,Option:OI,Help:TI}=zx;function Wx(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Ft=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const xr=()=>{},Ux=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),kt=Object.assign,qx=Object.prototype.hasOwnProperty,Re=(n,e)=>qx.call(n,e),Ce=Array.isArray,fi=n=>Bo(n)==="[object Map]",Kx=n=>Bo(n)==="[object Set]",Le=n=>typeof n=="function",Yt=n=>typeof n=="string",cs=n=>typeof n=="symbol",lt=n=>n!==null&&typeof n=="object",Gx=n=>(lt(n)||Le(n))&&Le(n.then)&&Le(n.catch),jx=Object.prototype.toString,Bo=n=>jx.call(n),xp=n=>Bo(n).slice(8,-1),Jx=n=>Bo(n)==="[object Object]",Ou=n=>Yt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Yx=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Xx=Yx(n=>n.charAt(0).toUpperCase()+n.slice(1)),jn=(n,e)=>!Object.is(n,e),Zx=(n,e,t,r=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:r,value:t})};let Ep;const Ho=()=>Ep||(Ep=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Tu(n){if(Ce(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Yt(r)?nE(r):Tu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(Yt(n)||lt(n))return n}const Qx=/;(?![^(]*\))/g,eE=/:([^]+)/,tE=/\/\*[^]*?\*\//g;function nE(n){const e={};return n.replace(tE,"").split(Qx).forEach(t=>{if(t){const r=t.split(eE);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Mu(n){let e="";if(Yt(n))e=n;else if(Ce(n))for(let t=0;t<n.length;t++){const r=Mu(n[t]);r&&(e+=r+" ")}else if(lt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function In(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let be;const Iu=new WeakSet;class rE{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Iu.has(this)&&(Iu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Cp(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ip(this),Ap(this);const e=be,t=Xt;be=this,Xt=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&be!==this&&In("Active effect was not restored correctly - this is likely a Vue internal bug."),Op(this),be=e,Xt=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Pu(e);this.deps=this.depsTail=void 0,Ip(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Iu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Lu(this)&&this.run()}get dirty(){return Lu(this)}}let kp=0,fs,hs;function Cp(n,e=!1){if(n.flags|=8,e){n.next=hs,hs=n;return}n.next=fs,fs=n}function Nu(){kp++}function Ru(){if(--kp>0)return;if(hs){let e=hs;for(hs=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;fs;){let e=fs;for(fs=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){n||(n=r)}e=t}}if(n)throw n}function Ap(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Op(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),Pu(r),iE(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function Lu(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Tp(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Tp(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===ds))return;n.globalVersion=ds;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Lu(n)){n.flags&=-3;return}const t=be,r=Xt;be=n,Xt=!0;try{Ap(n);const i=n.fn(n._value);(e.version===0||jn(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{be=t,Xt=r,Op(n),n.flags&=-3}}function Pu(n,e=!1){const{dep:t,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),process.env.NODE_ENV!=="production"&&t.subsHead===n&&(t.subsHead=i),t.subs===n&&(t.subs=r,!r&&t.computed)){t.computed.flags&=-5;for(let o=t.computed.deps;o;o=o.nextDep)Pu(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function iE(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Xt=!0;const Mp=[];function $o(){Mp.push(Xt),Xt=!1}function zo(){const n=Mp.pop();Xt=n===void 0?!0:n}function Ip(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=be;be=void 0;try{e()}finally{be=t}}}let ds=0,sE=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class Du{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){if(!be||!Xt||be===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==be)t=this.activeLink=new sE(be,this),be.deps?(t.prevDep=be.depsTail,be.depsTail.nextDep=t,be.depsTail=t):be.deps=be.depsTail=t,Np(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const r=t.nextDep;r.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=r),t.prevDep=be.depsTail,t.nextDep=void 0,be.depsTail.nextDep=t,be.depsTail=t,be.deps===t&&(be.deps=r)}return process.env.NODE_ENV!=="production"&&be.onTrack&&be.onTrack(kt({effect:be},e)),t}trigger(e){this.version++,ds++,this.notify(e)}notify(e){Nu();try{if(process.env.NODE_ENV!=="production")for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(kt({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Ru()}}}function Np(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)Np(r)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),process.env.NODE_ENV!=="production"&&n.dep.subsHead===void 0&&(n.dep.subsHead=n),n.dep.subs=n}}const Vo=new WeakMap,Er=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Fu=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),ps=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function $e(n,e,t){if(Xt&&be){let r=Vo.get(n);r||Vo.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new Du),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function Jn(n,e,t,r,i,o){const l=Vo.get(n);if(!l){ds++;return}const u=f=>{f&&(process.env.NODE_ENV!=="production"?f.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}):f.trigger())};if(Nu(),e==="clear")l.forEach(u);else{const f=Ce(n),d=f&&Ou(t);if(f&&t==="length"){const g=Number(r);l.forEach((p,_)=>{(_==="length"||_===ps||!cs(_)&&_>=g)&&u(p)})}else switch((t!==void 0||l.has(void 0))&&u(l.get(t)),d&&u(l.get(ps)),e){case"add":f?d&&u(l.get("length")):(u(l.get(Er)),fi(n)&&u(l.get(Fu)));break;case"delete":f||(u(l.get(Er)),fi(n)&&u(l.get(Fu)));break;case"set":fi(n)&&u(l.get(Er));break}}Ru()}function oE(n,e){const t=Vo.get(n);return t&&t.get(e)}function hi(n){const e=ce(n);return e===n?e:($e(e,"iterate",ps),gt(n)?e:e.map(ut))}function Bu(n){return $e(n=ce(n),"iterate",ps),n}const aE={__proto__:null,[Symbol.iterator](){return Hu(this,Symbol.iterator,ut)},concat(...n){return hi(this).concat(...n.map(e=>Ce(e)?hi(e):e))},entries(){return Hu(this,"entries",n=>(n[1]=ut(n[1]),n))},every(n,e){return Nn(this,"every",n,e,void 0,arguments)},filter(n,e){return Nn(this,"filter",n,e,t=>t.map(ut),arguments)},find(n,e){return Nn(this,"find",n,e,ut,arguments)},findIndex(n,e){return Nn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Nn(this,"findLast",n,e,ut,arguments)},findLastIndex(n,e){return Nn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Nn(this,"forEach",n,e,void 0,arguments)},includes(...n){return $u(this,"includes",n)},indexOf(...n){return $u(this,"indexOf",n)},join(n){return hi(this).join(n)},lastIndexOf(...n){return $u(this,"lastIndexOf",n)},map(n,e){return Nn(this,"map",n,e,void 0,arguments)},pop(){return ms(this,"pop")},push(...n){return ms(this,"push",n)},reduce(n,...e){return Rp(this,"reduce",n,e)},reduceRight(n,...e){return Rp(this,"reduceRight",n,e)},shift(){return ms(this,"shift")},some(n,e){return Nn(this,"some",n,e,void 0,arguments)},splice(...n){return ms(this,"splice",n)},toReversed(){return hi(this).toReversed()},toSorted(n){return hi(this).toSorted(n)},toSpliced(...n){return hi(this).toSpliced(...n)},unshift(...n){return ms(this,"unshift",n)},values(){return Hu(this,"values",ut)}};function Hu(n,e,t){const r=Bu(n),i=r[e]();return r!==n&&!gt(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const lE=Array.prototype;function Nn(n,e,t,r,i,o){const l=Bu(n),u=l!==n&&!gt(n),f=l[e];if(f!==lE[e]){const p=f.apply(n,o);return u?ut(p):p}let d=t;l!==n&&(u?d=function(p,_){return t.call(this,ut(p),_,n)}:t.length>2&&(d=function(p,_){return t.call(this,p,_,n)}));const g=f.call(l,d,r);return u&&i?i(g):g}function Rp(n,e,t,r){const i=Bu(n);let o=t;return i!==n&&(gt(n)?t.length>3&&(o=function(l,u,f){return t.call(this,l,u,f,n)}):o=function(l,u,f){return t.call(this,l,ut(u),f,n)}),i[e](o,...r)}function $u(n,e,t){const r=ce(n);$e(r,"iterate",ps);const i=r[e](...t);return(i===-1||i===!1)&&Ko(t[0])?(t[0]=ce(t[0]),r[e](...t)):i}function ms(n,e,t=[]){$o(),Nu();const r=ce(n)[e].apply(n,t);return Ru(),zo(),r}const uE=Wx("__proto__,__v_isRef,__isVue"),Lp=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(cs));function cE(n){cs(n)||(n=String(n));const e=ce(this);return $e(e,"has",n),e.hasOwnProperty(n)}class Pp{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?$p:Hp:o?vE:Bp).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const l=Ce(e);if(!i){let f;if(l&&(f=aE[t]))return f;if(t==="hasOwnProperty")return cE}const u=Reflect.get(e,t,Ge(e)?e:r);return(cs(t)?Lp.has(t):uE(t))||(i||$e(e,"get",t),o)?u:Ge(u)?l&&Ou(t)?u:u.value:lt(u)?i?zp(u):Wu(u):u}}class fE extends Pp{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Rn(o);if(!gt(r)&&!Rn(r)&&(o=ce(o),r=ce(r)),!Ce(e)&&Ge(o)&&!Ge(r))return f?!1:(o.value=r,!0)}const l=Ce(e)&&Ou(t)?Number(t)<e.length:Re(e,t),u=Reflect.set(e,t,r,Ge(e)?e:i);return e===ce(i)&&(l?jn(r,o)&&Jn(e,"set",t,r,o):Jn(e,"add",t,r)),u}deleteProperty(e,t){const r=Re(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&Jn(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!cs(t)||!Lp.has(t))&&$e(e,"has",t),r}ownKeys(e){return $e(e,"iterate",Ce(e)?"length":Er),Reflect.ownKeys(e)}}class Dp extends Pp{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&In(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&In(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const hE=new fE,dE=new Dp,pE=new Dp(!0),zu=n=>n,Wo=n=>Reflect.getPrototypeOf(n);function mE(n,e,t){return function(...r){const i=this.__v_raw,o=ce(i),l=fi(o),u=n==="entries"||n===Symbol.iterator&&l,f=n==="keys"&&l,d=i[n](...r),g=t?zu:e?qu:ut;return!e&&$e(o,"iterate",f?Fu:Er),{next(){const{value:p,done:_}=d.next();return _?{value:p,done:_}:{value:u?[g(p[0]),g(p[1])]:g(p),done:_}},[Symbol.iterator](){return this}}}}function Uo(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";In(`${Xx(n)} operation ${t}failed: target is readonly.`,ce(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function gE(n,e){const t={get(i){const o=this.__v_raw,l=ce(o),u=ce(i);n||(jn(i,u)&&$e(l,"get",i),$e(l,"get",u));const{has:f}=Wo(l),d=e?zu:n?qu:ut;if(f.call(l,i))return d(o.get(i));if(f.call(l,u))return d(o.get(u));o!==l&&o.get(i)},get size(){const i=this.__v_raw;return!n&&$e(ce(i),"iterate",Er),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,l=ce(o),u=ce(i);return n||(jn(i,u)&&$e(l,"has",i),$e(l,"has",u)),i===u?o.has(i):o.has(i)||o.has(u)},forEach(i,o){const l=this,u=l.__v_raw,f=ce(u),d=e?zu:n?qu:ut;return!n&&$e(f,"iterate",Er),u.forEach((g,p)=>i.call(o,d(g),d(p),l))}};return kt(t,n?{add:Uo("add"),set:Uo("set"),delete:Uo("delete"),clear:Uo("clear")}:{add(i){!e&&!gt(i)&&!Rn(i)&&(i=ce(i));const o=ce(this);return Wo(o).has.call(o,i)||(o.add(i),Jn(o,"add",i,i)),this},set(i,o){!e&&!gt(o)&&!Rn(o)&&(o=ce(o));const l=ce(this),{has:u,get:f}=Wo(l);let d=u.call(l,i);d?process.env.NODE_ENV!=="production"&&Fp(l,u,i):(i=ce(i),d=u.call(l,i));const g=f.call(l,i);return l.set(i,o),d?jn(o,g)&&Jn(l,"set",i,o,g):Jn(l,"add",i,o),this},delete(i){const o=ce(this),{has:l,get:u}=Wo(o);let f=l.call(o,i);f?process.env.NODE_ENV!=="production"&&Fp(o,l,i):(i=ce(i),f=l.call(o,i));const d=u?u.call(o,i):void 0,g=o.delete(i);return f&&Jn(o,"delete",i,void 0,d),g},clear(){const i=ce(this),o=i.size!==0,l=process.env.NODE_ENV!=="production"?fi(i)?new Map(i):new Set(i):void 0,u=i.clear();return o&&Jn(i,"clear",void 0,void 0,l),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=mE(i,n,e)}),t}function Vu(n,e){const t=gE(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Re(t,i)&&i in r?t:r,i,o)}const yE={get:Vu(!1,!1)},bE={get:Vu(!0,!1)},_E={get:Vu(!0,!0)};function Fp(n,e,t){const r=ce(t);if(r!==t&&e.call(n,r)){const i=xp(n);In(`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,vE=new WeakMap,Hp=new WeakMap,$p=new WeakMap;function wE(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function SE(n){return n.__v_skip||!Object.isExtensible(n)?0:wE(xp(n))}function Wu(n){return Rn(n)?n:Uu(n,!1,hE,yE,Bp)}function zp(n){return Uu(n,!0,dE,bE,Hp)}function qo(n){return Uu(n,!0,pE,_E,$p)}function Uu(n,e,t,r,i){if(!lt(n))return process.env.NODE_ENV!=="production"&&In(`value cannot be made ${e?"readonly":"reactive"}: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=i.get(n);if(o)return o;const l=SE(n);if(l===0)return n;const u=new Proxy(n,l===2?r:t);return i.set(n,u),u}function di(n){return Rn(n)?di(n.__v_raw):!!(n&&n.__v_isReactive)}function Rn(n){return!!(n&&n.__v_isReadonly)}function gt(n){return!!(n&&n.__v_isShallow)}function Ko(n){return n?!!n.__v_raw:!1}function ce(n){const e=n&&n.__v_raw;return e?ce(e):n}function xE(n){return!Re(n,"__v_skip")&&Object.isExtensible(n)&&Zx(n,"__v_skip",!0),n}const ut=n=>lt(n)?Wu(n):n,qu=n=>lt(n)?zp(n):n;function Ge(n){return n?n.__v_isRef===!0:!1}function Go(n){return EE(n,!1)}function EE(n,e){return Ge(n)?n:new kE(n,e)}class kE{constructor(e,t){this.dep=new Du,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ce(e),this._value=t?e:ut(e),this.__v_isShallow=t}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||gt(e)||Rn(e);e=r?e:ce(e),jn(e,t)&&(this._rawValue=e,this._value=r?e:ut(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function z(n){return Ge(n)?n.value:n}const CE={get:(n,e,t)=>e==="__v_raw"?n:z(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const i=n[e];return Ge(i)&&!Ge(t)?(i.value=t,!0):Reflect.set(n,e,t,r)}};function AE(n){return di(n)?n:new Proxy(n,CE)}class OE{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return oE(ce(this._object),this._key)}}class TE{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function pi(n,e,t){return Ge(n)?n:Le(n)?new TE(n):lt(n)&&arguments.length>1?ME(n,e,t):Go(n)}function ME(n,e,t){const r=n[e];return Ge(r)?r:new OE(n,e,t)}class IE{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Du(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ds-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&be!==this)return Cp(this,!0),!0;process.env.NODE_ENV}get value(){const e=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return Tp(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&In("Write operation failed: computed value is readonly")}}function NE(n,e,t=!1){let r,i;Le(n)?r=n:(r=n.get,i=n.set);const o=new IE(r,i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(o.onTrack=e.onTrack,o.onTrigger=e.onTrigger),o}const jo={},Jo=new WeakMap;let kr;function RE(n,e=!1,t=kr){if(t){let r=Jo.get(t);r||Jo.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&In("onWatcherCleanup() was called when there was no active watcher to associate with.")}function LE(n,e,t=Ft){const{immediate:r,deep:i,once:o,scheduler:l,augmentJob:u,call:f}=t,d=R=>{(t.onWarn||In)("Invalid watch source: ",R,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},g=R=>i?R:gt(R)||i===!1||i===0?Yn(R,1):Yn(R);let p,_,S,k,m=!1,b=!1;if(Ge(n)?(_=()=>n.value,m=gt(n)):di(n)?(_=()=>g(n),m=!0):Ce(n)?(b=!0,m=n.some(R=>di(R)||gt(R)),_=()=>n.map(R=>{if(Ge(R))return R.value;if(di(R))return g(R);if(Le(R))return f?f(R,2):R();process.env.NODE_ENV!=="production"&&d(R)})):Le(n)?e?_=f?()=>f(n,2):n:_=()=>{if(S){$o();try{S()}finally{zo()}}const R=kr;kr=p;try{return f?f(n,3,[k]):n(k)}finally{kr=R}}:(_=xr,process.env.NODE_ENV!=="production"&&d(n)),e&&i){const R=_,W=i===!0?1/0:i;_=()=>Yn(R(),W)}const x=()=>{p.stop()};if(o&&e){const R=e;e=(...W)=>{R(...W),x()}}let A=b?new Array(n.length).fill(jo):jo;const O=R=>{if(!(!(p.flags&1)||!p.dirty&&!R))if(e){const W=p.run();if(i||m||(b?W.some((D,U)=>jn(D,A[U])):jn(W,A))){S&&S();const D=kr;kr=p;try{const U=[W,A===jo?void 0:b&&A[0]===jo?[]:A,k];f?f(e,3,U):e(...U),A=W}finally{kr=D}}}else p.run()};return u&&u(O),p=new rE(_),p.scheduler=l?()=>l(O,!1):O,k=R=>RE(R,!1,p),S=p.onStop=()=>{const R=Jo.get(p);if(R){if(f)f(R,4);else for(const W of R)W();Jo.delete(p)}},process.env.NODE_ENV!=="production"&&(p.onTrack=t.onTrack,p.onTrigger=t.onTrigger),e?r?O(!0):A=p.run():l?l(O.bind(null,!0),!0):p.run(),x.pause=p.pause.bind(p),x.resume=p.resume.bind(p),x.stop=x,x}function Yn(n,e=1/0,t){if(e<=0||!lt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Ge(n))Yn(n.value,e,t);else if(Ce(n))for(let r=0;r<n.length;r++)Yn(n[r],e,t);else if(Kx(n)||fi(n))n.forEach(r=>{Yn(r,e,t)});else if(Jx(n)){for(const r in n)Yn(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Yn(n[r],e,t)}return n}const Cr=[];function PE(n){Cr.push(n)}function DE(){Cr.pop()}let Ku=!1;function Oe(n,...e){if(Ku)return;Ku=!0,$o();const t=Cr.length?Cr[Cr.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=FE();if(r)Yo(r,t,11,[n+e.map(o=>{var l,u;return(u=(l=o.toString)==null?void 0:l.call(o))!=null?u:JSON.stringify(o)}).join(""),t&&t.proxy,i.map(({vnode:o})=>`at <${cm(t,o.type)}>`).join(`
|
|
19
|
+
`),this.outputHelp({error:!0}));const x=_||{},k=x.exitCode||1,A=x.code||"commander.error";this._exit(k,A,g)}_parseOptionsEnv(){this.options.forEach(g=>{if(g.envVar&&g.envVar in i.env){const _=g.attributeName();(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))&&(g.required||g.optional?this.emit(`optionEnv:${g.name()}`,i.env[g.envVar]):this.emit(`optionEnv:${g.name()}`))}})}_parseOptionsImplied(){const g=new m(this.options),_=x=>this.getOptionValue(x)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(x));this.options.filter(x=>x.implied!==void 0&&_(x.attributeName())&&g.valueFromOption(this.getOptionValue(x.attributeName()),x)).forEach(x=>{Object.keys(x.implied).filter(k=>!_(k)).forEach(k=>{this.setOptionValueWithSource(k,x.implied[k],"implied")})})}missingArgument(g){const _=`error: missing required argument '${g}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument(g){const _=`error: option '${g.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(g){const _=`error: required option '${g.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(g,_){const x=N=>{const W=N.attributeName(),L=this.getOptionValue(W),U=this.options.find(pe=>pe.negate&&W===pe.attributeName()),j=this.options.find(pe=>!pe.negate&&W===pe.attributeName());return U&&(U.presetArg===void 0&&L===!1||U.presetArg!==void 0&&L===U.presetArg)?U:j||N},k=N=>{const W=x(N),L=W.attributeName();return this.getOptionValueSource(L)==="env"?`environment variable '${W.envVar}'`:`option '${W.flags}'`},A=`error: ${k(g)} cannot be used with ${k(_)}`;this.error(A,{code:"commander.conflictingOption"})}unknownOption(g){if(this._allowUnknownOption)return;let _="";if(g.startsWith("--")&&this._showSuggestionAfterError){let k=[],A=this;do{const N=A.createHelp().visibleOptions(A).filter(W=>W.long).map(W=>W.long);k=k.concat(N),A=A.parent}while(A&&!A._enablePositionalOptions);_=p(g,k)}const x=`error: unknown option '${g}'${_}`;this.error(x,{code:"commander.unknownOption"})}_excessArguments(g){if(this._allowExcessArguments)return;const _=this.registeredArguments.length,x=_===1?"":"s",A=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${x} but got ${g.length}.`;this.error(A,{code:"commander.excessArguments"})}unknownCommand(){const g=this.args[0];let _="";if(this._showSuggestionAfterError){const k=[];this.createHelp().visibleCommands(this).forEach(A=>{k.push(A.name()),A.alias()&&k.push(A.alias())}),_=p(g,k)}const x=`error: unknown command '${g}'${_}`;this.error(x,{code:"commander.unknownCommand"})}version(g,_,x){if(g===void 0)return this._version;this._version=g,_=_||"-V, --version",x=x||"output the version number";const k=this.createOption(_,x);return this._versionOptionName=k.attributeName(),this._registerOption(k),this.on("option:"+k.name(),()=>{this._outputConfiguration.writeOut(`${g}
|
|
20
|
+
`),this._exit(0,"commander.version",g)}),this}description(g,_){return g===void 0&&_===void 0?this._description:(this._description=g,_&&(this._argsDescription=_),this)}summary(g){return g===void 0?this._summary:(this._summary=g,this)}alias(g){if(g===void 0)return this._aliases[0];let _=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(_=this.commands[this.commands.length-1]),g===_._name)throw new Error("Command alias can't be the same as its name");const x=this.parent?._findCommand(g);if(x){const k=[x.name()].concat(x.aliases()).join("|");throw new Error(`cannot add alias '${g}' to command '${this.name()}' as already have command '${k}'`)}return _._aliases.push(g),this}aliases(g){return g===void 0?this._aliases:(g.forEach(_=>this.alias(_)),this)}usage(g){if(g===void 0){if(this._usage)return this._usage;const _=this.registeredArguments.map(x=>a(x));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=g,this}name(g){return g===void 0?this._name:(this._name=g,this)}nameFromFilename(g){return this._name=t.basename(g,t.extname(g)),this}executableDir(g){return g===void 0?this._executableDir:(this._executableDir=g,this)}helpInformation(g){const _=this.createHelp();return _.helpWidth===void 0&&(_.helpWidth=g&&g.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),_.formatHelp(this,_)}_getHelpContext(g){g=g||{};const _={error:!!g.error};let x;return _.error?x=k=>this._outputConfiguration.writeErr(k):x=k=>this._outputConfiguration.writeOut(k),_.write=g.write||x,_.command=this,_}outputHelp(g){let _;typeof g=="function"&&(_=g,g=void 0);const x=this._getHelpContext(g);this._getCommandAndAncestors().reverse().forEach(A=>A.emit("beforeAllHelp",x)),this.emit("beforeHelp",x);let k=this.helpInformation(x);if(_&&(k=_(k),typeof k!="string"&&!Buffer.isBuffer(k)))throw new Error("outputHelp callback must return a string or a Buffer");x.write(k),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",x),this._getCommandAndAncestors().forEach(A=>A.emit("afterAllHelp",x))}helpOption(g,_){return typeof g=="boolean"?(g?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(g=g??"-h, --help",_=_??"display help for command",this._helpOption=this.createOption(g,_),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(g){return this._helpOption=g,this}help(g){this.outputHelp(g);let _=i.exitCode||0;_===0&&g&&typeof g!="function"&&g.error&&(_=1),this._exit(_,"commander.help","(outputHelp)")}addHelpText(g,_){const x=["beforeAll","before","after","afterAll"];if(!x.includes(g))throw new Error(`Unexpected value for position to addHelpText.
|
|
21
|
+
Expecting one of '${x.join("', '")}'`);const k=`${g}Help`;return this.on(k,A=>{let N;typeof _=="function"?N=_({error:A.error,command:A.command}):N=_,N&&A.write(`${N}
|
|
22
|
+
`)}),this}_outputHelpIfRequested(g){const _=this._getHelpOption();_&&g.find(k=>_.is(k))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function S(C){return C.map(g=>{if(!g.startsWith("--inspect"))return g;let _,x="127.0.0.1",k="9229",A;return(A=g.match(/^(--inspect(-brk)?)$/))!==null?_=A[1]:(A=g.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(_=A[1],/^\d+$/.test(A[3])?k=A[3]:x=A[3]):(A=g.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(_=A[1],x=A[3],k=A[4]),_&&k!=="0"?`${_}=${x}:${parseInt(k)+1}`:g})}return Ju.Command=b,Ju}var tm;function u5(){if(tm)return It;tm=1;const{Argument:n}=Gu(),{Command:e}=l5(),{CommanderError:t,InvalidArgumentError:r}=Jo(),{Help:i}=Yp(),{Option:o}=Zp();return It.program=new e,It.createCommand=a=>new e(a),It.createOption=(a,u)=>new o(a,u),It.createArgument=(a,u)=>new n(a,u),It.Command=e,It.Option=o,It.Argument=n,It.Help=i,It.CommanderError=t,It.InvalidArgumentError=r,It.InvalidOptionArgumentError=r,It}var c5=u5(),f5=o5(c5);const{program:JI,createCommand:jI,createArgument:YI,createOption:XI,CommanderError:ZI,InvalidArgumentError:QI,InvalidOptionArgumentError:eN,Command:h5,Argument:tN,Option:nN,Help:rN}=f5;function d5(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Gt=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Fr=()=>{},p5=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Nt=Object.assign,m5=Object.prototype.hasOwnProperty,Le=(n,e)=>m5.call(n,e),Ae=Array.isArray,vi=n=>Yo(n)==="[object Map]",g5=n=>Yo(n)==="[object Set]",Pe=n=>typeof n=="function",un=n=>typeof n=="string",vs=n=>typeof n=="symbol",dt=n=>n!==null&&typeof n=="object",y5=n=>(dt(n)||Pe(n))&&Pe(n.then)&&Pe(n.catch),b5=Object.prototype.toString,Yo=n=>b5.call(n),nm=n=>Yo(n).slice(8,-1),_5=n=>Yo(n)==="[object Object]",Xu=n=>un(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,v5=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},w5=v5(n=>n.charAt(0).toUpperCase()+n.slice(1)),ur=(n,e)=>!Object.is(n,e),S5=(n,e,t,r=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:r,value:t})};let rm;const Xo=()=>rm||(rm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Zu(n){if(Ae(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=un(r)?k5(r):Zu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(un(n)||dt(n))return n}const x5=/;(?![^(]*\))/g,C5=/:([^]+)/,E5=/\/\*[^]*?\*\//g;function k5(n){const e={};return n.replace(E5,"").split(x5).forEach(t=>{if(t){const r=t.split(C5);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Qu(n){let e="";if(un(n))e=n;else if(Ae(n))for(let t=0;t<n.length;t++){const r=Qu(n[t]);r&&(e+=r+" ")}else if(dt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function $n(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let ve;const ec=new WeakSet;class A5{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ec.has(this)&&(ec.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||sm(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,cm(this),om(this);const e=ve,t=cn;ve=this,cn=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&ve!==this&&$n("Active effect was not restored correctly - this is likely a Vue internal bug."),am(this),ve=e,cn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)ic(e);this.deps=this.depsTail=void 0,cm(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ec.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){rc(this)&&this.run()}get dirty(){return rc(this)}}let im=0,ws,Ss;function sm(n,e=!1){if(n.flags|=8,e){n.next=Ss,Ss=n;return}n.next=ws,ws=n}function tc(){im++}function nc(){if(--im>0)return;if(Ss){let e=Ss;for(Ss=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;ws;){let e=ws;for(ws=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){n||(n=r)}e=t}}if(n)throw n}function om(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function am(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),ic(r),M5(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function rc(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(lm(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function lm(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===xs))return;n.globalVersion=xs;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!rc(n)){n.flags&=-3;return}const t=ve,r=cn;ve=n,cn=!0;try{om(n);const i=n.fn(n._value);(e.version===0||ur(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{ve=t,cn=r,am(n),n.flags&=-3}}function ic(n,e=!1){const{dep:t,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),process.env.NODE_ENV!=="production"&&t.subsHead===n&&(t.subsHead=i),t.subs===n&&(t.subs=r,!r&&t.computed)){t.computed.flags&=-5;for(let o=t.computed.deps;o;o=o.nextDep)ic(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function M5(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let cn=!0;const um=[];function Zo(){um.push(cn),cn=!1}function Qo(){const n=um.pop();cn=n===void 0?!0:n}function cm(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=ve;ve=void 0;try{e()}finally{ve=t}}}let xs=0,T5=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class sc{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){if(!ve||!cn||ve===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==ve)t=this.activeLink=new T5(ve,this),ve.deps?(t.prevDep=ve.depsTail,ve.depsTail.nextDep=t,ve.depsTail=t):ve.deps=ve.depsTail=t,fm(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const r=t.nextDep;r.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=r),t.prevDep=ve.depsTail,t.nextDep=void 0,ve.depsTail.nextDep=t,ve.depsTail=t,ve.deps===t&&(ve.deps=r)}return process.env.NODE_ENV!=="production"&&ve.onTrack&&ve.onTrack(Nt({effect:ve},e)),t}trigger(e){this.version++,xs++,this.notify(e)}notify(e){tc();try{if(process.env.NODE_ENV!=="production")for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(Nt({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{nc()}}}function fm(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)fm(r)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),process.env.NODE_ENV!=="production"&&n.dep.subsHead===void 0&&(n.dep.subsHead=n),n.dep.subs=n}}const ea=new WeakMap,zr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),oc=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),Cs=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function Ge(n,e,t){if(cn&&ve){let r=ea.get(n);r||ea.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new sc),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function cr(n,e,t,r,i,o){const a=ea.get(n);if(!a){xs++;return}const u=f=>{f&&(process.env.NODE_ENV!=="production"?f.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}):f.trigger())};if(tc(),e==="clear")a.forEach(u);else{const f=Ae(n),h=f&&Xu(t);if(f&&t==="length"){const m=Number(r);a.forEach((p,b)=>{(b==="length"||b===Cs||!vs(b)&&b>=m)&&u(p)})}else switch((t!==void 0||a.has(void 0))&&u(a.get(t)),h&&u(a.get(Cs)),e){case"add":f?h&&u(a.get("length")):(u(a.get(zr)),vi(n)&&u(a.get(oc)));break;case"delete":f||(u(a.get(zr)),vi(n)&&u(a.get(oc)));break;case"set":vi(n)&&u(a.get(zr));break}}nc()}function O5(n,e){const t=ea.get(n);return t&&t.get(e)}function wi(n){const e=fe(n);return e===n?e:(Ge(e,"iterate",Cs),St(n)?e:e.map(pt))}function ac(n){return Ge(n=fe(n),"iterate",Cs),n}const I5={__proto__:null,[Symbol.iterator](){return lc(this,Symbol.iterator,pt)},concat(...n){return wi(this).concat(...n.map(e=>Ae(e)?wi(e):e))},entries(){return lc(this,"entries",n=>(n[1]=pt(n[1]),n))},every(n,e){return Hn(this,"every",n,e,void 0,arguments)},filter(n,e){return Hn(this,"filter",n,e,t=>t.map(pt),arguments)},find(n,e){return Hn(this,"find",n,e,pt,arguments)},findIndex(n,e){return Hn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Hn(this,"findLast",n,e,pt,arguments)},findLastIndex(n,e){return Hn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Hn(this,"forEach",n,e,void 0,arguments)},includes(...n){return uc(this,"includes",n)},indexOf(...n){return uc(this,"indexOf",n)},join(n){return wi(this).join(n)},lastIndexOf(...n){return uc(this,"lastIndexOf",n)},map(n,e){return Hn(this,"map",n,e,void 0,arguments)},pop(){return Es(this,"pop")},push(...n){return Es(this,"push",n)},reduce(n,...e){return hm(this,"reduce",n,e)},reduceRight(n,...e){return hm(this,"reduceRight",n,e)},shift(){return Es(this,"shift")},some(n,e){return Hn(this,"some",n,e,void 0,arguments)},splice(...n){return Es(this,"splice",n)},toReversed(){return wi(this).toReversed()},toSorted(n){return wi(this).toSorted(n)},toSpliced(...n){return wi(this).toSpliced(...n)},unshift(...n){return Es(this,"unshift",n)},values(){return lc(this,"values",pt)}};function lc(n,e,t){const r=ac(n),i=r[e]();return r!==n&&!St(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const N5=Array.prototype;function Hn(n,e,t,r,i,o){const a=ac(n),u=a!==n&&!St(n),f=a[e];if(f!==N5[e]){const p=f.apply(n,o);return u?pt(p):p}let h=t;a!==n&&(u?h=function(p,b){return t.call(this,pt(p),b,n)}:t.length>2&&(h=function(p,b){return t.call(this,p,b,n)}));const m=f.call(a,h,r);return u&&i?i(m):m}function hm(n,e,t,r){const i=ac(n);let o=t;return i!==n&&(St(n)?t.length>3&&(o=function(a,u,f){return t.call(this,a,u,f,n)}):o=function(a,u,f){return t.call(this,a,pt(u),f,n)}),i[e](o,...r)}function uc(n,e,t){const r=fe(n);Ge(r,"iterate",Cs);const i=r[e](...t);return(i===-1||i===!1)&&ia(t[0])?(t[0]=fe(t[0]),r[e](...t)):i}function Es(n,e,t=[]){Zo(),tc();const r=fe(n)[e].apply(n,t);return nc(),Qo(),r}const R5=d5("__proto__,__v_isRef,__isVue"),dm=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(vs));function L5(n){vs(n)||(n=String(n));const e=fe(this);return Ge(e,"has",n),e.hasOwnProperty(n)}class pm{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?_m:bm:o?U5:ym).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=Ae(e);if(!i){let f;if(a&&(f=I5[t]))return f;if(t==="hasOwnProperty")return L5}const u=Reflect.get(e,t,tt(e)?e:r);return(vs(t)?dm.has(t):R5(t))||(i||Ge(e,"get",t),o)?u:tt(u)?a&&Xu(t)?u:u.value:dt(u)?i?vm(u):hc(u):u}}class P5 extends pm{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Wn(o);if(!St(r)&&!Wn(r)&&(o=fe(o),r=fe(r)),!Ae(e)&&tt(o)&&!tt(r))return f?!1:(o.value=r,!0)}const a=Ae(e)&&Xu(t)?Number(t)<e.length:Le(e,t),u=Reflect.set(e,t,r,tt(e)?e:i);return e===fe(i)&&(a?ur(r,o)&&cr(e,"set",t,r,o):cr(e,"add",t,r)),u}deleteProperty(e,t){const r=Le(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&cr(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!vs(t)||!dm.has(t))&&Ge(e,"has",t),r}ownKeys(e){return Ge(e,"iterate",Ae(e)?"length":zr),Reflect.ownKeys(e)}}class mm extends pm{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&$n(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&$n(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const D5=new P5,F5=new mm,z5=new mm(!0),cc=n=>n,ta=n=>Reflect.getPrototypeOf(n);function B5(n,e,t){return function(...r){const i=this.__v_raw,o=fe(i),a=vi(o),u=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,h=i[n](...r),m=t?cc:e?pc:pt;return!e&&Ge(o,"iterate",f?oc:zr),{next(){const{value:p,done:b}=h.next();return b?{value:p,done:b}:{value:u?[m(p[0]),m(p[1])]:m(p),done:b}},[Symbol.iterator](){return this}}}}function na(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";$n(`${w5(n)} operation ${t}failed: target is readonly.`,fe(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function $5(n,e){const t={get(i){const o=this.__v_raw,a=fe(o),u=fe(i);n||(ur(i,u)&&Ge(a,"get",i),Ge(a,"get",u));const{has:f}=ta(a),h=e?cc:n?pc:pt;if(f.call(a,i))return h(o.get(i));if(f.call(a,u))return h(o.get(u));o!==a&&o.get(i)},get size(){const i=this.__v_raw;return!n&&Ge(fe(i),"iterate",zr),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,a=fe(o),u=fe(i);return n||(ur(i,u)&&Ge(a,"has",i),Ge(a,"has",u)),i===u?o.has(i):o.has(i)||o.has(u)},forEach(i,o){const a=this,u=a.__v_raw,f=fe(u),h=e?cc:n?pc:pt;return!n&&Ge(f,"iterate",zr),u.forEach((m,p)=>i.call(o,h(m),h(p),a))}};return Nt(t,n?{add:na("add"),set:na("set"),delete:na("delete"),clear:na("clear")}:{add(i){!e&&!St(i)&&!Wn(i)&&(i=fe(i));const o=fe(this);return ta(o).has.call(o,i)||(o.add(i),cr(o,"add",i,i)),this},set(i,o){!e&&!St(o)&&!Wn(o)&&(o=fe(o));const a=fe(this),{has:u,get:f}=ta(a);let h=u.call(a,i);h?process.env.NODE_ENV!=="production"&&gm(a,u,i):(i=fe(i),h=u.call(a,i));const m=f.call(a,i);return a.set(i,o),h?ur(o,m)&&cr(a,"set",i,o,m):cr(a,"add",i,o),this},delete(i){const o=fe(this),{has:a,get:u}=ta(o);let f=a.call(o,i);f?process.env.NODE_ENV!=="production"&&gm(o,a,i):(i=fe(i),f=a.call(o,i));const h=u?u.call(o,i):void 0,m=o.delete(i);return f&&cr(o,"delete",i,void 0,h),m},clear(){const i=fe(this),o=i.size!==0,a=process.env.NODE_ENV!=="production"?vi(i)?new Map(i):new Set(i):void 0,u=i.clear();return o&&cr(i,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=B5(i,n,e)}),t}function fc(n,e){const t=$5(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Le(t,i)&&i in r?t:r,i,o)}const H5={get:fc(!1,!1)},W5={get:fc(!0,!1)},V5={get:fc(!0,!0)};function gm(n,e,t){const r=fe(t);if(r!==t&&e.call(n,r)){const i=nm(n);$n(`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 ym=new WeakMap,U5=new WeakMap,bm=new WeakMap,_m=new WeakMap;function q5(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function K5(n){return n.__v_skip||!Object.isExtensible(n)?0:q5(nm(n))}function hc(n){return Wn(n)?n:dc(n,!1,D5,H5,ym)}function vm(n){return dc(n,!0,F5,W5,bm)}function ra(n){return dc(n,!0,z5,V5,_m)}function dc(n,e,t,r,i){if(!dt(n))return process.env.NODE_ENV!=="production"&&$n(`value cannot be made ${e?"readonly":"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=K5(n);if(a===0)return n;const u=new Proxy(n,a===2?r:t);return i.set(n,u),u}function Si(n){return Wn(n)?Si(n.__v_raw):!!(n&&n.__v_isReactive)}function Wn(n){return!!(n&&n.__v_isReadonly)}function St(n){return!!(n&&n.__v_isShallow)}function ia(n){return n?!!n.__v_raw:!1}function fe(n){const e=n&&n.__v_raw;return e?fe(e):n}function G5(n){return!Le(n,"__v_skip")&&Object.isExtensible(n)&&S5(n,"__v_skip",!0),n}const pt=n=>dt(n)?hc(n):n,pc=n=>dt(n)?vm(n):n;function tt(n){return n?n.__v_isRef===!0:!1}function sa(n){return J5(n,!1)}function J5(n,e){return tt(n)?n:new j5(n,e)}class j5{constructor(e,t){this.dep=new sc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:fe(e),this._value=t?e:pt(e),this.__v_isShallow=t}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||St(e)||Wn(e);e=r?e:fe(e),ur(e,t)&&(this._rawValue=e,this._value=r?e:pt(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function H(n){return tt(n)?n.value:n}const Y5={get:(n,e,t)=>e==="__v_raw"?n:H(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const i=n[e];return tt(i)&&!tt(t)?(i.value=t,!0):Reflect.set(n,e,t,r)}};function X5(n){return Si(n)?n:new Proxy(n,Y5)}class Z5{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return O5(fe(this._object),this._key)}}class Q5{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function xi(n,e,t){return tt(n)?n:Pe(n)?new Q5(n):dt(n)&&arguments.length>1?eC(n,e,t):sa(n)}function eC(n,e,t){const r=n[e];return tt(r)?r:new Z5(n,e,t)}class tC{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new sc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=xs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ve!==this)return sm(this,!0),!0;process.env.NODE_ENV}get value(){const e=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return lm(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&$n("Write operation failed: computed value is readonly")}}function nC(n,e,t=!1){let r,i;Pe(n)?r=n:(r=n.get,i=n.set);const o=new tC(r,i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(o.onTrack=e.onTrack,o.onTrigger=e.onTrigger),o}const oa={},aa=new WeakMap;let Br;function rC(n,e=!1,t=Br){if(t){let r=aa.get(t);r||aa.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&$n("onWatcherCleanup() was called when there was no active watcher to associate with.")}function iC(n,e,t=Gt){const{immediate:r,deep:i,once:o,scheduler:a,augmentJob:u,call:f}=t,h=N=>{(t.onWarn||$n)("Invalid watch source: ",N,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},m=N=>i?N:St(N)||i===!1||i===0?fr(N,1):fr(N);let p,b,S,C,g=!1,_=!1;if(tt(n)?(b=()=>n.value,g=St(n)):Si(n)?(b=()=>m(n),g=!0):Ae(n)?(_=!0,g=n.some(N=>Si(N)||St(N)),b=()=>n.map(N=>{if(tt(N))return N.value;if(Si(N))return m(N);if(Pe(N))return f?f(N,2):N();process.env.NODE_ENV!=="production"&&h(N)})):Pe(n)?e?b=f?()=>f(n,2):n:b=()=>{if(S){Zo();try{S()}finally{Qo()}}const N=Br;Br=p;try{return f?f(n,3,[C]):n(C)}finally{Br=N}}:(b=Fr,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const N=b,W=i===!0?1/0:i;b=()=>fr(N(),W)}const x=()=>{p.stop()};if(o&&e){const N=e;e=(...W)=>{N(...W),x()}}let k=_?new Array(n.length).fill(oa):oa;const A=N=>{if(!(!(p.flags&1)||!p.dirty&&!N))if(e){const W=p.run();if(i||g||(_?W.some((L,U)=>ur(L,k[U])):ur(W,k))){S&&S();const L=Br;Br=p;try{const U=[W,k===oa?void 0:_&&k[0]===oa?[]:k,C];f?f(e,3,U):e(...U),k=W}finally{Br=L}}}else p.run()};return u&&u(A),p=new A5(b),p.scheduler=a?()=>a(A,!1):A,C=N=>rC(N,!1,p),S=p.onStop=()=>{const N=aa.get(p);if(N){if(f)f(N,4);else for(const W of N)W();aa.delete(p)}},process.env.NODE_ENV!=="production"&&(p.onTrack=t.onTrack,p.onTrigger=t.onTrigger),e?r?A(!0):k=p.run():a?a(A.bind(null,!0),!0):p.run(),x.pause=p.pause.bind(p),x.resume=p.resume.bind(p),x.stop=x,x}function fr(n,e=1/0,t){if(e<=0||!dt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,tt(n))fr(n.value,e,t);else if(Ae(n))for(let r=0;r<n.length;r++)fr(n[r],e,t);else if(g5(n)||vi(n))n.forEach(r=>{fr(r,e,t)});else if(_5(n)){for(const r in n)fr(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&fr(n[r],e,t)}return n}const $r=[];function sC(n){$r.push(n)}function oC(){$r.pop()}let mc=!1;function Te(n,...e){if(mc)return;mc=!0,Zo();const t=$r.length?$r[$r.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=aC();if(r)la(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 <${Vm(t,o.type)}>`).join(`
|
|
23
23
|
`),i]);else{const o=[`[Vue warn]: ${n}`,...e];i.length&&o.push(`
|
|
24
|
-
`,...
|
|
25
|
-
`],...HE(t))}),e}function HE({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${cm(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...$E(n.props),o]:[i+o]}function $E(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...Vp(r,n[r]))}),t.length>3&&e.push(" ..."),e}function Vp(n,e,t){return Yt(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:Ge(e)?(e=Vp(n,ce(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Le(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ce(e),t?e:[`${n}=`,e])}const Wp={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",15:"component update",16:"app unmount cleanup function"};function Yo(n,e,t,r){try{return r?n(...r):n()}catch(i){Gu(i,e,t)}}function Up(n,e,t,r){if(Le(n)){const i=Yo(n,e,t,r);return i&&Gx(i)&&i.catch(o=>{Gu(o,e,t)}),i}if(Ce(n)){const i=[];for(let o=0;o<n.length;o++)i.push(Up(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&Oe(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Gu(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:l}=e&&e.appContext.config||Ft;if(e){let u=e.parent;const f=e.proxy,d=process.env.NODE_ENV!=="production"?Wp[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;u;){const g=u.ec;if(g){for(let p=0;p<g.length;p++)if(g[p](n,f,d)===!1)return}u=u.parent}if(o){$o(),Yo(o,null,10,[n,f,d]),zo();return}}zE(n,t,i,r,l)}function zE(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=Wp[e];if(t&&PE(t),Oe(`Unhandled error${o?` during execution of ${o}`:""}`),t&&DE(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Bt=[];let Ln=-1;const mi=[];let Xn=null,gi=0;const qp=Promise.resolve();let Xo=null;const VE=100;function WE(n){const e=Xo||qp;return n?e.then(this?n.bind(this):n):e}function UE(n){let e=Ln+1,t=Bt.length;for(;e<t;){const r=e+t>>>1,i=Bt[r],o=gs(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function ju(n){if(!(n.flags&1)){const e=gs(n),t=Bt[Bt.length-1];!t||!(n.flags&2)&&e>=gs(t)?Bt.push(n):Bt.splice(UE(e),0,n),n.flags|=1,Kp()}}function Kp(){Xo||(Xo=qp.then(jp))}function Gp(n){Ce(n)?mi.push(...n):Xn&&n.id===-1?Xn.splice(gi+1,0,n):n.flags&1||(mi.push(n),n.flags|=1),Kp()}function qE(n){if(mi.length){const e=[...new Set(mi)].sort((t,r)=>gs(t)-gs(r));if(mi.length=0,Xn){Xn.push(...e);return}for(Xn=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),gi=0;gi<Xn.length;gi++){const t=Xn[gi];process.env.NODE_ENV!=="production"&&Jp(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}Xn=null,gi=0}}const gs=n=>n.id==null?n.flags&2?-1:1/0:n.id;function jp(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>Jp(n,t):xr;try{for(Ln=0;Ln<Bt.length;Ln++){const t=Bt[Ln];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),Yo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Ln<Bt.length;Ln++){const t=Bt[Ln];t&&(t.flags&=-2)}Ln=-1,Bt.length=0,qE(n),Xo=null,(Bt.length||mi.length)&&jp(n)}}function Jp(n,e){const t=n.get(e)||0;if(t>VE){const r=e.i,i=r&&um(r.type);return Gu(`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}return n.set(e,t+1),!1}const Ju=new Map;process.env.NODE_ENV!=="production"&&(Ho().__VUE_HMR_RUNTIME__={createRecord:Yu(KE),rerender:Yu(GE),reload:Yu(jE)});const Zo=new Map;function KE(n,e){return Zo.has(n)?!1:(Zo.set(n,{initialDef:Qo(e),instances:new Set}),!0)}function Qo(n){return fm(n)?n.__vccOpts:n}function GE(n,e){const t=Zo.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,Qo(r.type).render=e),r.renderCache=[],r.update()}))}function jE(n,e){const t=Zo.get(n);if(!t)return;e=Qo(e),Yp(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],l=Qo(o.type);let u=Ju.get(l);u||(l!==t.initialDef&&Yp(l,e),Ju.set(l,u=new Set)),u.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(u.add(o),o.ceReload(e.styles),u.delete(o)):o.parent?ju(()=>{o.parent.update(),u.delete(o)}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(l)}Gp(()=>{Ju.clear()})}function Yp(n,e){kt(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function Yu(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 yi,ea=[];function Xp(n,e){var t,r;yi=n,yi?(yi.enabled=!0,ea.forEach(({event:i,args:o})=>yi.emit(i,...o)),ea=[]):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=>{Xp(o,e)}),setTimeout(()=>{yi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ea=[])},3e3)):ea=[]}let un=null,JE=null;const YE=n=>n.__isTeleport;function Zp(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Zp(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Ho().requestIdleCallback,Ho().cancelIdleCallback;const XE=Symbol.for("v-ndc"),Xu=n=>n?Ak(n)?Ok(n):Xu(n.parent):null,ys=kt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>process.env.NODE_ENV!=="production"?qo(n.props):n.props,$attrs:n=>process.env.NODE_ENV!=="production"?qo(n.attrs):n.attrs,$slots:n=>process.env.NODE_ENV!=="production"?qo(n.slots):n.slots,$refs:n=>process.env.NODE_ENV!=="production"?qo(n.refs):n.refs,$parent:n=>Xu(n.parent),$root:n=>Xu(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>__VUE_OPTIONS_API__?tk(n):n.type,$forceUpdate:n=>n.f||(n.f=()=>{ju(n.update)}),$nextTick:n=>n.n||(n.n=WE.bind(n.proxy)),$watch:n=>__VUE_OPTIONS_API__?hk.bind(n):xr}),ZE=n=>n==="_"||n==="$",Zu=(n,e)=>n!==Ft&&!n.__isScriptSetup&&Re(n,e),QE={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:r,data:i,props:o,accessCache:l,type:u,appContext:f}=n;if(process.env.NODE_ENV!=="production"&&e==="__isVue")return!0;let d;if(e[0]!=="$"){const S=l[e];if(S!==void 0)switch(S){case 1:return r[e];case 2:return i[e];case 4:return t[e];case 3:return o[e]}else{if(Zu(r,e))return l[e]=1,r[e];if(i!==Ft&&Re(i,e))return l[e]=2,i[e];if((d=n.propsOptions[0])&&Re(d,e))return l[e]=3,o[e];if(t!==Ft&&Re(t,e))return l[e]=4,t[e];(!__VUE_OPTIONS_API__||ek)&&(l[e]=0)}}const g=ys[e];let p,_;if(g)return e==="$attrs"?($e(n.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&e==="$slots"&&$e(n,"get",e),g(n);if((p=u.__cssModules)&&(p=p[e]))return p;if(t!==Ft&&Re(t,e))return l[e]=4,t[e];if(_=f.config.globalProperties,Re(_,e))return _[e];process.env.NODE_ENV!=="production"&&un&&(!Yt(e)||e.indexOf("__v")!==0)&&(i!==Ft&&ZE(e[0])&&Re(i,e)?Oe(`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===un&&Oe(`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 Zu(i,e)?(i[e]=t,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&Re(i,e)?(Oe(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==Ft&&Re(r,e)?(r[e]=t,!0):Re(n.props,e)?(process.env.NODE_ENV!=="production"&&Oe(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in n?(process.env.NODE_ENV!=="production"&&Oe(`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}},l){let u;return!!t[l]||n!==Ft&&Re(n,l)||Zu(e,l)||(u=o[0])&&Re(u,l)||Re(r,l)||Re(ys,l)||Re(i.config.globalProperties,l)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Re(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};process.env.NODE_ENV!=="production"&&(QE.ownKeys=n=>(Oe("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 Qp(n){return Ce(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let ek=!0;function tk(n){const e=n.type,{mixins:t,extends:r}=e,{mixins:i,optionsCache:o,config:{optionMergeStrategies:l}}=n.appContext,u=o.get(e);let f;return u?f=u:!i.length&&!t&&!r?f=e:(f={},i.length&&i.forEach(d=>ta(f,d,l,!0)),ta(f,e,l)),lt(e)&&o.set(e,f),f}function ta(n,e,t,r=!1){const{mixins:i,extends:o}=e;o&&ta(n,o,t,!0),i&&i.forEach(l=>ta(n,l,t,!0));for(const l in e)if(r&&l==="expose")process.env.NODE_ENV!=="production"&&Oe('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=nk[l]||t&&t[l];n[l]=u?u(n[l],e[l]):e[l]}return n}const nk={data:em,props:nm,emits:nm,methods:bs,computed:bs,beforeCreate:ct,created:ct,beforeMount:ct,mounted:ct,beforeUpdate:ct,updated:ct,beforeDestroy:ct,beforeUnmount:ct,destroyed:ct,unmounted:ct,activated:ct,deactivated:ct,errorCaptured:ct,serverPrefetch:ct,components:bs,directives:bs,watch:ik,provide:em,inject:rk};function em(n,e){return e?n?function(){return kt(Le(n)?n.call(this,this):n,Le(e)?e.call(this,this):e)}:e:n}function rk(n,e){return bs(tm(n),tm(e))}function tm(n){if(Ce(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function ct(n,e){return n?[...new Set([].concat(n,e))]:e}function bs(n,e){return n?kt(Object.create(null),n,e):e}function nm(n,e){return n?Ce(n)&&Ce(e)?[...new Set([...n,...e])]:kt(Object.create(null),Qp(n),Qp(e??{})):e}function ik(n,e){if(!n)return e;if(!e)return n;const t=kt(Object.create(null),n);for(const r in e)t[r]=ct(n[r],e[r]);return t}let sk=null;function ok(n,e,t=!1){const r=_s||un;if(r||sk){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Le(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&Oe(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&Oe("inject() can only be used inside setup() or functional components.")}const ak={},rm=n=>Object.getPrototypeOf(n)===ak,lk=mk,uk=Symbol.for("v-scx"),ck=()=>{{const n=ok(uk);return n||process.env.NODE_ENV!=="production"&&Oe("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function fk(n,e,t){return process.env.NODE_ENV!=="production"&&!Le(e)&&Oe("`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."),im(n,e,t)}function im(n,e,t=Ft){const{immediate:r,deep:i,flush:o,once:l}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&Oe('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&Oe('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),l!==void 0&&Oe('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=kt({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=Oe);const f=e&&r||!e&&o!=="post";let d;if(ia){if(o==="sync"){const S=ck();d=S.__watcherHandles||(S.__watcherHandles=[])}else if(!f){const S=()=>{};return S.stop=xr,S.resume=xr,S.pause=xr,S}}const g=_s;u.call=(S,k,m)=>Up(S,g,k,m);let p=!1;o==="post"?u.scheduler=S=>{lk(S,g&&g.suspense)}:o!=="sync"&&(p=!0,u.scheduler=(S,k)=>{k?S():ju(S)}),u.augmentJob=S=>{e&&(S.flags|=4),p&&(S.flags|=2,g&&(S.id=g.uid,S.i=g))};const _=LE(n,e,u);return ia&&(d?d.push(_):f&&_()),_}function hk(n,e,t){const r=this.proxy,i=Yt(n)?n.includes(".")?dk(r,n):()=>r[n]:n.bind(r,r);let o;Le(e)?o=e:(o=e.handler,t=e);const l=Ck(this),u=im(i,o.bind(r),t);return l(),u}function dk(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 II(){}const pk=n=>n.__isSuspense;function mk(n,e){e&&e.pendingBranch?Ce(n)?e.effects.push(...n):e.effects.push(n):Gp(n)}const sm=Symbol.for("v-fgt"),gk=Symbol.for("v-txt"),yk=Symbol.for("v-cmt");let bi=null;function bk(n){return n?n.__v_isVNode===!0:!1}const _k=(...n)=>am(...n),om=({key:n})=>n??null,na=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Yt(n)||Ge(n)||Le(n)?{i:un,r:n,k:e,f:!!t}:n:null);function vk(n,e=null,t=null,r=0,i=null,o=n===sm?0:1,l=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&om(e),ref:e&&na(e),scopeId:JE,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:un};return u?(Qu(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=Yt(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&Oe("VNode created with invalid key (NaN). VNode type:",f.type),!l&&bi&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&bi.push(f),f}const wk=process.env.NODE_ENV!=="production"?_k:am;function am(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===XE)&&(process.env.NODE_ENV!=="production"&&!n&&Oe(`Invalid vnode type when creating vnode: ${n}.`),n=yk),bk(n)){const u=ra(n,e,!0);return t&&Qu(u,t),!o&&bi&&(u.shapeFlag&6?bi[bi.indexOf(n)]=u:bi.push(u)),u.patchFlag=-2,u}if(fm(n)&&(n=n.__vccOpts),e){e=Sk(e);let{class:u,style:f}=e;u&&!Yt(u)&&(e.class=Mu(u)),lt(f)&&(Ko(f)&&!Ce(f)&&(f=kt({},f)),e.style=Tu(f))}const l=Yt(n)?1:pk(n)?128:YE(n)?64:lt(n)?4:Le(n)?2:0;return process.env.NODE_ENV!=="production"&&l&4&&Ko(n)&&(n=ce(n),Oe("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`.",`
|
|
26
|
-
Component that was made reactive: `,n)),vk(n,e,t,r,i,l,o,!0)}function Sk(n){return n?Ko(n)||rm(n)?kt({},n):n:null}function ra(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:l,children:u,transition:f}=n,d=e?Ek(i||{},e):i,g={__v_isVNode:!0,__v_skip:!0,type:n.type,props:d,key:d&&om(d),ref:e&&e.ref?t&&o?Ce(o)?o.concat(na(e)):[o,na(e)]:na(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&Ce(u)?u.map(lm):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==sm?l===-1?16:l|16:l,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:f,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&ra(n.ssContent),ssFallback:n.ssFallback&&ra(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&Zp(g,f.clone(g)),g}function lm(n){const e=ra(n);return Ce(n.children)&&(e.children=n.children.map(lm)),e}function xk(n=" ",e=0){return wk(gk,null,n,e)}function Qu(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Ce(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Qu(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!rm(e)?e._ctx=un:i===3&&un&&(un.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Le(e)?(e={default:e,_ctx:un},t=32):(e=String(e),r&64?(t=16,e=[xk(e)]):t=8);n.children=e,n.shapeFlag|=t}function Ek(...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=Mu([e.class,r.class]));else if(i==="style")e.style=Tu([e.style,r.style]);else if(Ux(i)){const o=e[i],l=r[i];l&&o!==l&&!(Ce(o)&&o.includes(l))&&(e[i]=o?[].concat(o,l):l)}else i!==""&&(e[i]=r[i])}return e}let _s=null;const kk=()=>_s||un;let ec;{const n=Ho(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),o=>{i.length>1?i.forEach(l=>l(o)):i[0](o)}};ec=e("__VUE_INSTANCE_SETTERS__",t=>_s=t),e("__VUE_SSR_SETTERS__",t=>ia=t)}const Ck=n=>{const e=_s;return ec(n),n.scope.on(),()=>{n.scope.off(),ec(e)}};function Ak(n){return n.vnode.shapeFlag&4}let ia=!1;process.env.NODE_ENV;function Ok(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(AE(xE(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in ys)return ys[t](n)},has(e,t){return t in e||t in ys}})):n.proxy}const Tk=/(?:^|[-_])(\w)/g,Mk=n=>n.replace(Tk,e=>e.toUpperCase()).replace(/[-_]/g,"");function um(n,e=!0){return Le(n)?n.displayName||n.name:n.name||e&&n.__name}function cm(n,e,t=!1){let r=um(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 l in o)if(o[l]===e)return l};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?Mk(r):t?"App":"Anonymous"}function fm(n){return Le(n)&&"__vccOpts"in n}const de=(n,e)=>{const t=NE(n,e,ia);if(process.env.NODE_ENV!=="production"){const r=kk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function Ik(){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={__vue_custom_formatter:!0,header(p){return lt(p)?p.__isVue?["div",n,"VueInstance"]:Ge(p)?["div",{},["span",n,g(p)],"<",u("_value"in p?p._value:p),">"]:di(p)?["div",{},["span",n,gt(p)?"ShallowReactive":"Reactive"],"<",u(p),`>${Rn(p)?" (readonly)":""}`]:Rn(p)?["div",{},["span",n,gt(p)?"ShallowReadonly":"Readonly"],"<",u(p),">"]:null:null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...o(p.$)]}};function o(p){const _=[];p.type.props&&p.props&&_.push(l("props",ce(p.props))),p.setupState!==Ft&&_.push(l("setup",p.setupState)),p.data!==Ft&&_.push(l("data",ce(p.data)));const S=f(p,"computed");S&&_.push(l("computed",S));const k=f(p,"inject");return k&&_.push(l("injected",k)),_.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),_}function l(p,_){return _=kt({},_),Object.keys(_).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(_).map(S=>["div",{},["span",r,S+": "],u(_[S],!1)])]]:["span",{}]}function u(p,_=!0){return typeof p=="number"?["span",e,p]:typeof p=="string"?["span",t,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:lt(p)?["object",{object:_?ce(p):p}]:["span",t,String(p)]}function f(p,_){const S=p.type;if(Le(S))return;const k={};for(const m in p.ctx)d(S,m,_)&&(k[m]=p.ctx[m]);return k}function d(p,_,S){const k=p[S];if(Ce(k)&&k.includes(_)||lt(k)&&_ in k||p.extends&&d(p.extends,_,S)||p.mixins&&p.mixins.some(m=>d(m,_,S)))return!0}function g(p){return gt(p)?"ShallowRef":p.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 Nk(){Ik()}process.env.NODE_ENV!=="production"&&Nk();function je(n){this.content=n}je.prototype={constructor:je,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 je(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 je(t)},addToStart:function(n,e){return new je([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new je(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 je(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=je.from(n),n.size?new je(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=je.from(n),n.size?new je(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=je.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}},je.from=function(n){if(n instanceof je)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new je(e)};function hm(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 l=0;i.text[l]==o.text[l];l++)t++;return t}if(i.content.size||o.content.size){let l=hm(i.content,o.content,t+1);if(l!=null)return l}t+=i.nodeSize}}function dm(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 l=n.child(--i),u=e.child(--o),f=l.nodeSize;if(l==u){t-=f,r-=f;continue}if(!l.sameMarkup(u))return{a:t,b:r};if(l.isText&&l.text!=u.text){let d=0,g=Math.min(l.text.length,u.text.length);for(;d<g&&l.text[l.text.length-d-1]==u.text[u.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(l.content.size||u.content.size){let d=dm(l.content,u.content,t-1,r-1);if(d)return d}t-=f,r-=f}}class B{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 l=0,u=0;u<t;l++){let f=this.content[l],d=u+f.nodeSize;if(d>e&&r(f,i+u,o||null,l)!==!1&&f.content.size){let g=u+1;f.nodesBetween(Math.max(0,e-g),Math.min(f.content.size,t-g),r,i+g)}u=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",l=!0;return this.nodesBetween(e,t,(u,f)=>{u.isText?(o+=u.text.slice(Math.max(e,f)-f,t-f),l=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),l=!r):!l&&u.isBlock&&(o+=r,l=!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 B(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,l=0;l<t;o++){let u=this.content[o],f=l+u.nodeSize;f>e&&((l<e||f>t)&&(u.isText?u=u.cut(Math.max(0,e-l),Math.min(u.text.length,t-l)):u=u.cut(Math.max(0,e-l-1),Math.min(u.content.size,t-l-1))),r.push(u),i+=u.nodeSize),l=f}return new B(r,i)}cutByIndex(e,t){return e==t?B.empty:e==0&&t==this.content.length?this:new B(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 B(i,o)}addToStart(e){return new B([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new B(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 hm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return dm(this,e,t,r)}findIndex(e,t=-1){if(e==0)return sa(0,e);if(e==this.size)return sa(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),l=i+o.nodeSize;if(l>=e)return l==e||t>0?sa(r+1,l):sa(r,i);i=l}}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 B.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new B(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return B.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 B(t||e,r)}static from(e){if(!e)return B.empty;if(e instanceof B)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new B([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}B.empty=new B([],0);const tc={index:0,offset:0};function sa(n,e){return tc.index=n,tc.offset=e,tc}function oa(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(!oa(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!oa(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Ee=class Af{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&&oa(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 Af.none;if(e instanceof Af)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Ee.none=[];class aa extends Error{}class K{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=mm(this.content,e+this.openStart,t);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(e,t){return new K(pm(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 K.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 K(B.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 K(e,r,i)}}K.empty=new K(B.empty,0,0);function pm(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:l,offset:u}=n.findIndex(t);if(i==e||o.isText){if(u!=t&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(pm(o.content,e-i-1,t-i-1)))}function mm(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),l=n.maybeChild(i);if(o==e||l.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=mm(l.content,e-o-1,t);return u&&n.replaceChild(i,l.copy(u))}function Rk(n,e,t){if(t.openStart>n.depth)throw new aa("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new aa("Inconsistent open depths");return gm(n,e,t,0)}function gm(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let l=gm(n,e,t,r+1);return o.copy(o.content.replaceChild(i,l))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let l=n.parent,u=l.content;return Or(l,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:l,end:u}=Lk(t,n);return Or(o,bm(n,l,u,e,r))}else return Or(o,la(n,e,r))}function ym(n,e){if(!e.type.compatibleContent(n.type))throw new aa("Cannot join "+e.type.name+" onto "+n.type.name)}function nc(n,e,t){let r=n.node(t);return ym(r,e.node(t)),r}function Ar(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 vs(n,e,t,r){let i=(e||n).node(t),o=0,l=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Ar(n.nodeAfter,r),o++));for(let u=o;u<l;u++)Ar(i.child(u),r);e&&e.depth==t&&e.textOffset&&Ar(e.nodeBefore,r)}function Or(n,e){return n.type.checkContent(e),n.copy(e)}function bm(n,e,t,r,i){let o=n.depth>i&&nc(n,e,i+1),l=r.depth>i&&nc(t,r,i+1),u=[];return vs(null,n,i,u),o&&l&&e.index(i)==t.index(i)?(ym(o,l),Ar(Or(o,bm(n,e,t,r,i+1)),u)):(o&&Ar(Or(o,la(n,e,i+1)),u),vs(e,t,i,u),l&&Ar(Or(l,la(t,r,i+1)),u)),vs(r,null,i,u),new B(u)}function la(n,e,t){let r=[];if(vs(null,n,t,r),n.depth>t){let i=nc(n,e,t+1);Ar(Or(i,la(n,e,t+1)),r)}return vs(e,null,t,r),new B(r)}function Lk(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(B.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Bs{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 Ee.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 l=0;l<o.length;l++)o[l].type.spec.inclusive===!1&&(!i||!o[l].isInSet(i.marks))&&(o=o[l--].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 ua(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 l=e;;){let{index:u,offset:f}=l.content.findIndex(o),d=o-f;if(r.push(l,u,i+f),!d||(l=l.child(u),l.isText))break;o=d-1,i+=f+1}return new Bs(t,r,o)}static resolveCached(e,t){for(let i=0;i<rc.length;i++){let o=rc[i];if(o.pos==t&&o.doc==e)return o}let r=rc[ic]=Bs.resolve(e,t);return ic=(ic+1)%Pk,r}}let rc=[],ic=0,Pk=12;class ua{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 Dk=Object.create(null);let Tr=class Of{constructor(e,t,r,i=Ee.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||B.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&&oa(this.attrs,t||e.defaultAttrs||Dk)&&Ee.sameSet(this.marks,r||Ee.none)}copy(e=null){return e==this.content?this:new Of(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Of(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 K.empty;let i=this.resolve(e),o=this.resolve(t),l=r?0:i.sharedDepth(t),u=i.start(l),d=i.node(l).content.cut(i.pos-u,o.pos-u);return new K(d,i.depth-l,o.depth-l)}replace(e,t,r){return Rk(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 Bs.resolveCached(this,e)}resolveNoCache(e){return Bs.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()+")"),_m(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=B.empty,i=0,o=r.childCount){let l=this.contentMatchAt(e).matchFragment(r,i,o),u=l&&l.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),l=o&&o.matchFragment(this.content,t);return l?l.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=Ee.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Ee.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=B.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Tr.prototype.text=void 0;class Qa extends Tr{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):_m(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 Qa(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Qa(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 _m(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Vr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Fk(e,t);if(r.next==null)return Vr.empty;let i=vm(r);r.next&&r.err("Unexpected trailing text");let o=Uk(Wk(i));return qk(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(l,u){let f=l.matchFragment(e,r);if(f&&(!t||f.validEnd))return B.from(u.map(d=>d.createAndFill()));for(let d=0;d<l.next.length;d++){let{type:g,next:p}=l.next[d];if(!(g.isText||g.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let _=o(p,u.concat(g));if(_)return _}}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 l=[];for(let u=i;u.type;u=u.via)l.push(u.type);return l.reverse()}for(let l=0;l<o.next.length;l++){let{type:u,next:f}=o.next[l];!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 l=0;l<r.next.length;l++)o+=(l?", ":"")+r.next[l].type.name+"->"+e.indexOf(r.next[l].next);return o}).join(`
|
|
27
|
-
`)}}Vr.empty=new Vr(!0);class Fk{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 vm(n){let e=[];do e.push(Bk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Bk(n){let e=[];do e.push(Hk(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Hk(n){let e=Vk(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=$k(n,e);else break;return e}function wm(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function $k(n,e){let t=wm(n),r=t;return n.eat(",")&&(n.next!="}"?r=wm(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function zk(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let l=t[o];l.groups.indexOf(e)>-1&&i.push(l)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Vk(n){if(n.eat("(")){let e=vm(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=zk(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 Wk(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(l,u,f){let d={term:f,to:u};return e[l].push(d),d}function i(l,u){l.forEach(f=>f.to=u)}function o(l,u){if(l.type=="choice")return l.exprs.reduce((f,d)=>f.concat(o(d,u)),[]);if(l.type=="seq")for(let f=0;;f++){let d=o(l.exprs[f],u);if(f==l.exprs.length-1)return d;i(d,u=t())}else if(l.type=="star"){let f=t();return r(u,f),i(o(l.expr,f),f),[r(f)]}else if(l.type=="plus"){let f=t();return i(o(l.expr,u),f),i(o(l.expr,f),f),[r(f)]}else{if(l.type=="opt")return[r(u)].concat(o(l.expr,u));if(l.type=="range"){let f=u;for(let d=0;d<l.min;d++){let g=t();i(o(l.expr,f),g),f=g}if(l.max==-1)i(o(l.expr,f),f);else for(let d=l.min;d<l.max;d++){let g=t();r(f,g),i(o(l.expr,f),g),f=g}return[r(f)]}else{if(l.type=="name")return[r(u,void 0,l.value)];throw new Error("Unknown expr type")}}}}function Sm(n,e){return e-n}function xm(n,e){let t=[];return r(e),t.sort(Sm);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let l=0;l<o.length;l++){let{term:u,to:f}=o[l];!u&&t.indexOf(f)==-1&&r(f)}}}function Uk(n){let e=Object.create(null);return t(xm(n,0));function t(r){let i=[];r.forEach(l=>{n[l].forEach(({term:u,to:f})=>{if(!u)return;let d;for(let g=0;g<i.length;g++)i[g][0]==u&&(d=i[g][1]);xm(n,f).forEach(g=>{d||i.push([u,d=[]]),d.indexOf(g)==-1&&d.push(g)})})});let o=e[r.join(",")]=new Vr(r.indexOf(n.length-1)>-1);for(let l=0;l<i.length;l++){let u=i[l][1].sort(Sm);o.next.push({type:i[l][0],next:e[u.join(",")]||t(u)})}return o}}function qk(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,l=[];for(let u=0;u<i.next.length;u++){let{type:f,next:d}=i.next[u];l.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Em(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 km(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 Cm(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new Kk(n[t]);return e}let Am=class U0{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=Cm(r.attrs),this.defaultAttrs=Em(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==Vr.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:km(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Tr(this,this.computeAttrs(e),B.from(t),Ee.setFrom(r))}createChecked(e=null,t,r){return t=B.from(t),this.checkContent(t),new Tr(this,this.computeAttrs(e),t,Ee.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=B.from(t),t.size){let l=this.contentMatch.fillBefore(t);if(!l)return null;t=l.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(B.empty,!0);return o?new Tr(this,e,t.append(o),Ee.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:Ee.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,l)=>r[o]=new U0(o,t,l));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 Kk{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class el{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Cm(i.attrs),this.excluded=null;let o=Em(this.attrs);this.instance=o?new Ee(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ee(this,km(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,l)=>r[o]=new el(o,i++,t,l)),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 Gk{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=je.from(e.nodes),t.marks=je.from(e.marks||{}),this.nodes=Am.compile(this.spec.nodes,this),this.marks=el.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],l=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[l]||(r[l]=Vr.parse(l,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?Om(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],l=o.spec.excludes;o.excluded=l==null?[o]:l==""?[]:Om(this,l.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 Am){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 Qa(r,r.defaultAttrs,e,Ee.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Tr.fromJSON(this,e)}markFromJSON(e){return Ee.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Om(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],l=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(l=f)}if(!l)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}let sc=class Tf{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 Nm(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Nm(this,t,!0);return r.addAll(e,t.from,t.to),K.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(Yk(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let l=o.getAttrs(e);if(l===!1)continue;o.attrs=l||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 l=this.styles[o],u=l.style;if(!(u.indexOf(e)!=0||l.context&&!r.matchesContext(l.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=t))){if(l.getAttrs){let f=l.getAttrs(t);if(f===!1)continue;l.attrs=f||void 0}return l}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,l=0;for(;l<t.length;l++){let u=t[l];if((u.priority==null?50:u.priority)<o)break}t.splice(l,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(l=>{r(l=Rm(l)),l.mark||l.ignore||l.clearMark||(l.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(l=>{r(l=Rm(l)),l.node||l.ignore||l.mark||(l.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Tf(e,Tf.schemaRules(e)))}};const Tm={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},jk={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Mm={ol:!0,ul:!0},ca=1,fa=2,ws=4;function Im(n,e,t){return e!=null?(e?ca:0)|(e==="full"?fa:0):n&&n.whitespace=="pre"?ca|fa:t&~ws}class ha{constructor(e,t,r,i,o,l,u){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=Ee.none,this.stashMarks=[],this.match=l||(u&ws?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(B.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&ca)){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=B.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(B.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):Zk(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&&!Tm.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Nm{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,l=Im(null,t.preserveWhitespace,0)|(r?ws:0);i?o=new ha(i.type,i.attrs,Ee.none,Ee.none,!0,t.topMatch||i.type.contentMatch,l):r?o=new ha(null,null,Ee.none,Ee.none,!0,null,l):o=new ha(e.schema.topNodeType,null,Ee.none,Ee.none,!0,null,l),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(Xk(t));if(!r)return;let[i,o]=r,l=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],l);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],l);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&fa||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&ca)r.options&fa?t=t.replace(/\r\n?/g,`
|
|
28
|
-
`):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;
|
|
29
|
-
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Ee.none,r=Ee.none;e:for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let l=this.parser.matchStyle(e[i],e[i+1],this,o);if(!l)continue e;if(l.ignore)return null;if(l.clearMark?this.top.pendingMarks.forEach(u=>{l.clearMark(u)&&(r=u.addToSet(r))}):t=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(t),l.consuming===!1)o=l;else break}return[t,r]}addElementByRule(e,t,r){let i,o,l;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)):(l=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(l));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--,l&&this.removePendingMark(l,u)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,l=r==null?null:e.childNodes[r];o!=l;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],l=o.findWrapping(e);if(l&&(!t||t.length>l.length)&&(t=l,r=o,!l.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 l=Im(e,i,o.options);o.options&ws&&o.content.length==0&&(l|=ws),this.nodes.push(new ha(e,t,o.activeMarks,o.pendingMarks,r,null,l)),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),l=(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(l(u-1,f))return!0;return!1}else{let g=f>0||f==0&&i?this.nodes[f].type:r&&f>=o?r.node(f-o).type:null;if(!g||g.name!=d&&g.groups.indexOf(d)==-1)return!1;f--}}return!0};return l(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=Qk(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 l=i.popFromStashMark(e);l&&i.type&&i.type.allowsMarkType(l.type)&&(i.activeMarks=l.addToSet(i.activeMarks))}if(i==t)break}}}function Jk(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Mm.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Yk(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Xk(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 Rm(n){let e={};for(let t in n)e[t]=n[t];return e}function Zk(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],l=u=>{o.push(u);for(let f=0;f<u.edgeCount;f++){let{type:d,next:g}=u.edge(f);if(d==e||o.indexOf(g)<0&&l(g))return!0}};if(l(i.contentMatch))return!0}}function Qk(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class Ur{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=oc(t).createDocumentFragment());let i=r,o=[];return e.forEach(l=>{if(o.length||l.marks.length){let u=0,f=0;for(;u<o.length&&f<l.marks.length;){let d=l.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<l.marks.length;){let d=l.marks[f++],g=this.serializeMark(d,l.isInline,t);g&&(o.push([d,i]),i.appendChild(g.dom),i=g.contentDOM||g.dom)}}i.appendChild(this.serializeNodeInner(l,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Ur.renderSpec(oc(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&&Ur.renderSpec(oc(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 l,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 g in f)if(f[g]!=null){let p=g.indexOf(" ");p>0?u.setAttributeNS(g.slice(0,p),g.slice(p+1),f[g]):u.setAttribute(g,f[g])}}for(let g=d;g<t.length;g++){let p=t[g];if(p===0){if(g<t.length-1||g>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:_,contentDOM:S}=Ur.renderSpec(e,p,r);if(u.appendChild(_),S){if(l)throw new RangeError("Multiple content holes");l=S}}}return{dom:u,contentDOM:l}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ur(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Lm(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Lm(e.marks)}}function Lm(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function oc(n){return n.document||window.document}const Pm=65535,Dm=Math.pow(2,16);function eC(n,e){return n+e*Dm}function Fm(n){return n&Pm}function tC(n){return(n-(n&Pm))/Dm}const Bm=1,Hm=2,da=4,$m=8;class ac{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&$m)>0}get deletedBefore(){return(this.delInfo&(Bm|da))>0}get deletedAfter(){return(this.delInfo&(Hm|da))>0}get deletedAcross(){return(this.delInfo&da)>0}}class Wt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Wt.empty)return Wt.empty}recover(e){let t=0,r=Fm(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+tC(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,l=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],g=this.ranges[u+l],p=f+d;if(e<=p){let _=d?e==f?-1:e==p?1:t:t,S=f+i+(_<0?0:g);if(r)return S;let k=e==(t<0?f:p)?null:eC(u/3,e-f),m=e==f?Hm:e==p?Bm:da;return(t<0?e!=f:e!=p)&&(m|=$m),new ac(S,m,k)}i+=g-d}return r?e+i:new ac(e+i,0,null)}touches(e,t){let r=0,i=Fm(t),o=this.inverted?2:1,l=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],g=f+d;if(e<=g&&u==i*3)return!0;r+=this.ranges[u+l]-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 l=this.ranges[i],u=l-(this.inverted?o:0),f=l+(this.inverted?0:o),d=this.ranges[i+t],g=this.ranges[i+r];e(u,u+d,f,f+g),o+=g-d}}invert(){return new Wt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Wt.empty:new Wt(e<0?[0,-e,0]:[0,0,e])}}Wt.empty=new Wt([]);class Bi{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 Bi(this.maps,this.mirror,e,t)}copy(){return new Bi(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 Bi;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 l=this.maps[o],u=l.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 ac(e,i,null)}}const lc=Object.create(null);class tt{getMap(){return Wt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=lc[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 lc)throw new RangeError("Duplicate use of step JSON ID "+e);return lc[e]=t,t.prototype.jsonID=e,t}}class De{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new De(e,null)}static fail(e){return new De(null,e)}static fromReplace(e,t,r,i){try{return De.ok(e.replace(t,r,i))}catch(o){if(o instanceof aa)return De.fail(o.message);throw o}}}function uc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(uc(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return B.fromArray(r)}class fr extends tt{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 K(uc(t.content,(l,u)=>!l.isAtom||!u.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),i),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,o)}invert(){return new yn(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 fr(t.pos,r.pos,this.mark)}merge(e){return e instanceof fr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fr(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 fr(t.from,t.to,e.markFromJSON(t.mark))}}tt.jsonID("addMark",fr);class yn extends tt{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 K(uc(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,r)}invert(){return new fr(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 yn(t.pos,r.pos,this.mark)}merge(e){return e instanceof yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yn(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 yn(t.from,t.to,e.markFromJSON(t.mark))}}tt.jsonID("removeMark",yn);class hr extends tt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new K(B.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 hr(this.pos,t.marks[i]);return new hr(this.pos,this.mark)}}return new Hi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new hr(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 hr(t.pos,e.markFromJSON(t.mark))}}tt.jsonID("addNodeMark",hr);class Hi extends tt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new K(B.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new hr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Hi(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 Hi(t.pos,e.markFromJSON(t.mark))}}tt.jsonID("removeNodeMark",Hi);class nt extends tt{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&cc(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Wt([this.from,this.to-this.from,this.slice.size])}invert(e){return new nt(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 nt(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof nt)||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?K.empty:new K(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new nt(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?K.empty:new K(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new nt(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 nt(t.from,t.to,K.fromJSON(e,t.slice),!!t.structure)}}tt.jsonID("replace",nt);class We extends tt{constructor(e,t,r,i,o,l,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=l,this.structure=u}apply(e){if(this.structure&&(cc(e,this.from,this.gapFrom)||cc(e,this.gapTo,this.to)))return De.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return De.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?De.fromReplace(e,this.from,this.to,r):De.fail("Content does not fit in gap")}getMap(){return new Wt([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 We(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 We(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 We(t.from,t.to,t.gapFrom,t.gapTo,K.fromJSON(e,t.slice),t.insert,!!t.structure)}}tt.jsonID("replaceAround",We);function cc(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 l=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,i--}}return!1}function nC(n,e,t,r){let i=[],o=[],l,u;n.doc.nodesBetween(e,t,(f,d,g)=>{if(!f.isInline)return;let p=f.marks;if(!r.isInSet(p)&&g.type.allowsMarkType(r.type)){let _=Math.max(d,e),S=Math.min(d+f.nodeSize,t),k=r.addToSet(p);for(let m=0;m<p.length;m++)p[m].isInSet(k)||(l&&l.to==_&&l.mark.eq(p[m])?l.to=S:i.push(l=new yn(_,S,p[m])));u&&u.to==_?u.to=S:o.push(u=new fr(_,S,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function rC(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(l,u)=>{if(!l.isInline)return;o++;let f=null;if(r instanceof el){let d=l.marks,g;for(;g=r.isInSet(d);)(f||(f=[])).push(g),d=g.removeFromSet(d)}else r?r.isInSet(l.marks)&&(f=[r]):f=l.marks;if(f&&f.length){let d=Math.min(u+l.nodeSize,t);for(let g=0;g<f.length;g++){let p=f[g],_;for(let S=0;S<i.length;S++){let k=i[S];k.step==o-1&&p.eq(i[S].style)&&(_=k)}_?(_.to=d,_.step=o):i.push({style:p,from:Math.max(u,e),to:d,step:o})}}}),i.forEach(l=>n.step(new yn(l.from,l.to,l.style)))}function iC(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let u=0;u<i.childCount;u++){let f=i.child(u),d=l+f.nodeSize,g=r.matchType(f.type);if(!g)o.push(new nt(l,d,K.empty));else{r=g;for(let p=0;p<f.marks.length;p++)t.allowsMarkType(f.marks[p].type)||n.step(new yn(l,d,f.marks[p]))}l=d}if(!r.validEnd){let u=r.fillBefore(B.empty,!0);n.replace(l,l,new K(u,0,0))}for(let u=o.length-1;u>=0;u--)n.step(o[u])}function sC(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function _i(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),l=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,l,t))return r;if(r==0||i.type.spec.isolating||!sC(i,o,l))break}return null}function oC(n,e,t){let{$from:r,$to:i,depth:o}=e,l=r.before(o+1),u=i.after(o+1),f=l,d=u,g=B.empty,p=0;for(let k=o,m=!1;k>t;k--)m||r.index(k)>0?(m=!0,g=B.from(r.node(k).copy(g)),p++):f--;let _=B.empty,S=0;for(let k=o,m=!1;k>t;k--)m||i.after(k+1)<i.end(k)?(m=!0,_=B.from(i.node(k).copy(_)),S++):d++;n.step(new We(f,d,l,u,new K(g.append(_),p,S),g.size-p,!0))}function fc(n,e,t=null,r=n){let i=aC(n,e),o=i&&lC(r,e);return o?i.map(zm).concat({type:e,attrs:t}).concat(o.map(zm)):null}function zm(n){return{type:n,attrs:null}}function aC(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let l=o.length?o[0]:e;return t.canReplaceWith(r,i,l)?o:null}function lC(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),l=e.contentMatch.findWrapping(o.type);if(!l)return null;let f=(l.length?l[l.length-1]:e).contentMatch;for(let d=r;f&&d<i;d++)f=f.matchType(t.child(d).type);return!f||!f.validEnd?null:l}function uC(n,e,t){let r=B.empty;for(let l=t.length-1;l>=0;l--){if(r.size){let u=t[l].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=B.from(t[l].type.create(t[l].attrs,r))}let i=e.start,o=e.end;n.step(new We(i,o,i,o,new K(r,0,0),t.length,!0))}function cC(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,(l,u)=>{if(l.isTextblock&&!l.hasMarkup(r,i)&&fC(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),g=f.map(u+l.nodeSize,1);return n.step(new We(d,g,d+1,g-1,new K(B.from(r.create(i,null,l.marks)),0,0),1,!0)),!1}})}function fC(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function hC(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 l=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,l);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new We(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new K(B.from(l),0,0),1,!0))}function vi(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,l=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!l.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,g=t-2;d>o;d--,g--){let p=i.node(d),_=i.index(d);if(p.type.spec.isolating)return!1;let S=p.content.cutByIndex(_,p.childCount),k=r&&r[g]||p;if(k!=p&&(S=S.replaceChild(0,k.type.create(k.attrs))),!p.canReplace(_+1,p.childCount)||!k.type.validContent(S))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 dC(n,e,t=1,r){let i=n.doc.resolve(e),o=B.empty,l=B.empty;for(let u=i.depth,f=i.depth-t,d=t-1;u>f;u--,d--){o=B.from(i.node(u).copy(o));let g=r&&r[d];l=B.from(g?g.type.create(g.attrs,l):i.node(u).copy(l))}n.step(new nt(e,e,new K(o.append(l),t,t),!0))}function Zn(n,e){let t=n.resolve(e),r=t.index();return Vm(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Vm(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function pa(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,l,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,l=r.nodeAfter):t>0?(o=r.node(i+1),u++,l=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),l=r.node(i+1)),o&&!o.isTextblock&&Vm(o,l)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function pC(n,e,t){let r=new nt(e-t,e+t,K.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 gC(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 l=r.depth;l>=0;l--){let u=l==r.depth?0:r.pos<=(r.start(l+1)+r.end(l+1))/2?-1:1,f=r.index(l)+(u>0?1:0),d=r.node(l),g=!1;if(o==1)g=d.canReplace(f,f,i);else{let p=d.contentMatchAt(f).findWrapping(i.firstChild.type);g=p&&d.canReplaceWith(f,f,p[0])}if(g)return u==0?r.pos:u<0?r.before(l+1):r.after(l+1)}return null}function hc(n,e,t=e,r=K.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return Wm(i,o,r)?new nt(e,t,r):new yC(i,o,r).fit()}function Wm(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class yC{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=B.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=B.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,l=r.depth,u=i.depth;for(;l&&u&&o.childCount==1;)o=o.firstChild.content,l--,u--;let f=new K(o,l,u);return e>-1?new We(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new nt(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=dc(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:f}=this.frontier[l],d,g=null;if(e==1&&(o?f.matchType(o.type)||(g=f.fillBefore(B.from(o),!1)):i&&u.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:l,parent:i,inject:g};if(e==2&&o&&(d=f.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:l,parent:i,wrap:d};if(i&&f.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=dc(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new K(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=dc(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new K(Ss(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new K(Ss(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 m=0;m<o.length;m++)this.openFrontierNode(o[m]);let l=this.unplaced,u=r?r.content:l.content,f=l.openStart-e,d=0,g=[],{match:p,type:_}=this.frontier[t];if(i){for(let m=0;m<i.childCount;m++)g.push(i.child(m));p=p.matchFragment(i)}let S=u.size+e-(l.content.size-l.openEnd);for(;d<u.childCount;){let m=u.child(d),b=p.matchType(m.type);if(!b)break;d++,(d>1||f==0||m.content.size)&&(p=b,g.push(Um(m.mark(_.allowedMarks(m.marks)),d==1?f:0,d==u.childCount?S:-1)))}let k=d==u.childCount;k||(S=-1),this.placed=xs(this.placed,t,B.from(g)),this.frontier[t].match=p,k&&S<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=u;m<S;m++){let x=b.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),b=x.content}this.unplaced=k?e==0?K.empty:new K(Ss(l.content,e-1,1),e-1,S<0?l.openEnd:e-1):new K(Ss(l.content,e,d),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!pc(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)),l=pc(e,t,i,r,o);if(l){for(let u=t-1;u>=0;u--){let{match:f,type:d}=this.frontier[u],g=pc(e,u,d,f,!0);if(!g||g.childCount)continue e}return{depth:t,fit:l,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=xs(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=xs(this.placed,this.depth,B.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(B.empty,!0);t.childCount&&(this.placed=xs(this.placed,this.frontier.length,t))}}function Ss(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ss(n.firstChild.content,e-1,t)))}function xs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(xs(n.lastChild.content,e-1,t)))}function dc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Um(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Um(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(B.empty,!0)))),n.copy(r)}function pc(n,e,t,r,i){let o=n.node(e),l=i?n.indexAfter(e):n.index(e);if(l==o.childCount&&!t.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,l);return u&&!bC(t,o.content,l)?u:null}function bC(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function _C(n){return n.spec.defining||n.spec.definingForContent}function vC(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(Wm(i,o,r))return n.step(new nt(e,t,r));let l=Km(i,n.doc.resolve(t));l[l.length-1]==0&&l.pop();let u=-(i.depth+1);l.unshift(u);for(let _=i.depth,S=i.pos-1;_>0;_--,S--){let k=i.node(_).type.spec;if(k.defining||k.definingAsContext||k.isolating)break;l.indexOf(_)>-1?u=_:i.before(_)==S&&l.splice(1,0,-_)}let f=l.indexOf(u),d=[],g=r.openStart;for(let _=r.content,S=0;;S++){let k=_.firstChild;if(d.push(k),S==r.openStart)break;_=k.content}for(let _=g-1;_>=0;_--){let S=d[_].type,k=_C(S);if(k&&i.node(f).type!=S)g=_;else if(k||!S.isTextblock)break}for(let _=r.openStart;_>=0;_--){let S=(_+g+1)%(r.openStart+1),k=d[S];if(k)for(let m=0;m<l.length;m++){let b=l[(m+f)%l.length],x=!0;b<0&&(x=!1,b=-b);let A=i.node(b-1),O=i.index(b-1);if(A.canReplaceWith(O,O,k.type,k.marks))return n.replace(i.before(b),x?o.after(b):t,new K(qm(r.content,0,r.openStart,S),S,r.openEnd))}}let p=n.steps.length;for(let _=l.length-1;_>=0&&(n.replace(e,t,r),!(n.steps.length>p));_--){let S=l[_];S<0||(e=i.before(S),t=o.after(S))}}function qm(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(qm(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),l=o.fillBefore(n).append(n);n=l.append(o.matchFragment(l).fillBefore(B.empty,!0))}return n}function wC(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 K(B.from(r),0,0))}function SC(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Km(r,i);for(let l=0;l<o.length;l++){let u=o[l],f=l==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 l=1;l<=r.depth&&l<=i.depth;l++)if(e-r.start(l)==r.depth-l&&t>r.end(l)&&i.end(l)-t!=i.depth-l)return n.delete(r.before(l),t);n.delete(e,t)}function Km(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 tt{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 De.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 De.fromReplace(e,this.pos,this.pos+1,new K(B.from(i),0,t.isLeaf?0:1))}getMap(){return Wt.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)}}tt.jsonID("attr",$i);let wi=class extends Error{};wi=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},wi.prototype=Object.create(Error.prototype),wi.prototype.constructor=wi,wi.prototype.name="TransformError";class xC{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Bi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new wi(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=K.empty){let i=hc(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new K(B.from(r),0,0))}delete(e,t){return this.replace(e,t,K.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return vC(this,e,t,r),this}replaceRangeWith(e,t,r){return wC(this,e,t,r),this}deleteRange(e,t){return SC(this,e,t),this}lift(e,t){return oC(this,e,t),this}join(e,t=1){return pC(this,e,t),this}wrap(e,t){return uC(this,e,t),this}setBlockType(e,t=e,r,i=null){return cC(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return hC(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 hr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Ee)){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 Hi(e,t)),this}split(e,t=1,r){return dC(this,e,t,r),this}addMark(e,t,r){return nC(this,e,t,r),this}removeMark(e,t,r){return rC(this,e,t,r),this}clearIncompatible(e,t,r){return iC(this,e,t,r),this}}const mc=Object.create(null);class pe{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new EC(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=K.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,l=this.ranges;for(let u=0;u<l.length;u++){let{$from:f,$to:d}=l[u],g=e.mapping.slice(o);e.replaceRange(g.map(f.pos),g.map(d.pos),u?K.empty:t),u==0&&Jm(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:l,$to:u}=i[o],f=e.mapping.slice(r),d=f.map(l.pos),g=f.map(u.pos);o?e.deleteRange(d,g):(e.replaceRangeWith(d,g,t),Jm(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new me(e):Si(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 l=t<0?Si(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Si(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(l)return l}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new tn(e.node(0))}static atStart(e){return Si(e,e,0,0,1)||new tn(e)}static atEnd(e){return Si(e,e,e.content.size,e.childCount,-1)||new tn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=mc[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 mc)throw new RangeError("Duplicate use of selection JSON ID "+e);return mc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return me.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class EC{constructor(e,t){this.$from=e,this.$to=t}}let Gm=!1;function jm(n){!Gm&&!n.parent.inlineContent&&(Gm=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class me extends pe{constructor(e,t=e){jm(e),jm(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 pe.near(r);let i=e.resolve(t.map(this.anchor));return new me(i.parent.inlineContent?i:r,r)}replace(e,t=K.empty){if(super.replace(e,t),t==K.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof me&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new tl(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 me(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=pe.findFrom(t,r,!0)||pe.findFrom(t,-r,!0);if(o)t=o.$head;else return pe.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(pe.findFrom(e,-r,!0)||pe.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new me(e,t)}}pe.jsonID("text",me);class tl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new tl(e.map(this.anchor),e.map(this.head))}resolve(e){return me.between(e.resolve(this.anchor),e.resolve(this.head))}}class ee extends pe{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?pe.near(o):new ee(o)}content(){return new K(B.from(this.node),0,0)}eq(e){return e instanceof ee&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Mf(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ee(e.resolve(t.anchor))}static create(e,t){return new ee(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ee.prototype.visible=!1,pe.jsonID("node",ee);class Mf{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new tl(r,r):new Mf(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&ee.isSelectable(r)?new ee(t):pe.near(t)}}class tn extends pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=K.empty){if(t==K.empty){e.delete(0,e.doc.content.size);let r=pe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new tn(e)}map(e){return new tn(e)}eq(e){return e instanceof tn}getBookmark(){return kC}}pe.jsonID("all",tn);const kC={map(){return this},resolve(n){return new tn(n)}};function Si(n,e,t,r,i,o=!1){if(e.inlineContent)return me.create(n,t);for(let l=r-(i>0?0:1);i>0?l<e.childCount:l>=0;l+=i){let u=e.child(l);if(u.isAtom){if(!o&&ee.isSelectable(u))return ee.create(n,t-(i<0?u.nodeSize:0))}else{let f=Si(n,u,t+i,i<0?u.childCount:0,i,o);if(f)return f}t+=u.nodeSize*i}return null}function Jm(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof nt||i instanceof We))return;let o=n.mapping.maps[r],l;o.forEach((u,f,d,g)=>{l==null&&(l=g)}),n.setSelection(pe.near(n.doc.resolve(l),t))}function Ym(n,e){return!e||!n?n:n.bind(e)}class ma{constructor(e,t,r){this.name=e,this.init=Ym(t.init,r),this.apply=Ym(t.apply,r)}}new ma("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new ma("selection",{init(n,e){return n.selection||pe.atStart(e.doc)},apply(n){return n.selection}}),new ma("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new ma("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Xm(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Xm(i,e,{})),t[r]=i}return t}class Ct{constructor(e){this.spec=e,this.props={},e.props&&Xm(e.props,this,this.props),this.key=e.key?e.key.key:Zm("plugin")}getState(e){return e[this.key]}}const gc=Object.create(null);function Zm(n){return n in gc?n+"$"+ ++gc[n]:(gc[n]=0,n+"$")}class Zt{constructor(e="key"){this.key=Zm(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Es=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Qm=function(n,e,t,r){return t&&(eg(n,e,t,r,-1)||eg(n,e,t,r,1))},CC=/^(img|br|input|textarea|hr)$/i;function eg(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:ga(n))){let o=n.parentNode;if(!o||o.nodeType!=1||OC(n)||CC.test(n.nodeName)||n.contentEditable=="false")return!1;e=Es(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?ga(n):0}else return!1}}function ga(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function AC(n,e,t){for(let r=e==0,i=e==ga(n);r||i;){if(n==t)return!0;let o=Es(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==ga(n)}}function OC(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 tg=function(n){return n.focusNode&&Qm(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function ng(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const Qn=typeof navigator<"u"?navigator:null,rg=typeof document<"u"?document:null,er=Qn&&Qn.userAgent||"",yc=/Edge\/(\d+)/.exec(er),ig=/MSIE \d/.exec(er),bc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(er),ks=!!(ig||bc||yc),sg=ig?document.documentMode:bc?+bc[1]:yc?+yc[1]:0,ya=!ks&&/gecko\/(\d+)/i.test(er);ya&&+(/Firefox\/(\d+)/.exec(er)||[0,0])[1];const _c=!ks&&/Chrome\/(\d+)/.exec(er),xi=!!_c,TC=_c?+_c[1]:0,Mr=!ks&&!!Qn&&/Apple Computer/.test(Qn.vendor),vc=Mr&&(/Mobile\/\w+/.test(er)||!!Qn&&Qn.maxTouchPoints>2),Ht=vc||(Qn?/Mac/.test(Qn.platform):!1),Cs=/Android \d/.test(er),wc=!!rg&&"webkitFontSmoothing"in rg.documentElement.style,MC=wc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function IC(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,l=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(l<0)return null;let u=r.resolve(l),f,d;if(tg(t)){for(f=u;i&&!i.node;)i=i.parent;let g=i.node;if(i&&g.isAtom&&ee.isSelectable(g)&&i.parent&&!(g.isInline&&AC(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;d=new ee(l==p?u:r.resolve(p))}}else{let g=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(g<0)return null;f=r.resolve(g)}if(!d){let g=e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1;d=fg(n,f,u,g)}return d}function og(n){return n.editable?n.hasFocus():PC(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Sc(n,e=!1){let t=n.state.selection;if(LC(n,t),!!og(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&xi){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Qm(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)RC(n);else{let{anchor:r,head:i}=t,o,l;ag&&!(t instanceof me)&&(t.$from.parent.inlineContent||(o=lg(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(l=lg(n,t.to))),n.docView.setSelection(r,i,n.root,e),ag&&(o&&ug(o),l&&ug(l)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&NC(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const ag=Mr||xi&&TC<63;function lg(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(Mr&&i&&i.contentEditable=="false")return xc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return xc(i);if(o)return xc(o)}}function xc(n){return n.contentEditable="true",Mr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function ug(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function NC(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(()=>{(!og(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function RC(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,Es(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&ks&&sg<=11&&(r.disabled=!0,r.disabled=!1)}function LC(n,e){if(e instanceof ee){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(cg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else cg(n)}function cg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function fg(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||me.between(e,t,r)}function PC(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 Ec(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&&pe.findFrom(o,e)}function Ir(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function hg(n,e,t){let r=n.state.selection;if(r instanceof me){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=Ec(n.state,e);return i&&i instanceof ee?Ir(n,i):!1}else if(!(Ht&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,l;if(!o||o.isText)return!1;let u=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(l=n.docView.descAt(u))&&!l.contentDOM?ee.isSelectable(o)?Ir(n,new ee(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):wc?Ir(n,new me(n.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof ee&&r.node.isInline)return Ir(n,new me(e>0?r.$to:r.$from));{let i=Ec(n.state,e);return i?Ir(n,i):!1}}}function ba(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function As(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function kc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,l=!1;for(ya&&t.nodeType==1&&r<ba(t)&&As(t.childNodes[r])&&(l=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(As(u))i=t,o=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(dg(t))break;{let u=t.previousSibling;for(;u&&As(u);)i=t.parentNode,o=Es(u),u=u.previousSibling;if(u)t=u,r=ba(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}l?Ac(n,t,r):i&&Ac(n,i,o)}function Cc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=ba(t),o,l;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(As(u))o=t,l=++r;else break}else{if(dg(t))break;{let u=t.nextSibling;for(;u&&As(u);)o=u.parentNode,l=Es(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=ba(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&Ac(n,o,l)}function dg(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Ac(n,e,t){let r=n.domSelection();if(tg(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&&Sc(n)},50)}function pg(n,e,t){let r=n.state.selection;if(r instanceof me&&!r.empty||t.indexOf("s")>-1||Ht&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let l=Ec(n.state,e);if(l&&l instanceof ee)return Ir(n,l)}if(!i.parent.inlineContent){let l=e<0?i:o,u=r instanceof tn?pe.near(l,e):pe.findFrom(l,e);return u?Ir(n,u):!1}return!1}function mg(n,e){if(!(n.state.selection instanceof me))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 l=n.state.tr;return e<0?l.delete(t.pos-o.nodeSize,t.pos):l.delete(t.pos,t.pos+o.nodeSize),n.dispatch(l),!0}return!1}function gg(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function DC(n){if(!Mr||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;gg(n,r,"true"),setTimeout(()=>gg(n,r,"false"),20)}return!1}function FC(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function BC(n,e){let t=e.keyCode,r=FC(e);return t==8||Ht&&t==72&&r=="c"?mg(n,-1)||kc(n):t==46||Ht&&t==68&&r=="c"?mg(n,1)||Cc(n):t==13||t==27?!0:t==37||Ht&&t==66&&r=="c"?hg(n,-1,r)||kc(n):t==39||Ht&&t==70&&r=="c"?hg(n,1,r)||Cc(n):t==38||Ht&&t==80&&r=="c"?pg(n,-1,r)||kc(n):t==40||Ht&&t==78&&r=="c"?DC(n)||pg(n,1,r)||Cc(n):r==(Ht?"m":"c")&&(t==66||t==73||t==89||t==90)}function yg(n,e){n.someProp("transformCopied",S=>{e=S(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 S=r.firstChild;t.push(S.type.name,S.attrs!=S.type.defaultAttrs?S.attrs:null),r=S.content}let l=n.someProp("clipboardSerializer")||Ur.fromSchema(n.state.schema),u=kg(),f=u.createElement("div");f.appendChild(l.serializeFragment(r,{document:u}));let d=f.firstChild,g,p=0;for(;d&&d.nodeType==1&&(g=xg[d.nodeName.toLowerCase()]);){for(let S=g.length-1;S>=0;S--){let k=u.createElement(g[S]);for(;f.firstChild;)k.appendChild(f.firstChild);f.appendChild(k),p++}d=f.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${p?` -${p}`:""} ${JSON.stringify(t)}`);let _=n.someProp("clipboardTextSerializer",S=>S(e,n))||e.content.textBetween(0,e.content.size,`
|
|
24
|
+
`,...lC(i)),console.warn(...o)}Qo(),mc=!1}function aC(){let n=$r[$r.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 lC(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
|
|
25
|
+
`],...uC(t))}),e}function uC({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Vm(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...cC(n.props),o]:[i+o]}function cC(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...wm(r,n[r]))}),t.length>3&&e.push(" ..."),e}function wm(n,e,t){return un(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:tt(e)?(e=wm(n,fe(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Pe(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=fe(e),t?e:[`${n}=`,e])}const Sm={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",15:"component update",16:"app unmount cleanup function"};function la(n,e,t,r){try{return r?n(...r):n()}catch(i){gc(i,e,t)}}function xm(n,e,t,r){if(Pe(n)){const i=la(n,e,t,r);return i&&y5(i)&&i.catch(o=>{gc(o,e,t)}),i}if(Ae(n)){const i=[];for(let o=0;o<n.length;o++)i.push(xm(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&Te(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function gc(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||Gt;if(e){let u=e.parent;const f=e.proxy,h=process.env.NODE_ENV!=="production"?Sm[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;u;){const m=u.ec;if(m){for(let p=0;p<m.length;p++)if(m[p](n,f,h)===!1)return}u=u.parent}if(o){Zo(),la(o,null,10,[n,f,h]),Qo();return}}fC(n,t,i,r,a)}function fC(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=Sm[e];if(t&&sC(t),Te(`Unhandled error${o?` during execution of ${o}`:""}`),t&&oC(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Jt=[];let Vn=-1;const Ci=[];let hr=null,Ei=0;const Cm=Promise.resolve();let ua=null;const hC=100;function dC(n){const e=ua||Cm;return n?e.then(this?n.bind(this):n):e}function pC(n){let e=Vn+1,t=Jt.length;for(;e<t;){const r=e+t>>>1,i=Jt[r],o=ks(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function yc(n){if(!(n.flags&1)){const e=ks(n),t=Jt[Jt.length-1];!t||!(n.flags&2)&&e>=ks(t)?Jt.push(n):Jt.splice(pC(e),0,n),n.flags|=1,Em()}}function Em(){ua||(ua=Cm.then(Am))}function km(n){Ae(n)?Ci.push(...n):hr&&n.id===-1?hr.splice(Ei+1,0,n):n.flags&1||(Ci.push(n),n.flags|=1),Em()}function mC(n){if(Ci.length){const e=[...new Set(Ci)].sort((t,r)=>ks(t)-ks(r));if(Ci.length=0,hr){hr.push(...e);return}for(hr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),Ei=0;Ei<hr.length;Ei++){const t=hr[Ei];process.env.NODE_ENV!=="production"&&Mm(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}hr=null,Ei=0}}const ks=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Am(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>Mm(n,t):Fr;try{for(Vn=0;Vn<Jt.length;Vn++){const t=Jt[Vn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),la(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Vn<Jt.length;Vn++){const t=Jt[Vn];t&&(t.flags&=-2)}Vn=-1,Jt.length=0,mC(n),ua=null,(Jt.length||Ci.length)&&Am(n)}}function Mm(n,e){const t=n.get(e)||0;if(t>hC){const r=e.i,i=r&&Wm(r.type);return gc(`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}return n.set(e,t+1),!1}const bc=new Map;process.env.NODE_ENV!=="production"&&(Xo().__VUE_HMR_RUNTIME__={createRecord:_c(gC),rerender:_c(yC),reload:_c(bC)});const ca=new Map;function gC(n,e){return ca.has(n)?!1:(ca.set(n,{initialDef:fa(e),instances:new Set}),!0)}function fa(n){return Um(n)?n.__vccOpts:n}function yC(n,e){const t=ca.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,fa(r.type).render=e),r.renderCache=[],r.update()}))}function bC(n,e){const t=ca.get(n);if(!t)return;e=fa(e),Tm(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],a=fa(o.type);let u=bc.get(a);u||(a!==t.initialDef&&Tm(a,e),bc.set(a,u=new Set)),u.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(u.add(o),o.ceReload(e.styles),u.delete(o)):o.parent?yc(()=>{o.parent.update(),u.delete(o)}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(a)}km(()=>{bc.clear()})}function Tm(n,e){Nt(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function _c(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 ki,ha=[];function Om(n,e){var t,r;ki=n,ki?(ki.enabled=!0,ha.forEach(({event:i,args:o})=>ki.emit(i,...o)),ha=[]):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=>{Om(o,e)}),setTimeout(()=>{ki||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ha=[])},3e3)):ha=[]}let vn=null,_C=null;const vC=n=>n.__isTeleport;function Im(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Im(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Xo().requestIdleCallback,Xo().cancelIdleCallback;const wC=Symbol.for("v-ndc"),vc=n=>n?XC(n)?ZC(n):vc(n.parent):null,As=Nt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>process.env.NODE_ENV!=="production"?ra(n.props):n.props,$attrs:n=>process.env.NODE_ENV!=="production"?ra(n.attrs):n.attrs,$slots:n=>process.env.NODE_ENV!=="production"?ra(n.slots):n.slots,$refs:n=>process.env.NODE_ENV!=="production"?ra(n.refs):n.refs,$parent:n=>vc(n.parent),$root:n=>vc(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>__VUE_OPTIONS_API__?EC(n):n.type,$forceUpdate:n=>n.f||(n.f=()=>{yc(n.update)}),$nextTick:n=>n.n||(n.n=dC.bind(n.proxy)),$watch:n=>__VUE_OPTIONS_API__?DC.bind(n):Fr}),SC=n=>n==="_"||n==="$",wc=(n,e)=>n!==Gt&&!n.__isScriptSetup&&Le(n,e),xC={get({_:n},e){if(e==="__v_skip")return!0;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 h;if(e[0]!=="$"){const S=a[e];if(S!==void 0)switch(S){case 1:return r[e];case 2:return i[e];case 4:return t[e];case 3:return o[e]}else{if(wc(r,e))return a[e]=1,r[e];if(i!==Gt&&Le(i,e))return a[e]=2,i[e];if((h=n.propsOptions[0])&&Le(h,e))return a[e]=3,o[e];if(t!==Gt&&Le(t,e))return a[e]=4,t[e];(!__VUE_OPTIONS_API__||CC)&&(a[e]=0)}}const m=As[e];let p,b;if(m)return e==="$attrs"?(Ge(n.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&e==="$slots"&&Ge(n,"get",e),m(n);if((p=u.__cssModules)&&(p=p[e]))return p;if(t!==Gt&&Le(t,e))return a[e]=4,t[e];if(b=f.config.globalProperties,Le(b,e))return b[e];process.env.NODE_ENV!=="production"&&vn&&(!un(e)||e.indexOf("__v")!==0)&&(i!==Gt&&SC(e[0])&&Le(i,e)?Te(`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===vn&&Te(`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 wc(i,e)?(i[e]=t,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&Le(i,e)?(Te(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==Gt&&Le(r,e)?(r[e]=t,!0):Le(n.props,e)?(process.env.NODE_ENV!=="production"&&Te(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in n?(process.env.NODE_ENV!=="production"&&Te(`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!==Gt&&Le(n,a)||wc(e,a)||(u=o[0])&&Le(u,a)||Le(r,a)||Le(As,a)||Le(i.config.globalProperties,a)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Le(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};process.env.NODE_ENV!=="production"&&(xC.ownKeys=n=>(Te("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 Nm(n){return Ae(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let CC=!0;function EC(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(h=>da(f,h,a,!0)),da(f,e,a)),dt(e)&&o.set(e,f),f}function da(n,e,t,r=!1){const{mixins:i,extends:o}=e;o&&da(n,o,t,!0),i&&i.forEach(a=>da(n,a,t,!0));for(const a in e)if(r&&a==="expose")process.env.NODE_ENV!=="production"&&Te('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=kC[a]||t&&t[a];n[a]=u?u(n[a],e[a]):e[a]}return n}const kC={data:Rm,props:Pm,emits:Pm,methods:Ms,computed:Ms,beforeCreate:mt,created:mt,beforeMount:mt,mounted:mt,beforeUpdate:mt,updated:mt,beforeDestroy:mt,beforeUnmount:mt,destroyed:mt,unmounted:mt,activated:mt,deactivated:mt,errorCaptured:mt,serverPrefetch:mt,components:Ms,directives:Ms,watch:MC,provide:Rm,inject:AC};function Rm(n,e){return e?n?function(){return Nt(Pe(n)?n.call(this,this):n,Pe(e)?e.call(this,this):e)}:e:n}function AC(n,e){return Ms(Lm(n),Lm(e))}function Lm(n){if(Ae(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function mt(n,e){return n?[...new Set([].concat(n,e))]:e}function Ms(n,e){return n?Nt(Object.create(null),n,e):e}function Pm(n,e){return n?Ae(n)&&Ae(e)?[...new Set([...n,...e])]:Nt(Object.create(null),Nm(n),Nm(e??{})):e}function MC(n,e){if(!n)return e;if(!e)return n;const t=Nt(Object.create(null),n);for(const r in e)t[r]=mt(n[r],e[r]);return t}let TC=null;function OC(n,e,t=!1){const r=Ts||vn;if(r||TC){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Pe(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&Te(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&Te("inject() can only be used inside setup() or functional components.")}const IC={},Dm=n=>Object.getPrototypeOf(n)===IC,NC=BC,RC=Symbol.for("v-scx"),LC=()=>{{const n=OC(RC);return n||process.env.NODE_ENV!=="production"&&Te("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function PC(n,e,t){return process.env.NODE_ENV!=="production"&&!Pe(e)&&Te("`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."),Fm(n,e,t)}function Fm(n,e,t=Gt){const{immediate:r,deep:i,flush:o,once:a}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&Te('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&Te('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&Te('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=Nt({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=Te);const f=e&&r||!e&&o!=="post";let h;if(ga){if(o==="sync"){const S=LC();h=S.__watcherHandles||(S.__watcherHandles=[])}else if(!f){const S=()=>{};return S.stop=Fr,S.resume=Fr,S.pause=Fr,S}}const m=Ts;u.call=(S,C,g)=>xm(S,m,C,g);let p=!1;o==="post"?u.scheduler=S=>{NC(S,m&&m.suspense)}:o!=="sync"&&(p=!0,u.scheduler=(S,C)=>{C?S():yc(S)}),u.augmentJob=S=>{e&&(S.flags|=4),p&&(S.flags|=2,m&&(S.id=m.uid,S.i=m))};const b=iC(n,e,u);return ga&&(h?h.push(b):f&&b()),b}function DC(n,e,t){const r=this.proxy,i=un(n)?n.includes(".")?FC(r,n):()=>r[n]:n.bind(r,r);let o;Pe(e)?o=e:(o=e.handler,t=e);const a=YC(this),u=Fm(i,o.bind(r),t);return a(),u}function FC(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 sN(){}const zC=n=>n.__isSuspense;function BC(n,e){e&&e.pendingBranch?Ae(n)?e.effects.push(...n):e.effects.push(n):km(n)}const zm=Symbol.for("v-fgt"),$C=Symbol.for("v-txt"),HC=Symbol.for("v-cmt");let Ai=null;function WC(n){return n?n.__v_isVNode===!0:!1}const VC=(...n)=>$m(...n),Bm=({key:n})=>n??null,pa=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?un(n)||tt(n)||Pe(n)?{i:vn,r:n,k:e,f:!!t}:n:null);function UC(n,e=null,t=null,r=0,i=null,o=n===zm?0:1,a=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Bm(e),ref:e&&pa(e),scopeId:_C,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:vn};return u?(Sc(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=un(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&Te("VNode created with invalid key (NaN). VNode type:",f.type),!a&&Ai&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&Ai.push(f),f}const qC=process.env.NODE_ENV!=="production"?VC:$m;function $m(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===wC)&&(process.env.NODE_ENV!=="production"&&!n&&Te(`Invalid vnode type when creating vnode: ${n}.`),n=HC),WC(n)){const u=ma(n,e,!0);return t&&Sc(u,t),!o&&Ai&&(u.shapeFlag&6?Ai[Ai.indexOf(n)]=u:Ai.push(u)),u.patchFlag=-2,u}if(Um(n)&&(n=n.__vccOpts),e){e=KC(e);let{class:u,style:f}=e;u&&!un(u)&&(e.class=Qu(u)),dt(f)&&(ia(f)&&!Ae(f)&&(f=Nt({},f)),e.style=Zu(f))}const a=un(n)?1:zC(n)?128:vC(n)?64:dt(n)?4:Pe(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&ia(n)&&(n=fe(n),Te("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`.",`
|
|
26
|
+
Component that was made reactive: `,n)),UC(n,e,t,r,i,a,o,!0)}function KC(n){return n?ia(n)||Dm(n)?Nt({},n):n:null}function ma(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:a,children:u,transition:f}=n,h=e?JC(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&Bm(h),ref:e&&e.ref?t&&o?Ae(o)?o.concat(pa(e)):[o,pa(e)]:pa(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&Ae(u)?u.map(Hm):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==zm?a===-1?16:a|16:a,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:f,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&ma(n.ssContent),ssFallback:n.ssFallback&&ma(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&Im(m,f.clone(m)),m}function Hm(n){const e=ma(n);return Ae(n.children)&&(e.children=n.children.map(Hm)),e}function GC(n=" ",e=0){return qC($C,null,n,e)}function Sc(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Ae(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Sc(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!Dm(e)?e._ctx=vn:i===3&&vn&&(vn.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Pe(e)?(e={default:e,_ctx:vn},t=32):(e=String(e),r&64?(t=16,e=[GC(e)]):t=8);n.children=e,n.shapeFlag|=t}function JC(...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=Qu([e.class,r.class]));else if(i==="style")e.style=Zu([e.style,r.style]);else if(p5(i)){const o=e[i],a=r[i];a&&o!==a&&!(Ae(o)&&o.includes(a))&&(e[i]=o?[].concat(o,a):a)}else i!==""&&(e[i]=r[i])}return e}let Ts=null;const jC=()=>Ts||vn;let xc;{const n=Xo(),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)}};xc=e("__VUE_INSTANCE_SETTERS__",t=>Ts=t),e("__VUE_SSR_SETTERS__",t=>ga=t)}const YC=n=>{const e=Ts;return xc(n),n.scope.on(),()=>{n.scope.off(),xc(e)}};function XC(n){return n.vnode.shapeFlag&4}let ga=!1;process.env.NODE_ENV;function ZC(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(X5(G5(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in As)return As[t](n)},has(e,t){return t in e||t in As}})):n.proxy}const QC=/(?:^|[-_])(\w)/g,eE=n=>n.replace(QC,e=>e.toUpperCase()).replace(/[-_]/g,"");function Wm(n,e=!0){return Pe(n)?n.displayName||n.name:n.name||e&&n.__name}function Vm(n,e,t=!1){let r=Wm(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?eE(r):t?"App":"Anonymous"}function Um(n){return Pe(n)&&"__vccOpts"in n}const me=(n,e)=>{const t=nC(n,e,ga);if(process.env.NODE_ENV!=="production"){const r=jC();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function tE(){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={__vue_custom_formatter:!0,header(p){return dt(p)?p.__isVue?["div",n,"VueInstance"]:tt(p)?["div",{},["span",n,m(p)],"<",u("_value"in p?p._value:p),">"]:Si(p)?["div",{},["span",n,St(p)?"ShallowReactive":"Reactive"],"<",u(p),`>${Wn(p)?" (readonly)":""}`]:Wn(p)?["div",{},["span",n,St(p)?"ShallowReadonly":"Readonly"],"<",u(p),">"]:null:null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...o(p.$)]}};function o(p){const b=[];p.type.props&&p.props&&b.push(a("props",fe(p.props))),p.setupState!==Gt&&b.push(a("setup",p.setupState)),p.data!==Gt&&b.push(a("data",fe(p.data)));const S=f(p,"computed");S&&b.push(a("computed",S));const C=f(p,"inject");return C&&b.push(a("injected",C)),b.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),b}function a(p,b){return b=Nt({},b),Object.keys(b).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(b).map(S=>["div",{},["span",r,S+": "],u(b[S],!1)])]]:["span",{}]}function u(p,b=!0){return typeof p=="number"?["span",e,p]:typeof p=="string"?["span",t,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:dt(p)?["object",{object:b?fe(p):p}]:["span",t,String(p)]}function f(p,b){const S=p.type;if(Pe(S))return;const C={};for(const g in p.ctx)h(S,g,b)&&(C[g]=p.ctx[g]);return C}function h(p,b,S){const C=p[S];if(Ae(C)&&C.includes(b)||dt(C)&&b in C||p.extends&&h(p.extends,b,S)||p.mixins&&p.mixins.some(g=>h(g,b,S)))return!0}function m(p){return St(p)?"ShallowRef":p.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 nE(){tE()}process.env.NODE_ENV!=="production"&&nE();function nt(n){this.content=n}nt.prototype={constructor:nt,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 nt(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 nt(t)},addToStart:function(n,e){return new nt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new nt(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 nt(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=nt.from(n),n.size?new nt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=nt.from(n),n.size?new nt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=nt.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}},nt.from=function(n){if(n instanceof nt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new nt(e)};function qm(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=qm(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Km(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 h=0,m=Math.min(a.text.length,u.text.length);for(;h<m&&a.text[a.text.length-h-1]==u.text[u.text.length-h-1];)h++,t--,r--;return{a:t,b:r}}if(a.content.size||u.content.size){let h=Km(a.content,u.content,t-1,r-1);if(h)return h}t-=f,r-=f}}class z{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],h=u+f.nodeSize;if(h>e&&r(f,i+u,o||null,a)!==!1&&f.content.size){let m=u+1;f.nodesBetween(Math.max(0,e-m),Math.min(f.content.size,t-m),r,i+m)}u=h}}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 z(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 z(r,i)}cutByIndex(e,t){return e==t?z.empty:e==0&&t==this.content.length?this:new z(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 z(i,o)}addToStart(e){return new z([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new z(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 qm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Km(this,e,t,r)}findIndex(e,t=-1){if(e==0)return ya(0,e);if(e==this.size)return ya(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?ya(r+1,a):ya(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 z.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new z(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return z.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 z(t||e,r)}static from(e){if(!e)return z.empty;if(e instanceof z)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new z([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}z.empty=new z([],0);const Cc={index:0,offset:0};function ya(n,e){return Cc.index=n,Cc.offset=e,Cc}function ba(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(!ba(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ba(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Ee=class sh{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&&ba(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 sh.none;if(e instanceof sh)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Ee.none=[];class _a extends Error{}class K{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=Jm(this.content,e+this.openStart,t);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(e,t){return new K(Gm(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 K.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 K(z.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 K(e,r,i)}}K.empty=new K(z.empty,0,0);function Gm(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(Gm(o.content,e-i-1,t-i-1)))}function Jm(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=Jm(a.content,e-o-1,t);return u&&n.replaceChild(i,a.copy(u))}function rE(n,e,t){if(t.openStart>n.depth)throw new _a("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new _a("Inconsistent open depths");return jm(n,e,t,0)}function jm(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=jm(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 Wr(a,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:a,end:u}=iE(t,n);return Wr(o,Xm(n,a,u,e,r))}else return Wr(o,va(n,e,r))}function Ym(n,e){if(!e.type.compatibleContent(n.type))throw new _a("Cannot join "+e.type.name+" onto "+n.type.name)}function Ec(n,e,t){let r=n.node(t);return Ym(r,e.node(t)),r}function Hr(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 Os(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&&(Hr(n.nodeAfter,r),o++));for(let u=o;u<a;u++)Hr(i.child(u),r);e&&e.depth==t&&e.textOffset&&Hr(e.nodeBefore,r)}function Wr(n,e){return n.type.checkContent(e),n.copy(e)}function Xm(n,e,t,r,i){let o=n.depth>i&&Ec(n,e,i+1),a=r.depth>i&&Ec(t,r,i+1),u=[];return Os(null,n,i,u),o&&a&&e.index(i)==t.index(i)?(Ym(o,a),Hr(Wr(o,Xm(n,e,t,r,i+1)),u)):(o&&Hr(Wr(o,va(n,e,i+1)),u),Os(e,t,i,u),a&&Hr(Wr(a,va(t,r,i+1)),u)),Os(r,null,i,u),new z(u)}function va(n,e,t){let r=[];if(Os(null,n,t,r),n.depth>t){let i=Ec(n,e,t+1);Hr(Wr(i,va(n,e,t+1)),r)}return Os(e,null,t,r),new z(r)}function iE(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(z.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Ys{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 Ee.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 wa(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),h=o-f;if(r.push(a,u,i+f),!h||(a=a.child(u),a.isText))break;o=h-1,i+=f+1}return new Ys(t,r,o)}static resolveCached(e,t){for(let i=0;i<kc.length;i++){let o=kc[i];if(o.pos==t&&o.doc==e)return o}let r=kc[Ac]=Ys.resolve(e,t);return Ac=(Ac+1)%sE,r}}let kc=[],Ac=0,sE=12;class wa{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 oE=Object.create(null);let Vr=class oh{constructor(e,t,r,i=Ee.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||z.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&&ba(this.attrs,t||e.defaultAttrs||oE)&&Ee.sameSet(this.marks,r||Ee.none)}copy(e=null){return e==this.content?this:new oh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new oh(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 K.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),u=i.start(a),h=i.node(a).content.cut(i.pos-u,o.pos-u);return new K(h,i.depth-a,o.depth-a)}replace(e,t,r){return rE(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 Ys.resolveCached(this,e)}resolveNoCache(e){return Ys.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()+")"),Zm(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=z.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=Ee.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Ee.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=z.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Vr.prototype.text=void 0;class wl extends Vr{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):Zm(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 wl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new wl(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 Zm(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class ni{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new aE(e,t);if(r.next==null)return ni.empty;let i=Qm(r);r.next&&r.err("Unexpected trailing text");let o=pE(dE(i));return mE(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 z.from(u.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:m,next:p}=a.next[h];if(!(m.isText||m.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let b=o(p,u.concat(m));if(b)return b}}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(`
|
|
27
|
+
`)}}ni.empty=new ni(!0);class aE{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 Qm(n){let e=[];do e.push(lE(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function lE(n){let e=[];do e.push(uE(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function uE(n){let e=hE(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=cE(n,e);else break;return e}function eg(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function cE(n,e){let t=eg(n),r=t;return n.eat(",")&&(n.next!="}"?r=eg(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function fE(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 hE(n){if(n.eat("(")){let e=Qm(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=fE(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 dE(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,u,f){let h={term:f,to:u};return e[a].push(h),h}function i(a,u){a.forEach(f=>f.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((f,h)=>f.concat(o(h,u)),[]);if(a.type=="seq")for(let f=0;;f++){let h=o(a.exprs[f],u);if(f==a.exprs.length-1)return h;i(h,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 h=0;h<a.min;h++){let m=t();i(o(a.expr,f),m),f=m}if(a.max==-1)i(o(a.expr,f),f);else for(let h=a.min;h<a.max;h++){let m=t();r(f,m),i(o(a.expr,f),m),f=m}return[r(f)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function tg(n,e){return e-n}function ng(n,e){let t=[];return r(e),t.sort(tg);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 pE(n){let e=Object.create(null);return t(ng(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:u,to:f})=>{if(!u)return;let h;for(let m=0;m<i.length;m++)i[m][0]==u&&(h=i[m][1]);ng(n,f).forEach(m=>{h||i.push([u,h=[]]),h.indexOf(m)==-1&&h.push(m)})})});let o=e[r.join(",")]=new ni(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(tg);o.next.push({type:i[a][0],next:e[u.join(",")]||t(u)})}return o}}function mE(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:h}=i.next[u];a.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(h)==-1&&r.push(h)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function rg(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 ig(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 sg(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new gE(n[t]);return e}let og=class my{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=sg(r.attrs),this.defaultAttrs=rg(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==ni.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:ig(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Vr(this,this.computeAttrs(e),z.from(t),Ee.setFrom(r))}createChecked(e=null,t,r){return t=z.from(t),this.checkContent(t),new Vr(this,this.computeAttrs(e),t,Ee.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=z.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(z.empty,!0);return o?new Vr(this,e,t.append(o),Ee.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:Ee.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new my(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 gE{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Sl{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=sg(i.attrs),this.excluded=null;let o=rg(this.attrs);this.instance=o?new Ee(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ee(this,ig(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Sl(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 yE{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=nt.from(e.nodes),t.marks=nt.from(e.marks||{}),this.nodes=og.compile(this.spec.nodes,this),this.marks=Sl.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]=ni.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?ag(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==""?[]:ag(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 og){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 wl(r,r.defaultAttrs,e,Ee.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Vr.fromJSON(this,e)}markFromJSON(e){return Ee.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ag(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 Mc=class ah{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 fg(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new fg(this,t,!0);return r.addAll(e,t.from,t.to),K.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(vE(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=hg(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=hg(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ah(e,ah.schemaRules(e)))}};const lg={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},bE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ug={ol:!0,ul:!0},Sa=1,xa=2,Is=4;function cg(n,e,t){return e!=null?(e?Sa:0)|(e==="full"?xa:0):n&&n.whitespace=="pre"?Sa|xa:t&~Is}class Ca{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=Ee.none,this.stashMarks=[],this.match=a||(u&Is?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(z.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&Sa)){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=z.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(z.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):SE(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&&!lg.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class fg{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=cg(null,t.preserveWhitespace,0)|(r?Is:0);i?o=new Ca(i.type,i.attrs,Ee.none,Ee.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new Ca(null,null,Ee.none,Ee.none,!0,null,a):o=new Ca(e.schema.topNodeType,null,Ee.none,Ee.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(wE(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&xa||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&Sa)r.options&xa?t=t.replace(/\r\n?/g,`
|
|
28
|
+
`):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;ug.hasOwnProperty(r)&&this.parser.normalizeLists&&_E(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:bE.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(lg.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(`
|
|
29
|
+
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Ee.none,r=Ee.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=cg(e,i,o.options);o.options&Is&&o.content.length==0&&(a|=Is),this.nodes.push(new Ca(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 h=t[u];if(h==""){if(u==t.length-1||u==0)continue;for(;f>=o;f--)if(a(u-1,f))return!0;return!1}else{let m=f>0||f==0&&i?this.nodes[f].type:r&&f>=o?r.node(f-o).type:null;if(!m||m.name!=h&&m.groups.indexOf(h)==-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=xE(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 _E(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ug.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function vE(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function wE(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 hg(n){let e={};for(let t in n)e[t]=n[t];return e}function SE(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:h,next:m}=u.edge(f);if(h==e||o.indexOf(m)<0&&a(m))return!0}};if(a(i.contentMatch))return!0}}function xE(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class ii{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Tc(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 h=a.marks[f];if(!this.marks[h.type.name]){f++;continue}if(!h.eq(o[u][0])||h.type.spec.spanning===!1)break;u++,f++}for(;u<o.length;)i=o.pop()[1];for(;f<a.marks.length;){let h=a.marks[f++],m=this.serializeMark(h,a.isInline,t);m&&(o.push([h,i]),i.appendChild(m.dom),i=m.contentDOM||m.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=ii.renderSpec(Tc(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&&ii.renderSpec(Tc(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],h=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){h=2;for(let m in f)if(f[m]!=null){let p=m.indexOf(" ");p>0?u.setAttributeNS(m.slice(0,p),m.slice(p+1),f[m]):u.setAttribute(m,f[m])}}for(let m=h;m<t.length;m++){let p=t[m];if(p===0){if(m<t.length-1||m>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:b,contentDOM:S}=ii.renderSpec(e,p,r);if(u.appendChild(b),S){if(a)throw new RangeError("Multiple content holes");a=S}}}return{dom:u,contentDOM:a}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ii(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=dg(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return dg(e.marks)}}function dg(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Tc(n){return n.document||window.document}const pg=65535,mg=Math.pow(2,16);function CE(n,e){return n+e*mg}function gg(n){return n&pg}function EE(n){return(n-(n&pg))/mg}const yg=1,bg=2,Ea=4,_g=8;class Oc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&_g)>0}get deletedBefore(){return(this.delInfo&(yg|Ea))>0}get deletedAfter(){return(this.delInfo&(bg|Ea))>0}get deletedAcross(){return(this.delInfo&Ea)>0}}class Qt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Qt.empty)return Qt.empty}recover(e){let t=0,r=gg(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+EE(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 h=this.ranges[u+o],m=this.ranges[u+a],p=f+h;if(e<=p){let b=h?e==f?-1:e==p?1:t:t,S=f+i+(b<0?0:m);if(r)return S;let C=e==(t<0?f:p)?null:CE(u/3,e-f),g=e==f?bg:e==p?yg:Ea;return(t<0?e!=f:e!=p)&&(g|=_g),new Oc(S,g,C)}i+=m-h}return r?e+i:new Oc(e+i,0,null)}touches(e,t){let r=0,i=gg(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 h=this.ranges[u+o],m=f+h;if(e<=m&&u==i*3)return!0;r+=this.ranges[u+a]-h}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),h=this.ranges[i+t],m=this.ranges[i+r];e(u,u+h,f,f+m),o+=m-h}}invert(){return new Qt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Qt.empty:new Qt(e<0?[0,-e,0]:[0,0,e])}}Qt.empty=new Qt([]);class Ji{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 Ji(this.maps,this.mirror,e,t)}copy(){return new Ji(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 Ji;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 Oc(e,i,null)}}const Ic=Object.create(null);class lt{getMap(){return Qt.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 Fe{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Fe(e,null)}static fail(e){return new Fe(null,e)}static fromReplace(e,t,r,i){try{return Fe.ok(e.replace(t,r,i))}catch(o){if(o instanceof _a)return Fe.fail(o.message);throw o}}}function Nc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Nc(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return z.fromArray(r)}class kr extends lt{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 K(Nc(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 Fe.fromReplace(e,this.from,this.to,o)}invert(){return new An(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 kr(t.pos,r.pos,this.mark)}merge(e){return e instanceof kr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kr(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 kr(t.from,t.to,e.markFromJSON(t.mark))}}lt.jsonID("addMark",kr);class An extends lt{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 K(Nc(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Fe.fromReplace(e,this.from,this.to,r)}invert(){return new kr(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 An(t.pos,r.pos,this.mark)}merge(e){return e instanceof An&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new An(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 An(t.from,t.to,e.markFromJSON(t.mark))}}lt.jsonID("removeMark",An);class Ar extends lt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Fe.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new K(z.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 Ar(this.pos,t.marks[i]);return new Ar(this.pos,this.mark)}}return new ji(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ar(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 Ar(t.pos,e.markFromJSON(t.mark))}}lt.jsonID("addNodeMark",Ar);class ji extends lt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Fe.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new K(z.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ar(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ji(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 ji(t.pos,e.markFromJSON(t.mark))}}lt.jsonID("removeNodeMark",ji);class ut extends lt{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Rc(e,this.from,this.to)?Fe.fail("Structure replace would overwrite content"):Fe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Qt([this.from,this.to-this.from,this.slice.size])}invert(e){return new ut(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 ut(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof ut)||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?K.empty:new K(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ut(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?K.empty:new K(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ut(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 ut(t.from,t.to,K.fromJSON(e,t.slice),!!t.structure)}}lt.jsonID("replace",ut);class Xe extends lt{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&&(Rc(e,this.from,this.gapFrom)||Rc(e,this.gapTo,this.to)))return Fe.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Fe.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Fe.fromReplace(e,this.from,this.to,r):Fe.fail("Content does not fit in gap")}getMap(){return new Qt([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 Xe(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 Xe(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 Xe(t.from,t.to,t.gapFrom,t.gapTo,K.fromJSON(e,t.slice),t.insert,!!t.structure)}}lt.jsonID("replaceAround",Xe);function Rc(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 kE(n,e,t,r){let i=[],o=[],a,u;n.doc.nodesBetween(e,t,(f,h,m)=>{if(!f.isInline)return;let p=f.marks;if(!r.isInSet(p)&&m.type.allowsMarkType(r.type)){let b=Math.max(h,e),S=Math.min(h+f.nodeSize,t),C=r.addToSet(p);for(let g=0;g<p.length;g++)p[g].isInSet(C)||(a&&a.to==b&&a.mark.eq(p[g])?a.to=S:i.push(a=new An(b,S,p[g])));u&&u.to==b?u.to=S:o.push(u=new kr(b,S,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function AE(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 Sl){let h=a.marks,m;for(;m=r.isInSet(h);)(f||(f=[])).push(m),h=m.removeFromSet(h)}else r?r.isInSet(a.marks)&&(f=[r]):f=a.marks;if(f&&f.length){let h=Math.min(u+a.nodeSize,t);for(let m=0;m<f.length;m++){let p=f[m],b;for(let S=0;S<i.length;S++){let C=i[S];C.step==o-1&&p.eq(i[S].style)&&(b=C)}b?(b.to=h,b.step=o):i.push({style:p,from:Math.max(u,e),to:h,step:o})}}}),i.forEach(a=>n.step(new An(a.from,a.to,a.style)))}function ME(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),h=a+f.nodeSize,m=r.matchType(f.type);if(!m)o.push(new ut(a,h,K.empty));else{r=m;for(let p=0;p<f.marks.length;p++)t.allowsMarkType(f.marks[p].type)||n.step(new An(a,h,f.marks[p]))}a=h}if(!r.validEnd){let u=r.fillBefore(z.empty,!0);n.replace(a,a,new K(u,0,0))}for(let u=o.length-1;u>=0;u--)n.step(o[u])}function TE(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Mi(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||!TE(i,o,a))break}return null}function OE(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),u=i.after(o+1),f=a,h=u,m=z.empty,p=0;for(let C=o,g=!1;C>t;C--)g||r.index(C)>0?(g=!0,m=z.from(r.node(C).copy(m)),p++):f--;let b=z.empty,S=0;for(let C=o,g=!1;C>t;C--)g||i.after(C+1)<i.end(C)?(g=!0,b=z.from(i.node(C).copy(b)),S++):h++;n.step(new Xe(f,h,a,u,new K(m.append(b),p,S),m.size-p,!0))}function Lc(n,e,t=null,r=n){let i=IE(n,e),o=i&&NE(r,e);return o?i.map(vg).concat({type:e,attrs:t}).concat(o.map(vg)):null}function vg(n){return{type:n,attrs:null}}function IE(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 NE(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 h=r;f&&h<i;h++)f=f.matchType(t.child(h).type);return!f||!f.validEnd?null:a}function RE(n,e,t){let r=z.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=z.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new Xe(i,o,i,o,new K(r,0,0),t.length,!0))}function LE(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)&&PE(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),h=f.map(u,1),m=f.map(u+a.nodeSize,1);return n.step(new Xe(h,m,h+1,m-1,new K(z.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function PE(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function DE(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 Xe(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new K(z.from(a),0,0),1,!0))}function Ti(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 h=i.depth-1,m=t-2;h>o;h--,m--){let p=i.node(h),b=i.index(h);if(p.type.spec.isolating)return!1;let S=p.content.cutByIndex(b,p.childCount),C=r&&r[m]||p;if(C!=p&&(S=S.replaceChild(0,C.type.create(C.attrs))),!p.canReplace(b+1,p.childCount)||!C.type.validContent(S))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 FE(n,e,t=1,r){let i=n.doc.resolve(e),o=z.empty,a=z.empty;for(let u=i.depth,f=i.depth-t,h=t-1;u>f;u--,h--){o=z.from(i.node(u).copy(o));let m=r&&r[h];a=z.from(m?m.type.create(m.attrs,a):i.node(u).copy(a))}n.step(new ut(e,e,new K(o.append(a),t,t),!0))}function dr(n,e){let t=n.resolve(e),r=t.index();return wg(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function wg(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function ka(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&&wg(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 zE(n,e,t){let r=new ut(e-t,e+t,K.empty,!0);n.step(r)}function BE(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 $E(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),h=r.node(a),m=!1;if(o==1)m=h.canReplace(f,f,i);else{let p=h.contentMatchAt(f).findWrapping(i.firstChild.type);m=p&&h.canReplaceWith(f,f,p[0])}if(m)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function Pc(n,e,t=e,r=K.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return Sg(i,o,r)?new ut(e,t,r):new HE(i,o,r).fit()}function Sg(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class HE{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=z.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=z.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):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 K(o,a,u);return e>-1?new Xe(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new ut(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=Dc(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],h,m=null;if(e==1&&(o?f.matchType(o.type)||(m=f.fillBefore(z.from(o),!1)):i&&u.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:a,parent:i,inject:m};if(e==2&&o&&(h=f.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:a,parent:i,wrap:h};if(i&&f.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Dc(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new K(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=Dc(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new K(Ns(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new K(Ns(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 g=0;g<o.length;g++)this.openFrontierNode(o[g]);let a=this.unplaced,u=r?r.content:a.content,f=a.openStart-e,h=0,m=[],{match:p,type:b}=this.frontier[t];if(i){for(let g=0;g<i.childCount;g++)m.push(i.child(g));p=p.matchFragment(i)}let S=u.size+e-(a.content.size-a.openEnd);for(;h<u.childCount;){let g=u.child(h),_=p.matchType(g.type);if(!_)break;h++,(h>1||f==0||g.content.size)&&(p=_,m.push(xg(g.mark(b.allowedMarks(g.marks)),h==1?f:0,h==u.childCount?S:-1)))}let C=h==u.childCount;C||(S=-1),this.placed=Rs(this.placed,t,z.from(m)),this.frontier[t].match=p,C&&S<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,_=u;g<S;g++){let x=_.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),_=x.content}this.unplaced=C?e==0?K.empty:new K(Ns(a.content,e-1,1),e-1,S<0?a.openEnd:e-1):new K(Ns(a.content,e,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Fc(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=Fc(e,t,i,r,o);if(a){for(let u=t-1;u>=0;u--){let{match:f,type:h}=this.frontier[u],m=Fc(e,u,h,f,!0);if(!m||m.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=Rs(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=Rs(this.placed,this.depth,z.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(z.empty,!0);t.childCount&&(this.placed=Rs(this.placed,this.frontier.length,t))}}function Ns(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ns(n.firstChild.content,e-1,t)))}function Rs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Rs(n.lastChild.content,e-1,t)))}function Dc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function xg(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,xg(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(z.empty,!0)))),n.copy(r)}function Fc(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&&!WE(t,o.content,a)?u:null}function WE(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function VE(n){return n.spec.defining||n.spec.definingForContent}function UE(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(Sg(i,o,r))return n.step(new ut(e,t,r));let a=Eg(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let b=i.depth,S=i.pos-1;b>0;b--,S--){let C=i.node(b).type.spec;if(C.defining||C.definingAsContext||C.isolating)break;a.indexOf(b)>-1?u=b:i.before(b)==S&&a.splice(1,0,-b)}let f=a.indexOf(u),h=[],m=r.openStart;for(let b=r.content,S=0;;S++){let C=b.firstChild;if(h.push(C),S==r.openStart)break;b=C.content}for(let b=m-1;b>=0;b--){let S=h[b].type,C=VE(S);if(C&&i.node(f).type!=S)m=b;else if(C||!S.isTextblock)break}for(let b=r.openStart;b>=0;b--){let S=(b+m+1)%(r.openStart+1),C=h[S];if(C)for(let g=0;g<a.length;g++){let _=a[(g+f)%a.length],x=!0;_<0&&(x=!1,_=-_);let k=i.node(_-1),A=i.index(_-1);if(k.canReplaceWith(A,A,C.type,C.marks))return n.replace(i.before(_),x?o.after(_):t,new K(Cg(r.content,0,r.openStart,S),S,r.openEnd))}}let p=n.steps.length;for(let b=a.length-1;b>=0&&(n.replace(e,t,r),!(n.steps.length>p));b--){let S=a[b];S<0||(e=i.before(S),t=o.after(S))}}function Cg(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(Cg(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(z.empty,!0))}return n}function qE(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=BE(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new K(z.from(r),0,0))}function KE(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Eg(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 Eg(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 Yi extends lt{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 Fe.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 Fe.fromReplace(e,this.pos,this.pos+1,new K(z.from(i),0,t.isLeaf?0:1))}getMap(){return Qt.empty}invert(e){return new Yi(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 Yi(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 Yi(t.pos,t.attr,t.value)}}lt.jsonID("attr",Yi);let Oi=class extends Error{};Oi=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Oi.prototype=Object.create(Error.prototype),Oi.prototype.constructor=Oi,Oi.prototype.name="TransformError";class GE{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ji}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Oi(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=K.empty){let i=Pc(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new K(z.from(r),0,0))}delete(e,t){return this.replace(e,t,K.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return UE(this,e,t,r),this}replaceRangeWith(e,t,r){return qE(this,e,t,r),this}deleteRange(e,t){return KE(this,e,t),this}lift(e,t){return OE(this,e,t),this}join(e,t=1){return zE(this,e,t),this}wrap(e,t){return RE(this,e,t),this}setBlockType(e,t=e,r,i=null){return LE(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return DE(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Yi(e,t,r)),this}addNodeMark(e,t){return this.step(new Ar(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Ee)){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 ji(e,t)),this}split(e,t=1,r){return FE(this,e,t,r),this}addMark(e,t,r){return kE(this,e,t,r),this}removeMark(e,t,r){return AE(this,e,t,r),this}clearIncompatible(e,t,r){return ME(this,e,t,r),this}}const zc=Object.create(null);class ge{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new JE(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=K.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:h}=a[u],m=e.mapping.slice(o);e.replaceRange(m.map(f.pos),m.map(h.pos),u?K.empty:t),u==0&&Mg(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),h=f.map(a.pos),m=f.map(u.pos);o?e.deleteRange(h,m):(e.replaceRangeWith(h,m,t),Mg(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new ye(e):Ii(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?Ii(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Ii(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 mn(e.node(0))}static atStart(e){return Ii(e,e,0,0,1)||new mn(e)}static atEnd(e){return Ii(e,e,e.content.size,e.childCount,-1)||new mn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=zc[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 zc)throw new RangeError("Duplicate use of selection JSON ID "+e);return zc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ye.between(this.$anchor,this.$head).getBookmark()}}ge.prototype.visible=!0;class JE{constructor(e,t){this.$from=e,this.$to=t}}let kg=!1;function Ag(n){!kg&&!n.parent.inlineContent&&(kg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class ye extends ge{constructor(e,t=e){Ag(e),Ag(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 ge.near(r);let i=e.resolve(t.map(this.anchor));return new ye(i.parent.inlineContent?i:r,r)}replace(e,t=K.empty){if(super.replace(e,t),t==K.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ye&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new xl(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 ye(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=ge.findFrom(t,r,!0)||ge.findFrom(t,-r,!0);if(o)t=o.$head;else return ge.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ge.findFrom(e,-r,!0)||ge.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new ye(e,t)}}ge.jsonID("text",ye);class xl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new xl(e.map(this.anchor),e.map(this.head))}resolve(e){return ye.between(e.resolve(this.anchor),e.resolve(this.head))}}class ee extends ge{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?ge.near(o):new ee(o)}content(){return new K(z.from(this.node),0,0)}eq(e){return e instanceof ee&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new lh(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ee(e.resolve(t.anchor))}static create(e,t){return new ee(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ee.prototype.visible=!1,ge.jsonID("node",ee);class lh{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new xl(r,r):new lh(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&ee.isSelectable(r)?new ee(t):ge.near(t)}}class mn extends ge{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=K.empty){if(t==K.empty){e.delete(0,e.doc.content.size);let r=ge.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new mn(e)}map(e){return new mn(e)}eq(e){return e instanceof mn}getBookmark(){return jE}}ge.jsonID("all",mn);const jE={map(){return this},resolve(n){return new mn(n)}};function Ii(n,e,t,r,i,o=!1){if(e.inlineContent)return ye.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&&ee.isSelectable(u))return ee.create(n,t-(i<0?u.nodeSize:0))}else{let f=Ii(n,u,t+i,i<0?u.childCount:0,i,o);if(f)return f}t+=u.nodeSize*i}return null}function Mg(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof ut||i instanceof Xe))return;let o=n.mapping.maps[r],a;o.forEach((u,f,h,m)=>{a==null&&(a=m)}),n.setSelection(ge.near(n.doc.resolve(a),t))}function Tg(n,e){return!e||!n?n:n.bind(e)}class Aa{constructor(e,t,r){this.name=e,this.init=Tg(t.init,r),this.apply=Tg(t.apply,r)}}new Aa("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Aa("selection",{init(n,e){return n.selection||ge.atStart(e.doc)},apply(n){return n.selection}}),new Aa("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Aa("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Og(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Og(i,e,{})),t[r]=i}return t}class Rt{constructor(e){this.spec=e,this.props={},e.props&&Og(e.props,this,this.props),this.key=e.key?e.key.key:Ig("plugin")}getState(e){return e[this.key]}}const Bc=Object.create(null);function Ig(n){return n in Bc?n+"$"+ ++Bc[n]:(Bc[n]=0,n+"$")}class fn{constructor(e="key"){this.key=Ig(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ls=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))},YE=/^(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:Ma(n))){let o=n.parentNode;if(!o||o.nodeType!=1||ZE(n)||YE.test(n.nodeName)||n.contentEditable=="false")return!1;e=Ls(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?Ma(n):0}else return!1}}function Ma(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function XE(n,e,t){for(let r=e==0,i=e==Ma(n);r||i;){if(n==t)return!0;let o=Ls(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==Ma(n)}}function ZE(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 Lg=function(n){return n.focusNode&&Ng(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Pg(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const pr=typeof navigator<"u"?navigator:null,Dg=typeof document<"u"?document:null,mr=pr&&pr.userAgent||"",$c=/Edge\/(\d+)/.exec(mr),Fg=/MSIE \d/.exec(mr),Hc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mr),Ps=!!(Fg||Hc||$c),zg=Fg?document.documentMode:Hc?+Hc[1]:$c?+$c[1]:0,Ta=!Ps&&/gecko\/(\d+)/i.test(mr);Ta&&+(/Firefox\/(\d+)/.exec(mr)||[0,0])[1];const Wc=!Ps&&/Chrome\/(\d+)/.exec(mr),Ni=!!Wc,QE=Wc?+Wc[1]:0,Ur=!Ps&&!!pr&&/Apple Computer/.test(pr.vendor),Vc=Ur&&(/Mobile\/\w+/.test(mr)||!!pr&&pr.maxTouchPoints>2),jt=Vc||(pr?/Mac/.test(pr.platform):!1),Ds=/Android \d/.test(mr),Uc=!!Dg&&"webkitFontSmoothing"in Dg.documentElement.style,ek=Uc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tk(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,h;if(Lg(t)){for(f=u;i&&!i.node;)i=i.parent;let m=i.node;if(i&&m.isAtom&&ee.isSelectable(m)&&i.parent&&!(m.isInline&&XE(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;h=new ee(a==p?u:r.resolve(p))}}else{let m=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(m<0)return null;f=r.resolve(m)}if(!h){let m=e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1;h=Ug(n,f,u,m)}return h}function Bg(n){return n.editable?n.hasFocus():sk(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function qc(n,e=!1){let t=n.state.selection;if(ik(n,t),!!Bg(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Ni){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)rk(n);else{let{anchor:r,head:i}=t,o,a;$g&&!(t instanceof ye)&&(t.$from.parent.inlineContent||(o=Hg(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=Hg(n,t.to))),n.docView.setSelection(r,i,n.root,e),$g&&(o&&Wg(o),a&&Wg(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&nk(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const $g=Ur||Ni&&QE<63;function Hg(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(Ur&&i&&i.contentEditable=="false")return Kc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Kc(i);if(o)return Kc(o)}}function Kc(n){return n.contentEditable="true",Ur&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Wg(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function nk(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(()=>{(!Bg(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function rk(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,Ls(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Ps&&zg<=11&&(r.disabled=!0,r.disabled=!1)}function ik(n,e){if(e instanceof ee){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Vg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Vg(n)}function Vg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Ug(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||ye.between(e,t,r)}function sk(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 Gc(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&&ge.findFrom(o,e)}function qr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function qg(n,e,t){let r=n.state.selection;if(r instanceof ye){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=Gc(n.state,e);return i&&i instanceof ee?qr(n,i):!1}else if(!(jt&&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?ee.isSelectable(o)?qr(n,new ee(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):Uc?qr(n,new ye(n.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof ee&&r.node.isInline)return qr(n,new ye(e>0?r.$to:r.$from));{let i=Gc(n.state,e);return i?qr(n,i):!1}}}function Oa(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Fs(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function Jc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(Ta&&t.nodeType==1&&r<Oa(t)&&Fs(t.childNodes[r])&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(Fs(u))i=t,o=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(Kg(t))break;{let u=t.previousSibling;for(;u&&Fs(u);)i=t.parentNode,o=Ls(u),u=u.previousSibling;if(u)t=u,r=Oa(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?Yc(n,t,r):i&&Yc(n,i,o)}function jc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Oa(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(Fs(u))o=t,a=++r;else break}else{if(Kg(t))break;{let u=t.nextSibling;for(;u&&Fs(u);)o=u.parentNode,a=Ls(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=Oa(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&Yc(n,o,a)}function Kg(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Yc(n,e,t){let r=n.domSelection();if(Lg(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&&qc(n)},50)}function Gg(n,e,t){let r=n.state.selection;if(r instanceof ye&&!r.empty||t.indexOf("s")>-1||jt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=Gc(n.state,e);if(a&&a instanceof ee)return qr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,u=r instanceof mn?ge.near(a,e):ge.findFrom(a,e);return u?qr(n,u):!1}return!1}function Jg(n,e){if(!(n.state.selection instanceof ye))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 jg(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function ok(n){if(!Ur||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;jg(n,r,"true"),setTimeout(()=>jg(n,r,"false"),20)}return!1}function ak(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function lk(n,e){let t=e.keyCode,r=ak(e);return t==8||jt&&t==72&&r=="c"?Jg(n,-1)||Jc(n):t==46||jt&&t==68&&r=="c"?Jg(n,1)||jc(n):t==13||t==27?!0:t==37||jt&&t==66&&r=="c"?qg(n,-1,r)||Jc(n):t==39||jt&&t==70&&r=="c"?qg(n,1,r)||jc(n):t==38||jt&&t==80&&r=="c"?Gg(n,-1,r)||Jc(n):t==40||jt&&t==78&&r=="c"?ok(n)||Gg(n,1,r)||jc(n):r==(jt?"m":"c")&&(t==66||t==73||t==89||t==90)}function Yg(n,e){n.someProp("transformCopied",S=>{e=S(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 S=r.firstChild;t.push(S.type.name,S.attrs!=S.type.defaultAttrs?S.attrs:null),r=S.content}let a=n.someProp("clipboardSerializer")||ii.fromSchema(n.state.schema),u=i0(),f=u.createElement("div");f.appendChild(a.serializeFragment(r,{document:u}));let h=f.firstChild,m,p=0;for(;h&&h.nodeType==1&&(m=n0[h.nodeName.toLowerCase()]);){for(let S=m.length-1;S>=0;S--){let C=u.createElement(m[S]);for(;f.firstChild;)C.appendChild(f.firstChild);f.appendChild(C),p++}h=f.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${i} ${o}${p?` -${p}`:""} ${JSON.stringify(t)}`);let b=n.someProp("clipboardTextSerializer",S=>S(e,n))||e.content.textBetween(0,e.content.size,`
|
|
30
30
|
|
|
31
|
-
`);return{dom:f,text:
|
|
32
|
-
`))),0,0):K.empty;let p=n.someProp("clipboardTextParser",_=>_(e,i,r,n));if(p)u=p;else{let _=i.marks(),{schema:S}=n.state,k=Ur.fromSchema(S);l=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=l.appendChild(document.createElement("p"));m&&b.appendChild(k.serializeNode(S.text(m,_)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),l=zC(t),wc&&VC(l);let d=l&&l.querySelector("[data-pm-slice]"),g=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(g&&g[3])for(let p=+g[3];p>0;p--){let _=l.firstChild;for(;_&&_.nodeType!=1;)_=_.nextSibling;if(!_)break;l=_}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||sc.fromSchema(n.state.schema)).parseSlice(l,{preserveWhitespace:!!(f||g),context:i,ruleFromNode(_){return _.nodeName=="BR"&&!_.nextSibling&&_.parentNode&&!HC.test(_.parentNode.nodeName)?{ignore:!0}:null}})),g)u=WC(Sg(u,+g[1],+g[2]),g[4]);else if(u=K.maxOpen($C(u.content,i),!0),u.openStart||u.openEnd){let p=0,_=0;for(let S=u.content.firstChild;p<u.openStart&&!S.type.spec.isolating;p++,S=S.firstChild);for(let S=u.content.lastChild;_<u.openEnd&&!S.type.spec.isolating;_++,S=S.lastChild);u=Sg(u,p,_)}return n.someProp("transformPasted",p=>{u=p(u,n)}),u}const HC=/^(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 $C(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,l=[];if(n.forEach(u=>{if(!l)return;let f=i.findWrapping(u.type),d;if(!f)return l=null;if(d=l.length&&o.length&&vg(f,o,u,l[l.length-1],0))l[l.length-1]=d;else{l.length&&(l[l.length-1]=wg(l[l.length-1],o.length));let g=_g(u,f);l.push(g),i=i.matchType(g.type),o=f}}),l)return B.from(l)}return n}function _g(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,B.from(n));return n}function vg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=vg(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(B.from(_g(t,n,i+1))))}}function wg(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,wg(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(B.empty,!0);return n.copy(t.append(r))}function Oc(n,e,t,r,i,o){let l=e<0?n.firstChild:n.lastChild,u=l.content;return i<r-1&&(u=Oc(u,e,t,r,i+1,o)),i>=t&&(u=e<0?l.contentMatchAt(0).fillBefore(u,n.childCount>1||o<=i).append(u):u.append(l.contentMatchAt(l.childCount).fillBefore(B.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,l.copy(u))}function Sg(n,e,t){return e<n.openStart&&(n=new K(Oc(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new K(Oc(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const xg={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 Eg=null;function kg(){return Eg||(Eg=document.implementation.createHTMLDocument("title"))}function zC(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=kg().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&xg[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 VC(n){let e=n.querySelectorAll(xi?"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 WC(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:l}=n;for(let u=r.length-2;u>=0;u-=2){let f=t.nodes[r[u]];if(!f||f.hasRequiredAttrs())break;i=B.from(f.create(r[u+1],i)),o++,l++}return new K(i,o,l)}const Qt={},At={};function tr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}At.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Ag(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Cs&&xi&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),vc&&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,ng(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||BC(n,t)?t.preventDefault():tr(n,"key")},At.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},At.keypress=(n,e)=>{let t=e;if(Ag(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ht&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof me)||!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 _a(n){return{left:n.clientX,top:n.clientY}}function UC(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Tc(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let l=o.depth+1;l>0;l--)if(n.someProp(e,u=>l>o.depth?u(n,t,o.nodeAfter,o.before(l),i,!0):u(n,t,o.node(l),o.before(l),i,!1)))return!0;return!1}function Ei(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function qC(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&ee.isSelectable(r)?(Ei(n,new ee(t)),!0):!1}function KC(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof ee&&(r=t.node);let o=n.state.doc.resolve(e);for(let l=o.depth+1;l>0;l--){let u=l>o.depth?o.nodeAfter:o.node(l);if(ee.isSelectable(u)){r&&t.$from.depth>0&&l>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(l);break}}return i!=null?(Ei(n,ee.create(n.state.doc,i)),!0):!1}function GC(n,e,t,r,i){return Tc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?KC(n,t):qC(n,t))}function jC(n,e,t,r){return Tc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function JC(n,e,t,r){return Tc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||YC(n,t,r)}function YC(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ei(n,me.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(l.inlineContent)Ei(n,me.create(r,u+1,u+1+l.content.size));else if(ee.isSelectable(l))Ei(n,ee.create(r,u));else continue;return!0}}function Mc(n){return va(n)}const Cg=Ht?"metaKey":"ctrlKey";Qt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Mc(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&UC(t,n.input.lastClick)&&!t[Cg]&&(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 l=n.posAtCoords(_a(t));l&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new XC(n,l,t,!!r)):(o=="doubleClick"?jC:JC)(n,l.pos,l.inside,t)?t.preventDefault():tr(n,"pointer"))};class XC{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[Cg],this.allowDefault=r.shiftKey;let o,l;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),l=t.inside;else{let g=e.state.doc.resolve(t.pos);o=g.parent,l=g.depth?g.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 ee&&d.from<=l&&d.to>l)&&(this.mightDrag={node:o,pos:l,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ya&&!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)),tr(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(()=>Sc(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(_a(e))),this.updateAllowDefault(e),this.allowDefault||!t?tr(this.view,"pointer"):GC(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Mr&&this.mightDrag&&!this.mightDrag.node.isAtom||xi&&!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)?(Ei(this.view,pe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):tr(this.view,"pointer")}move(e){this.updateAllowDefault(e),tr(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)}}Qt.touchstart=n=>{n.input.lastTouch=Date.now(),Mc(n),tr(n,"pointer")},Qt.touchmove=n=>{n.input.lastTouch=Date.now(),tr(n,"pointer")},Qt.contextmenu=n=>Mc(n);function Ag(n,e){return n.composing?!0:Mr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const ZC=Cs?5e3:-1;At.compositionstart=At.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(),va(n,!0),n.markCursor=null;else if(va(n),ya&&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 l=o<0?i.lastChild:i.childNodes[o-1];if(!l)break;if(l.nodeType==3){n.domSelection().collapse(l,l.nodeValue.length);break}else i=l,o=-1}}n.input.composing=!0}Og(n,ZC)},At.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,Og(n,20))};function Og(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>va(n),e))}function QC(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=eA());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function eA(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function va(n,e=!1){if(!(Cs&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),QC(n),e||n.docView&&n.docView.dirty){let t=IC(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function tA(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 ki=ks&&sg<15||vc&&MC<604;Qt.copy=At.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=ki?null:t.clipboardData,l=r.content(),{dom:u,text:f}=yg(n,l);o?(t.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",f)):tA(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function nA(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function rA(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?Ic(n,r.value,null,e):Ic(n,r.textContent,r.innerHTML,e)},50)}function Ic(n,e,t,r){let i=bg(n,e,t,n.input.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",u=>u(n,r,i||K.empty)))return!0;if(!i)return!1;let o=nA(i),l=o?n.state.tr.replaceSelectionWith(o,n.input.shiftKey):n.state.tr.replaceSelection(i);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}At.paste=(n,e)=>{let t=e;if(n.composing&&!Cs)return;let r=ki?null:t.clipboardData;r&&Ic(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():rA(n,t)};class iA{constructor(e,t){this.slice=e,this.move=t}}const Tg=Ht?"altKey":"ctrlKey";Qt.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(_a(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ee?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(ee.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(ee.create(n.state.doc,d.posBefore)))}}let l=n.state.selection.content(),{dom:u,text:f}=yg(n,l);t.dataTransfer.clearData(),t.dataTransfer.setData(ki?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",ki||t.dataTransfer.setData("text/plain",f),n.dragging=new iA(l,!t[Tg])},Qt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},At.dragover=At.dragenter=(n,e)=>e.preventDefault(),At.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(_a(t));if(!i)return;let o=n.state.doc.resolve(i.pos),l=r&&r.slice;l?n.someProp("transformPasted",k=>{l=k(l,n)}):l=bg(n,t.dataTransfer.getData(ki?"Text":"text/plain"),ki?null:t.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!t[Tg]);if(n.someProp("handleDrop",k=>k(n,t,l||K.empty,u))){t.preventDefault();return}if(!l)return;t.preventDefault();let f=l?gC(n.state.doc,o.pos,l):o.pos;f==null&&(f=o.pos);let d=n.state.tr;u&&d.deleteSelection();let g=d.mapping.map(f),p=l.openStart==0&&l.openEnd==0&&l.content.childCount==1,_=d.doc;if(p?d.replaceRangeWith(g,g,l.content.firstChild):d.replaceRange(g,g,l),d.doc.eq(_))return;let S=d.doc.resolve(g);if(p&&ee.isSelectable(l.content.firstChild)&&S.nodeAfter&&S.nodeAfter.sameMarkup(l.content.firstChild))d.setSelection(new ee(S));else{let k=d.mapping.map(f);d.mapping.maps[d.mapping.maps.length-1].forEach((m,b,x,A)=>k=A),d.setSelection(fg(n,S,d.doc.resolve(k)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))},Qt.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())&&Sc(n)},20))},Qt.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)},Qt.beforeinput=(n,e)=>{if(xi&&Cs&&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,ng(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 At)Qt[n]=At[n];function Os(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 If{constructor(e,t){this.toDOM=e,this.spec=t||Nr,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:l}=e.mapResult(t.from+i,this.side<0?-1:1);return l?null:new bn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof If&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Os(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class cr{constructor(e,t){this.attrs=e,this.spec=t||Nr}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,l=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=l?null:new bn(o,l,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof cr&&Os(this.attrs,e.attrs)&&Os(this.spec,e.spec)}static is(e){return e.type instanceof cr}destroy(){}}class Nf{constructor(e,t){this.attrs=e,this.spec=t||Nr}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let l=e.mapResult(t.to+i,-1);return l.deleted||l.pos<=o.pos?null:new bn(o.pos-r,l.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 Nf&&Os(this.attrs,e.attrs)&&Os(this.spec,e.spec)}destroy(){}}class bn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new bn(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 bn(e,e,new If(t,r))}static inline(e,t,r,i){return new bn(e,t,new cr(r,i))}static node(e,t,r,i){return new bn(e,t,new Nf(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof cr}}const Ci=[],Nr={};class Ue{constructor(e,t){this.local=e.length?e:Ci,this.children=t.length?t:Ci}static create(e,t){return t.length?wa(t,e,0,Nr):ft}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 l=0;l<this.local.length;l++){let u=this.local[l];u.from<=t&&u.to>=e&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let l=0;l<this.children.length;l+=3)if(this.children[l]<t&&this.children[l+1]>e){let u=this.children[l]+1;this.children[l+2].findInner(e-u,t-u,r,i+u,o)}}map(e,t,r){return this==ft||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Nr)}mapInner(e,t,r,i,o){let l;for(let u=0;u<this.local.length;u++){let f=this.local[u].map(e,r,i);f&&f.type.valid(t,f)?(l||(l=[])).push(f):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?sA(this.children,l||[],e,t,r,i,o):l?new Ue(l.sort(Rr),Ci):ft}add(e,t){return t.length?this==ft?Ue.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,g;if(g=Ig(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,g,d+1):i.splice(o,0,f,f+u.nodeSize,wa(g,u,d+1,Nr)),o+=3}});let l=Mg(o?Ng(t):t,-r);for(let u=0;u<l.length;u++)l[u].type.valid(e,l[u])||l.splice(u--,1);return new Ue(l.length?this.local.concat(l).sort(Rr):this.local,i||this.children)}remove(e){return e.length==0||this==ft?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 l,u=r[o]+t,f=r[o+1]+t;for(let g=0,p;g<e.length;g++)(p=e[g])&&p.from>u&&p.to<f&&(e[g]=null,(l||(l=[])).push(p));if(!l)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(l,u+1);d!=ft?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,l;o<e.length;o++)if(l=e[o])for(let u=0;u<i.length;u++)i[u].eq(l,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 Ue(i,r):ft}forChild(e,t){if(this==ft)return this;if(t.isLeaf)return Ue.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,l=o+t.content.size;for(let u=0;u<this.local.length;u++){let f=this.local[u];if(f.from<l&&f.to>o&&f.type instanceof cr){let d=Math.max(o,f.from)-o,g=Math.min(l,f.to)-o;d<g&&(i||(i=[])).push(f.copy(d,g))}}if(i){let u=new Ue(i.sort(Rr),Ci);return r?new Wr([u,r]):u}return r||ft}eq(e){if(this==e)return!0;if(!(e instanceof Ue)||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 Nc(this.localsInner(e))}localsInner(e){if(this==ft)return Ci;if(e.inlineContent||!this.local.some(cr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof cr||t.push(this.local[r]);return t}}Ue.empty=new Ue([],[]),Ue.removeOverlap=Nc;const ft=Ue.empty;class Wr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Nr));return Wr.from(r)}forChild(e,t){if(t.isLeaf)return Ue.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ft&&(o instanceof Wr?r=r.concat(o.members):r.push(o))}return Wr.from(r)}eq(e){if(!(e instanceof Wr)||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 l=0;l<o.length;l++)t.push(o[l])}}return t?Nc(r?t:t.sort(Rr)):Ci}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new Wr(e.every(t=>t instanceof Ue)?e:e.reduce((t,r)=>t.concat(r instanceof Ue?r:r.members),[]))}}}function sA(n,e,t,r,i,o,l){let u=n.slice();for(let d=0,g=o;d<t.maps.length;d++){let p=0;t.maps[d].forEach((_,S,k,m)=>{let b=m-k-(S-_);for(let x=0;x<u.length;x+=3){let A=u[x+1];if(A<0||_>A+g-p)continue;let O=u[x]+g-p;S>=O?u[x+1]=_<=O?-2:-1:k>=i&&b&&(u[x]+=b,u[x+1]+=b)}p+=b}),g=t.maps[d].map(g,-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 g=t.map(n[d]+o),p=g-i;if(p<0||p>=r.content.size){f=!0;continue}let _=t.map(n[d+1]+o,-1),S=_-i,{index:k,offset:m}=r.content.findIndex(p),b=r.maybeChild(k);if(b&&m==p&&m+b.nodeSize==S){let x=u[d+2].mapInner(t,b,g+1,n[d]+o+1,l);x!=ft?(u[d]=p,u[d+1]=S,u[d+2]=x):(u[d+1]=-2,f=!0)}else f=!0}if(f){let d=oA(u,n,e,t,i,o,l),g=wa(d,r,0,l);e=g.local;for(let p=0;p<u.length;p+=3)u[p+1]<0&&(u.splice(p,3),p-=3);for(let p=0,_=0;p<g.children.length;p+=3){let S=g.children[p];for(;_<u.length&&u[_]<S;)_+=3;u.splice(_,0,g.children[p],g.children[p+1],g.children[p+2])}}return new Ue(e.sort(Rr),u)}function Mg(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 bn(i.from+e,i.to+e,i.type))}return t}function oA(n,e,t,r,i,o,l){function u(f,d){for(let g=0;g<f.local.length;g++){let p=f.local[g].map(r,i,d);p?t.push(p):l.onRemove&&l.onRemove(f.local[g].spec)}for(let g=0;g<f.children.length;g+=3)u(f.children[g+2],f.children[g]+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 Ig(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,l;o<n.length;o++)(l=n[o])&&l.from>t&&l.to<r&&((i||(i=[])).push(l),n[o]=null);return i}function Ng(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function wa(n,e,t,r){let i=[],o=!1;e.forEach((u,f)=>{let d=Ig(n,u,f+t);if(d){o=!0;let g=wa(d,u,t+f+1,r);g!=ft&&i.push(f,f+u.nodeSize,g)}});let l=Mg(o?Ng(n):n,-t).sort(Rr);for(let u=0;u<l.length;u++)l[u].type.valid(e,l[u])||(r.onRemove&&r.onRemove(l[u].spec),l.splice(u--,1));return l.length||i.length?new Ue(l,i):ft}function Rr(n,e){return n.from-e.from||n.to-e.to}function Nc(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),Rg(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),Rg(e,i,r.copy(o.from,r.to)));break}}}return e}function Rg(n,e,t){for(;e<n.length&&Rr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var nr={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:"'"},Sa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Lg=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),aA=typeof navigator<"u"&&/Mac/.test(navigator.platform),lA=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),uA=aA||Lg&&+Lg[1]<57,Xe=0;Xe<10;Xe++)nr[48+Xe]=nr[96+Xe]=String(Xe);for(var Xe=1;Xe<=24;Xe++)nr[Xe+111]="F"+Xe;for(var Xe=65;Xe<=90;Xe++)nr[Xe]=String.fromCharCode(Xe+32),Sa[Xe]=String.fromCharCode(Xe);for(var Rc in nr)Sa.hasOwnProperty(Rc)||(Sa[Rc]=nr[Rc]);function cA(n){var e=uA&&(n.ctrlKey||n.altKey||n.metaKey)||lA&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Sa:nr)[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 fA=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function hA(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,l;for(let u=0;u<e.length-1;u++){let f=e[u];if(/^(cmd|meta|m)$/i.test(f))l=!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))fA?l=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),l&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function dA(n){let e=Object.create(null);for(let t in n)e[hA(t)]=n[t];return e}function Lc(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 pA(n){return new Ct({props:{handleKeyDown:mA(n)}})}function mA(n){let e=dA(n);return function(t,r){let i=cA(r),o=i.length==1&&i!=" ",l,u=e[Lc(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)&&(l=nr[r.keyCode])&&l!=i){let f=e[Lc(l,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[Lc(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const gA=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function yA(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const bA=(n,e,t)=>{let r=yA(n,t);if(!r)return!1;let i=Pg(r);if(!i){let l=r.blockRange(),u=l&&_i(l);return u==null?!1:(e&&e(n.tr.lift(l,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Bg(n,i,e))return!0;if(r.parent.content.size==0&&(Ai(o,"end")||ee.isSelectable(o))){let l=hc(n.doc,r.before(),r.after(),K.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=n.tr.step(l);u.setSelection(Ai(o,"end")?pe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ee.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 Ai(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 _A=(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=Pg(r)}let l=o&&o.nodeBefore;return!l||!ee.isSelectable(l)?!1:(e&&e(n.tr.setSelection(ee.create(n.doc,o.pos-l.nodeSize)).scrollIntoView()),!0)};function Pg(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 vA(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const wA=(n,e,t)=>{let r=vA(n,t);if(!r)return!1;let i=Dg(r);if(!i)return!1;let o=i.nodeAfter;if(Bg(n,i,e))return!0;if(r.parent.content.size==0&&(Ai(o,"start")||ee.isSelectable(o))){let l=hc(n.doc,r.before(),r.after(),K.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=n.tr.step(l);u.setSelection(Ai(o,"start")?pe.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):ee.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},SA=(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=Dg(r)}let l=o&&o.nodeAfter;return!l||!ee.isSelectable(l)?!1:(e&&e(n.tr.setSelection(ee.create(n.doc,o.pos)).scrollIntoView()),!0)};function Dg(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 xA=(n,e)=>{let t=n.selection,r=t instanceof ee,i;if(r){if(t.node.isTextblock||!Zn(n.doc,t.from))return!1;i=t.from}else if(i=pa(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(ee.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},EA=(n,e)=>{let t=n.selection,r;if(t instanceof ee){if(t.node.isTextblock||!Zn(n.doc,t.to))return!1;r=t.to}else if(r=pa(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},kA=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&_i(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},CA=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
33
|
-
`).scrollIntoView()),!0)};function Fg(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 AA=(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),l=Fg(i.contentMatchAt(o));if(!l||!i.canReplaceWith(o,o,l))return!1;if(e){let u=t.after(),f=n.tr.replaceWith(u,u,l.createAndFill());f.setSelection(pe.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},OA=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof tn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Fg(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let l=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(l,o.createAndFill());u.setSelection(me.create(u.doc,l+1)),e(u.scrollIntoView())}return!0},TA=(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(vi(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&_i(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},MA=(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(ee.create(n.doc,i))),!0)};function IA(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||Zn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Bg(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,l;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(IA(n,e,t))return!0;let u=e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(l=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&l.matchType(o[0]||i.type).validEnd){if(t){let p=e.pos+i.nodeSize,_=B.empty;for(let m=o.length-1;m>=0;m--)_=B.from(o[m].create(null,_));_=B.from(r.copy(_));let S=n.tr.step(new We(e.pos-1,p,e.pos,p,new K(_,1,0),o.length,!0)),k=p+2*o.length;Zn(S.doc,k)&&S.join(k),t(S.scrollIntoView())}return!0}let f=pe.findFrom(e,1),d=f&&f.$from.blockRange(f.$to),g=d&&_i(d);if(g!=null&&g>=e.depth)return t&&t(n.tr.lift(d,g).scrollIntoView()),!0;if(u&&Ai(i,"start",!0)&&Ai(r,"end")){let p=r,_=[];for(;_.push(p),!p.isTextblock;)p=p.lastChild;let S=i,k=1;for(;!S.isTextblock;S=S.firstChild)k++;if(p.canReplace(p.childCount,p.childCount,S.content)){if(t){let m=B.empty;for(let x=_.length-1;x>=0;x--)m=B.from(_[x].copy(m));let b=n.tr.step(new We(e.pos-_.length,e.pos+i.nodeSize,e.pos+k,e.pos+i.nodeSize-k,new K(m,_.length,0),0,!0));t(b.scrollIntoView())}return!0}}return!1}function Hg(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(me.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const NA=Hg(-1),RA=Hg(1);function LA(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,l=i.blockRange(o),u=l&&fc(l,n,e);return u?(r&&r(t.tr.wrap(l,u).scrollIntoView()),!0):!1}}function $g(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:l},$to:{pos:u}}=t.selection.ranges[o];t.doc.nodesBetween(l,u,(f,d)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let g=t.doc.resolve(d),p=g.index();i=g.parent.canReplaceWith(p,p+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let l=0;l<t.selection.ranges.length;l++){let{$from:{pos:u},$to:{pos:f}}=t.selection.ranges[l];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 PA(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,l=i.blockRange(o),u=!1,f=l;if(!l)return!1;if(l.depth>=2&&i.node(l.depth-1).type.compatibleContent(n)&&l.startIndex==0){if(i.index(l.depth-1)==0)return!1;let g=t.doc.resolve(l.start-2);f=new ua(g,g,l.depth),l.endIndex<l.parent.childCount&&(l=new ua(i,t.doc.resolve(o.end(l.depth)),l.depth)),u=!0}let d=fc(f,n,e,l);return d?(r&&r(DA(t.tr,l,d,u,n).scrollIntoView()),!0):!1}}function DA(n,e,t,r,i){let o=B.empty;for(let g=t.length-1;g>=0;g--)o=B.from(t[g].type.create(t[g].attrs,o));n.step(new We(e.start-(r?2:0),e.end,e.start,e.end,new K(o,0,0),t.length,!0));let l=0;for(let g=0;g<t.length;g++)t[g].type==i&&(l=g+1);let u=t.length-l,f=e.start+t.length-(r?2:0),d=e.parent;for(let g=e.startIndex,p=e.endIndex,_=!0;g<p;g++,_=!1)!_&&vi(n.doc,f,u)&&(n.split(f,u),f+=2*u),f+=d.child(g).nodeSize;return n}function FA(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,l=>l.childCount>0&&l.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?BA(e,t,n,o):HA(e,t,o):!0:!1}}function BA(n,e,t,r){let i=n.tr,o=r.end,l=r.$to.end(r.depth);o<l&&(i.step(new We(o-1,l,o,l,new K(B.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new ua(i.doc.resolve(r.$from.pos),i.doc.resolve(l),r.depth));const u=_i(r);if(u==null)return!1;i.lift(r,u);let f=i.mapping.map(o,-1)-1;return Zn(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function HA(n,e,t){let r=n.tr,i=t.parent;for(let S=t.end,k=t.endIndex-1,m=t.startIndex;k>m;k--)S-=i.child(k).nodeSize,r.delete(S-1,S+1);let o=r.doc.resolve(t.start),l=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),g=o.index(-1);if(!d.canReplace(g+(u?0:1),g+1,l.content.append(f?B.empty:B.from(i))))return!1;let p=o.pos,_=p+l.nodeSize;return r.step(new We(p-(u?1:0),_+(f?1:0),p+1,_-1,new K((u?B.empty:B.from(i.copy(B.empty))).append(f?B.empty:B.from(i.copy(B.empty))),u?0:1,f?0:1),u?0:1)),e(r.scrollIntoView()),!0}function $A(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 l=o.startIndex;if(l==0)return!1;let u=o.parent,f=u.child(l-1);if(f.type!=n)return!1;if(t){let d=f.lastChild&&f.lastChild.type==u.type,g=B.from(d?n.create():null),p=new K(B.from(n.create(null,B.from(u.type.create(null,g)))),d?3:1,0),_=o.start,S=o.end;t(e.tr.step(new We(_-(d?3:1),S,_,S,p,1,!0)).scrollIntoView())}return!0}}function xa(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 Pc{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,l=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([u,f])=>[u,(...g)=>{const p=f(...g)(l);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:l}=i,u=[],f=!!e,d=e||o.tr,g=()=>(!f&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(d),u.every(_=>_===!0)),p={...Object.fromEntries(Object.entries(r).map(([_,S])=>[_,(...m)=>{const b=this.buildProps(d,t),x=S(...m)(b);return u.push(x),p}])),run:g};return p}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,l=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([f,d])=>[f,(...g)=>d(...g)({...l,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:l}=i,u={tr:e,editor:i,view:l,state:xa({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,(...g)=>d(...g)(u)]))}};return u}}function G(n,e,t){return n.config[e]===void 0&&n.parent?G(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?G(n.parent,e,t):null}):n.config[e]}function Ea(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 zg(n){const e=[],{nodeExtensions:t,markExtensions:r}=Ea(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(l=>{const u={name:l.name,options:l.options,storage:l.storage},f=G(l,"addGlobalAttributes",u);if(!f)return;f().forEach(g=>{g.types.forEach(p=>{Object.entries(g.attributes).forEach(([_,S])=>{e.push({type:p,name:_,attribute:{...o,...S}})})})})}),i.forEach(l=>{const u={name:l.name,options:l.options,storage:l.storage},f=G(l,"addAttributes",u);if(!f)return;const d=f();Object.entries(d).forEach(([g,p])=>{const _={...o,...p};typeof _?.default=="function"&&(_.default=_.default()),_?.isRequired&&_?.default===void 0&&delete _.default,e.push({type:l.name,name:g,attribute:_})})}),e}function ze(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 Oi(...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(g=>!f.includes(g));r[i]=[...f,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Dc(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)=>Oi(t,r),{})}function zA(n){return typeof n=="function"}function le(n,e=void 0,...t){return zA(n)?e?n.bind(e)(...t):n(...t):n}function VA(n={}){return Object.keys(n).length===0&&n.constructor===Object}function WA(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Vg(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,l)=>{const u=l.attribute.parseHTML?l.attribute.parseHTML(t):WA(t.getAttribute(l.name));return u==null?o:{...o,[l.name]:u}},{});return{...r,...i}}}}function Wg(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&VA(t)?!1:t!=null))}function Ug(n,e){var t;const r=zg(n),{nodeExtensions:i,markExtensions:o}=Ea(n),l=(t=i.find(d=>G(d,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(d=>{const g=r.filter(x=>x.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},_=n.reduce((x,A)=>{const O=G(A,"extendNodeSchema",p);return{...x,...O?O(d):{}}},{}),S=Wg({..._,content:le(G(d,"content",p)),marks:le(G(d,"marks",p)),group:le(G(d,"group",p)),inline:le(G(d,"inline",p)),atom:le(G(d,"atom",p)),selectable:le(G(d,"selectable",p)),draggable:le(G(d,"draggable",p)),code:le(G(d,"code",p)),defining:le(G(d,"defining",p)),isolating:le(G(d,"isolating",p)),attrs:Object.fromEntries(g.map(x=>{var A;return[x.name,{default:(A=x?.attribute)===null||A===void 0?void 0:A.default}]}))}),k=le(G(d,"parseHTML",p));k&&(S.parseDOM=k.map(x=>Vg(x,g)));const m=G(d,"renderHTML",p);m&&(S.toDOM=x=>m({node:x,HTMLAttributes:Dc(x,g)}));const b=G(d,"renderText",p);return b&&(S.toText=b),[d.name,S]})),f=Object.fromEntries(o.map(d=>{const g=r.filter(b=>b.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},_=n.reduce((b,x)=>{const A=G(x,"extendMarkSchema",p);return{...b,...A?A(d):{}}},{}),S=Wg({..._,inclusive:le(G(d,"inclusive",p)),excludes:le(G(d,"excludes",p)),group:le(G(d,"group",p)),spanning:le(G(d,"spanning",p)),code:le(G(d,"code",p)),attrs:Object.fromEntries(g.map(b=>{var x;return[b.name,{default:(x=b?.attribute)===null||x===void 0?void 0:x.default}]}))}),k=le(G(d,"parseHTML",p));k&&(S.parseDOM=k.map(b=>Vg(b,g)));const m=G(d,"renderHTML",p);return m&&(S.toDOM=b=>m({mark:b,HTMLAttributes:Dc(b,g)})),[d.name,S]}));return new Gk({topNode:l,nodes:u,marks:f})}function Fc(n,e){return e.nodes[n]||e.marks[n]||null}function qg(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const UA=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,l,u)=>{var f,d;const g=((d=(f=i.type.spec).toText)===null||d===void 0?void 0:d.call(f,{node:i,pos:o,parent:l,index:u}))||i.textContent||"%leaf%";t+=g.slice(0,Math.max(0,r-o))}),t};function Bc(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Kg{constructor(e){this.find=e.find,this.handler=e.handler}}const qA=(n,e)=>{if(Bc(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 Hc(n){var e;const{editor:t,from:r,to:i,text:o,rules:l,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(_=>_.type.spec.code))return!1;let g=!1;const p=UA(d)+o;return l.forEach(_=>{if(g)return;const S=qA(p,_.find);if(!S)return;const k=f.state.tr,m=xa({state:f.state,transaction:k}),b={from:r-(S[0].length-o.length),to:i},{commands:x,chain:A,can:O}=new Pc({editor:t,state:m});_.handler({state:m,range:b,match:S,commands:x,chain:A,can:O})===null||!k.steps.length||(k.setMeta(u,{transform:k,from:r,to:i,text:o}),f.dispatch(k),g=!0)}),g}function KA(n){const{editor:e,rules:t}=n,r=new Ct({state:{init(){return null},apply(i,o){const l=i.getMeta(r);return l||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,l,u){return Hc({editor:e,from:o,to:l,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Hc({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:l}=i.state.selection;return l?Hc({editor:e,from:l.pos,to:l.pos,text:`
|
|
34
|
-
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
31
|
+
`);return{dom:f,text:b}}function Xg(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",b=>{e=b(e,o||r,n)}),o)return e?new K(z.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
32
|
+
`))),0,0):K.empty;let p=n.someProp("clipboardTextParser",b=>b(e,i,r,n));if(p)u=p;else{let b=i.marks(),{schema:S}=n.state,C=ii.fromSchema(S);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let _=a.appendChild(document.createElement("p"));g&&_.appendChild(C.serializeNode(S.text(g,b)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),a=fk(t),Uc&&hk(a);let h=a&&a.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let p=+m[3];p>0;p--){let b=a.firstChild;for(;b&&b.nodeType!=1;)b=b.nextSibling;if(!b)break;a=b}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||Mc.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||m),context:i,ruleFromNode(b){return b.nodeName=="BR"&&!b.nextSibling&&b.parentNode&&!uk.test(b.parentNode.nodeName)?{ignore:!0}:null}})),m)u=dk(t0(u,+m[1],+m[2]),m[4]);else if(u=K.maxOpen(ck(u.content,i),!0),u.openStart||u.openEnd){let p=0,b=0;for(let S=u.content.firstChild;p<u.openStart&&!S.type.spec.isolating;p++,S=S.firstChild);for(let S=u.content.lastChild;b<u.openEnd&&!S.type.spec.isolating;b++,S=S.lastChild);u=t0(u,p,b)}return n.someProp("transformPasted",p=>{u=p(u,n)}),u}const uk=/^(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 ck(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),h;if(!f)return a=null;if(h=a.length&&o.length&&Qg(f,o,u,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=e0(a[a.length-1],o.length));let m=Zg(u,f);a.push(m),i=i.matchType(m.type),o=f}}),a)return z.from(a)}return n}function Zg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,z.from(n));return n}function Qg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=Qg(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(z.from(Zg(t,n,i+1))))}}function e0(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,e0(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(z.empty,!0);return n.copy(t.append(r))}function Xc(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,u=a.content;return i<r-1&&(u=Xc(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(z.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(u))}function t0(n,e,t){return e<n.openStart&&(n=new K(Xc(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new K(Xc(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const n0={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 r0=null;function i0(){return r0||(r0=document.implementation.createHTMLDocument("title"))}function fk(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=i0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&n0[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 hk(n){let e=n.querySelectorAll(Ni?"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 dk(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=z.from(f.create(r[u+1],i)),o++,a++}return new K(i,o,a)}const hn={},Lt={};function gr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Lt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!o0(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Ds&&Ni&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Vc&&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,Pg(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||lk(n,t)?t.preventDefault():gr(n,"key")},Lt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Lt.keypress=(n,e)=>{let t=e;if(o0(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||jt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof ye)||!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 Ia(n){return{left:n.clientX,top:n.clientY}}function pk(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Zc(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 Ri(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function mk(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&ee.isSelectable(r)?(Ri(n,new ee(t)),!0):!1}function gk(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof ee&&(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(ee.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?(Ri(n,ee.create(n.state.doc,i)),!0):!1}function yk(n,e,t,r,i){return Zc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?gk(n,t):mk(n,t))}function bk(n,e,t,r){return Zc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function _k(n,e,t,r){return Zc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||vk(n,t,r)}function vk(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ri(n,ye.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)Ri(n,ye.create(r,u+1,u+1+a.content.size));else if(ee.isSelectable(a))Ri(n,ee.create(r,u));else continue;return!0}}function Qc(n){return Na(n)}const s0=jt?"metaKey":"ctrlKey";hn.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Qc(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&pk(t,n.input.lastClick)&&!t[s0]&&(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(Ia(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new wk(n,a,t,!!r)):(o=="doubleClick"?bk:_k)(n,a.pos,a.inside,t)?t.preventDefault():gr(n,"pointer"))};class wk{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[s0],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let m=e.state.doc.resolve(t.pos);o=m.parent,a=m.depth?m.before():0}const u=i?null:r.target,f=u?e.docView.nearestDesc(u,!0):null;this.target=f?f.dom:null;let{selection:h}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||h instanceof ee&&h.from<=a&&h.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ta&&!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)),gr(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(()=>qc(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(Ia(e))),this.updateAllowDefault(e),this.allowDefault||!t?gr(this.view,"pointer"):yk(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ur&&this.mightDrag&&!this.mightDrag.node.isAtom||Ni&&!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)?(Ri(this.view,ge.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):gr(this.view,"pointer")}move(e){this.updateAllowDefault(e),gr(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)}}hn.touchstart=n=>{n.input.lastTouch=Date.now(),Qc(n),gr(n,"pointer")},hn.touchmove=n=>{n.input.lastTouch=Date.now(),gr(n,"pointer")},hn.contextmenu=n=>Qc(n);function o0(n,e){return n.composing?!0:Ur&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Sk=Ds?5e3:-1;Lt.compositionstart=Lt.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(),Na(n,!0),n.markCursor=null;else if(Na(n),Ta&&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}a0(n,Sk)},Lt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,a0(n,20))};function a0(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Na(n),e))}function xk(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Ck());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Ck(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Na(n,e=!1){if(!(Ds&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),xk(n),e||n.docView&&n.docView.dirty){let t=tk(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function Ek(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 Li=Ps&&zg<15||Vc&&ek<604;hn.copy=Lt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Li?null:t.clipboardData,a=r.content(),{dom:u,text:f}=Yg(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",f)):Ek(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function kk(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Ak(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?ef(n,r.value,null,e):ef(n,r.textContent,r.innerHTML,e)},50)}function ef(n,e,t,r){let i=Xg(n,e,t,n.input.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",u=>u(n,r,i||K.empty)))return!0;if(!i)return!1;let o=kk(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}Lt.paste=(n,e)=>{let t=e;if(n.composing&&!Ds)return;let r=Li?null:t.clipboardData;r&&ef(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():Ak(n,t)};class Mk{constructor(e,t){this.slice=e,this.move=t}}const l0=jt?"altKey":"ctrlKey";hn.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(Ia(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ee?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(ee.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let h=n.docView.nearestDesc(t.target,!0);h&&h.node.type.spec.draggable&&h!=n.docView&&n.dispatch(n.state.tr.setSelection(ee.create(n.state.doc,h.posBefore)))}}let a=n.state.selection.content(),{dom:u,text:f}=Yg(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(Li?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",Li||t.dataTransfer.setData("text/plain",f),n.dragging=new Mk(a,!t[l0])},hn.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Lt.dragover=Lt.dragenter=(n,e)=>e.preventDefault(),Lt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Ia(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",C=>{a=C(a,n)}):a=Xg(n,t.dataTransfer.getData(Li?"Text":"text/plain"),Li?null:t.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!t[l0]);if(n.someProp("handleDrop",C=>C(n,t,a||K.empty,u))){t.preventDefault();return}if(!a)return;t.preventDefault();let f=a?$E(n.state.doc,o.pos,a):o.pos;f==null&&(f=o.pos);let h=n.state.tr;u&&h.deleteSelection();let m=h.mapping.map(f),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,b=h.doc;if(p?h.replaceRangeWith(m,m,a.content.firstChild):h.replaceRange(m,m,a),h.doc.eq(b))return;let S=h.doc.resolve(m);if(p&&ee.isSelectable(a.content.firstChild)&&S.nodeAfter&&S.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new ee(S));else{let C=h.mapping.map(f);h.mapping.maps[h.mapping.maps.length-1].forEach((g,_,x,k)=>C=k),h.setSelection(Ug(n,S,h.doc.resolve(C)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},hn.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())&&qc(n)},20))},hn.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)},hn.beforeinput=(n,e)=>{if(Ni&&Ds&&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,Pg(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 Lt)hn[n]=Lt[n];function zs(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 uh{constructor(e,t){this.toDOM=e,this.spec=t||Kr,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 Mn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof uh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&zs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Er{constructor(e,t){this.attrs=e,this.spec=t||Kr}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 Mn(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Er&&zs(this.attrs,e.attrs)&&zs(this.spec,e.spec)}static is(e){return e.type instanceof Er}destroy(){}}class ch{constructor(e,t){this.attrs=e,this.spec=t||Kr}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 Mn(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 ch&&zs(this.attrs,e.attrs)&&zs(this.spec,e.spec)}destroy(){}}class Mn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Mn(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 Mn(e,e,new uh(t,r))}static inline(e,t,r,i){return new Mn(e,t,new Er(r,i))}static node(e,t,r,i){return new Mn(e,t,new ch(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Er}}const Pi=[],Kr={};class Ze{constructor(e,t){this.local=e.length?e:Pi,this.children=t.length?t:Pi}static create(e,t){return t.length?Ra(t,e,0,Kr):gt}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==gt||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Kr)}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?Tk(this.children,a||[],e,t,r,i,o):a?new Ze(a.sort(Gr),Pi):gt}add(e,t){return t.length?this==gt?Ze.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((u,f)=>{let h=f+r,m;if(m=c0(t,u,h)){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,m,h+1):i.splice(o,0,f,f+u.nodeSize,Ra(m,u,h+1,Kr)),o+=3}});let a=u0(o?f0(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(Gr):this.local,i||this.children)}remove(e){return e.length==0||this==gt?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 m=0,p;m<e.length;m++)(p=e[m])&&p.from>u&&p.to<f&&(e[m]=null,(a||(a=[])).push(p));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[o+2].removeInner(a,u+1);h!=gt?r[o+2]=h:(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):gt}forChild(e,t){if(this==gt)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 Er){let h=Math.max(o,f.from)-o,m=Math.min(a,f.to)-o;h<m&&(i||(i=[])).push(f.copy(h,m))}}if(i){let u=new Ze(i.sort(Gr),Pi);return r?new ri([u,r]):u}return r||gt}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 tf(this.localsInner(e))}localsInner(e){if(this==gt)return Pi;if(e.inlineContent||!this.local.some(Er.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Er||t.push(this.local[r]);return t}}Ze.empty=new Ze([],[]),Ze.removeOverlap=tf;const gt=Ze.empty;class ri{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Kr));return ri.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!=gt&&(o instanceof ri?r=r.concat(o.members):r.push(o))}return ri.from(r)}eq(e){if(!(e instanceof ri)||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?tf(r?t:t.sort(Gr)):Pi}static from(e){switch(e.length){case 0:return gt;case 1:return e[0];default:return new ri(e.every(t=>t instanceof Ze)?e:e.reduce((t,r)=>t.concat(r instanceof Ze?r:r.members),[]))}}}function Tk(n,e,t,r,i,o,a){let u=n.slice();for(let h=0,m=o;h<t.maps.length;h++){let p=0;t.maps[h].forEach((b,S,C,g)=>{let _=g-C-(S-b);for(let x=0;x<u.length;x+=3){let k=u[x+1];if(k<0||b>k+m-p)continue;let A=u[x]+m-p;S>=A?u[x+1]=b<=A?-2:-1:C>=i&&_&&(u[x]+=_,u[x+1]+=_)}p+=_}),m=t.maps[h].map(m,-1)}let f=!1;for(let h=0;h<u.length;h+=3)if(u[h+1]<0){if(u[h+1]==-2){f=!0,u[h+1]=-1;continue}let m=t.map(n[h]+o),p=m-i;if(p<0||p>=r.content.size){f=!0;continue}let b=t.map(n[h+1]+o,-1),S=b-i,{index:C,offset:g}=r.content.findIndex(p),_=r.maybeChild(C);if(_&&g==p&&g+_.nodeSize==S){let x=u[h+2].mapInner(t,_,m+1,n[h]+o+1,a);x!=gt?(u[h]=p,u[h+1]=S,u[h+2]=x):(u[h+1]=-2,f=!0)}else f=!0}if(f){let h=Ok(u,n,e,t,i,o,a),m=Ra(h,r,0,a);e=m.local;for(let p=0;p<u.length;p+=3)u[p+1]<0&&(u.splice(p,3),p-=3);for(let p=0,b=0;p<m.children.length;p+=3){let S=m.children[p];for(;b<u.length&&u[b]<S;)b+=3;u.splice(b,0,m.children[p],m.children[p+1],m.children[p+2])}}return new Ze(e.sort(Gr),u)}function u0(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 Mn(i.from+e,i.to+e,i.type))}return t}function Ok(n,e,t,r,i,o,a){function u(f,h){for(let m=0;m<f.local.length;m++){let p=f.local[m].map(r,i,h);p?t.push(p):a.onRemove&&a.onRemove(f.local[m].spec)}for(let m=0;m<f.children.length;m+=3)u(f.children[m+2],f.children[m]+h+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 c0(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 f0(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Ra(n,e,t,r){let i=[],o=!1;e.forEach((u,f)=>{let h=c0(n,u,f+t);if(h){o=!0;let m=Ra(h,u,t+f+1,r);m!=gt&&i.push(f,f+u.nodeSize,m)}});let a=u0(o?f0(n):n,-t).sort(Gr);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):gt}function Gr(n,e){return n.from-e.from||n.to-e.to}function tf(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),h0(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),h0(e,i,r.copy(o.from,r.to)));break}}}return e}function h0(n,e,t){for(;e<n.length&&Gr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var yr={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:"'"},La={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},d0=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Ik=typeof navigator<"u"&&/Mac/.test(navigator.platform),Nk=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Rk=Ik||d0&&+d0[1]<57,it=0;it<10;it++)yr[48+it]=yr[96+it]=String(it);for(var it=1;it<=24;it++)yr[it+111]="F"+it;for(var it=65;it<=90;it++)yr[it]=String.fromCharCode(it+32),La[it]=String.fromCharCode(it);for(var nf in yr)La.hasOwnProperty(nf)||(La[nf]=yr[nf]);function Lk(n){var e=Rk&&(n.ctrlKey||n.altKey||n.metaKey)||Nk&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?La:yr)[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 Pk=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Dk(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))Pk?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 Fk(n){let e=Object.create(null);for(let t in n)e[Dk(t)]=n[t];return e}function rf(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 zk(n){return new Rt({props:{handleKeyDown:Bk(n)}})}function Bk(n){let e=Fk(n);return function(t,r){let i=Lk(r),o=i.length==1&&i!=" ",a,u=e[rf(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=yr[r.keyCode])&&a!=i){let f=e[rf(a,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[rf(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const $k=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function Hk(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const Wk=(n,e,t)=>{let r=Hk(n,t);if(!r)return!1;let i=p0(r);if(!i){let a=r.blockRange(),u=a&&Mi(a);return u==null?!1:(e&&e(n.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&y0(n,i,e))return!0;if(r.parent.content.size==0&&(Di(o,"end")||ee.isSelectable(o))){let a=Pc(n.doc,r.before(),r.after(),K.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(Di(o,"end")?ge.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ee.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 Di(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 Vk=(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=p0(r)}let a=o&&o.nodeBefore;return!a||!ee.isSelectable(a)?!1:(e&&e(n.tr.setSelection(ee.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function p0(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 Uk(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const qk=(n,e,t)=>{let r=Uk(n,t);if(!r)return!1;let i=m0(r);if(!i)return!1;let o=i.nodeAfter;if(y0(n,i,e))return!0;if(r.parent.content.size==0&&(Di(o,"start")||ee.isSelectable(o))){let a=Pc(n.doc,r.before(),r.after(),K.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(Di(o,"start")?ge.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):ee.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},Kk=(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=m0(r)}let a=o&&o.nodeAfter;return!a||!ee.isSelectable(a)?!1:(e&&e(n.tr.setSelection(ee.create(n.doc,o.pos)).scrollIntoView()),!0)};function m0(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 Gk=(n,e)=>{let t=n.selection,r=t instanceof ee,i;if(r){if(t.node.isTextblock||!dr(n.doc,t.from))return!1;i=t.from}else if(i=ka(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(ee.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},Jk=(n,e)=>{let t=n.selection,r;if(t instanceof ee){if(t.node.isTextblock||!dr(n.doc,t.to))return!1;r=t.to}else if(r=ka(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},jk=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Mi(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},Yk=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
33
|
+
`).scrollIntoView()),!0)};function g0(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 Xk=(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=g0(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(ge.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},Zk=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof mn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=g0(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(ye.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},Qk=(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(Ti(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Mi(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},eA=(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(ee.create(n.doc,i))),!0)};function tA(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||dr(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function y0(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(tA(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 p=e.pos+i.nodeSize,b=z.empty;for(let g=o.length-1;g>=0;g--)b=z.from(o[g].create(null,b));b=z.from(r.copy(b));let S=n.tr.step(new Xe(e.pos-1,p,e.pos,p,new K(b,1,0),o.length,!0)),C=p+2*o.length;dr(S.doc,C)&&S.join(C),t(S.scrollIntoView())}return!0}let f=ge.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&Mi(h);if(m!=null&&m>=e.depth)return t&&t(n.tr.lift(h,m).scrollIntoView()),!0;if(u&&Di(i,"start",!0)&&Di(r,"end")){let p=r,b=[];for(;b.push(p),!p.isTextblock;)p=p.lastChild;let S=i,C=1;for(;!S.isTextblock;S=S.firstChild)C++;if(p.canReplace(p.childCount,p.childCount,S.content)){if(t){let g=z.empty;for(let x=b.length-1;x>=0;x--)g=z.from(b[x].copy(g));let _=n.tr.step(new Xe(e.pos-b.length,e.pos+i.nodeSize,e.pos+C,e.pos+i.nodeSize-C,new K(g,b.length,0),0,!0));t(_.scrollIntoView())}return!0}}return!1}function b0(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(ye.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const nA=b0(-1),rA=b0(1);function iA(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 _0(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,h)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let m=t.doc.resolve(h),p=m.index();i=m.parent.canReplaceWith(p,p+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 sA(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 m=t.doc.resolve(a.start-2);f=new wa(m,m,a.depth),a.endIndex<a.parent.childCount&&(a=new wa(i,t.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let h=Lc(f,n,e,a);return h?(r&&r(oA(t.tr,a,h,u,n).scrollIntoView()),!0):!1}}function oA(n,e,t,r,i){let o=z.empty;for(let m=t.length-1;m>=0;m--)o=z.from(t[m].type.create(t[m].attrs,o));n.step(new Xe(e.start-(r?2:0),e.end,e.start,e.end,new K(o,0,0),t.length,!0));let a=0;for(let m=0;m<t.length;m++)t[m].type==i&&(a=m+1);let u=t.length-a,f=e.start+t.length-(r?2:0),h=e.parent;for(let m=e.startIndex,p=e.endIndex,b=!0;m<p;m++,b=!1)!b&&Ti(n.doc,f,u)&&(n.split(f,u),f+=2*u),f+=h.child(m).nodeSize;return n}function aA(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?lA(e,t,n,o):uA(e,t,o):!0:!1}}function lA(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new Xe(o-1,a,o,a,new K(z.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new wa(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=Mi(r);if(u==null)return!1;i.lift(r,u);let f=i.mapping.map(o,-1)-1;return dr(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function uA(n,e,t){let r=n.tr,i=t.parent;for(let S=t.end,C=t.endIndex-1,g=t.startIndex;C>g;C--)S-=i.child(C).nodeSize,r.delete(S-1,S+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,h=o.node(-1),m=o.index(-1);if(!h.canReplace(m+(u?0:1),m+1,a.content.append(f?z.empty:z.from(i))))return!1;let p=o.pos,b=p+a.nodeSize;return r.step(new Xe(p-(u?1:0),b+(f?1:0),p+1,b-1,new K((u?z.empty:z.from(i.copy(z.empty))).append(f?z.empty:z.from(i.copy(z.empty))),u?0:1,f?0:1),u?0:1)),e(r.scrollIntoView()),!0}function cA(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,h=>h.childCount>0&&h.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 h=f.lastChild&&f.lastChild.type==u.type,m=z.from(h?n.create():null),p=new K(z.from(n.create(null,z.from(u.type.create(null,m)))),h?3:1,0),b=o.start,S=o.end;t(e.tr.step(new Xe(b-(h?3:1),S,b,S,p,1,!0)).scrollIntoView())}return!0}}function Pa(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 sf{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,(...m)=>{const p=f(...m)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),p}]))}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,h=e||o.tr,m=()=>(!f&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(h),u.every(b=>b===!0)),p={...Object.fromEntries(Object.entries(r).map(([b,S])=>[b,(...g)=>{const _=this.buildProps(h,t),x=S(...g)(_);return u.push(x),p}])),run:m};return p}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,h])=>[f,(...m)=>h(...m)({...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:Pa({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,h])=>[f,(...m)=>h(...m)(u)]))}};return u}}function G(n,e,t){return n.config[e]===void 0&&n.parent?G(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?G(n.parent,e,t):null}):n.config[e]}function Da(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 v0(n){const e=[],{nodeExtensions:t,markExtensions:r}=Da(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=G(a,"addGlobalAttributes",u);if(!f)return;f().forEach(m=>{m.types.forEach(p=>{Object.entries(m.attributes).forEach(([b,S])=>{e.push({type:p,name:b,attribute:{...o,...S}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},f=G(a,"addAttributes",u);if(!f)return;const h=f();Object.entries(h).forEach(([m,p])=>{const b={...o,...p};typeof b?.default=="function"&&(b.default=b.default()),b?.isRequired&&b?.default===void 0&&delete b.default,e.push({type:a.name,name:m,attribute:b})})}),e}function Je(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 Fi(...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(" "):[],h=u.filter(m=>!f.includes(m));r[i]=[...f,...h].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function of(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)=>Fi(t,r),{})}function fA(n){return typeof n=="function"}function ue(n,e=void 0,...t){return fA(n)?e?n.bind(e)(...t):n(...t):n}function hA(n={}){return Object.keys(n).length===0&&n.constructor===Object}function dA(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function w0(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):dA(t.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function S0(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&hA(t)?!1:t!=null))}function x0(n,e){var t;const r=v0(n),{nodeExtensions:i,markExtensions:o}=Da(n),a=(t=i.find(h=>G(h,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(h=>{const m=r.filter(x=>x.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},b=n.reduce((x,k)=>{const A=G(k,"extendNodeSchema",p);return{...x,...A?A(h):{}}},{}),S=S0({...b,content:ue(G(h,"content",p)),marks:ue(G(h,"marks",p)),group:ue(G(h,"group",p)),inline:ue(G(h,"inline",p)),atom:ue(G(h,"atom",p)),selectable:ue(G(h,"selectable",p)),draggable:ue(G(h,"draggable",p)),code:ue(G(h,"code",p)),defining:ue(G(h,"defining",p)),isolating:ue(G(h,"isolating",p)),attrs:Object.fromEntries(m.map(x=>{var k;return[x.name,{default:(k=x?.attribute)===null||k===void 0?void 0:k.default}]}))}),C=ue(G(h,"parseHTML",p));C&&(S.parseDOM=C.map(x=>w0(x,m)));const g=G(h,"renderHTML",p);g&&(S.toDOM=x=>g({node:x,HTMLAttributes:of(x,m)}));const _=G(h,"renderText",p);return _&&(S.toText=_),[h.name,S]})),f=Object.fromEntries(o.map(h=>{const m=r.filter(_=>_.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},b=n.reduce((_,x)=>{const k=G(x,"extendMarkSchema",p);return{..._,...k?k(h):{}}},{}),S=S0({...b,inclusive:ue(G(h,"inclusive",p)),excludes:ue(G(h,"excludes",p)),group:ue(G(h,"group",p)),spanning:ue(G(h,"spanning",p)),code:ue(G(h,"code",p)),attrs:Object.fromEntries(m.map(_=>{var x;return[_.name,{default:(x=_?.attribute)===null||x===void 0?void 0:x.default}]}))}),C=ue(G(h,"parseHTML",p));C&&(S.parseDOM=C.map(_=>w0(_,m)));const g=G(h,"renderHTML",p);return g&&(S.toDOM=_=>g({mark:_,HTMLAttributes:of(_,m)})),[h.name,S]}));return new yE({topNode:a,nodes:u,marks:f})}function af(n,e){return e.nodes[n]||e.marks[n]||null}function C0(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const pA=(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,h;const m=((h=(f=i.type.spec).toText)===null||h===void 0?void 0:h.call(f,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";t+=m.slice(0,Math.max(0,r-o))}),t};function lf(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class E0{constructor(e){this.find=e.find,this.handler=e.handler}}const mA=(n,e)=>{if(lf(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 uf(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 h=f.state.doc.resolve(r);if(h.parent.type.spec.code||!((e=h.nodeBefore||h.nodeAfter)===null||e===void 0)&&e.marks.find(b=>b.type.spec.code))return!1;let m=!1;const p=pA(h)+o;return a.forEach(b=>{if(m)return;const S=mA(p,b.find);if(!S)return;const C=f.state.tr,g=Pa({state:f.state,transaction:C}),_={from:r-(S[0].length-o.length),to:i},{commands:x,chain:k,can:A}=new sf({editor:t,state:g});b.handler({state:g,range:_,match:S,commands:x,chain:k,can:A})===null||!C.steps.length||(C.setMeta(u,{transform:C,from:r,to:i,text:o}),f.dispatch(C),m=!0)}),m}function gA(n){const{editor:e,rules:t}=n,r=new Rt({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 uf({editor:e,from:o,to:a,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&uf({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?uf({editor:e,from:a.pos,to:a.pos,text:`
|
|
34
|
+
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function yA(n){return typeof n=="number"}class bA{constructor(e){this.find=e.find,this.handler=e.handler}}const _A=(n,e)=>{if(lf(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 vA(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:u}=n,{commands:f,chain:h,can:m}=new sf({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(S,C)=>{if(!S.isTextblock||S.type.spec.code)return;const g=Math.max(r,C),_=Math.min(i,C+S.content.size),x=S.textBetween(g-C,_-C,void 0,"\uFFFC");_A(x,o.find).forEach(A=>{if(A.index===void 0)return;const N=g+A.index+1,W=N+A[0].length,L={from:t.tr.mapping.map(N),to:t.tr.mapping.map(W)},U=o.handler({state:t,range:L,match:A,commands:f,chain:h,can:m,pasteEvent:a,dropEvent:u});p.push(U)})}),p.every(S=>S!==null)}function wA(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(h=>new Rt({view(m){const p=b=>{var S;r=!((S=m.dom.parentElement)===null||S===void 0)&&S.contains(b.target)?m.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(m,p)=>(o=r===m.dom.parentElement,u=p,!1),paste:(m,p)=>{var b;const S=(b=p.clipboardData)===null||b===void 0?void 0:b.getData("text/html");return a=p,i=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(m,p,b)=>{const S=m[0],C=S.getMeta("uiEvent")==="paste"&&!i,g=S.getMeta("uiEvent")==="drop"&&!o;if(!C&&!g)return;const _=p.doc.content.findDiffStart(b.doc.content),x=p.doc.content.findDiffEnd(b.doc.content);if(!yA(_)||!x||_===x.b)return;const k=b.tr,A=Pa({state:b,transaction:k});if(!(!vA({editor:e,state:A,from:Math.max(_-1,0),to:x.b-1,rule:h,pasteEvent:a,dropEvent:u})||!k.steps.length))return u=new DragEvent("drop"),a=new ClipboardEvent("paste"),k}}))}function SA(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class Gi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Gi.resolve(e),this.schema=x0(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:af(r.name,this.schema)};r.type==="mark"&&(!((i=ue(G(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=G(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=G(r,"onCreate",o);u&&this.editor.on("create",u);const f=G(r,"onUpdate",o);f&&this.editor.on("update",f);const h=G(r,"onSelectionUpdate",o);h&&this.editor.on("selectionUpdate",h);const m=G(r,"onTransaction",o);m&&this.editor.on("transaction",m);const p=G(r,"onFocus",o);p&&this.editor.on("focus",p);const b=G(r,"onBlur",o);b&&this.editor.on("blur",b);const S=G(r,"onDestroy",o);S&&this.editor.on("destroy",S)})}static resolve(e){const t=Gi.sort(Gi.flatten(e)),r=SA(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=G(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=G(r,"priority")||100,a=G(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:af(t.name,this.schema)},i=G(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Gi.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:e,type:af(a.name,this.schema)},f=[],h=G(a,"addKeyboardShortcuts",u);let m={};if(a.type==="mark"&&a.config.exitable&&(m.ArrowRight=()=>Pt.handleExit({editor:e,mark:a})),h){const g=Object.fromEntries(Object.entries(h()).map(([_,x])=>[_,()=>x({editor:e})]));m={...m,...g}}const p=zk(m);f.push(p);const b=G(a,"addInputRules",u);C0(a,e.options.enableInputRules)&&b&&r.push(...b());const S=G(a,"addPasteRules",u);C0(a,e.options.enablePasteRules)&&S&&i.push(...S());const C=G(a,"addProseMirrorPlugins",u);if(C){const g=C();f.push(...g)}return f}).flat();return[gA({editor:e,rules:r}),...wA({editor:e,rules:i}),...o]}get attributes(){return v0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Da(this.extensions);return Object.fromEntries(t.filter(r=>!!G(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:Je(r.name,this.schema)},a=G(r,"addNodeView",o);if(!a)return[];const u=(f,h,m,p)=>{const b=of(f,i);return a()({editor:e,node:f,getPos:m,decorations:p,HTMLAttributes:b,extension:r})};return[r.name,u]}))}}function xA(n){return Object.prototype.toString.call(n).slice(8,-1)}function cf(n){return xA(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Fa(n,e){const t={...n};return cf(n)&&cf(e)&&Object.keys(e).forEach(r=>{cf(e[r])?r in n?t[r]=Fa(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class De{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=ue(G(this,"addOptions",{name:this.name}))),this.storage=ue(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new De(e)}configure(e={}){const t=this.extend();return t.options=Fa(this.options,e),t.storage=ue(G(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new De(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=ue(G(t,"addOptions",{name:t.name})),t.storage=ue(G(t,"addStorage",{name:t.name,options:t.options})),t}}function CA(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
35
35
|
|
|
36
|
-
`,textSerializers:l={}}=t||{};let u="",f=!0;return n.nodesBetween(r,i,(d,g,p,_)=>{var S;const k=l?.[d.type.name];k?(d.isBlock&&!f&&(u+=o,f=!0),p&&(u+=k({node:d,pos:g,parent:p,index:_,range:e}))):d.isText?(u+=(S=d?.text)===null||S===void 0?void 0:S.slice(Math.max(r,g)-g,i-g),f=!1):d.isBlock&&!f&&(u+=o,f=!0)}),u}function tO(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Pe.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ct({key:new Zt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,l=Math.min(...o.map(g=>g.$from.pos)),u=Math.max(...o.map(g=>g.$to.pos)),f=tO(t);return eO(r,{from:l,to:u},{textSerializers:f})}}})]}});const nO=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),rO=(n=!1)=>({commands:e})=>e.setContent("",n),iO=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:l})=>{n.doc.nodesBetween(o.pos,l.pos,(u,f)=>{if(u.type.isText)return;const{doc:d,mapping:g}=e,p=d.resolve(g.map(f)),_=d.resolve(g.map(f+u.nodeSize)),S=p.blockRange(_);if(!S)return;const k=_i(S);if(u.type.isTextblock){const{defaultType:m}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(S.start,m)}(k||k===0)&&e.lift(S,k)})}),!0},sO=n=>e=>n(e),oO=()=>({state:n,dispatch:e})=>OA(n,e),aO=(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 l=r.mapping.map(e);return r.insert(l,o.content),r.setSelection(new me(r.doc.resolve(l-1))),!0},lO=()=>({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},uO=n=>({tr:e,state:t,dispatch:r})=>{const i=ze(n,t.schema),o=e.selection.$anchor;for(let l=o.depth;l>0;l-=1)if(o.node(l).type===i){if(r){const f=o.before(l),d=o.after(l);e.delete(f,d).scrollIntoView()}return!0}return!1},cO=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},fO=()=>({state:n,dispatch:e})=>gA(n,e),hO=()=>({commands:n})=>n.keyboardShortcut("Enter"),dO=()=>({state:n,dispatch:e})=>AA(n,e);function Ca(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Bc(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function zc(n,e,t={}){return n.find(r=>r.type===e&&Ca(r.attrs,t))}function pO(n,e,t={}){return!!zc(n,e,t)}function Vc(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=zc([...r.node.marks],e,t);if(!i)return;let o=r.index,l=n.start()+r.offset,u=o+1,f=l+r.node.nodeSize;for(zc([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,l-=n.parent.child(o).nodeSize;for(;u<n.parent.childCount&&pO([...n.parent.child(u).marks],e,t);)f+=n.parent.child(u).nodeSize,u+=1;return{from:l,to:f}}function cn(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=cn(n,r.schema),{doc:l,selection:u}=t,{$from:f,from:d,to:g}=u;if(i){const p=Vc(f,o,e);if(p&&p.from<=d&&p.to>=g){const _=me.create(l,p.from,p.to);t.setSelection(_)}}return!0},gO=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 Gg(n){return n instanceof me}function Lr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function yO(n,e=null){if(!e)return null;const t=pe.atStart(n),r=pe.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?me.create(n,Lr(0,i,o),Lr(n.content.size,i,o)):me.create(n,Lr(e,i,o),Lr(e,i,o))}function Wc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const bO=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const l=()=>{Wc()&&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&&!Gg(t.state.selection))return l(),!0;const u=yO(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),l()),!0},_O=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),vO=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function jg(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function Aa(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?B.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),Aa("",e,t)}if(typeof n=="string"){const r=sc.fromSchema(e);return t.slice?r.parseSlice(jg(n),t.parseOptions).content:r.parse(jg(n),t.parseOptions)}return Aa("",e,t)}function wO(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof nt||i instanceof We))return;const o=n.mapping.maps[r];let l=0;o.forEach((u,f,d,g)=>{l===0&&(l=g)}),n.setSelection(pe.near(n.doc.resolve(l),t))}const SO=n=>n.toString().startsWith("<"),xO=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const l=Aa(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(l.toString()==="<>")return!0;let{from:u,to:f}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},d=!0,g=!0;if((SO(l)?l:[l]).forEach(_=>{_.check(),d=d?_.isText&&_.marks.length===0:!1,g=g?_.isBlock:!1}),u===f&&g){const{parent:_}=r.doc.resolve(u);_.isTextblock&&!_.type.spec.code&&!_.childCount&&(u-=1,f+=1)}d?Array.isArray(e)?r.insertText(e.map(_=>_.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,l),t.updateSelection&&wO(r,r.steps.length-1,-1)}return!0},EO=()=>({state:n,dispatch:e})=>xA(n,e),kO=()=>({state:n,dispatch:e})=>EA(n,e),CO=()=>({state:n,dispatch:e})=>bA(n,e),AO=()=>({state:n,dispatch:e})=>wA(n,e),OO=()=>({tr:n,state:e,dispatch:t})=>{try{const r=pa(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},TO=()=>({state:n,dispatch:e,tr:t})=>{try{const r=pa(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function Jg(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function MO(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,l;for(let u=0;u<e.length-1;u+=1){const f=e[u];if(/^(cmd|meta|m)$/i.test(f))l=!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))Wc()||Jg()?l=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),l&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const IO=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=MO(n).split(/-(?!$)/),l=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),u=new KeyboardEvent("keydown",{key:l==="Space"?" ":l,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 g=d.map(r.mapping);g&&i&&r.maybeStep(g)}),!0};function Uc(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,l=e?ze(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(p,_)=>{if(p.isText)return;const S=Math.max(r,_),k=Math.min(i,_+p.nodeSize);u.push({node:p,from:S,to:k})});const f=i-r,d=u.filter(p=>l?l.name===p.node.type.name:!0).filter(p=>Ca(p.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((p,_)=>p+_.to-_.from,0)>=f}const NO=(n,e={})=>({state:t,dispatch:r})=>{const i=ze(n,t.schema);return Uc(t,i,e)?kA(t,r):!1},RO=()=>({state:n,dispatch:e})=>TA(n,e),LO=n=>({state:e,dispatch:t})=>{const r=ze(n,e.schema);return FA(r)(e,t)},PO=()=>({state:n,dispatch:e})=>CA(n,e);function qc(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Yg(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 DO=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,l=null;const u=qc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=ze(n,r.schema)),u==="mark"&&(l=cn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(d,g)=>{o&&o===d.type&&t.setNodeMarkup(g,void 0,Yg(d.attrs,e)),l&&d.marks.length&&d.marks.forEach(p=>{l===p.type&&t.addMark(g,g+d.nodeSize,l.create(Yg(p.attrs,e)))})})}),!0):!1},FO=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),BO=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),HO=()=>({state:n,dispatch:e})=>_A(n,e),$O=()=>({state:n,dispatch:e})=>SA(n,e),zO=()=>({state:n,dispatch:e})=>MA(n,e),VO=()=>({state:n,dispatch:e})=>RA(n,e),WO=()=>({state:n,dispatch:e})=>NA(n,e);function UO(n,e,t={}){return Aa(n,e,{slice:!1,parseOptions:t})}const qO=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:l}=r,u=UO(n,i.schema,t);return o&&r.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!e),!0};function Xg(n,e){const t=cn(e,n.schema),{from:r,to:i,empty:o}=n.selection,l=[];o?(n.storedMarks&&l.push(...n.storedMarks),l.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,f=>{l.push(...f.marks)});const u=l.find(f=>f.type.name===t.name);return u?{...u.attrs}:{}}function KO(n,e){const t=new xC(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function GO(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 jO(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function JO(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 Kc(n){return e=>JO(e.$from,n)}function YO(n,e){const t=Fi.resolve(n);return Ug(t,e)}function XO(n,e){const t=ze(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,u=>{o.push(u)});const l=o.reverse().find(u=>u.type.name===t.name);return l?{...l.attrs}:{}}function ZO(n,e){const t=qc(typeof e=="string"?e:e.name,n.schema);return t==="node"?XO(n,e):t==="mark"?Xg(n,e):{}}function QO(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 eT(n){const e=QO(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,l)=>l!==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 tT(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const l=[];if(i.ranges.length)i.forEach((u,f)=>{l.push({from:u,to:f})});else{const{from:u,to:f}=t[o];if(u===void 0||f===void 0)return;l.push({from:u,to:f})}l.forEach(({from:u,to:f})=>{const d=e.slice(o).map(u,-1),g=e.slice(o).map(f),p=e.invert().map(d,-1),_=e.invert().map(g);r.push({oldRange:{from:p,to:_},newRange:{from:d,to:g}})})}),eT(r)}function Zg(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),l=Vc(o,i.type);l&&r.push({mark:i,...l})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(l=>({from:o,to:o+i.nodeSize,mark:l})))}),r}function Oa(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 nT(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?cn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>Ca(p.attrs,t,{strict:!1}));let l=0;const u=[];if(i.forEach(({$from:p,$to:_})=>{const S=p.pos,k=_.pos;n.doc.nodesBetween(S,k,(m,b)=>{if(!m.isText&&!m.marks.length)return;const x=Math.max(S,b),A=Math.min(k,b+m.nodeSize),O=A-x;l+=O,u.push(...m.marks.map(R=>({mark:R,from:x,to:A})))})}),l===0)return!1;const f=u.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>Ca(p.mark.attrs,t,{strict:!1})).reduce((p,_)=>p+_.to-_.from,0),d=u.filter(p=>o?p.mark.type!==o&&p.mark.type.excludes(o):!0).reduce((p,_)=>p+_.to-_.from,0);return(f>0?f+d:f)>=l}function Qg(n,e){const{nodeExtensions:t}=Ea(e),r=t.find(l=>l.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=le(G(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function rT(n,e,t){var r;const{selection:i}=e;let o=null;if(Gg(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:l}=i;return l.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,(g,p,_)=>{if(d)return!1;if(g.isInline){const S=!_||_.type.allowsMarkType(t),k=!!t.isInSet(g.marks)||!g.marks.some(m=>m.type.excludes(t));d=S&&k}return!d}),d})}const iT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:l,ranges:u}=o,f=cn(n,r.schema);if(i)if(l){const d=Xg(r,f);t.addStoredMark(f.create({...d,...e}))}else u.forEach(d=>{const g=d.$from.pos,p=d.$to.pos;r.doc.nodesBetween(g,p,(_,S)=>{const k=Math.max(S,g),m=Math.min(S+_.nodeSize,p);_.marks.find(x=>x.type===f)?_.marks.forEach(x=>{f===x.type&&t.addMark(k,m,f.create({...x.attrs,...e}))}):t.addMark(k,m,f.create(e))})});return rT(r,t,f)},sT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),oT=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=ze(n,t.schema);return o.isTextblock?i().command(({commands:l})=>$g(o,e)(t)?!0:l.clearNodes()).command(({state:l})=>$g(o,e)(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},aT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Lr(n,0,r.content.size),o=ee.create(r,i);e.setSelection(o)}return!0},lT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,l=me.atStart(r).from,u=me.atEnd(r).to,f=Lr(i,l,u),d=Lr(o,l,u),g=me.create(r,f,d);e.setSelection(g)}return!0},uT=n=>({state:e,dispatch:t})=>{const r=ze(n,e.schema);return $A(r)(e,t)};function e0(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 cT=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:l}=e,{$from:u,$to:f}=o,d=i.extensionManager.attributes,g=Oa(d,u.node().type.name,u.node().attrs);if(o instanceof ee&&o.node.isBlock)return!u.parentOffset||!vi(l,u.pos)?!1:(r&&(n&&e0(t,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const p=f.parentOffset===f.parent.content.size;o instanceof me&&e.deleteSelection();const _=u.depth===0?void 0:GO(u.node(-1).contentMatchAt(u.indexAfter(-1)));let S=p&&_?[{type:_,attrs:g}]:void 0,k=vi(e.doc,e.mapping.map(u.pos),1,S);if(!S&&!k&&vi(e.doc,e.mapping.map(u.pos),1,_?[{type:_}]:void 0)&&(k=!0,S=_?[{type:_,attrs:g}]:void 0),k&&(e.split(e.mapping.map(u.pos),1,S),_&&!p&&!u.parentOffset&&u.parent.type!==_)){const m=e.mapping.map(u.before()),b=e.doc.resolve(m);u.node(-1).canReplaceWith(b.index(),b.index()+1,_)&&e.setNodeMarkup(e.mapping.map(u.before()),_)}n&&e0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},fT=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const l=ze(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 g=u.node(-1);if(g.type!==l)return!1;const p=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let b=B.empty;const x=u.index(-1)?1:u.index(-2)?2:3;for(let U=u.depth-x;U>=u.depth-3;U-=1)b=B.from(u.node(U).copy(b));const A=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,O=Oa(p,u.node().type.name,u.node().attrs),R=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(O))||void 0;b=b.append(B.from(l.createAndFill(null,R)||void 0));const W=u.before(u.depth-(x-1));e.replace(W,u.after(-A),new K(b,4-x,0));let D=-1;e.doc.nodesBetween(W,e.doc.content.size,(U,Q)=>{if(D>-1)return!1;U.isTextblock&&U.content.size===0&&(D=Q+1)}),D>-1&&e.setSelection(me.near(e.doc.resolve(D))),e.scrollIntoView()}return!0}const _=f.pos===u.end()?g.contentMatchAt(0).defaultType:null,S=Oa(p,g.type.name,g.attrs),k=Oa(p,u.node().type.name,u.node().attrs);e.delete(u.pos,f.pos);const m=_?[{type:l,attrs:S},{type:_,attrs:k}]:[{type:l,attrs:S}];if(!vi(e.doc,u.pos,2))return!1;if(r){const{selection:b,storedMarks:x}=t,{splittableMarks:A}=i.extensionManager,O=x||b.$to.parentOffset&&b.$from.marks();if(e.split(u.pos,2,m).scrollIntoView(),!O||!r)return!0;const R=O.filter(W=>A.includes(W.type.name));e.ensureMarks(R)}return!0},Gc=(n,e)=>{const t=Kc(l=>l.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&&Zn(n.doc,t.pos)&&n.join(t.pos),!0},jc=(n,e)=>{const t=Kc(l=>l.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&&Zn(n.doc,r)&&n.join(r),!0},hT=(n,e,t,r={})=>({editor:i,tr:o,state:l,dispatch:u,chain:f,commands:d,can:g})=>{const{extensions:p,splittableMarks:_}=i.extensionManager,S=ze(n,l.schema),k=ze(e,l.schema),{selection:m,storedMarks:b}=l,{$from:x,$to:A}=m,O=x.blockRange(A),R=b||m.$to.parentOffset&&m.$from.marks();if(!O)return!1;const W=Kc(D=>Qg(D.type.name,p))(m);if(O.depth>=1&&W&&O.depth-W.depth<=1){if(W.node.type===S)return d.liftListItem(k);if(Qg(W.node.type.name,p)&&S.validContent(W.node.content)&&u)return f().command(()=>(o.setNodeMarkup(W.pos,S),!0)).command(()=>Gc(o,S)).command(()=>jc(o,S)).run()}return!t||!R||!u?f().command(()=>g().wrapInList(S,r)?!0:d.clearNodes()).wrapInList(S,r).command(()=>Gc(o,S)).command(()=>jc(o,S)).run():f().command(()=>{const D=g().wrapInList(S,r),U=R.filter(Q=>_.includes(Q.type.name));return o.ensureMarks(U),D?!0:d.clearNodes()}).wrapInList(S,r).command(()=>Gc(o,S)).command(()=>jc(o,S)).run()},dT=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,l=cn(n,r.schema);return nT(r,l,e)?i.unsetMark(l,{extendEmptyMarkRange:o}):i.setMark(l,e)},pT=(n,e,t={})=>({state:r,commands:i})=>{const o=ze(n,r.schema),l=ze(e,r.schema);return Uc(r,o,t)?i.setNode(l):i.setNode(o,t)},mT=(n,e={})=>({state:t,commands:r})=>{const i=ze(n,t.schema);return Uc(t,i,e)?r.lift(i):r.wrapIn(i,e)},gT=()=>({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 l=n.tr,u=o.transform;for(let f=u.steps.length-1;f>=0;f-=1)l.step(u.steps[f].invert(u.docs[f]));if(o.text){const f=l.doc.resolve(o.from).marks();l.replaceWith(o.from,o.to,n.schema.text(o.text,f))}else l.delete(o.from,o.to)}return!0}}return!1},yT=()=>({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},bT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:l=!1}=e,{selection:u}=t,f=cn(n,r.schema),{$from:d,empty:g,ranges:p}=u;if(!i)return!0;if(g&&l){let{from:_,to:S}=u;const k=(o=d.marks().find(b=>b.type===f))===null||o===void 0?void 0:o.attrs,m=Vc(d,f,k);m&&(_=m.from,S=m.to),t.removeMark(_,S,f)}else p.forEach(_=>{t.removeMark(_.$from.pos,_.$to.pos,f)});return t.removeStoredMark(f),!0},_T=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,l=null;const u=qc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=ze(n,r.schema)),u==="mark"&&(l=cn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const d=f.$from.pos,g=f.$to.pos;r.doc.nodesBetween(d,g,(p,_)=>{o&&o===p.type&&t.setNodeMarkup(_,void 0,{...p.attrs,...e}),l&&p.marks.length&&p.marks.forEach(S=>{if(l===S.type){const k=Math.max(_,d),m=Math.min(_+p.nodeSize,g);t.addMark(k,m,l.create({...S.attrs,...e}))}})})}),!0):!1},vT=(n,e={})=>({state:t,dispatch:r})=>{const i=ze(n,t.schema);return LA(i,e)(t,r)},wT=(n,e={})=>({state:t,dispatch:r})=>{const i=ze(n,t.schema);return PA(i,e)(t,r)};var ST=Object.freeze({__proto__:null,blur:nO,clearContent:rO,clearNodes:iO,command:sO,createParagraphNear:oO,cut:aO,deleteCurrentNode:lO,deleteNode:uO,deleteRange:cO,deleteSelection:fO,enter:hO,exitCode:dO,extendMarkRange:mO,first:gO,focus:bO,forEach:_O,insertContent:vO,insertContentAt:xO,joinUp:EO,joinDown:kO,joinBackward:CO,joinForward:AO,joinItemBackward:OO,joinItemForward:TO,keyboardShortcut:IO,lift:NO,liftEmptyBlock:RO,liftListItem:LO,newlineInCode:PO,resetAttributes:DO,scrollIntoView:FO,selectAll:BO,selectNodeBackward:HO,selectNodeForward:$O,selectParentNode:zO,selectTextblockEnd:VO,selectTextblockStart:WO,setContent:qO,setMark:iT,setMeta:sT,setNode:oT,setNodeSelection:aT,setTextSelection:lT,sinkListItem:uT,splitBlock:cT,splitListItem:fT,toggleList:hT,toggleMark:dT,toggleNode:pT,toggleWrap:mT,undoInputRule:gT,unsetAllMarks:yT,unsetMark:bT,updateAttributes:_T,wrapIn:vT,wrapInList:wT});Pe.create({name:"commands",addCommands(){return{...ST}}}),Pe.create({name:"editable",addProseMirrorPlugins(){return[new Ct({key:new Zt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Pe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Ct({key:new Zt("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}}}})]}}),Pe.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:l})=>[()=>l.undoInputRule(),()=>l.command(({tr:u})=>{const{selection:f,doc:d}=u,{empty:g,$anchor:p}=f,{pos:_,parent:S}=p,k=p.parent.isTextblock?u.doc.resolve(_-1):p,m=k.parent.type.spec.isolating,b=p.pos-p.parentOffset,x=m&&k.parent.childCount===1?b===p.pos:pe.atStart(d).from===_;return!g||!x||!S.type.isTextblock||S.textContent.length?!1:l.clearNodes()}),()=>l.deleteSelection(),()=>l.joinBackward(),()=>l.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:l})=>[()=>l.deleteSelection(),()=>l.deleteCurrentNode(),()=>l.joinForward(),()=>l.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:l})=>[()=>l.newlineInCode(),()=>l.createParagraphNear(),()=>l.liftEmptyBlock(),()=>l.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 Wc()||Jg()?o:i},addProseMirrorPlugins(){return[new Ct({key:new Zt("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(k=>k.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:l}=e.selection,u=pe.atStart(e.doc).from,f=pe.atEnd(e.doc).to;if(i||!(o===u&&l===f)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const p=t.tr,_=xa({state:t,transaction:p}),{commands:S}=new Pc({editor:this.editor,state:_});if(S.clearNodes(),!!p.steps.length)return p}})]}}),Pe.create({name:"tabindex",addProseMirrorPlugins(){return[new Ct({key:new Zt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function xT(n){return new Kg({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=le(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 ET(n){return new Kg({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=le(n.getAttributes,void 0,r)||{},l=e.tr.delete(t.from,t.to),f=l.doc.resolve(t.from).blockRange(),d=f&&fc(f,n.type,o);if(!d)return null;if(l.wrap(f,d),n.keepMarks&&n.editor){const{selection:p,storedMarks:_}=e,{splittableMarks:S}=n.editor.extensionManager,k=_||p.$to.parentOffset&&p.$from.marks();if(k){const m=k.filter(b=>S.includes(b.type.name));l.ensureMarks(m)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,o).run()}const g=l.doc.resolve(t.from-1).nodeBefore;g&&g.type===n.type&&Zn(l.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,g))&&l.join(t.from-1)}})}class Ot{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=le(G(this,"addOptions",{name:this.name}))),this.storage=le(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ot(e)}configure(e={}){const t=this.extend();return t.options=ka(this.options,e),t.storage=le(G(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ot(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=le(G(t,"addOptions",{name:t.name})),t.storage=le(G(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 l=i.marks();if(!!!l.find(d=>d?.type.name===t.name))return!1;const f=l.find(d=>d?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Dn{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=le(G(this,"addOptions",{name:this.name}))),this.storage=le(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Dn(e)}configure(e={}){const t=this.extend();return t.options=ka(this.options,e),t.storage=le(G(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Dn(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=le(G(t,"addOptions",{name:t.name})),t.storage=le(G(t,"addStorage",{name:t.name,options:t.options})),t}}function kT(n){return new jA({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=le(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:l}=e,u=r[r.length-1],f=r[0];let d=t.to;if(u){const g=f.search(/\S/),p=t.from+f.indexOf(u),_=p+u.length;if(Zg(t.from,t.to,e.doc).filter(k=>k.mark.type.excluded.find(b=>b===n.type&&b!==k.mark.type)).filter(k=>k.to>p).length)return null;_<t.to&&l.delete(_,t.to),p>t.from&&l.delete(t.from+g,p),d=t.from+g+u.length,l.addMark(t.from+g,d,n.type.create(o||{})),l.removeStoredMark(n.type)}}})}const CT=Dn.create({name:"text",group:"inline"});var Ta=200,Je=function(){};Je.prototype.append=function(e){return e.length?(e=Je.from(e),!this.length&&e||e.length<Ta&&this.leafAppend(e)||this.length<Ta&&e.leafPrepend(this)||this.appendInner(e)):this},Je.prototype.prepend=function(e){return e.length?Je.from(e).append(this):this},Je.prototype.appendInner=function(e){return new AT(this,e)},Je.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Je.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Je.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Je.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)},Je.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,l){return i.push(e(o,l))},t,r),i},Je.from=function(e){return e instanceof Je?e:e&&e.length?new t0(e):Je.empty};var t0=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,l,u){for(var f=o;f<l;f++)if(i(this.values[f],u+f)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,l,u){for(var f=o-1;f>=l;f--)if(i(this.values[f],u+f)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ta)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ta)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}(Je);Je.empty=new t0([]);var AT=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,l){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),l)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,l){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,l+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,l)===!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}(Je),n0=Je;const OT=500;class nn{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 l=e.tr,u,f,d=[],g=[];return this.items.forEach((p,_)=>{if(!p.step){i||(i=this.remapping(r,_+1),o=i.maps.length),o--,g.push(p);return}if(i){g.push(new mn(p.map));let S=p.step.map(i.slice(o)),k;S&&l.maybeStep(S).doc&&(k=l.mapping.maps[l.mapping.maps.length-1],d.push(new mn(k,void 0,void 0,d.length+g.length))),o--,k&&i.appendMap(k,o)}else l.maybeStep(p.step);if(p.selection)return u=i?p.selection.map(i.slice(o)):p.selection,f=new nn(this.items.slice(0,r).append(g.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:l,selection:u}}addTransform(e,t,r,i){let o=[],l=this.eventCount,u=this.items,f=!i&&u.length?u.get(u.length-1):null;for(let g=0;g<e.steps.length;g++){let p=e.steps[g].invert(e.docs[g]),_=new mn(e.mapping.maps[g],p,t),S;(S=f&&f.merge(_))&&(_=S,g?o.pop():u=u.slice(0,u.length-1)),o.push(_),t&&(l++,t=void 0),i||(f=_)}let d=l-r.depth;return d>MT&&(u=TT(u,d),l-=d),new nn(u.append(o),l)}remapping(e,t){let r=new Bi;return this.items.forEach((i,o)=>{let l=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,l)},e,t),r}addMaps(e){return this.eventCount==0?this:new nn(this.items.append(e.map(t=>new mn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,l=e.steps.length,u=this.eventCount;this.items.forEach(_=>{_.selection&&u--},i);let f=t;this.items.forEach(_=>{let S=o.getMirror(--f);if(S==null)return;l=Math.min(l,S);let k=o.maps[S];if(_.step){let m=e.steps[S].invert(e.docs[S]),b=_.selection&&_.selection.map(o.slice(f+1,S));b&&u++,r.push(new mn(k,m,b))}else r.push(new mn(k))},i);let d=[];for(let _=t;_<l;_++)d.push(new mn(o.maps[_]));let g=this.items.slice(0,i).append(d).append(r),p=new nn(g,u);return p.emptyItemCount()>OT&&(p=p.compress(this.items.length-r.length)),p}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((l,u)=>{if(u>=e)i.push(l),l.selection&&o++;else if(l.step){let f=l.step.map(t.slice(r)),d=f&&f.getMap();if(r--,d&&t.appendMap(d,r),f){let g=l.selection&&l.selection.map(t.slice(r));g&&o++;let p=new mn(d.invert(),f,g),_,S=i.length-1;(_=i.length&&i[S].merge(p))?i[S]=_:i.push(p)}}else l.map&&r--},this.items.length,0),new nn(n0.from(i.reverse()),o)}}nn.empty=new nn(n0.empty,0);function TT(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class mn{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 mn(t.getMap().invert(),t,this.selection)}}}class rr{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const MT=20;function IT(n,e,t,r){let i=t.getMeta(ir),o;if(i)return i.historyState;t.getMeta(RT)&&(n=new rr(n.done,n.undone,null,0));let l=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(l&&l.getMeta(ir))return l.getMeta(ir).redo?new rr(n.done.addTransform(t,void 0,r,Ma(e)),n.undone,r0(t.mapping.maps[t.steps.length-1]),n.prevTime):new rr(n.done,n.undone.addTransform(t,void 0,r,Ma(e)),null,n.prevTime);if(t.getMeta("addToHistory")!==!1&&!(l&&l.getMeta("addToHistory")===!1)){let u=n.prevTime==0||!l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!NT(t,n.prevRanges)),f=l?Jc(n.prevRanges,t.mapping):r0(t.mapping.maps[t.steps.length-1]);return new rr(n.done.addTransform(t,u?e.selection.getBookmark():void 0,r,Ma(e)),nn.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new rr(n.done.rebased(t,o),n.undone.rebased(t,o),Jc(n.prevRanges,t.mapping),n.prevTime):new rr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Jc(n.prevRanges,t.mapping),n.prevTime)}function NT(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 r0(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function Jc(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 i0(n,e,t,r){let i=Ma(e),o=ir.get(e).spec.config,l=(r?n.undone:n.done).popEvent(e,i);if(!l)return;let u=l.selection.resolve(l.transform.doc),f=(r?n.done:n.undone).addTransform(l.transform,e.selection.getBookmark(),o,i),d=new rr(r?f:l.remaining,r?l.remaining:f,null,0);t(l.transform.setSelection(u).setMeta(ir,{redo:r,historyState:d}).scrollIntoView())}let Yc=!1,s0=null;function Ma(n){let e=n.plugins;if(s0!=e){Yc=!1,s0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Yc=!0;break}}return Yc}const ir=new Zt("history"),RT=new Zt("closeHistory");function LT(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Ct({key:ir,state:{init(){return new rr(nn.empty,nn.empty,null,0)},apply(e,t,r){return IT(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?o0:r=="historyRedo"?a0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const o0=(n,e)=>{let t=ir.getState(n);return!t||t.done.eventCount==0?!1:(e&&i0(t,n,e,!1),!0)},a0=(n,e)=>{let t=ir.getState(n);return!t||t.undone.eventCount==0?!1:(e&&i0(t,n,e,!0),!0)},PT=Pe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>o0(n,e),redo:()=>({state:n,dispatch:e})=>a0(n,e)}},addProseMirrorPlugins(){return[LT(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()}}}),Xc=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),Zc=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),sr=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),ie=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),$t=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]}}),he=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]}}),en=Object.freeze({SETTINGS:"settings",ALL:"_"}),l0=Object.freeze({BLANK:"_blank",SELF:"_self"}),Ts=Object.freeze({URL:"url",BLOCK:"block"});class Qc{static create(e,t){const r=new this(e,t||{});return new Ct({key:new Zt(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 DT extends Qc{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=nl.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,l,u)=>{u.type.name===ie.DOCUMENT&&(r=Math.min(r,l+1),i=Math.max(i,l+o.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class FT extends Qc{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=bn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),Ue.create(e,t)}}const BT="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",HT="\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",Ti=(n,e)=>{for(const t in e)n[t]=e[t];return n},ef="numeric",tf="ascii",nf="alpha",Ia="asciinumeric",Na="alphanumeric",rf="domain",u0="emoji",$T="scheme",zT="slashscheme",c0="whitespace";function VT(n,e){return n in e||(e[n]=[]),e[n]}function Pr(n,e,t){e[ef]&&(e[Ia]=!0,e[Na]=!0),e[tf]&&(e[Ia]=!0,e[nf]=!0),e[Ia]&&(e[Na]=!0),e[nf]&&(e[Na]=!0),e[Na]&&(e[rf]=!0),e[u0]&&(e[rf]=!0);for(const r in e){const i=VT(r,t);i.indexOf(n)<0&&i.push(n)}}function WT(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function yt(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}yt.groups={},yt.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||yt.groups;let i;return e&&e.j?i=e:(i=new yt(e),t&&r&&Pr(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 l=0;l<o-1;l++)i=i.tt(n[l]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||yt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let l,u=i.go(n);if(u?(l=new yt,Ti(l.j,u.j),l.jr.push.apply(l.jr,u.jr),l.jd=u.jd,l.t=u.t):l=new yt,o){if(r)if(l.t&&typeof l.t=="string"){const f=Ti(WT(l.t,r),t);Pr(o,f,r)}else t&&Pr(o,t,r);l.t=o}return i.j[n]=l,l}};const J=(n,e,t,r,i)=>n.ta(e,t,r,i),zt=(n,e,t,r,i)=>n.tr(e,t,r,i),f0=(n,e,t,r,i)=>n.ts(e,t,r,i),$=(n,e,t,r,i)=>n.tt(e,t,r,i),Pn="WORD",sf="UWORD",Ms="LOCALHOST",of="TLD",af="UTLD",Ra="SCHEME",Mi="SLASH_SCHEME",lf="NUM",h0="WS",uf="NL",Ii="OPENBRACE",Is="OPENBRACKET",Ns="OPENANGLEBRACKET",Rs="OPENPAREN",Dr="CLOSEBRACE",Ni="CLOSEBRACKET",Ri="CLOSEANGLEBRACKET",Fr="CLOSEPAREN",La="AMPERSAND",Pa="APOSTROPHE",Da="ASTERISK",or="AT",Fa="BACKSLASH",Ba="BACKTICK",Ha="CARET",ar="COLON",cf="COMMA",$a="DOLLAR",fn="DOT",za="EQUALS",ff="EXCLAMATION",hn="HYPHEN",Va="PERCENT",Wa="PIPE",Ua="PLUS",qa="POUND",Ka="QUERY",hf="QUOTE",df="SEMI",dn="SLASH",Ls="TILDE",Ga="UNDERSCORE",d0="EMOJI",ja="SYM";var p0=Object.freeze({__proto__:null,WORD:Pn,UWORD:sf,LOCALHOST:Ms,TLD:of,UTLD:af,SCHEME:Ra,SLASH_SCHEME:Mi,NUM:lf,WS:h0,NL:uf,OPENBRACE:Ii,OPENBRACKET:Is,OPENANGLEBRACKET:Ns,OPENPAREN:Rs,CLOSEBRACE:Dr,CLOSEBRACKET:Ni,CLOSEANGLEBRACKET:Ri,CLOSEPAREN:Fr,AMPERSAND:La,APOSTROPHE:Pa,ASTERISK:Da,AT:or,BACKSLASH:Fa,BACKTICK:Ba,CARET:Ha,COLON:ar,COMMA:cf,DOLLAR:$a,DOT:fn,EQUALS:za,EXCLAMATION:ff,HYPHEN:hn,PERCENT:Va,PIPE:Wa,PLUS:Ua,POUND:qa,QUERY:Ka,QUOTE:hf,SEMI:df,SLASH:dn,TILDE:Ls,UNDERSCORE:Ga,EMOJI:d0,SYM:ja});const Li=/[a-z]/,pf=/\p{L}/u,mf=/\p{Emoji}/u,gf=/\d/,m0=/\s/,g0=`
|
|
37
|
-
`,
|
|
36
|
+
`,textSerializers:a={}}=t||{};let u="",f=!0;return n.nodesBetween(r,i,(h,m,p,b)=>{var S;const C=a?.[h.type.name];C?(h.isBlock&&!f&&(u+=o,f=!0),p&&(u+=C({node:h,pos:m,parent:p,index:b,range:e}))):h.isText?(u+=(S=h?.text)===null||S===void 0?void 0:S.slice(Math.max(r,m)-m,i-m),f=!1):h.isBlock&&!f&&(u+=o,f=!0)}),u}function EA(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}De.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Rt({key:new fn("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(m=>m.$from.pos)),u=Math.max(...o.map(m=>m.$to.pos)),f=EA(t);return CA(r,{from:a,to:u},{textSerializers:f})}}})]}});const kA=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),AA=(n=!1)=>({commands:e})=>e.setContent("",n),MA=()=>({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:h,mapping:m}=e,p=h.resolve(m.map(f)),b=h.resolve(m.map(f+u.nodeSize)),S=p.blockRange(b);if(!S)return;const C=Mi(S);if(u.type.isTextblock){const{defaultType:g}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(S.start,g)}(C||C===0)&&e.lift(S,C)})}),!0},TA=n=>e=>n(e),OA=()=>({state:n,dispatch:e})=>Zk(n,e),IA=(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 ye(r.doc.resolve(a-1))),!0},NA=()=>({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},RA=n=>({tr:e,state:t,dispatch:r})=>{const i=Je(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),h=o.after(a);e.delete(f,h).scrollIntoView()}return!0}return!1},LA=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},PA=()=>({state:n,dispatch:e})=>$k(n,e),DA=()=>({commands:n})=>n.keyboardShortcut("Enter"),FA=()=>({state:n,dispatch:e})=>Xk(n,e);function za(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:lf(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function ff(n,e,t={}){return n.find(r=>r.type===e&&za(r.attrs,t))}function zA(n,e,t={}){return!!ff(n,e,t)}function hf(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=ff([...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(ff([...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&&zA([...n.parent.child(u).marks],e,t);)f+=n.parent.child(u).nodeSize,u+=1;return{from:a,to:f}}function wn(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 BA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=wn(n,r.schema),{doc:a,selection:u}=t,{$from:f,from:h,to:m}=u;if(i){const p=hf(f,o,e);if(p&&p.from<=h&&p.to>=m){const b=ye.create(a,p.from,p.to);t.setSelection(b)}}return!0},$A=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 k0(n){return n instanceof ye}function Jr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function HA(n,e=null){if(!e)return null;const t=ge.atStart(n),r=ge.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?ye.create(n,Jr(0,i,o),Jr(n.content.size,i,o)):ye.create(n,Jr(e,i,o),Jr(e,i,o))}function df(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const WA=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{df()&&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&&!k0(t.state.selection))return a(),!0;const u=HA(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},VA=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),UA=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function A0(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function Ba(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?z.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),Ba("",e,t)}if(typeof n=="string"){const r=Mc.fromSchema(e);return t.slice?r.parseSlice(A0(n),t.parseOptions).content:r.parse(A0(n),t.parseOptions)}return Ba("",e,t)}function qA(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof ut||i instanceof Xe))return;const o=n.mapping.maps[r];let a=0;o.forEach((u,f,h,m)=>{a===0&&(a=m)}),n.setSelection(ge.near(n.doc.resolve(a),t))}const KA=n=>n.toString().startsWith("<"),GA=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=Ba(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},h=!0,m=!0;if((KA(a)?a:[a]).forEach(b=>{b.check(),h=h?b.isText&&b.marks.length===0:!1,m=m?b.isBlock:!1}),u===f&&m){const{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,f+=1)}h?Array.isArray(e)?r.insertText(e.map(b=>b.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&&qA(r,r.steps.length-1,-1)}return!0},JA=()=>({state:n,dispatch:e})=>Gk(n,e),jA=()=>({state:n,dispatch:e})=>Jk(n,e),YA=()=>({state:n,dispatch:e})=>Wk(n,e),XA=()=>({state:n,dispatch:e})=>qk(n,e),ZA=()=>({tr:n,state:e,dispatch:t})=>{try{const r=ka(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},QA=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ka(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function M0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function eM(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))df()||M0()?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 tM=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=eM(n).split(/-(?!$)/),a=o.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),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",h=>h(t,u))});return f?.steps.forEach(h=>{const m=h.map(r.mapping);m&&i&&r.maybeStep(m)}),!0};function pf(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?Je(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(p,b)=>{if(p.isText)return;const S=Math.max(r,b),C=Math.min(i,b+p.nodeSize);u.push({node:p,from:S,to:C})});const f=i-r,h=u.filter(p=>a?a.name===p.node.type.name:!0).filter(p=>za(p.node.attrs,t,{strict:!1}));return o?!!h.length:h.reduce((p,b)=>p+b.to-b.from,0)>=f}const nM=(n,e={})=>({state:t,dispatch:r})=>{const i=Je(n,t.schema);return pf(t,i,e)?jk(t,r):!1},rM=()=>({state:n,dispatch:e})=>Qk(n,e),iM=n=>({state:e,dispatch:t})=>{const r=Je(n,e.schema);return aA(r)(e,t)},sM=()=>({state:n,dispatch:e})=>Yk(n,e);function mf(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function T0(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 oM=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=mf(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=Je(n,r.schema)),u==="mark"&&(a=wn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(h,m)=>{o&&o===h.type&&t.setNodeMarkup(m,void 0,T0(h.attrs,e)),a&&h.marks.length&&h.marks.forEach(p=>{a===p.type&&t.addMark(m,m+h.nodeSize,a.create(T0(p.attrs,e)))})})}),!0):!1},aM=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),lM=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),uM=()=>({state:n,dispatch:e})=>Vk(n,e),cM=()=>({state:n,dispatch:e})=>Kk(n,e),fM=()=>({state:n,dispatch:e})=>eA(n,e),hM=()=>({state:n,dispatch:e})=>rA(n,e),dM=()=>({state:n,dispatch:e})=>nA(n,e);function pM(n,e,t={}){return Ba(n,e,{slice:!1,parseOptions:t})}const mM=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=pM(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!e),!0};function O0(n,e){const t=wn(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 gM(n,e){const t=new GE(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function yM(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 bM(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function _M(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 gf(n){return e=>_M(e.$from,n)}function vM(n,e){const t=Gi.resolve(n);return x0(t,e)}function wM(n,e){const t=Je(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 SM(n,e){const t=mf(typeof e=="string"?e:e.name,n.schema);return t==="node"?wM(n,e):t==="mark"?O0(n,e):{}}function xM(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 CM(n){const e=xM(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 EM(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 h=e.slice(o).map(u,-1),m=e.slice(o).map(f),p=e.invert().map(h,-1),b=e.invert().map(m);r.push({oldRange:{from:p,to:b},newRange:{from:h,to:m}})})}),CM(r)}function I0(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=hf(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 $a(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 kM(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?wn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>za(p.attrs,t,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:p,$to:b})=>{const S=p.pos,C=b.pos;n.doc.nodesBetween(S,C,(g,_)=>{if(!g.isText&&!g.marks.length)return;const x=Math.max(S,_),k=Math.min(C,_+g.nodeSize),A=k-x;a+=A,u.push(...g.marks.map(N=>({mark:N,from:x,to:k})))})}),a===0)return!1;const f=u.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>za(p.mark.attrs,t,{strict:!1})).reduce((p,b)=>p+b.to-b.from,0),h=u.filter(p=>o?p.mark.type!==o&&p.mark.type.excludes(o):!0).reduce((p,b)=>p+b.to-b.from,0);return(f>0?f+h:f)>=a}function N0(n,e){const{nodeExtensions:t}=Da(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ue(G(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function AM(n,e,t){var r;const{selection:i}=e;let o=null;if(k0(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 h=u.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(u.pos,f.pos,(m,p,b)=>{if(h)return!1;if(m.isInline){const S=!b||b.type.allowsMarkType(t),C=!!t.isInSet(m.marks)||!m.marks.some(g=>g.type.excludes(t));h=S&&C}return!h}),h})}const MM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:u}=o,f=wn(n,r.schema);if(i)if(a){const h=O0(r,f);t.addStoredMark(f.create({...h,...e}))}else u.forEach(h=>{const m=h.$from.pos,p=h.$to.pos;r.doc.nodesBetween(m,p,(b,S)=>{const C=Math.max(S,m),g=Math.min(S+b.nodeSize,p);b.marks.find(x=>x.type===f)?b.marks.forEach(x=>{f===x.type&&t.addMark(C,g,f.create({...x.attrs,...e}))}):t.addMark(C,g,f.create(e))})});return AM(r,t,f)},TM=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),OM=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=Je(n,t.schema);return o.isTextblock?i().command(({commands:a})=>_0(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>_0(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},IM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Jr(n,0,r.content.size),o=ee.create(r,i);e.setSelection(o)}return!0},NM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=ye.atStart(r).from,u=ye.atEnd(r).to,f=Jr(i,a,u),h=Jr(o,a,u),m=ye.create(r,f,h);e.setSelection(m)}return!0},RM=n=>({state:e,dispatch:t})=>{const r=Je(n,e.schema);return cA(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 LM=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:u,$to:f}=o,h=i.extensionManager.attributes,m=$a(h,u.node().type.name,u.node().attrs);if(o instanceof ee&&o.node.isBlock)return!u.parentOffset||!Ti(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 p=f.parentOffset===f.parent.content.size;o instanceof ye&&e.deleteSelection();const b=u.depth===0?void 0:yM(u.node(-1).contentMatchAt(u.indexAfter(-1)));let S=p&&b?[{type:b,attrs:m}]:void 0,C=Ti(e.doc,e.mapping.map(u.pos),1,S);if(!S&&!C&&Ti(e.doc,e.mapping.map(u.pos),1,b?[{type:b}]:void 0)&&(C=!0,S=b?[{type:b,attrs:m}]:void 0),C&&(e.split(e.mapping.map(u.pos),1,S),b&&!p&&!u.parentOffset&&u.parent.type!==b)){const g=e.mapping.map(u.before()),_=e.doc.resolve(g);u.node(-1).canReplaceWith(_.index(),_.index()+1,b)&&e.setNodeMarkup(e.mapping.map(u.before()),b)}n&&R0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},PM=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=Je(n,t.schema),{$from:u,$to:f}=t.selection,h=t.selection.node;if(h&&h.isBlock||u.depth<2||!u.sameParent(f))return!1;const m=u.node(-1);if(m.type!==a)return!1;const p=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 _=z.empty;const x=u.index(-1)?1:u.index(-2)?2:3;for(let U=u.depth-x;U>=u.depth-3;U-=1)_=z.from(u.node(U).copy(_));const k=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,A=$a(p,u.node().type.name,u.node().attrs),N=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(A))||void 0;_=_.append(z.from(a.createAndFill(null,N)||void 0));const W=u.before(u.depth-(x-1));e.replace(W,u.after(-k),new K(_,4-x,0));let L=-1;e.doc.nodesBetween(W,e.doc.content.size,(U,j)=>{if(L>-1)return!1;U.isTextblock&&U.content.size===0&&(L=j+1)}),L>-1&&e.setSelection(ye.near(e.doc.resolve(L))),e.scrollIntoView()}return!0}const b=f.pos===u.end()?m.contentMatchAt(0).defaultType:null,S=$a(p,m.type.name,m.attrs),C=$a(p,u.node().type.name,u.node().attrs);e.delete(u.pos,f.pos);const g=b?[{type:a,attrs:S},{type:b,attrs:C}]:[{type:a,attrs:S}];if(!Ti(e.doc,u.pos,2))return!1;if(r){const{selection:_,storedMarks:x}=t,{splittableMarks:k}=i.extensionManager,A=x||_.$to.parentOffset&&_.$from.marks();if(e.split(u.pos,2,g).scrollIntoView(),!A||!r)return!0;const N=A.filter(W=>k.includes(W.type.name));e.ensureMarks(N)}return!0},yf=(n,e)=>{const t=gf(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&&dr(n.doc,t.pos)&&n.join(t.pos),!0},bf=(n,e)=>{const t=gf(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&&dr(n.doc,r)&&n.join(r),!0},DM=(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:u,chain:f,commands:h,can:m})=>{const{extensions:p,splittableMarks:b}=i.extensionManager,S=Je(n,a.schema),C=Je(e,a.schema),{selection:g,storedMarks:_}=a,{$from:x,$to:k}=g,A=x.blockRange(k),N=_||g.$to.parentOffset&&g.$from.marks();if(!A)return!1;const W=gf(L=>N0(L.type.name,p))(g);if(A.depth>=1&&W&&A.depth-W.depth<=1){if(W.node.type===S)return h.liftListItem(C);if(N0(W.node.type.name,p)&&S.validContent(W.node.content)&&u)return f().command(()=>(o.setNodeMarkup(W.pos,S),!0)).command(()=>yf(o,S)).command(()=>bf(o,S)).run()}return!t||!N||!u?f().command(()=>m().wrapInList(S,r)?!0:h.clearNodes()).wrapInList(S,r).command(()=>yf(o,S)).command(()=>bf(o,S)).run():f().command(()=>{const L=m().wrapInList(S,r),U=N.filter(j=>b.includes(j.type.name));return o.ensureMarks(U),L?!0:h.clearNodes()}).wrapInList(S,r).command(()=>yf(o,S)).command(()=>bf(o,S)).run()},FM=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=wn(n,r.schema);return kM(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},zM=(n,e,t={})=>({state:r,commands:i})=>{const o=Je(n,r.schema),a=Je(e,r.schema);return pf(r,o,t)?i.setNode(a):i.setNode(o,t)},BM=(n,e={})=>({state:t,commands:r})=>{const i=Je(n,t.schema);return pf(t,i,e)?r.lift(i):r.wrapIn(i,e)},$M=()=>({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},HM=()=>({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},WM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=t,f=wn(n,r.schema),{$from:h,empty:m,ranges:p}=u;if(!i)return!0;if(m&&a){let{from:b,to:S}=u;const C=(o=h.marks().find(_=>_.type===f))===null||o===void 0?void 0:o.attrs,g=hf(h,f,C);g&&(b=g.from,S=g.to),t.removeMark(b,S,f)}else p.forEach(b=>{t.removeMark(b.$from.pos,b.$to.pos,f)});return t.removeStoredMark(f),!0},VM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=mf(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=Je(n,r.schema)),u==="mark"&&(a=wn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const h=f.$from.pos,m=f.$to.pos;r.doc.nodesBetween(h,m,(p,b)=>{o&&o===p.type&&t.setNodeMarkup(b,void 0,{...p.attrs,...e}),a&&p.marks.length&&p.marks.forEach(S=>{if(a===S.type){const C=Math.max(b,h),g=Math.min(b+p.nodeSize,m);t.addMark(C,g,a.create({...S.attrs,...e}))}})})}),!0):!1},UM=(n,e={})=>({state:t,dispatch:r})=>{const i=Je(n,t.schema);return iA(i,e)(t,r)},qM=(n,e={})=>({state:t,dispatch:r})=>{const i=Je(n,t.schema);return sA(i,e)(t,r)};var KM=Object.freeze({__proto__:null,blur:kA,clearContent:AA,clearNodes:MA,command:TA,createParagraphNear:OA,cut:IA,deleteCurrentNode:NA,deleteNode:RA,deleteRange:LA,deleteSelection:PA,enter:DA,exitCode:FA,extendMarkRange:BA,first:$A,focus:WA,forEach:VA,insertContent:UA,insertContentAt:GA,joinUp:JA,joinDown:jA,joinBackward:YA,joinForward:XA,joinItemBackward:ZA,joinItemForward:QA,keyboardShortcut:tM,lift:nM,liftEmptyBlock:rM,liftListItem:iM,newlineInCode:sM,resetAttributes:oM,scrollIntoView:aM,selectAll:lM,selectNodeBackward:uM,selectNodeForward:cM,selectParentNode:fM,selectTextblockEnd:hM,selectTextblockStart:dM,setContent:mM,setMark:MM,setMeta:TM,setNode:OM,setNodeSelection:IM,setTextSelection:NM,sinkListItem:RM,splitBlock:LM,splitListItem:PM,toggleList:DM,toggleMark:FM,toggleNode:zM,toggleWrap:BM,undoInputRule:$M,unsetAllMarks:HM,unsetMark:WM,updateAttributes:VM,wrapIn:UM,wrapInList:qM});De.create({name:"commands",addCommands(){return{...KM}}}),De.create({name:"editable",addProseMirrorPlugins(){return[new Rt({key:new fn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),De.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Rt({key:new fn("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}}}})]}}),De.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:f,doc:h}=u,{empty:m,$anchor:p}=f,{pos:b,parent:S}=p,C=p.parent.isTextblock?u.doc.resolve(b-1):p,g=C.parent.type.spec.isolating,_=p.pos-p.parentOffset,x=g&&C.parent.childCount===1?_===p.pos:ge.atStart(h).from===b;return!m||!x||!S.type.isTextblock||S.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 df()||M0()?o:i},addProseMirrorPlugins(){return[new Rt({key:new fn("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(C=>C.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,u=ge.atStart(e.doc).from,f=ge.atEnd(e.doc).to;if(i||!(o===u&&a===f)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const p=t.tr,b=Pa({state:t,transaction:p}),{commands:S}=new sf({editor:this.editor,state:b});if(S.clearNodes(),!!p.steps.length)return p}})]}}),De.create({name:"tabindex",addProseMirrorPlugins(){return[new Rt({key:new fn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function GM(n){return new E0({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=ue(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 JM(n){return new E0({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=ue(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),f=a.doc.resolve(t.from).blockRange(),h=f&&Lc(f,n.type,o);if(!h)return null;if(a.wrap(f,h),n.keepMarks&&n.editor){const{selection:p,storedMarks:b}=e,{splittableMarks:S}=n.editor.extensionManager,C=b||p.$to.parentOffset&&p.$from.marks();if(C){const g=C.filter(_=>S.includes(_.type.name));a.ensureMarks(g)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,o).run()}const m=a.doc.resolve(t.from-1).nodeBefore;m&&m.type===n.type&&dr(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&a.join(t.from-1)}})}class Pt{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=ue(G(this,"addOptions",{name:this.name}))),this.storage=ue(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Pt(e)}configure(e={}){const t=this.extend();return t.options=Fa(this.options,e),t.storage=ue(G(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Pt(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=ue(G(t,"addOptions",{name:t.name})),t.storage=ue(G(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(h=>h?.type.name===t.name))return!1;const f=a.find(h=>h?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Yn{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=ue(G(this,"addOptions",{name:this.name}))),this.storage=ue(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Yn(e)}configure(e={}){const t=this.extend();return t.options=Fa(this.options,e),t.storage=ue(G(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Yn(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=ue(G(t,"addOptions",{name:t.name})),t.storage=ue(G(t,"addStorage",{name:t.name,options:t.options})),t}}function jM(n){return new bA({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=ue(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 h=t.to;if(u){const m=f.search(/\S/),p=t.from+f.indexOf(u),b=p+u.length;if(I0(t.from,t.to,e.doc).filter(C=>C.mark.type.excluded.find(_=>_===n.type&&_!==C.mark.type)).filter(C=>C.to>p).length)return null;b<t.to&&a.delete(b,t.to),p>t.from&&a.delete(t.from+m,p),h=t.from+m+u.length,a.addMark(t.from+m,h,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}const YM=Yn.create({name:"text",group:"inline"});var Ha=200,rt=function(){};rt.prototype.append=function(e){return e.length?(e=rt.from(e),!this.length&&e||e.length<Ha&&this.leafAppend(e)||this.length<Ha&&e.leafPrepend(this)||this.appendInner(e)):this},rt.prototype.prepend=function(e){return e.length?rt.from(e).append(this):this},rt.prototype.appendInner=function(e){return new XM(this,e)},rt.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?rt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},rt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},rt.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)},rt.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},rt.from=function(e){return e instanceof rt?e:e&&e.length?new L0(e):rt.empty};var L0=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<=Ha)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ha)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}(rt);rt.empty=new L0([]);var XM=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}(rt),P0=rt;const ZM=500;class gn{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,h=[],m=[];return this.items.forEach((p,b)=>{if(!p.step){i||(i=this.remapping(r,b+1),o=i.maps.length),o--,m.push(p);return}if(i){m.push(new En(p.map));let S=p.step.map(i.slice(o)),C;S&&a.maybeStep(S).doc&&(C=a.mapping.maps[a.mapping.maps.length-1],h.push(new En(C,void 0,void 0,h.length+m.length))),o--,C&&i.appendMap(C,o)}else a.maybeStep(p.step);if(p.selection)return u=i?p.selection.map(i.slice(o)):p.selection,f=new gn(this.items.slice(0,r).append(m.reverse().concat(h)),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 m=0;m<e.steps.length;m++){let p=e.steps[m].invert(e.docs[m]),b=new En(e.mapping.maps[m],p,t),S;(S=f&&f.merge(b))&&(b=S,m?o.pop():u=u.slice(0,u.length-1)),o.push(b),t&&(a++,t=void 0),i||(f=b)}let h=a-r.depth;return h>eT&&(u=QM(u,h),a-=h),new gn(u.append(o),a)}remapping(e,t){let r=new Ji;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 gn(this.items.append(e.map(t=>new En(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(b=>{b.selection&&u--},i);let f=t;this.items.forEach(b=>{let S=o.getMirror(--f);if(S==null)return;a=Math.min(a,S);let C=o.maps[S];if(b.step){let g=e.steps[S].invert(e.docs[S]),_=b.selection&&b.selection.map(o.slice(f+1,S));_&&u++,r.push(new En(C,g,_))}else r.push(new En(C))},i);let h=[];for(let b=t;b<a;b++)h.push(new En(o.maps[b]));let m=this.items.slice(0,i).append(h).append(r),p=new gn(m,u);return p.emptyItemCount()>ZM&&(p=p.compress(this.items.length-r.length)),p}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)),h=f&&f.getMap();if(r--,h&&t.appendMap(h,r),f){let m=a.selection&&a.selection.map(t.slice(r));m&&o++;let p=new En(h.invert(),f,m),b,S=i.length-1;(b=i.length&&i[S].merge(p))?i[S]=b:i.push(p)}}else a.map&&r--},this.items.length,0),new gn(P0.from(i.reverse()),o)}}gn.empty=new gn(P0.empty,0);function QM(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class En{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 En(t.getMap().invert(),t,this.selection)}}}class br{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const eT=20;function tT(n,e,t,r){let i=t.getMeta(_r),o;if(i)return i.historyState;t.getMeta(rT)&&(n=new br(n.done,n.undone,null,0));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(_r))return a.getMeta(_r).redo?new br(n.done.addTransform(t,void 0,r,Wa(e)),n.undone,D0(t.mapping.maps[t.steps.length-1]),n.prevTime):new br(n.done,n.undone.addTransform(t,void 0,r,Wa(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||!nT(t,n.prevRanges)),f=a?_f(n.prevRanges,t.mapping):D0(t.mapping.maps[t.steps.length-1]);return new br(n.done.addTransform(t,u?e.selection.getBookmark():void 0,r,Wa(e)),gn.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new br(n.done.rebased(t,o),n.undone.rebased(t,o),_f(n.prevRanges,t.mapping),n.prevTime):new br(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),_f(n.prevRanges,t.mapping),n.prevTime)}function nT(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 D0(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function _f(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 F0(n,e,t,r){let i=Wa(e),o=_r.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),h=new br(r?f:a.remaining,r?a.remaining:f,null,0);t(a.transform.setSelection(u).setMeta(_r,{redo:r,historyState:h}).scrollIntoView())}let vf=!1,z0=null;function Wa(n){let e=n.plugins;if(z0!=e){vf=!1,z0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){vf=!0;break}}return vf}const _r=new fn("history"),rT=new fn("closeHistory");function iT(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Rt({key:_r,state:{init(){return new br(gn.empty,gn.empty,null,0)},apply(e,t,r){return tT(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?B0:r=="historyRedo"?$0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const B0=(n,e)=>{let t=_r.getState(n);return!t||t.done.eventCount==0?!1:(e&&F0(t,n,e,!1),!0)},$0=(n,e)=>{let t=_r.getState(n);return!t||t.undone.eventCount==0?!1:(e&&F0(t,n,e,!0),!0)},sT=De.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>B0(n,e),redo:()=>({state:n,dispatch:e})=>$0(n,e)}},addProseMirrorPlugins(){return[iT(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()}}}),wf=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),Sf=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),vr=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),ie=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Yt=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]}}),de=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]}}),dn=Object.freeze({SETTINGS:"settings",ALL:"_"}),H0=Object.freeze({BLANK:"_blank",SELF:"_self"}),Bs=Object.freeze({URL:"url",BLOCK:"block"});class xf{static create(e,t){const r=new this(e,t||{});return new Rt({key:new fn(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 oT extends xf{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=Cl.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===ie.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 aT extends xf{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=Mn.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 lT="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",uT="\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",zi=(n,e)=>{for(const t in e)n[t]=e[t];return n},Cf="numeric",Ef="ascii",kf="alpha",Va="asciinumeric",Ua="alphanumeric",Af="domain",W0="emoji",cT="scheme",fT="slashscheme",V0="whitespace";function hT(n,e){return n in e||(e[n]=[]),e[n]}function jr(n,e,t){e[Cf]&&(e[Va]=!0,e[Ua]=!0),e[Ef]&&(e[Va]=!0,e[kf]=!0),e[Va]&&(e[Ua]=!0),e[kf]&&(e[Ua]=!0),e[Ua]&&(e[Af]=!0),e[W0]&&(e[Af]=!0);for(const r in e){const i=hT(r,t);i.indexOf(n)<0&&i.push(n)}}function dT(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function xt(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}xt.groups={},xt.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||xt.groups;let i;return e&&e.j?i=e:(i=new xt(e),t&&r&&jr(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||xt.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 xt,zi(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new xt,o){if(r)if(a.t&&typeof a.t=="string"){const f=zi(dT(a.t,r),t);jr(o,f,r)}else t&&jr(o,t,r);a.t=o}return i.j[n]=a,a}};const Y=(n,e,t,r,i)=>n.ta(e,t,r,i),Xt=(n,e,t,r,i)=>n.tr(e,t,r,i),U0=(n,e,t,r,i)=>n.ts(e,t,r,i),$=(n,e,t,r,i)=>n.tt(e,t,r,i),Un="WORD",Mf="UWORD",$s="LOCALHOST",Tf="TLD",Of="UTLD",qa="SCHEME",Bi="SLASH_SCHEME",If="NUM",q0="WS",Nf="NL",$i="OPENBRACE",Hs="OPENBRACKET",Ws="OPENANGLEBRACKET",Vs="OPENPAREN",Yr="CLOSEBRACE",Hi="CLOSEBRACKET",Wi="CLOSEANGLEBRACKET",Xr="CLOSEPAREN",Ka="AMPERSAND",Ga="APOSTROPHE",Ja="ASTERISK",wr="AT",ja="BACKSLASH",Ya="BACKTICK",Xa="CARET",Sr="COLON",Rf="COMMA",Za="DOLLAR",Sn="DOT",Qa="EQUALS",Lf="EXCLAMATION",xn="HYPHEN",el="PERCENT",tl="PIPE",nl="PLUS",rl="POUND",il="QUERY",Pf="QUOTE",Df="SEMI",Cn="SLASH",Us="TILDE",sl="UNDERSCORE",K0="EMOJI",ol="SYM";var G0=Object.freeze({__proto__:null,WORD:Un,UWORD:Mf,LOCALHOST:$s,TLD:Tf,UTLD:Of,SCHEME:qa,SLASH_SCHEME:Bi,NUM:If,WS:q0,NL:Nf,OPENBRACE:$i,OPENBRACKET:Hs,OPENANGLEBRACKET:Ws,OPENPAREN:Vs,CLOSEBRACE:Yr,CLOSEBRACKET:Hi,CLOSEANGLEBRACKET:Wi,CLOSEPAREN:Xr,AMPERSAND:Ka,APOSTROPHE:Ga,ASTERISK:Ja,AT:wr,BACKSLASH:ja,BACKTICK:Ya,CARET:Xa,COLON:Sr,COMMA:Rf,DOLLAR:Za,DOT:Sn,EQUALS:Qa,EXCLAMATION:Lf,HYPHEN:xn,PERCENT:el,PIPE:tl,PLUS:nl,POUND:rl,QUERY:il,QUOTE:Pf,SEMI:Df,SLASH:Cn,TILDE:Us,UNDERSCORE:sl,EMOJI:K0,SYM:ol});const Vi=/[a-z]/,Ff=/\p{L}/u,zf=/\p{Emoji}/u,Bf=/\d/,J0=/\s/,j0=`
|
|
37
|
+
`,pT="\uFE0F",mT="\u200D";let al=null,ll=null;function gT(n){n===void 0&&(n=[]);const e={};xt.groups=e;const t=new xt;al==null&&(al=Y0(lT)),ll==null&&(ll=Y0(uT)),$(t,"'",Ga),$(t,"{",$i),$(t,"[",Hs),$(t,"<",Ws),$(t,"(",Vs),$(t,"}",Yr),$(t,"]",Hi),$(t,">",Wi),$(t,")",Xr),$(t,"&",Ka),$(t,"*",Ja),$(t,"@",wr),$(t,"`",Ya),$(t,"^",Xa),$(t,":",Sr),$(t,",",Rf),$(t,"$",Za),$(t,".",Sn),$(t,"=",Qa),$(t,"!",Lf),$(t,"-",xn),$(t,"%",el),$(t,"|",tl),$(t,"+",nl),$(t,"#",rl),$(t,"?",il),$(t,'"',Pf),$(t,"/",Cn),$(t,";",Df),$(t,"~",Us),$(t,"_",sl),$(t,"\\",ja);const r=Xt(t,Bf,If,{[Cf]:!0});Xt(r,Bf,r);const i=Xt(t,Vi,Un,{[Ef]:!0});Xt(i,Vi,i);const o=Xt(t,Ff,Mf,{[kf]:!0});Xt(o,Vi),Xt(o,Ff,o);const a=Xt(t,J0,q0,{[V0]:!0});$(t,j0,Nf,{[V0]:!0}),$(a,j0),Xt(a,J0,a);const u=Xt(t,zf,K0,{[W0]:!0});Xt(u,zf,u),$(u,pT,u);const f=$(u,mT);Xt(f,zf,u);const h=[[Vi,i]],m=[[Vi,null],[Ff,o]];for(let p=0;p<al.length;p++)xr(t,al[p],Tf,Un,h);for(let p=0;p<ll.length;p++)xr(t,ll[p],Of,Mf,m);jr(Tf,{tld:!0,ascii:!0},e),jr(Of,{utld:!0,alpha:!0},e),xr(t,"file",qa,Un,h),xr(t,"mailto",qa,Un,h),xr(t,"http",Bi,Un,h),xr(t,"https",Bi,Un,h),xr(t,"ftp",Bi,Un,h),xr(t,"ftps",Bi,Un,h),jr(qa,{scheme:!0,ascii:!0},e),jr(Bi,{slashscheme:!0,ascii:!0},e),n=n.sort((p,b)=>p[0]>b[0]?1:-1);for(let p=0;p<n.length;p++){const b=n[p][0],C=n[p][1]?{[cT]:!0}:{[fT]:!0};b.indexOf("-")>=0?C[Af]=!0:Vi.test(b)?Bf.test(b)?C[Va]=!0:C[Ef]=!0:C[Cf]=!0,U0(t,b,b,C)}return U0(t,"localhost",$s,{ascii:!0}),t.jd=new xt(ol),{start:t,tokens:zi({groups:e},G0)}}function yT(n,e){const t=bT(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,h=0,m=null,p=-1,b=-1;for(;a<r&&(f=u.go(t[a]));)u=f,u.accepts()?(p=0,b=0,m=u):p>=0&&(p+=t[a].length,b++),h+=t[a].length,o+=t[a].length,a++;o-=p,a-=b,h-=p,i.push({t:m.t,v:e.slice(o-h,o),s:o-h,e:o})}return i}function bT(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 xr(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 xt(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new xt(t),o.jr=i.slice(),n.j[e[a-1]]=o,o}function Y0(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 qs={defaultProtocol:"http",events:null,format:X0,formatHref:X0,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function $f(n,e){e===void 0&&(e=null);let t=zi({},qs);n&&(t=zi(t,n instanceof $f?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}$f.prototype={o:qs,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]:qs[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 X0(n){return n}function Z0(n,e){this.t="token",this.v=n,this.tk=e}Z0.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=qs.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),h=n.get("rel",t,e),m=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return a.href=r,u&&(a.class=u),f&&(a.target=f),h&&(a.rel=h),m&&zi(a,m),{tagName:i,attributes:a,content:o,eventListeners:p}}};function ul(n,e){class t extends Z0{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 Q0=ul("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),e1=ul("text"),_T=ul("nl"),Zr=ul("url",{isLink:!0,toHref(n){return n===void 0&&(n=qs.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==$s&&n[1].t===Sr}}),je=n=>new xt(n);function vT(n){let{groups:e}=n;const t=e.domain.concat([Ka,Ja,wr,ja,Ya,Xa,Za,Qa,xn,If,el,tl,nl,rl,Cn,ol,Us,sl]),r=[Ga,Wi,Yr,Hi,Xr,Sr,Rf,Sn,Lf,Ws,$i,Hs,Vs,il,Pf,Df],i=[Ka,Ga,Ja,ja,Ya,Xa,Yr,Za,Qa,xn,$i,el,tl,nl,rl,il,Cn,ol,Us,sl],o=je(),a=$(o,Us);Y(a,i,a),Y(a,e.domain,a);const u=je(),f=je(),h=je();Y(o,e.domain,u),Y(o,e.scheme,f),Y(o,e.slashscheme,h),Y(u,i,a),Y(u,e.domain,u);const m=$(u,wr);$(a,wr,m),$(f,wr,m),$(h,wr,m);const p=$(a,Sn);Y(p,i,a),Y(p,e.domain,a);const b=je();Y(m,e.domain,b),Y(b,e.domain,b);const S=$(b,Sn);Y(S,e.domain,b);const C=je(Q0);Y(S,e.tld,C),Y(S,e.utld,C),$(m,$s,C);const g=$(b,xn);Y(g,e.domain,b),Y(C,e.domain,b),$(C,Sn,S),$(C,xn,g);const _=$(C,Sr);Y(_,e.numeric,Q0);const x=$(u,xn),k=$(u,Sn);Y(x,e.domain,u),Y(k,i,a),Y(k,e.domain,u);const A=je(Zr);Y(k,e.tld,A),Y(k,e.utld,A),Y(A,e.domain,u),Y(A,i,a),$(A,Sn,k),$(A,xn,x),$(A,wr,m);const N=$(A,Sr),W=je(Zr);Y(N,e.numeric,W);const L=je(Zr),U=je();Y(L,t,L),Y(L,r,U),Y(U,t,L),Y(U,r,U),$(A,Cn,L),$(W,Cn,L);const j=$(f,Sr),pe=$(h,Sr),Ct=$(pe,Cn),yt=$(Ct,Cn);Y(f,e.domain,u),$(f,Sn,k),$(f,xn,x),Y(h,e.domain,u),$(h,Sn,k),$(h,xn,x),Y(j,e.domain,L),$(j,Cn,L),Y(yt,e.domain,L),Y(yt,t,L),$(yt,Cn,L);const Ft=$(L,$i),Xn=$(L,Hs),en=$(L,Ws),Tn=$(L,Vs);$(U,$i,Ft),$(U,Hs,Xn),$(U,Ws,en),$(U,Vs,Tn),$(Ft,Yr,L),$(Xn,Hi,L),$(en,Wi,L),$(Tn,Xr,L),$(Ft,Yr,L);const We=je(Zr),Ve=je(Zr),Ue=je(Zr),zt=je(Zr);Y(Ft,t,We),Y(Xn,t,Ve),Y(en,t,Ue),Y(Tn,t,zt);const st=je(),qe=je(),Zn=je(),Qn=je();return Y(Ft,r),Y(Xn,r),Y(en,r),Y(Tn,r),Y(We,t,We),Y(Ve,t,Ve),Y(Ue,t,Ue),Y(zt,t,zt),Y(We,r,We),Y(Ve,r,Ve),Y(Ue,r,Ue),Y(zt,r,zt),Y(st,t,st),Y(qe,t,Ve),Y(Zn,t,Ue),Y(Qn,t,zt),Y(st,r,st),Y(qe,r,qe),Y(Zn,r,Zn),Y(Qn,r,Qn),$(Ve,Hi,L),$(Ue,Wi,L),$(zt,Xr,L),$(We,Yr,L),$(qe,Hi,L),$(Zn,Wi,L),$(Qn,Xr,L),$(st,Xr,L),$(o,$s,A),$(o,Nf,_T),{start:o,tokens:G0}}function wT(n,e,t){let r=t.length,i=0,o=[],a=[];for(;i<r;){let u=n,f=null,h=null,m=0,p=null,b=-1;for(;i<r&&!(f=u.go(t[i].t));)a.push(t[i++]);for(;i<r&&(h=f||u.go(t[i].t));)f=null,u=h,u.accepts()?(b=0,p=u):b>=0&&b++,i++,m++;if(b<0)i-=m,i<r&&(a.push(t[i]),i++);else{a.length>0&&(o.push(Hf(e1,e,a)),a=[]),i-=b,m-=b;const S=p.t,C=t.slice(i-m,i);o.push(Hf(S,e,C))}}return a.length>0&&o.push(Hf(e1,e,a)),o}function Hf(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 ST=typeof console<"u"&&console&&console.warn||(()=>{}),xT="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Oe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function CT(){xt.groups={},Oe.scanner=null,Oe.parser=null,Oe.tokenQueue=[],Oe.pluginQueue=[],Oe.customSchemes=[],Oe.initialized=!1}function t1(n,e){if(e===void 0&&(e=!1),Oe.initialized&&ST(`linkifyjs: already initialized - will not register custom scheme "${n}" ${xT}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
|
|
38
38
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
39
39
|
2. Cannot start or end with "-"
|
|
40
|
-
3. "-" cannot repeat`);Te.customSchemes.push([n,e])}function tM(){Te.scanner=KT(Te.customSchemes);for(let n=0;n<Te.tokenQueue.length;n++)Te.tokenQueue[n][1]({scanner:Te.scanner});Te.parser=YT(Te.scanner.tokens);for(let n=0;n<Te.pluginQueue.length;n++)Te.pluginQueue[n][1]({scanner:Te.scanner,parser:Te.parser});Te.initialized=!0}function x0(n){return Te.initialized||tM(),XT(Te.parser.start,n,GT(Te.scanner.start,n))}function _f(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 yf(t),i=x0(n),o=[];for(let l=0;l<i.length;l++){const u=i[l];u.isLink&&(!e||u.t===e)&&o.push(u.toFormattedObject(r))}return o}function nM(n,e){e===void 0&&(e=null);const t=x0(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class rM extends Qc{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=nM(i);if(!i||!o)return!1;const l=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(l),!0}_createLinkAttrs(e,t){return Lf.query(t,{typeName:ie.TEXT,mark:{typeName:he.LINK},getMark:{typeName:he.LINK}})?.attrs||{href:e}}}function H(n){return(...e)=>t=>n(t,...e)}function Za(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 Hr(n){const e=Za(n);return["span",e?{...e,class:"zw-style"}:{},0]}function iM(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Vt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var sM=Object.defineProperty,oM=(n,e,t)=>e in n?sM(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ds=(n,e,t)=>oM(n,typeof e!="symbol"?e+"":e,t);const E0=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"}),aM=n=>n in E0,lM="[-\\+]?\\d+%?",uM="[-\\+]?\\d*\\.\\d+%?",ur=`(?:${uM})|(?:${lM})`,vf=`[\\s|\\(]+(${ur})[,|\\s]+(${ur})[,|\\s]+(${ur})\\s*\\)?`,wf=`[\\s|\\(]+(${ur})[,|\\s]+(${ur})[,|\\s]+(${ur})[,|\\s]+(${ur})\\s*\\)?`,pn=Object.freeze({CSS_UNIT:new RegExp(ur),RGB:new RegExp(`rgb${vf}`),RGBA:new RegExp(`rgba${wf}`),HSL:new RegExp(`hsl${vf}`),HSLA:new RegExp(`hsla${wf}`),HSV:new RegExp(`hsv${vf}`),HSVA:new RegExp(`hsva${wf}`),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})$/}),Sf=Object.freeze({WINDOW:Symbol("window")});function xf(n,e=0,t=1){return Math.max(e,Math.min(t,n))}function k0(n,e){let t=!1;return function(){t||(n.apply(this,arguments),t=!0,setTimeout(function(){t=!1},e))}}function $r(n){return n>1||n<-1?n/100:n}const zr=8,cM="#fff",fM="#e6e6e6";function hM(){const n=document.createElement("canvas");n.width=n.height=zr*2;const e=n.getContext("2d");return e?(e.fillStyle=cM,e.fillRect(0,0,n.width,n.height),e.fillStyle=fM,e.fillRect(0,0,zr,zr),e.translate(zr,zr),e.fillRect(0,0,zr,zr),n.toDataURL()):null}const C0=3;function Pi(n){return Number.parseFloat(n.toFixed(C0+2).substr(0,C0+2))}function dM(n,e=1){const t=[];let r=0;for(;r<n.length;)t.push(n.substr(r,e)),r+=e;return t}function A0(n){const e=dM(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 O0({h:n,s:e,v:t,a:r}){const i=l=>{const u=(l+n/60)%6;return t-t*e*Math.max(Math.min(u,4-u,1),0)},o=[i(5),i(3),i(1)].map(l=>Math.round(l*255));return{r:o[0],g:o[1],b:o[2],a:r}}function pM({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,l=Pi(o),u=Pi(i);return{h:n,s:l,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 T0(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 l=0;i!==o&&(i===e?l=60*(0+(t-r)/(i-o)):i===t?l=60*(2+(r-e)/(i-o)):i===r&&(l=60*(4+(e-t)/(i-o)))),l<0&&(l=l+360);const u=i===0?0:(i-o)/i,f=[l,u,i],d=Pi(f[1]),g=Pi(f[2]);return{h:Math.floor(f[0]),s:d,v:g,a:n.a}}function gM(n){return T0(A0(n))}function yM({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),l=Pi(o),u=Pi(i);return{h:n,s:l,l:u,a:r}}function bM(n){const e=gM(n),t=yM(e),r=A0(n);return{alpha:e.a,hex:n.substr(0,7),hexa:n,hsla:t,hsva:e,hue:e.h,rgba:r}}function Ef(n,e,t="0"){return n+t.repeat(Math.max(0,e-n.length))}function _M(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=Ef(e,8,"F"):e=Ef(Ef(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}function vM(n){return bM(_M(n))}const kf=class Ye{constructor(e){Ds(this,"rgba"),Ds(this,"hsva"),Ds(this,"alpha"),this.rgba=e,this.hsva=this.calcHsva(),this.alpha=e.a}static create(e){if(!e)return Ye.fromBlack();let t=e.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(aM(t))t=E0[t];else if(t===this.TRANSPARENT)return Ye.fromTransparent();const r=pn.RGB.exec(t)||pn.RGBA.exec(t);if(r){const u=r[4]===void 0?1:r[4];return Ye.fromRgba({r:Number.parseInt(r[1]),g:Number.parseInt(r[2]),b:Number.parseInt(r[3]),a:Number.parseFloat(u.toString())})}const i=pn.HSL.exec(t)||pn.HSLA.exec(t);if(i){const u=i[4]===void 0?1:i[4];return Ye.fromHsla({h:Number.parseInt(i[1]),s:Number.parseFloat(i[2]),l:Number.parseFloat(i[3]),a:Number.parseFloat(u.toString())})}const o=pn.HSV.exec(t)||pn.HSVA.exec(t);if(o){const u=o[4]===void 0?1:o[4];return Ye.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(u.toString())})}return pn.HEX8.exec(t)||pn.HEX6.exec(t)||pn.HEX4.exec(t)||pn.HEX3.exec(t)?Ye.fromHex(t):Ye.fromBlack()}static fromHex(e){const{rgba:t}=vM(e);return new Ye(t)}static fromRgba({r:e,g:t,b:r,a:i}){const o=$r(i);return new Ye({r:e,g:t,b:r,a:o})}static fromHsla({h:e,s:t,l:r,a:i}){const o=$r(t),l=$r(r),u=$r(i);return Ye.fromHsva(pM({h:e,s:o,l,a:u}))}static fromHsva({h:e,s:t,v:r,a:i}){const o=$r(t),l=$r(r),u=$r(i),f=O0({h:e,s:o,v:l,a:u});return new Ye(f)}static fromTransparent(){return new Ye({r:0,g:0,b:0,a:0})}static fromWhite(){return new Ye({r:255,g:255,b:255,a:1})}static fromBlack(){return new Ye({r:0,g:0,b:0,a:1})}static isTransparent(e){return Ye.create(e).isTransparent()}static isDark(e){return Ye.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 T0(this.rgba)}calcRgba(){return O0(this.hsva)}};Ds(kf,"TRANSPARENT","transparent"),Ds(kf,"NONE","none");let wM=kf;Sf.WINDOW;const M0=3,SM=n=>Number.parseFloat(n.toFixed(M0+2).substr(0,M0+2));Sf.WINDOW,Sf.WINDOW,k0((n,e)=>{n(e)},20);function I0(n){const e=wM.create(n);return e.alpha===1?e.toHexString():e.toRgbaString()}function N0(n,e){if(!n.includes("em"))return parseInt(n);const t=Di.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function xM(n,e){return(n.firstElementChild||n).style.fontSize||Di.getComputedStyle(e).fontSize}function EM(n,e,t){if(!n.includes("px"))return n;const r=xM(e,t),i=N0(r,t);return i?(parseInt(n)/i).toFixed(2):null}const kM={start:sr.LEFT,end:sr.RIGHT};function CM(n){const e=kM[n]||n;return sr.values.includes(e)?e:null}const R0=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function L0(n,e){return n.resolve(e).depth+1}function AM(n,e,t,r){const i=L0(n,r),o=e.from-i<=r,l=e.to+i>=t.nodeSize+r;return o&&l}const OM=(n,e)=>n.eq(e);function TM(n,e,t,r=OM){const i=n.resolve(e).path.reverse();for(const o of i)if(typeof o!="number"){for(const l of o.marks)if(r(l,t))return!0}return!1}function MM(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var Fs={exports:{}};var IM=Fs.exports,P0;function NM(){return P0||(P0=1,function(n,e){(function(){var t,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",d=500,g="__lodash_placeholder__",p=1,_=2,S=4,k=1,m=2,b=1,x=2,A=4,O=8,R=16,W=32,D=64,U=128,Q=256,we=512,rn=30,Fn="...",_n=800,qr=16,dr=1,Kr=2,Bn=3,rt=1/0,Ze=9007199254740991,vn=17976931348623157e292,sn=NaN,it=4294967295,Gr=it-1,jr=it>>>1,q0=[["ary",U],["bind",b],["bindKey",x],["curry",O],["curryRight",R],["flip",we],["partial",W],["partialRight",D],["rearg",Q]],Jr="[object Arguments]",$s="[object Array]",K0="[object AsyncFunction]",zi="[object Boolean]",Vi="[object Date]",G0="[object DOMException]",zs="[object Error]",Vs="[object Function]",Pf="[object GeneratorFunction]",Ut="[object Map]",Wi="[object Number]",j0="[object Null]",wn="[object Object]",Df="[object Promise]",J0="[object Proxy]",Ui="[object RegExp]",qt="[object Set]",qi="[object String]",Ws="[object Symbol]",Y0="[object Undefined]",Ki="[object WeakMap]",X0="[object WeakSet]",Gi="[object ArrayBuffer]",Yr="[object DataView]",rl="[object Float32Array]",il="[object Float64Array]",sl="[object Int8Array]",ol="[object Int16Array]",al="[object Int32Array]",ll="[object Uint8Array]",ul="[object Uint8ClampedArray]",cl="[object Uint16Array]",fl="[object Uint32Array]",Z0=/\b__p \+= '';/g,Q0=/\b(__p \+=) '' \+/g,ey=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ff=/&(?:amp|lt|gt|quot|#39);/g,Bf=/[&<>"']/g,ty=RegExp(Ff.source),ny=RegExp(Bf.source),ry=/<%-([\s\S]+?)%>/g,iy=/<%([\s\S]+?)%>/g,Hf=/<%=([\s\S]+?)%>/g,sy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oy=/^\w*$/,ay=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hl=/[\\^$.*+?()[\]{}|]/g,ly=RegExp(hl.source),dl=/^\s+/,uy=/\s/,cy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,fy=/\{\n\/\* \[wrapped with (.+)\] \*/,hy=/,? & /,dy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,py=/[()=,{}\[\]\/\s]/,my=/\\(\\)?/g,gy=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$f=/\w*$/,yy=/^[-+]0x[0-9a-f]+$/i,by=/^0b[01]+$/i,_y=/^\[object .+?Constructor\]$/,vy=/^0o[0-7]+$/i,wy=/^(?:0|[1-9]\d*)$/,Sy=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Us=/($^)/,xy=/['\n\r\u2028\u2029\\]/g,qs="\\ud800-\\udfff",Ey="\\u0300-\\u036f",ky="\\ufe20-\\ufe2f",Cy="\\u20d0-\\u20ff",zf=Ey+ky+Cy,Vf="\\u2700-\\u27bf",Wf="a-z\\xdf-\\xf6\\xf8-\\xff",Ay="\\xac\\xb1\\xd7\\xf7",Oy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ty="\\u2000-\\u206f",My=" \\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",Uf="A-Z\\xc0-\\xd6\\xd8-\\xde",qf="\\ufe0e\\ufe0f",Kf=Ay+Oy+Ty+My,pl="['\u2019]",Iy="["+qs+"]",Gf="["+Kf+"]",Ks="["+zf+"]",jf="\\d+",Ny="["+Vf+"]",Jf="["+Wf+"]",Yf="[^"+qs+Kf+jf+Vf+Wf+Uf+"]",ml="\\ud83c[\\udffb-\\udfff]",Ry="(?:"+Ks+"|"+ml+")",Xf="[^"+qs+"]",gl="(?:\\ud83c[\\udde6-\\uddff]){2}",yl="[\\ud800-\\udbff][\\udc00-\\udfff]",Xr="["+Uf+"]",Zf="\\u200d",Qf="(?:"+Jf+"|"+Yf+")",Ly="(?:"+Xr+"|"+Yf+")",eh="(?:"+pl+"(?:d|ll|m|re|s|t|ve))?",th="(?:"+pl+"(?:D|LL|M|RE|S|T|VE))?",nh=Ry+"?",rh="["+qf+"]?",Py="(?:"+Zf+"(?:"+[Xf,gl,yl].join("|")+")"+rh+nh+")*",Dy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ih=rh+nh+Py,By="(?:"+[Ny,gl,yl].join("|")+")"+ih,Hy="(?:"+[Xf+Ks+"?",Ks,gl,yl,Iy].join("|")+")",$y=RegExp(pl,"g"),zy=RegExp(Ks,"g"),bl=RegExp(ml+"(?="+ml+")|"+Hy+ih,"g"),Vy=RegExp([Xr+"?"+Jf+"+"+eh+"(?="+[Gf,Xr,"$"].join("|")+")",Ly+"+"+th+"(?="+[Gf,Xr+Qf,"$"].join("|")+")",Xr+"?"+Qf+"+"+eh,Xr+"+"+th,Fy,Dy,jf,By].join("|"),"g"),Wy=RegExp("["+Zf+qs+zf+qf+"]"),Uy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qy=["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"],Ky=-1,xe={};xe[rl]=xe[il]=xe[sl]=xe[ol]=xe[al]=xe[ll]=xe[ul]=xe[cl]=xe[fl]=!0,xe[Jr]=xe[$s]=xe[Gi]=xe[zi]=xe[Yr]=xe[Vi]=xe[zs]=xe[Vs]=xe[Ut]=xe[Wi]=xe[wn]=xe[Ui]=xe[qt]=xe[qi]=xe[Ki]=!1;var Se={};Se[Jr]=Se[$s]=Se[Gi]=Se[Yr]=Se[zi]=Se[Vi]=Se[rl]=Se[il]=Se[sl]=Se[ol]=Se[al]=Se[Ut]=Se[Wi]=Se[wn]=Se[Ui]=Se[qt]=Se[qi]=Se[Ws]=Se[ll]=Se[ul]=Se[cl]=Se[fl]=!0,Se[zs]=Se[Vs]=Se[Ki]=!1;var Gy={\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"},jy={"&":"&","<":"<",">":">",'"':""","'":"'"},Jy={"&":"&","<":"<",">":">",""":'"',"'":"'"},Yy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xy=parseFloat,Zy=parseInt,sh=typeof Ro=="object"&&Ro&&Ro.Object===Object&&Ro,Qy=typeof self=="object"&&self&&self.Object===Object&&self,qe=sh||Qy||Function("return this")(),_l=e&&!e.nodeType&&e,pr=_l&&!0&&n&&!n.nodeType&&n,oh=pr&&pr.exports===_l,vl=oh&&sh.process,Tt=function(){try{var T=pr&&pr.require&&pr.require("util").types;return T||vl&&vl.binding&&vl.binding("util")}catch{}}(),ah=Tt&&Tt.isArrayBuffer,lh=Tt&&Tt.isDate,uh=Tt&&Tt.isMap,ch=Tt&&Tt.isRegExp,fh=Tt&&Tt.isSet,hh=Tt&&Tt.isTypedArray;function bt(T,N,I){switch(I.length){case 0:return T.call(N);case 1:return T.call(N,I[0]);case 2:return T.call(N,I[0],I[1]);case 3:return T.call(N,I[0],I[1],I[2])}return T.apply(N,I)}function e1(T,N,I,q){for(var te=-1,ge=T==null?0:T.length;++te<ge;){var Fe=T[te];N(q,Fe,I(Fe),T)}return q}function Mt(T,N){for(var I=-1,q=T==null?0:T.length;++I<q&&N(T[I],I,T)!==!1;);return T}function t1(T,N){for(var I=T==null?0:T.length;I--&&N(T[I],I,T)!==!1;);return T}function dh(T,N){for(var I=-1,q=T==null?0:T.length;++I<q;)if(!N(T[I],I,T))return!1;return!0}function Hn(T,N){for(var I=-1,q=T==null?0:T.length,te=0,ge=[];++I<q;){var Fe=T[I];N(Fe,I,T)&&(ge[te++]=Fe)}return ge}function Gs(T,N){var I=T==null?0:T.length;return!!I&&Zr(T,N,0)>-1}function wl(T,N,I){for(var q=-1,te=T==null?0:T.length;++q<te;)if(I(N,T[q]))return!0;return!1}function ke(T,N){for(var I=-1,q=T==null?0:T.length,te=Array(q);++I<q;)te[I]=N(T[I],I,T);return te}function $n(T,N){for(var I=-1,q=N.length,te=T.length;++I<q;)T[te+I]=N[I];return T}function Sl(T,N,I,q){var te=-1,ge=T==null?0:T.length;for(q&&ge&&(I=T[++te]);++te<ge;)I=N(I,T[te],te,T);return I}function n1(T,N,I,q){var te=T==null?0:T.length;for(q&&te&&(I=T[--te]);te--;)I=N(I,T[te],te,T);return I}function xl(T,N){for(var I=-1,q=T==null?0:T.length;++I<q;)if(N(T[I],I,T))return!0;return!1}var r1=El("length");function i1(T){return T.split("")}function s1(T){return T.match(dy)||[]}function ph(T,N,I){var q;return I(T,function(te,ge,Fe){if(N(te,ge,Fe))return q=ge,!1}),q}function js(T,N,I,q){for(var te=T.length,ge=I+(q?1:-1);q?ge--:++ge<te;)if(N(T[ge],ge,T))return ge;return-1}function Zr(T,N,I){return N===N?y1(T,N,I):js(T,mh,I)}function o1(T,N,I,q){for(var te=I-1,ge=T.length;++te<ge;)if(q(T[te],N))return te;return-1}function mh(T){return T!==T}function gh(T,N){var I=T==null?0:T.length;return I?Cl(T,N)/I:sn}function El(T){return function(N){return N==null?t:N[T]}}function kl(T){return function(N){return T==null?t:T[N]}}function yh(T,N,I,q,te){return te(T,function(ge,Fe,ve){I=q?(q=!1,ge):N(I,ge,Fe,ve)}),I}function a1(T,N){var I=T.length;for(T.sort(N);I--;)T[I]=T[I].value;return T}function Cl(T,N){for(var I,q=-1,te=T.length;++q<te;){var ge=N(T[q]);ge!==t&&(I=I===t?ge:I+ge)}return I}function Al(T,N){for(var I=-1,q=Array(T);++I<T;)q[I]=N(I);return q}function l1(T,N){return ke(N,function(I){return[I,T[I]]})}function bh(T){return T&&T.slice(0,Sh(T)+1).replace(dl,"")}function _t(T){return function(N){return T(N)}}function Ol(T,N){return ke(N,function(I){return T[I]})}function ji(T,N){return T.has(N)}function _h(T,N){for(var I=-1,q=T.length;++I<q&&Zr(N,T[I],0)>-1;);return I}function vh(T,N){for(var I=T.length;I--&&Zr(N,T[I],0)>-1;);return I}function u1(T,N){for(var I=T.length,q=0;I--;)T[I]===N&&++q;return q}var c1=kl(Gy),f1=kl(jy);function h1(T){return"\\"+Yy[T]}function d1(T,N){return T==null?t:T[N]}function Qr(T){return Wy.test(T)}function p1(T){return Uy.test(T)}function m1(T){for(var N,I=[];!(N=T.next()).done;)I.push(N.value);return I}function Tl(T){var N=-1,I=Array(T.size);return T.forEach(function(q,te){I[++N]=[te,q]}),I}function wh(T,N){return function(I){return T(N(I))}}function zn(T,N){for(var I=-1,q=T.length,te=0,ge=[];++I<q;){var Fe=T[I];(Fe===N||Fe===g)&&(T[I]=g,ge[te++]=I)}return ge}function Js(T){var N=-1,I=Array(T.size);return T.forEach(function(q){I[++N]=q}),I}function g1(T){var N=-1,I=Array(T.size);return T.forEach(function(q){I[++N]=[q,q]}),I}function y1(T,N,I){for(var q=I-1,te=T.length;++q<te;)if(T[q]===N)return q;return-1}function b1(T,N,I){for(var q=I+1;q--;)if(T[q]===N)return q;return q}function ei(T){return Qr(T)?v1(T):r1(T)}function Kt(T){return Qr(T)?w1(T):i1(T)}function Sh(T){for(var N=T.length;N--&&uy.test(T.charAt(N)););return N}var _1=kl(Jy);function v1(T){for(var N=bl.lastIndex=0;bl.test(T);)++N;return N}function w1(T){return T.match(bl)||[]}function S1(T){return T.match(Vy)||[]}var x1=function T(N){N=N==null?qe:ti.defaults(qe.Object(),N,ti.pick(qe,qy));var I=N.Array,q=N.Date,te=N.Error,ge=N.Function,Fe=N.Math,ve=N.Object,Ml=N.RegExp,E1=N.String,It=N.TypeError,Ys=I.prototype,k1=ge.prototype,ni=ve.prototype,Xs=N["__core-js_shared__"],Zs=k1.toString,_e=ni.hasOwnProperty,C1=0,xh=function(){var s=/[^.]+$/.exec(Xs&&Xs.keys&&Xs.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Qs=ni.toString,A1=Zs.call(ve),O1=qe._,T1=Ml("^"+Zs.call(_e).replace(hl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eo=oh?N.Buffer:t,Vn=N.Symbol,to=N.Uint8Array,Eh=eo?eo.allocUnsafe:t,no=wh(ve.getPrototypeOf,ve),kh=ve.create,Ch=ni.propertyIsEnumerable,ro=Ys.splice,Ah=Vn?Vn.isConcatSpreadable:t,Ji=Vn?Vn.iterator:t,mr=Vn?Vn.toStringTag:t,io=function(){try{var s=vr(ve,"defineProperty");return s({},"",{}),s}catch{}}(),M1=N.clearTimeout!==qe.clearTimeout&&N.clearTimeout,I1=q&&q.now!==qe.Date.now&&q.now,N1=N.setTimeout!==qe.setTimeout&&N.setTimeout,so=Fe.ceil,oo=Fe.floor,Il=ve.getOwnPropertySymbols,R1=eo?eo.isBuffer:t,Oh=N.isFinite,L1=Ys.join,P1=wh(ve.keys,ve),Be=Fe.max,Qe=Fe.min,D1=q.now,F1=N.parseInt,Th=Fe.random,B1=Ys.reverse,Nl=vr(N,"DataView"),Yi=vr(N,"Map"),Rl=vr(N,"Promise"),ri=vr(N,"Set"),Xi=vr(N,"WeakMap"),Zi=vr(ve,"create"),ao=Xi&&new Xi,ii={},H1=wr(Nl),$1=wr(Yi),z1=wr(Rl),V1=wr(ri),W1=wr(Xi),lo=Vn?Vn.prototype:t,Qi=lo?lo.valueOf:t,Mh=lo?lo.toString:t;function v(s){if(Me(s)&&!ne(s)&&!(s instanceof ue)){if(s instanceof Nt)return s;if(_e.call(s,"__wrapped__"))return Id(s)}return new Nt(s)}var si=function(){function s(){}return function(a){if(!Ae(a))return{};if(kh)return kh(a);s.prototype=a;var c=new s;return s.prototype=t,c}}();function uo(){}function Nt(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=t}v.templateSettings={escape:ry,evaluate:iy,interpolate:Hf,variable:"",imports:{_:v}},v.prototype=uo.prototype,v.prototype.constructor=v,Nt.prototype=si(uo.prototype),Nt.prototype.constructor=Nt;function ue(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=it,this.__views__=[]}function U1(){var s=new ue(this.__wrapped__);return s.__actions__=ht(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ht(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ht(this.__views__),s}function q1(){if(this.__filtered__){var s=new ue(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function K1(){var s=this.__wrapped__.value(),a=this.__dir__,c=ne(s),h=a<0,y=c?s.length:0,w=i_(0,y,this.__views__),E=w.start,C=w.end,M=C-E,L=h?C:E-1,P=this.__iteratees__,F=P.length,V=0,j=Qe(M,this.__takeCount__);if(!c||!h&&y==M&&j==M)return ed(s,this.__actions__);var X=[];e:for(;M--&&V<j;){L+=a;for(var se=-1,Z=s[L];++se<F;){var ae=P[se],fe=ae.iteratee,St=ae.type,at=fe(Z);if(St==Kr)Z=at;else if(!at){if(St==dr)continue e;break e}}X[V++]=Z}return X}ue.prototype=si(uo.prototype),ue.prototype.constructor=ue;function gr(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var h=s[a];this.set(h[0],h[1])}}function G1(){this.__data__=Zi?Zi(null):{},this.size=0}function j1(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function J1(s){var a=this.__data__;if(Zi){var c=a[s];return c===f?t:c}return _e.call(a,s)?a[s]:t}function Y1(s){var a=this.__data__;return Zi?a[s]!==t:_e.call(a,s)}function X1(s,a){var c=this.__data__;return this.size+=this.has(s)?0:1,c[s]=Zi&&a===t?f:a,this}gr.prototype.clear=G1,gr.prototype.delete=j1,gr.prototype.get=J1,gr.prototype.has=Y1,gr.prototype.set=X1;function Sn(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var h=s[a];this.set(h[0],h[1])}}function Z1(){this.__data__=[],this.size=0}function Q1(s){var a=this.__data__,c=co(a,s);if(c<0)return!1;var h=a.length-1;return c==h?a.pop():ro.call(a,c,1),--this.size,!0}function eb(s){var a=this.__data__,c=co(a,s);return c<0?t:a[c][1]}function tb(s){return co(this.__data__,s)>-1}function nb(s,a){var c=this.__data__,h=co(c,s);return h<0?(++this.size,c.push([s,a])):c[h][1]=a,this}Sn.prototype.clear=Z1,Sn.prototype.delete=Q1,Sn.prototype.get=eb,Sn.prototype.has=tb,Sn.prototype.set=nb;function xn(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var h=s[a];this.set(h[0],h[1])}}function rb(){this.size=0,this.__data__={hash:new gr,map:new(Yi||Sn),string:new gr}}function ib(s){var a=xo(this,s).delete(s);return this.size-=a?1:0,a}function sb(s){return xo(this,s).get(s)}function ob(s){return xo(this,s).has(s)}function ab(s,a){var c=xo(this,s),h=c.size;return c.set(s,a),this.size+=c.size==h?0:1,this}xn.prototype.clear=rb,xn.prototype.delete=ib,xn.prototype.get=sb,xn.prototype.has=ob,xn.prototype.set=ab;function yr(s){var a=-1,c=s==null?0:s.length;for(this.__data__=new xn;++a<c;)this.add(s[a])}function lb(s){return this.__data__.set(s,f),this}function ub(s){return this.__data__.has(s)}yr.prototype.add=yr.prototype.push=lb,yr.prototype.has=ub;function Gt(s){var a=this.__data__=new Sn(s);this.size=a.size}function cb(){this.__data__=new Sn,this.size=0}function fb(s){var a=this.__data__,c=a.delete(s);return this.size=a.size,c}function hb(s){return this.__data__.get(s)}function db(s){return this.__data__.has(s)}function pb(s,a){var c=this.__data__;if(c instanceof Sn){var h=c.__data__;if(!Yi||h.length<i-1)return h.push([s,a]),this.size=++c.size,this;c=this.__data__=new xn(h)}return c.set(s,a),this.size=c.size,this}Gt.prototype.clear=cb,Gt.prototype.delete=fb,Gt.prototype.get=hb,Gt.prototype.has=db,Gt.prototype.set=pb;function Ih(s,a){var c=ne(s),h=!c&&Sr(s),y=!c&&!h&&Gn(s),w=!c&&!h&&!y&&ui(s),E=c||h||y||w,C=E?Al(s.length,E1):[],M=C.length;for(var L in s)(a||_e.call(s,L))&&!(E&&(L=="length"||y&&(L=="offset"||L=="parent")||w&&(L=="buffer"||L=="byteLength"||L=="byteOffset")||An(L,M)))&&C.push(L);return C}function Nh(s){var a=s.length;return a?s[Ul(0,a-1)]:t}function mb(s,a){return Eo(ht(s),br(a,0,s.length))}function gb(s){return Eo(ht(s))}function Ll(s,a,c){(c!==t&&!jt(s[a],c)||c===t&&!(a in s))&&En(s,a,c)}function es(s,a,c){var h=s[a];(!(_e.call(s,a)&&jt(h,c))||c===t&&!(a in s))&&En(s,a,c)}function co(s,a){for(var c=s.length;c--;)if(jt(s[c][0],a))return c;return-1}function yb(s,a,c,h){return Wn(s,function(y,w,E){a(h,y,c(y),E)}),h}function Rh(s,a){return s&&an(a,He(a),s)}function bb(s,a){return s&&an(a,pt(a),s)}function En(s,a,c){a=="__proto__"&&io?io(s,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):s[a]=c}function Pl(s,a){for(var c=-1,h=a.length,y=I(h),w=s==null;++c<h;)y[c]=w?t:mu(s,a[c]);return y}function br(s,a,c){return s===s&&(c!==t&&(s=s<=c?s:c),a!==t&&(s=s>=a?s:a)),s}function Rt(s,a,c,h,y,w){var E,C=a&p,M=a&_,L=a&S;if(c&&(E=y?c(s,h,y,w):c(s)),E!==t)return E;if(!Ae(s))return s;var P=ne(s);if(P){if(E=o_(s),!C)return ht(s,E)}else{var F=et(s),V=F==Vs||F==Pf;if(Gn(s))return rd(s,C);if(F==wn||F==Jr||V&&!y){if(E=M||V?{}:Sd(s),!C)return M?Jb(s,bb(E,s)):jb(s,Rh(E,s))}else{if(!Se[F])return y?s:{};E=a_(s,F,C)}}w||(w=new Gt);var j=w.get(s);if(j)return j;w.set(s,E),Xd(s)?s.forEach(function(Z){E.add(Rt(Z,a,c,Z,s,w))}):Jd(s)&&s.forEach(function(Z,ae){E.set(ae,Rt(Z,a,c,ae,s,w))});var X=L?M?tu:eu:M?pt:He,se=P?t:X(s);return Mt(se||s,function(Z,ae){se&&(ae=Z,Z=s[ae]),es(E,ae,Rt(Z,a,c,ae,s,w))}),E}function _b(s){var a=He(s);return function(c){return Lh(c,s,a)}}function Lh(s,a,c){var h=c.length;if(s==null)return!h;for(s=ve(s);h--;){var y=c[h],w=a[y],E=s[y];if(E===t&&!(y in s)||!w(E))return!1}return!0}function Ph(s,a,c){if(typeof s!="function")throw new It(l);return ls(function(){s.apply(t,c)},a)}function ts(s,a,c,h){var y=-1,w=Gs,E=!0,C=s.length,M=[],L=a.length;if(!C)return M;c&&(a=ke(a,_t(c))),h?(w=wl,E=!1):a.length>=i&&(w=ji,E=!1,a=new yr(a));e:for(;++y<C;){var P=s[y],F=c==null?P:c(P);if(P=h||P!==0?P:0,E&&F===F){for(var V=L;V--;)if(a[V]===F)continue e;M.push(P)}else w(a,F,h)||M.push(P)}return M}var Wn=ld(on),Dh=ld(Fl,!0);function vb(s,a){var c=!0;return Wn(s,function(h,y,w){return c=!!a(h,y,w),c}),c}function fo(s,a,c){for(var h=-1,y=s.length;++h<y;){var w=s[h],E=a(w);if(E!=null&&(C===t?E===E&&!wt(E):c(E,C)))var C=E,M=w}return M}function wb(s,a,c,h){var y=s.length;for(c=re(c),c<0&&(c=-c>y?0:y+c),h=h===t||h>y?y:re(h),h<0&&(h+=y),h=c>h?0:Qd(h);c<h;)s[c++]=a;return s}function Fh(s,a){var c=[];return Wn(s,function(h,y,w){a(h,y,w)&&c.push(h)}),c}function Ke(s,a,c,h,y){var w=-1,E=s.length;for(c||(c=u_),y||(y=[]);++w<E;){var C=s[w];a>0&&c(C)?a>1?Ke(C,a-1,c,h,y):$n(y,C):h||(y[y.length]=C)}return y}var Dl=ud(),Bh=ud(!0);function on(s,a){return s&&Dl(s,a,He)}function Fl(s,a){return s&&Bh(s,a,He)}function ho(s,a){return Hn(a,function(c){return On(s[c])})}function _r(s,a){a=qn(a,s);for(var c=0,h=a.length;s!=null&&c<h;)s=s[ln(a[c++])];return c&&c==h?s:t}function Hh(s,a,c){var h=a(s);return ne(s)?h:$n(h,c(s))}function st(s){return s==null?s===t?Y0:j0:mr&&mr in ve(s)?r_(s):g_(s)}function Bl(s,a){return s>a}function Sb(s,a){return s!=null&&_e.call(s,a)}function xb(s,a){return s!=null&&a in ve(s)}function Eb(s,a,c){return s>=Qe(a,c)&&s<Be(a,c)}function Hl(s,a,c){for(var h=c?wl:Gs,y=s[0].length,w=s.length,E=w,C=I(w),M=1/0,L=[];E--;){var P=s[E];E&&a&&(P=ke(P,_t(a))),M=Qe(P.length,M),C[E]=!c&&(a||y>=120&&P.length>=120)?new yr(E&&P):t}P=s[0];var F=-1,V=C[0];e:for(;++F<y&&L.length<M;){var j=P[F],X=a?a(j):j;if(j=c||j!==0?j:0,!(V?ji(V,X):h(L,X,c))){for(E=w;--E;){var se=C[E];if(!(se?ji(se,X):h(s[E],X,c)))continue e}V&&V.push(X),L.push(j)}}return L}function kb(s,a,c,h){return on(s,function(y,w,E){a(h,c(y),w,E)}),h}function ns(s,a,c){a=qn(a,s),s=Cd(s,a);var h=s==null?s:s[ln(Pt(a))];return h==null?t:bt(h,s,c)}function $h(s){return Me(s)&&st(s)==Jr}function Cb(s){return Me(s)&&st(s)==Gi}function Ab(s){return Me(s)&&st(s)==Vi}function rs(s,a,c,h,y){return s===a?!0:s==null||a==null||!Me(s)&&!Me(a)?s!==s&&a!==a:Ob(s,a,c,h,rs,y)}function Ob(s,a,c,h,y,w){var E=ne(s),C=ne(a),M=E?$s:et(s),L=C?$s:et(a);M=M==Jr?wn:M,L=L==Jr?wn:L;var P=M==wn,F=L==wn,V=M==L;if(V&&Gn(s)){if(!Gn(a))return!1;E=!0,P=!1}if(V&&!P)return w||(w=new Gt),E||ui(s)?_d(s,a,c,h,y,w):t_(s,a,M,c,h,y,w);if(!(c&k)){var j=P&&_e.call(s,"__wrapped__"),X=F&&_e.call(a,"__wrapped__");if(j||X){var se=j?s.value():s,Z=X?a.value():a;return w||(w=new Gt),y(se,Z,c,h,w)}}return V?(w||(w=new Gt),n_(s,a,c,h,y,w)):!1}function Tb(s){return Me(s)&&et(s)==Ut}function $l(s,a,c,h){var y=c.length,w=y,E=!h;if(s==null)return!w;for(s=ve(s);y--;){var C=c[y];if(E&&C[2]?C[1]!==s[C[0]]:!(C[0]in s))return!1}for(;++y<w;){C=c[y];var M=C[0],L=s[M],P=C[1];if(E&&C[2]){if(L===t&&!(M in s))return!1}else{var F=new Gt;if(h)var V=h(L,P,M,s,a,F);if(!(V===t?rs(P,L,k|m,h,F):V))return!1}}return!0}function zh(s){if(!Ae(s)||f_(s))return!1;var a=On(s)?T1:_y;return a.test(wr(s))}function Mb(s){return Me(s)&&st(s)==Ui}function Ib(s){return Me(s)&&et(s)==qt}function Nb(s){return Me(s)&&Mo(s.length)&&!!xe[st(s)]}function Vh(s){return typeof s=="function"?s:s==null?mt:typeof s=="object"?ne(s)?qh(s[0],s[1]):Uh(s):cp(s)}function zl(s){if(!as(s))return P1(s);var a=[];for(var c in ve(s))_e.call(s,c)&&c!="constructor"&&a.push(c);return a}function Rb(s){if(!Ae(s))return m_(s);var a=as(s),c=[];for(var h in s)h=="constructor"&&(a||!_e.call(s,h))||c.push(h);return c}function Vl(s,a){return s<a}function Wh(s,a){var c=-1,h=dt(s)?I(s.length):[];return Wn(s,function(y,w,E){h[++c]=a(y,w,E)}),h}function Uh(s){var a=ru(s);return a.length==1&&a[0][2]?Ed(a[0][0],a[0][1]):function(c){return c===s||$l(c,s,a)}}function qh(s,a){return su(s)&&xd(a)?Ed(ln(s),a):function(c){var h=mu(c,s);return h===t&&h===a?gu(c,s):rs(a,h,k|m)}}function po(s,a,c,h,y){s!==a&&Dl(a,function(w,E){if(y||(y=new Gt),Ae(w))Lb(s,a,E,c,po,h,y);else{var C=h?h(au(s,E),w,E+"",s,a,y):t;C===t&&(C=w),Ll(s,E,C)}},pt)}function Lb(s,a,c,h,y,w,E){var C=au(s,c),M=au(a,c),L=E.get(M);if(L){Ll(s,c,L);return}var P=w?w(C,M,c+"",s,a,E):t,F=P===t;if(F){var V=ne(M),j=!V&&Gn(M),X=!V&&!j&&ui(M);P=M,V||j||X?ne(C)?P=C:Ie(C)?P=ht(C):j?(F=!1,P=rd(M,!0)):X?(F=!1,P=id(M,!0)):P=[]:us(M)||Sr(M)?(P=C,Sr(C)?P=ep(C):(!Ae(C)||On(C))&&(P=Sd(M))):F=!1}F&&(E.set(M,P),y(P,M,h,w,E),E.delete(M)),Ll(s,c,P)}function Kh(s,a){var c=s.length;if(c)return a+=a<0?c:0,An(a,c)?s[a]:t}function Gh(s,a,c){a.length?a=ke(a,function(w){return ne(w)?function(E){return _r(E,w.length===1?w[0]:w)}:w}):a=[mt];var h=-1;a=ke(a,_t(Y()));var y=Wh(s,function(w,E,C){var M=ke(a,function(L){return L(w)});return{criteria:M,index:++h,value:w}});return a1(y,function(w,E){return Gb(w,E,c)})}function Pb(s,a){return jh(s,a,function(c,h){return gu(s,h)})}function jh(s,a,c){for(var h=-1,y=a.length,w={};++h<y;){var E=a[h],C=_r(s,E);c(C,E)&&is(w,qn(E,s),C)}return w}function Db(s){return function(a){return _r(a,s)}}function Wl(s,a,c,h){var y=h?o1:Zr,w=-1,E=a.length,C=s;for(s===a&&(a=ht(a)),c&&(C=ke(s,_t(c)));++w<E;)for(var M=0,L=a[w],P=c?c(L):L;(M=y(C,P,M,h))>-1;)C!==s&&ro.call(C,M,1),ro.call(s,M,1);return s}function Jh(s,a){for(var c=s?a.length:0,h=c-1;c--;){var y=a[c];if(c==h||y!==w){var w=y;An(y)?ro.call(s,y,1):Gl(s,y)}}return s}function Ul(s,a){return s+oo(Th()*(a-s+1))}function Fb(s,a,c,h){for(var y=-1,w=Be(so((a-s)/(c||1)),0),E=I(w);w--;)E[h?w:++y]=s,s+=c;return E}function ql(s,a){var c="";if(!s||a<1||a>Ze)return c;do a%2&&(c+=s),a=oo(a/2),a&&(s+=s);while(a);return c}function oe(s,a){return lu(kd(s,a,mt),s+"")}function Bb(s){return Nh(ci(s))}function Hb(s,a){var c=ci(s);return Eo(c,br(a,0,c.length))}function is(s,a,c,h){if(!Ae(s))return s;a=qn(a,s);for(var y=-1,w=a.length,E=w-1,C=s;C!=null&&++y<w;){var M=ln(a[y]),L=c;if(M==="__proto__"||M==="constructor"||M==="prototype")return s;if(y!=E){var P=C[M];L=h?h(P,M,C):t,L===t&&(L=Ae(P)?P:An(a[y+1])?[]:{})}es(C,M,L),C=C[M]}return s}var Yh=ao?function(s,a){return ao.set(s,a),s}:mt,$b=io?function(s,a){return io(s,"toString",{configurable:!0,enumerable:!1,value:bu(a),writable:!0})}:mt;function zb(s){return Eo(ci(s))}function Lt(s,a,c){var h=-1,y=s.length;a<0&&(a=-a>y?0:y+a),c=c>y?y:c,c<0&&(c+=y),y=a>c?0:c-a>>>0,a>>>=0;for(var w=I(y);++h<y;)w[h]=s[h+a];return w}function Vb(s,a){var c;return Wn(s,function(h,y,w){return c=a(h,y,w),!c}),!!c}function mo(s,a,c){var h=0,y=s==null?h:s.length;if(typeof a=="number"&&a===a&&y<=jr){for(;h<y;){var w=h+y>>>1,E=s[w];E!==null&&!wt(E)&&(c?E<=a:E<a)?h=w+1:y=w}return y}return Kl(s,a,mt,c)}function Kl(s,a,c,h){var y=0,w=s==null?0:s.length;if(w===0)return 0;a=c(a);for(var E=a!==a,C=a===null,M=wt(a),L=a===t;y<w;){var P=oo((y+w)/2),F=c(s[P]),V=F!==t,j=F===null,X=F===F,se=wt(F);if(E)var Z=h||X;else L?Z=X&&(h||V):C?Z=X&&V&&(h||!j):M?Z=X&&V&&!j&&(h||!se):j||se?Z=!1:Z=h?F<=a:F<a;Z?y=P+1:w=P}return Qe(w,Gr)}function Xh(s,a){for(var c=-1,h=s.length,y=0,w=[];++c<h;){var E=s[c],C=a?a(E):E;if(!c||!jt(C,M)){var M=C;w[y++]=E===0?0:E}}return w}function Zh(s){return typeof s=="number"?s:wt(s)?sn:+s}function vt(s){if(typeof s=="string")return s;if(ne(s))return ke(s,vt)+"";if(wt(s))return Mh?Mh.call(s):"";var a=s+"";return a=="0"&&1/s==-rt?"-0":a}function Un(s,a,c){var h=-1,y=Gs,w=s.length,E=!0,C=[],M=C;if(c)E=!1,y=wl;else if(w>=i){var L=a?null:Qb(s);if(L)return Js(L);E=!1,y=ji,M=new yr}else M=a?[]:C;e:for(;++h<w;){var P=s[h],F=a?a(P):P;if(P=c||P!==0?P:0,E&&F===F){for(var V=M.length;V--;)if(M[V]===F)continue e;a&&M.push(F),C.push(P)}else y(M,F,c)||(M!==C&&M.push(F),C.push(P))}return C}function Gl(s,a){return a=qn(a,s),s=Cd(s,a),s==null||delete s[ln(Pt(a))]}function Qh(s,a,c,h){return is(s,a,c(_r(s,a)),h)}function go(s,a,c,h){for(var y=s.length,w=h?y:-1;(h?w--:++w<y)&&a(s[w],w,s););return c?Lt(s,h?0:w,h?w+1:y):Lt(s,h?w+1:0,h?y:w)}function ed(s,a){var c=s;return c instanceof ue&&(c=c.value()),Sl(a,function(h,y){return y.func.apply(y.thisArg,$n([h],y.args))},c)}function jl(s,a,c){var h=s.length;if(h<2)return h?Un(s[0]):[];for(var y=-1,w=I(h);++y<h;)for(var E=s[y],C=-1;++C<h;)C!=y&&(w[y]=ts(w[y]||E,s[C],a,c));return Un(Ke(w,1),a,c)}function td(s,a,c){for(var h=-1,y=s.length,w=a.length,E={};++h<y;){var C=h<w?a[h]:t;c(E,s[h],C)}return E}function Jl(s){return Ie(s)?s:[]}function Yl(s){return typeof s=="function"?s:mt}function qn(s,a){return ne(s)?s:su(s,a)?[s]:Md(ye(s))}var Wb=oe;function Kn(s,a,c){var h=s.length;return c=c===t?h:c,!a&&c>=h?s:Lt(s,a,c)}var nd=M1||function(s){return qe.clearTimeout(s)};function rd(s,a){if(a)return s.slice();var c=s.length,h=Eh?Eh(c):new s.constructor(c);return s.copy(h),h}function Xl(s){var a=new s.constructor(s.byteLength);return new to(a).set(new to(s)),a}function Ub(s,a){var c=a?Xl(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.byteLength)}function qb(s){var a=new s.constructor(s.source,$f.exec(s));return a.lastIndex=s.lastIndex,a}function Kb(s){return Qi?ve(Qi.call(s)):{}}function id(s,a){var c=a?Xl(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.length)}function sd(s,a){if(s!==a){var c=s!==t,h=s===null,y=s===s,w=wt(s),E=a!==t,C=a===null,M=a===a,L=wt(a);if(!C&&!L&&!w&&s>a||w&&E&&M&&!C&&!L||h&&E&&M||!c&&M||!y)return 1;if(!h&&!w&&!L&&s<a||L&&c&&y&&!h&&!w||C&&c&&y||!E&&y||!M)return-1}return 0}function Gb(s,a,c){for(var h=-1,y=s.criteria,w=a.criteria,E=y.length,C=c.length;++h<E;){var M=sd(y[h],w[h]);if(M){if(h>=C)return M;var L=c[h];return M*(L=="desc"?-1:1)}}return s.index-a.index}function od(s,a,c,h){for(var y=-1,w=s.length,E=c.length,C=-1,M=a.length,L=Be(w-E,0),P=I(M+L),F=!h;++C<M;)P[C]=a[C];for(;++y<E;)(F||y<w)&&(P[c[y]]=s[y]);for(;L--;)P[C++]=s[y++];return P}function ad(s,a,c,h){for(var y=-1,w=s.length,E=-1,C=c.length,M=-1,L=a.length,P=Be(w-C,0),F=I(P+L),V=!h;++y<P;)F[y]=s[y];for(var j=y;++M<L;)F[j+M]=a[M];for(;++E<C;)(V||y<w)&&(F[j+c[E]]=s[y++]);return F}function ht(s,a){var c=-1,h=s.length;for(a||(a=I(h));++c<h;)a[c]=s[c];return a}function an(s,a,c,h){var y=!c;c||(c={});for(var w=-1,E=a.length;++w<E;){var C=a[w],M=h?h(c[C],s[C],C,c,s):t;M===t&&(M=s[C]),y?En(c,C,M):es(c,C,M)}return c}function jb(s,a){return an(s,iu(s),a)}function Jb(s,a){return an(s,vd(s),a)}function yo(s,a){return function(c,h){var y=ne(c)?e1:yb,w=a?a():{};return y(c,s,Y(h,2),w)}}function oi(s){return oe(function(a,c){var h=-1,y=c.length,w=y>1?c[y-1]:t,E=y>2?c[2]:t;for(w=s.length>3&&typeof w=="function"?(y--,w):t,E&&ot(c[0],c[1],E)&&(w=y<3?t:w,y=1),a=ve(a);++h<y;){var C=c[h];C&&s(a,C,h,w)}return a})}function ld(s,a){return function(c,h){if(c==null)return c;if(!dt(c))return s(c,h);for(var y=c.length,w=a?y:-1,E=ve(c);(a?w--:++w<y)&&h(E[w],w,E)!==!1;);return c}}function ud(s){return function(a,c,h){for(var y=-1,w=ve(a),E=h(a),C=E.length;C--;){var M=E[s?C:++y];if(c(w[M],M,w)===!1)break}return a}}function Yb(s,a,c){var h=a&b,y=ss(s);function w(){var E=this&&this!==qe&&this instanceof w?y:s;return E.apply(h?c:this,arguments)}return w}function cd(s){return function(a){a=ye(a);var c=Qr(a)?Kt(a):t,h=c?c[0]:a.charAt(0),y=c?Kn(c,1).join(""):a.slice(1);return h[s]()+y}}function ai(s){return function(a){return Sl(lp(ap(a).replace($y,"")),s,"")}}function ss(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var c=si(s.prototype),h=s.apply(c,a);return Ae(h)?h:c}}function Xb(s,a,c){var h=ss(s);function y(){for(var w=arguments.length,E=I(w),C=w,M=li(y);C--;)E[C]=arguments[C];var L=w<3&&E[0]!==M&&E[w-1]!==M?[]:zn(E,M);if(w-=L.length,w<c)return md(s,a,bo,y.placeholder,t,E,L,t,t,c-w);var P=this&&this!==qe&&this instanceof y?h:s;return bt(P,this,E)}return y}function fd(s){return function(a,c,h){var y=ve(a);if(!dt(a)){var w=Y(c,3);a=He(a),c=function(C){return w(y[C],C,y)}}var E=s(a,c,h);return E>-1?y[w?a[E]:E]:t}}function hd(s){return Cn(function(a){var c=a.length,h=c,y=Nt.prototype.thru;for(s&&a.reverse();h--;){var w=a[h];if(typeof w!="function")throw new It(l);if(y&&!E&&So(w)=="wrapper")var E=new Nt([],!0)}for(h=E?h:c;++h<c;){w=a[h];var C=So(w),M=C=="wrapper"?nu(w):t;M&&ou(M[0])&&M[1]==(U|O|W|Q)&&!M[4].length&&M[9]==1?E=E[So(M[0])].apply(E,M[3]):E=w.length==1&&ou(w)?E[C]():E.thru(w)}return function(){var L=arguments,P=L[0];if(E&&L.length==1&&ne(P))return E.plant(P).value();for(var F=0,V=c?a[F].apply(this,L):P;++F<c;)V=a[F].call(this,V);return V}})}function bo(s,a,c,h,y,w,E,C,M,L){var P=a&U,F=a&b,V=a&x,j=a&(O|R),X=a&we,se=V?t:ss(s);function Z(){for(var ae=arguments.length,fe=I(ae),St=ae;St--;)fe[St]=arguments[St];if(j)var at=li(Z),xt=u1(fe,at);if(h&&(fe=od(fe,h,y,j)),w&&(fe=ad(fe,w,E,j)),ae-=xt,j&&ae<L){var Ne=zn(fe,at);return md(s,a,bo,Z.placeholder,c,fe,Ne,C,M,L-ae)}var Jt=F?c:this,Mn=V?Jt[s]:s;return ae=fe.length,C?fe=y_(fe,C):X&&ae>1&&fe.reverse(),P&&M<ae&&(fe.length=M),this&&this!==qe&&this instanceof Z&&(Mn=se||ss(Mn)),Mn.apply(Jt,fe)}return Z}function dd(s,a){return function(c,h){return kb(c,s,a(h),{})}}function _o(s,a){return function(c,h){var y;if(c===t&&h===t)return a;if(c!==t&&(y=c),h!==t){if(y===t)return h;typeof c=="string"||typeof h=="string"?(c=vt(c),h=vt(h)):(c=Zh(c),h=Zh(h)),y=s(c,h)}return y}}function Zl(s){return Cn(function(a){return a=ke(a,_t(Y())),oe(function(c){var h=this;return s(a,function(y){return bt(y,h,c)})})})}function vo(s,a){a=a===t?" ":vt(a);var c=a.length;if(c<2)return c?ql(a,s):a;var h=ql(a,so(s/ei(a)));return Qr(a)?Kn(Kt(h),0,s).join(""):h.slice(0,s)}function Zb(s,a,c,h){var y=a&b,w=ss(s);function E(){for(var C=-1,M=arguments.length,L=-1,P=h.length,F=I(P+M),V=this&&this!==qe&&this instanceof E?w:s;++L<P;)F[L]=h[L];for(;M--;)F[L++]=arguments[++C];return bt(V,y?c:this,F)}return E}function pd(s){return function(a,c,h){return h&&typeof h!="number"&&ot(a,c,h)&&(c=h=t),a=Tn(a),c===t?(c=a,a=0):c=Tn(c),h=h===t?a<c?1:-1:Tn(h),Fb(a,c,h,s)}}function wo(s){return function(a,c){return typeof a=="string"&&typeof c=="string"||(a=Dt(a),c=Dt(c)),s(a,c)}}function md(s,a,c,h,y,w,E,C,M,L){var P=a&O,F=P?E:t,V=P?t:E,j=P?w:t,X=P?t:w;a|=P?W:D,a&=~(P?D:W),a&A||(a&=~(b|x));var se=[s,a,y,j,F,X,V,C,M,L],Z=c.apply(t,se);return ou(s)&&Ad(Z,se),Z.placeholder=h,Od(Z,s,a)}function Ql(s){var a=Fe[s];return function(c,h){if(c=Dt(c),h=h==null?0:Qe(re(h),292),h&&Oh(c)){var y=(ye(c)+"e").split("e"),w=a(y[0]+"e"+(+y[1]+h));return y=(ye(w)+"e").split("e"),+(y[0]+"e"+(+y[1]-h))}return a(c)}}var Qb=ri&&1/Js(new ri([,-0]))[1]==rt?function(s){return new ri(s)}:wu;function gd(s){return function(a){var c=et(a);return c==Ut?Tl(a):c==qt?g1(a):l1(a,s(a))}}function kn(s,a,c,h,y,w,E,C){var M=a&x;if(!M&&typeof s!="function")throw new It(l);var L=h?h.length:0;if(L||(a&=~(W|D),h=y=t),E=E===t?E:Be(re(E),0),C=C===t?C:re(C),L-=y?y.length:0,a&D){var P=h,F=y;h=y=t}var V=M?t:nu(s),j=[s,a,c,h,y,P,F,w,E,C];if(V&&p_(j,V),s=j[0],a=j[1],c=j[2],h=j[3],y=j[4],C=j[9]=j[9]===t?M?0:s.length:Be(j[9]-L,0),!C&&a&(O|R)&&(a&=~(O|R)),!a||a==b)var X=Yb(s,a,c);else a==O||a==R?X=Xb(s,a,C):(a==W||a==(b|W))&&!y.length?X=Zb(s,a,c,h):X=bo.apply(t,j);var se=V?Yh:Ad;return Od(se(X,j),s,a)}function yd(s,a,c,h){return s===t||jt(s,ni[c])&&!_e.call(h,c)?a:s}function bd(s,a,c,h,y,w){return Ae(s)&&Ae(a)&&(w.set(a,s),po(s,a,t,bd,w),w.delete(a)),s}function e_(s){return us(s)?t:s}function _d(s,a,c,h,y,w){var E=c&k,C=s.length,M=a.length;if(C!=M&&!(E&&M>C))return!1;var L=w.get(s),P=w.get(a);if(L&&P)return L==a&&P==s;var F=-1,V=!0,j=c&m?new yr:t;for(w.set(s,a),w.set(a,s);++F<C;){var X=s[F],se=a[F];if(h)var Z=E?h(se,X,F,a,s,w):h(X,se,F,s,a,w);if(Z!==t){if(Z)continue;V=!1;break}if(j){if(!xl(a,function(ae,fe){if(!ji(j,fe)&&(X===ae||y(X,ae,c,h,w)))return j.push(fe)})){V=!1;break}}else if(!(X===se||y(X,se,c,h,w))){V=!1;break}}return w.delete(s),w.delete(a),V}function t_(s,a,c,h,y,w,E){switch(c){case Yr:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Gi:return!(s.byteLength!=a.byteLength||!w(new to(s),new to(a)));case zi:case Vi:case Wi:return jt(+s,+a);case zs:return s.name==a.name&&s.message==a.message;case Ui:case qi:return s==a+"";case Ut:var C=Tl;case qt:var M=h&k;if(C||(C=Js),s.size!=a.size&&!M)return!1;var L=E.get(s);if(L)return L==a;h|=m,E.set(s,a);var P=_d(C(s),C(a),h,y,w,E);return E.delete(s),P;case Ws:if(Qi)return Qi.call(s)==Qi.call(a)}return!1}function n_(s,a,c,h,y,w){var E=c&k,C=eu(s),M=C.length,L=eu(a),P=L.length;if(M!=P&&!E)return!1;for(var F=M;F--;){var V=C[F];if(!(E?V in a:_e.call(a,V)))return!1}var j=w.get(s),X=w.get(a);if(j&&X)return j==a&&X==s;var se=!0;w.set(s,a),w.set(a,s);for(var Z=E;++F<M;){V=C[F];var ae=s[V],fe=a[V];if(h)var St=E?h(fe,ae,V,a,s,w):h(ae,fe,V,s,a,w);if(!(St===t?ae===fe||y(ae,fe,c,h,w):St)){se=!1;break}Z||(Z=V=="constructor")}if(se&&!Z){var at=s.constructor,xt=a.constructor;at!=xt&&"constructor"in s&&"constructor"in a&&!(typeof at=="function"&&at instanceof at&&typeof xt=="function"&&xt instanceof xt)&&(se=!1)}return w.delete(s),w.delete(a),se}function Cn(s){return lu(kd(s,t,Ld),s+"")}function eu(s){return Hh(s,He,iu)}function tu(s){return Hh(s,pt,vd)}var nu=ao?function(s){return ao.get(s)}:wu;function So(s){for(var a=s.name+"",c=ii[a],h=_e.call(ii,a)?c.length:0;h--;){var y=c[h],w=y.func;if(w==null||w==s)return y.name}return a}function li(s){var a=_e.call(v,"placeholder")?v:s;return a.placeholder}function Y(){var s=v.iteratee||_u;return s=s===_u?Vh:s,arguments.length?s(arguments[0],arguments[1]):s}function xo(s,a){var c=s.__data__;return c_(a)?c[typeof a=="string"?"string":"hash"]:c.map}function ru(s){for(var a=He(s),c=a.length;c--;){var h=a[c],y=s[h];a[c]=[h,y,xd(y)]}return a}function vr(s,a){var c=d1(s,a);return zh(c)?c:t}function r_(s){var a=_e.call(s,mr),c=s[mr];try{s[mr]=t;var h=!0}catch{}var y=Qs.call(s);return h&&(a?s[mr]=c:delete s[mr]),y}var iu=Il?function(s){return s==null?[]:(s=ve(s),Hn(Il(s),function(a){return Ch.call(s,a)}))}:Su,vd=Il?function(s){for(var a=[];s;)$n(a,iu(s)),s=no(s);return a}:Su,et=st;(Nl&&et(new Nl(new ArrayBuffer(1)))!=Yr||Yi&&et(new Yi)!=Ut||Rl&&et(Rl.resolve())!=Df||ri&&et(new ri)!=qt||Xi&&et(new Xi)!=Ki)&&(et=function(s){var a=st(s),c=a==wn?s.constructor:t,h=c?wr(c):"";if(h)switch(h){case H1:return Yr;case $1:return Ut;case z1:return Df;case V1:return qt;case W1:return Ki}return a});function i_(s,a,c){for(var h=-1,y=c.length;++h<y;){var w=c[h],E=w.size;switch(w.type){case"drop":s+=E;break;case"dropRight":a-=E;break;case"take":a=Qe(a,s+E);break;case"takeRight":s=Be(s,a-E);break}}return{start:s,end:a}}function s_(s){var a=s.match(fy);return a?a[1].split(hy):[]}function wd(s,a,c){a=qn(a,s);for(var h=-1,y=a.length,w=!1;++h<y;){var E=ln(a[h]);if(!(w=s!=null&&c(s,E)))break;s=s[E]}return w||++h!=y?w:(y=s==null?0:s.length,!!y&&Mo(y)&&An(E,y)&&(ne(s)||Sr(s)))}function o_(s){var a=s.length,c=new s.constructor(a);return a&&typeof s[0]=="string"&&_e.call(s,"index")&&(c.index=s.index,c.input=s.input),c}function Sd(s){return typeof s.constructor=="function"&&!as(s)?si(no(s)):{}}function a_(s,a,c){var h=s.constructor;switch(a){case Gi:return Xl(s);case zi:case Vi:return new h(+s);case Yr:return Ub(s,c);case rl:case il:case sl:case ol:case al:case ll:case ul:case cl:case fl:return id(s,c);case Ut:return new h;case Wi:case qi:return new h(s);case Ui:return qb(s);case qt:return new h;case Ws:return Kb(s)}}function l_(s,a){var c=a.length;if(!c)return s;var h=c-1;return a[h]=(c>1?"& ":"")+a[h],a=a.join(c>2?", ":" "),s.replace(cy,`{
|
|
41
|
-
/* [wrapped with `+
|
|
42
|
-
`)}function u_(s){return ne(s)||Sr(s)||!!(Ah&&s&&s[Ah])}function An(s,a){var c=typeof s;return a=a??Ze,!!a&&(c=="number"||c!="symbol"&&wy.test(s))&&s>-1&&s%1==0&&s<a}function ot(s,a,c){if(!Ae(c))return!1;var h=typeof a;return(h=="number"?dt(c)&&An(a,c.length):h=="string"&&a in c)?jt(c[a],s):!1}function su(s,a){if(ne(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||wt(s)?!0:oy.test(s)||!sy.test(s)||a!=null&&s in ve(a)}function c_(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function ou(s){var a=So(s),c=v[a];if(typeof c!="function"||!(a in ue.prototype))return!1;if(s===c)return!0;var h=nu(c);return!!h&&s===h[0]}function f_(s){return!!xh&&xh in s}var h_=Xs?On:xu;function as(s){var a=s&&s.constructor,c=typeof a=="function"&&a.prototype||ni;return s===c}function xd(s){return s===s&&!Ae(s)}function Ed(s,a){return function(c){return c==null?!1:c[s]===a&&(a!==t||s in ve(c))}}function d_(s){var a=Oo(s,function(h){return c.size===d&&c.clear(),h}),c=a.cache;return a}function p_(s,a){var c=s[1],h=a[1],y=c|h,w=y<(b|x|U),E=h==U&&c==O||h==U&&c==Q&&s[7].length<=a[8]||h==(U|Q)&&a[7].length<=a[8]&&c==O;if(!(w||E))return s;h&b&&(s[2]=a[2],y|=c&b?0:A);var C=a[3];if(C){var M=s[3];s[3]=M?od(M,C,a[4]):C,s[4]=M?zn(s[3],g):a[4]}return C=a[5],C&&(M=s[5],s[5]=M?ad(M,C,a[6]):C,s[6]=M?zn(s[5],g):a[6]),C=a[7],C&&(s[7]=C),h&U&&(s[8]=s[8]==null?a[8]:Qe(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=y,s}function m_(s){var a=[];if(s!=null)for(var c in ve(s))a.push(c);return a}function g_(s){return Qs.call(s)}function kd(s,a,c){return a=Be(a===t?s.length-1:a,0),function(){for(var h=arguments,y=-1,w=Be(h.length-a,0),E=I(w);++y<w;)E[y]=h[a+y];y=-1;for(var C=I(a+1);++y<a;)C[y]=h[y];return C[a]=c(E),bt(s,this,C)}}function Cd(s,a){return a.length<2?s:_r(s,Lt(a,0,-1))}function y_(s,a){for(var c=s.length,h=Qe(a.length,c),y=ht(s);h--;){var w=a[h];s[h]=An(w,c)?y[w]:t}return s}function au(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var Ad=Td(Yh),ls=N1||function(s,a){return qe.setTimeout(s,a)},lu=Td($b);function Od(s,a,c){var h=a+"";return lu(s,l_(h,b_(s_(h),c)))}function Td(s){var a=0,c=0;return function(){var h=D1(),y=qr-(h-c);if(c=h,y>0){if(++a>=_n)return arguments[0]}else a=0;return s.apply(t,arguments)}}function Eo(s,a){var c=-1,h=s.length,y=h-1;for(a=a===t?h:a;++c<a;){var w=Ul(c,y),E=s[w];s[w]=s[c],s[c]=E}return s.length=a,s}var Md=d_(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(ay,function(c,h,y,w){a.push(y?w.replace(my,"$1"):h||c)}),a});function ln(s){if(typeof s=="string"||wt(s))return s;var a=s+"";return a=="0"&&1/s==-rt?"-0":a}function wr(s){if(s!=null){try{return Zs.call(s)}catch{}try{return s+""}catch{}}return""}function b_(s,a){return Mt(q0,function(c){var h="_."+c[0];a&c[1]&&!Gs(s,h)&&s.push(h)}),s.sort()}function Id(s){if(s instanceof ue)return s.clone();var a=new Nt(s.__wrapped__,s.__chain__);return a.__actions__=ht(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function __(s,a,c){(c?ot(s,a,c):a===t)?a=1:a=Be(re(a),0);var h=s==null?0:s.length;if(!h||a<1)return[];for(var y=0,w=0,E=I(so(h/a));y<h;)E[w++]=Lt(s,y,y+=a);return E}function v_(s){for(var a=-1,c=s==null?0:s.length,h=0,y=[];++a<c;){var w=s[a];w&&(y[h++]=w)}return y}function w_(){var s=arguments.length;if(!s)return[];for(var a=I(s-1),c=arguments[0],h=s;h--;)a[h-1]=arguments[h];return $n(ne(c)?ht(c):[c],Ke(a,1))}var S_=oe(function(s,a){return Ie(s)?ts(s,Ke(a,1,Ie,!0)):[]}),x_=oe(function(s,a){var c=Pt(a);return Ie(c)&&(c=t),Ie(s)?ts(s,Ke(a,1,Ie,!0),Y(c,2)):[]}),E_=oe(function(s,a){var c=Pt(a);return Ie(c)&&(c=t),Ie(s)?ts(s,Ke(a,1,Ie,!0),t,c):[]});function k_(s,a,c){var h=s==null?0:s.length;return h?(a=c||a===t?1:re(a),Lt(s,a<0?0:a,h)):[]}function C_(s,a,c){var h=s==null?0:s.length;return h?(a=c||a===t?1:re(a),a=h-a,Lt(s,0,a<0?0:a)):[]}function A_(s,a){return s&&s.length?go(s,Y(a,3),!0,!0):[]}function O_(s,a){return s&&s.length?go(s,Y(a,3),!0):[]}function T_(s,a,c,h){var y=s==null?0:s.length;return y?(c&&typeof c!="number"&&ot(s,a,c)&&(c=0,h=y),wb(s,a,c,h)):[]}function Nd(s,a,c){var h=s==null?0:s.length;if(!h)return-1;var y=c==null?0:re(c);return y<0&&(y=Be(h+y,0)),js(s,Y(a,3),y)}function Rd(s,a,c){var h=s==null?0:s.length;if(!h)return-1;var y=h-1;return c!==t&&(y=re(c),y=c<0?Be(h+y,0):Qe(y,h-1)),js(s,Y(a,3),y,!0)}function Ld(s){var a=s==null?0:s.length;return a?Ke(s,1):[]}function M_(s){var a=s==null?0:s.length;return a?Ke(s,rt):[]}function I_(s,a){var c=s==null?0:s.length;return c?(a=a===t?1:re(a),Ke(s,a)):[]}function N_(s){for(var a=-1,c=s==null?0:s.length,h={};++a<c;){var y=s[a];h[y[0]]=y[1]}return h}function Pd(s){return s&&s.length?s[0]:t}function R_(s,a,c){var h=s==null?0:s.length;if(!h)return-1;var y=c==null?0:re(c);return y<0&&(y=Be(h+y,0)),Zr(s,a,y)}function L_(s){var a=s==null?0:s.length;return a?Lt(s,0,-1):[]}var P_=oe(function(s){var a=ke(s,Jl);return a.length&&a[0]===s[0]?Hl(a):[]}),D_=oe(function(s){var a=Pt(s),c=ke(s,Jl);return a===Pt(c)?a=t:c.pop(),c.length&&c[0]===s[0]?Hl(c,Y(a,2)):[]}),F_=oe(function(s){var a=Pt(s),c=ke(s,Jl);return a=typeof a=="function"?a:t,a&&c.pop(),c.length&&c[0]===s[0]?Hl(c,t,a):[]});function B_(s,a){return s==null?"":L1.call(s,a)}function Pt(s){var a=s==null?0:s.length;return a?s[a-1]:t}function H_(s,a,c){var h=s==null?0:s.length;if(!h)return-1;var y=h;return c!==t&&(y=re(c),y=y<0?Be(h+y,0):Qe(y,h-1)),a===a?b1(s,a,y):js(s,mh,y,!0)}function $_(s,a){return s&&s.length?Kh(s,re(a)):t}var z_=oe(Dd);function Dd(s,a){return s&&s.length&&a&&a.length?Wl(s,a):s}function V_(s,a,c){return s&&s.length&&a&&a.length?Wl(s,a,Y(c,2)):s}function W_(s,a,c){return s&&s.length&&a&&a.length?Wl(s,a,t,c):s}var U_=Cn(function(s,a){var c=s==null?0:s.length,h=Pl(s,a);return Jh(s,ke(a,function(y){return An(y,c)?+y:y}).sort(sd)),h});function q_(s,a){var c=[];if(!(s&&s.length))return c;var h=-1,y=[],w=s.length;for(a=Y(a,3);++h<w;){var E=s[h];a(E,h,s)&&(c.push(E),y.push(h))}return Jh(s,y),c}function uu(s){return s==null?s:B1.call(s)}function K_(s,a,c){var h=s==null?0:s.length;return h?(c&&typeof c!="number"&&ot(s,a,c)?(a=0,c=h):(a=a==null?0:re(a),c=c===t?h:re(c)),Lt(s,a,c)):[]}function G_(s,a){return mo(s,a)}function j_(s,a,c){return Kl(s,a,Y(c,2))}function J_(s,a){var c=s==null?0:s.length;if(c){var h=mo(s,a);if(h<c&&jt(s[h],a))return h}return-1}function Y_(s,a){return mo(s,a,!0)}function X_(s,a,c){return Kl(s,a,Y(c,2),!0)}function Z_(s,a){var c=s==null?0:s.length;if(c){var h=mo(s,a,!0)-1;if(jt(s[h],a))return h}return-1}function Q_(s){return s&&s.length?Xh(s):[]}function ev(s,a){return s&&s.length?Xh(s,Y(a,2)):[]}function tv(s){var a=s==null?0:s.length;return a?Lt(s,1,a):[]}function nv(s,a,c){return s&&s.length?(a=c||a===t?1:re(a),Lt(s,0,a<0?0:a)):[]}function rv(s,a,c){var h=s==null?0:s.length;return h?(a=c||a===t?1:re(a),a=h-a,Lt(s,a<0?0:a,h)):[]}function iv(s,a){return s&&s.length?go(s,Y(a,3),!1,!0):[]}function sv(s,a){return s&&s.length?go(s,Y(a,3)):[]}var ov=oe(function(s){return Un(Ke(s,1,Ie,!0))}),av=oe(function(s){var a=Pt(s);return Ie(a)&&(a=t),Un(Ke(s,1,Ie,!0),Y(a,2))}),lv=oe(function(s){var a=Pt(s);return a=typeof a=="function"?a:t,Un(Ke(s,1,Ie,!0),t,a)});function uv(s){return s&&s.length?Un(s):[]}function cv(s,a){return s&&s.length?Un(s,Y(a,2)):[]}function fv(s,a){return a=typeof a=="function"?a:t,s&&s.length?Un(s,t,a):[]}function cu(s){if(!(s&&s.length))return[];var a=0;return s=Hn(s,function(c){if(Ie(c))return a=Be(c.length,a),!0}),Al(a,function(c){return ke(s,El(c))})}function Fd(s,a){if(!(s&&s.length))return[];var c=cu(s);return a==null?c:ke(c,function(h){return bt(a,t,h)})}var hv=oe(function(s,a){return Ie(s)?ts(s,a):[]}),dv=oe(function(s){return jl(Hn(s,Ie))}),pv=oe(function(s){var a=Pt(s);return Ie(a)&&(a=t),jl(Hn(s,Ie),Y(a,2))}),mv=oe(function(s){var a=Pt(s);return a=typeof a=="function"?a:t,jl(Hn(s,Ie),t,a)}),gv=oe(cu);function yv(s,a){return td(s||[],a||[],es)}function bv(s,a){return td(s||[],a||[],is)}var _v=oe(function(s){var a=s.length,c=a>1?s[a-1]:t;return c=typeof c=="function"?(s.pop(),c):t,Fd(s,c)});function Bd(s){var a=v(s);return a.__chain__=!0,a}function vv(s,a){return a(s),s}function ko(s,a){return a(s)}var wv=Cn(function(s){var a=s.length,c=a?s[0]:0,h=this.__wrapped__,y=function(w){return Pl(w,s)};return a>1||this.__actions__.length||!(h instanceof ue)||!An(c)?this.thru(y):(h=h.slice(c,+c+(a?1:0)),h.__actions__.push({func:ko,args:[y],thisArg:t}),new Nt(h,this.__chain__).thru(function(w){return a&&!w.length&&w.push(t),w}))});function Sv(){return Bd(this)}function xv(){return new Nt(this.value(),this.__chain__)}function Ev(){this.__values__===t&&(this.__values__=Zd(this.value()));var s=this.__index__>=this.__values__.length,a=s?t:this.__values__[this.__index__++];return{done:s,value:a}}function kv(){return this}function Cv(s){for(var a,c=this;c instanceof uo;){var h=Id(c);h.__index__=0,h.__values__=t,a?y.__wrapped__=h:a=h;var y=h;c=c.__wrapped__}return y.__wrapped__=s,a}function Av(){var s=this.__wrapped__;if(s instanceof ue){var a=s;return this.__actions__.length&&(a=new ue(this)),a=a.reverse(),a.__actions__.push({func:ko,args:[uu],thisArg:t}),new Nt(a,this.__chain__)}return this.thru(uu)}function Ov(){return ed(this.__wrapped__,this.__actions__)}var Tv=yo(function(s,a,c){_e.call(s,c)?++s[c]:En(s,c,1)});function Mv(s,a,c){var h=ne(s)?dh:vb;return c&&ot(s,a,c)&&(a=t),h(s,Y(a,3))}function Iv(s,a){var c=ne(s)?Hn:Fh;return c(s,Y(a,3))}var Nv=fd(Nd),Rv=fd(Rd);function Lv(s,a){return Ke(Co(s,a),1)}function Pv(s,a){return Ke(Co(s,a),rt)}function Dv(s,a,c){return c=c===t?1:re(c),Ke(Co(s,a),c)}function Hd(s,a){var c=ne(s)?Mt:Wn;return c(s,Y(a,3))}function $d(s,a){var c=ne(s)?t1:Dh;return c(s,Y(a,3))}var Fv=yo(function(s,a,c){_e.call(s,c)?s[c].push(a):En(s,c,[a])});function Bv(s,a,c,h){s=dt(s)?s:ci(s),c=c&&!h?re(c):0;var y=s.length;return c<0&&(c=Be(y+c,0)),Io(s)?c<=y&&s.indexOf(a,c)>-1:!!y&&Zr(s,a,c)>-1}var Hv=oe(function(s,a,c){var h=-1,y=typeof a=="function",w=dt(s)?I(s.length):[];return Wn(s,function(E){w[++h]=y?bt(a,E,c):ns(E,a,c)}),w}),$v=yo(function(s,a,c){En(s,c,a)});function Co(s,a){var c=ne(s)?ke:Wh;return c(s,Y(a,3))}function zv(s,a,c,h){return s==null?[]:(ne(a)||(a=a==null?[]:[a]),c=h?t:c,ne(c)||(c=c==null?[]:[c]),Gh(s,a,c))}var Vv=yo(function(s,a,c){s[c?0:1].push(a)},function(){return[[],[]]});function Wv(s,a,c){var h=ne(s)?Sl:yh,y=arguments.length<3;return h(s,Y(a,4),c,y,Wn)}function Uv(s,a,c){var h=ne(s)?n1:yh,y=arguments.length<3;return h(s,Y(a,4),c,y,Dh)}function qv(s,a){var c=ne(s)?Hn:Fh;return c(s,To(Y(a,3)))}function Kv(s){var a=ne(s)?Nh:Bb;return a(s)}function Gv(s,a,c){(c?ot(s,a,c):a===t)?a=1:a=re(a);var h=ne(s)?mb:Hb;return h(s,a)}function jv(s){var a=ne(s)?gb:zb;return a(s)}function Jv(s){if(s==null)return 0;if(dt(s))return Io(s)?ei(s):s.length;var a=et(s);return a==Ut||a==qt?s.size:zl(s).length}function Yv(s,a,c){var h=ne(s)?xl:Vb;return c&&ot(s,a,c)&&(a=t),h(s,Y(a,3))}var Xv=oe(function(s,a){if(s==null)return[];var c=a.length;return c>1&&ot(s,a[0],a[1])?a=[]:c>2&&ot(a[0],a[1],a[2])&&(a=[a[0]]),Gh(s,Ke(a,1),[])}),Ao=I1||function(){return qe.Date.now()};function Zv(s,a){if(typeof a!="function")throw new It(l);return s=re(s),function(){if(--s<1)return a.apply(this,arguments)}}function zd(s,a,c){return a=c?t:a,a=s&&a==null?s.length:a,kn(s,U,t,t,t,t,a)}function Vd(s,a){var c;if(typeof a!="function")throw new It(l);return s=re(s),function(){return--s>0&&(c=a.apply(this,arguments)),s<=1&&(a=t),c}}var fu=oe(function(s,a,c){var h=b;if(c.length){var y=zn(c,li(fu));h|=W}return kn(s,h,a,c,y)}),Wd=oe(function(s,a,c){var h=b|x;if(c.length){var y=zn(c,li(Wd));h|=W}return kn(a,h,s,c,y)});function Ud(s,a,c){a=c?t:a;var h=kn(s,O,t,t,t,t,t,a);return h.placeholder=Ud.placeholder,h}function qd(s,a,c){a=c?t:a;var h=kn(s,R,t,t,t,t,t,a);return h.placeholder=qd.placeholder,h}function Kd(s,a,c){var h,y,w,E,C,M,L=0,P=!1,F=!1,V=!0;if(typeof s!="function")throw new It(l);a=Dt(a)||0,Ae(c)&&(P=!!c.leading,F="maxWait"in c,w=F?Be(Dt(c.maxWait)||0,a):w,V="trailing"in c?!!c.trailing:V);function j(Ne){var Jt=h,Mn=y;return h=y=t,L=Ne,E=s.apply(Mn,Jt),E}function X(Ne){return L=Ne,C=ls(ae,a),P?j(Ne):E}function se(Ne){var Jt=Ne-M,Mn=Ne-L,fp=a-Jt;return F?Qe(fp,w-Mn):fp}function Z(Ne){var Jt=Ne-M,Mn=Ne-L;return M===t||Jt>=a||Jt<0||F&&Mn>=w}function ae(){var Ne=Ao();if(Z(Ne))return fe(Ne);C=ls(ae,se(Ne))}function fe(Ne){return C=t,V&&h?j(Ne):(h=y=t,E)}function St(){C!==t&&nd(C),L=0,h=M=y=C=t}function at(){return C===t?E:fe(Ao())}function xt(){var Ne=Ao(),Jt=Z(Ne);if(h=arguments,y=this,M=Ne,Jt){if(C===t)return X(M);if(F)return nd(C),C=ls(ae,a),j(M)}return C===t&&(C=ls(ae,a)),E}return xt.cancel=St,xt.flush=at,xt}var Qv=oe(function(s,a){return Ph(s,1,a)}),ew=oe(function(s,a,c){return Ph(s,Dt(a)||0,c)});function tw(s){return kn(s,we)}function Oo(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new It(l);var c=function(){var h=arguments,y=a?a.apply(this,h):h[0],w=c.cache;if(w.has(y))return w.get(y);var E=s.apply(this,h);return c.cache=w.set(y,E)||w,E};return c.cache=new(Oo.Cache||xn),c}Oo.Cache=xn;function To(s){if(typeof s!="function")throw new It(l);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function nw(s){return Vd(2,s)}var rw=Wb(function(s,a){a=a.length==1&&ne(a[0])?ke(a[0],_t(Y())):ke(Ke(a,1),_t(Y()));var c=a.length;return oe(function(h){for(var y=-1,w=Qe(h.length,c);++y<w;)h[y]=a[y].call(this,h[y]);return bt(s,this,h)})}),hu=oe(function(s,a){var c=zn(a,li(hu));return kn(s,W,t,a,c)}),Gd=oe(function(s,a){var c=zn(a,li(Gd));return kn(s,D,t,a,c)}),iw=Cn(function(s,a){return kn(s,Q,t,t,t,a)});function sw(s,a){if(typeof s!="function")throw new It(l);return a=a===t?a:re(a),oe(s,a)}function ow(s,a){if(typeof s!="function")throw new It(l);return a=a==null?0:Be(re(a),0),oe(function(c){var h=c[a],y=Kn(c,0,a);return h&&$n(y,h),bt(s,this,y)})}function aw(s,a,c){var h=!0,y=!0;if(typeof s!="function")throw new It(l);return Ae(c)&&(h="leading"in c?!!c.leading:h,y="trailing"in c?!!c.trailing:y),Kd(s,a,{leading:h,maxWait:a,trailing:y})}function lw(s){return zd(s,1)}function uw(s,a){return hu(Yl(a),s)}function cw(){if(!arguments.length)return[];var s=arguments[0];return ne(s)?s:[s]}function fw(s){return Rt(s,S)}function hw(s,a){return a=typeof a=="function"?a:t,Rt(s,S,a)}function dw(s){return Rt(s,p|S)}function pw(s,a){return a=typeof a=="function"?a:t,Rt(s,p|S,a)}function mw(s,a){return a==null||Lh(s,a,He(a))}function jt(s,a){return s===a||s!==s&&a!==a}var gw=wo(Bl),yw=wo(function(s,a){return s>=a}),Sr=$h(function(){return arguments}())?$h:function(s){return Me(s)&&_e.call(s,"callee")&&!Ch.call(s,"callee")},ne=I.isArray,bw=ah?_t(ah):Cb;function dt(s){return s!=null&&Mo(s.length)&&!On(s)}function Ie(s){return Me(s)&&dt(s)}function _w(s){return s===!0||s===!1||Me(s)&&st(s)==zi}var Gn=R1||xu,vw=lh?_t(lh):Ab;function ww(s){return Me(s)&&s.nodeType===1&&!us(s)}function Sw(s){if(s==null)return!0;if(dt(s)&&(ne(s)||typeof s=="string"||typeof s.splice=="function"||Gn(s)||ui(s)||Sr(s)))return!s.length;var a=et(s);if(a==Ut||a==qt)return!s.size;if(as(s))return!zl(s).length;for(var c in s)if(_e.call(s,c))return!1;return!0}function xw(s,a){return rs(s,a)}function Ew(s,a,c){c=typeof c=="function"?c:t;var h=c?c(s,a):t;return h===t?rs(s,a,t,c):!!h}function du(s){if(!Me(s))return!1;var a=st(s);return a==zs||a==G0||typeof s.message=="string"&&typeof s.name=="string"&&!us(s)}function kw(s){return typeof s=="number"&&Oh(s)}function On(s){if(!Ae(s))return!1;var a=st(s);return a==Vs||a==Pf||a==K0||a==J0}function jd(s){return typeof s=="number"&&s==re(s)}function Mo(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Ze}function Ae(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function Me(s){return s!=null&&typeof s=="object"}var Jd=uh?_t(uh):Tb;function Cw(s,a){return s===a||$l(s,a,ru(a))}function Aw(s,a,c){return c=typeof c=="function"?c:t,$l(s,a,ru(a),c)}function Ow(s){return Yd(s)&&s!=+s}function Tw(s){if(h_(s))throw new te(o);return zh(s)}function Mw(s){return s===null}function Iw(s){return s==null}function Yd(s){return typeof s=="number"||Me(s)&&st(s)==Wi}function us(s){if(!Me(s)||st(s)!=wn)return!1;var a=no(s);if(a===null)return!0;var c=_e.call(a,"constructor")&&a.constructor;return typeof c=="function"&&c instanceof c&&Zs.call(c)==A1}var pu=ch?_t(ch):Mb;function Nw(s){return jd(s)&&s>=-Ze&&s<=Ze}var Xd=fh?_t(fh):Ib;function Io(s){return typeof s=="string"||!ne(s)&&Me(s)&&st(s)==qi}function wt(s){return typeof s=="symbol"||Me(s)&&st(s)==Ws}var ui=hh?_t(hh):Nb;function Rw(s){return s===t}function Lw(s){return Me(s)&&et(s)==Ki}function Pw(s){return Me(s)&&st(s)==X0}var Dw=wo(Vl),Fw=wo(function(s,a){return s<=a});function Zd(s){if(!s)return[];if(dt(s))return Io(s)?Kt(s):ht(s);if(Ji&&s[Ji])return m1(s[Ji]());var a=et(s),c=a==Ut?Tl:a==qt?Js:ci;return c(s)}function Tn(s){if(!s)return s===0?s:0;if(s=Dt(s),s===rt||s===-rt){var a=s<0?-1:1;return a*vn}return s===s?s:0}function re(s){var a=Tn(s),c=a%1;return a===a?c?a-c:a:0}function Qd(s){return s?br(re(s),0,it):0}function Dt(s){if(typeof s=="number")return s;if(wt(s))return sn;if(Ae(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=Ae(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=bh(s);var c=by.test(s);return c||vy.test(s)?Zy(s.slice(2),c?2:8):yy.test(s)?sn:+s}function ep(s){return an(s,pt(s))}function Bw(s){return s?br(re(s),-Ze,Ze):s===0?s:0}function ye(s){return s==null?"":vt(s)}var Hw=oi(function(s,a){if(as(a)||dt(a)){an(a,He(a),s);return}for(var c in a)_e.call(a,c)&&es(s,c,a[c])}),tp=oi(function(s,a){an(a,pt(a),s)}),No=oi(function(s,a,c,h){an(a,pt(a),s,h)}),$w=oi(function(s,a,c,h){an(a,He(a),s,h)}),zw=Cn(Pl);function Vw(s,a){var c=si(s);return a==null?c:Rh(c,a)}var Ww=oe(function(s,a){s=ve(s);var c=-1,h=a.length,y=h>2?a[2]:t;for(y&&ot(a[0],a[1],y)&&(h=1);++c<h;)for(var w=a[c],E=pt(w),C=-1,M=E.length;++C<M;){var L=E[C],P=s[L];(P===t||jt(P,ni[L])&&!_e.call(s,L))&&(s[L]=w[L])}return s}),Uw=oe(function(s){return s.push(t,bd),bt(np,t,s)});function qw(s,a){return ph(s,Y(a,3),on)}function Kw(s,a){return ph(s,Y(a,3),Fl)}function Gw(s,a){return s==null?s:Dl(s,Y(a,3),pt)}function jw(s,a){return s==null?s:Bh(s,Y(a,3),pt)}function Jw(s,a){return s&&on(s,Y(a,3))}function Yw(s,a){return s&&Fl(s,Y(a,3))}function Xw(s){return s==null?[]:ho(s,He(s))}function Zw(s){return s==null?[]:ho(s,pt(s))}function mu(s,a,c){var h=s==null?t:_r(s,a);return h===t?c:h}function Qw(s,a){return s!=null&&wd(s,a,Sb)}function gu(s,a){return s!=null&&wd(s,a,xb)}var eS=dd(function(s,a,c){a!=null&&typeof a.toString!="function"&&(a=Qs.call(a)),s[a]=c},bu(mt)),tS=dd(function(s,a,c){a!=null&&typeof a.toString!="function"&&(a=Qs.call(a)),_e.call(s,a)?s[a].push(c):s[a]=[c]},Y),nS=oe(ns);function He(s){return dt(s)?Ih(s):zl(s)}function pt(s){return dt(s)?Ih(s,!0):Rb(s)}function rS(s,a){var c={};return a=Y(a,3),on(s,function(h,y,w){En(c,a(h,y,w),h)}),c}function iS(s,a){var c={};return a=Y(a,3),on(s,function(h,y,w){En(c,y,a(h,y,w))}),c}var sS=oi(function(s,a,c){po(s,a,c)}),np=oi(function(s,a,c,h){po(s,a,c,h)}),oS=Cn(function(s,a){var c={};if(s==null)return c;var h=!1;a=ke(a,function(w){return w=qn(w,s),h||(h=w.length>1),w}),an(s,tu(s),c),h&&(c=Rt(c,p|_|S,e_));for(var y=a.length;y--;)Gl(c,a[y]);return c});function aS(s,a){return rp(s,To(Y(a)))}var lS=Cn(function(s,a){return s==null?{}:Pb(s,a)});function rp(s,a){if(s==null)return{};var c=ke(tu(s),function(h){return[h]});return a=Y(a),jh(s,c,function(h,y){return a(h,y[0])})}function uS(s,a,c){a=qn(a,s);var h=-1,y=a.length;for(y||(y=1,s=t);++h<y;){var w=s==null?t:s[ln(a[h])];w===t&&(h=y,w=c),s=On(w)?w.call(s):w}return s}function cS(s,a,c){return s==null?s:is(s,a,c)}function fS(s,a,c,h){return h=typeof h=="function"?h:t,s==null?s:is(s,a,c,h)}var ip=gd(He),sp=gd(pt);function hS(s,a,c){var h=ne(s),y=h||Gn(s)||ui(s);if(a=Y(a,4),c==null){var w=s&&s.constructor;y?c=h?new w:[]:Ae(s)?c=On(w)?si(no(s)):{}:c={}}return(y?Mt:on)(s,function(E,C,M){return a(c,E,C,M)}),c}function dS(s,a){return s==null?!0:Gl(s,a)}function pS(s,a,c){return s==null?s:Qh(s,a,Yl(c))}function mS(s,a,c,h){return h=typeof h=="function"?h:t,s==null?s:Qh(s,a,Yl(c),h)}function ci(s){return s==null?[]:Ol(s,He(s))}function gS(s){return s==null?[]:Ol(s,pt(s))}function yS(s,a,c){return c===t&&(c=a,a=t),c!==t&&(c=Dt(c),c=c===c?c:0),a!==t&&(a=Dt(a),a=a===a?a:0),br(Dt(s),a,c)}function bS(s,a,c){return a=Tn(a),c===t?(c=a,a=0):c=Tn(c),s=Dt(s),Eb(s,a,c)}function _S(s,a,c){if(c&&typeof c!="boolean"&&ot(s,a,c)&&(a=c=t),c===t&&(typeof a=="boolean"?(c=a,a=t):typeof s=="boolean"&&(c=s,s=t)),s===t&&a===t?(s=0,a=1):(s=Tn(s),a===t?(a=s,s=0):a=Tn(a)),s>a){var h=s;s=a,a=h}if(c||s%1||a%1){var y=Th();return Qe(s+y*(a-s+Xy("1e-"+((y+"").length-1))),a)}return Ul(s,a)}var vS=ai(function(s,a,c){return a=a.toLowerCase(),s+(c?op(a):a)});function op(s){return yu(ye(s).toLowerCase())}function ap(s){return s=ye(s),s&&s.replace(Sy,c1).replace(zy,"")}function wS(s,a,c){s=ye(s),a=vt(a);var h=s.length;c=c===t?h:br(re(c),0,h);var y=c;return c-=a.length,c>=0&&s.slice(c,y)==a}function SS(s){return s=ye(s),s&&ny.test(s)?s.replace(Bf,f1):s}function xS(s){return s=ye(s),s&&ly.test(s)?s.replace(hl,"\\$&"):s}var ES=ai(function(s,a,c){return s+(c?"-":"")+a.toLowerCase()}),kS=ai(function(s,a,c){return s+(c?" ":"")+a.toLowerCase()}),CS=cd("toLowerCase");function AS(s,a,c){s=ye(s),a=re(a);var h=a?ei(s):0;if(!a||h>=a)return s;var y=(a-h)/2;return vo(oo(y),c)+s+vo(so(y),c)}function OS(s,a,c){s=ye(s),a=re(a);var h=a?ei(s):0;return a&&h<a?s+vo(a-h,c):s}function TS(s,a,c){s=ye(s),a=re(a);var h=a?ei(s):0;return a&&h<a?vo(a-h,c)+s:s}function MS(s,a,c){return c||a==null?a=0:a&&(a=+a),F1(ye(s).replace(dl,""),a||0)}function IS(s,a,c){return(c?ot(s,a,c):a===t)?a=1:a=re(a),ql(ye(s),a)}function NS(){var s=arguments,a=ye(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var RS=ai(function(s,a,c){return s+(c?"_":"")+a.toLowerCase()});function LS(s,a,c){return c&&typeof c!="number"&&ot(s,a,c)&&(a=c=t),c=c===t?it:c>>>0,c?(s=ye(s),s&&(typeof a=="string"||a!=null&&!pu(a))&&(a=vt(a),!a&&Qr(s))?Kn(Kt(s),0,c):s.split(a,c)):[]}var PS=ai(function(s,a,c){return s+(c?" ":"")+yu(a)});function DS(s,a,c){return s=ye(s),c=c==null?0:br(re(c),0,s.length),a=vt(a),s.slice(c,c+a.length)==a}function FS(s,a,c){var h=v.templateSettings;c&&ot(s,a,c)&&(a=t),s=ye(s),a=No({},a,h,yd);var y=No({},a.imports,h.imports,yd),w=He(y),E=Ol(y,w),C,M,L=0,P=a.interpolate||Us,F="__p += '",V=Ml((a.escape||Us).source+"|"+P.source+"|"+(P===Hf?gy:Us).source+"|"+(a.evaluate||Us).source+"|$","g"),j="//# sourceURL="+(_e.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ky+"]")+`
|
|
43
|
-
`;s.replace(V,function(
|
|
44
|
-
__e(`+
|
|
45
|
-
'`),
|
|
46
|
-
`+
|
|
47
|
-
__p += '`),
|
|
48
|
-
((__t = (`+
|
|
49
|
-
'`),
|
|
50
|
-
`;var
|
|
40
|
+
3. "-" cannot repeat`);Oe.customSchemes.push([n,e])}function ET(){Oe.scanner=gT(Oe.customSchemes);for(let n=0;n<Oe.tokenQueue.length;n++)Oe.tokenQueue[n][1]({scanner:Oe.scanner});Oe.parser=vT(Oe.scanner.tokens);for(let n=0;n<Oe.pluginQueue.length;n++)Oe.pluginQueue[n][1]({scanner:Oe.scanner,parser:Oe.parser});Oe.initialized=!0}function n1(n){return Oe.initialized||ET(),wT(Oe.parser.start,n,yT(Oe.scanner.start,n))}function Wf(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 $f(t),i=n1(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 kT(n,e){e===void 0&&(e=null);const t=n1(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class AT extends xf{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=kT(i);if(!i||!o)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return dh.query(t,{typeName:ie.TEXT,mark:{typeName:de.LINK},getMark:{typeName:de.LINK}})?.attrs||{href:e}}}function B(n){return(...e)=>t=>n(t,...e)}function cl(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 Qr(n){const e=cl(n);return["span",e?{...e,class:"zw-style"}:{},0]}function MT(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Zt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var TT=Object.defineProperty,OT=(n,e,t)=>e in n?TT(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Cr=(n,e,t)=>OT(n,typeof e!="symbol"?e+"":e,t),r1,i1,s1;let o1=999;function IT(){return o1+=1,o1}function $e(n,e){let t=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(e[0])||(e=e.map(a=>[a]));let r=e[0].length,i=e[0].map((a,u)=>e.map(f=>f[u])),o=n.map(a=>i.map(u=>{let f=0;if(!Array.isArray(a)){for(let h of u)f+=a*h;return f}for(let h=0;h<a.length;h++)f+=a[h]*(u[h]||0);return f}));return t===1&&(o=o[0]),r===1?o.map(a=>a[0]):o}function a1(n){return Ks(n)==="string"}function Ks(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Vf(n,{precision:e,unit:t}){return Uf(n)?"none":NT(n,e)+(t??"")}function Uf(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function NT(n,e){if(n===0)return 0;let t=~~n,r=0;t&&e&&(r=~~Math.log10(Math.abs(t))+1);const i=10**(e-r);return Math.floor(n*i+.5)/i}const RT={deg:1,grad:.9,rad:180/Math.PI,turn:360};function LT(n){if(!n)return;n=n.trim();const e=/^([a-z]+)\((.+?)\)$/i,t=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g;let o=n.match(e);if(o){let a=[];return o[2].replace(i,(u,f)=>{let h=f.match(r),m=f;if(h){let p=h[0],b=m.slice(0,-p.length);p==="%"?(m=new Number(b/100),m.type="<percentage>"):(m=new Number(b*RT[p]),m.type="<angle>",m.unit=p)}else t.test(m)?(m=new Number(m),m.type="<number>"):m==="none"&&(m=new Number(NaN),m.none=!0);u.startsWith("/")&&(m=m instanceof Number?m:new Number(m),m.alpha=!0),typeof m=="object"&&m instanceof Number&&(m.raw=f),a.push(m)}),{name:o[1].toLowerCase(),rawName:o[1],rawArgs:o[2],args:a}}}function PT(n){return n[n.length-1]}function l1(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function DT(n,e,t){return(t-n)/(e-n)}function u1(n,e,t){return l1(e[0],e[1],DT(n[0],n[1],t))}function FT(n){return n.map(e=>e.split("|").map(t=>{t=t.trim();let r=t.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(r){let i=new String(r[1]);return i.range=[+r[2],+r[3]],i}return t}))}function zT(n,e,t){return Math.max(Math.min(t,e),n)}function qf(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function qn(n,e){return qf(Math.abs(n)**e,n)}function c1(n,e){return e===0?0:n/e}function BT(n,e,t=0,r=n.length){for(;t<r;){const i=t+r>>1;n[i]<e?t=i+1:r=i}return t}class $T{add(e,t,r){if(typeof arguments[0]!="string"){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(i){this[i]=this[i]||[],t&&this[i][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(r){r.call(t&&t.context?t.context:t,t)})}}const fl=new $T,Kn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function Kf(n){return Array.isArray(n)?n:Kn[n]}function hl(n,e,t,r={}){if(n=Kf(n),e=Kf(e),!n||!e)throw new TypeError(`Missing white point to convert ${n?"":"from"}${!n&&!e?"/":""}${e?"":"to"}`);if(n===e)return t;let i={W1:n,W2:e,XYZ:t,options:r};if(fl.run("chromatic-adaptation-start",i),i.M||(i.W1===Kn.D65&&i.W2===Kn.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===Kn.D50&&i.W2===Kn.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),fl.run("chromatic-adaptation-end",i),i.M)return $e(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const Gs={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((s1=(i1=(r1=globalThis?.process)==null?void 0:r1.env)==null?void 0:i1.NODE_ENV)==null?void 0:s1.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},HT=new Set(["<number>","<percentage>","<angle>"]);function f1(n,e,t,r){return Object.entries(n.coords).map(([o,a],u)=>{let f=e.coordGrammar[u],h=r[u],m=h?.type,p;if(h.none?p=f.find(C=>HT.has(C)):p=f.find(C=>C==m),!p){let C=a.name||o;throw new TypeError(`${m??h.raw} not allowed for ${C} in ${t}()`)}let b=p.range;m==="<percentage>"&&(b||(b=[0,1]));let S=a.range||a.refRange;return b&&S&&(r[u]=u1(b,S,r[u])),p})}function h1(n,{meta:e}={}){var t,r,i,o;let a={str:(t=String(n))==null?void 0:t.trim()};if(fl.run("parse-start",a),a.color)return a.color;if(a.parsed=LT(a.str),a.parsed){let u=a.parsed.name;if(u==="color"){let f=a.parsed.args.shift(),h=f.startsWith("--")?f.substring(2):`--${f}`,m=[f,h],p=a.parsed.rawArgs.indexOf("/")>0?a.parsed.args.pop():1;for(let C of ae.all){let g=C.getFormat("color");if(g&&(m.includes(g.id)||(r=g.ids)!=null&&r.filter(_=>m.includes(_)).length)){const _=Object.keys(C.coords).map((k,A)=>a.parsed.args[A]||0);let x;return g.coordGrammar&&(x=f1(C,g,"color",_)),e&&Object.assign(e,{formatId:"color",types:x}),g.id.startsWith("--")&&!f.startsWith("--")&&Gs.warn(`${C.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${g.id}) instead of color(${f}).`),f.startsWith("--")&&!g.id.startsWith("--")&&Gs.warn(`${C.name} is a standard space and supported in the CSS spec. Use color(${g.id}) instead of prefixed color(${f}).`),{spaceId:C.id,coords:_,alpha:p}}}let b="",S=f in ae.registry?f:h;if(S in ae.registry){let C=(o=(i=ae.registry[S].formats)==null?void 0:i.color)==null?void 0:o.id;C&&(b=`Did you mean color(${C})?`)}throw new TypeError(`Cannot parse color(${f}). `+(b||"Missing a plugin?"))}else for(let f of ae.all){let h=f.getFormat(u);if(h&&h.type==="function"){let m=1;(h.lastAlpha||PT(a.parsed.args).alpha)&&(m=a.parsed.args.pop());let p=a.parsed.args,b;return h.coordGrammar&&(b=f1(f,h,u,p)),e&&Object.assign(e,{formatId:h.name,types:b}),{spaceId:f.id,coords:p,alpha:m}}}}else for(let u of ae.all)for(let f in u.formats){let h=u.formats[f];if(h.type!=="custom"||h.test&&!h.test(a.str))continue;let m=h.parse(a.str);if(m)return m.alpha??(m.alpha=1),e&&(e.formatId=f),m}throw new TypeError(`Could not parse ${n} as a color. Missing a plugin?`)}function Ye(n){if(Array.isArray(n))return n.map(Ye);if(!n)throw new TypeError("Empty color reference");a1(n)&&(n=h1(n));let e=n.space||n.spaceId;return e instanceof ae||(n.space=ae.get(e)),n.alpha===void 0&&(n.alpha=1),n}const WT=75e-6,Gf=class pn{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?pn.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let r=e.coords??this.base.coords;for(let o in r)"name"in r[o]||(r[o].name=o);this.coords=r;let i=e.white??this.base.white??"D65";this.white=Kf(i),this.formats=e.formats??{};for(let o in this.formats){let a=this.formats[o];a.type||(a.type="function"),a.name||(a.name=o)}(t=this.formats.color)!=null&&t.id||(this.formats.color={...this.formats.color??{},id:e.cssId||this.id}),e.gamutSpace?this.gamutSpace=e.gamutSpace==="self"?this:pn.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(o,a)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:VT(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),fl.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=WT}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let r=Object.values(this.coords);return e.every((i,o)=>{let a=r[o];if(a.type!=="angle"&&a.range){if(Number.isNaN(i))return!0;let[u,f]=a.range;return(u===void 0||i>=u-t)&&(f===void 0||i<=f+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!("range"in e))}get cssId(){var e,t;return((t=(e=this.formats)==null?void 0:e.color)==null?void 0:t.id)||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type==="angle")return!0;return!1}getFormat(e){if(typeof e=="object")return e=d1(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=d1(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(e,t){if(arguments.length===1){const u=Ye(e);[e,t]=[u.space,u.coords]}if(e=pn.get(e),this.equals(e))return t;t=t.map(u=>Number.isNaN(u)?0:u);let r=this.path,i=e.path,o,a;for(let u=0;u<r.length&&r[u].equals(i[u]);u++)o=r[u],a=u;if(!o)throw new Error(`Cannot convert between color spaces ${this} and ${e}: no connection space was found`);for(let u=r.length-1;u>a;u--)t=r[u].toBase(t);for(let u=a+1;u<i.length;u++)t=i[u].fromBase(t);return t}from(e,t){if(arguments.length===1){const r=Ye(e);[e,t]=[r.space,r.coords]}return e=pn.get(e),e.to(this,t)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let r=this.coords[t],i=r.range||r.refRange;e.push(i?.min??0)}return e}static get all(){return[...new Set(Object.values(pn.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw new Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let r of t.aliases)this.register(r,t);return t}static get(e,...t){if(!e||e instanceof pn)return e;if(Ks(e)==="string"){let i=pn.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return pn.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=Ks(e),o,a;if(i==="string"?e.includes(".")?[o,a]=e.split("."):[o,a]=[,e]:Array.isArray(e)?[o,a]=e:(o=e.space,a=e.coordId),o=pn.get(o),o||(o=t),!o)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(i=Ks(a),i==="number"||i==="string"&&a>=0){let h=Object.entries(o.coords)[a];if(h)return{space:o,id:h[0],index:a,...h[1]}}o=pn.get(o);let u=a.toLowerCase(),f=0;for(let h in o.coords){let m=o.coords[h];if(h.toLowerCase()===u||((r=m.name)==null?void 0:r.toLowerCase())===u)return{space:o,id:h,index:f,...m};f++}throw new TypeError(`No "${a}" coordinate found in ${o.name}. Its coordinates are: ${Object.keys(o.coords).join(", ")}`)}};Cr(Gf,"registry",{}),Cr(Gf,"DEFAULT_FORMAT",{type:"functions",name:"color"});let ae=Gf;function VT(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function d1(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=FT(n.coords);let t=Object.entries(e).map(([r,i],o)=>{let a=n.coordGrammar[o][0],u=i.range||i.refRange,f=a.range,h="";return a=="<percentage>"?(f=[0,100],h="%"):a=="<angle>"&&(h="deg"),{fromRange:u,toRange:f,suffix:h}});n.serializeCoords=(r,i)=>r.map((o,a)=>{let{fromRange:u,toRange:f,suffix:h}=t[a];return u&&f&&(o=u1(u,f,o)),o=Vf(o,{precision:i,unit:h}),o})}return n}const Gn=new ae({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class p1 extends ae{constructor(e){e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Gn),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let r=$e(e.toXYZ_M,t);return this.white!==this.base.white&&(r=hl(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=hl(this.base.white,this.white,t),$e(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function Jf(n,e){return n=Ye(n),!e||n.space.equals(e)?n.coords.slice():(e=ae.get(e),e.from(n))}function Jn(n,e){n=Ye(n);let{space:t,index:r}=ae.resolveCoord(e,n.space);return Jf(n,t)[r]}function m1(n,e,t){return n=Ye(n),e=ae.get(e),n.coords=e.to(n.space,t),n}m1.returns="color";function jf(n,e,t){if(n=Ye(n),arguments.length===2&&Ks(arguments[1])==="object"){let r=arguments[1];for(let i in r)jf(n,i,r[i])}else{typeof t=="function"&&(t=t(Jn(n,e)));let{space:r,index:i}=ae.resolveCoord(e,n.space),o=Jf(n,r);o[i]=t,m1(n,r,o)}return n}jf.returns="color";const UT=new ae({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Gn,fromBase:n=>hl(Gn.white,"D50",n),toBase:n=>hl("D50",Gn.white,n)}),qT=216/24389,g1=24/116,dl=24389/27;let Yf=Kn.D50;const jn=new ae({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Yf,base:UT,fromBase(n){let t=n.map((r,i)=>r/Yf[i]).map(r=>r>qT?Math.cbrt(r):(dl*r+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(n){let e=[];return e[1]=(n[0]+16)/116,e[0]=n[1]/500+e[1],e[2]=e[1]-n[2]/200,[e[0]>g1?Math.pow(e[0],3):(116*e[0]-16)/dl,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/dl,e[2]>g1?Math.pow(e[2],3):(116*e[2]-16)/dl].map((r,i)=>r*Yf[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function ei(n){return(n%360+360)%360}const pl=new ae({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:jn,fromBase(n){let[e,t,r]=n,i;const o=.02;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),ei(i)]},toBase(n){let[e,t,r]=n;return t<0&&(t=0),isNaN(r)&&(r=0),[e,t*Math.cos(r*Math.PI/180),t*Math.sin(r*Math.PI/180)]},formats:{lch:{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}}),y1=25**7,ml=Math.PI,b1=180/ml,Ui=ml/180;function _1(n){const e=n*n;return e*e*e*n}function v1(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=Ye([n,e]);let[o,a,u]=jn.from(n),f=pl.from(jn,[o,a,u])[1],[h,m,p]=jn.from(e),b=pl.from(jn,[h,m,p])[1];f<0&&(f=0),b<0&&(b=0);let S=(f+b)/2,C=_1(S),g=.5*(1-Math.sqrt(C/(C+y1))),_=(1+g)*a,x=(1+g)*m,k=Math.sqrt(_**2+u**2),A=Math.sqrt(x**2+p**2),N=_===0&&u===0?0:Math.atan2(u,_),W=x===0&&p===0?0:Math.atan2(p,x);N<0&&(N+=2*ml),W<0&&(W+=2*ml),N*=b1,W*=b1;let L=h-o,U=A-k,j=W-N,pe=N+W,Ct=Math.abs(j),yt;k*A===0?yt=0:Ct<=180?yt=j:j>180?yt=j-360:j<-180?yt=j+360:Gs.warn("the unthinkable has happened");let Ft=2*Math.sqrt(A*k)*Math.sin(yt*Ui/2),Xn=(o+h)/2,en=(k+A)/2,Tn=_1(en),We;k*A===0?We=pe:Ct<=180?We=pe/2:pe<360?We=(pe+360)/2:We=(pe-360)/2;let Ve=(Xn-50)**2,Ue=1+.015*Ve/Math.sqrt(20+Ve),zt=1+.045*en,st=1;st-=.17*Math.cos((We-30)*Ui),st+=.24*Math.cos(2*We*Ui),st+=.32*Math.cos((3*We+6)*Ui),st-=.2*Math.cos((4*We-63)*Ui);let qe=1+.015*en*st,Zn=30*Math.exp(-1*((We-275)/25)**2),Qn=2*Math.sqrt(Tn/(Tn+y1)),El=-1*Math.sin(2*Zn*Ui)*Qn,tn=(L/(t*Ue))**2;return tn+=(U/(r*zt))**2,tn+=(Ft/(i*qe))**2,tn+=El*(U/(r*zt))*(Ft/(i*qe)),Math.sqrt(tn)}const KT=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],GT=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],JT=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],jT=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],gl=new ae({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Gn,fromBase(n){let t=$e(KT,n).map(r=>Math.cbrt(r));return $e(JT,t)},toBase(n){let t=$e(jT,n).map(r=>r**3);return $e(GT,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Xf(n,e){[n,e]=Ye([n,e]);let[t,r,i]=gl.from(n),[o,a,u]=gl.from(e),f=t-o,h=r-a,m=i-u;return Math.sqrt(f**2+h**2+m**2)}const YT=75e-6;function qi(n,e,{epsilon:t=YT}={}){n=Ye(n),e||(e=n.space),e=ae.get(e);let r=n.coords;return e!==n.space&&(r=e.from(n)),e.inGamut(r,{epsilon:t})}function Zf(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function XT(n,e,t="lab"){t=ae.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((o,a,u)=>{let f=i[u];return isNaN(a)||isNaN(f)?o:o+(f-a)**2},0))}function ZT(n,e){return XT(n,e,"lab")}const QT=Math.PI,w1=QT/180;function eO(n,e,{l:t=2,c:r=1}={}){[n,e]=Ye([n,e]);let[i,o,a]=jn.from(n),[,u,f]=pl.from(jn,[i,o,a]),[h,m,p]=jn.from(e),b=pl.from(jn,[h,m,p])[1];u<0&&(u=0),b<0&&(b=0);let S=i-h,C=u-b,g=o-m,_=a-p,x=g**2+_**2-C**2,k=.511;i>=16&&(k=.040975*i/(1+.01765*i));let A=.0638*u/(1+.0131*u)+.638,N;Number.isNaN(f)&&(f=0),f>=164&&f<=345?N=.56+Math.abs(.2*Math.cos((f+168)*w1)):N=.36+Math.abs(.4*Math.cos((f+35)*w1));let W=Math.pow(u,4),L=Math.sqrt(W/(W+1900)),U=A*(L*N+1-L),j=(S/(t*k))**2;return j+=(C/(r*A))**2,j+=x/U**2,Math.sqrt(j)}const S1=203,x1=new ae({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Gn,fromBase(n){return n.map(e=>Math.max(e*S1,0))},toBase(n){return n.map(e=>Math.max(e/S1,0))}}),yl=1.15,bl=.66,C1=2610/2**14,tO=2**14/2610,E1=3424/2**12,k1=2413/2**7,A1=2392/2**7,nO=1.7*2523/2**5,M1=2**5/(1.7*2523),_l=-.56,Qf=16295499532821565e-27,rO=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],iO=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],sO=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],oO=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],aO=new ae({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:x1,fromBase(n){let[e,t,r]=n,i=yl*e-(yl-1)*r,o=bl*t-(bl-1)*e,u=$e(rO,[i,o,r]).map(function(b){let S=E1+k1*(b/1e4)**C1,C=1+A1*(b/1e4)**C1;return(S/C)**nO}),[f,h,m]=$e(sO,u);return[(1+_l)*f/(1+_l*f)-Qf,h,m]},toBase(n){let[e,t,r]=n,i=(e+Qf)/(1+_l-_l*(e+Qf)),a=$e(oO,[i,t,r]).map(function(b){let S=E1-b**M1,C=A1*b**M1-k1;return 1e4*(S/C)**tO}),[u,f,h]=$e(iO,a),m=(u+(yl-1)*h)/yl,p=(f+(bl-1)*m)/bl;return[m,p,h]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),T1=new ae({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:aO,fromBase(n){let[e,t,r]=n,i;const o=2e-4;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),ei(i)]},toBase(n){return[n[0],n[1]*Math.cos(n[2]*Math.PI/180),n[1]*Math.sin(n[2]*Math.PI/180)]}});function lO(n,e){[n,e]=Ye([n,e]);let[t,r,i]=T1.from(n),[o,a,u]=T1.from(e),f=t-o,h=r-a;Number.isNaN(i)&&Number.isNaN(u)?(i=0,u=0):Number.isNaN(i)?i=u:Number.isNaN(u)&&(u=i);let m=i-u,p=2*Math.sqrt(r*a)*Math.sin(m/2*(Math.PI/180));return Math.sqrt(f**2+h**2+p**2)}const O1=3424/4096,I1=2413/128,N1=2392/128,R1=2610/16384,uO=2523/32,cO=16384/2610,L1=32/2523,fO=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],hO=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],dO=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],pO=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],P1=new ae({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:x1,fromBase(n){let e=$e(fO,n);return mO(e)},toBase(n){let e=gO(n);return $e(pO,e)}});function mO(n){let e=n.map(function(t){let r=O1+I1*(t/1e4)**R1,i=1+N1*(t/1e4)**R1;return(r/i)**uO});return $e(hO,e)}function gO(n){return $e(dO,n).map(function(r){let i=Math.max(r**L1-O1,0),o=I1-N1*r**L1;return 1e4*(i/o)**cO})}function yO(n,e){[n,e]=Ye([n,e]);let[t,r,i]=P1.from(n),[o,a,u]=P1.from(e);return 720*Math.sqrt((t-o)**2+.25*(r-a)**2+(i-u)**2)}const bO=Kn.D65,D1=.42,F1=1/D1,eh=2*Math.PI,z1=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],_O=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],vO=[[460,451,288],[460,-891,-261],[460,-220,-6300]],wO={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},ti={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},SO=180/Math.PI,B1=Math.PI/180;function $1(n,e){return n.map(r=>{const i=qn(e*Math.abs(r)*.01,D1);return 400*qf(i,r)/(i+27.13)})}function xO(n,e){const t=100/e*27.13**F1;return n.map(r=>{const i=Math.abs(r);return qf(t*qn(i/(400-i),F1),r)})}function CO(n){let e=ei(n);e<=ti.h[0]&&(e+=360);const t=BT(ti.h,e)-1,[r,i]=ti.h.slice(t,t+2),[o,a]=ti.e.slice(t,t+2),u=ti.H[t],f=(e-r)/o;return u+100*f/(f+(i-e)/a)}function EO(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=ti.h.slice(t,t+2),[o,a]=ti.e.slice(t,t+2);return ei((e*(a*r-o*i)-100*r*a)/(e*(a-o)-100*a))}function H1(n,e,t,r,i){const o={};o.discounting=i,o.refWhite=n,o.surround=r;const a=n.map(g=>g*100);o.la=e,o.yb=t;const u=a[1],f=$e(z1,a);r=wO[o.surround];const h=r[0];o.c=r[1],o.nc=r[2];const p=(1/(5*o.la+1))**4;o.fl=p*o.la+.1*(1-p)*(1-p)*Math.cbrt(5*o.la),o.flRoot=o.fl**.25,o.n=o.yb/u,o.z=1.48+Math.sqrt(o.n),o.nbb=.725*o.n**-.2,o.ncb=o.nbb;const b=Math.max(Math.min(h*(1-1/3.6*Math.exp((-o.la-42)/92)),1),0);o.dRgb=f.map(g=>l1(1,u/g,b)),o.dRgbInv=o.dRgb.map(g=>1/g);const S=f.map((g,_)=>g*o.dRgb[_]),C=$1(S,o.fl);return o.aW=o.nbb*(2*C[0]+C[1]+.05*C[2]),o}const W1=H1(bO,64/Math.PI*.2,20,"average",!1);function th(n,e){if(!(n.J!==void 0^n.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(n.C!==void 0^n.M!==void 0^n.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(n.h!==void 0^n.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(n.J===0||n.Q===0)return[0,0,0];let t=0;n.h!==void 0?t=ei(n.h)*B1:t=EO(n.H)*B1;const r=Math.cos(t),i=Math.sin(t);let o=0;n.J!==void 0?o=qn(n.J,1/2)*.1:n.Q!==void 0&&(o=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let a=0;n.C!==void 0?a=n.C/o:n.M!==void 0?a=n.M/e.flRoot/o:n.s!==void 0&&(a=4e-4*n.s**2*(e.aW+4)/e.c);const u=qn(a*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(t+2)+3.8),h=e.aW*qn(o,2/e.c/e.z),m=5e4/13*e.nc*e.ncb*f,p=h/e.nbb,b=23*(p+.305)*c1(u,23*m+u*(11*r+108*i)),S=b*r,C=b*i,g=xO($e(vO,[p,S,C]).map(_=>_*1/1403),e.fl);return $e(_O,g.map((_,x)=>_*e.dRgbInv[x])).map(_=>_/100)}function V1(n,e){const t=n.map(A=>A*100),r=$1($e(z1,t).map((A,N)=>A*e.dRgb[N]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,o=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(o,i)%eh+eh)%eh,u=.25*(Math.cos(a+2)+3.8),f=5e4/13*e.nc*e.ncb*c1(u*Math.sqrt(i**2+o**2),r[0]+r[1]+1.05*r[2]+.305),h=qn(f,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),m=e.nbb*(2*r[0]+r[1]+.05*r[2]),p=qn(m/e.aW,.5*e.c*e.z),b=100*qn(p,2),S=4/e.c*p*(e.aW+4)*e.flRoot,C=h*p,g=C*e.flRoot,_=ei(a*SO),x=CO(_),k=50*qn(e.c*h/(e.aW+4),1/2);return{J:b,C,h:_,s:k,Q:S,M:g,H:x}}new ae({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Gn,fromBase(n){const e=V1(n,W1);return[e.J,e.M,e.h]},toBase(n){return th({J:n[0],M:n[1],h:n[2]},W1)}});const kO=Kn.D65,AO=216/24389,U1=24389/27;function MO(n){return 116*(n>AO?Math.cbrt(n):(U1*n+16)/116)-16}function nh(n){return n>8?Math.pow((n+16)/116,3):n/U1}function TO(n,e){let[t,r,i]=n,o=[],a=0;if(i===0)return[0,0,0];let u=nh(i);i>0?a=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:a=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const f=2e-12,h=15;let m=0,p=1/0;for(;m<=h;){o=th({J:a,C:r,h:t},e);const b=Math.abs(o[1]-u);if(b<p){if(b<=f)return o;p=b}a=a-(o[1]-u)*a/(2*o[1]),m+=1}return th({J:a,C:r,h:t},e)}function OO(n,e){const t=MO(n[1]);if(t===0)return[0,0,0];const r=V1(n,rh);return[ei(r.h),r.C,t]}const rh=H1(kO,200/Math.PI*nh(50),nh(50)*100,"average",!1),vl=new ae({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:Gn,fromBase(n){return OO(n)},toBase(n){return TO(n,rh)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),IO=Math.PI/180,q1=[1,.007,.0228];function K1(n){n[1]<0&&(n=vl.fromBase(vl.toBase(n)));const e=Math.log(Math.max(1+q1[2]*n[1]*rh.flRoot,1))/q1[2],t=n[0]*IO,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function NO(n,e){[n,e]=Ye([n,e]);let[t,r,i]=K1(vl.from(n)),[o,a,u]=K1(vl.from(e));return Math.sqrt((t-o)**2+(r-a)**2+(i-u)**2)}const G1={deltaE76:ZT,deltaECMC:eO,deltaE2000:v1,deltaEJz:lO,deltaEITP:yO,deltaEOK:Xf,deltaEHCT:NO};function RO(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const J1={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function Js(n,{method:e=Gs.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:o={}}={}){if(n=Ye(n),a1(arguments[1])?t=arguments[1]:t||(t=n.space),t=ae.get(t),qi(n,t,{epsilon:0}))return n;let a;if(e==="css")a=LO(n,{space:t});else{if(e!=="clip"&&!qi(n,t)){Object.prototype.hasOwnProperty.call(J1,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:o}=J1[e]);let u=v1;if(r!==""){for(let h in G1)if("deltae"+r.toLowerCase()===h.toLowerCase()){u=G1[h];break}}let f=Js(He(n,t),{method:"clip",space:t});if(u(n,f)>i){if(Object.keys(o).length===3){let k=ae.resolveCoord(o.channel),A=Jn(He(n,k.space),k.id);if(Uf(A)&&(A=0),A>=o.max)return He({space:"xyz-d65",coords:Kn.D65},n.space);if(A<=o.min)return He({space:"xyz-d65",coords:[0,0,0]},n.space)}let h=ae.resolveCoord(e),m=h.space,p=h.id,b=He(n,m);b.coords.forEach((k,A)=>{Uf(k)&&(b.coords[A]=0)});let C=(h.range||h.refRange)[0],g=RO(i),_=C,x=Jn(b,p);for(;x-_>g;){let k=Zf(b);k=Js(k,{space:t,method:"clip"}),u(b,k)-i<g?_=Jn(b,p):x=Jn(b,p),jf(b,p,(_+x)/2)}a=He(b,t)}else a=f}else a=He(n,t);if(e==="clip"||!qi(a,t,{epsilon:0})){let u=Object.values(t.coords).map(f=>f.range||[]);a.coords=a.coords.map((f,h)=>{let[m,p]=u[h];return m!==void 0&&(f=Math.max(m,f)),p!==void 0&&(f=Math.min(f,p)),f})}}return t!==n.space&&(a=He(a,n.space)),n.coords=a.coords,n}Js.returns="color";const j1={WHITE:{space:gl,coords:[1,0,0]},BLACK:{space:gl,coords:[0,0,0]}};function LO(n,{space:e}={}){n=Ye(n),e||(e=n.space),e=ae.get(e);const i=ae.get("oklch");if(e.isUnbounded)return He(n,e);const o=He(n,i);let a=o.coords[0];if(a>=1){const C=He(j1.WHITE,e);return C.alpha=n.alpha,He(C,e)}if(a<=0){const C=He(j1.BLACK,e);return C.alpha=n.alpha,He(C,e)}if(qi(o,e,{epsilon:0}))return He(o,e);function u(C){const g=He(C,e),_=Object.values(e.coords);return g.coords=g.coords.map((x,k)=>{if("range"in _[k]){const[A,N]=_[k].range;return zT(A,x,N)}return x}),g}let f=0,h=o.coords[1],m=!0,p=Zf(o),b=u(p),S=Xf(b,p);if(S<.02)return b;for(;h-f>1e-4;){const C=(f+h)/2;if(p.coords[1]=C,m&&qi(p,e,{epsilon:0}))f=C;else if(b=u(p),S=Xf(b,p),S<.02){if(.02-S<1e-4)break;m=!1,f=C}else h=C}return b}function He(n,e,{inGamut:t}={}){n=Ye(n),e=ae.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=Js(i,t===!0?void 0:t)),i}He.returns="color";function PO(n,{precision:e=Gs.precision,format:t="default",inGamut:r=!0,...i}={}){var o;let a;n=Ye(n);let u=t;t=n.space.getFormat(t)??n.space.getFormat("default")??ae.DEFAULT_FORMAT;let f=n.coords.slice();if(r||(r=t.toGamut),r&&!qi(n)&&(f=Js(Zf(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)a=t.serialize(f,n.alpha,i);else throw new TypeError(`format ${u} can only be used to parse colors, not for serialization`);else{let h=t.name||"color";t.serializeCoords?f=t.serializeCoords(f,e):e!==null&&(f=f.map(S=>Vf(S,{precision:e})));let m=[...f];if(h==="color"){let S=t.id||((o=t.ids)==null?void 0:o[0])||n.space.id;m.unshift(S)}let p=n.alpha;e!==null&&(p=Vf(p,{precision:e}));let b=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${p}`;a=`${h}(${m.join(t.commas?", ":" ")}${b})`}return a}const DO=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],FO=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],zO=new p1({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:DO,fromXYZ_M:FO}),Y1={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let X1=Array(3).fill("<percentage> | <number>[0, 255]"),Z1=Array(3).fill("<number>[0, 255]");const Q1=new p1({id:"srgb",name:"sRGB",base:zO,fromBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r>.0031308?t*(1.055*r**(1/2.4)-.055):12.92*e}),toBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r<=.04045?e/12.92:t*((r+.055)/1.055)**2.4}),formats:{rgb:{coords:X1},rgb_number:{name:"rgb",commas:!0,coords:Z1,noAlpha:!0},color:{},rgba:{coords:X1,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:Z1},hex:{type:"custom",toGamut:!0,test:n=>/^#([a-f0-9]{3,4}){1,2}$/i.test(n),parse(n){n.length<=5&&(n=n.replace(/[a-f0-9]/gi,"$&$&"));let e=[];return n.replace(/[a-f0-9]{2}/gi,t=>{e.push(parseInt(t,16)/255)}),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:(n,e,{collapse:t=!0}={})=>{e<1&&n.push(e),n=n.map(o=>Math.round(o*255));let r=t&&n.every(o=>o%17===0);return"#"+n.map(o=>r?(o/17).toString(16):o.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:n=>/^[a-z]+$/i.test(n),parse(n){n=n.toLowerCase();let e={spaceId:"srgb",coords:null,alpha:1};if(n==="transparent"?(e.coords=Y1.black,e.alpha=0):e.coords=Y1[n],e.coords)return e}}}});function BO(n){return Jn(n,[Gn,"y"])}const ey=new ae({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Q1,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,o]=n,[a,u,f]=[NaN,0,(t+e)/2],h=e-t;if(h!==0){switch(u=f===0||f===1?0:(e-f)/Math.min(f,1-f),e){case r:a=(i-o)/h+(i<o?6:0);break;case i:a=(o-r)/h+2;break;case o:a=(r-i)/h+4}a=a*60}return u<0&&(a+=180,u=Math.abs(u)),a>=360&&(a-=360),[a,u*100,f*100]},toBase:n=>{let[e,t,r]=n;e=e%360,e<0&&(e+=360),t/=100,r/=100;function i(o){let a=(o+e/30)%12,u=t*Math.min(r,1-r);return r-u*Math.max(-1,Math.min(a-3,9-a,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage>","<percentage>"]},hsla:{coords:["<number> | <angle>","<percentage>","<percentage>"],commas:!0,lastAlpha:!0}}}),$O=new ae({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:ey,fromBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r+t*Math.min(r,1-r);return[e,i===0?0:200*(1-r/i),100*i]},toBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r*(1-t/2);return[e,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});class Dt{constructor(e){Cr(this,"data"),Cr(this,"isEmpty",!1),this.data=He(e,"srgb")}static fromEmpty(){return Dt.fromWhite().setEmpty(!0)}static fromBlack(){return new Dt({spaceId:"srgb",coords:[0,0,0],alpha:1})}static fromWhite(){return new Dt({spaceId:"srgb",coords:[1,1,1],alpha:1})}get r(){return Math.round(this.data.coords[0]*255)}get g(){return Math.round(this.data.coords[1]*255)}get b(){return Math.round(this.data.coords[2]*255)}get h(){return Jn(this.data,"hsv.h")}get s(){return Jn(this.data,"hsv.s")}get v(){return Jn(this.data,"hsv.v")}get alpha(){return this.data.alpha.valueOf()}get alphaPercent(){return Math.round(this.alpha*100)}get isTransparent(){return this.alpha===0}get isDark(){return BO(this.data)<.5}setEmpty(e){return this.isEmpty=e,this}withAlpha(e){return new Dt({...this.data,alpha:e})}withRgb(e){return new Dt({spaceId:"srgb",coords:[e.r?e.r/255:this.data.coords[0],e.g?e.g/255:this.data.coords[1],e.b?e.b/255:this.data.coords[2]],alpha:e.a??this.alpha})}withHsv(e){const t=Jf(this.data,"hsv");return new Dt({spaceId:"hsv",coords:[e.h??t[0],e.s??t[1],e.v??t[2]],alpha:this.alpha})}toString(){return this.isEmpty?"":this.alpha===1?this.toHexString():this.toRgbaString()}toHexString(){const e=PO(this.data,{format:"hex"}).toUpperCase();return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e.slice(0,7)}toRgbaString(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.alphaPercent}%)`}clone(){return new Dt(this.data).setEmpty(this.isEmpty)}}class HO{constructor(e){Cr(this,"_color"),this.setColor(e.solidColor)}get color(){return this._color}setColor(e){this._color=e}toString(){return this.color.toString()}isEqual(e){return this.toString()===e}update({solidColor:e}){this.setColor(e)}}class fh{constructor(e,t=0){Cr(this,"id"),this.color=e,this.offset=t,this.id=IT()}get isEmpty(){return this.color.isEmpty}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new fh(this.color.clone(),e)}}class WO{constructor(e){Cr(this,"_angle",0),Cr(this,"transitions",[]),this.update(e)}get canAddTransition(){return this.transitions.length<5}get canRemoveTransition(){return this.transitions.length>2}get angle(){return this._angle}setAngle(e){this._angle=e}addTransition(e){this.transitions.push(e),this.sortTransitions()}removeTransition(e){this.transitions=this.transitions.filter(({id:t})=>t!==e.id)}sortTransitions(){this.transitions=this.transitions.sort((e,t)=>e.offset-t.offset)}toString(e){if(this.transitions.some(i=>i.isEmpty))return"";const r=this.transitions.map(i=>i.toString());return`linear-gradient(${e??this.angle}deg, ${r.join(", ")})`}isEqual(e){return this.toString()===e}update(e){this._angle=e.angle,this.transitions=e.transitions.map(({color:t,offset:r})=>new fh(t,r))}}function VO(n){return n?n.startsWith("linear-gradient("):!1}function UO(n){const e=YO(n);return(e.isGradient?new WO(e):new HO(e)).toString()}ae.register(Q1),ae.register($O),ae.register(ey);function ty(n){if(!n)return Dt.fromEmpty();try{return new Dt(He(h1(n),"srgb"))}catch(e){return console.warn(e),Dt.fromBlack()}}function qO(n){const e=ty(n),t=Dt.fromWhite();return{isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(100),offset:100}]}}function KO(n){const e={"to top":0,"to top right":45,"to right":90,"to bottom right":135,"to bottom":180,"to bottom left":225,"to left":270,"to top left":315};return e[n]?e[n]:n.includes("deg")?Number.parseInt(n.trim().replace("deg","")):0}function GO(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:ty(t),offset:Number.parseFloat(r.replace("%",""))}})}function JO(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),o=GO(i),a=KO(r);return{isGradient:!0,solidColor:o[0].color,angle:a,transitions:o}}function jO(){const n=Dt.fromEmpty();return{isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}function YO(n,e=!0){if(!n)return jO();const t=VO(n)?JO(n):qO(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}function ny(n){return UO(n)}function ry(n,e){if(!n.includes("em"))return parseInt(n);const t=Ki.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function XO(n,e){return(n.firstElementChild||n).style.fontSize||Ki.getComputedStyle(e).fontSize}function ZO(n,e,t){if(!n.includes("px"))return n;const r=XO(e,t),i=ry(r,t);return i?(parseInt(n)/i).toFixed(2):null}const QO={start:vr.LEFT,end:vr.RIGHT};function eI(n){const e=QO[n]||n;return vr.values.includes(e)?e:null}const iy=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function sy(n,e){return n.resolve(e).depth+1}function tI(n,e,t,r){const i=sy(n,r),o=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return o&&a}const nI=(n,e)=>n.eq(e);function rI(n,e,t,r=nI){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 iI(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var js={exports:{}};var sI=js.exports,oy;function oI(){return oy||(oy=1,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__",h=500,m="__lodash_placeholder__",p=1,b=2,S=4,C=1,g=2,_=1,x=2,k=4,A=8,N=16,W=32,L=64,U=128,j=256,pe=512,Ct=30,yt="...",Ft=800,Xn=16,en=1,Tn=2,We=3,Ve=1/0,Ue=9007199254740991,zt=17976931348623157e292,st=NaN,qe=4294967295,Zn=qe-1,Qn=qe>>>1,El=[["ary",U],["bind",_],["bindKey",x],["curry",A],["curryRight",N],["flip",pe],["partial",W],["partialRight",L],["rearg",j]],tn="[object Arguments]",Zs="[object Array]",gy="[object AsyncFunction]",Xi="[object Boolean]",Zi="[object Date]",yy="[object DOMException]",Qs="[object Error]",eo="[object Function]",ph="[object GeneratorFunction]",nn="[object Map]",Qi="[object Number]",by="[object Null]",On="[object Object]",mh="[object Promise]",_y="[object Proxy]",es="[object RegExp]",rn="[object Set]",ts="[object String]",to="[object Symbol]",vy="[object Undefined]",ns="[object WeakMap]",wy="[object WeakSet]",rs="[object ArrayBuffer]",si="[object DataView]",kl="[object Float32Array]",Al="[object Float64Array]",Ml="[object Int8Array]",Tl="[object Int16Array]",Ol="[object Int32Array]",Il="[object Uint8Array]",Nl="[object Uint8ClampedArray]",Rl="[object Uint16Array]",Ll="[object Uint32Array]",Sy=/\b__p \+= '';/g,xy=/\b(__p \+=) '' \+/g,Cy=/(__e\(.*?\)|\b__t\)) \+\n'';/g,gh=/&(?:amp|lt|gt|quot|#39);/g,yh=/[&<>"']/g,Ey=RegExp(gh.source),ky=RegExp(yh.source),Ay=/<%-([\s\S]+?)%>/g,My=/<%([\s\S]+?)%>/g,bh=/<%=([\s\S]+?)%>/g,Ty=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Oy=/^\w*$/,Iy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pl=/[\\^$.*+?()[\]{}|]/g,Ny=RegExp(Pl.source),Dl=/^\s+/,Ry=/\s/,Ly=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Py=/\{\n\/\* \[wrapped with (.+)\] \*/,Dy=/,? & /,Fy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zy=/[()=,{}\[\]\/\s]/,By=/\\(\\)?/g,$y=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_h=/\w*$/,Hy=/^[-+]0x[0-9a-f]+$/i,Wy=/^0b[01]+$/i,Vy=/^\[object .+?Constructor\]$/,Uy=/^0o[0-7]+$/i,qy=/^(?:0|[1-9]\d*)$/,Ky=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,no=/($^)/,Gy=/['\n\r\u2028\u2029\\]/g,ro="\\ud800-\\udfff",Jy="\\u0300-\\u036f",jy="\\ufe20-\\ufe2f",Yy="\\u20d0-\\u20ff",vh=Jy+jy+Yy,wh="\\u2700-\\u27bf",Sh="a-z\\xdf-\\xf6\\xf8-\\xff",Xy="\\xac\\xb1\\xd7\\xf7",Zy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qy="\\u2000-\\u206f",eb=" \\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",xh="A-Z\\xc0-\\xd6\\xd8-\\xde",Ch="\\ufe0e\\ufe0f",Eh=Xy+Zy+Qy+eb,Fl="['\u2019]",tb="["+ro+"]",kh="["+Eh+"]",io="["+vh+"]",Ah="\\d+",nb="["+wh+"]",Mh="["+Sh+"]",Th="[^"+ro+Eh+Ah+wh+Sh+xh+"]",zl="\\ud83c[\\udffb-\\udfff]",rb="(?:"+io+"|"+zl+")",Oh="[^"+ro+"]",Bl="(?:\\ud83c[\\udde6-\\uddff]){2}",$l="[\\ud800-\\udbff][\\udc00-\\udfff]",oi="["+xh+"]",Ih="\\u200d",Nh="(?:"+Mh+"|"+Th+")",ib="(?:"+oi+"|"+Th+")",Rh="(?:"+Fl+"(?:d|ll|m|re|s|t|ve))?",Lh="(?:"+Fl+"(?:D|LL|M|RE|S|T|VE))?",Ph=rb+"?",Dh="["+Ch+"]?",sb="(?:"+Ih+"(?:"+[Oh,Bl,$l].join("|")+")"+Dh+Ph+")*",ob="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ab="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Fh=Dh+Ph+sb,lb="(?:"+[nb,Bl,$l].join("|")+")"+Fh,ub="(?:"+[Oh+io+"?",io,Bl,$l,tb].join("|")+")",cb=RegExp(Fl,"g"),fb=RegExp(io,"g"),Hl=RegExp(zl+"(?="+zl+")|"+ub+Fh,"g"),hb=RegExp([oi+"?"+Mh+"+"+Rh+"(?="+[kh,oi,"$"].join("|")+")",ib+"+"+Lh+"(?="+[kh,oi+Nh,"$"].join("|")+")",oi+"?"+Nh+"+"+Rh,oi+"+"+Lh,ab,ob,Ah,lb].join("|"),"g"),db=RegExp("["+Ih+ro+vh+Ch+"]"),pb=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,mb=["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"],gb=-1,Ce={};Ce[kl]=Ce[Al]=Ce[Ml]=Ce[Tl]=Ce[Ol]=Ce[Il]=Ce[Nl]=Ce[Rl]=Ce[Ll]=!0,Ce[tn]=Ce[Zs]=Ce[rs]=Ce[Xi]=Ce[si]=Ce[Zi]=Ce[Qs]=Ce[eo]=Ce[nn]=Ce[Qi]=Ce[On]=Ce[es]=Ce[rn]=Ce[ts]=Ce[ns]=!1;var xe={};xe[tn]=xe[Zs]=xe[rs]=xe[si]=xe[Xi]=xe[Zi]=xe[kl]=xe[Al]=xe[Ml]=xe[Tl]=xe[Ol]=xe[nn]=xe[Qi]=xe[On]=xe[es]=xe[rn]=xe[ts]=xe[to]=xe[Il]=xe[Nl]=xe[Rl]=xe[Ll]=!0,xe[Qs]=xe[eo]=xe[ns]=!1;var yb={\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"},bb={"&":"&","<":"<",">":">",'"':""","'":"'"},_b={"&":"&","<":"<",">":">",""":'"',"'":"'"},vb={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},wb=parseFloat,Sb=parseInt,zh=typeof qo=="object"&&qo&&qo.Object===Object&&qo,xb=typeof self=="object"&&self&&self.Object===Object&&self,Qe=zh||xb||Function("return this")(),Wl=e&&!e.nodeType&&e,Mr=Wl&&!0&&n&&!n.nodeType&&n,Bh=Mr&&Mr.exports===Wl,Vl=Bh&&zh.process,Bt=function(){try{var T=Mr&&Mr.require&&Mr.require("util").types;return T||Vl&&Vl.binding&&Vl.binding("util")}catch{}}(),$h=Bt&&Bt.isArrayBuffer,Hh=Bt&&Bt.isDate,Wh=Bt&&Bt.isMap,Vh=Bt&&Bt.isRegExp,Uh=Bt&&Bt.isSet,qh=Bt&&Bt.isTypedArray;function Et(T,R,I){switch(I.length){case 0:return T.call(R);case 1:return T.call(R,I[0]);case 2:return T.call(R,I[0],I[1]);case 3:return T.call(R,I[0],I[1],I[2])}return T.apply(R,I)}function Cb(T,R,I,q){for(var te=-1,be=T==null?0:T.length;++te<be;){var ze=T[te];R(q,ze,I(ze),T)}return q}function $t(T,R){for(var I=-1,q=T==null?0:T.length;++I<q&&R(T[I],I,T)!==!1;);return T}function Eb(T,R){for(var I=T==null?0:T.length;I--&&R(T[I],I,T)!==!1;);return T}function Kh(T,R){for(var I=-1,q=T==null?0:T.length;++I<q;)if(!R(T[I],I,T))return!1;return!0}function er(T,R){for(var I=-1,q=T==null?0:T.length,te=0,be=[];++I<q;){var ze=T[I];R(ze,I,T)&&(be[te++]=ze)}return be}function so(T,R){var I=T==null?0:T.length;return!!I&&ai(T,R,0)>-1}function Ul(T,R,I){for(var q=-1,te=T==null?0:T.length;++q<te;)if(I(R,T[q]))return!0;return!1}function ke(T,R){for(var I=-1,q=T==null?0:T.length,te=Array(q);++I<q;)te[I]=R(T[I],I,T);return te}function tr(T,R){for(var I=-1,q=R.length,te=T.length;++I<q;)T[te+I]=R[I];return T}function ql(T,R,I,q){var te=-1,be=T==null?0:T.length;for(q&&be&&(I=T[++te]);++te<be;)I=R(I,T[te],te,T);return I}function kb(T,R,I,q){var te=T==null?0:T.length;for(q&&te&&(I=T[--te]);te--;)I=R(I,T[te],te,T);return I}function Kl(T,R){for(var I=-1,q=T==null?0:T.length;++I<q;)if(R(T[I],I,T))return!0;return!1}var Ab=Gl("length");function Mb(T){return T.split("")}function Tb(T){return T.match(Fy)||[]}function Gh(T,R,I){var q;return I(T,function(te,be,ze){if(R(te,be,ze))return q=be,!1}),q}function oo(T,R,I,q){for(var te=T.length,be=I+(q?1:-1);q?be--:++be<te;)if(R(T[be],be,T))return be;return-1}function ai(T,R,I){return R===R?Hb(T,R,I):oo(T,Jh,I)}function Ob(T,R,I,q){for(var te=I-1,be=T.length;++te<be;)if(q(T[te],R))return te;return-1}function Jh(T){return T!==T}function jh(T,R){var I=T==null?0:T.length;return I?jl(T,R)/I:st}function Gl(T){return function(R){return R==null?t:R[T]}}function Jl(T){return function(R){return T==null?t:T[R]}}function Yh(T,R,I,q,te){return te(T,function(be,ze,Se){I=q?(q=!1,be):R(I,be,ze,Se)}),I}function Ib(T,R){var I=T.length;for(T.sort(R);I--;)T[I]=T[I].value;return T}function jl(T,R){for(var I,q=-1,te=T.length;++q<te;){var be=R(T[q]);be!==t&&(I=I===t?be:I+be)}return I}function Yl(T,R){for(var I=-1,q=Array(T);++I<T;)q[I]=R(I);return q}function Nb(T,R){return ke(R,function(I){return[I,T[I]]})}function Xh(T){return T&&T.slice(0,td(T)+1).replace(Dl,"")}function kt(T){return function(R){return T(R)}}function Xl(T,R){return ke(R,function(I){return T[I]})}function is(T,R){return T.has(R)}function Zh(T,R){for(var I=-1,q=T.length;++I<q&&ai(R,T[I],0)>-1;);return I}function Qh(T,R){for(var I=T.length;I--&&ai(R,T[I],0)>-1;);return I}function Rb(T,R){for(var I=T.length,q=0;I--;)T[I]===R&&++q;return q}var Lb=Jl(yb),Pb=Jl(bb);function Db(T){return"\\"+vb[T]}function Fb(T,R){return T==null?t:T[R]}function li(T){return db.test(T)}function zb(T){return pb.test(T)}function Bb(T){for(var R,I=[];!(R=T.next()).done;)I.push(R.value);return I}function Zl(T){var R=-1,I=Array(T.size);return T.forEach(function(q,te){I[++R]=[te,q]}),I}function ed(T,R){return function(I){return T(R(I))}}function nr(T,R){for(var I=-1,q=T.length,te=0,be=[];++I<q;){var ze=T[I];(ze===R||ze===m)&&(T[I]=m,be[te++]=I)}return be}function ao(T){var R=-1,I=Array(T.size);return T.forEach(function(q){I[++R]=q}),I}function $b(T){var R=-1,I=Array(T.size);return T.forEach(function(q){I[++R]=[q,q]}),I}function Hb(T,R,I){for(var q=I-1,te=T.length;++q<te;)if(T[q]===R)return q;return-1}function Wb(T,R,I){for(var q=I+1;q--;)if(T[q]===R)return q;return q}function ui(T){return li(T)?Ub(T):Ab(T)}function sn(T){return li(T)?qb(T):Mb(T)}function td(T){for(var R=T.length;R--&&Ry.test(T.charAt(R)););return R}var Vb=Jl(_b);function Ub(T){for(var R=Hl.lastIndex=0;Hl.test(T);)++R;return R}function qb(T){return T.match(Hl)||[]}function Kb(T){return T.match(hb)||[]}var Gb=function T(R){R=R==null?Qe:ci.defaults(Qe.Object(),R,ci.pick(Qe,mb));var I=R.Array,q=R.Date,te=R.Error,be=R.Function,ze=R.Math,Se=R.Object,Ql=R.RegExp,Jb=R.String,Ht=R.TypeError,lo=I.prototype,jb=be.prototype,fi=Se.prototype,uo=R["__core-js_shared__"],co=jb.toString,we=fi.hasOwnProperty,Yb=0,nd=function(){var s=/[^.]+$/.exec(uo&&uo.keys&&uo.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),fo=fi.toString,Xb=co.call(Se),Zb=Qe._,Qb=Ql("^"+co.call(we).replace(Pl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ho=Bh?R.Buffer:t,rr=R.Symbol,po=R.Uint8Array,rd=ho?ho.allocUnsafe:t,mo=ed(Se.getPrototypeOf,Se),id=Se.create,sd=fi.propertyIsEnumerable,go=lo.splice,od=rr?rr.isConcatSpreadable:t,ss=rr?rr.iterator:t,Tr=rr?rr.toStringTag:t,yo=function(){try{var s=Lr(Se,"defineProperty");return s({},"",{}),s}catch{}}(),e2=R.clearTimeout!==Qe.clearTimeout&&R.clearTimeout,t2=q&&q.now!==Qe.Date.now&&q.now,n2=R.setTimeout!==Qe.setTimeout&&R.setTimeout,bo=ze.ceil,_o=ze.floor,eu=Se.getOwnPropertySymbols,r2=ho?ho.isBuffer:t,ad=R.isFinite,i2=lo.join,s2=ed(Se.keys,Se),Be=ze.max,ot=ze.min,o2=q.now,a2=R.parseInt,ld=ze.random,l2=lo.reverse,tu=Lr(R,"DataView"),as=Lr(R,"Map"),nu=Lr(R,"Promise"),hi=Lr(R,"Set"),ls=Lr(R,"WeakMap"),us=Lr(Se,"create"),vo=ls&&new ls,di={},u2=Pr(tu),c2=Pr(as),f2=Pr(nu),h2=Pr(hi),d2=Pr(ls),wo=rr?rr.prototype:t,cs=wo?wo.valueOf:t,ud=wo?wo.toString:t;function v(s){if(Ie(s)&&!ne(s)&&!(s instanceof ce)){if(s instanceof Wt)return s;if(we.call(s,"__wrapped__"))return cp(s)}return new Wt(s)}var pi=function(){function s(){}return function(l){if(!Me(l))return{};if(id)return id(l);s.prototype=l;var c=new s;return s.prototype=t,c}}();function So(){}function Wt(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}v.templateSettings={escape:Ay,evaluate:My,interpolate:bh,variable:"",imports:{_:v}},v.prototype=So.prototype,v.prototype.constructor=v,Wt.prototype=pi(So.prototype),Wt.prototype.constructor=Wt;function ce(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=qe,this.__views__=[]}function p2(){var s=new ce(this.__wrapped__);return s.__actions__=bt(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=bt(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=bt(this.__views__),s}function m2(){if(this.__filtered__){var s=new ce(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function g2(){var s=this.__wrapped__.value(),l=this.__dir__,c=ne(s),d=l<0,y=c?s.length:0,w=M_(0,y,this.__views__),E=w.start,M=w.end,O=M-E,P=d?M:E-1,D=this.__iteratees__,F=D.length,V=0,J=ot(O,this.__takeCount__);if(!c||!d&&y==O&&J==O)return Rd(s,this.__actions__);var Z=[];e:for(;O--&&V<J;){P+=l;for(var se=-1,Q=s[P];++se<F;){var le=D[se],he=le.iteratee,Tt=le.type,ht=he(Q);if(Tt==Tn)Q=ht;else if(!ht){if(Tt==en)continue e;break e}}Z[V++]=Q}return Z}ce.prototype=pi(So.prototype),ce.prototype.constructor=ce;function Or(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var d=s[l];this.set(d[0],d[1])}}function y2(){this.__data__=us?us(null):{},this.size=0}function b2(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function _2(s){var l=this.__data__;if(us){var c=l[s];return c===f?t:c}return we.call(l,s)?l[s]:t}function v2(s){var l=this.__data__;return us?l[s]!==t:we.call(l,s)}function w2(s,l){var c=this.__data__;return this.size+=this.has(s)?0:1,c[s]=us&&l===t?f:l,this}Or.prototype.clear=y2,Or.prototype.delete=b2,Or.prototype.get=_2,Or.prototype.has=v2,Or.prototype.set=w2;function In(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var d=s[l];this.set(d[0],d[1])}}function S2(){this.__data__=[],this.size=0}function x2(s){var l=this.__data__,c=xo(l,s);if(c<0)return!1;var d=l.length-1;return c==d?l.pop():go.call(l,c,1),--this.size,!0}function C2(s){var l=this.__data__,c=xo(l,s);return c<0?t:l[c][1]}function E2(s){return xo(this.__data__,s)>-1}function k2(s,l){var c=this.__data__,d=xo(c,s);return d<0?(++this.size,c.push([s,l])):c[d][1]=l,this}In.prototype.clear=S2,In.prototype.delete=x2,In.prototype.get=C2,In.prototype.has=E2,In.prototype.set=k2;function Nn(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var d=s[l];this.set(d[0],d[1])}}function A2(){this.size=0,this.__data__={hash:new Or,map:new(as||In),string:new Or}}function M2(s){var l=Po(this,s).delete(s);return this.size-=l?1:0,l}function T2(s){return Po(this,s).get(s)}function O2(s){return Po(this,s).has(s)}function I2(s,l){var c=Po(this,s),d=c.size;return c.set(s,l),this.size+=c.size==d?0:1,this}Nn.prototype.clear=A2,Nn.prototype.delete=M2,Nn.prototype.get=T2,Nn.prototype.has=O2,Nn.prototype.set=I2;function Ir(s){var l=-1,c=s==null?0:s.length;for(this.__data__=new Nn;++l<c;)this.add(s[l])}function N2(s){return this.__data__.set(s,f),this}function R2(s){return this.__data__.has(s)}Ir.prototype.add=Ir.prototype.push=N2,Ir.prototype.has=R2;function on(s){var l=this.__data__=new In(s);this.size=l.size}function L2(){this.__data__=new In,this.size=0}function P2(s){var l=this.__data__,c=l.delete(s);return this.size=l.size,c}function D2(s){return this.__data__.get(s)}function F2(s){return this.__data__.has(s)}function z2(s,l){var c=this.__data__;if(c instanceof In){var d=c.__data__;if(!as||d.length<i-1)return d.push([s,l]),this.size=++c.size,this;c=this.__data__=new Nn(d)}return c.set(s,l),this.size=c.size,this}on.prototype.clear=L2,on.prototype.delete=P2,on.prototype.get=D2,on.prototype.has=F2,on.prototype.set=z2;function cd(s,l){var c=ne(s),d=!c&&Dr(s),y=!c&&!d&&lr(s),w=!c&&!d&&!y&&bi(s),E=c||d||y||w,M=E?Yl(s.length,Jb):[],O=M.length;for(var P in s)(l||we.call(s,P))&&!(E&&(P=="length"||y&&(P=="offset"||P=="parent")||w&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||Dn(P,O)))&&M.push(P);return M}function fd(s){var l=s.length;return l?s[du(0,l-1)]:t}function B2(s,l){return Do(bt(s),Nr(l,0,s.length))}function $2(s){return Do(bt(s))}function ru(s,l,c){(c!==t&&!an(s[l],c)||c===t&&!(l in s))&&Rn(s,l,c)}function fs(s,l,c){var d=s[l];(!(we.call(s,l)&&an(d,c))||c===t&&!(l in s))&&Rn(s,l,c)}function xo(s,l){for(var c=s.length;c--;)if(an(s[c][0],l))return c;return-1}function H2(s,l,c,d){return ir(s,function(y,w,E){l(d,y,c(y),E)}),d}function hd(s,l){return s&&bn(l,Ke(l),s)}function W2(s,l){return s&&bn(l,vt(l),s)}function Rn(s,l,c){l=="__proto__"&&yo?yo(s,l,{configurable:!0,enumerable:!0,value:c,writable:!0}):s[l]=c}function iu(s,l){for(var c=-1,d=l.length,y=I(d),w=s==null;++c<d;)y[c]=w?t:zu(s,l[c]);return y}function Nr(s,l,c){return s===s&&(c!==t&&(s=s<=c?s:c),l!==t&&(s=s>=l?s:l)),s}function Vt(s,l,c,d,y,w){var E,M=l&p,O=l&b,P=l&S;if(c&&(E=y?c(s,d,y,w):c(s)),E!==t)return E;if(!Me(s))return s;var D=ne(s);if(D){if(E=O_(s),!M)return bt(s,E)}else{var F=at(s),V=F==eo||F==ph;if(lr(s))return Dd(s,M);if(F==On||F==tn||V&&!y){if(E=O||V?{}:tp(s),!M)return O?__(s,W2(E,s)):b_(s,hd(E,s))}else{if(!xe[F])return y?s:{};E=I_(s,F,M)}}w||(w=new on);var J=w.get(s);if(J)return J;w.set(s,E),Op(s)?s.forEach(function(Q){E.add(Vt(Q,l,c,Q,s,w))}):Mp(s)&&s.forEach(function(Q,le){E.set(le,Vt(Q,l,c,le,s,w))});var Z=P?O?Cu:xu:O?vt:Ke,se=D?t:Z(s);return $t(se||s,function(Q,le){se&&(le=Q,Q=s[le]),fs(E,le,Vt(Q,l,c,le,s,w))}),E}function V2(s){var l=Ke(s);return function(c){return dd(c,s,l)}}function dd(s,l,c){var d=c.length;if(s==null)return!d;for(s=Se(s);d--;){var y=c[d],w=l[y],E=s[y];if(E===t&&!(y in s)||!w(E))return!1}return!0}function pd(s,l,c){if(typeof s!="function")throw new Ht(a);return bs(function(){s.apply(t,c)},l)}function hs(s,l,c,d){var y=-1,w=so,E=!0,M=s.length,O=[],P=l.length;if(!M)return O;c&&(l=ke(l,kt(c))),d?(w=Ul,E=!1):l.length>=i&&(w=is,E=!1,l=new Ir(l));e:for(;++y<M;){var D=s[y],F=c==null?D:c(D);if(D=d||D!==0?D:0,E&&F===F){for(var V=P;V--;)if(l[V]===F)continue e;O.push(D)}else w(l,F,d)||O.push(D)}return O}var ir=Hd(yn),md=Hd(ou,!0);function U2(s,l){var c=!0;return ir(s,function(d,y,w){return c=!!l(d,y,w),c}),c}function Co(s,l,c){for(var d=-1,y=s.length;++d<y;){var w=s[d],E=l(w);if(E!=null&&(M===t?E===E&&!Mt(E):c(E,M)))var M=E,O=w}return O}function q2(s,l,c,d){var y=s.length;for(c=re(c),c<0&&(c=-c>y?0:y+c),d=d===t||d>y?y:re(d),d<0&&(d+=y),d=c>d?0:Np(d);c<d;)s[c++]=l;return s}function gd(s,l){var c=[];return ir(s,function(d,y,w){l(d,y,w)&&c.push(d)}),c}function et(s,l,c,d,y){var w=-1,E=s.length;for(c||(c=R_),y||(y=[]);++w<E;){var M=s[w];l>0&&c(M)?l>1?et(M,l-1,c,d,y):tr(y,M):d||(y[y.length]=M)}return y}var su=Wd(),yd=Wd(!0);function yn(s,l){return s&&su(s,l,Ke)}function ou(s,l){return s&&yd(s,l,Ke)}function Eo(s,l){return er(l,function(c){return Fn(s[c])})}function Rr(s,l){l=or(l,s);for(var c=0,d=l.length;s!=null&&c<d;)s=s[_n(l[c++])];return c&&c==d?s:t}function bd(s,l,c){var d=l(s);return ne(s)?d:tr(d,c(s))}function ct(s){return s==null?s===t?vy:by:Tr&&Tr in Se(s)?A_(s):$_(s)}function au(s,l){return s>l}function K2(s,l){return s!=null&&we.call(s,l)}function G2(s,l){return s!=null&&l in Se(s)}function J2(s,l,c){return s>=ot(l,c)&&s<Be(l,c)}function lu(s,l,c){for(var d=c?Ul:so,y=s[0].length,w=s.length,E=w,M=I(w),O=1/0,P=[];E--;){var D=s[E];E&&l&&(D=ke(D,kt(l))),O=ot(D.length,O),M[E]=!c&&(l||y>=120&&D.length>=120)?new Ir(E&&D):t}D=s[0];var F=-1,V=M[0];e:for(;++F<y&&P.length<O;){var J=D[F],Z=l?l(J):J;if(J=c||J!==0?J:0,!(V?is(V,Z):d(P,Z,c))){for(E=w;--E;){var se=M[E];if(!(se?is(se,Z):d(s[E],Z,c)))continue e}V&&V.push(Z),P.push(J)}}return P}function j2(s,l,c,d){return yn(s,function(y,w,E){l(d,c(y),w,E)}),d}function ds(s,l,c){l=or(l,s),s=sp(s,l);var d=s==null?s:s[_n(qt(l))];return d==null?t:Et(d,s,c)}function _d(s){return Ie(s)&&ct(s)==tn}function Y2(s){return Ie(s)&&ct(s)==rs}function X2(s){return Ie(s)&&ct(s)==Zi}function ps(s,l,c,d,y){return s===l?!0:s==null||l==null||!Ie(s)&&!Ie(l)?s!==s&&l!==l:Z2(s,l,c,d,ps,y)}function Z2(s,l,c,d,y,w){var E=ne(s),M=ne(l),O=E?Zs:at(s),P=M?Zs:at(l);O=O==tn?On:O,P=P==tn?On:P;var D=O==On,F=P==On,V=O==P;if(V&&lr(s)){if(!lr(l))return!1;E=!0,D=!1}if(V&&!D)return w||(w=new on),E||bi(s)?Zd(s,l,c,d,y,w):E_(s,l,O,c,d,y,w);if(!(c&C)){var J=D&&we.call(s,"__wrapped__"),Z=F&&we.call(l,"__wrapped__");if(J||Z){var se=J?s.value():s,Q=Z?l.value():l;return w||(w=new on),y(se,Q,c,d,w)}}return V?(w||(w=new on),k_(s,l,c,d,y,w)):!1}function Q2(s){return Ie(s)&&at(s)==nn}function uu(s,l,c,d){var y=c.length,w=y,E=!d;if(s==null)return!w;for(s=Se(s);y--;){var M=c[y];if(E&&M[2]?M[1]!==s[M[0]]:!(M[0]in s))return!1}for(;++y<w;){M=c[y];var O=M[0],P=s[O],D=M[1];if(E&&M[2]){if(P===t&&!(O in s))return!1}else{var F=new on;if(d)var V=d(P,D,O,s,l,F);if(!(V===t?ps(D,P,C|g,d,F):V))return!1}}return!0}function vd(s){if(!Me(s)||P_(s))return!1;var l=Fn(s)?Qb:Vy;return l.test(Pr(s))}function e_(s){return Ie(s)&&ct(s)==es}function t_(s){return Ie(s)&&at(s)==rn}function n_(s){return Ie(s)&&Wo(s.length)&&!!Ce[ct(s)]}function wd(s){return typeof s=="function"?s:s==null?wt:typeof s=="object"?ne(s)?Cd(s[0],s[1]):xd(s):Vp(s)}function cu(s){if(!ys(s))return s2(s);var l=[];for(var c in Se(s))we.call(s,c)&&c!="constructor"&&l.push(c);return l}function r_(s){if(!Me(s))return B_(s);var l=ys(s),c=[];for(var d in s)d=="constructor"&&(l||!we.call(s,d))||c.push(d);return c}function fu(s,l){return s<l}function Sd(s,l){var c=-1,d=_t(s)?I(s.length):[];return ir(s,function(y,w,E){d[++c]=l(y,w,E)}),d}function xd(s){var l=ku(s);return l.length==1&&l[0][2]?rp(l[0][0],l[0][1]):function(c){return c===s||uu(c,s,l)}}function Cd(s,l){return Mu(s)&&np(l)?rp(_n(s),l):function(c){var d=zu(c,s);return d===t&&d===l?Bu(c,s):ps(l,d,C|g)}}function ko(s,l,c,d,y){s!==l&&su(l,function(w,E){if(y||(y=new on),Me(w))i_(s,l,E,c,ko,d,y);else{var M=d?d(Ou(s,E),w,E+"",s,l,y):t;M===t&&(M=w),ru(s,E,M)}},vt)}function i_(s,l,c,d,y,w,E){var M=Ou(s,c),O=Ou(l,c),P=E.get(O);if(P){ru(s,c,P);return}var D=w?w(M,O,c+"",s,l,E):t,F=D===t;if(F){var V=ne(O),J=!V&&lr(O),Z=!V&&!J&&bi(O);D=O,V||J||Z?ne(M)?D=M:Ne(M)?D=bt(M):J?(F=!1,D=Dd(O,!0)):Z?(F=!1,D=Fd(O,!0)):D=[]:_s(O)||Dr(O)?(D=M,Dr(M)?D=Rp(M):(!Me(M)||Fn(M))&&(D=tp(O))):F=!1}F&&(E.set(O,D),y(D,O,d,w,E),E.delete(O)),ru(s,c,D)}function Ed(s,l){var c=s.length;if(c)return l+=l<0?c:0,Dn(l,c)?s[l]:t}function kd(s,l,c){l.length?l=ke(l,function(w){return ne(w)?function(E){return Rr(E,w.length===1?w[0]:w)}:w}):l=[wt];var d=-1;l=ke(l,kt(X()));var y=Sd(s,function(w,E,M){var O=ke(l,function(P){return P(w)});return{criteria:O,index:++d,value:w}});return Ib(y,function(w,E){return y_(w,E,c)})}function s_(s,l){return Ad(s,l,function(c,d){return Bu(s,d)})}function Ad(s,l,c){for(var d=-1,y=l.length,w={};++d<y;){var E=l[d],M=Rr(s,E);c(M,E)&&ms(w,or(E,s),M)}return w}function o_(s){return function(l){return Rr(l,s)}}function hu(s,l,c,d){var y=d?Ob:ai,w=-1,E=l.length,M=s;for(s===l&&(l=bt(l)),c&&(M=ke(s,kt(c)));++w<E;)for(var O=0,P=l[w],D=c?c(P):P;(O=y(M,D,O,d))>-1;)M!==s&&go.call(M,O,1),go.call(s,O,1);return s}function Md(s,l){for(var c=s?l.length:0,d=c-1;c--;){var y=l[c];if(c==d||y!==w){var w=y;Dn(y)?go.call(s,y,1):gu(s,y)}}return s}function du(s,l){return s+_o(ld()*(l-s+1))}function a_(s,l,c,d){for(var y=-1,w=Be(bo((l-s)/(c||1)),0),E=I(w);w--;)E[d?w:++y]=s,s+=c;return E}function pu(s,l){var c="";if(!s||l<1||l>Ue)return c;do l%2&&(c+=s),l=_o(l/2),l&&(s+=s);while(l);return c}function oe(s,l){return Iu(ip(s,l,wt),s+"")}function l_(s){return fd(_i(s))}function u_(s,l){var c=_i(s);return Do(c,Nr(l,0,c.length))}function ms(s,l,c,d){if(!Me(s))return s;l=or(l,s);for(var y=-1,w=l.length,E=w-1,M=s;M!=null&&++y<w;){var O=_n(l[y]),P=c;if(O==="__proto__"||O==="constructor"||O==="prototype")return s;if(y!=E){var D=M[O];P=d?d(D,O,M):t,P===t&&(P=Me(D)?D:Dn(l[y+1])?[]:{})}fs(M,O,P),M=M[O]}return s}var Td=vo?function(s,l){return vo.set(s,l),s}:wt,c_=yo?function(s,l){return yo(s,"toString",{configurable:!0,enumerable:!1,value:Hu(l),writable:!0})}:wt;function f_(s){return Do(_i(s))}function Ut(s,l,c){var d=-1,y=s.length;l<0&&(l=-l>y?0:y+l),c=c>y?y:c,c<0&&(c+=y),y=l>c?0:c-l>>>0,l>>>=0;for(var w=I(y);++d<y;)w[d]=s[d+l];return w}function h_(s,l){var c;return ir(s,function(d,y,w){return c=l(d,y,w),!c}),!!c}function Ao(s,l,c){var d=0,y=s==null?d:s.length;if(typeof l=="number"&&l===l&&y<=Qn){for(;d<y;){var w=d+y>>>1,E=s[w];E!==null&&!Mt(E)&&(c?E<=l:E<l)?d=w+1:y=w}return y}return mu(s,l,wt,c)}function mu(s,l,c,d){var y=0,w=s==null?0:s.length;if(w===0)return 0;l=c(l);for(var E=l!==l,M=l===null,O=Mt(l),P=l===t;y<w;){var D=_o((y+w)/2),F=c(s[D]),V=F!==t,J=F===null,Z=F===F,se=Mt(F);if(E)var Q=d||Z;else P?Q=Z&&(d||V):M?Q=Z&&V&&(d||!J):O?Q=Z&&V&&!J&&(d||!se):J||se?Q=!1:Q=d?F<=l:F<l;Q?y=D+1:w=D}return ot(w,Zn)}function Od(s,l){for(var c=-1,d=s.length,y=0,w=[];++c<d;){var E=s[c],M=l?l(E):E;if(!c||!an(M,O)){var O=M;w[y++]=E===0?0:E}}return w}function Id(s){return typeof s=="number"?s:Mt(s)?st:+s}function At(s){if(typeof s=="string")return s;if(ne(s))return ke(s,At)+"";if(Mt(s))return ud?ud.call(s):"";var l=s+"";return l=="0"&&1/s==-Ve?"-0":l}function sr(s,l,c){var d=-1,y=so,w=s.length,E=!0,M=[],O=M;if(c)E=!1,y=Ul;else if(w>=i){var P=l?null:x_(s);if(P)return ao(P);E=!1,y=is,O=new Ir}else O=l?[]:M;e:for(;++d<w;){var D=s[d],F=l?l(D):D;if(D=c||D!==0?D:0,E&&F===F){for(var V=O.length;V--;)if(O[V]===F)continue e;l&&O.push(F),M.push(D)}else y(O,F,c)||(O!==M&&O.push(F),M.push(D))}return M}function gu(s,l){return l=or(l,s),s=sp(s,l),s==null||delete s[_n(qt(l))]}function Nd(s,l,c,d){return ms(s,l,c(Rr(s,l)),d)}function Mo(s,l,c,d){for(var y=s.length,w=d?y:-1;(d?w--:++w<y)&&l(s[w],w,s););return c?Ut(s,d?0:w,d?w+1:y):Ut(s,d?w+1:0,d?y:w)}function Rd(s,l){var c=s;return c instanceof ce&&(c=c.value()),ql(l,function(d,y){return y.func.apply(y.thisArg,tr([d],y.args))},c)}function yu(s,l,c){var d=s.length;if(d<2)return d?sr(s[0]):[];for(var y=-1,w=I(d);++y<d;)for(var E=s[y],M=-1;++M<d;)M!=y&&(w[y]=hs(w[y]||E,s[M],l,c));return sr(et(w,1),l,c)}function Ld(s,l,c){for(var d=-1,y=s.length,w=l.length,E={};++d<y;){var M=d<w?l[d]:t;c(E,s[d],M)}return E}function bu(s){return Ne(s)?s:[]}function _u(s){return typeof s=="function"?s:wt}function or(s,l){return ne(s)?s:Mu(s,l)?[s]:up(_e(s))}var d_=oe;function ar(s,l,c){var d=s.length;return c=c===t?d:c,!l&&c>=d?s:Ut(s,l,c)}var Pd=e2||function(s){return Qe.clearTimeout(s)};function Dd(s,l){if(l)return s.slice();var c=s.length,d=rd?rd(c):new s.constructor(c);return s.copy(d),d}function vu(s){var l=new s.constructor(s.byteLength);return new po(l).set(new po(s)),l}function p_(s,l){var c=l?vu(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.byteLength)}function m_(s){var l=new s.constructor(s.source,_h.exec(s));return l.lastIndex=s.lastIndex,l}function g_(s){return cs?Se(cs.call(s)):{}}function Fd(s,l){var c=l?vu(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.length)}function zd(s,l){if(s!==l){var c=s!==t,d=s===null,y=s===s,w=Mt(s),E=l!==t,M=l===null,O=l===l,P=Mt(l);if(!M&&!P&&!w&&s>l||w&&E&&O&&!M&&!P||d&&E&&O||!c&&O||!y)return 1;if(!d&&!w&&!P&&s<l||P&&c&&y&&!d&&!w||M&&c&&y||!E&&y||!O)return-1}return 0}function y_(s,l,c){for(var d=-1,y=s.criteria,w=l.criteria,E=y.length,M=c.length;++d<E;){var O=zd(y[d],w[d]);if(O){if(d>=M)return O;var P=c[d];return O*(P=="desc"?-1:1)}}return s.index-l.index}function Bd(s,l,c,d){for(var y=-1,w=s.length,E=c.length,M=-1,O=l.length,P=Be(w-E,0),D=I(O+P),F=!d;++M<O;)D[M]=l[M];for(;++y<E;)(F||y<w)&&(D[c[y]]=s[y]);for(;P--;)D[M++]=s[y++];return D}function $d(s,l,c,d){for(var y=-1,w=s.length,E=-1,M=c.length,O=-1,P=l.length,D=Be(w-M,0),F=I(D+P),V=!d;++y<D;)F[y]=s[y];for(var J=y;++O<P;)F[J+O]=l[O];for(;++E<M;)(V||y<w)&&(F[J+c[E]]=s[y++]);return F}function bt(s,l){var c=-1,d=s.length;for(l||(l=I(d));++c<d;)l[c]=s[c];return l}function bn(s,l,c,d){var y=!c;c||(c={});for(var w=-1,E=l.length;++w<E;){var M=l[w],O=d?d(c[M],s[M],M,c,s):t;O===t&&(O=s[M]),y?Rn(c,M,O):fs(c,M,O)}return c}function b_(s,l){return bn(s,Au(s),l)}function __(s,l){return bn(s,Qd(s),l)}function To(s,l){return function(c,d){var y=ne(c)?Cb:H2,w=l?l():{};return y(c,s,X(d,2),w)}}function mi(s){return oe(function(l,c){var d=-1,y=c.length,w=y>1?c[y-1]:t,E=y>2?c[2]:t;for(w=s.length>3&&typeof w=="function"?(y--,w):t,E&&ft(c[0],c[1],E)&&(w=y<3?t:w,y=1),l=Se(l);++d<y;){var M=c[d];M&&s(l,M,d,w)}return l})}function Hd(s,l){return function(c,d){if(c==null)return c;if(!_t(c))return s(c,d);for(var y=c.length,w=l?y:-1,E=Se(c);(l?w--:++w<y)&&d(E[w],w,E)!==!1;);return c}}function Wd(s){return function(l,c,d){for(var y=-1,w=Se(l),E=d(l),M=E.length;M--;){var O=E[s?M:++y];if(c(w[O],O,w)===!1)break}return l}}function v_(s,l,c){var d=l&_,y=gs(s);function w(){var E=this&&this!==Qe&&this instanceof w?y:s;return E.apply(d?c:this,arguments)}return w}function Vd(s){return function(l){l=_e(l);var c=li(l)?sn(l):t,d=c?c[0]:l.charAt(0),y=c?ar(c,1).join(""):l.slice(1);return d[s]()+y}}function gi(s){return function(l){return ql(Hp($p(l).replace(cb,"")),s,"")}}function gs(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=pi(s.prototype),d=s.apply(c,l);return Me(d)?d:c}}function w_(s,l,c){var d=gs(s);function y(){for(var w=arguments.length,E=I(w),M=w,O=yi(y);M--;)E[M]=arguments[M];var P=w<3&&E[0]!==O&&E[w-1]!==O?[]:nr(E,O);if(w-=P.length,w<c)return Jd(s,l,Oo,y.placeholder,t,E,P,t,t,c-w);var D=this&&this!==Qe&&this instanceof y?d:s;return Et(D,this,E)}return y}function Ud(s){return function(l,c,d){var y=Se(l);if(!_t(l)){var w=X(c,3);l=Ke(l),c=function(M){return w(y[M],M,y)}}var E=s(l,c,d);return E>-1?y[w?l[E]:E]:t}}function qd(s){return Pn(function(l){var c=l.length,d=c,y=Wt.prototype.thru;for(s&&l.reverse();d--;){var w=l[d];if(typeof w!="function")throw new Ht(a);if(y&&!E&&Lo(w)=="wrapper")var E=new Wt([],!0)}for(d=E?d:c;++d<c;){w=l[d];var M=Lo(w),O=M=="wrapper"?Eu(w):t;O&&Tu(O[0])&&O[1]==(U|A|W|j)&&!O[4].length&&O[9]==1?E=E[Lo(O[0])].apply(E,O[3]):E=w.length==1&&Tu(w)?E[M]():E.thru(w)}return function(){var P=arguments,D=P[0];if(E&&P.length==1&&ne(D))return E.plant(D).value();for(var F=0,V=c?l[F].apply(this,P):D;++F<c;)V=l[F].call(this,V);return V}})}function Oo(s,l,c,d,y,w,E,M,O,P){var D=l&U,F=l&_,V=l&x,J=l&(A|N),Z=l&pe,se=V?t:gs(s);function Q(){for(var le=arguments.length,he=I(le),Tt=le;Tt--;)he[Tt]=arguments[Tt];if(J)var ht=yi(Q),Ot=Rb(he,ht);if(d&&(he=Bd(he,d,y,J)),w&&(he=$d(he,w,E,J)),le-=Ot,J&&le<P){var Re=nr(he,ht);return Jd(s,l,Oo,Q.placeholder,c,he,Re,M,O,P-le)}var ln=F?c:this,Bn=V?ln[s]:s;return le=he.length,M?he=H_(he,M):Z&&le>1&&he.reverse(),D&&O<le&&(he.length=O),this&&this!==Qe&&this instanceof Q&&(Bn=se||gs(Bn)),Bn.apply(ln,he)}return Q}function Kd(s,l){return function(c,d){return j2(c,s,l(d),{})}}function Io(s,l){return function(c,d){var y;if(c===t&&d===t)return l;if(c!==t&&(y=c),d!==t){if(y===t)return d;typeof c=="string"||typeof d=="string"?(c=At(c),d=At(d)):(c=Id(c),d=Id(d)),y=s(c,d)}return y}}function wu(s){return Pn(function(l){return l=ke(l,kt(X())),oe(function(c){var d=this;return s(l,function(y){return Et(y,d,c)})})})}function No(s,l){l=l===t?" ":At(l);var c=l.length;if(c<2)return c?pu(l,s):l;var d=pu(l,bo(s/ui(l)));return li(l)?ar(sn(d),0,s).join(""):d.slice(0,s)}function S_(s,l,c,d){var y=l&_,w=gs(s);function E(){for(var M=-1,O=arguments.length,P=-1,D=d.length,F=I(D+O),V=this&&this!==Qe&&this instanceof E?w:s;++P<D;)F[P]=d[P];for(;O--;)F[P++]=arguments[++M];return Et(V,y?c:this,F)}return E}function Gd(s){return function(l,c,d){return d&&typeof d!="number"&&ft(l,c,d)&&(c=d=t),l=zn(l),c===t?(c=l,l=0):c=zn(c),d=d===t?l<c?1:-1:zn(d),a_(l,c,d,s)}}function Ro(s){return function(l,c){return typeof l=="string"&&typeof c=="string"||(l=Kt(l),c=Kt(c)),s(l,c)}}function Jd(s,l,c,d,y,w,E,M,O,P){var D=l&A,F=D?E:t,V=D?t:E,J=D?w:t,Z=D?t:w;l|=D?W:L,l&=~(D?L:W),l&k||(l&=~(_|x));var se=[s,l,y,J,F,Z,V,M,O,P],Q=c.apply(t,se);return Tu(s)&&op(Q,se),Q.placeholder=d,ap(Q,s,l)}function Su(s){var l=ze[s];return function(c,d){if(c=Kt(c),d=d==null?0:ot(re(d),292),d&&ad(c)){var y=(_e(c)+"e").split("e"),w=l(y[0]+"e"+(+y[1]+d));return y=(_e(w)+"e").split("e"),+(y[0]+"e"+(+y[1]-d))}return l(c)}}var x_=hi&&1/ao(new hi([,-0]))[1]==Ve?function(s){return new hi(s)}:Uu;function jd(s){return function(l){var c=at(l);return c==nn?Zl(l):c==rn?$b(l):Nb(l,s(l))}}function Ln(s,l,c,d,y,w,E,M){var O=l&x;if(!O&&typeof s!="function")throw new Ht(a);var P=d?d.length:0;if(P||(l&=~(W|L),d=y=t),E=E===t?E:Be(re(E),0),M=M===t?M:re(M),P-=y?y.length:0,l&L){var D=d,F=y;d=y=t}var V=O?t:Eu(s),J=[s,l,c,d,y,D,F,w,E,M];if(V&&z_(J,V),s=J[0],l=J[1],c=J[2],d=J[3],y=J[4],M=J[9]=J[9]===t?O?0:s.length:Be(J[9]-P,0),!M&&l&(A|N)&&(l&=~(A|N)),!l||l==_)var Z=v_(s,l,c);else l==A||l==N?Z=w_(s,l,M):(l==W||l==(_|W))&&!y.length?Z=S_(s,l,c,d):Z=Oo.apply(t,J);var se=V?Td:op;return ap(se(Z,J),s,l)}function Yd(s,l,c,d){return s===t||an(s,fi[c])&&!we.call(d,c)?l:s}function Xd(s,l,c,d,y,w){return Me(s)&&Me(l)&&(w.set(l,s),ko(s,l,t,Xd,w),w.delete(l)),s}function C_(s){return _s(s)?t:s}function Zd(s,l,c,d,y,w){var E=c&C,M=s.length,O=l.length;if(M!=O&&!(E&&O>M))return!1;var P=w.get(s),D=w.get(l);if(P&&D)return P==l&&D==s;var F=-1,V=!0,J=c&g?new Ir:t;for(w.set(s,l),w.set(l,s);++F<M;){var Z=s[F],se=l[F];if(d)var Q=E?d(se,Z,F,l,s,w):d(Z,se,F,s,l,w);if(Q!==t){if(Q)continue;V=!1;break}if(J){if(!Kl(l,function(le,he){if(!is(J,he)&&(Z===le||y(Z,le,c,d,w)))return J.push(he)})){V=!1;break}}else if(!(Z===se||y(Z,se,c,d,w))){V=!1;break}}return w.delete(s),w.delete(l),V}function E_(s,l,c,d,y,w,E){switch(c){case si:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case rs:return!(s.byteLength!=l.byteLength||!w(new po(s),new po(l)));case Xi:case Zi:case Qi:return an(+s,+l);case Qs:return s.name==l.name&&s.message==l.message;case es:case ts:return s==l+"";case nn:var M=Zl;case rn:var O=d&C;if(M||(M=ao),s.size!=l.size&&!O)return!1;var P=E.get(s);if(P)return P==l;d|=g,E.set(s,l);var D=Zd(M(s),M(l),d,y,w,E);return E.delete(s),D;case to:if(cs)return cs.call(s)==cs.call(l)}return!1}function k_(s,l,c,d,y,w){var E=c&C,M=xu(s),O=M.length,P=xu(l),D=P.length;if(O!=D&&!E)return!1;for(var F=O;F--;){var V=M[F];if(!(E?V in l:we.call(l,V)))return!1}var J=w.get(s),Z=w.get(l);if(J&&Z)return J==l&&Z==s;var se=!0;w.set(s,l),w.set(l,s);for(var Q=E;++F<O;){V=M[F];var le=s[V],he=l[V];if(d)var Tt=E?d(he,le,V,l,s,w):d(le,he,V,s,l,w);if(!(Tt===t?le===he||y(le,he,c,d,w):Tt)){se=!1;break}Q||(Q=V=="constructor")}if(se&&!Q){var ht=s.constructor,Ot=l.constructor;ht!=Ot&&"constructor"in s&&"constructor"in l&&!(typeof ht=="function"&&ht instanceof ht&&typeof Ot=="function"&&Ot instanceof Ot)&&(se=!1)}return w.delete(s),w.delete(l),se}function Pn(s){return Iu(ip(s,t,dp),s+"")}function xu(s){return bd(s,Ke,Au)}function Cu(s){return bd(s,vt,Qd)}var Eu=vo?function(s){return vo.get(s)}:Uu;function Lo(s){for(var l=s.name+"",c=di[l],d=we.call(di,l)?c.length:0;d--;){var y=c[d],w=y.func;if(w==null||w==s)return y.name}return l}function yi(s){var l=we.call(v,"placeholder")?v:s;return l.placeholder}function X(){var s=v.iteratee||Wu;return s=s===Wu?wd:s,arguments.length?s(arguments[0],arguments[1]):s}function Po(s,l){var c=s.__data__;return L_(l)?c[typeof l=="string"?"string":"hash"]:c.map}function ku(s){for(var l=Ke(s),c=l.length;c--;){var d=l[c],y=s[d];l[c]=[d,y,np(y)]}return l}function Lr(s,l){var c=Fb(s,l);return vd(c)?c:t}function A_(s){var l=we.call(s,Tr),c=s[Tr];try{s[Tr]=t;var d=!0}catch{}var y=fo.call(s);return d&&(l?s[Tr]=c:delete s[Tr]),y}var Au=eu?function(s){return s==null?[]:(s=Se(s),er(eu(s),function(l){return sd.call(s,l)}))}:qu,Qd=eu?function(s){for(var l=[];s;)tr(l,Au(s)),s=mo(s);return l}:qu,at=ct;(tu&&at(new tu(new ArrayBuffer(1)))!=si||as&&at(new as)!=nn||nu&&at(nu.resolve())!=mh||hi&&at(new hi)!=rn||ls&&at(new ls)!=ns)&&(at=function(s){var l=ct(s),c=l==On?s.constructor:t,d=c?Pr(c):"";if(d)switch(d){case u2:return si;case c2:return nn;case f2:return mh;case h2:return rn;case d2:return ns}return l});function M_(s,l,c){for(var d=-1,y=c.length;++d<y;){var w=c[d],E=w.size;switch(w.type){case"drop":s+=E;break;case"dropRight":l-=E;break;case"take":l=ot(l,s+E);break;case"takeRight":s=Be(s,l-E);break}}return{start:s,end:l}}function T_(s){var l=s.match(Py);return l?l[1].split(Dy):[]}function ep(s,l,c){l=or(l,s);for(var d=-1,y=l.length,w=!1;++d<y;){var E=_n(l[d]);if(!(w=s!=null&&c(s,E)))break;s=s[E]}return w||++d!=y?w:(y=s==null?0:s.length,!!y&&Wo(y)&&Dn(E,y)&&(ne(s)||Dr(s)))}function O_(s){var l=s.length,c=new s.constructor(l);return l&&typeof s[0]=="string"&&we.call(s,"index")&&(c.index=s.index,c.input=s.input),c}function tp(s){return typeof s.constructor=="function"&&!ys(s)?pi(mo(s)):{}}function I_(s,l,c){var d=s.constructor;switch(l){case rs:return vu(s);case Xi:case Zi:return new d(+s);case si:return p_(s,c);case kl:case Al:case Ml:case Tl:case Ol:case Il:case Nl:case Rl:case Ll:return Fd(s,c);case nn:return new d;case Qi:case ts:return new d(s);case es:return m_(s);case rn:return new d;case to:return g_(s)}}function N_(s,l){var c=l.length;if(!c)return s;var d=c-1;return l[d]=(c>1?"& ":"")+l[d],l=l.join(c>2?", ":" "),s.replace(Ly,`{
|
|
41
|
+
/* [wrapped with `+l+`] */
|
|
42
|
+
`)}function R_(s){return ne(s)||Dr(s)||!!(od&&s&&s[od])}function Dn(s,l){var c=typeof s;return l=l??Ue,!!l&&(c=="number"||c!="symbol"&&qy.test(s))&&s>-1&&s%1==0&&s<l}function ft(s,l,c){if(!Me(c))return!1;var d=typeof l;return(d=="number"?_t(c)&&Dn(l,c.length):d=="string"&&l in c)?an(c[l],s):!1}function Mu(s,l){if(ne(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||Mt(s)?!0:Oy.test(s)||!Ty.test(s)||l!=null&&s in Se(l)}function L_(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function Tu(s){var l=Lo(s),c=v[l];if(typeof c!="function"||!(l in ce.prototype))return!1;if(s===c)return!0;var d=Eu(c);return!!d&&s===d[0]}function P_(s){return!!nd&&nd in s}var D_=uo?Fn:Ku;function ys(s){var l=s&&s.constructor,c=typeof l=="function"&&l.prototype||fi;return s===c}function np(s){return s===s&&!Me(s)}function rp(s,l){return function(c){return c==null?!1:c[s]===l&&(l!==t||s in Se(c))}}function F_(s){var l=$o(s,function(d){return c.size===h&&c.clear(),d}),c=l.cache;return l}function z_(s,l){var c=s[1],d=l[1],y=c|d,w=y<(_|x|U),E=d==U&&c==A||d==U&&c==j&&s[7].length<=l[8]||d==(U|j)&&l[7].length<=l[8]&&c==A;if(!(w||E))return s;d&_&&(s[2]=l[2],y|=c&_?0:k);var M=l[3];if(M){var O=s[3];s[3]=O?Bd(O,M,l[4]):M,s[4]=O?nr(s[3],m):l[4]}return M=l[5],M&&(O=s[5],s[5]=O?$d(O,M,l[6]):M,s[6]=O?nr(s[5],m):l[6]),M=l[7],M&&(s[7]=M),d&U&&(s[8]=s[8]==null?l[8]:ot(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=y,s}function B_(s){var l=[];if(s!=null)for(var c in Se(s))l.push(c);return l}function $_(s){return fo.call(s)}function ip(s,l,c){return l=Be(l===t?s.length-1:l,0),function(){for(var d=arguments,y=-1,w=Be(d.length-l,0),E=I(w);++y<w;)E[y]=d[l+y];y=-1;for(var M=I(l+1);++y<l;)M[y]=d[y];return M[l]=c(E),Et(s,this,M)}}function sp(s,l){return l.length<2?s:Rr(s,Ut(l,0,-1))}function H_(s,l){for(var c=s.length,d=ot(l.length,c),y=bt(s);d--;){var w=l[d];s[d]=Dn(w,c)?y[w]:t}return s}function Ou(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var op=lp(Td),bs=n2||function(s,l){return Qe.setTimeout(s,l)},Iu=lp(c_);function ap(s,l,c){var d=l+"";return Iu(s,N_(d,W_(T_(d),c)))}function lp(s){var l=0,c=0;return function(){var d=o2(),y=Xn-(d-c);if(c=d,y>0){if(++l>=Ft)return arguments[0]}else l=0;return s.apply(t,arguments)}}function Do(s,l){var c=-1,d=s.length,y=d-1;for(l=l===t?d:l;++c<l;){var w=du(c,y),E=s[w];s[w]=s[c],s[c]=E}return s.length=l,s}var up=F_(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(Iy,function(c,d,y,w){l.push(y?w.replace(By,"$1"):d||c)}),l});function _n(s){if(typeof s=="string"||Mt(s))return s;var l=s+"";return l=="0"&&1/s==-Ve?"-0":l}function Pr(s){if(s!=null){try{return co.call(s)}catch{}try{return s+""}catch{}}return""}function W_(s,l){return $t(El,function(c){var d="_."+c[0];l&c[1]&&!so(s,d)&&s.push(d)}),s.sort()}function cp(s){if(s instanceof ce)return s.clone();var l=new Wt(s.__wrapped__,s.__chain__);return l.__actions__=bt(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function V_(s,l,c){(c?ft(s,l,c):l===t)?l=1:l=Be(re(l),0);var d=s==null?0:s.length;if(!d||l<1)return[];for(var y=0,w=0,E=I(bo(d/l));y<d;)E[w++]=Ut(s,y,y+=l);return E}function U_(s){for(var l=-1,c=s==null?0:s.length,d=0,y=[];++l<c;){var w=s[l];w&&(y[d++]=w)}return y}function q_(){var s=arguments.length;if(!s)return[];for(var l=I(s-1),c=arguments[0],d=s;d--;)l[d-1]=arguments[d];return tr(ne(c)?bt(c):[c],et(l,1))}var K_=oe(function(s,l){return Ne(s)?hs(s,et(l,1,Ne,!0)):[]}),G_=oe(function(s,l){var c=qt(l);return Ne(c)&&(c=t),Ne(s)?hs(s,et(l,1,Ne,!0),X(c,2)):[]}),J_=oe(function(s,l){var c=qt(l);return Ne(c)&&(c=t),Ne(s)?hs(s,et(l,1,Ne,!0),t,c):[]});function j_(s,l,c){var d=s==null?0:s.length;return d?(l=c||l===t?1:re(l),Ut(s,l<0?0:l,d)):[]}function Y_(s,l,c){var d=s==null?0:s.length;return d?(l=c||l===t?1:re(l),l=d-l,Ut(s,0,l<0?0:l)):[]}function X_(s,l){return s&&s.length?Mo(s,X(l,3),!0,!0):[]}function Z_(s,l){return s&&s.length?Mo(s,X(l,3),!0):[]}function Q_(s,l,c,d){var y=s==null?0:s.length;return y?(c&&typeof c!="number"&&ft(s,l,c)&&(c=0,d=y),q2(s,l,c,d)):[]}function fp(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var y=c==null?0:re(c);return y<0&&(y=Be(d+y,0)),oo(s,X(l,3),y)}function hp(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var y=d-1;return c!==t&&(y=re(c),y=c<0?Be(d+y,0):ot(y,d-1)),oo(s,X(l,3),y,!0)}function dp(s){var l=s==null?0:s.length;return l?et(s,1):[]}function ev(s){var l=s==null?0:s.length;return l?et(s,Ve):[]}function tv(s,l){var c=s==null?0:s.length;return c?(l=l===t?1:re(l),et(s,l)):[]}function nv(s){for(var l=-1,c=s==null?0:s.length,d={};++l<c;){var y=s[l];d[y[0]]=y[1]}return d}function pp(s){return s&&s.length?s[0]:t}function rv(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var y=c==null?0:re(c);return y<0&&(y=Be(d+y,0)),ai(s,l,y)}function iv(s){var l=s==null?0:s.length;return l?Ut(s,0,-1):[]}var sv=oe(function(s){var l=ke(s,bu);return l.length&&l[0]===s[0]?lu(l):[]}),ov=oe(function(s){var l=qt(s),c=ke(s,bu);return l===qt(c)?l=t:c.pop(),c.length&&c[0]===s[0]?lu(c,X(l,2)):[]}),av=oe(function(s){var l=qt(s),c=ke(s,bu);return l=typeof l=="function"?l:t,l&&c.pop(),c.length&&c[0]===s[0]?lu(c,t,l):[]});function lv(s,l){return s==null?"":i2.call(s,l)}function qt(s){var l=s==null?0:s.length;return l?s[l-1]:t}function uv(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var y=d;return c!==t&&(y=re(c),y=y<0?Be(d+y,0):ot(y,d-1)),l===l?Wb(s,l,y):oo(s,Jh,y,!0)}function cv(s,l){return s&&s.length?Ed(s,re(l)):t}var fv=oe(mp);function mp(s,l){return s&&s.length&&l&&l.length?hu(s,l):s}function hv(s,l,c){return s&&s.length&&l&&l.length?hu(s,l,X(c,2)):s}function dv(s,l,c){return s&&s.length&&l&&l.length?hu(s,l,t,c):s}var pv=Pn(function(s,l){var c=s==null?0:s.length,d=iu(s,l);return Md(s,ke(l,function(y){return Dn(y,c)?+y:y}).sort(zd)),d});function mv(s,l){var c=[];if(!(s&&s.length))return c;var d=-1,y=[],w=s.length;for(l=X(l,3);++d<w;){var E=s[d];l(E,d,s)&&(c.push(E),y.push(d))}return Md(s,y),c}function Nu(s){return s==null?s:l2.call(s)}function gv(s,l,c){var d=s==null?0:s.length;return d?(c&&typeof c!="number"&&ft(s,l,c)?(l=0,c=d):(l=l==null?0:re(l),c=c===t?d:re(c)),Ut(s,l,c)):[]}function yv(s,l){return Ao(s,l)}function bv(s,l,c){return mu(s,l,X(c,2))}function _v(s,l){var c=s==null?0:s.length;if(c){var d=Ao(s,l);if(d<c&&an(s[d],l))return d}return-1}function vv(s,l){return Ao(s,l,!0)}function wv(s,l,c){return mu(s,l,X(c,2),!0)}function Sv(s,l){var c=s==null?0:s.length;if(c){var d=Ao(s,l,!0)-1;if(an(s[d],l))return d}return-1}function xv(s){return s&&s.length?Od(s):[]}function Cv(s,l){return s&&s.length?Od(s,X(l,2)):[]}function Ev(s){var l=s==null?0:s.length;return l?Ut(s,1,l):[]}function kv(s,l,c){return s&&s.length?(l=c||l===t?1:re(l),Ut(s,0,l<0?0:l)):[]}function Av(s,l,c){var d=s==null?0:s.length;return d?(l=c||l===t?1:re(l),l=d-l,Ut(s,l<0?0:l,d)):[]}function Mv(s,l){return s&&s.length?Mo(s,X(l,3),!1,!0):[]}function Tv(s,l){return s&&s.length?Mo(s,X(l,3)):[]}var Ov=oe(function(s){return sr(et(s,1,Ne,!0))}),Iv=oe(function(s){var l=qt(s);return Ne(l)&&(l=t),sr(et(s,1,Ne,!0),X(l,2))}),Nv=oe(function(s){var l=qt(s);return l=typeof l=="function"?l:t,sr(et(s,1,Ne,!0),t,l)});function Rv(s){return s&&s.length?sr(s):[]}function Lv(s,l){return s&&s.length?sr(s,X(l,2)):[]}function Pv(s,l){return l=typeof l=="function"?l:t,s&&s.length?sr(s,t,l):[]}function Ru(s){if(!(s&&s.length))return[];var l=0;return s=er(s,function(c){if(Ne(c))return l=Be(c.length,l),!0}),Yl(l,function(c){return ke(s,Gl(c))})}function gp(s,l){if(!(s&&s.length))return[];var c=Ru(s);return l==null?c:ke(c,function(d){return Et(l,t,d)})}var Dv=oe(function(s,l){return Ne(s)?hs(s,l):[]}),Fv=oe(function(s){return yu(er(s,Ne))}),zv=oe(function(s){var l=qt(s);return Ne(l)&&(l=t),yu(er(s,Ne),X(l,2))}),Bv=oe(function(s){var l=qt(s);return l=typeof l=="function"?l:t,yu(er(s,Ne),t,l)}),$v=oe(Ru);function Hv(s,l){return Ld(s||[],l||[],fs)}function Wv(s,l){return Ld(s||[],l||[],ms)}var Vv=oe(function(s){var l=s.length,c=l>1?s[l-1]:t;return c=typeof c=="function"?(s.pop(),c):t,gp(s,c)});function yp(s){var l=v(s);return l.__chain__=!0,l}function Uv(s,l){return l(s),s}function Fo(s,l){return l(s)}var qv=Pn(function(s){var l=s.length,c=l?s[0]:0,d=this.__wrapped__,y=function(w){return iu(w,s)};return l>1||this.__actions__.length||!(d instanceof ce)||!Dn(c)?this.thru(y):(d=d.slice(c,+c+(l?1:0)),d.__actions__.push({func:Fo,args:[y],thisArg:t}),new Wt(d,this.__chain__).thru(function(w){return l&&!w.length&&w.push(t),w}))});function Kv(){return yp(this)}function Gv(){return new Wt(this.value(),this.__chain__)}function Jv(){this.__values__===t&&(this.__values__=Ip(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function jv(){return this}function Yv(s){for(var l,c=this;c instanceof So;){var d=cp(c);d.__index__=0,d.__values__=t,l?y.__wrapped__=d:l=d;var y=d;c=c.__wrapped__}return y.__wrapped__=s,l}function Xv(){var s=this.__wrapped__;if(s instanceof ce){var l=s;return this.__actions__.length&&(l=new ce(this)),l=l.reverse(),l.__actions__.push({func:Fo,args:[Nu],thisArg:t}),new Wt(l,this.__chain__)}return this.thru(Nu)}function Zv(){return Rd(this.__wrapped__,this.__actions__)}var Qv=To(function(s,l,c){we.call(s,c)?++s[c]:Rn(s,c,1)});function ew(s,l,c){var d=ne(s)?Kh:U2;return c&&ft(s,l,c)&&(l=t),d(s,X(l,3))}function tw(s,l){var c=ne(s)?er:gd;return c(s,X(l,3))}var nw=Ud(fp),rw=Ud(hp);function iw(s,l){return et(zo(s,l),1)}function sw(s,l){return et(zo(s,l),Ve)}function ow(s,l,c){return c=c===t?1:re(c),et(zo(s,l),c)}function bp(s,l){var c=ne(s)?$t:ir;return c(s,X(l,3))}function _p(s,l){var c=ne(s)?Eb:md;return c(s,X(l,3))}var aw=To(function(s,l,c){we.call(s,c)?s[c].push(l):Rn(s,c,[l])});function lw(s,l,c,d){s=_t(s)?s:_i(s),c=c&&!d?re(c):0;var y=s.length;return c<0&&(c=Be(y+c,0)),Vo(s)?c<=y&&s.indexOf(l,c)>-1:!!y&&ai(s,l,c)>-1}var uw=oe(function(s,l,c){var d=-1,y=typeof l=="function",w=_t(s)?I(s.length):[];return ir(s,function(E){w[++d]=y?Et(l,E,c):ds(E,l,c)}),w}),cw=To(function(s,l,c){Rn(s,c,l)});function zo(s,l){var c=ne(s)?ke:Sd;return c(s,X(l,3))}function fw(s,l,c,d){return s==null?[]:(ne(l)||(l=l==null?[]:[l]),c=d?t:c,ne(c)||(c=c==null?[]:[c]),kd(s,l,c))}var hw=To(function(s,l,c){s[c?0:1].push(l)},function(){return[[],[]]});function dw(s,l,c){var d=ne(s)?ql:Yh,y=arguments.length<3;return d(s,X(l,4),c,y,ir)}function pw(s,l,c){var d=ne(s)?kb:Yh,y=arguments.length<3;return d(s,X(l,4),c,y,md)}function mw(s,l){var c=ne(s)?er:gd;return c(s,Ho(X(l,3)))}function gw(s){var l=ne(s)?fd:l_;return l(s)}function yw(s,l,c){(c?ft(s,l,c):l===t)?l=1:l=re(l);var d=ne(s)?B2:u_;return d(s,l)}function bw(s){var l=ne(s)?$2:f_;return l(s)}function _w(s){if(s==null)return 0;if(_t(s))return Vo(s)?ui(s):s.length;var l=at(s);return l==nn||l==rn?s.size:cu(s).length}function vw(s,l,c){var d=ne(s)?Kl:h_;return c&&ft(s,l,c)&&(l=t),d(s,X(l,3))}var ww=oe(function(s,l){if(s==null)return[];var c=l.length;return c>1&&ft(s,l[0],l[1])?l=[]:c>2&&ft(l[0],l[1],l[2])&&(l=[l[0]]),kd(s,et(l,1),[])}),Bo=t2||function(){return Qe.Date.now()};function Sw(s,l){if(typeof l!="function")throw new Ht(a);return s=re(s),function(){if(--s<1)return l.apply(this,arguments)}}function vp(s,l,c){return l=c?t:l,l=s&&l==null?s.length:l,Ln(s,U,t,t,t,t,l)}function wp(s,l){var c;if(typeof l!="function")throw new Ht(a);return s=re(s),function(){return--s>0&&(c=l.apply(this,arguments)),s<=1&&(l=t),c}}var Lu=oe(function(s,l,c){var d=_;if(c.length){var y=nr(c,yi(Lu));d|=W}return Ln(s,d,l,c,y)}),Sp=oe(function(s,l,c){var d=_|x;if(c.length){var y=nr(c,yi(Sp));d|=W}return Ln(l,d,s,c,y)});function xp(s,l,c){l=c?t:l;var d=Ln(s,A,t,t,t,t,t,l);return d.placeholder=xp.placeholder,d}function Cp(s,l,c){l=c?t:l;var d=Ln(s,N,t,t,t,t,t,l);return d.placeholder=Cp.placeholder,d}function Ep(s,l,c){var d,y,w,E,M,O,P=0,D=!1,F=!1,V=!0;if(typeof s!="function")throw new Ht(a);l=Kt(l)||0,Me(c)&&(D=!!c.leading,F="maxWait"in c,w=F?Be(Kt(c.maxWait)||0,l):w,V="trailing"in c?!!c.trailing:V);function J(Re){var ln=d,Bn=y;return d=y=t,P=Re,E=s.apply(Bn,ln),E}function Z(Re){return P=Re,M=bs(le,l),D?J(Re):E}function se(Re){var ln=Re-O,Bn=Re-P,Up=l-ln;return F?ot(Up,w-Bn):Up}function Q(Re){var ln=Re-O,Bn=Re-P;return O===t||ln>=l||ln<0||F&&Bn>=w}function le(){var Re=Bo();if(Q(Re))return he(Re);M=bs(le,se(Re))}function he(Re){return M=t,V&&d?J(Re):(d=y=t,E)}function Tt(){M!==t&&Pd(M),P=0,d=O=y=M=t}function ht(){return M===t?E:he(Bo())}function Ot(){var Re=Bo(),ln=Q(Re);if(d=arguments,y=this,O=Re,ln){if(M===t)return Z(O);if(F)return Pd(M),M=bs(le,l),J(O)}return M===t&&(M=bs(le,l)),E}return Ot.cancel=Tt,Ot.flush=ht,Ot}var xw=oe(function(s,l){return pd(s,1,l)}),Cw=oe(function(s,l,c){return pd(s,Kt(l)||0,c)});function Ew(s){return Ln(s,pe)}function $o(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Ht(a);var c=function(){var d=arguments,y=l?l.apply(this,d):d[0],w=c.cache;if(w.has(y))return w.get(y);var E=s.apply(this,d);return c.cache=w.set(y,E)||w,E};return c.cache=new($o.Cache||Nn),c}$o.Cache=Nn;function Ho(s){if(typeof s!="function")throw new Ht(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 kw(s){return wp(2,s)}var Aw=d_(function(s,l){l=l.length==1&&ne(l[0])?ke(l[0],kt(X())):ke(et(l,1),kt(X()));var c=l.length;return oe(function(d){for(var y=-1,w=ot(d.length,c);++y<w;)d[y]=l[y].call(this,d[y]);return Et(s,this,d)})}),Pu=oe(function(s,l){var c=nr(l,yi(Pu));return Ln(s,W,t,l,c)}),kp=oe(function(s,l){var c=nr(l,yi(kp));return Ln(s,L,t,l,c)}),Mw=Pn(function(s,l){return Ln(s,j,t,t,t,l)});function Tw(s,l){if(typeof s!="function")throw new Ht(a);return l=l===t?l:re(l),oe(s,l)}function Ow(s,l){if(typeof s!="function")throw new Ht(a);return l=l==null?0:Be(re(l),0),oe(function(c){var d=c[l],y=ar(c,0,l);return d&&tr(y,d),Et(s,this,y)})}function Iw(s,l,c){var d=!0,y=!0;if(typeof s!="function")throw new Ht(a);return Me(c)&&(d="leading"in c?!!c.leading:d,y="trailing"in c?!!c.trailing:y),Ep(s,l,{leading:d,maxWait:l,trailing:y})}function Nw(s){return vp(s,1)}function Rw(s,l){return Pu(_u(l),s)}function Lw(){if(!arguments.length)return[];var s=arguments[0];return ne(s)?s:[s]}function Pw(s){return Vt(s,S)}function Dw(s,l){return l=typeof l=="function"?l:t,Vt(s,S,l)}function Fw(s){return Vt(s,p|S)}function zw(s,l){return l=typeof l=="function"?l:t,Vt(s,p|S,l)}function Bw(s,l){return l==null||dd(s,l,Ke(l))}function an(s,l){return s===l||s!==s&&l!==l}var $w=Ro(au),Hw=Ro(function(s,l){return s>=l}),Dr=_d(function(){return arguments}())?_d:function(s){return Ie(s)&&we.call(s,"callee")&&!sd.call(s,"callee")},ne=I.isArray,Ww=$h?kt($h):Y2;function _t(s){return s!=null&&Wo(s.length)&&!Fn(s)}function Ne(s){return Ie(s)&&_t(s)}function Vw(s){return s===!0||s===!1||Ie(s)&&ct(s)==Xi}var lr=r2||Ku,Uw=Hh?kt(Hh):X2;function qw(s){return Ie(s)&&s.nodeType===1&&!_s(s)}function Kw(s){if(s==null)return!0;if(_t(s)&&(ne(s)||typeof s=="string"||typeof s.splice=="function"||lr(s)||bi(s)||Dr(s)))return!s.length;var l=at(s);if(l==nn||l==rn)return!s.size;if(ys(s))return!cu(s).length;for(var c in s)if(we.call(s,c))return!1;return!0}function Gw(s,l){return ps(s,l)}function Jw(s,l,c){c=typeof c=="function"?c:t;var d=c?c(s,l):t;return d===t?ps(s,l,t,c):!!d}function Du(s){if(!Ie(s))return!1;var l=ct(s);return l==Qs||l==yy||typeof s.message=="string"&&typeof s.name=="string"&&!_s(s)}function jw(s){return typeof s=="number"&&ad(s)}function Fn(s){if(!Me(s))return!1;var l=ct(s);return l==eo||l==ph||l==gy||l==_y}function Ap(s){return typeof s=="number"&&s==re(s)}function Wo(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Ue}function Me(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Ie(s){return s!=null&&typeof s=="object"}var Mp=Wh?kt(Wh):Q2;function Yw(s,l){return s===l||uu(s,l,ku(l))}function Xw(s,l,c){return c=typeof c=="function"?c:t,uu(s,l,ku(l),c)}function Zw(s){return Tp(s)&&s!=+s}function Qw(s){if(D_(s))throw new te(o);return vd(s)}function eS(s){return s===null}function tS(s){return s==null}function Tp(s){return typeof s=="number"||Ie(s)&&ct(s)==Qi}function _s(s){if(!Ie(s)||ct(s)!=On)return!1;var l=mo(s);if(l===null)return!0;var c=we.call(l,"constructor")&&l.constructor;return typeof c=="function"&&c instanceof c&&co.call(c)==Xb}var Fu=Vh?kt(Vh):e_;function nS(s){return Ap(s)&&s>=-Ue&&s<=Ue}var Op=Uh?kt(Uh):t_;function Vo(s){return typeof s=="string"||!ne(s)&&Ie(s)&&ct(s)==ts}function Mt(s){return typeof s=="symbol"||Ie(s)&&ct(s)==to}var bi=qh?kt(qh):n_;function rS(s){return s===t}function iS(s){return Ie(s)&&at(s)==ns}function sS(s){return Ie(s)&&ct(s)==wy}var oS=Ro(fu),aS=Ro(function(s,l){return s<=l});function Ip(s){if(!s)return[];if(_t(s))return Vo(s)?sn(s):bt(s);if(ss&&s[ss])return Bb(s[ss]());var l=at(s),c=l==nn?Zl:l==rn?ao:_i;return c(s)}function zn(s){if(!s)return s===0?s:0;if(s=Kt(s),s===Ve||s===-Ve){var l=s<0?-1:1;return l*zt}return s===s?s:0}function re(s){var l=zn(s),c=l%1;return l===l?c?l-c:l:0}function Np(s){return s?Nr(re(s),0,qe):0}function Kt(s){if(typeof s=="number")return s;if(Mt(s))return st;if(Me(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Me(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=Xh(s);var c=Wy.test(s);return c||Uy.test(s)?Sb(s.slice(2),c?2:8):Hy.test(s)?st:+s}function Rp(s){return bn(s,vt(s))}function lS(s){return s?Nr(re(s),-Ue,Ue):s===0?s:0}function _e(s){return s==null?"":At(s)}var uS=mi(function(s,l){if(ys(l)||_t(l)){bn(l,Ke(l),s);return}for(var c in l)we.call(l,c)&&fs(s,c,l[c])}),Lp=mi(function(s,l){bn(l,vt(l),s)}),Uo=mi(function(s,l,c,d){bn(l,vt(l),s,d)}),cS=mi(function(s,l,c,d){bn(l,Ke(l),s,d)}),fS=Pn(iu);function hS(s,l){var c=pi(s);return l==null?c:hd(c,l)}var dS=oe(function(s,l){s=Se(s);var c=-1,d=l.length,y=d>2?l[2]:t;for(y&&ft(l[0],l[1],y)&&(d=1);++c<d;)for(var w=l[c],E=vt(w),M=-1,O=E.length;++M<O;){var P=E[M],D=s[P];(D===t||an(D,fi[P])&&!we.call(s,P))&&(s[P]=w[P])}return s}),pS=oe(function(s){return s.push(t,Xd),Et(Pp,t,s)});function mS(s,l){return Gh(s,X(l,3),yn)}function gS(s,l){return Gh(s,X(l,3),ou)}function yS(s,l){return s==null?s:su(s,X(l,3),vt)}function bS(s,l){return s==null?s:yd(s,X(l,3),vt)}function _S(s,l){return s&&yn(s,X(l,3))}function vS(s,l){return s&&ou(s,X(l,3))}function wS(s){return s==null?[]:Eo(s,Ke(s))}function SS(s){return s==null?[]:Eo(s,vt(s))}function zu(s,l,c){var d=s==null?t:Rr(s,l);return d===t?c:d}function xS(s,l){return s!=null&&ep(s,l,K2)}function Bu(s,l){return s!=null&&ep(s,l,G2)}var CS=Kd(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=fo.call(l)),s[l]=c},Hu(wt)),ES=Kd(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=fo.call(l)),we.call(s,l)?s[l].push(c):s[l]=[c]},X),kS=oe(ds);function Ke(s){return _t(s)?cd(s):cu(s)}function vt(s){return _t(s)?cd(s,!0):r_(s)}function AS(s,l){var c={};return l=X(l,3),yn(s,function(d,y,w){Rn(c,l(d,y,w),d)}),c}function MS(s,l){var c={};return l=X(l,3),yn(s,function(d,y,w){Rn(c,y,l(d,y,w))}),c}var TS=mi(function(s,l,c){ko(s,l,c)}),Pp=mi(function(s,l,c,d){ko(s,l,c,d)}),OS=Pn(function(s,l){var c={};if(s==null)return c;var d=!1;l=ke(l,function(w){return w=or(w,s),d||(d=w.length>1),w}),bn(s,Cu(s),c),d&&(c=Vt(c,p|b|S,C_));for(var y=l.length;y--;)gu(c,l[y]);return c});function IS(s,l){return Dp(s,Ho(X(l)))}var NS=Pn(function(s,l){return s==null?{}:s_(s,l)});function Dp(s,l){if(s==null)return{};var c=ke(Cu(s),function(d){return[d]});return l=X(l),Ad(s,c,function(d,y){return l(d,y[0])})}function RS(s,l,c){l=or(l,s);var d=-1,y=l.length;for(y||(y=1,s=t);++d<y;){var w=s==null?t:s[_n(l[d])];w===t&&(d=y,w=c),s=Fn(w)?w.call(s):w}return s}function LS(s,l,c){return s==null?s:ms(s,l,c)}function PS(s,l,c,d){return d=typeof d=="function"?d:t,s==null?s:ms(s,l,c,d)}var Fp=jd(Ke),zp=jd(vt);function DS(s,l,c){var d=ne(s),y=d||lr(s)||bi(s);if(l=X(l,4),c==null){var w=s&&s.constructor;y?c=d?new w:[]:Me(s)?c=Fn(w)?pi(mo(s)):{}:c={}}return(y?$t:yn)(s,function(E,M,O){return l(c,E,M,O)}),c}function FS(s,l){return s==null?!0:gu(s,l)}function zS(s,l,c){return s==null?s:Nd(s,l,_u(c))}function BS(s,l,c,d){return d=typeof d=="function"?d:t,s==null?s:Nd(s,l,_u(c),d)}function _i(s){return s==null?[]:Xl(s,Ke(s))}function $S(s){return s==null?[]:Xl(s,vt(s))}function HS(s,l,c){return c===t&&(c=l,l=t),c!==t&&(c=Kt(c),c=c===c?c:0),l!==t&&(l=Kt(l),l=l===l?l:0),Nr(Kt(s),l,c)}function WS(s,l,c){return l=zn(l),c===t?(c=l,l=0):c=zn(c),s=Kt(s),J2(s,l,c)}function VS(s,l,c){if(c&&typeof c!="boolean"&&ft(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=zn(s),l===t?(l=s,s=0):l=zn(l)),s>l){var d=s;s=l,l=d}if(c||s%1||l%1){var y=ld();return ot(s+y*(l-s+wb("1e-"+((y+"").length-1))),l)}return du(s,l)}var US=gi(function(s,l,c){return l=l.toLowerCase(),s+(c?Bp(l):l)});function Bp(s){return $u(_e(s).toLowerCase())}function $p(s){return s=_e(s),s&&s.replace(Ky,Lb).replace(fb,"")}function qS(s,l,c){s=_e(s),l=At(l);var d=s.length;c=c===t?d:Nr(re(c),0,d);var y=c;return c-=l.length,c>=0&&s.slice(c,y)==l}function KS(s){return s=_e(s),s&&ky.test(s)?s.replace(yh,Pb):s}function GS(s){return s=_e(s),s&&Ny.test(s)?s.replace(Pl,"\\$&"):s}var JS=gi(function(s,l,c){return s+(c?"-":"")+l.toLowerCase()}),jS=gi(function(s,l,c){return s+(c?" ":"")+l.toLowerCase()}),YS=Vd("toLowerCase");function XS(s,l,c){s=_e(s),l=re(l);var d=l?ui(s):0;if(!l||d>=l)return s;var y=(l-d)/2;return No(_o(y),c)+s+No(bo(y),c)}function ZS(s,l,c){s=_e(s),l=re(l);var d=l?ui(s):0;return l&&d<l?s+No(l-d,c):s}function QS(s,l,c){s=_e(s),l=re(l);var d=l?ui(s):0;return l&&d<l?No(l-d,c)+s:s}function ex(s,l,c){return c||l==null?l=0:l&&(l=+l),a2(_e(s).replace(Dl,""),l||0)}function tx(s,l,c){return(c?ft(s,l,c):l===t)?l=1:l=re(l),pu(_e(s),l)}function nx(){var s=arguments,l=_e(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var rx=gi(function(s,l,c){return s+(c?"_":"")+l.toLowerCase()});function ix(s,l,c){return c&&typeof c!="number"&&ft(s,l,c)&&(l=c=t),c=c===t?qe:c>>>0,c?(s=_e(s),s&&(typeof l=="string"||l!=null&&!Fu(l))&&(l=At(l),!l&&li(s))?ar(sn(s),0,c):s.split(l,c)):[]}var sx=gi(function(s,l,c){return s+(c?" ":"")+$u(l)});function ox(s,l,c){return s=_e(s),c=c==null?0:Nr(re(c),0,s.length),l=At(l),s.slice(c,c+l.length)==l}function ax(s,l,c){var d=v.templateSettings;c&&ft(s,l,c)&&(l=t),s=_e(s),l=Uo({},l,d,Yd);var y=Uo({},l.imports,d.imports,Yd),w=Ke(y),E=Xl(y,w),M,O,P=0,D=l.interpolate||no,F="__p += '",V=Ql((l.escape||no).source+"|"+D.source+"|"+(D===bh?$y:no).source+"|"+(l.evaluate||no).source+"|$","g"),J="//# sourceURL="+(we.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++gb+"]")+`
|
|
43
|
+
`;s.replace(V,function(Q,le,he,Tt,ht,Ot){return he||(he=Tt),F+=s.slice(P,Ot).replace(Gy,Db),le&&(M=!0,F+=`' +
|
|
44
|
+
__e(`+le+`) +
|
|
45
|
+
'`),ht&&(O=!0,F+=`';
|
|
46
|
+
`+ht+`;
|
|
47
|
+
__p += '`),he&&(F+=`' +
|
|
48
|
+
((__t = (`+he+`)) == null ? '' : __t) +
|
|
49
|
+
'`),P=Ot+Q.length,Q}),F+=`';
|
|
50
|
+
`;var Z=we.call(l,"variable")&&l.variable;if(!Z)F=`with (obj) {
|
|
51
51
|
`+F+`
|
|
52
52
|
}
|
|
53
|
-
`;else if(
|
|
54
|
-
`+(
|
|
55
|
-
`)+"var __t, __p = ''"+(
|
|
53
|
+
`;else if(zy.test(Z))throw new te(u);F=(O?F.replace(Sy,""):F).replace(xy,"$1").replace(Cy,"$1;"),F="function("+(Z||"obj")+`) {
|
|
54
|
+
`+(Z?"":`obj || (obj = {});
|
|
55
|
+
`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(O?`, __j = Array.prototype.join;
|
|
56
56
|
function print() { __p += __j.call(arguments, '') }
|
|
57
57
|
`:`;
|
|
58
58
|
`)+F+`return __p
|
|
59
|
-
}`;var se=up(function(){return ge(w,j+"return "+F).apply(t,E)});if(se.source=F,du(se))throw se;return se}function BS(s){return ye(s).toLowerCase()}function HS(s){return ye(s).toUpperCase()}function $S(s,a,c){if(s=ye(s),s&&(c||a===t))return bh(s);if(!s||!(a=vt(a)))return s;var h=Kt(s),y=Kt(a),w=_h(h,y),E=vh(h,y)+1;return Kn(h,w,E).join("")}function zS(s,a,c){if(s=ye(s),s&&(c||a===t))return s.slice(0,Sh(s)+1);if(!s||!(a=vt(a)))return s;var h=Kt(s),y=vh(h,Kt(a))+1;return Kn(h,0,y).join("")}function VS(s,a,c){if(s=ye(s),s&&(c||a===t))return s.replace(dl,"");if(!s||!(a=vt(a)))return s;var h=Kt(s),y=_h(h,Kt(a));return Kn(h,y).join("")}function WS(s,a){var c=rn,h=Fn;if(Ae(a)){var y="separator"in a?a.separator:y;c="length"in a?re(a.length):c,h="omission"in a?vt(a.omission):h}s=ye(s);var w=s.length;if(Qr(s)){var E=Kt(s);w=E.length}if(c>=w)return s;var C=c-ei(h);if(C<1)return h;var M=E?Kn(E,0,C).join(""):s.slice(0,C);if(y===t)return M+h;if(E&&(C+=M.length-C),pu(y)){if(s.slice(C).search(y)){var L,P=M;for(y.global||(y=Ml(y.source,ye($f.exec(y))+"g")),y.lastIndex=0;L=y.exec(P);)var F=L.index;M=M.slice(0,F===t?C:F)}}else if(s.indexOf(vt(y),C)!=C){var V=M.lastIndexOf(y);V>-1&&(M=M.slice(0,V))}return M+h}function US(s){return s=ye(s),s&&ty.test(s)?s.replace(Ff,_1):s}var qS=ai(function(s,a,c){return s+(c?" ":"")+a.toUpperCase()}),yu=cd("toUpperCase");function lp(s,a,c){return s=ye(s),a=c?t:a,a===t?p1(s)?S1(s):s1(s):s.match(a)||[]}var up=oe(function(s,a){try{return bt(s,t,a)}catch(c){return du(c)?c:new te(c)}}),KS=Cn(function(s,a){return Mt(a,function(c){c=ln(c),En(s,c,fu(s[c],s))}),s});function GS(s){var a=s==null?0:s.length,c=Y();return s=a?ke(s,function(h){if(typeof h[1]!="function")throw new It(l);return[c(h[0]),h[1]]}):[],oe(function(h){for(var y=-1;++y<a;){var w=s[y];if(bt(w[0],this,h))return bt(w[1],this,h)}})}function jS(s){return _b(Rt(s,p))}function bu(s){return function(){return s}}function JS(s,a){return s==null||s!==s?a:s}var YS=hd(),XS=hd(!0);function mt(s){return s}function _u(s){return Vh(typeof s=="function"?s:Rt(s,p))}function ZS(s){return Uh(Rt(s,p))}function QS(s,a){return qh(s,Rt(a,p))}var ex=oe(function(s,a){return function(c){return ns(c,s,a)}}),tx=oe(function(s,a){return function(c){return ns(s,c,a)}});function vu(s,a,c){var h=He(a),y=ho(a,h);c==null&&!(Ae(a)&&(y.length||!h.length))&&(c=a,a=s,s=this,y=ho(a,He(a)));var w=!(Ae(c)&&"chain"in c)||!!c.chain,E=On(s);return Mt(y,function(C){var M=a[C];s[C]=M,E&&(s.prototype[C]=function(){var L=this.__chain__;if(w||L){var P=s(this.__wrapped__),F=P.__actions__=ht(this.__actions__);return F.push({func:M,args:arguments,thisArg:s}),P.__chain__=L,P}return M.apply(s,$n([this.value()],arguments))})}),s}function nx(){return qe._===this&&(qe._=O1),this}function wu(){}function rx(s){return s=re(s),oe(function(a){return Kh(a,s)})}var ix=Zl(ke),sx=Zl(dh),ox=Zl(xl);function cp(s){return su(s)?El(ln(s)):Db(s)}function ax(s){return function(a){return s==null?t:_r(s,a)}}var lx=pd(),ux=pd(!0);function Su(){return[]}function xu(){return!1}function cx(){return{}}function fx(){return""}function hx(){return!0}function dx(s,a){if(s=re(s),s<1||s>Ze)return[];var c=it,h=Qe(s,it);a=Y(a),s-=it;for(var y=Al(h,a);++c<s;)a(c);return y}function px(s){return ne(s)?ke(s,ln):wt(s)?[s]:ht(Md(ye(s)))}function mx(s){var a=++C1;return ye(s)+a}var gx=_o(function(s,a){return s+a},0),yx=Ql("ceil"),bx=_o(function(s,a){return s/a},1),_x=Ql("floor");function vx(s){return s&&s.length?fo(s,mt,Bl):t}function wx(s,a){return s&&s.length?fo(s,Y(a,2),Bl):t}function Sx(s){return gh(s,mt)}function xx(s,a){return gh(s,Y(a,2))}function Ex(s){return s&&s.length?fo(s,mt,Vl):t}function kx(s,a){return s&&s.length?fo(s,Y(a,2),Vl):t}var Cx=_o(function(s,a){return s*a},1),Ax=Ql("round"),Ox=_o(function(s,a){return s-a},0);function Tx(s){return s&&s.length?Cl(s,mt):0}function Mx(s,a){return s&&s.length?Cl(s,Y(a,2)):0}return v.after=Zv,v.ary=zd,v.assign=Hw,v.assignIn=tp,v.assignInWith=No,v.assignWith=$w,v.at=zw,v.before=Vd,v.bind=fu,v.bindAll=KS,v.bindKey=Wd,v.castArray=cw,v.chain=Bd,v.chunk=__,v.compact=v_,v.concat=w_,v.cond=GS,v.conforms=jS,v.constant=bu,v.countBy=Tv,v.create=Vw,v.curry=Ud,v.curryRight=qd,v.debounce=Kd,v.defaults=Ww,v.defaultsDeep=Uw,v.defer=Qv,v.delay=ew,v.difference=S_,v.differenceBy=x_,v.differenceWith=E_,v.drop=k_,v.dropRight=C_,v.dropRightWhile=A_,v.dropWhile=O_,v.fill=T_,v.filter=Iv,v.flatMap=Lv,v.flatMapDeep=Pv,v.flatMapDepth=Dv,v.flatten=Ld,v.flattenDeep=M_,v.flattenDepth=I_,v.flip=tw,v.flow=YS,v.flowRight=XS,v.fromPairs=N_,v.functions=Xw,v.functionsIn=Zw,v.groupBy=Fv,v.initial=L_,v.intersection=P_,v.intersectionBy=D_,v.intersectionWith=F_,v.invert=eS,v.invertBy=tS,v.invokeMap=Hv,v.iteratee=_u,v.keyBy=$v,v.keys=He,v.keysIn=pt,v.map=Co,v.mapKeys=rS,v.mapValues=iS,v.matches=ZS,v.matchesProperty=QS,v.memoize=Oo,v.merge=sS,v.mergeWith=np,v.method=ex,v.methodOf=tx,v.mixin=vu,v.negate=To,v.nthArg=rx,v.omit=oS,v.omitBy=aS,v.once=nw,v.orderBy=zv,v.over=ix,v.overArgs=rw,v.overEvery=sx,v.overSome=ox,v.partial=hu,v.partialRight=Gd,v.partition=Vv,v.pick=lS,v.pickBy=rp,v.property=cp,v.propertyOf=ax,v.pull=z_,v.pullAll=Dd,v.pullAllBy=V_,v.pullAllWith=W_,v.pullAt=U_,v.range=lx,v.rangeRight=ux,v.rearg=iw,v.reject=qv,v.remove=q_,v.rest=sw,v.reverse=uu,v.sampleSize=Gv,v.set=cS,v.setWith=fS,v.shuffle=jv,v.slice=K_,v.sortBy=Xv,v.sortedUniq=Q_,v.sortedUniqBy=ev,v.split=LS,v.spread=ow,v.tail=tv,v.take=nv,v.takeRight=rv,v.takeRightWhile=iv,v.takeWhile=sv,v.tap=vv,v.throttle=aw,v.thru=ko,v.toArray=Zd,v.toPairs=ip,v.toPairsIn=sp,v.toPath=px,v.toPlainObject=ep,v.transform=hS,v.unary=lw,v.union=ov,v.unionBy=av,v.unionWith=lv,v.uniq=uv,v.uniqBy=cv,v.uniqWith=fv,v.unset=dS,v.unzip=cu,v.unzipWith=Fd,v.update=pS,v.updateWith=mS,v.values=ci,v.valuesIn=gS,v.without=hv,v.words=lp,v.wrap=uw,v.xor=dv,v.xorBy=pv,v.xorWith=mv,v.zip=gv,v.zipObject=yv,v.zipObjectDeep=bv,v.zipWith=_v,v.entries=ip,v.entriesIn=sp,v.extend=tp,v.extendWith=No,vu(v,v),v.add=gx,v.attempt=up,v.camelCase=vS,v.capitalize=op,v.ceil=yx,v.clamp=yS,v.clone=fw,v.cloneDeep=dw,v.cloneDeepWith=pw,v.cloneWith=hw,v.conformsTo=mw,v.deburr=ap,v.defaultTo=JS,v.divide=bx,v.endsWith=wS,v.eq=jt,v.escape=SS,v.escapeRegExp=xS,v.every=Mv,v.find=Nv,v.findIndex=Nd,v.findKey=qw,v.findLast=Rv,v.findLastIndex=Rd,v.findLastKey=Kw,v.floor=_x,v.forEach=Hd,v.forEachRight=$d,v.forIn=Gw,v.forInRight=jw,v.forOwn=Jw,v.forOwnRight=Yw,v.get=mu,v.gt=gw,v.gte=yw,v.has=Qw,v.hasIn=gu,v.head=Pd,v.identity=mt,v.includes=Bv,v.indexOf=R_,v.inRange=bS,v.invoke=nS,v.isArguments=Sr,v.isArray=ne,v.isArrayBuffer=bw,v.isArrayLike=dt,v.isArrayLikeObject=Ie,v.isBoolean=_w,v.isBuffer=Gn,v.isDate=vw,v.isElement=ww,v.isEmpty=Sw,v.isEqual=xw,v.isEqualWith=Ew,v.isError=du,v.isFinite=kw,v.isFunction=On,v.isInteger=jd,v.isLength=Mo,v.isMap=Jd,v.isMatch=Cw,v.isMatchWith=Aw,v.isNaN=Ow,v.isNative=Tw,v.isNil=Iw,v.isNull=Mw,v.isNumber=Yd,v.isObject=Ae,v.isObjectLike=Me,v.isPlainObject=us,v.isRegExp=pu,v.isSafeInteger=Nw,v.isSet=Xd,v.isString=Io,v.isSymbol=wt,v.isTypedArray=ui,v.isUndefined=Rw,v.isWeakMap=Lw,v.isWeakSet=Pw,v.join=B_,v.kebabCase=ES,v.last=Pt,v.lastIndexOf=H_,v.lowerCase=kS,v.lowerFirst=CS,v.lt=Dw,v.lte=Fw,v.max=vx,v.maxBy=wx,v.mean=Sx,v.meanBy=xx,v.min=Ex,v.minBy=kx,v.stubArray=Su,v.stubFalse=xu,v.stubObject=cx,v.stubString=fx,v.stubTrue=hx,v.multiply=Cx,v.nth=$_,v.noConflict=nx,v.noop=wu,v.now=Ao,v.pad=AS,v.padEnd=OS,v.padStart=TS,v.parseInt=MS,v.random=_S,v.reduce=Wv,v.reduceRight=Uv,v.repeat=IS,v.replace=NS,v.result=uS,v.round=Ax,v.runInContext=T,v.sample=Kv,v.size=Jv,v.snakeCase=RS,v.some=Yv,v.sortedIndex=G_,v.sortedIndexBy=j_,v.sortedIndexOf=J_,v.sortedLastIndex=Y_,v.sortedLastIndexBy=X_,v.sortedLastIndexOf=Z_,v.startCase=PS,v.startsWith=DS,v.subtract=Ox,v.sum=Tx,v.sumBy=Mx,v.template=FS,v.times=dx,v.toFinite=Tn,v.toInteger=re,v.toLength=Qd,v.toLower=BS,v.toNumber=Dt,v.toSafeInteger=Bw,v.toString=ye,v.toUpper=HS,v.trim=$S,v.trimEnd=zS,v.trimStart=VS,v.truncate=WS,v.unescape=US,v.uniqueId=mx,v.upperCase=qS,v.upperFirst=yu,v.each=Hd,v.eachRight=$d,v.first=Pd,vu(v,function(){var s={};return on(v,function(a,c){_e.call(v.prototype,c)||(s[c]=a)}),s}(),{chain:!1}),v.VERSION=r,Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){v[s].placeholder=v}),Mt(["drop","take"],function(s,a){ue.prototype[s]=function(c){c=c===t?1:Be(re(c),0);var h=this.__filtered__&&!a?new ue(this):this.clone();return h.__filtered__?h.__takeCount__=Qe(c,h.__takeCount__):h.__views__.push({size:Qe(c,it),type:s+(h.__dir__<0?"Right":"")}),h},ue.prototype[s+"Right"]=function(c){return this.reverse()[s](c).reverse()}}),Mt(["filter","map","takeWhile"],function(s,a){var c=a+1,h=c==dr||c==Bn;ue.prototype[s]=function(y){var w=this.clone();return w.__iteratees__.push({iteratee:Y(y,3),type:c}),w.__filtered__=w.__filtered__||h,w}}),Mt(["head","last"],function(s,a){var c="take"+(a?"Right":"");ue.prototype[s]=function(){return this[c](1).value()[0]}}),Mt(["initial","tail"],function(s,a){var c="drop"+(a?"":"Right");ue.prototype[s]=function(){return this.__filtered__?new ue(this):this[c](1)}}),ue.prototype.compact=function(){return this.filter(mt)},ue.prototype.find=function(s){return this.filter(s).head()},ue.prototype.findLast=function(s){return this.reverse().find(s)},ue.prototype.invokeMap=oe(function(s,a){return typeof s=="function"?new ue(this):this.map(function(c){return ns(c,s,a)})}),ue.prototype.reject=function(s){return this.filter(To(Y(s)))},ue.prototype.slice=function(s,a){s=re(s);var c=this;return c.__filtered__&&(s>0||a<0)?new ue(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),a!==t&&(a=re(a),c=a<0?c.dropRight(-a):c.take(a-s)),c)},ue.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},ue.prototype.toArray=function(){return this.take(it)},on(ue.prototype,function(s,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),y=v[h?"take"+(a=="last"?"Right":""):a],w=h||/^find/.test(a);y&&(v.prototype[a]=function(){var E=this.__wrapped__,C=h?[1]:arguments,M=E instanceof ue,L=C[0],P=M||ne(E),F=function(ae){var fe=y.apply(v,$n([ae],C));return h&&V?fe[0]:fe};P&&c&&typeof L=="function"&&L.length!=1&&(M=P=!1);var V=this.__chain__,j=!!this.__actions__.length,X=w&&!V,se=M&&!j;if(!w&&P){E=se?E:new ue(this);var Z=s.apply(E,C);return Z.__actions__.push({func:ko,args:[F],thisArg:t}),new Nt(Z,V)}return X&&se?s.apply(this,C):(Z=this.thru(F),X?h?Z.value()[0]:Z.value():Z)})}),Mt(["pop","push","shift","sort","splice","unshift"],function(s){var a=Ys[s],c=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",h=/^(?:pop|shift)$/.test(s);v.prototype[s]=function(){var y=arguments;if(h&&!this.__chain__){var w=this.value();return a.apply(ne(w)?w:[],y)}return this[c](function(E){return a.apply(ne(E)?E:[],y)})}}),on(ue.prototype,function(s,a){var c=v[a];if(c){var h=c.name+"";_e.call(ii,h)||(ii[h]=[]),ii[h].push({name:a,func:c})}}),ii[bo(t,x).name]=[{name:"wrapper",func:t}],ue.prototype.clone=U1,ue.prototype.reverse=q1,ue.prototype.value=K1,v.prototype.at=wv,v.prototype.chain=Sv,v.prototype.commit=xv,v.prototype.next=Ev,v.prototype.plant=Cv,v.prototype.reverse=Av,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=Ov,v.prototype.first=v.prototype.head,Ji&&(v.prototype[Ji]=kv),v},ti=x1();pr?((pr.exports=ti)._=ti,_l._=ti):qe._=ti}).call(IM)}(Fs,Fs.exports)),Fs.exports}var D0=NM();function Cf(n){return n.type.create(D0.cloneDeep(n.attrs))}const RM=Pe.create({name:"node_processor",addCommands(){return{setBlockAttributes:H(({commands:n,state:e},t,r,i={})=>{const o=z(n.getBlockAttributes(t))??{},{doc:l,tr:u}=e,{from:f,to:d}=u.selection;l.nodesBetween(f,d,(g,p)=>{ie.blocks.includes(g.type.name)&&u.setNodeAttribute(p,t,{...i,...o,...r})})}),getBlockAttributes:H(({editor:n},e,t)=>de(()=>{let r=Object.assign({},t||{});for(const i of ie.blocks)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:H(({commands:n},e)=>{for(const t of ie.blocks)n.resetAttributes(t,e)}),applyMark:H(({state:n,commands:e},t,r,i={})=>{const{tr:o,doc:l,schema:u}=n,{$from:f,$to:d}=o.selection,g=cn(he.LINK,u),p=cn(t,u);if(!(p.spec.group||"").includes(en.SETTINGS))return e.setMark(t,r);if(f.pos===d.pos)return;const S=k=>{if(!i.onAppliedToParent||i.onAppliedToParent(k)===!1){const{tr:m,node:b,position:x,mark:A}=k;e._removeNodeMark({tr:m,node:b,position:x,mark:A.type})}};l.nodesBetween(f.pos,d.pos,(k,m)=>{if(k.type.name===ie.LIST)return;const b=MM(k.marks,t),x=p.create({...b?.attrs||{},...r}),A=R0(f,d,k,m);if(!g.isInSet(k.marks)&&TM(o.doc,m,x,i.isAppliedToParent))return S({tr:o,node:k,position:m,mark:x});if(k.isText){o.addMark(A.from,A.to,x);return}AM(o.doc,o.selection,k,m)&&o.addNodeMark(m,x)})}),getMarks:H(({editor:n},e)=>{const t=pi(n,"state");return de(()=>{const{selection:r,doc:i}=z(t),{from:o,to:l}=z(r),u=[];return i.nodesBetween(o,l,f=>{for(const d of f.marks)d.type.name===e&&u.unshift(d.attrs)}),u})}),getMark:H(({commands:n},e)=>{const t=n.getMarks(e);return de(()=>z(t)[0]??null)}),hasMark:H(({commands:n},e)=>{const t=n.getMark(e);return de(()=>!!z(t))}),getCommonSettingMark:H(({commands:n},e,t)=>{const r=n.getMark(e);return de(()=>z(r)?.value??z(t))}),getDeviceSettingMark:H(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return de(()=>{for(const o of z(r)){const l=o[z(i)];if(l)return l}return z(t)})}),removeAllMarks:H(({state:n,commands:e})=>{const{tr:t,doc:r}=n,{from:i,to:o}=t.selection;r.nodesBetween(i,o,(l,u)=>{for(const f of l.marks)e._removeNodeMark({tr:t,node:l,position:u,mark:f})})}),removeMarks:H(({state:n,commands:e},t)=>{const{tr:r,doc:i}=n,{from:o,to:l}=r.selection;i.nodesBetween(o,l,(u,f)=>{const d=u.marks.filter(g=>t.includes(g.type.name));for(const g of d)e._removeNodeMark({tr:r,node:u,position:f,mark:g})})}),_removeNodeMark:H((n,{tr:e,node:t,position:r,mark:i})=>t.isText?e.removeMark(r,r+t.nodeSize,i):e.removeNodeMark(r,i))}}}),LM=Pe.create({name:"text_processor",addCommands(){return{getSelectedText:H(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:H(({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 l=R0(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)}),g=n.schema.text(d,i.marks);n.tr.replaceWith(l.from,l.to,g)})})}}}),PM=Pe.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:H(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:H(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:H(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;n.doc.nodesBetween(r,i,(o,l,u)=>{if(t({node:o,parent:u})){const f=o.isText?0:L0(n.doc,l);r=Math.min(r,l+f),i=Math.max(i,l+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:H(({commands:n})=>{n.expandSelection(({parent:e})=>e.type.name===ie.DOCUMENT)})}}}),DM=Dn.create({name:"doc",topNode:!0,content:"block+"});class Hs extends tt{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=Tr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,De.ok(t)}invert(){return new Hs(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 Hs(e.key,e.value,e.stepType)}}tt.jsonID("setDocAttr",Hs);const FM=DM.extend({marks:en.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:H(({state:n},e,t)=>{n.tr.step(new Hs(e,t,n.schema))})}}}),BM=Dn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Oi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),HM=BM.extend({marks:en.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),$M=Dn.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]}`,Oi(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=>xT({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),zM=$M.extend({marks:en.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),VM=Pe.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[DT.create(this.editor),FT.create(this.editor)]}}),WM=()=>[FM,HM,zM,CT,PT,RM,LM,PM,VM],UM=Ot.create({name:he.FONT_FAMILY,group:en.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:H(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=z(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(he.FONT_STYLE).value;!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:H(({commands:n})=>{const e=z(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return de(()=>n.findFontByName(z(r))||t)}),findFontByName:H((n,e)=>z(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:H(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:H(({commands:n})=>{const e=n.getPreset();return de(()=>z(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 Hr({font_family:e})}}),qM=Pe.create({name:he.STYLE_PRESET,addGlobalAttributes(){return[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{preset:{isRequired:!1,default:{id:z(this.options.defaultId)},parseHTML:n=>{const e=z(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=z(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:z(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:z(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 l=t[o],u=r[o],f=!u||u.toLowerCase()==="inherit";i[o]=f?l:u}return i}return{getPresetList:H(()=>de(()=>z(this.options.presets).filter(t=>!t.hidden))),getPreset:H(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:z(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),l=t.getLinkPreset();return de(()=>{const u=n(z(i),z(r).id);if(!z(o))return u;const f=z(l);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:H(({commands:t,chain:r},i)=>{const o=z(t.getPresetList()),l=n(o,i),u=l.node?.type??ie.PARAGRAPH,f={preset:{id:i}};l.node&&(f.level=l.node.level);for(const d of he.attributes)f[d]=z(t.getBlockAttributes(d));r().removeList().setNode(u,f).run()}),applyDefaultPreset:H(({commands:t})=>{t.applyPreset(z(this.options.defaultId))}),removePreset:H(({commands:t})=>{t.setNode(ie.PARAGRAPH,{preset:null})}),getPresetCustomization:H(({editor:t,commands:r})=>{const i=pi(t,"state");return de(()=>{const{selection:o,doc:l}=z(i),{from:u,to:f}=o;return r._getSettingCustomization(l,u,f)})}),isSettingCustomized:H(({commands:t},r)=>{const i=t.getPresetCustomization(),o=he.presetAttributes.includes(r)?"attributes":"marks";return de(()=>z(i)[o]?.includes(r)??!1)}),getContentCustomization:H(({editor:t,commands:r})=>{const i=pi(t,"state");return de(()=>{const{doc:o}=z(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:H((t,r,i,o)=>{const l=new Set,u=new Set;return r.nodesBetween(i,o,f=>{for(const[d,g]of Object.entries(f.attrs))he.presetAttributes.includes(d)&&g&&u.add(d);for(const{type:d}of f.marks)he.marks.includes(d.name)&&l.add(d.name)}),{attributes:Array.from(u),marks:Array.from(l)}}),removePresetCustomization:H(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(he.marks).resetAttributes(ie.PARAGRAPH,he.presetAttributes).resetAttributes(ie.HEADING,he.presetAttributes).restoreSelection().run()}),removeFormat:H(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Di.head,z(this.options.presets))}}),KM=Ot.create({name:he.FONT_WEIGHT,group:en.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:H(({commands:n},e)=>{n.applyMark(this.name,{value:e}),z(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:H(({commands:n})=>{const e=z(n.getFontWeight()),t=z(n.getFont()),i=Number(e)>=600?"400":"700",o=t.findClosestWeight(i);n.applyFontWeight(o)}),getFontWeight:H(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return de(()=>{const r=z(e),i=z(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:H(({commands:n})=>{const e=n.getPreset();return de(()=>z(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Vt("toggleBold"),"Mod-B":Vt("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 Hr({font_weight:n.value})}}),GM=Ot.create({name:he.FONT_SIZE,group:en.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:H(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].font_size.replace("px",""))}),applyFontSize:H(({commands:n},e)=>{const t=z(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:l})=>{const u={...l.attrs,[t]:null};if(!Object.values(u).some(g=>!!g))return!1;const d=l.type.create(u);if(i.isText){r.addMark(o,o+i.nodeSize,d);return}r.addNodeMark(o,d)}})}),increaseFontSize:H(({commands:n})=>{const e=Number(z(n.getFontSize())),t=Math.min(e+1,z(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:H(({commands:n})=>{const e=Number(z(n.getFontSize())),t=Math.max(e-1,z(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Vt("increaseFontSize"),"Mod-Shift--":Vt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=z(this.options.wrapperRef),r=N0(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 Hr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),jM=Ot.create({name:he.FONT_COLOR,group:en.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:H(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:H(({commands:n})=>{const e=n.getPreset();return de(()=>z(e).common.color)}),applyFontColor:H(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:I0(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Hr({font_color:n.value})}}),JM=Ot.create({name:he.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:H(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:H(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:I0(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Hr({background_color:n.value})}}),YM=Pe.create({name:"device_manager",addCommands(){return{getDevice:H(()=>pi(this.options,"device"))}}}),XM=Ot.create({name:he.FONT_STYLE,group:en.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:H(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return de(()=>z(e)?.italic??z(t).italic)}),isItalicAvailable:H(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return de(()=>{const r=z(e),i=z(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:H(({commands:n})=>{const e=n.getPreset();return de(()=>({italic:z(e).common.font_style==="italic"}))}),toggleItalic:H(({commands:n})=>{z(n.isItalicAvailable())&&(z(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:H(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:H(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Vt("toggleItalic"),"Mod-I":Vt("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 Hr({font_style:e})}}),ZM=Ot.create({name:he.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:H(({commands:n})=>{const e=n.getTextDecoration();return de(()=>z(e).underline)}),isStrikeThrough:H(({commands:n})=>{const e=n.getTextDecoration();return de(()=>z(e).strike_through)}),getTextDecoration:H(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return de(()=>{const r=z(e)??{},i=z(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:H(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return de(()=>z(e)!==z(t).underline)}),getDefaultTextDecoration:H(({commands:n})=>{const e=n.getPreset();return de(()=>{const{text_decoration:t}=z(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:H(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:H(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:H(({commands:n},e,t=null)=>{const r=z(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:H(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:H(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Vt("toggleUnderline"),"Mod-U":Vt("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"),Hr({text_decoration:e.join(" ")})}}),QM=Pe.create({name:"case_style",addCommands(){return{applyCaseStyle:H(({commands:n},e)=>{switch(e){case Zc.CAPITALIZE:return n.applyCapitalize();case Zc.LOWERCASE:return n.applyLowerCase();case Zc.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:H(({commands:n})=>{n.transformText(({text:e})=>iM(e))}),applyLowerCase:H(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:H(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),F0={mobile:null,tablet:null,desktop:null},eI=Pe.create({name:he.ALIGNMENT,addGlobalAttributes:()=>[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[he.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=CM(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?Za({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:H(({commands:n},e)=>{const t=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},F0)}),removeAlignment:H(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:H(({commands:n})=>{const e=n.getBlockAttributes(this.name,F0),t=n.getDevice(),r=n.getDefaultAlignment();return de(()=>z(e)?.[z(t)]??z(r))}),getDefaultAlignment:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].alignment??sr.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Vt("applyAlignment",sr.LEFT),"Mod-Shift-e":Vt("applyAlignment",sr.CENTER),"Mod-Shift-r":Vt("applyAlignment",sr.RIGHT),"Mod-Shift-j":Vt("applyAlignment",sr.JUSTIFY)})}),B0={mobile:null,tablet:null,desktop:null},tI=Pe.create({name:he.LINE_HEIGHT,addGlobalAttributes(){return[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[he.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const o=n.style.getPropertyValue("--zw-line-height-tablet")||null,l=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:o,desktop:l}}const e=n.style.lineHeight;if(!e)return null;const t=z(this.options.wrapperRef),r=EM(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?Za({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:H(({commands:n})=>{const e=n.getBlockAttributes(this.name,B0),t=n.getDevice(),r=n.getDefaultLineHeight();return de(()=>z(e)?.[z(t)]??z(r))}),getDefaultLineHeight:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].line_height)}),applyLineHeight:H(({commands:n},e)=>{const t=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},B0)})}}}),nI=Dn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Oi(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)}}}),rI=nI.extend({name:ie.LIST_ITEM,marks:en.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:H(({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 l of r.marks)t.addNodeMark(o,Cf(l));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===ie.LIST))return t.listItemNewline()}})}),iI=Dn.create({name:ie.LIST,content:`${ie.LIST_ITEM}+`,group:"block list",marks:en.SETTINGS,addExtensions:()=>[rI],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:$t.DISC}}}),parseHTML(){const n={a:$t.ROMAN,i:$t.LATIN,1:$t.DECIMAL},e=t=>{for(const r of $t.values){const i=`.${z(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||$t.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||$t.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[z(this.options.baseClass)+n.bullet.type,z(this.options.presetClass)];return[$t.ordered.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:H(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return de(()=>z(e).type??null)}),applyList:H(({commands:n,chain:e},t)=>{if(z(n.getListType())===t){n.removeList();return}return e().applyDefaultPreset().toggleList(ie.LIST,ie.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({commands:i,tr:o})=>i._bubbleListItemMarks(o)).run()}),_bubbleListItemMarks:H((n,e)=>{const{doc:t,selection:r}=e,i=r.$from.start(),o=r.$to.end();function l(u,f){if(he.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===ie.LIST)return;if(u.type.name!==ie.LIST_ITEM)return!1;const d=[];return u.forEach(g=>{for(const p of g.marks){if(p.isInSet(d)){e.removeNodeMark(f+1,p);continue}l(u,p)&&(e.removeNodeMark(f+1,p),e.addNodeMark(f,Cf(p)),d.push(p))}}),!1})}),removeList:H(({commands:n,state:e})=>{const{tr:t,doc:r,selection:i}=e,o=i.$from.start(),l=i.$to.end();r.nodesBetween(o,l,(u,f,d)=>{if([ie.LIST,ie.LIST_ITEM].includes(u.type.name))return;if(d.type.name!==ie.LIST_ITEM)return!1;const g=d.marks.filter(function(p){return!p.type.isInSet(u.marks)});for(const p of g)t.addNodeMark(f,Cf(p));return!1}),n.liftListItem(ie.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>ET({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n($t.DISC,/^\s*([-+*])\s$/),n($t.DECIMAL,/^(\d+)\.\s$/),n($t.LATIN,/^([ivx]{1,3})\.\s$/i),n($t.ROMAN,/^([a-z])\.\s$/i)]}});function sI(n){return new Ct({key:new Zt("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:l}=r,u=KO(t.doc,[...e]);if(tT(u).forEach(({newRange:d})=>{const g=jO(r.doc,d,S=>S.isTextblock);let p,_;if(g.length>1?(p=g[0],_=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):g.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(p=g[0],_=r.doc.textBetween(p.pos,d.to,void 0," ")),p&&_){const S=_.split(" ").filter(b=>b!=="");if(S.length<=0)return!1;const k=S[S.length-1],m=p.pos+_.lastIndexOf(k);if(!k)return!1;_f(k).filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>n.validate?n.validate(b.value):!0).forEach(b=>{Zg(b.from,b.to,r.doc).some(x=>x.mark.type===n.type)||l.addMark(b.from,b.to,n.type.create({href:b.href}))})}}),!!l.steps.length)return l}})}function oI(n){return new Ct({key:new Zt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const u=ZO(e.state,n.type.name),f=r.target,d=(i=f?.href)!==null&&i!==void 0?i:u.href,g=(o=f?.target)!==null&&o!==void 0?o:u.target;return f&&d?(e.editable&&window.open(d,g),!0):!1}}})}function aI(n){return new Ct({key:new Zt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{var i;const{state:o}=e,{selection:l}=o,{empty:u}=l;if(u)return!1;let f="";r.content.forEach(k=>{f+=k.textContent});const d=_f(f).find(k=>k.isLink&&k.value===f);if(!f||!d)return!1;const g=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/html"),p=/href="([^"]*)"/,_=g?.match(p),S=_?_[1]:d.href;return n.editor.commands.setMark(n.type,{href:S}),!0}}})}const lI=Ot.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){S0(n);return}S0(n.scheme,n.optionalSlashes)})},onDestroy(){eM()},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",Oi(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Oi(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[kT({find:n=>_f(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="([^"]*)"/,l=i?.match(o);return l?{href:l[1]}:{href:(r=n.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(sI({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(oI({type:this.type})),this.options.linkOnPaste&&n.push(aI({editor:this.editor,type:this.type})),n}}),uI=lI.extend({name:he.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:l0.SELF,parseHTML:n=>n.getAttribute("target")||l0.SELF},destination:{default:Ts.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Ts.URL;const t=e.replace("#","");return z(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Ts.BLOCK:Ts.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:H(({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($0.text(r.text,[$0.mark(he.LINK,r)])))),expandSelectionToLink:H(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:H(({commands:e})=>e.hasMark(this.name)),getLinkPreset:H(()=>de(()=>z(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),rM.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Ts.BLOCK?`#${n.href}`:n.href,t=z(this.options.basePresetClass)+z(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),cI=Ot.create({name:he.SUPERSCRIPT,addCommands(){return{applySuperscript:H(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:H(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:H(({commands:n})=>{z(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:H(({commands:n})=>{const e=n.getMark(this.name);return de(()=>!!z(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),fI=Pe.create({name:he.MARGIN,addGlobalAttributes:()=>[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[he.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?Za({margin:n.margin.value}):null}}}}]});function hI(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=Wu({default:null,link:null});return fk(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),WM().concat([qM.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new mI({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),iI.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),YM.configure({device:n.deviceRef}),GM.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),UM.configure({fonts:n.fonts,defaultPreset:pi(t,"default"),defaultFont:n.defaultFont}),KM,jM,JM,XM,ZM,QM,cI,eI,tI.configure({wrapperRef:n.wrapperRef}),uI.configure({preset:pi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),fI])}class dI{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class H0{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class gn extends H0{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=gn.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 l=u=>{this._assignElementProperties(u,e,gn.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,gn.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){l(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),l(f),i=null,o=u;continue}i||(i=this.dom.createElement("p"),l(i)),i.append(u),o=u}e.append(t),this._removeStyleProperties(e,gn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,gn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return gn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return gn.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 l=u=>{this._assignElementProperties(u,e,gn.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){l(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),l={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(l).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 pI extends H0{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!==ie.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(he.inlineMarks.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===ie.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>D0.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===ie.TEXT&&this._includesMarkType(e,he.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 nl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new gn({content:e,parser:t.parser||new dI})}static _buildJson(e){return new pI({content:e})}static normalize(e,t={}){return nl.build(e,t).normalize()}}class Di{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 Rf{static build({config:e,nodeDomParser:t}){const r=hI({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:Go(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:Go(Xc.DESKTOP),pageBlocksRef:Go([]),wrapperRef:Di.document.createElement("p")}),i=YO(r);return new Rf({schema:i,domParser:sc.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=nl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class $0{static doc(e){return{type:ie.DOCUMENT,content:e}}static list(e,t){return{type:ie.LIST,attrs:{bullet:{type:e}},content:t.map(r=>r.type===ie.LIST_ITEM?r:this.listItem([].concat(r)))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{type:ie.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:ie.HEADING,...r}}static paragraph(...e){return{type:ie.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:ie.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(he.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class mI{_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=Di.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 l of Xc.values)for(const u of Object.keys(r[l])){const f=this._makeVariable({device:l,preset:r,property:u}),d=this._makeInternalVariableName(u,l);if(t+=`${d}: var(${f}, inherit);`,i&&!he.attributes.includes(u)){const g=d.replace("preset-","");t+=`${g}: var(${d});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===Xc.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 Lf{static _instance;static get instance(){return this._instance??=new Lf,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 z0{static createWindow(){return new dp.JSDOM().window}types;parse(e){const{window:t}=new dp.JSDOM(e);return this.types=t,t.document}}class V0{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 gI extends V0{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:hp.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(e,{config:t,format:r}){Di.use(z0.createWindow());const i=hp.resolve(process.cwd(),t),o=Rf.build({config:require(i).editor,nodeDomParser:new z0}),l=e.map(d=>o.toJSON(this._formatInputHtml(d))),u=l.length===1?l[0]:l,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 yI="4.7.0-0";class bI extends V0{name="version";description="display cli version";doCommand(){this.output(yI)}}const W0=new Vx,_I=[gI,bI];for(const n of _I)new n().install(W0);W0.parse();
|
|
59
|
+
}`;var se=Wp(function(){return be(w,J+"return "+F).apply(t,E)});if(se.source=F,Du(se))throw se;return se}function lx(s){return _e(s).toLowerCase()}function ux(s){return _e(s).toUpperCase()}function cx(s,l,c){if(s=_e(s),s&&(c||l===t))return Xh(s);if(!s||!(l=At(l)))return s;var d=sn(s),y=sn(l),w=Zh(d,y),E=Qh(d,y)+1;return ar(d,w,E).join("")}function fx(s,l,c){if(s=_e(s),s&&(c||l===t))return s.slice(0,td(s)+1);if(!s||!(l=At(l)))return s;var d=sn(s),y=Qh(d,sn(l))+1;return ar(d,0,y).join("")}function hx(s,l,c){if(s=_e(s),s&&(c||l===t))return s.replace(Dl,"");if(!s||!(l=At(l)))return s;var d=sn(s),y=Zh(d,sn(l));return ar(d,y).join("")}function dx(s,l){var c=Ct,d=yt;if(Me(l)){var y="separator"in l?l.separator:y;c="length"in l?re(l.length):c,d="omission"in l?At(l.omission):d}s=_e(s);var w=s.length;if(li(s)){var E=sn(s);w=E.length}if(c>=w)return s;var M=c-ui(d);if(M<1)return d;var O=E?ar(E,0,M).join(""):s.slice(0,M);if(y===t)return O+d;if(E&&(M+=O.length-M),Fu(y)){if(s.slice(M).search(y)){var P,D=O;for(y.global||(y=Ql(y.source,_e(_h.exec(y))+"g")),y.lastIndex=0;P=y.exec(D);)var F=P.index;O=O.slice(0,F===t?M:F)}}else if(s.indexOf(At(y),M)!=M){var V=O.lastIndexOf(y);V>-1&&(O=O.slice(0,V))}return O+d}function px(s){return s=_e(s),s&&Ey.test(s)?s.replace(gh,Vb):s}var mx=gi(function(s,l,c){return s+(c?" ":"")+l.toUpperCase()}),$u=Vd("toUpperCase");function Hp(s,l,c){return s=_e(s),l=c?t:l,l===t?zb(s)?Kb(s):Tb(s):s.match(l)||[]}var Wp=oe(function(s,l){try{return Et(s,t,l)}catch(c){return Du(c)?c:new te(c)}}),gx=Pn(function(s,l){return $t(l,function(c){c=_n(c),Rn(s,c,Lu(s[c],s))}),s});function yx(s){var l=s==null?0:s.length,c=X();return s=l?ke(s,function(d){if(typeof d[1]!="function")throw new Ht(a);return[c(d[0]),d[1]]}):[],oe(function(d){for(var y=-1;++y<l;){var w=s[y];if(Et(w[0],this,d))return Et(w[1],this,d)}})}function bx(s){return V2(Vt(s,p))}function Hu(s){return function(){return s}}function _x(s,l){return s==null||s!==s?l:s}var vx=qd(),wx=qd(!0);function wt(s){return s}function Wu(s){return wd(typeof s=="function"?s:Vt(s,p))}function Sx(s){return xd(Vt(s,p))}function xx(s,l){return Cd(s,Vt(l,p))}var Cx=oe(function(s,l){return function(c){return ds(c,s,l)}}),Ex=oe(function(s,l){return function(c){return ds(s,c,l)}});function Vu(s,l,c){var d=Ke(l),y=Eo(l,d);c==null&&!(Me(l)&&(y.length||!d.length))&&(c=l,l=s,s=this,y=Eo(l,Ke(l)));var w=!(Me(c)&&"chain"in c)||!!c.chain,E=Fn(s);return $t(y,function(M){var O=l[M];s[M]=O,E&&(s.prototype[M]=function(){var P=this.__chain__;if(w||P){var D=s(this.__wrapped__),F=D.__actions__=bt(this.__actions__);return F.push({func:O,args:arguments,thisArg:s}),D.__chain__=P,D}return O.apply(s,tr([this.value()],arguments))})}),s}function kx(){return Qe._===this&&(Qe._=Zb),this}function Uu(){}function Ax(s){return s=re(s),oe(function(l){return Ed(l,s)})}var Mx=wu(ke),Tx=wu(Kh),Ox=wu(Kl);function Vp(s){return Mu(s)?Gl(_n(s)):o_(s)}function Ix(s){return function(l){return s==null?t:Rr(s,l)}}var Nx=Gd(),Rx=Gd(!0);function qu(){return[]}function Ku(){return!1}function Lx(){return{}}function Px(){return""}function Dx(){return!0}function Fx(s,l){if(s=re(s),s<1||s>Ue)return[];var c=qe,d=ot(s,qe);l=X(l),s-=qe;for(var y=Yl(d,l);++c<s;)l(c);return y}function zx(s){return ne(s)?ke(s,_n):Mt(s)?[s]:bt(up(_e(s)))}function Bx(s){var l=++Yb;return _e(s)+l}var $x=Io(function(s,l){return s+l},0),Hx=Su("ceil"),Wx=Io(function(s,l){return s/l},1),Vx=Su("floor");function Ux(s){return s&&s.length?Co(s,wt,au):t}function qx(s,l){return s&&s.length?Co(s,X(l,2),au):t}function Kx(s){return jh(s,wt)}function Gx(s,l){return jh(s,X(l,2))}function Jx(s){return s&&s.length?Co(s,wt,fu):t}function jx(s,l){return s&&s.length?Co(s,X(l,2),fu):t}var Yx=Io(function(s,l){return s*l},1),Xx=Su("round"),Zx=Io(function(s,l){return s-l},0);function Qx(s){return s&&s.length?jl(s,wt):0}function e5(s,l){return s&&s.length?jl(s,X(l,2)):0}return v.after=Sw,v.ary=vp,v.assign=uS,v.assignIn=Lp,v.assignInWith=Uo,v.assignWith=cS,v.at=fS,v.before=wp,v.bind=Lu,v.bindAll=gx,v.bindKey=Sp,v.castArray=Lw,v.chain=yp,v.chunk=V_,v.compact=U_,v.concat=q_,v.cond=yx,v.conforms=bx,v.constant=Hu,v.countBy=Qv,v.create=hS,v.curry=xp,v.curryRight=Cp,v.debounce=Ep,v.defaults=dS,v.defaultsDeep=pS,v.defer=xw,v.delay=Cw,v.difference=K_,v.differenceBy=G_,v.differenceWith=J_,v.drop=j_,v.dropRight=Y_,v.dropRightWhile=X_,v.dropWhile=Z_,v.fill=Q_,v.filter=tw,v.flatMap=iw,v.flatMapDeep=sw,v.flatMapDepth=ow,v.flatten=dp,v.flattenDeep=ev,v.flattenDepth=tv,v.flip=Ew,v.flow=vx,v.flowRight=wx,v.fromPairs=nv,v.functions=wS,v.functionsIn=SS,v.groupBy=aw,v.initial=iv,v.intersection=sv,v.intersectionBy=ov,v.intersectionWith=av,v.invert=CS,v.invertBy=ES,v.invokeMap=uw,v.iteratee=Wu,v.keyBy=cw,v.keys=Ke,v.keysIn=vt,v.map=zo,v.mapKeys=AS,v.mapValues=MS,v.matches=Sx,v.matchesProperty=xx,v.memoize=$o,v.merge=TS,v.mergeWith=Pp,v.method=Cx,v.methodOf=Ex,v.mixin=Vu,v.negate=Ho,v.nthArg=Ax,v.omit=OS,v.omitBy=IS,v.once=kw,v.orderBy=fw,v.over=Mx,v.overArgs=Aw,v.overEvery=Tx,v.overSome=Ox,v.partial=Pu,v.partialRight=kp,v.partition=hw,v.pick=NS,v.pickBy=Dp,v.property=Vp,v.propertyOf=Ix,v.pull=fv,v.pullAll=mp,v.pullAllBy=hv,v.pullAllWith=dv,v.pullAt=pv,v.range=Nx,v.rangeRight=Rx,v.rearg=Mw,v.reject=mw,v.remove=mv,v.rest=Tw,v.reverse=Nu,v.sampleSize=yw,v.set=LS,v.setWith=PS,v.shuffle=bw,v.slice=gv,v.sortBy=ww,v.sortedUniq=xv,v.sortedUniqBy=Cv,v.split=ix,v.spread=Ow,v.tail=Ev,v.take=kv,v.takeRight=Av,v.takeRightWhile=Mv,v.takeWhile=Tv,v.tap=Uv,v.throttle=Iw,v.thru=Fo,v.toArray=Ip,v.toPairs=Fp,v.toPairsIn=zp,v.toPath=zx,v.toPlainObject=Rp,v.transform=DS,v.unary=Nw,v.union=Ov,v.unionBy=Iv,v.unionWith=Nv,v.uniq=Rv,v.uniqBy=Lv,v.uniqWith=Pv,v.unset=FS,v.unzip=Ru,v.unzipWith=gp,v.update=zS,v.updateWith=BS,v.values=_i,v.valuesIn=$S,v.without=Dv,v.words=Hp,v.wrap=Rw,v.xor=Fv,v.xorBy=zv,v.xorWith=Bv,v.zip=$v,v.zipObject=Hv,v.zipObjectDeep=Wv,v.zipWith=Vv,v.entries=Fp,v.entriesIn=zp,v.extend=Lp,v.extendWith=Uo,Vu(v,v),v.add=$x,v.attempt=Wp,v.camelCase=US,v.capitalize=Bp,v.ceil=Hx,v.clamp=HS,v.clone=Pw,v.cloneDeep=Fw,v.cloneDeepWith=zw,v.cloneWith=Dw,v.conformsTo=Bw,v.deburr=$p,v.defaultTo=_x,v.divide=Wx,v.endsWith=qS,v.eq=an,v.escape=KS,v.escapeRegExp=GS,v.every=ew,v.find=nw,v.findIndex=fp,v.findKey=mS,v.findLast=rw,v.findLastIndex=hp,v.findLastKey=gS,v.floor=Vx,v.forEach=bp,v.forEachRight=_p,v.forIn=yS,v.forInRight=bS,v.forOwn=_S,v.forOwnRight=vS,v.get=zu,v.gt=$w,v.gte=Hw,v.has=xS,v.hasIn=Bu,v.head=pp,v.identity=wt,v.includes=lw,v.indexOf=rv,v.inRange=WS,v.invoke=kS,v.isArguments=Dr,v.isArray=ne,v.isArrayBuffer=Ww,v.isArrayLike=_t,v.isArrayLikeObject=Ne,v.isBoolean=Vw,v.isBuffer=lr,v.isDate=Uw,v.isElement=qw,v.isEmpty=Kw,v.isEqual=Gw,v.isEqualWith=Jw,v.isError=Du,v.isFinite=jw,v.isFunction=Fn,v.isInteger=Ap,v.isLength=Wo,v.isMap=Mp,v.isMatch=Yw,v.isMatchWith=Xw,v.isNaN=Zw,v.isNative=Qw,v.isNil=tS,v.isNull=eS,v.isNumber=Tp,v.isObject=Me,v.isObjectLike=Ie,v.isPlainObject=_s,v.isRegExp=Fu,v.isSafeInteger=nS,v.isSet=Op,v.isString=Vo,v.isSymbol=Mt,v.isTypedArray=bi,v.isUndefined=rS,v.isWeakMap=iS,v.isWeakSet=sS,v.join=lv,v.kebabCase=JS,v.last=qt,v.lastIndexOf=uv,v.lowerCase=jS,v.lowerFirst=YS,v.lt=oS,v.lte=aS,v.max=Ux,v.maxBy=qx,v.mean=Kx,v.meanBy=Gx,v.min=Jx,v.minBy=jx,v.stubArray=qu,v.stubFalse=Ku,v.stubObject=Lx,v.stubString=Px,v.stubTrue=Dx,v.multiply=Yx,v.nth=cv,v.noConflict=kx,v.noop=Uu,v.now=Bo,v.pad=XS,v.padEnd=ZS,v.padStart=QS,v.parseInt=ex,v.random=VS,v.reduce=dw,v.reduceRight=pw,v.repeat=tx,v.replace=nx,v.result=RS,v.round=Xx,v.runInContext=T,v.sample=gw,v.size=_w,v.snakeCase=rx,v.some=vw,v.sortedIndex=yv,v.sortedIndexBy=bv,v.sortedIndexOf=_v,v.sortedLastIndex=vv,v.sortedLastIndexBy=wv,v.sortedLastIndexOf=Sv,v.startCase=sx,v.startsWith=ox,v.subtract=Zx,v.sum=Qx,v.sumBy=e5,v.template=ax,v.times=Fx,v.toFinite=zn,v.toInteger=re,v.toLength=Np,v.toLower=lx,v.toNumber=Kt,v.toSafeInteger=lS,v.toString=_e,v.toUpper=ux,v.trim=cx,v.trimEnd=fx,v.trimStart=hx,v.truncate=dx,v.unescape=px,v.uniqueId=Bx,v.upperCase=mx,v.upperFirst=$u,v.each=bp,v.eachRight=_p,v.first=pp,Vu(v,function(){var s={};return yn(v,function(l,c){we.call(v.prototype,c)||(s[c]=l)}),s}(),{chain:!1}),v.VERSION=r,$t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){v[s].placeholder=v}),$t(["drop","take"],function(s,l){ce.prototype[s]=function(c){c=c===t?1:Be(re(c),0);var d=this.__filtered__&&!l?new ce(this):this.clone();return d.__filtered__?d.__takeCount__=ot(c,d.__takeCount__):d.__views__.push({size:ot(c,qe),type:s+(d.__dir__<0?"Right":"")}),d},ce.prototype[s+"Right"]=function(c){return this.reverse()[s](c).reverse()}}),$t(["filter","map","takeWhile"],function(s,l){var c=l+1,d=c==en||c==We;ce.prototype[s]=function(y){var w=this.clone();return w.__iteratees__.push({iteratee:X(y,3),type:c}),w.__filtered__=w.__filtered__||d,w}}),$t(["head","last"],function(s,l){var c="take"+(l?"Right":"");ce.prototype[s]=function(){return this[c](1).value()[0]}}),$t(["initial","tail"],function(s,l){var c="drop"+(l?"":"Right");ce.prototype[s]=function(){return this.__filtered__?new ce(this):this[c](1)}}),ce.prototype.compact=function(){return this.filter(wt)},ce.prototype.find=function(s){return this.filter(s).head()},ce.prototype.findLast=function(s){return this.reverse().find(s)},ce.prototype.invokeMap=oe(function(s,l){return typeof s=="function"?new ce(this):this.map(function(c){return ds(c,s,l)})}),ce.prototype.reject=function(s){return this.filter(Ho(X(s)))},ce.prototype.slice=function(s,l){s=re(s);var c=this;return c.__filtered__&&(s>0||l<0)?new ce(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),l!==t&&(l=re(l),c=l<0?c.dropRight(-l):c.take(l-s)),c)},ce.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},ce.prototype.toArray=function(){return this.take(qe)},yn(ce.prototype,function(s,l){var c=/^(?:filter|find|map|reject)|While$/.test(l),d=/^(?:head|last)$/.test(l),y=v[d?"take"+(l=="last"?"Right":""):l],w=d||/^find/.test(l);y&&(v.prototype[l]=function(){var E=this.__wrapped__,M=d?[1]:arguments,O=E instanceof ce,P=M[0],D=O||ne(E),F=function(le){var he=y.apply(v,tr([le],M));return d&&V?he[0]:he};D&&c&&typeof P=="function"&&P.length!=1&&(O=D=!1);var V=this.__chain__,J=!!this.__actions__.length,Z=w&&!V,se=O&&!J;if(!w&&D){E=se?E:new ce(this);var Q=s.apply(E,M);return Q.__actions__.push({func:Fo,args:[F],thisArg:t}),new Wt(Q,V)}return Z&&se?s.apply(this,M):(Q=this.thru(F),Z?d?Q.value()[0]:Q.value():Q)})}),$t(["pop","push","shift","sort","splice","unshift"],function(s){var l=lo[s],c=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",d=/^(?:pop|shift)$/.test(s);v.prototype[s]=function(){var y=arguments;if(d&&!this.__chain__){var w=this.value();return l.apply(ne(w)?w:[],y)}return this[c](function(E){return l.apply(ne(E)?E:[],y)})}}),yn(ce.prototype,function(s,l){var c=v[l];if(c){var d=c.name+"";we.call(di,d)||(di[d]=[]),di[d].push({name:l,func:c})}}),di[Oo(t,x).name]=[{name:"wrapper",func:t}],ce.prototype.clone=p2,ce.prototype.reverse=m2,ce.prototype.value=g2,v.prototype.at=qv,v.prototype.chain=Kv,v.prototype.commit=Gv,v.prototype.next=Jv,v.prototype.plant=Yv,v.prototype.reverse=Xv,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=Zv,v.prototype.first=v.prototype.head,ss&&(v.prototype[ss]=jv),v},ci=Gb();Mr?((Mr.exports=ci)._=ci,Wl._=ci):Qe._=ci}).call(sI)}(js,js.exports)),js.exports}var ay=oI();function ih(n){return n.type.create(ay.cloneDeep(n.attrs))}const aI=De.create({name:"node_processor",addCommands(){return{setBlockAttributes:B(({commands:n,state:e},t,r,i={})=>{const o=H(n.getBlockAttributes(t))??{},{doc:a,tr:u}=e,{from:f,to:h}=u.selection;a.nodesBetween(f,h,(m,p)=>{ie.blocks.includes(m.type.name)&&u.setNodeAttribute(p,t,{...i,...o,...r})})}),getBlockAttributes:B(({editor:n},e,t)=>me(()=>{let r=Object.assign({},t||{});for(const i of ie.blocks)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:B(({commands:n},e)=>{for(const t of ie.blocks)n.resetAttributes(t,e)}),applyMark:B(({state:n,commands:e},t,r,i={})=>{const{tr:o,doc:a,schema:u}=n,{$from:f,$to:h}=o.selection,m=wn(de.LINK,u),p=wn(t,u);if(!(p.spec.group||"").includes(dn.SETTINGS))return e.setMark(t,r);if(f.pos===h.pos)return;const S=C=>{if(!i.onAppliedToParent||i.onAppliedToParent(C)===!1){const{tr:g,node:_,position:x,mark:k}=C;e._removeNodeMark({tr:g,node:_,position:x,mark:k.type})}};a.nodesBetween(f.pos,h.pos,(C,g)=>{if(C.type.name===ie.LIST)return;const _=iI(C.marks,t),x=p.create({..._?.attrs||{},...r}),k=iy(f,h,C,g);if(!m.isInSet(C.marks)&&rI(o.doc,g,x,i.isAppliedToParent))return S({tr:o,node:C,position:g,mark:x});if(C.isText){o.addMark(k.from,k.to,x);return}tI(o.doc,o.selection,C,g)&&o.addNodeMark(g,x)})}),getMarks:B(({editor:n},e)=>{const t=xi(n,"state");return me(()=>{const{selection:r,doc:i}=H(t),{from:o,to:a}=H(r),u=[];return i.nodesBetween(o,a,f=>{for(const h of f.marks)h.type.name===e&&u.unshift(h.attrs)}),u})}),getMark:B(({commands:n},e)=>{const t=n.getMarks(e);return me(()=>H(t)[0]??null)}),hasMark:B(({commands:n},e)=>{const t=n.getMark(e);return me(()=>!!H(t))}),getCommonSettingMark:B(({commands:n},e,t)=>{const r=n.getMark(e);return me(()=>H(r)?.value??H(t))}),getDeviceSettingMark:B(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return me(()=>{for(const o of H(r)){const a=o[H(i)];if(a)return a}return H(t)})}),removeAllMarks:B(({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:B(({state:n,commands:e},t)=>{const{tr:r,doc:i}=n,{from:o,to:a}=r.selection;i.nodesBetween(o,a,(u,f)=>{const h=u.marks.filter(m=>t.includes(m.type.name));for(const m of h)e._removeNodeMark({tr:r,node:u,position:f,mark:m})})}),_removeNodeMark:B((n,{tr:e,node:t,position:r,mark:i})=>t.isText?e.removeMark(r,r+t.nodeSize,i):e.removeNodeMark(r,i))}}}),lI=De.create({name:"text_processor",addCommands(){return{getSelectedText:B(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:B(({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=iy(t,r,i,o),u=Math.max(0,t.pos-o),f=Math.max(0,r.pos-o),h=e({text:i.textContent.substring(u,f)}),m=n.schema.text(h,i.marks);n.tr.replaceWith(a.from,a.to,m)})})}}}),uI=De.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:B(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:B(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:B(({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:sy(n.doc,a);r=Math.min(r,a+f),i=Math.max(i,a+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:B(({commands:n})=>{n.expandSelection(({parent:e})=>e.type.name===ie.DOCUMENT)})}}}),cI=Yn.create({name:"doc",topNode:!0,content:"block+"});class Xs extends lt{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=Vr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Fe.ok(t)}invert(){return new Xs(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 Xs(e.key,e.value,e.stepType)}}lt.jsonID("setDocAttr",Xs);const fI=cI.extend({marks:dn.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:B(({state:n},e,t)=>{n.tr.step(new Xs(e,t,n.schema))})}}}),hI=Yn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Fi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),dI=hI.extend({marks:dn.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),pI=Yn.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]}`,Fi(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=>GM({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),mI=pI.extend({marks:dn.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),gI=De.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[oT.create(this.editor),aT.create(this.editor)]}}),yI=()=>[fI,dI,mI,YM,sT,aI,lI,uI,gI],bI=Pt.create({name:de.FONT_FAMILY,group:dn.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:B(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=H(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(de.FONT_STYLE).value;!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:B(({commands:n})=>{const e=H(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return me(()=>n.findFontByName(H(r))||t)}),findFontByName:B((n,e)=>H(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:B(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:B(({commands:n})=>{const e=n.getPreset();return me(()=>H(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 Qr({font_family:e})}}),_I=De.create({name:de.STYLE_PRESET,addGlobalAttributes(){return[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{preset:{isRequired:!1,default:{id:H(this.options.defaultId)},parseHTML:n=>{const e=H(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=H(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:H(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:H(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:B(()=>me(()=>H(this.options.presets).filter(t=>!t.hidden))),getPreset:B(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:H(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),a=t.getLinkPreset();return me(()=>{const u=n(H(i),H(r).id);if(!H(o))return u;const f=H(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:B(({commands:t,chain:r},i)=>{const o=H(t.getPresetList()),a=n(o,i),u=a.node?.type??ie.PARAGRAPH,f={preset:{id:i}};a.node&&(f.level=a.node.level);for(const h of de.attributes)f[h]=H(t.getBlockAttributes(h));r().removeList().setNode(u,f).run()}),applyDefaultPreset:B(({commands:t})=>{t.applyPreset(H(this.options.defaultId))}),removePreset:B(({commands:t})=>{t.setNode(ie.PARAGRAPH,{preset:null})}),getPresetCustomization:B(({editor:t,commands:r})=>{const i=xi(t,"state");return me(()=>{const{selection:o,doc:a}=H(i),{from:u,to:f}=o;return r._getSettingCustomization(a,u,f)})}),isSettingCustomized:B(({commands:t},r)=>{const i=t.getPresetCustomization(),o=de.presetAttributes.includes(r)?"attributes":"marks";return me(()=>H(i)[o]?.includes(r)??!1)}),getContentCustomization:B(({editor:t,commands:r})=>{const i=xi(t,"state");return me(()=>{const{doc:o}=H(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:B((t,r,i,o)=>{const a=new Set,u=new Set;return r.nodesBetween(i,o,f=>{for(const[h,m]of Object.entries(f.attrs))de.presetAttributes.includes(h)&&m&&u.add(h);for(const{type:h}of f.marks)de.marks.includes(h.name)&&a.add(h.name)}),{attributes:Array.from(u),marks:Array.from(a)}}),removePresetCustomization:B(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(de.marks).resetAttributes(ie.PARAGRAPH,de.presetAttributes).resetAttributes(ie.HEADING,de.presetAttributes).restoreSelection().run()}),removeFormat:B(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Ki.head,H(this.options.presets))}}),vI=Pt.create({name:de.FONT_WEIGHT,group:dn.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:B(({commands:n},e)=>{n.applyMark(this.name,{value:e}),H(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:B(({commands:n})=>{const e=H(n.getFontWeight()),t=H(n.getFont()),i=Number(e)>=600?"400":"700",o=t.findClosestWeight(i);n.applyFontWeight(o)}),getFontWeight:B(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return me(()=>{const r=H(e),i=H(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:B(({commands:n})=>{const e=n.getPreset();return me(()=>H(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Zt("toggleBold"),"Mod-B":Zt("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 Qr({font_weight:n.value})}}),wI=Pt.create({name:de.FONT_SIZE,group:dn.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:B(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:B(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return me(()=>H(t)[H(e)].font_size.replace("px",""))}),applyFontSize:B(({commands:n},e)=>{const t=H(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(m=>!!m))return!1;const h=a.type.create(u);if(i.isText){r.addMark(o,o+i.nodeSize,h);return}r.addNodeMark(o,h)}})}),increaseFontSize:B(({commands:n})=>{const e=Number(H(n.getFontSize())),t=Math.min(e+1,H(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:B(({commands:n})=>{const e=Number(H(n.getFontSize())),t=Math.max(e-1,H(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Zt("increaseFontSize"),"Mod-Shift--":Zt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=H(this.options.wrapperRef),r=ry(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 Qr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),SI=Pt.create({name:de.FONT_COLOR,group:dn.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:B(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:B(({commands:n})=>{const e=n.getPreset();return me(()=>H(e).common.color)}),applyFontColor:B(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:ny(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Qr({font_color:n.value})}}),xI=Pt.create({name:de.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:B(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:B(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:ny(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Qr({background_color:n.value})}}),CI=De.create({name:"device_manager",addCommands(){return{getDevice:B(()=>xi(this.options,"device"))}}}),EI=Pt.create({name:de.FONT_STYLE,group:dn.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:B(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return me(()=>H(e)?.italic??H(t).italic)}),isItalicAvailable:B(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return me(()=>{const r=H(e),i=H(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:B(({commands:n})=>{const e=n.getPreset();return me(()=>({italic:H(e).common.font_style==="italic"}))}),toggleItalic:B(({commands:n})=>{H(n.isItalicAvailable())&&(H(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:B(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:B(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Zt("toggleItalic"),"Mod-I":Zt("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 Qr({font_style:e})}}),kI=Pt.create({name:de.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:B(({commands:n})=>{const e=n.getTextDecoration();return me(()=>H(e).underline)}),isStrikeThrough:B(({commands:n})=>{const e=n.getTextDecoration();return me(()=>H(e).strike_through)}),getTextDecoration:B(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return me(()=>{const r=H(e)??{},i=H(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:B(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return me(()=>H(e)!==H(t).underline)}),getDefaultTextDecoration:B(({commands:n})=>{const e=n.getPreset();return me(()=>{const{text_decoration:t}=H(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:B(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:B(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:B(({commands:n},e,t=null)=>{const r=H(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:B(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:B(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Zt("toggleUnderline"),"Mod-U":Zt("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"),Qr({text_decoration:e.join(" ")})}}),AI=De.create({name:"case_style",addCommands(){return{applyCaseStyle:B(({commands:n},e)=>{switch(e){case Sf.CAPITALIZE:return n.applyCapitalize();case Sf.LOWERCASE:return n.applyLowerCase();case Sf.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:B(({commands:n})=>{n.transformText(({text:e})=>MT(e))}),applyLowerCase:B(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:B(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),ly={mobile:null,tablet:null,desktop:null},MI=De.create({name:de.ALIGNMENT,addGlobalAttributes:()=>[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[de.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=eI(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?cl({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:B(({commands:n},e)=>{const t=H(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},ly)}),removeAlignment:B(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:B(({commands:n})=>{const e=n.getBlockAttributes(this.name,ly),t=n.getDevice(),r=n.getDefaultAlignment();return me(()=>H(e)?.[H(t)]??H(r))}),getDefaultAlignment:B(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return me(()=>H(t)[H(e)].alignment??vr.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Zt("applyAlignment",vr.LEFT),"Mod-Shift-e":Zt("applyAlignment",vr.CENTER),"Mod-Shift-r":Zt("applyAlignment",vr.RIGHT),"Mod-Shift-j":Zt("applyAlignment",vr.JUSTIFY)})}),uy={mobile:null,tablet:null,desktop:null},TI=De.create({name:de.LINE_HEIGHT,addGlobalAttributes(){return[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[de.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=H(this.options.wrapperRef),r=ZO(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?cl({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:B(({commands:n})=>{const e=n.getBlockAttributes(this.name,uy),t=n.getDevice(),r=n.getDefaultLineHeight();return me(()=>H(e)?.[H(t)]??H(r))}),getDefaultLineHeight:B(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return me(()=>H(t)[H(e)].line_height)}),applyLineHeight:B(({commands:n},e)=>{const t=H(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},uy)})}}}),OI=Yn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Fi(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)}}}),II=OI.extend({name:ie.LIST_ITEM,marks:dn.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:B(({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,ih(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===ie.LIST))return t.listItemNewline()}})}),NI=Yn.create({name:ie.LIST,content:`${ie.LIST_ITEM}+`,group:"block list",marks:dn.SETTINGS,addExtensions:()=>[II],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:Yt.DISC}}}),parseHTML(){const n={a:Yt.ROMAN,i:Yt.LATIN,1:Yt.DECIMAL},e=t=>{for(const r of Yt.values){const i=`.${H(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Yt.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Yt.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[H(this.options.baseClass)+n.bullet.type,H(this.options.presetClass)];return[Yt.ordered.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:B(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return me(()=>H(e).type??null)}),applyList:B(({commands:n,chain:e},t)=>{if(H(n.getListType())===t){n.removeList();return}return e().applyDefaultPreset().toggleList(ie.LIST,ie.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({commands:i,tr:o})=>i._bubbleListItemMarks(o)).run()}),_bubbleListItemMarks:B((n,e)=>{const{doc:t,selection:r}=e,i=r.$from.start(),o=r.$to.end();function a(u,f){if(de.inlineMarks.includes(f.type)||f.type.isInSet(u.marks))return!1;for(const h of u.content.content)if(h.childCount&&(!h.marks||!f.isInSet(h.marks)))return!1;return!0}t.nodesBetween(i,o,(u,f)=>{if(u.type.name===ie.LIST)return;if(u.type.name!==ie.LIST_ITEM)return!1;const h=[];return u.forEach(m=>{for(const p of m.marks){if(p.isInSet(h)){e.removeNodeMark(f+1,p);continue}a(u,p)&&(e.removeNodeMark(f+1,p),e.addNodeMark(f,ih(p)),h.push(p))}}),!1})}),removeList:B(({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,h)=>{if([ie.LIST,ie.LIST_ITEM].includes(u.type.name))return;if(h.type.name!==ie.LIST_ITEM)return!1;const m=h.marks.filter(function(p){return!p.type.isInSet(u.marks)});for(const p of m)t.addNodeMark(f,ih(p));return!1}),n.liftListItem(ie.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>JM({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(Yt.DISC,/^\s*([-+*])\s$/),n(Yt.DECIMAL,/^(\d+)\.\s$/),n(Yt.LATIN,/^([ivx]{1,3})\.\s$/i),n(Yt.ROMAN,/^([a-z])\.\s$/i)]}});function RI(n){return new Rt({key:new fn("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(h=>h.docChanged)&&!t.doc.eq(r.doc),o=e.some(h=>h.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=r,u=gM(t.doc,[...e]);if(EM(u).forEach(({newRange:h})=>{const m=bM(r.doc,h,S=>S.isTextblock);let p,b;if(m.length>1?(p=m[0],b=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):m.length&&r.doc.textBetween(h.from,h.to," "," ").endsWith(" ")&&(p=m[0],b=r.doc.textBetween(p.pos,h.to,void 0," ")),p&&b){const S=b.split(" ").filter(_=>_!=="");if(S.length<=0)return!1;const C=S[S.length-1],g=p.pos+b.lastIndexOf(C);if(!C)return!1;Wf(C).filter(_=>_.isLink).map(_=>({..._,from:g+_.start+1,to:g+_.end+1})).filter(_=>r.schema.marks.code?!r.doc.rangeHasMark(_.from,_.to,r.schema.marks.code):!0).filter(_=>n.validate?n.validate(_.value):!0).forEach(_=>{I0(_.from,_.to,r.doc).some(x=>x.mark.type===n.type)||a.addMark(_.from,_.to,n.type.create({href:_.href}))})}}),!!a.steps.length)return a}})}function LI(n){return new Rt({key:new fn("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const u=SM(e.state,n.type.name),f=r.target,h=(i=f?.href)!==null&&i!==void 0?i:u.href,m=(o=f?.target)!==null&&o!==void 0?o:u.target;return f&&h?(e.editable&&window.open(h,m),!0):!1}}})}function PI(n){return new Rt({key:new fn("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(C=>{f+=C.textContent});const h=Wf(f).find(C=>C.isLink&&C.value===f);if(!f||!h)return!1;const m=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/html"),p=/href="([^"]*)"/,b=m?.match(p),S=b?b[1]:h.href;return n.editor.commands.setMark(n.type,{href:S}),!0}}})}const DI=Pt.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){t1(n);return}t1(n.scheme,n.optionalSlashes)})},onDestroy(){CT()},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",Fi(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Fi(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[jM({find:n=>Wf(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(RI({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(LI({type:this.type})),this.options.linkOnPaste&&n.push(PI({editor:this.editor,type:this.type})),n}}),FI=DI.extend({name:de.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:H0.SELF,parseHTML:n=>n.getAttribute("target")||H0.SELF},destination:{default:Bs.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Bs.URL;const t=e.replace("#","");return H(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Bs.BLOCK:Bs.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:B(({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(fy.text(r.text,[fy.mark(de.LINK,r)])))),expandSelectionToLink:B(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:B(({commands:e})=>e.hasMark(this.name)),getLinkPreset:B(()=>me(()=>H(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),AT.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Bs.BLOCK?`#${n.href}`:n.href,t=H(this.options.basePresetClass)+H(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),zI=Pt.create({name:de.SUPERSCRIPT,addCommands(){return{applySuperscript:B(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:B(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:B(({commands:n})=>{H(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:B(({commands:n})=>{const e=n.getMark(this.name);return me(()=>!!H(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),BI=De.create({name:de.MARGIN,addGlobalAttributes:()=>[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[de.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?cl({margin:n.margin.value}):null}}}}]});function $I(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=hc({default:null,link:null});return PC(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),yI().concat([_I.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new VI({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),NI.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),CI.configure({device:n.deviceRef}),wI.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),bI.configure({fonts:n.fonts,defaultPreset:xi(t,"default"),defaultFont:n.defaultFont}),vI,SI,xI,EI,kI,AI,zI,MI,TI.configure({wrapperRef:n.wrapperRef}),FI.configure({preset:xi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),BI])}class HI{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class cy{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class kn extends cy{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=kn.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,kn.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,kn.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,kn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,kn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return kn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return kn.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,kn.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 WI extends cy{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!==ie.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(de.inlineMarks.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===ie.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>ay.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===ie.TEXT&&this._includesMarkType(e,de.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 Cl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new kn({content:e,parser:t.parser||new HI})}static _buildJson(e){return new WI({content:e})}static normalize(e,t={}){return Cl.build(e,t).normalize()}}class Ki{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 hh{static build({config:e,nodeDomParser:t}){const r=$I({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:sa(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:sa(wf.DESKTOP),pageBlocksRef:sa([]),wrapperRef:Ki.document.createElement("p")}),i=vM(r);return new hh({schema:i,domParser:Mc.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=Cl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class fy{static doc(e){return{type:ie.DOCUMENT,content:e}}static list(e,t){return{type:ie.LIST,attrs:{bullet:{type:e}},content:t.map(r=>r.type===ie.LIST_ITEM?r:this.listItem([].concat(r)))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{type:ie.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:ie.HEADING,...r}}static paragraph(...e){return{type:ie.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:ie.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(de.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class VI{_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=Ki.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 wf.values)for(const u of Object.keys(r[a])){const f=this._makeVariable({device:a,preset:r,property:u}),h=this._makeInternalVariableName(u,a);if(t+=`${h}: var(${f}, inherit);`,i&&!de.attributes.includes(u)){const m=h.replace("preset-","");t+=`${m}: var(${h});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===wf.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 dh{static _instance;static get instance(){return this._instance??=new dh,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 hy{static createWindow(){return new Kp.JSDOM().window}types;parse(e){const{window:t}=new Kp.JSDOM(e);return this.types=t,t.document}}class dy{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 UI extends dy{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:qp.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(e,{config:t,format:r}){Ki.use(hy.createWindow());const i=qp.resolve(process.cwd(),t),o=hh.build({config:require(i).editor,nodeDomParser:new hy}),a=e.map(h=>o.toJSON(this._formatInputHtml(h))),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 qI="4.8.0-beta.0";class KI extends dy{name="version";description="display cli version";doCommand(){this.output(qI)}}const py=new h5,GI=[UI,KI];for(const n of GI)new n().install(py);py.parse();
|