@zipify/wysiwyg 4.13.0-beta.0 → 4.13.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +28 -28
- package/dist/node.js +15 -15
- package/dist/wysiwyg.mjs +2 -2
- package/lib/components/toolbar/ToolbarFloating.vue +2 -2
- package/lib/extensions/StylePreset.js +2 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
"use strict";var RC=require("node:events"),LC=require("node:child_process"),PC=require("node:path"),DC=require("node:fs"),FC=require("node:process"),im=require("path"),sm=require("jsdom"),
|
|
1
|
+
"use strict";var RC=require("node:events"),LC=require("node:child_process"),PC=require("node:path"),DC=require("node:fs"),FC=require("node:process"),im=require("path"),sm=require("jsdom"),Vo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function BC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mt={},Uo={},qo={},om;function Ko(){if(om)return qo;om=1;class n extends Error{constructor(r,i,s){super(s),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 qo.CommanderError=n,qo.InvalidArgumentError=e,qo}var am;function cc(){if(am)return Uo;am=1;const{InvalidArgumentError:n}=Ko();class e{constructor(i,s){switch(this.description=s||"",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,s){return s===this.defaultValue||!Array.isArray(s)?[i]:s.concat(i)}default(i,s){return this.defaultValue=i,this.defaultValueDescription=s,this}argParser(i){return this.parseArg=i,this}choices(i){return this.argChoices=i.slice(),this.parseArg=(s,a)=>{if(!this.argChoices.includes(s))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(s,a):s},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 Uo.Argument=e,Uo.humanReadableArgName=t,Uo}var Go={},Jo={},lm;function um(){if(lm)return Jo;lm=1;const{humanReadableArgName:n}=cc();class e{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(i){this.helpWidth=this.helpWidth??i.helpWidth??80}visibleCommands(i){const s=i.commands.filter(u=>!u._hidden),a=i._getHelpCommand();return a&&!a._hidden&&s.push(a),this.sortSubcommands&&s.sort((u,c)=>u.name().localeCompare(c.name())),s}compareOptions(i,s){const a=u=>u.short?u.short.replace(/^-/,""):u.long.replace(/^--/,"");return a(i).localeCompare(a(s))}visibleOptions(i){const s=i.options.filter(u=>!u.hidden),a=i._getHelpOption();if(a&&!a.hidden){const u=a.short&&i._findOption(a.short),c=a.long&&i._findOption(a.long);!u&&!c?s.push(a):a.long&&!c?s.push(i.createOption(a.long,a.description)):a.short&&!u&&s.push(i.createOption(a.short,a.description))}return this.sortOptions&&s.sort(this.compareOptions),s}visibleGlobalOptions(i){if(!this.showGlobalOptions)return[];const s=[];for(let a=i.parent;a;a=a.parent){const u=a.options.filter(c=>!c.hidden);s.push(...u)}return this.sortOptions&&s.sort(this.compareOptions),s}visibleArguments(i){return i._argsDescription&&i.registeredArguments.forEach(s=>{s.description=s.description||i._argsDescription[s.name()]||""}),i.registeredArguments.find(s=>s.description)?i.registeredArguments:[]}subcommandTerm(i){const s=i.registeredArguments.map(a=>n(a)).join(" ");return i._name+(i._aliases[0]?"|"+i._aliases[0]:"")+(i.options.length?" [options]":"")+(s?" "+s:"")}optionTerm(i){return i.flags}argumentTerm(i){return i.name()}longestSubcommandTermLength(i,s){return s.visibleCommands(i).reduce((a,u)=>Math.max(a,this.displayWidth(s.styleSubcommandTerm(s.subcommandTerm(u)))),0)}longestOptionTermLength(i,s){return s.visibleOptions(i).reduce((a,u)=>Math.max(a,this.displayWidth(s.styleOptionTerm(s.optionTerm(u)))),0)}longestGlobalOptionTermLength(i,s){return s.visibleGlobalOptions(i).reduce((a,u)=>Math.max(a,this.displayWidth(s.styleOptionTerm(s.optionTerm(u)))),0)}longestArgumentTermLength(i,s){return s.visibleArguments(i).reduce((a,u)=>Math.max(a,this.displayWidth(s.styleArgumentTerm(s.argumentTerm(u)))),0)}commandUsage(i){let s=i._name;i._aliases[0]&&(s=s+"|"+i._aliases[0]);let a="";for(let u=i.parent;u;u=u.parent)a=u.name()+" "+a;return a+s+" "+i.usage()}commandDescription(i){return i.description()}subcommandDescription(i){return i.summary()||i.description()}optionDescription(i){const s=[];return i.argChoices&&s.push(`choices: ${i.argChoices.map(a=>JSON.stringify(a)).join(", ")}`),i.defaultValue!==void 0&&(i.required||i.optional||i.isBoolean()&&typeof i.defaultValue=="boolean")&&s.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),i.presetArg!==void 0&&i.optional&&s.push(`preset: ${JSON.stringify(i.presetArg)}`),i.envVar!==void 0&&s.push(`env: ${i.envVar}`),s.length>0?`${i.description} (${s.join(", ")})`:i.description}argumentDescription(i){const s=[];if(i.argChoices&&s.push(`choices: ${i.argChoices.map(a=>JSON.stringify(a)).join(", ")}`),i.defaultValue!==void 0&&s.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),s.length>0){const a=`(${s.join(", ")})`;return i.description?`${i.description} ${a}`:a}return i.description}formatHelp(i,s){const a=s.padWidth(i,s),u=s.helpWidth??80;function c(S,E){return s.formatItem(S,a,E,s)}let h=[`${s.styleTitle("Usage:")} ${s.styleUsage(s.commandUsage(i))}`,""];const p=s.commandDescription(i);p.length>0&&(h=h.concat([s.boxWrap(s.styleCommandDescription(p),u),""]));const m=s.visibleArguments(i).map(S=>c(s.styleArgumentTerm(s.argumentTerm(S)),s.styleArgumentDescription(s.argumentDescription(S))));m.length>0&&(h=h.concat([s.styleTitle("Arguments:"),...m,""]));const y=s.visibleOptions(i).map(S=>c(s.styleOptionTerm(s.optionTerm(S)),s.styleOptionDescription(s.optionDescription(S))));if(y.length>0&&(h=h.concat([s.styleTitle("Options:"),...y,""])),s.showGlobalOptions){const S=s.visibleGlobalOptions(i).map(E=>c(s.styleOptionTerm(s.optionTerm(E)),s.styleOptionDescription(s.optionDescription(E))));S.length>0&&(h=h.concat([s.styleTitle("Global Options:"),...S,""]))}const _=s.visibleCommands(i).map(S=>c(s.styleSubcommandTerm(s.subcommandTerm(S)),s.styleSubcommandDescription(s.subcommandDescription(S))));return _.length>0&&(h=h.concat([s.styleTitle("Commands:"),..._,""])),h.join(`
|
|
2
2
|
`)}displayWidth(i){return t(i).length}styleTitle(i){return i}styleUsage(i){return i.split(" ").map(s=>s==="[options]"?this.styleOptionText(s):s==="[command]"?this.styleSubcommandText(s):s[0]==="["||s[0]==="<"?this.styleArgumentText(s):this.styleCommandText(s)).join(" ")}styleCommandDescription(i){return this.styleDescriptionText(i)}styleOptionDescription(i){return this.styleDescriptionText(i)}styleSubcommandDescription(i){return this.styleDescriptionText(i)}styleArgumentDescription(i){return this.styleDescriptionText(i)}styleDescriptionText(i){return i}styleOptionTerm(i){return this.styleOptionText(i)}styleSubcommandTerm(i){return i.split(" ").map(s=>s==="[options]"?this.styleOptionText(s):s[0]==="["||s[0]==="<"?this.styleArgumentText(s):this.styleSubcommandText(s)).join(" ")}styleArgumentTerm(i){return this.styleArgumentText(i)}styleOptionText(i){return i}styleArgumentText(i){return i}styleSubcommandText(i){return i}styleCommandText(i){return i}padWidth(i,s){return Math.max(s.longestOptionTermLength(i,s),s.longestGlobalOptionTermLength(i,s),s.longestSubcommandTermLength(i,s),s.longestArgumentTermLength(i,s))}preformatted(i){return/\n[^\S\r\n]/.test(i)}formatItem(i,s,a,u){const h=" ".repeat(2);if(!a)return h+i;const p=i.padEnd(s+i.length-u.displayWidth(i)),m=2,_=(this.helpWidth??80)-s-m-2;let S;return _<this.minWidthToWrap||u.preformatted(a)?S=a:S=u.boxWrap(a,_).replace(/\n/g,`
|
|
3
3
|
`+" ".repeat(s+m)),h+p+" ".repeat(m)+S.replace(/\n/g,`
|
|
4
4
|
${h}`)}boxWrap(i,s){if(s<this.minWidthToWrap)return i;const a=i.split(/\r\n|\n/),u=/[\s]*[^\s]+/g,c=[];return a.forEach(h=>{const p=h.match(u);if(p===null){c.push("");return}let m=[p.shift()],y=this.displayWidth(m[0]);p.forEach(_=>{const S=this.displayWidth(_);if(y+S<=s){m.push(_),y+=S;return}c.push(m.join(""));const E=_.trimStart();m=[E],y=this.displayWidth(E)}),c.push(m.join(""))}),c.join(`
|
|
5
|
-
`)}}function t(r){const i=/\x1b\[\d*(;\d*)*m/g;return r.replace(i,"")}return
|
|
5
|
+
`)}}function t(r){const i=/\x1b\[\d*(;\d*)*m/g;return r.replace(i,"")}return Jo.Help=e,Jo.stripColor=t,Jo}var jo={},cm;function fm(){if(cm)return jo;cm=1;const{InvalidArgumentError:n}=Ko();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 c=i(a);this.short=c.shortFlag,this.long=c.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,c)=>{if(!this.argChoices.includes(u))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(u,c):u},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?r(this.name().replace(/^no-/,"")):r(this.name())}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,c)=>{this.positiveOptions.has(c)&&this.dualOptions.add(c)})}valueFromOption(a,u){const c=u.attributeName();if(!this.dualOptions.has(c))return!0;const h=this.negativeOptions.get(c).presetArg,p=h!==void 0?h:!1;return u.negate===(p===a)}}function r(s){return s.split("-").reduce((a,u)=>a+u[0].toUpperCase()+u.slice(1))}function i(s){let a,u;const c=/^-[^-]$/,h=/^--[^-]/,p=s.split(/[ |,]+/).concat("guard");if(c.test(p[0])&&(a=p.shift()),h.test(p[0])&&(u=p.shift()),!a&&c.test(p[0])&&(a=p.shift()),!a&&h.test(p[0])&&(a=u,u=p.shift()),p[0].startsWith("-")){const m=p[0],y=`option creation failed due to '${m}' in option flags '${s}'`;throw/^-[^-][^-]/.test(m)?new Error(`${y}
|
|
6
6
|
- a short flag is a single dash and a single character
|
|
7
7
|
- either use a single dash and a single character (for a short flag)
|
|
8
8
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):c.test(m)?new Error(`${y}
|
|
9
9
|
- too many short flags`):h.test(m)?new Error(`${y}
|
|
10
10
|
- too many long flags`):new Error(`${y}
|
|
11
|
-
- unrecognised flag format`)}if(a===void 0&&u===void 0)throw new Error(`option creation failed due to no flags found in '${s}'.`);return{shortFlag:a,longFlag:u}}return
|
|
11
|
+
- unrecognised flag format`)}if(a===void 0&&u===void 0)throw new Error(`option creation failed due to no flags found in '${s}'.`);return{shortFlag:a,longFlag:u}}return jo.Option=e,jo.DualOptions=t,jo}var fc={},hm;function zC(){if(hm)return fc;hm=1;const n=3;function e(r,i){if(Math.abs(r.length-i.length)>n)return Math.max(r.length,i.length);const s=[];for(let a=0;a<=r.length;a++)s[a]=[a];for(let a=0;a<=i.length;a++)s[0][a]=a;for(let a=1;a<=i.length;a++)for(let u=1;u<=r.length;u++){let c=1;r[u-1]===i[a-1]?c=0:c=1,s[u][a]=Math.min(s[u-1][a]+1,s[u][a-1]+1,s[u-1][a-1]+c),u>1&&a>1&&r[u-1]===i[a-2]&&r[u-2]===i[a-1]&&(s[u][a]=Math.min(s[u][a],s[u-2][a-2]+1))}return s[r.length][i.length]}function t(r,i){if(!i||i.length===0)return"";i=Array.from(new Set(i));const s=r.startsWith("--");s&&(r=r.slice(2),i=i.map(h=>h.slice(2)));let a=[],u=n;const c=.4;return i.forEach(h=>{if(h.length<=1)return;const p=e(r,h),m=Math.max(r.length,h.length);(m-p)/m>c&&(p<u?(u=p,a=[h]):p===u&&a.push(h))}),a.sort((h,p)=>h.localeCompare(p)),s&&(a=a.map(h=>`--${h}`)),a.length>1?`
|
|
12
12
|
(Did you mean one of ${a.join(", ")}?)`:a.length===1?`
|
|
13
|
-
(Did you mean ${a[0]}?)`:""}return fc.suggestSimilar=t,fc}var dm;function $C(){if(dm)return
|
|
14
|
-
- specify the name in Command constructor or using .name()`);return v=v||{},v.isDefault&&(this._defaultCommandName=g._name),(v.noHelp||v.hidden)&&(g._hidden=!0),this._registerCommand(g),g.parent=this,g._checkForBrokenPassThrough(),this}createArgument(g,v){return new s(g,v)}argument(g,v,k,
|
|
15
|
-
Expecting one of '${k.join("', '")}'`);return this._lifeCycleHooks[g]?this._lifeCycleHooks[g].push(v):this._lifeCycleHooks[g]=[v],this}exitOverride(g){return g?this._exitCallback=g:this._exitCallback=v=>{if(v.code!=="commander.executeSubCommandAsync")throw v},this}_exit(g,v,k){this._exitCallback&&this._exitCallback(new u(g,v,k)),i.exit(g)}action(g){const v=k=>{const
|
|
16
|
-
- already used by option '${v.flags}'`)}this.options.push(g)}_registerCommand(g){const v=
|
|
17
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(g,v,k){if(r.existsSync(g))return;const
|
|
13
|
+
(Did you mean ${a[0]}?)`:""}return fc.suggestSimilar=t,fc}var dm;function $C(){if(dm)return Go;dm=1;const n=RC.EventEmitter,e=LC,t=PC,r=DC,i=FC,{Argument:s,humanReadableArgName:a}=cc(),{CommanderError:u}=Ko(),{Help:c,stripColor:h}=um(),{Option:p,DualOptions:m}=fm(),{suggestSimilar:y}=zC();class _ extends n{constructor(g){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,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._savedState=null,this._outputConfiguration={writeOut:v=>i.stdout.write(v),writeErr:v=>i.stderr.write(v),outputError:(v,k)=>k(v),getOutHelpWidth:()=>i.stdout.isTTY?i.stdout.columns:void 0,getErrHelpWidth:()=>i.stderr.isTTY?i.stderr.columns:void 0,getOutHasColors:()=>E()??(i.stdout.isTTY&&i.stdout.hasColors?.()),getErrHasColors:()=>E()??(i.stderr.isTTY&&i.stderr.hasColors?.()),stripColor:v=>h(v)},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 v=this;v;v=v.parent)g.push(v);return g}command(g,v,k){let A=v,T=k;typeof A=="object"&&A!==null&&(T=A,A=null),T=T||{};const[,F,U]=g.match(/([^ ]+) *(.*)/),W=this.createCommand(F);return A&&(W.description(A),W._executableHandler=!0),T.isDefault&&(this._defaultCommandName=W._name),W._hidden=!!(T.noHelp||T.hidden),W._executableFile=T.executableFile||null,U&&W.arguments(U),this._registerCommand(W),W.parent=this,W.copyInheritedSettings(this),A?this:W}createCommand(g){return new _(g)}createHelp(){return Object.assign(new c,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,v){if(!g._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
14
|
+
- specify the name in Command constructor or using .name()`);return v=v||{},v.isDefault&&(this._defaultCommandName=g._name),(v.noHelp||v.hidden)&&(g._hidden=!0),this._registerCommand(g),g.parent=this,g._checkForBrokenPassThrough(),this}createArgument(g,v){return new s(g,v)}argument(g,v,k,A){const T=this.createArgument(g,v);return typeof k=="function"?T.default(A).argParser(k):T.default(k),this.addArgument(T),this}arguments(g){return g.trim().split(/ +/).forEach(v=>{this.argument(v)}),this}addArgument(g){const v=this.registeredArguments.slice(-1)[0];if(v&&v.variadic)throw new Error(`only the last argument can be variadic '${v.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,v){if(typeof g=="boolean")return this._addImplicitHelpCommand=g,this;g=g??"help [command]";const[,k,A]=g.match(/([^ ]+) *(.*)/),T=v??"display help for command",F=this.createCommand(k);return F.helpOption(!1),A&&F.arguments(A),T&&F.description(T),this._addImplicitHelpCommand=!0,this._helpCommand=F,this}addHelpCommand(g,v){return typeof g!="object"?(this.helpCommand(g,v),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,v){const k=["preSubcommand","preAction","postAction"];if(!k.includes(g))throw new Error(`Unexpected value for event passed to hook : '${g}'.
|
|
15
|
+
Expecting one of '${k.join("', '")}'`);return this._lifeCycleHooks[g]?this._lifeCycleHooks[g].push(v):this._lifeCycleHooks[g]=[v],this}exitOverride(g){return g?this._exitCallback=g:this._exitCallback=v=>{if(v.code!=="commander.executeSubCommandAsync")throw v},this}_exit(g,v,k){this._exitCallback&&this._exitCallback(new u(g,v,k)),i.exit(g)}action(g){const v=k=>{const A=this.registeredArguments.length,T=k.slice(0,A);return this._storeOptionsAsProperties?T[A]=this:T[A]=this.opts(),T.push(this),g.apply(this,T)};return this._actionHandler=v,this}createOption(g,v){return new p(g,v)}_callParseArg(g,v,k,A){try{return g.parseArg(v,k)}catch(T){if(T.code==="commander.invalidArgument"){const F=`${A} ${T.message}`;this.error(F,{exitCode:T.exitCode,code:T.code})}throw T}}_registerOption(g){const v=g.short&&this._findOption(g.short)||g.long&&this._findOption(g.long);if(v){const k=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 '${k}'
|
|
16
|
+
- already used by option '${v.flags}'`)}this.options.push(g)}_registerCommand(g){const v=A=>[A.name()].concat(A.aliases()),k=v(g).find(A=>this._findCommand(A));if(k){const A=v(this._findCommand(k)).join("|"),T=v(g).join("|");throw new Error(`cannot add command '${T}' as already have command '${A}'`)}this.commands.push(g)}addOption(g){this._registerOption(g);const v=g.name(),k=g.attributeName();if(g.negate){const T=g.long.replace(/^--no-/,"--");this._findOption(T)||this.setOptionValueWithSource(k,g.defaultValue===void 0?!0:g.defaultValue,"default")}else g.defaultValue!==void 0&&this.setOptionValueWithSource(k,g.defaultValue,"default");const A=(T,F,U)=>{T==null&&g.presetArg!==void 0&&(T=g.presetArg);const W=this.getOptionValue(k);T!==null&&g.parseArg?T=this._callParseArg(g,T,W,F):T!==null&&g.variadic&&(T=g._concatValue(T,W)),T==null&&(g.negate?T=!1:g.isBoolean()||g.optional?T=!0:T=""),this.setOptionValueWithSource(k,T,U)};return this.on("option:"+v,T=>{const F=`error: option '${g.flags}' argument '${T}' is invalid.`;A(T,F,"cli")}),g.envVar&&this.on("optionEnv:"+v,T=>{const F=`error: option '${g.flags}' value '${T}' from env '${g.envVar}' is invalid.`;A(T,F,"env")}),this}_optionEx(g,v,k,A,T){if(typeof v=="object"&&v instanceof p)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const F=this.createOption(v,k);if(F.makeOptionMandatory(!!g.mandatory),typeof A=="function")F.default(T).argParser(A);else if(A instanceof RegExp){const U=A;A=(W,ee)=>{const te=U.exec(W);return te?te[0]:ee},F.default(T).argParser(A)}else F.default(A);return this.addOption(F)}option(g,v,k,A){return this._optionEx({},g,v,k,A)}requiredOption(g,v,k,A){return this._optionEx({mandatory:!0},g,v,k,A)}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,v){return this.setOptionValueWithSource(g,v,void 0)}setOptionValueWithSource(g,v,k){return this._storeOptionsAsProperties?this[g]=v:this._optionValues[g]=v,this._optionValueSources[g]=k,this}getOptionValueSource(g){return this._optionValueSources[g]}getOptionValueSourceWithGlobals(g){let v;return this._getCommandAndAncestors().forEach(k=>{k.getOptionValueSource(g)!==void 0&&(v=k.getOptionValueSource(g))}),v}_prepareUserArgs(g,v){if(g!==void 0&&!Array.isArray(g))throw new Error("first parameter to parse must be array or undefined");if(v=v||{},g===void 0&&v.from===void 0){i.versions?.electron&&(v.from="electron");const A=i.execArgv??[];(A.includes("-e")||A.includes("--eval")||A.includes("-p")||A.includes("--print"))&&(v.from="eval")}g===void 0&&(g=i.argv),this.rawArgs=g.slice();let k;switch(v.from){case void 0:case"node":this._scriptPath=g[1],k=g.slice(2);break;case"electron":i.defaultApp?(this._scriptPath=g[1],k=g.slice(2)):k=g.slice(1);break;case"user":k=g.slice(0);break;case"eval":k=g.slice(1);break;default:throw new Error(`unexpected parse option { from: '${v.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",k}parse(g,v){this._prepareForParse();const k=this._prepareUserArgs(g,v);return this._parseCommand([],k),this}async parseAsync(g,v){this._prepareForParse();const k=this._prepareUserArgs(g,v);return await this._parseCommand([],k),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
17
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(g,v,k){if(r.existsSync(g))return;const A=v?`searched for local subcommand relative to directory '${v}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",T=`'${g}' does not exist
|
|
18
18
|
- if '${k}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
19
19
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
20
|
-
- ${
|
|
20
|
+
- ${A}`;throw new Error(T)}_executeSubCommand(g,v){v=v.slice();let k=!1;const A=[".js",".ts",".tsx",".mjs",".cjs"];function T(te,Se){const vt=t.resolve(te,Se);if(r.existsSync(vt))return vt;if(A.includes(t.extname(Se)))return;const Sn=A.find(Ft=>r.existsSync(`${vt}${Ft}`));if(Sn)return`${vt}${Sn}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let F=g._executableFile||`${this._name}-${g._name}`,U=this._executableDir||"";if(this._scriptPath){let te;try{te=r.realpathSync(this._scriptPath)}catch{te=this._scriptPath}U=t.resolve(t.dirname(te),U)}if(U){let te=T(U,F);if(!te&&!g._executableFile&&this._scriptPath){const Se=t.basename(this._scriptPath,t.extname(this._scriptPath));Se!==this._name&&(te=T(U,`${Se}-${g._name}`))}F=te||F}k=A.includes(t.extname(F));let W;i.platform!=="win32"?k?(v.unshift(F),v=S(i.execArgv).concat(v),W=e.spawn(i.argv[0],v,{stdio:"inherit"})):W=e.spawn(F,v,{stdio:"inherit"}):(this._checkForMissingExecutable(F,U,g._name),v.unshift(F),v=S(i.execArgv).concat(v),W=e.spawn(i.execPath,v,{stdio:"inherit"})),W.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(Se=>{i.on(Se,()=>{W.killed===!1&&W.exitCode===null&&W.kill(Se)})});const ee=this._exitCallback;W.on("close",te=>{te=te??1,ee?ee(new u(te,"commander.executeSubCommandAsync","(close)")):i.exit(te)}),W.on("error",te=>{if(te.code==="ENOENT")this._checkForMissingExecutable(F,U,g._name);else if(te.code==="EACCES")throw new Error(`'${F}' not executable`);if(!ee)i.exit(1);else{const Se=new u(1,"commander.executeSubCommandAsync","(error)");Se.nestedError=te,ee(Se)}}),this.runningCommand=W}_dispatchSubcommand(g,v,k){const A=this._findCommand(g);A||this.help({error:!0}),A._prepareForParse();let T;return T=this._chainOrCallSubCommandHook(T,A,"preSubcommand"),T=this._chainOrCall(T,()=>{if(A._executableHandler)this._executeSubCommand(A,v.concat(k));else return A._parseCommand(v,k)}),T}_dispatchHelpCommand(g){g||this.help();const v=this._findCommand(g);return v&&!v._executableHandler&&v.help(),this._dispatchSubcommand(g,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((g,v)=>{g.required&&this.args[v]==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=(k,A,T)=>{let F=A;if(A!==null&&k.parseArg){const U=`error: command-argument value '${A}' is invalid for argument '${k.name()}'.`;F=this._callParseArg(k,A,T,U)}return F};this._checkNumberOfArguments();const v=[];this.registeredArguments.forEach((k,A)=>{let T=k.defaultValue;k.variadic?A<this.args.length?(T=this.args.slice(A),k.parseArg&&(T=T.reduce((F,U)=>g(k,U,F),k.defaultValue))):T===void 0&&(T=[]):A<this.args.length&&(T=this.args[A],k.parseArg&&(T=g(k,T,k.defaultValue))),v[A]=T}),this.processedArgs=v}_chainOrCall(g,v){return g&&g.then&&typeof g.then=="function"?g.then(()=>v()):v()}_chainOrCallHooks(g,v){let k=g;const A=[];return this._getCommandAndAncestors().reverse().filter(T=>T._lifeCycleHooks[v]!==void 0).forEach(T=>{T._lifeCycleHooks[v].forEach(F=>{A.push({hookedCommand:T,callback:F})})}),v==="postAction"&&A.reverse(),A.forEach(T=>{k=this._chainOrCall(k,()=>T.callback(T.hookedCommand,this))}),k}_chainOrCallSubCommandHook(g,v,k){let A=g;return this._lifeCycleHooks[k]!==void 0&&this._lifeCycleHooks[k].forEach(T=>{A=this._chainOrCall(A,()=>T(this,v))}),A}_parseCommand(g,v){const k=this.parseOptions(v);if(this._parseOptionsEnv(),this._parseOptionsImplied(),g=g.concat(k.operands),v=k.unknown,this.args=g.concat(v),g&&this._findCommand(g[0]))return this._dispatchSubcommand(g[0],g.slice(1),v);if(this._getHelpCommand()&&g[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(g[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(v),this._dispatchSubcommand(this._defaultCommandName,g,v);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(k.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const A=()=>{k.unknown.length>0&&this.unknownOption(k.unknown[0])},T=`command:${this.name()}`;if(this._actionHandler){A(),this._processArguments();let F;return F=this._chainOrCallHooks(F,"preAction"),F=this._chainOrCall(F,()=>this._actionHandler(this.processedArgs)),this.parent&&(F=this._chainOrCall(F,()=>{this.parent.emit(T,g,v)})),F=this._chainOrCallHooks(F,"postAction"),F}if(this.parent&&this.parent.listenerCount(T))A(),this._processArguments(),this.parent.emit(T,g,v);else if(g.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",g,v);this.listenerCount("command:*")?this.emit("command:*",g,v):this.commands.length?this.unknownCommand():(A(),this._processArguments())}else this.commands.length?(A(),this.help({error:!0})):(A(),this._processArguments())}_findCommand(g){if(g)return this.commands.find(v=>v._name===g||v._aliases.includes(g))}_findOption(g){return this.options.find(v=>v.is(g))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(g=>{g.options.forEach(v=>{v.mandatory&&g.getOptionValue(v.attributeName())===void 0&&g.missingMandatoryOptionValue(v)})})}_checkForConflictingLocalOptions(){const g=this.options.filter(k=>{const A=k.attributeName();return this.getOptionValue(A)===void 0?!1:this.getOptionValueSource(A)!=="default"});g.filter(k=>k.conflictsWith.length>0).forEach(k=>{const A=g.find(T=>k.conflictsWith.includes(T.attributeName()));A&&this._conflictingOption(k,A)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(g=>{g._checkForConflictingLocalOptions()})}parseOptions(g){const v=[],k=[];let A=v;const T=g.slice();function F(W){return W.length>1&&W[0]==="-"}let U=null;for(;T.length;){const W=T.shift();if(W==="--"){A===k&&A.push(W),A.push(...T);break}if(U&&!F(W)){this.emit(`option:${U.name()}`,W);continue}if(U=null,F(W)){const ee=this._findOption(W);if(ee){if(ee.required){const te=T.shift();te===void 0&&this.optionMissingArgument(ee),this.emit(`option:${ee.name()}`,te)}else if(ee.optional){let te=null;T.length>0&&!F(T[0])&&(te=T.shift()),this.emit(`option:${ee.name()}`,te)}else this.emit(`option:${ee.name()}`);U=ee.variadic?ee:null;continue}}if(W.length>2&&W[0]==="-"&&W[1]!=="-"){const ee=this._findOption(`-${W[1]}`);if(ee){ee.required||ee.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${ee.name()}`,W.slice(2)):(this.emit(`option:${ee.name()}`),T.unshift(`-${W.slice(2)}`));continue}}if(/^--[^=]+=/.test(W)){const ee=W.indexOf("="),te=this._findOption(W.slice(0,ee));if(te&&(te.required||te.optional)){this.emit(`option:${te.name()}`,W.slice(ee+1));continue}}if(F(W)&&(A=k),(this._enablePositionalOptions||this._passThroughOptions)&&v.length===0&&k.length===0){if(this._findCommand(W)){v.push(W),T.length>0&&k.push(...T);break}else if(this._getHelpCommand()&&W===this._getHelpCommand().name()){v.push(W),T.length>0&&v.push(...T);break}else if(this._defaultCommandName){k.push(W),T.length>0&&k.push(...T);break}}if(this._passThroughOptions){A.push(W),T.length>0&&A.push(...T);break}A.push(W)}return{operands:v,unknown:k}}opts(){if(this._storeOptionsAsProperties){const g={},v=this.options.length;for(let k=0;k<v;k++){const A=this.options[k].attributeName();g[A]=A===this._versionOptionName?this._version:this[A]}return g}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((g,v)=>Object.assign(g,v.opts()),{})}error(g,v){this._outputConfiguration.outputError(`${g}
|
|
21
21
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
22
22
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
23
|
-
`),this.outputHelp({error:!0}));const k=v||{},
|
|
24
|
-
`),this._exit(0,"commander.version",g)}),this}description(g,v){return g===void 0&&v===void 0?this._description:(this._description=g,v&&(this._argsDescription=v),this)}summary(g){return g===void 0?this._summary:(this._summary=g,this)}alias(g){if(g===void 0)return this._aliases[0];let v=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(v=this.commands[this.commands.length-1]),g===v._name)throw new Error("Command alias can't be the same as its name");const k=this.parent?._findCommand(g);if(k){const
|
|
25
|
-
Expecting one of '${k.join("', '")}'`);const
|
|
26
|
-
`)}),this}_outputHelpIfRequested(g){const v=this._getHelpOption();v&&g.find(T=>v.is(T))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function S(N){return N.map(g=>{if(!g.startsWith("--inspect"))return g;let v,k="127.0.0.1",T="9229",A;return(A=g.match(/^(--inspect(-brk)?)$/))!==null?v=A[1]:(A=g.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(v=A[1],/^\d+$/.test(A[3])?T=A[3]:k=A[3]):(A=g.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(v=A[1],k=A[3],T=A[4]),v&&T!=="0"?`${v}=${k}:${parseInt(T)+1}`:g})}function E(){if(i.env.NO_COLOR||i.env.FORCE_COLOR==="0"||i.env.FORCE_COLOR==="false")return!1;if(i.env.FORCE_COLOR||i.env.CLICOLOR_FORCE!==void 0)return!0}return Ko.Command=_,Ko.useColor=E,Ko}var pm;function HC(){if(pm)return Mt;pm=1;const{Argument:n}=cc(),{Command:e}=$C(),{CommanderError:t,InvalidArgumentError:r}=qo(),{Help:i}=um(),{Option:s}=fm();return Mt.program=new e,Mt.createCommand=a=>new e(a),Mt.createOption=(a,u)=>new s(a,u),Mt.createArgument=(a,u)=>new n(a,u),Mt.Command=e,Mt.Option=s,Mt.Argument=n,Mt.Help=i,Mt.CommanderError=t,Mt.InvalidArgumentError=r,Mt.InvalidOptionArgumentError=r,Mt}var WC=HC(),VC=BC(WC);const{program:MN,createCommand:IN,createArgument:NN,createOption:RN,CommanderError:LN,InvalidArgumentError:PN,InvalidOptionArgumentError:DN,Command:UC,Argument:FN,Option:BN,Help:zN}=VC;function qC(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const cs=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const mi=()=>{},KC=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),ar=Object.assign,GC=Object.prototype.hasOwnProperty,hc=(n,e)=>GC.call(n,e),Fe=Array.isArray,gi=n=>jo(n)==="[object Map]",JC=n=>jo(n)==="[object Set]",Qe=n=>typeof n=="function",Ln=n=>typeof n=="string",fs=n=>typeof n=="symbol",gt=n=>n!==null&&typeof n=="object",jC=n=>(gt(n)||Qe(n))&&Qe(n.then)&&Qe(n.catch),YC=Object.prototype.toString,jo=n=>YC.call(n),mm=n=>jo(n).slice(8,-1),XC=n=>jo(n)==="[object Object]",dc=n=>Ln(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,ZC=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},QC=ZC(n=>n.charAt(0).toUpperCase()+n.slice(1)),lr=(n,e)=>!Object.is(n,e);let gm;const Yo=()=>gm||(gm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function pc(n){if(Fe(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Ln(r)?rE(r):pc(r);if(i)for(const s in i)e[s]=i[s]}return e}else if(Ln(n)||gt(n))return n}const eE=/;(?![^(]*\))/g,tE=/:([^]+)/,nE=/\/\*[^]*?\*\//g;function rE(n){const e={};return n.replace(nE,"").split(eE).forEach(t=>{if(t){const r=t.split(tE);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function mc(n){let e="";if(Ln(n))e=n;else if(Fe(n))for(let t=0;t<n.length;t++){const r=mc(n[t]);r&&(e+=r+" ")}else if(gt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Pn(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let we;const gc=new WeakSet;class iE{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,gc.has(this)&&(gc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||bm(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,xm(this),_m(this);const e=we,t=sn;we=this,sn=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&we!==this&&Pn("Active effect was not restored correctly - this is likely a Vue internal bug."),wm(this),we=e,sn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)wc(e);this.deps=this.depsTail=void 0,xm(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?gc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){_c(this)&&this.run()}get dirty(){return _c(this)}}let ym=0,hs,ds;function bm(n,e=!1){if(n.flags|=8,e){n.next=ds,ds=n;return}n.next=hs,hs=n}function yc(){ym++}function bc(){if(--ym>0)return;if(ds){let e=ds;for(ds=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;hs;){let e=hs;for(hs=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 _m(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function wm(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),wc(r),sE(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function _c(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(vm(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function vm(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===ps))return;n.globalVersion=ps;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!_c(n)){n.flags&=-3;return}const t=we,r=sn;we=n,sn=!0;try{_m(n);const i=n.fn(n._value);(e.version===0||lr(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{we=t,sn=r,wm(n),n.flags&=-3}}function wc(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 s=t.computed.deps;s;s=s.nextDep)wc(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function sE(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let sn=!0;const Sm=[];function Xo(){Sm.push(sn),sn=!1}function Zo(){const n=Sm.pop();sn=n===void 0?!0:n}function xm(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=we;we=void 0;try{e()}finally{we=t}}}let ps=0,oE=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 vc{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(!we||!sn||we===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==we)t=this.activeLink=new oE(we,this),we.deps?(t.prevDep=we.depsTail,we.depsTail.nextDep=t,we.depsTail=t):we.deps=we.depsTail=t,Cm(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=we.depsTail,t.nextDep=void 0,we.depsTail.nextDep=t,we.depsTail=t,we.deps===t&&(we.deps=r)}return process.env.NODE_ENV!=="production"&&we.onTrack&&we.onTrack(ar({effect:we},e)),t}trigger(e){this.version++,ps++,this.notify(e)}notify(e){yc();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(ar({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{bc()}}}function Cm(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)Cm(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 Qo=new WeakMap,Br=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Sc=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),ms=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function yt(n,e,t){if(sn&&we){let r=Qo.get(n);r||Qo.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new vc),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function ur(n,e,t,r,i,s){const a=Qo.get(n);if(!a){ps++;return}const u=c=>{c&&(process.env.NODE_ENV!=="production"?c.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:s}):c.trigger())};if(yc(),e==="clear")a.forEach(u);else{const c=Fe(n),h=c&&dc(t);if(c&&t==="length"){const p=Number(r);a.forEach((m,y)=>{(y==="length"||y===ms||!fs(y)&&y>=p)&&u(m)})}else switch((t!==void 0||a.has(void 0))&&u(a.get(t)),h&&u(a.get(ms)),e){case"add":c?h&&u(a.get("length")):(u(a.get(Br)),gi(n)&&u(a.get(Sc)));break;case"delete":c||(u(a.get(Br)),gi(n)&&u(a.get(Sc)));break;case"set":gi(n)&&u(a.get(Br));break}}bc()}function aE(n,e){const t=Qo.get(n);return t&&t.get(e)}function yi(n){const e=he(n);return e===n?e:(yt(e,"iterate",ms),bt(n)?e:e.map(at))}function xc(n){return yt(n=he(n),"iterate",ms),n}const lE={__proto__:null,[Symbol.iterator](){return Cc(this,Symbol.iterator,at)},concat(...n){return yi(this).concat(...n.map(e=>Fe(e)?yi(e):e))},entries(){return Cc(this,"entries",n=>(n[1]=at(n[1]),n))},every(n,e){return Dn(this,"every",n,e,void 0,arguments)},filter(n,e){return Dn(this,"filter",n,e,t=>t.map(at),arguments)},find(n,e){return Dn(this,"find",n,e,at,arguments)},findIndex(n,e){return Dn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Dn(this,"findLast",n,e,at,arguments)},findLastIndex(n,e){return Dn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Dn(this,"forEach",n,e,void 0,arguments)},includes(...n){return Ec(this,"includes",n)},indexOf(...n){return Ec(this,"indexOf",n)},join(n){return yi(this).join(n)},lastIndexOf(...n){return Ec(this,"lastIndexOf",n)},map(n,e){return Dn(this,"map",n,e,void 0,arguments)},pop(){return gs(this,"pop")},push(...n){return gs(this,"push",n)},reduce(n,...e){return Em(this,"reduce",n,e)},reduceRight(n,...e){return Em(this,"reduceRight",n,e)},shift(){return gs(this,"shift")},some(n,e){return Dn(this,"some",n,e,void 0,arguments)},splice(...n){return gs(this,"splice",n)},toReversed(){return yi(this).toReversed()},toSorted(n){return yi(this).toSorted(n)},toSpliced(...n){return yi(this).toSpliced(...n)},unshift(...n){return gs(this,"unshift",n)},values(){return Cc(this,"values",at)}};function Cc(n,e,t){const r=xc(n),i=r[e]();return r!==n&&!bt(n)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.value&&(s.value=t(s.value)),s}),i}const uE=Array.prototype;function Dn(n,e,t,r,i,s){const a=xc(n),u=a!==n&&!bt(n),c=a[e];if(c!==uE[e]){const m=c.apply(n,s);return u?at(m):m}let h=t;a!==n&&(u?h=function(m,y){return t.call(this,at(m),y,n)}:t.length>2&&(h=function(m,y){return t.call(this,m,y,n)}));const p=c.call(a,h,r);return u&&i?i(p):p}function Em(n,e,t,r){const i=xc(n);let s=t;return i!==n&&(bt(n)?t.length>3&&(s=function(a,u,c){return t.call(this,a,u,c,n)}):s=function(a,u,c){return t.call(this,a,at(u),c,n)}),i[e](s,...r)}function Ec(n,e,t){const r=he(n);yt(r,"iterate",ms);const i=r[e](...t);return(i===-1||i===!1)&&na(t[0])?(t[0]=he(t[0]),r[e](...t)):i}function gs(n,e,t=[]){Xo(),yc();const r=he(n)[e].apply(n,t);return bc(),Zo(),r}const cE=qC("__proto__,__v_isRef,__isVue"),km=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(fs));function fE(n){fs(n)||(n=String(n));const e=he(this);return yt(e,"has",n),e.hasOwnProperty(n)}class Tm{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return s;if(t==="__v_raw")return r===(i?s?vE:Im:s?wE:Mm).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=Fe(e);if(!i){let c;if(a&&(c=lE[t]))return c;if(t==="hasOwnProperty")return fE}const u=Reflect.get(e,t,lt(e)?e:r);return(fs(t)?km.has(t):cE(t))||(i||yt(e,"get",t),s)?u:lt(u)?a&&dc(t)?u:u.value:gt(u)?i?Nm(u):Tc(u):u}}class hE extends Tm{constructor(e=!1){super(!1,e)}set(e,t,r,i){let s=e[t];if(!this._isShallow){const c=Fn(s);if(!bt(r)&&!Fn(r)&&(s=he(s),r=he(r)),!Fe(e)&<(s)&&!lt(r))return c?!1:(s.value=r,!0)}const a=Fe(e)&&dc(t)?Number(t)<e.length:hc(e,t),u=Reflect.set(e,t,r,lt(e)?e:i);return e===he(i)&&(a?lr(r,s)&&ur(e,"set",t,r,s):ur(e,"add",t,r)),u}deleteProperty(e,t){const r=hc(e,t),i=e[t],s=Reflect.deleteProperty(e,t);return s&&r&&ur(e,"delete",t,void 0,i),s}has(e,t){const r=Reflect.has(e,t);return(!fs(t)||!km.has(t))&&yt(e,"has",t),r}ownKeys(e){return yt(e,"iterate",Fe(e)?"length":Br),Reflect.ownKeys(e)}}class dE extends Tm{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Pn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Pn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const pE=new hE,mE=new dE,kc=n=>n,ea=n=>Reflect.getPrototypeOf(n);function gE(n,e,t){return function(...r){const i=this.__v_raw,s=he(i),a=gi(s),u=n==="entries"||n===Symbol.iterator&&a,c=n==="keys"&&a,h=i[n](...r),p=t?kc:e?Ac:at;return!e&&yt(s,"iterate",c?Sc:Br),{next(){const{value:m,done:y}=h.next();return y?{value:m,done:y}:{value:u?[p(m[0]),p(m[1])]:p(m),done:y}},[Symbol.iterator](){return this}}}}function ta(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Pn(`${QC(n)} operation ${t}failed: target is readonly.`,he(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function yE(n,e){const t={get(i){const s=this.__v_raw,a=he(s),u=he(i);n||(lr(i,u)&&yt(a,"get",i),yt(a,"get",u));const{has:c}=ea(a),h=e?kc:n?Ac:at;if(c.call(a,i))return h(s.get(i));if(c.call(a,u))return h(s.get(u));s!==a&&s.get(i)},get size(){const i=this.__v_raw;return!n&&yt(he(i),"iterate",Br),Reflect.get(i,"size",i)},has(i){const s=this.__v_raw,a=he(s),u=he(i);return n||(lr(i,u)&&yt(a,"has",i),yt(a,"has",u)),i===u?s.has(i):s.has(i)||s.has(u)},forEach(i,s){const a=this,u=a.__v_raw,c=he(u),h=e?kc:n?Ac:at;return!n&&yt(c,"iterate",Br),u.forEach((p,m)=>i.call(s,h(p),h(m),a))}};return ar(t,n?{add:ta("add"),set:ta("set"),delete:ta("delete"),clear:ta("clear")}:{add(i){!e&&!bt(i)&&!Fn(i)&&(i=he(i));const s=he(this);return ea(s).has.call(s,i)||(s.add(i),ur(s,"add",i,i)),this},set(i,s){!e&&!bt(s)&&!Fn(s)&&(s=he(s));const a=he(this),{has:u,get:c}=ea(a);let h=u.call(a,i);h?process.env.NODE_ENV!=="production"&&Om(a,u,i):(i=he(i),h=u.call(a,i));const p=c.call(a,i);return a.set(i,s),h?lr(s,p)&&ur(a,"set",i,s,p):ur(a,"add",i,s),this},delete(i){const s=he(this),{has:a,get:u}=ea(s);let c=a.call(s,i);c?process.env.NODE_ENV!=="production"&&Om(s,a,i):(i=he(i),c=a.call(s,i));const h=u?u.call(s,i):void 0,p=s.delete(i);return c&&ur(s,"delete",i,void 0,h),p},clear(){const i=he(this),s=i.size!==0,a=process.env.NODE_ENV!=="production"?gi(i)?new Map(i):new Set(i):void 0,u=i.clear();return s&&ur(i,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=gE(i,n,e)}),t}function Am(n,e){const t=yE(n,e);return(r,i,s)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(hc(t,i)&&i in r?t:r,i,s)}const bE={get:Am(!1,!1)},_E={get:Am(!0,!1)};function Om(n,e,t){const r=he(t);if(r!==t&&e.call(n,r)){const i=mm(n);Pn(`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 Mm=new WeakMap,wE=new WeakMap,Im=new WeakMap,vE=new WeakMap;function SE(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xE(n){return n.__v_skip||!Object.isExtensible(n)?0:SE(mm(n))}function Tc(n){return Fn(n)?n:Rm(n,!1,pE,bE,Mm)}function Nm(n){return Rm(n,!0,mE,_E,Im)}function Rm(n,e,t,r,i){if(!gt(n))return process.env.NODE_ENV!=="production"&&Pn(`value cannot be made ${e?"readonly":"reactive"}: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const s=i.get(n);if(s)return s;const a=xE(n);if(a===0)return n;const u=new Proxy(n,a===2?r:t);return i.set(n,u),u}function ys(n){return Fn(n)?ys(n.__v_raw):!!(n&&n.__v_isReactive)}function Fn(n){return!!(n&&n.__v_isReadonly)}function bt(n){return!!(n&&n.__v_isShallow)}function na(n){return n?!!n.__v_raw:!1}function he(n){const e=n&&n.__v_raw;return e?he(e):n}const at=n=>gt(n)?Tc(n):n,Ac=n=>gt(n)?Nm(n):n;function lt(n){return n?n.__v_isRef===!0:!1}function ra(n){return CE(n,!1)}function CE(n,e){return lt(n)?n:new EE(n,e)}class EE{constructor(e,t){this.dep=new vc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:he(e),this._value=t?e:at(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||bt(e)||Fn(e);e=r?e:he(e),lr(e,t)&&(this._rawValue=e,this._value=r?e:at(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function V(n){return lt(n)?n.value:n}class kE{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 aE(he(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 bi(n,e,t){return lt(n)?n:Qe(n)?new TE(n):gt(n)&&arguments.length>1?AE(n,e,t):ra(n)}function AE(n,e,t){const r=n[e];return lt(r)?r:new kE(n,e,t)}class OE{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new vc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ps-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&we!==this)return bm(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 vm(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&Pn("Write operation failed: computed value is readonly")}}function ME(n,e,t=!1){let r,i;Qe(n)?r=n:(r=n.get,i=n.set);const s=new OE(r,i,t);return process.env.NODE_ENV,s}const ia={},sa=new WeakMap;let zr;function IE(n,e=!1,t=zr){if(t){let r=sa.get(t);r||sa.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Pn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function NE(n,e,t=cs){const{immediate:r,deep:i,once:s,scheduler:a,augmentJob:u,call:c}=t,h=T=>{(t.onWarn||Pn)("Invalid watch source: ",T,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},p=T=>i?T:bt(T)||i===!1||i===0?cr(T,1):cr(T);let m,y,_,S,E=!1,N=!1;if(lt(n)?(y=()=>n.value,E=bt(n)):ys(n)?(y=()=>p(n),E=!0):Fe(n)?(N=!0,E=n.some(T=>ys(T)||bt(T)),y=()=>n.map(T=>{if(lt(T))return T.value;if(ys(T))return p(T);if(Qe(T))return c?c(T,2):T();process.env.NODE_ENV!=="production"&&h(T)})):Qe(n)?e?y=c?()=>c(n,2):n:y=()=>{if(_){Xo();try{_()}finally{Zo()}}const T=zr;zr=m;try{return c?c(n,3,[S]):n(S)}finally{zr=T}}:(y=mi,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const T=y,A=i===!0?1/0:i;y=()=>cr(T(),A)}const g=()=>{m.stop()};if(s&&e){const T=e;e=(...A)=>{T(...A),g()}}let v=N?new Array(n.length).fill(ia):ia;const k=T=>{if(!(!(m.flags&1)||!m.dirty&&!T))if(e){const A=m.run();if(i||E||(N?A.some((F,U)=>lr(F,v[U])):lr(A,v))){_&&_();const F=zr;zr=m;try{const U=[A,v===ia?void 0:N&&v[0]===ia?[]:v,S];c?c(e,3,U):e(...U),v=A}finally{zr=F}}}else m.run()};return u&&u(k),m=new iE(y),m.scheduler=a?()=>a(k,!1):k,S=T=>IE(T,!1,m),_=m.onStop=()=>{const T=sa.get(m);if(T){if(c)c(T,4);else for(const A of T)A();sa.delete(m)}},process.env.NODE_ENV!=="production"&&(m.onTrack=t.onTrack,m.onTrigger=t.onTrigger),e?r?k(!0):v=m.run():a?a(k.bind(null,!0),!0):m.run(),g.pause=m.pause.bind(m),g.resume=m.resume.bind(m),g.stop=g,g}function cr(n,e=1/0,t){if(e<=0||!gt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,lt(n))cr(n.value,e,t);else if(Fe(n))for(let r=0;r<n.length;r++)cr(n[r],e,t);else if(JC(n)||gi(n))n.forEach(r=>{cr(r,e,t)});else if(XC(n)){for(const r in n)cr(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&cr(n[r],e,t)}return n}const $r=[];function RE(n){$r.push(n)}function LE(){$r.pop()}let Oc=!1;function ut(n,...e){if(Oc)return;Oc=!0,Xo();const t=$r.length?$r[$r.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=PE();if(r)oa(r,t,11,[n+e.map(s=>{var a,u;return(u=(a=s.toString)==null?void 0:a.call(s))!=null?u:JSON.stringify(s)}).join(""),t&&t.proxy,i.map(({vnode:s})=>`at <${Xm(t,s.type)}>`).join(`
|
|
23
|
+
`),this.outputHelp({error:!0}));const k=v||{},A=k.exitCode||1,T=k.code||"commander.error";this._exit(A,T,g)}_parseOptionsEnv(){this.options.forEach(g=>{if(g.envVar&&g.envVar in i.env){const v=g.attributeName();(this.getOptionValue(v)===void 0||["default","config","env"].includes(this.getOptionValueSource(v)))&&(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),v=k=>this.getOptionValue(k)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(k));this.options.filter(k=>k.implied!==void 0&&v(k.attributeName())&&g.valueFromOption(this.getOptionValue(k.attributeName()),k)).forEach(k=>{Object.keys(k.implied).filter(A=>!v(A)).forEach(A=>{this.setOptionValueWithSource(A,k.implied[A],"implied")})})}missingArgument(g){const v=`error: missing required argument '${g}'`;this.error(v,{code:"commander.missingArgument"})}optionMissingArgument(g){const v=`error: option '${g.flags}' argument missing`;this.error(v,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(g){const v=`error: required option '${g.flags}' not specified`;this.error(v,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(g,v){const k=F=>{const U=F.attributeName(),W=this.getOptionValue(U),ee=this.options.find(Se=>Se.negate&&U===Se.attributeName()),te=this.options.find(Se=>!Se.negate&&U===Se.attributeName());return ee&&(ee.presetArg===void 0&&W===!1||ee.presetArg!==void 0&&W===ee.presetArg)?ee:te||F},A=F=>{const U=k(F),W=U.attributeName();return this.getOptionValueSource(W)==="env"?`environment variable '${U.envVar}'`:`option '${U.flags}'`},T=`error: ${A(g)} cannot be used with ${A(v)}`;this.error(T,{code:"commander.conflictingOption"})}unknownOption(g){if(this._allowUnknownOption)return;let v="";if(g.startsWith("--")&&this._showSuggestionAfterError){let A=[],T=this;do{const F=T.createHelp().visibleOptions(T).filter(U=>U.long).map(U=>U.long);A=A.concat(F),T=T.parent}while(T&&!T._enablePositionalOptions);v=y(g,A)}const k=`error: unknown option '${g}'${v}`;this.error(k,{code:"commander.unknownOption"})}_excessArguments(g){if(this._allowExcessArguments)return;const v=this.registeredArguments.length,k=v===1?"":"s",T=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${v} argument${k} but got ${g.length}.`;this.error(T,{code:"commander.excessArguments"})}unknownCommand(){const g=this.args[0];let v="";if(this._showSuggestionAfterError){const A=[];this.createHelp().visibleCommands(this).forEach(T=>{A.push(T.name()),T.alias()&&A.push(T.alias())}),v=y(g,A)}const k=`error: unknown command '${g}'${v}`;this.error(k,{code:"commander.unknownCommand"})}version(g,v,k){if(g===void 0)return this._version;this._version=g,v=v||"-V, --version",k=k||"output the version number";const A=this.createOption(v,k);return this._versionOptionName=A.attributeName(),this._registerOption(A),this.on("option:"+A.name(),()=>{this._outputConfiguration.writeOut(`${g}
|
|
24
|
+
`),this._exit(0,"commander.version",g)}),this}description(g,v){return g===void 0&&v===void 0?this._description:(this._description=g,v&&(this._argsDescription=v),this)}summary(g){return g===void 0?this._summary:(this._summary=g,this)}alias(g){if(g===void 0)return this._aliases[0];let v=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(v=this.commands[this.commands.length-1]),g===v._name)throw new Error("Command alias can't be the same as its name");const k=this.parent?._findCommand(g);if(k){const A=[k.name()].concat(k.aliases()).join("|");throw new Error(`cannot add alias '${g}' to command '${this.name()}' as already have command '${A}'`)}return v._aliases.push(g),this}aliases(g){return g===void 0?this._aliases:(g.forEach(v=>this.alias(v)),this)}usage(g){if(g===void 0){if(this._usage)return this._usage;const v=this.registeredArguments.map(k=>a(k));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?v:[]).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 v=this.createHelp(),k=this._getOutputContext(g);v.prepareContext({error:k.error,helpWidth:k.helpWidth,outputHasColors:k.hasColors});const A=v.formatHelp(this,v);return k.hasColors?A:this._outputConfiguration.stripColor(A)}_getOutputContext(g){g=g||{};const v=!!g.error;let k,A,T;return v?(k=U=>this._outputConfiguration.writeErr(U),A=this._outputConfiguration.getErrHasColors(),T=this._outputConfiguration.getErrHelpWidth()):(k=U=>this._outputConfiguration.writeOut(U),A=this._outputConfiguration.getOutHasColors(),T=this._outputConfiguration.getOutHelpWidth()),{error:v,write:U=>(A||(U=this._outputConfiguration.stripColor(U)),k(U)),hasColors:A,helpWidth:T}}outputHelp(g){let v;typeof g=="function"&&(v=g,g=void 0);const k=this._getOutputContext(g),A={error:k.error,write:k.write,command:this};this._getCommandAndAncestors().reverse().forEach(F=>F.emit("beforeAllHelp",A)),this.emit("beforeHelp",A);let T=this.helpInformation({error:k.error});if(v&&(T=v(T),typeof T!="string"&&!Buffer.isBuffer(T)))throw new Error("outputHelp callback must return a string or a Buffer");k.write(T),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",A),this._getCommandAndAncestors().forEach(F=>F.emit("afterAllHelp",A))}helpOption(g,v){return typeof g=="boolean"?(g?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(g=g??"-h, --help",v=v??"display help for command",this._helpOption=this.createOption(g,v),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 v=Number(i.exitCode??0);v===0&&g&&typeof g!="function"&&g.error&&(v=1),this._exit(v,"commander.help","(outputHelp)")}addHelpText(g,v){const k=["beforeAll","before","after","afterAll"];if(!k.includes(g))throw new Error(`Unexpected value for position to addHelpText.
|
|
25
|
+
Expecting one of '${k.join("', '")}'`);const A=`${g}Help`;return this.on(A,T=>{let F;typeof v=="function"?F=v({error:T.error,command:T.command}):F=v,F&&T.write(`${F}
|
|
26
|
+
`)}),this}_outputHelpIfRequested(g){const v=this._getHelpOption();v&&g.find(A=>v.is(A))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function S(N){return N.map(g=>{if(!g.startsWith("--inspect"))return g;let v,k="127.0.0.1",A="9229",T;return(T=g.match(/^(--inspect(-brk)?)$/))!==null?v=T[1]:(T=g.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(v=T[1],/^\d+$/.test(T[3])?A=T[3]:k=T[3]):(T=g.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(v=T[1],k=T[3],A=T[4]),v&&A!=="0"?`${v}=${k}:${parseInt(A)+1}`:g})}function E(){if(i.env.NO_COLOR||i.env.FORCE_COLOR==="0"||i.env.FORCE_COLOR==="false")return!1;if(i.env.FORCE_COLOR||i.env.CLICOLOR_FORCE!==void 0)return!0}return Go.Command=_,Go.useColor=E,Go}var pm;function HC(){if(pm)return Mt;pm=1;const{Argument:n}=cc(),{Command:e}=$C(),{CommanderError:t,InvalidArgumentError:r}=Ko(),{Help:i}=um(),{Option:s}=fm();return Mt.program=new e,Mt.createCommand=a=>new e(a),Mt.createOption=(a,u)=>new s(a,u),Mt.createArgument=(a,u)=>new n(a,u),Mt.Command=e,Mt.Option=s,Mt.Argument=n,Mt.Help=i,Mt.CommanderError=t,Mt.InvalidArgumentError=r,Mt.InvalidOptionArgumentError=r,Mt}var WC=HC(),VC=BC(WC);const{program:MN,createCommand:IN,createArgument:NN,createOption:RN,CommanderError:LN,InvalidArgumentError:PN,InvalidOptionArgumentError:DN,Command:UC,Argument:FN,Option:BN,Help:zN}=VC;function qC(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const fs=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const mi=()=>{},KC=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),ar=Object.assign,GC=Object.prototype.hasOwnProperty,hc=(n,e)=>GC.call(n,e),Fe=Array.isArray,gi=n=>Yo(n)==="[object Map]",JC=n=>Yo(n)==="[object Set]",Qe=n=>typeof n=="function",Ln=n=>typeof n=="string",hs=n=>typeof n=="symbol",gt=n=>n!==null&&typeof n=="object",jC=n=>(gt(n)||Qe(n))&&Qe(n.then)&&Qe(n.catch),YC=Object.prototype.toString,Yo=n=>YC.call(n),mm=n=>Yo(n).slice(8,-1),XC=n=>Yo(n)==="[object Object]",dc=n=>Ln(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,ZC=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},QC=ZC(n=>n.charAt(0).toUpperCase()+n.slice(1)),lr=(n,e)=>!Object.is(n,e);let gm;const Xo=()=>gm||(gm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function pc(n){if(Fe(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Ln(r)?rE(r):pc(r);if(i)for(const s in i)e[s]=i[s]}return e}else if(Ln(n)||gt(n))return n}const eE=/;(?![^(]*\))/g,tE=/:([^]+)/,nE=/\/\*[^]*?\*\//g;function rE(n){const e={};return n.replace(nE,"").split(eE).forEach(t=>{if(t){const r=t.split(tE);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function mc(n){let e="";if(Ln(n))e=n;else if(Fe(n))for(let t=0;t<n.length;t++){const r=mc(n[t]);r&&(e+=r+" ")}else if(gt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Pn(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let we;const gc=new WeakSet;class iE{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,gc.has(this)&&(gc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||bm(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,xm(this),_m(this);const e=we,t=sn;we=this,sn=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&we!==this&&Pn("Active effect was not restored correctly - this is likely a Vue internal bug."),wm(this),we=e,sn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)wc(e);this.deps=this.depsTail=void 0,xm(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?gc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){_c(this)&&this.run()}get dirty(){return _c(this)}}let ym=0,ds,ps;function bm(n,e=!1){if(n.flags|=8,e){n.next=ps,ps=n;return}n.next=ds,ds=n}function yc(){ym++}function bc(){if(--ym>0)return;if(ps){let e=ps;for(ps=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;ds;){let e=ds;for(ds=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 _m(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function wm(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),wc(r),sE(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function _c(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(vm(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function vm(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===ms))return;n.globalVersion=ms;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!_c(n)){n.flags&=-3;return}const t=we,r=sn;we=n,sn=!0;try{_m(n);const i=n.fn(n._value);(e.version===0||lr(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{we=t,sn=r,wm(n),n.flags&=-3}}function wc(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 s=t.computed.deps;s;s=s.nextDep)wc(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function sE(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let sn=!0;const Sm=[];function Zo(){Sm.push(sn),sn=!1}function Qo(){const n=Sm.pop();sn=n===void 0?!0:n}function xm(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=we;we=void 0;try{e()}finally{we=t}}}let ms=0,oE=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 vc{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(!we||!sn||we===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==we)t=this.activeLink=new oE(we,this),we.deps?(t.prevDep=we.depsTail,we.depsTail.nextDep=t,we.depsTail=t):we.deps=we.depsTail=t,Cm(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=we.depsTail,t.nextDep=void 0,we.depsTail.nextDep=t,we.depsTail=t,we.deps===t&&(we.deps=r)}return process.env.NODE_ENV!=="production"&&we.onTrack&&we.onTrack(ar({effect:we},e)),t}trigger(e){this.version++,ms++,this.notify(e)}notify(e){yc();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(ar({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{bc()}}}function Cm(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)Cm(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,Br=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Sc=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),gs=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function yt(n,e,t){if(sn&&we){let r=ea.get(n);r||ea.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new vc),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function ur(n,e,t,r,i,s){const a=ea.get(n);if(!a){ms++;return}const u=c=>{c&&(process.env.NODE_ENV!=="production"?c.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:s}):c.trigger())};if(yc(),e==="clear")a.forEach(u);else{const c=Fe(n),h=c&&dc(t);if(c&&t==="length"){const p=Number(r);a.forEach((m,y)=>{(y==="length"||y===gs||!hs(y)&&y>=p)&&u(m)})}else switch((t!==void 0||a.has(void 0))&&u(a.get(t)),h&&u(a.get(gs)),e){case"add":c?h&&u(a.get("length")):(u(a.get(Br)),gi(n)&&u(a.get(Sc)));break;case"delete":c||(u(a.get(Br)),gi(n)&&u(a.get(Sc)));break;case"set":gi(n)&&u(a.get(Br));break}}bc()}function aE(n,e){const t=ea.get(n);return t&&t.get(e)}function yi(n){const e=he(n);return e===n?e:(yt(e,"iterate",gs),bt(n)?e:e.map(at))}function xc(n){return yt(n=he(n),"iterate",gs),n}const lE={__proto__:null,[Symbol.iterator](){return Cc(this,Symbol.iterator,at)},concat(...n){return yi(this).concat(...n.map(e=>Fe(e)?yi(e):e))},entries(){return Cc(this,"entries",n=>(n[1]=at(n[1]),n))},every(n,e){return Dn(this,"every",n,e,void 0,arguments)},filter(n,e){return Dn(this,"filter",n,e,t=>t.map(at),arguments)},find(n,e){return Dn(this,"find",n,e,at,arguments)},findIndex(n,e){return Dn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Dn(this,"findLast",n,e,at,arguments)},findLastIndex(n,e){return Dn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Dn(this,"forEach",n,e,void 0,arguments)},includes(...n){return Ec(this,"includes",n)},indexOf(...n){return Ec(this,"indexOf",n)},join(n){return yi(this).join(n)},lastIndexOf(...n){return Ec(this,"lastIndexOf",n)},map(n,e){return Dn(this,"map",n,e,void 0,arguments)},pop(){return ys(this,"pop")},push(...n){return ys(this,"push",n)},reduce(n,...e){return Em(this,"reduce",n,e)},reduceRight(n,...e){return Em(this,"reduceRight",n,e)},shift(){return ys(this,"shift")},some(n,e){return Dn(this,"some",n,e,void 0,arguments)},splice(...n){return ys(this,"splice",n)},toReversed(){return yi(this).toReversed()},toSorted(n){return yi(this).toSorted(n)},toSpliced(...n){return yi(this).toSpliced(...n)},unshift(...n){return ys(this,"unshift",n)},values(){return Cc(this,"values",at)}};function Cc(n,e,t){const r=xc(n),i=r[e]();return r!==n&&!bt(n)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.value&&(s.value=t(s.value)),s}),i}const uE=Array.prototype;function Dn(n,e,t,r,i,s){const a=xc(n),u=a!==n&&!bt(n),c=a[e];if(c!==uE[e]){const m=c.apply(n,s);return u?at(m):m}let h=t;a!==n&&(u?h=function(m,y){return t.call(this,at(m),y,n)}:t.length>2&&(h=function(m,y){return t.call(this,m,y,n)}));const p=c.call(a,h,r);return u&&i?i(p):p}function Em(n,e,t,r){const i=xc(n);let s=t;return i!==n&&(bt(n)?t.length>3&&(s=function(a,u,c){return t.call(this,a,u,c,n)}):s=function(a,u,c){return t.call(this,a,at(u),c,n)}),i[e](s,...r)}function Ec(n,e,t){const r=he(n);yt(r,"iterate",gs);const i=r[e](...t);return(i===-1||i===!1)&&ra(t[0])?(t[0]=he(t[0]),r[e](...t)):i}function ys(n,e,t=[]){Zo(),yc();const r=he(n)[e].apply(n,t);return bc(),Qo(),r}const cE=qC("__proto__,__v_isRef,__isVue"),km=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(hs));function fE(n){hs(n)||(n=String(n));const e=he(this);return yt(e,"has",n),e.hasOwnProperty(n)}class Am{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return s;if(t==="__v_raw")return r===(i?s?vE:Im:s?wE:Mm).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=Fe(e);if(!i){let c;if(a&&(c=lE[t]))return c;if(t==="hasOwnProperty")return fE}const u=Reflect.get(e,t,lt(e)?e:r);return(hs(t)?km.has(t):cE(t))||(i||yt(e,"get",t),s)?u:lt(u)?a&&dc(t)?u:u.value:gt(u)?i?Nm(u):Ac(u):u}}class hE extends Am{constructor(e=!1){super(!1,e)}set(e,t,r,i){let s=e[t];if(!this._isShallow){const c=Fn(s);if(!bt(r)&&!Fn(r)&&(s=he(s),r=he(r)),!Fe(e)&<(s)&&!lt(r))return c?!1:(s.value=r,!0)}const a=Fe(e)&&dc(t)?Number(t)<e.length:hc(e,t),u=Reflect.set(e,t,r,lt(e)?e:i);return e===he(i)&&(a?lr(r,s)&&ur(e,"set",t,r,s):ur(e,"add",t,r)),u}deleteProperty(e,t){const r=hc(e,t),i=e[t],s=Reflect.deleteProperty(e,t);return s&&r&&ur(e,"delete",t,void 0,i),s}has(e,t){const r=Reflect.has(e,t);return(!hs(t)||!km.has(t))&&yt(e,"has",t),r}ownKeys(e){return yt(e,"iterate",Fe(e)?"length":Br),Reflect.ownKeys(e)}}class dE extends Am{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Pn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Pn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const pE=new hE,mE=new dE,kc=n=>n,ta=n=>Reflect.getPrototypeOf(n);function gE(n,e,t){return function(...r){const i=this.__v_raw,s=he(i),a=gi(s),u=n==="entries"||n===Symbol.iterator&&a,c=n==="keys"&&a,h=i[n](...r),p=t?kc:e?Tc:at;return!e&&yt(s,"iterate",c?Sc:Br),{next(){const{value:m,done:y}=h.next();return y?{value:m,done:y}:{value:u?[p(m[0]),p(m[1])]:p(m),done:y}},[Symbol.iterator](){return this}}}}function na(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Pn(`${QC(n)} operation ${t}failed: target is readonly.`,he(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function yE(n,e){const t={get(i){const s=this.__v_raw,a=he(s),u=he(i);n||(lr(i,u)&&yt(a,"get",i),yt(a,"get",u));const{has:c}=ta(a),h=e?kc:n?Tc:at;if(c.call(a,i))return h(s.get(i));if(c.call(a,u))return h(s.get(u));s!==a&&s.get(i)},get size(){const i=this.__v_raw;return!n&&yt(he(i),"iterate",Br),Reflect.get(i,"size",i)},has(i){const s=this.__v_raw,a=he(s),u=he(i);return n||(lr(i,u)&&yt(a,"has",i),yt(a,"has",u)),i===u?s.has(i):s.has(i)||s.has(u)},forEach(i,s){const a=this,u=a.__v_raw,c=he(u),h=e?kc:n?Tc:at;return!n&&yt(c,"iterate",Br),u.forEach((p,m)=>i.call(s,h(p),h(m),a))}};return ar(t,n?{add:na("add"),set:na("set"),delete:na("delete"),clear:na("clear")}:{add(i){!e&&!bt(i)&&!Fn(i)&&(i=he(i));const s=he(this);return ta(s).has.call(s,i)||(s.add(i),ur(s,"add",i,i)),this},set(i,s){!e&&!bt(s)&&!Fn(s)&&(s=he(s));const a=he(this),{has:u,get:c}=ta(a);let h=u.call(a,i);h?process.env.NODE_ENV!=="production"&&Om(a,u,i):(i=he(i),h=u.call(a,i));const p=c.call(a,i);return a.set(i,s),h?lr(s,p)&&ur(a,"set",i,s,p):ur(a,"add",i,s),this},delete(i){const s=he(this),{has:a,get:u}=ta(s);let c=a.call(s,i);c?process.env.NODE_ENV!=="production"&&Om(s,a,i):(i=he(i),c=a.call(s,i));const h=u?u.call(s,i):void 0,p=s.delete(i);return c&&ur(s,"delete",i,void 0,h),p},clear(){const i=he(this),s=i.size!==0,a=process.env.NODE_ENV!=="production"?gi(i)?new Map(i):new Set(i):void 0,u=i.clear();return s&&ur(i,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=gE(i,n,e)}),t}function Tm(n,e){const t=yE(n,e);return(r,i,s)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(hc(t,i)&&i in r?t:r,i,s)}const bE={get:Tm(!1,!1)},_E={get:Tm(!0,!1)};function Om(n,e,t){const r=he(t);if(r!==t&&e.call(n,r)){const i=mm(n);Pn(`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 Mm=new WeakMap,wE=new WeakMap,Im=new WeakMap,vE=new WeakMap;function SE(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xE(n){return n.__v_skip||!Object.isExtensible(n)?0:SE(mm(n))}function Ac(n){return Fn(n)?n:Rm(n,!1,pE,bE,Mm)}function Nm(n){return Rm(n,!0,mE,_E,Im)}function Rm(n,e,t,r,i){if(!gt(n))return process.env.NODE_ENV!=="production"&&Pn(`value cannot be made ${e?"readonly":"reactive"}: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const s=i.get(n);if(s)return s;const a=xE(n);if(a===0)return n;const u=new Proxy(n,a===2?r:t);return i.set(n,u),u}function bs(n){return Fn(n)?bs(n.__v_raw):!!(n&&n.__v_isReactive)}function Fn(n){return!!(n&&n.__v_isReadonly)}function bt(n){return!!(n&&n.__v_isShallow)}function ra(n){return n?!!n.__v_raw:!1}function he(n){const e=n&&n.__v_raw;return e?he(e):n}const at=n=>gt(n)?Ac(n):n,Tc=n=>gt(n)?Nm(n):n;function lt(n){return n?n.__v_isRef===!0:!1}function ia(n){return CE(n,!1)}function CE(n,e){return lt(n)?n:new EE(n,e)}class EE{constructor(e,t){this.dep=new vc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:he(e),this._value=t?e:at(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||bt(e)||Fn(e);e=r?e:he(e),lr(e,t)&&(this._rawValue=e,this._value=r?e:at(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function V(n){return lt(n)?n.value:n}class kE{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 aE(he(this._object),this._key)}}class AE{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 bi(n,e,t){return lt(n)?n:Qe(n)?new AE(n):gt(n)&&arguments.length>1?TE(n,e,t):ia(n)}function TE(n,e,t){const r=n[e];return lt(r)?r:new kE(n,e,t)}class OE{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new vc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ms-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&we!==this)return bm(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 vm(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&Pn("Write operation failed: computed value is readonly")}}function ME(n,e,t=!1){let r,i;Qe(n)?r=n:(r=n.get,i=n.set);const s=new OE(r,i,t);return process.env.NODE_ENV,s}const sa={},oa=new WeakMap;let zr;function IE(n,e=!1,t=zr){if(t){let r=oa.get(t);r||oa.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Pn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function NE(n,e,t=fs){const{immediate:r,deep:i,once:s,scheduler:a,augmentJob:u,call:c}=t,h=A=>{(t.onWarn||Pn)("Invalid watch source: ",A,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},p=A=>i?A:bt(A)||i===!1||i===0?cr(A,1):cr(A);let m,y,_,S,E=!1,N=!1;if(lt(n)?(y=()=>n.value,E=bt(n)):bs(n)?(y=()=>p(n),E=!0):Fe(n)?(N=!0,E=n.some(A=>bs(A)||bt(A)),y=()=>n.map(A=>{if(lt(A))return A.value;if(bs(A))return p(A);if(Qe(A))return c?c(A,2):A();process.env.NODE_ENV!=="production"&&h(A)})):Qe(n)?e?y=c?()=>c(n,2):n:y=()=>{if(_){Zo();try{_()}finally{Qo()}}const A=zr;zr=m;try{return c?c(n,3,[S]):n(S)}finally{zr=A}}:(y=mi,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const A=y,T=i===!0?1/0:i;y=()=>cr(A(),T)}const g=()=>{m.stop()};if(s&&e){const A=e;e=(...T)=>{A(...T),g()}}let v=N?new Array(n.length).fill(sa):sa;const k=A=>{if(!(!(m.flags&1)||!m.dirty&&!A))if(e){const T=m.run();if(i||E||(N?T.some((F,U)=>lr(F,v[U])):lr(T,v))){_&&_();const F=zr;zr=m;try{const U=[T,v===sa?void 0:N&&v[0]===sa?[]:v,S];c?c(e,3,U):e(...U),v=T}finally{zr=F}}}else m.run()};return u&&u(k),m=new iE(y),m.scheduler=a?()=>a(k,!1):k,S=A=>IE(A,!1,m),_=m.onStop=()=>{const A=oa.get(m);if(A){if(c)c(A,4);else for(const T of A)T();oa.delete(m)}},process.env.NODE_ENV!=="production"&&(m.onTrack=t.onTrack,m.onTrigger=t.onTrigger),e?r?k(!0):v=m.run():a?a(k.bind(null,!0),!0):m.run(),g.pause=m.pause.bind(m),g.resume=m.resume.bind(m),g.stop=g,g}function cr(n,e=1/0,t){if(e<=0||!gt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,lt(n))cr(n.value,e,t);else if(Fe(n))for(let r=0;r<n.length;r++)cr(n[r],e,t);else if(JC(n)||gi(n))n.forEach(r=>{cr(r,e,t)});else if(XC(n)){for(const r in n)cr(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&cr(n[r],e,t)}return n}const $r=[];function RE(n){$r.push(n)}function LE(){$r.pop()}let Oc=!1;function ut(n,...e){if(Oc)return;Oc=!0,Zo();const t=$r.length?$r[$r.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=PE();if(r)aa(r,t,11,[n+e.map(s=>{var a,u;return(u=(a=s.toString)==null?void 0:a.call(s))!=null?u:JSON.stringify(s)}).join(""),t&&t.proxy,i.map(({vnode:s})=>`at <${Xm(t,s.type)}>`).join(`
|
|
27
27
|
`),i]);else{const s=[`[Vue warn]: ${n}`,...e];i.length&&s.push(`
|
|
28
|
-
`,...DE(i)),console.warn(...s)}
|
|
29
|
-
`],...FE(t))}),e}function FE({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Xm(n.component,n.type,r)}`,s=">"+t;return n.props?[i,...BE(n.props),s]:[i+s]}function BE(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...Lm(r,n[r]))}),t.length>3&&e.push(" ..."),e}function Lm(n,e,t){return Ln(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:lt(e)?(e=Lm(n,he(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Qe(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=he(e),t?e:[`${n}=`,e])}const Pm={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 oa(n,e,t,r){try{return r?n(...r):n()}catch(i){Mc(i,e,t)}}function Dm(n,e,t,r){if(Qe(n)){const i=oa(n,e,t,r);return i&&jC(i)&&i.catch(s=>{Mc(s,e,t)}),i}if(Fe(n)){const i=[];for(let s=0;s<n.length;s++)i.push(Dm(n[s],e,t,r));return i}else process.env.NODE_ENV!=="production"&&ut(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Mc(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||cs;if(e){let u=e.parent;const c=e.proxy,h=process.env.NODE_ENV!=="production"?Pm[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;u;){const p=u.ec;if(p){for(let m=0;m<p.length;m++)if(p[m](n,c,h)===!1)return}u=u.parent}if(s){Xo(),oa(s,null,10,[n,c,h]),Zo();return}}zE(n,t,i,r,a)}function zE(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const s=Pm[e];if(t&&RE(t),ut(`Unhandled error${s?` during execution of ${s}`:""}`),t&&LE(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Kt=[];let Bn=-1;const _i=[];let fr=null,wi=0;const $E=Promise.resolve();let Ic=null;const HE=100;function WE(n){let e=Bn+1,t=Kt.length;for(;e<t;){const r=e+t>>>1,i=Kt[r],s=bs(i);s<n||s===n&&i.flags&2?e=r+1:t=r}return e}function Fm(n){if(!(n.flags&1)){const e=bs(n),t=Kt[Kt.length-1];!t||!(n.flags&2)&&e>=bs(t)?Kt.push(n):Kt.splice(WE(e),0,n),n.flags|=1,Bm()}}function Bm(){Ic||(Ic=$E.then($m))}function zm(n){Fe(n)?_i.push(...n):fr&&n.id===-1?fr.splice(wi+1,0,n):n.flags&1||(_i.push(n),n.flags|=1),Bm()}function VE(n){if(_i.length){const e=[...new Set(_i)].sort((t,r)=>bs(t)-bs(r));if(_i.length=0,fr){fr.push(...e);return}for(fr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),wi=0;wi<fr.length;wi++){const t=fr[wi];process.env.NODE_ENV!=="production"&&Hm(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}fr=null,wi=0}}const bs=n=>n.id==null?n.flags&2?-1:1/0:n.id;function $m(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>Hm(n,t):mi;try{for(Bn=0;Bn<Kt.length;Bn++){const t=Kt[Bn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),oa(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Bn<Kt.length;Bn++){const t=Kt[Bn];t&&(t.flags&=-2)}Bn=-1,Kt.length=0,VE(n),Ic=null,(Kt.length||_i.length)&&$m(n)}}function Hm(n,e){const t=n.get(e)||0;if(t>HE){const r=e.i,i=r&&Ym(r.type);return Mc(`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 Nc=new Map;process.env.NODE_ENV!=="production"&&(Yo().__VUE_HMR_RUNTIME__={createRecord:Rc(UE),rerender:Rc(qE),reload:Rc(KE)});const aa=new Map;function UE(n,e){return aa.has(n)?!1:(aa.set(n,{initialDef:la(e),instances:new Set}),!0)}function la(n){return Zm(n)?n.__vccOpts:n}function qE(n,e){const t=aa.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,la(r.type).render=e),r.renderCache=[],r.update()}))}function KE(n,e){const t=aa.get(n);if(!t)return;e=la(e),Wm(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const s=r[i],a=la(s.type);let u=Nc.get(a);u||(a!==t.initialDef&&Wm(a,e),Nc.set(a,u=new Set)),u.add(s),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(u.add(s),s.ceReload(e.styles),u.delete(s)):s.parent?Fm(()=>{s.parent.update(),u.delete(s)}):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),s.root.ce&&s!==s.root&&s.root.ce._removeChildStyle(a)}zm(()=>{Nc.clear()})}function Wm(n,e){ar(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function Rc(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 vi,ua=[];function Vm(n,e){var t,r;vi=n,vi?(vi.enabled=!0,ua.forEach(({event:i,args:s})=>vi.emit(i,...s)),ua=[]):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(s=>{Vm(s,e)}),setTimeout(()=>{vi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ua=[])},3e3)):ua=[]}let Si=null,GE=null;const JE=n=>n.__isTeleport;function Um(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Um(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Yo().requestIdleCallback,Yo().cancelIdleCallback;const jE=Symbol.for("v-ndc"),YE={};process.env.NODE_ENV!=="production"&&(YE.ownKeys=n=>(ut("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)));let XE=null;function ZE(n,e,t=!1){const r=ha||Si;if(r||XE){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&&Qe(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&ut(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&ut("inject() can only be used inside setup() or functional components.")}const QE={},qm=n=>Object.getPrototypeOf(n)===QE,e5=o5,t5=Symbol.for("v-scx"),n5=()=>{{const n=ZE(t5);return n||process.env.NODE_ENV!=="production"&&ut("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function r5(n,e,t){return process.env.NODE_ENV!=="production"&&!Qe(e)&&ut("`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."),i5(n,e,t)}function i5(n,e,t=cs){const{immediate:r,deep:i,flush:s,once:a}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&ut('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&ut('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&ut('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=ar({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=ut);const c=e&&r||!e&&s!=="post";let h;if(da){if(s==="sync"){const _=n5();h=_.__watcherHandles||(_.__watcherHandles=[])}else if(!c){const _=()=>{};return _.stop=mi,_.resume=mi,_.pause=mi,_}}const p=ha;u.call=(_,S,E)=>Dm(_,p,S,E);let m=!1;s==="post"?u.scheduler=_=>{e5(_,p&&p.suspense)}:s!=="sync"&&(m=!0,u.scheduler=(_,S)=>{S?_():Fm(_)}),u.augmentJob=_=>{e&&(_.flags|=4),m&&(_.flags|=2,p&&(_.id=p.uid,_.i=p))};const y=NE(n,e,u);return da&&(h?h.push(y):c&&y()),y}const s5=n=>n.__isSuspense;function o5(n,e){e&&e.pendingBranch?Fe(n)?e.effects.push(...n):e.effects.push(n):zm(n)}const Km=Symbol.for("v-fgt"),a5=Symbol.for("v-txt"),l5=Symbol.for("v-cmt");function u5(n){return n?n.__v_isVNode===!0:!1}const c5=(...n)=>Jm(...n),Gm=({key:n})=>n??null,ca=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Ln(n)||lt(n)||Qe(n)?{i:Si,r:n,k:e,f:!!t}:n:null);function f5(n,e=null,t=null,r=0,i=null,s=n===Km?0:1,a=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Gm(e),ref:e&&ca(e),scopeId:GE,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:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Si};return u?(Lc(c,t),s&128&&n.normalize(c)):t&&(c.shapeFlag|=Ln(t)?8:16),process.env.NODE_ENV!=="production"&&c.key!==c.key&&ut("VNode created with invalid key (NaN). VNode type:",c.type),c}const h5=process.env.NODE_ENV!=="production"?c5:Jm;function Jm(n,e=null,t=null,r=0,i=null,s=!1){if((!n||n===jE)&&(process.env.NODE_ENV!=="production"&&!n&&ut(`Invalid vnode type when creating vnode: ${n}.`),n=l5),u5(n)){const u=fa(n,e,!0);return t&&Lc(u,t),u.patchFlag=-2,u}if(Zm(n)&&(n=n.__vccOpts),e){e=d5(e);let{class:u,style:c}=e;u&&!Ln(u)&&(e.class=mc(u)),gt(c)&&(na(c)&&!Fe(c)&&(c=ar({},c)),e.style=pc(c))}const a=Ln(n)?1:s5(n)?128:JE(n)?64:gt(n)?4:Qe(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&na(n)&&(n=he(n),ut("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`.",`
|
|
30
|
-
Component that was made reactive: `,n)),f5(n,e,t,r,i,a,s,!0)}function d5(n){return n?na(n)||qm(n)?ar({},n):n:null}function fa(n,e,t=!1,r=!1){const{props:i,ref:s,patchFlag:a,children:u,transition:c}=n,h=e?m5(i||{},e):i,p={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&Gm(h),ref:e&&e.ref?t&&s?Fe(s)?s.concat(ca(e)):[s,ca(e)]:ca(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&Fe(u)?u.map(jm):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Km?a===-1?16:a|16:a,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:c,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&fa(n.ssContent),ssFallback:n.ssFallback&&fa(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return c&&r&&Um(p,c.clone(p)),p}function jm(n){const e=fa(n);return Fe(n.children)&&(e.children=n.children.map(jm)),e}function p5(n=" ",e=0){return h5(a5,null,n,e)}function Lc(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Fe(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Lc(n,i()),i._c&&(i._d=!0));return}else t=32,!e._&&!qm(e)&&(e._ctx=Si);else Qe(e)?(e={default:e,_ctx:Si},t=32):(e=String(e),r&64?(t=16,e=[p5(e)]):t=8);n.children=e,n.shapeFlag|=t}function m5(...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=mc([e.class,r.class]));else if(i==="style")e.style=pc([e.style,r.style]);else if(KC(i)){const s=e[i],a=r[i];a&&s!==a&&!(Fe(s)&&s.includes(a))&&(e[i]=s?[].concat(s,a):a)}else i!==""&&(e[i]=r[i])}return e}let ha=null;const g5=()=>ha||Si;{const n=Yo(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),s=>{i.length>1?i.forEach(a=>a(s)):i[0](s)}};e("__VUE_INSTANCE_SETTERS__",t=>ha=t),e("__VUE_SSR_SETTERS__",t=>da=t)}let da=!1;process.env.NODE_ENV;const y5=/(?:^|[-_])(\w)/g,b5=n=>n.replace(y5,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ym(n,e=!0){return Qe(n)?n.displayName||n.name:n.name||e&&n.__name}function Xm(n,e,t=!1){let r=Ym(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=s=>{for(const a in s)if(s[a]===e)return a};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?b5(r):t?"App":"Anonymous"}function Zm(n){return Qe(n)&&"__vccOpts"in n}const ge=(n,e)=>{const t=ME(n,e,da);if(process.env.NODE_ENV!=="production"){const r=g5();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function _5(){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(m){return gt(m)?m.__isVue?["div",n,"VueInstance"]:lt(m)?["div",{},["span",n,p(m)],"<",u("_value"in m?m._value:m),">"]:ys(m)?["div",{},["span",n,bt(m)?"ShallowReactive":"Reactive"],"<",u(m),`>${Fn(m)?" (readonly)":""}`]:Fn(m)?["div",{},["span",n,bt(m)?"ShallowReadonly":"Readonly"],"<",u(m),">"]:null:null},hasBody(m){return m&&m.__isVue},body(m){if(m&&m.__isVue)return["div",{},...s(m.$)]}};function s(m){const y=[];m.type.props&&m.props&&y.push(a("props",he(m.props))),m.setupState!==cs&&y.push(a("setup",m.setupState)),m.data!==cs&&y.push(a("data",he(m.data)));const _=c(m,"computed");_&&y.push(a("computed",_));const S=c(m,"inject");return S&&y.push(a("injected",S)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:m}]]),y}function a(m,y){return y=ar({},y),Object.keys(y).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},m],["div",{style:"padding-left:1.25em"},...Object.keys(y).map(_=>["div",{},["span",r,_+": "],u(y[_],!1)])]]:["span",{}]}function u(m,y=!0){return typeof m=="number"?["span",e,m]:typeof m=="string"?["span",t,JSON.stringify(m)]:typeof m=="boolean"?["span",r,m]:gt(m)?["object",{object:y?he(m):m}]:["span",t,String(m)]}function c(m,y){const _=m.type;if(Qe(_))return;const S={};for(const E in m.ctx)h(_,E,y)&&(S[E]=m.ctx[E]);return S}function h(m,y,_){const S=m[_];if(Fe(S)&&S.includes(y)||gt(S)&&y in S||m.extends&&h(m.extends,y,_)||m.mixins&&m.mixins.some(E=>h(E,y,_)))return!0}function p(m){return bt(m)?"ShallowRef":m.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function w5(){_5()}process.env.NODE_ENV!=="production"&&w5();function et(n){this.content=n}et.prototype={constructor:et,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),s=r.content.slice();return i==-1?s.push(t||n,e):(s[i+1]=e,t&&(s[i]=t)),new et(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new et(t)},addToStart:function(n,e){return new et([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new et(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),s=r.find(n);return i.splice(s==-1?i.length:s,0,e,t),new et(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=et.from(n),n.size?new et(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=et.from(n),n.size?new et(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=et.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},et.from=function(n){if(n instanceof et)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new et(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),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)t++;return t}if(i.content.size||s.content.size){let a=Qm(i.content,s.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function eg(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let a=n.child(--i),u=e.child(--s),c=a.nodeSize;if(a==u){t-=c,r-=c;continue}if(!a.sameMarkup(u))return{a:t,b:r};if(a.isText&&a.text!=u.text){let h=0,p=Math.min(a.text.length,u.text.length);for(;h<p&&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=eg(a.content,u.content,t-1,r-1);if(h)return h}t-=c,r-=c}}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,s){for(let a=0,u=0;u<t;a++){let c=this.content[a],h=u+c.nodeSize;if(h>e&&r(c,i+u,s||null,a)!==!1&&c.content.size){let p=u+1;c.nodesBetween(Math.max(0,e-p),Math.min(c.content.size,t-p),r,i+p)}u=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",a=!0;return this.nodesBetween(e,t,(u,c)=>{let h=u.isText?u.text.slice(Math.max(e,c)-c,t-c):u.isLeaf?i?typeof i=="function"?i(u):i:u.type.spec.leafText?u.type.spec.leafText(u):"":"";u.isBlock&&(u.isLeaf&&h||u.isTextblock)&&r&&(a?a=!1:s+=r),s+=h},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);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 s=0,a=0;a<t;s++){let u=this.content[s],c=a+u.nodeSize;c>e&&((a<e||c>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=c}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(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new z(i,s)}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 eg(this,e,t,r)}findIndex(e,t=-1){if(e==0)return pa(0,e);if(e==this.size)return pa(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 s=this.child(r),a=i+s.nodeSize;if(a>=e)return a==e||t>0?pa(r+1,a):pa(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 s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}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 Pc={index:0,offset:0};function pa(n,e){return Pc.index=n,Pc.offset=e,Pc}function ma(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(!ma(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ma(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Oe=class wh{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}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&&ma(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`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}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 wh.none;if(e instanceof wh)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Oe.none=[];class ga 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=ng(this.content,e+this.openStart,t);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(e,t){return new K(tg(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 s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new K(e,r,i)}}K.empty=new K(z.empty,0,0);function tg(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:a,offset:u}=n.findIndex(t);if(i==e||s.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,s.copy(tg(s.content,e-i-1,t-i-1)))}function ng(n,e,t,r){let{index:i,offset:s}=n.findIndex(e),a=n.maybeChild(i);if(s==e||a.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=ng(a.content,e-s-1,t);return u&&n.replaceChild(i,a.copy(u))}function v5(n,e,t){if(t.openStart>n.depth)throw new ga("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ga("Inconsistent open depths");return rg(n,e,t,0)}function rg(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=rg(n,e,t,r+1);return s.copy(s.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}=S5(t,n);return Wr(s,sg(n,a,u,e,r))}else return Wr(s,ya(n,e,r))}function ig(n,e){if(!e.type.compatibleContent(n.type))throw new ga("Cannot join "+e.type.name+" onto "+n.type.name)}function Dc(n,e,t){let r=n.node(t);return ig(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 _s(n,e,t,r){let i=(e||n).node(t),s=0,a=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(Hr(n.nodeAfter,r),s++));for(let u=s;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 sg(n,e,t,r,i){let s=n.depth>i&&Dc(n,e,i+1),a=r.depth>i&&Dc(t,r,i+1),u=[];return _s(null,n,i,u),s&&a&&e.index(i)==t.index(i)?(ig(s,a),Hr(Wr(s,sg(n,e,t,r,i+1)),u)):(s&&Hr(Wr(s,ya(n,e,i+1)),u),_s(e,t,i,u),a&&Hr(Wr(a,ya(t,r,i+1)),u)),_s(r,null,i,u),new z(u)}function ya(n,e,t){let r=[];if(_s(null,n,t,r),n.depth>t){let i=Dc(n,e,t+1);Hr(Wr(i,ya(n,e,t+1)),r)}return _s(e,null,t,r),new z(r)}function S5(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(z.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class qs{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 s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Oe.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 s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}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 s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].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 ba(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,s=t;for(let a=e;;){let{index:u,offset:c}=a.content.findIndex(s),h=s-c;if(r.push(a,u,i+c),!h||(a=a.child(u),a.isText))break;s=h-1,i+=c+1}return new qs(t,r,s)}static resolveCached(e,t){let r=og.get(e);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==t)return a}else og.set(e,r=new x5);let i=r.elts[r.i]=qs.resolve(e,t);return r.i=(r.i+1)%C5,i}}class x5{constructor(){this.elts=[],this.i=0}}const C5=12,og=new WeakMap;class ba{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 E5=Object.create(null);let hr=class vh{constructor(e,t,r,i=Oe.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||z.empty}get children(){return this.content.content}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&&ma(this.attrs,t||e.defaultAttrs||E5)&&Oe.sameSet(this.marks,r||Oe.none)}copy(e=null){return e==this.content?this:new vh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new vh(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),s=this.resolve(t),a=r?0:i.sharedDepth(t),u=i.start(a),h=i.node(a).content.cut(i.pos-u,s.pos-u);return new K(h,i.depth-a,s.depth-a)}replace(e,t,r){return v5(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 qs.resolveCached(this,e)}resolveNoCache(e){return qs.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(r.isInSet(s.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()+")"),ag(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,s=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,s),u=a&&a.matchFragment(this.content,t);if(!u||!u.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),a=s&&s.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),this.type.checkAttrs(this.attrs);let e=Oe.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Oe.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;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),s=e.nodeType(t.type).create(t.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};hr.prototype.text=void 0;class Pl extends hr{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):ag(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 Pl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Pl(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 ag(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Zr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new k5(e,t);if(r.next==null)return Zr.empty;let i=lg(r);r.next&&r.err("Unexpected trailing text");let s=R5(N5(i));return L5(s,r),s}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 s=t;i&&s<r;s++)i=i.matchType(e.child(s).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 s(a,u){let c=a.matchFragment(e,r);if(c&&(!t||c.validEnd))return z.from(u.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:p,next:m}=a.next[h];if(!(p.isText||p.hasRequiredAttrs())&&i.indexOf(m)==-1){i.push(m);let y=s(m,u.concat(p));if(y)return y}}return null}return s(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(),s=i.match;if(s.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<s.next.length;a++){let{type:u,next:c}=s.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in t)&&(!i.type||c.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 s=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return s}).join(`
|
|
31
|
-
`)}}Zr.empty=new Zr(!0);class k5{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 lg(n){let e=[];do e.push(T5(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function T5(n){let e=[];do e.push(A5(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function A5(n){let e=I5(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=O5(n,e);else break;return e}function ug(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function O5(n,e){let t=ug(n),r=t;return n.eat(",")&&(n.next!="}"?r=ug(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function M5(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let s in t){let a=t[s];a.isInGroup(e)&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function I5(n){if(n.eat("(")){let e=lg(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=M5(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 N5(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(a,u,c){let h={term:c,to:u};return e[a].push(h),h}function i(a,u){a.forEach(c=>c.to=u)}function s(a,u){if(a.type=="choice")return a.exprs.reduce((c,h)=>c.concat(s(h,u)),[]);if(a.type=="seq")for(let c=0;;c++){let h=s(a.exprs[c],u);if(c==a.exprs.length-1)return h;i(h,u=t())}else if(a.type=="star"){let c=t();return r(u,c),i(s(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=t();return i(s(a.expr,u),c),i(s(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(u)].concat(s(a.expr,u));if(a.type=="range"){let c=u;for(let h=0;h<a.min;h++){let p=t();i(s(a.expr,c),p),c=p}if(a.max==-1)i(s(a.expr,c),c);else for(let h=a.min;h<a.max;h++){let p=t();r(c,p),i(s(a.expr,c),p),c=p}return[r(c)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function cg(n,e){return e-n}function fg(n,e){let t=[];return r(e),t.sort(cg);function r(i){let s=n[i];if(s.length==1&&!s[0].term)return r(s[0].to);t.push(i);for(let a=0;a<s.length;a++){let{term:u,to:c}=s[a];!u&&t.indexOf(c)==-1&&r(c)}}}function R5(n){let e=Object.create(null);return t(fg(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:u,to:c})=>{if(!u)return;let h;for(let p=0;p<i.length;p++)i[p][0]==u&&(h=i[p][1]);fg(n,c).forEach(p=>{h||i.push([u,h=[]]),h.indexOf(p)==-1&&h.push(p)})})});let s=e[r.join(",")]=new Zr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(cg);s.next.push({type:i[a][0],next:e[u.join(",")]||t(u)})}return s}}function L5(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],s=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:c,next:h}=i.next[u];a.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),r.indexOf(h)==-1&&r.push(h)}s&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function hg(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 dg(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let s=n[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function pg(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in n){let s=n[i];s.validate&&s.validate(e[i])}}function mg(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new D5(n,r,e[r]);return t}let gg=class Ky{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=mg(e,r.attrs),this.defaultAttrs=hg(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Zr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}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:dg(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new hr(this,this.computeAttrs(e),z.from(t),Oe.setFrom(r))}createChecked(e=null,t,r){return t=z.from(t),this.checkContent(t),new hr(this,this.computeAttrs(e),t,Oe.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),s=i&&i.fillBefore(z.empty,!0);return s?new hr(this,e,t.append(s),Oe.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)}`)}checkAttrs(e){pg(this.attrs,e,"node",this.name)}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:Oe.none:e}static compile(e,t){let r=Object.create(null);e.forEach((s,a)=>r[s]=new Ky(s,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 s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function P5(n,e,t){let r=t.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`)}}class D5{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?P5(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Dl{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=mg(e,i.attrs),this.excluded=null;let s=hg(this.attrs);this.instance=s?new Oe(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Oe(this,dg(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,a)=>r[s]=new Dl(s,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]}checkAttrs(e){pg(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class yg{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=et.from(e.nodes),t.marks=et.from(e.marks||{}),this.nodes=gg.compile(this.spec.nodes,this),this.marks=Dl.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 s=this.nodes[i],a=s.spec.content||"",u=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=Zr.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=u=="_"?null:u?bg(this,u.split(" ")):u==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:bg(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 gg){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 Pl(r,r.defaultAttrs,e,Oe.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return hr.fromJSON(this,e)}markFromJSON(e){return Oe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function bg(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],s=n.marks[i],a=s;if(s)t.push(s);else for(let u in n.marks){let c=n.marks[u];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function F5(n){return n.tag!=null}function B5(n){return n.style!=null}let ws=class Sh{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(F5(i))this.tags.push(i);else if(B5(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new Sg(this,t,!1);return r.addAll(e,Oe.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Sg(this,t,!0);return r.addAll(e,Oe.none,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 s=this.tags[i];if(H5(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,t,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],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 c=a.getAttrs(t);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let u=t[a];if((u.priority==null?50:u.priority)<s)break}t.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{r(a=xg(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{r(a=xg(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Sh(e,Sh.schemaRules(e)))}};const _g={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},z5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},wg={ol:!0,ul:!0},vs=1,Fc=2,_a=4;function vg(n,e,t){return e!=null?(e?vs:0)|(e==="full"?Fc:0):n&&n.whitespace=="pre"?vs|Fc:t&-5}class wa{constructor(e,t,r,i,s,a){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=Oe.none,this.match=s||(a&_a?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&vs)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.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}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!_g.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Sg{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,a=vg(null,t.preserveWhitespace,0)|(r?_a:0);i?s=new wa(i.type,i.attrs,Oe.none,!0,t.topMatch||i.type.contentMatch,a):r?s=new wa(null,null,Oe.none,!0,null,a):s=new wa(e.schema.topNodeType,null,Oe.none,!0,null,a),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,s=i.options&Fc?"full":this.localPreserveWS||(i.options&vs)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)s!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
28
|
+
`,...DE(i)),console.warn(...s)}Qo(),Oc=!1}function PE(){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 DE(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
|
|
29
|
+
`],...FE(t))}),e}function FE({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Xm(n.component,n.type,r)}`,s=">"+t;return n.props?[i,...BE(n.props),s]:[i+s]}function BE(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...Lm(r,n[r]))}),t.length>3&&e.push(" ..."),e}function Lm(n,e,t){return Ln(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:lt(e)?(e=Lm(n,he(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Qe(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=he(e),t?e:[`${n}=`,e])}const Pm={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 aa(n,e,t,r){try{return r?n(...r):n()}catch(i){Mc(i,e,t)}}function Dm(n,e,t,r){if(Qe(n)){const i=aa(n,e,t,r);return i&&jC(i)&&i.catch(s=>{Mc(s,e,t)}),i}if(Fe(n)){const i=[];for(let s=0;s<n.length;s++)i.push(Dm(n[s],e,t,r));return i}else process.env.NODE_ENV!=="production"&&ut(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Mc(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||fs;if(e){let u=e.parent;const c=e.proxy,h=process.env.NODE_ENV!=="production"?Pm[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;u;){const p=u.ec;if(p){for(let m=0;m<p.length;m++)if(p[m](n,c,h)===!1)return}u=u.parent}if(s){Zo(),aa(s,null,10,[n,c,h]),Qo();return}}zE(n,t,i,r,a)}function zE(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const s=Pm[e];if(t&&RE(t),ut(`Unhandled error${s?` during execution of ${s}`:""}`),t&&LE(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Kt=[];let Bn=-1;const _i=[];let fr=null,wi=0;const $E=Promise.resolve();let Ic=null;const HE=100;function WE(n){let e=Bn+1,t=Kt.length;for(;e<t;){const r=e+t>>>1,i=Kt[r],s=_s(i);s<n||s===n&&i.flags&2?e=r+1:t=r}return e}function Fm(n){if(!(n.flags&1)){const e=_s(n),t=Kt[Kt.length-1];!t||!(n.flags&2)&&e>=_s(t)?Kt.push(n):Kt.splice(WE(e),0,n),n.flags|=1,Bm()}}function Bm(){Ic||(Ic=$E.then($m))}function zm(n){Fe(n)?_i.push(...n):fr&&n.id===-1?fr.splice(wi+1,0,n):n.flags&1||(_i.push(n),n.flags|=1),Bm()}function VE(n){if(_i.length){const e=[...new Set(_i)].sort((t,r)=>_s(t)-_s(r));if(_i.length=0,fr){fr.push(...e);return}for(fr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),wi=0;wi<fr.length;wi++){const t=fr[wi];process.env.NODE_ENV!=="production"&&Hm(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}fr=null,wi=0}}const _s=n=>n.id==null?n.flags&2?-1:1/0:n.id;function $m(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>Hm(n,t):mi;try{for(Bn=0;Bn<Kt.length;Bn++){const t=Kt[Bn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),aa(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Bn<Kt.length;Bn++){const t=Kt[Bn];t&&(t.flags&=-2)}Bn=-1,Kt.length=0,VE(n),Ic=null,(Kt.length||_i.length)&&$m(n)}}function Hm(n,e){const t=n.get(e)||0;if(t>HE){const r=e.i,i=r&&Ym(r.type);return Mc(`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 Nc=new Map;process.env.NODE_ENV!=="production"&&(Xo().__VUE_HMR_RUNTIME__={createRecord:Rc(UE),rerender:Rc(qE),reload:Rc(KE)});const la=new Map;function UE(n,e){return la.has(n)?!1:(la.set(n,{initialDef:ua(e),instances:new Set}),!0)}function ua(n){return Zm(n)?n.__vccOpts:n}function qE(n,e){const t=la.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,ua(r.type).render=e),r.renderCache=[],r.update()}))}function KE(n,e){const t=la.get(n);if(!t)return;e=ua(e),Wm(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const s=r[i],a=ua(s.type);let u=Nc.get(a);u||(a!==t.initialDef&&Wm(a,e),Nc.set(a,u=new Set)),u.add(s),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(u.add(s),s.ceReload(e.styles),u.delete(s)):s.parent?Fm(()=>{s.parent.update(),u.delete(s)}):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),s.root.ce&&s!==s.root&&s.root.ce._removeChildStyle(a)}zm(()=>{Nc.clear()})}function Wm(n,e){ar(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function Rc(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 vi,ca=[];function Vm(n,e){var t,r;vi=n,vi?(vi.enabled=!0,ca.forEach(({event:i,args:s})=>vi.emit(i,...s)),ca=[]):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(s=>{Vm(s,e)}),setTimeout(()=>{vi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ca=[])},3e3)):ca=[]}let Si=null,GE=null;const JE=n=>n.__isTeleport;function Um(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Um(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 jE=Symbol.for("v-ndc"),YE={};process.env.NODE_ENV!=="production"&&(YE.ownKeys=n=>(ut("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)));let XE=null;function ZE(n,e,t=!1){const r=da||Si;if(r||XE){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&&Qe(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&ut(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&ut("inject() can only be used inside setup() or functional components.")}const QE={},qm=n=>Object.getPrototypeOf(n)===QE,e5=o5,t5=Symbol.for("v-scx"),n5=()=>{{const n=ZE(t5);return n||process.env.NODE_ENV!=="production"&&ut("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function r5(n,e,t){return process.env.NODE_ENV!=="production"&&!Qe(e)&&ut("`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."),i5(n,e,t)}function i5(n,e,t=fs){const{immediate:r,deep:i,flush:s,once:a}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&ut('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&ut('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&ut('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=ar({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=ut);const c=e&&r||!e&&s!=="post";let h;if(pa){if(s==="sync"){const _=n5();h=_.__watcherHandles||(_.__watcherHandles=[])}else if(!c){const _=()=>{};return _.stop=mi,_.resume=mi,_.pause=mi,_}}const p=da;u.call=(_,S,E)=>Dm(_,p,S,E);let m=!1;s==="post"?u.scheduler=_=>{e5(_,p&&p.suspense)}:s!=="sync"&&(m=!0,u.scheduler=(_,S)=>{S?_():Fm(_)}),u.augmentJob=_=>{e&&(_.flags|=4),m&&(_.flags|=2,p&&(_.id=p.uid,_.i=p))};const y=NE(n,e,u);return pa&&(h?h.push(y):c&&y()),y}const s5=n=>n.__isSuspense;function o5(n,e){e&&e.pendingBranch?Fe(n)?e.effects.push(...n):e.effects.push(n):zm(n)}const Km=Symbol.for("v-fgt"),a5=Symbol.for("v-txt"),l5=Symbol.for("v-cmt");function u5(n){return n?n.__v_isVNode===!0:!1}const c5=(...n)=>Jm(...n),Gm=({key:n})=>n??null,fa=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Ln(n)||lt(n)||Qe(n)?{i:Si,r:n,k:e,f:!!t}:n:null);function f5(n,e=null,t=null,r=0,i=null,s=n===Km?0:1,a=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Gm(e),ref:e&&fa(e),scopeId:GE,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:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Si};return u?(Lc(c,t),s&128&&n.normalize(c)):t&&(c.shapeFlag|=Ln(t)?8:16),process.env.NODE_ENV!=="production"&&c.key!==c.key&&ut("VNode created with invalid key (NaN). VNode type:",c.type),c}const h5=process.env.NODE_ENV!=="production"?c5:Jm;function Jm(n,e=null,t=null,r=0,i=null,s=!1){if((!n||n===jE)&&(process.env.NODE_ENV!=="production"&&!n&&ut(`Invalid vnode type when creating vnode: ${n}.`),n=l5),u5(n)){const u=ha(n,e,!0);return t&&Lc(u,t),u.patchFlag=-2,u}if(Zm(n)&&(n=n.__vccOpts),e){e=d5(e);let{class:u,style:c}=e;u&&!Ln(u)&&(e.class=mc(u)),gt(c)&&(ra(c)&&!Fe(c)&&(c=ar({},c)),e.style=pc(c))}const a=Ln(n)?1:s5(n)?128:JE(n)?64:gt(n)?4:Qe(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&ra(n)&&(n=he(n),ut("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`.",`
|
|
30
|
+
Component that was made reactive: `,n)),f5(n,e,t,r,i,a,s,!0)}function d5(n){return n?ra(n)||qm(n)?ar({},n):n:null}function ha(n,e,t=!1,r=!1){const{props:i,ref:s,patchFlag:a,children:u,transition:c}=n,h=e?m5(i||{},e):i,p={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&Gm(h),ref:e&&e.ref?t&&s?Fe(s)?s.concat(fa(e)):[s,fa(e)]:fa(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&Fe(u)?u.map(jm):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Km?a===-1?16:a|16:a,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:c,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&ha(n.ssContent),ssFallback:n.ssFallback&&ha(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return c&&r&&Um(p,c.clone(p)),p}function jm(n){const e=ha(n);return Fe(n.children)&&(e.children=n.children.map(jm)),e}function p5(n=" ",e=0){return h5(a5,null,n,e)}function Lc(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Fe(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Lc(n,i()),i._c&&(i._d=!0));return}else t=32,!e._&&!qm(e)&&(e._ctx=Si);else Qe(e)?(e={default:e,_ctx:Si},t=32):(e=String(e),r&64?(t=16,e=[p5(e)]):t=8);n.children=e,n.shapeFlag|=t}function m5(...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=mc([e.class,r.class]));else if(i==="style")e.style=pc([e.style,r.style]);else if(KC(i)){const s=e[i],a=r[i];a&&s!==a&&!(Fe(s)&&s.includes(a))&&(e[i]=s?[].concat(s,a):a)}else i!==""&&(e[i]=r[i])}return e}let da=null;const g5=()=>da||Si;{const n=Xo(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),s=>{i.length>1?i.forEach(a=>a(s)):i[0](s)}};e("__VUE_INSTANCE_SETTERS__",t=>da=t),e("__VUE_SSR_SETTERS__",t=>pa=t)}let pa=!1;process.env.NODE_ENV;const y5=/(?:^|[-_])(\w)/g,b5=n=>n.replace(y5,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ym(n,e=!0){return Qe(n)?n.displayName||n.name:n.name||e&&n.__name}function Xm(n,e,t=!1){let r=Ym(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=s=>{for(const a in s)if(s[a]===e)return a};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?b5(r):t?"App":"Anonymous"}function Zm(n){return Qe(n)&&"__vccOpts"in n}const ge=(n,e)=>{const t=ME(n,e,pa);if(process.env.NODE_ENV!=="production"){const r=g5();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function _5(){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(m){return gt(m)?m.__isVue?["div",n,"VueInstance"]:lt(m)?["div",{},["span",n,p(m)],"<",u("_value"in m?m._value:m),">"]:bs(m)?["div",{},["span",n,bt(m)?"ShallowReactive":"Reactive"],"<",u(m),`>${Fn(m)?" (readonly)":""}`]:Fn(m)?["div",{},["span",n,bt(m)?"ShallowReadonly":"Readonly"],"<",u(m),">"]:null:null},hasBody(m){return m&&m.__isVue},body(m){if(m&&m.__isVue)return["div",{},...s(m.$)]}};function s(m){const y=[];m.type.props&&m.props&&y.push(a("props",he(m.props))),m.setupState!==fs&&y.push(a("setup",m.setupState)),m.data!==fs&&y.push(a("data",he(m.data)));const _=c(m,"computed");_&&y.push(a("computed",_));const S=c(m,"inject");return S&&y.push(a("injected",S)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:m}]]),y}function a(m,y){return y=ar({},y),Object.keys(y).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},m],["div",{style:"padding-left:1.25em"},...Object.keys(y).map(_=>["div",{},["span",r,_+": "],u(y[_],!1)])]]:["span",{}]}function u(m,y=!0){return typeof m=="number"?["span",e,m]:typeof m=="string"?["span",t,JSON.stringify(m)]:typeof m=="boolean"?["span",r,m]:gt(m)?["object",{object:y?he(m):m}]:["span",t,String(m)]}function c(m,y){const _=m.type;if(Qe(_))return;const S={};for(const E in m.ctx)h(_,E,y)&&(S[E]=m.ctx[E]);return S}function h(m,y,_){const S=m[_];if(Fe(S)&&S.includes(y)||gt(S)&&y in S||m.extends&&h(m.extends,y,_)||m.mixins&&m.mixins.some(E=>h(E,y,_)))return!0}function p(m){return bt(m)?"ShallowRef":m.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function w5(){_5()}process.env.NODE_ENV!=="production"&&w5();function et(n){this.content=n}et.prototype={constructor:et,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),s=r.content.slice();return i==-1?s.push(t||n,e):(s[i+1]=e,t&&(s[i]=t)),new et(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new et(t)},addToStart:function(n,e){return new et([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new et(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),s=r.find(n);return i.splice(s==-1?i.length:s,0,e,t),new et(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=et.from(n),n.size?new et(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=et.from(n),n.size?new et(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=et.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},et.from=function(n){if(n instanceof et)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new et(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),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)t++;return t}if(i.content.size||s.content.size){let a=Qm(i.content,s.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function eg(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let a=n.child(--i),u=e.child(--s),c=a.nodeSize;if(a==u){t-=c,r-=c;continue}if(!a.sameMarkup(u))return{a:t,b:r};if(a.isText&&a.text!=u.text){let h=0,p=Math.min(a.text.length,u.text.length);for(;h<p&&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=eg(a.content,u.content,t-1,r-1);if(h)return h}t-=c,r-=c}}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,s){for(let a=0,u=0;u<t;a++){let c=this.content[a],h=u+c.nodeSize;if(h>e&&r(c,i+u,s||null,a)!==!1&&c.content.size){let p=u+1;c.nodesBetween(Math.max(0,e-p),Math.min(c.content.size,t-p),r,i+p)}u=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",a=!0;return this.nodesBetween(e,t,(u,c)=>{let h=u.isText?u.text.slice(Math.max(e,c)-c,t-c):u.isLeaf?i?typeof i=="function"?i(u):i:u.type.spec.leafText?u.type.spec.leafText(u):"":"";u.isBlock&&(u.isLeaf&&h||u.isTextblock)&&r&&(a?a=!1:s+=r),s+=h},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);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 s=0,a=0;a<t;s++){let u=this.content[s],c=a+u.nodeSize;c>e&&((a<e||c>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=c}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(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new z(i,s)}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 eg(this,e,t,r)}findIndex(e,t=-1){if(e==0)return ma(0,e);if(e==this.size)return ma(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 s=this.child(r),a=i+s.nodeSize;if(a>=e)return a==e||t>0?ma(r+1,a):ma(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 s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}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 Pc={index:0,offset:0};function ma(n,e){return Pc.index=n,Pc.offset=e,Pc}function ga(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(!ga(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ga(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Oe=class wh{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}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&&ga(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`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}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 wh.none;if(e instanceof wh)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Oe.none=[];class ya 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=ng(this.content,e+this.openStart,t);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(e,t){return new K(tg(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 s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new K(e,r,i)}}K.empty=new K(z.empty,0,0);function tg(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:a,offset:u}=n.findIndex(t);if(i==e||s.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,s.copy(tg(s.content,e-i-1,t-i-1)))}function ng(n,e,t,r){let{index:i,offset:s}=n.findIndex(e),a=n.maybeChild(i);if(s==e||a.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=ng(a.content,e-s-1,t);return u&&n.replaceChild(i,a.copy(u))}function v5(n,e,t){if(t.openStart>n.depth)throw new ya("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ya("Inconsistent open depths");return rg(n,e,t,0)}function rg(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=rg(n,e,t,r+1);return s.copy(s.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}=S5(t,n);return Wr(s,sg(n,a,u,e,r))}else return Wr(s,ba(n,e,r))}function ig(n,e){if(!e.type.compatibleContent(n.type))throw new ya("Cannot join "+e.type.name+" onto "+n.type.name)}function Dc(n,e,t){let r=n.node(t);return ig(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 ws(n,e,t,r){let i=(e||n).node(t),s=0,a=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(Hr(n.nodeAfter,r),s++));for(let u=s;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 sg(n,e,t,r,i){let s=n.depth>i&&Dc(n,e,i+1),a=r.depth>i&&Dc(t,r,i+1),u=[];return ws(null,n,i,u),s&&a&&e.index(i)==t.index(i)?(ig(s,a),Hr(Wr(s,sg(n,e,t,r,i+1)),u)):(s&&Hr(Wr(s,ba(n,e,i+1)),u),ws(e,t,i,u),a&&Hr(Wr(a,ba(t,r,i+1)),u)),ws(r,null,i,u),new z(u)}function ba(n,e,t){let r=[];if(ws(null,n,t,r),n.depth>t){let i=Dc(n,e,t+1);Hr(Wr(i,ba(n,e,t+1)),r)}return ws(e,null,t,r),new z(r)}function S5(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(z.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Ks{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 s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Oe.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 s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}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 s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].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 _a(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,s=t;for(let a=e;;){let{index:u,offset:c}=a.content.findIndex(s),h=s-c;if(r.push(a,u,i+c),!h||(a=a.child(u),a.isText))break;s=h-1,i+=c+1}return new Ks(t,r,s)}static resolveCached(e,t){let r=og.get(e);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==t)return a}else og.set(e,r=new x5);let i=r.elts[r.i]=Ks.resolve(e,t);return r.i=(r.i+1)%C5,i}}class x5{constructor(){this.elts=[],this.i=0}}const C5=12,og=new WeakMap;class _a{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 E5=Object.create(null);let hr=class vh{constructor(e,t,r,i=Oe.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||z.empty}get children(){return this.content.content}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&&ga(this.attrs,t||e.defaultAttrs||E5)&&Oe.sameSet(this.marks,r||Oe.none)}copy(e=null){return e==this.content?this:new vh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new vh(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),s=this.resolve(t),a=r?0:i.sharedDepth(t),u=i.start(a),h=i.node(a).content.cut(i.pos-u,s.pos-u);return new K(h,i.depth-a,s.depth-a)}replace(e,t,r){return v5(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 Ks.resolveCached(this,e)}resolveNoCache(e){return Ks.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(r.isInSet(s.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()+")"),ag(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,s=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,s),u=a&&a.matchFragment(this.content,t);if(!u||!u.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),a=s&&s.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),this.type.checkAttrs(this.attrs);let e=Oe.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Oe.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;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),s=e.nodeType(t.type).create(t.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};hr.prototype.text=void 0;class Pl extends hr{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):ag(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 Pl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Pl(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 ag(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Zr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new k5(e,t);if(r.next==null)return Zr.empty;let i=lg(r);r.next&&r.err("Unexpected trailing text");let s=R5(N5(i));return L5(s,r),s}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 s=t;i&&s<r;s++)i=i.matchType(e.child(s).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 s(a,u){let c=a.matchFragment(e,r);if(c&&(!t||c.validEnd))return z.from(u.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:p,next:m}=a.next[h];if(!(p.isText||p.hasRequiredAttrs())&&i.indexOf(m)==-1){i.push(m);let y=s(m,u.concat(p));if(y)return y}}return null}return s(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(),s=i.match;if(s.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<s.next.length;a++){let{type:u,next:c}=s.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in t)&&(!i.type||c.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 s=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return s}).join(`
|
|
31
|
+
`)}}Zr.empty=new Zr(!0);class k5{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 lg(n){let e=[];do e.push(A5(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function A5(n){let e=[];do e.push(T5(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function T5(n){let e=I5(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=O5(n,e);else break;return e}function ug(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function O5(n,e){let t=ug(n),r=t;return n.eat(",")&&(n.next!="}"?r=ug(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function M5(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let s in t){let a=t[s];a.isInGroup(e)&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function I5(n){if(n.eat("(")){let e=lg(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=M5(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 N5(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(a,u,c){let h={term:c,to:u};return e[a].push(h),h}function i(a,u){a.forEach(c=>c.to=u)}function s(a,u){if(a.type=="choice")return a.exprs.reduce((c,h)=>c.concat(s(h,u)),[]);if(a.type=="seq")for(let c=0;;c++){let h=s(a.exprs[c],u);if(c==a.exprs.length-1)return h;i(h,u=t())}else if(a.type=="star"){let c=t();return r(u,c),i(s(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=t();return i(s(a.expr,u),c),i(s(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(u)].concat(s(a.expr,u));if(a.type=="range"){let c=u;for(let h=0;h<a.min;h++){let p=t();i(s(a.expr,c),p),c=p}if(a.max==-1)i(s(a.expr,c),c);else for(let h=a.min;h<a.max;h++){let p=t();r(c,p),i(s(a.expr,c),p),c=p}return[r(c)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function cg(n,e){return e-n}function fg(n,e){let t=[];return r(e),t.sort(cg);function r(i){let s=n[i];if(s.length==1&&!s[0].term)return r(s[0].to);t.push(i);for(let a=0;a<s.length;a++){let{term:u,to:c}=s[a];!u&&t.indexOf(c)==-1&&r(c)}}}function R5(n){let e=Object.create(null);return t(fg(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:u,to:c})=>{if(!u)return;let h;for(let p=0;p<i.length;p++)i[p][0]==u&&(h=i[p][1]);fg(n,c).forEach(p=>{h||i.push([u,h=[]]),h.indexOf(p)==-1&&h.push(p)})})});let s=e[r.join(",")]=new Zr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(cg);s.next.push({type:i[a][0],next:e[u.join(",")]||t(u)})}return s}}function L5(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],s=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:c,next:h}=i.next[u];a.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),r.indexOf(h)==-1&&r.push(h)}s&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function hg(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 dg(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let s=n[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function pg(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in n){let s=n[i];s.validate&&s.validate(e[i])}}function mg(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new D5(n,r,e[r]);return t}let gg=class Ky{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=mg(e,r.attrs),this.defaultAttrs=hg(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Zr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}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:dg(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new hr(this,this.computeAttrs(e),z.from(t),Oe.setFrom(r))}createChecked(e=null,t,r){return t=z.from(t),this.checkContent(t),new hr(this,this.computeAttrs(e),t,Oe.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),s=i&&i.fillBefore(z.empty,!0);return s?new hr(this,e,t.append(s),Oe.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)}`)}checkAttrs(e){pg(this.attrs,e,"node",this.name)}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:Oe.none:e}static compile(e,t){let r=Object.create(null);e.forEach((s,a)=>r[s]=new Ky(s,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 s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function P5(n,e,t){let r=t.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`)}}class D5{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?P5(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Dl{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=mg(e,i.attrs),this.excluded=null;let s=hg(this.attrs);this.instance=s?new Oe(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Oe(this,dg(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,a)=>r[s]=new Dl(s,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]}checkAttrs(e){pg(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class yg{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=et.from(e.nodes),t.marks=et.from(e.marks||{}),this.nodes=gg.compile(this.spec.nodes,this),this.marks=Dl.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 s=this.nodes[i],a=s.spec.content||"",u=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=Zr.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=u=="_"?null:u?bg(this,u.split(" ")):u==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:bg(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 gg){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 Pl(r,r.defaultAttrs,e,Oe.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return hr.fromJSON(this,e)}markFromJSON(e){return Oe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function bg(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],s=n.marks[i],a=s;if(s)t.push(s);else for(let u in n.marks){let c=n.marks[u];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function F5(n){return n.tag!=null}function B5(n){return n.style!=null}let vs=class Sh{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(F5(i))this.tags.push(i);else if(B5(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new Sg(this,t,!1);return r.addAll(e,Oe.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Sg(this,t,!0);return r.addAll(e,Oe.none,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 s=this.tags[i];if(H5(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,t,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],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 c=a.getAttrs(t);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let u=t[a];if((u.priority==null?50:u.priority)<s)break}t.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{r(a=xg(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{r(a=xg(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Sh(e,Sh.schemaRules(e)))}};const _g={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},z5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},wg={ol:!0,ul:!0},Ss=1,Fc=2,wa=4;function vg(n,e,t){return e!=null?(e?Ss:0)|(e==="full"?Fc:0):n&&n.whitespace=="pre"?Ss|Fc:t&-5}class va{constructor(e,t,r,i,s,a){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=Oe.none,this.match=s||(a&wa?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&Ss)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.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}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!_g.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Sg{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,a=vg(null,t.preserveWhitespace,0)|(r?wa:0);i?s=new va(i.type,i.attrs,Oe.none,!0,t.topMatch||i.type.contentMatch,a):r?s=new va(null,null,Oe.none,!0,null,a):s=new va(e.schema.topNodeType,null,Oe.none,!0,null,a),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,s=i.options&Fc?"full":this.localPreserveWS||(i.options&Ss)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)s!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
32
32
|
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],u=e.previousSibling;(!a||u&&u.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),u;wg.hasOwnProperty(a)&&this.parser.normalizeLists&&$5(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(u=this.parser.matchTag(e,this,r));e:if(c?c.ignore:z5.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let h,p=this.needsBlock;if(_g.hasOwnProperty(a))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),h=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let m=c&&c.skip?t:this.readStyles(e,t);m&&this.addAll(e,m),h&&this.sync(s),this.needsBlock=p}else{let h=this.readStyles(e,t);h&&this.addElementByRule(e,c,h,c.consuming===!1?u:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
33
|
-
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=r.getPropertyValue(s);if(a)for(let u=void 0;;){let c=this.parser.matchStyle(s,a,this,u);if(!c)break;if(c.ignore)return null;if(c.clearMark?t=t.filter(h=>!c.clearMark(h)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)u=c;else break}}return t}addElementByRule(e,t,r,i){let s,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(a,t.attrs||null,r,t.preserveWhitespace);c&&(s=!0,r=c)}else{let c=this.parser.schema.marks[t.mark];r=r.concat(c.create(t.attrs))}let u=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}s&&this.sync(u)&&this.open--}addAll(e,t,r,i){let s=r||0;for(let a=r?e.childNodes[r]:e.firstChild,u=i==null?null:e.childNodes[i];a!=u;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,t);this.findAtPoint(e,s)}findPlace(e,t){let r,i;for(let s=this.open;s>=0;s--){let a=this.nodes[s],u=a.findWrapping(e);if(u&&(!r||r.length>u.length)&&(r=u,i=a,!u.length)||a.solid)break}if(!r)return null;this.sync(i);for(let s=0;s<r.length;s++)t=this.enterInner(r[s],null,t,!1);return t}insertNode(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let r=this.findPlace(e,t);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=Oe.none;for(let a of r.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):Cg(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,t,r,i){let s=this.findPlace(e.create(t),r);return s&&(s=this.enterInner(e,t,r,!0,i)),s}enterInner(e,t,r,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let u=vg(e,s,a.options);a.options&_a&&a.content.length==0&&(u|=_a);let c=Oe.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):Cg(h.type,e))?(c=h.addToSet(c),!1):!0),this.nodes.push(new wa(e,t,c,i,null,u)),this.open++,r}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;this.localPreserveWS&&(this.nodes[t].options|=vs)}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),s=-(r?r.depth+1:0)+(i?0:1),a=(u,c)=>{for(;u>=0;u--){let h=t[u];if(h==""){if(u==t.length-1||u==0)continue;for(;c>=s;c--)if(a(u-1,c))return!0;return!1}else{let p=c>0||c==0&&i?this.nodes[c].type:r&&c>=s?r.node(c-s).type:null;if(!p||p.name!=h&&!p.isInGroup(h))return!1;c--}}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}}}function $5(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&wg.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function H5(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function xg(n){let e={};for(let t in n)e[t]=n[t];return e}function Cg(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],a=u=>{s.push(u);for(let c=0;c<u.edgeCount;c++){let{type:h,next:p}=u.edge(c);if(h==e||s.indexOf(p)<0&&a(p))return!0}};if(a(i.contentMatch))return!0}}class Us{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Bc(t).createDocumentFragment());let i=r,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let u=0,c=0;for(;u<s.length&&c<a.marks.length;){let h=a.marks[c];if(!this.marks[h.type.name]){c++;continue}if(!h.eq(s[u][0])||h.type.spec.spanning===!1)break;u++,c++}for(;u<s.length;)i=s.pop()[1];for(;c<a.marks.length;){let h=a.marks[c++],p=this.serializeMark(h,a.isInline,t);p&&(s.push([h,i]),i.appendChild(p.dom),i=p.contentDOM||p.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=va(Bc(t),this.nodes[e.type.name](e),null,e.attrs);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 s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&va(Bc(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return va(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Us(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Eg(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Eg(e.marks)}}function Eg(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Bc(n){return n.document||window.document}const kg=new WeakMap;function W5(n){let e=kg.get(n);return e===void 0&&kg.set(n,e=V5(n)),e}function V5(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function va(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=W5(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(t=i.slice(0,a),i=i.slice(a+1));let u,c=t?n.createElementNS(t,i):n.createElement(i),h=e[1],p=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){p=2;for(let m in h)if(h[m]!=null){let y=m.indexOf(" ");y>0?c.setAttributeNS(m.slice(0,y),m.slice(y+1),h[m]):c.setAttribute(m,h[m])}}for(let m=p;m<e.length;m++){let y=e[m];if(y===0){if(m<e.length-1||m>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:_,contentDOM:S}=va(n,y,t,r);if(c.appendChild(_),S){if(u)throw new RangeError("Multiple content holes");u=S}}}return{dom:c,contentDOM:u}}const Tg=65535,Ag=Math.pow(2,16);function U5(n,e){return n+e*Ag}function Og(n){return n&Tg}function q5(n){return(n-(n&Tg))/Ag}const Mg=1,Ig=2,Sa=4,Ng=8;class zc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ng)>0}get deletedBefore(){return(this.delInfo&(Mg|Sa))>0}get deletedAfter(){return(this.delInfo&(Ig|Sa))>0}get deletedAcross(){return(this.delInfo&Sa)>0}}class Pt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Pt.empty)return Pt.empty}recover(e){let t=0,r=Og(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+q5(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,s=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let c=this.ranges[u]-(this.inverted?i:0);if(c>e)break;let h=this.ranges[u+s],p=this.ranges[u+a],m=c+h;if(e<=m){let y=h?e==c?-1:e==m?1:t:t,_=c+i+(y<0?0:p);if(r)return _;let S=e==(t<0?c:m)?null:U5(u/3,e-c),E=e==c?Ig:e==m?Mg:Sa;return(t<0?e!=c:e!=m)&&(E|=Ng),new zc(_,E,S)}i+=p-h}return r?e+i:new zc(e+i,0,null)}touches(e,t){let r=0,i=Og(t),s=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let c=this.ranges[u]-(this.inverted?r:0);if(c>e)break;let h=this.ranges[u+s],p=c+h;if(e<=p&&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,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?s:0),c=a+(this.inverted?0:s),h=this.ranges[i+t],p=this.ranges[i+r];e(u,u+h,c,c+p),s+=p-h}}invert(){return new Pt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Pt.empty:new Pt(e<0?[0,-e,0]:[0,0,e])}}Pt.empty=new Pt([]);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 s=this.from;s<this.to;s++){let a=this.maps[s],u=a.mapResult(e,t);if(u.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,e=this.maps[c].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new zc(e,i,null)}}const $c=Object.create(null);class Ue{getMap(){return Pt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=$c[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 $c)throw new RangeError("Duplicate use of step JSON ID "+e);return $c[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(s){if(s instanceof ga)return De.fail(s.message);throw s}}}function Hc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(Hc(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return z.fromArray(r)}class Tr extends Ue{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)),s=new K(Hc(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 De.fromReplace(e,this.from,this.to,s)}invert(){return new wn(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 Tr(t.pos,r.pos,this.mark)}merge(e){return e instanceof Tr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Tr(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 Tr(t.from,t.to,e.markFromJSON(t.mark))}}Ue.jsonID("addMark",Tr);class wn extends Ue{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(Hc(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 Tr(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 wn(t.pos,r.pos,this.mark)}merge(e){return e instanceof wn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wn(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 wn(t.from,t.to,e.markFromJSON(t.mark))}}Ue.jsonID("removeMark",wn);class Ar extends Ue{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(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 zi(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))}}Ue.jsonID("addNodeMark",Ar);class zi extends Ue{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(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 zi(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 zi(t.pos,e.markFromJSON(t.mark))}}Ue.jsonID("removeNodeMark",zi);class je extends Ue{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Wc(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Pt([this.from,this.to-this.from,this.slice.size])}invert(e){return new je(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 je(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof je)||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 je(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 je(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 je(t.from,t.to,K.fromJSON(e,t.slice),!!t.structure)}}Ue.jsonID("replace",je);class Je extends Ue{constructor(e,t,r,i,s,a,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=a,this.structure=u}apply(e){if(this.structure&&(Wc(e,this.from,this.gapFrom)||Wc(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 Pt([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 Je(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=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||s>r.pos?null:new Je(t.pos,r.pos,i,s,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 Je(t.from,t.to,t.gapFrom,t.gapTo,K.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ue.jsonID("replaceAround",Je);function Wc(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function K5(n,e,t,r){let i=[],s=[],a,u;n.doc.nodesBetween(e,t,(c,h,p)=>{if(!c.isInline)return;let m=c.marks;if(!r.isInSet(m)&&p.type.allowsMarkType(r.type)){let y=Math.max(h,e),_=Math.min(h+c.nodeSize,t),S=r.addToSet(m);for(let E=0;E<m.length;E++)m[E].isInSet(S)||(a&&a.to==y&&a.mark.eq(m[E])?a.to=_:i.push(a=new wn(y,_,m[E])));u&&u.to==y?u.to=_:s.push(u=new Tr(y,_,r))}}),i.forEach(c=>n.step(c)),s.forEach(c=>n.step(c))}function G5(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(a,u)=>{if(!a.isInline)return;s++;let c=null;if(r instanceof Dl){let h=a.marks,p;for(;p=r.isInSet(h);)(c||(c=[])).push(p),h=p.removeFromSet(h)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let h=Math.min(u+a.nodeSize,t);for(let p=0;p<c.length;p++){let m=c[p],y;for(let _=0;_<i.length;_++){let S=i[_];S.step==s-1&&m.eq(i[_].style)&&(y=S)}y?(y.to=h,y.step=s):i.push({style:m,from:Math.max(u,e),to:h,step:s})}}}),i.forEach(a=>n.step(new wn(a.from,a.to,a.style)))}function Vc(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),a=[],u=e+1;for(let c=0;c<s.childCount;c++){let h=s.child(c),p=u+h.nodeSize,m=r.matchType(h.type);if(!m)a.push(new je(u,p,K.empty));else{r=m;for(let y=0;y<h.marks.length;y++)t.allowsMarkType(h.marks[y].type)||n.step(new wn(u,p,h.marks[y]));if(i&&h.isText&&t.whitespace!="pre"){let y,_=/\r?\n|\r/g,S;for(;y=_.exec(h.text);)S||(S=new K(z.from(t.schema.text(" ",t.allowedMarks(h.marks))),0,0)),a.push(new je(u+y.index,u+y.index+y[0].length,S))}}u=p}if(!r.validEnd){let c=r.fillBefore(z.empty,!0);n.replace(u,u,new K(c,0,0))}for(let c=a.length-1;c>=0;c--)n.step(a[c])}function J5(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function xi(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),s=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(s,a,t))return r;if(r==0||i.type.spec.isolating||!J5(i,s,a))break}return null}function j5(n,e,t){let{$from:r,$to:i,depth:s}=e,a=r.before(s+1),u=i.after(s+1),c=a,h=u,p=z.empty,m=0;for(let S=s,E=!1;S>t;S--)E||r.index(S)>0?(E=!0,p=z.from(r.node(S).copy(p)),m++):c--;let y=z.empty,_=0;for(let S=s,E=!1;S>t;S--)E||i.after(S+1)<i.end(S)?(E=!0,y=z.from(i.node(S).copy(y)),_++):h++;n.step(new Je(c,h,a,u,new K(p.append(y),m,_),p.size-m,!0))}function Uc(n,e,t=null,r=n){let i=Y5(n,e),s=i&&X5(r,e);return s?i.map(Rg).concat({type:e,attrs:t}).concat(s.map(Rg)):null}function Rg(n){return{type:n,attrs:null}}function Y5(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.contentMatchAt(r).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return t.canReplaceWith(r,i,a)?s:null}function X5(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.child(r),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let c=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;c&&h<i;h++)c=c.matchType(t.child(h).type);return!c||!c.validEnd?null:a}function Z5(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,s=e.end;n.step(new Je(i,s,i,s,new K(r,0,0),t.length,!0))}function Q5(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(a,u)=>{let c=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,c)&&ek(n.doc,n.mapping.slice(s).map(u),r)){let h=null;if(r.schema.linebreakReplacement){let _=r.whitespace=="pre",S=!!r.contentMatch.matchType(r.schema.linebreakReplacement);_&&!S?h=!1:!_&&S&&(h=!0)}h===!1&&Pg(n,a,u,s),Vc(n,n.mapping.slice(s).map(u,1),r,void 0,h===null);let p=n.mapping.slice(s),m=p.map(u,1),y=p.map(u+a.nodeSize,1);return n.step(new Je(m,y,m+1,y-1,new K(z.from(r.create(c,null,a.marks)),0,0),1,!0)),h===!0&&Lg(n,a,u,s),!1}})}function Lg(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let a,u=/\r?\n|\r/g;for(;a=u.exec(i.text);){let c=n.mapping.slice(r).map(t+1+s+a.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Pg(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=n.mapping.slice(r).map(t+1+s);n.replaceWith(a,a+1,e.type.schema.text(`
|
|
34
|
-
`))}})}function ek(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function tk(n,e,t,r,i){let s=n.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let a=t.create(r,null,i||s.marks);if(s.isLeaf)return n.replaceWith(e,e+s.nodeSize,a);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Je(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new K(z.from(a),0,0),1,!0))}function zn(n,e,t=1,r){let i=n.resolve(e),s=i.depth-t,a=r&&r[r.length-1]||i.parent;if(s<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,p=t-2;h>s;h--,p--){let m=i.node(h),y=i.index(h);if(m.type.spec.isolating)return!1;let _=m.content.cutByIndex(y,m.childCount),S=r&&r[p+1];S&&(_=_.replaceChild(0,S.type.create(S.attrs)));let E=r&&r[p]||m;if(!m.canReplace(y+1,m.childCount)||!E.type.validContent(_))return!1}let u=i.indexAfter(s),c=r&&r[0];return i.node(s).canReplaceWith(u,u,c?c.type:i.node(s+1).type)}function nk(n,e,t=1,r){let i=n.doc.resolve(e),s=z.empty,a=z.empty;for(let u=i.depth,c=i.depth-t,h=t-1;u>c;u--,h--){s=z.from(i.node(u).copy(s));let p=r&&r[h];a=z.from(p?p.type.create(p.attrs,a):i.node(u).copy(a))}n.step(new je(e,e,new K(s.append(a),t,t),!0))}function dr(n,e){let t=n.resolve(e),r=t.index();return Dg(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function rk(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),a=s.type==r?n.type.schema.nodes.text:s.type;if(t=t.matchType(a),!t||!n.type.allowsMarks(s.marks))return!1}return t.validEnd}function Dg(n,e){return!!(n&&e&&!n.isLeaf&&rk(n,e))}function xa(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let s,a,u=r.index(i);if(i==r.depth?(s=r.nodeBefore,a=r.nodeAfter):t>0?(s=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(s=r.node(i).maybeChild(u-1),a=r.node(i+1)),s&&!s.isTextblock&&Dg(s,a)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function ik(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,s=n.doc.resolve(e-t),a=s.node().type;if(i&&a.inlineContent){let p=a.whitespace=="pre",m=!!a.contentMatch.matchType(i);p&&!m?r=!1:!p&&m&&(r=!0)}let u=n.steps.length;if(r===!1){let p=n.doc.resolve(e+t);Pg(n,p.node(),p.before(),u)}a.inlineContent&&Vc(n,e+t-1,a,s.node().contentMatchAt(s.index()),r==null);let c=n.mapping.slice(u),h=c.map(e-t);if(n.step(new je(h,c.map(e+t,-1),K.empty,!0)),r===!0){let p=n.doc.resolve(h);Lg(n,p.node(),p.before(),n.steps.length)}return n}function sk(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 s=r.index(i);if(r.node(i).canReplaceWith(s,s,t))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,t))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function ok(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)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,c=r.index(a)+(u>0?1:0),h=r.node(a),p=!1;if(s==1)p=h.canReplace(c,c,i);else{let m=h.contentMatchAt(c).findWrapping(i.firstChild.type);p=m&&h.canReplaceWith(c,c,m[0])}if(p)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function Ca(n,e,t=e,r=K.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),s=n.resolve(t);return Fg(i,s,r)?new je(e,t,r):new ak(i,s,r).fit()}function Fg(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class ak{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 s=e.node(i);this.frontier.push({type:s.type,match:s.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 s=this.placed,a=r.depth,u=i.depth;for(;a&&u&&s.childCount==1;)s=s.firstChild.content,a--,u--;let c=new K(s,a,u);return e>-1?new Je(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new je(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}t=s.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=qc(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:c,match:h}=this.frontier[u],p,m=null;if(t==1&&(a?h.matchType(a.type)||(m=h.fillBefore(z.from(a),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:u,parent:s,inject:m};if(t==2&&a&&(p=h.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:s,wrap:p};if(s&&h.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=qc(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=qc(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new K(Ss(e,t-1,1),t-1,s?t-1:r)}else this.unplaced=new K(Ss(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let E=0;E<s.length;E++)this.openFrontierNode(s[E]);let a=this.unplaced,u=r?r.content:a.content,c=a.openStart-e,h=0,p=[],{match:m,type:y}=this.frontier[t];if(i){for(let E=0;E<i.childCount;E++)p.push(i.child(E));m=m.matchFragment(i)}let _=u.size+e-(a.content.size-a.openEnd);for(;h<u.childCount;){let E=u.child(h),N=m.matchType(E.type);if(!N)break;h++,(h>1||c==0||E.content.size)&&(m=N,p.push(Bg(E.mark(y.allowedMarks(E.marks)),h==1?c:0,h==u.childCount?_:-1)))}let S=h==u.childCount;S||(_=-1),this.placed=xs(this.placed,t,z.from(p)),this.frontier[t].match=m,S&&_<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,N=u;E<_;E++){let g=N.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),N=g.content}this.unplaced=S?e==0?K.empty:new K(Ss(a.content,e-1,1),e-1,_<0?a.openEnd:e-1):new K(Ss(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||!Kc(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],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Kc(e,t,i,r,s);if(a){for(let u=t-1;u>=0;u--){let{match:c,type:h}=this.frontier[u],p=Kc(e,u,h,c,!0);if(!p||p.childCount)continue e}return{depth:t,fit:a,move:s?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),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}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,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=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 qc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Bg(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Bg(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 Kc(n,e,t,r,i){let s=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==s.childCount&&!t.compatibleContent(s.type))return null;let u=r.fillBefore(s.content,!0,a);return u&&!lk(t,s.content,a)?u:null}function lk(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function uk(n){return n.spec.defining||n.spec.definingForContent}function ck(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),s=n.doc.resolve(t);if(Fg(i,s,r))return n.step(new je(e,t,r));let a=$g(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let y=i.depth,_=i.pos-1;y>0;y--,_--){let S=i.node(y).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(y)>-1?u=y:i.before(y)==_&&a.splice(1,0,-y)}let c=a.indexOf(u),h=[],p=r.openStart;for(let y=r.content,_=0;;_++){let S=y.firstChild;if(h.push(S),_==r.openStart)break;y=S.content}for(let y=p-1;y>=0;y--){let _=h[y],S=uk(_.type);if(S&&!_.sameMarkup(i.node(Math.abs(u)-1)))p=y;else if(S||!_.type.isTextblock)break}for(let y=r.openStart;y>=0;y--){let _=(y+p+1)%(r.openStart+1),S=h[_];if(S)for(let E=0;E<a.length;E++){let N=a[(E+c)%a.length],g=!0;N<0&&(g=!1,N=-N);let v=i.node(N-1),k=i.index(N-1);if(v.canReplaceWith(k,k,S.type,S.marks))return n.replace(i.before(N),g?s.after(N):t,new K(zg(r.content,0,r.openStart,_),_,r.openEnd))}}let m=n.steps.length;for(let y=a.length-1;y>=0&&(n.replace(e,t,r),!(n.steps.length>m));y--){let _=a[y];_<0||(e=i.before(_),t=s.after(_))}}function zg(n,e,t,r,i){if(e<t){let s=n.firstChild;n=n.replaceChild(0,s.copy(zg(s.content,e+1,t,r,s)))}if(e>r){let s=i.contentMatchAt(0),a=s.fillBefore(n).append(n);n=a.append(s.matchFragment(a).fillBefore(z.empty,!0))}return n}function fk(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=sk(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new K(z.from(r),0,0))}function hk(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),s=$g(r,i);for(let a=0;a<s.length;a++){let u=s[a],c=a==s.length-1;if(c&&u==0||r.node(u).type.contentMatch.validEnd)return n.delete(r.start(u),i.end(u));if(u>0&&(c||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&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return n.delete(r.before(a),t);n.delete(e,t)}function $g(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let s=n.start(i);if(s<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;(s==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class $i extends Ue{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 s in t.attrs)r[s]=t.attrs[s];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(z.from(i),0,t.isLeaf?0:1))}getMap(){return Pt.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)}}Ue.jsonID("attr",$i);class Ks extends Ue{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return De.ok(r)}getMap(){return Pt.empty}invert(e){return new Ks(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ks(t.attr,t.value)}}Ue.jsonID("docAttr",Ks);let Ci=class extends Error{};Ci=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Ci.prototype=Object.create(Error.prototype),Ci.prototype.constructor=Ci,Ci.prototype.name="TransformError";class dk{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 Ci(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=Ca(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 ck(this,e,t,r),this}replaceRangeWith(e,t,r){return fk(this,e,t,r),this}deleteRange(e,t){return hk(this,e,t),this}lift(e,t){return j5(this,e,t),this}join(e,t=1){return ik(this,e,t),this}wrap(e,t){return Z5(this,e,t),this}setBlockType(e,t=e,r,i=null){return Q5(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return tk(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new $i(e,t,r)),this}setDocAttribute(e,t){return this.step(new Ks(e,t)),this}addNodeMark(e,t){return this.step(new Ar(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Oe)){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 zi(e,t)),this}split(e,t=1,r){return nk(this,e,t,r),this}addMark(e,t,r){return K5(this,e,t,r),this}removeMark(e,t,r){return G5(this,e,t,r),this}clearIncompatible(e,t,r){return Vc(this,e,t,r),this}}const Gc=Object.create(null);class ye{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new pk(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 s=e.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:c,$to:h}=a[u],p=e.mapping.slice(s);e.replaceRange(p.map(c.pos),p.map(h.pos),u?K.empty:t),u==0&&Vg(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:u}=i[s],c=e.mapping.slice(r),h=c.map(a.pos),p=c.map(u.pos);s?e.deleteRange(h,p):(e.replaceRangeWith(h,p,t),Vg(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new pe(e):Ei(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=t<0?Ei(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):Ei(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Lt(e.node(0))}static atStart(e){return Ei(e,e,0,0,1)||new Lt(e)}static atEnd(e){return Ei(e,e,e.content.size,e.childCount,-1)||new Lt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Gc[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 Gc)throw new RangeError("Duplicate use of selection JSON ID "+e);return Gc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return pe.between(this.$anchor,this.$head).getBookmark()}}ye.prototype.visible=!0;class pk{constructor(e,t){this.$from=e,this.$to=t}}let Hg=!1;function Wg(n){!Hg&&!n.parent.inlineContent&&(Hg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class pe extends ye{constructor(e,t=e){Wg(e),Wg(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 ye.near(r);let i=e.resolve(t.map(this.anchor));return new pe(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 pe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Fl(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 pe(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 s=ye.findFrom(t,r,!0)||ye.findFrom(t,-r,!0);if(s)t=s.$head;else return ye.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ye.findFrom(e,-r,!0)||ye.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new pe(e,t)}}ye.jsonID("text",pe);class Fl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Fl(e.map(this.anchor),e.map(this.head))}resolve(e){return pe.between(e.resolve(this.anchor),e.resolve(this.head))}}class Q extends ye{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),s=e.resolve(i);return r?ye.near(s):new Q(s)}content(){return new K(z.from(this.node),0,0)}eq(e){return e instanceof Q&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new xh(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Q(e.resolve(t.anchor))}static create(e,t){return new Q(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Q.prototype.visible=!1,ye.jsonID("node",Q);class xh{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Fl(r,r):new xh(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Q.isSelectable(r)?new Q(t):ye.near(t)}}class Lt extends ye{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=ye.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Lt(e)}map(e){return new Lt(e)}eq(e){return e instanceof Lt}getBookmark(){return mk}}ye.jsonID("all",Lt);const mk={map(){return this},resolve(n){return new Lt(n)}};function Ei(n,e,t,r,i,s=!1){if(e.inlineContent)return pe.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(!s&&Q.isSelectable(u))return Q.create(n,t-(i<0?u.nodeSize:0))}else{let c=Ei(n,u,t+i,i<0?u.childCount:0,i,s);if(c)return c}t+=u.nodeSize*i}return null}function Vg(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof je||i instanceof Je))return;let s=n.mapping.maps[r],a;s.forEach((u,c,h,p)=>{a==null&&(a=p)}),n.setSelection(ye.near(n.doc.resolve(a),t))}function Ug(n,e){return!e||!n?n:n.bind(e)}class Ea{constructor(e,t,r){this.name=e,this.init=Ug(t.init,r),this.apply=Ug(t.apply,r)}}new Ea("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Ea("selection",{init(n,e){return n.selection||ye.atStart(e.doc)},apply(n){return n.selection}}),new Ea("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Ea("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function qg(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=qg(i,e,{})),t[r]=i}return t}class ct{constructor(e){this.spec=e,this.props={},e.props&&qg(e.props,this,this.props),this.key=e.key?e.key.key:Kg("plugin")}getState(e){return e[this.key]}}const Jc=Object.create(null);function Kg(n){return n in Jc?n+"$"+ ++Jc[n]:(Jc[n]=0,n+"$")}class It{constructor(e="key"){this.key=Kg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Vr=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Gg=function(n,e,t,r){return t&&(Jg(n,e,t,r,-1)||Jg(n,e,t,r,1))},gk=/^(img|br|input|textarea|hr)$/i;function Jg(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:ka(n))){let s=n.parentNode;if(!s||s.nodeType!=1||jc(n)||gk.test(n.nodeName)||n.contentEditable=="false")return!1;e=Vr(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?ka(n):0}else return!1}}function ka(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function yk(n,e,t){for(let r=e==0,i=e==ka(n);r||i;){if(n==t)return!0;let s=Vr(n);if(n=n.parentNode,!n)return!1;r=r&&s==0,i=i&&s==ka(n)}}function jc(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 jg=function(n){return n.focusNode&&Gg(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Yg(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const pn=typeof navigator<"u"?navigator:null,Xg=typeof document<"u"?document:null,pr=pn&&pn.userAgent||"",Yc=/Edge\/(\d+)/.exec(pr),Zg=/MSIE \d/.exec(pr),Xc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pr),Cs=!!(Zg||Xc||Yc),Qg=Zg?document.documentMode:Xc?+Xc[1]:Yc?+Yc[1]:0,Ta=!Cs&&/gecko\/(\d+)/i.test(pr);Ta&&+(/Firefox\/(\d+)/.exec(pr)||[0,0])[1];const Zc=!Cs&&/Chrome\/(\d+)/.exec(pr),mr=!!Zc,e0=Zc?+Zc[1]:0,Ur=!Cs&&!!pn&&/Apple Computer/.test(pn.vendor),Qc=Ur&&(/Mobile\/\w+/.test(pr)||!!pn&&pn.maxTouchPoints>2),Gt=Qc||(pn?/Mac/.test(pn.platform):!1),bk=pn?/Win/.test(pn.platform):!1,Es=/Android \d/.test(pr),ef=!!Xg&&"webkitFontSmoothing"in Xg.documentElement.style,_k=ef?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wk(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),s=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let u=r.resolve(a),c,h;if(jg(t)){for(c=a;i&&!i.node;)i=i.parent;let m=i.node;if(i&&m.isAtom&&Q.isSelectable(m)&&i.parent&&!(m.isInline&&yk(t.focusNode,t.focusOffset,i.dom))){let y=i.posBefore;h=new Q(a==y?u:r.resolve(y))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let m=a,y=a;for(let _=0;_<t.rangeCount;_++){let S=t.getRangeAt(_);m=Math.min(m,n.docView.posFromDOM(S.startContainer,S.startOffset,1)),y=Math.max(y,n.docView.posFromDOM(S.endContainer,S.endOffset,-1))}if(m<0)return null;[c,a]=y==n.state.selection.anchor?[y,m]:[m,y],u=r.resolve(a)}else c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null}let p=r.resolve(c);if(!h){let m=e=="pointer"||n.state.selection.head<u.pos&&!s?1:-1;h=o0(n,p,u,m)}return h}function t0(n){return n.editable?n.hasFocus():Ck(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function tf(n,e=!1){let t=n.state.selection;if(xk(n,t),!!t0(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&mr){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Gg(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)Sk(n);else{let{anchor:r,head:i}=t,s,a;n0&&!(t instanceof pe)&&(t.$from.parent.inlineContent||(s=r0(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=r0(n,t.to))),n.docView.setSelection(r,i,n,e),n0&&(s&&i0(s),a&&i0(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&vk(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const n0=Ur||mr&&e0<63;function r0(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,s=r?t.childNodes[r-1]:null;if(Ur&&i&&i.contentEditable=="false")return nf(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return nf(i);if(s)return nf(s)}}function nf(n){return n.contentEditable="true",Ur&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function i0(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function vk(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(()=>{(!t0(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Sk(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setStart(r.parentNode,Vr(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Cs&&Qg<=11&&(r.disabled=!0,r.disabled=!1)}function xk(n,e){if(e instanceof Q){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(s0(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else s0(n)}function s0(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function o0(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||pe.between(e,t,r)}function Ck(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 rf(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),s=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ye.findFrom(s,e)}function gr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function a0(n,e,t){let r=n.state.selection;if(r instanceof pe)if(t.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=n.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return gr(n,new pe(r.$anchor,a))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=rf(n.state,e);return i&&i instanceof Q?gr(n,i):!1}else if(!(Gt&&t.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;let u=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=n.docView.descAt(u))&&!a.contentDOM?Q.isSelectable(s)?gr(n,new Q(e<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):ef?gr(n,new pe(n.state.doc.resolve(e<0?u:u+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Q&&r.node.isInline)return gr(n,new pe(e>0?r.$to:r.$from));{let i=rf(n.state,e);return i?gr(n,i):!1}}}function Aa(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ks(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function ki(n,e){return e<0?Ek(n):kk(n)}function Ek(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,s,a=!1;for(Ta&&t.nodeType==1&&r<Aa(t)&&ks(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(ks(u,-1))i=t,s=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(l0(t))break;{let u=t.previousSibling;for(;u&&ks(u,-1);)i=t.parentNode,s=Vr(u),u=u.previousSibling;if(u)t=u,r=Aa(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?sf(n,t,r):i&&sf(n,i,s)}function kk(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Aa(t),s,a;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(ks(u,1))s=t,a=++r;else break}else{if(l0(t))break;{let u=t.nextSibling;for(;u&&ks(u,1);)s=u.parentNode,a=Vr(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=Aa(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}s&&sf(n,s,a)}function l0(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Tk(n,e){for(;n&&e==n.childNodes.length&&!jc(n);)e=Vr(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function Ak(n,e){for(;n&&!e&&!jc(n);)e=Vr(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function sf(n,e,t){if(e.nodeType!=3){let s,a;(a=Tk(e,t))?(e=a,t=0):(s=Ak(e,t))&&(e=s,t=s.nodeValue.length)}let r=n.domSelection();if(!r)return;if(jg(r)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&tf(n)},50)}function u0(n,e){let t=n.state.doc.resolve(e);if(!(mr||bk)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let s=n.coordsAtPos(e-1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=n.coordsAtPos(e+1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function c0(n,e,t){let r=n.state.selection;if(r instanceof pe&&!r.empty||t.indexOf("s")>-1||Gt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=rf(n.state,e);if(a&&a instanceof Q)return gr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:s,u=r instanceof Lt?ye.near(a,e):ye.findFrom(a,e);return u?gr(n,u):!1}return!1}function f0(n,e){if(!(n.state.selection instanceof pe))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 s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let a=n.state.tr;return e<0?a.delete(t.pos-s.nodeSize,t.pos):a.delete(t.pos,t.pos+s.nodeSize),n.dispatch(a),!0}return!1}function h0(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;h0(n,r,"true"),setTimeout(()=>h0(n,r,"false"),20)}return!1}function Mk(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Ik(n,e){let t=e.keyCode,r=Mk(e);if(t==8||Gt&&t==72&&r=="c")return f0(n,-1)||ki(n,-1);if(t==46&&!e.shiftKey||Gt&&t==68&&r=="c")return f0(n,1)||ki(n,1);if(t==13||t==27)return!0;if(t==37||Gt&&t==66&&r=="c"){let i=t==37?u0(n,n.state.selection.from)=="ltr"?-1:1:-1;return a0(n,i,r)||ki(n,i)}else if(t==39||Gt&&t==70&&r=="c"){let i=t==39?u0(n,n.state.selection.from)=="ltr"?1:-1:1;return a0(n,i,r)||ki(n,i)}else{if(t==38||Gt&&t==80&&r=="c")return c0(n,-1,r)||ki(n,-1);if(t==40||Gt&&t==78&&r=="c")return Ok(n)||c0(n,1,r)||ki(n,1);if(r==(Gt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function d0(n,e){n.someProp("transformCopied",_=>{e=_(e,n)});let t=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let _=r.firstChild;t.push(_.type.name,_.attrs!=_.type.defaultAttrs?_.attrs:null),r=_.content}let a=n.someProp("clipboardSerializer")||Us.fromSchema(n.state.schema),u=v0(),c=u.createElement("div");c.appendChild(a.serializeFragment(r,{document:u}));let h=c.firstChild,p,m=0;for(;h&&h.nodeType==1&&(p=_0[h.nodeName.toLowerCase()]);){for(let _=p.length-1;_>=0;_--){let S=u.createElement(p[_]);for(;c.firstChild;)S.appendChild(c.firstChild);c.appendChild(S),m++}h=c.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${i} ${s}${m?` -${m}`:""} ${JSON.stringify(t)}`);let y=n.someProp("clipboardTextSerializer",_=>_(e,n))||e.content.textBetween(0,e.content.size,`
|
|
33
|
+
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=r.getPropertyValue(s);if(a)for(let u=void 0;;){let c=this.parser.matchStyle(s,a,this,u);if(!c)break;if(c.ignore)return null;if(c.clearMark?t=t.filter(h=>!c.clearMark(h)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)u=c;else break}}return t}addElementByRule(e,t,r,i){let s,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(a,t.attrs||null,r,t.preserveWhitespace);c&&(s=!0,r=c)}else{let c=this.parser.schema.marks[t.mark];r=r.concat(c.create(t.attrs))}let u=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}s&&this.sync(u)&&this.open--}addAll(e,t,r,i){let s=r||0;for(let a=r?e.childNodes[r]:e.firstChild,u=i==null?null:e.childNodes[i];a!=u;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,t);this.findAtPoint(e,s)}findPlace(e,t){let r,i;for(let s=this.open;s>=0;s--){let a=this.nodes[s],u=a.findWrapping(e);if(u&&(!r||r.length>u.length)&&(r=u,i=a,!u.length)||a.solid)break}if(!r)return null;this.sync(i);for(let s=0;s<r.length;s++)t=this.enterInner(r[s],null,t,!1);return t}insertNode(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let r=this.findPlace(e,t);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=Oe.none;for(let a of r.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):Cg(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,t,r,i){let s=this.findPlace(e.create(t),r);return s&&(s=this.enterInner(e,t,r,!0,i)),s}enterInner(e,t,r,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let u=vg(e,s,a.options);a.options&wa&&a.content.length==0&&(u|=wa);let c=Oe.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):Cg(h.type,e))?(c=h.addToSet(c),!1):!0),this.nodes.push(new va(e,t,c,i,null,u)),this.open++,r}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;this.localPreserveWS&&(this.nodes[t].options|=Ss)}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),s=-(r?r.depth+1:0)+(i?0:1),a=(u,c)=>{for(;u>=0;u--){let h=t[u];if(h==""){if(u==t.length-1||u==0)continue;for(;c>=s;c--)if(a(u-1,c))return!0;return!1}else{let p=c>0||c==0&&i?this.nodes[c].type:r&&c>=s?r.node(c-s).type:null;if(!p||p.name!=h&&!p.isInGroup(h))return!1;c--}}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}}}function $5(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&wg.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function H5(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function xg(n){let e={};for(let t in n)e[t]=n[t];return e}function Cg(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],a=u=>{s.push(u);for(let c=0;c<u.edgeCount;c++){let{type:h,next:p}=u.edge(c);if(h==e||s.indexOf(p)<0&&a(p))return!0}};if(a(i.contentMatch))return!0}}class qs{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Bc(t).createDocumentFragment());let i=r,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let u=0,c=0;for(;u<s.length&&c<a.marks.length;){let h=a.marks[c];if(!this.marks[h.type.name]){c++;continue}if(!h.eq(s[u][0])||h.type.spec.spanning===!1)break;u++,c++}for(;u<s.length;)i=s.pop()[1];for(;c<a.marks.length;){let h=a.marks[c++],p=this.serializeMark(h,a.isInline,t);p&&(s.push([h,i]),i.appendChild(p.dom),i=p.contentDOM||p.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Sa(Bc(t),this.nodes[e.type.name](e),null,e.attrs);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 s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Sa(Bc(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return Sa(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new qs(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Eg(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Eg(e.marks)}}function Eg(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Bc(n){return n.document||window.document}const kg=new WeakMap;function W5(n){let e=kg.get(n);return e===void 0&&kg.set(n,e=V5(n)),e}function V5(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function Sa(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=W5(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(t=i.slice(0,a),i=i.slice(a+1));let u,c=t?n.createElementNS(t,i):n.createElement(i),h=e[1],p=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){p=2;for(let m in h)if(h[m]!=null){let y=m.indexOf(" ");y>0?c.setAttributeNS(m.slice(0,y),m.slice(y+1),h[m]):c.setAttribute(m,h[m])}}for(let m=p;m<e.length;m++){let y=e[m];if(y===0){if(m<e.length-1||m>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:_,contentDOM:S}=Sa(n,y,t,r);if(c.appendChild(_),S){if(u)throw new RangeError("Multiple content holes");u=S}}}return{dom:c,contentDOM:u}}const Ag=65535,Tg=Math.pow(2,16);function U5(n,e){return n+e*Tg}function Og(n){return n&Ag}function q5(n){return(n-(n&Ag))/Tg}const Mg=1,Ig=2,xa=4,Ng=8;class zc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ng)>0}get deletedBefore(){return(this.delInfo&(Mg|xa))>0}get deletedAfter(){return(this.delInfo&(Ig|xa))>0}get deletedAcross(){return(this.delInfo&xa)>0}}class Pt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Pt.empty)return Pt.empty}recover(e){let t=0,r=Og(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+q5(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,s=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let c=this.ranges[u]-(this.inverted?i:0);if(c>e)break;let h=this.ranges[u+s],p=this.ranges[u+a],m=c+h;if(e<=m){let y=h?e==c?-1:e==m?1:t:t,_=c+i+(y<0?0:p);if(r)return _;let S=e==(t<0?c:m)?null:U5(u/3,e-c),E=e==c?Ig:e==m?Mg:xa;return(t<0?e!=c:e!=m)&&(E|=Ng),new zc(_,E,S)}i+=p-h}return r?e+i:new zc(e+i,0,null)}touches(e,t){let r=0,i=Og(t),s=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let c=this.ranges[u]-(this.inverted?r:0);if(c>e)break;let h=this.ranges[u+s],p=c+h;if(e<=p&&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,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?s:0),c=a+(this.inverted?0:s),h=this.ranges[i+t],p=this.ranges[i+r];e(u,u+h,c,c+p),s+=p-h}}invert(){return new Pt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Pt.empty:new Pt(e<0?[0,-e,0]:[0,0,e])}}Pt.empty=new Pt([]);class zi{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 zi(this.maps,this.mirror,e,t)}copy(){return new zi(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 zi;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 s=this.from;s<this.to;s++){let a=this.maps[s],u=a.mapResult(e,t);if(u.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,e=this.maps[c].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new zc(e,i,null)}}const $c=Object.create(null);class Ue{getMap(){return Pt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=$c[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 $c)throw new RangeError("Duplicate use of step JSON ID "+e);return $c[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(s){if(s instanceof ya)return De.fail(s.message);throw s}}}function Hc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(Hc(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return z.fromArray(r)}class Ar extends Ue{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)),s=new K(Hc(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 De.fromReplace(e,this.from,this.to,s)}invert(){return new wn(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 Ar(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ar&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ar(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 Ar(t.from,t.to,e.markFromJSON(t.mark))}}Ue.jsonID("addMark",Ar);class wn extends Ue{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(Hc(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 Ar(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 wn(t.pos,r.pos,this.mark)}merge(e){return e instanceof wn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wn(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 wn(t.from,t.to,e.markFromJSON(t.mark))}}Ue.jsonID("removeMark",wn);class Tr extends Ue{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(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 Tr(this.pos,t.marks[i]);return new Tr(this.pos,this.mark)}}return new $i(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Tr(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 Tr(t.pos,e.markFromJSON(t.mark))}}Ue.jsonID("addNodeMark",Tr);class $i extends Ue{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(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 Tr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $i(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 $i(t.pos,e.markFromJSON(t.mark))}}Ue.jsonID("removeNodeMark",$i);class je extends Ue{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Wc(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Pt([this.from,this.to-this.from,this.slice.size])}invert(e){return new je(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 je(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof je)||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 je(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 je(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 je(t.from,t.to,K.fromJSON(e,t.slice),!!t.structure)}}Ue.jsonID("replace",je);class Je extends Ue{constructor(e,t,r,i,s,a,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=a,this.structure=u}apply(e){if(this.structure&&(Wc(e,this.from,this.gapFrom)||Wc(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 Pt([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 Je(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=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||s>r.pos?null:new Je(t.pos,r.pos,i,s,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 Je(t.from,t.to,t.gapFrom,t.gapTo,K.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ue.jsonID("replaceAround",Je);function Wc(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function K5(n,e,t,r){let i=[],s=[],a,u;n.doc.nodesBetween(e,t,(c,h,p)=>{if(!c.isInline)return;let m=c.marks;if(!r.isInSet(m)&&p.type.allowsMarkType(r.type)){let y=Math.max(h,e),_=Math.min(h+c.nodeSize,t),S=r.addToSet(m);for(let E=0;E<m.length;E++)m[E].isInSet(S)||(a&&a.to==y&&a.mark.eq(m[E])?a.to=_:i.push(a=new wn(y,_,m[E])));u&&u.to==y?u.to=_:s.push(u=new Ar(y,_,r))}}),i.forEach(c=>n.step(c)),s.forEach(c=>n.step(c))}function G5(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(a,u)=>{if(!a.isInline)return;s++;let c=null;if(r instanceof Dl){let h=a.marks,p;for(;p=r.isInSet(h);)(c||(c=[])).push(p),h=p.removeFromSet(h)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let h=Math.min(u+a.nodeSize,t);for(let p=0;p<c.length;p++){let m=c[p],y;for(let _=0;_<i.length;_++){let S=i[_];S.step==s-1&&m.eq(i[_].style)&&(y=S)}y?(y.to=h,y.step=s):i.push({style:m,from:Math.max(u,e),to:h,step:s})}}}),i.forEach(a=>n.step(new wn(a.from,a.to,a.style)))}function Vc(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),a=[],u=e+1;for(let c=0;c<s.childCount;c++){let h=s.child(c),p=u+h.nodeSize,m=r.matchType(h.type);if(!m)a.push(new je(u,p,K.empty));else{r=m;for(let y=0;y<h.marks.length;y++)t.allowsMarkType(h.marks[y].type)||n.step(new wn(u,p,h.marks[y]));if(i&&h.isText&&t.whitespace!="pre"){let y,_=/\r?\n|\r/g,S;for(;y=_.exec(h.text);)S||(S=new K(z.from(t.schema.text(" ",t.allowedMarks(h.marks))),0,0)),a.push(new je(u+y.index,u+y.index+y[0].length,S))}}u=p}if(!r.validEnd){let c=r.fillBefore(z.empty,!0);n.replace(u,u,new K(c,0,0))}for(let c=a.length-1;c>=0;c--)n.step(a[c])}function J5(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function xi(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),s=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(s,a,t))return r;if(r==0||i.type.spec.isolating||!J5(i,s,a))break}return null}function j5(n,e,t){let{$from:r,$to:i,depth:s}=e,a=r.before(s+1),u=i.after(s+1),c=a,h=u,p=z.empty,m=0;for(let S=s,E=!1;S>t;S--)E||r.index(S)>0?(E=!0,p=z.from(r.node(S).copy(p)),m++):c--;let y=z.empty,_=0;for(let S=s,E=!1;S>t;S--)E||i.after(S+1)<i.end(S)?(E=!0,y=z.from(i.node(S).copy(y)),_++):h++;n.step(new Je(c,h,a,u,new K(p.append(y),m,_),p.size-m,!0))}function Uc(n,e,t=null,r=n){let i=Y5(n,e),s=i&&X5(r,e);return s?i.map(Rg).concat({type:e,attrs:t}).concat(s.map(Rg)):null}function Rg(n){return{type:n,attrs:null}}function Y5(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.contentMatchAt(r).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return t.canReplaceWith(r,i,a)?s:null}function X5(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.child(r),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let c=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;c&&h<i;h++)c=c.matchType(t.child(h).type);return!c||!c.validEnd?null:a}function Z5(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,s=e.end;n.step(new Je(i,s,i,s,new K(r,0,0),t.length,!0))}function Q5(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(a,u)=>{let c=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,c)&&ek(n.doc,n.mapping.slice(s).map(u),r)){let h=null;if(r.schema.linebreakReplacement){let _=r.whitespace=="pre",S=!!r.contentMatch.matchType(r.schema.linebreakReplacement);_&&!S?h=!1:!_&&S&&(h=!0)}h===!1&&Pg(n,a,u,s),Vc(n,n.mapping.slice(s).map(u,1),r,void 0,h===null);let p=n.mapping.slice(s),m=p.map(u,1),y=p.map(u+a.nodeSize,1);return n.step(new Je(m,y,m+1,y-1,new K(z.from(r.create(c,null,a.marks)),0,0),1,!0)),h===!0&&Lg(n,a,u,s),!1}})}function Lg(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let a,u=/\r?\n|\r/g;for(;a=u.exec(i.text);){let c=n.mapping.slice(r).map(t+1+s+a.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Pg(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=n.mapping.slice(r).map(t+1+s);n.replaceWith(a,a+1,e.type.schema.text(`
|
|
34
|
+
`))}})}function ek(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function tk(n,e,t,r,i){let s=n.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let a=t.create(r,null,i||s.marks);if(s.isLeaf)return n.replaceWith(e,e+s.nodeSize,a);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Je(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new K(z.from(a),0,0),1,!0))}function zn(n,e,t=1,r){let i=n.resolve(e),s=i.depth-t,a=r&&r[r.length-1]||i.parent;if(s<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,p=t-2;h>s;h--,p--){let m=i.node(h),y=i.index(h);if(m.type.spec.isolating)return!1;let _=m.content.cutByIndex(y,m.childCount),S=r&&r[p+1];S&&(_=_.replaceChild(0,S.type.create(S.attrs)));let E=r&&r[p]||m;if(!m.canReplace(y+1,m.childCount)||!E.type.validContent(_))return!1}let u=i.indexAfter(s),c=r&&r[0];return i.node(s).canReplaceWith(u,u,c?c.type:i.node(s+1).type)}function nk(n,e,t=1,r){let i=n.doc.resolve(e),s=z.empty,a=z.empty;for(let u=i.depth,c=i.depth-t,h=t-1;u>c;u--,h--){s=z.from(i.node(u).copy(s));let p=r&&r[h];a=z.from(p?p.type.create(p.attrs,a):i.node(u).copy(a))}n.step(new je(e,e,new K(s.append(a),t,t),!0))}function dr(n,e){let t=n.resolve(e),r=t.index();return Dg(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function rk(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),a=s.type==r?n.type.schema.nodes.text:s.type;if(t=t.matchType(a),!t||!n.type.allowsMarks(s.marks))return!1}return t.validEnd}function Dg(n,e){return!!(n&&e&&!n.isLeaf&&rk(n,e))}function Ca(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let s,a,u=r.index(i);if(i==r.depth?(s=r.nodeBefore,a=r.nodeAfter):t>0?(s=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(s=r.node(i).maybeChild(u-1),a=r.node(i+1)),s&&!s.isTextblock&&Dg(s,a)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function ik(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,s=n.doc.resolve(e-t),a=s.node().type;if(i&&a.inlineContent){let p=a.whitespace=="pre",m=!!a.contentMatch.matchType(i);p&&!m?r=!1:!p&&m&&(r=!0)}let u=n.steps.length;if(r===!1){let p=n.doc.resolve(e+t);Pg(n,p.node(),p.before(),u)}a.inlineContent&&Vc(n,e+t-1,a,s.node().contentMatchAt(s.index()),r==null);let c=n.mapping.slice(u),h=c.map(e-t);if(n.step(new je(h,c.map(e+t,-1),K.empty,!0)),r===!0){let p=n.doc.resolve(h);Lg(n,p.node(),p.before(),n.steps.length)}return n}function sk(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 s=r.index(i);if(r.node(i).canReplaceWith(s,s,t))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,t))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function ok(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)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,c=r.index(a)+(u>0?1:0),h=r.node(a),p=!1;if(s==1)p=h.canReplace(c,c,i);else{let m=h.contentMatchAt(c).findWrapping(i.firstChild.type);p=m&&h.canReplaceWith(c,c,m[0])}if(p)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function Ea(n,e,t=e,r=K.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),s=n.resolve(t);return Fg(i,s,r)?new je(e,t,r):new ak(i,s,r).fit()}function Fg(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class ak{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 s=e.node(i);this.frontier.push({type:s.type,match:s.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 s=this.placed,a=r.depth,u=i.depth;for(;a&&u&&s.childCount==1;)s=s.firstChild.content,a--,u--;let c=new K(s,a,u);return e>-1?new Je(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new je(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}t=s.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=qc(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:c,match:h}=this.frontier[u],p,m=null;if(t==1&&(a?h.matchType(a.type)||(m=h.fillBefore(z.from(a),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:u,parent:s,inject:m};if(t==2&&a&&(p=h.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:s,wrap:p};if(s&&h.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=qc(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=qc(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new K(xs(e,t-1,1),t-1,s?t-1:r)}else this.unplaced=new K(xs(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let E=0;E<s.length;E++)this.openFrontierNode(s[E]);let a=this.unplaced,u=r?r.content:a.content,c=a.openStart-e,h=0,p=[],{match:m,type:y}=this.frontier[t];if(i){for(let E=0;E<i.childCount;E++)p.push(i.child(E));m=m.matchFragment(i)}let _=u.size+e-(a.content.size-a.openEnd);for(;h<u.childCount;){let E=u.child(h),N=m.matchType(E.type);if(!N)break;h++,(h>1||c==0||E.content.size)&&(m=N,p.push(Bg(E.mark(y.allowedMarks(E.marks)),h==1?c:0,h==u.childCount?_:-1)))}let S=h==u.childCount;S||(_=-1),this.placed=Cs(this.placed,t,z.from(p)),this.frontier[t].match=m,S&&_<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,N=u;E<_;E++){let g=N.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),N=g.content}this.unplaced=S?e==0?K.empty:new K(xs(a.content,e-1,1),e-1,_<0?a.openEnd:e-1):new K(xs(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||!Kc(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],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Kc(e,t,i,r,s);if(a){for(let u=t-1;u>=0;u--){let{match:c,type:h}=this.frontier[u],p=Kc(e,u,h,c,!0);if(!p||p.childCount)continue e}return{depth:t,fit:a,move:s?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=Cs(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Cs(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=Cs(this.placed,this.frontier.length,t))}}function xs(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(xs(n.firstChild.content,e-1,t)))}function Cs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Cs(n.lastChild.content,e-1,t)))}function qc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Bg(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Bg(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 Kc(n,e,t,r,i){let s=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==s.childCount&&!t.compatibleContent(s.type))return null;let u=r.fillBefore(s.content,!0,a);return u&&!lk(t,s.content,a)?u:null}function lk(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function uk(n){return n.spec.defining||n.spec.definingForContent}function ck(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),s=n.doc.resolve(t);if(Fg(i,s,r))return n.step(new je(e,t,r));let a=$g(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let y=i.depth,_=i.pos-1;y>0;y--,_--){let S=i.node(y).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(y)>-1?u=y:i.before(y)==_&&a.splice(1,0,-y)}let c=a.indexOf(u),h=[],p=r.openStart;for(let y=r.content,_=0;;_++){let S=y.firstChild;if(h.push(S),_==r.openStart)break;y=S.content}for(let y=p-1;y>=0;y--){let _=h[y],S=uk(_.type);if(S&&!_.sameMarkup(i.node(Math.abs(u)-1)))p=y;else if(S||!_.type.isTextblock)break}for(let y=r.openStart;y>=0;y--){let _=(y+p+1)%(r.openStart+1),S=h[_];if(S)for(let E=0;E<a.length;E++){let N=a[(E+c)%a.length],g=!0;N<0&&(g=!1,N=-N);let v=i.node(N-1),k=i.index(N-1);if(v.canReplaceWith(k,k,S.type,S.marks))return n.replace(i.before(N),g?s.after(N):t,new K(zg(r.content,0,r.openStart,_),_,r.openEnd))}}let m=n.steps.length;for(let y=a.length-1;y>=0&&(n.replace(e,t,r),!(n.steps.length>m));y--){let _=a[y];_<0||(e=i.before(_),t=s.after(_))}}function zg(n,e,t,r,i){if(e<t){let s=n.firstChild;n=n.replaceChild(0,s.copy(zg(s.content,e+1,t,r,s)))}if(e>r){let s=i.contentMatchAt(0),a=s.fillBefore(n).append(n);n=a.append(s.matchFragment(a).fillBefore(z.empty,!0))}return n}function fk(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=sk(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new K(z.from(r),0,0))}function hk(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),s=$g(r,i);for(let a=0;a<s.length;a++){let u=s[a],c=a==s.length-1;if(c&&u==0||r.node(u).type.contentMatch.validEnd)return n.delete(r.start(u),i.end(u));if(u>0&&(c||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&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return n.delete(r.before(a),t);n.delete(e,t)}function $g(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let s=n.start(i);if(s<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;(s==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class Hi extends Ue{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 s in t.attrs)r[s]=t.attrs[s];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(z.from(i),0,t.isLeaf?0:1))}getMap(){return Pt.empty}invert(e){return new Hi(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 Hi(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 Hi(t.pos,t.attr,t.value)}}Ue.jsonID("attr",Hi);class Gs extends Ue{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return De.ok(r)}getMap(){return Pt.empty}invert(e){return new Gs(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Gs(t.attr,t.value)}}Ue.jsonID("docAttr",Gs);let Ci=class extends Error{};Ci=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Ci.prototype=Object.create(Error.prototype),Ci.prototype.constructor=Ci,Ci.prototype.name="TransformError";class dk{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new zi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ci(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=Ea(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 ck(this,e,t,r),this}replaceRangeWith(e,t,r){return fk(this,e,t,r),this}deleteRange(e,t){return hk(this,e,t),this}lift(e,t){return j5(this,e,t),this}join(e,t=1){return ik(this,e,t),this}wrap(e,t){return Z5(this,e,t),this}setBlockType(e,t=e,r,i=null){return Q5(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return tk(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Hi(e,t,r)),this}setDocAttribute(e,t){return this.step(new Gs(e,t)),this}addNodeMark(e,t){return this.step(new Tr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Oe)){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 $i(e,t)),this}split(e,t=1,r){return nk(this,e,t,r),this}addMark(e,t,r){return K5(this,e,t,r),this}removeMark(e,t,r){return G5(this,e,t,r),this}clearIncompatible(e,t,r){return Vc(this,e,t,r),this}}const Gc=Object.create(null);class ye{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new pk(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 s=e.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:c,$to:h}=a[u],p=e.mapping.slice(s);e.replaceRange(p.map(c.pos),p.map(h.pos),u?K.empty:t),u==0&&Vg(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:u}=i[s],c=e.mapping.slice(r),h=c.map(a.pos),p=c.map(u.pos);s?e.deleteRange(h,p):(e.replaceRangeWith(h,p,t),Vg(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new pe(e):Ei(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=t<0?Ei(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):Ei(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Lt(e.node(0))}static atStart(e){return Ei(e,e,0,0,1)||new Lt(e)}static atEnd(e){return Ei(e,e,e.content.size,e.childCount,-1)||new Lt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Gc[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 Gc)throw new RangeError("Duplicate use of selection JSON ID "+e);return Gc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return pe.between(this.$anchor,this.$head).getBookmark()}}ye.prototype.visible=!0;class pk{constructor(e,t){this.$from=e,this.$to=t}}let Hg=!1;function Wg(n){!Hg&&!n.parent.inlineContent&&(Hg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class pe extends ye{constructor(e,t=e){Wg(e),Wg(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 ye.near(r);let i=e.resolve(t.map(this.anchor));return new pe(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 pe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Fl(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 pe(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 s=ye.findFrom(t,r,!0)||ye.findFrom(t,-r,!0);if(s)t=s.$head;else return ye.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ye.findFrom(e,-r,!0)||ye.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new pe(e,t)}}ye.jsonID("text",pe);class Fl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Fl(e.map(this.anchor),e.map(this.head))}resolve(e){return pe.between(e.resolve(this.anchor),e.resolve(this.head))}}class Q extends ye{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),s=e.resolve(i);return r?ye.near(s):new Q(s)}content(){return new K(z.from(this.node),0,0)}eq(e){return e instanceof Q&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new xh(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Q(e.resolve(t.anchor))}static create(e,t){return new Q(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Q.prototype.visible=!1,ye.jsonID("node",Q);class xh{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Fl(r,r):new xh(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Q.isSelectable(r)?new Q(t):ye.near(t)}}class Lt extends ye{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=ye.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Lt(e)}map(e){return new Lt(e)}eq(e){return e instanceof Lt}getBookmark(){return mk}}ye.jsonID("all",Lt);const mk={map(){return this},resolve(n){return new Lt(n)}};function Ei(n,e,t,r,i,s=!1){if(e.inlineContent)return pe.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(!s&&Q.isSelectable(u))return Q.create(n,t-(i<0?u.nodeSize:0))}else{let c=Ei(n,u,t+i,i<0?u.childCount:0,i,s);if(c)return c}t+=u.nodeSize*i}return null}function Vg(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof je||i instanceof Je))return;let s=n.mapping.maps[r],a;s.forEach((u,c,h,p)=>{a==null&&(a=p)}),n.setSelection(ye.near(n.doc.resolve(a),t))}function Ug(n,e){return!e||!n?n:n.bind(e)}class ka{constructor(e,t,r){this.name=e,this.init=Ug(t.init,r),this.apply=Ug(t.apply,r)}}new ka("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new ka("selection",{init(n,e){return n.selection||ye.atStart(e.doc)},apply(n){return n.selection}}),new ka("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new ka("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function qg(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=qg(i,e,{})),t[r]=i}return t}class ct{constructor(e){this.spec=e,this.props={},e.props&&qg(e.props,this,this.props),this.key=e.key?e.key.key:Kg("plugin")}getState(e){return e[this.key]}}const Jc=Object.create(null);function Kg(n){return n in Jc?n+"$"+ ++Jc[n]:(Jc[n]=0,n+"$")}class It{constructor(e="key"){this.key=Kg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Vr=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Gg=function(n,e,t,r){return t&&(Jg(n,e,t,r,-1)||Jg(n,e,t,r,1))},gk=/^(img|br|input|textarea|hr)$/i;function Jg(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:Aa(n))){let s=n.parentNode;if(!s||s.nodeType!=1||jc(n)||gk.test(n.nodeName)||n.contentEditable=="false")return!1;e=Vr(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?Aa(n):0}else return!1}}function Aa(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function yk(n,e,t){for(let r=e==0,i=e==Aa(n);r||i;){if(n==t)return!0;let s=Vr(n);if(n=n.parentNode,!n)return!1;r=r&&s==0,i=i&&s==Aa(n)}}function jc(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 jg=function(n){return n.focusNode&&Gg(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Yg(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const pn=typeof navigator<"u"?navigator:null,Xg=typeof document<"u"?document:null,pr=pn&&pn.userAgent||"",Yc=/Edge\/(\d+)/.exec(pr),Zg=/MSIE \d/.exec(pr),Xc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pr),Es=!!(Zg||Xc||Yc),Qg=Zg?document.documentMode:Xc?+Xc[1]:Yc?+Yc[1]:0,Ta=!Es&&/gecko\/(\d+)/i.test(pr);Ta&&+(/Firefox\/(\d+)/.exec(pr)||[0,0])[1];const Zc=!Es&&/Chrome\/(\d+)/.exec(pr),mr=!!Zc,e0=Zc?+Zc[1]:0,Ur=!Es&&!!pn&&/Apple Computer/.test(pn.vendor),Qc=Ur&&(/Mobile\/\w+/.test(pr)||!!pn&&pn.maxTouchPoints>2),Gt=Qc||(pn?/Mac/.test(pn.platform):!1),bk=pn?/Win/.test(pn.platform):!1,ks=/Android \d/.test(pr),ef=!!Xg&&"webkitFontSmoothing"in Xg.documentElement.style,_k=ef?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wk(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),s=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let u=r.resolve(a),c,h;if(jg(t)){for(c=a;i&&!i.node;)i=i.parent;let m=i.node;if(i&&m.isAtom&&Q.isSelectable(m)&&i.parent&&!(m.isInline&&yk(t.focusNode,t.focusOffset,i.dom))){let y=i.posBefore;h=new Q(a==y?u:r.resolve(y))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let m=a,y=a;for(let _=0;_<t.rangeCount;_++){let S=t.getRangeAt(_);m=Math.min(m,n.docView.posFromDOM(S.startContainer,S.startOffset,1)),y=Math.max(y,n.docView.posFromDOM(S.endContainer,S.endOffset,-1))}if(m<0)return null;[c,a]=y==n.state.selection.anchor?[y,m]:[m,y],u=r.resolve(a)}else c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null}let p=r.resolve(c);if(!h){let m=e=="pointer"||n.state.selection.head<u.pos&&!s?1:-1;h=o0(n,p,u,m)}return h}function t0(n){return n.editable?n.hasFocus():Ck(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function tf(n,e=!1){let t=n.state.selection;if(xk(n,t),!!t0(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&mr){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Gg(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)Sk(n);else{let{anchor:r,head:i}=t,s,a;n0&&!(t instanceof pe)&&(t.$from.parent.inlineContent||(s=r0(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=r0(n,t.to))),n.docView.setSelection(r,i,n,e),n0&&(s&&i0(s),a&&i0(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&vk(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const n0=Ur||mr&&e0<63;function r0(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,s=r?t.childNodes[r-1]:null;if(Ur&&i&&i.contentEditable=="false")return nf(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return nf(i);if(s)return nf(s)}}function nf(n){return n.contentEditable="true",Ur&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function i0(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function vk(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(()=>{(!t0(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Sk(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setStart(r.parentNode,Vr(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Es&&Qg<=11&&(r.disabled=!0,r.disabled=!1)}function xk(n,e){if(e instanceof Q){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(s0(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else s0(n)}function s0(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function o0(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||pe.between(e,t,r)}function Ck(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 rf(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),s=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ye.findFrom(s,e)}function gr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function a0(n,e,t){let r=n.state.selection;if(r instanceof pe)if(t.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=n.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return gr(n,new pe(r.$anchor,a))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=rf(n.state,e);return i&&i instanceof Q?gr(n,i):!1}else if(!(Gt&&t.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;let u=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=n.docView.descAt(u))&&!a.contentDOM?Q.isSelectable(s)?gr(n,new Q(e<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):ef?gr(n,new pe(n.state.doc.resolve(e<0?u:u+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Q&&r.node.isInline)return gr(n,new pe(e>0?r.$to:r.$from));{let i=rf(n.state,e);return i?gr(n,i):!1}}}function Oa(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function As(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function ki(n,e){return e<0?Ek(n):kk(n)}function Ek(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,s,a=!1;for(Ta&&t.nodeType==1&&r<Oa(t)&&As(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(As(u,-1))i=t,s=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(l0(t))break;{let u=t.previousSibling;for(;u&&As(u,-1);)i=t.parentNode,s=Vr(u),u=u.previousSibling;if(u)t=u,r=Oa(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?sf(n,t,r):i&&sf(n,i,s)}function kk(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Oa(t),s,a;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(As(u,1))s=t,a=++r;else break}else{if(l0(t))break;{let u=t.nextSibling;for(;u&&As(u,1);)s=u.parentNode,a=Vr(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}}}s&&sf(n,s,a)}function l0(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Ak(n,e){for(;n&&e==n.childNodes.length&&!jc(n);)e=Vr(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function Tk(n,e){for(;n&&!e&&!jc(n);)e=Vr(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function sf(n,e,t){if(e.nodeType!=3){let s,a;(a=Ak(e,t))?(e=a,t=0):(s=Tk(e,t))&&(e=s,t=s.nodeValue.length)}let r=n.domSelection();if(!r)return;if(jg(r)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&tf(n)},50)}function u0(n,e){let t=n.state.doc.resolve(e);if(!(mr||bk)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let s=n.coordsAtPos(e-1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=n.coordsAtPos(e+1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function c0(n,e,t){let r=n.state.selection;if(r instanceof pe&&!r.empty||t.indexOf("s")>-1||Gt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=rf(n.state,e);if(a&&a instanceof Q)return gr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:s,u=r instanceof Lt?ye.near(a,e):ye.findFrom(a,e);return u?gr(n,u):!1}return!1}function f0(n,e){if(!(n.state.selection instanceof pe))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 s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let a=n.state.tr;return e<0?a.delete(t.pos-s.nodeSize,t.pos):a.delete(t.pos,t.pos+s.nodeSize),n.dispatch(a),!0}return!1}function h0(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;h0(n,r,"true"),setTimeout(()=>h0(n,r,"false"),20)}return!1}function Mk(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Ik(n,e){let t=e.keyCode,r=Mk(e);if(t==8||Gt&&t==72&&r=="c")return f0(n,-1)||ki(n,-1);if(t==46&&!e.shiftKey||Gt&&t==68&&r=="c")return f0(n,1)||ki(n,1);if(t==13||t==27)return!0;if(t==37||Gt&&t==66&&r=="c"){let i=t==37?u0(n,n.state.selection.from)=="ltr"?-1:1:-1;return a0(n,i,r)||ki(n,i)}else if(t==39||Gt&&t==70&&r=="c"){let i=t==39?u0(n,n.state.selection.from)=="ltr"?1:-1:1;return a0(n,i,r)||ki(n,i)}else{if(t==38||Gt&&t==80&&r=="c")return c0(n,-1,r)||ki(n,-1);if(t==40||Gt&&t==78&&r=="c")return Ok(n)||c0(n,1,r)||ki(n,1);if(r==(Gt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function d0(n,e){n.someProp("transformCopied",_=>{e=_(e,n)});let t=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let _=r.firstChild;t.push(_.type.name,_.attrs!=_.type.defaultAttrs?_.attrs:null),r=_.content}let a=n.someProp("clipboardSerializer")||qs.fromSchema(n.state.schema),u=v0(),c=u.createElement("div");c.appendChild(a.serializeFragment(r,{document:u}));let h=c.firstChild,p,m=0;for(;h&&h.nodeType==1&&(p=_0[h.nodeName.toLowerCase()]);){for(let _=p.length-1;_>=0;_--){let S=u.createElement(p[_]);for(;c.firstChild;)S.appendChild(c.firstChild);c.appendChild(S),m++}h=c.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${i} ${s}${m?` -${m}`:""} ${JSON.stringify(t)}`);let y=n.someProp("clipboardTextSerializer",_=>_(e,n))||e.content.textBetween(0,e.content.size,`
|
|
35
35
|
|
|
36
36
|
`);return{dom:c,text:y,slice:e}}function p0(n,e,t,r,i){let s=i.parent.type.spec.code,a,u;if(!t&&!e)return null;let c=e&&(r||s||!t);if(c){if(n.someProp("transformPastedText",y=>{e=y(e,s||r,n)}),s)return e?new K(z.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
37
|
-
`))),0,0):K.empty;let m=n.someProp("clipboardTextParser",y=>y(e,i,r,n));if(m)u=m;else{let y=i.marks(),{schema:_}=n.state,S=Us.fromSchema(_);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let N=a.appendChild(document.createElement("p"));E&&N.appendChild(S.serializeNode(_.text(E,y)))})}}else n.someProp("transformPastedHTML",m=>{t=m(t,n)}),a=Pk(t),ef&&Dk(a);let h=a&&a.querySelector("[data-pm-slice]"),p=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let m=+p[3];m>0;m--){let y=a.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;a=y}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||ws.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||p),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!Nk.test(y.parentNode.nodeName)?{ignore:!0}:null}})),p)u=Fk(b0(u,+p[1],+p[2]),p[4]);else if(u=K.maxOpen(Rk(u.content,i),!0),u.openStart||u.openEnd){let m=0,y=0;for(let _=u.content.firstChild;m<u.openStart&&!_.type.spec.isolating;m++,_=_.firstChild);for(let _=u.content.lastChild;y<u.openEnd&&!_.type.spec.isolating;y++,_=_.lastChild);u=b0(u,m,y)}return n.someProp("transformPasted",m=>{u=m(u,n)}),u}const Nk=/^(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 Rk(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)),s,a=[];if(n.forEach(u=>{if(!a)return;let c=i.findWrapping(u.type),h;if(!c)return a=null;if(h=a.length&&s.length&&g0(c,s,u,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=y0(a[a.length-1],s.length));let p=m0(u,c);a.push(p),i=i.matchType(p.type),s=c}}),a)return z.from(a)}return n}function m0(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,z.from(n));return n}function g0(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let s=g0(n,e,t,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(z.from(m0(t,n,i+1))))}}function y0(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,y0(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(z.empty,!0);return n.copy(t.append(r))}function of(n,e,t,r,i,s){let a=e<0?n.firstChild:n.lastChild,u=a.content;return n.childCount>1&&(s=0),i<r-1&&(u=of(u,e,t,r,i+1,s)),i>=t&&(u=e<0?a.contentMatchAt(0).fillBefore(u,s<=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 b0(n,e,t){return e<n.openStart&&(n=new K(of(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new K(of(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const _0={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 w0=null;function v0(){return w0||(w0=document.implementation.createHTMLDocument("title"))}let af=null;function Lk(n){let e=window.trustedTypes;return e?(af||(af=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),af.createHTML(n)):n}function Pk(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=v0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&_0[r[1].toLowerCase()])&&(n=i.map(s=>"<"+s+">").join("")+n+i.map(s=>"</"+s+">").reverse().join("")),t.innerHTML=Lk(n),i)for(let s=0;s<i.length;s++)t=t.querySelector(i[s])||t;return t}function Dk(n){let e=n.querySelectorAll(mr?"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 Fk(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:s,openEnd:a}=n;for(let u=r.length-2;u>=0;u-=2){let c=t.nodes[r[u]];if(!c||c.hasRequiredAttrs())break;i=z.from(c.create(r[u+1],i)),s++,a++}return new K(i,s,a)}const on={},Nt={};function yr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Nt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!x0(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Es&&mr&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Qc&&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,Yg(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Ik(n,t)?t.preventDefault():yr(n,"key")},Nt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Nt.keypress=(n,e)=>{let t=e;if(x0(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Gt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof pe)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",s=>s(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function Oa(n){return{left:n.clientX,top:n.clientY}}function Bk(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function lf(n,e,t,r,i){if(r==-1)return!1;let s=n.state.doc.resolve(r);for(let a=s.depth+1;a>0;a--)if(n.someProp(e,u=>a>s.depth?u(n,t,s.nodeAfter,s.before(a),i,!0):u(n,t,s.node(a),s.before(a),i,!1)))return!0;return!1}function Ti(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function zk(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Q.isSelectable(r)?(Ti(n,new Q(t)),!0):!1}function $k(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Q&&(r=t.node);let s=n.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let u=a>s.depth?s.nodeAfter:s.node(a);if(Q.isSelectable(u)){r&&t.$from.depth>0&&a>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(a);break}}return i!=null?(Ti(n,Q.create(n.state.doc,i)),!0):!1}function Hk(n,e,t,r,i){return lf(n,"handleClickOn",e,t,r)||n.someProp("handleClick",s=>s(n,e,r))||(i?$k(n,t):zk(n,t))}function Wk(n,e,t,r){return lf(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Vk(n,e,t,r){return lf(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Uk(n,t,r)}function Uk(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ti(n,pe.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s),u=i.before(s);if(a.inlineContent)Ti(n,pe.create(r,u+1,u+1+a.content.size));else if(Q.isSelectable(a))Ti(n,Q.create(r,u));else continue;return!0}}function uf(n){return Ma(n)}const S0=Gt?"metaKey":"ctrlKey";on.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=uf(n),i=Date.now(),s="singleClick";i-n.input.lastClick.time<500&&Bk(t,n.input.lastClick)&&!t[S0]&&(n.input.lastClick.type=="singleClick"?s="doubleClick":n.input.lastClick.type=="doubleClick"&&(s="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s};let a=n.posAtCoords(Oa(t));a&&(s=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new qk(n,a,t,!!r)):(s=="doubleClick"?Wk:Vk)(n,a.pos,a.inside,t)?t.preventDefault():yr(n,"pointer"))};class qk{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 s,a;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),a=t.inside;else{let p=e.state.doc.resolve(t.pos);s=p.parent,a=p.depth?p.before():0}const u=i?null:r.target,c=u?e.docView.nearestDesc(u,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:h}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||h instanceof Q&&h.from<=a&&h.to>a)&&(this.mightDrag={node:s,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)),yr(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(()=>tf(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(Oa(e))),this.updateAllowDefault(e),this.allowDefault||!t?yr(this.view,"pointer"):Hk(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ur&&this.mightDrag&&!this.mightDrag.node.isAtom||mr&&!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)?(Ti(this.view,ye.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):yr(this.view,"pointer")}move(e){this.updateAllowDefault(e),yr(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)}}on.touchstart=n=>{n.input.lastTouch=Date.now(),uf(n),yr(n,"pointer")},on.touchmove=n=>{n.input.lastTouch=Date.now(),yr(n,"pointer")},on.contextmenu=n=>uf(n);function x0(n,e){return n.composing?!0:Ur&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Kk=Es?5e3:-1;Nt.compositionstart=Nt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof pe&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Ma(n,!0),n.markCursor=null;else if(Ma(n,!e.selection.empty),Ta&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let u=n.domSelection();u&&u.collapse(a,a.nodeValue.length);break}else i=a,s=-1}}n.input.composing=!0}C0(n,Kk)},Nt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,C0(n,20))};function C0(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ma(n),e))}function Gk(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Jk());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Jk(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ma(n,e=!1){if(!(Es&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Gk(n),e||n.docView&&n.docView.dirty){let t=wk(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!n.state.selection.empty?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function jk(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 Ts=Cs&&Qg<15||Qc&&_k<604;on.copy=Nt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let s=Ts?null:t.clipboardData,a=r.content(),{dom:u,text:c}=d0(n,a);s?(t.preventDefault(),s.clearData(),s.setData("text/html",u.innerHTML),s.setData("text/plain",c)):jk(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Yk(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Xk(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();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?cf(n,r.value,null,i,e):cf(n,r.textContent,r.innerHTML,i,e)},50)}function cf(n,e,t,r,i){let s=p0(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,s||K.empty)))return!0;if(!s)return!1;let a=Yk(s),u=a?n.state.tr.replaceSelectionWith(a,r):n.state.tr.replaceSelection(s);return n.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function E0(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Nt.paste=(n,e)=>{let t=e;if(n.composing&&!Es)return;let r=Ts?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&cf(n,E0(r),r.getData("text/html"),i,t)?t.preventDefault():Xk(n,t)};class Zk{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const k0=Gt?"altKey":"ctrlKey";on.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,s=i.empty?null:n.posAtCoords(Oa(t)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof Q?i.to-1:i.to))){if(r&&r.mightDrag)a=Q.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let m=n.docView.nearestDesc(t.target,!0);m&&m.node.type.spec.draggable&&m!=n.docView&&(a=Q.create(n.state.doc,m.posBefore))}}let u=(a||n.state.selection).content(),{dom:c,text:h,slice:p}=d0(n,u);(!t.dataTransfer.files.length||!mr||e0>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Ts?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ts||t.dataTransfer.setData("text/plain",h),n.dragging=new Zk(p,!t[k0],a)},on.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Nt.dragover=Nt.dragenter=(n,e)=>e.preventDefault(),Nt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Oa(t));if(!i)return;let s=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",S=>{a=S(a,n)}):a=p0(n,E0(t.dataTransfer),Ts?null:t.dataTransfer.getData("text/html"),!1,s);let u=!!(r&&!t[k0]);if(n.someProp("handleDrop",S=>S(n,t,a||K.empty,u))){t.preventDefault();return}if(!a)return;t.preventDefault();let c=a?ok(n.state.doc,s.pos,a):s.pos;c==null&&(c=s.pos);let h=n.state.tr;if(u){let{node:S}=r;S?S.replace(h):h.deleteSelection()}let p=h.mapping.map(c),m=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,y=h.doc;if(m?h.replaceRangeWith(p,p,a.content.firstChild):h.replaceRange(p,p,a),h.doc.eq(y))return;let _=h.doc.resolve(p);if(m&&Q.isSelectable(a.content.firstChild)&&_.nodeAfter&&_.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new Q(_));else{let S=h.mapping.map(c);h.mapping.maps[h.mapping.maps.length-1].forEach((E,N,g,v)=>S=v),h.setSelection(o0(n,_,h.doc.resolve(S)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},on.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())&&tf(n)},20))},on.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)},on.beforeinput=(n,e)=>{if(mr&&Es&&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",s=>s(n,Yg(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 Nt)on[n]=Nt[n];function As(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Bl{constructor(e,t){this.toDOM=e,this.spec=t||qr,this.side=this.spec.side||0}map(e,t,r,i){let{pos:s,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new vn(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Bl&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&As(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class kr{constructor(e,t){this.attrs=e,this.spec=t||qr}map(e,t,r,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=a?null:new vn(s,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof kr&&As(this.attrs,e.attrs)&&As(this.spec,e.spec)}static is(e){return e.type instanceof kr}destroy(){}}let Qk=class Gy{constructor(e,t){this.attrs=e,this.spec=t||qr}map(e,t,r,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=s.pos?null:new vn(s.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(r)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof Gy&&As(this.attrs,e.attrs)&&As(this.spec,e.spec)}destroy(){}};class vn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new vn(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 vn(e,e,new Bl(t,r))}static inline(e,t,r,i){return new vn(e,t,new kr(r,i))}static node(e,t,r,i){return new vn(e,t,new Qk(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof kr}get widget(){return this.type instanceof Bl}}const Ai=[],qr={};class Ye{constructor(e,t){this.local=e.length?e:Ai,this.children=t.length?t:Ai}static create(e,t){return t.length?Ia(t,e,0,qr):ft}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,s){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=t&&u.to>=e&&(!s||s(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,s)}}map(e,t,r){return this==ft||e.maps.length==0?this:this.mapInner(e,t,0,0,r||qr)}mapInner(e,t,r,i,s){let a;for(let u=0;u<this.local.length;u++){let c=this.local[u].map(e,r,i);c&&c.type.valid(t,c)?(a||(a=[])).push(c):s.onRemove&&s.onRemove(this.local[u].spec)}return this.children.length?eT(this.children,a||[],e,t,r,i,s):a?new Ye(a.sort(Kr),Ai):ft}add(e,t){return t.length?this==ft?Ye.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,s=0;e.forEach((u,c)=>{let h=c+r,p;if(p=A0(t,u,h)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(u,p,h+1):i.splice(s,0,c,c+u.nodeSize,Ia(p,u,h+1,qr)),s+=3}});let a=T0(s?O0(t):t,-r);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||a.splice(u--,1);return new Ye(a.length?this.local.concat(a).sort(Kr):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 s=0;s<r.length;s+=3){let a,u=r[s]+t,c=r[s+1]+t;for(let p=0,m;p<e.length;p++)(m=e[p])&&m.from>u&&m.to<c&&(e[p]=null,(a||(a=[])).push(m));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[s+2].removeInner(a,u+1);h!=ft?r[s+2]=h:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,a;s<e.length;s++)if(a=e[s])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 Ye(i,r):ft}forChild(e,t){if(this==ft)return this;if(t.isLeaf)return Ye.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 s=e+1,a=s+t.content.size;for(let u=0;u<this.local.length;u++){let c=this.local[u];if(c.from<a&&c.to>s&&c.type instanceof kr){let h=Math.max(s,c.from)-s,p=Math.min(a,c.to)-s;h<p&&(i||(i=[])).push(c.copy(h,p))}}if(i){let u=new Ye(i.sort(Kr),Ai);return r?new Qr([u,r]):u}return r||ft}eq(e){if(this==e)return!0;if(!(e instanceof Ye)||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 ff(this.localsInner(e))}localsInner(e){if(this==ft)return Ai;if(e.inlineContent||!this.local.some(kr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof kr||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Ye.empty=new Ye([],[]),Ye.removeOverlap=ff;const ft=Ye.empty;class Qr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,qr));return Qr.from(r)}forChild(e,t){if(t.isLeaf)return Ye.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=ft&&(s instanceof Qr?r=r.concat(s.members):r.push(s))}return Qr.from(r)}eq(e){if(!(e instanceof Qr)||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 s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{r&&(t=t.slice(),r=!1);for(let a=0;a<s.length;a++)t.push(s[a])}}return t?ff(r?t:t.sort(Kr)):Ai}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new Qr(e.every(t=>t instanceof Ye)?e:e.reduce((t,r)=>t.concat(r instanceof Ye?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function eT(n,e,t,r,i,s,a){let u=n.slice();for(let h=0,p=s;h<t.maps.length;h++){let m=0;t.maps[h].forEach((y,_,S,E)=>{let N=E-S-(_-y);for(let g=0;g<u.length;g+=3){let v=u[g+1];if(v<0||y>v+p-m)continue;let k=u[g]+p-m;_>=k?u[g+1]=y<=k?-2:-1:y>=p&&N&&(u[g]+=N,u[g+1]+=N)}m+=N}),p=t.maps[h].map(p,-1)}let c=!1;for(let h=0;h<u.length;h+=3)if(u[h+1]<0){if(u[h+1]==-2){c=!0,u[h+1]=-1;continue}let p=t.map(n[h]+s),m=p-i;if(m<0||m>=r.content.size){c=!0;continue}let y=t.map(n[h+1]+s,-1),_=y-i,{index:S,offset:E}=r.content.findIndex(m),N=r.maybeChild(S);if(N&&E==m&&E+N.nodeSize==_){let g=u[h+2].mapInner(t,N,p+1,n[h]+s+1,a);g!=ft?(u[h]=m,u[h+1]=_,u[h+2]=g):(u[h+1]=-2,c=!0)}else c=!0}if(c){let h=tT(u,n,e,t,i,s,a),p=Ia(h,r,0,a);e=p.local;for(let m=0;m<u.length;m+=3)u[m+1]<0&&(u.splice(m,3),m-=3);for(let m=0,y=0;m<p.children.length;m+=3){let _=p.children[m];for(;y<u.length&&u[y]<_;)y+=3;u.splice(y,0,p.children[m],p.children[m+1],p.children[m+2])}}return new Ye(e.sort(Kr),u)}function T0(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 vn(i.from+e,i.to+e,i.type))}return t}function tT(n,e,t,r,i,s,a){function u(c,h){for(let p=0;p<c.local.length;p++){let m=c.local[p].map(r,i,h);m?t.push(m):a.onRemove&&a.onRemove(c.local[p].spec)}for(let p=0;p<c.children.length;p+=3)u(c.children[p+2],c.children[p]+h+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&u(n[c+2],e[c]+s+1);return t}function A0(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let s=0,a;s<n.length;s++)(a=n[s])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[s]=null);return i}function O0(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Ia(n,e,t,r){let i=[],s=!1;e.forEach((u,c)=>{let h=A0(n,u,c+t);if(h){s=!0;let p=Ia(h,u,t+c+1,r);p!=ft&&i.push(c,c+u.nodeSize,p)}});let a=T0(s?O0(n):n,-t).sort(Kr);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 Ye(a,i):ft}function Kr(n,e){return n.from-e.from||n.to-e.to}function ff(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 s=e[i];if(s.from==r.from){s.to!=r.to&&(e==n&&(e=n.slice()),e[i]=s.copy(s.from,r.to),M0(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,s.from),M0(e,i,r.copy(s.from,r.to)));break}}}return e}function M0(n,e,t){for(;e<n.length&&Kr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var br={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:"'"},Na={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nT=typeof navigator<"u"&&/Mac/.test(navigator.platform),rT=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tt=0;tt<10;tt++)br[48+tt]=br[96+tt]=String(tt);for(var tt=1;tt<=24;tt++)br[tt+111]="F"+tt;for(var tt=65;tt<=90;tt++)br[tt]=String.fromCharCode(tt+32),Na[tt]=String.fromCharCode(tt);for(var hf in br)Na.hasOwnProperty(hf)||(Na[hf]=br[hf]);function iT(n){var e=nT&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||rT&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Na:br)[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 sT=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function oT(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,s,a;for(let u=0;u<e.length-1;u++){let c=e[u];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))sT?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function aT(n){let e=Object.create(null);for(let t in n)e[oT(t)]=n[t];return e}function df(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function lT(n){return new ct({props:{handleKeyDown:uT(n)}})}function uT(n){let e=aT(n);return function(t,r){let i=iT(r),s,a=e[df(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=e[df(i,r,!1)];if(u&&u(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(s=br[r.keyCode])&&s!=i){let u=e[df(s,r)];if(u&&u(t.state,t.dispatch,t))return!0}}return!1}}const pf=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function I0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const N0=(n,e,t)=>{let r=I0(n,t);if(!r)return!1;let i=mf(r);if(!i){let a=r.blockRange(),u=a&&xi(a);return u==null?!1:(e&&e(n.tr.lift(a,u).scrollIntoView()),!0)}let s=i.nodeBefore;if(H0(n,i,e,-1))return!0;if(r.parent.content.size==0&&(Oi(s,"end")||Q.isSelectable(s)))for(let a=r.depth;;a--){let u=Ca(n.doc,r.before(a),r.after(a),K.empty);if(u&&u.slice.size<u.to-u.from){if(e){let c=n.tr.step(u);c.setSelection(Oi(s,"end")?ye.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):Q.create(c.doc,i.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},cT=(n,e,t)=>{let r=I0(n,t);if(!r)return!1;let i=mf(r);return i?R0(n,i,e):!1},fT=(n,e,t)=>{let r=P0(n,t);if(!r)return!1;let i=gf(r);return i?R0(n,i,e):!1};function R0(n,e,t){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let p=i.lastChild;if(!p)return!1;i=p}let a=e.nodeAfter,u=a,c=e.pos+1;for(;!u.isTextblock;c++){if(u.type.spec.isolating)return!1;let p=u.firstChild;if(!p)return!1;u=p}let h=Ca(n.doc,s,c,K.empty);if(!h||h.from!=s||h instanceof je&&h.slice.size>=c-s)return!1;if(t){let p=n.tr.step(h);p.setSelection(pe.create(p.doc,s)),t(p.scrollIntoView())}return!0}function Oi(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 L0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;s=mf(r)}let a=s&&s.nodeBefore;return!a||!Q.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Q.create(n.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function mf(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 P0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const D0=(n,e,t)=>{let r=P0(n,t);if(!r)return!1;let i=gf(r);if(!i)return!1;let s=i.nodeAfter;if(H0(n,i,e,1))return!0;if(r.parent.content.size==0&&(Oi(s,"start")||Q.isSelectable(s))){let a=Ca(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(Oi(s,"start")?ye.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Q.create(u.doc,u.mapping.map(i.pos))),e(u.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},F0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;s=gf(r)}let a=s&&s.nodeAfter;return!a||!Q.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Q.create(n.doc,s.pos)).scrollIntoView()),!0)};function gf(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 hT=(n,e)=>{let t=n.selection,r=t instanceof Q,i;if(r){if(t.node.isTextblock||!dr(n.doc,t.from))return!1;i=t.from}else if(i=xa(n.doc,t.from,-1),i==null)return!1;if(e){let s=n.tr.join(i);r&&s.setSelection(Q.create(s.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},dT=(n,e)=>{let t=n.selection,r;if(t instanceof Q){if(t.node.isTextblock||!dr(n.doc,t.to))return!1;r=t.to}else if(r=xa(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},pT=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),s=i&&xi(i);return s==null?!1:(e&&e(n.tr.lift(i,s).scrollIntoView()),!0)},B0=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
38
|
-
`).scrollIntoView()),!0)};function yf(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 mT=(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),s=t.indexAfter(-1),a=yf(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(e){let u=t.after(),c=n.tr.replaceWith(u,u,a.createAndFill());c.setSelection(ye.near(c.doc.resolve(u),1)),e(c.scrollIntoView())}return!0},z0=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Lt||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=yf(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(a,s.createAndFill());u.setSelection(pe.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},$0=(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 s=t.before();if(zn(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let r=t.blockRange(),i=r&&xi(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function gT(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Q&&e.selection.node.isBlock)return!r.parentOffset||!zn(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],a,u,c=!1,h=!1;for(let _=r.depth;;_--)if(r.node(_).isBlock){c=r.end(_)==r.pos+(r.depth-_),h=r.start(_)==r.pos-(r.depth-_),u=yf(r.node(_-1).contentMatchAt(r.indexAfter(_-1))),s.unshift(c&&u?{type:u}:null),a=_;break}else{if(_==1)return!1;s.unshift(null)}let p=e.tr;(e.selection instanceof pe||e.selection instanceof Lt)&&p.deleteSelection();let m=p.mapping.map(r.pos),y=zn(p.doc,m,s.length,s);if(y||(s[0]=u?{type:u}:null,y=zn(p.doc,m,s.length,s)),p.split(m,s.length,s),!c&&h&&r.node(a).type!=u){let _=p.mapping.map(r.before(a)),S=p.doc.resolve(_);u&&r.node(a-1).canReplaceWith(S.index(),S.index()+1,u)&&p.setNodeMarkup(p.mapping.map(r.before(a)),u)}return t&&t(p.scrollIntoView()),!0}}const yT=gT(),bT=(n,e)=>{let{$from:t,to:r}=n.selection,i,s=t.sharedDepth(r);return s==0?!1:(i=t.before(s),e&&e(n.tr.setSelection(Q.create(n.doc,i))),!0)};function _T(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||dr(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function H0(n,e,t,r){let i=e.nodeBefore,s=e.nodeAfter,a,u,c=i.type.spec.isolating||s.type.spec.isolating;if(!c&&_T(n,e,t))return!0;let h=!c&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(a=(u=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&u.matchType(a[0]||s.type).validEnd){if(t){let _=e.pos+s.nodeSize,S=z.empty;for(let g=a.length-1;g>=0;g--)S=z.from(a[g].create(null,S));S=z.from(i.copy(S));let E=n.tr.step(new Je(e.pos-1,_,e.pos,_,new K(S,1,0),a.length,!0)),N=E.doc.resolve(_+2*a.length);N.nodeAfter&&N.nodeAfter.type==i.type&&dr(E.doc,N.pos)&&E.join(N.pos),t(E.scrollIntoView())}return!0}let p=s.type.spec.isolating||r>0&&c?null:ye.findFrom(e,1),m=p&&p.$from.blockRange(p.$to),y=m&&xi(m);if(y!=null&&y>=e.depth)return t&&t(n.tr.lift(m,y).scrollIntoView()),!0;if(h&&Oi(s,"start",!0)&&Oi(i,"end")){let _=i,S=[];for(;S.push(_),!_.isTextblock;)_=_.lastChild;let E=s,N=1;for(;!E.isTextblock;E=E.firstChild)N++;if(_.canReplace(_.childCount,_.childCount,E.content)){if(t){let g=z.empty;for(let k=S.length-1;k>=0;k--)g=z.from(S[k].copy(g));let v=n.tr.step(new Je(e.pos-S.length,e.pos+s.nodeSize,e.pos+N,e.pos+s.nodeSize-N,new K(g,S.length,0),0,!0));t(v.scrollIntoView())}return!0}}return!1}function W0(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(pe.create(e.doc,n<0?i.start(s):i.end(s)))),!0):!1}}const wT=W0(-1),vT=W0(1);function ST(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,a=i.blockRange(s),u=a&&Uc(a,n,e);return u?(r&&r(t.tr.wrap(a,u).scrollIntoView()),!0):!1}}function V0(n,e=null){return function(t,r){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:u}}=t.selection.ranges[s];t.doc.nodesBetween(a,u,(c,h)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)i=!0;else{let p=t.doc.resolve(h),m=p.index();i=p.parent.canReplaceWith(m,m+1,n)}})}if(!i)return!1;if(r){let s=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:c}}=t.selection.ranges[a];s.setBlockType(u,c,n,e)}r(s.scrollIntoView())}return!0}}function bf(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}bf(pf,N0,L0),bf(pf,D0,F0),bf(B0,z0,$0,yT),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function xT(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,a=i.blockRange(s);if(!a)return!1;let u=r?t.tr:null;return CT(u,a,n,e)?(r&&r(u.scrollIntoView()),!0):!1}}function CT(n,e,t,r=null){let i=!1,s=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=a.resolve(e.start-2);s=new ba(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new ba(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let u=Uc(s,t,r,e);return u?(n&&ET(n,e,u,i,t),!0):!1}function ET(n,e,t,r,i){let s=z.empty;for(let p=t.length-1;p>=0;p--)s=z.from(t[p].type.create(t[p].attrs,s));n.step(new Je(e.start-(r?2:0),e.end,e.start,e.end,new K(s,0,0),t.length,!0));let a=0;for(let p=0;p<t.length;p++)t[p].type==i&&(a=p+1);let u=t.length-a,c=e.start+t.length-(r?2:0),h=e.parent;for(let p=e.startIndex,m=e.endIndex,y=!0;p<m;p++,y=!1)!y&&zn(n.doc,c,u)&&(n.split(c,u),c+=2*u),c+=h.child(p).nodeSize;return n}function kT(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return s?t?r.node(s.depth-1).type==n?TT(e,t,n,s):AT(e,t,s):!0:!1}}function TT(n,e,t,r){let i=n.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(i.step(new Je(s-1,a,s,a,new K(z.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new ba(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=xi(r);if(u==null)return!1;i.lift(r,u);let c=i.mapping.map(s,-1)-1;return dr(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function AT(n,e,t){let r=n.tr,i=t.parent;for(let _=t.end,S=t.endIndex-1,E=t.startIndex;S>E;S--)_-=i.child(S).nodeSize,r.delete(_-1,_+1);let s=r.doc.resolve(t.start),a=s.nodeAfter;if(r.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let u=t.startIndex==0,c=t.endIndex==i.childCount,h=s.node(-1),p=s.index(-1);if(!h.canReplace(p+(u?0:1),p+1,a.content.append(c?z.empty:z.from(i))))return!1;let m=s.pos,y=m+a.nodeSize;return r.step(new Je(m-(u?1:0),y+(c?1:0),m+1,y-1,new K((u?z.empty:z.from(i.copy(z.empty))).append(c?z.empty:z.from(i.copy(z.empty))),u?0:1,c?0:1),u?0:1)),e(r.scrollIntoView()),!0}function OT(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,h=>h.childCount>0&&h.firstChild.type==n);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let u=s.parent,c=u.child(a-1);if(c.type!=n)return!1;if(t){let h=c.lastChild&&c.lastChild.type==u.type,p=z.from(h?n.create():null),m=new K(z.from(n.create(null,z.from(u.type.create(null,p)))),h?3:1,0),y=s.start,_=s.end;t(e.tr.step(new Je(y-(h?3:1),_,y,_,m,1,!0)).scrollIntoView())}return!0}}function Ra(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,s=t.storedMarks,t}}}class _f{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:s}=r,a=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([u,c])=>[u,(...p)=>{const m=c(...p)(a);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:a}=i,u=[],c=!!e,h=e||s.tr,p=()=>(!c&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(h),u.every(y=>y===!0)),m={...Object.fromEntries(Object.entries(r).map(([y,_])=>[y,(...E)=>{const N=this.buildProps(h,t),g=_(...E)(N);return u.push(g),m}])),run:p};return m}createCan(e){const{rawCommands:t,state:r}=this,i=!1,s=e||r.tr,a=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([c,h])=>[c,(...p)=>h(...p)({...a,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:a}=i,u={tr:e,editor:i,view:a,state:Ra({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,h])=>[c,(...p)=>h(...p)(u)]))}};return u}}function J(n,e,t){return n.config[e]===void 0&&n.parent?J(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?J(n.parent,e,t):null}):n.config[e]}function La(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 U0(n){const e=[],{nodeExtensions:t,markExtensions:r}=La(n),i=[...t,...r],s={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,extensions:i},c=J(a,"addGlobalAttributes",u);if(!c)return;c().forEach(p=>{p.types.forEach(m=>{Object.entries(p.attributes).forEach(([y,_])=>{e.push({type:m,name:y,attribute:{...s,..._}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},c=J(a,"addAttributes",u);if(!c)return;const h=c();Object.entries(h).forEach(([p,m])=>{const y={...s,...m};typeof y?.default=="function"&&(y.default=y.default()),y?.isRequired&&y?.default===void 0&&delete y.default,e.push({type:a.name,name:p,attribute:y})})}),e}function qe(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 Mi(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const u=s?String(s).split(" "):[],c=r[i]?r[i].split(" "):[],h=u.filter(p=>!c.includes(p));r[i]=[...c,...h].join(" ")}else if(i==="style"){const u=s?s.split(";").map(p=>p.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(p=>p.trim()).filter(Boolean):[],h=new Map;c.forEach(p=>{const[m,y]=p.split(":").map(_=>_.trim());h.set(m,y)}),u.forEach(p=>{const[m,y]=p.split(":").map(_=>_.trim());h.set(m,y)}),r[i]=Array.from(h.entries()).map(([p,m])=>`${p}: ${m}`).join("; ")}else r[i]=s}),r},{})}function wf(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Mi(t,r),{})}function MT(n){return typeof n=="function"}function de(n,e=void 0,...t){return MT(n)?e?n.bind(e)(...t):n(...t):n}function IT(n={}){return Object.keys(n).length===0&&n.constructor===Object}function NT(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function q0(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((s,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(t):NT(t.getAttribute(a.name));return u==null?s:{...s,[a.name]:u}},{});return{...r,...i}}}}function K0(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&IT(t)?!1:t!=null))}function G0(n,e){var t;const r=U0(n),{nodeExtensions:i,markExtensions:s}=La(n),a=(t=i.find(h=>J(h,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(h=>{const p=r.filter(g=>g.type===h.name),m={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((g,v)=>{const k=J(v,"extendNodeSchema",m);return{...g,...k?k(h):{}}},{}),_=K0({...y,content:de(J(h,"content",m)),marks:de(J(h,"marks",m)),group:de(J(h,"group",m)),inline:de(J(h,"inline",m)),atom:de(J(h,"atom",m)),selectable:de(J(h,"selectable",m)),draggable:de(J(h,"draggable",m)),code:de(J(h,"code",m)),whitespace:de(J(h,"whitespace",m)),linebreakReplacement:de(J(h,"linebreakReplacement",m)),defining:de(J(h,"defining",m)),isolating:de(J(h,"isolating",m)),attrs:Object.fromEntries(p.map(g=>{var v;return[g.name,{default:(v=g?.attribute)===null||v===void 0?void 0:v.default}]}))}),S=de(J(h,"parseHTML",m));S&&(_.parseDOM=S.map(g=>q0(g,p)));const E=J(h,"renderHTML",m);E&&(_.toDOM=g=>E({node:g,HTMLAttributes:wf(g,p)}));const N=J(h,"renderText",m);return N&&(_.toText=N),[h.name,_]})),c=Object.fromEntries(s.map(h=>{const p=r.filter(N=>N.type===h.name),m={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((N,g)=>{const v=J(g,"extendMarkSchema",m);return{...N,...v?v(h):{}}},{}),_=K0({...y,inclusive:de(J(h,"inclusive",m)),excludes:de(J(h,"excludes",m)),group:de(J(h,"group",m)),spanning:de(J(h,"spanning",m)),code:de(J(h,"code",m)),attrs:Object.fromEntries(p.map(N=>{var g;return[N.name,{default:(g=N?.attribute)===null||g===void 0?void 0:g.default}]}))}),S=de(J(h,"parseHTML",m));S&&(_.parseDOM=S.map(N=>q0(N,p)));const E=J(h,"renderHTML",m);return E&&(_.toDOM=N=>E({mark:N,HTMLAttributes:wf(N,p)})),[h.name,_]}));return new yg({topNode:a,nodes:u,marks:c})}function vf(n,e){return e.nodes[n]||e.marks[n]||null}function J0(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function j0(n,e){const t=Us.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}const RT=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,s,a,u)=>{var c,h;const p=((h=(c=i.type.spec).toText)===null||h===void 0?void 0:h.call(c,{node:i,pos:s,parent:a,index:u}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?p:p.slice(0,Math.max(0,r-s))}),t};function Sf(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Y0{constructor(e){this.find=e.find,this.handler=e.handler}}const LT=(n,e)=>{if(Sf(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 Pa(n){var e;const{editor:t,from:r,to:i,text:s,rules:a,plugin:u}=n,{view:c}=t;if(c.composing)return!1;const h=c.state.doc.resolve(r);if(h.parent.type.spec.code||!((e=h.nodeBefore||h.nodeAfter)===null||e===void 0)&&e.marks.find(y=>y.type.spec.code))return!1;let p=!1;const m=RT(h)+s;return a.forEach(y=>{if(p)return;const _=LT(m,y.find);if(!_)return;const S=c.state.tr,E=Ra({state:c.state,transaction:S}),N={from:r-(_[0].length-s.length),to:i},{commands:g,chain:v,can:k}=new _f({editor:t,state:E});y.handler({state:E,range:N,match:_,commands:g,chain:v,can:k})===null||!S.steps.length||(S.setMeta(u,{transform:S,from:r,to:i,text:s}),c.dispatch(S),p=!0)}),p}function PT(n){const{editor:e,rules:t}=n,r=new ct({state:{init(){return null},apply(i,s,a){const u=i.getMeta(r);if(u)return u;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:p}=c;typeof p=="string"?p=p:p=j0(z.from(p),a.schema);const{from:m}=c,y=m+p.length;Pa({editor:e,from:m,to:y,text:p,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,a,u){return Pa({editor:e,from:s,to:a,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Pa({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Pa({editor:e,from:a.pos,to:a.pos,text:`
|
|
39
|
-
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
37
|
+
`))),0,0):K.empty;let m=n.someProp("clipboardTextParser",y=>y(e,i,r,n));if(m)u=m;else{let y=i.marks(),{schema:_}=n.state,S=qs.fromSchema(_);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let N=a.appendChild(document.createElement("p"));E&&N.appendChild(S.serializeNode(_.text(E,y)))})}}else n.someProp("transformPastedHTML",m=>{t=m(t,n)}),a=Pk(t),ef&&Dk(a);let h=a&&a.querySelector("[data-pm-slice]"),p=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let m=+p[3];m>0;m--){let y=a.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;a=y}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||vs.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||p),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!Nk.test(y.parentNode.nodeName)?{ignore:!0}:null}})),p)u=Fk(b0(u,+p[1],+p[2]),p[4]);else if(u=K.maxOpen(Rk(u.content,i),!0),u.openStart||u.openEnd){let m=0,y=0;for(let _=u.content.firstChild;m<u.openStart&&!_.type.spec.isolating;m++,_=_.firstChild);for(let _=u.content.lastChild;y<u.openEnd&&!_.type.spec.isolating;y++,_=_.lastChild);u=b0(u,m,y)}return n.someProp("transformPasted",m=>{u=m(u,n)}),u}const Nk=/^(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 Rk(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)),s,a=[];if(n.forEach(u=>{if(!a)return;let c=i.findWrapping(u.type),h;if(!c)return a=null;if(h=a.length&&s.length&&g0(c,s,u,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=y0(a[a.length-1],s.length));let p=m0(u,c);a.push(p),i=i.matchType(p.type),s=c}}),a)return z.from(a)}return n}function m0(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,z.from(n));return n}function g0(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let s=g0(n,e,t,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(z.from(m0(t,n,i+1))))}}function y0(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,y0(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(z.empty,!0);return n.copy(t.append(r))}function of(n,e,t,r,i,s){let a=e<0?n.firstChild:n.lastChild,u=a.content;return n.childCount>1&&(s=0),i<r-1&&(u=of(u,e,t,r,i+1,s)),i>=t&&(u=e<0?a.contentMatchAt(0).fillBefore(u,s<=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 b0(n,e,t){return e<n.openStart&&(n=new K(of(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new K(of(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const _0={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 w0=null;function v0(){return w0||(w0=document.implementation.createHTMLDocument("title"))}let af=null;function Lk(n){let e=window.trustedTypes;return e?(af||(af=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),af.createHTML(n)):n}function Pk(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=v0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&_0[r[1].toLowerCase()])&&(n=i.map(s=>"<"+s+">").join("")+n+i.map(s=>"</"+s+">").reverse().join("")),t.innerHTML=Lk(n),i)for(let s=0;s<i.length;s++)t=t.querySelector(i[s])||t;return t}function Dk(n){let e=n.querySelectorAll(mr?"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 Fk(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:s,openEnd:a}=n;for(let u=r.length-2;u>=0;u-=2){let c=t.nodes[r[u]];if(!c||c.hasRequiredAttrs())break;i=z.from(c.create(r[u+1],i)),s++,a++}return new K(i,s,a)}const on={},Nt={};function yr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Nt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!x0(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ks&&mr&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Qc&&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,Yg(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Ik(n,t)?t.preventDefault():yr(n,"key")},Nt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Nt.keypress=(n,e)=>{let t=e;if(x0(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Gt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof pe)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",s=>s(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function Ma(n){return{left:n.clientX,top:n.clientY}}function Bk(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function lf(n,e,t,r,i){if(r==-1)return!1;let s=n.state.doc.resolve(r);for(let a=s.depth+1;a>0;a--)if(n.someProp(e,u=>a>s.depth?u(n,t,s.nodeAfter,s.before(a),i,!0):u(n,t,s.node(a),s.before(a),i,!1)))return!0;return!1}function Ai(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function zk(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Q.isSelectable(r)?(Ai(n,new Q(t)),!0):!1}function $k(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Q&&(r=t.node);let s=n.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let u=a>s.depth?s.nodeAfter:s.node(a);if(Q.isSelectable(u)){r&&t.$from.depth>0&&a>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(a);break}}return i!=null?(Ai(n,Q.create(n.state.doc,i)),!0):!1}function Hk(n,e,t,r,i){return lf(n,"handleClickOn",e,t,r)||n.someProp("handleClick",s=>s(n,e,r))||(i?$k(n,t):zk(n,t))}function Wk(n,e,t,r){return lf(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Vk(n,e,t,r){return lf(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Uk(n,t,r)}function Uk(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ai(n,pe.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s),u=i.before(s);if(a.inlineContent)Ai(n,pe.create(r,u+1,u+1+a.content.size));else if(Q.isSelectable(a))Ai(n,Q.create(r,u));else continue;return!0}}function uf(n){return Ia(n)}const S0=Gt?"metaKey":"ctrlKey";on.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=uf(n),i=Date.now(),s="singleClick";i-n.input.lastClick.time<500&&Bk(t,n.input.lastClick)&&!t[S0]&&(n.input.lastClick.type=="singleClick"?s="doubleClick":n.input.lastClick.type=="doubleClick"&&(s="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s};let a=n.posAtCoords(Ma(t));a&&(s=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new qk(n,a,t,!!r)):(s=="doubleClick"?Wk:Vk)(n,a.pos,a.inside,t)?t.preventDefault():yr(n,"pointer"))};class qk{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 s,a;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),a=t.inside;else{let p=e.state.doc.resolve(t.pos);s=p.parent,a=p.depth?p.before():0}const u=i?null:r.target,c=u?e.docView.nearestDesc(u,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:h}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||h instanceof Q&&h.from<=a&&h.to>a)&&(this.mightDrag={node:s,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)),yr(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(()=>tf(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(Ma(e))),this.updateAllowDefault(e),this.allowDefault||!t?yr(this.view,"pointer"):Hk(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ur&&this.mightDrag&&!this.mightDrag.node.isAtom||mr&&!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)?(Ai(this.view,ye.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):yr(this.view,"pointer")}move(e){this.updateAllowDefault(e),yr(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)}}on.touchstart=n=>{n.input.lastTouch=Date.now(),uf(n),yr(n,"pointer")},on.touchmove=n=>{n.input.lastTouch=Date.now(),yr(n,"pointer")},on.contextmenu=n=>uf(n);function x0(n,e){return n.composing?!0:Ur&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Kk=ks?5e3:-1;Nt.compositionstart=Nt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof pe&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Ia(n,!0),n.markCursor=null;else if(Ia(n,!e.selection.empty),Ta&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let u=n.domSelection();u&&u.collapse(a,a.nodeValue.length);break}else i=a,s=-1}}n.input.composing=!0}C0(n,Kk)},Nt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,C0(n,20))};function C0(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ia(n),e))}function Gk(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Jk());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Jk(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ia(n,e=!1){if(!(ks&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Gk(n),e||n.docView&&n.docView.dirty){let t=wk(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!n.state.selection.empty?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function jk(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 Ts=Es&&Qg<15||Qc&&_k<604;on.copy=Nt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let s=Ts?null:t.clipboardData,a=r.content(),{dom:u,text:c}=d0(n,a);s?(t.preventDefault(),s.clearData(),s.setData("text/html",u.innerHTML),s.setData("text/plain",c)):jk(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Yk(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Xk(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();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?cf(n,r.value,null,i,e):cf(n,r.textContent,r.innerHTML,i,e)},50)}function cf(n,e,t,r,i){let s=p0(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,s||K.empty)))return!0;if(!s)return!1;let a=Yk(s),u=a?n.state.tr.replaceSelectionWith(a,r):n.state.tr.replaceSelection(s);return n.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function E0(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Nt.paste=(n,e)=>{let t=e;if(n.composing&&!ks)return;let r=Ts?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&cf(n,E0(r),r.getData("text/html"),i,t)?t.preventDefault():Xk(n,t)};class Zk{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const k0=Gt?"altKey":"ctrlKey";on.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,s=i.empty?null:n.posAtCoords(Ma(t)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof Q?i.to-1:i.to))){if(r&&r.mightDrag)a=Q.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let m=n.docView.nearestDesc(t.target,!0);m&&m.node.type.spec.draggable&&m!=n.docView&&(a=Q.create(n.state.doc,m.posBefore))}}let u=(a||n.state.selection).content(),{dom:c,text:h,slice:p}=d0(n,u);(!t.dataTransfer.files.length||!mr||e0>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Ts?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ts||t.dataTransfer.setData("text/plain",h),n.dragging=new Zk(p,!t[k0],a)},on.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Nt.dragover=Nt.dragenter=(n,e)=>e.preventDefault(),Nt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Ma(t));if(!i)return;let s=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",S=>{a=S(a,n)}):a=p0(n,E0(t.dataTransfer),Ts?null:t.dataTransfer.getData("text/html"),!1,s);let u=!!(r&&!t[k0]);if(n.someProp("handleDrop",S=>S(n,t,a||K.empty,u))){t.preventDefault();return}if(!a)return;t.preventDefault();let c=a?ok(n.state.doc,s.pos,a):s.pos;c==null&&(c=s.pos);let h=n.state.tr;if(u){let{node:S}=r;S?S.replace(h):h.deleteSelection()}let p=h.mapping.map(c),m=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,y=h.doc;if(m?h.replaceRangeWith(p,p,a.content.firstChild):h.replaceRange(p,p,a),h.doc.eq(y))return;let _=h.doc.resolve(p);if(m&&Q.isSelectable(a.content.firstChild)&&_.nodeAfter&&_.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new Q(_));else{let S=h.mapping.map(c);h.mapping.maps[h.mapping.maps.length-1].forEach((E,N,g,v)=>S=v),h.setSelection(o0(n,_,h.doc.resolve(S)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},on.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())&&tf(n)},20))},on.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)},on.beforeinput=(n,e)=>{if(mr&&ks&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",s=>s(n,Yg(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 Nt)on[n]=Nt[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 Bl{constructor(e,t){this.toDOM=e,this.spec=t||qr,this.side=this.spec.side||0}map(e,t,r,i){let{pos:s,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new vn(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Bl&&(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 kr{constructor(e,t){this.attrs=e,this.spec=t||qr}map(e,t,r,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=a?null:new vn(s,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof kr&&Os(this.attrs,e.attrs)&&Os(this.spec,e.spec)}static is(e){return e.type instanceof kr}destroy(){}}let Qk=class Gy{constructor(e,t){this.attrs=e,this.spec=t||qr}map(e,t,r,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=s.pos?null:new vn(s.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(r)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof Gy&&Os(this.attrs,e.attrs)&&Os(this.spec,e.spec)}destroy(){}};class vn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new vn(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 vn(e,e,new Bl(t,r))}static inline(e,t,r,i){return new vn(e,t,new kr(r,i))}static node(e,t,r,i){return new vn(e,t,new Qk(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof kr}get widget(){return this.type instanceof Bl}}const Ti=[],qr={};class Ye{constructor(e,t){this.local=e.length?e:Ti,this.children=t.length?t:Ti}static create(e,t){return t.length?Na(t,e,0,qr):ft}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,s){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=t&&u.to>=e&&(!s||s(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,s)}}map(e,t,r){return this==ft||e.maps.length==0?this:this.mapInner(e,t,0,0,r||qr)}mapInner(e,t,r,i,s){let a;for(let u=0;u<this.local.length;u++){let c=this.local[u].map(e,r,i);c&&c.type.valid(t,c)?(a||(a=[])).push(c):s.onRemove&&s.onRemove(this.local[u].spec)}return this.children.length?eA(this.children,a||[],e,t,r,i,s):a?new Ye(a.sort(Kr),Ti):ft}add(e,t){return t.length?this==ft?Ye.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,s=0;e.forEach((u,c)=>{let h=c+r,p;if(p=T0(t,u,h)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(u,p,h+1):i.splice(s,0,c,c+u.nodeSize,Na(p,u,h+1,qr)),s+=3}});let a=A0(s?O0(t):t,-r);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||a.splice(u--,1);return new Ye(a.length?this.local.concat(a).sort(Kr):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 s=0;s<r.length;s+=3){let a,u=r[s]+t,c=r[s+1]+t;for(let p=0,m;p<e.length;p++)(m=e[p])&&m.from>u&&m.to<c&&(e[p]=null,(a||(a=[])).push(m));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[s+2].removeInner(a,u+1);h!=ft?r[s+2]=h:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,a;s<e.length;s++)if(a=e[s])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 Ye(i,r):ft}forChild(e,t){if(this==ft)return this;if(t.isLeaf)return Ye.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 s=e+1,a=s+t.content.size;for(let u=0;u<this.local.length;u++){let c=this.local[u];if(c.from<a&&c.to>s&&c.type instanceof kr){let h=Math.max(s,c.from)-s,p=Math.min(a,c.to)-s;h<p&&(i||(i=[])).push(c.copy(h,p))}}if(i){let u=new Ye(i.sort(Kr),Ti);return r?new Qr([u,r]):u}return r||ft}eq(e){if(this==e)return!0;if(!(e instanceof Ye)||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 ff(this.localsInner(e))}localsInner(e){if(this==ft)return Ti;if(e.inlineContent||!this.local.some(kr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof kr||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Ye.empty=new Ye([],[]),Ye.removeOverlap=ff;const ft=Ye.empty;class Qr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,qr));return Qr.from(r)}forChild(e,t){if(t.isLeaf)return Ye.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=ft&&(s instanceof Qr?r=r.concat(s.members):r.push(s))}return Qr.from(r)}eq(e){if(!(e instanceof Qr)||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 s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{r&&(t=t.slice(),r=!1);for(let a=0;a<s.length;a++)t.push(s[a])}}return t?ff(r?t:t.sort(Kr)):Ti}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new Qr(e.every(t=>t instanceof Ye)?e:e.reduce((t,r)=>t.concat(r instanceof Ye?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function eA(n,e,t,r,i,s,a){let u=n.slice();for(let h=0,p=s;h<t.maps.length;h++){let m=0;t.maps[h].forEach((y,_,S,E)=>{let N=E-S-(_-y);for(let g=0;g<u.length;g+=3){let v=u[g+1];if(v<0||y>v+p-m)continue;let k=u[g]+p-m;_>=k?u[g+1]=y<=k?-2:-1:y>=p&&N&&(u[g]+=N,u[g+1]+=N)}m+=N}),p=t.maps[h].map(p,-1)}let c=!1;for(let h=0;h<u.length;h+=3)if(u[h+1]<0){if(u[h+1]==-2){c=!0,u[h+1]=-1;continue}let p=t.map(n[h]+s),m=p-i;if(m<0||m>=r.content.size){c=!0;continue}let y=t.map(n[h+1]+s,-1),_=y-i,{index:S,offset:E}=r.content.findIndex(m),N=r.maybeChild(S);if(N&&E==m&&E+N.nodeSize==_){let g=u[h+2].mapInner(t,N,p+1,n[h]+s+1,a);g!=ft?(u[h]=m,u[h+1]=_,u[h+2]=g):(u[h+1]=-2,c=!0)}else c=!0}if(c){let h=tA(u,n,e,t,i,s,a),p=Na(h,r,0,a);e=p.local;for(let m=0;m<u.length;m+=3)u[m+1]<0&&(u.splice(m,3),m-=3);for(let m=0,y=0;m<p.children.length;m+=3){let _=p.children[m];for(;y<u.length&&u[y]<_;)y+=3;u.splice(y,0,p.children[m],p.children[m+1],p.children[m+2])}}return new Ye(e.sort(Kr),u)}function A0(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 vn(i.from+e,i.to+e,i.type))}return t}function tA(n,e,t,r,i,s,a){function u(c,h){for(let p=0;p<c.local.length;p++){let m=c.local[p].map(r,i,h);m?t.push(m):a.onRemove&&a.onRemove(c.local[p].spec)}for(let p=0;p<c.children.length;p+=3)u(c.children[p+2],c.children[p]+h+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&u(n[c+2],e[c]+s+1);return t}function T0(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let s=0,a;s<n.length;s++)(a=n[s])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[s]=null);return i}function O0(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Na(n,e,t,r){let i=[],s=!1;e.forEach((u,c)=>{let h=T0(n,u,c+t);if(h){s=!0;let p=Na(h,u,t+c+1,r);p!=ft&&i.push(c,c+u.nodeSize,p)}});let a=A0(s?O0(n):n,-t).sort(Kr);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 Ye(a,i):ft}function Kr(n,e){return n.from-e.from||n.to-e.to}function ff(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 s=e[i];if(s.from==r.from){s.to!=r.to&&(e==n&&(e=n.slice()),e[i]=s.copy(s.from,r.to),M0(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,s.from),M0(e,i,r.copy(s.from,r.to)));break}}}return e}function M0(n,e,t){for(;e<n.length&&Kr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var br={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:"'"},Ra={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nA=typeof navigator<"u"&&/Mac/.test(navigator.platform),rA=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tt=0;tt<10;tt++)br[48+tt]=br[96+tt]=String(tt);for(var tt=1;tt<=24;tt++)br[tt+111]="F"+tt;for(var tt=65;tt<=90;tt++)br[tt]=String.fromCharCode(tt+32),Ra[tt]=String.fromCharCode(tt);for(var hf in br)Ra.hasOwnProperty(hf)||(Ra[hf]=br[hf]);function iA(n){var e=nA&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||rA&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Ra:br)[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 sA=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function oA(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,s,a;for(let u=0;u<e.length-1;u++){let c=e[u];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))sA?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function aA(n){let e=Object.create(null);for(let t in n)e[oA(t)]=n[t];return e}function df(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function lA(n){return new ct({props:{handleKeyDown:uA(n)}})}function uA(n){let e=aA(n);return function(t,r){let i=iA(r),s,a=e[df(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=e[df(i,r,!1)];if(u&&u(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(s=br[r.keyCode])&&s!=i){let u=e[df(s,r)];if(u&&u(t.state,t.dispatch,t))return!0}}return!1}}const pf=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function I0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const N0=(n,e,t)=>{let r=I0(n,t);if(!r)return!1;let i=mf(r);if(!i){let a=r.blockRange(),u=a&&xi(a);return u==null?!1:(e&&e(n.tr.lift(a,u).scrollIntoView()),!0)}let s=i.nodeBefore;if(H0(n,i,e,-1))return!0;if(r.parent.content.size==0&&(Oi(s,"end")||Q.isSelectable(s)))for(let a=r.depth;;a--){let u=Ea(n.doc,r.before(a),r.after(a),K.empty);if(u&&u.slice.size<u.to-u.from){if(e){let c=n.tr.step(u);c.setSelection(Oi(s,"end")?ye.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):Q.create(c.doc,i.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},cA=(n,e,t)=>{let r=I0(n,t);if(!r)return!1;let i=mf(r);return i?R0(n,i,e):!1},fA=(n,e,t)=>{let r=P0(n,t);if(!r)return!1;let i=gf(r);return i?R0(n,i,e):!1};function R0(n,e,t){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let p=i.lastChild;if(!p)return!1;i=p}let a=e.nodeAfter,u=a,c=e.pos+1;for(;!u.isTextblock;c++){if(u.type.spec.isolating)return!1;let p=u.firstChild;if(!p)return!1;u=p}let h=Ea(n.doc,s,c,K.empty);if(!h||h.from!=s||h instanceof je&&h.slice.size>=c-s)return!1;if(t){let p=n.tr.step(h);p.setSelection(pe.create(p.doc,s)),t(p.scrollIntoView())}return!0}function Oi(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 L0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;s=mf(r)}let a=s&&s.nodeBefore;return!a||!Q.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Q.create(n.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function mf(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 P0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const D0=(n,e,t)=>{let r=P0(n,t);if(!r)return!1;let i=gf(r);if(!i)return!1;let s=i.nodeAfter;if(H0(n,i,e,1))return!0;if(r.parent.content.size==0&&(Oi(s,"start")||Q.isSelectable(s))){let a=Ea(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(Oi(s,"start")?ye.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Q.create(u.doc,u.mapping.map(i.pos))),e(u.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},F0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;s=gf(r)}let a=s&&s.nodeAfter;return!a||!Q.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Q.create(n.doc,s.pos)).scrollIntoView()),!0)};function gf(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 hA=(n,e)=>{let t=n.selection,r=t instanceof Q,i;if(r){if(t.node.isTextblock||!dr(n.doc,t.from))return!1;i=t.from}else if(i=Ca(n.doc,t.from,-1),i==null)return!1;if(e){let s=n.tr.join(i);r&&s.setSelection(Q.create(s.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},dA=(n,e)=>{let t=n.selection,r;if(t instanceof Q){if(t.node.isTextblock||!dr(n.doc,t.to))return!1;r=t.to}else if(r=Ca(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},pA=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),s=i&&xi(i);return s==null?!1:(e&&e(n.tr.lift(i,s).scrollIntoView()),!0)},B0=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
38
|
+
`).scrollIntoView()),!0)};function yf(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 mA=(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),s=t.indexAfter(-1),a=yf(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(e){let u=t.after(),c=n.tr.replaceWith(u,u,a.createAndFill());c.setSelection(ye.near(c.doc.resolve(u),1)),e(c.scrollIntoView())}return!0},z0=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Lt||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=yf(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(a,s.createAndFill());u.setSelection(pe.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},$0=(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 s=t.before();if(zn(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let r=t.blockRange(),i=r&&xi(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function gA(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Q&&e.selection.node.isBlock)return!r.parentOffset||!zn(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],a,u,c=!1,h=!1;for(let _=r.depth;;_--)if(r.node(_).isBlock){c=r.end(_)==r.pos+(r.depth-_),h=r.start(_)==r.pos-(r.depth-_),u=yf(r.node(_-1).contentMatchAt(r.indexAfter(_-1))),s.unshift(c&&u?{type:u}:null),a=_;break}else{if(_==1)return!1;s.unshift(null)}let p=e.tr;(e.selection instanceof pe||e.selection instanceof Lt)&&p.deleteSelection();let m=p.mapping.map(r.pos),y=zn(p.doc,m,s.length,s);if(y||(s[0]=u?{type:u}:null,y=zn(p.doc,m,s.length,s)),p.split(m,s.length,s),!c&&h&&r.node(a).type!=u){let _=p.mapping.map(r.before(a)),S=p.doc.resolve(_);u&&r.node(a-1).canReplaceWith(S.index(),S.index()+1,u)&&p.setNodeMarkup(p.mapping.map(r.before(a)),u)}return t&&t(p.scrollIntoView()),!0}}const yA=gA(),bA=(n,e)=>{let{$from:t,to:r}=n.selection,i,s=t.sharedDepth(r);return s==0?!1:(i=t.before(s),e&&e(n.tr.setSelection(Q.create(n.doc,i))),!0)};function _A(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||dr(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function H0(n,e,t,r){let i=e.nodeBefore,s=e.nodeAfter,a,u,c=i.type.spec.isolating||s.type.spec.isolating;if(!c&&_A(n,e,t))return!0;let h=!c&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(a=(u=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&u.matchType(a[0]||s.type).validEnd){if(t){let _=e.pos+s.nodeSize,S=z.empty;for(let g=a.length-1;g>=0;g--)S=z.from(a[g].create(null,S));S=z.from(i.copy(S));let E=n.tr.step(new Je(e.pos-1,_,e.pos,_,new K(S,1,0),a.length,!0)),N=E.doc.resolve(_+2*a.length);N.nodeAfter&&N.nodeAfter.type==i.type&&dr(E.doc,N.pos)&&E.join(N.pos),t(E.scrollIntoView())}return!0}let p=s.type.spec.isolating||r>0&&c?null:ye.findFrom(e,1),m=p&&p.$from.blockRange(p.$to),y=m&&xi(m);if(y!=null&&y>=e.depth)return t&&t(n.tr.lift(m,y).scrollIntoView()),!0;if(h&&Oi(s,"start",!0)&&Oi(i,"end")){let _=i,S=[];for(;S.push(_),!_.isTextblock;)_=_.lastChild;let E=s,N=1;for(;!E.isTextblock;E=E.firstChild)N++;if(_.canReplace(_.childCount,_.childCount,E.content)){if(t){let g=z.empty;for(let k=S.length-1;k>=0;k--)g=z.from(S[k].copy(g));let v=n.tr.step(new Je(e.pos-S.length,e.pos+s.nodeSize,e.pos+N,e.pos+s.nodeSize-N,new K(g,S.length,0),0,!0));t(v.scrollIntoView())}return!0}}return!1}function W0(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(pe.create(e.doc,n<0?i.start(s):i.end(s)))),!0):!1}}const wA=W0(-1),vA=W0(1);function SA(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,a=i.blockRange(s),u=a&&Uc(a,n,e);return u?(r&&r(t.tr.wrap(a,u).scrollIntoView()),!0):!1}}function V0(n,e=null){return function(t,r){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:u}}=t.selection.ranges[s];t.doc.nodesBetween(a,u,(c,h)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)i=!0;else{let p=t.doc.resolve(h),m=p.index();i=p.parent.canReplaceWith(m,m+1,n)}})}if(!i)return!1;if(r){let s=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:c}}=t.selection.ranges[a];s.setBlockType(u,c,n,e)}r(s.scrollIntoView())}return!0}}function bf(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}bf(pf,N0,L0),bf(pf,D0,F0),bf(B0,z0,$0,yA),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function xA(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,a=i.blockRange(s);if(!a)return!1;let u=r?t.tr:null;return CA(u,a,n,e)?(r&&r(u.scrollIntoView()),!0):!1}}function CA(n,e,t,r=null){let i=!1,s=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=a.resolve(e.start-2);s=new _a(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new _a(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let u=Uc(s,t,r,e);return u?(n&&EA(n,e,u,i,t),!0):!1}function EA(n,e,t,r,i){let s=z.empty;for(let p=t.length-1;p>=0;p--)s=z.from(t[p].type.create(t[p].attrs,s));n.step(new Je(e.start-(r?2:0),e.end,e.start,e.end,new K(s,0,0),t.length,!0));let a=0;for(let p=0;p<t.length;p++)t[p].type==i&&(a=p+1);let u=t.length-a,c=e.start+t.length-(r?2:0),h=e.parent;for(let p=e.startIndex,m=e.endIndex,y=!0;p<m;p++,y=!1)!y&&zn(n.doc,c,u)&&(n.split(c,u),c+=2*u),c+=h.child(p).nodeSize;return n}function kA(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return s?t?r.node(s.depth-1).type==n?AA(e,t,n,s):TA(e,t,s):!0:!1}}function AA(n,e,t,r){let i=n.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(i.step(new Je(s-1,a,s,a,new K(z.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new _a(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=xi(r);if(u==null)return!1;i.lift(r,u);let c=i.mapping.map(s,-1)-1;return dr(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function TA(n,e,t){let r=n.tr,i=t.parent;for(let _=t.end,S=t.endIndex-1,E=t.startIndex;S>E;S--)_-=i.child(S).nodeSize,r.delete(_-1,_+1);let s=r.doc.resolve(t.start),a=s.nodeAfter;if(r.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let u=t.startIndex==0,c=t.endIndex==i.childCount,h=s.node(-1),p=s.index(-1);if(!h.canReplace(p+(u?0:1),p+1,a.content.append(c?z.empty:z.from(i))))return!1;let m=s.pos,y=m+a.nodeSize;return r.step(new Je(m-(u?1:0),y+(c?1:0),m+1,y-1,new K((u?z.empty:z.from(i.copy(z.empty))).append(c?z.empty:z.from(i.copy(z.empty))),u?0:1,c?0:1),u?0:1)),e(r.scrollIntoView()),!0}function OA(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,h=>h.childCount>0&&h.firstChild.type==n);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let u=s.parent,c=u.child(a-1);if(c.type!=n)return!1;if(t){let h=c.lastChild&&c.lastChild.type==u.type,p=z.from(h?n.create():null),m=new K(z.from(n.create(null,z.from(u.type.create(null,p)))),h?3:1,0),y=s.start,_=s.end;t(e.tr.step(new Je(y-(h?3:1),_,y,_,m,1,!0)).scrollIntoView())}return!0}}function La(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,s=t.storedMarks,t}}}class _f{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:s}=r,a=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([u,c])=>[u,(...p)=>{const m=c(...p)(a);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:a}=i,u=[],c=!!e,h=e||s.tr,p=()=>(!c&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(h),u.every(y=>y===!0)),m={...Object.fromEntries(Object.entries(r).map(([y,_])=>[y,(...E)=>{const N=this.buildProps(h,t),g=_(...E)(N);return u.push(g),m}])),run:p};return m}createCan(e){const{rawCommands:t,state:r}=this,i=!1,s=e||r.tr,a=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([c,h])=>[c,(...p)=>h(...p)({...a,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:a}=i,u={tr:e,editor:i,view:a,state:La({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,h])=>[c,(...p)=>h(...p)(u)]))}};return u}}function J(n,e,t){return n.config[e]===void 0&&n.parent?J(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?J(n.parent,e,t):null}):n.config[e]}function Pa(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 U0(n){const e=[],{nodeExtensions:t,markExtensions:r}=Pa(n),i=[...t,...r],s={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,extensions:i},c=J(a,"addGlobalAttributes",u);if(!c)return;c().forEach(p=>{p.types.forEach(m=>{Object.entries(p.attributes).forEach(([y,_])=>{e.push({type:m,name:y,attribute:{...s,..._}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},c=J(a,"addAttributes",u);if(!c)return;const h=c();Object.entries(h).forEach(([p,m])=>{const y={...s,...m};typeof y?.default=="function"&&(y.default=y.default()),y?.isRequired&&y?.default===void 0&&delete y.default,e.push({type:a.name,name:p,attribute:y})})}),e}function qe(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 Mi(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const u=s?String(s).split(" "):[],c=r[i]?r[i].split(" "):[],h=u.filter(p=>!c.includes(p));r[i]=[...c,...h].join(" ")}else if(i==="style"){const u=s?s.split(";").map(p=>p.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(p=>p.trim()).filter(Boolean):[],h=new Map;c.forEach(p=>{const[m,y]=p.split(":").map(_=>_.trim());h.set(m,y)}),u.forEach(p=>{const[m,y]=p.split(":").map(_=>_.trim());h.set(m,y)}),r[i]=Array.from(h.entries()).map(([p,m])=>`${p}: ${m}`).join("; ")}else r[i]=s}),r},{})}function wf(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Mi(t,r),{})}function MA(n){return typeof n=="function"}function de(n,e=void 0,...t){return MA(n)?e?n.bind(e)(...t):n(...t):n}function IA(n={}){return Object.keys(n).length===0&&n.constructor===Object}function NA(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function q0(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((s,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(t):NA(t.getAttribute(a.name));return u==null?s:{...s,[a.name]:u}},{});return{...r,...i}}}}function K0(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&IA(t)?!1:t!=null))}function G0(n,e){var t;const r=U0(n),{nodeExtensions:i,markExtensions:s}=Pa(n),a=(t=i.find(h=>J(h,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(h=>{const p=r.filter(g=>g.type===h.name),m={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((g,v)=>{const k=J(v,"extendNodeSchema",m);return{...g,...k?k(h):{}}},{}),_=K0({...y,content:de(J(h,"content",m)),marks:de(J(h,"marks",m)),group:de(J(h,"group",m)),inline:de(J(h,"inline",m)),atom:de(J(h,"atom",m)),selectable:de(J(h,"selectable",m)),draggable:de(J(h,"draggable",m)),code:de(J(h,"code",m)),whitespace:de(J(h,"whitespace",m)),linebreakReplacement:de(J(h,"linebreakReplacement",m)),defining:de(J(h,"defining",m)),isolating:de(J(h,"isolating",m)),attrs:Object.fromEntries(p.map(g=>{var v;return[g.name,{default:(v=g?.attribute)===null||v===void 0?void 0:v.default}]}))}),S=de(J(h,"parseHTML",m));S&&(_.parseDOM=S.map(g=>q0(g,p)));const E=J(h,"renderHTML",m);E&&(_.toDOM=g=>E({node:g,HTMLAttributes:wf(g,p)}));const N=J(h,"renderText",m);return N&&(_.toText=N),[h.name,_]})),c=Object.fromEntries(s.map(h=>{const p=r.filter(N=>N.type===h.name),m={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((N,g)=>{const v=J(g,"extendMarkSchema",m);return{...N,...v?v(h):{}}},{}),_=K0({...y,inclusive:de(J(h,"inclusive",m)),excludes:de(J(h,"excludes",m)),group:de(J(h,"group",m)),spanning:de(J(h,"spanning",m)),code:de(J(h,"code",m)),attrs:Object.fromEntries(p.map(N=>{var g;return[N.name,{default:(g=N?.attribute)===null||g===void 0?void 0:g.default}]}))}),S=de(J(h,"parseHTML",m));S&&(_.parseDOM=S.map(N=>q0(N,p)));const E=J(h,"renderHTML",m);return E&&(_.toDOM=N=>E({mark:N,HTMLAttributes:wf(N,p)})),[h.name,_]}));return new yg({topNode:a,nodes:u,marks:c})}function vf(n,e){return e.nodes[n]||e.marks[n]||null}function J0(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function j0(n,e){const t=qs.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}const RA=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,s,a,u)=>{var c,h;const p=((h=(c=i.type.spec).toText)===null||h===void 0?void 0:h.call(c,{node:i,pos:s,parent:a,index:u}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?p:p.slice(0,Math.max(0,r-s))}),t};function Sf(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Y0{constructor(e){this.find=e.find,this.handler=e.handler}}const LA=(n,e)=>{if(Sf(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 Da(n){var e;const{editor:t,from:r,to:i,text:s,rules:a,plugin:u}=n,{view:c}=t;if(c.composing)return!1;const h=c.state.doc.resolve(r);if(h.parent.type.spec.code||!((e=h.nodeBefore||h.nodeAfter)===null||e===void 0)&&e.marks.find(y=>y.type.spec.code))return!1;let p=!1;const m=RA(h)+s;return a.forEach(y=>{if(p)return;const _=LA(m,y.find);if(!_)return;const S=c.state.tr,E=La({state:c.state,transaction:S}),N={from:r-(_[0].length-s.length),to:i},{commands:g,chain:v,can:k}=new _f({editor:t,state:E});y.handler({state:E,range:N,match:_,commands:g,chain:v,can:k})===null||!S.steps.length||(S.setMeta(u,{transform:S,from:r,to:i,text:s}),c.dispatch(S),p=!0)}),p}function PA(n){const{editor:e,rules:t}=n,r=new ct({state:{init(){return null},apply(i,s,a){const u=i.getMeta(r);if(u)return u;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:p}=c;typeof p=="string"?p=p:p=j0(z.from(p),a.schema);const{from:m}=c,y=m+p.length;Da({editor:e,from:m,to:y,text:p,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,a,u){return Da({editor:e,from:s,to:a,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Da({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Da({editor:e,from:a.pos,to:a.pos,text:`
|
|
39
|
+
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function DA(n){return Object.prototype.toString.call(n).slice(8,-1)}function Fa(n){return DA(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Ba(n,e){const t={...n};return Fa(n)&&Fa(e)&&Object.keys(e).forEach(r=>{Fa(e[r])&&Fa(n[r])?t[r]=Ba(n[r],e[r]):t[r]=e[r]}),t}class wt{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&&Object.keys(e.defaultOptions).length>0&&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=de(J(this,"addOptions",{name:this.name}))),this.storage=de(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new wt(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Ba(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new wt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=de(J(t,"addOptions",{name:t.name})),t.storage=de(J(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 c=a.find(h=>h?.type.name===t.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function FA(n){return typeof n=="number"}class BA{constructor(e){this.find=e.find,this.handler=e.handler}}const zA=(n,e,t)=>{if(Sf(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=n,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function $A(n){const{editor:e,state:t,from:r,to:i,rule:s,pasteEvent:a,dropEvent:u}=n,{commands:c,chain:h,can:p}=new _f({editor:e,state:t}),m=[];return t.doc.nodesBetween(r,i,(_,S)=>{if(!_.isTextblock||_.type.spec.code)return;const E=Math.max(r,S),N=Math.min(i,S+_.content.size),g=_.textBetween(E-S,N-S,void 0,"\uFFFC");zA(g,s.find,a).forEach(k=>{if(k.index===void 0)return;const A=E+k.index+1,T=A+k[0].length,F={from:t.tr.mapping.map(A),to:t.tr.mapping.map(T)},U=s.handler({state:t,range:F,match:k,commands:c,chain:h,can:p,pasteEvent:a,dropEvent:u});m.push(U)})}),m.every(_=>_!==null)}let za=null;const HA=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function WA(n){const{editor:e,rules:t}=n;let r=null,i=!1,s=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,u;try{u=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{u=null}const c=({state:p,from:m,to:y,rule:_,pasteEvt:S})=>{const E=p.tr,N=La({state:p,transaction:E});if(!(!$A({editor:e,state:N,from:Math.max(m-1,0),to:y.b-1,rule:_,pasteEvent:S,dropEvent:u})||!E.steps.length)){try{u=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{u=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return t.map(p=>new ct({view(m){const y=S=>{var E;r=!((E=m.dom.parentElement)===null||E===void 0)&&E.contains(S.target)?m.dom.parentElement:null,r&&(za=e)},_=()=>{za&&(za=null)};return window.addEventListener("dragstart",y),window.addEventListener("dragend",_),{destroy(){window.removeEventListener("dragstart",y),window.removeEventListener("dragend",_)}}},props:{handleDOMEvents:{drop:(m,y)=>{if(s=r===m.dom.parentElement,u=y,!s){const _=za;_&&setTimeout(()=>{const S=_.state.selection;S&&_.commands.deleteRange({from:S.from,to:S.to})},10)}return!1},paste:(m,y)=>{var _;const S=(_=y.clipboardData)===null||_===void 0?void 0:_.getData("text/html");return a=y,i=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(m,y,_)=>{const S=m[0],E=S.getMeta("uiEvent")==="paste"&&!i,N=S.getMeta("uiEvent")==="drop"&&!s,g=S.getMeta("applyPasteRules"),v=!!g;if(!E&&!N&&!v)return;if(v){let{text:T}=g;typeof T=="string"?T=T:T=j0(z.from(T),_.schema);const{from:F}=g,U=F+T.length,W=HA(T);return c({rule:p,state:_,from:F,to:{b:U},pasteEvt:W})}const k=y.doc.content.findDiffStart(_.doc.content),A=y.doc.content.findDiffEnd(_.doc.content);if(!(!FA(k)||!A||k===A.b))return c({rule:p,state:_,from:k,to:A,pasteEvt:a})}}))}function VA(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}class Bi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Bi.resolve(e),this.schema=G0(this.extensions,t),this.setupExtensions()}static resolve(e){const t=Bi.sort(Bi.flatten(e)),r=VA(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=J(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const s=J(r,"priority")||100,a=J(i,"priority")||100;return s>a?-1:s<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:vf(t.name,this.schema)},i=J(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Bi.sort([...this.extensions].reverse()),r=[],i=[],s=t.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:e,type:vf(a.name,this.schema)},c=[],h=J(a,"addKeyboardShortcuts",u);let p={};if(a.type==="mark"&&J(a,"exitable",u)&&(p.ArrowRight=()=>wt.handleExit({editor:e,mark:a})),h){const E=Object.fromEntries(Object.entries(h()).map(([N,g])=>[N,()=>g({editor:e})]));p={...p,...E}}const m=lA(p);c.push(m);const y=J(a,"addInputRules",u);J0(a,e.options.enableInputRules)&&y&&r.push(...y());const _=J(a,"addPasteRules",u);J0(a,e.options.enablePasteRules)&&_&&i.push(..._());const S=J(a,"addProseMirrorPlugins",u);if(S){const E=S();c.push(...E)}return c}).flat();return[PA({editor:e,rules:r}),...WA({editor:e,rules:i}),...s]}get attributes(){return U0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Pa(this.extensions);return Object.fromEntries(t.filter(r=>!!J(r,"addNodeView")).map(r=>{const i=this.attributes.filter(c=>c.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:qe(r.name,this.schema)},a=J(r,"addNodeView",s);if(!a)return[];const u=(c,h,p,m,y)=>{const _=wf(c,i);return a()({node:c,view:h,getPos:p,decorations:m,innerDecorations:y,editor:e,extension:r,HTMLAttributes:_})};return[r.name,u]}))}setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:vf(e.name,this.schema)};e.type==="mark"&&(!((t=de(J(e,"keepOnSplit",r)))!==null&&t!==void 0)||t)&&this.splittableMarks.push(e.name);const i=J(e,"onBeforeCreate",r),s=J(e,"onCreate",r),a=J(e,"onUpdate",r),u=J(e,"onSelectionUpdate",r),c=J(e,"onTransaction",r),h=J(e,"onFocus",r),p=J(e,"onBlur",r),m=J(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),u&&this.editor.on("selectionUpdate",u),c&&this.editor.on("transaction",c),h&&this.editor.on("focus",h),p&&this.editor.on("blur",p),m&&this.editor.on("destroy",m)})}}class Re{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&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=de(J(this,"addOptions",{name:this.name}))),this.storage=de(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Re(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Ba(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Re({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=de(J(t,"addOptions",{name:t.name})),t.storage=de(J(t,"addStorage",{name:t.name,options:t.options})),t}}function UA(n,e,t){const{from:r,to:i}=e,{blockSeparator:s=`
|
|
40
40
|
|
|
41
|
-
`,textSerializers:a={}}=t||{};let u="";return n.nodesBetween(r,i,(c,h,p,m)=>{var y;c.isBlock&&h>r&&(u+=s);const _=a?.[c.type.name];if(_)return p&&(u+=_({node:c,pos:h,parent:p,index:m,range:e})),!1;c.isText&&(u+=(y=c?.text)===null||y===void 0?void 0:y.slice(Math.max(r,h)-h,i-h))}),u}function qT(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Re.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ct({key:new It("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map(p=>p.$from.pos)),u=Math.max(...s.map(p=>p.$to.pos)),c=qT(t);return UT(r,{from:a,to:u},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}});const KT=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),GT=(n=!1)=>({commands:e})=>e.setContent("",n),JT=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:s,$to:a})=>{n.doc.nodesBetween(s.pos,a.pos,(u,c)=>{if(u.type.isText)return;const{doc:h,mapping:p}=e,m=h.resolve(p.map(c)),y=h.resolve(p.map(c+u.nodeSize)),_=m.blockRange(y);if(!_)return;const S=xi(_);if(u.type.isTextblock){const{defaultType:E}=m.parent.contentMatchAt(m.index());e.setNodeMarkup(_.start,E)}(S||S===0)&&e.lift(_,S)})}),!0},jT=n=>e=>n(e),YT=()=>({state:n,dispatch:e})=>z0(n,e),XT=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,s=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,s.content),r.setSelection(new pe(r.doc.resolve(a-1))),!0},ZT=()=>({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 s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const u=i.before(s),c=i.after(s);n.delete(u,c).scrollIntoView()}return!0}return!1},QT=n=>({tr:e,state:t,dispatch:r})=>{const i=qe(n,t.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(r){const c=s.before(a),h=s.after(a);e.delete(c,h).scrollIntoView()}return!0}return!1},eA=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},tA=()=>({state:n,dispatch:e})=>pf(n,e),nA=()=>({commands:n})=>n.keyboardShortcut("Enter"),rA=()=>({state:n,dispatch:e})=>mT(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]:Sf(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function X0(n,e,t={}){return n.find(r=>r.type===e&&za(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function Z0(n,e,t={}){return!!X0(n,e,t)}function xf(n,e,t){var r;if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(p=>p.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(p=>p.type===e)||(t=t||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!X0([...i.node.marks],e,t)))return;let a=i.index,u=n.start()+i.offset,c=a+1,h=u+i.node.nodeSize;for(;a>0&&Z0([...n.parent.child(a-1).marks],e,t);)a-=1,u-=n.parent.child(a).nodeSize;for(;c<n.parent.childCount&&Z0([...n.parent.child(c).marks],e,t);)h+=n.parent.child(c).nodeSize,c+=1;return{from:u,to:h}}function mn(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 iA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const s=mn(n,r.schema),{doc:a,selection:u}=t,{$from:c,from:h,to:p}=u;if(i){const m=xf(c,s,e);if(m&&m.from<=h&&m.to>=p){const y=pe.create(a,m.from,m.to);t.setSelection(y)}}return!0},sA=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 Q0(n){return n instanceof pe}function Gr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function oA(n,e=null){if(!e)return null;const t=ye.atStart(n),r=ye.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,s=r.to;return e==="all"?pe.create(n,Gr(0,i,s),Gr(n.content.size,i,s)):pe.create(n,Gr(e,i,s),Gr(e,i,s))}function aA(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Cf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const lA=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(Cf()||aA())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(s&&n===null&&!Q0(t.state.selection))return a(),!0;const u=oA(i.doc,n)||t.state.selection,c=t.state.selection.eq(u);return s&&(c||i.setSelection(u),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},uA=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),cA=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),e1=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&e1(r)}return n};function $a(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return e1(t)}function Ha(n,e,t){if(n instanceof hr||n instanceof z)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return z.fromArray(n.map(u=>e.nodeFromJSON(u)));const a=e.nodeFromJSON(n);return t.errorOnInvalidContent&&a.check(),a}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",s),Ha("",e,t)}if(i){if(t.errorOnInvalidContent){let a=!1,u="";const c=new yg({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(a=!0,u=typeof h=="string"?h:h.outerHTML,null)}]}})});if(t.slice?ws.fromSchema(c).parseSlice($a(n),t.parseOptions):ws.fromSchema(c).parse($a(n),t.parseOptions),t.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${u}`)})}const s=ws.fromSchema(e);return t.slice?s.parseSlice($a(n),t.parseOptions).content:s.parse($a(n),t.parseOptions)}return Ha("",e,t)}function fA(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof je||i instanceof Je))return;const s=n.mapping.maps[r];let a=0;s.forEach((u,c,h,p)=>{a===0&&(a=p)}),n.setSelection(ye.near(n.doc.resolve(a),t))}const hA=n=>!("type"in n),dA=(n,e,t)=>({tr:r,dispatch:i,editor:s})=>{var a;if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let u;try{u=Ha(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(a=t.errorOnInvalidContent)!==null&&a!==void 0?a:s.options.enableContentCheck})}catch(S){return s.emit("contentError",{editor:s,error:S,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:h}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},p=!0,m=!0;if((hA(u)?u:[u]).forEach(S=>{S.check(),p=p?S.isText&&S.marks.length===0:!1,m=m?S.isBlock:!1}),c===h&&m){const{parent:S}=r.doc.resolve(c);S.isTextblock&&!S.type.spec.code&&!S.childCount&&(c-=1,h+=1)}let _;if(p){if(Array.isArray(e))_=e.map(S=>S.text||"").join("");else if(e instanceof z){let S="";e.forEach(E=>{E.text&&(S+=E.text)}),_=S}else typeof e=="object"&&e&&e.text?_=e.text:_=e;r.insertText(_,c,h)}else _=u,r.replaceWith(c,h,_);t.updateSelection&&fA(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:_}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:_})}return!0},pA=()=>({state:n,dispatch:e})=>hT(n,e),mA=()=>({state:n,dispatch:e})=>dT(n,e),gA=()=>({state:n,dispatch:e})=>N0(n,e),yA=()=>({state:n,dispatch:e})=>D0(n,e),bA=()=>({state:n,dispatch:e,tr:t})=>{try{const r=xa(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},_A=()=>({state:n,dispatch:e,tr:t})=>{try{const r=xa(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},wA=()=>({state:n,dispatch:e})=>cT(n,e),vA=()=>({state:n,dispatch:e})=>fT(n,e);function t1(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function SA(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,s,a;for(let u=0;u<e.length-1;u+=1){const c=e[u];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))Cf()||t1()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}const xA=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const s=SA(n).split(/-(?!$)/),a=s.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",h=>h(t,u))});return c?.steps.forEach(h=>{const p=h.map(r.mapping);p&&i&&r.maybeStep(p)}),!0};function Ef(n,e,t={}){const{from:r,to:i,empty:s}=n.selection,a=e?qe(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(m,y)=>{if(m.isText)return;const _=Math.max(r,y),S=Math.min(i,y+m.nodeSize);u.push({node:m,from:_,to:S})});const c=i-r,h=u.filter(m=>a?a.name===m.node.type.name:!0).filter(m=>za(m.node.attrs,t,{strict:!1}));return s?!!h.length:h.reduce((m,y)=>m+y.to-y.from,0)>=c}const CA=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return Ef(t,i,e)?pT(t,r):!1},EA=()=>({state:n,dispatch:e})=>$0(n,e),kA=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return kT(r)(e,t)},TA=()=>({state:n,dispatch:e})=>B0(n,e);function kf(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function n1(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 AA=(n,e)=>({tr:t,state:r,dispatch:i})=>{let s=null,a=null;const u=kf(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(s=qe(n,r.schema)),u==="mark"&&(a=mn(n,r.schema)),i&&t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(h,p)=>{s&&s===h.type&&t.setNodeMarkup(p,void 0,n1(h.attrs,e)),a&&h.marks.length&&h.marks.forEach(m=>{a===m.type&&t.addMark(p,p+h.nodeSize,a.create(n1(m.attrs,e)))})})}),!0):!1},OA=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),MA=()=>({tr:n,dispatch:e})=>{if(e){const t=new Lt(n.doc);n.setSelection(t)}return!0},IA=()=>({state:n,dispatch:e})=>L0(n,e),NA=()=>({state:n,dispatch:e})=>F0(n,e),RA=()=>({state:n,dispatch:e})=>bT(n,e),LA=()=>({state:n,dispatch:e})=>vT(n,e),PA=()=>({state:n,dispatch:e})=>wT(n,e);function DA(n,e,t={},r={}){return Ha(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const FA=(n,e=!1,t={},r={})=>({editor:i,tr:s,dispatch:a,commands:u})=>{var c,h;const{doc:p}=s;if(t.preserveWhitespace!=="full"){const m=DA(n,i.schema,t,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return a&&s.replaceWith(0,p.content.size,m).setMeta("preventUpdate",!e),!0}return a&&s.setMeta("preventUpdate",!e),u.insertContentAt({from:0,to:p.content.size},n,{parseOptions:t,errorOnInvalidContent:(h=r.errorOnInvalidContent)!==null&&h!==void 0?h:i.options.enableContentCheck})};function r1(n,e){const t=mn(e,n.schema),{from:r,to:i,empty:s}=n.selection,a=[];s?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,c=>{a.push(...c.marks)});const u=a.find(c=>c.type.name===t.name);return u?{...u.attrs}:{}}function BA(n,e){const t=new dk(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function zA(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 $A(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&r.push({node:i,pos:s})}),r}function HA(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 Tf(n){return e=>HA(e.$from,n)}function WA(n,e){const t=Fi.resolve(n);return G0(t,e)}function VA(n,e){const t=qe(e,n.schema),{from:r,to:i}=n.selection,s=[];n.doc.nodesBetween(r,i,u=>{s.push(u)});const a=s.reverse().find(u=>u.type.name===t.name);return a?{...a.attrs}:{}}function UA(n,e){const t=kf(typeof e=="string"?e:e.name,n.schema);return t==="node"?VA(n,e):t==="mark"?r1(n,e):{}}function qA(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 KA(n){const e=qA(n);return e.length===1?e:e.filter((t,r)=>!e.filter((s,a)=>a!==r).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function GA(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((u,c)=>{a.push({from:u,to:c})});else{const{from:u,to:c}=t[s];if(u===void 0||c===void 0)return;a.push({from:u,to:c})}a.forEach(({from:u,to:c})=>{const h=e.slice(s).map(u,-1),p=e.slice(s).map(c),m=e.invert().map(h,-1),y=e.invert().map(p);r.push({oldRange:{from:m,to:y},newRange:{from:h,to:p}})})}),KA(r)}function i1(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const s=t.resolve(n),a=xf(s,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),r}function Wa(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function JA(n,e,t={}){const{empty:r,ranges:i}=n.selection,s=e?mn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(m=>s?s.name===m.type.name:!0).find(m=>za(m.attrs,t,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:m,$to:y})=>{const _=m.pos,S=y.pos;n.doc.nodesBetween(_,S,(E,N)=>{if(!E.isText&&!E.marks.length)return;const g=Math.max(_,N),v=Math.min(S,N+E.nodeSize),k=v-g;a+=k,u.push(...E.marks.map(T=>({mark:T,from:g,to:v})))})}),a===0)return!1;const c=u.filter(m=>s?s.name===m.mark.type.name:!0).filter(m=>za(m.mark.attrs,t,{strict:!1})).reduce((m,y)=>m+y.to-y.from,0),h=u.filter(m=>s?m.mark.type!==s&&m.mark.type.excludes(s):!0).reduce((m,y)=>m+y.to-y.from,0);return(c>0?c+h:c)>=a}function s1(n,e){const{nodeExtensions:t}=La(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=de(J(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function o1(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!==null&&r!==void 0?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(s=>{i!==!1&&(o1(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function jA(n,e,t){var r;const{selection:i}=e;let s=null;if(Q0(i)&&(s=i.$cursor),s){const u=(r=n.storedMarks)!==null&&r!==void 0?r:s.marks();return!!t.isInSet(u)||!u.some(c=>c.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:u,$to:c})=>{let h=u.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(u.pos,c.pos,(p,m,y)=>{if(h)return!1;if(p.isInline){const _=!y||y.type.allowsMarkType(t),S=!!t.isInSet(p.marks)||!p.marks.some(E=>E.type.excludes(t));h=_&&S}return!h}),h})}const YA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=t,{empty:a,ranges:u}=s,c=mn(n,r.schema);if(i)if(a){const h=r1(r,c);t.addStoredMark(c.create({...h,...e}))}else u.forEach(h=>{const p=h.$from.pos,m=h.$to.pos;r.doc.nodesBetween(p,m,(y,_)=>{const S=Math.max(_,p),E=Math.min(_+y.nodeSize,m);y.marks.find(g=>g.type===c)?y.marks.forEach(g=>{c===g.type&&t.addMark(S,E,c.create({...g.attrs,...e}))}):t.addMark(S,E,c.create(e))})});return jA(r,t,c)},XA=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),ZA=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const s=qe(n,t.schema);let a;return t.selection.$anchor.sameParent(t.selection.$head)&&(a=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:u})=>V0(s,{...a,...e})(t)?!0:u.clearNodes()).command(({state:u})=>V0(s,{...a,...e})(u,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},QA=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Gr(n,0,r.content.size),s=Q.create(r,i);e.setSelection(s)}return!0},eO=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:s}=typeof n=="number"?{from:n,to:n}:n,a=pe.atStart(r).from,u=pe.atEnd(r).to,c=Gr(i,a,u),h=Gr(s,a,u),p=pe.create(r,c,h);e.setSelection(p)}return!0},tO=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return OT(r)(e,t)};function a1(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 nO=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:s,doc:a}=e,{$from:u,$to:c}=s,h=i.extensionManager.attributes,p=Wa(h,u.node().type.name,u.node().attrs);if(s instanceof Q&&s.node.isBlock)return!u.parentOffset||!zn(a,u.pos)?!1:(r&&(n&&a1(t,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;const m=c.parentOffset===c.parent.content.size,y=u.depth===0?void 0:zA(u.node(-1).contentMatchAt(u.indexAfter(-1)));let _=m&&y?[{type:y,attrs:p}]:void 0,S=zn(e.doc,e.mapping.map(u.pos),1,_);if(!_&&!S&&zn(e.doc,e.mapping.map(u.pos),1,y?[{type:y}]:void 0)&&(S=!0,_=y?[{type:y,attrs:p}]:void 0),r){if(S&&(s instanceof pe&&e.deleteSelection(),e.split(e.mapping.map(u.pos),1,_),y&&!m&&!u.parentOffset&&u.parent.type!==y)){const E=e.mapping.map(u.before()),N=e.doc.resolve(E);u.node(-1).canReplaceWith(N.index(),N.index()+1,y)&&e.setNodeMarkup(e.mapping.map(u.before()),y)}n&&a1(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return S},rO=(n,e={})=>({tr:t,state:r,dispatch:i,editor:s})=>{var a;const u=qe(n,r.schema),{$from:c,$to:h}=r.selection,p=r.selection.node;if(p&&p.isBlock||c.depth<2||!c.sameParent(h))return!1;const m=c.node(-1);if(m.type!==u)return!1;const y=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==u||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let g=z.empty;const v=c.index(-1)?1:c.index(-2)?2:3;for(let W=c.depth-v;W>=c.depth-3;W-=1)g=z.from(c.node(W).copy(g));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,T={...Wa(y,c.node().type.name,c.node().attrs),...e},A=((a=u.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(T))||void 0;g=g.append(z.from(u.createAndFill(null,A)||void 0));const F=c.before(c.depth-(v-1));t.replace(F,c.after(-k),new K(g,4-v,0));let U=-1;t.doc.nodesBetween(F,t.doc.content.size,(W,ee)=>{if(U>-1)return!1;W.isTextblock&&W.content.size===0&&(U=ee+1)}),U>-1&&t.setSelection(pe.near(t.doc.resolve(U))),t.scrollIntoView()}return!0}const _=h.pos===c.end()?m.contentMatchAt(0).defaultType:null,S={...Wa(y,m.type.name,m.attrs),...e},E={...Wa(y,c.node().type.name,c.node().attrs),...e};t.delete(c.pos,h.pos);const N=_?[{type:u,attrs:S},{type:_,attrs:E}]:[{type:u,attrs:S}];if(!zn(t.doc,c.pos,2))return!1;if(i){const{selection:g,storedMarks:v}=r,{splittableMarks:k}=s.extensionManager,T=v||g.$to.parentOffset&&g.$from.marks();if(t.split(c.pos,2,N).scrollIntoView(),!T||!i)return!0;const A=T.filter(F=>k.includes(F.type.name));t.ensureMarks(A)}return!0},Af=(n,e)=>{const t=Tf(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},Of=(n,e)=>{const t=Tf(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},iO=(n,e,t,r={})=>({editor:i,tr:s,state:a,dispatch:u,chain:c,commands:h,can:p})=>{const{extensions:m,splittableMarks:y}=i.extensionManager,_=qe(n,a.schema),S=qe(e,a.schema),{selection:E,storedMarks:N}=a,{$from:g,$to:v}=E,k=g.blockRange(v),T=N||E.$to.parentOffset&&E.$from.marks();if(!k)return!1;const A=Tf(F=>s1(F.type.name,m))(E);if(k.depth>=1&&A&&k.depth-A.depth<=1){if(A.node.type===_)return h.liftListItem(S);if(s1(A.node.type.name,m)&&_.validContent(A.node.content)&&u)return c().command(()=>(s.setNodeMarkup(A.pos,_),!0)).command(()=>Af(s,_)).command(()=>Of(s,_)).run()}return!t||!T||!u?c().command(()=>p().wrapInList(_,r)?!0:h.clearNodes()).wrapInList(_,r).command(()=>Af(s,_)).command(()=>Of(s,_)).run():c().command(()=>{const F=p().wrapInList(_,r),U=T.filter(W=>y.includes(W.type.name));return s.ensureMarks(U),F?!0:h.clearNodes()}).wrapInList(_,r).command(()=>Af(s,_)).command(()=>Of(s,_)).run()},sO=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,a=mn(n,r.schema);return JA(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},oO=(n,e,t={})=>({state:r,commands:i})=>{const s=qe(n,r.schema),a=qe(e,r.schema),u=Ef(r,s,t);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),u?i.setNode(a,c):i.setNode(s,{...c,...t})},aO=(n,e={})=>({state:t,commands:r})=>{const i=qe(n,t.schema);return Ef(t,i,e)?r.lift(i):r.wrapIn(i,e)},lO=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let s;if(i.spec.isInputRules&&(s=i.getState(n))){if(e){const a=n.tr,u=s.transform;for(let c=u.steps.length-1;c>=0;c-=1)a.step(u.steps[c].invert(u.docs[c]));if(s.text){const c=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,n.schema.text(s.text,c))}else a.delete(s.from,s.to)}return!0}}return!1},uO=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(s=>{n.removeMark(s.$from.pos,s.$to.pos)}),!0},cO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=t,c=mn(n,r.schema),{$from:h,empty:p,ranges:m}=u;if(!i)return!0;if(p&&a){let{from:y,to:_}=u;const S=(s=h.marks().find(N=>N.type===c))===null||s===void 0?void 0:s.attrs,E=xf(h,c,S);E&&(y=E.from,_=E.to),t.removeMark(y,_,c)}else m.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,c)});return t.removeStoredMark(c),!0},fO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let s=null,a=null;const u=kf(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(s=qe(n,r.schema)),u==="mark"&&(a=mn(n,r.schema)),i&&t.selection.ranges.forEach(c=>{const h=c.$from.pos,p=c.$to.pos;let m,y,_,S;t.selection.empty?r.doc.nodesBetween(h,p,(E,N)=>{s&&s===E.type&&(_=Math.max(N,h),S=Math.min(N+E.nodeSize,p),m=N,y=E)}):r.doc.nodesBetween(h,p,(E,N)=>{N<h&&s&&s===E.type&&(_=Math.max(N,h),S=Math.min(N+E.nodeSize,p),m=N,y=E),N>=h&&N<=p&&(s&&s===E.type&&t.setNodeMarkup(N,void 0,{...E.attrs,...e}),a&&E.marks.length&&E.marks.forEach(g=>{if(a===g.type){const v=Math.max(N,h),k=Math.min(N+E.nodeSize,p);t.addMark(v,k,a.create({...g.attrs,...e}))}}))}),y&&(m!==void 0&&t.setNodeMarkup(m,void 0,{...y.attrs,...e}),a&&y.marks.length&&y.marks.forEach(E=>{a===E.type&&t.addMark(_,S,a.create({...E.attrs,...e}))}))}),!0):!1},hO=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return ST(i,e)(t,r)},dO=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return xT(i,e)(t,r)};var pO=Object.freeze({__proto__:null,blur:KT,clearContent:GT,clearNodes:JT,command:jT,createParagraphNear:YT,cut:XT,deleteCurrentNode:ZT,deleteNode:QT,deleteRange:eA,deleteSelection:tA,enter:nA,exitCode:rA,extendMarkRange:iA,first:sA,focus:lA,forEach:uA,insertContent:cA,insertContentAt:dA,joinBackward:gA,joinDown:mA,joinForward:yA,joinItemBackward:bA,joinItemForward:_A,joinTextblockBackward:wA,joinTextblockForward:vA,joinUp:pA,keyboardShortcut:xA,lift:CA,liftEmptyBlock:EA,liftListItem:kA,newlineInCode:TA,resetAttributes:AA,scrollIntoView:OA,selectAll:MA,selectNodeBackward:IA,selectNodeForward:NA,selectParentNode:RA,selectTextblockEnd:LA,selectTextblockStart:PA,setContent:FA,setMark:YA,setMeta:XA,setNode:ZA,setNodeSelection:QA,setTextSelection:eO,sinkListItem:tO,splitBlock:nO,splitListItem:rO,toggleList:iO,toggleMark:sO,toggleNode:oO,toggleWrap:aO,undoInputRule:lO,unsetAllMarks:uO,unsetMark:cO,updateAttributes:fO,wrapIn:hO,wrapInList:dO});Re.create({name:"commands",addCommands(){return{...pO}}}),Re.create({name:"drop",addProseMirrorPlugins(){return[new ct({key:new It("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),Re.create({name:"editable",addProseMirrorPlugins(){return[new ct({key:new It("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Re.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new ct({key:new It("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Re.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:c,doc:h}=u,{empty:p,$anchor:m}=c,{pos:y,parent:_}=m,S=m.parent.isTextblock&&y>0?u.doc.resolve(y-1):m,E=S.parent.type.spec.isolating,N=m.pos-m.parentOffset,g=E&&S.parent.childCount===1?N===m.pos:ye.atStart(h).from===y;return!p||!_.type.isTextblock||_.textContent.length||!g||g&&m.parent.type.name==="paragraph"?!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},s={...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 Cf()||t1()?s:i},addProseMirrorPlugins(){return[new ct({key:new It("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(E=>E.getMeta("composition")))return;const r=n.some(E=>E.docChanged)&&!e.doc.eq(t.doc),i=n.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:a,to:u}=e.selection,c=ye.atStart(e.doc).from,h=ye.atEnd(e.doc).to;if(s||!(a===c&&u===h)||!o1(t.doc))return;const y=t.tr,_=Ra({state:t,transaction:y}),{commands:S}=new _f({editor:this.editor,state:_});if(S.clearNodes(),!!y.steps.length)return y}})]}}),Re.create({name:"paste",addProseMirrorPlugins(){return[new ct({key:new It("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Re.create({name:"tabindex",addProseMirrorPlugins(){return[new ct({key:new It("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function mO(n){return new Y0({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),s=de(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,s)}})}function gO(n){return new Y0({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const s=de(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),c=a.doc.resolve(t.from).blockRange(),h=c&&Uc(c,n.type,s);if(!h)return null;if(a.wrap(c,h),n.keepMarks&&n.editor){const{selection:m,storedMarks:y}=e,{splittableMarks:_}=n.editor.extensionManager,S=y||m.$to.parentOffset&&m.$from.marks();if(S){const E=S.filter(N=>_.includes(N.type.name));a.ensureMarks(E)}}if(n.keepAttributes){const m=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(m,s).run()}const p=a.doc.resolve(t.from-1).nodeBefore;p&&p.type===n.type&&dr(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,p))&&a.join(t.from-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&&Object.keys(e.defaultOptions).length>0&&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=de(J(this,"addOptions",{name:this.name}))),this.storage=de(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Yn(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Fa(this.options,e)});return t.name=this.name,t.parent=this.parent,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&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=de(J(t,"addOptions",{name:t.name})),t.storage=de(J(t,"addStorage",{name:t.name,options:t.options})),t}}function yO(n){return new BT({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const s=de(n.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=e,u=r[r.length-1],c=r[0];let h=t.to;if(u){const p=c.search(/\S/),m=t.from+c.indexOf(u),y=m+u.length;if(i1(t.from,t.to,e.doc).filter(S=>S.mark.type.excluded.find(N=>N===n.type&&N!==S.mark.type)).filter(S=>S.to>m).length)return null;y<t.to&&a.delete(y,t.to),m>t.from&&a.delete(t.from+p,m),h=t.from+p+u.length,a.addMark(t.from+p,h,n.type.create(s||{})),a.removeStoredMark(n.type)}}})}const bO=Yn.create({name:"text",group:"inline"});var Va=200,Ke=function(){};Ke.prototype.append=function(e){return e.length?(e=Ke.from(e),!this.length&&e||e.length<Va&&this.leafAppend(e)||this.length<Va&&e.leafPrepend(this)||this.appendInner(e)):this},Ke.prototype.prepend=function(e){return e.length?Ke.from(e).append(this):this},Ke.prototype.appendInner=function(e){return new _O(this,e)},Ke.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ke.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ke.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ke.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ke.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},t,r),i},Ke.from=function(e){return e instanceof Ke?e:e&&e.length?new l1(e):Ke.empty};var l1=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,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,u){for(var c=s;c<a;c++)if(i(this.values[c],u+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,u){for(var c=s-1;c>=a;c--)if(i(this.values[c],u+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Va)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Va)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ke);Ke.empty=new l1([]);var _O=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,s,a){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(s,u),a)===!1||s>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,s)-u,a+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,a){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(s,u)-u,a+u)===!1||s<u&&this.left.forEachInvertedInner(r,Math.min(i,u),s,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ke);const wO=500;class un{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,s;t&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=e.tr,u,c,h=[],p=[];return this.items.forEach((m,y)=>{if(!m.step){i||(i=this.remapping(r,y+1),s=i.maps.length),s--,p.push(m);return}if(i){p.push(new bn(m.map));let _=m.step.map(i.slice(s)),S;_&&a.maybeStep(_).doc&&(S=a.mapping.maps[a.mapping.maps.length-1],h.push(new bn(S,void 0,void 0,h.length+p.length))),s--,S&&i.appendMap(S,s)}else a.maybeStep(m.step);if(m.selection)return u=i?m.selection.map(i.slice(s)):m.selection,c=new un(this.items.slice(0,r).append(p.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:u}}addTransform(e,t,r,i){let s=[],a=this.eventCount,u=this.items,c=!i&&u.length?u.get(u.length-1):null;for(let p=0;p<e.steps.length;p++){let m=e.steps[p].invert(e.docs[p]),y=new bn(e.mapping.maps[p],m,t),_;(_=c&&c.merge(y))&&(y=_,p?s.pop():u=u.slice(0,u.length-1)),s.push(y),t&&(a++,t=void 0),i||(c=y)}let h=a-r.depth;return h>SO&&(u=vO(u,h),a-=h),new un(u.append(s),a)}remapping(e,t){let r=new Bi;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-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 un(this.items.append(e.map(t=>new bn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),s=e.mapping,a=e.steps.length,u=this.eventCount;this.items.forEach(y=>{y.selection&&u--},i);let c=t;this.items.forEach(y=>{let _=s.getMirror(--c);if(_==null)return;a=Math.min(a,_);let S=s.maps[_];if(y.step){let E=e.steps[_].invert(e.docs[_]),N=y.selection&&y.selection.map(s.slice(c+1,_));N&&u++,r.push(new bn(S,E,N))}else r.push(new bn(S))},i);let h=[];for(let y=t;y<a;y++)h.push(new bn(s.maps[y]));let p=this.items.slice(0,i).append(h).append(r),m=new un(p,u);return m.emptyItemCount()>wO&&(m=m.compress(this.items.length-r.length)),m}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],s=0;return this.items.forEach((a,u)=>{if(u>=e)i.push(a),a.selection&&s++;else if(a.step){let c=a.step.map(t.slice(r)),h=c&&c.getMap();if(r--,h&&t.appendMap(h,r),c){let p=a.selection&&a.selection.map(t.slice(r));p&&s++;let m=new bn(h.invert(),c,p),y,_=i.length-1;(y=i.length&&i[_].merge(m))?i[_]=y:i.push(m)}}else a.map&&r--},this.items.length,0),new un(Ke.from(i.reverse()),s)}}un.empty=new un(Ke.empty,0);function vO(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class bn{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 bn(t.getMap().invert(),t,this.selection)}}}class _r{constructor(e,t,r,i,s){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const SO=20;function xO(n,e,t,r){let i=t.getMeta(Jr),s;if(i)return i.historyState;t.getMeta(kO)&&(n=new _r(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Jr))return a.getMeta(Jr).redo?new _r(n.done.addTransform(t,void 0,r,Ua(e)),n.undone,u1(t.mapping.maps),n.prevTime,n.prevComposition):new _r(n.done,n.undone.addTransform(t,void 0,r,Ua(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=t.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=u&&(n.prevTime<(t.time||0)-r.newGroupDelay||!CO(t,n.prevRanges)),h=a?Mf(n.prevRanges,t.mapping):u1(t.mapping.maps);return new _r(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Ua(e)),un.empty,h,t.time,u??n.prevComposition)}else return(s=t.getMeta("rebased"))?new _r(n.done.rebased(t,s),n.undone.rebased(t,s),Mf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new _r(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Mf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function CO(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function u1(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,s,a)=>e.push(s,a));return e}function Mf(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),s=e.map(n[r+1],-1);i<=s&&t.push(i,s)}return t}function EO(n,e,t){let r=Ua(e),i=Jr.get(e).spec.config,s=(t?n.undone:n.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),u=(t?n.done:n.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),c=new _r(t?u:s.remaining,t?s.remaining:u,null,0,-1);return s.transform.setSelection(a).setMeta(Jr,{redo:t,historyState:c})}let If=!1,c1=null;function Ua(n){let e=n.plugins;if(c1!=e){If=!1,c1=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){If=!0;break}}return If}const Jr=new It("history"),kO=new It("closeHistory");function TO(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new ct({key:Jr,state:{init(){return new _r(un.empty,un.empty,null,0,-1)},apply(e,t,r){return xO(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?h1:r=="historyRedo"?d1:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function f1(n,e){return(t,r)=>{let i=Jr.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let s=EO(i,t,n);s&&r(e?s.scrollIntoView():s)}return!0}}const h1=f1(!1,!0),d1=f1(!0,!0),AO=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>h1(n,e),redo:()=>({state:n,dispatch:e})=>d1(n,e)}},addProseMirrorPlugins(){return[TO(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var $n=(n=>(n.COMMON="common",n.DESKTOP="desktop",n.TABLET="tablet",n.MOBILE="mobile",n.ALL="all",n))($n||{});const OO=["common","mobile","tablet","desktop"];var qa=(n=>(n.UPPERCASE="uppercase",n.LOWERCASE="lowercase",n.CAPITALIZE="capitalize",n))(qa||{}),wr=(n=>(n.LEFT="left",n.CENTER="center",n.RIGHT="right",n.JUSTIFY="justify",n))(wr||{});const MO=["left","center","right","justify"];var oe=(n=>(n.DOCUMENT="doc",n.PARAGRAPH="paragraph",n.HEADING="heading",n.LIST="list",n.LIST_ITEM="listItem",n.TEXT="text",n))(oe||{});const Nf=["paragraph","list","heading"];var an=(n=>(n.DISC="disc",n.CIRCLE="circle",n.SQUARE="square",n.DECIMAL="decimal",n.ROMAN="roman",n.LATIN="latin",n))(an||{});const IO=["disc","circle","square","decimal","roman","latin"],NO=["decimal","roman","latin"];var ke=(n=>(n.ALIGNMENT="alignment",n.BACKGROUND_COLOR="background_color",n.FONT_COLOR="font_color",n.FONT_FAMILY="font_family",n.FONT_SIZE="font_size",n.FONT_STYLE="font_style",n.FONT_WEIGHT="font_weight",n.LINE_HEIGHT="line_height",n.LETTER_SPACING="letter_spacing",n.TEXT_DECORATION="text_decoration",n.SUPERSCRIPT="superscript",n.MARGIN="margin",n.LINK="link",n.STYLE_PRESET="style_preset",n))(ke||{});const p1=["alignment","line_height","margin"],Ka=["line_height"],m1=["text_decoration","link","superscript","background_color"],g1=["background_color","font_color","font_family","font_size","font_style","font_weight","letter_spacing","text_decoration","superscript"];var Rt=(n=>(n.SETTINGS="settings",n.ALL="_",n))(Rt||{}),Rf=(n=>(n.BLANK="_blank",n.SELF="_self",n))(Rf||{}),Ii=(n=>(n.URL="url",n.BLOCK="block",n))(Ii||{});class Lf{static create(e,t){const r=new this(e,t||{});return new ct({key:new It(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 RO extends Lf{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=zl.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,(s,a,u)=>{u.type.name===oe.DOCUMENT&&(r=Math.min(r,a+1),i=Math.max(i,a+s.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class LO extends Lf{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 s=vn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(s)}return!1}),Ye.create(e,t)}}const PO="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",DO="\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\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",Ni=(n,e)=>{for(const t in e)n[t]=e[t];return n},Pf="numeric",Df="ascii",Ff="alpha",Os="asciinumeric",Ms="alphanumeric",Bf="domain",y1="emoji",FO="scheme",BO="slashscheme",zf="whitespace";function zO(n,e){return n in e||(e[n]=[]),e[n]}function jr(n,e,t){e[Pf]&&(e[Os]=!0,e[Ms]=!0),e[Df]&&(e[Os]=!0,e[Ff]=!0),e[Os]&&(e[Ms]=!0),e[Ff]&&(e[Ms]=!0),e[Ms]&&(e[Bf]=!0),e[y1]&&(e[Bf]=!0);for(const r in e){const i=zO(r,t);i.indexOf(n)<0&&i.push(n)}}function $O(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function _t(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}_t.groups={},_t.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],s=e.jr[r][1];if(s&&i.test(n))return s}return e.jd},has(n,e=!1){return 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||_t.groups;let i;return e&&e.j?i=e:(i=new _t(e),t&&r&&jr(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const s=n.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(n[a]);return i.tt(n[s-1],e,t,r)},tt(n,e,t,r){r=r||_t.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const s=e;let a,u=i.go(n);if(u?(a=new _t,Ni(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new _t,s){if(r)if(a.t&&typeof a.t=="string"){const c=Ni($O(a.t,r),t);jr(s,c,r)}else t&&jr(s,t,r);a.t=s}return i.j[n]=a,a}};const ae=(n,e,t,r,i)=>n.ta(e,t,r,i),Ne=(n,e,t,r,i)=>n.tr(e,t,r,i),b1=(n,e,t,r,i)=>n.ts(e,t,r,i),$=(n,e,t,r,i)=>n.tt(e,t,r,i),Hn="WORD",$f="UWORD",_1="ASCIINUMERICAL",w1="ALPHANUMERICAL",Is="LOCALHOST",Hf="TLD",Wf="UTLD",Ga="SCHEME",Ri="SLASH_SCHEME",Vf="NUM",Uf="WS",qf="NL",Ns="OPENBRACE",Rs="CLOSEBRACE",Ja="OPENBRACKET",ja="CLOSEBRACKET",Ya="OPENPAREN",Xa="CLOSEPAREN",Za="OPENANGLEBRACKET",Qa="CLOSEANGLEBRACKET",el="FULLWIDTHLEFTPAREN",tl="FULLWIDTHRIGHTPAREN",nl="LEFTCORNERBRACKET",rl="RIGHTCORNERBRACKET",il="LEFTWHITECORNERBRACKET",sl="RIGHTWHITECORNERBRACKET",ol="FULLWIDTHLESSTHAN",al="FULLWIDTHGREATERTHAN",ll="AMPERSAND",Kf="APOSTROPHE",ul="ASTERISK",vr="AT",cl="BACKSLASH",fl="BACKTICK",hl="CARET",Sr="COLON",Gf="COMMA",dl="DOLLAR",gn="DOT",pl="EQUALS",Jf="EXCLAMATION",Jt="HYPHEN",Ls="PERCENT",ml="PIPE",gl="PLUS",yl="POUND",Ps="QUERY",jf="QUOTE",v1="FULLWIDTHMIDDLEDOT",Yf="SEMI",yn="SLASH",Ds="TILDE",bl="UNDERSCORE",S1="EMOJI",_l="SYM";var x1=Object.freeze({__proto__:null,WORD:Hn,UWORD:$f,ASCIINUMERICAL:_1,ALPHANUMERICAL:w1,LOCALHOST:Is,TLD:Hf,UTLD:Wf,SCHEME:Ga,SLASH_SCHEME:Ri,NUM:Vf,WS:Uf,NL:qf,OPENBRACE:Ns,CLOSEBRACE:Rs,OPENBRACKET:Ja,CLOSEBRACKET:ja,OPENPAREN:Ya,CLOSEPAREN:Xa,OPENANGLEBRACKET:Za,CLOSEANGLEBRACKET:Qa,FULLWIDTHLEFTPAREN:el,FULLWIDTHRIGHTPAREN:tl,LEFTCORNERBRACKET:nl,RIGHTCORNERBRACKET:rl,LEFTWHITECORNERBRACKET:il,RIGHTWHITECORNERBRACKET:sl,FULLWIDTHLESSTHAN:ol,FULLWIDTHGREATERTHAN:al,AMPERSAND:ll,APOSTROPHE:Kf,ASTERISK:ul,AT:vr,BACKSLASH:cl,BACKTICK:fl,CARET:hl,COLON:Sr,COMMA:Gf,DOLLAR:dl,DOT:gn,EQUALS:pl,EXCLAMATION:Jf,HYPHEN:Jt,PERCENT:Ls,PIPE:ml,PLUS:gl,POUND:yl,QUERY:Ps,QUOTE:jf,FULLWIDTHMIDDLEDOT:v1,SEMI:Yf,SLASH:yn,TILDE:Ds,UNDERSCORE:bl,EMOJI:S1,SYM:_l});const Wn=/[a-z]/,Fs=/\p{L}/u,Xf=/\p{Emoji}/u,Vn=/\d/,Zf=/\s/,C1="\r",Qf=`
|
|
42
|
-
`,HO="\uFE0F",WO="\u200D",eh="\uFFFC";let wl=null,vl=null;function VO(n=[]){const e={};_t.groups=e;const t=new _t;wl==null&&(wl=k1(PO)),vl==null&&(vl=k1(DO)),$(t,"'",Kf),$(t,"{",
|
|
41
|
+
`,textSerializers:a={}}=t||{};let u="";return n.nodesBetween(r,i,(c,h,p,m)=>{var y;c.isBlock&&h>r&&(u+=s);const _=a?.[c.type.name];if(_)return p&&(u+=_({node:c,pos:h,parent:p,index:m,range:e})),!1;c.isText&&(u+=(y=c?.text)===null||y===void 0?void 0:y.slice(Math.max(r,h)-h,i-h))}),u}function qA(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Re.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ct({key:new It("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map(p=>p.$from.pos)),u=Math.max(...s.map(p=>p.$to.pos)),c=qA(t);return UA(r,{from:a,to:u},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}});const KA=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),GA=(n=!1)=>({commands:e})=>e.setContent("",n),JA=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:s,$to:a})=>{n.doc.nodesBetween(s.pos,a.pos,(u,c)=>{if(u.type.isText)return;const{doc:h,mapping:p}=e,m=h.resolve(p.map(c)),y=h.resolve(p.map(c+u.nodeSize)),_=m.blockRange(y);if(!_)return;const S=xi(_);if(u.type.isTextblock){const{defaultType:E}=m.parent.contentMatchAt(m.index());e.setNodeMarkup(_.start,E)}(S||S===0)&&e.lift(_,S)})}),!0},jA=n=>e=>n(e),YA=()=>({state:n,dispatch:e})=>z0(n,e),XA=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,s=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,s.content),r.setSelection(new pe(r.doc.resolve(a-1))),!0},ZA=()=>({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 s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const u=i.before(s),c=i.after(s);n.delete(u,c).scrollIntoView()}return!0}return!1},QA=n=>({tr:e,state:t,dispatch:r})=>{const i=qe(n,t.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(r){const c=s.before(a),h=s.after(a);e.delete(c,h).scrollIntoView()}return!0}return!1},eT=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},tT=()=>({state:n,dispatch:e})=>pf(n,e),nT=()=>({commands:n})=>n.keyboardShortcut("Enter"),rT=()=>({state:n,dispatch:e})=>mA(n,e);function $a(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Sf(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function X0(n,e,t={}){return n.find(r=>r.type===e&&$a(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function Z0(n,e,t={}){return!!X0(n,e,t)}function xf(n,e,t){var r;if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(p=>p.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(p=>p.type===e)||(t=t||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!X0([...i.node.marks],e,t)))return;let a=i.index,u=n.start()+i.offset,c=a+1,h=u+i.node.nodeSize;for(;a>0&&Z0([...n.parent.child(a-1).marks],e,t);)a-=1,u-=n.parent.child(a).nodeSize;for(;c<n.parent.childCount&&Z0([...n.parent.child(c).marks],e,t);)h+=n.parent.child(c).nodeSize,c+=1;return{from:u,to:h}}function mn(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 iT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const s=mn(n,r.schema),{doc:a,selection:u}=t,{$from:c,from:h,to:p}=u;if(i){const m=xf(c,s,e);if(m&&m.from<=h&&m.to>=p){const y=pe.create(a,m.from,m.to);t.setSelection(y)}}return!0},sT=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 Q0(n){return n instanceof pe}function Gr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function oT(n,e=null){if(!e)return null;const t=ye.atStart(n),r=ye.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,s=r.to;return e==="all"?pe.create(n,Gr(0,i,s),Gr(n.content.size,i,s)):pe.create(n,Gr(e,i,s),Gr(e,i,s))}function aT(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Cf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const lT=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(Cf()||aT())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(s&&n===null&&!Q0(t.state.selection))return a(),!0;const u=oT(i.doc,n)||t.state.selection,c=t.state.selection.eq(u);return s&&(c||i.setSelection(u),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},uT=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),cT=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),e1=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&e1(r)}return n};function Ha(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return e1(t)}function Wa(n,e,t){if(n instanceof hr||n instanceof z)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return z.fromArray(n.map(u=>e.nodeFromJSON(u)));const a=e.nodeFromJSON(n);return t.errorOnInvalidContent&&a.check(),a}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",s),Wa("",e,t)}if(i){if(t.errorOnInvalidContent){let a=!1,u="";const c=new yg({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(a=!0,u=typeof h=="string"?h:h.outerHTML,null)}]}})});if(t.slice?vs.fromSchema(c).parseSlice(Ha(n),t.parseOptions):vs.fromSchema(c).parse(Ha(n),t.parseOptions),t.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${u}`)})}const s=vs.fromSchema(e);return t.slice?s.parseSlice(Ha(n),t.parseOptions).content:s.parse(Ha(n),t.parseOptions)}return Wa("",e,t)}function fT(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof je||i instanceof Je))return;const s=n.mapping.maps[r];let a=0;s.forEach((u,c,h,p)=>{a===0&&(a=p)}),n.setSelection(ye.near(n.doc.resolve(a),t))}const hT=n=>!("type"in n),dT=(n,e,t)=>({tr:r,dispatch:i,editor:s})=>{var a;if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let u;try{u=Wa(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(a=t.errorOnInvalidContent)!==null&&a!==void 0?a:s.options.enableContentCheck})}catch(S){return s.emit("contentError",{editor:s,error:S,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:h}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},p=!0,m=!0;if((hT(u)?u:[u]).forEach(S=>{S.check(),p=p?S.isText&&S.marks.length===0:!1,m=m?S.isBlock:!1}),c===h&&m){const{parent:S}=r.doc.resolve(c);S.isTextblock&&!S.type.spec.code&&!S.childCount&&(c-=1,h+=1)}let _;if(p){if(Array.isArray(e))_=e.map(S=>S.text||"").join("");else if(e instanceof z){let S="";e.forEach(E=>{E.text&&(S+=E.text)}),_=S}else typeof e=="object"&&e&&e.text?_=e.text:_=e;r.insertText(_,c,h)}else _=u,r.replaceWith(c,h,_);t.updateSelection&&fT(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:_}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:_})}return!0},pT=()=>({state:n,dispatch:e})=>hA(n,e),mT=()=>({state:n,dispatch:e})=>dA(n,e),gT=()=>({state:n,dispatch:e})=>N0(n,e),yT=()=>({state:n,dispatch:e})=>D0(n,e),bT=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Ca(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},_T=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Ca(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},wT=()=>({state:n,dispatch:e})=>cA(n,e),vT=()=>({state:n,dispatch:e})=>fA(n,e);function t1(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function ST(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,s,a;for(let u=0;u<e.length-1;u+=1){const c=e[u];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))Cf()||t1()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}const xT=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const s=ST(n).split(/-(?!$)/),a=s.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",h=>h(t,u))});return c?.steps.forEach(h=>{const p=h.map(r.mapping);p&&i&&r.maybeStep(p)}),!0};function Ef(n,e,t={}){const{from:r,to:i,empty:s}=n.selection,a=e?qe(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(m,y)=>{if(m.isText)return;const _=Math.max(r,y),S=Math.min(i,y+m.nodeSize);u.push({node:m,from:_,to:S})});const c=i-r,h=u.filter(m=>a?a.name===m.node.type.name:!0).filter(m=>$a(m.node.attrs,t,{strict:!1}));return s?!!h.length:h.reduce((m,y)=>m+y.to-y.from,0)>=c}const CT=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return Ef(t,i,e)?pA(t,r):!1},ET=()=>({state:n,dispatch:e})=>$0(n,e),kT=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return kA(r)(e,t)},AT=()=>({state:n,dispatch:e})=>B0(n,e);function kf(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function n1(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 TT=(n,e)=>({tr:t,state:r,dispatch:i})=>{let s=null,a=null;const u=kf(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(s=qe(n,r.schema)),u==="mark"&&(a=mn(n,r.schema)),i&&t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(h,p)=>{s&&s===h.type&&t.setNodeMarkup(p,void 0,n1(h.attrs,e)),a&&h.marks.length&&h.marks.forEach(m=>{a===m.type&&t.addMark(p,p+h.nodeSize,a.create(n1(m.attrs,e)))})})}),!0):!1},OT=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),MT=()=>({tr:n,dispatch:e})=>{if(e){const t=new Lt(n.doc);n.setSelection(t)}return!0},IT=()=>({state:n,dispatch:e})=>L0(n,e),NT=()=>({state:n,dispatch:e})=>F0(n,e),RT=()=>({state:n,dispatch:e})=>bA(n,e),LT=()=>({state:n,dispatch:e})=>vA(n,e),PT=()=>({state:n,dispatch:e})=>wA(n,e);function DT(n,e,t={},r={}){return Wa(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const FT=(n,e=!1,t={},r={})=>({editor:i,tr:s,dispatch:a,commands:u})=>{var c,h;const{doc:p}=s;if(t.preserveWhitespace!=="full"){const m=DT(n,i.schema,t,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return a&&s.replaceWith(0,p.content.size,m).setMeta("preventUpdate",!e),!0}return a&&s.setMeta("preventUpdate",!e),u.insertContentAt({from:0,to:p.content.size},n,{parseOptions:t,errorOnInvalidContent:(h=r.errorOnInvalidContent)!==null&&h!==void 0?h:i.options.enableContentCheck})};function r1(n,e){const t=mn(e,n.schema),{from:r,to:i,empty:s}=n.selection,a=[];s?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,c=>{a.push(...c.marks)});const u=a.find(c=>c.type.name===t.name);return u?{...u.attrs}:{}}function BT(n,e){const t=new dk(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function zT(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 $T(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&r.push({node:i,pos:s})}),r}function HT(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 Af(n){return e=>HT(e.$from,n)}function WT(n,e){const t=Bi.resolve(n);return G0(t,e)}function VT(n,e){const t=qe(e,n.schema),{from:r,to:i}=n.selection,s=[];n.doc.nodesBetween(r,i,u=>{s.push(u)});const a=s.reverse().find(u=>u.type.name===t.name);return a?{...a.attrs}:{}}function UT(n,e){const t=kf(typeof e=="string"?e:e.name,n.schema);return t==="node"?VT(n,e):t==="mark"?r1(n,e):{}}function qT(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 KT(n){const e=qT(n);return e.length===1?e:e.filter((t,r)=>!e.filter((s,a)=>a!==r).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function GT(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((u,c)=>{a.push({from:u,to:c})});else{const{from:u,to:c}=t[s];if(u===void 0||c===void 0)return;a.push({from:u,to:c})}a.forEach(({from:u,to:c})=>{const h=e.slice(s).map(u,-1),p=e.slice(s).map(c),m=e.invert().map(h,-1),y=e.invert().map(p);r.push({oldRange:{from:m,to:y},newRange:{from:h,to:p}})})}),KT(r)}function i1(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const s=t.resolve(n),a=xf(s,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),r}function Va(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function JT(n,e,t={}){const{empty:r,ranges:i}=n.selection,s=e?mn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(m=>s?s.name===m.type.name:!0).find(m=>$a(m.attrs,t,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:m,$to:y})=>{const _=m.pos,S=y.pos;n.doc.nodesBetween(_,S,(E,N)=>{if(!E.isText&&!E.marks.length)return;const g=Math.max(_,N),v=Math.min(S,N+E.nodeSize),k=v-g;a+=k,u.push(...E.marks.map(A=>({mark:A,from:g,to:v})))})}),a===0)return!1;const c=u.filter(m=>s?s.name===m.mark.type.name:!0).filter(m=>$a(m.mark.attrs,t,{strict:!1})).reduce((m,y)=>m+y.to-y.from,0),h=u.filter(m=>s?m.mark.type!==s&&m.mark.type.excludes(s):!0).reduce((m,y)=>m+y.to-y.from,0);return(c>0?c+h:c)>=a}function s1(n,e){const{nodeExtensions:t}=Pa(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=de(J(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function o1(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!==null&&r!==void 0?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(s=>{i!==!1&&(o1(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function jT(n,e,t){var r;const{selection:i}=e;let s=null;if(Q0(i)&&(s=i.$cursor),s){const u=(r=n.storedMarks)!==null&&r!==void 0?r:s.marks();return!!t.isInSet(u)||!u.some(c=>c.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:u,$to:c})=>{let h=u.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(u.pos,c.pos,(p,m,y)=>{if(h)return!1;if(p.isInline){const _=!y||y.type.allowsMarkType(t),S=!!t.isInSet(p.marks)||!p.marks.some(E=>E.type.excludes(t));h=_&&S}return!h}),h})}const YT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=t,{empty:a,ranges:u}=s,c=mn(n,r.schema);if(i)if(a){const h=r1(r,c);t.addStoredMark(c.create({...h,...e}))}else u.forEach(h=>{const p=h.$from.pos,m=h.$to.pos;r.doc.nodesBetween(p,m,(y,_)=>{const S=Math.max(_,p),E=Math.min(_+y.nodeSize,m);y.marks.find(g=>g.type===c)?y.marks.forEach(g=>{c===g.type&&t.addMark(S,E,c.create({...g.attrs,...e}))}):t.addMark(S,E,c.create(e))})});return jT(r,t,c)},XT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),ZT=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const s=qe(n,t.schema);let a;return t.selection.$anchor.sameParent(t.selection.$head)&&(a=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:u})=>V0(s,{...a,...e})(t)?!0:u.clearNodes()).command(({state:u})=>V0(s,{...a,...e})(u,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},QT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Gr(n,0,r.content.size),s=Q.create(r,i);e.setSelection(s)}return!0},eO=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:s}=typeof n=="number"?{from:n,to:n}:n,a=pe.atStart(r).from,u=pe.atEnd(r).to,c=Gr(i,a,u),h=Gr(s,a,u),p=pe.create(r,c,h);e.setSelection(p)}return!0},tO=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return OA(r)(e,t)};function a1(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 nO=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:s,doc:a}=e,{$from:u,$to:c}=s,h=i.extensionManager.attributes,p=Va(h,u.node().type.name,u.node().attrs);if(s instanceof Q&&s.node.isBlock)return!u.parentOffset||!zn(a,u.pos)?!1:(r&&(n&&a1(t,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;const m=c.parentOffset===c.parent.content.size,y=u.depth===0?void 0:zT(u.node(-1).contentMatchAt(u.indexAfter(-1)));let _=m&&y?[{type:y,attrs:p}]:void 0,S=zn(e.doc,e.mapping.map(u.pos),1,_);if(!_&&!S&&zn(e.doc,e.mapping.map(u.pos),1,y?[{type:y}]:void 0)&&(S=!0,_=y?[{type:y,attrs:p}]:void 0),r){if(S&&(s instanceof pe&&e.deleteSelection(),e.split(e.mapping.map(u.pos),1,_),y&&!m&&!u.parentOffset&&u.parent.type!==y)){const E=e.mapping.map(u.before()),N=e.doc.resolve(E);u.node(-1).canReplaceWith(N.index(),N.index()+1,y)&&e.setNodeMarkup(e.mapping.map(u.before()),y)}n&&a1(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return S},rO=(n,e={})=>({tr:t,state:r,dispatch:i,editor:s})=>{var a;const u=qe(n,r.schema),{$from:c,$to:h}=r.selection,p=r.selection.node;if(p&&p.isBlock||c.depth<2||!c.sameParent(h))return!1;const m=c.node(-1);if(m.type!==u)return!1;const y=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==u||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let g=z.empty;const v=c.index(-1)?1:c.index(-2)?2:3;for(let W=c.depth-v;W>=c.depth-3;W-=1)g=z.from(c.node(W).copy(g));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,A={...Va(y,c.node().type.name,c.node().attrs),...e},T=((a=u.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(A))||void 0;g=g.append(z.from(u.createAndFill(null,T)||void 0));const F=c.before(c.depth-(v-1));t.replace(F,c.after(-k),new K(g,4-v,0));let U=-1;t.doc.nodesBetween(F,t.doc.content.size,(W,ee)=>{if(U>-1)return!1;W.isTextblock&&W.content.size===0&&(U=ee+1)}),U>-1&&t.setSelection(pe.near(t.doc.resolve(U))),t.scrollIntoView()}return!0}const _=h.pos===c.end()?m.contentMatchAt(0).defaultType:null,S={...Va(y,m.type.name,m.attrs),...e},E={...Va(y,c.node().type.name,c.node().attrs),...e};t.delete(c.pos,h.pos);const N=_?[{type:u,attrs:S},{type:_,attrs:E}]:[{type:u,attrs:S}];if(!zn(t.doc,c.pos,2))return!1;if(i){const{selection:g,storedMarks:v}=r,{splittableMarks:k}=s.extensionManager,A=v||g.$to.parentOffset&&g.$from.marks();if(t.split(c.pos,2,N).scrollIntoView(),!A||!i)return!0;const T=A.filter(F=>k.includes(F.type.name));t.ensureMarks(T)}return!0},Tf=(n,e)=>{const t=Af(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},Of=(n,e)=>{const t=Af(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},iO=(n,e,t,r={})=>({editor:i,tr:s,state:a,dispatch:u,chain:c,commands:h,can:p})=>{const{extensions:m,splittableMarks:y}=i.extensionManager,_=qe(n,a.schema),S=qe(e,a.schema),{selection:E,storedMarks:N}=a,{$from:g,$to:v}=E,k=g.blockRange(v),A=N||E.$to.parentOffset&&E.$from.marks();if(!k)return!1;const T=Af(F=>s1(F.type.name,m))(E);if(k.depth>=1&&T&&k.depth-T.depth<=1){if(T.node.type===_)return h.liftListItem(S);if(s1(T.node.type.name,m)&&_.validContent(T.node.content)&&u)return c().command(()=>(s.setNodeMarkup(T.pos,_),!0)).command(()=>Tf(s,_)).command(()=>Of(s,_)).run()}return!t||!A||!u?c().command(()=>p().wrapInList(_,r)?!0:h.clearNodes()).wrapInList(_,r).command(()=>Tf(s,_)).command(()=>Of(s,_)).run():c().command(()=>{const F=p().wrapInList(_,r),U=A.filter(W=>y.includes(W.type.name));return s.ensureMarks(U),F?!0:h.clearNodes()}).wrapInList(_,r).command(()=>Tf(s,_)).command(()=>Of(s,_)).run()},sO=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,a=mn(n,r.schema);return JT(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},oO=(n,e,t={})=>({state:r,commands:i})=>{const s=qe(n,r.schema),a=qe(e,r.schema),u=Ef(r,s,t);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),u?i.setNode(a,c):i.setNode(s,{...c,...t})},aO=(n,e={})=>({state:t,commands:r})=>{const i=qe(n,t.schema);return Ef(t,i,e)?r.lift(i):r.wrapIn(i,e)},lO=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let s;if(i.spec.isInputRules&&(s=i.getState(n))){if(e){const a=n.tr,u=s.transform;for(let c=u.steps.length-1;c>=0;c-=1)a.step(u.steps[c].invert(u.docs[c]));if(s.text){const c=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,n.schema.text(s.text,c))}else a.delete(s.from,s.to)}return!0}}return!1},uO=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(s=>{n.removeMark(s.$from.pos,s.$to.pos)}),!0},cO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=t,c=mn(n,r.schema),{$from:h,empty:p,ranges:m}=u;if(!i)return!0;if(p&&a){let{from:y,to:_}=u;const S=(s=h.marks().find(N=>N.type===c))===null||s===void 0?void 0:s.attrs,E=xf(h,c,S);E&&(y=E.from,_=E.to),t.removeMark(y,_,c)}else m.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,c)});return t.removeStoredMark(c),!0},fO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let s=null,a=null;const u=kf(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(s=qe(n,r.schema)),u==="mark"&&(a=mn(n,r.schema)),i&&t.selection.ranges.forEach(c=>{const h=c.$from.pos,p=c.$to.pos;let m,y,_,S;t.selection.empty?r.doc.nodesBetween(h,p,(E,N)=>{s&&s===E.type&&(_=Math.max(N,h),S=Math.min(N+E.nodeSize,p),m=N,y=E)}):r.doc.nodesBetween(h,p,(E,N)=>{N<h&&s&&s===E.type&&(_=Math.max(N,h),S=Math.min(N+E.nodeSize,p),m=N,y=E),N>=h&&N<=p&&(s&&s===E.type&&t.setNodeMarkup(N,void 0,{...E.attrs,...e}),a&&E.marks.length&&E.marks.forEach(g=>{if(a===g.type){const v=Math.max(N,h),k=Math.min(N+E.nodeSize,p);t.addMark(v,k,a.create({...g.attrs,...e}))}}))}),y&&(m!==void 0&&t.setNodeMarkup(m,void 0,{...y.attrs,...e}),a&&y.marks.length&&y.marks.forEach(E=>{a===E.type&&t.addMark(_,S,a.create({...E.attrs,...e}))}))}),!0):!1},hO=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return SA(i,e)(t,r)},dO=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return xA(i,e)(t,r)};var pO=Object.freeze({__proto__:null,blur:KA,clearContent:GA,clearNodes:JA,command:jA,createParagraphNear:YA,cut:XA,deleteCurrentNode:ZA,deleteNode:QA,deleteRange:eT,deleteSelection:tT,enter:nT,exitCode:rT,extendMarkRange:iT,first:sT,focus:lT,forEach:uT,insertContent:cT,insertContentAt:dT,joinBackward:gT,joinDown:mT,joinForward:yT,joinItemBackward:bT,joinItemForward:_T,joinTextblockBackward:wT,joinTextblockForward:vT,joinUp:pT,keyboardShortcut:xT,lift:CT,liftEmptyBlock:ET,liftListItem:kT,newlineInCode:AT,resetAttributes:TT,scrollIntoView:OT,selectAll:MT,selectNodeBackward:IT,selectNodeForward:NT,selectParentNode:RT,selectTextblockEnd:LT,selectTextblockStart:PT,setContent:FT,setMark:YT,setMeta:XT,setNode:ZT,setNodeSelection:QT,setTextSelection:eO,sinkListItem:tO,splitBlock:nO,splitListItem:rO,toggleList:iO,toggleMark:sO,toggleNode:oO,toggleWrap:aO,undoInputRule:lO,unsetAllMarks:uO,unsetMark:cO,updateAttributes:fO,wrapIn:hO,wrapInList:dO});Re.create({name:"commands",addCommands(){return{...pO}}}),Re.create({name:"drop",addProseMirrorPlugins(){return[new ct({key:new It("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),Re.create({name:"editable",addProseMirrorPlugins(){return[new ct({key:new It("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Re.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new ct({key:new It("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Re.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:c,doc:h}=u,{empty:p,$anchor:m}=c,{pos:y,parent:_}=m,S=m.parent.isTextblock&&y>0?u.doc.resolve(y-1):m,E=S.parent.type.spec.isolating,N=m.pos-m.parentOffset,g=E&&S.parent.childCount===1?N===m.pos:ye.atStart(h).from===y;return!p||!_.type.isTextblock||_.textContent.length||!g||g&&m.parent.type.name==="paragraph"?!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},s={...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 Cf()||t1()?s:i},addProseMirrorPlugins(){return[new ct({key:new It("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(E=>E.getMeta("composition")))return;const r=n.some(E=>E.docChanged)&&!e.doc.eq(t.doc),i=n.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:a,to:u}=e.selection,c=ye.atStart(e.doc).from,h=ye.atEnd(e.doc).to;if(s||!(a===c&&u===h)||!o1(t.doc))return;const y=t.tr,_=La({state:t,transaction:y}),{commands:S}=new _f({editor:this.editor,state:_});if(S.clearNodes(),!!y.steps.length)return y}})]}}),Re.create({name:"paste",addProseMirrorPlugins(){return[new ct({key:new It("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Re.create({name:"tabindex",addProseMirrorPlugins(){return[new ct({key:new It("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function mO(n){return new Y0({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),s=de(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,s)}})}function gO(n){return new Y0({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const s=de(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),c=a.doc.resolve(t.from).blockRange(),h=c&&Uc(c,n.type,s);if(!h)return null;if(a.wrap(c,h),n.keepMarks&&n.editor){const{selection:m,storedMarks:y}=e,{splittableMarks:_}=n.editor.extensionManager,S=y||m.$to.parentOffset&&m.$from.marks();if(S){const E=S.filter(N=>_.includes(N.type.name));a.ensureMarks(E)}}if(n.keepAttributes){const m=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(m,s).run()}const p=a.doc.resolve(t.from-1).nodeBefore;p&&p.type===n.type&&dr(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,p))&&a.join(t.from-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&&Object.keys(e.defaultOptions).length>0&&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=de(J(this,"addOptions",{name:this.name}))),this.storage=de(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Yn(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Ba(this.options,e)});return t.name=this.name,t.parent=this.parent,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&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=de(J(t,"addOptions",{name:t.name})),t.storage=de(J(t,"addStorage",{name:t.name,options:t.options})),t}}function yO(n){return new BA({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const s=de(n.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=e,u=r[r.length-1],c=r[0];let h=t.to;if(u){const p=c.search(/\S/),m=t.from+c.indexOf(u),y=m+u.length;if(i1(t.from,t.to,e.doc).filter(S=>S.mark.type.excluded.find(N=>N===n.type&&N!==S.mark.type)).filter(S=>S.to>m).length)return null;y<t.to&&a.delete(y,t.to),m>t.from&&a.delete(t.from+p,m),h=t.from+p+u.length,a.addMark(t.from+p,h,n.type.create(s||{})),a.removeStoredMark(n.type)}}})}const bO=Yn.create({name:"text",group:"inline"});var Ua=200,Ke=function(){};Ke.prototype.append=function(e){return e.length?(e=Ke.from(e),!this.length&&e||e.length<Ua&&this.leafAppend(e)||this.length<Ua&&e.leafPrepend(this)||this.appendInner(e)):this},Ke.prototype.prepend=function(e){return e.length?Ke.from(e).append(this):this},Ke.prototype.appendInner=function(e){return new _O(this,e)},Ke.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ke.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ke.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ke.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ke.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},t,r),i},Ke.from=function(e){return e instanceof Ke?e:e&&e.length?new l1(e):Ke.empty};var l1=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,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,u){for(var c=s;c<a;c++)if(i(this.values[c],u+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,u){for(var c=s-1;c>=a;c--)if(i(this.values[c],u+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ua)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ua)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ke);Ke.empty=new l1([]);var _O=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,s,a){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(s,u),a)===!1||s>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,s)-u,a+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,a){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(s,u)-u,a+u)===!1||s<u&&this.left.forEachInvertedInner(r,Math.min(i,u),s,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ke);const wO=500;class un{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,s;t&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=e.tr,u,c,h=[],p=[];return this.items.forEach((m,y)=>{if(!m.step){i||(i=this.remapping(r,y+1),s=i.maps.length),s--,p.push(m);return}if(i){p.push(new bn(m.map));let _=m.step.map(i.slice(s)),S;_&&a.maybeStep(_).doc&&(S=a.mapping.maps[a.mapping.maps.length-1],h.push(new bn(S,void 0,void 0,h.length+p.length))),s--,S&&i.appendMap(S,s)}else a.maybeStep(m.step);if(m.selection)return u=i?m.selection.map(i.slice(s)):m.selection,c=new un(this.items.slice(0,r).append(p.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:u}}addTransform(e,t,r,i){let s=[],a=this.eventCount,u=this.items,c=!i&&u.length?u.get(u.length-1):null;for(let p=0;p<e.steps.length;p++){let m=e.steps[p].invert(e.docs[p]),y=new bn(e.mapping.maps[p],m,t),_;(_=c&&c.merge(y))&&(y=_,p?s.pop():u=u.slice(0,u.length-1)),s.push(y),t&&(a++,t=void 0),i||(c=y)}let h=a-r.depth;return h>SO&&(u=vO(u,h),a-=h),new un(u.append(s),a)}remapping(e,t){let r=new zi;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-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 un(this.items.append(e.map(t=>new bn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),s=e.mapping,a=e.steps.length,u=this.eventCount;this.items.forEach(y=>{y.selection&&u--},i);let c=t;this.items.forEach(y=>{let _=s.getMirror(--c);if(_==null)return;a=Math.min(a,_);let S=s.maps[_];if(y.step){let E=e.steps[_].invert(e.docs[_]),N=y.selection&&y.selection.map(s.slice(c+1,_));N&&u++,r.push(new bn(S,E,N))}else r.push(new bn(S))},i);let h=[];for(let y=t;y<a;y++)h.push(new bn(s.maps[y]));let p=this.items.slice(0,i).append(h).append(r),m=new un(p,u);return m.emptyItemCount()>wO&&(m=m.compress(this.items.length-r.length)),m}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],s=0;return this.items.forEach((a,u)=>{if(u>=e)i.push(a),a.selection&&s++;else if(a.step){let c=a.step.map(t.slice(r)),h=c&&c.getMap();if(r--,h&&t.appendMap(h,r),c){let p=a.selection&&a.selection.map(t.slice(r));p&&s++;let m=new bn(h.invert(),c,p),y,_=i.length-1;(y=i.length&&i[_].merge(m))?i[_]=y:i.push(m)}}else a.map&&r--},this.items.length,0),new un(Ke.from(i.reverse()),s)}}un.empty=new un(Ke.empty,0);function vO(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class bn{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 bn(t.getMap().invert(),t,this.selection)}}}class _r{constructor(e,t,r,i,s){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const SO=20;function xO(n,e,t,r){let i=t.getMeta(Jr),s;if(i)return i.historyState;t.getMeta(kO)&&(n=new _r(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Jr))return a.getMeta(Jr).redo?new _r(n.done.addTransform(t,void 0,r,qa(e)),n.undone,u1(t.mapping.maps),n.prevTime,n.prevComposition):new _r(n.done,n.undone.addTransform(t,void 0,r,qa(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=t.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=u&&(n.prevTime<(t.time||0)-r.newGroupDelay||!CO(t,n.prevRanges)),h=a?Mf(n.prevRanges,t.mapping):u1(t.mapping.maps);return new _r(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,qa(e)),un.empty,h,t.time,u??n.prevComposition)}else return(s=t.getMeta("rebased"))?new _r(n.done.rebased(t,s),n.undone.rebased(t,s),Mf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new _r(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Mf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function CO(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function u1(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,s,a)=>e.push(s,a));return e}function Mf(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),s=e.map(n[r+1],-1);i<=s&&t.push(i,s)}return t}function EO(n,e,t){let r=qa(e),i=Jr.get(e).spec.config,s=(t?n.undone:n.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),u=(t?n.done:n.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),c=new _r(t?u:s.remaining,t?s.remaining:u,null,0,-1);return s.transform.setSelection(a).setMeta(Jr,{redo:t,historyState:c})}let If=!1,c1=null;function qa(n){let e=n.plugins;if(c1!=e){If=!1,c1=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){If=!0;break}}return If}const Jr=new It("history"),kO=new It("closeHistory");function AO(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new ct({key:Jr,state:{init(){return new _r(un.empty,un.empty,null,0,-1)},apply(e,t,r){return xO(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?h1:r=="historyRedo"?d1:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function f1(n,e){return(t,r)=>{let i=Jr.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let s=EO(i,t,n);s&&r(e?s.scrollIntoView():s)}return!0}}const h1=f1(!1,!0),d1=f1(!0,!0),TO=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>h1(n,e),redo:()=>({state:n,dispatch:e})=>d1(n,e)}},addProseMirrorPlugins(){return[AO(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var $n=(n=>(n.COMMON="common",n.DESKTOP="desktop",n.TABLET="tablet",n.MOBILE="mobile",n.ALL="all",n))($n||{});const OO=["common","mobile","tablet","desktop"];var Ka=(n=>(n.UPPERCASE="uppercase",n.LOWERCASE="lowercase",n.CAPITALIZE="capitalize",n))(Ka||{}),wr=(n=>(n.LEFT="left",n.CENTER="center",n.RIGHT="right",n.JUSTIFY="justify",n))(wr||{});const MO=["left","center","right","justify"];var ie=(n=>(n.DOCUMENT="doc",n.PARAGRAPH="paragraph",n.HEADING="heading",n.LIST="list",n.LIST_ITEM="listItem",n.TEXT="text",n))(ie||{});const Nf=["paragraph","list","heading"];var an=(n=>(n.DISC="disc",n.CIRCLE="circle",n.SQUARE="square",n.DECIMAL="decimal",n.ROMAN="roman",n.LATIN="latin",n))(an||{});const IO=["disc","circle","square","decimal","roman","latin"],NO=["decimal","roman","latin"];var ke=(n=>(n.ALIGNMENT="alignment",n.BACKGROUND_COLOR="background_color",n.FONT_COLOR="font_color",n.FONT_FAMILY="font_family",n.FONT_SIZE="font_size",n.FONT_STYLE="font_style",n.FONT_WEIGHT="font_weight",n.LINE_HEIGHT="line_height",n.LETTER_SPACING="letter_spacing",n.TEXT_DECORATION="text_decoration",n.SUPERSCRIPT="superscript",n.MARGIN="margin",n.LINK="link",n.STYLE_PRESET="style_preset",n))(ke||{});const p1=["alignment","line_height","margin"],Ii=["line_height"],m1=["text_decoration","link","superscript","background_color"],g1=["background_color","font_color","font_family","font_size","font_style","font_weight","letter_spacing","text_decoration","superscript"];var Rt=(n=>(n.SETTINGS="settings",n.ALL="_",n))(Rt||{}),Rf=(n=>(n.BLANK="_blank",n.SELF="_self",n))(Rf||{}),Ni=(n=>(n.URL="url",n.BLOCK="block",n))(Ni||{});class Lf{static create(e,t){const r=new this(e,t||{});return new ct({key:new It(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 RO extends Lf{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=zl.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,(s,a,u)=>{u.type.name===ie.DOCUMENT&&(r=Math.min(r,a+1),i=Math.max(i,a+s.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class LO extends Lf{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 s=vn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(s)}return!1}),Ye.create(e,t)}}const PO="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",DO="\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\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",Ri=(n,e)=>{for(const t in e)n[t]=e[t];return n},Pf="numeric",Df="ascii",Ff="alpha",Ms="asciinumeric",Is="alphanumeric",Bf="domain",y1="emoji",FO="scheme",BO="slashscheme",zf="whitespace";function zO(n,e){return n in e||(e[n]=[]),e[n]}function jr(n,e,t){e[Pf]&&(e[Ms]=!0,e[Is]=!0),e[Df]&&(e[Ms]=!0,e[Ff]=!0),e[Ms]&&(e[Is]=!0),e[Ff]&&(e[Is]=!0),e[Is]&&(e[Bf]=!0),e[y1]&&(e[Bf]=!0);for(const r in e){const i=zO(r,t);i.indexOf(n)<0&&i.push(n)}}function $O(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function _t(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}_t.groups={},_t.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],s=e.jr[r][1];if(s&&i.test(n))return s}return e.jd},has(n,e=!1){return 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||_t.groups;let i;return e&&e.j?i=e:(i=new _t(e),t&&r&&jr(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const s=n.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(n[a]);return i.tt(n[s-1],e,t,r)},tt(n,e,t,r){r=r||_t.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const s=e;let a,u=i.go(n);if(u?(a=new _t,Ri(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new _t,s){if(r)if(a.t&&typeof a.t=="string"){const c=Ri($O(a.t,r),t);jr(s,c,r)}else t&&jr(s,t,r);a.t=s}return i.j[n]=a,a}};const ae=(n,e,t,r,i)=>n.ta(e,t,r,i),Ne=(n,e,t,r,i)=>n.tr(e,t,r,i),b1=(n,e,t,r,i)=>n.ts(e,t,r,i),$=(n,e,t,r,i)=>n.tt(e,t,r,i),Hn="WORD",$f="UWORD",_1="ASCIINUMERICAL",w1="ALPHANUMERICAL",Ns="LOCALHOST",Hf="TLD",Wf="UTLD",Ga="SCHEME",Li="SLASH_SCHEME",Vf="NUM",Uf="WS",qf="NL",Rs="OPENBRACE",Ls="CLOSEBRACE",Ja="OPENBRACKET",ja="CLOSEBRACKET",Ya="OPENPAREN",Xa="CLOSEPAREN",Za="OPENANGLEBRACKET",Qa="CLOSEANGLEBRACKET",el="FULLWIDTHLEFTPAREN",tl="FULLWIDTHRIGHTPAREN",nl="LEFTCORNERBRACKET",rl="RIGHTCORNERBRACKET",il="LEFTWHITECORNERBRACKET",sl="RIGHTWHITECORNERBRACKET",ol="FULLWIDTHLESSTHAN",al="FULLWIDTHGREATERTHAN",ll="AMPERSAND",Kf="APOSTROPHE",ul="ASTERISK",vr="AT",cl="BACKSLASH",fl="BACKTICK",hl="CARET",Sr="COLON",Gf="COMMA",dl="DOLLAR",gn="DOT",pl="EQUALS",Jf="EXCLAMATION",Jt="HYPHEN",Ps="PERCENT",ml="PIPE",gl="PLUS",yl="POUND",Ds="QUERY",jf="QUOTE",v1="FULLWIDTHMIDDLEDOT",Yf="SEMI",yn="SLASH",Fs="TILDE",bl="UNDERSCORE",S1="EMOJI",_l="SYM";var x1=Object.freeze({__proto__:null,WORD:Hn,UWORD:$f,ASCIINUMERICAL:_1,ALPHANUMERICAL:w1,LOCALHOST:Ns,TLD:Hf,UTLD:Wf,SCHEME:Ga,SLASH_SCHEME:Li,NUM:Vf,WS:Uf,NL:qf,OPENBRACE:Rs,CLOSEBRACE:Ls,OPENBRACKET:Ja,CLOSEBRACKET:ja,OPENPAREN:Ya,CLOSEPAREN:Xa,OPENANGLEBRACKET:Za,CLOSEANGLEBRACKET:Qa,FULLWIDTHLEFTPAREN:el,FULLWIDTHRIGHTPAREN:tl,LEFTCORNERBRACKET:nl,RIGHTCORNERBRACKET:rl,LEFTWHITECORNERBRACKET:il,RIGHTWHITECORNERBRACKET:sl,FULLWIDTHLESSTHAN:ol,FULLWIDTHGREATERTHAN:al,AMPERSAND:ll,APOSTROPHE:Kf,ASTERISK:ul,AT:vr,BACKSLASH:cl,BACKTICK:fl,CARET:hl,COLON:Sr,COMMA:Gf,DOLLAR:dl,DOT:gn,EQUALS:pl,EXCLAMATION:Jf,HYPHEN:Jt,PERCENT:Ps,PIPE:ml,PLUS:gl,POUND:yl,QUERY:Ds,QUOTE:jf,FULLWIDTHMIDDLEDOT:v1,SEMI:Yf,SLASH:yn,TILDE:Fs,UNDERSCORE:bl,EMOJI:S1,SYM:_l});const Wn=/[a-z]/,Bs=/\p{L}/u,Xf=/\p{Emoji}/u,Vn=/\d/,Zf=/\s/,C1="\r",Qf=`
|
|
42
|
+
`,HO="\uFE0F",WO="\u200D",eh="\uFFFC";let wl=null,vl=null;function VO(n=[]){const e={};_t.groups=e;const t=new _t;wl==null&&(wl=k1(PO)),vl==null&&(vl=k1(DO)),$(t,"'",Kf),$(t,"{",Rs),$(t,"}",Ls),$(t,"[",Ja),$(t,"]",ja),$(t,"(",Ya),$(t,")",Xa),$(t,"<",Za),$(t,">",Qa),$(t,"\uFF08",el),$(t,"\uFF09",tl),$(t,"\u300C",nl),$(t,"\u300D",rl),$(t,"\u300E",il),$(t,"\u300F",sl),$(t,"\uFF1C",ol),$(t,"\uFF1E",al),$(t,"&",ll),$(t,"*",ul),$(t,"@",vr),$(t,"`",fl),$(t,"^",hl),$(t,":",Sr),$(t,",",Gf),$(t,"$",dl),$(t,".",gn),$(t,"=",pl),$(t,"!",Jf),$(t,"-",Jt),$(t,"%",Ps),$(t,"|",ml),$(t,"+",gl),$(t,"#",yl),$(t,"?",Ds),$(t,'"',jf),$(t,"/",yn),$(t,";",Yf),$(t,"~",Fs),$(t,"_",bl),$(t,"\\",cl),$(t,"\u30FB",v1);const r=Ne(t,Vn,Vf,{[Pf]:!0});Ne(r,Vn,r);const i=Ne(r,Wn,_1,{[Ms]:!0}),s=Ne(r,Bs,w1,{[Is]:!0}),a=Ne(t,Wn,Hn,{[Df]:!0});Ne(a,Vn,i),Ne(a,Wn,a),Ne(i,Vn,i),Ne(i,Wn,i);const u=Ne(t,Bs,$f,{[Ff]:!0});Ne(u,Wn),Ne(u,Vn,s),Ne(u,Bs,u),Ne(s,Vn,s),Ne(s,Wn),Ne(s,Bs,s);const c=$(t,Qf,qf,{[zf]:!0}),h=$(t,C1,Uf,{[zf]:!0}),p=Ne(t,Zf,Uf,{[zf]:!0});$(t,eh,p),$(h,Qf,c),$(h,eh,p),Ne(h,Zf,p),$(p,C1),$(p,Qf),Ne(p,Zf,p),$(p,eh,p);const m=Ne(t,Xf,S1,{[y1]:!0});$(m,"#"),Ne(m,Xf,m),$(m,HO,m);const y=$(m,WO);$(y,"#"),Ne(y,Xf,m);const _=[[Wn,a],[Vn,i]],S=[[Wn,null],[Bs,u],[Vn,s]];for(let E=0;E<wl.length;E++)xr(t,wl[E],Hf,Hn,_);for(let E=0;E<vl.length;E++)xr(t,vl[E],Wf,$f,S);jr(Hf,{tld:!0,ascii:!0},e),jr(Wf,{utld:!0,alpha:!0},e),xr(t,"file",Ga,Hn,_),xr(t,"mailto",Ga,Hn,_),xr(t,"http",Li,Hn,_),xr(t,"https",Li,Hn,_),xr(t,"ftp",Li,Hn,_),xr(t,"ftps",Li,Hn,_),jr(Ga,{scheme:!0,ascii:!0},e),jr(Li,{slashscheme:!0,ascii:!0},e),n=n.sort((E,N)=>E[0]>N[0]?1:-1);for(let E=0;E<n.length;E++){const N=n[E][0],v=n[E][1]?{[FO]:!0}:{[BO]:!0};N.indexOf("-")>=0?v[Bf]=!0:Wn.test(N)?Vn.test(N)?v[Ms]=!0:v[Df]=!0:v[Pf]=!0,b1(t,N,N,v)}return b1(t,"localhost",Ns,{ascii:!0}),t.jd=new _t(_l),{start:t,tokens:Ri({groups:e},x1)}}function E1(n,e){const t=UO(e.replace(/[A-Z]/g,u=>u.toLowerCase())),r=t.length,i=[];let s=0,a=0;for(;a<r;){let u=n,c=null,h=0,p=null,m=-1,y=-1;for(;a<r&&(c=u.go(t[a]));)u=c,u.accepts()?(m=0,y=0,p=u):m>=0&&(m+=t[a].length,y++),h+=t[a].length,s+=t[a].length,a++;s-=m,a-=y,h-=m,i.push({t:p.t,v:e.slice(s-h,s),s:s-h,e:s})}return i}function UO(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),s,a=i<55296||i>56319||r+1===t||(s=n.charCodeAt(r+1))<56320||s>57343?n[r]:n.slice(r,r+2);e.push(a),r+=a.length}return e}function xr(n,e,t,r,i){let s;const a=e.length;for(let u=0;u<a-1;u++){const c=e[u];n.j[c]?s=n.j[c]:(s=new _t(r),s.jr=i.slice(),n.j[c]=s),n=s}return s=new _t(t),s.jr=i.slice(),n.j[e[a-1]]=s,s}function k1(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let s=0;for(;i.indexOf(n[r+s])>=0;)s++;if(s>0){e.push(t.join(""));for(let a=parseInt(n.substring(r,r+s),10);a>0;a--)t.pop();r+=s}else t.push(n[r]),r++}return e}const zs={defaultProtocol:"http",events:null,format:A1,formatHref:A1,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function th(n,e=null){let t=Ri({},zs);n&&(t=Ri(t,n instanceof th?n.o:n));const r=t.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}th.prototype={o:zs,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]:zs[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 A1(n){return n}function T1(n,e){this.t="token",this.v=n,this.tk=e}T1.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=zs.defaultProtocol){return{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),s=this.toFormattedString(n),a={},u=n.get("className",t,e),c=n.get("target",t,e),h=n.get("rel",t,e),p=n.getObj("attributes",t,e),m=n.getObj("events",t,e);return a.href=r,u&&(a.class=u),c&&(a.target=c),h&&(a.rel=h),p&&Ri(a,p),{tagName:i,attributes:a,content:s,eventListeners:m}}};function Sl(n,e){class t extends T1{constructor(i,s){super(i,s),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const O1=Sl("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),M1=Sl("text"),qO=Sl("nl"),xl=Sl("url",{isLink:!0,toHref(n=zs.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Ns&&n[1].t===Sr}}),jt=n=>new _t(n);function KO({groups:n}){const e=n.domain.concat([ll,ul,vr,cl,fl,hl,dl,pl,Jt,Vf,Ps,ml,gl,yl,yn,_l,Fs,bl]),t=[Sr,Gf,gn,Jf,Ps,Ds,jf,Yf,Za,Qa,Rs,Ls,ja,Ja,Ya,Xa,el,tl,nl,rl,il,sl,ol,al],r=[ll,Kf,ul,cl,fl,hl,dl,pl,Jt,Rs,Ls,Ps,ml,gl,yl,Ds,yn,_l,Fs,bl],i=jt(),s=$(i,Fs);ae(s,r,s),ae(s,n.domain,s);const a=jt(),u=jt(),c=jt();ae(i,n.domain,a),ae(i,n.scheme,u),ae(i,n.slashscheme,c),ae(a,r,s),ae(a,n.domain,a);const h=$(a,vr);$(s,vr,h),$(u,vr,h),$(c,vr,h);const p=$(s,gn);ae(p,r,s),ae(p,n.domain,s);const m=jt();ae(h,n.domain,m),ae(m,n.domain,m);const y=$(m,gn);ae(y,n.domain,m);const _=jt(O1);ae(y,n.tld,_),ae(y,n.utld,_),$(h,Ns,_);const S=$(m,Jt);$(S,Jt,S),ae(S,n.domain,m),ae(_,n.domain,m),$(_,gn,y),$(_,Jt,S);const E=$(_,Sr);ae(E,n.numeric,O1);const N=$(a,Jt),g=$(a,gn);$(N,Jt,N),ae(N,n.domain,a),ae(g,r,s),ae(g,n.domain,a);const v=jt(xl);ae(g,n.tld,v),ae(g,n.utld,v),ae(v,n.domain,a),ae(v,r,s),$(v,gn,g),$(v,Jt,N),$(v,vr,h);const k=$(v,Sr),A=jt(xl);ae(k,n.numeric,A);const T=jt(xl),F=jt();ae(T,e,T),ae(T,t,F),ae(F,e,T),ae(F,t,F),$(v,yn,T),$(A,yn,T);const U=$(u,Sr),W=$(c,Sr),ee=$(W,yn),te=$(ee,yn);ae(u,n.domain,a),$(u,gn,g),$(u,Jt,N),ae(c,n.domain,a),$(c,gn,g),$(c,Jt,N),ae(U,n.domain,T),$(U,yn,T),$(U,Ds,T),ae(te,n.domain,T),ae(te,e,T),$(te,yn,T);const Se=[[Rs,Ls],[Ja,ja],[Ya,Xa],[Za,Qa],[el,tl],[nl,rl],[il,sl],[ol,al]];for(let vt=0;vt<Se.length;vt++){const[Sn,Ft]=Se[vt],xn=$(T,Sn);$(F,Sn,xn),$(xn,Ft,T);const We=jt(xl);ae(xn,e,We);const St=jt();ae(xn,t),ae(We,e,We),ae(We,t,St),ae(St,e,We),ae(St,t,St),$(We,Ft,T),$(St,Ft,T)}return $(i,Ns,v),$(i,qf,qO),{start:i,tokens:x1}}function GO(n,e,t){let r=t.length,i=0,s=[],a=[];for(;i<r;){let u=n,c=null,h=null,p=0,m=null,y=-1;for(;i<r&&!(c=u.go(t[i].t));)a.push(t[i++]);for(;i<r&&(h=c||u.go(t[i].t));)c=null,u=h,u.accepts()?(y=0,m=u):y>=0&&y++,i++,p++;if(y<0)i-=p,i<r&&(a.push(t[i]),i++);else{a.length>0&&(s.push(nh(M1,e,a)),a=[]),i-=y,p-=y;const _=m.t,S=t.slice(i-p,i);s.push(nh(_,e,S))}}return a.length>0&&s.push(nh(M1,e,a)),s}function nh(n,e,t){const r=t[0].s,i=t[t.length-1].e,s=e.slice(r,i);return new n(s,t)}const JO=typeof console<"u"&&console&&console.warn||(()=>{}),jO="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ae={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function YO(){return _t.groups={},Ae.scanner=null,Ae.parser=null,Ae.tokenQueue=[],Ae.pluginQueue=[],Ae.customSchemes=[],Ae.initialized=!1,Ae}function I1(n,e=!1){if(Ae.initialized&&JO(`linkifyjs: already initialized - will not register custom scheme "${n}" ${jO}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
|
|
43
43
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
44
44
|
2. Cannot start or end with "-"
|
|
45
|
-
3. "-" cannot repeat`);Te.customSchemes.push([n,e])}function XO(){Te.scanner=VO(Te.customSchemes);for(let n=0;n<Te.tokenQueue.length;n++)Te.tokenQueue[n][1]({scanner:Te.scanner});Te.parser=KO(Te.scanner.tokens);for(let n=0;n<Te.pluginQueue.length;n++)Te.pluginQueue[n][1]({scanner:Te.scanner,parser:Te.parser});return Te.initialized=!0,Te}function Cl(n){return Te.initialized||XO(),GO(Te.parser.start,n,E1(Te.scanner.start,n))}Cl.scan=E1;function N1(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new th(t),i=Cl(n),s=[];for(let a=0;a<i.length;a++){const u=i[a];u.isLink&&(!e||u.t===e)&&r.check(u)&&s.push(u.toFormattedObject(r))}return s}function ZO(n,e=null){const t=Cl(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class QO extends Lf{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(),s=ZO(i);if(!i||!s)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return kh.query(t,{typeName:oe.TEXT,mark:{typeName:ke.LINK},getMark:{typeName:ke.LINK}})?.attrs||{href:e}}}function H(n){return(...e)=>t=>n(t,...e)}function El(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const s=r.replace(/_/g,"-");return`${t}--zw-${s}:${i};`},"");return e?{style:e}:null}function Cr(n){const e=El(n);return["span",e?{...e,class:"zw-style"}:{},0]}function eM(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Yt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var tM=Object.defineProperty,nM=(n,e,t)=>e in n?tM(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Un=(n,e,t)=>nM(n,typeof e!="symbol"?e+"":e,t),R1,L1,P1;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(c=>c[u])),s=n.map(a=>i.map(u=>{let c=0;if(!Array.isArray(a)){for(let h of u)c+=a*h;return c}for(let h=0;h<a.length;h++)c+=a[h]*(u[h]||0);return c}));return t===1&&(s=s[0]),r===1?s.map(a=>a[0]):s}function D1(n){return zs(n)==="string"}function zs(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function rh(n,{precision:e,unit:t}){return ih(n)?"none":rM(n,e)+(t??"")}function ih(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function rM(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 iM={deg:1,grad:.9,rad:180/Math.PI,turn:360};function sM(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 s=n.match(e);if(s){let a=[];return s[2].replace(i,(u,c)=>{let h=c.match(r),p=c;if(h){let m=h[0],y=p.slice(0,-m.length);m==="%"?(p=new Number(y/100),p.type="<percentage>"):(p=new Number(y*iM[m]),p.type="<angle>",p.unit=m)}else t.test(p)?(p=new Number(p),p.type="<number>"):p==="none"&&(p=new Number(NaN),p.none=!0);u.startsWith("/")&&(p=p instanceof Number?p:new Number(p),p.alpha=!0),typeof p=="object"&&p instanceof Number&&(p.raw=c),a.push(p)}),{name:s[1].toLowerCase(),rawName:s[1],rawArgs:s[2],args:a}}}function oM(n){return n[n.length-1]}function F1(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function aM(n,e,t){return(t-n)/(e-n)}function B1(n,e,t){return F1(e[0],e[1],aM(n[0],n[1],t))}function lM(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 uM(n,e,t){return Math.max(Math.min(t,e),n)}function sh(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function qn(n,e){return sh(Math.abs(n)**e,n)}function z1(n,e){return e===0?0:n/e}function cM(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 fM{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 kl=new fM,Kn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function oh(n){return Array.isArray(n)?n:Kn[n]}function Tl(n,e,t,r={}){if(n=oh(n),e=oh(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(kl.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]])),kl.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 $s={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((P1=(L1=(R1=globalThis?.process)==null?void 0:R1.env)==null?void 0:L1.NODE_ENV)==null?void 0:P1.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},hM=new Set(["<number>","<percentage>","<angle>"]);function $1(n,e,t,r){return Object.entries(n.coords).map(([s,a],u)=>{let c=e.coordGrammar[u],h=r[u],p=h?.type,m;if(h.none?m=c.find(S=>hM.has(S)):m=c.find(S=>S==p),!m){let S=a.name||s;throw new TypeError(`${p??h.raw} not allowed for ${S} in ${t}()`)}let y=m.range;p==="<percentage>"&&(y||(y=[0,1]));let _=a.range||a.refRange;return y&&_&&(r[u]=B1(y,_,r[u])),m})}function H1(n,{meta:e}={}){var t,r,i,s;let a={str:(t=String(n))==null?void 0:t.trim()};if(kl.run("parse-start",a),a.color)return a.color;if(a.parsed=sM(a.str),a.parsed){let u=a.parsed.name;if(u==="color"){let c=a.parsed.args.shift(),h=c.startsWith("--")?c.substring(2):`--${c}`,p=[c,h],m=a.parsed.rawArgs.indexOf("/")>0?a.parsed.args.pop():1;for(let S of le.all){let E=S.getFormat("color");if(E&&(p.includes(E.id)||(r=E.ids)!=null&&r.filter(N=>p.includes(N)).length)){const N=Object.keys(S.coords).map((v,k)=>a.parsed.args[k]||0);let g;return E.coordGrammar&&(g=$1(S,E,"color",N)),e&&Object.assign(e,{formatId:"color",types:g}),E.id.startsWith("--")&&!c.startsWith("--")&&$s.warn(`${S.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${E.id}) instead of color(${c}).`),c.startsWith("--")&&!E.id.startsWith("--")&&$s.warn(`${S.name} is a standard space and supported in the CSS spec. Use color(${E.id}) instead of prefixed color(${c}).`),{spaceId:S.id,coords:N,alpha:m}}}let y="",_=c in le.registry?c:h;if(_ in le.registry){let S=(s=(i=le.registry[_].formats)==null?void 0:i.color)==null?void 0:s.id;S&&(y=`Did you mean color(${S})?`)}throw new TypeError(`Cannot parse color(${c}). `+(y||"Missing a plugin?"))}else for(let c of le.all){let h=c.getFormat(u);if(h&&h.type==="function"){let p=1;(h.lastAlpha||oM(a.parsed.args).alpha)&&(p=a.parsed.args.pop());let m=a.parsed.args,y;return h.coordGrammar&&(y=$1(c,h,u,m)),e&&Object.assign(e,{formatId:h.name,types:y}),{spaceId:c.id,coords:m,alpha:p}}}}else for(let u of le.all)for(let c in u.formats){let h=u.formats[c];if(h.type!=="custom"||h.test&&!h.test(a.str))continue;let p=h.parse(a.str);if(p)return p.alpha??(p.alpha=1),e&&(e.formatId=c),p}throw new TypeError(`Could not parse ${n} as a color. Missing a plugin?`)}function Ge(n){if(Array.isArray(n))return n.map(Ge);if(!n)throw new TypeError("Empty color reference");D1(n)&&(n=H1(n));let e=n.space||n.spaceId;return e instanceof le||(n.space=le.get(e)),n.alpha===void 0&&(n.alpha=1),n}const dM=75e-6,ah=class ln{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?ln.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 s in r)"name"in r[s]||(r[s].name=s);this.coords=r;let i=e.white??this.base.white??"D65";this.white=oh(i),this.formats=e.formats??{};for(let s in this.formats){let a=this.formats[s];a.type||(a.type="function"),a.name||(a.name=s)}(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:ln.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(s,a)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:pM(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),kl.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=dM}={}){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,s)=>{let a=r[s];if(a.type!=="angle"&&a.range){if(Number.isNaN(i))return!0;let[u,c]=a.range;return(u===void 0||i>=u-t)&&(c===void 0||i<=c+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=W1(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=W1(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=Ge(e);[e,t]=[u.space,u.coords]}if(e=ln.get(e),this.equals(e))return t;t=t.map(u=>Number.isNaN(u)?0:u);let r=this.path,i=e.path,s,a;for(let u=0;u<r.length&&r[u].equals(i[u]);u++)s=r[u],a=u;if(!s)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=Ge(e);[e,t]=[r.space,r.coords]}return e=ln.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(ln.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 ln)return e;if(zs(e)==="string"){let i=ln.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return ln.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=zs(e),s,a;if(i==="string"?e.includes(".")?[s,a]=e.split("."):[s,a]=[,e]:Array.isArray(e)?[s,a]=e:(s=e.space,a=e.coordId),s=ln.get(s),s||(s=t),!s)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(i=zs(a),i==="number"||i==="string"&&a>=0){let h=Object.entries(s.coords)[a];if(h)return{space:s,id:h[0],index:a,...h[1]}}s=ln.get(s);let u=a.toLowerCase(),c=0;for(let h in s.coords){let p=s.coords[h];if(h.toLowerCase()===u||((r=p.name)==null?void 0:r.toLowerCase())===u)return{space:s,id:h,index:c,...p};c++}throw new TypeError(`No "${a}" coordinate found in ${s.name}. Its coordinates are: ${Object.keys(s.coords).join(", ")}`)}};Un(ah,"registry",{}),Un(ah,"DEFAULT_FORMAT",{type:"functions",name:"color"});let le=ah;function pM(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function W1(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=lM(n.coords);let t=Object.entries(e).map(([r,i],s)=>{let a=n.coordGrammar[s][0],u=i.range||i.refRange,c=a.range,h="";return a=="<percentage>"?(c=[0,100],h="%"):a=="<angle>"&&(h="deg"),{fromRange:u,toRange:c,suffix:h}});n.serializeCoords=(r,i)=>r.map((s,a)=>{let{fromRange:u,toRange:c,suffix:h}=t[a];return u&&c&&(s=B1(u,c,s)),s=rh(s,{precision:i,unit:h}),s})}return n}const Gn=new le({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 V1 extends le{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=Tl(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=Tl(this.base.white,this.white,t),$e(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function lh(n,e){return n=Ge(n),!e||n.space.equals(e)?n.coords.slice():(e=le.get(e),e.from(n))}function Jn(n,e){n=Ge(n);let{space:t,index:r}=le.resolveCoord(e,n.space);return lh(n,t)[r]}function U1(n,e,t){return n=Ge(n),e=le.get(e),n.coords=e.to(n.space,t),n}U1.returns="color";function uh(n,e,t){if(n=Ge(n),arguments.length===2&&zs(arguments[1])==="object"){let r=arguments[1];for(let i in r)uh(n,i,r[i])}else{typeof t=="function"&&(t=t(Jn(n,e)));let{space:r,index:i}=le.resolveCoord(e,n.space),s=lh(n,r);s[i]=t,U1(n,r,s)}return n}uh.returns="color";const mM=new le({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Gn,fromBase:n=>Tl(Gn.white,"D50",n),toBase:n=>Tl("D50",Gn.white,n)}),gM=216/24389,q1=24/116,Al=24389/27;let ch=Kn.D50;const jn=new le({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:ch,base:mM,fromBase(n){let t=n.map((r,i)=>r/ch[i]).map(r=>r>gM?Math.cbrt(r):(Al*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]>q1?Math.pow(e[0],3):(116*e[0]-16)/Al,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/Al,e[2]>q1?Math.pow(e[2],3):(116*e[2]-16)/Al].map((r,i)=>r*ch[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Er(n){return(n%360+360)%360}const Ol=new le({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 s=.02;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Er(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>"]}}}),K1=25**7,Ml=Math.PI,G1=180/Ml,Li=Ml/180;function J1(n){const e=n*n;return e*e*e*n}function j1(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=Ge([n,e]);let[s,a,u]=jn.from(n),c=Ol.from(jn,[s,a,u])[1],[h,p,m]=jn.from(e),y=Ol.from(jn,[h,p,m])[1];c<0&&(c=0),y<0&&(y=0);let _=(c+y)/2,S=J1(_),E=.5*(1-Math.sqrt(S/(S+K1))),N=(1+E)*a,g=(1+E)*p,v=Math.sqrt(N**2+u**2),k=Math.sqrt(g**2+m**2),T=N===0&&u===0?0:Math.atan2(u,N),A=g===0&&m===0?0:Math.atan2(m,g);T<0&&(T+=2*Ml),A<0&&(A+=2*Ml),T*=G1,A*=G1;let F=h-s,U=k-v,W=A-T,ee=T+A,te=Math.abs(W),Se;v*k===0?Se=0:te<=180?Se=W:W>180?Se=W-360:W<-180?Se=W+360:$s.warn("the unthinkable has happened");let vt=2*Math.sqrt(k*v)*Math.sin(Se*Li/2),Sn=(s+h)/2,Ft=(v+k)/2,xn=J1(Ft),We;v*k===0?We=ee:te<=180?We=ee/2:ee<360?We=(ee+360)/2:We=(ee-360)/2;let St=(Sn-50)**2,Xn=1+.015*St/Math.sqrt(20+St),Js=1+.045*Ft,cn=1;cn-=.17*Math.cos((We-30)*Li),cn+=.24*Math.cos(2*We*Li),cn+=.32*Math.cos((3*We+6)*Li),cn-=.2*Math.cos((4*We-63)*Li);let xt=1+.015*Ft*cn,$l=30*Math.exp(-1*((We-275)/25)**2),Hl=2*Math.sqrt(xn/(xn+K1)),Wl=-1*Math.sin(2*$l*Li)*Hl,Xt=(F/(t*Xn))**2;return Xt+=(U/(r*Js))**2,Xt+=(vt/(i*xt))**2,Xt+=Wl*(U/(r*Js))*(vt/(i*xt)),Math.sqrt(Xt)}const yM=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],bM=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],_M=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],wM=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Hs=new le({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(yM,n).map(r=>Math.cbrt(r));return $e(_M,t)},toBase(n){let t=$e(wM,n).map(r=>r**3);return $e(bM,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function fh(n,e){[n,e]=Ge([n,e]);let[t,r,i]=Hs.from(n),[s,a,u]=Hs.from(e),c=t-s,h=r-a,p=i-u;return Math.sqrt(c**2+h**2+p**2)}const vM=75e-6;function Pi(n,e,{epsilon:t=vM}={}){n=Ge(n),e||(e=n.space),e=le.get(e);let r=n.coords;return e!==n.space&&(r=e.from(n)),e.inGamut(r,{epsilon:t})}function hh(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function SM(n,e,t="lab"){t=le.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((s,a,u)=>{let c=i[u];return isNaN(a)||isNaN(c)?s:s+(c-a)**2},0))}function xM(n,e){return SM(n,e,"lab")}const CM=Math.PI,Y1=CM/180;function EM(n,e,{l:t=2,c:r=1}={}){[n,e]=Ge([n,e]);let[i,s,a]=jn.from(n),[,u,c]=Ol.from(jn,[i,s,a]),[h,p,m]=jn.from(e),y=Ol.from(jn,[h,p,m])[1];u<0&&(u=0),y<0&&(y=0);let _=i-h,S=u-y,E=s-p,N=a-m,g=E**2+N**2-S**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let k=.0638*u/(1+.0131*u)+.638,T;Number.isNaN(c)&&(c=0),c>=164&&c<=345?T=.56+Math.abs(.2*Math.cos((c+168)*Y1)):T=.36+Math.abs(.4*Math.cos((c+35)*Y1));let A=Math.pow(u,4),F=Math.sqrt(A/(A+1900)),U=k*(F*T+1-F),W=(_/(t*v))**2;return W+=(S/(r*k))**2,W+=g/U**2,Math.sqrt(W)}const X1=203,Z1=new le({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*X1,0))},toBase(n){return n.map(e=>Math.max(e/X1,0))}}),Il=1.15,Nl=.66,Q1=2610/2**14,kM=2**14/2610,ey=3424/2**12,ty=2413/2**7,ny=2392/2**7,TM=1.7*2523/2**5,ry=2**5/(1.7*2523),Rl=-.56,dh=16295499532821565e-27,AM=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],OM=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],MM=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],IM=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],NM=new le({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:Z1,fromBase(n){let[e,t,r]=n,i=Il*e-(Il-1)*r,s=Nl*t-(Nl-1)*e,u=$e(AM,[i,s,r]).map(function(y){let _=ey+ty*(y/1e4)**Q1,S=1+ny*(y/1e4)**Q1;return(_/S)**TM}),[c,h,p]=$e(MM,u);return[(1+Rl)*c/(1+Rl*c)-dh,h,p]},toBase(n){let[e,t,r]=n,i=(e+dh)/(1+Rl-Rl*(e+dh)),a=$e(IM,[i,t,r]).map(function(y){let _=ey-y**ry,S=ny*y**ry-ty;return 1e4*(_/S)**kM}),[u,c,h]=$e(OM,a),p=(u+(Il-1)*h)/Il,m=(c+(Nl-1)*p)/Nl;return[p,m,h]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),iy=new le({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:NM,fromBase(n){let[e,t,r]=n,i;const s=2e-4;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Er(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 RM(n,e){[n,e]=Ge([n,e]);let[t,r,i]=iy.from(n),[s,a,u]=iy.from(e),c=t-s,h=r-a;Number.isNaN(i)&&Number.isNaN(u)?(i=0,u=0):Number.isNaN(i)?i=u:Number.isNaN(u)&&(u=i);let p=i-u,m=2*Math.sqrt(r*a)*Math.sin(p/2*(Math.PI/180));return Math.sqrt(c**2+h**2+m**2)}const sy=3424/4096,oy=2413/128,ay=2392/128,ly=2610/16384,LM=2523/32,PM=16384/2610,uy=32/2523,DM=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],FM=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],BM=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],zM=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],cy=new le({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:Z1,fromBase(n){let e=$e(DM,n);return $M(e)},toBase(n){let e=HM(n);return $e(zM,e)}});function $M(n){let e=n.map(function(t){let r=sy+oy*(t/1e4)**ly,i=1+ay*(t/1e4)**ly;return(r/i)**LM});return $e(FM,e)}function HM(n){return $e(BM,n).map(function(r){let i=Math.max(r**uy-sy,0),s=oy-ay*r**uy;return 1e4*(i/s)**PM})}function WM(n,e){[n,e]=Ge([n,e]);let[t,r,i]=cy.from(n),[s,a,u]=cy.from(e);return 720*Math.sqrt((t-s)**2+.25*(r-a)**2+(i-u)**2)}const VM=Kn.D65,fy=.42,hy=1/fy,ph=2*Math.PI,dy=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],UM=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],qM=[[460,451,288],[460,-891,-261],[460,-220,-6300]],KM={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},Yr={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},GM=180/Math.PI,py=Math.PI/180;function my(n,e){return n.map(r=>{const i=qn(e*Math.abs(r)*.01,fy);return 400*sh(i,r)/(i+27.13)})}function JM(n,e){const t=100/e*27.13**hy;return n.map(r=>{const i=Math.abs(r);return sh(t*qn(i/(400-i),hy),r)})}function jM(n){let e=Er(n);e<=Yr.h[0]&&(e+=360);const t=cM(Yr.h,e)-1,[r,i]=Yr.h.slice(t,t+2),[s,a]=Yr.e.slice(t,t+2),u=Yr.H[t],c=(e-r)/s;return u+100*c/(c+(i-e)/a)}function YM(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=Yr.h.slice(t,t+2),[s,a]=Yr.e.slice(t,t+2);return Er((e*(a*r-s*i)-100*r*a)/(e*(a-s)-100*a))}function gy(n,e,t,r,i){const s={};s.discounting=i,s.refWhite=n,s.surround=r;const a=n.map(E=>E*100);s.la=e,s.yb=t;const u=a[1],c=$e(dy,a);r=KM[s.surround];const h=r[0];s.c=r[1],s.nc=r[2];const m=(1/(5*s.la+1))**4;s.fl=m*s.la+.1*(1-m)*(1-m)*Math.cbrt(5*s.la),s.flRoot=s.fl**.25,s.n=s.yb/u,s.z=1.48+Math.sqrt(s.n),s.nbb=.725*s.n**-.2,s.ncb=s.nbb;const y=Math.max(Math.min(h*(1-1/3.6*Math.exp((-s.la-42)/92)),1),0);s.dRgb=c.map(E=>F1(1,u/E,y)),s.dRgbInv=s.dRgb.map(E=>1/E);const _=c.map((E,N)=>E*s.dRgb[N]),S=my(_,s.fl);return s.aW=s.nbb*(2*S[0]+S[1]+.05*S[2]),s}const yy=gy(VM,64/Math.PI*.2,20,"average",!1);function mh(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=Er(n.h)*py:t=YM(n.H)*py;const r=Math.cos(t),i=Math.sin(t);let s=0;n.J!==void 0?s=qn(n.J,1/2)*.1:n.Q!==void 0&&(s=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let a=0;n.C!==void 0?a=n.C/s:n.M!==void 0?a=n.M/e.flRoot/s: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),c=.25*(Math.cos(t+2)+3.8),h=e.aW*qn(s,2/e.c/e.z),p=5e4/13*e.nc*e.ncb*c,m=h/e.nbb,y=23*(m+.305)*z1(u,23*p+u*(11*r+108*i)),_=y*r,S=y*i,E=JM($e(qM,[m,_,S]).map(N=>N*1/1403),e.fl);return $e(UM,E.map((N,g)=>N*e.dRgbInv[g])).map(N=>N/100)}function by(n,e){const t=n.map(k=>k*100),r=my($e(dy,t).map((k,T)=>k*e.dRgb[T]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,s=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(s,i)%ph+ph)%ph,u=.25*(Math.cos(a+2)+3.8),c=5e4/13*e.nc*e.ncb*z1(u*Math.sqrt(i**2+s**2),r[0]+r[1]+1.05*r[2]+.305),h=qn(c,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),p=e.nbb*(2*r[0]+r[1]+.05*r[2]),m=qn(p/e.aW,.5*e.c*e.z),y=100*qn(m,2),_=4/e.c*m*(e.aW+4)*e.flRoot,S=h*m,E=S*e.flRoot,N=Er(a*GM),g=jM(N),v=50*qn(e.c*h/(e.aW+4),1/2);return{J:y,C:S,h:N,s:v,Q:_,M:E,H:g}}new le({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=by(n,yy);return[e.J,e.M,e.h]},toBase(n){return mh({J:n[0],M:n[1],h:n[2]},yy)}});const XM=Kn.D65,ZM=216/24389,_y=24389/27;function QM(n){return 116*(n>ZM?Math.cbrt(n):(_y*n+16)/116)-16}function gh(n){return n>8?Math.pow((n+16)/116,3):n/_y}function eI(n,e){let[t,r,i]=n,s=[],a=0;if(i===0)return[0,0,0];let u=gh(i);i>0?a=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:a=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const c=2e-12,h=15;let p=0,m=1/0;for(;p<=h;){s=mh({J:a,C:r,h:t},e);const y=Math.abs(s[1]-u);if(y<m){if(y<=c)return s;m=y}a=a-(s[1]-u)*a/(2*s[1]),p+=1}return mh({J:a,C:r,h:t},e)}function tI(n,e){const t=QM(n[1]);if(t===0)return[0,0,0];const r=by(n,yh);return[Er(r.h),r.C,t]}const yh=gy(XM,200/Math.PI*gh(50),gh(50)*100,"average",!1),Ll=new le({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 tI(n)},toBase(n){return eI(n,yh)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),nI=Math.PI/180,wy=[1,.007,.0228];function vy(n){n[1]<0&&(n=Ll.fromBase(Ll.toBase(n)));const e=Math.log(Math.max(1+wy[2]*n[1]*yh.flRoot,1))/wy[2],t=n[0]*nI,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function rI(n,e){[n,e]=Ge([n,e]);let[t,r,i]=vy(Ll.from(n)),[s,a,u]=vy(Ll.from(e));return Math.sqrt((t-s)**2+(r-a)**2+(i-u)**2)}const Sy={deltaE76:xM,deltaECMC:EM,deltaE2000:j1,deltaEJz:RM,deltaEITP:WM,deltaEOK:fh,deltaEHCT:rI};function iI(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const xy={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 Ws(n,{method:e=$s.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:s={}}={}){if(n=Ge(n),D1(arguments[1])?t=arguments[1]:t||(t=n.space),t=le.get(t),Pi(n,t,{epsilon:0}))return n;let a;if(e==="css")a=sI(n,{space:t});else{if(e!=="clip"&&!Pi(n,t)){Object.prototype.hasOwnProperty.call(xy,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:s}=xy[e]);let u=j1;if(r!==""){for(let h in Sy)if("deltae"+r.toLowerCase()===h.toLowerCase()){u=Sy[h];break}}let c=Ws(He(n,t),{method:"clip",space:t});if(u(n,c)>i){if(Object.keys(s).length===3){let v=le.resolveCoord(s.channel),k=Jn(He(n,v.space),v.id);if(ih(k)&&(k=0),k>=s.max)return He({space:"xyz-d65",coords:Kn.D65},n.space);if(k<=s.min)return He({space:"xyz-d65",coords:[0,0,0]},n.space)}let h=le.resolveCoord(e),p=h.space,m=h.id,y=He(n,p);y.coords.forEach((v,k)=>{ih(v)&&(y.coords[k]=0)});let S=(h.range||h.refRange)[0],E=iI(i),N=S,g=Jn(y,m);for(;g-N>E;){let v=hh(y);v=Ws(v,{space:t,method:"clip"}),u(y,v)-i<E?N=Jn(y,m):g=Jn(y,m),uh(y,m,(N+g)/2)}a=He(y,t)}else a=c}else a=He(n,t);if(e==="clip"||!Pi(a,t,{epsilon:0})){let u=Object.values(t.coords).map(c=>c.range||[]);a.coords=a.coords.map((c,h)=>{let[p,m]=u[h];return p!==void 0&&(c=Math.max(p,c)),m!==void 0&&(c=Math.min(c,m)),c})}}return t!==n.space&&(a=He(a,n.space)),n.coords=a.coords,n}Ws.returns="color";const Cy={WHITE:{space:Hs,coords:[1,0,0]},BLACK:{space:Hs,coords:[0,0,0]}};function sI(n,{space:e}={}){n=Ge(n),e||(e=n.space),e=le.get(e);const i=le.get("oklch");if(e.isUnbounded)return He(n,e);const s=He(n,i);let a=s.coords[0];if(a>=1){const S=He(Cy.WHITE,e);return S.alpha=n.alpha,He(S,e)}if(a<=0){const S=He(Cy.BLACK,e);return S.alpha=n.alpha,He(S,e)}if(Pi(s,e,{epsilon:0}))return He(s,e);function u(S){const E=He(S,e),N=Object.values(e.coords);return E.coords=E.coords.map((g,v)=>{if("range"in N[v]){const[k,T]=N[v].range;return uM(k,g,T)}return g}),E}let c=0,h=s.coords[1],p=!0,m=hh(s),y=u(m),_=fh(y,m);if(_<.02)return y;for(;h-c>1e-4;){const S=(c+h)/2;if(m.coords[1]=S,p&&Pi(m,e,{epsilon:0}))c=S;else if(y=u(m),_=fh(y,m),_<.02){if(.02-_<1e-4)break;p=!1,c=S}else h=S}return y}function He(n,e,{inGamut:t}={}){n=Ge(n),e=le.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=Ws(i,t===!0?void 0:t)),i}He.returns="color";function oI(n,{precision:e=$s.precision,format:t="default",inGamut:r=!0,...i}={}){var s;let a;n=Ge(n);let u=t;t=n.space.getFormat(t)??n.space.getFormat("default")??le.DEFAULT_FORMAT;let c=n.coords.slice();if(r||(r=t.toGamut),r&&!Pi(n)&&(c=Ws(hh(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)a=t.serialize(c,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?c=t.serializeCoords(c,e):e!==null&&(c=c.map(_=>rh(_,{precision:e})));let p=[...c];if(h==="color"){let _=t.id||((s=t.ids)==null?void 0:s[0])||n.space.id;p.unshift(_)}let m=n.alpha;e!==null&&(m=rh(m,{precision:e}));let y=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${m}`;a=`${h}(${p.join(t.commas?", ":" ")}${y})`}return a}const aI=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],lI=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],uI=new V1({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:aI,fromXYZ_M:lI}),Ey={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 ky=Array(3).fill("<percentage> | <number>[0, 255]"),Ty=Array(3).fill("<number>[0, 255]");const Ay=new V1({id:"srgb",name:"sRGB",base:uI,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:ky},rgb_number:{name:"rgb",commas:!0,coords:Ty,noAlpha:!0},color:{},rgba:{coords:ky,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:Ty},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(s=>Math.round(s*255));let r=t&&n.every(s=>s%17===0);return"#"+n.map(s=>r?(s/17).toString(16):s.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=Ey.black,e.alpha=0):e.coords=Ey[n],e.coords)return e}}}});function cI(n){return Jn(n,[Gn,"y"])}const Oy=new le({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:Ay,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,s]=n,[a,u,c]=[NaN,0,(t+e)/2],h=e-t;if(h!==0){switch(u=c===0||c===1?0:(e-c)/Math.min(c,1-c),e){case r:a=(i-s)/h+(i<s?6:0);break;case i:a=(s-r)/h+2;break;case s:a=(r-i)/h+4}a=a*60}return u<0&&(a+=180,u=Math.abs(u)),a>=360&&(a-=360),[a,u*100,c*100]},toBase:n=>{let[e,t,r]=n;e=e%360,e<0&&(e+=360),t/=100,r/=100;function i(s){let a=(s+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}}}),fI=new le({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:Oy,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>"]}}}),hI=new le({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Hs,fromBase(n){let[e,t,r]=n,i;const s=2e-4;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Er(i)]},toBase(n){let[e,t,r]=n,i,s;return isNaN(r)?(i=0,s=0):(i=t*Math.cos(r*Math.PI/180),s=t*Math.sin(r*Math.PI/180)),[e,i,s]},formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});class Dt{constructor(e){Un(this,"data"),this.data=He(e,"srgb")}static fromTransparent(){return new Dt({spaceId:"srgb",coords:[1,1,1],alpha: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 cI(this.data)<.5}withAlpha(e){return new Dt({...this.data,alpha:e})}withRgb(e){const t=this.alpha===0?1:this.alpha;return new Dt({spaceId:"srgb",alpha:e.a??t,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]]})}withHsv(e){const r=lh(this.data,"hsv"),i=Math.max(e.s??r[1],1e-5),s=Math.max(e.v??r[2],1e-5),a=this.alpha===0?1:this.alpha;return new Dt({alpha:a,spaceId:"hsv",coords:[e.h??r[0],i,s]})}toString(){return this.alpha===1?this.toHexString():this.toRgbaString()}toHexString(){const e=oI(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)}}class dI{constructor(e){Un(this,"_color"),Un(this,"isEmpty",!1),this.update(e)}get color(){return this._color}setColor(e){this._color=e}setEmpty(e){this.isEmpty=e}toString(){return this.isEmpty?"":this.color.toString()}isEqual(e){return this.toString()===e}update({solidColor:e,isEmpty:t}){this.setColor(e),this.setEmpty(t)}}let My=999;function pI(){return My+=1,My}function mI(n){return n?n.startsWith("linear-gradient("):!1}function gI(){const n=Dt.fromTransparent();return{isEmpty:!0,isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}le.register(Ay),le.register(fI),le.register(Oy),le.register(hI);function Iy(n){if(!n)return Dt.fromTransparent();try{return new Dt(He(H1(n),"srgb"))}catch(e){return console.warn(e),Dt.fromBlack()}}function yI(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 bI(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:Iy(t),offset:Number.parseFloat(r.replace("%",""))}})}function _I(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),s=bI(i),a=yI(r);return{isEmpty:!1,isGradient:!0,solidColor:s[0].color,angle:a,transitions:s}}function wI(n){const e=Iy(n),t=Dt.fromWhite();return{isEmpty:!1,isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(1),offset:100}]}}function vI(n,e=!0){if(!n)return gI();const t=mI(n)?_I(n):wI(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}class Ch{constructor(e,t=0){Un(this,"id"),this.color=e,this.offset=t,this.id=pI()}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new Ch(this.color.clone(),e)}}class SI{constructor(e){Un(this,"isEmpty",!1),Un(this,"_angle",0),Un(this,"_transitions",[]),this.update(e)}get transitions(){return this._transitions}get canAddTransition(){return this.transitions.length<5}get canRemoveTransition(){return this.transitions.length>2}get angle(){return this._angle}setAngle(e){this._angle=e}setEmpty(e){this.isEmpty=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.isEmpty)return"";const t=this.transitions.map(r=>r.toString());return`linear-gradient(${e??this.angle}deg, ${t.join(", ")})`}isEqual(e){return this.toString()===e}update(e){this._angle=e.angle,this._transitions=e.transitions.map(({color:t,offset:r})=>new Ch(t,r)),this.setEmpty(e.isEmpty)}hasTransition(e){return this.transitions.some(t=>t.id===e.id)}}function xI(n){const e=vI(n);return(e.isGradient?new SI(e):new dI(e)).toString()}function Ny(n){return xI(n)}function Ry(n,e){const t=Di.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r*10)/10}function Ly(n,e){return String(n).includes("em")?Math.round(Ry(n,e)):parseInt(n)}function CI(n,e){return(n.firstElementChild||n).style.fontSize||Di.getComputedStyle(e).fontSize}function EI(n,e,t){if(!n.includes("px"))return n;const r=CI(e,t),i=Ly(r,t);return i?(parseInt(n)/i).toFixed(2):null}function kI(n,e){return String(n).includes("em")?Ry(n,e):parseFloat(n)}const TI={start:wr.LEFT,end:wr.RIGHT};function AI(n){const e=TI[n]||n;return MO.includes(e)?e:null}const Py=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function Dy(n,e){return n.resolve(e).depth+1}function OI(n,e,t,r){const i=Dy(n,r),s=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return s&&a}const MI=(n,e)=>n.eq(e);function II(n,e,t,r=MI){const i=n.resolve(e).path.slice().reverse();for(const s of i)if(typeof s!="number"){for(const a of s.marks)if(r(a,t))return!0}return!1}function NI(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var Vs={exports:{}};var RI=Vs.exports,Fy;function LI(){return Fy||(Fy=1,function(n,e){(function(){var t,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",m=1,y=2,_=4,S=1,E=2,N=1,g=2,v=4,k=8,T=16,A=32,F=64,U=128,W=256,ee=512,te=30,Se="...",vt=800,Sn=16,Ft=1,xn=2,We=3,St=1/0,Xn=9007199254740991,Js=17976931348623157e292,cn=NaN,xt=4294967295,$l=xt-1,Hl=xt>>>1,Wl=[["ary",U],["bind",N],["bindKey",g],["curry",k],["curryRight",T],["flip",ee],["partial",A],["partialRight",F],["rearg",W]],Xt="[object Arguments]",js="[object Array]",Jy="[object AsyncFunction]",Hi="[object Boolean]",Wi="[object Date]",jy="[object DOMException]",Ys="[object Error]",Xs="[object Function]",Th="[object GeneratorFunction]",Zt="[object Map]",Vi="[object Number]",Yy="[object Null]",Cn="[object Object]",Ah="[object Promise]",Xy="[object Proxy]",Ui="[object RegExp]",Qt="[object Set]",qi="[object String]",Zs="[object Symbol]",Zy="[object Undefined]",Ki="[object WeakMap]",Qy="[object WeakSet]",Gi="[object ArrayBuffer]",ei="[object DataView]",Vl="[object Float32Array]",Ul="[object Float64Array]",ql="[object Int8Array]",Kl="[object Int16Array]",Gl="[object Int32Array]",Jl="[object Uint8Array]",jl="[object Uint8ClampedArray]",Yl="[object Uint16Array]",Xl="[object Uint32Array]",eb=/\b__p \+= '';/g,tb=/\b(__p \+=) '' \+/g,nb=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oh=/&(?:amp|lt|gt|quot|#39);/g,Mh=/[&<>"']/g,rb=RegExp(Oh.source),ib=RegExp(Mh.source),sb=/<%-([\s\S]+?)%>/g,ob=/<%([\s\S]+?)%>/g,Ih=/<%=([\s\S]+?)%>/g,ab=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lb=/^\w*$/,ub=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zl=/[\\^$.*+?()[\]{}|]/g,cb=RegExp(Zl.source),Ql=/^\s+/,fb=/\s/,hb=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,db=/\{\n\/\* \[wrapped with (.+)\] \*/,pb=/,? & /,mb=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gb=/[()=,{}\[\]\/\s]/,yb=/\\(\\)?/g,bb=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nh=/\w*$/,_b=/^[-+]0x[0-9a-f]+$/i,wb=/^0b[01]+$/i,vb=/^\[object .+?Constructor\]$/,Sb=/^0o[0-7]+$/i,xb=/^(?:0|[1-9]\d*)$/,Cb=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qs=/($^)/,Eb=/['\n\r\u2028\u2029\\]/g,eo="\\ud800-\\udfff",kb="\\u0300-\\u036f",Tb="\\ufe20-\\ufe2f",Ab="\\u20d0-\\u20ff",Rh=kb+Tb+Ab,Lh="\\u2700-\\u27bf",Ph="a-z\\xdf-\\xf6\\xf8-\\xff",Ob="\\xac\\xb1\\xd7\\xf7",Mb="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ib="\\u2000-\\u206f",Nb=" \\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",Dh="A-Z\\xc0-\\xd6\\xd8-\\xde",Fh="\\ufe0e\\ufe0f",Bh=Ob+Mb+Ib+Nb,eu="['\u2019]",Rb="["+eo+"]",zh="["+Bh+"]",to="["+Rh+"]",$h="\\d+",Lb="["+Lh+"]",Hh="["+Ph+"]",Wh="[^"+eo+Bh+$h+Lh+Ph+Dh+"]",tu="\\ud83c[\\udffb-\\udfff]",Pb="(?:"+to+"|"+tu+")",Vh="[^"+eo+"]",nu="(?:\\ud83c[\\udde6-\\uddff]){2}",ru="[\\ud800-\\udbff][\\udc00-\\udfff]",ti="["+Dh+"]",Uh="\\u200d",qh="(?:"+Hh+"|"+Wh+")",Db="(?:"+ti+"|"+Wh+")",Kh="(?:"+eu+"(?:d|ll|m|re|s|t|ve))?",Gh="(?:"+eu+"(?:D|LL|M|RE|S|T|VE))?",Jh=Pb+"?",jh="["+Fh+"]?",Fb="(?:"+Uh+"(?:"+[Vh,nu,ru].join("|")+")"+jh+Jh+")*",Bb="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zb="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yh=jh+Jh+Fb,$b="(?:"+[Lb,nu,ru].join("|")+")"+Yh,Hb="(?:"+[Vh+to+"?",to,nu,ru,Rb].join("|")+")",Wb=RegExp(eu,"g"),Vb=RegExp(to,"g"),iu=RegExp(tu+"(?="+tu+")|"+Hb+Yh,"g"),Ub=RegExp([ti+"?"+Hh+"+"+Kh+"(?="+[zh,ti,"$"].join("|")+")",Db+"+"+Gh+"(?="+[zh,ti+qh,"$"].join("|")+")",ti+"?"+qh+"+"+Kh,ti+"+"+Gh,zb,Bb,$h,$b].join("|"),"g"),qb=RegExp("["+Uh+eo+Rh+Fh+"]"),Kb=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gb=["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"],Jb=-1,Ee={};Ee[Vl]=Ee[Ul]=Ee[ql]=Ee[Kl]=Ee[Gl]=Ee[Jl]=Ee[jl]=Ee[Yl]=Ee[Xl]=!0,Ee[Xt]=Ee[js]=Ee[Gi]=Ee[Hi]=Ee[ei]=Ee[Wi]=Ee[Ys]=Ee[Xs]=Ee[Zt]=Ee[Vi]=Ee[Cn]=Ee[Ui]=Ee[Qt]=Ee[qi]=Ee[Ki]=!1;var Ce={};Ce[Xt]=Ce[js]=Ce[Gi]=Ce[ei]=Ce[Hi]=Ce[Wi]=Ce[Vl]=Ce[Ul]=Ce[ql]=Ce[Kl]=Ce[Gl]=Ce[Zt]=Ce[Vi]=Ce[Cn]=Ce[Ui]=Ce[Qt]=Ce[qi]=Ce[Zs]=Ce[Jl]=Ce[jl]=Ce[Yl]=Ce[Xl]=!0,Ce[Ys]=Ce[Xs]=Ce[Ki]=!1;var jb={\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"},Yb={"&":"&","<":"<",">":">",'"':""","'":"'"},Xb={"&":"&","<":"<",">":">",""":'"',"'":"'"},Zb={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qb=parseFloat,e2=parseInt,Xh=typeof Wo=="object"&&Wo&&Wo.Object===Object&&Wo,t2=typeof self=="object"&&self&&self.Object===Object&&self,Xe=Xh||t2||Function("return this")(),su=e&&!e.nodeType&&e,Or=su&&!0&&n&&!n.nodeType&&n,Zh=Or&&Or.exports===su,ou=Zh&&Xh.process,Bt=function(){try{var M=Or&&Or.require&&Or.require("util").types;return M||ou&&ou.binding&&ou.binding("util")}catch{}}(),Qh=Bt&&Bt.isArrayBuffer,ed=Bt&&Bt.isDate,td=Bt&&Bt.isMap,nd=Bt&&Bt.isRegExp,rd=Bt&&Bt.isSet,id=Bt&&Bt.isTypedArray;function Ct(M,L,R){switch(R.length){case 0:return M.call(L);case 1:return M.call(L,R[0]);case 2:return M.call(L,R[0],R[1]);case 3:return M.call(L,R[0],R[1],R[2])}return M.apply(L,R)}function n2(M,L,R,G){for(var ne=-1,be=M==null?0:M.length;++ne<be;){var Be=M[ne];L(G,Be,R(Be),M)}return G}function zt(M,L){for(var R=-1,G=M==null?0:M.length;++R<G&&L(M[R],R,M)!==!1;);return M}function r2(M,L){for(var R=M==null?0:M.length;R--&&L(M[R],R,M)!==!1;);return M}function sd(M,L){for(var R=-1,G=M==null?0:M.length;++R<G;)if(!L(M[R],R,M))return!1;return!0}function Zn(M,L){for(var R=-1,G=M==null?0:M.length,ne=0,be=[];++R<G;){var Be=M[R];L(Be,R,M)&&(be[ne++]=Be)}return be}function no(M,L){var R=M==null?0:M.length;return!!R&&ni(M,L,0)>-1}function au(M,L,R){for(var G=-1,ne=M==null?0:M.length;++G<ne;)if(R(L,M[G]))return!0;return!1}function Ae(M,L){for(var R=-1,G=M==null?0:M.length,ne=Array(G);++R<G;)ne[R]=L(M[R],R,M);return ne}function Qn(M,L){for(var R=-1,G=L.length,ne=M.length;++R<G;)M[ne+R]=L[R];return M}function lu(M,L,R,G){var ne=-1,be=M==null?0:M.length;for(G&&be&&(R=M[++ne]);++ne<be;)R=L(R,M[ne],ne,M);return R}function i2(M,L,R,G){var ne=M==null?0:M.length;for(G&&ne&&(R=M[--ne]);ne--;)R=L(R,M[ne],ne,M);return R}function uu(M,L){for(var R=-1,G=M==null?0:M.length;++R<G;)if(L(M[R],R,M))return!0;return!1}var s2=cu("length");function o2(M){return M.split("")}function a2(M){return M.match(mb)||[]}function od(M,L,R){var G;return R(M,function(ne,be,Be){if(L(ne,be,Be))return G=be,!1}),G}function ro(M,L,R,G){for(var ne=M.length,be=R+(G?1:-1);G?be--:++be<ne;)if(L(M[be],be,M))return be;return-1}function ni(M,L,R){return L===L?_2(M,L,R):ro(M,ad,R)}function l2(M,L,R,G){for(var ne=R-1,be=M.length;++ne<be;)if(G(M[ne],L))return ne;return-1}function ad(M){return M!==M}function ld(M,L){var R=M==null?0:M.length;return R?hu(M,L)/R:cn}function cu(M){return function(L){return L==null?t:L[M]}}function fu(M){return function(L){return M==null?t:M[L]}}function ud(M,L,R,G,ne){return ne(M,function(be,Be,xe){R=G?(G=!1,be):L(R,be,Be,xe)}),R}function u2(M,L){var R=M.length;for(M.sort(L);R--;)M[R]=M[R].value;return M}function hu(M,L){for(var R,G=-1,ne=M.length;++G<ne;){var be=L(M[G]);be!==t&&(R=R===t?be:R+be)}return R}function du(M,L){for(var R=-1,G=Array(M);++R<M;)G[R]=L(R);return G}function c2(M,L){return Ae(L,function(R){return[R,M[R]]})}function cd(M){return M&&M.slice(0,pd(M)+1).replace(Ql,"")}function Et(M){return function(L){return M(L)}}function pu(M,L){return Ae(L,function(R){return M[R]})}function Ji(M,L){return M.has(L)}function fd(M,L){for(var R=-1,G=M.length;++R<G&&ni(L,M[R],0)>-1;);return R}function hd(M,L){for(var R=M.length;R--&&ni(L,M[R],0)>-1;);return R}function f2(M,L){for(var R=M.length,G=0;R--;)M[R]===L&&++G;return G}var h2=fu(jb),d2=fu(Yb);function p2(M){return"\\"+Zb[M]}function m2(M,L){return M==null?t:M[L]}function ri(M){return qb.test(M)}function g2(M){return Kb.test(M)}function y2(M){for(var L,R=[];!(L=M.next()).done;)R.push(L.value);return R}function mu(M){var L=-1,R=Array(M.size);return M.forEach(function(G,ne){R[++L]=[ne,G]}),R}function dd(M,L){return function(R){return M(L(R))}}function er(M,L){for(var R=-1,G=M.length,ne=0,be=[];++R<G;){var Be=M[R];(Be===L||Be===p)&&(M[R]=p,be[ne++]=R)}return be}function io(M){var L=-1,R=Array(M.size);return M.forEach(function(G){R[++L]=G}),R}function b2(M){var L=-1,R=Array(M.size);return M.forEach(function(G){R[++L]=[G,G]}),R}function _2(M,L,R){for(var G=R-1,ne=M.length;++G<ne;)if(M[G]===L)return G;return-1}function w2(M,L,R){for(var G=R+1;G--;)if(M[G]===L)return G;return G}function ii(M){return ri(M)?S2(M):s2(M)}function en(M){return ri(M)?x2(M):o2(M)}function pd(M){for(var L=M.length;L--&&fb.test(M.charAt(L)););return L}var v2=fu(Xb);function S2(M){for(var L=iu.lastIndex=0;iu.test(M);)++L;return L}function x2(M){return M.match(iu)||[]}function C2(M){return M.match(Ub)||[]}var E2=function M(L){L=L==null?Xe:si.defaults(Xe.Object(),L,si.pick(Xe,Gb));var R=L.Array,G=L.Date,ne=L.Error,be=L.Function,Be=L.Math,xe=L.Object,gu=L.RegExp,k2=L.String,$t=L.TypeError,so=R.prototype,T2=be.prototype,oi=xe.prototype,oo=L["__core-js_shared__"],ao=T2.toString,ve=oi.hasOwnProperty,A2=0,md=function(){var o=/[^.]+$/.exec(oo&&oo.keys&&oo.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),lo=oi.toString,O2=ao.call(xe),M2=Xe._,I2=gu("^"+ao.call(ve).replace(Zl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uo=Zh?L.Buffer:t,tr=L.Symbol,co=L.Uint8Array,gd=uo?uo.allocUnsafe:t,fo=dd(xe.getPrototypeOf,xe),yd=xe.create,bd=oi.propertyIsEnumerable,ho=so.splice,_d=tr?tr.isConcatSpreadable:t,ji=tr?tr.iterator:t,Mr=tr?tr.toStringTag:t,po=function(){try{var o=Pr(xe,"defineProperty");return o({},"",{}),o}catch{}}(),N2=L.clearTimeout!==Xe.clearTimeout&&L.clearTimeout,R2=G&&G.now!==Xe.Date.now&&G.now,L2=L.setTimeout!==Xe.setTimeout&&L.setTimeout,mo=Be.ceil,go=Be.floor,yu=xe.getOwnPropertySymbols,P2=uo?uo.isBuffer:t,wd=L.isFinite,D2=so.join,F2=dd(xe.keys,xe),ze=Be.max,nt=Be.min,B2=G.now,z2=L.parseInt,vd=Be.random,$2=so.reverse,bu=Pr(L,"DataView"),Yi=Pr(L,"Map"),_u=Pr(L,"Promise"),ai=Pr(L,"Set"),Xi=Pr(L,"WeakMap"),Zi=Pr(xe,"create"),yo=Xi&&new Xi,li={},H2=Dr(bu),W2=Dr(Yi),V2=Dr(_u),U2=Dr(ai),q2=Dr(Xi),bo=tr?tr.prototype:t,Qi=bo?bo.valueOf:t,Sd=bo?bo.toString:t;function w(o){if(Ie(o)&&!re(o)&&!(o instanceof fe)){if(o instanceof Ht)return o;if(ve.call(o,"__wrapped__"))return xp(o)}return new Ht(o)}var ui=function(){function o(){}return function(l){if(!Me(l))return{};if(yd)return yd(l);o.prototype=l;var f=new o;return o.prototype=t,f}}();function _o(){}function Ht(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}w.templateSettings={escape:sb,evaluate:ob,interpolate:Ih,variable:"",imports:{_:w}},w.prototype=_o.prototype,w.prototype.constructor=w,Ht.prototype=ui(_o.prototype),Ht.prototype.constructor=Ht;function fe(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=xt,this.__views__=[]}function K2(){var o=new fe(this.__wrapped__);return o.__actions__=ht(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=ht(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=ht(this.__views__),o}function G2(){if(this.__filtered__){var o=new fe(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function J2(){var o=this.__wrapped__.value(),l=this.__dir__,f=re(o),d=l<0,b=f?o.length:0,x=ow(0,b,this.__views__),C=x.start,O=x.end,I=O-C,P=d?O:C-1,D=this.__iteratees__,B=D.length,q=0,j=nt(I,this.__takeCount__);if(!f||!d&&b==I&&j==I)return Kd(o,this.__actions__);var X=[];e:for(;I--&&q<j;){P+=l;for(var se=-1,Z=o[P];++se<B;){var ce=D[se],me=ce.iteratee,At=ce.type,ot=me(Z);if(At==xn)Z=ot;else if(!ot){if(At==Ft)continue e;break e}}X[q++]=Z}return X}fe.prototype=ui(_o.prototype),fe.prototype.constructor=fe;function Ir(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var d=o[l];this.set(d[0],d[1])}}function j2(){this.__data__=Zi?Zi(null):{},this.size=0}function Y2(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function X2(o){var l=this.__data__;if(Zi){var f=l[o];return f===c?t:f}return ve.call(l,o)?l[o]:t}function Z2(o){var l=this.__data__;return Zi?l[o]!==t:ve.call(l,o)}function Q2(o,l){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=Zi&&l===t?c:l,this}Ir.prototype.clear=j2,Ir.prototype.delete=Y2,Ir.prototype.get=X2,Ir.prototype.has=Z2,Ir.prototype.set=Q2;function En(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var d=o[l];this.set(d[0],d[1])}}function e_(){this.__data__=[],this.size=0}function t_(o){var l=this.__data__,f=wo(l,o);if(f<0)return!1;var d=l.length-1;return f==d?l.pop():ho.call(l,f,1),--this.size,!0}function n_(o){var l=this.__data__,f=wo(l,o);return f<0?t:l[f][1]}function r_(o){return wo(this.__data__,o)>-1}function i_(o,l){var f=this.__data__,d=wo(f,o);return d<0?(++this.size,f.push([o,l])):f[d][1]=l,this}En.prototype.clear=e_,En.prototype.delete=t_,En.prototype.get=n_,En.prototype.has=r_,En.prototype.set=i_;function kn(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var d=o[l];this.set(d[0],d[1])}}function s_(){this.size=0,this.__data__={hash:new Ir,map:new(Yi||En),string:new Ir}}function o_(o){var l=No(this,o).delete(o);return this.size-=l?1:0,l}function a_(o){return No(this,o).get(o)}function l_(o){return No(this,o).has(o)}function u_(o,l){var f=No(this,o),d=f.size;return f.set(o,l),this.size+=f.size==d?0:1,this}kn.prototype.clear=s_,kn.prototype.delete=o_,kn.prototype.get=a_,kn.prototype.has=l_,kn.prototype.set=u_;function Nr(o){var l=-1,f=o==null?0:o.length;for(this.__data__=new kn;++l<f;)this.add(o[l])}function c_(o){return this.__data__.set(o,c),this}function f_(o){return this.__data__.has(o)}Nr.prototype.add=Nr.prototype.push=c_,Nr.prototype.has=f_;function tn(o){var l=this.__data__=new En(o);this.size=l.size}function h_(){this.__data__=new En,this.size=0}function d_(o){var l=this.__data__,f=l.delete(o);return this.size=l.size,f}function p_(o){return this.__data__.get(o)}function m_(o){return this.__data__.has(o)}function g_(o,l){var f=this.__data__;if(f instanceof En){var d=f.__data__;if(!Yi||d.length<i-1)return d.push([o,l]),this.size=++f.size,this;f=this.__data__=new kn(d)}return f.set(o,l),this.size=f.size,this}tn.prototype.clear=h_,tn.prototype.delete=d_,tn.prototype.get=p_,tn.prototype.has=m_,tn.prototype.set=g_;function xd(o,l){var f=re(o),d=!f&&Fr(o),b=!f&&!d&&or(o),x=!f&&!d&&!b&&di(o),C=f||d||b||x,O=C?du(o.length,k2):[],I=O.length;for(var P in o)(l||ve.call(o,P))&&!(C&&(P=="length"||b&&(P=="offset"||P=="parent")||x&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||Mn(P,I)))&&O.push(P);return O}function Cd(o){var l=o.length;return l?o[Mu(0,l-1)]:t}function y_(o,l){return Ro(ht(o),Rr(l,0,o.length))}function b_(o){return Ro(ht(o))}function wu(o,l,f){(f!==t&&!nn(o[l],f)||f===t&&!(l in o))&&Tn(o,l,f)}function es(o,l,f){var d=o[l];(!(ve.call(o,l)&&nn(d,f))||f===t&&!(l in o))&&Tn(o,l,f)}function wo(o,l){for(var f=o.length;f--;)if(nn(o[f][0],l))return f;return-1}function __(o,l,f,d){return nr(o,function(b,x,C){l(d,b,f(b),C)}),d}function Ed(o,l){return o&&hn(l,Ve(l),o)}function w_(o,l){return o&&hn(l,pt(l),o)}function Tn(o,l,f){l=="__proto__"&&po?po(o,l,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[l]=f}function vu(o,l){for(var f=-1,d=l.length,b=R(d),x=o==null;++f<d;)b[f]=x?t:tc(o,l[f]);return b}function Rr(o,l,f){return o===o&&(f!==t&&(o=o<=f?o:f),l!==t&&(o=o>=l?o:l)),o}function Wt(o,l,f,d,b,x){var C,O=l&m,I=l&y,P=l&_;if(f&&(C=b?f(o,d,b,x):f(o)),C!==t)return C;if(!Me(o))return o;var D=re(o);if(D){if(C=lw(o),!O)return ht(o,C)}else{var B=rt(o),q=B==Xs||B==Th;if(or(o))return jd(o,O);if(B==Cn||B==Xt||q&&!b){if(C=I||q?{}:pp(o),!O)return I?X_(o,w_(C,o)):Y_(o,Ed(C,o))}else{if(!Ce[B])return b?o:{};C=uw(o,B,O)}}x||(x=new tn);var j=x.get(o);if(j)return j;x.set(o,C),Vp(o)?o.forEach(function(Z){C.add(Wt(Z,l,f,Z,o,x))}):Hp(o)&&o.forEach(function(Z,ce){C.set(ce,Wt(Z,l,f,ce,o,x))});var X=P?I?Hu:$u:I?pt:Ve,se=D?t:X(o);return zt(se||o,function(Z,ce){se&&(ce=Z,Z=o[ce]),es(C,ce,Wt(Z,l,f,ce,o,x))}),C}function v_(o){var l=Ve(o);return function(f){return kd(f,o,l)}}function kd(o,l,f){var d=f.length;if(o==null)return!d;for(o=xe(o);d--;){var b=f[d],x=l[b],C=o[b];if(C===t&&!(b in o)||!x(C))return!1}return!0}function Td(o,l,f){if(typeof o!="function")throw new $t(a);return ls(function(){o.apply(t,f)},l)}function ts(o,l,f,d){var b=-1,x=no,C=!0,O=o.length,I=[],P=l.length;if(!O)return I;f&&(l=Ae(l,Et(f))),d?(x=au,C=!1):l.length>=i&&(x=Ji,C=!1,l=new Nr(l));e:for(;++b<O;){var D=o[b],B=f==null?D:f(D);if(D=d||D!==0?D:0,C&&B===B){for(var q=P;q--;)if(l[q]===B)continue e;I.push(D)}else x(l,B,d)||I.push(D)}return I}var nr=ep(fn),Ad=ep(xu,!0);function S_(o,l){var f=!0;return nr(o,function(d,b,x){return f=!!l(d,b,x),f}),f}function vo(o,l,f){for(var d=-1,b=o.length;++d<b;){var x=o[d],C=l(x);if(C!=null&&(O===t?C===C&&!Tt(C):f(C,O)))var O=C,I=x}return I}function x_(o,l,f,d){var b=o.length;for(f=ie(f),f<0&&(f=-f>b?0:b+f),d=d===t||d>b?b:ie(d),d<0&&(d+=b),d=f>d?0:qp(d);f<d;)o[f++]=l;return o}function Od(o,l){var f=[];return nr(o,function(d,b,x){l(d,b,x)&&f.push(d)}),f}function Ze(o,l,f,d,b){var x=-1,C=o.length;for(f||(f=fw),b||(b=[]);++x<C;){var O=o[x];l>0&&f(O)?l>1?Ze(O,l-1,f,d,b):Qn(b,O):d||(b[b.length]=O)}return b}var Su=tp(),Md=tp(!0);function fn(o,l){return o&&Su(o,l,Ve)}function xu(o,l){return o&&Md(o,l,Ve)}function So(o,l){return Zn(l,function(f){return In(o[f])})}function Lr(o,l){l=ir(l,o);for(var f=0,d=l.length;o!=null&&f<d;)o=o[dn(l[f++])];return f&&f==d?o:t}function Id(o,l,f){var d=l(o);return re(o)?d:Qn(d,f(o))}function it(o){return o==null?o===t?Zy:Yy:Mr&&Mr in xe(o)?sw(o):bw(o)}function Cu(o,l){return o>l}function C_(o,l){return o!=null&&ve.call(o,l)}function E_(o,l){return o!=null&&l in xe(o)}function k_(o,l,f){return o>=nt(l,f)&&o<ze(l,f)}function Eu(o,l,f){for(var d=f?au:no,b=o[0].length,x=o.length,C=x,O=R(x),I=1/0,P=[];C--;){var D=o[C];C&&l&&(D=Ae(D,Et(l))),I=nt(D.length,I),O[C]=!f&&(l||b>=120&&D.length>=120)?new Nr(C&&D):t}D=o[0];var B=-1,q=O[0];e:for(;++B<b&&P.length<I;){var j=D[B],X=l?l(j):j;if(j=f||j!==0?j:0,!(q?Ji(q,X):d(P,X,f))){for(C=x;--C;){var se=O[C];if(!(se?Ji(se,X):d(o[C],X,f)))continue e}q&&q.push(X),P.push(j)}}return P}function T_(o,l,f,d){return fn(o,function(b,x,C){l(d,f(b),x,C)}),d}function ns(o,l,f){l=ir(l,o),o=bp(o,l);var d=o==null?o:o[dn(Ut(l))];return d==null?t:Ct(d,o,f)}function Nd(o){return Ie(o)&&it(o)==Xt}function A_(o){return Ie(o)&&it(o)==Gi}function O_(o){return Ie(o)&&it(o)==Wi}function rs(o,l,f,d,b){return o===l?!0:o==null||l==null||!Ie(o)&&!Ie(l)?o!==o&&l!==l:M_(o,l,f,d,rs,b)}function M_(o,l,f,d,b,x){var C=re(o),O=re(l),I=C?js:rt(o),P=O?js:rt(l);I=I==Xt?Cn:I,P=P==Xt?Cn:P;var D=I==Cn,B=P==Cn,q=I==P;if(q&&or(o)){if(!or(l))return!1;C=!0,D=!1}if(q&&!D)return x||(x=new tn),C||di(o)?fp(o,l,f,d,b,x):rw(o,l,I,f,d,b,x);if(!(f&S)){var j=D&&ve.call(o,"__wrapped__"),X=B&&ve.call(l,"__wrapped__");if(j||X){var se=j?o.value():o,Z=X?l.value():l;return x||(x=new tn),b(se,Z,f,d,x)}}return q?(x||(x=new tn),iw(o,l,f,d,b,x)):!1}function I_(o){return Ie(o)&&rt(o)==Zt}function ku(o,l,f,d){var b=f.length,x=b,C=!d;if(o==null)return!x;for(o=xe(o);b--;){var O=f[b];if(C&&O[2]?O[1]!==o[O[0]]:!(O[0]in o))return!1}for(;++b<x;){O=f[b];var I=O[0],P=o[I],D=O[1];if(C&&O[2]){if(P===t&&!(I in o))return!1}else{var B=new tn;if(d)var q=d(P,D,I,o,l,B);if(!(q===t?rs(D,P,S|E,d,B):q))return!1}}return!0}function Rd(o){if(!Me(o)||dw(o))return!1;var l=In(o)?I2:vb;return l.test(Dr(o))}function N_(o){return Ie(o)&&it(o)==Ui}function R_(o){return Ie(o)&&rt(o)==Qt}function L_(o){return Ie(o)&&zo(o.length)&&!!Ee[it(o)]}function Ld(o){return typeof o=="function"?o:o==null?mt:typeof o=="object"?re(o)?Fd(o[0],o[1]):Dd(o):nm(o)}function Tu(o){if(!as(o))return F2(o);var l=[];for(var f in xe(o))ve.call(o,f)&&f!="constructor"&&l.push(f);return l}function P_(o){if(!Me(o))return yw(o);var l=as(o),f=[];for(var d in o)d=="constructor"&&(l||!ve.call(o,d))||f.push(d);return f}function Au(o,l){return o<l}function Pd(o,l){var f=-1,d=dt(o)?R(o.length):[];return nr(o,function(b,x,C){d[++f]=l(b,x,C)}),d}function Dd(o){var l=Vu(o);return l.length==1&&l[0][2]?gp(l[0][0],l[0][1]):function(f){return f===o||ku(f,o,l)}}function Fd(o,l){return qu(o)&&mp(l)?gp(dn(o),l):function(f){var d=tc(f,o);return d===t&&d===l?nc(f,o):rs(l,d,S|E)}}function xo(o,l,f,d,b){o!==l&&Su(l,function(x,C){if(b||(b=new tn),Me(x))D_(o,l,C,f,xo,d,b);else{var O=d?d(Gu(o,C),x,C+"",o,l,b):t;O===t&&(O=x),wu(o,C,O)}},pt)}function D_(o,l,f,d,b,x,C){var O=Gu(o,f),I=Gu(l,f),P=C.get(I);if(P){wu(o,f,P);return}var D=x?x(O,I,f+"",o,l,C):t,B=D===t;if(B){var q=re(I),j=!q&&or(I),X=!q&&!j&&di(I);D=I,q||j||X?re(O)?D=O:Le(O)?D=ht(O):j?(B=!1,D=jd(I,!0)):X?(B=!1,D=Yd(I,!0)):D=[]:us(I)||Fr(I)?(D=O,Fr(O)?D=Kp(O):(!Me(O)||In(O))&&(D=pp(I))):B=!1}B&&(C.set(I,D),b(D,I,d,x,C),C.delete(I)),wu(o,f,D)}function Bd(o,l){var f=o.length;if(f)return l+=l<0?f:0,Mn(l,f)?o[l]:t}function zd(o,l,f){l.length?l=Ae(l,function(x){return re(x)?function(C){return Lr(C,x.length===1?x[0]:x)}:x}):l=[mt];var d=-1;l=Ae(l,Et(Y()));var b=Pd(o,function(x,C,O){var I=Ae(l,function(P){return P(x)});return{criteria:I,index:++d,value:x}});return u2(b,function(x,C){return j_(x,C,f)})}function F_(o,l){return $d(o,l,function(f,d){return nc(o,d)})}function $d(o,l,f){for(var d=-1,b=l.length,x={};++d<b;){var C=l[d],O=Lr(o,C);f(O,C)&&is(x,ir(C,o),O)}return x}function B_(o){return function(l){return Lr(l,o)}}function Ou(o,l,f,d){var b=d?l2:ni,x=-1,C=l.length,O=o;for(o===l&&(l=ht(l)),f&&(O=Ae(o,Et(f)));++x<C;)for(var I=0,P=l[x],D=f?f(P):P;(I=b(O,D,I,d))>-1;)O!==o&&ho.call(O,I,1),ho.call(o,I,1);return o}function Hd(o,l){for(var f=o?l.length:0,d=f-1;f--;){var b=l[f];if(f==d||b!==x){var x=b;Mn(b)?ho.call(o,b,1):Ru(o,b)}}return o}function Mu(o,l){return o+go(vd()*(l-o+1))}function z_(o,l,f,d){for(var b=-1,x=ze(mo((l-o)/(f||1)),0),C=R(x);x--;)C[d?x:++b]=o,o+=f;return C}function Iu(o,l){var f="";if(!o||l<1||l>Xn)return f;do l%2&&(f+=o),l=go(l/2),l&&(o+=o);while(l);return f}function ue(o,l){return Ju(yp(o,l,mt),o+"")}function $_(o){return Cd(pi(o))}function H_(o,l){var f=pi(o);return Ro(f,Rr(l,0,f.length))}function is(o,l,f,d){if(!Me(o))return o;l=ir(l,o);for(var b=-1,x=l.length,C=x-1,O=o;O!=null&&++b<x;){var I=dn(l[b]),P=f;if(I==="__proto__"||I==="constructor"||I==="prototype")return o;if(b!=C){var D=O[I];P=d?d(D,I,O):t,P===t&&(P=Me(D)?D:Mn(l[b+1])?[]:{})}es(O,I,P),O=O[I]}return o}var Wd=yo?function(o,l){return yo.set(o,l),o}:mt,W_=po?function(o,l){return po(o,"toString",{configurable:!0,enumerable:!1,value:ic(l),writable:!0})}:mt;function V_(o){return Ro(pi(o))}function Vt(o,l,f){var d=-1,b=o.length;l<0&&(l=-l>b?0:b+l),f=f>b?b:f,f<0&&(f+=b),b=l>f?0:f-l>>>0,l>>>=0;for(var x=R(b);++d<b;)x[d]=o[d+l];return x}function U_(o,l){var f;return nr(o,function(d,b,x){return f=l(d,b,x),!f}),!!f}function Co(o,l,f){var d=0,b=o==null?d:o.length;if(typeof l=="number"&&l===l&&b<=Hl){for(;d<b;){var x=d+b>>>1,C=o[x];C!==null&&!Tt(C)&&(f?C<=l:C<l)?d=x+1:b=x}return b}return Nu(o,l,mt,f)}function Nu(o,l,f,d){var b=0,x=o==null?0:o.length;if(x===0)return 0;l=f(l);for(var C=l!==l,O=l===null,I=Tt(l),P=l===t;b<x;){var D=go((b+x)/2),B=f(o[D]),q=B!==t,j=B===null,X=B===B,se=Tt(B);if(C)var Z=d||X;else P?Z=X&&(d||q):O?Z=X&&q&&(d||!j):I?Z=X&&q&&!j&&(d||!se):j||se?Z=!1:Z=d?B<=l:B<l;Z?b=D+1:x=D}return nt(x,$l)}function Vd(o,l){for(var f=-1,d=o.length,b=0,x=[];++f<d;){var C=o[f],O=l?l(C):C;if(!f||!nn(O,I)){var I=O;x[b++]=C===0?0:C}}return x}function Ud(o){return typeof o=="number"?o:Tt(o)?cn:+o}function kt(o){if(typeof o=="string")return o;if(re(o))return Ae(o,kt)+"";if(Tt(o))return Sd?Sd.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}function rr(o,l,f){var d=-1,b=no,x=o.length,C=!0,O=[],I=O;if(f)C=!1,b=au;else if(x>=i){var P=l?null:tw(o);if(P)return io(P);C=!1,b=Ji,I=new Nr}else I=l?[]:O;e:for(;++d<x;){var D=o[d],B=l?l(D):D;if(D=f||D!==0?D:0,C&&B===B){for(var q=I.length;q--;)if(I[q]===B)continue e;l&&I.push(B),O.push(D)}else b(I,B,f)||(I!==O&&I.push(B),O.push(D))}return O}function Ru(o,l){return l=ir(l,o),o=bp(o,l),o==null||delete o[dn(Ut(l))]}function qd(o,l,f,d){return is(o,l,f(Lr(o,l)),d)}function Eo(o,l,f,d){for(var b=o.length,x=d?b:-1;(d?x--:++x<b)&&l(o[x],x,o););return f?Vt(o,d?0:x,d?x+1:b):Vt(o,d?x+1:0,d?b:x)}function Kd(o,l){var f=o;return f instanceof fe&&(f=f.value()),lu(l,function(d,b){return b.func.apply(b.thisArg,Qn([d],b.args))},f)}function Lu(o,l,f){var d=o.length;if(d<2)return d?rr(o[0]):[];for(var b=-1,x=R(d);++b<d;)for(var C=o[b],O=-1;++O<d;)O!=b&&(x[b]=ts(x[b]||C,o[O],l,f));return rr(Ze(x,1),l,f)}function Gd(o,l,f){for(var d=-1,b=o.length,x=l.length,C={};++d<b;){var O=d<x?l[d]:t;f(C,o[d],O)}return C}function Pu(o){return Le(o)?o:[]}function Du(o){return typeof o=="function"?o:mt}function ir(o,l){return re(o)?o:qu(o,l)?[o]:Sp(_e(o))}var q_=ue;function sr(o,l,f){var d=o.length;return f=f===t?d:f,!l&&f>=d?o:Vt(o,l,f)}var Jd=N2||function(o){return Xe.clearTimeout(o)};function jd(o,l){if(l)return o.slice();var f=o.length,d=gd?gd(f):new o.constructor(f);return o.copy(d),d}function Fu(o){var l=new o.constructor(o.byteLength);return new co(l).set(new co(o)),l}function K_(o,l){var f=l?Fu(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function G_(o){var l=new o.constructor(o.source,Nh.exec(o));return l.lastIndex=o.lastIndex,l}function J_(o){return Qi?xe(Qi.call(o)):{}}function Yd(o,l){var f=l?Fu(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function Xd(o,l){if(o!==l){var f=o!==t,d=o===null,b=o===o,x=Tt(o),C=l!==t,O=l===null,I=l===l,P=Tt(l);if(!O&&!P&&!x&&o>l||x&&C&&I&&!O&&!P||d&&C&&I||!f&&I||!b)return 1;if(!d&&!x&&!P&&o<l||P&&f&&b&&!d&&!x||O&&f&&b||!C&&b||!I)return-1}return 0}function j_(o,l,f){for(var d=-1,b=o.criteria,x=l.criteria,C=b.length,O=f.length;++d<C;){var I=Xd(b[d],x[d]);if(I){if(d>=O)return I;var P=f[d];return I*(P=="desc"?-1:1)}}return o.index-l.index}function Zd(o,l,f,d){for(var b=-1,x=o.length,C=f.length,O=-1,I=l.length,P=ze(x-C,0),D=R(I+P),B=!d;++O<I;)D[O]=l[O];for(;++b<C;)(B||b<x)&&(D[f[b]]=o[b]);for(;P--;)D[O++]=o[b++];return D}function Qd(o,l,f,d){for(var b=-1,x=o.length,C=-1,O=f.length,I=-1,P=l.length,D=ze(x-O,0),B=R(D+P),q=!d;++b<D;)B[b]=o[b];for(var j=b;++I<P;)B[j+I]=l[I];for(;++C<O;)(q||b<x)&&(B[j+f[C]]=o[b++]);return B}function ht(o,l){var f=-1,d=o.length;for(l||(l=R(d));++f<d;)l[f]=o[f];return l}function hn(o,l,f,d){var b=!f;f||(f={});for(var x=-1,C=l.length;++x<C;){var O=l[x],I=d?d(f[O],o[O],O,f,o):t;I===t&&(I=o[O]),b?Tn(f,O,I):es(f,O,I)}return f}function Y_(o,l){return hn(o,Uu(o),l)}function X_(o,l){return hn(o,hp(o),l)}function ko(o,l){return function(f,d){var b=re(f)?n2:__,x=l?l():{};return b(f,o,Y(d,2),x)}}function ci(o){return ue(function(l,f){var d=-1,b=f.length,x=b>1?f[b-1]:t,C=b>2?f[2]:t;for(x=o.length>3&&typeof x=="function"?(b--,x):t,C&&st(f[0],f[1],C)&&(x=b<3?t:x,b=1),l=xe(l);++d<b;){var O=f[d];O&&o(l,O,d,x)}return l})}function ep(o,l){return function(f,d){if(f==null)return f;if(!dt(f))return o(f,d);for(var b=f.length,x=l?b:-1,C=xe(f);(l?x--:++x<b)&&d(C[x],x,C)!==!1;);return f}}function tp(o){return function(l,f,d){for(var b=-1,x=xe(l),C=d(l),O=C.length;O--;){var I=C[o?O:++b];if(f(x[I],I,x)===!1)break}return l}}function Z_(o,l,f){var d=l&N,b=ss(o);function x(){var C=this&&this!==Xe&&this instanceof x?b:o;return C.apply(d?f:this,arguments)}return x}function np(o){return function(l){l=_e(l);var f=ri(l)?en(l):t,d=f?f[0]:l.charAt(0),b=f?sr(f,1).join(""):l.slice(1);return d[o]()+b}}function fi(o){return function(l){return lu(em(Qp(l).replace(Wb,"")),o,"")}}function ss(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var f=ui(o.prototype),d=o.apply(f,l);return Me(d)?d:f}}function Q_(o,l,f){var d=ss(o);function b(){for(var x=arguments.length,C=R(x),O=x,I=hi(b);O--;)C[O]=arguments[O];var P=x<3&&C[0]!==I&&C[x-1]!==I?[]:er(C,I);if(x-=P.length,x<f)return ap(o,l,To,b.placeholder,t,C,P,t,t,f-x);var D=this&&this!==Xe&&this instanceof b?d:o;return Ct(D,this,C)}return b}function rp(o){return function(l,f,d){var b=xe(l);if(!dt(l)){var x=Y(f,3);l=Ve(l),f=function(O){return x(b[O],O,b)}}var C=o(l,f,d);return C>-1?b[x?l[C]:C]:t}}function ip(o){return On(function(l){var f=l.length,d=f,b=Ht.prototype.thru;for(o&&l.reverse();d--;){var x=l[d];if(typeof x!="function")throw new $t(a);if(b&&!C&&Io(x)=="wrapper")var C=new Ht([],!0)}for(d=C?d:f;++d<f;){x=l[d];var O=Io(x),I=O=="wrapper"?Wu(x):t;I&&Ku(I[0])&&I[1]==(U|k|A|W)&&!I[4].length&&I[9]==1?C=C[Io(I[0])].apply(C,I[3]):C=x.length==1&&Ku(x)?C[O]():C.thru(x)}return function(){var P=arguments,D=P[0];if(C&&P.length==1&&re(D))return C.plant(D).value();for(var B=0,q=f?l[B].apply(this,P):D;++B<f;)q=l[B].call(this,q);return q}})}function To(o,l,f,d,b,x,C,O,I,P){var D=l&U,B=l&N,q=l&g,j=l&(k|T),X=l&ee,se=q?t:ss(o);function Z(){for(var ce=arguments.length,me=R(ce),At=ce;At--;)me[At]=arguments[At];if(j)var ot=hi(Z),Ot=f2(me,ot);if(d&&(me=Zd(me,d,b,j)),x&&(me=Qd(me,x,C,j)),ce-=Ot,j&&ce<P){var Pe=er(me,ot);return ap(o,l,To,Z.placeholder,f,me,Pe,O,I,P-ce)}var rn=B?f:this,Rn=q?rn[o]:o;return ce=me.length,O?me=_w(me,O):X&&ce>1&&me.reverse(),D&&I<ce&&(me.length=I),this&&this!==Xe&&this instanceof Z&&(Rn=se||ss(Rn)),Rn.apply(rn,me)}return Z}function sp(o,l){return function(f,d){return T_(f,o,l(d),{})}}function Ao(o,l){return function(f,d){var b;if(f===t&&d===t)return l;if(f!==t&&(b=f),d!==t){if(b===t)return d;typeof f=="string"||typeof d=="string"?(f=kt(f),d=kt(d)):(f=Ud(f),d=Ud(d)),b=o(f,d)}return b}}function Bu(o){return On(function(l){return l=Ae(l,Et(Y())),ue(function(f){var d=this;return o(l,function(b){return Ct(b,d,f)})})})}function Oo(o,l){l=l===t?" ":kt(l);var f=l.length;if(f<2)return f?Iu(l,o):l;var d=Iu(l,mo(o/ii(l)));return ri(l)?sr(en(d),0,o).join(""):d.slice(0,o)}function ew(o,l,f,d){var b=l&N,x=ss(o);function C(){for(var O=-1,I=arguments.length,P=-1,D=d.length,B=R(D+I),q=this&&this!==Xe&&this instanceof C?x:o;++P<D;)B[P]=d[P];for(;I--;)B[P++]=arguments[++O];return Ct(q,b?f:this,B)}return C}function op(o){return function(l,f,d){return d&&typeof d!="number"&&st(l,f,d)&&(f=d=t),l=Nn(l),f===t?(f=l,l=0):f=Nn(f),d=d===t?l<f?1:-1:Nn(d),z_(l,f,d,o)}}function Mo(o){return function(l,f){return typeof l=="string"&&typeof f=="string"||(l=qt(l),f=qt(f)),o(l,f)}}function ap(o,l,f,d,b,x,C,O,I,P){var D=l&k,B=D?C:t,q=D?t:C,j=D?x:t,X=D?t:x;l|=D?A:F,l&=~(D?F:A),l&v||(l&=-4);var se=[o,l,b,j,B,X,q,O,I,P],Z=f.apply(t,se);return Ku(o)&&_p(Z,se),Z.placeholder=d,wp(Z,o,l)}function zu(o){var l=Be[o];return function(f,d){if(f=qt(f),d=d==null?0:nt(ie(d),292),d&&wd(f)){var b=(_e(f)+"e").split("e"),x=l(b[0]+"e"+(+b[1]+d));return b=(_e(x)+"e").split("e"),+(b[0]+"e"+(+b[1]-d))}return l(f)}}var tw=ai&&1/io(new ai([,-0]))[1]==St?function(o){return new ai(o)}:ac;function lp(o){return function(l){var f=rt(l);return f==Zt?mu(l):f==Qt?b2(l):c2(l,o(l))}}function An(o,l,f,d,b,x,C,O){var I=l&g;if(!I&&typeof o!="function")throw new $t(a);var P=d?d.length:0;if(P||(l&=-97,d=b=t),C=C===t?C:ze(ie(C),0),O=O===t?O:ie(O),P-=b?b.length:0,l&F){var D=d,B=b;d=b=t}var q=I?t:Wu(o),j=[o,l,f,d,b,D,B,x,C,O];if(q&&gw(j,q),o=j[0],l=j[1],f=j[2],d=j[3],b=j[4],O=j[9]=j[9]===t?I?0:o.length:ze(j[9]-P,0),!O&&l&(k|T)&&(l&=-25),!l||l==N)var X=Z_(o,l,f);else l==k||l==T?X=Q_(o,l,O):(l==A||l==(N|A))&&!b.length?X=ew(o,l,f,d):X=To.apply(t,j);var se=q?Wd:_p;return wp(se(X,j),o,l)}function up(o,l,f,d){return o===t||nn(o,oi[f])&&!ve.call(d,f)?l:o}function cp(o,l,f,d,b,x){return Me(o)&&Me(l)&&(x.set(l,o),xo(o,l,t,cp,x),x.delete(l)),o}function nw(o){return us(o)?t:o}function fp(o,l,f,d,b,x){var C=f&S,O=o.length,I=l.length;if(O!=I&&!(C&&I>O))return!1;var P=x.get(o),D=x.get(l);if(P&&D)return P==l&&D==o;var B=-1,q=!0,j=f&E?new Nr:t;for(x.set(o,l),x.set(l,o);++B<O;){var X=o[B],se=l[B];if(d)var Z=C?d(se,X,B,l,o,x):d(X,se,B,o,l,x);if(Z!==t){if(Z)continue;q=!1;break}if(j){if(!uu(l,function(ce,me){if(!Ji(j,me)&&(X===ce||b(X,ce,f,d,x)))return j.push(me)})){q=!1;break}}else if(!(X===se||b(X,se,f,d,x))){q=!1;break}}return x.delete(o),x.delete(l),q}function rw(o,l,f,d,b,x,C){switch(f){case ei:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case Gi:return!(o.byteLength!=l.byteLength||!x(new co(o),new co(l)));case Hi:case Wi:case Vi:return nn(+o,+l);case Ys:return o.name==l.name&&o.message==l.message;case Ui:case qi:return o==l+"";case Zt:var O=mu;case Qt:var I=d&S;if(O||(O=io),o.size!=l.size&&!I)return!1;var P=C.get(o);if(P)return P==l;d|=E,C.set(o,l);var D=fp(O(o),O(l),d,b,x,C);return C.delete(o),D;case Zs:if(Qi)return Qi.call(o)==Qi.call(l)}return!1}function iw(o,l,f,d,b,x){var C=f&S,O=$u(o),I=O.length,P=$u(l),D=P.length;if(I!=D&&!C)return!1;for(var B=I;B--;){var q=O[B];if(!(C?q in l:ve.call(l,q)))return!1}var j=x.get(o),X=x.get(l);if(j&&X)return j==l&&X==o;var se=!0;x.set(o,l),x.set(l,o);for(var Z=C;++B<I;){q=O[B];var ce=o[q],me=l[q];if(d)var At=C?d(me,ce,q,l,o,x):d(ce,me,q,o,l,x);if(!(At===t?ce===me||b(ce,me,f,d,x):At)){se=!1;break}Z||(Z=q=="constructor")}if(se&&!Z){var ot=o.constructor,Ot=l.constructor;ot!=Ot&&"constructor"in o&&"constructor"in l&&!(typeof ot=="function"&&ot instanceof ot&&typeof Ot=="function"&&Ot instanceof Ot)&&(se=!1)}return x.delete(o),x.delete(l),se}function On(o){return Ju(yp(o,t,kp),o+"")}function $u(o){return Id(o,Ve,Uu)}function Hu(o){return Id(o,pt,hp)}var Wu=yo?function(o){return yo.get(o)}:ac;function Io(o){for(var l=o.name+"",f=li[l],d=ve.call(li,l)?f.length:0;d--;){var b=f[d],x=b.func;if(x==null||x==o)return b.name}return l}function hi(o){var l=ve.call(w,"placeholder")?w:o;return l.placeholder}function Y(){var o=w.iteratee||sc;return o=o===sc?Ld:o,arguments.length?o(arguments[0],arguments[1]):o}function No(o,l){var f=o.__data__;return hw(l)?f[typeof l=="string"?"string":"hash"]:f.map}function Vu(o){for(var l=Ve(o),f=l.length;f--;){var d=l[f],b=o[d];l[f]=[d,b,mp(b)]}return l}function Pr(o,l){var f=m2(o,l);return Rd(f)?f:t}function sw(o){var l=ve.call(o,Mr),f=o[Mr];try{o[Mr]=t;var d=!0}catch{}var b=lo.call(o);return d&&(l?o[Mr]=f:delete o[Mr]),b}var Uu=yu?function(o){return o==null?[]:(o=xe(o),Zn(yu(o),function(l){return bd.call(o,l)}))}:lc,hp=yu?function(o){for(var l=[];o;)Qn(l,Uu(o)),o=fo(o);return l}:lc,rt=it;(bu&&rt(new bu(new ArrayBuffer(1)))!=ei||Yi&&rt(new Yi)!=Zt||_u&&rt(_u.resolve())!=Ah||ai&&rt(new ai)!=Qt||Xi&&rt(new Xi)!=Ki)&&(rt=function(o){var l=it(o),f=l==Cn?o.constructor:t,d=f?Dr(f):"";if(d)switch(d){case H2:return ei;case W2:return Zt;case V2:return Ah;case U2:return Qt;case q2:return Ki}return l});function ow(o,l,f){for(var d=-1,b=f.length;++d<b;){var x=f[d],C=x.size;switch(x.type){case"drop":o+=C;break;case"dropRight":l-=C;break;case"take":l=nt(l,o+C);break;case"takeRight":o=ze(o,l-C);break}}return{start:o,end:l}}function aw(o){var l=o.match(db);return l?l[1].split(pb):[]}function dp(o,l,f){l=ir(l,o);for(var d=-1,b=l.length,x=!1;++d<b;){var C=dn(l[d]);if(!(x=o!=null&&f(o,C)))break;o=o[C]}return x||++d!=b?x:(b=o==null?0:o.length,!!b&&zo(b)&&Mn(C,b)&&(re(o)||Fr(o)))}function lw(o){var l=o.length,f=new o.constructor(l);return l&&typeof o[0]=="string"&&ve.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function pp(o){return typeof o.constructor=="function"&&!as(o)?ui(fo(o)):{}}function uw(o,l,f){var d=o.constructor;switch(l){case Gi:return Fu(o);case Hi:case Wi:return new d(+o);case ei:return K_(o,f);case Vl:case Ul:case ql:case Kl:case Gl:case Jl:case jl:case Yl:case Xl:return Yd(o,f);case Zt:return new d;case Vi:case qi:return new d(o);case Ui:return G_(o);case Qt:return new d;case Zs:return J_(o)}}function cw(o,l){var f=l.length;if(!f)return o;var d=f-1;return l[d]=(f>1?"& ":"")+l[d],l=l.join(f>2?", ":" "),o.replace(hb,`{
|
|
45
|
+
3. "-" cannot repeat`);Ae.customSchemes.push([n,e])}function XO(){Ae.scanner=VO(Ae.customSchemes);for(let n=0;n<Ae.tokenQueue.length;n++)Ae.tokenQueue[n][1]({scanner:Ae.scanner});Ae.parser=KO(Ae.scanner.tokens);for(let n=0;n<Ae.pluginQueue.length;n++)Ae.pluginQueue[n][1]({scanner:Ae.scanner,parser:Ae.parser});return Ae.initialized=!0,Ae}function Cl(n){return Ae.initialized||XO(),GO(Ae.parser.start,n,E1(Ae.scanner.start,n))}Cl.scan=E1;function N1(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new th(t),i=Cl(n),s=[];for(let a=0;a<i.length;a++){const u=i[a];u.isLink&&(!e||u.t===e)&&r.check(u)&&s.push(u.toFormattedObject(r))}return s}function ZO(n,e=null){const t=Cl(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class QO extends Lf{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(),s=ZO(i);if(!i||!s)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return kh.query(t,{typeName:ie.TEXT,mark:{typeName:ke.LINK},getMark:{typeName:ke.LINK}})?.attrs||{href:e}}}function H(n){return(...e)=>t=>n(t,...e)}function El(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const s=r.replace(/_/g,"-");return`${t}--zw-${s}:${i};`},"");return e?{style:e}:null}function Cr(n){const e=El(n);return["span",e?{...e,class:"zw-style"}:{},0]}function eM(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Yt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var tM=Object.defineProperty,nM=(n,e,t)=>e in n?tM(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Un=(n,e,t)=>nM(n,typeof e!="symbol"?e+"":e,t),R1,L1,P1;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(c=>c[u])),s=n.map(a=>i.map(u=>{let c=0;if(!Array.isArray(a)){for(let h of u)c+=a*h;return c}for(let h=0;h<a.length;h++)c+=a[h]*(u[h]||0);return c}));return t===1&&(s=s[0]),r===1?s.map(a=>a[0]):s}function D1(n){return $s(n)==="string"}function $s(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function rh(n,{precision:e,unit:t}){return ih(n)?"none":rM(n,e)+(t??"")}function ih(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function rM(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 iM={deg:1,grad:.9,rad:180/Math.PI,turn:360};function sM(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 s=n.match(e);if(s){let a=[];return s[2].replace(i,(u,c)=>{let h=c.match(r),p=c;if(h){let m=h[0],y=p.slice(0,-m.length);m==="%"?(p=new Number(y/100),p.type="<percentage>"):(p=new Number(y*iM[m]),p.type="<angle>",p.unit=m)}else t.test(p)?(p=new Number(p),p.type="<number>"):p==="none"&&(p=new Number(NaN),p.none=!0);u.startsWith("/")&&(p=p instanceof Number?p:new Number(p),p.alpha=!0),typeof p=="object"&&p instanceof Number&&(p.raw=c),a.push(p)}),{name:s[1].toLowerCase(),rawName:s[1],rawArgs:s[2],args:a}}}function oM(n){return n[n.length-1]}function F1(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function aM(n,e,t){return(t-n)/(e-n)}function B1(n,e,t){return F1(e[0],e[1],aM(n[0],n[1],t))}function lM(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 uM(n,e,t){return Math.max(Math.min(t,e),n)}function sh(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function qn(n,e){return sh(Math.abs(n)**e,n)}function z1(n,e){return e===0?0:n/e}function cM(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 fM{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 kl=new fM,Kn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function oh(n){return Array.isArray(n)?n:Kn[n]}function Al(n,e,t,r={}){if(n=oh(n),e=oh(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(kl.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]])),kl.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 Hs={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((P1=(L1=(R1=globalThis?.process)==null?void 0:R1.env)==null?void 0:L1.NODE_ENV)==null?void 0:P1.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},hM=new Set(["<number>","<percentage>","<angle>"]);function $1(n,e,t,r){return Object.entries(n.coords).map(([s,a],u)=>{let c=e.coordGrammar[u],h=r[u],p=h?.type,m;if(h.none?m=c.find(S=>hM.has(S)):m=c.find(S=>S==p),!m){let S=a.name||s;throw new TypeError(`${p??h.raw} not allowed for ${S} in ${t}()`)}let y=m.range;p==="<percentage>"&&(y||(y=[0,1]));let _=a.range||a.refRange;return y&&_&&(r[u]=B1(y,_,r[u])),m})}function H1(n,{meta:e}={}){var t,r,i,s;let a={str:(t=String(n))==null?void 0:t.trim()};if(kl.run("parse-start",a),a.color)return a.color;if(a.parsed=sM(a.str),a.parsed){let u=a.parsed.name;if(u==="color"){let c=a.parsed.args.shift(),h=c.startsWith("--")?c.substring(2):`--${c}`,p=[c,h],m=a.parsed.rawArgs.indexOf("/")>0?a.parsed.args.pop():1;for(let S of le.all){let E=S.getFormat("color");if(E&&(p.includes(E.id)||(r=E.ids)!=null&&r.filter(N=>p.includes(N)).length)){const N=Object.keys(S.coords).map((v,k)=>a.parsed.args[k]||0);let g;return E.coordGrammar&&(g=$1(S,E,"color",N)),e&&Object.assign(e,{formatId:"color",types:g}),E.id.startsWith("--")&&!c.startsWith("--")&&Hs.warn(`${S.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${E.id}) instead of color(${c}).`),c.startsWith("--")&&!E.id.startsWith("--")&&Hs.warn(`${S.name} is a standard space and supported in the CSS spec. Use color(${E.id}) instead of prefixed color(${c}).`),{spaceId:S.id,coords:N,alpha:m}}}let y="",_=c in le.registry?c:h;if(_ in le.registry){let S=(s=(i=le.registry[_].formats)==null?void 0:i.color)==null?void 0:s.id;S&&(y=`Did you mean color(${S})?`)}throw new TypeError(`Cannot parse color(${c}). `+(y||"Missing a plugin?"))}else for(let c of le.all){let h=c.getFormat(u);if(h&&h.type==="function"){let p=1;(h.lastAlpha||oM(a.parsed.args).alpha)&&(p=a.parsed.args.pop());let m=a.parsed.args,y;return h.coordGrammar&&(y=$1(c,h,u,m)),e&&Object.assign(e,{formatId:h.name,types:y}),{spaceId:c.id,coords:m,alpha:p}}}}else for(let u of le.all)for(let c in u.formats){let h=u.formats[c];if(h.type!=="custom"||h.test&&!h.test(a.str))continue;let p=h.parse(a.str);if(p)return p.alpha??(p.alpha=1),e&&(e.formatId=c),p}throw new TypeError(`Could not parse ${n} as a color. Missing a plugin?`)}function Ge(n){if(Array.isArray(n))return n.map(Ge);if(!n)throw new TypeError("Empty color reference");D1(n)&&(n=H1(n));let e=n.space||n.spaceId;return e instanceof le||(n.space=le.get(e)),n.alpha===void 0&&(n.alpha=1),n}const dM=75e-6,ah=class ln{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?ln.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 s in r)"name"in r[s]||(r[s].name=s);this.coords=r;let i=e.white??this.base.white??"D65";this.white=oh(i),this.formats=e.formats??{};for(let s in this.formats){let a=this.formats[s];a.type||(a.type="function"),a.name||(a.name=s)}(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:ln.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(s,a)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:pM(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),kl.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=dM}={}){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,s)=>{let a=r[s];if(a.type!=="angle"&&a.range){if(Number.isNaN(i))return!0;let[u,c]=a.range;return(u===void 0||i>=u-t)&&(c===void 0||i<=c+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=W1(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=W1(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=Ge(e);[e,t]=[u.space,u.coords]}if(e=ln.get(e),this.equals(e))return t;t=t.map(u=>Number.isNaN(u)?0:u);let r=this.path,i=e.path,s,a;for(let u=0;u<r.length&&r[u].equals(i[u]);u++)s=r[u],a=u;if(!s)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=Ge(e);[e,t]=[r.space,r.coords]}return e=ln.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(ln.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 ln)return e;if($s(e)==="string"){let i=ln.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return ln.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=$s(e),s,a;if(i==="string"?e.includes(".")?[s,a]=e.split("."):[s,a]=[,e]:Array.isArray(e)?[s,a]=e:(s=e.space,a=e.coordId),s=ln.get(s),s||(s=t),!s)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(i=$s(a),i==="number"||i==="string"&&a>=0){let h=Object.entries(s.coords)[a];if(h)return{space:s,id:h[0],index:a,...h[1]}}s=ln.get(s);let u=a.toLowerCase(),c=0;for(let h in s.coords){let p=s.coords[h];if(h.toLowerCase()===u||((r=p.name)==null?void 0:r.toLowerCase())===u)return{space:s,id:h,index:c,...p};c++}throw new TypeError(`No "${a}" coordinate found in ${s.name}. Its coordinates are: ${Object.keys(s.coords).join(", ")}`)}};Un(ah,"registry",{}),Un(ah,"DEFAULT_FORMAT",{type:"functions",name:"color"});let le=ah;function pM(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function W1(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=lM(n.coords);let t=Object.entries(e).map(([r,i],s)=>{let a=n.coordGrammar[s][0],u=i.range||i.refRange,c=a.range,h="";return a=="<percentage>"?(c=[0,100],h="%"):a=="<angle>"&&(h="deg"),{fromRange:u,toRange:c,suffix:h}});n.serializeCoords=(r,i)=>r.map((s,a)=>{let{fromRange:u,toRange:c,suffix:h}=t[a];return u&&c&&(s=B1(u,c,s)),s=rh(s,{precision:i,unit:h}),s})}return n}const Gn=new le({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 V1 extends le{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=Al(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=Al(this.base.white,this.white,t),$e(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function lh(n,e){return n=Ge(n),!e||n.space.equals(e)?n.coords.slice():(e=le.get(e),e.from(n))}function Jn(n,e){n=Ge(n);let{space:t,index:r}=le.resolveCoord(e,n.space);return lh(n,t)[r]}function U1(n,e,t){return n=Ge(n),e=le.get(e),n.coords=e.to(n.space,t),n}U1.returns="color";function uh(n,e,t){if(n=Ge(n),arguments.length===2&&$s(arguments[1])==="object"){let r=arguments[1];for(let i in r)uh(n,i,r[i])}else{typeof t=="function"&&(t=t(Jn(n,e)));let{space:r,index:i}=le.resolveCoord(e,n.space),s=lh(n,r);s[i]=t,U1(n,r,s)}return n}uh.returns="color";const mM=new le({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Gn,fromBase:n=>Al(Gn.white,"D50",n),toBase:n=>Al("D50",Gn.white,n)}),gM=216/24389,q1=24/116,Tl=24389/27;let ch=Kn.D50;const jn=new le({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:ch,base:mM,fromBase(n){let t=n.map((r,i)=>r/ch[i]).map(r=>r>gM?Math.cbrt(r):(Tl*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]>q1?Math.pow(e[0],3):(116*e[0]-16)/Tl,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/Tl,e[2]>q1?Math.pow(e[2],3):(116*e[2]-16)/Tl].map((r,i)=>r*ch[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Er(n){return(n%360+360)%360}const Ol=new le({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 s=.02;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Er(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>"]}}}),K1=25**7,Ml=Math.PI,G1=180/Ml,Pi=Ml/180;function J1(n){const e=n*n;return e*e*e*n}function j1(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=Ge([n,e]);let[s,a,u]=jn.from(n),c=Ol.from(jn,[s,a,u])[1],[h,p,m]=jn.from(e),y=Ol.from(jn,[h,p,m])[1];c<0&&(c=0),y<0&&(y=0);let _=(c+y)/2,S=J1(_),E=.5*(1-Math.sqrt(S/(S+K1))),N=(1+E)*a,g=(1+E)*p,v=Math.sqrt(N**2+u**2),k=Math.sqrt(g**2+m**2),A=N===0&&u===0?0:Math.atan2(u,N),T=g===0&&m===0?0:Math.atan2(m,g);A<0&&(A+=2*Ml),T<0&&(T+=2*Ml),A*=G1,T*=G1;let F=h-s,U=k-v,W=T-A,ee=A+T,te=Math.abs(W),Se;v*k===0?Se=0:te<=180?Se=W:W>180?Se=W-360:W<-180?Se=W+360:Hs.warn("the unthinkable has happened");let vt=2*Math.sqrt(k*v)*Math.sin(Se*Pi/2),Sn=(s+h)/2,Ft=(v+k)/2,xn=J1(Ft),We;v*k===0?We=ee:te<=180?We=ee/2:ee<360?We=(ee+360)/2:We=(ee-360)/2;let St=(Sn-50)**2,Xn=1+.015*St/Math.sqrt(20+St),js=1+.045*Ft,cn=1;cn-=.17*Math.cos((We-30)*Pi),cn+=.24*Math.cos(2*We*Pi),cn+=.32*Math.cos((3*We+6)*Pi),cn-=.2*Math.cos((4*We-63)*Pi);let xt=1+.015*Ft*cn,$l=30*Math.exp(-1*((We-275)/25)**2),Hl=2*Math.sqrt(xn/(xn+K1)),Wl=-1*Math.sin(2*$l*Pi)*Hl,Xt=(F/(t*Xn))**2;return Xt+=(U/(r*js))**2,Xt+=(vt/(i*xt))**2,Xt+=Wl*(U/(r*js))*(vt/(i*xt)),Math.sqrt(Xt)}const yM=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],bM=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],_M=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],wM=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Ws=new le({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(yM,n).map(r=>Math.cbrt(r));return $e(_M,t)},toBase(n){let t=$e(wM,n).map(r=>r**3);return $e(bM,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function fh(n,e){[n,e]=Ge([n,e]);let[t,r,i]=Ws.from(n),[s,a,u]=Ws.from(e),c=t-s,h=r-a,p=i-u;return Math.sqrt(c**2+h**2+p**2)}const vM=75e-6;function Di(n,e,{epsilon:t=vM}={}){n=Ge(n),e||(e=n.space),e=le.get(e);let r=n.coords;return e!==n.space&&(r=e.from(n)),e.inGamut(r,{epsilon:t})}function hh(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function SM(n,e,t="lab"){t=le.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((s,a,u)=>{let c=i[u];return isNaN(a)||isNaN(c)?s:s+(c-a)**2},0))}function xM(n,e){return SM(n,e,"lab")}const CM=Math.PI,Y1=CM/180;function EM(n,e,{l:t=2,c:r=1}={}){[n,e]=Ge([n,e]);let[i,s,a]=jn.from(n),[,u,c]=Ol.from(jn,[i,s,a]),[h,p,m]=jn.from(e),y=Ol.from(jn,[h,p,m])[1];u<0&&(u=0),y<0&&(y=0);let _=i-h,S=u-y,E=s-p,N=a-m,g=E**2+N**2-S**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let k=.0638*u/(1+.0131*u)+.638,A;Number.isNaN(c)&&(c=0),c>=164&&c<=345?A=.56+Math.abs(.2*Math.cos((c+168)*Y1)):A=.36+Math.abs(.4*Math.cos((c+35)*Y1));let T=Math.pow(u,4),F=Math.sqrt(T/(T+1900)),U=k*(F*A+1-F),W=(_/(t*v))**2;return W+=(S/(r*k))**2,W+=g/U**2,Math.sqrt(W)}const X1=203,Z1=new le({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*X1,0))},toBase(n){return n.map(e=>Math.max(e/X1,0))}}),Il=1.15,Nl=.66,Q1=2610/2**14,kM=2**14/2610,ey=3424/2**12,ty=2413/2**7,ny=2392/2**7,AM=1.7*2523/2**5,ry=2**5/(1.7*2523),Rl=-.56,dh=16295499532821565e-27,TM=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],OM=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],MM=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],IM=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],NM=new le({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:Z1,fromBase(n){let[e,t,r]=n,i=Il*e-(Il-1)*r,s=Nl*t-(Nl-1)*e,u=$e(TM,[i,s,r]).map(function(y){let _=ey+ty*(y/1e4)**Q1,S=1+ny*(y/1e4)**Q1;return(_/S)**AM}),[c,h,p]=$e(MM,u);return[(1+Rl)*c/(1+Rl*c)-dh,h,p]},toBase(n){let[e,t,r]=n,i=(e+dh)/(1+Rl-Rl*(e+dh)),a=$e(IM,[i,t,r]).map(function(y){let _=ey-y**ry,S=ny*y**ry-ty;return 1e4*(_/S)**kM}),[u,c,h]=$e(OM,a),p=(u+(Il-1)*h)/Il,m=(c+(Nl-1)*p)/Nl;return[p,m,h]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),iy=new le({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:NM,fromBase(n){let[e,t,r]=n,i;const s=2e-4;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Er(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 RM(n,e){[n,e]=Ge([n,e]);let[t,r,i]=iy.from(n),[s,a,u]=iy.from(e),c=t-s,h=r-a;Number.isNaN(i)&&Number.isNaN(u)?(i=0,u=0):Number.isNaN(i)?i=u:Number.isNaN(u)&&(u=i);let p=i-u,m=2*Math.sqrt(r*a)*Math.sin(p/2*(Math.PI/180));return Math.sqrt(c**2+h**2+m**2)}const sy=3424/4096,oy=2413/128,ay=2392/128,ly=2610/16384,LM=2523/32,PM=16384/2610,uy=32/2523,DM=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],FM=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],BM=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],zM=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],cy=new le({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:Z1,fromBase(n){let e=$e(DM,n);return $M(e)},toBase(n){let e=HM(n);return $e(zM,e)}});function $M(n){let e=n.map(function(t){let r=sy+oy*(t/1e4)**ly,i=1+ay*(t/1e4)**ly;return(r/i)**LM});return $e(FM,e)}function HM(n){return $e(BM,n).map(function(r){let i=Math.max(r**uy-sy,0),s=oy-ay*r**uy;return 1e4*(i/s)**PM})}function WM(n,e){[n,e]=Ge([n,e]);let[t,r,i]=cy.from(n),[s,a,u]=cy.from(e);return 720*Math.sqrt((t-s)**2+.25*(r-a)**2+(i-u)**2)}const VM=Kn.D65,fy=.42,hy=1/fy,ph=2*Math.PI,dy=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],UM=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],qM=[[460,451,288],[460,-891,-261],[460,-220,-6300]],KM={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},Yr={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},GM=180/Math.PI,py=Math.PI/180;function my(n,e){return n.map(r=>{const i=qn(e*Math.abs(r)*.01,fy);return 400*sh(i,r)/(i+27.13)})}function JM(n,e){const t=100/e*27.13**hy;return n.map(r=>{const i=Math.abs(r);return sh(t*qn(i/(400-i),hy),r)})}function jM(n){let e=Er(n);e<=Yr.h[0]&&(e+=360);const t=cM(Yr.h,e)-1,[r,i]=Yr.h.slice(t,t+2),[s,a]=Yr.e.slice(t,t+2),u=Yr.H[t],c=(e-r)/s;return u+100*c/(c+(i-e)/a)}function YM(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=Yr.h.slice(t,t+2),[s,a]=Yr.e.slice(t,t+2);return Er((e*(a*r-s*i)-100*r*a)/(e*(a-s)-100*a))}function gy(n,e,t,r,i){const s={};s.discounting=i,s.refWhite=n,s.surround=r;const a=n.map(E=>E*100);s.la=e,s.yb=t;const u=a[1],c=$e(dy,a);r=KM[s.surround];const h=r[0];s.c=r[1],s.nc=r[2];const m=(1/(5*s.la+1))**4;s.fl=m*s.la+.1*(1-m)*(1-m)*Math.cbrt(5*s.la),s.flRoot=s.fl**.25,s.n=s.yb/u,s.z=1.48+Math.sqrt(s.n),s.nbb=.725*s.n**-.2,s.ncb=s.nbb;const y=Math.max(Math.min(h*(1-1/3.6*Math.exp((-s.la-42)/92)),1),0);s.dRgb=c.map(E=>F1(1,u/E,y)),s.dRgbInv=s.dRgb.map(E=>1/E);const _=c.map((E,N)=>E*s.dRgb[N]),S=my(_,s.fl);return s.aW=s.nbb*(2*S[0]+S[1]+.05*S[2]),s}const yy=gy(VM,64/Math.PI*.2,20,"average",!1);function mh(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=Er(n.h)*py:t=YM(n.H)*py;const r=Math.cos(t),i=Math.sin(t);let s=0;n.J!==void 0?s=qn(n.J,1/2)*.1:n.Q!==void 0&&(s=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let a=0;n.C!==void 0?a=n.C/s:n.M!==void 0?a=n.M/e.flRoot/s: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),c=.25*(Math.cos(t+2)+3.8),h=e.aW*qn(s,2/e.c/e.z),p=5e4/13*e.nc*e.ncb*c,m=h/e.nbb,y=23*(m+.305)*z1(u,23*p+u*(11*r+108*i)),_=y*r,S=y*i,E=JM($e(qM,[m,_,S]).map(N=>N*1/1403),e.fl);return $e(UM,E.map((N,g)=>N*e.dRgbInv[g])).map(N=>N/100)}function by(n,e){const t=n.map(k=>k*100),r=my($e(dy,t).map((k,A)=>k*e.dRgb[A]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,s=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(s,i)%ph+ph)%ph,u=.25*(Math.cos(a+2)+3.8),c=5e4/13*e.nc*e.ncb*z1(u*Math.sqrt(i**2+s**2),r[0]+r[1]+1.05*r[2]+.305),h=qn(c,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),p=e.nbb*(2*r[0]+r[1]+.05*r[2]),m=qn(p/e.aW,.5*e.c*e.z),y=100*qn(m,2),_=4/e.c*m*(e.aW+4)*e.flRoot,S=h*m,E=S*e.flRoot,N=Er(a*GM),g=jM(N),v=50*qn(e.c*h/(e.aW+4),1/2);return{J:y,C:S,h:N,s:v,Q:_,M:E,H:g}}new le({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=by(n,yy);return[e.J,e.M,e.h]},toBase(n){return mh({J:n[0],M:n[1],h:n[2]},yy)}});const XM=Kn.D65,ZM=216/24389,_y=24389/27;function QM(n){return 116*(n>ZM?Math.cbrt(n):(_y*n+16)/116)-16}function gh(n){return n>8?Math.pow((n+16)/116,3):n/_y}function eI(n,e){let[t,r,i]=n,s=[],a=0;if(i===0)return[0,0,0];let u=gh(i);i>0?a=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:a=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const c=2e-12,h=15;let p=0,m=1/0;for(;p<=h;){s=mh({J:a,C:r,h:t},e);const y=Math.abs(s[1]-u);if(y<m){if(y<=c)return s;m=y}a=a-(s[1]-u)*a/(2*s[1]),p+=1}return mh({J:a,C:r,h:t},e)}function tI(n,e){const t=QM(n[1]);if(t===0)return[0,0,0];const r=by(n,yh);return[Er(r.h),r.C,t]}const yh=gy(XM,200/Math.PI*gh(50),gh(50)*100,"average",!1),Ll=new le({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 tI(n)},toBase(n){return eI(n,yh)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),nI=Math.PI/180,wy=[1,.007,.0228];function vy(n){n[1]<0&&(n=Ll.fromBase(Ll.toBase(n)));const e=Math.log(Math.max(1+wy[2]*n[1]*yh.flRoot,1))/wy[2],t=n[0]*nI,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function rI(n,e){[n,e]=Ge([n,e]);let[t,r,i]=vy(Ll.from(n)),[s,a,u]=vy(Ll.from(e));return Math.sqrt((t-s)**2+(r-a)**2+(i-u)**2)}const Sy={deltaE76:xM,deltaECMC:EM,deltaE2000:j1,deltaEJz:RM,deltaEITP:WM,deltaEOK:fh,deltaEHCT:rI};function iI(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const xy={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 Vs(n,{method:e=Hs.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:s={}}={}){if(n=Ge(n),D1(arguments[1])?t=arguments[1]:t||(t=n.space),t=le.get(t),Di(n,t,{epsilon:0}))return n;let a;if(e==="css")a=sI(n,{space:t});else{if(e!=="clip"&&!Di(n,t)){Object.prototype.hasOwnProperty.call(xy,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:s}=xy[e]);let u=j1;if(r!==""){for(let h in Sy)if("deltae"+r.toLowerCase()===h.toLowerCase()){u=Sy[h];break}}let c=Vs(He(n,t),{method:"clip",space:t});if(u(n,c)>i){if(Object.keys(s).length===3){let v=le.resolveCoord(s.channel),k=Jn(He(n,v.space),v.id);if(ih(k)&&(k=0),k>=s.max)return He({space:"xyz-d65",coords:Kn.D65},n.space);if(k<=s.min)return He({space:"xyz-d65",coords:[0,0,0]},n.space)}let h=le.resolveCoord(e),p=h.space,m=h.id,y=He(n,p);y.coords.forEach((v,k)=>{ih(v)&&(y.coords[k]=0)});let S=(h.range||h.refRange)[0],E=iI(i),N=S,g=Jn(y,m);for(;g-N>E;){let v=hh(y);v=Vs(v,{space:t,method:"clip"}),u(y,v)-i<E?N=Jn(y,m):g=Jn(y,m),uh(y,m,(N+g)/2)}a=He(y,t)}else a=c}else a=He(n,t);if(e==="clip"||!Di(a,t,{epsilon:0})){let u=Object.values(t.coords).map(c=>c.range||[]);a.coords=a.coords.map((c,h)=>{let[p,m]=u[h];return p!==void 0&&(c=Math.max(p,c)),m!==void 0&&(c=Math.min(c,m)),c})}}return t!==n.space&&(a=He(a,n.space)),n.coords=a.coords,n}Vs.returns="color";const Cy={WHITE:{space:Ws,coords:[1,0,0]},BLACK:{space:Ws,coords:[0,0,0]}};function sI(n,{space:e}={}){n=Ge(n),e||(e=n.space),e=le.get(e);const i=le.get("oklch");if(e.isUnbounded)return He(n,e);const s=He(n,i);let a=s.coords[0];if(a>=1){const S=He(Cy.WHITE,e);return S.alpha=n.alpha,He(S,e)}if(a<=0){const S=He(Cy.BLACK,e);return S.alpha=n.alpha,He(S,e)}if(Di(s,e,{epsilon:0}))return He(s,e);function u(S){const E=He(S,e),N=Object.values(e.coords);return E.coords=E.coords.map((g,v)=>{if("range"in N[v]){const[k,A]=N[v].range;return uM(k,g,A)}return g}),E}let c=0,h=s.coords[1],p=!0,m=hh(s),y=u(m),_=fh(y,m);if(_<.02)return y;for(;h-c>1e-4;){const S=(c+h)/2;if(m.coords[1]=S,p&&Di(m,e,{epsilon:0}))c=S;else if(y=u(m),_=fh(y,m),_<.02){if(.02-_<1e-4)break;p=!1,c=S}else h=S}return y}function He(n,e,{inGamut:t}={}){n=Ge(n),e=le.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=Vs(i,t===!0?void 0:t)),i}He.returns="color";function oI(n,{precision:e=Hs.precision,format:t="default",inGamut:r=!0,...i}={}){var s;let a;n=Ge(n);let u=t;t=n.space.getFormat(t)??n.space.getFormat("default")??le.DEFAULT_FORMAT;let c=n.coords.slice();if(r||(r=t.toGamut),r&&!Di(n)&&(c=Vs(hh(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)a=t.serialize(c,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?c=t.serializeCoords(c,e):e!==null&&(c=c.map(_=>rh(_,{precision:e})));let p=[...c];if(h==="color"){let _=t.id||((s=t.ids)==null?void 0:s[0])||n.space.id;p.unshift(_)}let m=n.alpha;e!==null&&(m=rh(m,{precision:e}));let y=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${m}`;a=`${h}(${p.join(t.commas?", ":" ")}${y})`}return a}const aI=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],lI=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],uI=new V1({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:aI,fromXYZ_M:lI}),Ey={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 ky=Array(3).fill("<percentage> | <number>[0, 255]"),Ay=Array(3).fill("<number>[0, 255]");const Ty=new V1({id:"srgb",name:"sRGB",base:uI,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:ky},rgb_number:{name:"rgb",commas:!0,coords:Ay,noAlpha:!0},color:{},rgba:{coords:ky,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:Ay},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(s=>Math.round(s*255));let r=t&&n.every(s=>s%17===0);return"#"+n.map(s=>r?(s/17).toString(16):s.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=Ey.black,e.alpha=0):e.coords=Ey[n],e.coords)return e}}}});function cI(n){return Jn(n,[Gn,"y"])}const Oy=new le({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:Ty,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,s]=n,[a,u,c]=[NaN,0,(t+e)/2],h=e-t;if(h!==0){switch(u=c===0||c===1?0:(e-c)/Math.min(c,1-c),e){case r:a=(i-s)/h+(i<s?6:0);break;case i:a=(s-r)/h+2;break;case s:a=(r-i)/h+4}a=a*60}return u<0&&(a+=180,u=Math.abs(u)),a>=360&&(a-=360),[a,u*100,c*100]},toBase:n=>{let[e,t,r]=n;e=e%360,e<0&&(e+=360),t/=100,r/=100;function i(s){let a=(s+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}}}),fI=new le({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:Oy,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>"]}}}),hI=new le({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Ws,fromBase(n){let[e,t,r]=n,i;const s=2e-4;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Er(i)]},toBase(n){let[e,t,r]=n,i,s;return isNaN(r)?(i=0,s=0):(i=t*Math.cos(r*Math.PI/180),s=t*Math.sin(r*Math.PI/180)),[e,i,s]},formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});class Dt{constructor(e){Un(this,"data"),this.data=He(e,"srgb")}static fromTransparent(){return new Dt({spaceId:"srgb",coords:[1,1,1],alpha: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 cI(this.data)<.5}withAlpha(e){return new Dt({...this.data,alpha:e})}withRgb(e){const t=this.alpha===0?1:this.alpha;return new Dt({spaceId:"srgb",alpha:e.a??t,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]]})}withHsv(e){const r=lh(this.data,"hsv"),i=Math.max(e.s??r[1],1e-5),s=Math.max(e.v??r[2],1e-5),a=this.alpha===0?1:this.alpha;return new Dt({alpha:a,spaceId:"hsv",coords:[e.h??r[0],i,s]})}toString(){return this.alpha===1?this.toHexString():this.toRgbaString()}toHexString(){const e=oI(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)}}class dI{constructor(e){Un(this,"_color"),Un(this,"isEmpty",!1),this.update(e)}get color(){return this._color}setColor(e){this._color=e}setEmpty(e){this.isEmpty=e}toString(){return this.isEmpty?"":this.color.toString()}isEqual(e){return this.toString()===e}update({solidColor:e,isEmpty:t}){this.setColor(e),this.setEmpty(t)}}let My=999;function pI(){return My+=1,My}function mI(n){return n?n.startsWith("linear-gradient("):!1}function gI(){const n=Dt.fromTransparent();return{isEmpty:!0,isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}le.register(Ty),le.register(fI),le.register(Oy),le.register(hI);function Iy(n){if(!n)return Dt.fromTransparent();try{return new Dt(He(H1(n),"srgb"))}catch(e){return console.warn(e),Dt.fromBlack()}}function yI(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 bI(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:Iy(t),offset:Number.parseFloat(r.replace("%",""))}})}function _I(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),s=bI(i),a=yI(r);return{isEmpty:!1,isGradient:!0,solidColor:s[0].color,angle:a,transitions:s}}function wI(n){const e=Iy(n),t=Dt.fromWhite();return{isEmpty:!1,isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(1),offset:100}]}}function vI(n,e=!0){if(!n)return gI();const t=mI(n)?_I(n):wI(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}class Ch{constructor(e,t=0){Un(this,"id"),this.color=e,this.offset=t,this.id=pI()}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new Ch(this.color.clone(),e)}}class SI{constructor(e){Un(this,"isEmpty",!1),Un(this,"_angle",0),Un(this,"_transitions",[]),this.update(e)}get transitions(){return this._transitions}get canAddTransition(){return this.transitions.length<5}get canRemoveTransition(){return this.transitions.length>2}get angle(){return this._angle}setAngle(e){this._angle=e}setEmpty(e){this.isEmpty=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.isEmpty)return"";const t=this.transitions.map(r=>r.toString());return`linear-gradient(${e??this.angle}deg, ${t.join(", ")})`}isEqual(e){return this.toString()===e}update(e){this._angle=e.angle,this._transitions=e.transitions.map(({color:t,offset:r})=>new Ch(t,r)),this.setEmpty(e.isEmpty)}hasTransition(e){return this.transitions.some(t=>t.id===e.id)}}function xI(n){const e=vI(n);return(e.isGradient?new SI(e):new dI(e)).toString()}function Ny(n){return xI(n)}function Ry(n,e){const t=Fi.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r*10)/10}function Ly(n,e){return String(n).includes("em")?Math.round(Ry(n,e)):parseInt(n)}function CI(n,e){return(n.firstElementChild||n).style.fontSize||Fi.getComputedStyle(e).fontSize}function EI(n,e,t){if(!n.includes("px"))return n;const r=CI(e,t),i=Ly(r,t);return i?(parseInt(n)/i).toFixed(2):null}function kI(n,e){return String(n).includes("em")?Ry(n,e):parseFloat(n)}const AI={start:wr.LEFT,end:wr.RIGHT};function TI(n){const e=AI[n]||n;return MO.includes(e)?e:null}const Py=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function Dy(n,e){return n.resolve(e).depth+1}function OI(n,e,t,r){const i=Dy(n,r),s=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return s&&a}const MI=(n,e)=>n.eq(e);function II(n,e,t,r=MI){const i=n.resolve(e).path.slice().reverse();for(const s of i)if(typeof s!="number"){for(const a of s.marks)if(r(a,t))return!0}return!1}function NI(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var Us={exports:{}};var RI=Us.exports,Fy;function LI(){return Fy||(Fy=1,function(n,e){(function(){var t,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",m=1,y=2,_=4,S=1,E=2,N=1,g=2,v=4,k=8,A=16,T=32,F=64,U=128,W=256,ee=512,te=30,Se="...",vt=800,Sn=16,Ft=1,xn=2,We=3,St=1/0,Xn=9007199254740991,js=17976931348623157e292,cn=NaN,xt=4294967295,$l=xt-1,Hl=xt>>>1,Wl=[["ary",U],["bind",N],["bindKey",g],["curry",k],["curryRight",A],["flip",ee],["partial",T],["partialRight",F],["rearg",W]],Xt="[object Arguments]",Ys="[object Array]",Jy="[object AsyncFunction]",Wi="[object Boolean]",Vi="[object Date]",jy="[object DOMException]",Xs="[object Error]",Zs="[object Function]",Ah="[object GeneratorFunction]",Zt="[object Map]",Ui="[object Number]",Yy="[object Null]",Cn="[object Object]",Th="[object Promise]",Xy="[object Proxy]",qi="[object RegExp]",Qt="[object Set]",Ki="[object String]",Qs="[object Symbol]",Zy="[object Undefined]",Gi="[object WeakMap]",Qy="[object WeakSet]",Ji="[object ArrayBuffer]",ei="[object DataView]",Vl="[object Float32Array]",Ul="[object Float64Array]",ql="[object Int8Array]",Kl="[object Int16Array]",Gl="[object Int32Array]",Jl="[object Uint8Array]",jl="[object Uint8ClampedArray]",Yl="[object Uint16Array]",Xl="[object Uint32Array]",eb=/\b__p \+= '';/g,tb=/\b(__p \+=) '' \+/g,nb=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oh=/&(?:amp|lt|gt|quot|#39);/g,Mh=/[&<>"']/g,rb=RegExp(Oh.source),ib=RegExp(Mh.source),sb=/<%-([\s\S]+?)%>/g,ob=/<%([\s\S]+?)%>/g,Ih=/<%=([\s\S]+?)%>/g,ab=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lb=/^\w*$/,ub=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zl=/[\\^$.*+?()[\]{}|]/g,cb=RegExp(Zl.source),Ql=/^\s+/,fb=/\s/,hb=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,db=/\{\n\/\* \[wrapped with (.+)\] \*/,pb=/,? & /,mb=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gb=/[()=,{}\[\]\/\s]/,yb=/\\(\\)?/g,bb=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nh=/\w*$/,_b=/^[-+]0x[0-9a-f]+$/i,wb=/^0b[01]+$/i,vb=/^\[object .+?Constructor\]$/,Sb=/^0o[0-7]+$/i,xb=/^(?:0|[1-9]\d*)$/,Cb=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,eo=/($^)/,Eb=/['\n\r\u2028\u2029\\]/g,to="\\ud800-\\udfff",kb="\\u0300-\\u036f",Ab="\\ufe20-\\ufe2f",Tb="\\u20d0-\\u20ff",Rh=kb+Ab+Tb,Lh="\\u2700-\\u27bf",Ph="a-z\\xdf-\\xf6\\xf8-\\xff",Ob="\\xac\\xb1\\xd7\\xf7",Mb="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ib="\\u2000-\\u206f",Nb=" \\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",Dh="A-Z\\xc0-\\xd6\\xd8-\\xde",Fh="\\ufe0e\\ufe0f",Bh=Ob+Mb+Ib+Nb,eu="['\u2019]",Rb="["+to+"]",zh="["+Bh+"]",no="["+Rh+"]",$h="\\d+",Lb="["+Lh+"]",Hh="["+Ph+"]",Wh="[^"+to+Bh+$h+Lh+Ph+Dh+"]",tu="\\ud83c[\\udffb-\\udfff]",Pb="(?:"+no+"|"+tu+")",Vh="[^"+to+"]",nu="(?:\\ud83c[\\udde6-\\uddff]){2}",ru="[\\ud800-\\udbff][\\udc00-\\udfff]",ti="["+Dh+"]",Uh="\\u200d",qh="(?:"+Hh+"|"+Wh+")",Db="(?:"+ti+"|"+Wh+")",Kh="(?:"+eu+"(?:d|ll|m|re|s|t|ve))?",Gh="(?:"+eu+"(?:D|LL|M|RE|S|T|VE))?",Jh=Pb+"?",jh="["+Fh+"]?",Fb="(?:"+Uh+"(?:"+[Vh,nu,ru].join("|")+")"+jh+Jh+")*",Bb="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zb="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yh=jh+Jh+Fb,$b="(?:"+[Lb,nu,ru].join("|")+")"+Yh,Hb="(?:"+[Vh+no+"?",no,nu,ru,Rb].join("|")+")",Wb=RegExp(eu,"g"),Vb=RegExp(no,"g"),iu=RegExp(tu+"(?="+tu+")|"+Hb+Yh,"g"),Ub=RegExp([ti+"?"+Hh+"+"+Kh+"(?="+[zh,ti,"$"].join("|")+")",Db+"+"+Gh+"(?="+[zh,ti+qh,"$"].join("|")+")",ti+"?"+qh+"+"+Kh,ti+"+"+Gh,zb,Bb,$h,$b].join("|"),"g"),qb=RegExp("["+Uh+to+Rh+Fh+"]"),Kb=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gb=["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"],Jb=-1,Ee={};Ee[Vl]=Ee[Ul]=Ee[ql]=Ee[Kl]=Ee[Gl]=Ee[Jl]=Ee[jl]=Ee[Yl]=Ee[Xl]=!0,Ee[Xt]=Ee[Ys]=Ee[Ji]=Ee[Wi]=Ee[ei]=Ee[Vi]=Ee[Xs]=Ee[Zs]=Ee[Zt]=Ee[Ui]=Ee[Cn]=Ee[qi]=Ee[Qt]=Ee[Ki]=Ee[Gi]=!1;var Ce={};Ce[Xt]=Ce[Ys]=Ce[Ji]=Ce[ei]=Ce[Wi]=Ce[Vi]=Ce[Vl]=Ce[Ul]=Ce[ql]=Ce[Kl]=Ce[Gl]=Ce[Zt]=Ce[Ui]=Ce[Cn]=Ce[qi]=Ce[Qt]=Ce[Ki]=Ce[Qs]=Ce[Jl]=Ce[jl]=Ce[Yl]=Ce[Xl]=!0,Ce[Xs]=Ce[Zs]=Ce[Gi]=!1;var jb={\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"},Yb={"&":"&","<":"<",">":">",'"':""","'":"'"},Xb={"&":"&","<":"<",">":">",""":'"',"'":"'"},Zb={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qb=parseFloat,e2=parseInt,Xh=typeof Vo=="object"&&Vo&&Vo.Object===Object&&Vo,t2=typeof self=="object"&&self&&self.Object===Object&&self,Xe=Xh||t2||Function("return this")(),su=e&&!e.nodeType&&e,Or=su&&!0&&n&&!n.nodeType&&n,Zh=Or&&Or.exports===su,ou=Zh&&Xh.process,Bt=function(){try{var M=Or&&Or.require&&Or.require("util").types;return M||ou&&ou.binding&&ou.binding("util")}catch{}}(),Qh=Bt&&Bt.isArrayBuffer,ed=Bt&&Bt.isDate,td=Bt&&Bt.isMap,nd=Bt&&Bt.isRegExp,rd=Bt&&Bt.isSet,id=Bt&&Bt.isTypedArray;function Ct(M,L,R){switch(R.length){case 0:return M.call(L);case 1:return M.call(L,R[0]);case 2:return M.call(L,R[0],R[1]);case 3:return M.call(L,R[0],R[1],R[2])}return M.apply(L,R)}function n2(M,L,R,G){for(var ne=-1,be=M==null?0:M.length;++ne<be;){var Be=M[ne];L(G,Be,R(Be),M)}return G}function zt(M,L){for(var R=-1,G=M==null?0:M.length;++R<G&&L(M[R],R,M)!==!1;);return M}function r2(M,L){for(var R=M==null?0:M.length;R--&&L(M[R],R,M)!==!1;);return M}function sd(M,L){for(var R=-1,G=M==null?0:M.length;++R<G;)if(!L(M[R],R,M))return!1;return!0}function Zn(M,L){for(var R=-1,G=M==null?0:M.length,ne=0,be=[];++R<G;){var Be=M[R];L(Be,R,M)&&(be[ne++]=Be)}return be}function ro(M,L){var R=M==null?0:M.length;return!!R&&ni(M,L,0)>-1}function au(M,L,R){for(var G=-1,ne=M==null?0:M.length;++G<ne;)if(R(L,M[G]))return!0;return!1}function Te(M,L){for(var R=-1,G=M==null?0:M.length,ne=Array(G);++R<G;)ne[R]=L(M[R],R,M);return ne}function Qn(M,L){for(var R=-1,G=L.length,ne=M.length;++R<G;)M[ne+R]=L[R];return M}function lu(M,L,R,G){var ne=-1,be=M==null?0:M.length;for(G&&be&&(R=M[++ne]);++ne<be;)R=L(R,M[ne],ne,M);return R}function i2(M,L,R,G){var ne=M==null?0:M.length;for(G&&ne&&(R=M[--ne]);ne--;)R=L(R,M[ne],ne,M);return R}function uu(M,L){for(var R=-1,G=M==null?0:M.length;++R<G;)if(L(M[R],R,M))return!0;return!1}var s2=cu("length");function o2(M){return M.split("")}function a2(M){return M.match(mb)||[]}function od(M,L,R){var G;return R(M,function(ne,be,Be){if(L(ne,be,Be))return G=be,!1}),G}function io(M,L,R,G){for(var ne=M.length,be=R+(G?1:-1);G?be--:++be<ne;)if(L(M[be],be,M))return be;return-1}function ni(M,L,R){return L===L?_2(M,L,R):io(M,ad,R)}function l2(M,L,R,G){for(var ne=R-1,be=M.length;++ne<be;)if(G(M[ne],L))return ne;return-1}function ad(M){return M!==M}function ld(M,L){var R=M==null?0:M.length;return R?hu(M,L)/R:cn}function cu(M){return function(L){return L==null?t:L[M]}}function fu(M){return function(L){return M==null?t:M[L]}}function ud(M,L,R,G,ne){return ne(M,function(be,Be,xe){R=G?(G=!1,be):L(R,be,Be,xe)}),R}function u2(M,L){var R=M.length;for(M.sort(L);R--;)M[R]=M[R].value;return M}function hu(M,L){for(var R,G=-1,ne=M.length;++G<ne;){var be=L(M[G]);be!==t&&(R=R===t?be:R+be)}return R}function du(M,L){for(var R=-1,G=Array(M);++R<M;)G[R]=L(R);return G}function c2(M,L){return Te(L,function(R){return[R,M[R]]})}function cd(M){return M&&M.slice(0,pd(M)+1).replace(Ql,"")}function Et(M){return function(L){return M(L)}}function pu(M,L){return Te(L,function(R){return M[R]})}function ji(M,L){return M.has(L)}function fd(M,L){for(var R=-1,G=M.length;++R<G&&ni(L,M[R],0)>-1;);return R}function hd(M,L){for(var R=M.length;R--&&ni(L,M[R],0)>-1;);return R}function f2(M,L){for(var R=M.length,G=0;R--;)M[R]===L&&++G;return G}var h2=fu(jb),d2=fu(Yb);function p2(M){return"\\"+Zb[M]}function m2(M,L){return M==null?t:M[L]}function ri(M){return qb.test(M)}function g2(M){return Kb.test(M)}function y2(M){for(var L,R=[];!(L=M.next()).done;)R.push(L.value);return R}function mu(M){var L=-1,R=Array(M.size);return M.forEach(function(G,ne){R[++L]=[ne,G]}),R}function dd(M,L){return function(R){return M(L(R))}}function er(M,L){for(var R=-1,G=M.length,ne=0,be=[];++R<G;){var Be=M[R];(Be===L||Be===p)&&(M[R]=p,be[ne++]=R)}return be}function so(M){var L=-1,R=Array(M.size);return M.forEach(function(G){R[++L]=G}),R}function b2(M){var L=-1,R=Array(M.size);return M.forEach(function(G){R[++L]=[G,G]}),R}function _2(M,L,R){for(var G=R-1,ne=M.length;++G<ne;)if(M[G]===L)return G;return-1}function w2(M,L,R){for(var G=R+1;G--;)if(M[G]===L)return G;return G}function ii(M){return ri(M)?S2(M):s2(M)}function en(M){return ri(M)?x2(M):o2(M)}function pd(M){for(var L=M.length;L--&&fb.test(M.charAt(L)););return L}var v2=fu(Xb);function S2(M){for(var L=iu.lastIndex=0;iu.test(M);)++L;return L}function x2(M){return M.match(iu)||[]}function C2(M){return M.match(Ub)||[]}var E2=function M(L){L=L==null?Xe:si.defaults(Xe.Object(),L,si.pick(Xe,Gb));var R=L.Array,G=L.Date,ne=L.Error,be=L.Function,Be=L.Math,xe=L.Object,gu=L.RegExp,k2=L.String,$t=L.TypeError,oo=R.prototype,A2=be.prototype,oi=xe.prototype,ao=L["__core-js_shared__"],lo=A2.toString,ve=oi.hasOwnProperty,T2=0,md=function(){var o=/[^.]+$/.exec(ao&&ao.keys&&ao.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),uo=oi.toString,O2=lo.call(xe),M2=Xe._,I2=gu("^"+lo.call(ve).replace(Zl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),co=Zh?L.Buffer:t,tr=L.Symbol,fo=L.Uint8Array,gd=co?co.allocUnsafe:t,ho=dd(xe.getPrototypeOf,xe),yd=xe.create,bd=oi.propertyIsEnumerable,po=oo.splice,_d=tr?tr.isConcatSpreadable:t,Yi=tr?tr.iterator:t,Mr=tr?tr.toStringTag:t,mo=function(){try{var o=Pr(xe,"defineProperty");return o({},"",{}),o}catch{}}(),N2=L.clearTimeout!==Xe.clearTimeout&&L.clearTimeout,R2=G&&G.now!==Xe.Date.now&&G.now,L2=L.setTimeout!==Xe.setTimeout&&L.setTimeout,go=Be.ceil,yo=Be.floor,yu=xe.getOwnPropertySymbols,P2=co?co.isBuffer:t,wd=L.isFinite,D2=oo.join,F2=dd(xe.keys,xe),ze=Be.max,nt=Be.min,B2=G.now,z2=L.parseInt,vd=Be.random,$2=oo.reverse,bu=Pr(L,"DataView"),Xi=Pr(L,"Map"),_u=Pr(L,"Promise"),ai=Pr(L,"Set"),Zi=Pr(L,"WeakMap"),Qi=Pr(xe,"create"),bo=Zi&&new Zi,li={},H2=Dr(bu),W2=Dr(Xi),V2=Dr(_u),U2=Dr(ai),q2=Dr(Zi),_o=tr?tr.prototype:t,es=_o?_o.valueOf:t,Sd=_o?_o.toString:t;function w(o){if(Ie(o)&&!re(o)&&!(o instanceof fe)){if(o instanceof Ht)return o;if(ve.call(o,"__wrapped__"))return xp(o)}return new Ht(o)}var ui=function(){function o(){}return function(l){if(!Me(l))return{};if(yd)return yd(l);o.prototype=l;var f=new o;return o.prototype=t,f}}();function wo(){}function Ht(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}w.templateSettings={escape:sb,evaluate:ob,interpolate:Ih,variable:"",imports:{_:w}},w.prototype=wo.prototype,w.prototype.constructor=w,Ht.prototype=ui(wo.prototype),Ht.prototype.constructor=Ht;function fe(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=xt,this.__views__=[]}function K2(){var o=new fe(this.__wrapped__);return o.__actions__=ht(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=ht(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=ht(this.__views__),o}function G2(){if(this.__filtered__){var o=new fe(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function J2(){var o=this.__wrapped__.value(),l=this.__dir__,f=re(o),d=l<0,b=f?o.length:0,x=ow(0,b,this.__views__),C=x.start,O=x.end,I=O-C,P=d?O:C-1,D=this.__iteratees__,B=D.length,q=0,j=nt(I,this.__takeCount__);if(!f||!d&&b==I&&j==I)return Kd(o,this.__actions__);var X=[];e:for(;I--&&q<j;){P+=l;for(var oe=-1,Z=o[P];++oe<B;){var ce=D[oe],me=ce.iteratee,Tt=ce.type,ot=me(Z);if(Tt==xn)Z=ot;else if(!ot){if(Tt==Ft)continue e;break e}}X[q++]=Z}return X}fe.prototype=ui(wo.prototype),fe.prototype.constructor=fe;function Ir(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var d=o[l];this.set(d[0],d[1])}}function j2(){this.__data__=Qi?Qi(null):{},this.size=0}function Y2(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function X2(o){var l=this.__data__;if(Qi){var f=l[o];return f===c?t:f}return ve.call(l,o)?l[o]:t}function Z2(o){var l=this.__data__;return Qi?l[o]!==t:ve.call(l,o)}function Q2(o,l){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=Qi&&l===t?c:l,this}Ir.prototype.clear=j2,Ir.prototype.delete=Y2,Ir.prototype.get=X2,Ir.prototype.has=Z2,Ir.prototype.set=Q2;function En(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var d=o[l];this.set(d[0],d[1])}}function e_(){this.__data__=[],this.size=0}function t_(o){var l=this.__data__,f=vo(l,o);if(f<0)return!1;var d=l.length-1;return f==d?l.pop():po.call(l,f,1),--this.size,!0}function n_(o){var l=this.__data__,f=vo(l,o);return f<0?t:l[f][1]}function r_(o){return vo(this.__data__,o)>-1}function i_(o,l){var f=this.__data__,d=vo(f,o);return d<0?(++this.size,f.push([o,l])):f[d][1]=l,this}En.prototype.clear=e_,En.prototype.delete=t_,En.prototype.get=n_,En.prototype.has=r_,En.prototype.set=i_;function kn(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var d=o[l];this.set(d[0],d[1])}}function s_(){this.size=0,this.__data__={hash:new Ir,map:new(Xi||En),string:new Ir}}function o_(o){var l=Ro(this,o).delete(o);return this.size-=l?1:0,l}function a_(o){return Ro(this,o).get(o)}function l_(o){return Ro(this,o).has(o)}function u_(o,l){var f=Ro(this,o),d=f.size;return f.set(o,l),this.size+=f.size==d?0:1,this}kn.prototype.clear=s_,kn.prototype.delete=o_,kn.prototype.get=a_,kn.prototype.has=l_,kn.prototype.set=u_;function Nr(o){var l=-1,f=o==null?0:o.length;for(this.__data__=new kn;++l<f;)this.add(o[l])}function c_(o){return this.__data__.set(o,c),this}function f_(o){return this.__data__.has(o)}Nr.prototype.add=Nr.prototype.push=c_,Nr.prototype.has=f_;function tn(o){var l=this.__data__=new En(o);this.size=l.size}function h_(){this.__data__=new En,this.size=0}function d_(o){var l=this.__data__,f=l.delete(o);return this.size=l.size,f}function p_(o){return this.__data__.get(o)}function m_(o){return this.__data__.has(o)}function g_(o,l){var f=this.__data__;if(f instanceof En){var d=f.__data__;if(!Xi||d.length<i-1)return d.push([o,l]),this.size=++f.size,this;f=this.__data__=new kn(d)}return f.set(o,l),this.size=f.size,this}tn.prototype.clear=h_,tn.prototype.delete=d_,tn.prototype.get=p_,tn.prototype.has=m_,tn.prototype.set=g_;function xd(o,l){var f=re(o),d=!f&&Fr(o),b=!f&&!d&&or(o),x=!f&&!d&&!b&&di(o),C=f||d||b||x,O=C?du(o.length,k2):[],I=O.length;for(var P in o)(l||ve.call(o,P))&&!(C&&(P=="length"||b&&(P=="offset"||P=="parent")||x&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||Mn(P,I)))&&O.push(P);return O}function Cd(o){var l=o.length;return l?o[Mu(0,l-1)]:t}function y_(o,l){return Lo(ht(o),Rr(l,0,o.length))}function b_(o){return Lo(ht(o))}function wu(o,l,f){(f!==t&&!nn(o[l],f)||f===t&&!(l in o))&&An(o,l,f)}function ts(o,l,f){var d=o[l];(!(ve.call(o,l)&&nn(d,f))||f===t&&!(l in o))&&An(o,l,f)}function vo(o,l){for(var f=o.length;f--;)if(nn(o[f][0],l))return f;return-1}function __(o,l,f,d){return nr(o,function(b,x,C){l(d,b,f(b),C)}),d}function Ed(o,l){return o&&hn(l,Ve(l),o)}function w_(o,l){return o&&hn(l,pt(l),o)}function An(o,l,f){l=="__proto__"&&mo?mo(o,l,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[l]=f}function vu(o,l){for(var f=-1,d=l.length,b=R(d),x=o==null;++f<d;)b[f]=x?t:tc(o,l[f]);return b}function Rr(o,l,f){return o===o&&(f!==t&&(o=o<=f?o:f),l!==t&&(o=o>=l?o:l)),o}function Wt(o,l,f,d,b,x){var C,O=l&m,I=l&y,P=l&_;if(f&&(C=b?f(o,d,b,x):f(o)),C!==t)return C;if(!Me(o))return o;var D=re(o);if(D){if(C=lw(o),!O)return ht(o,C)}else{var B=rt(o),q=B==Zs||B==Ah;if(or(o))return jd(o,O);if(B==Cn||B==Xt||q&&!b){if(C=I||q?{}:pp(o),!O)return I?X_(o,w_(C,o)):Y_(o,Ed(C,o))}else{if(!Ce[B])return b?o:{};C=uw(o,B,O)}}x||(x=new tn);var j=x.get(o);if(j)return j;x.set(o,C),Vp(o)?o.forEach(function(Z){C.add(Wt(Z,l,f,Z,o,x))}):Hp(o)&&o.forEach(function(Z,ce){C.set(ce,Wt(Z,l,f,ce,o,x))});var X=P?I?Hu:$u:I?pt:Ve,oe=D?t:X(o);return zt(oe||o,function(Z,ce){oe&&(ce=Z,Z=o[ce]),ts(C,ce,Wt(Z,l,f,ce,o,x))}),C}function v_(o){var l=Ve(o);return function(f){return kd(f,o,l)}}function kd(o,l,f){var d=f.length;if(o==null)return!d;for(o=xe(o);d--;){var b=f[d],x=l[b],C=o[b];if(C===t&&!(b in o)||!x(C))return!1}return!0}function Ad(o,l,f){if(typeof o!="function")throw new $t(a);return us(function(){o.apply(t,f)},l)}function ns(o,l,f,d){var b=-1,x=ro,C=!0,O=o.length,I=[],P=l.length;if(!O)return I;f&&(l=Te(l,Et(f))),d?(x=au,C=!1):l.length>=i&&(x=ji,C=!1,l=new Nr(l));e:for(;++b<O;){var D=o[b],B=f==null?D:f(D);if(D=d||D!==0?D:0,C&&B===B){for(var q=P;q--;)if(l[q]===B)continue e;I.push(D)}else x(l,B,d)||I.push(D)}return I}var nr=ep(fn),Td=ep(xu,!0);function S_(o,l){var f=!0;return nr(o,function(d,b,x){return f=!!l(d,b,x),f}),f}function So(o,l,f){for(var d=-1,b=o.length;++d<b;){var x=o[d],C=l(x);if(C!=null&&(O===t?C===C&&!At(C):f(C,O)))var O=C,I=x}return I}function x_(o,l,f,d){var b=o.length;for(f=se(f),f<0&&(f=-f>b?0:b+f),d=d===t||d>b?b:se(d),d<0&&(d+=b),d=f>d?0:qp(d);f<d;)o[f++]=l;return o}function Od(o,l){var f=[];return nr(o,function(d,b,x){l(d,b,x)&&f.push(d)}),f}function Ze(o,l,f,d,b){var x=-1,C=o.length;for(f||(f=fw),b||(b=[]);++x<C;){var O=o[x];l>0&&f(O)?l>1?Ze(O,l-1,f,d,b):Qn(b,O):d||(b[b.length]=O)}return b}var Su=tp(),Md=tp(!0);function fn(o,l){return o&&Su(o,l,Ve)}function xu(o,l){return o&&Md(o,l,Ve)}function xo(o,l){return Zn(l,function(f){return In(o[f])})}function Lr(o,l){l=ir(l,o);for(var f=0,d=l.length;o!=null&&f<d;)o=o[dn(l[f++])];return f&&f==d?o:t}function Id(o,l,f){var d=l(o);return re(o)?d:Qn(d,f(o))}function it(o){return o==null?o===t?Zy:Yy:Mr&&Mr in xe(o)?sw(o):bw(o)}function Cu(o,l){return o>l}function C_(o,l){return o!=null&&ve.call(o,l)}function E_(o,l){return o!=null&&l in xe(o)}function k_(o,l,f){return o>=nt(l,f)&&o<ze(l,f)}function Eu(o,l,f){for(var d=f?au:ro,b=o[0].length,x=o.length,C=x,O=R(x),I=1/0,P=[];C--;){var D=o[C];C&&l&&(D=Te(D,Et(l))),I=nt(D.length,I),O[C]=!f&&(l||b>=120&&D.length>=120)?new Nr(C&&D):t}D=o[0];var B=-1,q=O[0];e:for(;++B<b&&P.length<I;){var j=D[B],X=l?l(j):j;if(j=f||j!==0?j:0,!(q?ji(q,X):d(P,X,f))){for(C=x;--C;){var oe=O[C];if(!(oe?ji(oe,X):d(o[C],X,f)))continue e}q&&q.push(X),P.push(j)}}return P}function A_(o,l,f,d){return fn(o,function(b,x,C){l(d,f(b),x,C)}),d}function rs(o,l,f){l=ir(l,o),o=bp(o,l);var d=o==null?o:o[dn(Ut(l))];return d==null?t:Ct(d,o,f)}function Nd(o){return Ie(o)&&it(o)==Xt}function T_(o){return Ie(o)&&it(o)==Ji}function O_(o){return Ie(o)&&it(o)==Vi}function is(o,l,f,d,b){return o===l?!0:o==null||l==null||!Ie(o)&&!Ie(l)?o!==o&&l!==l:M_(o,l,f,d,is,b)}function M_(o,l,f,d,b,x){var C=re(o),O=re(l),I=C?Ys:rt(o),P=O?Ys:rt(l);I=I==Xt?Cn:I,P=P==Xt?Cn:P;var D=I==Cn,B=P==Cn,q=I==P;if(q&&or(o)){if(!or(l))return!1;C=!0,D=!1}if(q&&!D)return x||(x=new tn),C||di(o)?fp(o,l,f,d,b,x):rw(o,l,I,f,d,b,x);if(!(f&S)){var j=D&&ve.call(o,"__wrapped__"),X=B&&ve.call(l,"__wrapped__");if(j||X){var oe=j?o.value():o,Z=X?l.value():l;return x||(x=new tn),b(oe,Z,f,d,x)}}return q?(x||(x=new tn),iw(o,l,f,d,b,x)):!1}function I_(o){return Ie(o)&&rt(o)==Zt}function ku(o,l,f,d){var b=f.length,x=b,C=!d;if(o==null)return!x;for(o=xe(o);b--;){var O=f[b];if(C&&O[2]?O[1]!==o[O[0]]:!(O[0]in o))return!1}for(;++b<x;){O=f[b];var I=O[0],P=o[I],D=O[1];if(C&&O[2]){if(P===t&&!(I in o))return!1}else{var B=new tn;if(d)var q=d(P,D,I,o,l,B);if(!(q===t?is(D,P,S|E,d,B):q))return!1}}return!0}function Rd(o){if(!Me(o)||dw(o))return!1;var l=In(o)?I2:vb;return l.test(Dr(o))}function N_(o){return Ie(o)&&it(o)==qi}function R_(o){return Ie(o)&&rt(o)==Qt}function L_(o){return Ie(o)&&$o(o.length)&&!!Ee[it(o)]}function Ld(o){return typeof o=="function"?o:o==null?mt:typeof o=="object"?re(o)?Fd(o[0],o[1]):Dd(o):nm(o)}function Au(o){if(!ls(o))return F2(o);var l=[];for(var f in xe(o))ve.call(o,f)&&f!="constructor"&&l.push(f);return l}function P_(o){if(!Me(o))return yw(o);var l=ls(o),f=[];for(var d in o)d=="constructor"&&(l||!ve.call(o,d))||f.push(d);return f}function Tu(o,l){return o<l}function Pd(o,l){var f=-1,d=dt(o)?R(o.length):[];return nr(o,function(b,x,C){d[++f]=l(b,x,C)}),d}function Dd(o){var l=Vu(o);return l.length==1&&l[0][2]?gp(l[0][0],l[0][1]):function(f){return f===o||ku(f,o,l)}}function Fd(o,l){return qu(o)&&mp(l)?gp(dn(o),l):function(f){var d=tc(f,o);return d===t&&d===l?nc(f,o):is(l,d,S|E)}}function Co(o,l,f,d,b){o!==l&&Su(l,function(x,C){if(b||(b=new tn),Me(x))D_(o,l,C,f,Co,d,b);else{var O=d?d(Gu(o,C),x,C+"",o,l,b):t;O===t&&(O=x),wu(o,C,O)}},pt)}function D_(o,l,f,d,b,x,C){var O=Gu(o,f),I=Gu(l,f),P=C.get(I);if(P){wu(o,f,P);return}var D=x?x(O,I,f+"",o,l,C):t,B=D===t;if(B){var q=re(I),j=!q&&or(I),X=!q&&!j&&di(I);D=I,q||j||X?re(O)?D=O:Le(O)?D=ht(O):j?(B=!1,D=jd(I,!0)):X?(B=!1,D=Yd(I,!0)):D=[]:cs(I)||Fr(I)?(D=O,Fr(O)?D=Kp(O):(!Me(O)||In(O))&&(D=pp(I))):B=!1}B&&(C.set(I,D),b(D,I,d,x,C),C.delete(I)),wu(o,f,D)}function Bd(o,l){var f=o.length;if(f)return l+=l<0?f:0,Mn(l,f)?o[l]:t}function zd(o,l,f){l.length?l=Te(l,function(x){return re(x)?function(C){return Lr(C,x.length===1?x[0]:x)}:x}):l=[mt];var d=-1;l=Te(l,Et(Y()));var b=Pd(o,function(x,C,O){var I=Te(l,function(P){return P(x)});return{criteria:I,index:++d,value:x}});return u2(b,function(x,C){return j_(x,C,f)})}function F_(o,l){return $d(o,l,function(f,d){return nc(o,d)})}function $d(o,l,f){for(var d=-1,b=l.length,x={};++d<b;){var C=l[d],O=Lr(o,C);f(O,C)&&ss(x,ir(C,o),O)}return x}function B_(o){return function(l){return Lr(l,o)}}function Ou(o,l,f,d){var b=d?l2:ni,x=-1,C=l.length,O=o;for(o===l&&(l=ht(l)),f&&(O=Te(o,Et(f)));++x<C;)for(var I=0,P=l[x],D=f?f(P):P;(I=b(O,D,I,d))>-1;)O!==o&&po.call(O,I,1),po.call(o,I,1);return o}function Hd(o,l){for(var f=o?l.length:0,d=f-1;f--;){var b=l[f];if(f==d||b!==x){var x=b;Mn(b)?po.call(o,b,1):Ru(o,b)}}return o}function Mu(o,l){return o+yo(vd()*(l-o+1))}function z_(o,l,f,d){for(var b=-1,x=ze(go((l-o)/(f||1)),0),C=R(x);x--;)C[d?x:++b]=o,o+=f;return C}function Iu(o,l){var f="";if(!o||l<1||l>Xn)return f;do l%2&&(f+=o),l=yo(l/2),l&&(o+=o);while(l);return f}function ue(o,l){return Ju(yp(o,l,mt),o+"")}function $_(o){return Cd(pi(o))}function H_(o,l){var f=pi(o);return Lo(f,Rr(l,0,f.length))}function ss(o,l,f,d){if(!Me(o))return o;l=ir(l,o);for(var b=-1,x=l.length,C=x-1,O=o;O!=null&&++b<x;){var I=dn(l[b]),P=f;if(I==="__proto__"||I==="constructor"||I==="prototype")return o;if(b!=C){var D=O[I];P=d?d(D,I,O):t,P===t&&(P=Me(D)?D:Mn(l[b+1])?[]:{})}ts(O,I,P),O=O[I]}return o}var Wd=bo?function(o,l){return bo.set(o,l),o}:mt,W_=mo?function(o,l){return mo(o,"toString",{configurable:!0,enumerable:!1,value:ic(l),writable:!0})}:mt;function V_(o){return Lo(pi(o))}function Vt(o,l,f){var d=-1,b=o.length;l<0&&(l=-l>b?0:b+l),f=f>b?b:f,f<0&&(f+=b),b=l>f?0:f-l>>>0,l>>>=0;for(var x=R(b);++d<b;)x[d]=o[d+l];return x}function U_(o,l){var f;return nr(o,function(d,b,x){return f=l(d,b,x),!f}),!!f}function Eo(o,l,f){var d=0,b=o==null?d:o.length;if(typeof l=="number"&&l===l&&b<=Hl){for(;d<b;){var x=d+b>>>1,C=o[x];C!==null&&!At(C)&&(f?C<=l:C<l)?d=x+1:b=x}return b}return Nu(o,l,mt,f)}function Nu(o,l,f,d){var b=0,x=o==null?0:o.length;if(x===0)return 0;l=f(l);for(var C=l!==l,O=l===null,I=At(l),P=l===t;b<x;){var D=yo((b+x)/2),B=f(o[D]),q=B!==t,j=B===null,X=B===B,oe=At(B);if(C)var Z=d||X;else P?Z=X&&(d||q):O?Z=X&&q&&(d||!j):I?Z=X&&q&&!j&&(d||!oe):j||oe?Z=!1:Z=d?B<=l:B<l;Z?b=D+1:x=D}return nt(x,$l)}function Vd(o,l){for(var f=-1,d=o.length,b=0,x=[];++f<d;){var C=o[f],O=l?l(C):C;if(!f||!nn(O,I)){var I=O;x[b++]=C===0?0:C}}return x}function Ud(o){return typeof o=="number"?o:At(o)?cn:+o}function kt(o){if(typeof o=="string")return o;if(re(o))return Te(o,kt)+"";if(At(o))return Sd?Sd.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}function rr(o,l,f){var d=-1,b=ro,x=o.length,C=!0,O=[],I=O;if(f)C=!1,b=au;else if(x>=i){var P=l?null:tw(o);if(P)return so(P);C=!1,b=ji,I=new Nr}else I=l?[]:O;e:for(;++d<x;){var D=o[d],B=l?l(D):D;if(D=f||D!==0?D:0,C&&B===B){for(var q=I.length;q--;)if(I[q]===B)continue e;l&&I.push(B),O.push(D)}else b(I,B,f)||(I!==O&&I.push(B),O.push(D))}return O}function Ru(o,l){return l=ir(l,o),o=bp(o,l),o==null||delete o[dn(Ut(l))]}function qd(o,l,f,d){return ss(o,l,f(Lr(o,l)),d)}function ko(o,l,f,d){for(var b=o.length,x=d?b:-1;(d?x--:++x<b)&&l(o[x],x,o););return f?Vt(o,d?0:x,d?x+1:b):Vt(o,d?x+1:0,d?b:x)}function Kd(o,l){var f=o;return f instanceof fe&&(f=f.value()),lu(l,function(d,b){return b.func.apply(b.thisArg,Qn([d],b.args))},f)}function Lu(o,l,f){var d=o.length;if(d<2)return d?rr(o[0]):[];for(var b=-1,x=R(d);++b<d;)for(var C=o[b],O=-1;++O<d;)O!=b&&(x[b]=ns(x[b]||C,o[O],l,f));return rr(Ze(x,1),l,f)}function Gd(o,l,f){for(var d=-1,b=o.length,x=l.length,C={};++d<b;){var O=d<x?l[d]:t;f(C,o[d],O)}return C}function Pu(o){return Le(o)?o:[]}function Du(o){return typeof o=="function"?o:mt}function ir(o,l){return re(o)?o:qu(o,l)?[o]:Sp(_e(o))}var q_=ue;function sr(o,l,f){var d=o.length;return f=f===t?d:f,!l&&f>=d?o:Vt(o,l,f)}var Jd=N2||function(o){return Xe.clearTimeout(o)};function jd(o,l){if(l)return o.slice();var f=o.length,d=gd?gd(f):new o.constructor(f);return o.copy(d),d}function Fu(o){var l=new o.constructor(o.byteLength);return new fo(l).set(new fo(o)),l}function K_(o,l){var f=l?Fu(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function G_(o){var l=new o.constructor(o.source,Nh.exec(o));return l.lastIndex=o.lastIndex,l}function J_(o){return es?xe(es.call(o)):{}}function Yd(o,l){var f=l?Fu(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function Xd(o,l){if(o!==l){var f=o!==t,d=o===null,b=o===o,x=At(o),C=l!==t,O=l===null,I=l===l,P=At(l);if(!O&&!P&&!x&&o>l||x&&C&&I&&!O&&!P||d&&C&&I||!f&&I||!b)return 1;if(!d&&!x&&!P&&o<l||P&&f&&b&&!d&&!x||O&&f&&b||!C&&b||!I)return-1}return 0}function j_(o,l,f){for(var d=-1,b=o.criteria,x=l.criteria,C=b.length,O=f.length;++d<C;){var I=Xd(b[d],x[d]);if(I){if(d>=O)return I;var P=f[d];return I*(P=="desc"?-1:1)}}return o.index-l.index}function Zd(o,l,f,d){for(var b=-1,x=o.length,C=f.length,O=-1,I=l.length,P=ze(x-C,0),D=R(I+P),B=!d;++O<I;)D[O]=l[O];for(;++b<C;)(B||b<x)&&(D[f[b]]=o[b]);for(;P--;)D[O++]=o[b++];return D}function Qd(o,l,f,d){for(var b=-1,x=o.length,C=-1,O=f.length,I=-1,P=l.length,D=ze(x-O,0),B=R(D+P),q=!d;++b<D;)B[b]=o[b];for(var j=b;++I<P;)B[j+I]=l[I];for(;++C<O;)(q||b<x)&&(B[j+f[C]]=o[b++]);return B}function ht(o,l){var f=-1,d=o.length;for(l||(l=R(d));++f<d;)l[f]=o[f];return l}function hn(o,l,f,d){var b=!f;f||(f={});for(var x=-1,C=l.length;++x<C;){var O=l[x],I=d?d(f[O],o[O],O,f,o):t;I===t&&(I=o[O]),b?An(f,O,I):ts(f,O,I)}return f}function Y_(o,l){return hn(o,Uu(o),l)}function X_(o,l){return hn(o,hp(o),l)}function Ao(o,l){return function(f,d){var b=re(f)?n2:__,x=l?l():{};return b(f,o,Y(d,2),x)}}function ci(o){return ue(function(l,f){var d=-1,b=f.length,x=b>1?f[b-1]:t,C=b>2?f[2]:t;for(x=o.length>3&&typeof x=="function"?(b--,x):t,C&&st(f[0],f[1],C)&&(x=b<3?t:x,b=1),l=xe(l);++d<b;){var O=f[d];O&&o(l,O,d,x)}return l})}function ep(o,l){return function(f,d){if(f==null)return f;if(!dt(f))return o(f,d);for(var b=f.length,x=l?b:-1,C=xe(f);(l?x--:++x<b)&&d(C[x],x,C)!==!1;);return f}}function tp(o){return function(l,f,d){for(var b=-1,x=xe(l),C=d(l),O=C.length;O--;){var I=C[o?O:++b];if(f(x[I],I,x)===!1)break}return l}}function Z_(o,l,f){var d=l&N,b=as(o);function x(){var C=this&&this!==Xe&&this instanceof x?b:o;return C.apply(d?f:this,arguments)}return x}function np(o){return function(l){l=_e(l);var f=ri(l)?en(l):t,d=f?f[0]:l.charAt(0),b=f?sr(f,1).join(""):l.slice(1);return d[o]()+b}}function fi(o){return function(l){return lu(em(Qp(l).replace(Wb,"")),o,"")}}function as(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var f=ui(o.prototype),d=o.apply(f,l);return Me(d)?d:f}}function Q_(o,l,f){var d=as(o);function b(){for(var x=arguments.length,C=R(x),O=x,I=hi(b);O--;)C[O]=arguments[O];var P=x<3&&C[0]!==I&&C[x-1]!==I?[]:er(C,I);if(x-=P.length,x<f)return ap(o,l,To,b.placeholder,t,C,P,t,t,f-x);var D=this&&this!==Xe&&this instanceof b?d:o;return Ct(D,this,C)}return b}function rp(o){return function(l,f,d){var b=xe(l);if(!dt(l)){var x=Y(f,3);l=Ve(l),f=function(O){return x(b[O],O,b)}}var C=o(l,f,d);return C>-1?b[x?l[C]:C]:t}}function ip(o){return On(function(l){var f=l.length,d=f,b=Ht.prototype.thru;for(o&&l.reverse();d--;){var x=l[d];if(typeof x!="function")throw new $t(a);if(b&&!C&&No(x)=="wrapper")var C=new Ht([],!0)}for(d=C?d:f;++d<f;){x=l[d];var O=No(x),I=O=="wrapper"?Wu(x):t;I&&Ku(I[0])&&I[1]==(U|k|T|W)&&!I[4].length&&I[9]==1?C=C[No(I[0])].apply(C,I[3]):C=x.length==1&&Ku(x)?C[O]():C.thru(x)}return function(){var P=arguments,D=P[0];if(C&&P.length==1&&re(D))return C.plant(D).value();for(var B=0,q=f?l[B].apply(this,P):D;++B<f;)q=l[B].call(this,q);return q}})}function To(o,l,f,d,b,x,C,O,I,P){var D=l&U,B=l&N,q=l&g,j=l&(k|A),X=l&ee,oe=q?t:as(o);function Z(){for(var ce=arguments.length,me=R(ce),Tt=ce;Tt--;)me[Tt]=arguments[Tt];if(j)var ot=hi(Z),Ot=f2(me,ot);if(d&&(me=Zd(me,d,b,j)),x&&(me=Qd(me,x,C,j)),ce-=Ot,j&&ce<P){var Pe=er(me,ot);return ap(o,l,To,Z.placeholder,f,me,Pe,O,I,P-ce)}var rn=B?f:this,Rn=q?rn[o]:o;return ce=me.length,O?me=_w(me,O):X&&ce>1&&me.reverse(),D&&I<ce&&(me.length=I),this&&this!==Xe&&this instanceof Z&&(Rn=oe||as(Rn)),Rn.apply(rn,me)}return Z}function sp(o,l){return function(f,d){return A_(f,o,l(d),{})}}function Oo(o,l){return function(f,d){var b;if(f===t&&d===t)return l;if(f!==t&&(b=f),d!==t){if(b===t)return d;typeof f=="string"||typeof d=="string"?(f=kt(f),d=kt(d)):(f=Ud(f),d=Ud(d)),b=o(f,d)}return b}}function Bu(o){return On(function(l){return l=Te(l,Et(Y())),ue(function(f){var d=this;return o(l,function(b){return Ct(b,d,f)})})})}function Mo(o,l){l=l===t?" ":kt(l);var f=l.length;if(f<2)return f?Iu(l,o):l;var d=Iu(l,go(o/ii(l)));return ri(l)?sr(en(d),0,o).join(""):d.slice(0,o)}function ew(o,l,f,d){var b=l&N,x=as(o);function C(){for(var O=-1,I=arguments.length,P=-1,D=d.length,B=R(D+I),q=this&&this!==Xe&&this instanceof C?x:o;++P<D;)B[P]=d[P];for(;I--;)B[P++]=arguments[++O];return Ct(q,b?f:this,B)}return C}function op(o){return function(l,f,d){return d&&typeof d!="number"&&st(l,f,d)&&(f=d=t),l=Nn(l),f===t?(f=l,l=0):f=Nn(f),d=d===t?l<f?1:-1:Nn(d),z_(l,f,d,o)}}function Io(o){return function(l,f){return typeof l=="string"&&typeof f=="string"||(l=qt(l),f=qt(f)),o(l,f)}}function ap(o,l,f,d,b,x,C,O,I,P){var D=l&k,B=D?C:t,q=D?t:C,j=D?x:t,X=D?t:x;l|=D?T:F,l&=~(D?F:T),l&v||(l&=-4);var oe=[o,l,b,j,B,X,q,O,I,P],Z=f.apply(t,oe);return Ku(o)&&_p(Z,oe),Z.placeholder=d,wp(Z,o,l)}function zu(o){var l=Be[o];return function(f,d){if(f=qt(f),d=d==null?0:nt(se(d),292),d&&wd(f)){var b=(_e(f)+"e").split("e"),x=l(b[0]+"e"+(+b[1]+d));return b=(_e(x)+"e").split("e"),+(b[0]+"e"+(+b[1]-d))}return l(f)}}var tw=ai&&1/so(new ai([,-0]))[1]==St?function(o){return new ai(o)}:ac;function lp(o){return function(l){var f=rt(l);return f==Zt?mu(l):f==Qt?b2(l):c2(l,o(l))}}function Tn(o,l,f,d,b,x,C,O){var I=l&g;if(!I&&typeof o!="function")throw new $t(a);var P=d?d.length:0;if(P||(l&=-97,d=b=t),C=C===t?C:ze(se(C),0),O=O===t?O:se(O),P-=b?b.length:0,l&F){var D=d,B=b;d=b=t}var q=I?t:Wu(o),j=[o,l,f,d,b,D,B,x,C,O];if(q&&gw(j,q),o=j[0],l=j[1],f=j[2],d=j[3],b=j[4],O=j[9]=j[9]===t?I?0:o.length:ze(j[9]-P,0),!O&&l&(k|A)&&(l&=-25),!l||l==N)var X=Z_(o,l,f);else l==k||l==A?X=Q_(o,l,O):(l==T||l==(N|T))&&!b.length?X=ew(o,l,f,d):X=To.apply(t,j);var oe=q?Wd:_p;return wp(oe(X,j),o,l)}function up(o,l,f,d){return o===t||nn(o,oi[f])&&!ve.call(d,f)?l:o}function cp(o,l,f,d,b,x){return Me(o)&&Me(l)&&(x.set(l,o),Co(o,l,t,cp,x),x.delete(l)),o}function nw(o){return cs(o)?t:o}function fp(o,l,f,d,b,x){var C=f&S,O=o.length,I=l.length;if(O!=I&&!(C&&I>O))return!1;var P=x.get(o),D=x.get(l);if(P&&D)return P==l&&D==o;var B=-1,q=!0,j=f&E?new Nr:t;for(x.set(o,l),x.set(l,o);++B<O;){var X=o[B],oe=l[B];if(d)var Z=C?d(oe,X,B,l,o,x):d(X,oe,B,o,l,x);if(Z!==t){if(Z)continue;q=!1;break}if(j){if(!uu(l,function(ce,me){if(!ji(j,me)&&(X===ce||b(X,ce,f,d,x)))return j.push(me)})){q=!1;break}}else if(!(X===oe||b(X,oe,f,d,x))){q=!1;break}}return x.delete(o),x.delete(l),q}function rw(o,l,f,d,b,x,C){switch(f){case ei:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case Ji:return!(o.byteLength!=l.byteLength||!x(new fo(o),new fo(l)));case Wi:case Vi:case Ui:return nn(+o,+l);case Xs:return o.name==l.name&&o.message==l.message;case qi:case Ki:return o==l+"";case Zt:var O=mu;case Qt:var I=d&S;if(O||(O=so),o.size!=l.size&&!I)return!1;var P=C.get(o);if(P)return P==l;d|=E,C.set(o,l);var D=fp(O(o),O(l),d,b,x,C);return C.delete(o),D;case Qs:if(es)return es.call(o)==es.call(l)}return!1}function iw(o,l,f,d,b,x){var C=f&S,O=$u(o),I=O.length,P=$u(l),D=P.length;if(I!=D&&!C)return!1;for(var B=I;B--;){var q=O[B];if(!(C?q in l:ve.call(l,q)))return!1}var j=x.get(o),X=x.get(l);if(j&&X)return j==l&&X==o;var oe=!0;x.set(o,l),x.set(l,o);for(var Z=C;++B<I;){q=O[B];var ce=o[q],me=l[q];if(d)var Tt=C?d(me,ce,q,l,o,x):d(ce,me,q,o,l,x);if(!(Tt===t?ce===me||b(ce,me,f,d,x):Tt)){oe=!1;break}Z||(Z=q=="constructor")}if(oe&&!Z){var ot=o.constructor,Ot=l.constructor;ot!=Ot&&"constructor"in o&&"constructor"in l&&!(typeof ot=="function"&&ot instanceof ot&&typeof Ot=="function"&&Ot instanceof Ot)&&(oe=!1)}return x.delete(o),x.delete(l),oe}function On(o){return Ju(yp(o,t,kp),o+"")}function $u(o){return Id(o,Ve,Uu)}function Hu(o){return Id(o,pt,hp)}var Wu=bo?function(o){return bo.get(o)}:ac;function No(o){for(var l=o.name+"",f=li[l],d=ve.call(li,l)?f.length:0;d--;){var b=f[d],x=b.func;if(x==null||x==o)return b.name}return l}function hi(o){var l=ve.call(w,"placeholder")?w:o;return l.placeholder}function Y(){var o=w.iteratee||sc;return o=o===sc?Ld:o,arguments.length?o(arguments[0],arguments[1]):o}function Ro(o,l){var f=o.__data__;return hw(l)?f[typeof l=="string"?"string":"hash"]:f.map}function Vu(o){for(var l=Ve(o),f=l.length;f--;){var d=l[f],b=o[d];l[f]=[d,b,mp(b)]}return l}function Pr(o,l){var f=m2(o,l);return Rd(f)?f:t}function sw(o){var l=ve.call(o,Mr),f=o[Mr];try{o[Mr]=t;var d=!0}catch{}var b=uo.call(o);return d&&(l?o[Mr]=f:delete o[Mr]),b}var Uu=yu?function(o){return o==null?[]:(o=xe(o),Zn(yu(o),function(l){return bd.call(o,l)}))}:lc,hp=yu?function(o){for(var l=[];o;)Qn(l,Uu(o)),o=ho(o);return l}:lc,rt=it;(bu&&rt(new bu(new ArrayBuffer(1)))!=ei||Xi&&rt(new Xi)!=Zt||_u&&rt(_u.resolve())!=Th||ai&&rt(new ai)!=Qt||Zi&&rt(new Zi)!=Gi)&&(rt=function(o){var l=it(o),f=l==Cn?o.constructor:t,d=f?Dr(f):"";if(d)switch(d){case H2:return ei;case W2:return Zt;case V2:return Th;case U2:return Qt;case q2:return Gi}return l});function ow(o,l,f){for(var d=-1,b=f.length;++d<b;){var x=f[d],C=x.size;switch(x.type){case"drop":o+=C;break;case"dropRight":l-=C;break;case"take":l=nt(l,o+C);break;case"takeRight":o=ze(o,l-C);break}}return{start:o,end:l}}function aw(o){var l=o.match(db);return l?l[1].split(pb):[]}function dp(o,l,f){l=ir(l,o);for(var d=-1,b=l.length,x=!1;++d<b;){var C=dn(l[d]);if(!(x=o!=null&&f(o,C)))break;o=o[C]}return x||++d!=b?x:(b=o==null?0:o.length,!!b&&$o(b)&&Mn(C,b)&&(re(o)||Fr(o)))}function lw(o){var l=o.length,f=new o.constructor(l);return l&&typeof o[0]=="string"&&ve.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function pp(o){return typeof o.constructor=="function"&&!ls(o)?ui(ho(o)):{}}function uw(o,l,f){var d=o.constructor;switch(l){case Ji:return Fu(o);case Wi:case Vi:return new d(+o);case ei:return K_(o,f);case Vl:case Ul:case ql:case Kl:case Gl:case Jl:case jl:case Yl:case Xl:return Yd(o,f);case Zt:return new d;case Ui:case Ki:return new d(o);case qi:return G_(o);case Qt:return new d;case Qs:return J_(o)}}function cw(o,l){var f=l.length;if(!f)return o;var d=f-1;return l[d]=(f>1?"& ":"")+l[d],l=l.join(f>2?", ":" "),o.replace(hb,`{
|
|
46
46
|
/* [wrapped with `+l+`] */
|
|
47
|
-
`)}function fw(o){return re(o)||Fr(o)||!!(_d&&o&&o[_d])}function Mn(o,l){var f=typeof o;return l=l??Xn,!!l&&(f=="number"||f!="symbol"&&xb.test(o))&&o>-1&&o%1==0&&o<l}function st(o,l,f){if(!Me(f))return!1;var d=typeof l;return(d=="number"?dt(f)&&Mn(l,f.length):d=="string"&&l in f)?nn(f[l],o):!1}function qu(o,l){if(re(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||Tt(o)?!0:lb.test(o)||!ab.test(o)||l!=null&&o in xe(l)}function hw(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function Ku(o){var l=Io(o),f=w[l];if(typeof f!="function"||!(l in fe.prototype))return!1;if(o===f)return!0;var d=Wu(f);return!!d&&o===d[0]}function dw(o){return!!md&&md in o}var pw=oo?In:uc;function as(o){var l=o&&o.constructor,f=typeof l=="function"&&l.prototype||oi;return o===f}function mp(o){return o===o&&!Me(o)}function gp(o,l){return function(f){return f==null?!1:f[o]===l&&(l!==t||o in xe(f))}}function mw(o){var l=Fo(o,function(d){return f.size===h&&f.clear(),d}),f=l.cache;return l}function gw(o,l){var f=o[1],d=l[1],b=f|d,x=b<(N|g|U),C=d==U&&f==k||d==U&&f==W&&o[7].length<=l[8]||d==(U|W)&&l[7].length<=l[8]&&f==k;if(!(x||C))return o;d&N&&(o[2]=l[2],b|=f&N?0:v);var O=l[3];if(O){var I=o[3];o[3]=I?Zd(I,O,l[4]):O,o[4]=I?er(o[3],p):l[4]}return O=l[5],O&&(I=o[5],o[5]=I?Qd(I,O,l[6]):O,o[6]=I?er(o[5],p):l[6]),O=l[7],O&&(o[7]=O),d&U&&(o[8]=o[8]==null?l[8]:nt(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=b,o}function yw(o){var l=[];if(o!=null)for(var f in xe(o))l.push(f);return l}function bw(o){return lo.call(o)}function yp(o,l,f){return l=ze(l===t?o.length-1:l,0),function(){for(var d=arguments,b=-1,x=ze(d.length-l,0),C=R(x);++b<x;)C[b]=d[l+b];b=-1;for(var O=R(l+1);++b<l;)O[b]=d[b];return O[l]=f(C),Ct(o,this,O)}}function bp(o,l){return l.length<2?o:Lr(o,Vt(l,0,-1))}function _w(o,l){for(var f=o.length,d=nt(l.length,f),b=ht(o);d--;){var x=l[d];o[d]=Mn(x,f)?b[x]:t}return o}function Gu(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var _p=vp(Wd),ls=L2||function(o,l){return Xe.setTimeout(o,l)},Ju=vp(W_);function wp(o,l,f){var d=l+"";return Ju(o,cw(d,ww(aw(d),f)))}function vp(o){var l=0,f=0;return function(){var d=B2(),b=Sn-(d-f);if(f=d,b>0){if(++l>=vt)return arguments[0]}else l=0;return o.apply(t,arguments)}}function Ro(o,l){var f=-1,d=o.length,b=d-1;for(l=l===t?d:l;++f<l;){var x=Mu(f,b),C=o[x];o[x]=o[f],o[f]=C}return o.length=l,o}var Sp=mw(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(ub,function(f,d,b,x){l.push(b?x.replace(yb,"$1"):d||f)}),l});function dn(o){if(typeof o=="string"||Tt(o))return o;var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}function Dr(o){if(o!=null){try{return ao.call(o)}catch{}try{return o+""}catch{}}return""}function ww(o,l){return zt(Wl,function(f){var d="_."+f[0];l&f[1]&&!no(o,d)&&o.push(d)}),o.sort()}function xp(o){if(o instanceof fe)return o.clone();var l=new Ht(o.__wrapped__,o.__chain__);return l.__actions__=ht(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function vw(o,l,f){(f?st(o,l,f):l===t)?l=1:l=ze(ie(l),0);var d=o==null?0:o.length;if(!d||l<1)return[];for(var b=0,x=0,C=R(mo(d/l));b<d;)C[x++]=Vt(o,b,b+=l);return C}function Sw(o){for(var l=-1,f=o==null?0:o.length,d=0,b=[];++l<f;){var x=o[l];x&&(b[d++]=x)}return b}function xw(){var o=arguments.length;if(!o)return[];for(var l=R(o-1),f=arguments[0],d=o;d--;)l[d-1]=arguments[d];return Qn(re(f)?ht(f):[f],Ze(l,1))}var Cw=ue(function(o,l){return Le(o)?ts(o,Ze(l,1,Le,!0)):[]}),Ew=ue(function(o,l){var f=Ut(l);return Le(f)&&(f=t),Le(o)?ts(o,Ze(l,1,Le,!0),Y(f,2)):[]}),kw=ue(function(o,l){var f=Ut(l);return Le(f)&&(f=t),Le(o)?ts(o,Ze(l,1,Le,!0),t,f):[]});function Tw(o,l,f){var d=o==null?0:o.length;return d?(l=f||l===t?1:ie(l),Vt(o,l<0?0:l,d)):[]}function Aw(o,l,f){var d=o==null?0:o.length;return d?(l=f||l===t?1:ie(l),l=d-l,Vt(o,0,l<0?0:l)):[]}function Ow(o,l){return o&&o.length?Eo(o,Y(l,3),!0,!0):[]}function Mw(o,l){return o&&o.length?Eo(o,Y(l,3),!0):[]}function Iw(o,l,f,d){var b=o==null?0:o.length;return b?(f&&typeof f!="number"&&st(o,l,f)&&(f=0,d=b),x_(o,l,f,d)):[]}function Cp(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=f==null?0:ie(f);return b<0&&(b=ze(d+b,0)),ro(o,Y(l,3),b)}function Ep(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=d-1;return f!==t&&(b=ie(f),b=f<0?ze(d+b,0):nt(b,d-1)),ro(o,Y(l,3),b,!0)}function kp(o){var l=o==null?0:o.length;return l?Ze(o,1):[]}function Nw(o){var l=o==null?0:o.length;return l?Ze(o,St):[]}function Rw(o,l){var f=o==null?0:o.length;return f?(l=l===t?1:ie(l),Ze(o,l)):[]}function Lw(o){for(var l=-1,f=o==null?0:o.length,d={};++l<f;){var b=o[l];d[b[0]]=b[1]}return d}function Tp(o){return o&&o.length?o[0]:t}function Pw(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=f==null?0:ie(f);return b<0&&(b=ze(d+b,0)),ni(o,l,b)}function Dw(o){var l=o==null?0:o.length;return l?Vt(o,0,-1):[]}var Fw=ue(function(o){var l=Ae(o,Pu);return l.length&&l[0]===o[0]?Eu(l):[]}),Bw=ue(function(o){var l=Ut(o),f=Ae(o,Pu);return l===Ut(f)?l=t:f.pop(),f.length&&f[0]===o[0]?Eu(f,Y(l,2)):[]}),zw=ue(function(o){var l=Ut(o),f=Ae(o,Pu);return l=typeof l=="function"?l:t,l&&f.pop(),f.length&&f[0]===o[0]?Eu(f,t,l):[]});function $w(o,l){return o==null?"":D2.call(o,l)}function Ut(o){var l=o==null?0:o.length;return l?o[l-1]:t}function Hw(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=d;return f!==t&&(b=ie(f),b=b<0?ze(d+b,0):nt(b,d-1)),l===l?w2(o,l,b):ro(o,ad,b,!0)}function Ww(o,l){return o&&o.length?Bd(o,ie(l)):t}var Vw=ue(Ap);function Ap(o,l){return o&&o.length&&l&&l.length?Ou(o,l):o}function Uw(o,l,f){return o&&o.length&&l&&l.length?Ou(o,l,Y(f,2)):o}function qw(o,l,f){return o&&o.length&&l&&l.length?Ou(o,l,t,f):o}var Kw=On(function(o,l){var f=o==null?0:o.length,d=vu(o,l);return Hd(o,Ae(l,function(b){return Mn(b,f)?+b:b}).sort(Xd)),d});function Gw(o,l){var f=[];if(!(o&&o.length))return f;var d=-1,b=[],x=o.length;for(l=Y(l,3);++d<x;){var C=o[d];l(C,d,o)&&(f.push(C),b.push(d))}return Hd(o,b),f}function ju(o){return o==null?o:$2.call(o)}function Jw(o,l,f){var d=o==null?0:o.length;return d?(f&&typeof f!="number"&&st(o,l,f)?(l=0,f=d):(l=l==null?0:ie(l),f=f===t?d:ie(f)),Vt(o,l,f)):[]}function jw(o,l){return Co(o,l)}function Yw(o,l,f){return Nu(o,l,Y(f,2))}function Xw(o,l){var f=o==null?0:o.length;if(f){var d=Co(o,l);if(d<f&&nn(o[d],l))return d}return-1}function Zw(o,l){return Co(o,l,!0)}function Qw(o,l,f){return Nu(o,l,Y(f,2),!0)}function ev(o,l){var f=o==null?0:o.length;if(f){var d=Co(o,l,!0)-1;if(nn(o[d],l))return d}return-1}function tv(o){return o&&o.length?Vd(o):[]}function nv(o,l){return o&&o.length?Vd(o,Y(l,2)):[]}function rv(o){var l=o==null?0:o.length;return l?Vt(o,1,l):[]}function iv(o,l,f){return o&&o.length?(l=f||l===t?1:ie(l),Vt(o,0,l<0?0:l)):[]}function sv(o,l,f){var d=o==null?0:o.length;return d?(l=f||l===t?1:ie(l),l=d-l,Vt(o,l<0?0:l,d)):[]}function ov(o,l){return o&&o.length?Eo(o,Y(l,3),!1,!0):[]}function av(o,l){return o&&o.length?Eo(o,Y(l,3)):[]}var lv=ue(function(o){return rr(Ze(o,1,Le,!0))}),uv=ue(function(o){var l=Ut(o);return Le(l)&&(l=t),rr(Ze(o,1,Le,!0),Y(l,2))}),cv=ue(function(o){var l=Ut(o);return l=typeof l=="function"?l:t,rr(Ze(o,1,Le,!0),t,l)});function fv(o){return o&&o.length?rr(o):[]}function hv(o,l){return o&&o.length?rr(o,Y(l,2)):[]}function dv(o,l){return l=typeof l=="function"?l:t,o&&o.length?rr(o,t,l):[]}function Yu(o){if(!(o&&o.length))return[];var l=0;return o=Zn(o,function(f){if(Le(f))return l=ze(f.length,l),!0}),du(l,function(f){return Ae(o,cu(f))})}function Op(o,l){if(!(o&&o.length))return[];var f=Yu(o);return l==null?f:Ae(f,function(d){return Ct(l,t,d)})}var pv=ue(function(o,l){return Le(o)?ts(o,l):[]}),mv=ue(function(o){return Lu(Zn(o,Le))}),gv=ue(function(o){var l=Ut(o);return Le(l)&&(l=t),Lu(Zn(o,Le),Y(l,2))}),yv=ue(function(o){var l=Ut(o);return l=typeof l=="function"?l:t,Lu(Zn(o,Le),t,l)}),bv=ue(Yu);function _v(o,l){return Gd(o||[],l||[],es)}function wv(o,l){return Gd(o||[],l||[],is)}var vv=ue(function(o){var l=o.length,f=l>1?o[l-1]:t;return f=typeof f=="function"?(o.pop(),f):t,Op(o,f)});function Mp(o){var l=w(o);return l.__chain__=!0,l}function Sv(o,l){return l(o),o}function Lo(o,l){return l(o)}var xv=On(function(o){var l=o.length,f=l?o[0]:0,d=this.__wrapped__,b=function(x){return vu(x,o)};return l>1||this.__actions__.length||!(d instanceof fe)||!Mn(f)?this.thru(b):(d=d.slice(f,+f+(l?1:0)),d.__actions__.push({func:Lo,args:[b],thisArg:t}),new Ht(d,this.__chain__).thru(function(x){return l&&!x.length&&x.push(t),x}))});function Cv(){return Mp(this)}function Ev(){return new Ht(this.value(),this.__chain__)}function kv(){this.__values__===t&&(this.__values__=Up(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function Tv(){return this}function Av(o){for(var l,f=this;f instanceof _o;){var d=xp(f);d.__index__=0,d.__values__=t,l?b.__wrapped__=d:l=d;var b=d;f=f.__wrapped__}return b.__wrapped__=o,l}function Ov(){var o=this.__wrapped__;if(o instanceof fe){var l=o;return this.__actions__.length&&(l=new fe(this)),l=l.reverse(),l.__actions__.push({func:Lo,args:[ju],thisArg:t}),new Ht(l,this.__chain__)}return this.thru(ju)}function Mv(){return Kd(this.__wrapped__,this.__actions__)}var Iv=ko(function(o,l,f){ve.call(o,f)?++o[f]:Tn(o,f,1)});function Nv(o,l,f){var d=re(o)?sd:S_;return f&&st(o,l,f)&&(l=t),d(o,Y(l,3))}function Rv(o,l){var f=re(o)?Zn:Od;return f(o,Y(l,3))}var Lv=rp(Cp),Pv=rp(Ep);function Dv(o,l){return Ze(Po(o,l),1)}function Fv(o,l){return Ze(Po(o,l),St)}function Bv(o,l,f){return f=f===t?1:ie(f),Ze(Po(o,l),f)}function Ip(o,l){var f=re(o)?zt:nr;return f(o,Y(l,3))}function Np(o,l){var f=re(o)?r2:Ad;return f(o,Y(l,3))}var zv=ko(function(o,l,f){ve.call(o,f)?o[f].push(l):Tn(o,f,[l])});function $v(o,l,f,d){o=dt(o)?o:pi(o),f=f&&!d?ie(f):0;var b=o.length;return f<0&&(f=ze(b+f,0)),$o(o)?f<=b&&o.indexOf(l,f)>-1:!!b&&ni(o,l,f)>-1}var Hv=ue(function(o,l,f){var d=-1,b=typeof l=="function",x=dt(o)?R(o.length):[];return nr(o,function(C){x[++d]=b?Ct(l,C,f):ns(C,l,f)}),x}),Wv=ko(function(o,l,f){Tn(o,f,l)});function Po(o,l){var f=re(o)?Ae:Pd;return f(o,Y(l,3))}function Vv(o,l,f,d){return o==null?[]:(re(l)||(l=l==null?[]:[l]),f=d?t:f,re(f)||(f=f==null?[]:[f]),zd(o,l,f))}var Uv=ko(function(o,l,f){o[f?0:1].push(l)},function(){return[[],[]]});function qv(o,l,f){var d=re(o)?lu:ud,b=arguments.length<3;return d(o,Y(l,4),f,b,nr)}function Kv(o,l,f){var d=re(o)?i2:ud,b=arguments.length<3;return d(o,Y(l,4),f,b,Ad)}function Gv(o,l){var f=re(o)?Zn:Od;return f(o,Bo(Y(l,3)))}function Jv(o){var l=re(o)?Cd:$_;return l(o)}function jv(o,l,f){(f?st(o,l,f):l===t)?l=1:l=ie(l);var d=re(o)?y_:H_;return d(o,l)}function Yv(o){var l=re(o)?b_:V_;return l(o)}function Xv(o){if(o==null)return 0;if(dt(o))return $o(o)?ii(o):o.length;var l=rt(o);return l==Zt||l==Qt?o.size:Tu(o).length}function Zv(o,l,f){var d=re(o)?uu:U_;return f&&st(o,l,f)&&(l=t),d(o,Y(l,3))}var Qv=ue(function(o,l){if(o==null)return[];var f=l.length;return f>1&&st(o,l[0],l[1])?l=[]:f>2&&st(l[0],l[1],l[2])&&(l=[l[0]]),zd(o,Ze(l,1),[])}),Do=R2||function(){return Xe.Date.now()};function eS(o,l){if(typeof l!="function")throw new $t(a);return o=ie(o),function(){if(--o<1)return l.apply(this,arguments)}}function Rp(o,l,f){return l=f?t:l,l=o&&l==null?o.length:l,An(o,U,t,t,t,t,l)}function Lp(o,l){var f;if(typeof l!="function")throw new $t(a);return o=ie(o),function(){return--o>0&&(f=l.apply(this,arguments)),o<=1&&(l=t),f}}var Xu=ue(function(o,l,f){var d=N;if(f.length){var b=er(f,hi(Xu));d|=A}return An(o,d,l,f,b)}),Pp=ue(function(o,l,f){var d=N|g;if(f.length){var b=er(f,hi(Pp));d|=A}return An(l,d,o,f,b)});function Dp(o,l,f){l=f?t:l;var d=An(o,k,t,t,t,t,t,l);return d.placeholder=Dp.placeholder,d}function Fp(o,l,f){l=f?t:l;var d=An(o,T,t,t,t,t,t,l);return d.placeholder=Fp.placeholder,d}function Bp(o,l,f){var d,b,x,C,O,I,P=0,D=!1,B=!1,q=!0;if(typeof o!="function")throw new $t(a);l=qt(l)||0,Me(f)&&(D=!!f.leading,B="maxWait"in f,x=B?ze(qt(f.maxWait)||0,l):x,q="trailing"in f?!!f.trailing:q);function j(Pe){var rn=d,Rn=b;return d=b=t,P=Pe,C=o.apply(Rn,rn),C}function X(Pe){return P=Pe,O=ls(ce,l),D?j(Pe):C}function se(Pe){var rn=Pe-I,Rn=Pe-P,rm=l-rn;return B?nt(rm,x-Rn):rm}function Z(Pe){var rn=Pe-I,Rn=Pe-P;return I===t||rn>=l||rn<0||B&&Rn>=x}function ce(){var Pe=Do();if(Z(Pe))return me(Pe);O=ls(ce,se(Pe))}function me(Pe){return O=t,q&&d?j(Pe):(d=b=t,C)}function At(){O!==t&&Jd(O),P=0,d=I=b=O=t}function ot(){return O===t?C:me(Do())}function Ot(){var Pe=Do(),rn=Z(Pe);if(d=arguments,b=this,I=Pe,rn){if(O===t)return X(I);if(B)return Jd(O),O=ls(ce,l),j(I)}return O===t&&(O=ls(ce,l)),C}return Ot.cancel=At,Ot.flush=ot,Ot}var tS=ue(function(o,l){return Td(o,1,l)}),nS=ue(function(o,l,f){return Td(o,qt(l)||0,f)});function rS(o){return An(o,ee)}function Fo(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new $t(a);var f=function(){var d=arguments,b=l?l.apply(this,d):d[0],x=f.cache;if(x.has(b))return x.get(b);var C=o.apply(this,d);return f.cache=x.set(b,C)||x,C};return f.cache=new(Fo.Cache||kn),f}Fo.Cache=kn;function Bo(o){if(typeof o!="function")throw new $t(a);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function iS(o){return Lp(2,o)}var sS=q_(function(o,l){l=l.length==1&&re(l[0])?Ae(l[0],Et(Y())):Ae(Ze(l,1),Et(Y()));var f=l.length;return ue(function(d){for(var b=-1,x=nt(d.length,f);++b<x;)d[b]=l[b].call(this,d[b]);return Ct(o,this,d)})}),Zu=ue(function(o,l){var f=er(l,hi(Zu));return An(o,A,t,l,f)}),zp=ue(function(o,l){var f=er(l,hi(zp));return An(o,F,t,l,f)}),oS=On(function(o,l){return An(o,W,t,t,t,l)});function aS(o,l){if(typeof o!="function")throw new $t(a);return l=l===t?l:ie(l),ue(o,l)}function lS(o,l){if(typeof o!="function")throw new $t(a);return l=l==null?0:ze(ie(l),0),ue(function(f){var d=f[l],b=sr(f,0,l);return d&&Qn(b,d),Ct(o,this,b)})}function uS(o,l,f){var d=!0,b=!0;if(typeof o!="function")throw new $t(a);return Me(f)&&(d="leading"in f?!!f.leading:d,b="trailing"in f?!!f.trailing:b),Bp(o,l,{leading:d,maxWait:l,trailing:b})}function cS(o){return Rp(o,1)}function fS(o,l){return Zu(Du(l),o)}function hS(){if(!arguments.length)return[];var o=arguments[0];return re(o)?o:[o]}function dS(o){return Wt(o,_)}function pS(o,l){return l=typeof l=="function"?l:t,Wt(o,_,l)}function mS(o){return Wt(o,m|_)}function gS(o,l){return l=typeof l=="function"?l:t,Wt(o,m|_,l)}function yS(o,l){return l==null||kd(o,l,Ve(l))}function nn(o,l){return o===l||o!==o&&l!==l}var bS=Mo(Cu),_S=Mo(function(o,l){return o>=l}),Fr=Nd(function(){return arguments}())?Nd:function(o){return Ie(o)&&ve.call(o,"callee")&&!bd.call(o,"callee")},re=R.isArray,wS=Qh?Et(Qh):A_;function dt(o){return o!=null&&zo(o.length)&&!In(o)}function Le(o){return Ie(o)&&dt(o)}function vS(o){return o===!0||o===!1||Ie(o)&&it(o)==Hi}var or=P2||uc,SS=ed?Et(ed):O_;function xS(o){return Ie(o)&&o.nodeType===1&&!us(o)}function CS(o){if(o==null)return!0;if(dt(o)&&(re(o)||typeof o=="string"||typeof o.splice=="function"||or(o)||di(o)||Fr(o)))return!o.length;var l=rt(o);if(l==Zt||l==Qt)return!o.size;if(as(o))return!Tu(o).length;for(var f in o)if(ve.call(o,f))return!1;return!0}function ES(o,l){return rs(o,l)}function kS(o,l,f){f=typeof f=="function"?f:t;var d=f?f(o,l):t;return d===t?rs(o,l,t,f):!!d}function Qu(o){if(!Ie(o))return!1;var l=it(o);return l==Ys||l==jy||typeof o.message=="string"&&typeof o.name=="string"&&!us(o)}function TS(o){return typeof o=="number"&&wd(o)}function In(o){if(!Me(o))return!1;var l=it(o);return l==Xs||l==Th||l==Jy||l==Xy}function $p(o){return typeof o=="number"&&o==ie(o)}function zo(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=Xn}function Me(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Ie(o){return o!=null&&typeof o=="object"}var Hp=td?Et(td):I_;function AS(o,l){return o===l||ku(o,l,Vu(l))}function OS(o,l,f){return f=typeof f=="function"?f:t,ku(o,l,Vu(l),f)}function MS(o){return Wp(o)&&o!=+o}function IS(o){if(pw(o))throw new ne(s);return Rd(o)}function NS(o){return o===null}function RS(o){return o==null}function Wp(o){return typeof o=="number"||Ie(o)&&it(o)==Vi}function us(o){if(!Ie(o)||it(o)!=Cn)return!1;var l=fo(o);if(l===null)return!0;var f=ve.call(l,"constructor")&&l.constructor;return typeof f=="function"&&f instanceof f&&ao.call(f)==O2}var ec=nd?Et(nd):N_;function LS(o){return $p(o)&&o>=-9007199254740991&&o<=Xn}var Vp=rd?Et(rd):R_;function $o(o){return typeof o=="string"||!re(o)&&Ie(o)&&it(o)==qi}function Tt(o){return typeof o=="symbol"||Ie(o)&&it(o)==Zs}var di=id?Et(id):L_;function PS(o){return o===t}function DS(o){return Ie(o)&&rt(o)==Ki}function FS(o){return Ie(o)&&it(o)==Qy}var BS=Mo(Au),zS=Mo(function(o,l){return o<=l});function Up(o){if(!o)return[];if(dt(o))return $o(o)?en(o):ht(o);if(ji&&o[ji])return y2(o[ji]());var l=rt(o),f=l==Zt?mu:l==Qt?io:pi;return f(o)}function Nn(o){if(!o)return o===0?o:0;if(o=qt(o),o===St||o===-1/0){var l=o<0?-1:1;return l*Js}return o===o?o:0}function ie(o){var l=Nn(o),f=l%1;return l===l?f?l-f:l:0}function qp(o){return o?Rr(ie(o),0,xt):0}function qt(o){if(typeof o=="number")return o;if(Tt(o))return cn;if(Me(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=Me(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=cd(o);var f=wb.test(o);return f||Sb.test(o)?e2(o.slice(2),f?2:8):_b.test(o)?cn:+o}function Kp(o){return hn(o,pt(o))}function $S(o){return o?Rr(ie(o),-9007199254740991,Xn):o===0?o:0}function _e(o){return o==null?"":kt(o)}var HS=ci(function(o,l){if(as(l)||dt(l)){hn(l,Ve(l),o);return}for(var f in l)ve.call(l,f)&&es(o,f,l[f])}),Gp=ci(function(o,l){hn(l,pt(l),o)}),Ho=ci(function(o,l,f,d){hn(l,pt(l),o,d)}),WS=ci(function(o,l,f,d){hn(l,Ve(l),o,d)}),VS=On(vu);function US(o,l){var f=ui(o);return l==null?f:Ed(f,l)}var qS=ue(function(o,l){o=xe(o);var f=-1,d=l.length,b=d>2?l[2]:t;for(b&&st(l[0],l[1],b)&&(d=1);++f<d;)for(var x=l[f],C=pt(x),O=-1,I=C.length;++O<I;){var P=C[O],D=o[P];(D===t||nn(D,oi[P])&&!ve.call(o,P))&&(o[P]=x[P])}return o}),KS=ue(function(o){return o.push(t,cp),Ct(Jp,t,o)});function GS(o,l){return od(o,Y(l,3),fn)}function JS(o,l){return od(o,Y(l,3),xu)}function jS(o,l){return o==null?o:Su(o,Y(l,3),pt)}function YS(o,l){return o==null?o:Md(o,Y(l,3),pt)}function XS(o,l){return o&&fn(o,Y(l,3))}function ZS(o,l){return o&&xu(o,Y(l,3))}function QS(o){return o==null?[]:So(o,Ve(o))}function ex(o){return o==null?[]:So(o,pt(o))}function tc(o,l,f){var d=o==null?t:Lr(o,l);return d===t?f:d}function tx(o,l){return o!=null&&dp(o,l,C_)}function nc(o,l){return o!=null&&dp(o,l,E_)}var nx=sp(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=lo.call(l)),o[l]=f},ic(mt)),rx=sp(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=lo.call(l)),ve.call(o,l)?o[l].push(f):o[l]=[f]},Y),ix=ue(ns);function Ve(o){return dt(o)?xd(o):Tu(o)}function pt(o){return dt(o)?xd(o,!0):P_(o)}function sx(o,l){var f={};return l=Y(l,3),fn(o,function(d,b,x){Tn(f,l(d,b,x),d)}),f}function ox(o,l){var f={};return l=Y(l,3),fn(o,function(d,b,x){Tn(f,b,l(d,b,x))}),f}var ax=ci(function(o,l,f){xo(o,l,f)}),Jp=ci(function(o,l,f,d){xo(o,l,f,d)}),lx=On(function(o,l){var f={};if(o==null)return f;var d=!1;l=Ae(l,function(x){return x=ir(x,o),d||(d=x.length>1),x}),hn(o,Hu(o),f),d&&(f=Wt(f,m|y|_,nw));for(var b=l.length;b--;)Ru(f,l[b]);return f});function ux(o,l){return jp(o,Bo(Y(l)))}var cx=On(function(o,l){return o==null?{}:F_(o,l)});function jp(o,l){if(o==null)return{};var f=Ae(Hu(o),function(d){return[d]});return l=Y(l),$d(o,f,function(d,b){return l(d,b[0])})}function fx(o,l,f){l=ir(l,o);var d=-1,b=l.length;for(b||(b=1,o=t);++d<b;){var x=o==null?t:o[dn(l[d])];x===t&&(d=b,x=f),o=In(x)?x.call(o):x}return o}function hx(o,l,f){return o==null?o:is(o,l,f)}function dx(o,l,f,d){return d=typeof d=="function"?d:t,o==null?o:is(o,l,f,d)}var Yp=lp(Ve),Xp=lp(pt);function px(o,l,f){var d=re(o),b=d||or(o)||di(o);if(l=Y(l,4),f==null){var x=o&&o.constructor;b?f=d?new x:[]:Me(o)?f=In(x)?ui(fo(o)):{}:f={}}return(b?zt:fn)(o,function(C,O,I){return l(f,C,O,I)}),f}function mx(o,l){return o==null?!0:Ru(o,l)}function gx(o,l,f){return o==null?o:qd(o,l,Du(f))}function yx(o,l,f,d){return d=typeof d=="function"?d:t,o==null?o:qd(o,l,Du(f),d)}function pi(o){return o==null?[]:pu(o,Ve(o))}function bx(o){return o==null?[]:pu(o,pt(o))}function _x(o,l,f){return f===t&&(f=l,l=t),f!==t&&(f=qt(f),f=f===f?f:0),l!==t&&(l=qt(l),l=l===l?l:0),Rr(qt(o),l,f)}function wx(o,l,f){return l=Nn(l),f===t?(f=l,l=0):f=Nn(f),o=qt(o),k_(o,l,f)}function vx(o,l,f){if(f&&typeof f!="boolean"&&st(o,l,f)&&(l=f=t),f===t&&(typeof l=="boolean"?(f=l,l=t):typeof o=="boolean"&&(f=o,o=t)),o===t&&l===t?(o=0,l=1):(o=Nn(o),l===t?(l=o,o=0):l=Nn(l)),o>l){var d=o;o=l,l=d}if(f||o%1||l%1){var b=vd();return nt(o+b*(l-o+Qb("1e-"+((b+"").length-1))),l)}return Mu(o,l)}var Sx=fi(function(o,l,f){return l=l.toLowerCase(),o+(f?Zp(l):l)});function Zp(o){return rc(_e(o).toLowerCase())}function Qp(o){return o=_e(o),o&&o.replace(Cb,h2).replace(Vb,"")}function xx(o,l,f){o=_e(o),l=kt(l);var d=o.length;f=f===t?d:Rr(ie(f),0,d);var b=f;return f-=l.length,f>=0&&o.slice(f,b)==l}function Cx(o){return o=_e(o),o&&ib.test(o)?o.replace(Mh,d2):o}function Ex(o){return o=_e(o),o&&cb.test(o)?o.replace(Zl,"\\$&"):o}var kx=fi(function(o,l,f){return o+(f?"-":"")+l.toLowerCase()}),Tx=fi(function(o,l,f){return o+(f?" ":"")+l.toLowerCase()}),Ax=np("toLowerCase");function Ox(o,l,f){o=_e(o),l=ie(l);var d=l?ii(o):0;if(!l||d>=l)return o;var b=(l-d)/2;return Oo(go(b),f)+o+Oo(mo(b),f)}function Mx(o,l,f){o=_e(o),l=ie(l);var d=l?ii(o):0;return l&&d<l?o+Oo(l-d,f):o}function Ix(o,l,f){o=_e(o),l=ie(l);var d=l?ii(o):0;return l&&d<l?Oo(l-d,f)+o:o}function Nx(o,l,f){return f||l==null?l=0:l&&(l=+l),z2(_e(o).replace(Ql,""),l||0)}function Rx(o,l,f){return(f?st(o,l,f):l===t)?l=1:l=ie(l),Iu(_e(o),l)}function Lx(){var o=arguments,l=_e(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var Px=fi(function(o,l,f){return o+(f?"_":"")+l.toLowerCase()});function Dx(o,l,f){return f&&typeof f!="number"&&st(o,l,f)&&(l=f=t),f=f===t?xt:f>>>0,f?(o=_e(o),o&&(typeof l=="string"||l!=null&&!ec(l))&&(l=kt(l),!l&&ri(o))?sr(en(o),0,f):o.split(l,f)):[]}var Fx=fi(function(o,l,f){return o+(f?" ":"")+rc(l)});function Bx(o,l,f){return o=_e(o),f=f==null?0:Rr(ie(f),0,o.length),l=kt(l),o.slice(f,f+l.length)==l}function zx(o,l,f){var d=w.templateSettings;f&&st(o,l,f)&&(l=t),o=_e(o),l=Ho({},l,d,up);var b=Ho({},l.imports,d.imports,up),x=Ve(b),C=pu(b,x),O,I,P=0,D=l.interpolate||Qs,B="__p += '",q=gu((l.escape||Qs).source+"|"+D.source+"|"+(D===Ih?bb:Qs).source+"|"+(l.evaluate||Qs).source+"|$","g"),j="//# sourceURL="+(ve.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jb+"]")+`
|
|
48
|
-
`;o.replace(q,function(Z,ce,me,
|
|
47
|
+
`)}function fw(o){return re(o)||Fr(o)||!!(_d&&o&&o[_d])}function Mn(o,l){var f=typeof o;return l=l??Xn,!!l&&(f=="number"||f!="symbol"&&xb.test(o))&&o>-1&&o%1==0&&o<l}function st(o,l,f){if(!Me(f))return!1;var d=typeof l;return(d=="number"?dt(f)&&Mn(l,f.length):d=="string"&&l in f)?nn(f[l],o):!1}function qu(o,l){if(re(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||At(o)?!0:lb.test(o)||!ab.test(o)||l!=null&&o in xe(l)}function hw(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function Ku(o){var l=No(o),f=w[l];if(typeof f!="function"||!(l in fe.prototype))return!1;if(o===f)return!0;var d=Wu(f);return!!d&&o===d[0]}function dw(o){return!!md&&md in o}var pw=ao?In:uc;function ls(o){var l=o&&o.constructor,f=typeof l=="function"&&l.prototype||oi;return o===f}function mp(o){return o===o&&!Me(o)}function gp(o,l){return function(f){return f==null?!1:f[o]===l&&(l!==t||o in xe(f))}}function mw(o){var l=Bo(o,function(d){return f.size===h&&f.clear(),d}),f=l.cache;return l}function gw(o,l){var f=o[1],d=l[1],b=f|d,x=b<(N|g|U),C=d==U&&f==k||d==U&&f==W&&o[7].length<=l[8]||d==(U|W)&&l[7].length<=l[8]&&f==k;if(!(x||C))return o;d&N&&(o[2]=l[2],b|=f&N?0:v);var O=l[3];if(O){var I=o[3];o[3]=I?Zd(I,O,l[4]):O,o[4]=I?er(o[3],p):l[4]}return O=l[5],O&&(I=o[5],o[5]=I?Qd(I,O,l[6]):O,o[6]=I?er(o[5],p):l[6]),O=l[7],O&&(o[7]=O),d&U&&(o[8]=o[8]==null?l[8]:nt(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=b,o}function yw(o){var l=[];if(o!=null)for(var f in xe(o))l.push(f);return l}function bw(o){return uo.call(o)}function yp(o,l,f){return l=ze(l===t?o.length-1:l,0),function(){for(var d=arguments,b=-1,x=ze(d.length-l,0),C=R(x);++b<x;)C[b]=d[l+b];b=-1;for(var O=R(l+1);++b<l;)O[b]=d[b];return O[l]=f(C),Ct(o,this,O)}}function bp(o,l){return l.length<2?o:Lr(o,Vt(l,0,-1))}function _w(o,l){for(var f=o.length,d=nt(l.length,f),b=ht(o);d--;){var x=l[d];o[d]=Mn(x,f)?b[x]:t}return o}function Gu(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var _p=vp(Wd),us=L2||function(o,l){return Xe.setTimeout(o,l)},Ju=vp(W_);function wp(o,l,f){var d=l+"";return Ju(o,cw(d,ww(aw(d),f)))}function vp(o){var l=0,f=0;return function(){var d=B2(),b=Sn-(d-f);if(f=d,b>0){if(++l>=vt)return arguments[0]}else l=0;return o.apply(t,arguments)}}function Lo(o,l){var f=-1,d=o.length,b=d-1;for(l=l===t?d:l;++f<l;){var x=Mu(f,b),C=o[x];o[x]=o[f],o[f]=C}return o.length=l,o}var Sp=mw(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(ub,function(f,d,b,x){l.push(b?x.replace(yb,"$1"):d||f)}),l});function dn(o){if(typeof o=="string"||At(o))return o;var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}function Dr(o){if(o!=null){try{return lo.call(o)}catch{}try{return o+""}catch{}}return""}function ww(o,l){return zt(Wl,function(f){var d="_."+f[0];l&f[1]&&!ro(o,d)&&o.push(d)}),o.sort()}function xp(o){if(o instanceof fe)return o.clone();var l=new Ht(o.__wrapped__,o.__chain__);return l.__actions__=ht(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function vw(o,l,f){(f?st(o,l,f):l===t)?l=1:l=ze(se(l),0);var d=o==null?0:o.length;if(!d||l<1)return[];for(var b=0,x=0,C=R(go(d/l));b<d;)C[x++]=Vt(o,b,b+=l);return C}function Sw(o){for(var l=-1,f=o==null?0:o.length,d=0,b=[];++l<f;){var x=o[l];x&&(b[d++]=x)}return b}function xw(){var o=arguments.length;if(!o)return[];for(var l=R(o-1),f=arguments[0],d=o;d--;)l[d-1]=arguments[d];return Qn(re(f)?ht(f):[f],Ze(l,1))}var Cw=ue(function(o,l){return Le(o)?ns(o,Ze(l,1,Le,!0)):[]}),Ew=ue(function(o,l){var f=Ut(l);return Le(f)&&(f=t),Le(o)?ns(o,Ze(l,1,Le,!0),Y(f,2)):[]}),kw=ue(function(o,l){var f=Ut(l);return Le(f)&&(f=t),Le(o)?ns(o,Ze(l,1,Le,!0),t,f):[]});function Aw(o,l,f){var d=o==null?0:o.length;return d?(l=f||l===t?1:se(l),Vt(o,l<0?0:l,d)):[]}function Tw(o,l,f){var d=o==null?0:o.length;return d?(l=f||l===t?1:se(l),l=d-l,Vt(o,0,l<0?0:l)):[]}function Ow(o,l){return o&&o.length?ko(o,Y(l,3),!0,!0):[]}function Mw(o,l){return o&&o.length?ko(o,Y(l,3),!0):[]}function Iw(o,l,f,d){var b=o==null?0:o.length;return b?(f&&typeof f!="number"&&st(o,l,f)&&(f=0,d=b),x_(o,l,f,d)):[]}function Cp(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=f==null?0:se(f);return b<0&&(b=ze(d+b,0)),io(o,Y(l,3),b)}function Ep(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=d-1;return f!==t&&(b=se(f),b=f<0?ze(d+b,0):nt(b,d-1)),io(o,Y(l,3),b,!0)}function kp(o){var l=o==null?0:o.length;return l?Ze(o,1):[]}function Nw(o){var l=o==null?0:o.length;return l?Ze(o,St):[]}function Rw(o,l){var f=o==null?0:o.length;return f?(l=l===t?1:se(l),Ze(o,l)):[]}function Lw(o){for(var l=-1,f=o==null?0:o.length,d={};++l<f;){var b=o[l];d[b[0]]=b[1]}return d}function Ap(o){return o&&o.length?o[0]:t}function Pw(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=f==null?0:se(f);return b<0&&(b=ze(d+b,0)),ni(o,l,b)}function Dw(o){var l=o==null?0:o.length;return l?Vt(o,0,-1):[]}var Fw=ue(function(o){var l=Te(o,Pu);return l.length&&l[0]===o[0]?Eu(l):[]}),Bw=ue(function(o){var l=Ut(o),f=Te(o,Pu);return l===Ut(f)?l=t:f.pop(),f.length&&f[0]===o[0]?Eu(f,Y(l,2)):[]}),zw=ue(function(o){var l=Ut(o),f=Te(o,Pu);return l=typeof l=="function"?l:t,l&&f.pop(),f.length&&f[0]===o[0]?Eu(f,t,l):[]});function $w(o,l){return o==null?"":D2.call(o,l)}function Ut(o){var l=o==null?0:o.length;return l?o[l-1]:t}function Hw(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=d;return f!==t&&(b=se(f),b=b<0?ze(d+b,0):nt(b,d-1)),l===l?w2(o,l,b):io(o,ad,b,!0)}function Ww(o,l){return o&&o.length?Bd(o,se(l)):t}var Vw=ue(Tp);function Tp(o,l){return o&&o.length&&l&&l.length?Ou(o,l):o}function Uw(o,l,f){return o&&o.length&&l&&l.length?Ou(o,l,Y(f,2)):o}function qw(o,l,f){return o&&o.length&&l&&l.length?Ou(o,l,t,f):o}var Kw=On(function(o,l){var f=o==null?0:o.length,d=vu(o,l);return Hd(o,Te(l,function(b){return Mn(b,f)?+b:b}).sort(Xd)),d});function Gw(o,l){var f=[];if(!(o&&o.length))return f;var d=-1,b=[],x=o.length;for(l=Y(l,3);++d<x;){var C=o[d];l(C,d,o)&&(f.push(C),b.push(d))}return Hd(o,b),f}function ju(o){return o==null?o:$2.call(o)}function Jw(o,l,f){var d=o==null?0:o.length;return d?(f&&typeof f!="number"&&st(o,l,f)?(l=0,f=d):(l=l==null?0:se(l),f=f===t?d:se(f)),Vt(o,l,f)):[]}function jw(o,l){return Eo(o,l)}function Yw(o,l,f){return Nu(o,l,Y(f,2))}function Xw(o,l){var f=o==null?0:o.length;if(f){var d=Eo(o,l);if(d<f&&nn(o[d],l))return d}return-1}function Zw(o,l){return Eo(o,l,!0)}function Qw(o,l,f){return Nu(o,l,Y(f,2),!0)}function ev(o,l){var f=o==null?0:o.length;if(f){var d=Eo(o,l,!0)-1;if(nn(o[d],l))return d}return-1}function tv(o){return o&&o.length?Vd(o):[]}function nv(o,l){return o&&o.length?Vd(o,Y(l,2)):[]}function rv(o){var l=o==null?0:o.length;return l?Vt(o,1,l):[]}function iv(o,l,f){return o&&o.length?(l=f||l===t?1:se(l),Vt(o,0,l<0?0:l)):[]}function sv(o,l,f){var d=o==null?0:o.length;return d?(l=f||l===t?1:se(l),l=d-l,Vt(o,l<0?0:l,d)):[]}function ov(o,l){return o&&o.length?ko(o,Y(l,3),!1,!0):[]}function av(o,l){return o&&o.length?ko(o,Y(l,3)):[]}var lv=ue(function(o){return rr(Ze(o,1,Le,!0))}),uv=ue(function(o){var l=Ut(o);return Le(l)&&(l=t),rr(Ze(o,1,Le,!0),Y(l,2))}),cv=ue(function(o){var l=Ut(o);return l=typeof l=="function"?l:t,rr(Ze(o,1,Le,!0),t,l)});function fv(o){return o&&o.length?rr(o):[]}function hv(o,l){return o&&o.length?rr(o,Y(l,2)):[]}function dv(o,l){return l=typeof l=="function"?l:t,o&&o.length?rr(o,t,l):[]}function Yu(o){if(!(o&&o.length))return[];var l=0;return o=Zn(o,function(f){if(Le(f))return l=ze(f.length,l),!0}),du(l,function(f){return Te(o,cu(f))})}function Op(o,l){if(!(o&&o.length))return[];var f=Yu(o);return l==null?f:Te(f,function(d){return Ct(l,t,d)})}var pv=ue(function(o,l){return Le(o)?ns(o,l):[]}),mv=ue(function(o){return Lu(Zn(o,Le))}),gv=ue(function(o){var l=Ut(o);return Le(l)&&(l=t),Lu(Zn(o,Le),Y(l,2))}),yv=ue(function(o){var l=Ut(o);return l=typeof l=="function"?l:t,Lu(Zn(o,Le),t,l)}),bv=ue(Yu);function _v(o,l){return Gd(o||[],l||[],ts)}function wv(o,l){return Gd(o||[],l||[],ss)}var vv=ue(function(o){var l=o.length,f=l>1?o[l-1]:t;return f=typeof f=="function"?(o.pop(),f):t,Op(o,f)});function Mp(o){var l=w(o);return l.__chain__=!0,l}function Sv(o,l){return l(o),o}function Po(o,l){return l(o)}var xv=On(function(o){var l=o.length,f=l?o[0]:0,d=this.__wrapped__,b=function(x){return vu(x,o)};return l>1||this.__actions__.length||!(d instanceof fe)||!Mn(f)?this.thru(b):(d=d.slice(f,+f+(l?1:0)),d.__actions__.push({func:Po,args:[b],thisArg:t}),new Ht(d,this.__chain__).thru(function(x){return l&&!x.length&&x.push(t),x}))});function Cv(){return Mp(this)}function Ev(){return new Ht(this.value(),this.__chain__)}function kv(){this.__values__===t&&(this.__values__=Up(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function Av(){return this}function Tv(o){for(var l,f=this;f instanceof wo;){var d=xp(f);d.__index__=0,d.__values__=t,l?b.__wrapped__=d:l=d;var b=d;f=f.__wrapped__}return b.__wrapped__=o,l}function Ov(){var o=this.__wrapped__;if(o instanceof fe){var l=o;return this.__actions__.length&&(l=new fe(this)),l=l.reverse(),l.__actions__.push({func:Po,args:[ju],thisArg:t}),new Ht(l,this.__chain__)}return this.thru(ju)}function Mv(){return Kd(this.__wrapped__,this.__actions__)}var Iv=Ao(function(o,l,f){ve.call(o,f)?++o[f]:An(o,f,1)});function Nv(o,l,f){var d=re(o)?sd:S_;return f&&st(o,l,f)&&(l=t),d(o,Y(l,3))}function Rv(o,l){var f=re(o)?Zn:Od;return f(o,Y(l,3))}var Lv=rp(Cp),Pv=rp(Ep);function Dv(o,l){return Ze(Do(o,l),1)}function Fv(o,l){return Ze(Do(o,l),St)}function Bv(o,l,f){return f=f===t?1:se(f),Ze(Do(o,l),f)}function Ip(o,l){var f=re(o)?zt:nr;return f(o,Y(l,3))}function Np(o,l){var f=re(o)?r2:Td;return f(o,Y(l,3))}var zv=Ao(function(o,l,f){ve.call(o,f)?o[f].push(l):An(o,f,[l])});function $v(o,l,f,d){o=dt(o)?o:pi(o),f=f&&!d?se(f):0;var b=o.length;return f<0&&(f=ze(b+f,0)),Ho(o)?f<=b&&o.indexOf(l,f)>-1:!!b&&ni(o,l,f)>-1}var Hv=ue(function(o,l,f){var d=-1,b=typeof l=="function",x=dt(o)?R(o.length):[];return nr(o,function(C){x[++d]=b?Ct(l,C,f):rs(C,l,f)}),x}),Wv=Ao(function(o,l,f){An(o,f,l)});function Do(o,l){var f=re(o)?Te:Pd;return f(o,Y(l,3))}function Vv(o,l,f,d){return o==null?[]:(re(l)||(l=l==null?[]:[l]),f=d?t:f,re(f)||(f=f==null?[]:[f]),zd(o,l,f))}var Uv=Ao(function(o,l,f){o[f?0:1].push(l)},function(){return[[],[]]});function qv(o,l,f){var d=re(o)?lu:ud,b=arguments.length<3;return d(o,Y(l,4),f,b,nr)}function Kv(o,l,f){var d=re(o)?i2:ud,b=arguments.length<3;return d(o,Y(l,4),f,b,Td)}function Gv(o,l){var f=re(o)?Zn:Od;return f(o,zo(Y(l,3)))}function Jv(o){var l=re(o)?Cd:$_;return l(o)}function jv(o,l,f){(f?st(o,l,f):l===t)?l=1:l=se(l);var d=re(o)?y_:H_;return d(o,l)}function Yv(o){var l=re(o)?b_:V_;return l(o)}function Xv(o){if(o==null)return 0;if(dt(o))return Ho(o)?ii(o):o.length;var l=rt(o);return l==Zt||l==Qt?o.size:Au(o).length}function Zv(o,l,f){var d=re(o)?uu:U_;return f&&st(o,l,f)&&(l=t),d(o,Y(l,3))}var Qv=ue(function(o,l){if(o==null)return[];var f=l.length;return f>1&&st(o,l[0],l[1])?l=[]:f>2&&st(l[0],l[1],l[2])&&(l=[l[0]]),zd(o,Ze(l,1),[])}),Fo=R2||function(){return Xe.Date.now()};function eS(o,l){if(typeof l!="function")throw new $t(a);return o=se(o),function(){if(--o<1)return l.apply(this,arguments)}}function Rp(o,l,f){return l=f?t:l,l=o&&l==null?o.length:l,Tn(o,U,t,t,t,t,l)}function Lp(o,l){var f;if(typeof l!="function")throw new $t(a);return o=se(o),function(){return--o>0&&(f=l.apply(this,arguments)),o<=1&&(l=t),f}}var Xu=ue(function(o,l,f){var d=N;if(f.length){var b=er(f,hi(Xu));d|=T}return Tn(o,d,l,f,b)}),Pp=ue(function(o,l,f){var d=N|g;if(f.length){var b=er(f,hi(Pp));d|=T}return Tn(l,d,o,f,b)});function Dp(o,l,f){l=f?t:l;var d=Tn(o,k,t,t,t,t,t,l);return d.placeholder=Dp.placeholder,d}function Fp(o,l,f){l=f?t:l;var d=Tn(o,A,t,t,t,t,t,l);return d.placeholder=Fp.placeholder,d}function Bp(o,l,f){var d,b,x,C,O,I,P=0,D=!1,B=!1,q=!0;if(typeof o!="function")throw new $t(a);l=qt(l)||0,Me(f)&&(D=!!f.leading,B="maxWait"in f,x=B?ze(qt(f.maxWait)||0,l):x,q="trailing"in f?!!f.trailing:q);function j(Pe){var rn=d,Rn=b;return d=b=t,P=Pe,C=o.apply(Rn,rn),C}function X(Pe){return P=Pe,O=us(ce,l),D?j(Pe):C}function oe(Pe){var rn=Pe-I,Rn=Pe-P,rm=l-rn;return B?nt(rm,x-Rn):rm}function Z(Pe){var rn=Pe-I,Rn=Pe-P;return I===t||rn>=l||rn<0||B&&Rn>=x}function ce(){var Pe=Fo();if(Z(Pe))return me(Pe);O=us(ce,oe(Pe))}function me(Pe){return O=t,q&&d?j(Pe):(d=b=t,C)}function Tt(){O!==t&&Jd(O),P=0,d=I=b=O=t}function ot(){return O===t?C:me(Fo())}function Ot(){var Pe=Fo(),rn=Z(Pe);if(d=arguments,b=this,I=Pe,rn){if(O===t)return X(I);if(B)return Jd(O),O=us(ce,l),j(I)}return O===t&&(O=us(ce,l)),C}return Ot.cancel=Tt,Ot.flush=ot,Ot}var tS=ue(function(o,l){return Ad(o,1,l)}),nS=ue(function(o,l,f){return Ad(o,qt(l)||0,f)});function rS(o){return Tn(o,ee)}function Bo(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new $t(a);var f=function(){var d=arguments,b=l?l.apply(this,d):d[0],x=f.cache;if(x.has(b))return x.get(b);var C=o.apply(this,d);return f.cache=x.set(b,C)||x,C};return f.cache=new(Bo.Cache||kn),f}Bo.Cache=kn;function zo(o){if(typeof o!="function")throw new $t(a);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function iS(o){return Lp(2,o)}var sS=q_(function(o,l){l=l.length==1&&re(l[0])?Te(l[0],Et(Y())):Te(Ze(l,1),Et(Y()));var f=l.length;return ue(function(d){for(var b=-1,x=nt(d.length,f);++b<x;)d[b]=l[b].call(this,d[b]);return Ct(o,this,d)})}),Zu=ue(function(o,l){var f=er(l,hi(Zu));return Tn(o,T,t,l,f)}),zp=ue(function(o,l){var f=er(l,hi(zp));return Tn(o,F,t,l,f)}),oS=On(function(o,l){return Tn(o,W,t,t,t,l)});function aS(o,l){if(typeof o!="function")throw new $t(a);return l=l===t?l:se(l),ue(o,l)}function lS(o,l){if(typeof o!="function")throw new $t(a);return l=l==null?0:ze(se(l),0),ue(function(f){var d=f[l],b=sr(f,0,l);return d&&Qn(b,d),Ct(o,this,b)})}function uS(o,l,f){var d=!0,b=!0;if(typeof o!="function")throw new $t(a);return Me(f)&&(d="leading"in f?!!f.leading:d,b="trailing"in f?!!f.trailing:b),Bp(o,l,{leading:d,maxWait:l,trailing:b})}function cS(o){return Rp(o,1)}function fS(o,l){return Zu(Du(l),o)}function hS(){if(!arguments.length)return[];var o=arguments[0];return re(o)?o:[o]}function dS(o){return Wt(o,_)}function pS(o,l){return l=typeof l=="function"?l:t,Wt(o,_,l)}function mS(o){return Wt(o,m|_)}function gS(o,l){return l=typeof l=="function"?l:t,Wt(o,m|_,l)}function yS(o,l){return l==null||kd(o,l,Ve(l))}function nn(o,l){return o===l||o!==o&&l!==l}var bS=Io(Cu),_S=Io(function(o,l){return o>=l}),Fr=Nd(function(){return arguments}())?Nd:function(o){return Ie(o)&&ve.call(o,"callee")&&!bd.call(o,"callee")},re=R.isArray,wS=Qh?Et(Qh):T_;function dt(o){return o!=null&&$o(o.length)&&!In(o)}function Le(o){return Ie(o)&&dt(o)}function vS(o){return o===!0||o===!1||Ie(o)&&it(o)==Wi}var or=P2||uc,SS=ed?Et(ed):O_;function xS(o){return Ie(o)&&o.nodeType===1&&!cs(o)}function CS(o){if(o==null)return!0;if(dt(o)&&(re(o)||typeof o=="string"||typeof o.splice=="function"||or(o)||di(o)||Fr(o)))return!o.length;var l=rt(o);if(l==Zt||l==Qt)return!o.size;if(ls(o))return!Au(o).length;for(var f in o)if(ve.call(o,f))return!1;return!0}function ES(o,l){return is(o,l)}function kS(o,l,f){f=typeof f=="function"?f:t;var d=f?f(o,l):t;return d===t?is(o,l,t,f):!!d}function Qu(o){if(!Ie(o))return!1;var l=it(o);return l==Xs||l==jy||typeof o.message=="string"&&typeof o.name=="string"&&!cs(o)}function AS(o){return typeof o=="number"&&wd(o)}function In(o){if(!Me(o))return!1;var l=it(o);return l==Zs||l==Ah||l==Jy||l==Xy}function $p(o){return typeof o=="number"&&o==se(o)}function $o(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=Xn}function Me(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Ie(o){return o!=null&&typeof o=="object"}var Hp=td?Et(td):I_;function TS(o,l){return o===l||ku(o,l,Vu(l))}function OS(o,l,f){return f=typeof f=="function"?f:t,ku(o,l,Vu(l),f)}function MS(o){return Wp(o)&&o!=+o}function IS(o){if(pw(o))throw new ne(s);return Rd(o)}function NS(o){return o===null}function RS(o){return o==null}function Wp(o){return typeof o=="number"||Ie(o)&&it(o)==Ui}function cs(o){if(!Ie(o)||it(o)!=Cn)return!1;var l=ho(o);if(l===null)return!0;var f=ve.call(l,"constructor")&&l.constructor;return typeof f=="function"&&f instanceof f&&lo.call(f)==O2}var ec=nd?Et(nd):N_;function LS(o){return $p(o)&&o>=-9007199254740991&&o<=Xn}var Vp=rd?Et(rd):R_;function Ho(o){return typeof o=="string"||!re(o)&&Ie(o)&&it(o)==Ki}function At(o){return typeof o=="symbol"||Ie(o)&&it(o)==Qs}var di=id?Et(id):L_;function PS(o){return o===t}function DS(o){return Ie(o)&&rt(o)==Gi}function FS(o){return Ie(o)&&it(o)==Qy}var BS=Io(Tu),zS=Io(function(o,l){return o<=l});function Up(o){if(!o)return[];if(dt(o))return Ho(o)?en(o):ht(o);if(Yi&&o[Yi])return y2(o[Yi]());var l=rt(o),f=l==Zt?mu:l==Qt?so:pi;return f(o)}function Nn(o){if(!o)return o===0?o:0;if(o=qt(o),o===St||o===-1/0){var l=o<0?-1:1;return l*js}return o===o?o:0}function se(o){var l=Nn(o),f=l%1;return l===l?f?l-f:l:0}function qp(o){return o?Rr(se(o),0,xt):0}function qt(o){if(typeof o=="number")return o;if(At(o))return cn;if(Me(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=Me(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=cd(o);var f=wb.test(o);return f||Sb.test(o)?e2(o.slice(2),f?2:8):_b.test(o)?cn:+o}function Kp(o){return hn(o,pt(o))}function $S(o){return o?Rr(se(o),-9007199254740991,Xn):o===0?o:0}function _e(o){return o==null?"":kt(o)}var HS=ci(function(o,l){if(ls(l)||dt(l)){hn(l,Ve(l),o);return}for(var f in l)ve.call(l,f)&&ts(o,f,l[f])}),Gp=ci(function(o,l){hn(l,pt(l),o)}),Wo=ci(function(o,l,f,d){hn(l,pt(l),o,d)}),WS=ci(function(o,l,f,d){hn(l,Ve(l),o,d)}),VS=On(vu);function US(o,l){var f=ui(o);return l==null?f:Ed(f,l)}var qS=ue(function(o,l){o=xe(o);var f=-1,d=l.length,b=d>2?l[2]:t;for(b&&st(l[0],l[1],b)&&(d=1);++f<d;)for(var x=l[f],C=pt(x),O=-1,I=C.length;++O<I;){var P=C[O],D=o[P];(D===t||nn(D,oi[P])&&!ve.call(o,P))&&(o[P]=x[P])}return o}),KS=ue(function(o){return o.push(t,cp),Ct(Jp,t,o)});function GS(o,l){return od(o,Y(l,3),fn)}function JS(o,l){return od(o,Y(l,3),xu)}function jS(o,l){return o==null?o:Su(o,Y(l,3),pt)}function YS(o,l){return o==null?o:Md(o,Y(l,3),pt)}function XS(o,l){return o&&fn(o,Y(l,3))}function ZS(o,l){return o&&xu(o,Y(l,3))}function QS(o){return o==null?[]:xo(o,Ve(o))}function ex(o){return o==null?[]:xo(o,pt(o))}function tc(o,l,f){var d=o==null?t:Lr(o,l);return d===t?f:d}function tx(o,l){return o!=null&&dp(o,l,C_)}function nc(o,l){return o!=null&&dp(o,l,E_)}var nx=sp(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=uo.call(l)),o[l]=f},ic(mt)),rx=sp(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=uo.call(l)),ve.call(o,l)?o[l].push(f):o[l]=[f]},Y),ix=ue(rs);function Ve(o){return dt(o)?xd(o):Au(o)}function pt(o){return dt(o)?xd(o,!0):P_(o)}function sx(o,l){var f={};return l=Y(l,3),fn(o,function(d,b,x){An(f,l(d,b,x),d)}),f}function ox(o,l){var f={};return l=Y(l,3),fn(o,function(d,b,x){An(f,b,l(d,b,x))}),f}var ax=ci(function(o,l,f){Co(o,l,f)}),Jp=ci(function(o,l,f,d){Co(o,l,f,d)}),lx=On(function(o,l){var f={};if(o==null)return f;var d=!1;l=Te(l,function(x){return x=ir(x,o),d||(d=x.length>1),x}),hn(o,Hu(o),f),d&&(f=Wt(f,m|y|_,nw));for(var b=l.length;b--;)Ru(f,l[b]);return f});function ux(o,l){return jp(o,zo(Y(l)))}var cx=On(function(o,l){return o==null?{}:F_(o,l)});function jp(o,l){if(o==null)return{};var f=Te(Hu(o),function(d){return[d]});return l=Y(l),$d(o,f,function(d,b){return l(d,b[0])})}function fx(o,l,f){l=ir(l,o);var d=-1,b=l.length;for(b||(b=1,o=t);++d<b;){var x=o==null?t:o[dn(l[d])];x===t&&(d=b,x=f),o=In(x)?x.call(o):x}return o}function hx(o,l,f){return o==null?o:ss(o,l,f)}function dx(o,l,f,d){return d=typeof d=="function"?d:t,o==null?o:ss(o,l,f,d)}var Yp=lp(Ve),Xp=lp(pt);function px(o,l,f){var d=re(o),b=d||or(o)||di(o);if(l=Y(l,4),f==null){var x=o&&o.constructor;b?f=d?new x:[]:Me(o)?f=In(x)?ui(ho(o)):{}:f={}}return(b?zt:fn)(o,function(C,O,I){return l(f,C,O,I)}),f}function mx(o,l){return o==null?!0:Ru(o,l)}function gx(o,l,f){return o==null?o:qd(o,l,Du(f))}function yx(o,l,f,d){return d=typeof d=="function"?d:t,o==null?o:qd(o,l,Du(f),d)}function pi(o){return o==null?[]:pu(o,Ve(o))}function bx(o){return o==null?[]:pu(o,pt(o))}function _x(o,l,f){return f===t&&(f=l,l=t),f!==t&&(f=qt(f),f=f===f?f:0),l!==t&&(l=qt(l),l=l===l?l:0),Rr(qt(o),l,f)}function wx(o,l,f){return l=Nn(l),f===t?(f=l,l=0):f=Nn(f),o=qt(o),k_(o,l,f)}function vx(o,l,f){if(f&&typeof f!="boolean"&&st(o,l,f)&&(l=f=t),f===t&&(typeof l=="boolean"?(f=l,l=t):typeof o=="boolean"&&(f=o,o=t)),o===t&&l===t?(o=0,l=1):(o=Nn(o),l===t?(l=o,o=0):l=Nn(l)),o>l){var d=o;o=l,l=d}if(f||o%1||l%1){var b=vd();return nt(o+b*(l-o+Qb("1e-"+((b+"").length-1))),l)}return Mu(o,l)}var Sx=fi(function(o,l,f){return l=l.toLowerCase(),o+(f?Zp(l):l)});function Zp(o){return rc(_e(o).toLowerCase())}function Qp(o){return o=_e(o),o&&o.replace(Cb,h2).replace(Vb,"")}function xx(o,l,f){o=_e(o),l=kt(l);var d=o.length;f=f===t?d:Rr(se(f),0,d);var b=f;return f-=l.length,f>=0&&o.slice(f,b)==l}function Cx(o){return o=_e(o),o&&ib.test(o)?o.replace(Mh,d2):o}function Ex(o){return o=_e(o),o&&cb.test(o)?o.replace(Zl,"\\$&"):o}var kx=fi(function(o,l,f){return o+(f?"-":"")+l.toLowerCase()}),Ax=fi(function(o,l,f){return o+(f?" ":"")+l.toLowerCase()}),Tx=np("toLowerCase");function Ox(o,l,f){o=_e(o),l=se(l);var d=l?ii(o):0;if(!l||d>=l)return o;var b=(l-d)/2;return Mo(yo(b),f)+o+Mo(go(b),f)}function Mx(o,l,f){o=_e(o),l=se(l);var d=l?ii(o):0;return l&&d<l?o+Mo(l-d,f):o}function Ix(o,l,f){o=_e(o),l=se(l);var d=l?ii(o):0;return l&&d<l?Mo(l-d,f)+o:o}function Nx(o,l,f){return f||l==null?l=0:l&&(l=+l),z2(_e(o).replace(Ql,""),l||0)}function Rx(o,l,f){return(f?st(o,l,f):l===t)?l=1:l=se(l),Iu(_e(o),l)}function Lx(){var o=arguments,l=_e(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var Px=fi(function(o,l,f){return o+(f?"_":"")+l.toLowerCase()});function Dx(o,l,f){return f&&typeof f!="number"&&st(o,l,f)&&(l=f=t),f=f===t?xt:f>>>0,f?(o=_e(o),o&&(typeof l=="string"||l!=null&&!ec(l))&&(l=kt(l),!l&&ri(o))?sr(en(o),0,f):o.split(l,f)):[]}var Fx=fi(function(o,l,f){return o+(f?" ":"")+rc(l)});function Bx(o,l,f){return o=_e(o),f=f==null?0:Rr(se(f),0,o.length),l=kt(l),o.slice(f,f+l.length)==l}function zx(o,l,f){var d=w.templateSettings;f&&st(o,l,f)&&(l=t),o=_e(o),l=Wo({},l,d,up);var b=Wo({},l.imports,d.imports,up),x=Ve(b),C=pu(b,x),O,I,P=0,D=l.interpolate||eo,B="__p += '",q=gu((l.escape||eo).source+"|"+D.source+"|"+(D===Ih?bb:eo).source+"|"+(l.evaluate||eo).source+"|$","g"),j="//# sourceURL="+(ve.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jb+"]")+`
|
|
48
|
+
`;o.replace(q,function(Z,ce,me,Tt,ot,Ot){return me||(me=Tt),B+=o.slice(P,Ot).replace(Eb,p2),ce&&(O=!0,B+=`' +
|
|
49
49
|
__e(`+ce+`) +
|
|
50
50
|
'`),ot&&(I=!0,B+=`';
|
|
51
51
|
`+ot+`;
|
|
@@ -61,4 +61,4 @@ __p += '`),me&&(B+=`' +
|
|
|
61
61
|
function print() { __p += __j.call(arguments, '') }
|
|
62
62
|
`:`;
|
|
63
63
|
`)+B+`return __p
|
|
64
|
-
}`;var se=tm(function(){return be(x,j+"return "+B).apply(t,C)});if(se.source=B,Qu(se))throw se;return se}function $x(o){return _e(o).toLowerCase()}function Hx(o){return _e(o).toUpperCase()}function Wx(o,l,f){if(o=_e(o),o&&(f||l===t))return cd(o);if(!o||!(l=kt(l)))return o;var d=en(o),b=en(l),x=fd(d,b),C=hd(d,b)+1;return sr(d,x,C).join("")}function Vx(o,l,f){if(o=_e(o),o&&(f||l===t))return o.slice(0,pd(o)+1);if(!o||!(l=kt(l)))return o;var d=en(o),b=hd(d,en(l))+1;return sr(d,0,b).join("")}function Ux(o,l,f){if(o=_e(o),o&&(f||l===t))return o.replace(Ql,"");if(!o||!(l=kt(l)))return o;var d=en(o),b=fd(d,en(l));return sr(d,b).join("")}function qx(o,l){var f=te,d=Se;if(Me(l)){var b="separator"in l?l.separator:b;f="length"in l?ie(l.length):f,d="omission"in l?kt(l.omission):d}o=_e(o);var x=o.length;if(ri(o)){var C=en(o);x=C.length}if(f>=x)return o;var O=f-ii(d);if(O<1)return d;var I=C?sr(C,0,O).join(""):o.slice(0,O);if(b===t)return I+d;if(C&&(O+=I.length-O),ec(b)){if(o.slice(O).search(b)){var P,D=I;for(b.global||(b=gu(b.source,_e(Nh.exec(b))+"g")),b.lastIndex=0;P=b.exec(D);)var B=P.index;I=I.slice(0,B===t?O:B)}}else if(o.indexOf(kt(b),O)!=O){var q=I.lastIndexOf(b);q>-1&&(I=I.slice(0,q))}return I+d}function Kx(o){return o=_e(o),o&&rb.test(o)?o.replace(Oh,v2):o}var Gx=fi(function(o,l,f){return o+(f?" ":"")+l.toUpperCase()}),rc=np("toUpperCase");function em(o,l,f){return o=_e(o),l=f?t:l,l===t?g2(o)?C2(o):a2(o):o.match(l)||[]}var tm=ue(function(o,l){try{return Ct(o,t,l)}catch(f){return Qu(f)?f:new ne(f)}}),Jx=On(function(o,l){return zt(l,function(f){f=dn(f),Tn(o,f,Xu(o[f],o))}),o});function jx(o){var l=o==null?0:o.length,f=Y();return o=l?Ae(o,function(d){if(typeof d[1]!="function")throw new $t(a);return[f(d[0]),d[1]]}):[],ue(function(d){for(var b=-1;++b<l;){var x=o[b];if(Ct(x[0],this,d))return Ct(x[1],this,d)}})}function Yx(o){return v_(Wt(o,m))}function ic(o){return function(){return o}}function Xx(o,l){return o==null||o!==o?l:o}var Zx=ip(),Qx=ip(!0);function mt(o){return o}function sc(o){return Ld(typeof o=="function"?o:Wt(o,m))}function eC(o){return Dd(Wt(o,m))}function tC(o,l){return Fd(o,Wt(l,m))}var nC=ue(function(o,l){return function(f){return ns(f,o,l)}}),rC=ue(function(o,l){return function(f){return ns(o,f,l)}});function oc(o,l,f){var d=Ve(l),b=So(l,d);f==null&&!(Me(l)&&(b.length||!d.length))&&(f=l,l=o,o=this,b=So(l,Ve(l)));var x=!(Me(f)&&"chain"in f)||!!f.chain,C=In(o);return zt(b,function(O){var I=l[O];o[O]=I,C&&(o.prototype[O]=function(){var P=this.__chain__;if(x||P){var D=o(this.__wrapped__),B=D.__actions__=ht(this.__actions__);return B.push({func:I,args:arguments,thisArg:o}),D.__chain__=P,D}return I.apply(o,Qn([this.value()],arguments))})}),o}function iC(){return Xe._===this&&(Xe._=M2),this}function ac(){}function sC(o){return o=ie(o),ue(function(l){return Bd(l,o)})}var oC=Bu(Ae),aC=Bu(sd),lC=Bu(uu);function nm(o){return qu(o)?cu(dn(o)):B_(o)}function uC(o){return function(l){return o==null?t:Lr(o,l)}}var cC=op(),fC=op(!0);function lc(){return[]}function uc(){return!1}function hC(){return{}}function dC(){return""}function pC(){return!0}function mC(o,l){if(o=ie(o),o<1||o>Xn)return[];var f=xt,d=nt(o,xt);l=Y(l),o-=xt;for(var b=du(d,l);++f<o;)l(f);return b}function gC(o){return re(o)?Ae(o,dn):Tt(o)?[o]:ht(Sp(_e(o)))}function yC(o){var l=++A2;return _e(o)+l}var bC=Ao(function(o,l){return o+l},0),_C=zu("ceil"),wC=Ao(function(o,l){return o/l},1),vC=zu("floor");function SC(o){return o&&o.length?vo(o,mt,Cu):t}function xC(o,l){return o&&o.length?vo(o,Y(l,2),Cu):t}function CC(o){return ld(o,mt)}function EC(o,l){return ld(o,Y(l,2))}function kC(o){return o&&o.length?vo(o,mt,Au):t}function TC(o,l){return o&&o.length?vo(o,Y(l,2),Au):t}var AC=Ao(function(o,l){return o*l},1),OC=zu("round"),MC=Ao(function(o,l){return o-l},0);function IC(o){return o&&o.length?hu(o,mt):0}function NC(o,l){return o&&o.length?hu(o,Y(l,2)):0}return w.after=eS,w.ary=Rp,w.assign=HS,w.assignIn=Gp,w.assignInWith=Ho,w.assignWith=WS,w.at=VS,w.before=Lp,w.bind=Xu,w.bindAll=Jx,w.bindKey=Pp,w.castArray=hS,w.chain=Mp,w.chunk=vw,w.compact=Sw,w.concat=xw,w.cond=jx,w.conforms=Yx,w.constant=ic,w.countBy=Iv,w.create=US,w.curry=Dp,w.curryRight=Fp,w.debounce=Bp,w.defaults=qS,w.defaultsDeep=KS,w.defer=tS,w.delay=nS,w.difference=Cw,w.differenceBy=Ew,w.differenceWith=kw,w.drop=Tw,w.dropRight=Aw,w.dropRightWhile=Ow,w.dropWhile=Mw,w.fill=Iw,w.filter=Rv,w.flatMap=Dv,w.flatMapDeep=Fv,w.flatMapDepth=Bv,w.flatten=kp,w.flattenDeep=Nw,w.flattenDepth=Rw,w.flip=rS,w.flow=Zx,w.flowRight=Qx,w.fromPairs=Lw,w.functions=QS,w.functionsIn=ex,w.groupBy=zv,w.initial=Dw,w.intersection=Fw,w.intersectionBy=Bw,w.intersectionWith=zw,w.invert=nx,w.invertBy=rx,w.invokeMap=Hv,w.iteratee=sc,w.keyBy=Wv,w.keys=Ve,w.keysIn=pt,w.map=Po,w.mapKeys=sx,w.mapValues=ox,w.matches=eC,w.matchesProperty=tC,w.memoize=Fo,w.merge=ax,w.mergeWith=Jp,w.method=nC,w.methodOf=rC,w.mixin=oc,w.negate=Bo,w.nthArg=sC,w.omit=lx,w.omitBy=ux,w.once=iS,w.orderBy=Vv,w.over=oC,w.overArgs=sS,w.overEvery=aC,w.overSome=lC,w.partial=Zu,w.partialRight=zp,w.partition=Uv,w.pick=cx,w.pickBy=jp,w.property=nm,w.propertyOf=uC,w.pull=Vw,w.pullAll=Ap,w.pullAllBy=Uw,w.pullAllWith=qw,w.pullAt=Kw,w.range=cC,w.rangeRight=fC,w.rearg=oS,w.reject=Gv,w.remove=Gw,w.rest=aS,w.reverse=ju,w.sampleSize=jv,w.set=hx,w.setWith=dx,w.shuffle=Yv,w.slice=Jw,w.sortBy=Qv,w.sortedUniq=tv,w.sortedUniqBy=nv,w.split=Dx,w.spread=lS,w.tail=rv,w.take=iv,w.takeRight=sv,w.takeRightWhile=ov,w.takeWhile=av,w.tap=Sv,w.throttle=uS,w.thru=Lo,w.toArray=Up,w.toPairs=Yp,w.toPairsIn=Xp,w.toPath=gC,w.toPlainObject=Kp,w.transform=px,w.unary=cS,w.union=lv,w.unionBy=uv,w.unionWith=cv,w.uniq=fv,w.uniqBy=hv,w.uniqWith=dv,w.unset=mx,w.unzip=Yu,w.unzipWith=Op,w.update=gx,w.updateWith=yx,w.values=pi,w.valuesIn=bx,w.without=pv,w.words=em,w.wrap=fS,w.xor=mv,w.xorBy=gv,w.xorWith=yv,w.zip=bv,w.zipObject=_v,w.zipObjectDeep=wv,w.zipWith=vv,w.entries=Yp,w.entriesIn=Xp,w.extend=Gp,w.extendWith=Ho,oc(w,w),w.add=bC,w.attempt=tm,w.camelCase=Sx,w.capitalize=Zp,w.ceil=_C,w.clamp=_x,w.clone=dS,w.cloneDeep=mS,w.cloneDeepWith=gS,w.cloneWith=pS,w.conformsTo=yS,w.deburr=Qp,w.defaultTo=Xx,w.divide=wC,w.endsWith=xx,w.eq=nn,w.escape=Cx,w.escapeRegExp=Ex,w.every=Nv,w.find=Lv,w.findIndex=Cp,w.findKey=GS,w.findLast=Pv,w.findLastIndex=Ep,w.findLastKey=JS,w.floor=vC,w.forEach=Ip,w.forEachRight=Np,w.forIn=jS,w.forInRight=YS,w.forOwn=XS,w.forOwnRight=ZS,w.get=tc,w.gt=bS,w.gte=_S,w.has=tx,w.hasIn=nc,w.head=Tp,w.identity=mt,w.includes=$v,w.indexOf=Pw,w.inRange=wx,w.invoke=ix,w.isArguments=Fr,w.isArray=re,w.isArrayBuffer=wS,w.isArrayLike=dt,w.isArrayLikeObject=Le,w.isBoolean=vS,w.isBuffer=or,w.isDate=SS,w.isElement=xS,w.isEmpty=CS,w.isEqual=ES,w.isEqualWith=kS,w.isError=Qu,w.isFinite=TS,w.isFunction=In,w.isInteger=$p,w.isLength=zo,w.isMap=Hp,w.isMatch=AS,w.isMatchWith=OS,w.isNaN=MS,w.isNative=IS,w.isNil=RS,w.isNull=NS,w.isNumber=Wp,w.isObject=Me,w.isObjectLike=Ie,w.isPlainObject=us,w.isRegExp=ec,w.isSafeInteger=LS,w.isSet=Vp,w.isString=$o,w.isSymbol=Tt,w.isTypedArray=di,w.isUndefined=PS,w.isWeakMap=DS,w.isWeakSet=FS,w.join=$w,w.kebabCase=kx,w.last=Ut,w.lastIndexOf=Hw,w.lowerCase=Tx,w.lowerFirst=Ax,w.lt=BS,w.lte=zS,w.max=SC,w.maxBy=xC,w.mean=CC,w.meanBy=EC,w.min=kC,w.minBy=TC,w.stubArray=lc,w.stubFalse=uc,w.stubObject=hC,w.stubString=dC,w.stubTrue=pC,w.multiply=AC,w.nth=Ww,w.noConflict=iC,w.noop=ac,w.now=Do,w.pad=Ox,w.padEnd=Mx,w.padStart=Ix,w.parseInt=Nx,w.random=vx,w.reduce=qv,w.reduceRight=Kv,w.repeat=Rx,w.replace=Lx,w.result=fx,w.round=OC,w.runInContext=M,w.sample=Jv,w.size=Xv,w.snakeCase=Px,w.some=Zv,w.sortedIndex=jw,w.sortedIndexBy=Yw,w.sortedIndexOf=Xw,w.sortedLastIndex=Zw,w.sortedLastIndexBy=Qw,w.sortedLastIndexOf=ev,w.startCase=Fx,w.startsWith=Bx,w.subtract=MC,w.sum=IC,w.sumBy=NC,w.template=zx,w.times=mC,w.toFinite=Nn,w.toInteger=ie,w.toLength=qp,w.toLower=$x,w.toNumber=qt,w.toSafeInteger=$S,w.toString=_e,w.toUpper=Hx,w.trim=Wx,w.trimEnd=Vx,w.trimStart=Ux,w.truncate=qx,w.unescape=Kx,w.uniqueId=yC,w.upperCase=Gx,w.upperFirst=rc,w.each=Ip,w.eachRight=Np,w.first=Tp,oc(w,function(){var o={};return fn(w,function(l,f){ve.call(w.prototype,f)||(o[f]=l)}),o}(),{chain:!1}),w.VERSION=r,zt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){w[o].placeholder=w}),zt(["drop","take"],function(o,l){fe.prototype[o]=function(f){f=f===t?1:ze(ie(f),0);var d=this.__filtered__&&!l?new fe(this):this.clone();return d.__filtered__?d.__takeCount__=nt(f,d.__takeCount__):d.__views__.push({size:nt(f,xt),type:o+(d.__dir__<0?"Right":"")}),d},fe.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),zt(["filter","map","takeWhile"],function(o,l){var f=l+1,d=f==Ft||f==We;fe.prototype[o]=function(b){var x=this.clone();return x.__iteratees__.push({iteratee:Y(b,3),type:f}),x.__filtered__=x.__filtered__||d,x}}),zt(["head","last"],function(o,l){var f="take"+(l?"Right":"");fe.prototype[o]=function(){return this[f](1).value()[0]}}),zt(["initial","tail"],function(o,l){var f="drop"+(l?"":"Right");fe.prototype[o]=function(){return this.__filtered__?new fe(this):this[f](1)}}),fe.prototype.compact=function(){return this.filter(mt)},fe.prototype.find=function(o){return this.filter(o).head()},fe.prototype.findLast=function(o){return this.reverse().find(o)},fe.prototype.invokeMap=ue(function(o,l){return typeof o=="function"?new fe(this):this.map(function(f){return ns(f,o,l)})}),fe.prototype.reject=function(o){return this.filter(Bo(Y(o)))},fe.prototype.slice=function(o,l){o=ie(o);var f=this;return f.__filtered__&&(o>0||l<0)?new fe(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),l!==t&&(l=ie(l),f=l<0?f.dropRight(-l):f.take(l-o)),f)},fe.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},fe.prototype.toArray=function(){return this.take(xt)},fn(fe.prototype,function(o,l){var f=/^(?:filter|find|map|reject)|While$/.test(l),d=/^(?:head|last)$/.test(l),b=w[d?"take"+(l=="last"?"Right":""):l],x=d||/^find/.test(l);b&&(w.prototype[l]=function(){var C=this.__wrapped__,O=d?[1]:arguments,I=C instanceof fe,P=O[0],D=I||re(C),B=function(ce){var me=b.apply(w,Qn([ce],O));return d&&q?me[0]:me};D&&f&&typeof P=="function"&&P.length!=1&&(I=D=!1);var q=this.__chain__,j=!!this.__actions__.length,X=x&&!q,se=I&&!j;if(!x&&D){C=se?C:new fe(this);var Z=o.apply(C,O);return Z.__actions__.push({func:Lo,args:[B],thisArg:t}),new Ht(Z,q)}return X&&se?o.apply(this,O):(Z=this.thru(B),X?d?Z.value()[0]:Z.value():Z)})}),zt(["pop","push","shift","sort","splice","unshift"],function(o){var l=so[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",d=/^(?:pop|shift)$/.test(o);w.prototype[o]=function(){var b=arguments;if(d&&!this.__chain__){var x=this.value();return l.apply(re(x)?x:[],b)}return this[f](function(C){return l.apply(re(C)?C:[],b)})}}),fn(fe.prototype,function(o,l){var f=w[l];if(f){var d=f.name+"";ve.call(li,d)||(li[d]=[]),li[d].push({name:l,func:f})}}),li[To(t,g).name]=[{name:"wrapper",func:t}],fe.prototype.clone=K2,fe.prototype.reverse=G2,fe.prototype.value=J2,w.prototype.at=xv,w.prototype.chain=Cv,w.prototype.commit=Ev,w.prototype.next=kv,w.prototype.plant=Av,w.prototype.reverse=Ov,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=Mv,w.prototype.first=w.prototype.head,ji&&(w.prototype[ji]=Tv),w},si=E2();Or?((Or.exports=si)._=si,su._=si):Xe._=si}).call(RI)}(Vs,Vs.exports)),Vs.exports}var By=LI();function bh(n){return n.type.create(By.cloneDeep(n.attrs))}function PI(n){return JSON.parse(JSON.stringify(n))}function _h({tr:n,node:e,position:t,mark:r}){return e.isText?n.removeMark(t,t+e.nodeSize,r):n.removeNodeMark(t,r)}const DI=Re.create({name:"node_processor",addCommands(){return{setBlockAttributes:H(({commands:n,state:e},t,r,i={})=>{const s=PI(r),a=V(n.getBlockAttributes(t))??{},{doc:u,tr:c}=e,{from:h,to:p}=c.selection;u.nodesBetween(h,p,(m,y)=>{Nf.includes(m.type.name)&&c.setNodeAttribute(y,t,{...i,...a,...s})})}),getBlockAttributes:H(({editor:n},e,t)=>ge(()=>{let r=Object.assign({},t||{});for(const i of Nf)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:H(({commands:n},e)=>{for(const t of Nf)n.resetAttributes(t,e)}),applyMark:H(({state:n,commands:e},t,r,i={})=>{const{tr:s,doc:a,schema:u}=n,{$from:c,$to:h}=s.selection,p=mn(ke.LINK,u),m=mn(t,u);if(!(m.spec.group||"").includes(Rt.SETTINGS))return e.setMark(t,r);if(c.pos===h.pos)return;const _=S=>{if(!i.onAppliedToParent||i.onAppliedToParent(S)===!1){const{tr:E,node:N,position:g,mark:v}=S;_h({tr:E,node:N,position:g,mark:v.type})}};a.nodesBetween(c.pos,h.pos,(S,E)=>{if(S.type.name===oe.LIST)return;const N=NI(S.marks,t),g=m.create({...N?.attrs||{},...r}),v=Py(c,h,S,E);if(!p.isInSet(S.marks)&&II(s.doc,E,g,i.isAppliedToParent))return _({tr:s,node:S,position:E,mark:g});if(S.isText){s.addMark(v.from,v.to,g);return}OI(s.doc,s.selection,S,E)&&s.addNodeMark(E,g)})}),getMarks:H(({editor:n},e)=>{const t=bi(n,"state");return ge(()=>{const{selection:r,doc:i}=V(t),{from:s,to:a}=V(r),u=[];return i.nodesBetween(s,a,c=>{for(const h of c.marks)h.type.name===e&&u.unshift(h.attrs)}),u})}),getMark:H(({commands:n},e)=>{const t=n.getMarks(e);return ge(()=>V(t)[0]??null)}),hasMark:H(({commands:n},e)=>{const t=n.getMark(e);return ge(()=>!!V(t))}),getCommonSettingMark:H(({commands:n},e,t)=>{const r=n.getMark(e);return ge(()=>V(r)?.value??V(t))}),getDeviceSettingMark:H(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return ge(()=>{for(const s of V(r)){const a=s[V(i)];if(a||a===0)return a}return V(t)})}),removeAllMarks:H(({state:n})=>{const{tr:e,doc:t}=n,{from:r,to:i}=e.selection;t.nodesBetween(r,i,(s,a)=>{for(const u of s.marks)_h({tr:e,node:s,position:a,mark:u})})}),removeMarks:H(({state:n},e)=>{const{tr:t,doc:r}=n,{from:i,to:s}=t.selection;r.nodesBetween(i,s,(a,u)=>{const c=a.marks.filter(h=>e.includes(h.type.name));for(const h of c)_h({tr:t,node:a,position:u,mark:h})})})}}}),FI=Re.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,s)=>{if(!i.isText)return;const a=Py(t,r,i,s),u=Math.max(0,t.pos-s),c=Math.max(0,r.pos-s),h=e({text:i.textContent.substring(u,c)}),p=n.schema.text(h,i.marks);n.tr.replaceWith(a.from,a.to,p)})})}}}),BI=Re.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;return n.doc.nodesBetween(r,i,(s,a,u)=>{if(t({node:s,parent:u})){const c=s.isText?0:Dy(n.doc,a);r=Math.min(r,a+c),i=Math.max(i,a+s.nodeSize-c)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:H(({commands:n})=>n.expandSelection(({parent:e})=>e.type.name===oe.DOCUMENT))}}}),zI=Yn.create({name:"doc",topNode:!0,content:"block+"});class Gs extends Ue{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=hr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,De.ok(t)}invert(){return new Gs(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 Gs(e.key,e.value,e.stepType)}}Ue.jsonID("setDocAttr",Gs);const $I=zI.extend({marks:Rt.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 Gs(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",Mi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),WI=HI.extend({marks:Rt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),VI=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]}`,Mi(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=>mO({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),UI=VI.extend({marks:Rt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),qI=Re.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[RO.create(this.editor),LO.create(this.editor)]}}),KI=()=>[$I,WI,UI,bO,AO,DI,FI,BI,qI],GI=wt.create({name:ke.FONT_FAMILY,group:Rt.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=V(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(ke.FONT_STYLE).value;t.isItalicOnly?n.applyItalic():!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:H(({commands:n})=>{const e=V(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return ge(()=>n.findFontByName(V(r))||t)}),findFontByName:H((n,e)=>V(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 ge(()=>V(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 Cr({font_family:e})}}),JI=Re.create({name:ke.STYLE_PRESET,addGlobalAttributes(){return[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{preset:{isRequired:!1,default:{id:V(this.options.defaultId)},parseHTML:n=>{const e=V(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 s=V(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(s))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:V(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:V(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 s of Object.keys(t)){const a=t[s],u=r[s],c=!u||u.toLowerCase()==="inherit";i[s]=c?a:u}return i}return{getPresetList:H(()=>ge(()=>V(this.options.presets).filter(t=>!t.hidden))),getPreset:H(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:V(this.options.defaultId)}),i=t.getPresetList(),s=t.isLink(),a=t.getLinkPreset();return ge(()=>{const u=n(V(i),V(r).id);if(!V(s))return u;const c=V(a);return{id:u.id,common:e(u.common,c.common),mobile:e(u.mobile,c.mobile),tablet:e(u.tablet,c.tablet),desktop:e(u.desktop,c.desktop)}})}),applyPreset:H(({commands:t,chain:r},i)=>{const s=V(t.getPresetList()),a=n(s,i),u=a.node?.type??oe.PARAGRAPH,c={preset:{id:i}};a.node&&(c.level=a.node.level);for(const h of p1)c[h]=V(t.getBlockAttributes(h));r().removeList().setNode(u,c).run()}),applyDefaultPreset:H(({commands:t})=>{t.applyPreset(V(this.options.defaultId))}),removePreset:H(({commands:t})=>{t.setNode(oe.PARAGRAPH,{preset:null})}),getPresetCustomization:H(({editor:t,commands:r})=>{const i=bi(t,"state");return ge(()=>{const{selection:s,doc:a}=V(i),{from:u,to:c}=s;return r._getSettingCustomization(a,u,c)})}),isSettingCustomized:H(({commands:t},r)=>{const i=t.getPresetCustomization(),s=Ka.includes(r)?"attributes":"marks";return ge(()=>V(i)[s]?.includes(r)??!1)}),getContentCustomization:H(({editor:t,commands:r})=>{const i=bi(t,"state");return ge(()=>{const{doc:s}=V(i);return r._getSettingCustomization(s,0,s.content.size)})}),_getSettingCustomization:H((t,r,i,s)=>{const a=new Set,u=new Set;return r.nodesBetween(i,s,c=>{for(const[h,p]of Object.entries(c.attrs))Ka.includes(h)&&p&&u.add(h);for(const{type:h}of c.marks)g1.includes(h.name)&&a.add(h.name)}),{attributes:Array.from(u),marks:Array.from(a)}}),removePresetCustomization:H(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(g1).resetAttributes(oe.PARAGRAPH,Ka).resetAttributes(oe.HEADING,Ka).restoreSelection().run()}),removeFormat:H(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Di.head,V(this.options.presets))}}),jI=wt.create({name:ke.FONT_WEIGHT,group:Rt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:H(({commands:n},e)=>{n.applyMark(this.name,{value:e}),V(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:H(({commands:n})=>{const e=V(n.getFontWeight()),t=V(n.getFont()),i=Number(e)>=600?"400":"700",s=t.findClosestWeight(i);n.applyFontWeight(s)}),getFontWeight:H(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return ge(()=>{const r=V(e),i=V(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:H(({commands:n})=>{const e=n.getPreset();return ge(()=>V(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Yt("toggleBold"),"Mod-B":Yt("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 Cr({font_weight:n.value})}}),YI=wt.create({name:ke.FONT_SIZE,group:Rt.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 ge(()=>V(t)[V(e)].font_size.replace("px",""))}),applyFontSize:H(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.applyMark(this.name,r,{isAppliedToParent:(i,s)=>i.type.name!==s.type.name?!1:t.every(a=>i.attrs[a]===s.attrs[a]),onAppliedToParent:({tr:i,node:s,position:a,mark:u})=>{const c={...u.attrs};if(t.forEach(m=>{c[m]=null}),!Object.values(c).some(m=>!!m))return!1;const p=u.type.create(c);if(s.isText){i.addMark(a,a+s.nodeSize,p);return}i.addNodeMark(a,p)}})}),increaseFontSize:H(({commands:n})=>{const e=Number(V(n.getFontSize())),t=Math.min(e+1,V(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:H(({commands:n})=>{const e=Number(V(n.getFontSize())),t=Math.max(e-1,V(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Yt("increaseFontSize"),"Mod-Shift--":Yt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=V(this.options.wrapperRef),r=Ly(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 Cr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),XI=wt.create({name:ke.FONT_COLOR,group:Rt.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 ge(()=>V(e).common.color)}),applyFontColor:H(({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 Cr({font_color:n.value})}}),ZI=wt.create({name:ke.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:Ny(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Cr({background_color:n.value})}}),QI=Re.create({name:"device_manager",addCommands(){return{getDevice:H(()=>{const n=bi(this.options,"device");return ge(()=>{const e=V(n);return e===$n.ALL?$n.DESKTOP:e})}),getTargetDevices:H(()=>{const n=V(this.options.device);return n===$n.ALL?[$n.DESKTOP,$n.TABLET,$n.MOBILE]:[n]})}}}),eN=wt.create({name:ke.FONT_STYLE,group:Rt.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:H(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return ge(()=>V(e)?.italic??V(t).italic)}),isItalicAvailable:H(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return ge(()=>{const r=V(e),i=V(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:H(({commands:n})=>{const e=n.getPreset();return ge(()=>({italic:V(e).common.font_style==="italic"}))}),toggleItalic:H(({commands:n})=>{V(n.isItalicAvailable())&&(V(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":Yt("toggleItalic"),"Mod-I":Yt("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 Cr({font_style:e})}}),tN=wt.create({name:ke.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:H(({commands:n})=>{const e=n.getTextDecoration();return ge(()=>V(e).underline)}),isStrikeThrough:H(({commands:n})=>{const e=n.getTextDecoration();return ge(()=>V(e).strike_through)}),getTextDecoration:H(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return ge(()=>{const r=V(e)??{},i=V(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 ge(()=>V(e)!==V(t).underline)}),getDefaultTextDecoration:H(({commands:n})=>{const e=n.getPreset();return ge(()=>{const{text_decoration:t}=V(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=V(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":Yt("toggleUnderline"),"Mod-U":Yt("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"),Cr({text_decoration:e.join(" ")})}}),nN=Re.create({name:"case_style",addCommands(){return{applyCaseStyle:H(({commands:n},e)=>{switch(e){case qa.CAPITALIZE:return n.applyCapitalize();case qa.LOWERCASE:return n.applyLowerCase();case qa.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:H(({commands:n})=>{n.transformText(({text:e})=>eM(e))}),applyLowerCase:H(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:H(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),zy={mobile:null,tablet:null,desktop:null},rN=Re.create({name:ke.ALIGNMENT,addGlobalAttributes:()=>[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{[ke.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=AI(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?El({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=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.setBlockAttributes(this.name,r,zy)}),removeAlignment:H(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:H(({commands:n})=>{const e=n.getBlockAttributes(this.name,zy),t=n.getDevice(),r=n.getDefaultAlignment();return ge(()=>V(e)?.[V(t)]??V(r))}),getDefaultAlignment:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>V(t)[V(e)].alignment??wr.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Yt("applyAlignment",wr.LEFT),"Mod-Shift-e":Yt("applyAlignment",wr.CENTER),"Mod-Shift-r":Yt("applyAlignment",wr.RIGHT),"Mod-Shift-j":Yt("applyAlignment",wr.JUSTIFY)})}),$y={mobile:null,tablet:null,desktop:null},iN=Re.create({name:ke.LINE_HEIGHT,addGlobalAttributes(){return[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{[ke.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const s=n.style.getPropertyValue("--zw-line-height-tablet")||null,a=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:s,desktop:a}}const e=n.style.lineHeight;if(!e)return null;const t=V(this.options.wrapperRef),r=EI(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?El({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,$y),t=n.getDevice(),r=n.getDefaultLineHeight();return ge(()=>V(e)?.[V(t)]??V(r))}),getDefaultLineHeight:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>V(t)[V(e)].line_height)}),applyLineHeight:H(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.setBlockAttributes(this.name,r,$y)})}}}),sN=wt.create({name:ke.LETTER_SPACING,group:Rt.SETTINGS,addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getLetterSpacing:H(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultLetterSpacing())),getDefaultLetterSpacing:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>V(t)[V(e)].letter_spacing??null)}),applyLetterSpacing:H(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.applyMark(this.name,r)})}},parseHTML(){const n=e=>{if(!e)return null;const t=V(this.options.wrapperRef);return`${kI(e,t)}px`};return[{tag:'[style*="--zw-letter-spacing"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-letter-spacing-mobile")),tablet:n(e.getPropertyValue("--zw-letter-spacing-tablet")),desktop:n(e.getPropertyValue("--zw-letter-spacing-desktop"))})},{style:"letter-spacing",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:t}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return Cr({letter_spacing_mobile:e(n.mobile),letter_spacing_tablet:e(n.tablet),letter_spacing_desktop:e(n.desktop)})}}),oN=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",Mi(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)}}}),aN=oN.extend({name:oe.LIST_ITEM,marks:Rt.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 s=n(t);for(const a of r.marks)t.addNodeMark(s,bh(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===oe.LIST))return t.listItemNewline()}})});function lN(n,e){if(m1.includes(e.type)||e.type.isInSet(n.marks))return!1;for(const t of n.content.content)if(t.childCount&&(!t.marks||!e.isInSet(t.marks)))return!1;return!0}function uN(n){const e=n.selection.$from.start(),t=n.selection.$to.end();n.doc.nodesBetween(e,t,(r,i)=>{if(r.type.name===oe.LIST)return;if(r.type.name!==oe.LIST_ITEM)return!1;const s=[];return r.forEach(a=>{for(const u of a.marks){if(u.isInSet(s)){n.removeNodeMark(i+1,u);continue}lN(r,u)&&(n.removeNodeMark(i+1,u),n.addNodeMark(i,bh(u)),s.push(u))}}),!1})}const cN=Yn.create({name:oe.LIST,content:`${oe.LIST_ITEM}+`,group:"block list",marks:Rt.SETTINGS,addExtensions:()=>[aN],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:an.DISC}}}),parseHTML(){const n={a:an.ROMAN,i:an.LATIN,1:an.DECIMAL},e=t=>{for(const r of IO){const i=`.${V(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||an.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||an.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[V(this.options.baseClass)+n.bullet.type,V(this.options.presetClass)];return[NO.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:H(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return ge(()=>V(e).type??null)}),applyList:H(({commands:n,chain:e},t)=>V(n.getListType())===t?n.removeList():e().applyDefaultPreset().toggleList(oe.LIST,oe.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({tr:i})=>uN(i)).run()),removeList:H(({chain:n})=>n().expandSelection(({parent:e})=>e.type.name===oe.LIST).command(({tr:e})=>{const t=e.selection.$from.start(),r=e.selection.$to.end();return e.doc.nodesBetween(t,r,(i,s,a)=>{if([oe.LIST,oe.LIST_ITEM].includes(i.type.name))return;if(a.type.name!==oe.LIST_ITEM)return!1;const u=a.marks.filter(c=>!c.type.isInSet(i.marks));for(const c of u)e.addNodeMark(s,bh(c));return!1}),!0}).liftListItem(oe.LIST_ITEM).run())}},addInputRules(){const n=(e,t)=>gO({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(an.DISC,/^\s*([-+*])\s$/),n(an.DECIMAL,/^(\d+)\.\s$/),n(an.LATIN,/^([ivx]{1,3})\.\s$/i),n(an.ROMAN,/^([a-z])\.\s$/i)]}});function fN(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function hN(n){return new ct({key:new It("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(h=>h.docChanged)&&!t.doc.eq(r.doc),s=e.some(h=>h.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=r,u=BA(t.doc,[...e]);if(GA(u).forEach(({newRange:h})=>{const p=$A(r.doc,h,_=>_.isTextblock);let m,y;if(p.length>1?(m=p[0],y=r.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ")):p.length&&r.doc.textBetween(h.from,h.to," "," ").endsWith(" ")&&(m=p[0],y=r.doc.textBetween(m.pos,h.to,void 0," ")),m&&y){const _=y.split(" ").filter(g=>g!=="");if(_.length<=0)return!1;const S=_[_.length-1],E=m.pos+y.lastIndexOf(S);if(!S)return!1;const N=Cl(S).map(g=>g.toObject(n.defaultProtocol));if(!fN(N))return!1;N.filter(g=>g.isLink).map(g=>({...g,from:E+g.start+1,to:E+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate(g.value)).filter(g=>n.shouldAutoLink(g.value)).forEach(g=>{i1(g.from,g.to,r.doc).some(v=>v.mark.type===n.type)||a.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!a.steps.length)return a}})}function dN(n){return new ct({key:new It("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let a=r.target;const u=[];for(;a.nodeName!=="DIV";)u.push(a),a=a.parentNode;if(!u.find(y=>y.nodeName==="A"))return!1;const c=UA(e.state,n.type.name),h=r.target,p=(i=h?.href)!==null&&i!==void 0?i:c.href,m=(s=h?.target)!==null&&s!==void 0?s:c.target;return h&&p?(window.open(p,m),!0):!1}}})}function pN(n){return new ct({key:new It("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:s}=i,{empty:a}=s;if(a)return!1;let u="";r.content.forEach(h=>{u+=h.textContent});const c=N1(u,{defaultProtocol:n.defaultProtocol}).find(h=>h.isLink&&h.value===u);return!u||!c?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}const mN=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Xr(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(mN,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const gN=wt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){I1(n);return}I1(n.scheme,n.optionalSlashes)})},onDestroy(){YO()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!Xr(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Xr(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!Xr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Mi(this.options.HTMLAttributes,n),0]:["a",Mi(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Xr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Xr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[yO({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,i=N1(n).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!Xr(a,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(hN({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Xr(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(dN({type:this.type})),this.options.linkOnPaste&&n.push(pN({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),yN=gN.extend({name:ke.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:Rf.SELF,parseHTML:n=>n.getAttribute("target")||Rf.SELF},destination:{default:Ii.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Ii.URL;const t=e.replace("#","");return V(this.options.pageBlocks).find(s=>s.id===parseInt(t))?Ii.BLOCK:Ii.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(Wy.text(r.text,[Wy.mark(ke.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(()=>ge(()=>V(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),QO.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Ii.BLOCK?`#${n.href}`:n.href,t=V(this.options.basePresetClass)+V(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),bN=wt.create({name:ke.SUPERSCRIPT,addCommands(){return{applySuperscript:H(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:H(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:H(({commands:n})=>{V(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:H(({commands:n})=>{const e=n.getMark(this.name);return ge(()=>!!V(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),_N=Re.create({name:ke.MARGIN,addGlobalAttributes:()=>[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{[ke.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:s}=n.style;return[e,t,r,i,s].some(c=>!!c)?e?{value:e}:{value:[t||0,r||0,i||0,s||0].join(" ")}:null},renderHTML(n){return n.margin?El({margin:n.margin.value}):null}}}}]});function wN(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=Tc({default:null,link:null});return r5(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),KI().concat([JI.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new EN({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),cN.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),QI.configure({device:n.deviceRef}),YI.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),GI.configure({fonts:n.fonts,defaultPreset:bi(t,"default"),defaultFont:n.defaultFont}),jI,XI,ZI,eN,tN,nN,bN,rN,iN.configure({wrapperRef:n.wrapperRef}),sN,yN.configure({preset:bi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),_N])}class vN{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class Hy{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class _n extends Hy{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=_n.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=s=>s.tagName!=="BODY"&&t.call(this,s),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:s=>r(s)?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,s;const a=u=>{this._assignElementProperties(u,e,_n.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,_n.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){a(u),i=null,s=u;continue}if(u.tagName==="BR"&&s&&s?.tagName!=="BR"){u.remove(),s=u;continue}if(u.tagName==="BR"){const c=this.dom.createElement("p");c.append(u),a(c),i=null,s=u;continue}i||(i=this.dom.createElement("p"),a(i)),i.append(u),s=u}e.append(t),this._removeStyleProperties(e,_n.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,_n.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return _n.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return _n.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const s=t.style.getPropertyValue(i);s&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,s)}}_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 s=i.cloneNode();const a=u=>{this._assignElementProperties(u,e,_n.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){a(s),s=i.cloneNode();continue}s.append(u)}t.append(s),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),s=this._parseTextDecoration(i),a={underline:s.underline||t.underline,line_through:s.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),s=i.style.backgroundColor||t;i.style.backgroundColor=s}}_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 SN extends Hy{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!==oe.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(m1.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===oe.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>By.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===oe.TEXT&&this._includesMarkType(e,ke.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 zl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new _n({content:e,parser:t.parser||new vN})}static _buildJson(e){return new SN({content:e})}static normalize(e,t={}){return zl.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 Eh{static build({config:e,nodeDomParser:t}){const r=wN({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:ra(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:ra($n.DESKTOP),pageBlocksRef:ra([]),wrapperRef:Di.document.createElement("p")}),i=WA(r);return new Eh({schema:i,domParser:ws.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=zl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}function xN(n,e){return n.type===e}function CN(n){return typeof n=="string"}class Wy{static doc(e){return{type:oe.DOCUMENT,content:e}}static list(e,t){return{type:oe.LIST,attrs:{bullet:{type:e}},content:t.map(r=>xN(r,oe.LIST_ITEM)?r:this.listItem([r].flat()))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{type:oe.LIST_ITEM,...t?{attrs:t}:{},...i?{marks:i}:{},content:[r].flat().map(s=>CN(s)?this.paragraph(s):s)}}static heading(e,...t){const r=this.textBlock(t);return r.attrs??={},r.attrs.level=e,{type:oe.HEADING,...r}}static paragraph(...e){return{type:oe.PARAGRAPH,...this.textBlock(e)}}static textBlock(e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:[r].flat(),...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:oe.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(ke.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class EN{_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,s=this.makePresetCssClass(r);t+=` ${s} {`;for(const a of OO)for(const u of Object.keys(r[a])){const c=this._makeVariable({device:a,preset:r,property:u}),h=this._makeInternalVariableName(u,a);if(t+=`${h}: var(${c}, inherit);`,i&&!p1.includes(u)){const p=h.replace("preset-","");t+=`${p}: var(${h});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===$n.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 kh{static _instance;static get instance(){return this._instance??=new kh,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 Vy{static createWindow(){return new sm.JSDOM().window}types;parse(e){const{window:t}=new sm.JSDOM(e);return this.types=t,t.document}}class Uy{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){}}class kN extends Uy{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:im.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(e,{config:t,format:r}){Di.use(Vy.createWindow());const i=im.resolve(process.cwd(),t),s=Eh.build({config:require(i).editor,nodeDomParser:new Vy}),a=e.map(h=>s.toJSON(this._formatInputHtml(h))),u=a.length===1?a[0]:a,c=this._stringifyContent(u);this.output(r==="rb"?this._formatOutputRb(c):c)}_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 TN="4.13.0-beta.0";class AN extends Uy{name="version";description="display cli version";doCommand(){this.output(TN)}}const qy=new UC,ON=[kN,AN];for(const n of ON)new n().install(qy);qy.parse();
|
|
64
|
+
}`;var oe=tm(function(){return be(x,j+"return "+B).apply(t,C)});if(oe.source=B,Qu(oe))throw oe;return oe}function $x(o){return _e(o).toLowerCase()}function Hx(o){return _e(o).toUpperCase()}function Wx(o,l,f){if(o=_e(o),o&&(f||l===t))return cd(o);if(!o||!(l=kt(l)))return o;var d=en(o),b=en(l),x=fd(d,b),C=hd(d,b)+1;return sr(d,x,C).join("")}function Vx(o,l,f){if(o=_e(o),o&&(f||l===t))return o.slice(0,pd(o)+1);if(!o||!(l=kt(l)))return o;var d=en(o),b=hd(d,en(l))+1;return sr(d,0,b).join("")}function Ux(o,l,f){if(o=_e(o),o&&(f||l===t))return o.replace(Ql,"");if(!o||!(l=kt(l)))return o;var d=en(o),b=fd(d,en(l));return sr(d,b).join("")}function qx(o,l){var f=te,d=Se;if(Me(l)){var b="separator"in l?l.separator:b;f="length"in l?se(l.length):f,d="omission"in l?kt(l.omission):d}o=_e(o);var x=o.length;if(ri(o)){var C=en(o);x=C.length}if(f>=x)return o;var O=f-ii(d);if(O<1)return d;var I=C?sr(C,0,O).join(""):o.slice(0,O);if(b===t)return I+d;if(C&&(O+=I.length-O),ec(b)){if(o.slice(O).search(b)){var P,D=I;for(b.global||(b=gu(b.source,_e(Nh.exec(b))+"g")),b.lastIndex=0;P=b.exec(D);)var B=P.index;I=I.slice(0,B===t?O:B)}}else if(o.indexOf(kt(b),O)!=O){var q=I.lastIndexOf(b);q>-1&&(I=I.slice(0,q))}return I+d}function Kx(o){return o=_e(o),o&&rb.test(o)?o.replace(Oh,v2):o}var Gx=fi(function(o,l,f){return o+(f?" ":"")+l.toUpperCase()}),rc=np("toUpperCase");function em(o,l,f){return o=_e(o),l=f?t:l,l===t?g2(o)?C2(o):a2(o):o.match(l)||[]}var tm=ue(function(o,l){try{return Ct(o,t,l)}catch(f){return Qu(f)?f:new ne(f)}}),Jx=On(function(o,l){return zt(l,function(f){f=dn(f),An(o,f,Xu(o[f],o))}),o});function jx(o){var l=o==null?0:o.length,f=Y();return o=l?Te(o,function(d){if(typeof d[1]!="function")throw new $t(a);return[f(d[0]),d[1]]}):[],ue(function(d){for(var b=-1;++b<l;){var x=o[b];if(Ct(x[0],this,d))return Ct(x[1],this,d)}})}function Yx(o){return v_(Wt(o,m))}function ic(o){return function(){return o}}function Xx(o,l){return o==null||o!==o?l:o}var Zx=ip(),Qx=ip(!0);function mt(o){return o}function sc(o){return Ld(typeof o=="function"?o:Wt(o,m))}function eC(o){return Dd(Wt(o,m))}function tC(o,l){return Fd(o,Wt(l,m))}var nC=ue(function(o,l){return function(f){return rs(f,o,l)}}),rC=ue(function(o,l){return function(f){return rs(o,f,l)}});function oc(o,l,f){var d=Ve(l),b=xo(l,d);f==null&&!(Me(l)&&(b.length||!d.length))&&(f=l,l=o,o=this,b=xo(l,Ve(l)));var x=!(Me(f)&&"chain"in f)||!!f.chain,C=In(o);return zt(b,function(O){var I=l[O];o[O]=I,C&&(o.prototype[O]=function(){var P=this.__chain__;if(x||P){var D=o(this.__wrapped__),B=D.__actions__=ht(this.__actions__);return B.push({func:I,args:arguments,thisArg:o}),D.__chain__=P,D}return I.apply(o,Qn([this.value()],arguments))})}),o}function iC(){return Xe._===this&&(Xe._=M2),this}function ac(){}function sC(o){return o=se(o),ue(function(l){return Bd(l,o)})}var oC=Bu(Te),aC=Bu(sd),lC=Bu(uu);function nm(o){return qu(o)?cu(dn(o)):B_(o)}function uC(o){return function(l){return o==null?t:Lr(o,l)}}var cC=op(),fC=op(!0);function lc(){return[]}function uc(){return!1}function hC(){return{}}function dC(){return""}function pC(){return!0}function mC(o,l){if(o=se(o),o<1||o>Xn)return[];var f=xt,d=nt(o,xt);l=Y(l),o-=xt;for(var b=du(d,l);++f<o;)l(f);return b}function gC(o){return re(o)?Te(o,dn):At(o)?[o]:ht(Sp(_e(o)))}function yC(o){var l=++T2;return _e(o)+l}var bC=Oo(function(o,l){return o+l},0),_C=zu("ceil"),wC=Oo(function(o,l){return o/l},1),vC=zu("floor");function SC(o){return o&&o.length?So(o,mt,Cu):t}function xC(o,l){return o&&o.length?So(o,Y(l,2),Cu):t}function CC(o){return ld(o,mt)}function EC(o,l){return ld(o,Y(l,2))}function kC(o){return o&&o.length?So(o,mt,Tu):t}function AC(o,l){return o&&o.length?So(o,Y(l,2),Tu):t}var TC=Oo(function(o,l){return o*l},1),OC=zu("round"),MC=Oo(function(o,l){return o-l},0);function IC(o){return o&&o.length?hu(o,mt):0}function NC(o,l){return o&&o.length?hu(o,Y(l,2)):0}return w.after=eS,w.ary=Rp,w.assign=HS,w.assignIn=Gp,w.assignInWith=Wo,w.assignWith=WS,w.at=VS,w.before=Lp,w.bind=Xu,w.bindAll=Jx,w.bindKey=Pp,w.castArray=hS,w.chain=Mp,w.chunk=vw,w.compact=Sw,w.concat=xw,w.cond=jx,w.conforms=Yx,w.constant=ic,w.countBy=Iv,w.create=US,w.curry=Dp,w.curryRight=Fp,w.debounce=Bp,w.defaults=qS,w.defaultsDeep=KS,w.defer=tS,w.delay=nS,w.difference=Cw,w.differenceBy=Ew,w.differenceWith=kw,w.drop=Aw,w.dropRight=Tw,w.dropRightWhile=Ow,w.dropWhile=Mw,w.fill=Iw,w.filter=Rv,w.flatMap=Dv,w.flatMapDeep=Fv,w.flatMapDepth=Bv,w.flatten=kp,w.flattenDeep=Nw,w.flattenDepth=Rw,w.flip=rS,w.flow=Zx,w.flowRight=Qx,w.fromPairs=Lw,w.functions=QS,w.functionsIn=ex,w.groupBy=zv,w.initial=Dw,w.intersection=Fw,w.intersectionBy=Bw,w.intersectionWith=zw,w.invert=nx,w.invertBy=rx,w.invokeMap=Hv,w.iteratee=sc,w.keyBy=Wv,w.keys=Ve,w.keysIn=pt,w.map=Do,w.mapKeys=sx,w.mapValues=ox,w.matches=eC,w.matchesProperty=tC,w.memoize=Bo,w.merge=ax,w.mergeWith=Jp,w.method=nC,w.methodOf=rC,w.mixin=oc,w.negate=zo,w.nthArg=sC,w.omit=lx,w.omitBy=ux,w.once=iS,w.orderBy=Vv,w.over=oC,w.overArgs=sS,w.overEvery=aC,w.overSome=lC,w.partial=Zu,w.partialRight=zp,w.partition=Uv,w.pick=cx,w.pickBy=jp,w.property=nm,w.propertyOf=uC,w.pull=Vw,w.pullAll=Tp,w.pullAllBy=Uw,w.pullAllWith=qw,w.pullAt=Kw,w.range=cC,w.rangeRight=fC,w.rearg=oS,w.reject=Gv,w.remove=Gw,w.rest=aS,w.reverse=ju,w.sampleSize=jv,w.set=hx,w.setWith=dx,w.shuffle=Yv,w.slice=Jw,w.sortBy=Qv,w.sortedUniq=tv,w.sortedUniqBy=nv,w.split=Dx,w.spread=lS,w.tail=rv,w.take=iv,w.takeRight=sv,w.takeRightWhile=ov,w.takeWhile=av,w.tap=Sv,w.throttle=uS,w.thru=Po,w.toArray=Up,w.toPairs=Yp,w.toPairsIn=Xp,w.toPath=gC,w.toPlainObject=Kp,w.transform=px,w.unary=cS,w.union=lv,w.unionBy=uv,w.unionWith=cv,w.uniq=fv,w.uniqBy=hv,w.uniqWith=dv,w.unset=mx,w.unzip=Yu,w.unzipWith=Op,w.update=gx,w.updateWith=yx,w.values=pi,w.valuesIn=bx,w.without=pv,w.words=em,w.wrap=fS,w.xor=mv,w.xorBy=gv,w.xorWith=yv,w.zip=bv,w.zipObject=_v,w.zipObjectDeep=wv,w.zipWith=vv,w.entries=Yp,w.entriesIn=Xp,w.extend=Gp,w.extendWith=Wo,oc(w,w),w.add=bC,w.attempt=tm,w.camelCase=Sx,w.capitalize=Zp,w.ceil=_C,w.clamp=_x,w.clone=dS,w.cloneDeep=mS,w.cloneDeepWith=gS,w.cloneWith=pS,w.conformsTo=yS,w.deburr=Qp,w.defaultTo=Xx,w.divide=wC,w.endsWith=xx,w.eq=nn,w.escape=Cx,w.escapeRegExp=Ex,w.every=Nv,w.find=Lv,w.findIndex=Cp,w.findKey=GS,w.findLast=Pv,w.findLastIndex=Ep,w.findLastKey=JS,w.floor=vC,w.forEach=Ip,w.forEachRight=Np,w.forIn=jS,w.forInRight=YS,w.forOwn=XS,w.forOwnRight=ZS,w.get=tc,w.gt=bS,w.gte=_S,w.has=tx,w.hasIn=nc,w.head=Ap,w.identity=mt,w.includes=$v,w.indexOf=Pw,w.inRange=wx,w.invoke=ix,w.isArguments=Fr,w.isArray=re,w.isArrayBuffer=wS,w.isArrayLike=dt,w.isArrayLikeObject=Le,w.isBoolean=vS,w.isBuffer=or,w.isDate=SS,w.isElement=xS,w.isEmpty=CS,w.isEqual=ES,w.isEqualWith=kS,w.isError=Qu,w.isFinite=AS,w.isFunction=In,w.isInteger=$p,w.isLength=$o,w.isMap=Hp,w.isMatch=TS,w.isMatchWith=OS,w.isNaN=MS,w.isNative=IS,w.isNil=RS,w.isNull=NS,w.isNumber=Wp,w.isObject=Me,w.isObjectLike=Ie,w.isPlainObject=cs,w.isRegExp=ec,w.isSafeInteger=LS,w.isSet=Vp,w.isString=Ho,w.isSymbol=At,w.isTypedArray=di,w.isUndefined=PS,w.isWeakMap=DS,w.isWeakSet=FS,w.join=$w,w.kebabCase=kx,w.last=Ut,w.lastIndexOf=Hw,w.lowerCase=Ax,w.lowerFirst=Tx,w.lt=BS,w.lte=zS,w.max=SC,w.maxBy=xC,w.mean=CC,w.meanBy=EC,w.min=kC,w.minBy=AC,w.stubArray=lc,w.stubFalse=uc,w.stubObject=hC,w.stubString=dC,w.stubTrue=pC,w.multiply=TC,w.nth=Ww,w.noConflict=iC,w.noop=ac,w.now=Fo,w.pad=Ox,w.padEnd=Mx,w.padStart=Ix,w.parseInt=Nx,w.random=vx,w.reduce=qv,w.reduceRight=Kv,w.repeat=Rx,w.replace=Lx,w.result=fx,w.round=OC,w.runInContext=M,w.sample=Jv,w.size=Xv,w.snakeCase=Px,w.some=Zv,w.sortedIndex=jw,w.sortedIndexBy=Yw,w.sortedIndexOf=Xw,w.sortedLastIndex=Zw,w.sortedLastIndexBy=Qw,w.sortedLastIndexOf=ev,w.startCase=Fx,w.startsWith=Bx,w.subtract=MC,w.sum=IC,w.sumBy=NC,w.template=zx,w.times=mC,w.toFinite=Nn,w.toInteger=se,w.toLength=qp,w.toLower=$x,w.toNumber=qt,w.toSafeInteger=$S,w.toString=_e,w.toUpper=Hx,w.trim=Wx,w.trimEnd=Vx,w.trimStart=Ux,w.truncate=qx,w.unescape=Kx,w.uniqueId=yC,w.upperCase=Gx,w.upperFirst=rc,w.each=Ip,w.eachRight=Np,w.first=Ap,oc(w,function(){var o={};return fn(w,function(l,f){ve.call(w.prototype,f)||(o[f]=l)}),o}(),{chain:!1}),w.VERSION=r,zt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){w[o].placeholder=w}),zt(["drop","take"],function(o,l){fe.prototype[o]=function(f){f=f===t?1:ze(se(f),0);var d=this.__filtered__&&!l?new fe(this):this.clone();return d.__filtered__?d.__takeCount__=nt(f,d.__takeCount__):d.__views__.push({size:nt(f,xt),type:o+(d.__dir__<0?"Right":"")}),d},fe.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),zt(["filter","map","takeWhile"],function(o,l){var f=l+1,d=f==Ft||f==We;fe.prototype[o]=function(b){var x=this.clone();return x.__iteratees__.push({iteratee:Y(b,3),type:f}),x.__filtered__=x.__filtered__||d,x}}),zt(["head","last"],function(o,l){var f="take"+(l?"Right":"");fe.prototype[o]=function(){return this[f](1).value()[0]}}),zt(["initial","tail"],function(o,l){var f="drop"+(l?"":"Right");fe.prototype[o]=function(){return this.__filtered__?new fe(this):this[f](1)}}),fe.prototype.compact=function(){return this.filter(mt)},fe.prototype.find=function(o){return this.filter(o).head()},fe.prototype.findLast=function(o){return this.reverse().find(o)},fe.prototype.invokeMap=ue(function(o,l){return typeof o=="function"?new fe(this):this.map(function(f){return rs(f,o,l)})}),fe.prototype.reject=function(o){return this.filter(zo(Y(o)))},fe.prototype.slice=function(o,l){o=se(o);var f=this;return f.__filtered__&&(o>0||l<0)?new fe(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),l!==t&&(l=se(l),f=l<0?f.dropRight(-l):f.take(l-o)),f)},fe.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},fe.prototype.toArray=function(){return this.take(xt)},fn(fe.prototype,function(o,l){var f=/^(?:filter|find|map|reject)|While$/.test(l),d=/^(?:head|last)$/.test(l),b=w[d?"take"+(l=="last"?"Right":""):l],x=d||/^find/.test(l);b&&(w.prototype[l]=function(){var C=this.__wrapped__,O=d?[1]:arguments,I=C instanceof fe,P=O[0],D=I||re(C),B=function(ce){var me=b.apply(w,Qn([ce],O));return d&&q?me[0]:me};D&&f&&typeof P=="function"&&P.length!=1&&(I=D=!1);var q=this.__chain__,j=!!this.__actions__.length,X=x&&!q,oe=I&&!j;if(!x&&D){C=oe?C:new fe(this);var Z=o.apply(C,O);return Z.__actions__.push({func:Po,args:[B],thisArg:t}),new Ht(Z,q)}return X&&oe?o.apply(this,O):(Z=this.thru(B),X?d?Z.value()[0]:Z.value():Z)})}),zt(["pop","push","shift","sort","splice","unshift"],function(o){var l=oo[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",d=/^(?:pop|shift)$/.test(o);w.prototype[o]=function(){var b=arguments;if(d&&!this.__chain__){var x=this.value();return l.apply(re(x)?x:[],b)}return this[f](function(C){return l.apply(re(C)?C:[],b)})}}),fn(fe.prototype,function(o,l){var f=w[l];if(f){var d=f.name+"";ve.call(li,d)||(li[d]=[]),li[d].push({name:l,func:f})}}),li[To(t,g).name]=[{name:"wrapper",func:t}],fe.prototype.clone=K2,fe.prototype.reverse=G2,fe.prototype.value=J2,w.prototype.at=xv,w.prototype.chain=Cv,w.prototype.commit=Ev,w.prototype.next=kv,w.prototype.plant=Tv,w.prototype.reverse=Ov,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=Mv,w.prototype.first=w.prototype.head,Yi&&(w.prototype[Yi]=Av),w},si=E2();Or?((Or.exports=si)._=si,su._=si):Xe._=si}).call(RI)}(Us,Us.exports)),Us.exports}var By=LI();function bh(n){return n.type.create(By.cloneDeep(n.attrs))}function PI(n){return JSON.parse(JSON.stringify(n))}function _h({tr:n,node:e,position:t,mark:r}){return e.isText?n.removeMark(t,t+e.nodeSize,r):n.removeNodeMark(t,r)}const DI=Re.create({name:"node_processor",addCommands(){return{setBlockAttributes:H(({commands:n,state:e},t,r,i={})=>{const s=PI(r),a=V(n.getBlockAttributes(t))??{},{doc:u,tr:c}=e,{from:h,to:p}=c.selection;u.nodesBetween(h,p,(m,y)=>{Nf.includes(m.type.name)&&c.setNodeAttribute(y,t,{...i,...a,...s})})}),getBlockAttributes:H(({editor:n},e,t)=>ge(()=>{let r=Object.assign({},t||{});for(const i of Nf)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:H(({commands:n},e)=>{for(const t of Nf)n.resetAttributes(t,e)}),applyMark:H(({state:n,commands:e},t,r,i={})=>{const{tr:s,doc:a,schema:u}=n,{$from:c,$to:h}=s.selection,p=mn(ke.LINK,u),m=mn(t,u);if(!(m.spec.group||"").includes(Rt.SETTINGS))return e.setMark(t,r);if(c.pos===h.pos)return;const _=S=>{if(!i.onAppliedToParent||i.onAppliedToParent(S)===!1){const{tr:E,node:N,position:g,mark:v}=S;_h({tr:E,node:N,position:g,mark:v.type})}};a.nodesBetween(c.pos,h.pos,(S,E)=>{if(S.type.name===ie.LIST)return;const N=NI(S.marks,t),g=m.create({...N?.attrs||{},...r}),v=Py(c,h,S,E);if(!p.isInSet(S.marks)&&II(s.doc,E,g,i.isAppliedToParent))return _({tr:s,node:S,position:E,mark:g});if(S.isText){s.addMark(v.from,v.to,g);return}OI(s.doc,s.selection,S,E)&&s.addNodeMark(E,g)})}),getMarks:H(({editor:n},e)=>{const t=bi(n,"state");return ge(()=>{const{selection:r,doc:i}=V(t),{from:s,to:a}=V(r),u=[];return i.nodesBetween(s,a,c=>{for(const h of c.marks)h.type.name===e&&u.unshift(h.attrs)}),u})}),getMark:H(({commands:n},e)=>{const t=n.getMarks(e);return ge(()=>V(t)[0]??null)}),hasMark:H(({commands:n},e)=>{const t=n.getMark(e);return ge(()=>!!V(t))}),getCommonSettingMark:H(({commands:n},e,t)=>{const r=n.getMark(e);return ge(()=>V(r)?.value??V(t))}),getDeviceSettingMark:H(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return ge(()=>{for(const s of V(r)){const a=s[V(i)];if(a||a===0)return a}return V(t)})}),removeAllMarks:H(({state:n})=>{const{tr:e,doc:t}=n,{from:r,to:i}=e.selection;t.nodesBetween(r,i,(s,a)=>{for(const u of s.marks)_h({tr:e,node:s,position:a,mark:u})})}),removeMarks:H(({state:n},e)=>{const{tr:t,doc:r}=n,{from:i,to:s}=t.selection;r.nodesBetween(i,s,(a,u)=>{const c=a.marks.filter(h=>e.includes(h.type.name));for(const h of c)_h({tr:t,node:a,position:u,mark:h})})})}}}),FI=Re.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,s)=>{if(!i.isText)return;const a=Py(t,r,i,s),u=Math.max(0,t.pos-s),c=Math.max(0,r.pos-s),h=e({text:i.textContent.substring(u,c)}),p=n.schema.text(h,i.marks);n.tr.replaceWith(a.from,a.to,p)})})}}}),BI=Re.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;return n.doc.nodesBetween(r,i,(s,a,u)=>{if(t({node:s,parent:u})){const c=s.isText?0:Dy(n.doc,a);r=Math.min(r,a+c),i=Math.max(i,a+s.nodeSize-c)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:H(({commands:n})=>n.expandSelection(({parent:e})=>e.type.name===ie.DOCUMENT))}}}),zI=Yn.create({name:"doc",topNode:!0,content:"block+"});class Js extends Ue{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=hr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,De.ok(t)}invert(){return new Js(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 Js(e.key,e.value,e.stepType)}}Ue.jsonID("setDocAttr",Js);const $I=zI.extend({marks:Rt.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 Js(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",Mi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),WI=HI.extend({marks:Rt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),VI=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]}`,Mi(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=>mO({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),UI=VI.extend({marks:Rt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),qI=Re.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[RO.create(this.editor),LO.create(this.editor)]}}),KI=()=>[$I,WI,UI,bO,TO,DI,FI,BI,qI],GI=wt.create({name:ke.FONT_FAMILY,group:Rt.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=V(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(ke.FONT_STYLE).value;t.isItalicOnly?n.applyItalic():!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:H(({commands:n})=>{const e=V(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return ge(()=>n.findFontByName(V(r))||t)}),findFontByName:H((n,e)=>V(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 ge(()=>V(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 Cr({font_family:e})}}),JI=Re.create({name:ke.STYLE_PRESET,addGlobalAttributes(){return[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{preset:{isRequired:!1,default:{id:V(this.options.defaultId)},parseHTML:n=>{const e=V(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 s=V(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(s))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:V(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:V(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 s of Object.keys(t)){const a=t[s],u=r[s],c=!u||u.toLowerCase()==="inherit";i[s]=c?a:u}return i}return{getPresetList:H(()=>ge(()=>V(this.options.presets).filter(t=>!t.hidden))),getPreset:H(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:V(this.options.defaultId)}),i=t.getPresetList(),s=t.isLink(),a=t.getLinkPreset();return ge(()=>{const u=n(V(i),V(r).id);if(!V(s))return u;const c=V(a);return{id:u.id,common:e(u.common,c.common),mobile:e(u.mobile,c.mobile),tablet:e(u.tablet,c.tablet),desktop:e(u.desktop,c.desktop)}})}),applyPreset:H(({commands:t,chain:r},i)=>{const s=V(t.getPresetList()),a=n(s,i),u=a.node?.type??ie.PARAGRAPH,c={preset:{id:i}};a.node&&(c.level=a.node.level);for(const h of p1)c[h]=V(t.getBlockAttributes(h));r().removeList().setNode(u,c).run()}),applyDefaultPreset:H(({commands:t})=>{t.applyPreset(V(this.options.defaultId))}),removePreset:H(({commands:t})=>{t.setNode(ie.PARAGRAPH,{preset:null})}),getPresetCustomization:H(({editor:t,commands:r})=>{const i=bi(t,"state");return ge(()=>{const{selection:s,doc:a}=V(i),{from:u,to:c}=s;return r._getSettingCustomization(a,u,c)})}),isSettingCustomized:H(({commands:t},r)=>{const i=t.getPresetCustomization(),s=Ii.includes(r)?"attributes":"marks";return ge(()=>V(i)[s]?.includes(r)??!1)}),getContentCustomization:H(({editor:t,commands:r})=>{const i=bi(t,"state");return ge(()=>{const{doc:s}=V(i);return r._getSettingCustomization(s,0,s.content.size)})}),_getSettingCustomization:H((t,r,i,s)=>{const a=new Set,u=new Set;return r.nodesBetween(i,s,c=>{for(const[h,p]of Object.entries(c.attrs))Ii.includes(h)&&p&&u.add(h);for(const{type:h}of c.marks)g1.includes(h.name)&&a.add(h.name)}),{attributes:Array.from(u),marks:Array.from(a)}}),removePresetCustomization:H(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(g1).resetAttributes(ie.PARAGRAPH,Ii).resetAttributes(ie.HEADING,Ii).restoreSelection().run()}),removeFormat:H(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().resetAttributes(ie.PARAGRAPH,Ii).resetAttributes(ie.HEADING,Ii).restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Fi.head,V(this.options.presets))}}),jI=wt.create({name:ke.FONT_WEIGHT,group:Rt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:H(({commands:n},e)=>{n.applyMark(this.name,{value:e}),V(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:H(({commands:n})=>{const e=V(n.getFontWeight()),t=V(n.getFont()),i=Number(e)>=600?"400":"700",s=t.findClosestWeight(i);n.applyFontWeight(s)}),getFontWeight:H(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return ge(()=>{const r=V(e),i=V(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:H(({commands:n})=>{const e=n.getPreset();return ge(()=>V(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Yt("toggleBold"),"Mod-B":Yt("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 Cr({font_weight:n.value})}}),YI=wt.create({name:ke.FONT_SIZE,group:Rt.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 ge(()=>V(t)[V(e)].font_size.replace("px",""))}),applyFontSize:H(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.applyMark(this.name,r,{isAppliedToParent:(i,s)=>i.type.name!==s.type.name?!1:t.every(a=>i.attrs[a]===s.attrs[a]),onAppliedToParent:({tr:i,node:s,position:a,mark:u})=>{const c={...u.attrs};if(t.forEach(m=>{c[m]=null}),!Object.values(c).some(m=>!!m))return!1;const p=u.type.create(c);if(s.isText){i.addMark(a,a+s.nodeSize,p);return}i.addNodeMark(a,p)}})}),increaseFontSize:H(({commands:n})=>{const e=Number(V(n.getFontSize())),t=Math.min(e+1,V(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:H(({commands:n})=>{const e=Number(V(n.getFontSize())),t=Math.max(e-1,V(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Yt("increaseFontSize"),"Mod-Shift--":Yt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=V(this.options.wrapperRef),r=Ly(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 Cr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),XI=wt.create({name:ke.FONT_COLOR,group:Rt.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 ge(()=>V(e).common.color)}),applyFontColor:H(({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 Cr({font_color:n.value})}}),ZI=wt.create({name:ke.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:Ny(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Cr({background_color:n.value})}}),QI=Re.create({name:"device_manager",addCommands(){return{getDevice:H(()=>{const n=bi(this.options,"device");return ge(()=>{const e=V(n);return e===$n.ALL?$n.DESKTOP:e})}),getTargetDevices:H(()=>{const n=V(this.options.device);return n===$n.ALL?[$n.DESKTOP,$n.TABLET,$n.MOBILE]:[n]})}}}),eN=wt.create({name:ke.FONT_STYLE,group:Rt.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:H(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return ge(()=>V(e)?.italic??V(t).italic)}),isItalicAvailable:H(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return ge(()=>{const r=V(e),i=V(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:H(({commands:n})=>{const e=n.getPreset();return ge(()=>({italic:V(e).common.font_style==="italic"}))}),toggleItalic:H(({commands:n})=>{V(n.isItalicAvailable())&&(V(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":Yt("toggleItalic"),"Mod-I":Yt("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 Cr({font_style:e})}}),tN=wt.create({name:ke.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:H(({commands:n})=>{const e=n.getTextDecoration();return ge(()=>V(e).underline)}),isStrikeThrough:H(({commands:n})=>{const e=n.getTextDecoration();return ge(()=>V(e).strike_through)}),getTextDecoration:H(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return ge(()=>{const r=V(e)??{},i=V(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 ge(()=>V(e)!==V(t).underline)}),getDefaultTextDecoration:H(({commands:n})=>{const e=n.getPreset();return ge(()=>{const{text_decoration:t}=V(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=V(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":Yt("toggleUnderline"),"Mod-U":Yt("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"),Cr({text_decoration:e.join(" ")})}}),nN=Re.create({name:"case_style",addCommands(){return{applyCaseStyle:H(({commands:n},e)=>{switch(e){case Ka.CAPITALIZE:return n.applyCapitalize();case Ka.LOWERCASE:return n.applyLowerCase();case Ka.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:H(({commands:n})=>{n.transformText(({text:e})=>eM(e))}),applyLowerCase:H(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:H(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),zy={mobile:null,tablet:null,desktop:null},rN=Re.create({name:ke.ALIGNMENT,addGlobalAttributes:()=>[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[ke.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=TI(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?El({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=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.setBlockAttributes(this.name,r,zy)}),removeAlignment:H(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:H(({commands:n})=>{const e=n.getBlockAttributes(this.name,zy),t=n.getDevice(),r=n.getDefaultAlignment();return ge(()=>V(e)?.[V(t)]??V(r))}),getDefaultAlignment:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>V(t)[V(e)].alignment??wr.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Yt("applyAlignment",wr.LEFT),"Mod-Shift-e":Yt("applyAlignment",wr.CENTER),"Mod-Shift-r":Yt("applyAlignment",wr.RIGHT),"Mod-Shift-j":Yt("applyAlignment",wr.JUSTIFY)})}),$y={mobile:null,tablet:null,desktop:null},iN=Re.create({name:ke.LINE_HEIGHT,addGlobalAttributes(){return[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[ke.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const s=n.style.getPropertyValue("--zw-line-height-tablet")||null,a=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:s,desktop:a}}const e=n.style.lineHeight;if(!e)return null;const t=V(this.options.wrapperRef),r=EI(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?El({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,$y),t=n.getDevice(),r=n.getDefaultLineHeight();return ge(()=>V(e)?.[V(t)]??V(r))}),getDefaultLineHeight:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>V(t)[V(e)].line_height)}),applyLineHeight:H(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.setBlockAttributes(this.name,r,$y)})}}}),sN=wt.create({name:ke.LETTER_SPACING,group:Rt.SETTINGS,addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getLetterSpacing:H(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultLetterSpacing())),getDefaultLetterSpacing:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>V(t)[V(e)].letter_spacing??null)}),applyLetterSpacing:H(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.applyMark(this.name,r)})}},parseHTML(){const n=e=>{if(!e)return null;const t=V(this.options.wrapperRef);return`${kI(e,t)}px`};return[{tag:'[style*="--zw-letter-spacing"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-letter-spacing-mobile")),tablet:n(e.getPropertyValue("--zw-letter-spacing-tablet")),desktop:n(e.getPropertyValue("--zw-letter-spacing-desktop"))})},{style:"letter-spacing",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:t}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return Cr({letter_spacing_mobile:e(n.mobile),letter_spacing_tablet:e(n.tablet),letter_spacing_desktop:e(n.desktop)})}}),oN=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",Mi(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)}}}),aN=oN.extend({name:ie.LIST_ITEM,marks:Rt.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 s=n(t);for(const a of r.marks)t.addNodeMark(s,bh(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()}})});function lN(n,e){if(m1.includes(e.type)||e.type.isInSet(n.marks))return!1;for(const t of n.content.content)if(t.childCount&&(!t.marks||!e.isInSet(t.marks)))return!1;return!0}function uN(n){const e=n.selection.$from.start(),t=n.selection.$to.end();n.doc.nodesBetween(e,t,(r,i)=>{if(r.type.name===ie.LIST)return;if(r.type.name!==ie.LIST_ITEM)return!1;const s=[];return r.forEach(a=>{for(const u of a.marks){if(u.isInSet(s)){n.removeNodeMark(i+1,u);continue}lN(r,u)&&(n.removeNodeMark(i+1,u),n.addNodeMark(i,bh(u)),s.push(u))}}),!1})}const cN=Yn.create({name:ie.LIST,content:`${ie.LIST_ITEM}+`,group:"block list",marks:Rt.SETTINGS,addExtensions:()=>[aN],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:an.DISC}}}),parseHTML(){const n={a:an.ROMAN,i:an.LATIN,1:an.DECIMAL},e=t=>{for(const r of IO){const i=`.${V(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||an.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||an.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[V(this.options.baseClass)+n.bullet.type,V(this.options.presetClass)];return[NO.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:H(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return ge(()=>V(e).type??null)}),applyList:H(({commands:n,chain:e},t)=>V(n.getListType())===t?n.removeList():e().applyDefaultPreset().toggleList(ie.LIST,ie.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({tr:i})=>uN(i)).run()),removeList:H(({chain:n})=>n().expandSelection(({parent:e})=>e.type.name===ie.LIST).command(({tr:e})=>{const t=e.selection.$from.start(),r=e.selection.$to.end();return e.doc.nodesBetween(t,r,(i,s,a)=>{if([ie.LIST,ie.LIST_ITEM].includes(i.type.name))return;if(a.type.name!==ie.LIST_ITEM)return!1;const u=a.marks.filter(c=>!c.type.isInSet(i.marks));for(const c of u)e.addNodeMark(s,bh(c));return!1}),!0}).liftListItem(ie.LIST_ITEM).run())}},addInputRules(){const n=(e,t)=>gO({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(an.DISC,/^\s*([-+*])\s$/),n(an.DECIMAL,/^(\d+)\.\s$/),n(an.LATIN,/^([ivx]{1,3})\.\s$/i),n(an.ROMAN,/^([a-z])\.\s$/i)]}});function fN(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function hN(n){return new ct({key:new It("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(h=>h.docChanged)&&!t.doc.eq(r.doc),s=e.some(h=>h.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=r,u=BT(t.doc,[...e]);if(GT(u).forEach(({newRange:h})=>{const p=$T(r.doc,h,_=>_.isTextblock);let m,y;if(p.length>1?(m=p[0],y=r.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ")):p.length&&r.doc.textBetween(h.from,h.to," "," ").endsWith(" ")&&(m=p[0],y=r.doc.textBetween(m.pos,h.to,void 0," ")),m&&y){const _=y.split(" ").filter(g=>g!=="");if(_.length<=0)return!1;const S=_[_.length-1],E=m.pos+y.lastIndexOf(S);if(!S)return!1;const N=Cl(S).map(g=>g.toObject(n.defaultProtocol));if(!fN(N))return!1;N.filter(g=>g.isLink).map(g=>({...g,from:E+g.start+1,to:E+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate(g.value)).filter(g=>n.shouldAutoLink(g.value)).forEach(g=>{i1(g.from,g.to,r.doc).some(v=>v.mark.type===n.type)||a.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!a.steps.length)return a}})}function dN(n){return new ct({key:new It("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let a=r.target;const u=[];for(;a.nodeName!=="DIV";)u.push(a),a=a.parentNode;if(!u.find(y=>y.nodeName==="A"))return!1;const c=UT(e.state,n.type.name),h=r.target,p=(i=h?.href)!==null&&i!==void 0?i:c.href,m=(s=h?.target)!==null&&s!==void 0?s:c.target;return h&&p?(window.open(p,m),!0):!1}}})}function pN(n){return new ct({key:new It("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:s}=i,{empty:a}=s;if(a)return!1;let u="";r.content.forEach(h=>{u+=h.textContent});const c=N1(u,{defaultProtocol:n.defaultProtocol}).find(h=>h.isLink&&h.value===u);return!u||!c?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}const mN=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Xr(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(mN,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const gN=wt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){I1(n);return}I1(n.scheme,n.optionalSlashes)})},onDestroy(){YO()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!Xr(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Xr(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!Xr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Mi(this.options.HTMLAttributes,n),0]:["a",Mi(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Xr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Xr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[yO({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,i=N1(n).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!Xr(a,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(hN({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Xr(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(dN({type:this.type})),this.options.linkOnPaste&&n.push(pN({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),yN=gN.extend({name:ke.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:Rf.SELF,parseHTML:n=>n.getAttribute("target")||Rf.SELF},destination:{default:Ni.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Ni.URL;const t=e.replace("#","");return V(this.options.pageBlocks).find(s=>s.id===parseInt(t))?Ni.BLOCK:Ni.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(Wy.text(r.text,[Wy.mark(ke.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(()=>ge(()=>V(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),QO.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Ni.BLOCK?`#${n.href}`:n.href,t=V(this.options.basePresetClass)+V(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),bN=wt.create({name:ke.SUPERSCRIPT,addCommands(){return{applySuperscript:H(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:H(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:H(({commands:n})=>{V(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:H(({commands:n})=>{const e=n.getMark(this.name);return ge(()=>!!V(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),_N=Re.create({name:ke.MARGIN,addGlobalAttributes:()=>[{types:[ie.PARAGRAPH,ie.HEADING],attributes:{[ke.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:s}=n.style;return[e,t,r,i,s].some(c=>!!c)?e?{value:e}:{value:[t||0,r||0,i||0,s||0].join(" ")}:null},renderHTML(n){return n.margin?El({margin:n.margin.value}):null}}}}]});function wN(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=Ac({default:null,link:null});return r5(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),KI().concat([JI.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new EN({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),cN.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),QI.configure({device:n.deviceRef}),YI.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),GI.configure({fonts:n.fonts,defaultPreset:bi(t,"default"),defaultFont:n.defaultFont}),jI,XI,ZI,eN,tN,nN,bN,rN,iN.configure({wrapperRef:n.wrapperRef}),sN,yN.configure({preset:bi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),_N])}class vN{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class Hy{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class _n extends Hy{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=_n.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=s=>s.tagName!=="BODY"&&t.call(this,s),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:s=>r(s)?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,s;const a=u=>{this._assignElementProperties(u,e,_n.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,_n.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){a(u),i=null,s=u;continue}if(u.tagName==="BR"&&s&&s?.tagName!=="BR"){u.remove(),s=u;continue}if(u.tagName==="BR"){const c=this.dom.createElement("p");c.append(u),a(c),i=null,s=u;continue}i||(i=this.dom.createElement("p"),a(i)),i.append(u),s=u}e.append(t),this._removeStyleProperties(e,_n.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,_n.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return _n.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return _n.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const s=t.style.getPropertyValue(i);s&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,s)}}_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 s=i.cloneNode();const a=u=>{this._assignElementProperties(u,e,_n.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){a(s),s=i.cloneNode();continue}s.append(u)}t.append(s),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),s=this._parseTextDecoration(i),a={underline:s.underline||t.underline,line_through:s.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),s=i.style.backgroundColor||t;i.style.backgroundColor=s}}_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 SN extends Hy{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(m1.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=>By.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,ke.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 zl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new _n({content:e,parser:t.parser||new vN})}static _buildJson(e){return new SN({content:e})}static normalize(e,t={}){return zl.build(e,t).normalize()}}class Fi{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 Eh{static build({config:e,nodeDomParser:t}){const r=wN({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:ia(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:ia($n.DESKTOP),pageBlocksRef:ia([]),wrapperRef:Fi.document.createElement("p")}),i=WT(r);return new Eh({schema:i,domParser:vs.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=zl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}function xN(n,e){return n.type===e}function CN(n){return typeof n=="string"}class Wy{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=>xN(r,ie.LIST_ITEM)?r:this.listItem([r].flat()))}}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:[r].flat().map(s=>CN(s)?this.paragraph(s):s)}}static heading(e,...t){const r=this.textBlock(t);return r.attrs??={},r.attrs.level=e,{type:ie.HEADING,...r}}static paragraph(...e){return{type:ie.PARAGRAPH,...this.textBlock(e)}}static textBlock(e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:[r].flat(),...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(ke.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class EN{_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=Fi.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,s=this.makePresetCssClass(r);t+=` ${s} {`;for(const a of OO)for(const u of Object.keys(r[a])){const c=this._makeVariable({device:a,preset:r,property:u}),h=this._makeInternalVariableName(u,a);if(t+=`${h}: var(${c}, inherit);`,i&&!p1.includes(u)){const p=h.replace("preset-","");t+=`${p}: var(${h});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===$n.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 kh{static _instance;static get instance(){return this._instance??=new kh,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 Vy{static createWindow(){return new sm.JSDOM().window}types;parse(e){const{window:t}=new sm.JSDOM(e);return this.types=t,t.document}}class Uy{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){}}class kN extends Uy{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:im.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(e,{config:t,format:r}){Fi.use(Vy.createWindow());const i=im.resolve(process.cwd(),t),s=Eh.build({config:require(i).editor,nodeDomParser:new Vy}),a=e.map(h=>s.toJSON(this._formatInputHtml(h))),u=a.length===1?a[0]:a,c=this._stringifyContent(u);this.output(r==="rb"?this._formatOutputRb(c):c)}_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 AN="4.13.0-beta.1";class TN extends Uy{name="version";description="display cli version";doCommand(){this.output(AN)}}const qy=new UC,ON=[kN,TN];for(const n of ON)new n().install(qy);qy.parse();
|