@next-bricks/markdown 1.14.1 → 1.15.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.
@@ -1,3 +1,3 @@
1
- /*! For license information please see 7768.078dabf3.js.LICENSE.txt */
2
- (globalThis.webpackChunk_next_bricks_markdown=globalThis.webpackChunk_next_bricks_markdown||[]).push([[7768],{135:(e,t,n)=>{"use strict";n.d(t,{b6:()=>I,eD:()=>O,Eb:()=>N});var r=n(27647),o=200,i=function(){};i.prototype.append=function(e){return e.length?(e=i.from(e),!this.length&&e||e.length<o&&this.leafAppend(e)||this.length<o&&e.leafPrepend(this)||this.appendInner(e)):this},i.prototype.prepend=function(e){return e.length?i.from(e).append(this):this},i.prototype.appendInner=function(e){return new a(this,e)},i.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?i.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},i.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},i.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},i.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},i.from=function(e){return e instanceof i?e:e&&e.length?new s(e):i.empty};var s=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=o)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=o)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(i);i.empty=new s([]);var a=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(i);const l=i;var c=n(11329),u=n(81570);class d{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new p(e.map));let t,o=e.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new p(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new d(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),u=new p(e.mapping.maps[n],c,t);(l=a&&a.merge(u))&&(u=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(u),t&&(i++,t=void 0),r||(a=u)}let l=i-n.depth;return l>f&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),i-=l),new d(s.append(o),i)}remapping(e,t){let n=new c.X9;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new d(this.items.append(e.map((e=>new p(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(a+1,r));c&&s++,n.push(new p(l,i,c))}else n.push(new p(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new p(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),u=new d(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&o++;let l,c=new p(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new d(l.from(r.reverse()),o)}}d.empty=new d(l.empty,0);class p{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new p(t.getMap().invert(),t,this.selection)}}}class h{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const f=20;function m(e){let t=[];return e.forEach(((e,n,r,o)=>t.push(r,o))),t}function g(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function y(e,t,n,r){let o=w(t),i=v.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,o),c=new h(r?l:s.remaining,r?s.remaining:l,null,0,-1);n(s.transform.setSelection(a).setMeta(v,{redo:r,historyState:c}).scrollIntoView())}let b=!1,k=null;function w(e){let t=e.plugins;if(k!=t){b=!1,k=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){b=!0;break}}return b}const v=new u.hs("history"),x=new u.hs("closeHistory");const S=(e,t)=>{let n=v.getState(e);return!(!n||0==n.done.eventCount||(t&&y(n,e,t,!1),0))},E=(e,t)=>{let n=v.getState(e);return!(!n||0==n.undone.eventCount||(t&&y(n,e,t,!0),0))};var C=n(16512);const A=(e,t)=>(Object.assign(e,{meta:{package:"@milkdown/plugin-history",...t}}),e),N=(0,C.yu)("Undo",(()=>()=>S));A(N,{displayName:"Command<undo>"});const O=(0,C.yu)("Undo",(()=>()=>E));A(N,{displayName:"Command<redo>"});const T=(0,C.Qx)({},"historyProviderConfig");A(T,{displayName:"Ctx<historyProviderConfig>"});const M=(0,C.Gf)((e=>function(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new u.k_({key:v,state:{init:()=>new h(d.empty,d.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(v);if(i)return i.historyState;n.getMeta(x)&&(e=new h(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(v))return s.getMeta(v).redo?new h(e.done.addTransform(n,void 0,r,w(t)),e.undone,m(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new h(e.done,e.undone.addTransform(n,void 0,r,w(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new h(e.done.rebased(n,o),e.undone.rebased(n,o),g(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new h(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),g(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),a=s?g(e.prevRanges,n.mapping):m(n.mapping.maps[n.steps.length-1]);return new h(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,w(t)),d.empty,a,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?S:"historyRedo"==n?E:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(e.get(T.key))));A(M,{displayName:"Ctx<historyProviderPlugin>"});const D=(0,C.pq)("historyKeymap",{Undo:{shortcuts:"Mod-z",command:e=>{const t=e.get(r.MD);return()=>t.call(N.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:e=>{const t=e.get(r.MD);return()=>t.call(O.key)}}});A(D.ctx,{displayName:"KeymapCtx<history>"}),A(D.shortcuts,{displayName:"Keymap<history>"});const I=[T,M,D,N,O].flat()},1440:(e,t,n)=>{"use strict";n.d(t,{$D:()=>p,Ik:()=>g,TR:()=>h,XM:()=>c,Xm:()=>f,_K:()=>m,dI:()=>d,j7:()=>l,nr:()=>u,pj:()=>b,sm:()=>k,zD:()=>y});var r=Object.defineProperty,o=(e=>(e.docTypeError="docTypeError",e.contextNotFound="contextNotFound",e.timerNotFound="timerNotFound",e.ctxCallOutOfScope="ctxCallOutOfScope",e.createNodeInParserFail="createNodeInParserFail",e.stackOverFlow="stackOverFlow",e.parserMatchError="parserMatchError",e.serializerMatchError="serializerMatchError",e.getAtomFromSchemaFail="getAtomFromSchemaFail",e.expectDomTypeError="expectDomTypeError",e.callCommandBeforeEditorView="callCommandBeforeEditorView",e.missingRootElement="missingRootElement",e.missingNodeInSchema="missingNodeInSchema",e.missingMarkInSchema="missingMarkInSchema",e.ctxNotBind="ctxNotBind",e.missingYjsDoc="missingYjsDoc",e))(o||{});class i extends Error{constructor(e,t){super(t),((e,t,n)=>{((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n)})(this,"code"),this.name="MilkdownError",this.code=e}}const s=(e,t)=>"function"==typeof t?"[Function]":t,a=e=>JSON.stringify(e,s),l=e=>new i(o.docTypeError,`Doc type error, unsupported type: ${a(e)}`),c=e=>new i(o.contextNotFound,`Context "${e}" not found, do you forget to inject it?`),u=e=>new i(o.timerNotFound,`Timer "${e}" not found, do you forget to record it?`),d=()=>new i(o.ctxCallOutOfScope,"Should not call a context out of the plugin."),p=(...e)=>{const t=e.reduce(((e,t)=>{if(!t)return e;const n=e=>Array.isArray(e)?e.map((e=>n(e))).join(", "):e.toJSON?a(e.toJSON()):e.spec?a(e.spec):e.toString();return`${e}, ${n(t)}`}),"Create prosemirror node from remark failed in parser");return new i(o.createNodeInParserFail,t)},h=()=>new i(o.stackOverFlow,"Stack over flow, cannot pop on an empty stack."),f=e=>new i(o.parserMatchError,`Cannot match target parser for node: ${a(e)}.`),m=e=>new i(o.serializerMatchError,`Cannot match target serializer for node: ${a(e)}.`),g=e=>new i(o.expectDomTypeError,`Expect to be a dom, but get: ${a(e)}.`),y=()=>new i(o.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized"),b=e=>new i(o.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`),k=e=>new i(o.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)},1854:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>ie,PD:()=>lt,hm:()=>Ie,Wf:()=>U,e0:()=>A,vY:()=>M,oO:()=>ne,Xk:()=>Ee,Ej:()=>Te});var r=n(16512),o=n(27647),i=n(25715),s=n(16090),a=n(1440),l=n(80096),c=n(37096);const u=[["ß","ss"],["ẞ","Ss"],["ä","ae"],["Ä","Ae"],["ö","oe"],["Ö","Oe"],["ü","ue"],["Ü","Ue"],["À","A"],["Á","A"],["Â","A"],["Ã","A"],["Ä","Ae"],["Å","A"],["Æ","AE"],["Ç","C"],["È","E"],["É","E"],["Ê","E"],["Ë","E"],["Ì","I"],["Í","I"],["Î","I"],["Ï","I"],["Ð","D"],["Ñ","N"],["Ò","O"],["Ó","O"],["Ô","O"],["Õ","O"],["Ö","Oe"],["Ő","O"],["Ø","O"],["Ù","U"],["Ú","U"],["Û","U"],["Ü","Ue"],["Ű","U"],["Ý","Y"],["Þ","TH"],["ß","ss"],["à","a"],["á","a"],["â","a"],["ã","a"],["ä","ae"],["å","a"],["æ","ae"],["ç","c"],["è","e"],["é","e"],["ê","e"],["ë","e"],["ì","i"],["í","i"],["î","i"],["ï","i"],["ð","d"],["ñ","n"],["ò","o"],["ó","o"],["ô","o"],["õ","o"],["ö","oe"],["ő","o"],["ø","o"],["ù","u"],["ú","u"],["û","u"],["ü","ue"],["ű","u"],["ý","y"],["þ","th"],["ÿ","y"],["ẞ","SS"],["à","a"],["À","A"],["á","a"],["Á","A"],["â","a"],["Â","A"],["ã","a"],["Ã","A"],["è","e"],["È","E"],["é","e"],["É","E"],["ê","e"],["Ê","E"],["ì","i"],["Ì","I"],["í","i"],["Í","I"],["ò","o"],["Ò","O"],["ó","o"],["Ó","O"],["ô","o"],["Ô","O"],["õ","o"],["Õ","O"],["ù","u"],["Ù","U"],["ú","u"],["Ú","U"],["ý","y"],["Ý","Y"],["ă","a"],["Ă","A"],["Đ","D"],["đ","d"],["ĩ","i"],["Ĩ","I"],["ũ","u"],["Ũ","U"],["ơ","o"],["Ơ","O"],["ư","u"],["Ư","U"],["ạ","a"],["Ạ","A"],["ả","a"],["Ả","A"],["ấ","a"],["Ấ","A"],["ầ","a"],["Ầ","A"],["ẩ","a"],["Ẩ","A"],["ẫ","a"],["Ẫ","A"],["ậ","a"],["Ậ","A"],["ắ","a"],["Ắ","A"],["ằ","a"],["Ằ","A"],["ẳ","a"],["Ẳ","A"],["ẵ","a"],["Ẵ","A"],["ặ","a"],["Ặ","A"],["ẹ","e"],["Ẹ","E"],["ẻ","e"],["Ẻ","E"],["ẽ","e"],["Ẽ","E"],["ế","e"],["Ế","E"],["ề","e"],["Ề","E"],["ể","e"],["Ể","E"],["ễ","e"],["Ễ","E"],["ệ","e"],["Ệ","E"],["ỉ","i"],["Ỉ","I"],["ị","i"],["Ị","I"],["ọ","o"],["Ọ","O"],["ỏ","o"],["Ỏ","O"],["ố","o"],["Ố","O"],["ồ","o"],["Ồ","O"],["ổ","o"],["Ổ","O"],["ỗ","o"],["Ỗ","O"],["ộ","o"],["Ộ","O"],["ớ","o"],["Ớ","O"],["ờ","o"],["Ờ","O"],["ở","o"],["Ở","O"],["ỡ","o"],["Ỡ","O"],["ợ","o"],["Ợ","O"],["ụ","u"],["Ụ","U"],["ủ","u"],["Ủ","U"],["ứ","u"],["Ứ","U"],["ừ","u"],["Ừ","U"],["ử","u"],["Ử","U"],["ữ","u"],["Ữ","U"],["ự","u"],["Ự","U"],["ỳ","y"],["Ỳ","Y"],["ỵ","y"],["Ỵ","Y"],["ỷ","y"],["Ỷ","Y"],["ỹ","y"],["Ỹ","Y"],["ء","e"],["آ","a"],["أ","a"],["ؤ","w"],["إ","i"],["ئ","y"],["ا","a"],["ب","b"],["ة","t"],["ت","t"],["ث","th"],["ج","j"],["ح","h"],["خ","kh"],["د","d"],["ذ","dh"],["ر","r"],["ز","z"],["س","s"],["ش","sh"],["ص","s"],["ض","d"],["ط","t"],["ظ","z"],["ع","e"],["غ","gh"],["ـ","_"],["ف","f"],["ق","q"],["ك","k"],["ل","l"],["م","m"],["ن","n"],["ه","h"],["و","w"],["ى","a"],["ي","y"],["َ‎","a"],["ُ","u"],["ِ‎","i"],["٠","0"],["١","1"],["٢","2"],["٣","3"],["٤","4"],["٥","5"],["٦","6"],["٧","7"],["٨","8"],["٩","9"],["چ","ch"],["ک","k"],["گ","g"],["پ","p"],["ژ","zh"],["ی","y"],["۰","0"],["۱","1"],["۲","2"],["۳","3"],["۴","4"],["۵","5"],["۶","6"],["۷","7"],["۸","8"],["۹","9"],["ټ","p"],["ځ","z"],["څ","c"],["ډ","d"],["ﺫ","d"],["ﺭ","r"],["ړ","r"],["ﺯ","z"],["ږ","g"],["ښ","x"],["ګ","g"],["ڼ","n"],["ۀ","e"],["ې","e"],["ۍ","ai"],["ٹ","t"],["ڈ","d"],["ڑ","r"],["ں","n"],["ہ","h"],["ھ","h"],["ے","e"],["А","A"],["а","a"],["Б","B"],["б","b"],["В","V"],["в","v"],["Г","G"],["г","g"],["Д","D"],["д","d"],["ъе","ye"],["Ъе","Ye"],["ъЕ","yE"],["ЪЕ","YE"],["Е","E"],["е","e"],["Ё","Yo"],["ё","yo"],["Ж","Zh"],["ж","zh"],["З","Z"],["з","z"],["И","I"],["и","i"],["ый","iy"],["Ый","Iy"],["ЫЙ","IY"],["ыЙ","iY"],["Й","Y"],["й","y"],["К","K"],["к","k"],["Л","L"],["л","l"],["М","M"],["м","m"],["Н","N"],["н","n"],["О","O"],["о","o"],["П","P"],["п","p"],["Р","R"],["р","r"],["С","S"],["с","s"],["Т","T"],["т","t"],["У","U"],["у","u"],["Ф","F"],["ф","f"],["Х","Kh"],["х","kh"],["Ц","Ts"],["ц","ts"],["Ч","Ch"],["ч","ch"],["Ш","Sh"],["ш","sh"],["Щ","Sch"],["щ","sch"],["Ъ",""],["ъ",""],["Ы","Y"],["ы","y"],["Ь",""],["ь",""],["Э","E"],["э","e"],["Ю","Yu"],["ю","yu"],["Я","Ya"],["я","ya"],["ă","a"],["Ă","A"],["ș","s"],["Ș","S"],["ț","t"],["Ț","T"],["ţ","t"],["Ţ","T"],["ş","s"],["Ş","S"],["ç","c"],["Ç","C"],["ğ","g"],["Ğ","G"],["ı","i"],["İ","I"],["ա","a"],["Ա","A"],["բ","b"],["Բ","B"],["գ","g"],["Գ","G"],["դ","d"],["Դ","D"],["ե","ye"],["Ե","Ye"],["զ","z"],["Զ","Z"],["է","e"],["Է","E"],["ը","y"],["Ը","Y"],["թ","t"],["Թ","T"],["ժ","zh"],["Ժ","Zh"],["ի","i"],["Ի","I"],["լ","l"],["Լ","L"],["խ","kh"],["Խ","Kh"],["ծ","ts"],["Ծ","Ts"],["կ","k"],["Կ","K"],["հ","h"],["Հ","H"],["ձ","dz"],["Ձ","Dz"],["ղ","gh"],["Ղ","Gh"],["ճ","tch"],["Ճ","Tch"],["մ","m"],["Մ","M"],["յ","y"],["Յ","Y"],["ն","n"],["Ն","N"],["շ","sh"],["Շ","Sh"],["ո","vo"],["Ո","Vo"],["չ","ch"],["Չ","Ch"],["պ","p"],["Պ","P"],["ջ","j"],["Ջ","J"],["ռ","r"],["Ռ","R"],["ս","s"],["Ս","S"],["վ","v"],["Վ","V"],["տ","t"],["Տ","T"],["ր","r"],["Ր","R"],["ց","c"],["Ց","C"],["ու","u"],["ՈՒ","U"],["Ու","U"],["փ","p"],["Փ","P"],["ք","q"],["Ք","Q"],["օ","o"],["Օ","O"],["ֆ","f"],["Ֆ","F"],["և","yev"],["ა","a"],["ბ","b"],["გ","g"],["დ","d"],["ე","e"],["ვ","v"],["ზ","z"],["თ","t"],["ი","i"],["კ","k"],["ლ","l"],["მ","m"],["ნ","n"],["ო","o"],["პ","p"],["ჟ","zh"],["რ","r"],["ს","s"],["ტ","t"],["უ","u"],["ფ","ph"],["ქ","q"],["ღ","gh"],["ყ","k"],["შ","sh"],["ჩ","ch"],["ც","ts"],["ძ","dz"],["წ","ts"],["ჭ","tch"],["ხ","kh"],["ჯ","j"],["ჰ","h"],["č","c"],["ď","d"],["ě","e"],["ň","n"],["ř","r"],["š","s"],["ť","t"],["ů","u"],["ž","z"],["Č","C"],["Ď","D"],["Ě","E"],["Ň","N"],["Ř","R"],["Š","S"],["Ť","T"],["Ů","U"],["Ž","Z"],["ހ","h"],["ށ","sh"],["ނ","n"],["ރ","r"],["ބ","b"],["ޅ","lh"],["ކ","k"],["އ","a"],["ވ","v"],["މ","m"],["ފ","f"],["ދ","dh"],["ތ","th"],["ލ","l"],["ގ","g"],["ޏ","gn"],["ސ","s"],["ޑ","d"],["ޒ","z"],["ޓ","t"],["ޔ","y"],["ޕ","p"],["ޖ","j"],["ޗ","ch"],["ޘ","tt"],["ޙ","hh"],["ޚ","kh"],["ޛ","th"],["ޜ","z"],["ޝ","sh"],["ޞ","s"],["ޟ","d"],["ޠ","t"],["ޡ","z"],["ޢ","a"],["ޣ","gh"],["ޤ","q"],["ޥ","w"],["ަ","a"],["ާ","aa"],["ި","i"],["ީ","ee"],["ު","u"],["ޫ","oo"],["ެ","e"],["ޭ","ey"],["ޮ","o"],["ޯ","oa"],["ް",""],["α","a"],["β","v"],["γ","g"],["δ","d"],["ε","e"],["ζ","z"],["η","i"],["θ","th"],["ι","i"],["κ","k"],["λ","l"],["μ","m"],["ν","n"],["ξ","ks"],["ο","o"],["π","p"],["ρ","r"],["σ","s"],["τ","t"],["υ","y"],["φ","f"],["χ","x"],["ψ","ps"],["ω","o"],["ά","a"],["έ","e"],["ί","i"],["ό","o"],["ύ","y"],["ή","i"],["ώ","o"],["ς","s"],["ϊ","i"],["ΰ","y"],["ϋ","y"],["ΐ","i"],["Α","A"],["Β","B"],["Γ","G"],["Δ","D"],["Ε","E"],["Ζ","Z"],["Η","I"],["Θ","TH"],["Ι","I"],["Κ","K"],["Λ","L"],["Μ","M"],["Ν","N"],["Ξ","KS"],["Ο","O"],["Π","P"],["Ρ","R"],["Σ","S"],["Τ","T"],["Υ","Y"],["Φ","F"],["Χ","X"],["Ψ","PS"],["Ω","O"],["Ά","A"],["Έ","E"],["Ί","I"],["Ό","O"],["Ύ","Y"],["Ή","I"],["Ώ","O"],["Ϊ","I"],["Ϋ","Y"],["ā","a"],["ē","e"],["ģ","g"],["ī","i"],["ķ","k"],["ļ","l"],["ņ","n"],["ū","u"],["Ā","A"],["Ē","E"],["Ģ","G"],["Ī","I"],["Ķ","K"],["Ļ","L"],["Ņ","N"],["Ū","U"],["č","c"],["š","s"],["ž","z"],["Č","C"],["Š","S"],["Ž","Z"],["ą","a"],["č","c"],["ę","e"],["ė","e"],["į","i"],["š","s"],["ų","u"],["ū","u"],["ž","z"],["Ą","A"],["Č","C"],["Ę","E"],["Ė","E"],["Į","I"],["Š","S"],["Ų","U"],["Ū","U"],["Ќ","Kj"],["ќ","kj"],["Љ","Lj"],["љ","lj"],["Њ","Nj"],["њ","nj"],["Тс","Ts"],["тс","ts"],["ą","a"],["ć","c"],["ę","e"],["ł","l"],["ń","n"],["ś","s"],["ź","z"],["ż","z"],["Ą","A"],["Ć","C"],["Ę","E"],["Ł","L"],["Ń","N"],["Ś","S"],["Ź","Z"],["Ż","Z"],["Є","Ye"],["І","I"],["Ї","Yi"],["Ґ","G"],["є","ye"],["і","i"],["ї","yi"],["ґ","g"],["IJ","IJ"],["ij","ij"],["¢","c"],["¥","Y"],["߿","b"],["৳","t"],["૱","Bo"],["฿","B"],["₠","CE"],["₡","C"],["₢","Cr"],["₣","F"],["₥","m"],["₦","N"],["₧","Pt"],["₨","Rs"],["₩","W"],["₫","s"],["€","E"],["₭","K"],["₮","T"],["₯","Dp"],["₰","S"],["₱","P"],["₲","G"],["₳","A"],["₴","S"],["₵","C"],["₶","tt"],["₷","S"],["₸","T"],["₹","R"],["₺","L"],["₽","P"],["₿","B"],["﹩","$"],["¢","c"],["¥","Y"],["₩","W"],["𝐀","A"],["𝐁","B"],["𝐂","C"],["𝐃","D"],["𝐄","E"],["𝐅","F"],["𝐆","G"],["𝐇","H"],["𝐈","I"],["𝐉","J"],["𝐊","K"],["𝐋","L"],["𝐌","M"],["𝐍","N"],["𝐎","O"],["𝐏","P"],["𝐐","Q"],["𝐑","R"],["𝐒","S"],["𝐓","T"],["𝐔","U"],["𝐕","V"],["𝐖","W"],["𝐗","X"],["𝐘","Y"],["𝐙","Z"],["𝐚","a"],["𝐛","b"],["𝐜","c"],["𝐝","d"],["𝐞","e"],["𝐟","f"],["𝐠","g"],["𝐡","h"],["𝐢","i"],["𝐣","j"],["𝐤","k"],["𝐥","l"],["𝐦","m"],["𝐧","n"],["𝐨","o"],["𝐩","p"],["𝐪","q"],["𝐫","r"],["𝐬","s"],["𝐭","t"],["𝐮","u"],["𝐯","v"],["𝐰","w"],["𝐱","x"],["𝐲","y"],["𝐳","z"],["𝐴","A"],["𝐵","B"],["𝐶","C"],["𝐷","D"],["𝐸","E"],["𝐹","F"],["𝐺","G"],["𝐻","H"],["𝐼","I"],["𝐽","J"],["𝐾","K"],["𝐿","L"],["𝑀","M"],["𝑁","N"],["𝑂","O"],["𝑃","P"],["𝑄","Q"],["𝑅","R"],["𝑆","S"],["𝑇","T"],["𝑈","U"],["𝑉","V"],["𝑊","W"],["𝑋","X"],["𝑌","Y"],["𝑍","Z"],["𝑎","a"],["𝑏","b"],["𝑐","c"],["𝑑","d"],["𝑒","e"],["𝑓","f"],["𝑔","g"],["𝑖","i"],["𝑗","j"],["𝑘","k"],["𝑙","l"],["𝑚","m"],["𝑛","n"],["𝑜","o"],["𝑝","p"],["𝑞","q"],["𝑟","r"],["𝑠","s"],["𝑡","t"],["𝑢","u"],["𝑣","v"],["𝑤","w"],["𝑥","x"],["𝑦","y"],["𝑧","z"],["𝑨","A"],["𝑩","B"],["𝑪","C"],["𝑫","D"],["𝑬","E"],["𝑭","F"],["𝑮","G"],["𝑯","H"],["𝑰","I"],["𝑱","J"],["𝑲","K"],["𝑳","L"],["𝑴","M"],["𝑵","N"],["𝑶","O"],["𝑷","P"],["𝑸","Q"],["𝑹","R"],["𝑺","S"],["𝑻","T"],["𝑼","U"],["𝑽","V"],["𝑾","W"],["𝑿","X"],["𝒀","Y"],["𝒁","Z"],["𝒂","a"],["𝒃","b"],["𝒄","c"],["𝒅","d"],["𝒆","e"],["𝒇","f"],["𝒈","g"],["𝒉","h"],["𝒊","i"],["𝒋","j"],["𝒌","k"],["𝒍","l"],["𝒎","m"],["𝒏","n"],["𝒐","o"],["𝒑","p"],["𝒒","q"],["𝒓","r"],["𝒔","s"],["𝒕","t"],["𝒖","u"],["𝒗","v"],["𝒘","w"],["𝒙","x"],["𝒚","y"],["𝒛","z"],["𝒜","A"],["𝒞","C"],["𝒟","D"],["𝒢","g"],["𝒥","J"],["𝒦","K"],["𝒩","N"],["𝒪","O"],["𝒫","P"],["𝒬","Q"],["𝒮","S"],["𝒯","T"],["𝒰","U"],["𝒱","V"],["𝒲","W"],["𝒳","X"],["𝒴","Y"],["𝒵","Z"],["𝒶","a"],["𝒷","b"],["𝒸","c"],["𝒹","d"],["𝒻","f"],["𝒽","h"],["𝒾","i"],["𝒿","j"],["𝓀","h"],["𝓁","l"],["𝓂","m"],["𝓃","n"],["𝓅","p"],["𝓆","q"],["𝓇","r"],["𝓈","s"],["𝓉","t"],["𝓊","u"],["𝓋","v"],["𝓌","w"],["𝓍","x"],["𝓎","y"],["𝓏","z"],["𝓐","A"],["𝓑","B"],["𝓒","C"],["𝓓","D"],["𝓔","E"],["𝓕","F"],["𝓖","G"],["𝓗","H"],["𝓘","I"],["𝓙","J"],["𝓚","K"],["𝓛","L"],["𝓜","M"],["𝓝","N"],["𝓞","O"],["𝓟","P"],["𝓠","Q"],["𝓡","R"],["𝓢","S"],["𝓣","T"],["𝓤","U"],["𝓥","V"],["𝓦","W"],["𝓧","X"],["𝓨","Y"],["𝓩","Z"],["𝓪","a"],["𝓫","b"],["𝓬","c"],["𝓭","d"],["𝓮","e"],["𝓯","f"],["𝓰","g"],["𝓱","h"],["𝓲","i"],["𝓳","j"],["𝓴","k"],["𝓵","l"],["𝓶","m"],["𝓷","n"],["𝓸","o"],["𝓹","p"],["𝓺","q"],["𝓻","r"],["𝓼","s"],["𝓽","t"],["𝓾","u"],["𝓿","v"],["𝔀","w"],["𝔁","x"],["𝔂","y"],["𝔃","z"],["𝔄","A"],["𝔅","B"],["𝔇","D"],["𝔈","E"],["𝔉","F"],["𝔊","G"],["𝔍","J"],["𝔎","K"],["𝔏","L"],["𝔐","M"],["𝔑","N"],["𝔒","O"],["𝔓","P"],["𝔔","Q"],["𝔖","S"],["𝔗","T"],["𝔘","U"],["𝔙","V"],["𝔚","W"],["𝔛","X"],["𝔜","Y"],["𝔞","a"],["𝔟","b"],["𝔠","c"],["𝔡","d"],["𝔢","e"],["𝔣","f"],["𝔤","g"],["𝔥","h"],["𝔦","i"],["𝔧","j"],["𝔨","k"],["𝔩","l"],["𝔪","m"],["𝔫","n"],["𝔬","o"],["𝔭","p"],["𝔮","q"],["𝔯","r"],["𝔰","s"],["𝔱","t"],["𝔲","u"],["𝔳","v"],["𝔴","w"],["𝔵","x"],["𝔶","y"],["𝔷","z"],["𝔸","A"],["𝔹","B"],["𝔻","D"],["𝔼","E"],["𝔽","F"],["𝔾","G"],["𝕀","I"],["𝕁","J"],["𝕂","K"],["𝕃","L"],["𝕄","M"],["𝕆","N"],["𝕊","S"],["𝕋","T"],["𝕌","U"],["𝕍","V"],["𝕎","W"],["𝕏","X"],["𝕐","Y"],["𝕒","a"],["𝕓","b"],["𝕔","c"],["𝕕","d"],["𝕖","e"],["𝕗","f"],["𝕘","g"],["𝕙","h"],["𝕚","i"],["𝕛","j"],["𝕜","k"],["𝕝","l"],["𝕞","m"],["𝕟","n"],["𝕠","o"],["𝕡","p"],["𝕢","q"],["𝕣","r"],["𝕤","s"],["𝕥","t"],["𝕦","u"],["𝕧","v"],["𝕨","w"],["𝕩","x"],["𝕪","y"],["𝕫","z"],["𝕬","A"],["𝕭","B"],["𝕮","C"],["𝕯","D"],["𝕰","E"],["𝕱","F"],["𝕲","G"],["𝕳","H"],["𝕴","I"],["𝕵","J"],["𝕶","K"],["𝕷","L"],["𝕸","M"],["𝕹","N"],["𝕺","O"],["𝕻","P"],["𝕼","Q"],["𝕽","R"],["𝕾","S"],["𝕿","T"],["𝖀","U"],["𝖁","V"],["𝖂","W"],["𝖃","X"],["𝖄","Y"],["𝖅","Z"],["𝖆","a"],["𝖇","b"],["𝖈","c"],["𝖉","d"],["𝖊","e"],["𝖋","f"],["𝖌","g"],["𝖍","h"],["𝖎","i"],["𝖏","j"],["𝖐","k"],["𝖑","l"],["𝖒","m"],["𝖓","n"],["𝖔","o"],["𝖕","p"],["𝖖","q"],["𝖗","r"],["𝖘","s"],["𝖙","t"],["𝖚","u"],["𝖛","v"],["𝖜","w"],["𝖝","x"],["𝖞","y"],["𝖟","z"],["𝖠","A"],["𝖡","B"],["𝖢","C"],["𝖣","D"],["𝖤","E"],["𝖥","F"],["𝖦","G"],["𝖧","H"],["𝖨","I"],["𝖩","J"],["𝖪","K"],["𝖫","L"],["𝖬","M"],["𝖭","N"],["𝖮","O"],["𝖯","P"],["𝖰","Q"],["𝖱","R"],["𝖲","S"],["𝖳","T"],["𝖴","U"],["𝖵","V"],["𝖶","W"],["𝖷","X"],["𝖸","Y"],["𝖹","Z"],["𝖺","a"],["𝖻","b"],["𝖼","c"],["𝖽","d"],["𝖾","e"],["𝖿","f"],["𝗀","g"],["𝗁","h"],["𝗂","i"],["𝗃","j"],["𝗄","k"],["𝗅","l"],["𝗆","m"],["𝗇","n"],["𝗈","o"],["𝗉","p"],["𝗊","q"],["𝗋","r"],["𝗌","s"],["𝗍","t"],["𝗎","u"],["𝗏","v"],["𝗐","w"],["𝗑","x"],["𝗒","y"],["𝗓","z"],["𝗔","A"],["𝗕","B"],["𝗖","C"],["𝗗","D"],["𝗘","E"],["𝗙","F"],["𝗚","G"],["𝗛","H"],["𝗜","I"],["𝗝","J"],["𝗞","K"],["𝗟","L"],["𝗠","M"],["𝗡","N"],["𝗢","O"],["𝗣","P"],["𝗤","Q"],["𝗥","R"],["𝗦","S"],["𝗧","T"],["𝗨","U"],["𝗩","V"],["𝗪","W"],["𝗫","X"],["𝗬","Y"],["𝗭","Z"],["𝗮","a"],["𝗯","b"],["𝗰","c"],["𝗱","d"],["𝗲","e"],["𝗳","f"],["𝗴","g"],["𝗵","h"],["𝗶","i"],["𝗷","j"],["𝗸","k"],["𝗹","l"],["𝗺","m"],["𝗻","n"],["𝗼","o"],["𝗽","p"],["𝗾","q"],["𝗿","r"],["𝘀","s"],["𝘁","t"],["𝘂","u"],["𝘃","v"],["𝘄","w"],["𝘅","x"],["𝘆","y"],["𝘇","z"],["𝘈","A"],["𝘉","B"],["𝘊","C"],["𝘋","D"],["𝘌","E"],["𝘍","F"],["𝘎","G"],["𝘏","H"],["𝘐","I"],["𝘑","J"],["𝘒","K"],["𝘓","L"],["𝘔","M"],["𝘕","N"],["𝘖","O"],["𝘗","P"],["𝘘","Q"],["𝘙","R"],["𝘚","S"],["𝘛","T"],["𝘜","U"],["𝘝","V"],["𝘞","W"],["𝘟","X"],["𝘠","Y"],["𝘡","Z"],["𝘢","a"],["𝘣","b"],["𝘤","c"],["𝘥","d"],["𝘦","e"],["𝘧","f"],["𝘨","g"],["𝘩","h"],["𝘪","i"],["𝘫","j"],["𝘬","k"],["𝘭","l"],["𝘮","m"],["𝘯","n"],["𝘰","o"],["𝘱","p"],["𝘲","q"],["𝘳","r"],["𝘴","s"],["𝘵","t"],["𝘶","u"],["𝘷","v"],["𝘸","w"],["𝘹","x"],["𝘺","y"],["𝘻","z"],["𝘼","A"],["𝘽","B"],["𝘾","C"],["𝘿","D"],["𝙀","E"],["𝙁","F"],["𝙂","G"],["𝙃","H"],["𝙄","I"],["𝙅","J"],["𝙆","K"],["𝙇","L"],["𝙈","M"],["𝙉","N"],["𝙊","O"],["𝙋","P"],["𝙌","Q"],["𝙍","R"],["𝙎","S"],["𝙏","T"],["𝙐","U"],["𝙑","V"],["𝙒","W"],["𝙓","X"],["𝙔","Y"],["𝙕","Z"],["𝙖","a"],["𝙗","b"],["𝙘","c"],["𝙙","d"],["𝙚","e"],["𝙛","f"],["𝙜","g"],["𝙝","h"],["𝙞","i"],["𝙟","j"],["𝙠","k"],["𝙡","l"],["𝙢","m"],["𝙣","n"],["𝙤","o"],["𝙥","p"],["𝙦","q"],["𝙧","r"],["𝙨","s"],["𝙩","t"],["𝙪","u"],["𝙫","v"],["𝙬","w"],["𝙭","x"],["𝙮","y"],["𝙯","z"],["𝙰","A"],["𝙱","B"],["𝙲","C"],["𝙳","D"],["𝙴","E"],["𝙵","F"],["𝙶","G"],["𝙷","H"],["𝙸","I"],["𝙹","J"],["𝙺","K"],["𝙻","L"],["𝙼","M"],["𝙽","N"],["𝙾","O"],["𝙿","P"],["𝚀","Q"],["𝚁","R"],["𝚂","S"],["𝚃","T"],["𝚄","U"],["𝚅","V"],["𝚆","W"],["𝚇","X"],["𝚈","Y"],["𝚉","Z"],["𝚊","a"],["𝚋","b"],["𝚌","c"],["𝚍","d"],["𝚎","e"],["𝚏","f"],["𝚐","g"],["𝚑","h"],["𝚒","i"],["𝚓","j"],["𝚔","k"],["𝚕","l"],["𝚖","m"],["𝚗","n"],["𝚘","o"],["𝚙","p"],["𝚚","q"],["𝚛","r"],["𝚜","s"],["𝚝","t"],["𝚞","u"],["𝚟","v"],["𝚠","w"],["𝚡","x"],["𝚢","y"],["𝚣","z"],["𝚤","l"],["𝚥","j"],["𝛢","A"],["𝛣","B"],["𝛤","G"],["𝛥","D"],["𝛦","E"],["𝛧","Z"],["𝛨","I"],["𝛩","TH"],["𝛪","I"],["𝛫","K"],["𝛬","L"],["𝛭","M"],["𝛮","N"],["𝛯","KS"],["𝛰","O"],["𝛱","P"],["𝛲","R"],["𝛳","TH"],["𝛴","S"],["𝛵","T"],["𝛶","Y"],["𝛷","F"],["𝛸","x"],["𝛹","PS"],["𝛺","O"],["𝛻","D"],["𝛼","a"],["𝛽","b"],["𝛾","g"],["𝛿","d"],["𝜀","e"],["𝜁","z"],["𝜂","i"],["𝜃","th"],["𝜄","i"],["𝜅","k"],["𝜆","l"],["𝜇","m"],["𝜈","n"],["𝜉","ks"],["𝜊","o"],["𝜋","p"],["𝜌","r"],["𝜍","s"],["𝜎","s"],["𝜏","t"],["𝜐","y"],["𝜑","f"],["𝜒","x"],["𝜓","ps"],["𝜔","o"],["𝜕","d"],["𝜖","E"],["𝜗","TH"],["𝜘","K"],["𝜙","f"],["𝜚","r"],["𝜛","p"],["𝜜","A"],["𝜝","V"],["𝜞","G"],["𝜟","D"],["𝜠","E"],["𝜡","Z"],["𝜢","I"],["𝜣","TH"],["𝜤","I"],["𝜥","K"],["𝜦","L"],["𝜧","M"],["𝜨","N"],["𝜩","KS"],["𝜪","O"],["𝜫","P"],["𝜬","S"],["𝜭","TH"],["𝜮","S"],["𝜯","T"],["𝜰","Y"],["𝜱","F"],["𝜲","X"],["𝜳","PS"],["𝜴","O"],["𝜵","D"],["𝜶","a"],["𝜷","v"],["𝜸","g"],["𝜹","d"],["𝜺","e"],["𝜻","z"],["𝜼","i"],["𝜽","th"],["𝜾","i"],["𝜿","k"],["𝝀","l"],["𝝁","m"],["𝝂","n"],["𝝃","ks"],["𝝄","o"],["𝝅","p"],["𝝆","r"],["𝝇","s"],["𝝈","s"],["𝝉","t"],["𝝊","y"],["𝝋","f"],["𝝌","x"],["𝝍","ps"],["𝝎","o"],["𝝏","a"],["𝝐","e"],["𝝑","i"],["𝝒","k"],["𝝓","f"],["𝝔","r"],["𝝕","p"],["𝝖","A"],["𝝗","B"],["𝝘","G"],["𝝙","D"],["𝝚","E"],["𝝛","Z"],["𝝜","I"],["𝝝","TH"],["𝝞","I"],["𝝟","K"],["𝝠","L"],["𝝡","M"],["𝝢","N"],["𝝣","KS"],["𝝤","O"],["𝝥","P"],["𝝦","R"],["𝝧","TH"],["𝝨","S"],["𝝩","T"],["𝝪","Y"],["𝝫","F"],["𝝬","X"],["𝝭","PS"],["𝝮","O"],["𝝯","D"],["𝝰","a"],["𝝱","v"],["𝝲","g"],["𝝳","d"],["𝝴","e"],["𝝵","z"],["𝝶","i"],["𝝷","th"],["𝝸","i"],["𝝹","k"],["𝝺","l"],["𝝻","m"],["𝝼","n"],["𝝽","ks"],["𝝾","o"],["𝝿","p"],["𝞀","r"],["𝞁","s"],["𝞂","s"],["𝞃","t"],["𝞄","y"],["𝞅","f"],["𝞆","x"],["𝞇","ps"],["𝞈","o"],["𝞉","a"],["𝞊","e"],["𝞋","i"],["𝞌","k"],["𝞍","f"],["𝞎","r"],["𝞏","p"],["𝞐","A"],["𝞑","V"],["𝞒","G"],["𝞓","D"],["𝞔","E"],["𝞕","Z"],["𝞖","I"],["𝞗","TH"],["𝞘","I"],["𝞙","K"],["𝞚","L"],["𝞛","M"],["𝞜","N"],["𝞝","KS"],["𝞞","O"],["𝞟","P"],["𝞠","S"],["𝞡","TH"],["𝞢","S"],["𝞣","T"],["𝞤","Y"],["𝞥","F"],["𝞦","X"],["𝞧","PS"],["𝞨","O"],["𝞩","D"],["𝞪","av"],["𝞫","g"],["𝞬","d"],["𝞭","e"],["𝞮","z"],["𝞯","i"],["𝞰","i"],["𝞱","th"],["𝞲","i"],["𝞳","k"],["𝞴","l"],["𝞵","m"],["𝞶","n"],["𝞷","ks"],["𝞸","o"],["𝞹","p"],["𝞺","r"],["𝞻","s"],["𝞼","s"],["𝞽","t"],["𝞾","y"],["𝞿","f"],["𝟀","x"],["𝟁","ps"],["𝟂","o"],["𝟃","a"],["𝟄","e"],["𝟅","i"],["𝟆","k"],["𝟇","f"],["𝟈","r"],["𝟉","p"],["𝟊","F"],["𝟋","f"],["⒜","(a)"],["⒝","(b)"],["⒞","(c)"],["⒟","(d)"],["⒠","(e)"],["⒡","(f)"],["⒢","(g)"],["⒣","(h)"],["⒤","(i)"],["⒥","(j)"],["⒦","(k)"],["⒧","(l)"],["⒨","(m)"],["⒩","(n)"],["⒪","(o)"],["⒫","(p)"],["⒬","(q)"],["⒭","(r)"],["⒮","(s)"],["⒯","(t)"],["⒰","(u)"],["⒱","(v)"],["⒲","(w)"],["⒳","(x)"],["⒴","(y)"],["⒵","(z)"],["Ⓐ","(A)"],["Ⓑ","(B)"],["Ⓒ","(C)"],["Ⓓ","(D)"],["Ⓔ","(E)"],["Ⓕ","(F)"],["Ⓖ","(G)"],["Ⓗ","(H)"],["Ⓘ","(I)"],["Ⓙ","(J)"],["Ⓚ","(K)"],["Ⓛ","(L)"],["Ⓝ","(N)"],["Ⓞ","(O)"],["Ⓟ","(P)"],["Ⓠ","(Q)"],["Ⓡ","(R)"],["Ⓢ","(S)"],["Ⓣ","(T)"],["Ⓤ","(U)"],["Ⓥ","(V)"],["Ⓦ","(W)"],["Ⓧ","(X)"],["Ⓨ","(Y)"],["Ⓩ","(Z)"],["ⓐ","(a)"],["ⓑ","(b)"],["ⓒ","(b)"],["ⓓ","(c)"],["ⓔ","(e)"],["ⓕ","(f)"],["ⓖ","(g)"],["ⓗ","(h)"],["ⓘ","(i)"],["ⓙ","(j)"],["ⓚ","(k)"],["ⓛ","(l)"],["ⓜ","(m)"],["ⓝ","(n)"],["ⓞ","(o)"],["ⓟ","(p)"],["ⓠ","(q)"],["ⓡ","(r)"],["ⓢ","(s)"],["ⓣ","(t)"],["ⓤ","(u)"],["ⓥ","(v)"],["ⓦ","(w)"],["ⓧ","(x)"],["ⓨ","(y)"],["ⓩ","(z)"],["Ċ","C"],["ċ","c"],["Ġ","G"],["ġ","g"],["Ħ","H"],["ħ","h"],["Ż","Z"],["ż","z"],["𝟎","0"],["𝟏","1"],["𝟐","2"],["𝟑","3"],["𝟒","4"],["𝟓","5"],["𝟔","6"],["𝟕","7"],["𝟖","8"],["𝟗","9"],["𝟘","0"],["𝟙","1"],["𝟚","2"],["𝟛","3"],["𝟜","4"],["𝟝","5"],["𝟞","6"],["𝟟","7"],["𝟠","8"],["𝟡","9"],["𝟢","0"],["𝟣","1"],["𝟤","2"],["𝟥","3"],["𝟦","4"],["𝟧","5"],["𝟨","6"],["𝟩","7"],["𝟪","8"],["𝟫","9"],["𝟬","0"],["𝟭","1"],["𝟮","2"],["𝟯","3"],["𝟰","4"],["𝟱","5"],["𝟲","6"],["𝟳","7"],["𝟴","8"],["𝟵","9"],["𝟶","0"],["𝟷","1"],["𝟸","2"],["𝟹","3"],["𝟺","4"],["𝟻","5"],["𝟼","6"],["𝟽","7"],["𝟾","8"],["𝟿","9"],["①","1"],["②","2"],["③","3"],["④","4"],["⑤","5"],["⑥","6"],["⑦","7"],["⑧","8"],["⑨","9"],["⑩","10"],["⑪","11"],["⑫","12"],["⑬","13"],["⑭","14"],["⑮","15"],["⑯","16"],["⑰","17"],["⑱","18"],["⑲","19"],["⑳","20"],["⑴","1"],["⑵","2"],["⑶","3"],["⑷","4"],["⑸","5"],["⑹","6"],["⑺","7"],["⑻","8"],["⑼","9"],["⑽","10"],["⑾","11"],["⑿","12"],["⒀","13"],["⒁","14"],["⒂","15"],["⒃","16"],["⒄","17"],["⒅","18"],["⒆","19"],["⒇","20"],["⒈","1."],["⒉","2."],["⒊","3."],["⒋","4."],["⒌","5."],["⒍","6."],["⒎","7."],["⒏","8."],["⒐","9."],["⒑","10."],["⒒","11."],["⒓","12."],["⒔","13."],["⒕","14."],["⒖","15."],["⒗","16."],["⒘","17."],["⒙","18."],["⒚","19."],["⒛","20."],["⓪","0"],["⓫","11"],["⓬","12"],["⓭","13"],["⓮","14"],["⓯","15"],["⓰","16"],["⓱","17"],["⓲","18"],["⓳","19"],["⓴","20"],["⓵","1"],["⓶","2"],["⓷","3"],["⓸","4"],["⓹","5"],["⓺","6"],["⓻","7"],["⓼","8"],["⓽","9"],["⓾","10"],["⓿","0"],["🙰","&"],["🙱","&"],["🙲","&"],["🙳","&"],["🙴","&"],["🙵","&"],["🙶",'"'],["🙷",'"'],["🙸",'"'],["‽","?!"],["🙹","?!"],["🙺","?!"],["🙻","?!"],["🙼","/"],["🙽","\\"],["🜇","AR"],["🜈","V"],["🜉","V"],["🜆","VR"],["🜅","VF"],["🜩","2"],["🜪","5"],["🝡","f"],["🝢","W"],["🝣","U"],["🝧","V"],["🝨","T"],["🝪","V"],["🝫","MB"],["🝬","VB"],["🝲","3B"],["🝳","3B"],["💯","100"],["🔙","BACK"],["🔚","END"],["🔛","ON!"],["🔜","SOON"],["🔝","TOP"],["🔞","18"],["🔤","abc"],["🔠","ABCD"],["🔡","abcd"],["🔢","1234"],["🔣","T&@%"],["#️⃣","#"],["*️⃣","*"],["0️⃣","0"],["1️⃣","1"],["2️⃣","2"],["3️⃣","3"],["4️⃣","4"],["5️⃣","5"],["6️⃣","6"],["7️⃣","7"],["8️⃣","8"],["9️⃣","9"],["🔟","10"],["🅰️","A"],["🅱️","B"],["🆎","AB"],["🆑","CL"],["🅾️","O"],["🅿","P"],["🆘","SOS"],["🅲","C"],["🅳","D"],["🅴","E"],["🅵","F"],["🅶","G"],["🅷","H"],["🅸","I"],["🅹","J"],["🅺","K"],["🅻","L"],["🅼","M"],["🅽","N"],["🆀","Q"],["🆁","R"],["🆂","S"],["🆃","T"],["🆄","U"],["🆅","V"],["🆆","W"],["🆇","X"],["🆈","Y"],["🆉","Z"]];const d=[["&"," and "],["🦄"," unicorn "],["♥"," love "]];function p(e,t){if("string"!=typeof e)throw new TypeError(`Expected a string, got \`${typeof e}\``);const n=(t={separator:"-",lowercase:!0,decamelize:!0,customReplacements:[],preserveLeadingUnderscore:!1,preserveTrailingDash:!1,preserveCharacters:[],...t}).preserveLeadingUnderscore&&e.startsWith("_"),r=t.preserveTrailingDash&&e.endsWith("-");e=function(e,t){if("string"!=typeof e)throw new TypeError(`Expected a string, got \`${typeof e}\``);t={customReplacements:[],...t};const n=new Map([...u,...t.customReplacements]);return(e=((e,t)=>{for(const[n,r]of t)e=e.replace(new RegExp((0,c.A)(n),"g"),r);return e})(e=e.normalize(),n)).normalize("NFD").replace(/[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u0898-\u089F\u08C9-\u08D2\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C3C\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u1714\u1715\u1734\u17C9-\u17D3\u17DD\u1939-\u193B\u1A60\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABE\u1AC1-\u1ACB\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1BE6\u1BF2\u1BF3\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA806\uA82C\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3\u{102E0}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D22}-\u{10D27}\u{10D4E}\u{10D69}-\u{10D6D}\u{10EFD}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11046}\u{11070}\u{110B9}\u{110BA}\u{11133}\u{11134}\u{11173}\u{111C0}\u{111CA}-\u{111CC}\u{11235}\u{11236}\u{112E9}\u{112EA}\u{1133B}\u{1133C}\u{1134D}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113CE}-\u{113D0}\u{113D2}\u{113D3}\u{113E1}\u{113E2}\u{11442}\u{11446}\u{114C2}\u{114C3}\u{115BF}\u{115C0}\u{1163F}\u{116B6}\u{116B7}\u{1172B}\u{11839}\u{1183A}\u{1193D}\u{1193E}\u{11943}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D42}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{11F5A}\u{13447}-\u{13455}\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16D6B}\u{16D6C}\u{16F8F}-\u{16F9F}\u{16FF0}\u{16FF1}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1E030}-\u{1E06D}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E946}\u{1E948}-\u{1E94A}]/gu,"").normalize()}(e,{customReplacements:new Map([...d,...t.customReplacements])}),t.decamelize&&(e=(e=>e.replace(/([A-Z]{2,})(\d+)/g,"$1 $2").replace(/([a-z\d]+)([A-Z]{2,})/g,"$1 $2").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-rt-z\d]+)/g,"$1 $2"))(e));const o=(e=>{let t="a-z\\d";if(t+=e.lowercase?"":"A-Z",e.preserveCharacters.length>0)for(const n of e.preserveCharacters){if(n===e.separator)throw new Error(`The separator character \`${e.separator}\` cannot be included in preserved characters: ${e.preserveCharacters}`);t+=(0,c.A)(n)}return new RegExp(`[^${t}]+`,"g")})(t);return t.lowercase&&(e=e.toLowerCase()),e=(e=(e=e.replace(/([a-zA-Z\d]+)'([ts])(\s|$)/g,"$1$2$3")).replace(o,t.separator)).replace(/\\/g,""),t.separator&&(e=((e,t)=>{const n=(0,c.A)(t);return e.replace(new RegExp(`${n}{2,}`,"g"),t).replace(new RegExp(`^${n}|${n}$`,"g"),"")})(e,t.separator)),n&&(e=`_${e}`),r&&(e=`${e}-`),e}var h=n(81570),f=n(44254),m=n(11329);var g=n(73686),y=n(66641);const b=function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),(0,y.VG)(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)},k={}.hasOwnProperty;function w(e){return String(e||"").toUpperCase()}function v(){return e=>{const t=function(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),(0,y.VG)(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)}(e,"definition",(e=>{const n=w(e.identifier);n&&!k.call(t,n)&&(t[n]=e)})),function(e){const n=w(e);return n&&k.call(t,n)?t[n]:null}}(e);!function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),(0,y.VG)(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)}(e,((e,n,r)=>{if("definition"===e.type&&null!==r&&"number"==typeof n)return r.children.splice(n,1),[y._Z,n];if("imageReference"===e.type||"linkReference"===e.type){const o=t(e.identifier);if(o&&null!==r&&"number"==typeof n){const t="imageReference"===e.type?{type:"image",url:o.url,title:o.title,alt:e.alt}:{type:"link",url:o.url,title:o.title,children:e.children};return r.children[n]=t,[y._Z,n]}}}))}}const x=(e,t)=>{var n;if(!(t.childCount>=1&&"hardbreak"===(null==(n=t.lastChild)?void 0:n.type.name)))return void e.next(t.content);const r=[];t.content.forEach(((e,n,o)=>{o!==t.childCount-1&&r.push(e)})),e.next(s.FK.fromArray(r))},S=(e,t)=>(Object.assign(e,{meta:{package:"@milkdown/preset-commonmark",...t}}),e),E=(0,r.JY)("emphasis");S(E,{displayName:"Attr<emphasis>",group:"Emphasis"});const C=(0,r.hk)("emphasis",(e=>({inclusive:!1,parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>"italic"===e}],toDOM:t=>["em",e.get(E.key)(t)],parseMarkdown:{match:e=>"emphasis"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"emphasis"===e.type.name,runner:(e,t)=>{e.withMark(t,"emphasis")}}})));S(C.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"}),S(C.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});const A=(0,r.yu)("ToggleEmphasis",(()=>()=>(0,i.wh)(C.type())));S(A,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});const N=(0,r.pq)("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:e=>{const t=e.get(o.MD);return()=>t.call(A.key)}}});S(N.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"}),S(N.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});const O=(0,r.JY)("strong");S(O,{displayName:"Attr<strong>",group:"Strong"});const T=(0,r.hk)("strong",(e=>({inclusive:!1,parseDOM:[{tag:"b"},{tag:"strong"},{style:"font-style",getAttrs:e=>"bold"===e}],toDOM:t=>["strong",e.get(O.key)(t)],parseMarkdown:{match:e=>"strong"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strong"===e.type.name,runner:(e,t)=>{e.withMark(t,"strong")}}})));S(T.mark,{displayName:"MarkSchema<strong>",group:"Strong"}),S(T.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});const M=(0,r.yu)("ToggleStrong",(()=>()=>(0,i.wh)(T.type())));S(M,{displayName:"Command<toggleStrongCommand>",group:"Strong"});const D=(0,r.pq)("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:e=>{const t=e.get(o.MD);return()=>t.call(M.key)}}});S(D.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"}),S(D.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});const I=(0,r.JY)("inlineCode");S(I,{displayName:"Attr<inlineCode>",group:"InlineCode"});const R=(0,r.hk)("inlineCode",(e=>({priority:100,code:!0,inclusive:!1,parseDOM:[{tag:"code"}],toDOM:t=>["code",e.get(I.key)(t)],parseMarkdown:{match:e=>"inlineCode"===e.type,runner:(e,t,n)=>{e.openMark(n),e.addText(t.value),e.closeMark(n)}},toMarkdown:{match:e=>"inlineCode"===e.type.name,runner:(e,t,n)=>{e.withMark(t,"inlineCode",n.text||"")}}})));S(R.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"}),S(R.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});const F=(0,r.yu)("ToggleInlineCode",(()=>()=>(e,t)=>{const{selection:n,tr:r}=e;if(n.empty)return!1;const{from:o,to:i}=n;return e.doc.rangeHasMark(o,i,R.type())?(null==t||t(r.removeMark(o,i,R.type())),!0):(Object.keys(e.schema.marks).filter((e=>e!==R.type.name)).map((t=>e.schema.marks[t])).forEach((e=>{r.removeMark(o,i,e)})),null==t||t(r.addMark(o,i,R.type().create())),!0)}));S(F,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});const L=(0,r.pq)("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:e=>{const t=e.get(o.MD);return()=>t.call(F.key)}}});S(L.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"}),S(L.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});const P=(0,r.JY)("link");S(P,{displayName:"Attr<link>",group:"Link"});const B=(0,r.hk)("link",(e=>({attrs:{href:{},title:{default:null}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:t=>["a",{...e.get(P.key)(t),...t.attrs}],parseMarkdown:{match:e=>"link"===e.type,runner:(e,t,n)=>{const r=t.url,o=t.title;e.openMark(n,{href:r,title:o}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"link"===e.type.name,runner:(e,t)=>{e.withMark(t,"link",void 0,{title:t.attrs.title,url:t.attrs.href})}}})));S(B.mark,{displayName:"MarkSchema<link>",group:"Link"});const _=(0,r.yu)("ToggleLink",(()=>(e={})=>(0,i.wh)(B.type(),e)));S(_,{displayName:"Command<toggleLinkCommand>",group:"Link"});const z=(0,r.yu)("UpdateLink",(()=>(e={})=>(t,n)=>{if(!n)return!1;let r,o=-1;const{selection:i}=t,{from:s,to:a}=i;if(t.doc.nodesBetween(s,s===a?a+1:a,((e,t)=>{if(B.type().isInSet(e.marks))return r=e,o=t,!1})),!r)return!1;const l=r.marks.find((({type:e})=>e===B.type()));if(!l)return!1;const c=o,u=o+r.nodeSize,{tr:d}=t,p=B.type().create({...l.attrs,...e});return!!p&&(n(d.removeMark(c,u,l).addMark(c,u,p).setSelection(new h.U3(d.selection.$anchor)).scrollIntoView()),!0)}));S(z,{displayName:"Command<updateLinkCommand>",group:"Link"});const $=(0,r.dz)("doc",(()=>({content:"block+",parseMarkdown:{match:({type:e})=>"root"===e,runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>"doc"===e.type.name,runner:(e,t)=>{e.openNode("root"),e.next(t.content)}}})));S($,{displayName:"NodeSchema<doc>",group:"Doc"});const j=(0,r.YR)("paragraph");S(j,{displayName:"Attr<paragraph>",group:"Paragraph"});const U=(0,r.Yh)("paragraph",(e=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:t=>["p",e.get(j.key)(t),0],parseMarkdown:{match:e=>"paragraph"===e.type,runner:(e,t,n)=>{e.openNode(n),t.children?e.next(t.children):e.addText(t.value||""),e.closeNode()}},toMarkdown:{match:e=>"paragraph"===e.type.name,runner:(e,t)=>{e.openNode("paragraph"),x(e,t),e.closeNode()}}})));S(U.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"}),S(U.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});const H=(0,r.yu)("TurnIntoText",(()=>()=>(0,i.y_)(U.type())));S(H,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});const V=(0,r.pq)("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:e=>{const t=e.get(o.MD);return()=>t.call(H.key)}}});S(V.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"}),S(V.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});const W=Array(6).fill(0).map(((e,t)=>t+1)),K=(0,r.Qx)((e=>p(e.textContent)),"headingIdGenerator");S(K,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});const q=(0,r.YR)("heading");S(q,{displayName:"Attr<heading>",group:"Heading"});const G=(0,r.Yh)("heading",(e=>{const t=e.get(K.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:""},level:{default:1}},parseDOM:W.map((e=>({tag:`h${e}`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw(0,a.Ik)(t);return{level:e,id:t.id}}}))),toDOM:n=>[`h${n.attrs.level}`,{...e.get(q.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:e})=>"heading"===e,runner:(e,t,n)=>{const r=t.depth;e.openNode(n,{level:r}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"heading"===e.type.name,runner:(e,t)=>{e.openNode("heading",void 0,{depth:t.attrs.level}),x(e,t),e.closeNode()}}}}));S(G.node,{displayName:"NodeSchema<heading>",group:"Heading"}),S(G.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});const J=(0,r.b_)((e=>(0,l.JJ)(/^(?<hashes>#+)\s$/,G.type(),(t=>{var n,r;const i=(null==(r=null==(n=t.groups)?void 0:n.hashes)?void 0:r.length)||0,s=e.get(o.kY),{$from:a}=s.state.selection,l=a.node();if("heading"===l.type.name){let e=Number(l.attrs.level)+Number(i);return e>6&&(e=6),{level:e}}return{level:i}}))));S(J,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});const Y=(0,r.yu)("WrapInHeading",(()=>e=>(e??(e=1),e<1?(0,i.y_)(U.type()):(0,i.y_)(G.type(),{level:e}))));S(Y,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});const Z=(0,r.yu)("DowngradeHeading",(()=>()=>(e,t,n)=>{const{$from:r}=e.selection,o=r.node();if(o.type!==G.type()||!e.selection.empty||0!==r.parentOffset)return!1;const s=o.attrs.level-1;return s?(null==t||t(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...o.attrs,level:s})),!0):(0,i.y_)(U.type())(e,t,n)}));S(Z,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});const X=(0,r.pq)("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,3)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,3)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,3)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:e=>{const t=e.get(o.MD);return()=>t.call(Z.key)}}});S(X.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"}),S(X.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});const Q=(0,r.YR)("blockquote");S(Q,{displayName:"Attr<blockquote>",group:"Blockquote"});const ee=(0,r.Yh)("blockquote",(e=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:t=>["blockquote",e.get(Q.key)(t),0],parseMarkdown:{match:({type:e})=>"blockquote"===e,runner:(e,t,n)=>{e.openNode(n).next(t.children).closeNode()}},toMarkdown:{match:e=>"blockquote"===e.type.name,runner:(e,t)=>{e.openNode("blockquote").next(t.content).closeNode()}}})));S(ee.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"}),S(ee.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});const te=(0,r.b_)((()=>(0,l.tG)(/^\s*>\s$/,ee.type())));S(te,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});const ne=(0,r.yu)("WrapInBlockquote",(()=>()=>(0,i.Im)(ee.type())));S(ne,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});const re=(0,r.pq)("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:e=>{const t=e.get(o.MD);return()=>t.call(ne.key)}}});S(re.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"}),S(re.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});const oe=(0,r.YR)("codeBlock",(()=>({pre:{},code:{}})));S(oe,{displayName:"Attr<codeBlock>",group:"CodeBlock"});const ie=(0,r.Yh)("code_block",(e=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{language:e.dataset.language}}}],toDOM:t=>{const n=e.get(oe.key)(t);return["pre",{...n.pre,"data-language":t.attrs.language},["code",n.code,0]]},parseMarkdown:{match:({type:e})=>"code"===e,runner:(e,t,n)=>{const r=t.lang,o=t.value;e.openNode(n,{language:r}),o&&e.addText(o),e.closeNode()}},toMarkdown:{match:e=>"code_block"===e.type.name,runner:(e,t)=>{var n;e.addNode("code",void 0,(null==(n=t.content.firstChild)?void 0:n.text)||"",{lang:t.attrs.language})}}})));S(ie.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"}),S(ie.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});const se=(0,r.b_)((()=>(0,l.JJ)(/^```(?<language>[a-z]*)?[\s\n]$/,ie.type(),(e=>{var t;return{language:(null==(t=e.groups)?void 0:t.language)??""}}))));S(se,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});const ae=(0,r.yu)("CreateCodeBlock",(()=>(e="")=>(0,i.y_)(ie.type(),{language:e})));S(ae,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"}),S((0,r.yu)("UpdateCodeBlockLanguage",(()=>({pos:e,language:t}={pos:-1,language:""})=>(n,r)=>e>=0&&(null==r||r(n.tr.setNodeAttribute(e,"language",t)),!0))),{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});const le=(0,r.pq)("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:e=>{const t=e.get(o.MD);return()=>t.call(ae.key)}}});S(le.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"}),S(le.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});const ce=(0,r.YR)("image");S(ce,{displayName:"Attr<image>",group:"Image"});const ue=(0,r.Yh)("image",(e=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:""},alt:{default:""},title:{default:""}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:t=>["img",{...e.get(ce.key)(t),...t.attrs}],parseMarkdown:{match:({type:e})=>"image"===e,runner:(e,t,n)=>{const r=t.url,o=t.alt,i=t.title;e.addNode(n,{src:r,alt:o,title:i})}},toMarkdown:{match:e=>"image"===e.type.name,runner:(e,t)=>{e.addNode("image",void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}})));S(ue.node,{displayName:"NodeSchema<image>",group:"Image"}),S(ue.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});const de=(0,r.yu)("InsertImage",(()=>(e={})=>(t,n)=>{if(!n)return!0;const{src:r="",alt:o="",title:i=""}=e,s=ue.type().create({src:r,alt:o,title:i});return s&&n(t.tr.replaceSelectionWith(s).scrollIntoView()),!0}));S(de,{displayName:"Command<insertImageCommand>",group:"Image"});const pe=(0,r.yu)("UpdateImage",(()=>(e={})=>(t,n)=>{const r=(0,f.UM)(t.selection,ue.type());if(!r)return!1;const{node:o,pos:i}=r,s={...o.attrs},{src:a,alt:l,title:c}=e;return void 0!==a&&(s.src=a),void 0!==l&&(s.alt=l),void 0!==c&&(s.title=c),null==n||n(t.tr.setNodeMarkup(i,void 0,s).scrollIntoView()),!0}));S(pe,{displayName:"Command<updateImageCommand>",group:"Image"}),S((0,r.b_)((()=>new l.fV(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,((e,t,n,r)=>{const[o,i,s="",a]=t;return o?e.tr.replaceWith(n,r,ue.type().create({src:s,alt:i,title:a})):null})))),{displayName:"InputRule<insertImageInputRule>",group:"Image"});const he=(0,r.YR)("hardbreak",(e=>({"data-is-inline":e.attrs.isInline})));S(he,{displayName:"Attr<hardbreak>",group:"Hardbreak"});const fe=(0,r.Yh)("hardbreak",(e=>({inline:!0,group:"inline",attrs:{isInline:{default:!1}},selectable:!1,parseDOM:[{tag:"br"}],toDOM:t=>["br",e.get(he.key)(t)],parseMarkdown:{match:({type:e})=>"break"===e,runner:(e,t,n)=>{var r;e.addNode(n,{isInline:Boolean(null==(r=t.data)?void 0:r.isInline)})}},leafText:()=>"\n",toMarkdown:{match:e=>"hardbreak"===e.type.name,runner:(e,t)=>{t.attrs.isInline?e.addNode("text",void 0,"\n"):e.addNode("break")}}})));S(fe.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"}),S(fe.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});const me=(0,r.yu)("InsertHardbreak",(()=>()=>(e,t)=>{var n;const{selection:r,tr:o}=e;if(r.empty){const i=r.$from.node();if(i.childCount>0&&"hardbreak"===(null==(n=i.lastChild)?void 0:n.type.name))return null==t||t(o.replaceRangeWith(r.to-1,r.to,e.schema.node("paragraph")).setSelection(h.LN.near(o.doc.resolve(r.to))).scrollIntoView()),!0}return null==t||t(o.setMeta("hardbreak",!0).replaceSelectionWith(fe.type().create()).scrollIntoView()),!0}));S(me,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});const ge=(0,r.pq)("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:e=>{const t=e.get(o.MD);return()=>t.call(me.key)}}});S(ge.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"}),S(ge.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});const ye=(0,r.YR)("hr");S(ye,{displayName:"Attr<hr>",group:"Hr"});const be=(0,r.Yh)("hr",(e=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:t=>["hr",e.get(ye.key)(t)],parseMarkdown:{match:({type:e})=>"thematicBreak"===e,runner:(e,t,n)=>{e.addNode(n)}},toMarkdown:{match:e=>"hr"===e.type.name,runner:e=>{e.addNode("thematicBreak")}}})));S(be.node,{displayName:"NodeSchema<hr>",group:"Hr"}),S(be.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});const ke=(0,r.b_)((()=>new l.fV(/^(?:---|___\s|\*\*\*\s)$/,((e,t,n,r)=>{const{tr:o}=e;return t[0]&&o.replaceWith(n-1,r,be.type().create()),o}))));S(ke,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});const we=(0,r.yu)("InsertHr",(()=>()=>(e,t)=>{if(!t)return!0;const n=U.node.type().create(),{tr:r,selection:o}=e,{from:i}=o,s=be.type().create();if(!s)return!0;const a=r.replaceSelectionWith(s).insert(i,n),l=h.LN.findFrom(a.doc.resolve(i),1,!0);return l&&t(a.setSelection(l).scrollIntoView()),!0}));S(we,{displayName:"Command<insertHrCommand>",group:"Hr"});const ve=(0,r.YR)("bulletList");S(ve,{displayName:"Attr<bulletList>",group:"BulletList"});const xe=(0,r.Yh)("bullet_list",(e=>({content:"listItem+",group:"block",attrs:{spread:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{spread:e.dataset.spread}}}],toDOM:t=>["ul",{...e.get(ve.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!t,runner:(e,t,n)=>{const r=null!=t.spread?`${t.spread}`:"false";e.openNode(n,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>"bullet_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!1,spread:"true"===t.attrs.spread}).next(t.content).closeNode()}}})));S(xe.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"}),S(xe.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});const Se=(0,r.b_)((()=>(0,l.tG)(/^\s*([-+*])\s$/,xe.type())));S(Se,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});const Ee=(0,r.yu)("WrapInBulletList",(()=>()=>(0,i.Im)(xe.type())));S(Ee,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});const Ce=(0,r.pq)("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:e=>{const t=e.get(o.MD);return()=>t.call(Ee.key)}}});S(Ce.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"}),S(Ce.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});const Ae=(0,r.YR)("orderedList");S(Ae,{displayName:"Attr<orderedList>",group:"OrderedList"});const Ne=(0,r.Yh)("ordered_list",(e=>({content:"listItem+",group:"block",attrs:{order:{default:1},spread:{default:!1}},parseDOM:[{tag:"ol",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{spread:e.dataset.spread,order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:t=>["ol",{...e.get(Ae.key)(t),...1===t.attrs.order?{}:t.attrs.order,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!!t,runner:(e,t,n)=>{const r=null!=t.spread?`${t.spread}`:"true";e.openNode(n,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>"ordered_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!0,start:1,spread:"true"===t.attrs.spread}),e.next(t.content),e.closeNode()}}})));S(Ne.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"}),S(Ne.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});const Oe=(0,r.b_)((()=>(0,l.tG)(/^\s*(\d+)\.\s$/,Ne.type(),(e=>({order:Number(e[1])})),((e,t)=>t.childCount+t.attrs.order===Number(e[1])))));S(Oe,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});const Te=(0,r.yu)("WrapInOrderedList",(()=>()=>(0,i.Im)(Ne.type())));S(Te,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});const Me=(0,r.pq)("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:e=>{const t=e.get(o.MD);return()=>t.call(Te.key)}}});S(Me.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"}),S(Me.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});const De=(0,r.YR)("listItem");S(De,{displayName:"Attr<listItem>",group:"ListItem"});const Ie=(0,r.Yh)("list_item",(e=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•"},listType:{default:"bullet"},spread:{default:"true"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{label:e.dataset.label,listType:e.dataset["list-type"],spread:e.dataset.spread}}}],toDOM:t=>["li",{...e.get(De.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,n)=>{const r=null!=t.label?`${t.label}.`:"•",o=null!=t.label?"ordered":"bullet",i=null!=t.spread?`${t.spread}`:"true";e.openNode(n,{label:r,listType:o,spread:i}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{e.openNode("listItem",void 0,{spread:"true"===t.attrs.spread}),e.next(t.content),e.closeNode()}}})));S(Ie.node,{displayName:"NodeSchema<listItem>",group:"ListItem"}),S(Ie.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});const Re=(0,r.yu)("SinkListItem",(()=>()=>{return e=Ie.type(),function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));if(!i)return!1;let a=i.startIndex;if(0==a)return!1;let l=i.parent,c=l.child(a-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==l.type,o=s.FK.from(r?e.create():null),a=new s.Ji(s.FK.from(e.create(null,s.FK.from(l.type.create(null,o)))),r?3:1,0),u=i.start,d=i.end;n(t.tr.step(new m.Wg(u-(r?3:1),d,u,d,a,1,!0)).scrollIntoView())}return!0};var e}));S(Re,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});const Fe=(0,r.yu)("SplitListItem",(()=>()=>{return e=Ie.type(),function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,a=r.$to.end(r.depth);i<a&&(o.step(new m.Wg(i-1,a,i,a,new s.Ji(s.FK.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new s.u$(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const l=(0,m.jP)(r);if(null==l)return!1;o.lift(r,l);let c=o.mapping.map(i,-1)-1;return(0,m.n9)(o.doc,c)&&o.join(c),t(o.scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),a=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,c=n.endIndex==o.childCount,u=i.node(-1),d=i.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?s.FK.empty:s.FK.from(o))))return!1;let p=i.pos,h=p+a.nodeSize;return r.step(new m.Wg(p-(l?1:0),h+(c?1:0),p+1,h-1,new s.Ji((l?s.FK.empty:s.FK.from(o.copy(s.FK.empty))).append(c?s.FK.empty:s.FK.from(o.copy(s.FK.empty))),l?0:1,c?0:1),l?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))};var e}));S(Fe,{displayName:"Command<liftListItemCommand>",group:"ListItem"});const Le=(0,r.yu)("SplitListItem",(()=>()=>{return e=Ie.type(),function(t,n){let{$from:r,$to:o,node:i}=t.selection;if(i&&i.isBlock||r.depth<2||!r.sameParent(o))return!1;let a=r.node(-1);if(a.type!=e)return!1;if(0==r.parent.content.size&&r.node(-1).childCount==r.indexAfter(-1)){if(3==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let o=s.FK.empty,i=r.index(-1)?1:r.index(-2)?2:3;for(let e=r.depth-i;e>=r.depth-3;e--)o=s.FK.from(r.node(e).copy(o));let a=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;o=o.append(s.FK.from(e.createAndFill()));let l=r.before(r.depth-(i-1)),c=t.tr.replace(l,r.after(-a),new s.Ji(o,4-i,0)),u=-1;c.doc.nodesBetween(l,c.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0==e.content.size&&(u=t+1)})),u>-1&&c.setSelection(h.LN.near(c.doc.resolve(u))),n(c.scrollIntoView())}return!0}let l=o.pos==r.end()?a.contentMatchAt(0).defaultType:null,c=t.tr.delete(r.pos,o.pos),u=l?[null,{type:l}]:void 0;return!!(0,m.zy)(c.doc,r.pos,2,u)&&(n&&n(c.split(r.pos,2,u).scrollIntoView()),!0)};var e}));S(Le,{displayName:"Command<splitListItemCommand>",group:"ListItem"});const Pe=(0,r.pq)("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:e=>{const t=e.get(o.MD);return()=>t.call(Le.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:e=>{const t=e.get(o.MD);return()=>t.call(Re.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:e=>{const t=e.get(o.MD);return()=>t.call(Fe.key)}}});S(Pe.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"}),S(Pe.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});const Be=(0,r.dz)("text",(()=>({group:"inline",parseMarkdown:{match:({type:e})=>"text"===e,runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>"text"===e.type.name,runner:(e,t)=>{e.addNode("text",void 0,t.text)}}})));S(Be,{displayName:"NodeSchema<text>",group:"Text"});const _e=(0,r.YR)("html");S(_e,{displayName:"Attr<html>",group:"Html"});const ze=(0,r.Yh)("html",(e=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:""}},toDOM:t=>{const n=document.createElement("span"),r={...e.get(_e.key)(t),"data-value":t.attrs.value,"data-type":"html"};return n.textContent=t.attrs.value,["span",r,t.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>Boolean("html"===e),runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>"html"===e.type.name,runner:(e,t)=>{e.addNode("html",void 0,t.attrs.value)}}})));S(ze.node,{displayName:"NodeSchema<html>",group:"Html"}),S(ze.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});const $e=[$,j,U,K,q,G,he,fe,Q,ee,oe,ie,ye,be,ce,ue,ve,xe,Ae,Ne,De,Ie,E,C,O,T,I,R,P,B,_e,ze,Be].flat(),je=[te,Se,Oe,se,ke,J].flat(),Ue=[H,ne,Y,Z,ae,me,we,de,pe,Te,Ee,Re,Le,Fe,A,F,M,_,z],He=[re,le,ge,X,Pe,Me,Ce,V,N,L,D].flat(),Ve=/\[(?<span>((www|https:\/\/|http:\/\/)[^\s\]]+))]\((?<url>[^\s\]]+)\)/,We=e=>{let t=e,n=t.match(Ve);for(;n&&n.groups;){const{span:e}=n.groups;t=t.replace(Ve,e),n=t.match(Ve)}return t},Ke=(e,t,n)=>{const r=e.split(""),o=r[t];return r[t]&&r[n]&&(r[t]=r[n],r[n]=o),r.join("").toString()},qe={placeholderConfig:{hole:"∅",punctuation:"⁂",char:"∴"},globalNodes:["footnote_definition"],shouldSyncNode:({prevNode:e,nextNode:t})=>e.inlineContent&&t&&e.type===t.type&&!e.eq(t),movePlaceholder:(e,t)=>{const n=["*","_"];let r=t.indexOf(e);for(;n.includes(t[r-1]||"")&&n.includes(t[r+1]||"");)t=Ke(t,r,r+1),r+=1;return t}},Ge=(0,r.Qx)(qe,"inlineSyncConfig");S(Ge,{displayName:"Ctx<inlineSyncConfig>",group:"Prose"});const Je=e=>e.split("\n\n")[0]||"",Ye=(e,t)=>{try{const n=((e,t)=>{const{globalNodes:n}=e.get(Ge.key),r=[];return t.doc.descendants((e=>{if(n.includes(e.type.name)||n.includes(e.type))return r.push(e),!1})),r})(e,t),i=(e=>e.selection.$from.node())(t),s=((e,t,n,r)=>e.get(o.M)(t.schema.topNodeType.create(void 0,[n,...r])))(e,t,i,n),[a,l]=((e,t)=>{const n=e.get(Ge.key),o=n.placeholderConfig.hole,[i="",...s]=t.split("\n\n");let a=(0,r.Fs)((e=>t=>t.replace((e=>new RegExp(`\\\\(?=[^\\w\\s${e}\\\\]|_)`,"g"))(e),""))(o),(e=>n.movePlaceholder(o,e)),We)(i);const l=(e=>t=>{const n=t.indexOf(e.hole),r=t.charAt(n-1),o=t.charAt(n+1),i=/[^\w]|_/;return o?r&&i.test(r)&&i.test(o)?e.punctuation:e.char:e.punctuation})(n.placeholderConfig)(a);return a=a.replace(o,l),a=[a,...s].join("\n\n"),[a,l]})(e,s),c=((e,t)=>{const n=e.get(o.bQ)(t);return n?n.firstChild:null})(e,a);return!c||i.type!==c.type||(e=>1===e.childCount&&"html"===e.child(0).type.name)(c)?null:(c.attrs={...i.attrs},c.descendants((e=>{var t;const n=e.marks.find((e=>"link"===e.type.name));n&&(null==(t=e.text)?void 0:t.includes(l))&&n.attrs.href.includes(l)&&(n.attrs.href=n.attrs.href.replace(l,""))})),{text:Je(a),prevNode:i,nextNode:c,placeholder:l})}catch{return null}},Ze=(0,r.Gf)((e=>{let t=null;const n=new h.hs("MILKDOWN_INLINE_SYNC");return new h.k_({key:n,state:{init:()=>null,apply:(r,i,s,a)=>{var l;const c=e.get(o.kY);if(null==(l=c.hasFocus)||!l.call(c)||!c.editable||!r.docChanged||r.getMeta(n))return null;const u=Ye(e,a);if(!u)return null;t&&(cancelAnimationFrame(t),t=null);const{prevNode:d,nextNode:p,text:f}=u,{shouldSyncNode:m}=e.get(Ge.key);return m({prevNode:d,nextNode:p,ctx:e,tr:r,text:f})&&(t=requestAnimationFrame((()=>{t=null;const{dispatch:r,state:i}=e.get(o.kY);((e,t,n,r,o)=>{const{placeholderConfig:i}=e.get(Ge.key),s=i.hole;let a=n.tr.setMeta(t,!0).insertText(s,n.selection.from);const l=n.apply(a),c=Ye(e,l);if(!c)return;const{$from:u}=l.selection,d=u.before(),p=u.after(),f=((e,t,n)=>{let r=t,o=!1;return e.descendants((e=>{var t;if(o)return!1;if(e.isText){const i=null==(t=e.text)?void 0:t.indexOf(n);if(null!=i&&i>=0)return o=!0,r+=i,!1}r+=e.nodeSize})),r})(c.nextNode,d,c.placeholder);a=a.replaceWith(d,p,c.nextNode).setNodeMarkup(d,void 0,o).delete(f+1,f+2),a=a.setSelection(h.U3.near(a.doc.resolve(f+1))),r(a)})(e,n,i,r,d.attrs)})),r.setMeta("addToHistory",!1)),null}}})}));S(Ze,{displayName:"Prose<inlineSyncPlugin>",group:"Prose"});const Xe=(0,r.lz)((()=>()=>e=>{b(e,"list",(e=>{if(e.ordered){const t=e.start??1;e.children.forEach(((e,n)=>{e.label=n+t}))}}))}));S(Xe,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});const Qe=(0,r.lz)((()=>()=>e=>{const t=/[\t ]*(?:\r?\n|\r)/g;b(e,"text",((e,n,r)=>{if(!e.value||"string"!=typeof e.value)return;const o=[];let i=0;t.lastIndex=0;let s=t.exec(e.value);for(;s;){const n=s.index;i!==n&&o.push({type:"text",value:e.value.slice(i,n)}),o.push({type:"break",data:{isInline:!0}}),i=n+s[0].length,s=t.exec(e.value)}return o.length>0&&r&&"number"==typeof n?(i<e.value.length&&o.push({type:"text",value:e.value.slice(i)}),r.children.splice(n,1,...o),n+o.length):void 0}))}));S(Qe,{displayName:"Remark<remarkLineBreak>",group:"Remark"});const et=(0,r.lz)((()=>v));S(et,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});const tt=(0,r.lz)((()=>()=>e=>{!function(e){(function e(t,n,r){if((e=>!!e.children)(t)){const n=[];for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r];if(o){const i=e(o,r,t);if(i)for(let e=0,t=i.length;e<t;e++){const t=i[e];t&&n.push(t)}}}t.children=n}return((e,t,n)=>(e=>"html"===e.type)(e)?("root"===(null==n?void 0:n.type)&&(e.children=[{...e}],delete e.value,e.type="paragraph"),[e]):[e])(t,0,r)})(e,0,null)[0]}(e)}));S(tt,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});const nt=(0,r.Gf)((()=>{let e=!1;const t=new h.hs("MILKDOWN_INLINE_NODES_CURSOR"),n=new h.k_({key:t,state:{init:()=>!1,apply(e){if(!e.selection.empty)return!1;const t=e.selection.$from,n=t.nodeBefore,r=t.nodeAfter;return!(!(n&&r&&n.isInline&&!n.isText&&r.isInline)||r.isText)}},props:{handleDOMEvents:{compositionend:(t,r)=>!!e&&(e=!1,requestAnimationFrame((()=>{if(n.getState(t.state)){const e=t.state.selection.from;r.preventDefault(),t.dispatch(t.state.tr.insertText(r.data||"",e))}})),!0),compositionstart:t=>(n.getState(t.state)&&(e=!0),!1),beforeinput:(t,r)=>{if(n.getState(t.state)&&r instanceof InputEvent&&r.data&&!e){const e=t.state.selection.from;return r.preventDefault(),t.dispatch(t.state.tr.insertText(r.data||"",e)),!0}return!1}},decorations(e){if(n.getState(e)){const t=e.selection.$from.pos,n=document.createElement("span"),r=g.NZ.widget(t,n,{side:-1}),o=document.createElement("span"),i=g.NZ.widget(t,o);return setTimeout((()=>{n.contentEditable="true",o.contentEditable="true"})),g.zF.create(e.doc,[r,i])}return g.zF.empty}}});return n}));S(nt,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});const rt=(0,r.Gf)((()=>new h.k_({key:new h.hs("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(e,t,n)=>{if(!e.length)return;const[r]=e;if(!r)return;const[o]=r.steps;if(r.getMeta("hardbreak")){if(!(o instanceof m.Ln))return;const{from:e}=o;return n.tr.setNodeMarkup(e,fe.type(),void 0,[])}if(o instanceof m.XE){let e=n.tr;const{from:t,to:r}=o;return n.doc.nodesBetween(t,r,((t,n)=>{t.type===fe.type()&&(e=e.setNodeMarkup(n,fe.type(),void 0,[]))})),e}}})));S(rt,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});const ot=(0,r.Qx)(["table","code_block"],"hardbreakFilterNodes");S(ot,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});const it=(0,r.Gf)((e=>{const t=e.get(ot.key);return new h.k_({key:new h.hs("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(e,n)=>{const r=e.getMeta("hardbreak"),[o]=e.steps;if(r&&o){const{from:e}=o,r=n.doc.resolve(e);let i=r.depth,s=!0;for(;i>0;)t.includes(r.node(i).type.name)&&(s=!1),i--;return s}return!0}})}));S(it,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});const st=(0,r.Gf)((e=>{const t=new h.hs("MILKDOWN_HEADING_ID"),n=n=>{if(n.composing||!n.editable)return;const r=e.get(K.key),o=n.state.tr.setMeta("addToHistory",!1);let i=!1;n.state.doc.descendants(((e,n)=>{if(e.type===G.type()){if(0===e.textContent.trim().length)return;const s=e.attrs,a=r(e);s.id!==a&&(i=!0,o.setMeta(t,!0).setNodeMarkup(n,void 0,{...s,id:a}))}})),i&&n.dispatch(o)};return new h.k_({key:t,view:e=>(n(e),{update:e=>{n(e)}})})}));S(st,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});const at=(0,r.Gf)((()=>{const e=e=>{if(e.composing||!e.editable)return;const t=Ne.type(),n=xe.type(),r=Ie.type(),o=e.state,i=(e,t)=>{let n=!1;const r=`${t+1}.`;return e.label!==r&&(e.label=r,n=!0),n};let s=o.tr,a=!1;o.doc.descendants(((e,o,l,c)=>{if(e.type===n){const n=e.maybeChild(0);(null==n?void 0:n.type)===r&&"ordered"===n.attrs.listType&&(a=!0,s.setNodeMarkup(o,t,{spread:"true"}),e.descendants(((e,t,n,o)=>{if(e.type===r){const n={...e.attrs};i(n,o)&&(s=s.setNodeMarkup(t,void 0,n))}return!1})))}else if(e.type===r&&(null==l?void 0:l.type)===t){const t={...e.attrs};let n=!1;"ordered"!==t.listType&&(t.listType="ordered",n=!0),(null==l?void 0:l.maybeChild(0))&&(n=i(t,c)),n&&(s=s.setNodeMarkup(o,void 0,t),a=!0)}})),a&&e.dispatch(s.setMeta("addToHistory",!1))};return new h.k_({key:new h.hs("MILKDOWN_KEEP_LIST_ORDER"),view:t=>(e(t),{update:t=>{e(t)}})})}));S(at,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});const lt=[$e,je,Ue,He,[Ge,Ze,rt,ot,it,nt,Xe,et,Qe,tt,st,at]].flat()},2402:(e,t,n)=>{"use strict";n.d(t,{AL:()=>J,D8:()=>de,GU:()=>re,J3:()=>u,LF:()=>he,RC:()=>ne,_t:()=>ee,aH:()=>b,aR:()=>ae,gR:()=>ie,i4:()=>le,kG:()=>pe,of:()=>f,rn:()=>C});var r,o,i=n(81570),s=n(16090),a=n(73686),l=n(15939),c=n(11329);if("undefined"!=typeof WeakMap){let e=new WeakMap;r=t=>e.get(t),o=(t,n)=>(e.set(t,n),n)}else{const e=[],t=10;let n=0;r=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},o=(r,o)=>(n==t&&(n=0),e[n++]=r,e[n++]=o)}var u=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,o=t/this.width|0;let i=r+1,s=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;s<this.height&&this.map[t+this.width*e]==n;e++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(e,t){const{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:s,right:a,top:l,bottom:c}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(o,l),right:Math.max(r,a),bottom:Math.max(i,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){const i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==e.left&&o&&this.map[i-1]==s||r==e.top&&r&&this.map[i-this.width]==s||t.push(s))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width;const r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return r(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);const t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const o=e.child(r);let i=0;if(n)for(let t=0;t<r;t++){const n=e.child(t);for(let e=0;e<n.childCount;e++){const o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){const t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[];let o=0,i=null;const s=[];for(let e=0,o=t*n;e<o;e++)r[e]=0;for(let a=0,l=0;a<n;a++){const c=e.child(a);l++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==c.childCount)break;const u=c.child(e),{colspan:d,rowspan:p,colwidth:h}=u.attrs;for(let e=0;e<p;e++){if(e+a>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:p-e});break}const c=o+e*t;for(let e=0;e<d;e++){0==r[c+e]?r[c+e]=l:(i||(i=[])).push({type:"collision",row:a,pos:l,n:d-e});const n=h&&h[e];if(n){const r=(c+e)%t*2,o=s[r];null==o||o!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):o==n&&s[r+1]++}}}o+=d,l+=u.nodeSize}const u=(a+1)*t;let d=0;for(;o<u;)0==r[o++]&&d++;d&&(i||(i=[])).push({type:"missing",row:a,n:d}),l++}const a=new u(t,n,r,i);let l=!1;for(let e=0;!l&&e<s.length;e+=2)null!=s[e]&&s[e+1]<n&&(l=!0);return l&&function(e,t,n){e.problems||(e.problems=[]);const r={};for(let o=0;o<e.map.length;o++){const i=e.map[o];if(r[i])continue;r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null;const l=s.attrs;for(let n=0;n<l.colspan;n++){const r=t[(o+n)%e.width*2];null==r||l.colwidth&&l.colwidth[n]==r||((a||(a=d(l)))[n]=r)}a&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}(a,s,e),a}(e))}};function d(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function p(e,t){if("string"==typeof e)return{};const n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((e=>Number(e))):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(const n in t){const r=t[n].getFromDOM,o=r&&r(e);null!=o&&(i[n]=o)}return i}function h(e,t){const n={};1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(","));for(const r in t){const o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function f(e){const t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(const e in t)n[e]={default:t[e].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:()=>["table",["tbody",0]]},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:()=>["tr",0]},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:e=>p(e,t)}],toDOM:e=>["td",h(e,t),0]},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:e=>p(e,t)}],toDOM:e=>["th",h(e,t),0]}}}function m(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}var g=new i.hs("selectingCells");function y(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function b(e){const t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function k(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;const n=y(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function w(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function v(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function x(e,t,n){const r=e.node(-1),o=u.get(r),i=e.start(-1),s=o.nextCell(e.pos-i,t,n);return null==s?null:e.node(0).resolve(i+s)}function S(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((e=>e>0))||(r.colwidth=null)),r}function E(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}var C=class extends i.LN{constructor(e,t=e){const n=e.node(-1),r=u.get(n),o=e.start(-1),s=r.rectBetween(e.pos-o,t.pos-o),a=e.node(0),l=r.cellsInRect(s).filter((e=>e!=t.pos-o));l.unshift(t.pos-o);const c=l.map((e=>{const t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);const r=o+e+1;return new i.yn(a.resolve(r),a.resolve(r+t.content.size))}));super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(e,t){const n=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(w(n)&&w(r)&&v(n,r)){const e=this.$anchorCell.node(-1)!=n.node(-1);return e&&this.isRowSelection()?C.rowSelection(n,r):e&&this.isColSelection()?C.colSelection(n,r):new C(n,r)}return i.U3.between(n,r)}content(){const e=this.$anchorCell.node(-1),t=u.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let n=r.top;n<r.bottom;n++){const a=[];for(let i=n*t.width+r.left,s=r.left;s<r.right;s++,i++){const n=t.map[i];if(o[n])continue;o[n]=!0;const s=t.findCell(n);let l=e.nodeAt(n);if(!l)throw RangeError(`No cell with offset ${n} found`);const c=r.left-s.left,u=s.right-r.right;if(c>0||u>0){let e=l.attrs;if(c>0&&(e=S(e,0,c)),u>0&&(e=S(e,e.colspan-u,u)),s.left<r.left){if(l=l.type.createAndFill(e),!l)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else l=l.type.create(e,l.content)}if(s.top<r.top||s.bottom>r.bottom){const e={...l.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};l=s.top<r.top?l.type.createAndFill(e):l.type.create(e,l.content)}a.push(l)}i.push(e.child(n).copy(s.FK.from(a)))}const a=this.isColSelection()&&this.isRowSelection()?e:i;return new s.Ji(s.FK.from(a),1,1)}replace(e,t=s.Ji.empty){const n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){const{$from:i,$to:a}=r[o],l=e.mapping.slice(n);e.replace(l.map(i.pos),l.map(a.pos),o?s.Ji.empty:t)}const o=i.LN.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new s.Ji(s.FK.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=u.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<o.length;n++)e(t.nodeAt(o[n]),r+o[n])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const n=e.node(-1),r=u.get(n),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(t.pos-o),a=e.node(0);return i.top<=s.top?(i.top>0&&(e=a.resolve(o+r.map[i.left])),s.bottom<r.height&&(t=a.resolve(o+r.map[r.width*(r.height-1)+s.right-1]))):(s.top>0&&(t=a.resolve(o+r.map[s.left])),i.bottom<r.height&&(e=a.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))),new C(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=u.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),o=t.colCount(this.$headCell.pos-n);if(Math.min(r,o)>0)return!1;const i=r+this.$anchorCell.nodeAfter.attrs.colspan,s=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,s)==t.width}eq(e){return e instanceof C&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const n=e.node(-1),r=u.get(n),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(t.pos-o),a=e.node(0);return i.left<=s.left?(i.left>0&&(e=a.resolve(o+r.map[i.top*r.width])),s.right<r.width&&(t=a.resolve(o+r.map[r.width*(s.top+1)-1]))):(s.left>0&&(t=a.resolve(o+r.map[s.top*r.width])),i.right<r.width&&(e=a.resolve(o+r.map[r.width*(i.top+1)-1]))),new C(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new C(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new C(e.resolve(t),e.resolve(n))}getBookmark(){return new A(this.$anchorCell.pos,this.$headCell.pos)}};C.prototype.visible=!1,i.LN.jsonID("cell",C);var A=class{constructor(e,t){this.anchor=e,this.head=t}map(e){return new A(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&v(t,n)?new C(t,n):i.LN.near(n,1)}};function N(e){if(!(e.selection instanceof C))return null;const t=[];return e.selection.forEachCell(((e,n)=>{t.push(a.NZ.node(n,n+e.nodeSize,{class:"selectedCell"}))})),a.zF.create(e.doc,t)}var O=new i.hs("fix-tables");function T(e,t,n,r){const o=e.childCount,i=t.childCount;e:for(let s=0,a=0;s<i;s++){const i=t.child(s);for(let t=a,r=Math.min(o,s+3);t<r;t++)if(e.child(t)==i){a=t+1,n+=i.nodeSize;continue e}r(i,n),a<o&&e.child(a).sameMarkup(i)?T(e.child(a),i,n+1,r):i.nodesBetween(0,i.content.size,r,n+1),n+=i.nodeSize}}function M(e,t){let n;const r=(t,r)=>{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){const o=u.get(t);if(!o.problems)return r;r||(r=e.tr);const i=[];for(let e=0;e<o.height;e++)i.push(0);for(let e=0;e<o.problems.length;e++){const s=o.problems[e];if("collision"==s.type){const e=t.nodeAt(s.pos);if(!e)continue;const o=e.attrs;for(let e=0;e<o.rowspan;e++)i[s.row+e]+=s.n;r.setNodeMarkup(r.mapping.map(n+1+s.pos),null,S(o,o.colspan-s.n,s.n))}else if("missing"==s.type)i[s.row]+=s.n;else if("overlong_rowspan"==s.type){const e=t.nodeAt(s.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+s.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-s.n})}else if("colwidth mismatch"==s.type){const e=t.nodeAt(s.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+s.pos),null,{...e.attrs,colwidth:s.colwidth})}}let s,a;for(let e=0;e<i.length;e++)i[e]&&(null==s&&(s=e),a=e);for(let l=0,c=n+1;l<o.height;l++){const n=t.child(l),o=c+n.nodeSize,u=i[l];if(u>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);const i=[];for(let n=0;n<u;n++){const n=m(e.schema)[t].createAndFill();n&&i.push(n)}const d=0!=l&&s!=l-1||a!=l?o-1:c+1;r.insert(r.mapping.map(d),i)}c=o}return r.setMeta(O,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&T(t.doc,e.doc,0,r):e.doc.descendants(r),n}function D(e,t){const n=e.createAndFill();return new c.dL(n).replace(0,n.content.size,t).doc}function I(e,t,n,r,o,i,s,a){if(0==s||s==t.height)return!1;let l=!1;for(let c=o;c<i;c++){const o=s*t.width+c,i=t.map[o];if(t.map[o-t.width]==i){l=!0;const o=n.nodeAt(i),{top:u,left:d}=t.findCell(i);e.setNodeMarkup(e.mapping.slice(a).map(i+r),null,{...o.attrs,rowspan:s-u}),e.insert(e.mapping.slice(a).map(t.positionAt(s,d,n)),o.type.createAndFill({...o.attrs,rowspan:u+o.attrs.rowspan-s})),c+=o.attrs.colspan-1}}return l}function R(e,t,n,r,o,i,s,a){if(0==s||s==t.width)return!1;let l=!1;for(let c=o;c<i;c++){const o=c*t.width+s,i=t.map[o];if(t.map[o-1]==i){l=!0;const o=n.nodeAt(i),u=t.colCount(i),d=e.mapping.slice(a).map(i+r);e.setNodeMarkup(d,null,S(o.attrs,s-u,o.attrs.colspan-(s-u))),e.insert(d+o.nodeSize,o.type.createAndFill(S(o.attrs,0,s-u))),c+=o.attrs.rowspan-1}}return l}function F(e,t,n,r,o){let i=n?e.doc.nodeAt(n-1):e.doc;if(!i)throw new Error("No table found");let a=u.get(i);const{top:l,left:c}=r,d=c+o.width,p=l+o.height,h=e.tr;let f=0;function g(){if(i=n?h.doc.nodeAt(n-1):h.doc,!i)throw new Error("No table found");a=u.get(i),f=h.mapping.maps.length}(function(e,t,n,r,o,i,a){const l=m(e.doc.type.schema);let c,u;if(o>t.width)for(let i=0,s=0;i<t.height;i++){const d=n.child(i);s+=d.nodeSize;const p=[];let h;h=null==d.lastChild||d.lastChild.type==l.cell?c||(c=l.cell.createAndFill()):u||(u=l.header_cell.createAndFill());for(let e=t.width;e<o;e++)p.push(h);e.insert(e.mapping.slice(a).map(s-1+r),p)}if(i>t.height){const d=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,o);e++){const o=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==l.header_cell;d.push(o?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const p=l.row.create(null,s.FK.from(d)),h=[];for(let e=t.height;e<i;e++)h.push(p);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),h)}return!(!c&&!u)})(h,a,i,n,d,p,f)&&g(),I(h,a,i,n,c,d,l,f)&&g(),I(h,a,i,n,c,d,p,f)&&g(),R(h,a,i,n,l,p,c,f)&&g(),R(h,a,i,n,l,p,d,f)&&g();for(let e=l;e<p;e++){const t=a.positionAt(e,c,i),r=a.positionAt(e,d,i);h.replace(h.mapping.slice(f).map(t+n),h.mapping.slice(f).map(r+n),new s.Ji(o.rows[e-l],0,0))}g(),h.setSelection(new C(h.doc.resolve(n+a.positionAt(l,c,i)),h.doc.resolve(n+a.positionAt(p-1,d-1,i)))),t(h)}var L=(0,l.K)({ArrowLeft:B("horiz",-1),ArrowRight:B("horiz",1),ArrowUp:B("vert",-1),ArrowDown:B("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:z,"Mod-Backspace":z,Delete:z,"Mod-Delete":z});function P(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function B(e,t){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof C)return P(n,r,i.LN.near(s.$headCell,t));if("horiz"!=e&&!s.empty)return!1;const a=H(o,e,t);if(null==a)return!1;if("horiz"==e)return P(n,r,i.LN.near(n.doc.resolve(s.head+t),t));{const o=n.doc.resolve(a),s=x(o,e,t);let l;return l=s?i.LN.near(s,1):t<0?i.LN.near(n.doc.resolve(o.before(-1)),-1):i.LN.near(n.doc.resolve(o.after(-1)),1),P(n,r,l)}}}function _(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof C)s=i;else{const r=H(o,e,t);if(null==r)return!1;s=new C(n.doc.resolve(r))}const a=x(s.$headCell,e,t);return!!a&&P(n,r,new C(s.$anchorCell,a))}}function z(e,t){const n=e.selection;if(!(n instanceof C))return!1;if(t){const r=e.tr,o=m(e.schema).cell.createAndFill().content;n.forEachCell(((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new s.Ji(o,0,0))})),r.docChanged&&t(r)}return!0}function $(e,t){const n=y(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new C(n))),!0)}function j(e,t,n){if(!b(e.state))return!1;let r=function(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.child(0).type.spec.tableRole);)n--,r--,t=t.child(0).content;const o=t.child(0),i=o.type.spec.tableRole,a=o.type.schema,l=[];if("row"==i)for(let e=0;e<t.childCount;e++){let o=t.child(e).content;const i=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(i||c)&&(o=D(m(a).row,new s.Ji(o,i,c)).content),l.push(o)}else{if("cell"!=i&&"header_cell"!=i)return null;l.push(n||r?D(m(a).row,new s.Ji(t,n,r)).content:t)}return function(e,t){const n=[];for(let e=0;e<t.length;e++){const r=t[e];for(let t=r.childCount-1;t>=0;t--){const{rowspan:o,colspan:i}=r.child(t).attrs;for(let t=e;t<e+o;t++)n[t]=(n[t]||0)+i}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(s.FK.empty),n[o]<r){const i=m(e).cell.createAndFill(),a=[];for(let e=n[o];e<r;e++)a.push(i);t[o]=t[o].append(s.FK.from(a))}return{height:t.length,width:r,rows:t}}(a,l)}(n);const o=e.state.selection;if(o instanceof C){r||(r={width:1,height:1,rows:[s.FK.from(D(m(e.state.schema).cell,n))]});const t=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),a=u.get(t).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=function({width:e,height:t,rows:n},r,o){if(e!=r){const t=[],o=[];for(let e=0;e<n.length;e++){const i=n[e],a=[];for(let n=t[e]||0,o=0;n<r;o++){let s=i.child(o%i.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(S(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),a.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}o.push(s.FK.from(a))}n=o,e=r}if(t!=o){const e=[];for(let r=0,i=0;r<o;r++,i++){const a=[],l=n[i%t];for(let e=0;e<l.childCount;e++){let t=l.child(e);r+t.attrs.rowspan>o&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,o-t.attrs.rowspan)},t.content)),a.push(t)}e.push(s.FK.from(a))}n=e,t=o}return{width:e,height:t,rows:n}}(r,a.right-a.left,a.bottom-a.top),F(e.state,e.dispatch,i,a,r),!0}if(r){const t=k(e.state),n=t.start(-1);return F(e.state,e.dispatch,n,u.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function U(e,t){var n;if(t.ctrlKey||t.metaKey)return;const r=V(e,t.target);let o;if(t.shiftKey&&e.state.selection instanceof C)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(o=y(e.state.selection.$anchor))&&(null==(n=W(e,t))?void 0:n.pos)!=o.pos)i(o,t),t.preventDefault();else if(!r)return;function i(t,n){let r=W(e,n);const o=null==g.getState(e.state);if(!r||!v(t,r)){if(!o)return;r=t}const i=new C(t,r);if(o||!e.state.selection.eq(i)){const n=e.state.tr.setSelection(i);o&&n.setMeta(g,t.pos),e.dispatch(n)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",a),null!=g.getState(e.state)&&e.dispatch(e.state.tr.setMeta(g,-1))}function a(n){const o=n,a=g.getState(e.state);let l;if(null!=a)l=e.state.doc.resolve(a);else if(V(e,o.target)!=r&&(l=W(e,t),!l))return s();l&&i(l,o)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",a)}function H(e,t,n){if(!(e.state.selection instanceof i.U3))return null;const{$head:r}=e.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){const i=r.before(o),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?i:null}}return null}function V(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function W(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?y(e.state.doc.resolve(n.pos)):null}var K=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),q(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,q(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function q(e,t,n,r,o,i){var s;let a=0,l=!0,c=t.firstChild;const u=e.firstChild;if(u){for(let e=0,n=0;e<u.childCount;e++){const{colspan:s,colwidth:d}=u.child(e).attrs;for(let e=0;e<s;e++,n++){const s=o==n?i:d&&d[e],u=s?s+"px":"";a+=s||r,s||(l=!1),c?(c.style.width!=u&&(c.style.width=u),c=c.nextSibling):t.appendChild(document.createElement("col")).style.width=u}}for(;c;){const e=c.nextSibling;null==(s=c.parentNode)||s.removeChild(c),c=e}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var G=new i.hs("tableColumnResizing");function J({handleWidth:e=5,cellMinWidth:t=25,View:n=K,lastColumnResizable:r=!0}={}){const o=new i.k_({key:G,state:{init:(e,r)=>(o.spec.props.nodeViews[m(r.schema).table.name]=(e,r)=>new n(e,t,r),new Y(-1,!1)),apply:(e,t)=>t.apply(e)},props:{attributes:e=>{const t=G.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(t,n)=>{!function(e,t,n,r,o){const i=G.getState(e.state);if(i&&!i.dragging){const r=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target);let s=-1;if(r){const{left:o,right:i}=r.getBoundingClientRect();t.clientX-o<=n?s=Z(e,t,"left"):i-t.clientX<=n&&(s=Z(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){const t=e.state.doc.resolve(s),n=t.node(-1),r=u.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Q(e,s)}}}(t,n,e,0,r)},mouseleave:e=>{!function(e){const t=G.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Q(e,-1)}(e)},mousedown:(e,n)=>{!function(e,t,n){const r=G.getState(e.state);if(!r||-1==r.activeHandle||r.dragging)return!1;const o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=e.domAtPos(t);let s=i.node.childNodes[i.offset].offsetWidth,a=n;if(r)for(let e=0;e<n;e++)r[e]&&(s-=r[e],a--);return s/a}(e,r.activeHandle,o.attrs);function s(t){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);const r=G.getState(e.state);(null==r?void 0:r.dragging)&&(function(e,t,n){const r=e.state.doc.resolve(t),o=r.node(-1),i=u.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let e=0;e<i.height;e++){const t=e*i.width+a;if(e&&i.map[t]==i.map[t-i.width])continue;const r=i.map[t],u=o.nodeAt(r).attrs,d=1==u.colspan?0:a-i.colCount(r);if(u.colwidth&&u.colwidth[d]==n)continue;const p=u.colwidth?u.colwidth.slice():(c=u.colspan,Array(c).fill(0));p[d]=n,l.setNodeMarkup(s+r,null,{...u,colwidth:p})}var c;l.docChanged&&e.dispatch(l)}(e,r.activeHandle,X(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(G,{setDragging:null})))}function a(t){if(!t.which)return s(t);const r=G.getState(e.state);if(r&&r.dragging){const o=X(r.dragging,t,n);!function(e,t,n,r){const o=e.state.doc.resolve(t),i=o.node(-1),s=o.start(-1),a=u.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let l=e.domAtPos(o.start(-1)).node;for(;l&&"TABLE"!=l.nodeName;)l=l.parentNode;l&&q(i,l.firstChild,l,r,a,n)}(e,r.activeHandle,o,n)}}e.dispatch(e.state.tr.setMeta(G,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),t.preventDefault()}(e,n,t)}},decorations:e=>{const t=G.getState(e);if(t&&t.activeHandle>-1)return function(e,t){const n=[],r=e.doc.resolve(t),o=r.node(-1);if(!o)return a.zF.empty;const i=u.get(o),s=r.start(-1),l=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let e=0;e<i.height;e++){const t=l+e*i.width-1;if(!(l!=i.width&&i.map[t]==i.map[t+1]||0!=e&&i.map[t-1]==i.map[t-1-i.width])){const e=i.map[t],r=s+e+o.nodeAt(e).nodeSize-1,l=document.createElement("div");l.className="column-resize-handle",n.push(a.NZ.widget(r,l))}}return a.zF.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return o}var Y=class{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,n=e.getMeta(G);if(n&&null!=n.setHandle)return new Y(n.setHandle,!1);if(n&&void 0!==n.setDragging)return new Y(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){let n=e.mapping.map(t.activeHandle,-1);return w(e.doc.resolve(n))||(n=-1),new Y(n,t.dragging)}return t}};function Z(e,t,n){const r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;const{pos:o}=r,i=y(e.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;const s=u.get(i.node(-1)),a=i.start(-1),l=s.map.indexOf(i.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function X(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Q(e,t){e.dispatch(e.state.tr.setMeta(G,{setHandle:t}))}function ee(e){const t=e.selection,n=k(e),r=n.node(-1),o=n.start(-1),i=u.get(r);return{...t instanceof C?i.rectBetween(t.$anchorCell.pos-o,t.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function te(e,{map:t,tableStart:n,table:r},o){let i=o>0?-1:0;(function(e,t,n){const r=m(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(t,r,o+i)&&(i=0==o||o==t.width?null:0);for(let s=0;s<t.height;s++){const a=s*t.width+o;if(o>0&&o<t.width&&t.map[a-1]==t.map[a]){const i=t.map[a],l=r.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,E(l.attrs,o-t.colCount(i))),s+=l.attrs.rowspan-1}else{const l=null==i?m(r.type.schema).cell:r.nodeAt(t.map[a+i]).type,c=t.positionAt(s,o,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function ne(e,t){if(!b(e))return!1;if(t){const n=ee(e);t(te(e.tr,n,n.left))}return!0}function re(e,t){if(!b(e))return!1;if(t){const n=ee(e);t(te(e.tr,n,n.right))}return!0}function oe(e,{map:t,table:n,tableStart:r},o){const i=e.mapping.maps.length;for(let s=0;s<t.height;){const a=s*t.width+o,l=t.map[a],c=n.nodeAt(l),u=c.attrs;if(o>0&&t.map[a-1]==l||o<t.width-1&&t.map[a+1]==l)e.setNodeMarkup(e.mapping.slice(i).map(r+l),null,S(u,o-t.colCount(l)));else{const t=e.mapping.slice(i).map(r+l);e.delete(t,t+c.nodeSize)}s+=u.rowspan}}function ie(e,t){if(!b(e))return!1;if(t){const n=ee(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;oe(r,n,e),e!=n.left;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=u.get(e)}t(r)}return!0}function se(e,{map:t,table:n,tableStart:r},o){let i=0;for(let e=0;e<o;e++)i+=n.child(e).nodeSize;const s=i+n.child(o).nodeSize,a=e.mapping.maps.length;e.delete(i+r,s+r);for(let i=0,s=o*t.width;i<t.width;i++,s++){const l=t.map[s];if(o>0&&l==t.map[s-t.width]){const t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(a).map(l+r),null,{...t,rowspan:t.rowspan-1}),i+=t.colspan-1}else if(o<t.width&&l==t.map[s+t.width]){const s=n.nodeAt(l),c=s.attrs,u=s.type.create({...c,rowspan:s.attrs.rowspan-1},s.content),d=t.positionAt(o+1,i,n);e.insert(e.mapping.slice(a).map(r+d),u),i+=c.colspan-1}}}function ae(e,t){if(!b(e))return!1;if(t){const n=ee(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;se(r,n,e),e!=n.top;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=u.get(n.table)}t(r)}return!0}function le(e,t){return function(n,r){if(!b(n))return!1;const o=k(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){const i=n.tr;n.selection instanceof C?n.selection.forEachCell(((n,r)=>{n.attrs[e]!==t&&i.setNodeMarkup(r,null,{...n.attrs,[e]:t})})):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[e]:t}),r(i)}return!0}}function ce(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<r.length;e++){const o=t.table.nodeAt(r[e]);if(o&&o.type!==n.header_cell)return!1}return!0}function ue(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!b(t))return!1;if(n){const r=m(t.schema),o=ee(t),i=t.tr,s=o.map.cellsInRect("column"==e?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==e?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map((e=>o.table.nodeAt(e)));for(let e=0;e<s.length;e++)a[e].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[e],r.cell,a[e].attrs);if(0==i.steps.length)for(let e=0;e<s.length;e++)i.setNodeMarkup(o.tableStart+s[e],r.header_cell,a[e].attrs);n(i)}return!0}}(e):function(t,n){if(!b(t))return!1;if(n){const r=m(t.schema),o=ee(t),i=t.tr,s=ce("row",o,r),a=ce("column",o,r),l=("column"===e?s:"row"===e&&a)?1:0,c="column"==e?{left:0,top:l,right:1,bottom:o.map.height}:"row"==e?{left:l,top:0,right:o.map.width,bottom:1}:o,u="column"==e?a?r.cell:r.header_cell:"row"==e?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach((e=>{const t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,u,n.attrs)})),n(i)}return!0}}function de(e){return function(t,n){if(!b(t))return!1;const r=function(e,t){if(t<0){const t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){const r=e.node(-1).child(t),o=r.lastChild;if(o)return n-1-o.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){const e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}(k(t),e);if(null==r)return!1;if(n){const e=t.doc.resolve(r);n(t.tr.setSelection(i.U3.between(e,(o=e,o.node(0).resolve(o.pos+o.nodeAfter.nodeSize)))).scrollIntoView())}var o;return!0}}function pe(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function he({allowTableNodeSelection:e=!1}={}){return new i.k_({key:g,state:{init:()=>null,apply(e,t){const n=e.getMeta(g);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;const{deleted:r,pos:o}=e.mapping.mapResult(t);return r?null:o}},props:{decorations:N,handleDOMEvents:{mousedown:U},createSelectionBetween:e=>null!=g.getState(e.state)?e.state.selection:null,handleTripleClick:$,handleKeyDown:L,handlePaste:j},appendTransaction:(t,n,r)=>function(e,t,n){const r=(t||e).selection,o=(t||e).doc;let s,a;if(r instanceof i.nh&&(a=r.node.type.spec.tableRole)){if("cell"==a||"header_cell"==a)s=C.create(o,r.from);else if("row"==a){const e=o.resolve(r.from+1);s=C.rowSelection(e,e)}else if(!n){const e=u.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];s=C.create(o,t+1,n)}}else r instanceof i.U3&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<e.pos-6)return!1;let n=e.pos,r=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(o).type.spec.tableRole)}(r)?s=i.U3.create(o,r.from):r instanceof i.U3&&function({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){const r=e.node(t);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;break}}for(let e=t.depth;e>0;e--){const n=t.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){r=n;break}}return n!==r&&0===t.parentOffset}(r)&&(s=i.U3.create(o,r.$from.start(),r.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}(r,M(r,n),e)})}ue("row",{useDeprecatedLogic:!0}),ue("column",{useDeprecatedLogic:!0}),ue("cell",{useDeprecatedLogic:!0})},5536:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(12559);function o(e,t,n){return n((0,r.A)(e,t))}},8653:(e,t,n)=>{"use strict";n.d(t,{F_:()=>p,Ob:()=>u});var r=n(67488),o=n(27647),i=n(81570),s=n(30072),a=Object.defineProperty,l=(e,t,n)=>(((e,t,n)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class c{constructor(){l(this,"beforeMountedListeners",[]),l(this,"mountedListeners",[]),l(this,"updatedListeners",[]),l(this,"markdownUpdatedListeners",[]),l(this,"blurListeners",[]),l(this,"focusListeners",[]),l(this,"destroyListeners",[]),l(this,"beforeMount",(e=>(this.beforeMountedListeners.push(e),this))),l(this,"mounted",(e=>(this.mountedListeners.push(e),this))),l(this,"updated",(e=>(this.updatedListeners.push(e),this)))}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}}const u=(0,r.Z0)(new c,"listener"),d=new i.hs("MILKDOWN_LISTENER"),p=e=>(e.inject(u,new c),async()=>{await e.wait(o.ge);const t=e.get(u),{listeners:n}=t;n.beforeMount.forEach((t=>t(e))),await e.wait(o.g3);const r=e.get(o.M);let a=null,l=null;const c=new i.k_({key:d,view:()=>({destroy:()=>{n.destroy.forEach((t=>t(e)))}}),props:{handleDOMEvents:{focus:()=>(n.focus.forEach((t=>t(e))),!1),blur:()=>(n.blur.forEach((t=>t(e))),!1)}},state:{init:()=>{},apply:t=>t.docChanged&&!1!==t.getMeta("addToHistory")?s((()=>{const{doc:o}=t;if(n.updated.length>0&&(null==a||!a.eq(o))&&n.updated.forEach((t=>{t(e,o,a)})),n.markdownUpdated.length>0&&(null==a||!a.eq(o))){const t=r(o);n.markdownUpdated.forEach((n=>{n(e,t,l)})),l=t}a=o}),200)():void 0}});e.update(o.TP,(e=>e.concat(c))),await e.wait(o.CU),n.mounted.forEach((t=>t(e)))});p.meta={package:"@milkdown/plugin-listener",displayName:"Listener"}},9760:(e,t,n)=>{"use strict";n.d(t,{E:()=>s});var r=n(27647);function o(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=o(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}const i=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=o(e))&&(r&&(r+=" "),r+=t);return r},s=e=>{e.update(r.QM,(e=>{const t=e.attributes;return{...e,attributes:e=>{const n="function"==typeof t?t(e):t;return{...n,class:i("prose dark:prose-invert outline-none",(null==n?void 0:n.class)||"","milkdown-theme-nord")}}}}))}},10660:(e,t,n)=>{"use strict";n.d(t,{y:()=>i});var r=n(43890);const o={}.hasOwnProperty;function i(e){const t={};let n=-1;for(;++n<e.length;)s(t,e[n]);return t}function s(e,t){let n;for(n in t){const r=(o.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;for(s in i){o.call(r,s)||(r[s]=[]);const e=i[s];a(r[s],Array.isArray(e)?e:e?[e]:[])}}}function a(e,t){let n=-1;const o=[];for(;++n<t.length;)("after"===t[n].add?e:o).push(t[n]);(0,r.m)(e,0,0,o)}},11329:(e,t,n)=>{"use strict";n.d(t,{$L:()=>N,Ln:()=>y,Um:()=>A,Wg:()=>b,X9:()=>l,XE:()=>h,dL:()=>$,jP:()=>v,n9:()=>C,oM:()=>x,zy:()=>E});var r=n(16090);const o=Math.pow(2,16);function i(e){return 65535&e}class s{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class a{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&a.empty)return a.empty}recover(e){let t=0,n=i(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/o}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let u=this.ranges[l+i],d=this.ranges[l+a],p=c+u;if(e<=p){let i=c+r+((u?e==c?-1:e==p?1:t:t)<0?0:d);if(n)return i;let a=e==c?2:e==p?1:4;return(t<0?e!=c:e!=p)&&(a|=8),new s(i,a,e==(t<0?c:p)?null:l/3+(e-c)*o)}r+=d-u}return n?e+r:new s(e+r,0,null)}touches(e,t){let n=0,r=i(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let i=this.ranges[t]-(this.inverted?n:0);if(i>e)break;let a=this.ranges[t+o];if(e<=i+a&&t==3*r)return!0;n+=this.ranges[t+s]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new a(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?a.empty:new a(e<0?[0,-e,0]:[0,0,e])}}a.empty=new a([]);class l{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new l(this.maps,this.mirror,e,t)}copy(){return new l(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r: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,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new l;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new s(e,r,null)}}const c=Object.create(null);class u{getMap(){return a.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=c[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.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 d{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new d(e,null)}static fail(e){return new d(null,e)}static fromReplace(e,t,n,o){try{return d.ok(e.replace(t,n,o))}catch(e){if(e instanceof r.vI)return d.fail(e.message);throw e}}}function p(e,t,n){let o=[];for(let r=0;r<e.childCount;r++){let i=e.child(r);i.content.size&&(i=i.copy(p(i.content,t,i))),i.isInline&&(i=t(i,n,r)),o.push(i)}return r.FK.fromArray(o)}class h extends u{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),o=n.node(n.sharedDepth(this.to)),i=new r.Ji(p(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),o),t.openStart,t.openEnd);return d.fromReplace(e,this.from,this.to,i)}invert(){return new f(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new h(t.pos,n.pos,this.mark)}merge(e){return e instanceof h&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new h(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("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new h(t.from,t.to,e.markFromJSON(t.mark))}}u.jsonID("addMark",h);class f extends u{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new r.Ji(p(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return d.fromReplace(e,this.from,this.to,n)}invert(){return new h(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new f(t.pos,n.pos,this.mark)}merge(e){return e instanceof f&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new f(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("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new f(t.from,t.to,e.markFromJSON(t.mark))}}u.jsonID("removeMark",f);class m extends u{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new m(this.pos,t.marks[n]);return new m(this.pos,this.mark)}}return new g(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new m(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new m(t.pos,e.markFromJSON(t.mark))}}u.jsonID("addNodeMark",m);class g extends u{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new m(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new g(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new g(t.pos,e.markFromJSON(t.mark))}}u.jsonID("removeNodeMark",g);class y extends u{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&k(e,this.from,this.to)?d.fail("Structure replace would overwrite content"):d.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new a([this.from,this.to-this.from,this.slice.size])}invert(e){return new y(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new y(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof y)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new y(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new y(this.from,this.to+(e.to-e.from),t,this.structure)}}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("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new y(t.from,t.to,r.Ji.fromJSON(e,t.slice),!!t.structure)}}u.jsonID("replace",y);class b extends u{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(k(e,this.from,this.gapFrom)||k(e,this.gapTo,this.to)))return d.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return d.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?d.fromReplace(e,this.from,this.to,n):d.fail("Content does not fit in gap")}getMap(){return new a([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 b(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),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new b(t.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new b(t.from,t.to,t.gapFrom,t.gapTo,r.Ji.fromJSON(e,t.slice),t.insert,!!t.structure)}}function k(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function w(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function v(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!w(r,o,i))break}return null}function x(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<o;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return i?o.map(S).concat({type:t,attrs:n}).concat(i.map(S)):null}function S(e){return{type:e,attrs:null}}function E(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function C(e,t){let n=e.resolve(t),r=n.index();return o=n.nodeBefore,i=n.nodeAfter,!(!o||!i||o.isLeaf||!o.canAppend(i))&&n.parent.canReplace(r,r+1);var o,i}function A(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,i=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(i,i,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function N(e,t,n=t,o=r.Ji.empty){if(t==n&&!o.size)return null;let i=e.resolve(t),s=e.resolve(n);return O(i,s,o)?new y(t,n,o):new T(i,s,o).fit()}function O(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}u.jsonID("replaceAround",b);class T{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.FK.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=r.FK.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(e<0?this.$to:n.doc.resolve(e));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&1==i.childCount;)i=i.firstChild.content,s--,a--;let l=new r.Ji(i,s,a);return e>-1?new b(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new y(n.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,o=null;n?(o=I(this.unplaced.content,n-1).firstChild,e=o.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let s,{type:a,match:l}=this.frontier[e],c=null;if(1==t&&(i?l.matchType(i.type)||(c=l.fillBefore(r.FK.from(i),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:n,frontierDepth:e,parent:o,inject:c};if(2==t&&i&&(s=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:o,wrap:s};if(o&&l.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,o=I(e,t);return!(!o.childCount||o.firstChild.isLeaf||(this.unplaced=new r.Ji(e,t+1,Math.max(n,o.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,o=I(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new r.Ji(M(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new r.Ji(M(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let s=this.unplaced,a=n?n.content:s.content,l=s.openStart-e,c=0,u=[],{match:d,type:p}=this.frontier[t];if(o){for(let e=0;e<o.childCount;e++)u.push(o.child(e));d=d.matchFragment(o)}let h=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let e=a.child(c),t=d.matchType(e.type);if(!t)break;c++,(c>1||0==l||e.content.size)&&(d=t,u.push(R(e.mark(p.allowedMarks(e.marks)),1==c?l:0,c==a.childCount?h:-1)))}let f=c==a.childCount;f||(h=-1),this.placed=D(this.placed,t,r.FK.from(u)),this.frontier[t].match=d,f&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=a;e<h;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=f?0==e?r.Ji.empty:new r.Ji(M(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new r.Ji(M(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!F(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=F(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=F(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=D(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=D(this.placed,this.depth,r.FK.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.FK.empty,!0);e.childCount&&(this.placed=D(this.placed,this.frontier.length,e))}}function M(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(M(e.firstChild.content,t-1,n)))}function D(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(D(e.lastChild.content,t-1,n)))}function I(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function R(e,t,n){if(t<=0)return e;let o=e.content;return t>1&&(o=o.replaceChild(0,R(o.firstChild,t-1,1==o.childCount?n-1:0))),t>0&&(o=e.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.FK.empty,!0)))),e.copy(o)}function F(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function L(e){return e.spec.defining||e.spec.definingForContent}function P(e,t,n,o,i){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(P(r.content,t+1,n,o,r)))}if(t>o){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.FK.empty,!0))}return e}function B(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}class _ extends u{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let o=t.type.create(n,null,t.marks);return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(o),0,t.isLeaf?0:1))}getMap(){return a.empty}invert(e){return new _(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 _(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new _(t.pos,t.attr,t.value)}}u.jsonID("attr",_);let z=class extends Error{};z=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(z.prototype=Object.create(Error.prototype)).constructor=z,z.prototype.name="TransformError";class ${constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new l}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new z(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,n=r.Ji.empty){let o=N(this.doc,e,t,n);return o&&this.step(o),this}replaceWith(e,t,n){return this.replace(e,t,new r.Ji(r.FK.from(n),0,0))}delete(e,t){return this.replace(e,t,r.Ji.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,o){if(!o.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),s=e.doc.resolve(n);if(O(i,s,o))return e.step(new y(t,n,o));let a=B(i,e.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(i.depth+1);a.unshift(l);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(e)>-1?l=e:i.before(e)==t&&a.splice(1,0,-e)}let c=a.indexOf(l),u=[],d=o.openStart;for(let e=o.content,t=0;;t++){let n=e.firstChild;if(u.push(n),t==o.openStart)break;e=n.content}for(let e=d-1;e>=0;e--){let t=u[e].type,n=L(t);if(n&&i.node(c).type!=t)d=e;else if(n||!t.isTextblock)break}for(let t=o.openStart;t>=0;t--){let l=(t+d+1)%(o.openStart+1),p=u[l];if(p)for(let t=0;t<a.length;t++){let u=a[(t+c)%a.length],d=!0;u<0&&(d=!1,u=-u);let h=i.node(u-1),f=i.index(u-1);if(h.canReplaceWith(f,f,p.type,p.marks))return e.replace(i.before(u),d?s.after(u):n,new r.Ji(P(o.content,0,o.openStart,l),l,o.openEnd))}}let p=e.steps.length;for(let r=a.length-1;r>=0&&(e.replace(t,n,o),!(e.steps.length>p));r--){let e=a[r];e<0||(t=i.before(e),n=s.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,o){if(!o.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,o.type);null!=r&&(t=n=r)}e.replaceRange(t,n,new r.Ji(r.FK.from(o),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=B(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:o,$to:i,depth:s}=t,a=o.before(s+1),l=i.after(s+1),c=a,u=l,d=r.FK.empty,p=0;for(let e=s,t=!1;e>n;e--)t||o.index(e)>0?(t=!0,d=r.FK.from(o.node(e).copy(d)),p++):c--;let h=r.FK.empty,f=0;for(let e=s,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,h=r.FK.from(i.node(e).copy(h)),f++):u++;e.step(new b(c,u,a,l,new r.Ji(d.append(h),p,f),d.size-p,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let o=new y(t-n,t+n,r.Ji.empty,!0);e.step(o)}(this,e,t),this}wrap(e,t){return function(e,t,n){let o=r.FK.empty;for(let e=n.length-1;e>=0;e--){if(o.size){let t=n[e].type.contentMatch.matchFragment(o);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=r.FK.from(n[e].type.create(n[e].attrs,o))}let i=t.start,s=t.end;e.step(new b(i,s,i,s,new r.Ji(o,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,o=null){return function(e,t,n,o,i){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(o,i)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(s).map(n),o)){e.clearIncompatible(e.mapping.slice(s).map(n,1),o);let a=e.mapping.slice(s),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new b(l,c,l+1,c-1,new r.Ji(r.FK.from(o.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,o),this}setNodeMarkup(e,t,n=null,o){return function(e,t,n,o,i){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(o,null,i||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new b(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new r.Ji(r.FK.from(a),0,0),1,!0))}(this,e,t,n,o),this}setNodeAttribute(e,t,n){return this.step(new _(e,t,n)),this}addNodeMark(e,t){return this.step(new m(e,t)),this}removeNodeMark(e,t){if(!(t instanceof r.CU)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new g(e,t)),this}split(e,t=1,n){return function(e,t,n=1,o){let i=e.doc.resolve(t),s=r.FK.empty,a=r.FK.empty;for(let e=i.depth,t=i.depth-n,l=n-1;e>t;e--,l--){s=r.FK.from(i.node(e).copy(s));let t=o&&o[l];a=r.FK.from(t?t.type.create(t.attrs,a):i.node(e).copy(a))}e.step(new y(t,t,new r.Ji(s.append(a),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(p)||(o&&o.to==c&&o.mark.eq(u[e])?o.to=d:s.push(o=new f(c,d,u[e])));i&&i.to==c?i.to=d:a.push(i=new h(c,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,o){let i=[],s=0;e.doc.nodesBetween(t,n,((e,a)=>{if(!e.isInline)return;s++;let l=null;if(o instanceof r.sX){let t,n=e.marks;for(;t=o.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else o?o.isInSet(e.marks)&&(l=[o]):l=e.marks;if(l&&l.length){let r=Math.min(a+e.nodeSize,n);for(let e=0;e<l.length;e++){let n,o=l[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==s-1&&o.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=s):i.push({style:o,from:Math.max(a,t),to:r,step:s})}}})),i.forEach((t=>e.step(new f(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,o=n.contentMatch){let i=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<i.childCount;t++){let l=i.child(t),c=a+l.nodeSize,u=o.matchType(l.type);if(u){o=u;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new f(a,c,l.marks[t]))}else s.push(new y(a,c,r.Ji.empty));a=c}if(!o.validEnd){let t=o.fillBefore(r.FK.empty,!0);e.replace(a,a,new r.Ji(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}(this,e,t,n),this}}},15186:(e,t,n)=>{"use strict";n.d(t,{C:()=>r});const r=function(e){if(null==e)return i;if("string"==typeof e)return t=e,o((function(e){return e&&e.type===t}));var t;if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=r(e[n]);return o((function(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}))}(e):function(e){return o((function(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}))}(e);if("function"==typeof e)return o(e);throw new Error("Expected function, string, or object as test")};function o(e){return function(t,...n){return Boolean(t&&"object"==typeof t&&"type"in t&&Boolean(e.call(this,t,...n)))}}function i(){return!0}},15939:(e,t,n)=>{"use strict";n.d(t,{K:()=>g,w:()=>m});for(var r={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:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),a="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),l=s||i&&+i[1]<57,c=0;c<10;c++)r[48+c]=r[96+c]=String(c);for(c=1;c<=24;c++)r[c+111]="F"+c;for(c=65;c<=90;c++)r[c]=String.fromCharCode(c+32),o[c]=String.fromCharCode(c);for(var u in r)o.hasOwnProperty(u)||(o[u]=r[u]);var d=n(81570);const p="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function h(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);p?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function f(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function m(e){return new d.k_({props:{handleKeyDown:g(e)}})}function g(e){let t=function(e){let t=Object.create(null);for(let n in e)t[h(n)]=e[n];return t}(e);return function(e,n){let i,s=function(e){var t=!(l&&(e.ctrlKey||e.altKey||e.metaKey)||a&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?o:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),c=t[f(s,n)];if(c&&c(e.state,e.dispatch,e))return!0;if(1==s.length&&" "!=s){if(n.shiftKey){let r=t[f(s,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||s.charCodeAt(0)>127)&&(i=r[n.keyCode])&&i!=s){let r=t[f(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}},16090:(e,t,n)=>{"use strict";function r(e){this.content=e}n.d(t,{S4:()=>Z,ZF:()=>ae,FK:()=>a,CU:()=>d,sX:()=>G,bP:()=>D,u$:()=>T,Z6:()=>K,vI:()=>p,Sj:()=>J,Ji:()=>h}),r.prototype={constructor:r,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var o=n&&n!=e?this.remove(n):this,i=o.find(e),s=o.content.slice();return-1==i?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new r(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var o=this.remove(t),i=o.content.slice(),s=o.find(e);return i.splice(-1==s?i.length:s,0,t,n),new r(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};const o=r;function i(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),s=t.child(r);if(o!=s){if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let e=0;o.text[e]==s.text[e];e++)n++;return n}if(o.content.size||s.content.size){let e=i(o.content,s.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function s(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let a=e.child(--o),l=t.child(--i),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let e=0,t=Math.min(a.text.length,l.text.length);for(;e<t&&a.text[a.text.length-e-1]==l.text[l.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let e=s(a.content,l.content,n-1,r-1);if(e)return e}n-=c,r-=c}else n-=c,r-=c}}class a{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let a=this.content[i],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,r+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(e,a)-a,t-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new a(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let s=this.content[o],a=i+s.nodeSize;a>e&&((i<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=a}return new a(n,r)}cutByIndex(e,t){return e==t?a.empty:0==e&&t==this.content.length?this:new a(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new a(r,o)}addToStart(e){return new a([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new a(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,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return i(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return s(this,e,t,n)}findIndex(e,t=-1){if(0==e)return c(0,e);if(e==this.size)return c(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?c(n+1,o):c(n,r);r=o}}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 a.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new a(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return a.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new a(t||e,n)}static from(e){if(!e)return a.empty;if(e instanceof a)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new a([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}a.empty=new a([],0);const l={index:0,offset:0};function c(e,t){return l.index=e,l.offset=t,l}function u(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!u(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!u(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class d{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||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&&u(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 n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return d.none;if(e instanceof d)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}d.none=[];class p extends Error{}class h{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=m(this.content,e+this.openStart,t);return n&&new h(n,this.openStart,this.openEnd)}removeBetween(e,t){return new h(f(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 h.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new h(a.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new h(e,n,r)}}function f(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(f(i.content,t-o-1,n-o-1)))}function m(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=m(s.content,t-i-1,n);return a&&e.replaceChild(o,s.copy(a))}function g(e,t,n){if(n.openStart>e.depth)throw new p("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new p("Inconsistent open depths");return y(e,t,n,0)}function y(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=y(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(a.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return x(i,S(e,o,s,t,r))}{let r=e.parent,o=r.content;return x(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return x(i,E(e,t,r))}function b(e,t){if(!t.type.compatibleContent(e.type))throw new p("Cannot join "+t.type.name+" onto "+e.type.name)}function k(e,t,n){let r=e.node(n);return b(r,t.node(n)),r}function w(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function v(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(w(e.nodeAfter,r),i++));for(let e=i;e<s;e++)w(o.child(e),r);t&&t.depth==n&&t.textOffset&&w(t.nodeBefore,r)}function x(e,t){return e.type.checkContent(t),e.copy(t)}function S(e,t,n,r,o){let i=e.depth>o&&k(e,t,o+1),s=r.depth>o&&k(n,r,o+1),l=[];return v(null,e,o,l),i&&s&&t.index(o)==n.index(o)?(b(i,s),w(x(i,S(e,t,n,r,o+1)),l)):(i&&w(x(i,E(e,t,o+1)),l),v(t,n,o,l),s&&w(x(s,E(n,r,o+1)),l)),v(r,null,o,l),new a(l)}function E(e,t,n){let r=[];return v(null,e,n,r),e.depth>n&&w(x(k(e,t,n+1),E(e,t,n+1)),r),v(t,null,n,r),new a(r)}h.empty=new h(a.empty,0,0);class C{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?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[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].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 n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}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):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return d.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(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 n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new T(this,e,n);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 n=[],r=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s)break;if(t=t.child(e),t.isText)break;o=s-1,r+=i+1}return new C(t,n,o)}static resolveCached(e,t){for(let n=0;n<A.length;n++){let r=A[n];if(r.pos==t&&r.doc==e)return r}let n=A[N]=C.resolve(e,t);return N=(N+1)%O,n}}let A=[],N=0,O=12;class T{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const M=Object.create(null);class D{constructor(e,t,n,r=d.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||a.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,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,n,r){return this.content.textBetween(e,t,n,r)}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,n){return this.type==e&&u(this.attrs,t||e.defaultAttrs||M)&&d.sameSet(this.marks,n||d.none)}copy(e=null){return e==this.content?this:new D(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new D(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return h.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new h(a,r.depth-i,o.depth-i)}replace(e,t,n){return g(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return C.resolveCached(this,e)}resolveNoCache(e){return C.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),R(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,n=a.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=d.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!d.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.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((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=a.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}D.prototype.text=void 0;class I extends D{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):R(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 I(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new I(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&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 R(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class F{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new L(e,t);if(null==n.next)return F.empty;let r=P(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);U(e,n).forEach((e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new F(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(j);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}(U(e,0))}(function(e){let t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(e(n,i))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(i,s),o(e(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(e(t.expr,i),s),o(e(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(i)].concat(e(t.expr,i));if("range"==t.type){let s=i;for(let r=0;r<t.min;r++){let r=n();o(e(t.expr,s),r),s=r}if(-1==t.max)o(e(t.expr,s),s);else for(let i=t.min;i<t.max;i++){let i=n();r(s,i),o(e(t.expr,s),i),s=i}return[r(s)]}if("name"==t.type)return[r(i,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=e(t.exprs[r],i);if(r==t.exprs.length-1)return s;o(s,i=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((e=>e.to=t))}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&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 n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let l=i.matchFragment(e,n);if(l&&(!t||l.validEnd))return a.from(s.map((e=>e.createAndFill())));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.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=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}F.empty=new F(!0);class L{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 P(e){let t=[];do{t.push(B(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function B(e){let t=[];do{t.push(_(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function _(e){let t=function(e){if(e.eat("(")){let t=P(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&o.push(r)}return 0==o.length&&e.err("No node type or group '"+t+"' found"),o}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=$(e,t)}return t}function z(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function $(e,t){let n=z(e),r=n;return e.eat(",")&&(r="}"!=e.next?z(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function j(e,t){return t-e}function U(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(j)}function H(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function V(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function W(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new q(e[n]);return t}class K{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=W(n.attrs),this.defaultAttrs=H(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==F.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:V(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new D(this,this.computeAttrs(e),a.from(t),d.setFrom(n))}createChecked(e=null,t,n){return t=a.from(t),this.checkContent(t),new D(this,this.computeAttrs(e),t,d.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=a.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(a.empty,!0);return o?new D(this,e,t.append(o),d.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:d.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new K(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class q{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class G{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=W(r.attrs),this.excluded=null;let o=H(this.attrs);this.instance=o?new d(this,o):null}create(e=null){return!e&&this.instance?this.instance:new d(this,V(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new G(e,r++,t,o))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class J{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=o.from(e.nodes),t.marks=o.from(e.marks||{}),this.nodes=K.compile(this.spec.nodes,this),this.marks=G.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",o=t.spec.marks;t.contentMatch=n[r]||(n[r]=F.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==o?null:o?Y(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Y(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof K))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new I(n,n.defaultAttrs,e,d.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return D.fromJSON(this,e)}markFromJSON(e){return d.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Y(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Z{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new re(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new re(this,t,!0);return n.addAll(e,t.from,t.to),h.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(oe(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ie(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ie(e)),e.node||e.ignore||e.mark||(e.node=t)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Z(e,Z.schemaRules(e)))}}const X={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},Q={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ee={ol:!0,ul:!0};function te(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class ne{constructor(e,t,n,r,o,i,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=d.none,this.stashMarks=[],this.match=i||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(a.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=a.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(a.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):se(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!X.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class re{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,o=t.topNode,i=te(null,t.preserveWhitespace,0)|(n?4:0);r=o?new ne(o.type,o.attrs,d.none,d.none,!0,t.topMatch||o.type.contentMatch,i):new ne(n?null:e.schema.topNodeType,null,d.none,d.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style");if(t){let n=this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t));if(!n)return;let[r,o]=n,i=this.top;for(let e=0;e<o.length;e++)this.removePendingMark(o[e],i);for(let e=0;e<r.length;e++)this.addPendingMark(r[e]);this.addElement(e);for(let e=0;e<r.length;e++)this.removePendingMark(r[e],i);for(let e=0;e<o.length;e++)this.addPendingMark(o[e])}else this.addElement(e)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],o=e.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();ee.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&ee.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:Q.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let t,n=this.top,i=this.needsBlock;if(X.hasOwnProperty(r))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=i}else this.addElementByRule(e,o,!1===o.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=d.none,n=d.none;for(let r=0;r<e.length;r+=2)for(let o;;){let i=this.parser.matchStyle(e[r],e[r+1],this,o);if(!i)break;if(i.ignore)return null;if(i.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach((e=>{i.clearMark(e)&&(n=e.addToSet(n))})):t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;o=i}return[t,n]}addElementByRule(e,t,n){let r,o,i;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):r=this.enter(o,t.attrs||null,t.preserveWhitespace)):(i=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(i));let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(e,t,n){let r=t||0;for(let o=t?e.childNodes[t]:e.firstChild,i=null==n?null:e.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let i=te(e,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new ne(e,t,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].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("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function oe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ie(e){let t={};for(let n in e)t[n]=e[n];return t}function se(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class ae{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=ce(t).createDocumentFragment());let r=n,o=[];return e.forEach((e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=ae.renderSpec(ce(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ae.renderSpec(ce(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,o=t[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?e.createElementNS(n,o):e.createElement(o),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let o=l;o<t.length;o++){let i=t[o];if(0===i){if(o<t.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=ae.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ae(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=le(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return le(e.marks)}}function le(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ce(e){return e.document||window.document}},16486:(e,t,n)=>{"use strict";n.d(t,{Se:()=>u,wu:()=>l});var r=n(27647),o=n(81570),i=n(73686),s=n(16512),a=n(1440);const l=(0,s.Qx)({uploader:async(e,t)=>{const n=[];for(let t=0;t<e.length;t++){const r=e.item(t);!r||!r.type.includes("image")||n.push(r)}const{image:r}=t.nodes;if(!r)throw(0,a.pj)("image");return(await Promise.all(n.map((e=>(e=>new Promise((t=>{const n=new FileReader;n.addEventListener("load",(()=>{t({alt:e.name,src:n.result})}),!1),n.readAsDataURL(e)})))(e))))).map((({alt:e,src:t})=>r.createAndFill({src:t,alt:e})))},enableHtmlFileUploader:!1,uploadWidgetFactory:(e,t)=>{const n=document.createElement("span");return n.textContent="Upload in progress...",i.NZ.widget(e,n,t)}},"uploadConfig");l.meta={package:"@milkdown/plugin-upload",displayName:"Ctx<uploadConfig>"};const c=(0,s.Gf)((e=>{const t=new o.hs("MILKDOWN_UPLOAD"),n=(n,o,i)=>{var s;if(!i||i.length<=0)return!1;const a=Symbol("upload symbol"),c=e.get(r.pZ),{tr:u}=n.state,d=o instanceof DragEvent?(null==(s=n.posAtCoords({left:o.clientX,top:o.clientY}))?void 0:s.pos)??u.selection.from:u.selection.from;n.dispatch(u.setMeta(t,{add:{id:a,pos:d}}));const{uploader:p}=e.get(l.key);return p(i,c).then((e=>{const r=((e,n)=>{var r;const o=t.getState(e);if(!o)return-1;const i=o.find(void 0,void 0,(e=>e.id===n));return i.length?(null==(r=i[0])?void 0:r.from)??-1:-1})(n.state,a);r<0||n.dispatch(n.state.tr.replaceWith(r,r,e).setMeta(t,{remove:{id:a}}))})).catch((e=>{console.error(e)})),!0};return new o.k_({key:t,state:{init:()=>i.zF.empty,apply(t,n){const r=n.map(t.mapping,t.doc),o=t.getMeta(this);if(!o)return r;if(o.add){const{uploadWidgetFactory:n}=e.get(l.key),i=n(o.add.pos,{id:o.add.id});return r.add(t.doc,[i])}if(o.remove){const e=r.find(void 0,void 0,(e=>e.id===o.remove.id));return r.remove(e)}return r}},props:{decorations(e){return this.getState(e)},handlePaste:(t,r)=>{var o,i;const{enableHtmlFileUploader:s}=e.get(l.key);return!(!(r instanceof ClipboardEvent)||!s&&(null==(o=r.clipboardData)?void 0:o.getData("text/html")))&&n(t,r,null==(i=r.clipboardData)?void 0:i.files)},handleDrop:(e,t)=>{var r;return t instanceof DragEvent&&n(e,t,null==(r=t.dataTransfer)?void 0:r.files)}}})}));c.meta={package:"@milkdown/plugin-upload",displayName:"Prose<upload>"};const u=[l,c]},16512:(e,t,n)=>{"use strict";n.d(t,{Fs:()=>C,Gf:()=>h,Ht:()=>m,JY:()=>x,KD:()=>S,Qx:()=>y,YR:()=>v,Yh:()=>b,b_:()=>d,dz:()=>p,hk:()=>k,lz:()=>f,m5:()=>g,pq:()=>w,yh:()=>E,yu:()=>u});var r=n(27647),o=n(67488),i=n(99742),s=n(1440),a=n(15939),l=n(16090),c=n(81570);(0,i.d_)("abcedfghicklmn",10);const u=(e,t)=>{const n=(0,r.qf)(e),o=i=>async()=>{o.key=n,await i.wait(r.x8);const s=t(i);return i.get(r.MD).create(n,s),o.run=t=>i.get(r.MD).call(e,t),()=>{i.get(r.MD).remove(n)}};return o},d=e=>{const t=n=>async()=>{await n.wait(r.x8);const o=e(n);return n.update(r.f4,(e=>[...e,o])),t.inputRule=o,()=>{n.update(r.f4,(e=>e.filter((e=>e!==o))))}};return t},p=(e,t)=>{let n;const o=i=>async()=>{const a=t(i);if(i.update(r.P_,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),o.id=e,o.schema=a,await i.wait(r.x8),n=i.get(r.pZ).nodes[e],!n)throw(0,s.pj)(e);return()=>{i.update(r.P_,(t=>t.filter((([t])=>t!==e))))}};return o.type=()=>n,o},h=e=>{let t;const n=n=>async()=>(await n.wait(r.x8),t=e(n),n.update(r.TP,(e=>[...e,t])),()=>{n.update(r.TP,(e=>e.filter((e=>e!==t))))});return n.plugin=()=>t,n.key=()=>t.spec.key,n},f=e=>{const t=n=>async()=>{await n.wait(r.ge);const o=e(n);return n.update(r.eM,(e=>[...e,o])),t.plugin=o,()=>{n.update(r.eM,(e=>e.filter((e=>e!==o))))}};return t},m=e=>{const t=n=>async()=>{await n.wait(r.x8);const o=e(n),i=(0,a.w)(o);return n.update(r.TP,(e=>[...e,i])),t.keymap=o,()=>{n.update(r.TP,(e=>e.filter((e=>e!==i))))}};return t},g=(e,t)=>{const n=o=>async()=>{await o.wait(r.x8);const i=t(o);return e.type()instanceof l.Z6?o.update(r.pe,(t=>[...t,[e.id,i]])):o.update(r.aD,(t=>[...t,[e.id,i]])),n.view=i,n.type=e,()=>{e.type()instanceof l.Z6?o.update(r.pe,(t=>t.filter((t=>t[0]!==e.id)))):o.update(r.aD,(t=>t.filter((t=>t[0]!==e.id))))}};return n},y=(e,t)=>{const n=(0,o.Z0)(e,t),r=e=>(e.inject(n),()=>()=>{e.remove(n)});return r.key=n,r},b=(e,t)=>{const n=y(t,e),o=p(e,(e=>e.get(n.key)(e))),i=[n,o];return i.id=o.id,i.node=o,i.type=o.type,i.schema=o.schema,i.ctx=n,i.key=n.key,i.extendSchema=t=>o=>()=>{const s=o.get(n.key),a=t(s)(o);o.update(r.P_,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),i.schema=a},i},k=(e,t)=>{const n=y(t,e),o=((e,t)=>{let n;const o=i=>async()=>{const a=t(i);if(i.update(r.u7,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),o.id=e,o.schema=a,await i.wait(r.x8),n=i.get(r.pZ).marks[e],!n)throw(0,s.sm)(e);return()=>{i.update(r.u7,(t=>t.filter((([t])=>t!==e))))}};return o.type=()=>n,o})(e,(e=>e.get(n.key)(e))),i=[n,o];return i.id=o.id,i.mark=o,i.type=o.type,i.schema=o.schema,i.ctx=n,i.key=n.key,i.extendSchema=t=>o=>()=>{const s=o.get(n.key),a=t(s)(o);o.update(r.u7,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),i.schema=a},i},w=(e,t)=>{const n=Object.fromEntries(Object.entries(t).map((([e,{shortcuts:t}])=>[e,t]))),r=y(n,`${e}Keymap`),o=m((e=>{const n=e.get(r.key),o=Object.entries(t).flatMap((([t,{command:r}])=>[n[t]].flat().map((t=>[t,r(e)]))));return Object.fromEntries(o)})),i=[r,o];return i.ctx=r,i.shortcuts=o,i.key=r.key,i.keymap=o.keymap,i},v=(e,t=()=>({}))=>y(t,`${e}Attr`),x=(e,t=()=>({}))=>y(t,`${e}Attr`);function S(e,t){return n=>n.get(r.MD).call(e,t)}const E=(e,t=!1)=>n=>{const o=n.get(r.kY),i=n.get(r.bQ)(e);if(!i)return;if(!t){const{state:e}=o;return o.dispatch(e.tr.replace(0,e.doc.content.size,new l.Ji(i.content,0,0)))}const s=n.get(r.pZ),a=n.get(r.Sr),u=n.get(r.TP),d=c.$t.create({schema:s,doc:i,plugins:u,...a});o.updateState(d)},C=(...e)=>{const t=e.length;let n=t;for(;n--;)if("function"!=typeof e[n])throw new TypeError("Expected a function");return(...n)=>{let r=0,o=t?e[r](...n):n[0];for(;++r<t;)o=e[r](o);return o}}},17884:(e,t,n)=>{"use strict";n.d(t,{CW:()=>r,lV:()=>s,cx:()=>l,JQ:()=>c,BM:()=>o,ok:()=>i,ol:()=>a,HP:()=>d,Ee:()=>u,On:()=>p,es:()=>f,Ny:()=>h});const r=m(/[A-Za-z]/),o=m(/\d/),i=m(/[\dA-Fa-f]/),s=m(/[\dA-Za-z]/),a=m(/[!-/:-@[-`{-~]/),l=m(/[#-'*+\--9=?A-Z^-~]/);function c(e){return null!==e&&(e<32||127===e)}function u(e){return null!==e&&(e<0||32===e)}function d(e){return null!==e&&e<-2}function p(e){return-2===e||-1===e||32===e}const h=m(/\s/),f=m(/[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/);function m(e){return function(t){return null!==t&&e.test(String.fromCharCode(t))}}},20062:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},23796:(e,t,n)=>{"use strict";function r(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}n.d(t,{W:()=>r})},24586:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(11369);function o(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},25715:(e,t,n)=>{"use strict";n.d(t,{Im:()=>g,RV:()=>E,wh:()=>b,y_:()=>y});var r=n(11329),o=n(16090),i=n(81570);const s=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function a(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function l(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function c(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function u(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var d;function p(e,t,n){let s,l,c=t.nodeBefore,u=t.nodeAfter;if(c.type.spec.isolating||u.type.spec.isolating)return!1;if(function(e,t,n){let o=t.nodeBefore,i=t.nodeAfter,s=t.index();return!(!(o&&i&&o.type.compatibleContent(i.type))||(!o.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(s,s+1)||!i.isTextblock&&!(0,r.n9)(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,o.type,o.contentMatchAt(o.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let d=t.parent.canReplace(t.index(),t.index()+1);if(d&&(s=(l=c.contentMatchAt(c.childCount)).findWrapping(u.type))&&l.matchType(s[0]||u.type).validEnd){if(n){let i=t.pos+u.nodeSize,a=o.FK.empty;for(let e=s.length-1;e>=0;e--)a=o.FK.from(s[e].create(null,a));a=o.FK.from(c.copy(a));let l=e.tr.step(new r.Wg(t.pos-1,i,t.pos,i,new o.Ji(a,1,0),s.length,!0)),d=i+2*s.length;(0,r.n9)(l.doc,d)&&l.join(d),n(l.scrollIntoView())}return!0}let p=i.LN.findFrom(t,1),h=p&&p.$from.blockRange(p.$to),f=h&&(0,r.jP)(h);if(null!=f&&f>=t.depth)return n&&n(e.tr.lift(h,f).scrollIntoView()),!0;if(d&&a(u,"start",!0)&&a(c,"end")){let i=c,s=[];for(;s.push(i),!i.isTextblock;)i=i.lastChild;let a=u,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(i.canReplace(i.childCount,i.childCount,a.content)){if(n){let i=o.FK.empty;for(let e=s.length-1;e>=0;e--)i=o.FK.from(s[e].copy(i));n(e.tr.step(new r.Wg(t.pos-s.length,t.pos+u.nodeSize,t.pos+l,t.pos+u.nodeSize-l,new o.Ji(i,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function h(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return!!o.node(s).isTextblock&&(n&&n(t.tr.setSelection(i.U3.create(t.doc,e<0?o.start(s):o.end(s)))),!0)}}const f=h(-1),m=h(1);function g(e,t=null){return function(n,o){let{$from:i,$to:s}=n.selection,a=i.blockRange(s),l=a&&(0,r.oM)(a,e,t);return!!l&&(o&&o(n.tr.wrap(a,l).scrollIntoView()),!0)}}function y(e,t=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,e,t)}r(o.scrollIntoView())}return!0}}function b(e,t=null){return function(n,r){let{empty:o,$cursor:i,ranges:s}=n.selection;if(o&&!i||!function(e,t,n){for(let r=0;r<t.length;r++){let{$from:o,$to:i}=t[r],s=0==o.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(o.pos,i.pos,(e=>{if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,e))return!1;if(r)if(i)e.isInSet(n.storedMarks||i.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let o=!1,i=n.tr;for(let t=0;!o&&t<s.length;t++){let{$from:r,$to:i}=s[t];o=n.doc.rangeHasMark(r.pos,i.pos,e)}for(let n=0;n<s.length;n++){let{$from:r,$to:a}=s[n];if(o)i.removeMark(r.pos,a.pos,e);else{let n=r.pos,o=a.pos,s=r.nodeAfter,l=a.nodeBefore,c=s&&s.isText?/^\s*/.exec(s.text)[0].length:0,u=l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+c<o&&(n+=c,o-=u),i.addMark(n,o,e.create(t))}}r(i.scrollIntoView())}return!0}}function k(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let w=k(s,((e,t,n)=>{let s=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!s)return!1;let c=l(s);if(!c){let n=s.blockRange(),o=n&&(0,r.jP)(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let u=c.nodeBefore;if(!u.type.spec.isolating&&p(e,c,t))return!0;if(0==s.parent.content.size&&(a(u,"end")||i.nh.isSelectable(u))){let n=(0,r.$L)(e.doc,s.before(),s.after(),o.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(a(u,"end")?i.LN.findFrom(r.doc.resolve(r.mapping.map(c.pos,-1)),-1):i.nh.create(r.doc,c.pos-u.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!u.isAtom||c.depth!=s.depth-1||(t&&t(e.tr.delete(c.pos-u.nodeSize,c.pos).scrollIntoView()),0))}),((e,t,n)=>{let{$head:r,empty:o}=e.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=l(r)}let a=s&&s.nodeBefore;return!(!a||!i.nh.isSelectable(a)||(t&&t(e.tr.setSelection(i.nh.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),0))})),v=k(s,((e,t,n)=>{let s=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}(e,n);if(!s)return!1;let l=c(s);if(!l)return!1;let u=l.nodeAfter;if(p(e,l,t))return!0;if(0==s.parent.content.size&&(a(u,"start")||i.nh.isSelectable(u))){let n=(0,r.$L)(e.doc,s.before(),s.after(),o.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(a(u,"start")?i.LN.findFrom(r.doc.resolve(r.mapping.map(l.pos)),1):i.nh.create(r.doc,r.mapping.map(l.pos))),t(r.scrollIntoView())}return!0}}return!(!u.isAtom||l.depth!=s.depth-1||(t&&t(e.tr.delete(l.pos,l.pos+u.nodeSize).scrollIntoView()),0))}),((e,t,n)=>{let{$head:r,empty:o}=e.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=c(r)}let a=s&&s.nodeAfter;return!(!a||!i.nh.isSelectable(a)||(t&&t(e.tr.setSelection(i.nh.create(e.doc,s.pos)).scrollIntoView()),0))}));const x={Enter:k(((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))}),((e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof i.i5||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=u(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=e.tr.insert(n,s.createAndFill());a.setSelection(i.U3.create(a.doc,n+1)),t(a.scrollIntoView())}return!0}),((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if((0,r.zy)(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let o=n.blockRange(),i=o&&(0,r.jP)(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)}),((e,t)=>{let{$from:n,$to:o}=e.selection;if(e.selection instanceof i.nh&&e.selection.node.isBlock)return!(!n.parentOffset||!(0,r.zy)(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(t){let s=o.parentOffset==o.parent.content.size,a=e.tr;(e.selection instanceof i.U3||e.selection instanceof i.i5)&&a.deleteSelection();let l=0==n.depth?null:u(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=d?[d]:s&&l?[{type:l}]:void 0,p=(0,r.zy)(a.doc,a.mapping.map(n.pos),1,c);if(c||p||!(0,r.zy)(a.doc,a.mapping.map(n.pos),1,l?[{type:l}]:void 0)||(l&&(c=[{type:l}]),p=!0),p&&(a.split(a.mapping.map(n.pos),1,c),!s&&!n.parentOffset&&n.parent.type!=l)){let e=a.mapping.map(n.before()),t=a.doc.resolve(e);l&&n.node(-1).canReplaceWith(t.index(),t.index()+1,l)&&a.setNodeMarkup(a.mapping.map(n.before()),l)}t(a.scrollIntoView())}return!0})),"Mod-Enter":(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),a=u(o.contentMatchAt(s));if(!a||!o.canReplaceWith(s,s,a))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,a.createAndFill());o.setSelection(i.LN.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},Backspace:w,"Mod-Backspace":w,"Shift-Backspace":w,Delete:v,"Mod-Delete":v,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new i.i5(e.doc))),!0)},S={"Ctrl-h":x.Backspace,"Alt-Backspace":x["Mod-Backspace"],"Ctrl-d":x.Delete,"Ctrl-Alt-Backspace":x["Mod-Delete"],"Alt-Delete":x["Mod-Delete"],"Alt-d":x["Mod-Delete"],"Ctrl-a":f,"Ctrl-e":m};for(let e in x)S[e]=x[e];const E=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&"darwin"==os.platform())?S:x},26243:(e,t,n)=>{"use strict";function r(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}n.d(t,{B:()=>r})},27647:(e,t,n)=>{"use strict";n.d(t,{KE:()=>fo,CU:()=>Lr,ge:()=>nr,x8:()=>hr,g3:()=>Er,MD:()=>qr,qf:()=>Kr,CI:()=>Or,Sr:()=>Mr,kY:()=>Pr,QM:()=>_r,f4:()=>ir,aD:()=>cr,u7:()=>yr,pe:()=>lr,P_:()=>gr,bQ:()=>vr,TP:()=>sr,eM:()=>ar,k:()=>zr,pZ:()=>mr,M:()=>Ar});var r={};n.r(r),n.d(r,{attentionMarkers:()=>Ee,contentInitial:()=>be,disable:()=>Ce,document:()=>ye,flow:()=>we,flowInitial:()=>ke,insideSpan:()=>Se,string:()=>ve,text:()=>xe});var o=n(67488),i=n(16090);const s={};function a(e,t){const n=t||s;return l(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function l(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return c(e.children,t,n)}return Array.isArray(e)?c(e,t,n):""}function c(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=l(e[o],t,n);return r.join("")}var u=n(10660),d=n(77508),p=n(17884);const h={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,(function(n){if(null!==n)return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),(0,d.N)(e,t,"linePrefix");e.consume(n)}),(function(t){return e.enter("paragraph"),r(t)}));let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):(0,p.HP)(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};var f=n(43890);const m={tokenize:function(e){const t=this,n=[];let r,o,i,s=0;return a;function a(r){if(s<n.length){const o=n[s];return t.containerState=o[1],e.attempt(o[0].continuation,l,c)(r)}return c(r)}function l(e){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}w(s);let a=n;for(;a<t.events.length;)t.events[a][1].end=Object.assign({},o),a++;return(0,f.m)(t.events,i+1,0,t.events.slice(n)),t.events.length=a,c(e)}return a(e)}function c(o){if(s===n.length){if(!r)return h(o);if(r.currentConstruct&&r.currentConstruct.concrete)return y(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(g,u,d)(o)}function u(e){return r&&v(),w(s),h(e)}function d(e){return t.parser.lazy[t.now().line]=s!==n.length,i=t.now().offset,y(e)}function h(n){return t.containerState={},e.attempt(g,m,y)(n)}function m(e){return s++,n.push([t.currentConstruct,t.containerState]),h(e)}function y(n){return null===n?(r&&v(),w(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:r}),b(n))}function b(n){return null===n?(k(e.exit("chunkFlow"),!0),w(0),void e.consume(n)):(0,p.HP)(n)?(e.consume(n),k(e.exit("chunkFlow")),s=0,t.interrupt=void 0,a):(e.consume(n),b)}function k(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(a),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,a,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){a=t.events[l][1].end;break}o=!0}for(w(s),e=n;e<t.events.length;)t.events[e][1].end=Object.assign({},a),e++;(0,f.m)(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function w(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},g={tokenize:function(e,t,n){return(0,d.N)(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};var y=n(35460);function b(e){const t={};let n,r,o,i,s,a,l,c=-1;for(;++c<e.length;){for(;c in t;)c=t[c];if(n=e[c],c&&"chunkFlow"===n[1].type&&"listItemPrefix"===e[c-1][1].type&&(a=n[1]._tokenizer.events,o=0,o<a.length&&"lineEndingBlank"===a[o][1].type&&(o+=2),o<a.length&&"content"===a[o][1].type))for(;++o<a.length&&"content"!==a[o][1].type;)"chunkText"===a[o][1].type&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,k(e,c)),c=t[c],l=!0);else if(n[1]._container){for(o=c,r=void 0;o--&&(i=e[o],"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type);)"enter"===i[0]&&(r&&(e[r][1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);r&&(n[1].end=Object.assign({},e[r][1].start),s=e.slice(r,c),s.unshift(n),(0,f.m)(e,r,c-r+1,s))}}return!l}function k(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,d,p=-1,h=n,m=0,g=0;const y=[g];for(;h;){for(;e[++o][1]!==h;);i.push(o),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<a.length;)"exit"===a[p][0]&&"enter"===a[p-1][0]&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(g=p+1,y.push(g),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):y.pop(),p=y.length;p--;){const t=a.slice(y[p],y[p+1]),n=i.pop();l.unshift([n,n+t.length-1]),(0,f.m)(e,n,2,t)}for(p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const w={tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):(0,p.HP)(t)?e.check(v,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}},resolve:function(e){return b(e),e}},v={tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),(0,d.N)(e,o,"linePrefix")};function o(o){if(null===o||(0,p.HP)(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}},partial:!0},x={tokenize:function(e){const t=this,n=e.attempt(y.B,(function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(r)}),e.attempt(this.parser.constructs.flowInitial,r,(0,d.N)(e,e.attempt(this.parser.constructs.flow,r,e.attempt(w,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}},S={resolveAll:N()},E=A("string"),C=A("text");function A(e){return{tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,s);return i;function i(e){return l(e)?o(e):s(e)}function s(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),a)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}},resolveAll:N("text"===e?O:void 0)}}function N(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function O(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,s=o.length,a=-1,l=0;for(;s--;){const e=o[s];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)l++,a--;if(a)break;a=-1}else if(-2===e)i=!0,l++;else if(-1!==e){s++;break}}if(l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-l,offset:r.end.offset-l,_index:r.start._index+s,_bufferIndex:s?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},o.start),r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}var T=n(23796);function M(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},i=[];let s=[],a=[],l=!0;const c={consume:function(e){(0,p.HP)(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,v()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e,l=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=g(),u.events.push(["enter",n,u]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=g(),u.events.push(["exit",t,u]),t},attempt:k((function(e,t){w(e,t.from)})),check:k(b),interrupt:k(b,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if("string"==typeof i)s=i;else switch(i){case-5:s="\r";break;case-4:s="\n";break;case-3:s="\r\n";break;case-2:s=t?" ":"\t";break;case-1:if(!t&&o)continue;s=" ";break;default:s=String.fromCharCode(i)}o=-2===i,r.push(s)}return r.join("")}(m(e),t)},now:g,defineSkip:function(e){o[e.line]=e.column,v()},write:function(e){return s=(0,f.V)(s,e),function(){let e;for(;r._index<s.length;){const t=s[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)y(t.charCodeAt(r._bufferIndex));else y(t)}}(),null!==s[s.length-1]?[]:(w(t,0),u.events=(0,T.W)(i,u.events,u),u.events)}};let d,h=t.tokenize.call(u,c);return t.resolveAll&&i.push(t),u;function m(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;return n===o?s=[e[n].slice(r,i)]:(s=e.slice(n,o),r>-1&&(s[0]=s[0].slice(r)),i>0&&s.push(e[o].slice(0,i))),s}(s,e)}function g(){return Object.assign({},r)}function y(e){l=void 0,d=e,h=h(e)}function b(e,t){t.restore()}function k(e,t){return function(n,o,i){let s,d,p,h;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return function(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return s=e,d=0,0===e.length?i:m(e[d])}function m(e){return function(n){return h=function(){const e=g(),t=u.previous,n=u.currentConstruct,o=u.events.length,i=Array.from(a);return{restore:function(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=o,a=i,v()},from:o}}(),p=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?b():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,y,b)(n)}}function y(t){return l=!0,e(p,h),o}function b(e){return l=!0,h.restore(),++d<s.length?m(s[d]):i}}}function w(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&(0,f.m)(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function v(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const D={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),s(i)):o>=3&&(null===i||(0,p.HP)(i))?(e.exit("thematicBreak"),t(i)):n(i)}function s(t){return t===r?(e.consume(t),o++,s):(e.exit("thematicBreakSequence"),(0,p.On)(t)?(0,d.N)(e,i,"whitespace")(t):i(t))}}},I={name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,s=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:(0,p.BM)(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(D,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return(0,p.BM)(t)&&++s<10?(e.consume(t),a):(!r.interrupt||s<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(y.B,r.interrupt?n:c,e.attempt(R,d,u))}function c(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function u(t){return(0,p.On)(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(y.B,(function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,(0,d.N)(e,t,"listItemIndent",r.containerState.size+1)(n)}),(function(n){return r.containerState.furtherBlankLines||!(0,p.On)(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(F,t,o)(n))}));function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,(0,d.N)(e,e.attempt(I,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)}},R={tokenize:function(e,t,n){const r=this;return(0,d.N)(e,(function(e){const o=r.events[r.events.length-1];return!(0,p.On)(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},F={tokenize:function(e,t,n){const r=this;return(0,d.N)(e,(function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0},L={name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return(0,p.On)(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){const r=this;return function(t){return(0,p.On)(t)?(0,d.N)(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(L,t,n)(r)}}},exit:function(e){e.exit("blockQuote")}};function P(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d):null===t||41===t||(0,p.JQ)(t)?n(t):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(n))}function h(t){return 62===t?(e.exit("chunkString"),e.exit(a),d(t)):null===t||60===t||(0,p.HP)(t)?n(t):(e.consume(t),92===t?f:h)}function f(t){return 60===t||62===t||92===t?(e.consume(t),h):h(t)}function m(o){return 40===o?++u>c?n(o):(e.consume(o),m):41===o?u--?(e.consume(o),m):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(o)):null===o||(0,p.Ee)(o)?u?n(o):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(o)):(0,p.JQ)(o)?n(o):(e.consume(o),92===o?g:m)}function g(t){return 40===t||41===t||92===t?(e.consume(t),m):m(t)}}function B(e,t,n,r,o,i){const s=this;let a,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),c};function c(d){return null===d||91===d||93===d&&!a||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs||l>999?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):(0,p.HP)(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||(0,p.HP)(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a=a||!(0,p.On)(t),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function _(e,t,n,r,o,i){let s;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),s=40===t?41:t,a};function a(n){return n===s?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===s?(e.exit(i),a(s)):null===t?n(t):(0,p.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),(0,d.N)(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===s||null===t||(0,p.HP)(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===s||92===t?(e.consume(t),c):c(t)}}function z(e,t){let n;return function r(o){return(0,p.HP)(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):(0,p.On)(o)?(0,d.N)(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}var $=n(26243);const j={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return B.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=(0,$.B)(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s):n(t)}function s(t){return(0,p.Ee)(t)?z(e,a)(t):a(t)}function a(t){return P(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(U,c,c)(t)}function c(t){return(0,p.On)(t)?(0,d.N)(e,u,"whitespace")(t):u(t)}function u(i){return null===i||(0,p.HP)(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},U={tokenize:function(e,t,n){return function(t){return(0,p.Ee)(t)?z(e,r)(t):n(t)};function r(t){return _(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return(0,p.On)(t)?(0,d.N)(e,i,"whitespace")(t):i(t)}function i(e){return null===e||(0,p.HP)(e)?t(e):n(e)}},partial:!0},H={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),(0,d.N)(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?a(t):(0,p.HP)(t)?e.attempt(V,i,a)(t):(e.enter("codeFlowValue"),s(t))}function s(t){return null===t||(0,p.HP)(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),s)}function a(n){return e.exit("codeIndented"),t(n)}}},V={tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):(0,p.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):(0,d.N)(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):(0,p.HP)(e)?o(e):n(e)}},partial:!0},W={name:"headingAtx",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||(0,p.Ee)(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),s(n)):null===n||(0,p.HP)(n)?(e.exit("atxHeading"),t(n)):(0,p.On)(n)?(0,d.N)(e,i,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function s(t){return 35===t?(e.consume(t),s):(e.exit("atxHeadingSequence"),i(t))}function a(t){return null===t||35===t||(0,p.Ee)(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),a)}},resolve:function(e,t){let n,r,o=e.length-2,i=3;return"whitespace"===e[i][1].type&&(i+=2),o-2>i&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4),o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},(0,f.m)(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e}},K={name:"setextUnderline",tokenize:function(e,t,n){const r=this;let o;return function(t){let s,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){s="paragraph"===r.events[a][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!s?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t))};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),(0,p.On)(t)?(0,d.N)(e,s,"lineSuffix")(t):s(t))}function s(r){return null===r||(0,p.HP)(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const s={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",s,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[o][1].end)):e[n][1]=s,e.push(["exit",s,t]),e}},q=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],G=["pre","script","style","textarea"],J={name:"htmlFlow",tokenize:function(e,t,n){const r=this;let o,i,s,a,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),i=!0,f):63===a?(e.consume(a),o=3,r.interrupt?t:L):(0,p.CW)(a)?(e.consume(a),s=String.fromCharCode(a),m):n(a)}function u(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,a=0,h):(0,p.CW)(i)?(e.consume(i),o=4,r.interrupt?t:L):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:L):n(o)}function h(o){return o==="CDATA[".charCodeAt(a++)?(e.consume(o),6===a?r.interrupt?t:N:h):n(o)}function f(t){return(0,p.CW)(t)?(e.consume(t),s=String.fromCharCode(t),m):n(t)}function m(a){if(null===a||47===a||62===a||(0,p.Ee)(a)){const l=47===a,c=s.toLowerCase();return l||i||!G.includes(c)?q.includes(s.toLowerCase())?(o=6,l?(e.consume(a),g):r.interrupt?t(a):N(a)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):i?y(a):b(a)):(o=1,r.interrupt?t(a):N(a))}return 45===a||(0,p.lV)(a)?(e.consume(a),s+=String.fromCharCode(a),m):n(a)}function g(o){return 62===o?(e.consume(o),r.interrupt?t:N):n(o)}function y(t){return(0,p.On)(t)?(e.consume(t),y):C(t)}function b(t){return 47===t?(e.consume(t),C):58===t||95===t||(0,p.CW)(t)?(e.consume(t),k):(0,p.On)(t)?(e.consume(t),b):C(t)}function k(t){return 45===t||46===t||58===t||95===t||(0,p.lV)(t)?(e.consume(t),k):w(t)}function w(t){return 61===t?(e.consume(t),v):(0,p.On)(t)?(e.consume(t),w):b(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,x):(0,p.On)(t)?(e.consume(t),v):S(t)}function x(t){return t===l?(e.consume(t),l=null,E):null===t||(0,p.HP)(t)?n(t):(e.consume(t),x)}function S(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||(0,p.Ee)(t)?w(t):(e.consume(t),S)}function E(e){return 47===e||62===e||(0,p.On)(e)?b(e):n(e)}function C(t){return 62===t?(e.consume(t),A):n(t)}function A(t){return null===t||(0,p.HP)(t)?N(t):(0,p.On)(t)?(e.consume(t),A):n(t)}function N(t){return 45===t&&2===o?(e.consume(t),D):60===t&&1===o?(e.consume(t),I):62===t&&4===o?(e.consume(t),P):63===t&&3===o?(e.consume(t),L):93===t&&5===o?(e.consume(t),F):!(0,p.HP)(t)||6!==o&&7!==o?null===t||(0,p.HP)(t)?(e.exit("htmlFlowData"),O(t)):(e.consume(t),N):(e.exit("htmlFlowData"),e.check(Y,B,O)(t))}function O(t){return e.check(Z,T,B)(t)}function T(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return null===t||(0,p.HP)(t)?O(t):(e.enter("htmlFlowData"),N(t))}function D(t){return 45===t?(e.consume(t),L):N(t)}function I(t){return 47===t?(e.consume(t),s="",R):N(t)}function R(t){if(62===t){const n=s.toLowerCase();return G.includes(n)?(e.consume(t),P):N(t)}return(0,p.CW)(t)&&s.length<8?(e.consume(t),s+=String.fromCharCode(t),R):N(t)}function F(t){return 93===t?(e.consume(t),L):N(t)}function L(t){return 62===t?(e.consume(t),P):45===t&&2===o?(e.consume(t),L):N(t)}function P(t){return null===t||(0,p.HP)(t)?(e.exit("htmlFlowData"),B(t)):(e.consume(t),P)}function B(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},concrete:!0},Y={tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(y.B,t,n)}},partial:!0},Z={tokenize:function(e,t,n){const r=this;return function(t){return(0,p.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},X={tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},Q={name:"codeFenced",tokenize:function(e,t,n){const r=this,o={tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s};function s(t){return e.enter("codeFencedFence"),(0,p.On)(t)?(0,d.N)(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=a?(e.exit("codeFencedFenceSequence"),(0,p.On)(t)?(0,d.N)(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||(0,p.HP)(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0};let i,s=0,a=0;return function(t){return function(t){const n=r.events[r.events.length-1];return s=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(a++,e.consume(t),l):a<3?n(t):(e.exit("codeFencedFenceSequence"),(0,p.On)(t)?(0,d.N)(e,c,"whitespace")(t):c(t))}function c(n){return null===n||(0,p.HP)(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(X,m,w)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||(0,p.HP)(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):(0,p.On)(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),(0,d.N)(e,h,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),u)}function h(t){return null===t||(0,p.HP)(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||(0,p.HP)(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===i?n(t):(e.consume(t),f)}function m(t){return e.attempt(o,w,g)(t)}function g(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),y}function y(t){return s>0&&(0,p.On)(t)?(0,d.N)(e,b,"linePrefix",s+1)(t):b(t)}function b(t){return null===t||(0,p.HP)(t)?e.check(X,m,w)(t):(e.enter("codeFlowValue"),k(t))}function k(t){return null===t||(0,p.HP)(t)?(e.exit("codeFlowValue"),b(t)):(e.consume(t),k)}function w(n){return e.exit("codeFenced"),t(n)}},concrete:!0};var ee=n(51157);const te={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=p.lV,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=p.ok,c):(e.enter("characterReferenceValue"),o=7,i=p.BM,c(t))}function c(a){if(59===a&&s){const o=e.exit("characterReferenceValue");return i!==p.lV||(0,ee.s)(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return i(a)&&s++<o?(e.consume(a),c):n(a)}}},ne={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return(0,p.ol)(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},re={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),(0,d.N)(e,t,"linePrefix")}}},oe={name:"labelEnd",tokenize:function(e,t,n){const r=this;let o,i,s=r.events.length;for(;s--;)if(("labelImage"===r.events[s][1].type||"labelLink"===r.events[s][1].type)&&!r.events[s][1]._balanced){o=r.events[s][1];break}return function(t){return o?o._inactive?u(t):(i=r.parser.defined.includes((0,$.B)(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(ie,c,i?c:u)(t):91===t?e.attempt(se,c,i?l:u)(t):i?c(t):u(t)}function l(t){return e.attempt(ae,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}},resolveTo:function(e,t){let n,r,o,i,s=e.length,a=0;for(;s--;)if(n=e[s][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[s][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[s][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=s,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(o=s);const l={type:"labelLink"===e[r][1].type?"link":"image",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[r][1].start),end:Object.assign({},e[o][1].end)},u={type:"labelText",start:Object.assign({},e[r+a+2][1].end),end:Object.assign({},e[o-2][1].start)};return i=[["enter",l,t],["enter",c,t]],i=(0,f.V)(i,e.slice(r+1,r+a+3)),i=(0,f.V)(i,[["enter",u,t]]),i=(0,f.V)(i,(0,T.W)(t.parser.constructs.insideSpan.null,e.slice(r+a+4,o-3),t)),i=(0,f.V)(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=(0,f.V)(i,e.slice(o+1)),i=(0,f.V)(i,[["exit",l,t]]),(0,f.m)(e,r,e.length,i),e},resolveAll:function(e){let t=-1;for(;++t<e.length;){const n=e[t][1];"labelImage"!==n.type&&"labelLink"!==n.type&&"labelEnd"!==n.type||(e.splice(t+1,"labelImage"===n.type?4:2),n.type="data",t++)}return e}},ie={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return(0,p.Ee)(t)?z(e,o)(t):o(t)}function o(t){return 41===t?c(t):P(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return(0,p.Ee)(t)?z(e,a)(t):c(t)}function s(e){return n(e)}function a(t){return 34===t||39===t||40===t?_(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return(0,p.Ee)(t)?z(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},se={tokenize:function(e,t,n){const r=this;return function(t){return B.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes((0,$.B)(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},ae={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},le={name:"labelStartImage",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:oe.resolveAll};var ce=n(66990);const ue={name:"attention",tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=(0,ce.S)(r);let i;return function(t){return i=t,e.enter("attentionSequence"),s(t)};function s(a){if(a===i)return e.consume(a),s;const l=e.exit("attentionSequence"),c=(0,ce.S)(a),u=!c||2===c&&o||n.includes(a),d=!o||2===o&&c||n.includes(r);return l._open=Boolean(42===i?u:u&&(o||!d)),l._close=Boolean(42===i?d:d&&(c||!u)),t(a)}},resolveAll:function(e,t){let n,r,o,i,s,a,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d=Object.assign({},e[n][1].end),p=Object.assign({},e[u][1].start);de(d,-a),de(p,a),i={type:a>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[n][1].end)},s={type:a>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[u][1].start),end:p},o={type:a>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[u][1].start)},r={type:a>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({},s.end)},e[n][1].end=Object.assign({},i.start),e[u][1].start=Object.assign({},s.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=(0,f.V)(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=(0,f.V)(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=(0,f.V)(l,(0,T.W)(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=(0,f.V)(l,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=(0,f.V)(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,(0,f.m)(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e}};function de(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const pe={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return(0,p.CW)(t)?(e.consume(t),i):l(t)}function i(e){return 43===e||45===e||46===e||(0,p.lV)(e)?(r=1,s(e)):l(e)}function s(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||(0,p.lV)(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||(0,p.JQ)(r)?n(r):(e.consume(r),a)}function l(t){return 64===t?(e.consume(t),c):(0,p.cx)(t)?(e.consume(t),l):n(t)}function c(e){return(0,p.lV)(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||(0,p.lV)(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}},he={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,s;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),x):63===t?(e.consume(t),w):(0,p.CW)(t)?(e.consume(t),C):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,m):(0,p.CW)(t)?(e.consume(t),k):n(t)}function c(t){return 45===t?(e.consume(t),f):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),h):(0,p.HP)(t)?(s=u,F(t)):(e.consume(t),u)}function h(t){return 45===t?(e.consume(t),f):u(t)}function f(e){return 62===e?R(e):45===e?h(e):u(e)}function m(t){return t==="CDATA[".charCodeAt(i++)?(e.consume(t),6===i?g:m):n(t)}function g(t){return null===t?n(t):93===t?(e.consume(t),y):(0,p.HP)(t)?(s=g,F(t)):(e.consume(t),g)}function y(t){return 93===t?(e.consume(t),b):g(t)}function b(t){return 62===t?R(t):93===t?(e.consume(t),b):g(t)}function k(t){return null===t||62===t?R(t):(0,p.HP)(t)?(s=k,F(t)):(e.consume(t),k)}function w(t){return null===t?n(t):63===t?(e.consume(t),v):(0,p.HP)(t)?(s=w,F(t)):(e.consume(t),w)}function v(e){return 62===e?R(e):w(e)}function x(t){return(0,p.CW)(t)?(e.consume(t),S):n(t)}function S(t){return 45===t||(0,p.lV)(t)?(e.consume(t),S):E(t)}function E(t){return(0,p.HP)(t)?(s=E,F(t)):(0,p.On)(t)?(e.consume(t),E):R(t)}function C(t){return 45===t||(0,p.lV)(t)?(e.consume(t),C):47===t||62===t||(0,p.Ee)(t)?A(t):n(t)}function A(t){return 47===t?(e.consume(t),R):58===t||95===t||(0,p.CW)(t)?(e.consume(t),N):(0,p.HP)(t)?(s=A,F(t)):(0,p.On)(t)?(e.consume(t),A):R(t)}function N(t){return 45===t||46===t||58===t||95===t||(0,p.lV)(t)?(e.consume(t),N):O(t)}function O(t){return 61===t?(e.consume(t),T):(0,p.HP)(t)?(s=O,F(t)):(0,p.On)(t)?(e.consume(t),O):A(t)}function T(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,M):(0,p.HP)(t)?(s=T,F(t)):(0,p.On)(t)?(e.consume(t),T):(e.consume(t),D)}function M(t){return t===o?(e.consume(t),o=void 0,I):null===t?n(t):(0,p.HP)(t)?(s=M,F(t)):(e.consume(t),M)}function D(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||(0,p.Ee)(t)?A(t):(e.consume(t),D)}function I(e){return 47===e||62===e||(0,p.Ee)(e)?A(e):n(e)}function R(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function F(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),L}function L(t){return(0,p.On)(t)?(0,d.N)(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):P(t)}function P(t){return e.enter("htmlTextData"),s(t)}}},fe={name:"labelStartLink",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:oe.resolveAll},me={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return(0,p.HP)(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},ge={name:"codeText",tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),s(t)};function s(t){return 96===t?(e.consume(t),i++,s):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):(0,p.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||(0,p.HP)(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type}},ye={42:I,43:I,45:I,48:I,49:I,50:I,51:I,52:I,53:I,54:I,55:I,56:I,57:I,62:L},be={91:j},ke={[-2]:H,[-1]:H,32:H},we={35:W,42:D,45:[K,D],60:J,61:K,95:D,96:Q,126:Q},ve={38:te,92:ne},xe={[-5]:re,[-4]:re,[-3]:re,33:le,38:te,42:ue,60:[pe,he],91:fe,92:[me,ne],93:oe,95:ue,96:ge},Se={null:[ue,S]},Ee={null:[42,95]},Ce={null:[]},Ae=/[\0\t\n\r]/g;var Ne=n(99896),Oe=n(47938);function Te(e){return e&&"object"==typeof e?"position"in e||"type"in e?De(e.position):"start"in e||"end"in e?De(e):"line"in e||"column"in e?Me(e):"":""}function Me(e){return Ie(e&&e.line)+":"+Ie(e&&e.column)}function De(e){return Me(e&&e.start)+"-"+Me(e&&e.end)}function Ie(e){return e&&"number"==typeof e?e:1}const Re={}.hasOwnProperty,Fe=function(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(v),autolinkProtocol:h,autolinkEmail:h,atxHeading:s(b),blockQuote:s((function(){return{type:"blockquote",children:[]}})),characterEscape:h,characterReference:h,codeFenced:s(y),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(y,l),codeText:s((function(){return{type:"inlineCode",value:""}}),l),codeTextData:h,data:h,codeFlowValue:h,definition:s((function(){return{type:"definition",identifier:"",label:null,title:null,url:""}})),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s((function(){return{type:"emphasis",children:[]}})),hardBreakEscape:s(k),hardBreakTrailing:s(k),htmlFlow:s(w,l),htmlFlowData:h,htmlText:s(w,l),htmlTextData:h,image:s((function(){return{type:"image",title:null,url:"",alt:null}})),label:l,link:s(v),listItem:s((function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}})),listItemValue:function(e){i("expectingFirstListItemValue")&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),o("expectingFirstListItemValue"))},listOrdered:s(x,(function(){o("expectingFirstListItemValue",!0)})),listUnordered:s(x),paragraph:s((function(){return{type:"paragraph",children:[]}})),reference:function(){o("referenceType","collapsed")},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(b),strong:s((function(){return{type:"strong",children:[]}})),thematicBreak:s((function(){return{type:"thematicBreak"}}))},exit:{atxHeading:u(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:u(),autolinkEmail:function(e){f.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){f.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:u(),characterEscapeValue:f,characterReferenceMarkerHexadecimal:g,characterReferenceMarkerNumeric:g,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=i("characterReferenceType");let r;n?(r=(0,Ne.C)(t,"characterReferenceMarkerNumeric"===n?10:16),o("characterReferenceType")):r=(0,ee.s)(t);const s=this.stack.pop();s.value+=r,s.position.end=Le(e.end)},codeFenced:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),o("flowCodeInside")})),codeFencedFence:function(){i("flowCodeInside")||(this.buffer(),o("flowCodeInside",!0))},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:f,codeIndented:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")})),codeText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),codeTextData:f,data:f,definition:u(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,$.B)(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:u(),hardBreakEscape:u(m),hardBreakTrailing:u(m),htmlFlow:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlFlowData:f,htmlText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlTextData:f,image:u((function(){const e=this.stack[this.stack.length-1];if(i("inReference")){const t=i("referenceType")||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;o("referenceType")})),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(o("inReference",!0),"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=(0,Oe.s)(t),n.identifier=(0,$.B)(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(i("atHardBreak"))return n.children[n.children.length-1].position.end=Le(e.end),void o("atHardBreak");!i("setextHeadingSlurpLineEnding")&&t.canContainEols.includes(n.type)&&(h.call(this,e),f.call(this,e))},link:u((function(){const e=this.stack[this.stack.length-1];if(i("inReference")){const t=i("referenceType")||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;o("referenceType")})),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,$.B)(this.sliceSerialize(e)).toLowerCase(),o("referenceType","full")},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){o("inReference")},setextHeading:u((function(){o("setextHeadingSlurpLineEnding")})),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).charCodeAt(0)?1:2},setextHeadingText:function(){o("setextHeadingSlurpLineEnding",!0)},strong:u(),thematicBreak:u()}};Pe(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let n={type:"root",children:[]};const s={stack:[n],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:p,setData:o,getData:i},a=[];let u=-1;for(;++u<e.length;)"listOrdered"!==e[u][1].type&&"listUnordered"!==e[u][1].type||("enter"===e[u][0]?a.push(u):u=r(e,a.pop(),u));for(u=-1;++u<e.length;){const n=t[e[u][0]];Re.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},s),e[u][1])}if(s.tokenStack.length>0){const e=s.tokenStack[s.tokenStack.length-1];(e[1]||_e).call(s,void 0,e[0])}for(n.position={start:Le(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Le(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)n=t.transforms[u](n)||n;return n};function r(e,t,n){let r,o,i,s,a=t-1,l=-1,c=!1;for(;++a<=n;){const t=e[a];if("listUnordered"===t[1].type||"listOrdered"===t[1].type||"blockQuote"===t[1].type?("enter"===t[0]?l++:l--,s=void 0):"lineEndingBlank"===t[1].type?"enter"===t[0]&&(!r||s||l||i||(i=a),s=void 0):"linePrefix"===t[1].type||"listItemValue"===t[1].type||"listItemMarker"===t[1].type||"listItemPrefix"===t[1].type||"listItemPrefixWhitespace"===t[1].type||(s=void 0),!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let s=a;for(o=void 0;s--;){const t=e[s];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",o=s}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||a,0,["exit",r,t[2]]),a++,n++}"listItemPrefix"===t[1].type&&(r={type:"listItem",_spread:!1,start:Object.assign({},t[1].start)},e.splice(a,0,["enter",r,t[2]]),a++,n++,i=void 0,s=!0)}}return e[t][1]._spread=c,n}function o(e,t){n[e]=t}function i(e){return n[e]}function s(e,t){return function(n){c.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(e,t,n){return this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n]),e.position={start:Le(t.start)},e}function u(e){return function(t){e&&e.call(this,t),d.call(this,t)}}function d(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Te({start:e.start,end:e.end})+"): it’s not open");return r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||_e).call(this,e,r[0])),n.position.end=Le(e.end),n}function p(){return a(this.stack.pop())}function h(e){const t=this.stack[this.stack.length-1];let n=t.children[t.children.length-1];n&&"text"===n.type||(n={type:"text",value:""},n.position={start:Le(e.start)},t.children.push(n)),this.stack.push(n)}function f(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Le(e.end)}function m(){o("atHardBreak",!0)}function g(e){o("characterReferenceType",e.type)}function y(){return{type:"code",lang:null,meta:null,value:""}}function b(){return{type:"heading",depth:void 0,children:[]}}function k(){return{type:"break"}}function w(){return{type:"html",value:""}}function v(){return{type:"link",title:null,url:"",children:[]}}function x(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}}(n)(function(e){for(;!b(e););return e}(function(e={}){const t={defined:[],lazy:{},constructs:(0,u.y)([r].concat(e.extensions||[])),content:n(h),document:n(m),flow:n(x),string:n(E),text:n(C)};return t;function n(e){return function(n){return M(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,s){const a=[];let l,c,u,d,p;for(o=n+o.toString(i),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);u<o.length;){if(Ae.lastIndex=u,l=Ae.exec(o),d=l&&void 0!==l.index?l.index:o.length,p=o.charCodeAt(d),!l){n=o.slice(u);break}if(10===p&&u===d&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),u<d&&(a.push(o.slice(u,d)),t+=d-u),p){case 0:a.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),a.push(-2);t++<c;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return s&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))};function Le(e){return{line:e.line,column:e.column,offset:e.offset}}function Pe(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Pe(e,r):Be(e,r)}}function Be(e,t){let n;for(n in t)if(Re.call(t,n))if("canContainEols"===n){const r=t[n];r&&e[n].push(...r)}else if("transforms"===n){const r=t[n];r&&e[n].push(...r)}else if("enter"===n||"exit"===n){const r=t[n];r&&Object.assign(e[n],r)}}function _e(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Te({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Te({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Te({start:t.start,end:t.end})+") is still open")}function ze(e){Object.assign(this,{Parser:t=>{const n=this.data("settings");return Fe(t,Object.assign({},n,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}var $e=n(14706);function je(e,t){let n,r=-1;if(t.extensions)for(;++r<t.extensions.length;)je(e,t.extensions[r]);for(n in t)"extensions"===n||("unsafe"===n||"join"===n?e[n]=[...e[n]||[],...t[n]||[]]:"handlers"===n?e[n]=Object.assign(e[n],t[n]||{}):e.options[n]=t[n]);return e}function Ue(e,t,n){return">"+(n?"":" ")+e}function He(e,t){return Ve(e,t.inConstruct,!0)&&!Ve(e,t.notInConstruct,!1)}function Ve(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function We(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if("\n"===n.unsafe[o].character&&He(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}var Ke=n(45344);function qe(e,t){return Boolean(!t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Ge(e,t,n){return(n?"":" ")+e}function Je(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ye(e,t,n,r){const o=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),i=n.enter("emphasis"),s=n.createTracker(r);let a=s.move(o);return a+=s.move(n.containerPhrasing(e,{before:a,after:o,...s.current()})),a+=s.move(o),i(),a}Ye.peek=function(e,t,n){return n.options.emphasis||"*"};var Ze=n(66641);function Xe(e,t){let n=!1;var r,o,i,s;return r=e,o=e=>{if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,Ze.dc},"function"==typeof o&&"function"!=typeof i&&(s=i,i=o,o=null),(0,Ze.VG)(r,o,(function(e,t){const n=t[t.length-1];return i(e,n?n.children.indexOf(e):null,n)}),s),Boolean((!e.depth||e.depth<3)&&a(e)&&(t.options.setext||n))}function Qe(e){return e.value||""}function et(e,t,n,r){const o=Je(n),i='"'===o?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),a()),c+=l.move(")"),s(),c}function tt(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(d+"]"),l}function nt(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function rt(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=nt(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}function ot(e,t){const n=a(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function it(e,t,n,r){const o=Je(n),i='"'===o?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(ot(e,n)){const t=n.stack;n.stack=[],a=n.enter("autolink");let r=s.move("<");return r+=s.move(n.containerPhrasing(e,{before:r,after:">",...s.current()})),r+=s.move(">"),a(),n.stack=t,r}a=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=s.move(" "+o),c+=s.move(n.safe(e.title,{before:c,after:o,...s.current()})),c+=s.move(o),l()),c+=s.move(")"),a(),c}function st(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(d+"]"),l}function at(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function lt(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ct(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}Qe.peek=function(){return"<"},et.peek=function(){return"!"},tt.peek=function(){return"!"},rt.peek=function(){return"`"},it.peek=function(e,t,n){return ot(e,n)?"<":"["},st.peek=function(){return"["};const ut=(0,n(15186).C)(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","link","linkReference","strong","text"]);function dt(e,t,n,r){const o=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),i=n.enter("strong"),s=n.createTracker(r);let a=s.move(o+o);return a+=s.move(n.containerPhrasing(e,{before:a,after:o,...s.current()})),a+=s.move(o+o),i(),a}dt.peek=function(e,t,n){return n.options.strong||"*"};const pt={blockquote:function(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const s=n.indentLines(n.containerFlow(e,i.current()),Ue);return o(),s},break:We,code:function(e,t,n,r){const o=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),i=e.value||"",s="`"===o?"GraveAccent":"Tilde";if(qe(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(i,Ge);return e(),t}const a=n.createTracker(r),l=o.repeat(Math.max((0,Ke.D)(i,o)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const t=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...a.current()})),t()}return u+=a.move("\n"),i&&(u+=a.move(i+"\n")),u+=a.move(l),c(),u},definition:function(e,t,n,r){const o=Je(n),i='"'===o?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),a(),e.title&&(a=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),a()),s(),c},emphasis:Ye,hardBreak:We,heading:function(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(Xe(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),s=n.containerPhrasing(e,{...i.current(),before:"\n",after:"\n"});return r(),t(),s+"\n"+(1===o?"=":"-").repeat(s.length-(Math.max(s.lastIndexOf("\r"),s.lastIndexOf("\n"))+1))}const s="#".repeat(o),a=n.enter("headingAtx"),l=n.enter("phrasing");i.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...i.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c},html:Qe,image:et,imageReference:tt,inlineCode:rt,link:it,linkReference:st,list:function(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let s=e.ordered?lt(n):at(n);const a=e.ordered?function(e){const t=lt(e),n=e.options.bulletOrderedOther;if(!n)return"."===t?")":".";if("."!==n&&")"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrderedOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bulletOrdered` (`"+t+"`) and `bulletOrderedOther` (`"+n+"`) to be different");return n}(n):function(e){const t=at(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n),l=n.bulletLastUsed;let c=!1;if(t&&(e.ordered?n.options.bulletOrderedOther:n.options.bulletOther)&&l&&s===l&&(c=!0),!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==s&&"-"!==s||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(c=!0),ct(n)===s&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){c=!0;break}}}}c&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=i,o(),u},listItem:function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"tab";if(1===t||"1"===t)return"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||at(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let s=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));const a=n.createTracker(r);a.move(i+" ".repeat(s-i.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),(function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?i:i+" ".repeat(s-i.length))+e}));return l(),c},paragraph:function(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),s=n.containerPhrasing(e,r);return i(),o(),s},root:function(e,t,n,r){const o=e.children.some((e=>ut(e)));return(o?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:dt,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(ct(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}},ht=[function(e,t,n,r){if("code"===t.type&&qe(t,r)&&("list"===e.type||e.type===t.type&&qe(e,r)))return!1;if("list"===e.type&&e.type===t.type&&Boolean(e.ordered)===Boolean(t.ordered)&&!(e.ordered?r.options.bulletOrderedOther:r.options.bulletOther))return!1;if("spread"in n&&"boolean"==typeof n.spread){if("paragraph"===e.type&&(e.type===t.type||"definition"===t.type||"heading"===t.type&&Xe(t,r)))return;return n.spread?1:0}}],ft=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],mt=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:ft},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:ft},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:ft},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:ft},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:ft},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:ft},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:ft},{atBreak:!0,character:"~"}];function gt(e){return e.label||!e.identifier?e.label||"":(0,Oe.s)(e.identifier)}function yt(e,t,n,r){let o=r.join.length;for(;o--;){const i=r.join[o](e,t,n,r);if(!0===i||1===i)break;if("number"==typeof i)return"\n".repeat(1+i);if(!1===i)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const bt=/\r?\n|\r/g;function kt(e,t){const n=[];let r,o=0,i=0;for(;r=bt.exec(e);)s(e.slice(o,r.index)),n.push(r[0]),o=r.index+r[0].length,i++;return s(e.slice(o)),n.join("");function s(e){n.push(t(e,i,!e))}}function wt(e,t){return e-t}function vt(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],o=[],i=e+t;let s,a=-1,l=0;for(;s=n.exec(i);)r.push(s.index);for(;++a<r.length;)l!==r[a]&&o.push(e.slice(l,r[a])),o.push("\\"),l=r[a];return o.push(e.slice(l)),o.join("")}function xt(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,o=n.line||1,i=n.column||1;return{move:function(e){const t=e||"",n=t.split(/\r?\n|\r/g),s=n[n.length-1];return o+=n.length-1,i=1===n.length?i+s.length:1+s.length+r,t},current:function(){return{now:{line:o,column:i},lineShift:r}},shift:function(e){r+=e}}}function St(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function Et(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function Ct(e,t){if("definition"===e.type&&e.type===t.type)return 0}function At(e,t){return function(e,t,n){const r=t.indexStack,o=e.children||[],i=[];let s=-1,a=n.before;r.push(-1);let l=t.createTracker(n);for(;++s<o.length;){const c=o[s];let u;if(r[r.length-1]=s,s+1<o.length){let n=t.handle.handlers[o[s+1].type];n&&n.peek&&(n=n.peek),u=n?n(o[s+1],e,t,{before:"",after:"",...l.current()}).charAt(0):""}else u=n.after;i.length>0&&("\r"===a||"\n"===a)&&"html"===c.type&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=t.createTracker(n),l.move(i.join(""))),i.push(l.move(t.handle(c,e,t,{...l.current(),before:a,after:u}))),a=i[i.length-1].slice(-1)}return r.pop(),i.join("")}(e,this,t)}function Nt(e,t){return function(e,t,n){const r=t.indexStack,o=e.children||[],i=t.createTracker(n),s=[];let a=-1;for(r.push(-1);++a<o.length;){const n=o[a];r[r.length-1]=a,s.push(i.move(t.handle(n,e,t,{before:"\n",after:"\n",...i.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),a<o.length-1&&s.push(i.move(yt(n,o[a+1],e,t)))}return r.pop(),s.join("")}(e,this,t)}function Ot(e,t){return function(e,t,n){const r=(n.before||"")+(t||"")+(n.after||""),o=[],i=[],s={};let a=-1;for(;++a<e.unsafe.length;){const t=e.unsafe[a];if(!He(e.stack,t))continue;const n=nt(t);let i;for(;i=n.exec(r);){const e="before"in t||Boolean(t.atBreak),n="after"in t,r=i.index+(e?i[1].length:0);o.includes(r)?(s[r].before&&!e&&(s[r].before=!1),s[r].after&&!n&&(s[r].after=!1)):(o.push(r),s[r]={before:e,after:n})}}o.sort(wt);let l=n.before?n.before.length:0;const c=r.length-(n.after?n.after.length:0);for(a=-1;++a<o.length;){const e=o[a];e<l||e>=c||e+1<c&&o[a+1]===e+1&&s[e].after&&!s[e+1].before&&!s[e+1].after||o[a-1]===e-1&&s[e].before&&!s[e-1].before&&!s[e-1].after||(l!==e&&i.push(vt(r.slice(l,e),"\\")),l=e,!/[!-/:-@[-`{-~]/.test(r.charAt(e))||n.encode&&n.encode.includes(r.charAt(e))?(i.push("&#x"+r.charCodeAt(e).toString(16).toUpperCase()+";"),l++):i.push("\\"))}return i.push(vt(r.slice(l,c),n.after)),i.join("")}(this,e,t)}function Tt(e){Object.assign(this,{Compiler:t=>{const n=this.data("settings");return function(e,t={}){const n={enter:function(e){return n.stack.push(e),function(){n.stack.pop()}},indentLines:kt,associationId:gt,containerPhrasing:At,containerFlow:Nt,createTracker:xt,safe:Ot,stack:[],unsafe:[],join:[],handlers:{},options:{},indexStack:[],handle:void 0};je(n,{unsafe:mt,join:ht,handlers:pt}),je(n,t),n.options.tightDefinitions&&je(n,{join:[Ct]}),n.handle=(0,$e.A)("type",{invalid:St,unknown:Et,handlers:n.handlers});let r=n.handle(e,void 0,n,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return r&&10!==r.charCodeAt(r.length-1)&&13!==r.charCodeAt(r.length-1)&&(r+="\n"),r}(t,Object.assign({},n,e,{extensions:this.data("toMarkdownExtensions")||[]}))}})}var Mt=n(659),Dt=n(88966),It=n(89710);function Rt(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}var Ft=n(4934);function Lt(e){return Bt(e&&e.line)+":"+Bt(e&&e.column)}function Pt(e){return Lt(e&&e.start)+"-"+Lt(e&&e.end)}function Bt(e){return e&&"number"==typeof e?e:1}class _t extends Error{constructor(e,t,n){const r=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),"string"==typeof t&&(n=t,t=void 0),"string"==typeof n){const e=n.indexOf(":");-1===e?r[1]=n:(r[0]=n.slice(0,e),r[1]=n.slice(e+1))}var i;t&&("type"in t||"position"in t?t.position&&(o=t.position):"start"in t||"end"in t?o=t:("line"in t||"column"in t)&&(o.start=t)),this.name=((i=t)&&"object"==typeof i?"position"in i||"type"in i?Pt(i.position):"start"in i||"end"in i?Pt(i):"line"in i||"column"in i?Lt(i):"":"")||"1:1",this.message="object"==typeof e?e.message:e,this.stack="","object"==typeof e&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=r[0],this.ruleId=r[1],this.file,this.actual,this.expected,this.url,this.note}}_t.prototype.file="",_t.prototype.name="",_t.prototype.reason="",_t.prototype.message="",_t.prototype.stack="",_t.prototype.fatal=null,_t.prototype.column=null,_t.prototype.line=null,_t.prototype.source=null,_t.prototype.ruleId=null,_t.prototype.position=null;const zt=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Vt(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.charCodeAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(47===e.charCodeAt(i)){if(n){r=i+1;break}}else s<0&&(n=!0,s=i+1),a>-1&&(e.charCodeAt(i)===t.charCodeAt(a--)?a<0&&(o=i):(a=-1,o=s));return r===o?o=s:o<0&&(o=e.length),e.slice(r,o)},$t=function(e){if(Vt(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.charCodeAt(0)?"/":".":1===n&&47===e.charCodeAt(0)?"//":e.slice(0,n)},jt=function(e){Vt(e);let t,n=e.length,r=-1,o=0,i=-1,s=0;for(;n--;){const a=e.charCodeAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?i<0?i=n:1!==s&&(s=1):i>-1&&(s=-1);else if(t){o=n+1;break}}return i<0||r<0||0===s||1===s&&i===r-1&&i===o+1?"":e.slice(i,r)},Ut=function(...e){let t,n=-1;for(;++n<e.length;)Vt(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Vt(e);const t=47===e.charCodeAt(0);let n=function(e,t){let n,r,o="",i=0,s=-1,a=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.charCodeAt(l);else{if(47===n)break;n=47}if(47===n){if(s===l-1||1===a);else if(s!==l-1&&2===a){if(o.length<2||2!==i||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),s=l,a=0;continue}}else if(o.length>0){o="",i=0,s=l,a=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(s+1,l):o=e.slice(s+1,l),i=l-s-1;s=l,a=0}else 46===n&&a>-1?a++:a=-1}return o}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.charCodeAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},Ht="/";function Vt(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Wt=function(){return"/"};function Kt(e){return null!==e&&"object"==typeof e&&e.href&&e.origin}const qt=["history","path","basename","stem","extname","dirname"];class Gt{constructor(e){let t;t=e?"string"==typeof e||function(e){return Dt(e)}(e)?{value:e}:Kt(e)?{path:e}:e:{},this.data={},this.messages=[],this.history=[],this.cwd=Wt(),this.value,this.stored,this.result,this.map;let n,r=-1;for(;++r<qt.length;){const e=qt[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)qt.includes(n)||(this[n]=t[n])}get path(){return this.history[this.history.length-1]}set path(e){Kt(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!Kt(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.charCodeAt(n)&&50===t.charCodeAt(n+1)){const e=t.charCodeAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),Yt(e,"path"),this.path!==e&&this.history.push(e)}get dirname(){return"string"==typeof this.path?$t(this.path):void 0}set dirname(e){Zt(this.basename,"dirname"),this.path=Ut(e||"",this.basename)}get basename(){return"string"==typeof this.path?zt(this.path):void 0}set basename(e){Yt(e,"basename"),Jt(e,"basename"),this.path=Ut(this.dirname||"",e)}get extname(){return"string"==typeof this.path?jt(this.path):void 0}set extname(e){if(Jt(e,"extname"),Zt(this.dirname,"extname"),e){if(46!==e.charCodeAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ut(this.dirname,this.stem+(e||""))}get stem(){return"string"==typeof this.path?zt(this.path,this.extname):void 0}set stem(e){Yt(e,"stem"),Jt(e,"stem"),this.path=Ut(this.dirname||"",e+(this.extname||""))}toString(e){return(this.value||"").toString(e||void 0)}message(e,t,n){const r=new _t(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=null,r}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}}function Jt(e,t){if(e&&e.includes(Ht))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ht+"`")}function Yt(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Zt(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Xt=function e(){const t=(0,Ft.S)(),n=[];let r,o={},i=-1;return s.data=function(e,t){return"string"==typeof e?2===arguments.length?(rn("data",r),o[e]=t,s):Qt.call(o,e)&&o[e]||null:e?(rn("data",r),o=e,s):o},s.Parser=void 0,s.Compiler=void 0,s.freeze=function(){if(r)return s;for(;++i<n.length;){const[e,...r]=n[i];if(!1===r[0])continue;!0===r[0]&&(r[0]=void 0);const o=e.call(s,...r);"function"==typeof o&&t.use(o)}return r=!0,i=Number.POSITIVE_INFINITY,s},s.attachers=n,s.use=function(e,...t){let i;if(rn("use",r),null==e);else if("function"==typeof e)u(e,...t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?c(e):l(e)}return i&&(o.settings=Object.assign(o.settings||{},i)),s;function a(e){if("function"==typeof e)u(e);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;u(t,...n)}else l(e)}}function l(e){c(e.plugins),e.settings&&(i=Object.assign(i||{},e.settings))}function c(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;)a(e[t])}}function u(e,t){let r,o=-1;for(;++o<n.length;)if(n[o][0]===e){r=n[o];break}r?(Rt(r[1])&&Rt(t)&&(t=It(!0,r[1],t)),r[1]=t):n.push([...arguments])}},s.parse=function(e){s.freeze();const t=an(e),n=s.Parser;return tn("parse",n),en(n,"parse")?new n(String(t),t).parse():n(String(t),t)},s.stringify=function(e,t){s.freeze();const n=an(t),r=s.Compiler;return nn("stringify",r),on(e),en(r,"compile")?new r(e,n).compile():r(e,n)},s.run=function(e,n,r){if(on(e),s.freeze(),r||"function"!=typeof n||(r=n,n=void 0),!r)return new Promise(o);function o(o,i){t.run(e,an(n),(function(t,n,s){n=n||e,t?i(t):o?o(n):r(null,n,s)}))}o(null,r)},s.runSync=function(e,t){let n,r;return s.run(e,t,(function(e,t){(0,Mt.V)(e),n=t,r=!0})),sn("runSync","run",r),n},s.process=function(e,t){if(s.freeze(),tn("process",s.Parser),nn("process",s.Compiler),!t)return new Promise(n);function n(n,r){const o=an(e);function i(e,o){e||!o?r(e):n?n(o):t(null,o)}s.run(s.parse(o),o,((e,t,n)=>{if(!e&&t&&n){const o=s.stringify(t,n);null==o||("string"==typeof(r=o)||Dt(r)?n.value=o:n.result=o),i(e,n)}else i(e);var r}))}n(null,t)},s.processSync=function(e){let t;s.freeze(),tn("processSync",s.Parser),nn("processSync",s.Compiler);const n=an(e);return s.process(n,(function(e){t=!0,(0,Mt.V)(e)})),sn("processSync","process",t),n},s;function s(){const t=e();let r=-1;for(;++r<n.length;)t.use(...n[r]);return t.data(It(!0,{},o)),t}}().freeze(),Qt={}.hasOwnProperty;function en(e,t){return"function"==typeof e&&e.prototype&&(function(e){let t;for(t in e)if(Qt.call(e,t))return!0;return!1}(e.prototype)||t in e.prototype)}function tn(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `Parser`")}function nn(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `Compiler`")}function rn(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function on(e){if(!Rt(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function sn(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function an(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Gt(e)}var ln,cn,un,dn,pn,hn,fn,mn=n(1440),gn=Object.defineProperty,yn=(e,t,n)=>(((e,t,n)=>{t in e?gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),bn=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},kn=(e,t,n)=>(bn(e,t,"read from private field"),n?n.call(e):t.get(e)),wn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},vn=(e,t,n,r)=>(bn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class xn{}class Sn{constructor(){yn(this,"elements",[]),yn(this,"size",(()=>this.elements.length)),yn(this,"top",(()=>this.elements.at(-1))),yn(this,"push",(e=>{var t;null==(t=this.top())||t.push(e)})),yn(this,"open",(e=>{this.elements.push(e)})),yn(this,"close",(()=>{const e=this.elements.pop();if(!e)throw(0,mn.TR)();return e}))}}class En extends xn{constructor(e,t,n){super(),this.type=e,this.content=t,this.attrs=n}push(e,...t){this.content.push(e,...t)}pop(){return this.content.pop()}static create(e,t,n){return new En(e,t,n)}}const Cn=class extends Sn{constructor(e){super(),yn(this,"schema"),wn(this,ln,i.CU.none),wn(this,cn,(e=>e.isText)),wn(this,un,((e,t)=>{if(kn(this,cn).call(this,e)&&kn(this,cn).call(this,t)&&i.CU.sameSet(e.marks,t.marks))return this.schema.text(e.text+t.text,e.marks)})),wn(this,dn,(e=>{const t=Object.values({...this.schema.nodes,...this.schema.marks}).find((t=>t.spec.parseMarkdown.match(e)));if(!t)throw(0,mn.Xm)(e);return t})),wn(this,pn,(e=>{const t=kn(this,dn).call(this,e);t.spec.parseMarkdown.runner(this,e,t)})),yn(this,"injectRoot",((e,t,n)=>(this.openNode(t,n),this.next(e.children),this))),yn(this,"openNode",((e,t)=>(this.open(En.create(e,[],t)),this))),wn(this,hn,(()=>{vn(this,ln,i.CU.none);const e=this.close();return kn(this,fn).call(this,e.type,e.attrs,e.content)})),yn(this,"closeNode",(()=>(kn(this,hn).call(this),this))),wn(this,fn,((e,t,n)=>{const r=e.createAndFill(t,n,kn(this,ln));if(!r)throw(0,mn.$D)(e,t,n);return this.push(r),r})),yn(this,"addNode",((e,t,n)=>(kn(this,fn).call(this,e,t,n),this))),yn(this,"openMark",((e,t)=>{const n=e.create(t);return vn(this,ln,n.addToSet(kn(this,ln))),this})),yn(this,"closeMark",(e=>(vn(this,ln,e.removeFromSet(kn(this,ln))),this))),yn(this,"addText",(e=>{const t=this.top();if(!t)throw(0,mn.TR)();const n=t.pop(),r=this.schema.text(e,kn(this,ln));if(!n)return t.push(r),this;const o=kn(this,un).call(this,n,r);return o?(t.push(o),this):(t.push(n,r),this)})),yn(this,"build",(()=>{let e;do{e=kn(this,hn).call(this)}while(this.size());return e})),yn(this,"next",((e=[])=>([e].flat().forEach((e=>kn(this,pn).call(this,e))),this))),yn(this,"toDoc",(()=>this.build())),yn(this,"run",((e,t)=>{const n=e.runSync(e.parse(t),t);return this.next(n),this})),this.schema=e}};let An=Cn;ln=new WeakMap,cn=new WeakMap,un=new WeakMap,dn=new WeakMap,pn=new WeakMap,hn=new WeakMap,fn=new WeakMap,yn(An,"create",((e,t)=>{const n=new Cn(e);return e=>(n.run(t,e),n.toDoc())}));const Nn=class extends xn{constructor(e,t,n,r={}){super(),yn(this,"push",((e,...t)=>{this.children||(this.children=[]),this.children.push(e,...t)})),yn(this,"pop",(()=>{var e;return null==(e=this.children)?void 0:e.pop()})),this.type=e,this.children=t,this.value=n,this.props=r}};let On=Nn;var Tn,Mn,Dn,In,Rn,Fn,Ln,Pn,Bn,_n,zn,$n;yn(On,"create",((e,t,n,r={})=>new Nn(e,t,n,r)));const jn=class extends Sn{constructor(e){super(),wn(this,Tn,i.CU.none),yn(this,"schema"),wn(this,Mn,(e=>{const t=Object.values({...this.schema.nodes,...this.schema.marks}).find((t=>t.spec.toMarkdown.match(e)));if(!t)throw(0,mn._K)(e.type);return t})),wn(this,Dn,(e=>kn(this,Mn).call(this,e).spec.toMarkdown.runner(this,e))),wn(this,In,((e,t)=>kn(this,Mn).call(this,e).spec.toMarkdown.runner(this,e,t))),wn(this,Rn,(e=>{const{marks:t}=e,n=e=>e.type.spec.priority??50;[...t].sort(((e,t)=>n(e)-n(t))).every((t=>!kn(this,In).call(this,t,e)))&&kn(this,Dn).call(this,e),t.forEach((e=>kn(this,$n).call(this,e)))})),wn(this,Fn,((e,t)=>{var n;if(e.type===t||1!==(null==(n=e.children)?void 0:n.length))return e;const r=e=>{var n;if(e.type===t)return e;if(1!==(null==(n=e.children)?void 0:n.length))return null;const[o]=e.children;return o?r(o):null},o=r(e);if(!o)return e;const i=o.children?[...o.children]:void 0,s={...e,children:i};return s.children=i,o.children=[s],o})),wn(this,Ln,(e=>{const{children:t}=e;return t&&(e.children=t.reduce(((e,t,n)=>{if(0===n)return[t];const r=e.at(-1);if(r&&r.isMark&&t.isMark){t=kn(this,Fn).call(this,t,r.type);const{children:n,...o}=t,{children:i,...s}=r;if(t.type===r.type&&n&&i&&JSON.stringify(o)===JSON.stringify(s)){const t={...s,children:[...i,...n]};return e.slice(0,-1).concat(kn(this,Ln).call(this,t))}}return e.concat(t)}),[])),e})),wn(this,Pn,(e=>{const t={...e.props,type:e.type};return e.children&&(t.children=e.children),e.value&&(t.value=e.value),t})),yn(this,"openNode",((e,t,n)=>(this.open(On.create(e,void 0,t,n)),this))),wn(this,Bn,(()=>{const e=this.close();return kn(this,_n).call(this,e.type,e.children,e.value,e.props)})),yn(this,"closeNode",(()=>(kn(this,Bn).call(this),this))),wn(this,_n,((e,t,n,r)=>{const o=On.create(e,t,n,r),i=kn(this,Ln).call(this,kn(this,Pn).call(this,o));return this.push(i),i})),yn(this,"addNode",((e,t,n,r)=>(kn(this,_n).call(this,e,t,n,r),this))),wn(this,zn,((e,t,n,r)=>e.isInSet(kn(this,Tn))?this:(vn(this,Tn,e.addToSet(kn(this,Tn))),this.openNode(t,n,{...r,isMark:!0})))),wn(this,$n,(e=>{!e.isInSet(kn(this,Tn))||(vn(this,Tn,e.type.removeFromSet(kn(this,Tn))),kn(this,Bn).call(this))})),yn(this,"withMark",((e,t,n,r)=>(kn(this,zn).call(this,e,t,n,r),this))),yn(this,"closeMark",(e=>(kn(this,$n).call(this,e),this))),yn(this,"build",(()=>{let e=null;do{e=kn(this,Bn).call(this)}while(this.size());return e})),yn(this,"next",(e=>{return t=e,Object.prototype.hasOwnProperty.call(t,"size")?(e.forEach((e=>{kn(this,Rn).call(this,e)})),this):(kn(this,Rn).call(this,e),this);var t})),yn(this,"toString",(e=>e.stringify(this.build()))),yn(this,"run",(e=>(this.next(e),this))),this.schema=e}};let Un=jn;Tn=new WeakMap,Mn=new WeakMap,Dn=new WeakMap,In=new WeakMap,Rn=new WeakMap,Fn=new WeakMap,Ln=new WeakMap,Pn=new WeakMap,Bn=new WeakMap,_n=new WeakMap,zn=new WeakMap,$n=new WeakMap,yn(Un,"create",((e,t)=>{const n=new jn(e);return e=>(n.run(e),n.toString(t))}));var Hn=n(81570),Vn=n(73686),Wn=n(44254),Kn=n(25715),qn=n(15939),Gn=Object.defineProperty,Jn=(e,t,n)=>(((e,t,n)=>{t in e?Gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),Yn=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Zn=(e,t,n)=>(Yn(e,t,"read from private field"),n?n.call(e):t.get(e)),Xn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Qn=(e,t,n,r)=>(Yn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);const er=(e,t)=>(e.meta={package:"@milkdown/core",group:"System",...t},e),tr=(0,o.CR)("ConfigReady"),nr=(0,o.CR)("InitReady"),rr=(0,o.Z0)([],"initTimer"),or=(0,o.Z0)({},"editor"),ir=(0,o.Z0)([],"inputRules"),sr=(0,o.Z0)([],"prosePlugins"),ar=(0,o.Z0)([],"remarkPlugins"),lr=(0,o.Z0)([],"nodeView"),cr=(0,o.Z0)([],"markView"),ur=(0,o.Z0)(Xt().use(ze).use(Tt),"remark"),dr=(0,o.Z0)({},"remarkStringifyOptions"),pr=e=>{const t=t=>(t.inject(or,e).inject(sr).inject(ar).inject(ir).inject(lr).inject(cr).inject(dr).inject(ur,Xt().use(ze).use(Tt)).inject(rr,[tr]).record(nr),async()=>{await t.waitTimers(rr);const e=t.get(dr);return t.set(ur,Xt().use(ze).use(Tt,e)),t.done(nr),()=>{t.remove(or).remove(sr).remove(ar).remove(ir).remove(lr).remove(cr).remove(dr).remove(ur).remove(rr).clearTimer(nr)}});return er(t,{displayName:"Init"}),t},hr=(0,o.CR)("SchemaReady"),fr=(0,o.Z0)([],"schemaTimer"),mr=(0,o.Z0)({},"schema"),gr=(0,o.Z0)([],"nodes"),yr=(0,o.Z0)([],"marks"),br=e=>{var t;return{...e,parseDOM:null==(t=e.parseDOM)?void 0:t.map((t=>({priority:e.priority,...t})))}},kr=e=>(e.inject(mr).inject(gr).inject(yr).inject(fr,[nr]).record(hr),async()=>{await e.waitTimers(fr);const t=e.get(ur),n=e.get(ar).reduce(((e,t)=>e.use(t)),t);e.set(ur,n);const r=Object.fromEntries(e.get(gr).map((([e,t])=>[e,br(t)]))),o=Object.fromEntries(e.get(yr).map((([e,t])=>[e,br(t)])));return e.set(mr,new i.Sj({nodes:r,marks:o})),e.done(hr),()=>{e.remove(mr).remove(gr).remove(yr).remove(fr).clearTimer(hr)}});er(kr,{displayName:"Schema"});const wr=(0,o.CR)("ParserReady"),vr=(0,o.Z0)((()=>{throw(0,mn.dI)()}),"parser"),xr=(0,o.Z0)([],"parserTimer"),Sr=e=>(e.inject(vr).inject(xr,[hr]).record(wr),async()=>{await e.waitTimers(xr);const t=e.get(ur),n=e.get(mr);return e.set(vr,An.create(n,t)),e.done(wr),()=>{e.remove(vr).remove(xr).clearTimer(wr)}});er(Sr,{displayName:"Parser"});const Er=(0,o.CR)("SerializerReady"),Cr=(0,o.Z0)([],"serializerTimer"),Ar=(0,o.Z0)((()=>""),"serializer"),Nr=e=>(e.inject(Ar).inject(Cr,[hr]).record(Er),async()=>{await e.waitTimers(Cr);const t=e.get(ur),n=e.get(mr);return e.set(Ar,Un.create(n,t)),e.done(Er),()=>{e.remove(Ar).remove(Cr).clearTimer(Er)}});er(Nr,{displayName:"Serializer"});const Or=(0,o.Z0)("","defaultValue"),Tr=(0,o.Z0)({},"editorState"),Mr=(0,o.Z0)((e=>e),"stateOptions"),Dr=(0,o.Z0)([],"editorStateTimer"),Ir=(0,o.CR)("EditorStateReady"),Rr=new Hn.hs("MILKDOWN_STATE_TRACKER"),Fr=e=>(e.inject(Or).inject(Tr).inject(Mr).inject(Dr,[wr,Er,Jr]).record(Ir),async()=>{await e.waitTimers(Dr);const t=e.get(mr),n=e.get(vr),r=e.get(ir),o=e.get(Mr),s=e.get(sr),a=((e,t,n)=>{if("string"==typeof e)return t(e);if("html"===e.type)return i.S4.fromSchema(n).parse(e.dom);if("json"===e.type)return i.bP.fromJSON(n,e.value);throw(0,mn.j7)(e)})(e.get(Or),n,t),l=[...s,new Hn.k_({key:Rr,state:{init:()=>{},apply:(t,n,r,o)=>{e.set(Tr,o)}}}),(0,Wn.Z6)({rules:r}),(0,qn.w)(Kn.RV)];e.set(sr,l);const c=o({schema:t,doc:a,plugins:l}),u=Hn.$t.create(c);return e.set(Tr,u),e.done(Ir),()=>{e.remove(Or).remove(Tr).remove(Mr).remove(Dr).clearTimer(Ir)}});er(Fr,{displayName:"EditorState"});const Lr=(0,o.CR)("EditorViewReady"),Pr=(0,o.Z0)({},"editorView"),Br=(0,o.Z0)([],"editorViewTimer"),_r=(0,o.Z0)({},"editorViewOptions"),zr=(0,o.Z0)(null,"root"),$r=(0,o.Z0)(null,"rootDOM"),jr=(0,o.Z0)({},"rootAttrs"),Ur=new Hn.hs("MILKDOWN_VIEW_CLEAR"),Hr=e=>(e.inject(zr,document.body).inject(Pr).inject(_r).inject($r).inject(jr).inject(Br,[Ir]).record(Lr),async()=>{await e.wait(nr);const t=e.get(zr)||document.body,n="string"==typeof t?document.querySelector(t):t;e.update(sr,(t=>[new Hn.k_({key:Ur,view:t=>{const r=n?((e,t)=>{const n=document.createElement("div");n.className="milkdown",e.appendChild(n),t.set($r,n);const r=t.get(jr);return Object.entries(r).forEach((([e,t])=>n.setAttribute(e,t))),n})(n,e):void 0;return(()=>{if(r&&n){const e=t.dom;n.replaceChild(r,e),r.appendChild(e)}})(),{destroy:()=>{null!=r&&r.parentNode&&(null==r||r.parentNode.replaceChild(t.dom,r)),null==r||r.remove()}}}}),...t])),await e.waitTimers(Br);const r=e.get(Tr),o=e.get(_r),i=Object.fromEntries(e.get(lr)),s=Object.fromEntries(e.get(cr)),a=new Vn.Lz(n,{state:r,nodeViews:i,markViews:s,...o});return(e=>{e.classList.add("editor"),e.setAttribute("role","textbox")})(a.dom),e.set(Pr,a),e.done(Lr),()=>{null==a||a.destroy(),e.remove(zr).remove(Pr).remove(_r).remove($r).remove(jr).remove(Br).clearTimer(Lr)}});var Vr,Wr;er(Hr,{displayName:"EditorView"}),Vr=new WeakMap,Wr=new WeakMap;const Kr=(e="cmdKey")=>(0,o.Z0)((()=>()=>!1),e),qr=(0,o.Z0)(new class{constructor(){Xn(this,Vr,new o.mc),Xn(this,Wr,null),Jn(this,"setCtx",(e=>{Qn(this,Wr,e)}))}create(e,t){const n=e.create(Zn(this,Vr).sliceMap);return n.set(t),n}get(e){return Zn(this,Vr).get(e).get()}remove(e){return Zn(this,Vr).remove(e)}call(e,t){if(null==Zn(this,Wr))throw(0,mn.zD)();const n=this.get(e)(t),r=Zn(this,Wr).get(Pr);return n(r.state,r.dispatch,r)}},"commands"),Gr=(0,o.Z0)([hr],"commandsTimer"),Jr=(0,o.CR)("CommandsReady"),Yr=e=>(e.inject(qr).inject(Gr).record(Jr),e.get(qr).setCtx(e),async()=>(await e.waitTimers(Gr),e.done(Jr),()=>{e.remove(qr).remove(Gr).clearTimer(Jr)}));var Zr,Xr,Qr,eo,to,no,ro,oo,io,so,ao,lo,co,uo,po;er(Yr,{displayName:"Commands"});const ho=class{constructor(){Xn(this,Zr,!1),Xn(this,Xr,"Idle"),Xn(this,Qr,[]),Xn(this,eo,(()=>{})),Xn(this,to,new o.mc),Xn(this,no,new o.zD),Xn(this,ro,new Map),Xn(this,oo,new Map),Xn(this,io,new o.Kj(Zn(this,to),Zn(this,no))),Xn(this,so,(()=>{const e=(e=>{const t=t=>(t.record(tr),async()=>(await e(t),t.done(tr),()=>{t.clearTimer(tr)}));return er(t,{displayName:"Config"}),t})((async e=>{await Promise.all(Zn(this,Qr).map((t=>t(e))))})),t=[kr,Sr,Nr,Yr,Fr,Hr,pr(this),e];Zn(this,ao).call(this,t,Zn(this,oo))})),Xn(this,ao,((e,t)=>{e.forEach((e=>{const n=Zn(this,io).produce(Zn(this,Zr)?e.meta:void 0),r=e(n);t.set(e,{ctx:n,handler:r,cleanup:void 0})}))})),Xn(this,lo,((e,t=!1)=>Promise.all([e].flat().map((e=>{const n=Zn(this,ro).get(e),r=null==n?void 0:n.cleanup;return t?Zn(this,ro).delete(e):Zn(this,ro).set(e,{ctx:void 0,handler:void 0,cleanup:void 0}),"function"==typeof r?r():r}))))),Xn(this,co,(async()=>{await Promise.all([...Zn(this,oo).entries()].map((([e,{cleanup:t}])=>"function"==typeof t?t():t))),Zn(this,oo).clear()})),Xn(this,uo,(e=>{Qn(this,Xr,e),Zn(this,eo).call(this,e)})),Xn(this,po,(e=>[...e.entries()].map((async([t,n])=>{const{ctx:r,handler:o}=n;if(!o)return;const i=await o();e.set(t,{ctx:r,handler:o,cleanup:i})})))),Jn(this,"enableInspector",((e=!0)=>(Qn(this,Zr,e),this))),Jn(this,"onStatusChange",(e=>(Qn(this,eo,e),this))),Jn(this,"config",(e=>(Zn(this,Qr).push(e),this))),Jn(this,"removeConfig",(e=>(Qn(this,Qr,Zn(this,Qr).filter((t=>t!==e))),this))),Jn(this,"use",(e=>{const t=[e].flat();return t.flat().forEach((e=>{Zn(this,ro).set(e,{ctx:void 0,handler:void 0,cleanup:void 0})})),"Created"===Zn(this,Xr)&&Zn(this,ao).call(this,t,Zn(this,ro)),this})),Jn(this,"remove",(async e=>"OnCreate"===Zn(this,Xr)?(console.warn("[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code."),new Promise((t=>{setTimeout((()=>{t(this.remove(e))}),50)}))):(await Zn(this,lo).call(this,[e].flat(),!0),this))),Jn(this,"create",(async()=>("OnCreate"===Zn(this,Xr)||("Created"===Zn(this,Xr)&&await this.destroy(),Zn(this,uo).call(this,"OnCreate"),Zn(this,so).call(this),Zn(this,ao).call(this,[...Zn(this,ro).keys()],Zn(this,ro)),await Promise.all([Zn(this,po).call(this,Zn(this,oo)),Zn(this,po).call(this,Zn(this,ro))].flat()),Zn(this,uo).call(this,"Created")),this))),Jn(this,"destroy",(async(e=!1)=>"Destroyed"===Zn(this,Xr)||"OnDestroy"===Zn(this,Xr)?this:"OnCreate"===Zn(this,Xr)?new Promise((t=>{setTimeout((()=>{t(this.destroy(e))}),50)})):(e&&Qn(this,Qr,[]),Zn(this,uo).call(this,"OnDestroy"),await Zn(this,lo).call(this,[...Zn(this,ro).keys()],e),await Zn(this,co).call(this),Zn(this,uo).call(this,"Destroyed"),this))),Jn(this,"action",(e=>e(Zn(this,io)))),Jn(this,"inspect",(()=>Zn(this,Zr)?[...Zn(this,oo).values(),...Zn(this,ro).values()].map((({ctx:e})=>{var t;return null==(t=null==e?void 0:e.inspector)?void 0:t.read()})).filter((e=>Boolean(e))):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])))}static make(){return new ho}get ctx(){return Zn(this,io)}get status(){return Zn(this,Xr)}};let fo=ho;Zr=new WeakMap,Xr=new WeakMap,Qr=new WeakMap,eo=new WeakMap,to=new WeakMap,no=new WeakMap,ro=new WeakMap,oo=new WeakMap,io=new WeakMap,so=new WeakMap,ao=new WeakMap,lo=new WeakMap,co=new WeakMap,uo=new WeakMap,po=new WeakMap},29796:(e,t,n)=>{"use strict";n.d(t,{Wj:()=>p,mS:()=>u});var r=n(44254),o=n(81570),i=n(37082),s=n(16512),a=n(73686);const l=(e,t=[])=>e.flatMap((e=>{var n;return"element"===e.type?l(e.children,[...t,...(null==(n=e.properties)?void 0:n.className)||[]]):[{text:e.value,className:t}]}));function c(e,t,n){const{highlight:o,listLanguages:i}=n,s=i(),c=[];return(0,r.xe)((e=>e.type.name===t))(e).forEach((e=>{let t=e.pos+1;const{language:n}=e.node.attrs;if(!n||!s.includes(n))return void console.warn("Unsupported language detected, this language has not been supported by current prism config: ",n);const r=o(e.node.textContent,n);l(r.children).forEach((e=>{const n=t+e.text.length;if(e.className.length){const r=a.NZ.inline(t,n,{class:e.className.join(" ")});c.push(r)}t=n}))})),a.zF.create(e,c)}const u=(0,s.Qx)({configureRefractor:()=>{}},"prismConfig");u.meta={package:"@milkdown/plugin-prism",displayName:"Ctx<prism>"};const d=(0,s.Gf)((e=>{const{configureRefractor:t}=e.get(u.key),n="code_block";return new o.k_({key:new o.hs("MILKDOWN_PRISM"),state:{init:(e,{doc:r})=>{const o=t(i.L);return c(r,n,o??i.L)},apply:(e,t,o,s)=>{var a,l;const u=s.selection.$head.parent.type.name===n,d=o.selection.$head.parent.type.name===n,p=(0,r.xe)((e=>e.type.name===n))(o.doc),h=(0,r.xe)((e=>e.type.name===n))(s.doc);return e.docChanged&&(u||d||p.length!==h.length||(null==(a=p[0])?void 0:a.node.attrs.language)!==(null==(l=h[0])?void 0:l.node.attrs.language)||e.steps.some((e=>{const t=e;return void 0!==t.from&&void 0!==t.to&&p.some((e=>e.pos>=t.from&&e.pos+e.node.nodeSize<=t.to))})))?c(e.doc,n,i.L):t.map(e.mapping,e.doc)}},props:{decorations(e){return this.getState(e)}}})}));d.meta={package:"@milkdown/plugin-prism",displayName:"Prose<prism>"};const p=[d,u]},30072:(e,t,n)=>{var r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),d=Object.prototype.toString,p=Math.max,h=Math.min,f=function(){return u.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=i.test(e);return n||s.test(e)?a(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,s,a,l,c=0,u=!1,d=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,i=o;return r=o=void 0,c=t,s=e.apply(i,n)}function k(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function w(){var e=f();if(k(e))return v(e);a=setTimeout(w,function(e){var n=t-(e-l);return d?h(n,i-(e-c)):n}(e))}function v(e){return a=void 0,y&&r?b(e):(r=o=void 0,s)}function x(){var e=f(),n=k(e);if(r=arguments,o=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(w,t),u?b(e):s}(l);if(d)return a=setTimeout(w,t),b(l)}return void 0===a&&(a=setTimeout(w,t)),s}return t=g(t)||0,m(n)&&(u=!!n.leading,i=(d="maxWait"in n)?p(g(n.maxWait)||0,t):i,y="trailing"in n?!!n.trailing:y),x.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=o=a=void 0},x.flush=function(){return void 0===a?s:v(f())},x}},30537:(e,t,n)=>{"use strict";n.d(t,{vh:()=>Rt,_r:()=>It,RP:()=>Lt,kD:()=>Ft,pK:()=>Dt,bA:()=>ot,xu:()=>it,Te:()=>Xt,f$:()=>Ct,tt:()=>Nt,lW:()=>At,cq:()=>Tt,kr:()=>Ot,A7:()=>Mt,zF:()=>Pt,$l:()=>et});var r=n(1440),o=n(1854),i=n(80096),s=n(16512),a=n(27647),l=n(81570),c=n(2402),u=n(44254),d=n(25715),p=n(10660),h=n(17884);const f={tokenize:function(e,t,n){let r=0;return function t(i){return(87===i||119===i)&&r<3?(r++,e.consume(i),t):46===i&&3===r?(e.consume(i),o):n(i)};function o(e){return null===e?n(e):t(e)}},partial:!0},m={tokenize:function(e,t,n){let r,o,i;return s;function s(t){return 46===t||95===t?e.check(y,l,a)(t):null===t||(0,h.Ee)(t)||(0,h.Ny)(t)||45!==t&&(0,h.es)(t)?l(t):(i=!0,e.consume(t),s)}function a(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),s}function l(e){return o||r||!i?n(e):t(e)}},partial:!0},g={tokenize:function(e,t){let n=0,r=0;return o;function o(s){return 40===s?(n++,e.consume(s),o):41===s&&r<n?i(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(y,t,i)(s):null===s||(0,h.Ee)(s)||(0,h.Ny)(s)?t(s):(e.consume(s),o)}function i(t){return 41===t&&r++,e.consume(t),o}},partial:!0},y={tokenize:function(e,t,n){return r;function r(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),r):38===s?(e.consume(s),i):93===s?(e.consume(s),o):60===s||null===s||(0,h.Ee)(s)||(0,h.Ny)(s)?t(s):n(s)}function o(e){return null===e||40===e||91===e||(0,h.Ee)(e)||(0,h.Ny)(e)?t(e):r(e)}function i(e){return(0,h.CW)(e)?s(e):n(e)}function s(t){return 59===t?(e.consume(t),r):(0,h.CW)(t)?(e.consume(t),s):n(t)}},partial:!0},b={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return(0,h.lV)(e)?n(e):t(e)}},partial:!0},k={tokenize:function(e,t,n){const r=this;return function(t){return 87!==t&&119!==t||!C.call(r,r.previous)||T(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(f,e.attempt(m,e.attempt(g,o),n),n)(t))};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:C},w={tokenize:function(e,t,n){const r=this;let o="",i=!1;return function(t){return 72!==t&&104!==t||!A.call(r,r.previous)||T(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),s)};function s(t){if((0,h.CW)(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),s;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),a}return n(t)}function a(t){return 47===t?(e.consume(t),i?l:(i=!0,a)):n(t)}function l(t){return null===t||(0,h.JQ)(t)||(0,h.Ee)(t)||(0,h.Ny)(t)||(0,h.es)(t)?n(t):e.attempt(m,e.attempt(g,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:A},v={tokenize:function(e,t,n){const r=this;let o,i;return function(t){return O(t)&&N.call(r,r.previous)&&!T(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(t)):n(t)};function s(t){return O(t)?(e.consume(t),s):64===t?(e.consume(t),a):n(t)}function a(t){return 46===t?e.check(b,c,l)(t):45===t||95===t||(0,h.lV)(t)?(i=!0,e.consume(t),a):c(t)}function l(t){return e.consume(t),o=!0,a}function c(s){return i&&o&&(0,h.CW)(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:N},x={},S={text:x};let E=48;for(;E<123;)x[E]=v,E++,58===E?E=65:91===E&&(E=97);function C(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||(0,h.Ee)(e)}function A(e){return!(0,h.CW)(e)}function N(e){return!(47===e||O(e))}function O(e){return 43===e||45===e||46===e||95===e||(0,h.lV)(e)}function T(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}x[43]=v,x[45]=v,x[46]=v,x[95]=v,x[72]=[v,w],x[104]=[v,w],x[87]=[v,k],x[119]=[v,k];var M=n(35460),D=n(77508),I=n(26243);const R={tokenize:function(e,t,n){const r=this;return(0,D.N)(e,(function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function F(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){s=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!s||!s._balanced)return n(o);const a=(0,I.B)(r.sliceSerialize({start:s.end,end:r.now()}));return 94===a.codePointAt(0)&&i.includes(a.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)):n(o)}}function L(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[r+1],e[r+2],["enter",o,t],e[r+3],e[r+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(r,e.length-r+1,...l),e}function P(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),a};function a(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(a){if(s>999||93===a&&!i||null===a||91===a||(0,h.Ee)(a))return n(a);if(93===a){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes((0,I.B)(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(a)}return(0,h.Ee)(a)||(i=!0),s++,e.consume(a),92===a?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function B(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,s,a=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(a>999||93===t&&!s||null===t||91===t||(0,h.Ee)(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=(0,I.B)(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return(0,h.Ee)(t)||(s=!0),a++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),a++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),(0,D.N)(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function _(e,t,n){return e.check(M.B,t,e.attempt(R,t,n))}function z(e){e.exit("gfmFootnoteDefinition")}var $=n(43890),j=n(66990),U=n(23796);function H(e){let t=(e||{}).singleTilde;const n={tokenize:function(e,n,r){const o=this.previous,i=this.events;let s=0;return function(t){return 126===o&&"characterEscape"!==i[i.length-1][1].type?r(t):(e.enter("strikethroughSequenceTemporary"),a(t))};function a(i){const l=(0,j.S)(o);if(126===i)return s>1?r(i):(e.consume(i),s++,a);if(s<2&&!t)return r(i);const c=e.exit("strikethroughSequenceTemporary"),u=(0,j.S)(i);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(i)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const o={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",o,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],a=t.parser.constructs.insideSpan.null;a&&(0,$.m)(s,s.length,0,(0,U.W)(a,e.slice(r+1,n),t)),(0,$.m)(s,s.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",o,t]]),(0,$.m)(e,r-1,n-r+3,s),n=r+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class V{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let o=0;if(0!==n||0!==r.length){for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(((e,t)=>e[0]-t[0])),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1])),n.push(this.map[t][2]),e.length=this.map[t][0];n.push([...e]),e.length=0;let r=n.pop();for(;r;)e.push(...r),r=n.pop();this.map.length=0}}function W(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}const K={flow:{null:{tokenize:function(e,t,n){const r=this;let o,i=0,s=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?v:a;return i===v&&r.parser.lazy[r.now().line]?n(e):i(e)};function a(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(o=!0,s+=1),l(e)}(t)}function l(t){return null===t?n(t):(0,h.HP)(t)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):(0,h.On)(t)?(0,D.N)(e,l,"whitespace")(t):(s+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||(0,h.Ee)(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,(0,h.On)(t)?(0,D.N)(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?m(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):w(t)}function f(t){return(0,h.On)(t)?(0,D.N)(e,m,"whitespace")(t):m(t)}function m(t){return 58===t?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(s+=1,g(t)):null===t||(0,h.HP)(t)?k(t):w(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),y(t)):w(t)}function y(t){return 45===t?(e.consume(t),y):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(t))}function b(t){return(0,h.On)(t)?(0,D.N)(e,k,"whitespace")(t):k(t)}function k(n){return 124===n?p(n):(null===n||(0,h.HP)(n))&&o&&i===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):w(n)}function w(e){return n(e)}function v(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||(0,h.HP)(n)?(e.exit("tableRow"),t(n)):(0,h.On)(n)?(0,D.N)(e,x,"whitespace")(n):(e.enter("data"),S(n))}function S(t){return null===t||124===t||(0,h.Ee)(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?E:S)}function E(t){return 92===t||124===t?(e.consume(t),S):S(t)}},resolveAll:function(e,t){let n,r,o,i=-1,s=!0,a=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new V;for(;++i<e.length;){const h=e[i],f=h[1];"enter"===h[0]?"tableHead"===f.type?(u=!1,0!==d&&(G(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(s=!0,o=void 0,l=[0,0,0,0],c=[0,i+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",r,t]])),a="tableDelimiterRow"===f.type?2:r?3:1):!a||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(s?s=!1:(0!==l[1]&&(c[0]=c[1],o=q(p,t,l,a,void 0,o)),l=c,c=[l[1],i,0,0])):(s=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],o=q(p,t,l,a,void 0,o),l=[0,0,0,0]),c[2]=i)):"tableHead"===f.type?(u=!0,d=i):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=i,0!==l[1]?(c[0]=c[1],o=q(p,t,l,a,i,o)):0!==c[1]&&(o=q(p,t,c,a,i,o)),a=0):!a||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=i)}for(0!==d&&G(p,t,d,n,r),p.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=W(t.events,i))}return e}}}};function q(e,t,n,r,o,i){const s=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},J(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const a=J(t.events,n[1]);if(i={type:s,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=J(t.events,n[2]),i=J(t.events,n[3]),s={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",s,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==o&&(i.end=Object.assign({},J(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function G(e,t,n,r,o){const i=[],s=J(t.events,n);o&&(o.end=Object.assign({},s),i.push(["exit",o,t])),r.end=Object.assign({},s),i.push(["exit",r,t]),e.add(n+1,0,i)}function J(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const Y={tokenize:function(e,t,n){const r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o):n(t)};function o(t){return(0,h.Ee)(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(r){return(0,h.HP)(r)?t(r):(0,h.On)(r)?e.check({tokenize:X},t,n)(r):n(r)}}},Z={text:{91:Y}};function X(e,t,n){return(0,D.N)(e,(function(e){return null===e?n(e):t(e)}),"whitespace")}var Q=n(58999),ee=n(37096),te=n(66641),ne=n(15186);const re={}.hasOwnProperty;function oe(e){return"string"==typeof e?new RegExp((0,ee.A)(e),"g"):e}function ie(e){return"function"==typeof e?e:()=>e}const se="phrasing",ae=["autolink","link","image","label"],le={transforms:[function(e){!function(e,t,n,r){let o,i;"string"==typeof t||t instanceof RegExp?(i=[[t,n]],o=r):(i=t,o=n),o||(o={});const s=(0,ne.C)(o.ignore||[]),a=function(e){const t=[];if("object"!=typeof e)throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let n=-1;for(;++n<e.length;)t.push([oe(e[n][0]),ie(e[n][1])])}else{let n;for(n in e)re.call(e,n)&&t.push([oe(n),ie(e[n])])}return t}(i);let l=-1;for(;++l<a.length;)(0,te.VG)(e,"text",c);return e;function c(e,t){let n,r=-1;for(;++r<t.length;){const e=t[r];if(s(e,n?n.children.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=a[l][0],o=a[l][1];let i=0;const s=n.children.indexOf(e);let c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){const n=d.index,s={index:d.index,input:d.input,stack:[...t,e]};let a=o(...d,s);if("string"==typeof a&&(a=a.length>0?{type:"text",value:a}:void 0),!1!==a&&(i!==n&&u.push({type:"text",value:e.value.slice(i,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),i=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}return c?(i<e.value.length&&u.push({type:"text",value:e.value.slice(i)}),n.children.splice(s,1,...u)):u=[e],s+u.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,de],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,pe]],{ignore:["link","linkReference"]})}],enter:{literalAutolink:function(e){this.enter({type:"link",title:null,url:"",children:[]},e)},literalAutolinkEmail:ue,literalAutolinkHttp:ue,literalAutolinkWww:ue},exit:{literalAutolink:function(e){this.exit(e)},literalAutolinkEmail:function(e){this.config.exit.autolinkEmail.call(this,e)},literalAutolinkHttp:function(e){this.config.exit.autolinkProtocol.call(this,e)},literalAutolinkWww:function(e){this.config.exit.data.call(this,e),this.stack[this.stack.length-1].url="http://"+this.sliceSerialize(e)}}},ce={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:se,notInConstruct:ae},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:se,notInConstruct:ae},{character:":",before:"[ps]",after:"\\/",inConstruct:se,notInConstruct:ae}]};function ue(e){this.config.enter.autolinkProtocol.call(this,e)}function de(e,t,n,r,o){let i="";if(!he(o))return!1;if(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}(n))return!1;const s=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=(0,Q.D)(e,"(");let i=(0,Q.D)(e,")");for(;-1!==r&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function pe(e,t,n,r){return!(!he(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function he(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||(0,h.Ny)(n)||(0,h.es)(n))&&(!t||47!==n)}var fe=n(47938);function me(e){return e.label||!e.identifier?e.label||"":(0,fe.s)(e.identifier)}function ge(e,t,n,r){let o=r.join.length;for(;o--;){const i=r.join[o](e,t,n,r);if(!0===i||1===i)break;if("number"==typeof i)return"\n".repeat(1+i);if(!1===i)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const ye=/\r?\n|\r/g;function be(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function ke(e,t){return we(e,t.inConstruct,!0)&&!we(e,t.notInConstruct,!1)}function we(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ve(e,t,n){const r=(n.before||"")+(t||"")+(n.after||""),o=[],i=[],s={};let a=-1;for(;++a<e.unsafe.length;){const t=e.unsafe[a];if(!ke(e.stack,t))continue;const n=be(t);let i;for(;i=n.exec(r);){const e="before"in t||Boolean(t.atBreak),n="after"in t,r=i.index+(e?i[1].length:0);o.includes(r)?(s[r].before&&!e&&(s[r].before=!1),s[r].after&&!n&&(s[r].after=!1)):(o.push(r),s[r]={before:e,after:n})}}o.sort(xe);let l=n.before?n.before.length:0;const c=r.length-(n.after?n.after.length:0);for(a=-1;++a<o.length;){const e=o[a];e<l||e>=c||e+1<c&&o[a+1]===e+1&&s[e].after&&!s[e+1].before&&!s[e+1].after||o[a-1]===e-1&&s[e].before&&!s[e-1].before&&!s[e-1].after||(l!==e&&i.push(Se(r.slice(l,e),"\\")),l=e,!/[!-/:-@[-`{-~]/.test(r.charAt(e))||n.encode&&n.encode.includes(r.charAt(e))?(i.push("&#x"+r.charCodeAt(e).toString(16).toUpperCase()+";"),l++):i.push("\\"))}return i.push(Se(r.slice(l,c),n.after)),i.join("")}function xe(e,t){return e-t}function Se(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],o=[],i=e+t;let s,a=-1,l=0;for(;s=n.exec(i);)r.push(s.index);for(;++a<r.length;)l!==r[a]&&o.push(e.slice(l,r[a])),o.push("\\"),l=r[a];return o.push(e.slice(l)),o.join("")}function Ee(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,o=n.line||1,i=n.column||1;return{move:function(e){const t=e||"",n=t.split(/\r?\n|\r/g),s=n[n.length-1];return o+=n.length-1,i=1===n.length?i+s.length:1+s.length+r,t},current:function(){return{now:{line:o,column:i},lineShift:r}},shift:function(e){r+=e}}}function Ce(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ae(){this.buffer()}function Ne(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,I.B)(this.sliceSerialize(e)).toLowerCase()}function Oe(e){this.exit(e)}function Te(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Me(){this.buffer()}function De(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,I.B)(this.sliceSerialize(e)).toLowerCase()}function Ie(e){this.exit(e)}function Re(e,t,n,r){const o=Ee(r);let i=o.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return i+=o.move(ve(n,me(e),{...o.current(),before:i,after:"]"})),a(),s(),i+=o.move("]"),i}function Fe(e,t,n,r){const o=Ee(r);let i=o.move("[^");const s=n.enter("footnoteDefinition"),a=n.enter("label");return i+=o.move(ve(n,me(e),{...o.current(),before:i,after:"]"})),a(),i+=o.move("]:"+(e.children&&e.children.length>0?" ":"")),o.shift(4),i+=o.move(function(e,t){const n=[];let r,o=0,i=0;for(;r=ye.exec(e);)s(e.slice(o,r.index)),n.push(r[0]),o=r.index+r[0].length,i++;return s(e.slice(o)),n.join("");function s(e){n.push(t(e,i,!e))}}(function(e,t,n){const r=t.indexStack,o=e.children||[],i=t.createTracker(n),s=[];let a=-1;for(r.push(-1);++a<o.length;){const n=o[a];r[r.length-1]=a,s.push(i.move(t.handle(n,e,t,{before:"\n",after:"\n",...i.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),a<o.length-1&&s.push(i.move(ge(n,o[a+1],e,t)))}return r.pop(),s.join("")}(e,n,o.current()),Le)),s(),i}function Le(e,t,n){return 0===t?e:(n?"":" ")+e}function Pe(e,t,n){const r=t.indexStack,o=e.children||[],i=[];let s=-1,a=n.before;r.push(-1);let l=t.createTracker(n);for(;++s<o.length;){const c=o[s];let u;if(r[r.length-1]=s,s+1<o.length){let n=t.handle.handlers[o[s+1].type];n&&n.peek&&(n=n.peek),u=n?n(o[s+1],e,t,{before:"",after:"",...l.current()}).charAt(0):""}else u=n.after;i.length>0&&("\r"===a||"\n"===a)&&"html"===c.type&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=t.createTracker(n),l.move(i.join(""))),i.push(l.move(t.handle(c,e,t,{...l.current(),before:a,after:u}))),a=i[i.length-1].slice(-1)}return r.pop(),i.join("")}Re.peek=function(){return"["},ze.peek=function(){return"~"};const Be={canContainEols:["delete"],enter:{strikethrough:function(e){this.enter({type:"delete",children:[]},e)}},exit:{strikethrough:function(e){this.exit(e)}}},_e={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"]}],handlers:{delete:ze}};function ze(e,t,n,r){const o=Ee(r),i=n.enter("strikethrough");let s=o.move("~~");return s+=Pe(e,n,{...o.current(),before:s,after:"~"}),s+=o.move("~~"),i(),s}function $e(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=be(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}$e.peek=function(){return"`"};var je=n(67395);const Ue={enter:{table:function(e){const t=e._align;this.enter({type:"table",align:t.map((e=>"none"===e?null:e)),children:[]},e),this.setData("inTable",!0)},tableData:Ve,tableHeader:Ve,tableRow:function(e){this.enter({type:"tableRow",children:[]},e)}},exit:{codeText:function(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,We)),this.stack[this.stack.length-1].value=t,this.exit(e)},table:function(e){this.exit(e),this.setData("inTable")},tableData:He,tableHeader:He,tableRow:He}};function He(e){this.exit(e)}function Ve(e){this.enter({type:"tableCell",children:[]},e)}function We(e,t){return"|"===t?t:e}function Ke(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:function(e,t,n,r){return a(function(e,t,n){const r=e.children;let o=-1;const i=[],s=t.enter("table");for(;++o<r.length;)i[o]=l(r[o],t,n);return s(),i}(e,n,r),e.align)},tableRow:function(e,t,n,r){const o=a([l(e,n,r)]);return o.slice(0,o.indexOf("\n"))},tableCell:s,inlineCode:function(e,t,n){let r=$e(e,0,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r}}};function s(e,t,n,r){const o=n.enter("tableCell"),s=n.enter("phrasing"),a=Pe(e,n,{...r,before:i,after:i});return s(),o(),a}function a(e,t){return(0,je.Q)(e,{align:t,alignDelimiters:r,padding:n,stringLength:o})}function l(e,t,n){const r=e.children;let o=-1;const i=[],a=t.enter("tableRow");for(;++o<r.length;)i[o]=s(r[o],0,t,n);return a(),i}}const qe={exit:{taskListCheckValueChecked:Je,taskListCheckValueUnchecked:Je,paragraph:function(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1],n=e.children[0];if(n&&"text"===n.type){const r=t.children;let o,i=-1;for(;++i<r.length;){const e=r[i];if("paragraph"===e.type){o=e;break}}o===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}}},Ge={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:function(e,t,n,r){const o=e.children[0],i="boolean"==typeof e.checked&&o&&"paragraph"===o.type,s="["+(e.checked?"x":" ")+"] ",a=Ee(r);i&&a.move(s);let l=function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"tab";if(1===t||"1"===t)return"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||function(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let s=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));const a=n.createTracker(r);a.move(i+" ".repeat(s-i.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),(function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?i:i+" ".repeat(s-i.length))+e}));return l(),c}(e,t,n,{...r,...a.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,(function(e){return e+s}))),l}}};function Je(e){this.stack[this.stack.length-2].checked="taskListCheckValueChecked"===e.type}function Ye(e={}){const t=this.data();function n(e,n){(t[e]?t[e]:t[e]=[]).push(n)}n("micromarkExtensions",function(e){return(0,p.y)([S,{document:{91:{tokenize:B,continuation:{tokenize:_},exit:z}},text:{91:{tokenize:P},93:{add:"after",tokenize:F,resolveTo:L}}},H(e),K,Z])}(e)),n("fromMarkdownExtensions",[le,{enter:{gfmFootnoteDefinition:Ce,gfmFootnoteDefinitionLabelString:Ae,gfmFootnoteCall:Te,gfmFootnoteCallString:Me},exit:{gfmFootnoteDefinition:Oe,gfmFootnoteDefinitionLabelString:Ne,gfmFootnoteCall:Ie,gfmFootnoteCallString:De}},Be,Ue,qe]),n("toMarkdownExtensions",function(e){return{extensions:[ce,{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:Fe,footnoteReference:Re}},_e,Ke(e),Ge]}}(e))}const Ze=(e,t)=>(Object.assign(e,{meta:{package:"@milkdown/preset-gfm",...t}}),e),Xe=(0,s.JY)("strike_through");Ze(Xe,{displayName:"Attr<strikethrough>",group:"Strikethrough"});const Qe=(0,s.hk)("strike_through",(e=>({inclusive:!1,parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>"line-through"===e}],toDOM:t=>["del",e.get(Xe.key)(t)],parseMarkdown:{match:e=>"delete"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strike_through"===e.type.name,runner:(e,t)=>{e.withMark(t,"delete")}}})));Ze(Qe.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"}),Ze(Qe.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});const et=(0,s.yu)("ToggleStrikeThrough",(()=>()=>(0,d.wh)(Qe.type())));Ze(et,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});const tt=(0,s.pq)("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:e=>{const t=e.get(a.MD);return()=>t.call(et.key)}}});Ze(tt.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"}),Ze(tt.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});const nt=(e=3,t=3)=>{const n=Array(t).fill(0).map((()=>kt.type().createAndFill())),r=Array(t).fill(0).map((()=>wt.type().createAndFill())),o=Array(e).fill(0).map(((e,t)=>bt.type().create(null,0===t?r:n)));return yt.type().create(null,o)},rt=e=>(0,u.KP)((e=>"table"===e.type.spec.tableRole))(e),ot=(e,t)=>{const n=rt(t);if(!n)return;const r=c.J3.get(n.node);return e<0||e>=r.width?void 0:r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map((e=>{const t=n.node.nodeAt(e);if(!t)return;const r=e+n.start;return{pos:r,start:r+1,node:t}})).filter((e=>null!=e))},it=(e,t)=>{const n=rt(t);if(!n)return;const r=c.J3.get(n.node);return e<0||e>=r.height?void 0:r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map((e=>{const t=n.node.nodeAt(e);if(!t)return;const r=e+n.start;return{pos:r,start:r+1,node:t}})).filter((e=>null!=e))};function st(e,{map:t,tableStart:n,table:r},o){const i=Array(o).fill(0).reduce(((e,t,n)=>e+r.child(n).nodeSize),n),s=Array(t.width).fill(0).map(((e,n)=>{const o=r.nodeAt(t.map[n]);return kt.type().createAndFill({alignment:null==o?void 0:o.attrs.alignment})}));return e.insert(i,bt.type().create(null,s)),e}const at=e=>t=>n=>{const r=rt(n.selection),o="row"===e;if(r){const e=c.J3.get(r.node);if(t>=0&&t<(o?e.height:e.width)){const i=e.positionAt(o?t:e.height-1,o?e.width-1:t,r.node),s=n.doc.resolve(r.start+i),a=o?c.rn.rowSelection:c.rn.colSelection,l=e.positionAt(o?t:0,o?0:t,r.node),d=n.doc.resolve(r.start+l);return(0,u.I9)(n.setSelection(a(s,d)))}}return n},lt=at("row"),ct=at("col"),ut=e=>e[0].map(((t,n)=>e.map((e=>e[n])))),dt=(e,t)=>{const n=[],r=c.J3.get(e);for(let o=0;o<r.height;o++){const i=e.child(o),s=[];for(let n=0;n<r.width;n++){if(!t[o][n])continue;const i=r.map[o*r.width+n],a=t[o][n],l=e.nodeAt(i).type.createChecked(Object.assign({},a.attrs),a.content,a.marks);s.push(l)}n.push(i.type.createChecked(i.attrs,s,i.marks))}return e.type.createChecked(e.attrs,n,e.marks)},pt=e=>{const t=c.J3.get(e),n=[];for(let r=0;r<t.height;r++){const o=[],i={};for(let n=0;n<t.width;n++){const s=t.map[r*t.width+n],a=e.nodeAt(s),l=t.findCell(s);i[s]||l.top!==r?o.push(null):(i[s]=!0,o.push(a))}n.push(o)}return n},ht=(e,t,n,r)=>{const o=t[0]>n[0]?-1:1,i=e.splice(t[0],t.length),s=i.length%2==0?1:0;let a;return a=-1===r&&1===o?n[0]-1:1===r&&-1===o?n[n.length-1]-s+1:-1===o?n[0]:n[n.length-1]-s,e.splice(a,0,...i),e},ft=(e,t)=>{let n=e,r=e;for(let o=e;o>=0;o--){const e=ot(o,t.selection);e&&e.forEach((e=>{const t=e.node.attrs.colspan+o-1;t>=n&&(n=o),t>r&&(r=t)}))}for(let n=e;n<=r;n++){const e=ot(n,t.selection);e&&e.forEach((e=>{const t=e.node.attrs.colspan+n-1;e.node.attrs.colspan>1&&t>r&&(r=t)}))}const o=[];for(let e=n;e<=r;e++){const n=ot(e,t.selection);n&&n.length&&o.push(e)}n=o[0],r=o[o.length-1];const i=ot(n,t.selection),s=it(0,t.selection),a=t.doc.resolve(i[i.length-1].pos);let l;for(let e=r;e>=n;e--){const n=ot(e,t.selection);if(n&&n.length){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){l=n[0];break}if(l)break}}return{$anchor:a,$head:t.doc.resolve(l.pos),indexes:o}},mt=(e,t)=>{let n=e,r=e;for(let o=e;o>=0;o--)it(o,t.selection).forEach((e=>{const t=e.node.attrs.rowspan+o-1;t>=n&&(n=o),t>r&&(r=t)}));for(let n=e;n<=r;n++)it(n,t.selection).forEach((e=>{const t=e.node.attrs.rowspan+n-1;e.node.attrs.rowspan>1&&t>r&&(r=t)}));const o=[];for(let e=n;e<=r;e++){const n=it(e,t.selection);n&&n.length&&o.push(e)}n=o[0],r=o[o.length-1];const i=it(n,t.selection),s=ot(0,t.selection),a=t.doc.resolve(i[i.length-1].pos);let l;for(let e=r;e>=n;e--){const n=it(e,t.selection);if(n&&n.length){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){l=n[0];break}if(l)break}}return{$anchor:a,$head:t.doc.resolve(l.pos),indexes:o}};const gt=(0,c.of)({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:e=>e.style.textAlign||"left",setDOMAttr:(e,t)=>{t.style=`text-align: ${e||"left"}`}}}}),yt=(0,s.Yh)("table",(()=>({...gt.table,parseMarkdown:{match:e=>"table"===e.type,runner:(e,t,n)=>{const r=t.align,o=t.children.map(((e,t)=>({...e,align:r,isHeader:0===t})));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table"===e.type.name,runner:(e,t)=>{var n;const r=null==(n=t.content.firstChild)?void 0:n.content;if(!r)return;const o=[];r.forEach((e=>{o.push(e.attrs.alignment)})),e.openNode("table",void 0,{align:o}),e.next(t.content),e.closeNode()}}})));Ze(yt.node,{displayName:"NodeSchema<table>",group:"Table"}),Ze(yt.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});const bt=(0,s.Yh)("table_row",(()=>({...gt.table_row,parseMarkdown:{match:e=>"tableRow"===e.type,runner:(e,t,n)=>{const r=t.align,o=t.children.map(((e,n)=>({...e,align:r[n],isHeader:t.isHeader})));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table_row"===e.type.name,runner:(e,t)=>{e.openNode("tableRow"),e.next(t.content),e.closeNode()}}})));Ze(bt.node,{displayName:"NodeSchema<tableRow>",group:"Table"}),Ze(bt.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});const kt=(0,s.Yh)("table_cell",(()=>({...gt.table_cell,parseMarkdown:{match:e=>"tableCell"===e.type&&!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>"table_cell"===e.type.name,runner:(e,t)=>{e.openNode("tableCell").next(t.content).closeNode()}}})));Ze(kt.node,{displayName:"NodeSchema<tableCell>",group:"Table"}),Ze(kt.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});const wt=(0,s.Yh)("table_header",(()=>({...gt.table_header,parseMarkdown:{match:e=>"tableCell"===e.type&&!!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>"table_header"===e.type.name,runner:(e,t)=>{e.openNode("tableCell"),e.next(t.content),e.closeNode()}}})));Ze(wt.node,{displayName:"NodeSchema<tableHeader>",group:"Table"}),Ze(wt.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});const vt=(0,s.b_)((()=>new i.fV(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,((e,t,n,r)=>{var o,i;const s=e.doc.resolve(n);if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),yt.type()))return null;const a=nt(Number(null==(o=t.groups)?void 0:o.row),Number(null==(i=t.groups)?void 0:i.col)),c=e.tr.replaceRangeWith(n,r,a).scrollIntoView();return c.setSelection(l.U3.create(c.doc,n+3))}))));Ze(vt,{displayName:"InputRule<insertTableInputRule>",group:"Table"});const xt=(0,s.yu)("GoToPrevTableCell",(()=>()=>(0,c.D8)(-1)));Ze(xt,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});const St=(0,s.yu)("GoToNextTableCell",(()=>()=>(0,c.D8)(1)));Ze(St,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});const Et=(0,s.yu)("BreakTable",(()=>()=>(e,t)=>{if(!(0,c.aH)(e))return!1;const{$head:n}=e.selection,r=n.after(),i=e.tr.replaceWith(r,r,o.Wf.type().createAndFill());return i.setSelection(l.LN.near(i.doc.resolve(r),1)).scrollIntoView(),null==t||t(i),!0}));Ze(Et,{displayName:"Command<breakTableCommand>",group:"Table"});const Ct=(0,s.yu)("InsertTable",(()=>({row:e,col:t}={})=>(n,r)=>{const{selection:o,tr:i}=n,{from:s}=o,a=nt(e,t),c=i.replaceSelectionWith(a),u=l.LN.findFrom(c.doc.resolve(s),1,!0);return u&&(null==r||r(c.setSelection(u))),!0}));Ze(Ct,{displayName:"Command<insertTableCommand>",group:"Table"});const At=(0,s.yu)("MoveRow",(()=>({from:e,to:t}={})=>(n,r)=>{const{tr:o}=n,i=null==r?void 0:r(function(e,t,n,r=!0){const o=rt(e.selection);if(!o)return e;const{indexes:i}=mt(t,e),{indexes:s}=mt(n,e);if(i.includes(n))return e;const a=((e,t,n)=>{let r=pt(e.node);return r=ht(r,t,n,0),dt(e.node,r)})(o,i,s),l=(0,u.I9)(e).replaceWith(o.pos,o.pos+o.node.nodeSize,a);if(!r)return l;const d=c.J3.get(a),p=o.start,h=n,f=d.positionAt(h,d.width-1,a),m=l.doc.resolve(p+f),g=c.rn.rowSelection,y=d.positionAt(h,0,a),b=l.doc.resolve(p+y);return l.setSelection(g(m,b))}(o,e??0,t??0,!0));return Boolean(i)}));Ze(At,{displayName:"Command<moveRowCommand>",group:"Table"});const Nt=(0,s.yu)("MoveCol",(()=>({from:e,to:t}={})=>(n,r)=>{const{tr:o}=n,i=null==r?void 0:r(function(e,t,n,r=!0){const o=rt(e.selection);if(!o)return e;const{indexes:i}=ft(t,e),{indexes:s}=ft(n,e);if(i.includes(n))return e;const a=((e,t,n)=>{let r=ut(pt(e.node));return r=ht(r,t,n,0),r=ut(r),dt(e.node,r)})(o,i,s),l=(0,u.I9)(e).replaceWith(o.pos,o.pos+o.node.nodeSize,a);if(!r)return l;const d=c.J3.get(a),p=o.start,h=n,f=d.positionAt(d.height-1,h,a),m=l.doc.resolve(p+f),g=c.rn.colSelection,y=d.positionAt(0,h,a),b=l.doc.resolve(p+y);return l.setSelection(g(m,b))}(o,e??0,t??0,!0));return Boolean(i)}));Ze(Nt,{displayName:"Command<moveColCommand>",group:"Table"});const Ot=(0,s.yu)("SelectRow",(()=>(e=0)=>(t,n)=>{const{tr:r}=t,o=null==n?void 0:n(lt(e)(r));return Boolean(o)}));Ze(Ot,{displayName:"Command<selectRowCommand>",group:"Table"});const Tt=(0,s.yu)("SelectCol",(()=>(e=0)=>(t,n)=>{const{tr:r}=t,o=null==n?void 0:n(ct(e)(r));return Boolean(o)}));Ze(Tt,{displayName:"Command<selectColCommand>",group:"Table"});const Mt=(0,s.yu)("SelectTable",(()=>()=>(e,t)=>{const{tr:n}=e,r=null==t?void 0:t((e=>{const t=(e=>{const t=rt(e);if(!t)return;const n=c.J3.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map((e=>{const n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}}))})(e.selection);if(t&&t[0]){const n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){const t=e.doc.resolve(r.pos);return(0,u.I9)(e.setSelection(new c.rn(t,n)))}}return e})(n));return Boolean(r)}));Ze(Mt,{displayName:"Command<selectTableCommand>",group:"Table"});const Dt=(0,s.yu)("DeleteSelectedCells",(()=>()=>(e,t)=>{const{selection:n}=e;if(!(n instanceof c.rn))return!1;const r=n.isRowSelection(),o=n.isColSelection();return r&&o?(0,c.kG)(e,t):o?(0,c.gR)(e,t):(0,c.aR)(e,t)}));Ze(Dt,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});const It=(0,s.yu)("AddColBefore",(()=>()=>c.RC));Ze(It,{displayName:"Command<addColBeforeCommand>",group:"Table"});const Rt=(0,s.yu)("AddColAfter",(()=>()=>c.GU));Ze(Rt,{displayName:"Command<addColAfterCommand>",group:"Table"});const Ft=(0,s.yu)("AddRowBefore",(()=>()=>(e,t)=>{if(!(0,c.aH)(e))return!1;if(t){const n=(0,c._t)(e);t(st(e.tr,n,n.top))}return!0}));Ze(Ft,{displayName:"Command<addRowBeforeCommand>",group:"Table"});const Lt=(0,s.yu)("AddRowAfter",(()=>()=>(e,t)=>{if(!(0,c.aH)(e))return!1;if(t){const n=(0,c._t)(e);t(st(e.tr,n,n.bottom))}return!0}));Ze(Lt,{displayName:"Command<addRowAfterCommand>",group:"Table"});const Pt=(0,s.yu)("SetAlign",(()=>(e="left")=>(0,c.i4)("alignment",e)));Ze(Pt,{displayName:"Command<setAlignCommand>",group:"Table"});const Bt=(0,s.pq)("tableKeymap",{NextCell:{shortcuts:["Mod-]","Tab"],command:e=>{const t=e.get(a.MD);return()=>t.call(St.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:e=>{const t=e.get(a.MD);return()=>t.call(xt.key)}},ExitTable:{shortcuts:["Mod-Enter"],command:e=>{const t=e.get(a.MD);return()=>t.call(Et.key)}}});Ze(Bt.ctx,{displayName:"KeymapCtx<table>",group:"Table"}),Ze(Bt.shortcuts,{displayName:"Keymap<table>",group:"Table"});const _t="footnote_definition",zt="footnoteDefinition",$t=(0,s.Yh)("footnote_definition",(()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:""}},parseDOM:[{tag:`dl[data-type="${_t}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,r.Ik)(e);return{label:e.dataset.label}},contentElement:"dd"}],toDOM:e=>{const t=e.attrs.label;return["dl",{"data-label":t,"data-type":_t},["dt",t],["dd",0]]},parseMarkdown:{match:({type:e})=>e===zt,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===_t,runner:(e,t)=>{e.openNode(zt,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}})));Ze($t.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"}),Ze($t.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});const jt="footnote_reference",Ut=(0,s.Yh)("footnote_reference",(()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:""}},parseDOM:[{tag:`sup[data-type="${jt}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,r.Ik)(e);return{label:e.dataset.label}}}],toDOM:e=>{const t=e.attrs.label;return["sup",{"data-label":t,"data-type":jt},t]},parseMarkdown:{match:({type:e})=>"footnoteReference"===e,runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===jt,runner:(e,t)=>{e.addNode("footnoteReference",void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}})));Ze(Ut.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"}),Ze(Ut.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});const Ht=o.hm.extendSchema((e=>t=>{const n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,r.Ik)(e);return{label:e.dataset.label,listType:e.dataset["list-type"],spread:e.dataset.spread,checked:e.dataset.checked?"true"===e.dataset.checked:null}}},...(null==n?void 0:n.parseDOM)||[]],toDOM:e=>n.toDOM&&null==e.attrs.checked?n.toDOM(e):["li",{"data-item-type":"task","data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread,"data-checked":e.attrs.checked},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,r)=>{if(null==t.checked)return void n.parseMarkdown.runner(e,t,r);const o=null!=t.label?`${t.label}.`:"•",i=null!=t.checked?Boolean(t.checked):null,s=null!=t.label?"ordered":"bullet",a=null!=t.spread?`${t.spread}`:"true";e.openNode(r,{label:o,listType:s,spread:a,checked:i}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{if(null==t.attrs.checked)return void n.toMarkdown.runner(e,t);const r=t.attrs.label,o=t.attrs.listType,i="true"===t.attrs.spread,s=t.attrs.checked;e.openNode("listItem",void 0,{label:r,listType:o,spread:i,checked:s}),e.next(t.content),e.closeNode()}}}}));Ze(Ht,{displayName:"NodeSchema<listItem>",group:"ListItem"});const Vt=(0,s.b_)((()=>new i.fV(/^\[(?<checked>\s|x)\]\s$/,((e,t,n,r)=>{var o;const i=e.doc.resolve(n);let s=0,a=i.node(s);for(;a&&"list_item"!==a.type.name;)s--,a=i.node(s);if(!a||null!=a.attrs.checked)return null;const l=Boolean("x"===(null==(o=t.groups)?void 0:o.checked)),c=i.before(s),u=e.tr;return u.deleteRange(n,r).setNodeMarkup(c,void 0,{...a.attrs,checked:l}),u}))));Ze(Vt,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});const Wt=[tt,Bt].flat(),Kt=[vt,Vt],qt=(0,s.Gf)((()=>{const e=new l.hs("MILKDOWN_AUTO_INSERT_ZERO_SPACE"),t=e=>e.type===o.Wf.type();return new l.k_({key:e,props:{handleDOMEvents:{compositionstart(e){const{state:n,dispatch:r}=e,{tr:o,selection:i}=n,{$from:s}=i;return u.T.safari&&(0,c.aH)(n)&&i.empty&&(e=>t(e)&&2===e.nodeSize)(s.parent)&&r(o.insertText("⁠",s.start())),!1},compositionend(e){const{state:n,dispatch:r}=e,{tr:o,selection:i}=n,{$from:s}=i;return u.T.safari&&(0,c.aH)(n)&&i.empty&&t(s.parent)&&s.parent.textContent.startsWith("⁠")&&r(o.delete(s.start(),s.start()+1)),!1}}}})}));Ze(qt,{displayName:"Prose<autoInsertZeroSpaceInTablePlugin>",group:"Prose"});const Gt=(0,s.Gf)((()=>(0,c.AL)({})));Ze(Gt,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});const Jt=(0,s.Gf)((()=>(0,c.LF)()));Ze(Jt,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});const Yt=(0,s.lz)((()=>Ye));Ze(Yt,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"});const Zt=[qt,Gt,Jt,Yt],Xt=[[Ht,yt,bt,wt,kt,$t,Ut,Xe,Qe].flat(),Kt,Wt,Zt,[St,xt,Et,Ct,At,Nt,Ot,Tt,Mt,Dt,Ft,Lt,It,Rt,Pt,et]].flat()},33971:(e,t,n)=>{"use strict";n.d(t,{vo:()=>D,e2:()=>y,$X:()=>k,hi:()=>x,Uv:()=>E,W4:()=>N,rJ:()=>T});var r,o,i,s,a=n(18769),l=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},c=(e,t,n)=>(((e,t)=>{if(!t.has(e))throw TypeError("Cannot access private method")})(e,t),n);class u{constructor({node:e,view:t,getPos:n,decorations:o,innerDecorations:i,options:s}){l(this,r),this.selected=!1,this.selectNode=()=>{var e,t;this.selected=!0,null==(t=(e=this.options).selectNode)||t.call(e)},this.deselectNode=()=>{var e,t;this.selected=!1,null==(t=(e=this.options).deselectNode)||t.call(e)},this.shouldUpdate=e=>!(e.type!==this.node.type||e.sameMarkup(this.node)&&e.content.eq(this.node.content)),this.update=(e,t,n)=>{var r,o;const i=this.options.update;let s;return i&&(s=i(e,t,n)),"boolean"!=typeof s&&(s=this.shouldUpdate(e)),this.node=e,this.decorations=t,this.innerDecorations=n,s&&(null==(o=(r=this.options).onUpdate)||o.call(r)),s},this.shouldIgnoreMutation=e=>!(this.dom&&this.contentDOM&&!this.node.isLeaf&&!this.node.isAtom)||"selection"!==e.type&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)),this.ignoreMutation=e=>{if(!this.dom||!this.contentDOM)return!0;let t;const n=this.options.ignoreMutation;return n&&(t=n(e)),"boolean"!=typeof t&&(t=this.shouldIgnoreMutation(e)),t},this.destroy=()=>{var e,t,n;null==(t=(e=this.options).destroy)||t.call(e),this.dom.remove(),null==(n=this.contentDOM)||n.remove()},this.setAttrs=e=>{const{dispatch:t,state:n}=this.view,r=this.getPos();if("number"==typeof r)return t(n.tr.setNodeMarkup(r,void 0,{...this.node.attrs,...e}))},this.node=e,this.view=t,this.getPos=n,this.decorations=o,this.innerDecorations=i,this.options=s,this.dom=this.createDOM(s.as),this.contentDOM=e.isLeaf?null:this.createContentDOM(s.contentAs),this.dom.setAttribute("data-node-view-root","true"),this.contentDOM&&(this.contentDOM.setAttribute("data-node-view-content","true"),this.contentDOM.style.whiteSpace="inherit"),this.setSelection=s.setSelection,this.stopEvent=s.stopEvent}createDOM(e){return c(this,r,o).call(this,e)}createContentDOM(e){return c(this,r,o).call(this,e)}get component(){return this.options.component}}r=new WeakSet,o=function(e){const{node:t}=this;return null==e?document.createElement(t.isInline?"span":"div"):e instanceof HTMLElement?e:e instanceof Function?e(t):document.createElement(e)};class d{constructor(e){this.view=e.view,this.options=e.options}get component(){return this.options.component}get root(){var e,t;let n=null==(t=(e=this.options).root)?void 0:t.call(e,this.view.dom);return n||(n=this.view.dom.parentElement??document.body),n}update(e,t){var n,r;this.view=e,this.prevState=t,null==(r=(n=this.options).update)||r.call(n,e,t)}destroy(){var e,t;null==(t=(e=this.options).destroy)||t.call(e)}}class p{constructor({pos:e,spec:t,options:n}){l(this,i),this.pos=e,this.options=n,this.spec=t,this.dom=c(this,i,s).call(this,n.as),this.dom.setAttribute("data-widget-view-root","true")}bind(e,t){this.view=e,this.getPos=t}get component(){return this.options.component}}i=new WeakSet,s=function(e){return e instanceof HTMLElement?e:document.createElement(e)};var h=n(99742),f=n(59435),m=n(73686);const g=(0,a.createContext)({contentRef:()=>{},view:null,getPos:()=>0,setAttrs:()=>{},node:null,selected:!1,decorations:[],innerDecorations:null}),y=()=>(0,a.useContext)(g),b=(0,a.createContext)((e=>{throw new Error("out of scope")})),k=()=>(0,a.useContext)(b);class w extends u{constructor(){super(...arguments),this.key=(0,h.Ak)(),this.context={contentRef:e=>{e&&this.contentDOM&&e.firstChild!==this.contentDOM&&e.appendChild(this.contentDOM)},view:this.view,getPos:this.getPos,setAttrs:this.setAttrs,node:this.node,selected:this.selected,decorations:this.decorations,innerDecorations:this.innerDecorations},this.updateContext=()=>{Object.assign(this.context,{node:this.node,selected:this.selected,decorations:this.decorations,innerDecorations:this.innerDecorations})},this.render=()=>{const e=this.component;return(0,f.createPortal)(a.createElement(g.Provider,{value:this.context},a.createElement(e,null)),this.dom,this.key)}}}const v=(0,a.createContext)({view:null}),x=()=>(0,a.useContext)(v),S=(0,a.createContext)((e=>{throw new Error("out of scope")})),E=()=>(0,a.useContext)(S);class C extends d{constructor(){super(...arguments),this.key=(0,h.Ak)(),this.context={view:this.view,prevState:this.prevState},this.updateContext=()=>{Object.assign(this.context,{view:this.view,prevState:this.prevState})},this.render=()=>{const e=this.component;return(0,f.createPortal)(a.createElement(v.Provider,{value:this.context},a.createElement(e,null)),this.root,this.key)}}}const A=(0,a.createContext)({view:null,getPos:()=>{}}),N=()=>(0,a.useContext)(A),O=(0,a.createContext)((e=>{throw new Error("out of scope")})),T=()=>(0,a.useContext)(O);class M extends p{constructor(){super(...arguments),this.key=(0,h.Ak)(),this.context={view:this.view,getPos:this.getPos,spec:this.spec},this.updateContext=()=>{Object.assign(this.context,{view:this.view,getPos:this.getPos,spec:this.spec})},this.render=()=>{const e=this.component;return(0,f.createPortal)(a.createElement(A.Provider,{value:this.context},a.createElement(e,null)),this.dom,this.key)}}}const D=({children:e})=>{const{renderReactRenderer:t,removeReactRenderer:n,portals:r}=(()=>{const[e,t]=(0,a.useState)({}),n=(0,a.useRef)(!1);(0,a.useEffect)((()=>(requestAnimationFrame((()=>{n.current=!0})),()=>{n.current=!1})),[]);const r=(0,a.useCallback)((e=>{n.current?(0,f.flushSync)(e):e()}),[]);return{portals:e,renderReactRenderer:(0,a.useCallback)(((e,n=!0)=>{r((()=>{n&&e.updateContext(),t((t=>({...t,[e.key]:e.render()})))}))}),[r]),removeReactRenderer:(0,a.useCallback)((e=>{r((()=>{t((t=>{const n={...t};return delete n[e.key],n}))}))}),[r])}})(),o=((e,t)=>(0,a.useCallback)((n=>(r,o,i,s,a)=>{const l=new w({node:r,view:o,getPos:i,decorations:s,innerDecorations:a,options:{...n,onUpdate(){var t;null==(t=n.onUpdate)||t.call(n),e(l)},selectNode(){var t;null==(t=n.selectNode)||t.call(n),e(l)},deselectNode(){var t;null==(t=n.deselectNode)||t.call(n),e(l)},destroy(){var e;null==(e=n.destroy)||e.call(n),t(l)}}});return e(l,!1),l}),[t,e]))(t,n),i=((e,t)=>(0,a.useCallback)((n=>r=>{const o=new C({view:r,options:{...n,update:(t,r)=>{var i;null==(i=n.update)||i.call(n,t,r),e(o)},destroy:()=>{var e;null==(e=n.destroy)||e.call(n),t(o)}}});return e(o,!1),o}),[t,e]))(t,n),s=((e,t)=>(0,a.useCallback)((n=>(r,o={})=>{const i=new M({pos:r,options:n}),s={...o,destroy:e=>{var n;null==(n=o.destroy)||n.call(o,e),t(i)}};return i.spec=s,m.NZ.widget(r,((t,n)=>(i.bind(t,n),e(i),i.dom)),s)}),[t,e]))(t,n),l=(0,a.useMemo)((()=>Object.values(r)),[r]);return a.createElement(b.Provider,{value:o},a.createElement(S.Provider,{value:i},a.createElement(O.Provider,{value:s},e,l)))}},35435:(e,t,n)=>{"use strict";n.d(t,{pZ:()=>a});var r=n(81570),o=n(16512);const i=(0,o.Qx)({type:"space",size:2},"indentConfig");i.meta={package:"@milkdown/plugin-indent",displayName:"Ctx<indentConfig>"};const s=(0,o.Ht)((e=>({Tab:(t,n)=>{const o=e.get(i.key),{tr:s}=t,a=((e,t)=>{const{doc:n,selection:o}=e;if(!n||!o||!(o instanceof r.U3||o instanceof r.i5))return e;const{to:i}=o,s="space"===t.type?Array(t.size).fill(" ").join(""):"\t";return e.insertText(s,i)})(s,o);return!!a.docChanged&&(null==n||n(a),!0)}})));s.meta={package:"@milkdown/plugin-indent",displayName:"Shortcut<indent>"};const a=[i,s]},35460:(e,t,n)=>{"use strict";n.d(t,{B:()=>i});var r=n(77508),o=n(17884);const i={tokenize:function(e,t,n){return function(t){return(0,o.On)(t)?(0,r.N)(e,i,"linePrefix")(t):i(t)};function i(e){return null===e||(0,o.HP)(e)?t(e):n(e)}},partial:!0}},37082:(e,t,n)=>{"use strict";n.d(t,{L:()=>Ye});var r={};function o(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}function i(e){e.register(o),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}function s(e){e.register(i),function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(e)}function a(e){e.register(s),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}function l(e){!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],i=r.variable[1].inside,s=0;s<o.length;s++)i[o[s]]=e.languages.bash[o[s]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash}(e)}function c(e){e.register(o),function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,n){return"(?:"+t[+n]+")"}))}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,(function(){return"(?:"+e+")"}));return e.replace(/<<self>>/g,"[^\\s\\S]")}var o="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",i="class enum interface record struct",s="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",a="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(i),u=RegExp(l(o+" "+i+" "+s+" "+a)),d=l(i+" "+s+" "+a),p=l(o+" "+i+" "+a),h=r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),f=r(/\((?:[^()]|<<self>>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,g=t(/<<0>>(?:\s*<<1>>)?/.source,[m,h]),y=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,g]),b=/\[\s*(?:,\s*)*\]/.source,k=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[y,b]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[h,f,b]),v=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),x=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[v,y,b]),S={keyword:u,punctuation:/[<>()?,.:[\]]/},E=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,C=/"(?:\\.|[^\\"\r\n])*"/.source,A=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[C]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[y]),lookbehind:!0,inside:S},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,x]),lookbehind:!0,inside:S},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[c,g]),lookbehind:!0,inside:S},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[y]),lookbehind:!0,inside:S},{pattern:n(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[k]),lookbehind:!0,inside:S},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[x,p,m]),inside:S}],keyword:u,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:S},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[x,y]),inside:S,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[x]),lookbehind:!0,inside:S,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,h]),inside:{function:n(/^<<0>>/.source,[m]),generic:{pattern:RegExp(h),alias:"class-name",inside:S}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,g,m,x,u.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[g,f]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:u,"class-name":{pattern:RegExp(x),greedy:!0,inside:S},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var N=C+"|"+E,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[N]),T=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[O]),2),M=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,D=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[y,T]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[M,D]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[M]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[T]),inside:e.languages.csharp},"class-name":{pattern:RegExp(y),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var I=/:[^}\r\n]+/.source,R=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[O]),2),F=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[R,I]),L=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[N]),2),P=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,I]);function B(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,I]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[F]),lookbehind:!0,greedy:!0,inside:B(F,R)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[P]),lookbehind:!0,greedy:!0,inside:B(P,L)}],char:{pattern:RegExp(E),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(e)}function u(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.value.replace(/&amp;/,"&"))})),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return t})),"i"),lookbehind:!0,greedy:!0,inside:o},e.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}function d(e){!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(e)}function p(e){!function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),"diff"===n&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(e)}function h(e){e.register(o),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}function f(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}function m(e){e.register(o),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(e)}function g(e){!function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",o=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(e)}function y(e){e.register(o),e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}function b(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}function k(e){e.register(o),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(e)}function w(e){e.register(d),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}function v(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}function x(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}function S(e){!function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<value>>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<key>>/g,(function(){return"(?:"+o+"|"+i+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(i),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(e)}function E(e){e.register(u),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var o=t[n];if("code"===o.type){var i=o.content[1],s=o.content[3];if(i&&s&&"code-language"===i.type&&"code-block"===s.type&&"string"==typeof i.content){var a=i.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());s.alias?"string"==typeof s.alias?s.alias=[s.alias,l]:s.alias.push(l):s.alias=[l]}}else e(o.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,o=t.classes.length;r<o;r++){var i=t.classes[r],s=/language-(.+)/.exec(i);if(s){n=s[1];break}}var a=e.languages[n];if(a)t.content=e.highlight(t.content.value,a,n);else if(n&&"none"!==n&&e.plugins.autoloader){var l="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=l,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(l);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}})),RegExp(e.languages.markup.tag.pattern.source,"gi"),String.fromCodePoint||String.fromCharCode,e.languages.md=e.languages.markdown}(e)}function C(e){e.register(i),e.languages.objectivec=e.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}function A(e){!function(e){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;e.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}}(e)}function N(e){e.register(u),function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,i){if(n.language===r){var s=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof i&&!i(e))return e;for(var o,a=s.length;-1!==n.code.indexOf(o=t(r,a));)++a;return s[a]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,i=Object.keys(n.tokenStack);!function s(a){for(var l=0;l<a.length&&!(o>=i.length);l++){var c=a[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=i[o],d=n.tokenStack[u],p="string"==typeof c?c:c.content,h=t(r,u),f=p.indexOf(h);if(f>-1){++o;var m=p.substring(0,f),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=p.substring(f+h.length),b=[];m&&b.push.apply(b,s([m])),b.push(g),y&&b.push.apply(b,s([y])),"string"==typeof c?a.splice.apply(a,[l,1].concat(b)):c.content=b}}else c.content&&s(c.content)}return a}(n.tokens)}}}})}(e)}function O(e){e.register(N),function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,o=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,i=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:o,punctuation:i};var s={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},a=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:s}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:s}}];e.languages.insertBefore("php","variable",{string:a,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:a,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:o,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){/<\?/.test(t.code)&&e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(e)}function T(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}function M(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}function D(e){e.register(o),function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(e)}function I(e){!function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(e)}function R(e){e.register(d),function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(e)}function F(e){e.register(d),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}function L(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}function P(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach((function(t){t.inside.interpolation.inside=e.languages.swift}))}function B(e){e.register(y),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(e)}function _(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}function z(e){e.register(_),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}n.r(r),n.d(r,{boolean:()=>W,booleanish:()=>K,commaOrSpaceSeparated:()=>Z,commaSeparated:()=>Y,number:()=>G,overloadedBoolean:()=>q,spaceSeparated:()=>J}),o.displayName="clike",o.aliases=[],i.displayName="c",i.aliases=[],s.displayName="cpp",s.aliases=[],a.displayName="arduino",a.aliases=["ino"],l.displayName="bash",l.aliases=["sh","shell"],c.displayName="csharp",c.aliases=["cs","dotnet"],u.displayName="markup",u.aliases=["atom","html","mathml","rss","ssml","svg","xml"],d.displayName="css",d.aliases=[],p.displayName="diff",p.aliases=[],h.displayName="go",h.aliases=[],f.displayName="ini",f.aliases=[],m.displayName="java",m.aliases=[],g.displayName="regex",g.aliases=[],y.displayName="javascript",y.aliases=["js"],b.displayName="json",b.aliases=["webmanifest"],k.displayName="kotlin",k.aliases=["kt","kts"],w.displayName="less",w.aliases=[],v.displayName="lua",v.aliases=[],x.displayName="makefile",x.aliases=[],S.displayName="yaml",S.aliases=["yml"],E.displayName="markdown",E.aliases=["md"],C.displayName="objectivec",C.aliases=["objc"],A.displayName="perl",A.aliases=[],N.displayName="markup-templating",N.aliases=[],O.displayName="php",O.aliases=[],T.displayName="python",T.aliases=["py"],M.displayName="r",M.aliases=[],D.displayName="ruby",D.aliases=["rb"],I.displayName="rust",I.aliases=[],R.displayName="sass",R.aliases=[],F.displayName="scss",F.aliases=[],L.displayName="sql",L.aliases=[],P.displayName="swift",P.aliases=[],B.displayName="typescript",B.aliases=["ts"],_.displayName="basic",_.aliases=[],z.displayName="vbnet",z.aliases=[];class ${constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function j(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new $(n,r,t)}function U(e){return e.toLowerCase()}$.prototype.property={},$.prototype.normal={},$.prototype.space=null;class H{constructor(e,t){this.property=e,this.attribute=t}}H.prototype.space=null,H.prototype.boolean=!1,H.prototype.booleanish=!1,H.prototype.overloadedBoolean=!1,H.prototype.number=!1,H.prototype.commaSeparated=!1,H.prototype.spaceSeparated=!1,H.prototype.commaOrSpaceSeparated=!1,H.prototype.mustUseProperty=!1,H.prototype.defined=!1;let V=0;const W=X(),K=X(),q=X(),G=X(),J=X(),Y=X(),Z=X();function X(){return 2**++V}const Q=Object.keys(r);class ee extends H{constructor(e,t,n,o){let i=-1;if(super(e,t),te(this,"space",o),"number"==typeof n)for(;++i<Q.length;){const e=Q[i];te(this,Q[i],(n&r[e])===r[e])}}}function te(e,t,n){n&&(e[t]=n)}ee.prototype.defined=!0;const ne={}.hasOwnProperty;function re(e){const t={},n={};let r;for(r in e.properties)if(ne.call(e.properties,r)){const o=e.properties[r],i=new ee(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[U(r)]=r,n[U(i.attribute)]=r}return new $(t,n,e.space)}const oe=re({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),ie=re({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function se(e,t){return t in e?e[t]:t}function ae(e,t){return se(e,t.toLowerCase())}const le=re({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:ae,properties:{xmlns:null,xmlnsXLink:null}}),ce=re({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:K,ariaAutoComplete:null,ariaBusy:K,ariaChecked:K,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:J,ariaCurrent:null,ariaDescribedBy:J,ariaDetails:null,ariaDisabled:K,ariaDropEffect:J,ariaErrorMessage:null,ariaExpanded:K,ariaFlowTo:J,ariaGrabbed:K,ariaHasPopup:null,ariaHidden:K,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:J,ariaLevel:G,ariaLive:null,ariaModal:K,ariaMultiLine:K,ariaMultiSelectable:K,ariaOrientation:null,ariaOwns:J,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:K,ariaReadOnly:K,ariaRelevant:null,ariaRequired:K,ariaRoleDescription:J,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:K,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null}}),ue=re({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:ae,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Y,acceptCharset:J,accessKey:J,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:J,autoFocus:W,autoPlay:W,capture:W,charSet:null,checked:W,cite:null,className:J,cols:G,colSpan:null,content:null,contentEditable:K,controls:W,controlsList:J,coords:G|Y,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:q,draggable:K,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:J,height:G,hidden:W,high:G,href:null,hrefLang:null,htmlFor:J,httpEquiv:J,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:J,itemRef:J,itemScope:W,itemType:J,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:W,optimum:G,pattern:null,ping:J,placeholder:null,playsInline:W,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:J,required:W,reversed:W,rows:G,rowSpan:G,sandbox:J,scope:null,scoped:W,seamless:W,selected:W,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:K,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:K,width:G,wrap:null,align:null,aLink:null,archive:J,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:K,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:W,disableRemotePlayback:W,prefix:null,property:null,results:G,security:null,unselectable:null}}),de=re({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:se,properties:{about:Z,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:J,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Y,g2:Y,glyphName:Y,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:Z,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:J,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Z,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Z,rev:Z,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Z,requiredFeatures:Z,requiredFonts:Z,requiredFormats:Z,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:Z,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Z,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Z,to:null,transform:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),pe=j([ie,oe,le,ce,ue],"html"),he=(j([ie,oe,le,ce,de],"svg"),/^data[-\w.:]+$/i),fe=/-[a-z]/g,me=/[A-Z]/g;function ge(e){return"-"+e.toLowerCase()}function ye(e){return e.charAt(1).toUpperCase()}const be=/[#.]/g;var ke=n(10010),we=n(36469);const ve=new Set(["menu","submit","reset","button"]),xe={}.hasOwnProperty;function Se(e,t,n,r){const o=function(e,t){const n=U(t);let r=t,o=H;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&he.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(fe,ye);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!fe.test(e)){let n=e.replace(me,ge);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=ee}return new o(r,t)}(e,n);let i,s=-1;if(null!=r){if("number"==typeof r){if(Number.isNaN(r))return;i=r}else i="boolean"==typeof r?r:"string"==typeof r?o.spaceSeparated?(0,ke.q)(r):o.commaSeparated?(0,we.q)(r):o.commaOrSpaceSeparated?(0,ke.q)((0,we.q)(r).join(" ")):Ce(o,o.property,r):Array.isArray(r)?r.concat():"style"===o.property?function(e){const t=[];let n;for(n in e)xe.call(e,n)&&t.push([n,e[n]].join(": "));return t.join("; ")}(r):String(r);if(Array.isArray(i)){const e=[];for(;++s<i.length;)e[s]=Ce(o,o.property,i[s]);i=e}"className"===o.property&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[o.property]=i}}function Ee(e,t){let n=-1;if(null==t);else if("string"==typeof t||"number"==typeof t)e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(;++n<t.length;)Ee(e,t[n]);else{if("object"!=typeof t||!("type"in t))throw new Error("Expected node, nodes, or string, got `"+t+"`");"root"===t.type?Ee(e,t.children):e.push(t)}}function Ce(e,t,n){if("string"==typeof n){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(""===n||U(n)===U(t)))return!0}return n}const Ae=(Ne=pe,function(e,t,...n){let r,o=-1;if(null==e)r={type:"root",children:[]},n.unshift(t);else if(r=function(e){const t=e||"",n={};let r,o,i=0;for(;i<t.length;){be.lastIndex=i;const e=be.exec(t),s=t.slice(i,e?e.index:t.length);s&&(r?"#"===r?n.id=s:Array.isArray(n.className)?n.className.push(s):n.className=[s]:o=s,i+=s.length),e&&(r=e[0],i++)}return{type:"element",tagName:o||"div",properties:n,children:[]}}(e),r.tagName=r.tagName.toLowerCase(),i=t,s=r.tagName,null==i||"object"!=typeof i||Array.isArray(i)||"input"!==s&&i.type&&"string"==typeof i.type&&("children"in i&&Array.isArray(i.children)||("button"===s?!ve.has(i.type.toLowerCase()):"value"in i)))n.unshift(t);else{let e;for(e in t)xe.call(t,e)&&Se(Ne,r.properties,e,t[e])}for(var i,s;++o<n.length;)Ee(r.children,n[o]);return"element"===r.type&&"template"===r.tagName&&(r.content={type:"root",children:r.children},r.children=[]),r});var Ne,Oe=n(49054);const Te={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function Me(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}function De(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Ie(e){return function(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}(e)||Me(e)}var Re=n(51157);const Fe=String.fromCharCode,Le=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Pe(e,t={}){const n="string"==typeof t.additional?t.additional.charCodeAt(0):t.additional,r=[];let o,i,s=0,a=-1,l="";t.position&&("start"in t.position||"indent"in t.position?(i=t.position.indent,o=t.position.start):o=t.position);let c,u=(o?o.line:0)||1,d=(o?o.column:0)||1,p=f();for(s--;++s<=e.length;)if(10===c&&(d=(i?i[a]:0)||1),c=e.charCodeAt(s),38===c){const o=e.charCodeAt(s+1);if(9===o||10===o||12===o||32===o||38===o||60===o||Number.isNaN(o)||n&&o===n){l+=Fe(c),d++;continue}const i=s+1;let a,u=i,y=i;if(35===o){y=++u;const t=e.charCodeAt(y);88===t||120===t?(a="hexadecimal",y=++u):a="decimal"}else a="named";let b="",k="",w="";const v="named"===a?Ie:"decimal"===a?Me:De;for(y--;++y<=e.length;){const t=e.charCodeAt(y);if(!v(t))break;w+=Fe(t),"named"===a&&Oe.K.includes(w)&&(b=w,k=(0,Re.s)(w))}let x=59===e.charCodeAt(y);if(x){y++;const e="named"===a&&(0,Re.s)(w);e&&(b=w,k=e)}let S=1+y-i,E="";if(x||!1!==t.nonTerminated)if(w)if("named"===a){if(x&&!k)m(5,1);else if(b!==w&&(y=u+b.length,S=1+y-u,x=!1),!x){const n=b?1:3;if(t.attribute){const t=e.charCodeAt(y);61===t?(m(n,S),k=""):Ie(t)?k="":m(n,S)}else m(n,S)}E=k}else{x||m(2,S);let e=Number.parseInt(w,"hexadecimal"===a?16:10);if((h=e)>=55296&&h<=57343||h>1114111)m(7,S),E=Fe(65533);else if(e in Te)m(6,S),E=Te[e];else{let t="";Be(e)&&m(6,S),e>65535&&(e-=65536,t+=Fe(e>>>10|55296),e=56320|1023&e),E=t+Fe(e)}}else"named"!==a&&m(4,S);if(E){g(),p=f(),s=y-1,d+=y-i+1,r.push(E);const n=f();n.offset++,t.reference&&t.reference.call(t.referenceContext,E,{start:p,end:n},e.slice(i-1,y)),p=n}else w=e.slice(i-1,y),l+=w,d+=w.length,s=y-1}else 10===c&&(u++,a++,d=0),Number.isNaN(c)?g():(l+=Fe(c),d++);var h;return r.join("");function f(){return{line:u,column:d,offset:s+((o?o.offset:0)||0)}}function m(e,n){let r;t.warning&&(r=f(),r.column+=n,r.offset+=n,t.warning.call(t.warningContext,Le[e],r,e))}function g(){l&&(r.push(l),t.text&&t.text.call(t.textContext,l,{start:p,end:f()}),l="")}}function Be(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||!(65535&~e)||65534==(65535&e)}var _e=0,ze={},$e={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++_e}),e.__id},clone:function e(t,n){var r,o;switch(n=n||{},$e.util.type(t)){case"Object":if(o=$e.util.objId(t),n[o])return n[o];for(var i in r={},n[o]=r,t)t.hasOwnProperty(i)&&(r[i]=e(t[i],n));return r;case"Array":return o=$e.util.objId(t),n[o]?n[o]:(r=[],n[o]=r,t.forEach((function(t,o){r[o]=e(t,n)})),r);default:return t}}},languages:{plain:ze,plaintext:ze,text:ze,txt:ze,extend:function(e,t){var n=$e.util.clone($e.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var o=(r=r||$e.languages)[e],i={};for(var s in o)if(o.hasOwnProperty(s)){if(s==t)for(var a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);n.hasOwnProperty(s)||(i[s]=o[s])}var l=r[e];return r[e]=i,$e.languages.DFS($e.languages,(function(t,n){n===l&&t!=e&&(this[t]=i)})),i},DFS:function e(t,n,r,o){o=o||{};var i=$e.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var a=t[s],l=$e.util.type(a);"Object"!==l||o[i(a)]?"Array"!==l||o[i(a)]||(o[i(a)]=!0,e(a,n,s,o)):(o[i(a)]=!0,e(a,n,null,o))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if($e.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=$e.tokenize(r.code,r.grammar),$e.hooks.run("after-tokenize",r),je.stringify($e.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new Ve;return We(o,o.head,e),He(e,o,t,o.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=$e.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=$e.hooks.all[e];if(n&&n.length)for(var r,o=0;r=n[o++];)r(t)}},Token:je};function je(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function Ue(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function He(e,t,n,r,o,i){for(var s in n)if(n.hasOwnProperty(s)&&n[s]){var a=n[s];a=Array.isArray(a)?a:[a];for(var l=0;l<a.length;++l){if(i&&i.cause==s+","+l)return;var c=a[l],u=c.inside,d=!!c.lookbehind,p=!!c.greedy,h=c.alias;if(p&&!c.pattern.global){var f=c.pattern.toString().match(/[imsuy]*$/)[0];c.pattern=RegExp(c.pattern.source,f+"g")}for(var m=c.pattern||c,g=r.next,y=o;g!==t.tail&&!(i&&y>=i.reach);y+=g.value.length,g=g.next){var b=g.value;if(t.length>e.length)return;if(!(b instanceof je)){var k,w=1;if(p){if(!(k=Ue(m,y,e,d))||k.index>=e.length)break;var v=k.index,x=k.index+k[0].length,S=y;for(S+=g.value.length;v>=S;)S+=(g=g.next).value.length;if(y=S-=g.value.length,g.value instanceof je)continue;for(var E=g;E!==t.tail&&(S<x||"string"==typeof E.value);E=E.next)w++,S+=E.value.length;w--,b=e.slice(y,S),k.index-=y}else if(!(k=Ue(m,0,b,d)))continue;v=k.index;var C=k[0],A=b.slice(0,v),N=b.slice(v+C.length),O=y+b.length;i&&O>i.reach&&(i.reach=O);var T=g.prev;if(A&&(T=We(t,T,A),y+=A.length),Ke(t,T,w),g=We(t,T,new je(s,u?$e.tokenize(C,u):C,h,C)),N&&We(t,g,N),w>1){var M={cause:s+","+l,reach:O};He(e,t,n,g.prev,y,M),i&&M.reach>i.reach&&(i.reach=M.reach)}}}}}}function Ve(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function We(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function Ke(e,t,n){for(var r=t.next,o=0;o<n&&r!==e.tail;o++)r=r.next;t.next=r,r.prev=t,e.length-=o}const qe=$e,Ge={}.hasOwnProperty;function Je(){}Je.prototype=qe;const Ye=new Je;Ye.highlight=function(e,t){if("string"!=typeof e)throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&"object"==typeof t)n=t;else{if(r=t,"string"!=typeof r)throw new TypeError("Expected `string` for `name`, got `"+r+"`");if(!Ge.call(Ye.languages,r))throw new Error("Unknown language: `"+r+"` is not registered");n=Ye.languages[r]}return{type:"root",children:qe.highlight.call(Ye,e,n,r)}},Ye.register=function(e){if("function"!=typeof e||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Ge.call(Ye.languages,e.displayName)||e(Ye)},Ye.alias=function(e,t){const n=Ye.languages;let r,o={};for(r in"string"==typeof e?t&&(o[e]=t):o=e,o)if(Ge.call(o,r)){const e=o[r],t="string"==typeof e?[e]:e;let i=-1;for(;++i<t.length;)n[t[i]]=n[r]}},Ye.registered=function(e){if("string"!=typeof e)throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Ge.call(Ye.languages,e)},Ye.listLanguages=function(){const e=Ye.languages,t=[];let n;for(n in e)Ge.call(e,n)&&"object"==typeof e[n]&&t.push(n);return t},Ye.util.encode=function(e){return e},Ye.Token.stringify=function e(t,n){if("string"==typeof t)return{type:"text",value:t};if(Array.isArray(t)){const r=[];let o=-1;for(;++o<t.length;)""!==t[o]&&null!==t[o]&&void 0!==t[o]&&r.push(e(t[o],n));return r}const r={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n};return t.alias&&r.classes.push(..."string"==typeof t.alias?[t.alias]:t.alias),Ye.hooks.run("wrap",r),Ae(r.tag+"."+r.classes.join("."),function(e){let t;for(t in e)Ge.call(e,t)&&(e[t]=Pe(e[t]));return e}(r.attributes),r.content)},Ye.register(o),Ye.register(i),Ye.register(s),Ye.register(a),Ye.register(l),Ye.register(c),Ye.register(u),Ye.register(d),Ye.register(p),Ye.register(h),Ye.register(f),Ye.register(m),Ye.register(g),Ye.register(y),Ye.register(b),Ye.register(k),Ye.register(w),Ye.register(v),Ye.register(x),Ye.register(S),Ye.register(E),Ye.register(C),Ye.register(A),Ye.register(N),Ye.register(O),Ye.register(T),Ye.register(M),Ye.register(D),Ye.register(I),Ye.register(R),Ye.register(F),Ye.register(L),Ye.register(P),Ye.register(B),Ye.register(_),Ye.register(z)},43890:(e,t,n)=>{"use strict";function r(e,t,n,r){const o=e.length;let i,s=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),[].splice.apply(e,i);else for(n&&[].splice.apply(e,[t,n]);s<r.length;)i=r.slice(s,s+1e4),i.unshift(t,0),[].splice.apply(e,i),s+=1e4,t+=1e4}function o(e,t){return e.length>0?(r(e,e.length,0,t),e):t}n.d(t,{V:()=>o,m:()=>r})},44254:(e,t,n)=>{"use strict";n.d(t,{I9:()=>_,KP:()=>$,MG:()=>B,T:()=>S,UM:()=>j,Z6:()=>A,xe:()=>z});var r=n(81570);const o="undefined"!=typeof navigator?navigator:null,i="undefined"!=typeof document?document:null,s=o&&o.userAgent||"",a=/Edge\/(\d+)/.exec(s),l=/MSIE \d/.exec(s),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(s),u=!!(l||c||a),d=l?document.documentMode:c?+c[1]:a?+a[1]:0,p=!u&&/gecko\/(\d+)/i.test(s),h=p&&+(/Firefox\/(\d+)/.exec(s)||[0,0])[1],f=!u&&/Chrome\/(\d+)/.exec(s),m=!!f,g=f?+f[1]:0,y=!u&&!!o&&/Apple Computer/.test(o.vendor),b=y&&(/Mobile\/\w+/.test(s)||!!o&&o.maxTouchPoints>2),k=b||!!o&&/Mac/.test(o.platform),w=/Android \d/.test(s),v=!!i&&"webkitFontSmoothing"in i.documentElement.style,x=v?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var S=Object.freeze({__proto__:null,ie:u,ie_version:d,gecko:p,gecko_version:h,chrome:m,chrome_version:g,safari:y,ios:b,mac:k,android:w,webkit:v,webkit_version:x});function E(e,t,n,r,o,i){if(e.composing)return!1;const s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;const l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,void 0,"")+r;for(let a=0;a<o.length;a++){const c=o[a].match.exec(l),u=c&&c[0]&&o[a].handler(s,c,t-(c[0].length-r.length),n);if(u)return e.dispatch(u.setMeta(i,{transform:u,from:t,to:n,text:r})),!0}return!1}const C=new r.hs("MILKDOWN_CUSTOM_INPUTRULES"),A=({rules:e})=>{const t=new r.k_({key:C,isInputRules:!0,state:{init:()=>null,apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,o,i)=>E(n,r,o,i,e,t),handleDOMEvents:{compositionend:n=>(setTimeout((()=>{const{$cursor:r}=n.state.selection;r&&E(n,r.pos,r.pos,"",e,t)})),!1)},handleKeyDown(n,r){if("Enter"!==r.key)return!1;const{$cursor:o}=n.state.selection;return!!o&&E(n,o.pos,o.pos,"\n",e,t)}}});return t};var N=Object.defineProperty,O=Object.defineProperties,T=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,R=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F=(e,t)=>{for(var n in t||(t={}))D.call(t,n)&&R(e,n,t[n]);if(M)for(var n of M(t))I.call(t,n)&&R(e,n,t[n]);return e},L=(e,t)=>O(e,T(t));function P(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function B(e,t,n){const r=e.state.doc.content.size,o=P(t,0,r),i=P(n,0,r),s=e.coordsAtPos(o),a=e.coordsAtPos(i,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),u=Math.min(s.left,a.left),d=Math.max(s.right,a.right),p={top:l,bottom:c,left:u,right:d,width:d-u,height:c-l,x:u,y:l};return L(F({},p),{toJSON:()=>p})}const _=e=>Object.assign(Object.create(e),e).setTime(Date.now()),z=e=>(t,n)=>((e,t=!0)=>{const n=[];return e.descendants(((e,r)=>{if(n.push({node:e,pos:r}),!t)return!1})),n})(t,n).filter((t=>e(t.node))),$=e=>t=>(e=>t=>{for(let n=t.depth;n>0;n--){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}})(e)(t.$from),j=(e,t)=>{if(!(e instanceof r.nh))return;const{node:n,$from:o}=e;return((e,t)=>Array.isArray(e)&&e.includes(t.type)||t.type===e)(t,n)?{node:n,pos:o.pos,start:o.start(o.depth),depth:o.depth}:void 0}},47938:(e,t,n)=>{"use strict";n.d(t,{s:()=>s});var r=n(51157),o=n(99896);const i=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function s(e){return e.replace(i,a)}function a(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return(0,o.C)(n.slice(t?2:1),t?16:10)}return(0,r.s)(n)||e}},53373:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=s(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=s(t,n));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},61408:(e,t,n)=>{"use strict";function r(e,t,n,r,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,o)}n.d(t,{i:()=>i});var o=n(41361),i=function(){var e,t=(e=function*(e,t,n){var r=new FormData,i=function*(){if(Array.isArray(a)){var e="".concat(s,"[]");a.forEach((t=>{r.append(e,t)}))}else r.append(s,a)};for(var[s,a]of Object.entries(t))yield*i();return(yield o.http.put("api/gateway/object_store.object_store.PutObject/api/v1/objectStore/bucket/".concat(e,"/object"),r,n)).data},function(){var t=this,n=arguments;return new Promise((function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,l,"next",e)}function l(e){r(s,o,i,a,l,"throw",e)}a(void 0)}))});return function(e,n,r){return t.apply(this,arguments)}}()},66641:(e,t,n)=>{"use strict";n.d(t,{dc:()=>o,_Z:()=>i,VG:()=>s});var r=n(15186);const o=!1,i="skip",s=function(e,t,n,s){"function"==typeof t&&"function"!=typeof n&&(s=n,n=t,t=null);const a=(0,r.C)(t),l=s?-1:1;!function e(r,c,u){const d=r&&"object"==typeof r?r:{};if("string"==typeof d.type){const e="string"==typeof d.tagName?d.tagName:"string"==typeof d.name?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+r.type+(e?"<"+e+">":"")+")"})}return p;function p(){let d,p,h,f=[];if((!t||a(r,c,u[u.length-1]||null))&&(f=function(e){return Array.isArray(e)?e:"number"==typeof e?[true,e]:[e]}(n(r,u)),f[0]===o))return f;if(r.children&&f[0]!==i)for(p=(s?r.children.length:-1)+l,h=u.concat(r);p>-1&&p<r.children.length;){if(d=e(r.children[p],p,h)(),d[0]===o)return d;p="number"==typeof d[1]?d[1]:p+l}return f}}(e,void 0,[])()}},66990:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var r=n(17884);function o(e){return null===e||(0,r.Ee)(e)||(0,r.Ny)(e)?1:(0,r.es)(e)?2:void 0}},67488:(e,t,n)=>{"use strict";n.d(t,{CR:()=>U,Kj:()=>I,Z0:()=>g,mc:()=>h,zD:()=>R});var r,o,i,s=n(1440),a=Object.defineProperty,l=(e,t,n)=>(((e,t,n)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),c=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},u=(e,t,n)=>(c(e,t,"read from private field"),n?n.call(e):t.get(e)),d=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},p=(e,t,n,r)=>(c(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class h{constructor(){l(this,"sliceMap",new Map),l(this,"get",(e=>{const t="string"==typeof e?[...this.sliceMap.values()].find((t=>t.type.name===e)):this.sliceMap.get(e.id);if(!t){const t="string"==typeof e?e:e.name;throw(0,s.XM)(t)}return t})),l(this,"remove",(e=>{const t="string"==typeof e?[...this.sliceMap.values()].find((t=>t.type.name===e)):this.sliceMap.get(e.id);!t||this.sliceMap.delete(t.type.id)})),l(this,"has",(e=>"string"==typeof e?[...this.sliceMap.values()].some((t=>t.type.name===e)):this.sliceMap.has(e.id)))}}class f{constructor(e,t,n){l(this,"type"),d(this,r,[]),d(this,o,void 0),d(this,i,(()=>{u(this,r).forEach((e=>e(u(this,o))))})),l(this,"set",(e=>{p(this,o,e),u(this,i).call(this)})),l(this,"get",(()=>u(this,o))),l(this,"update",(e=>{p(this,o,e(u(this,o))),u(this,i).call(this)})),this.type=n,p(this,o,t),e.set(n.id,this)}on(e){return u(this,r).push(e),()=>{p(this,r,u(this,r).filter((t=>t!==e)))}}once(e){const t=this.on((n=>{e(n),t()}));return t}off(e){p(this,r,u(this,r).filter((t=>t!==e)))}offAll(){p(this,r,[])}}r=new WeakMap,o=new WeakMap,i=new WeakMap;class m{constructor(e,t){l(this,"id"),l(this,"name"),l(this,"_typeInfo"),l(this,"_defaultValue"),this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw(0,s.dI)()}}create(e,t=this._defaultValue){return new f(e,t,this)}}const g=(e,t)=>new m(e,t);var y,b,k,w,v,x,S,E,C,A,N,O,T;class M{constructor(e,t,n){d(this,y,void 0),d(this,b,void 0),d(this,k,void 0),d(this,w,new Set),d(this,v,new Set),d(this,x,new Map),d(this,S,new Map),l(this,"read",(()=>({metadata:u(this,y),injectedSlices:[...u(this,w)].map((e=>({name:"string"==typeof e?e:e.name,value:u(this,E).call(this,e)}))),consumedSlices:[...u(this,v)].map((e=>({name:"string"==typeof e?e:e.name,value:u(this,E).call(this,e)}))),recordedTimers:[...u(this,x)].map((([e,{duration:t}])=>({name:e.name,duration:t,status:u(this,C).call(this,e)}))),waitTimers:[...u(this,S)].map((([e,{duration:t}])=>({name:e.name,duration:t,status:u(this,C).call(this,e)})))}))),l(this,"onRecord",(e=>{u(this,x).set(e,{start:Date.now(),duration:0})})),l(this,"onClear",(e=>{u(this,x).delete(e)})),l(this,"onDone",(e=>{const t=u(this,x).get(e);!t||(t.duration=Date.now()-t.start)})),l(this,"onWait",((e,t)=>{const n=Date.now();t.finally((()=>{u(this,S).set(e,{duration:Date.now()-n})}))})),l(this,"onInject",(e=>{u(this,w).add(e)})),l(this,"onRemove",(e=>{u(this,w).delete(e)})),l(this,"onUse",(e=>{u(this,v).add(e)})),d(this,E,(e=>u(this,b).get(e).get())),d(this,C,(e=>u(this,k).get(e).status)),p(this,b,e),p(this,k,t),p(this,y,n)}}y=new WeakMap,b=new WeakMap,k=new WeakMap,w=new WeakMap,v=new WeakMap,x=new WeakMap,S=new WeakMap,E=new WeakMap,C=new WeakMap;const D=class{constructor(e,t,n){d(this,A,void 0),d(this,N,void 0),d(this,O,void 0),d(this,T,void 0),l(this,"produce",(e=>e&&Object.keys(e).length?new D(u(this,A),u(this,N),{...e}):this)),l(this,"inject",((e,t)=>{var n;const r=e.create(u(this,A).sliceMap);return null!=t&&r.set(t),null==(n=u(this,T))||n.onInject(e),this})),l(this,"remove",(e=>{var t;return u(this,A).remove(e),null==(t=u(this,T))||t.onRemove(e),this})),l(this,"record",(e=>{var t;return e.create(u(this,N).store),null==(t=u(this,T))||t.onRecord(e),this})),l(this,"clearTimer",(e=>{var t;return u(this,N).remove(e),null==(t=u(this,T))||t.onClear(e),this})),l(this,"isInjected",(e=>u(this,A).has(e))),l(this,"isRecorded",(e=>u(this,N).has(e))),l(this,"use",(e=>{var t;return null==(t=u(this,T))||t.onUse(e),u(this,A).get(e)})),l(this,"get",(e=>this.use(e).get())),l(this,"set",((e,t)=>this.use(e).set(t))),l(this,"update",((e,t)=>this.use(e).update(t))),l(this,"timer",(e=>u(this,N).get(e))),l(this,"done",(e=>{var t;this.timer(e).done(),null==(t=u(this,T))||t.onDone(e)})),l(this,"wait",(e=>{var t;const n=this.timer(e).start();return null==(t=u(this,T))||t.onWait(e,n),n})),l(this,"waitTimers",(async e=>{await Promise.all(this.get(e).map((e=>this.wait(e))))})),p(this,A,e),p(this,N,t),p(this,O,n),n&&p(this,T,new M(e,t,n))}get meta(){return u(this,O)}get inspector(){return u(this,T)}};let I=D;A=new WeakMap,N=new WeakMap,O=new WeakMap,T=new WeakMap;class R{constructor(){l(this,"store",new Map),l(this,"get",(e=>{const t=this.store.get(e.id);if(!t)throw(0,s.nr)(e.name);return t})),l(this,"remove",(e=>{this.store.delete(e.id)})),l(this,"has",(e=>this.store.has(e.id)))}}var F,L,P,B,_,z;class ${constructor(e,t){l(this,"type"),d(this,F,null),d(this,L,null),d(this,P,void 0),d(this,B,"pending"),l(this,"start",(()=>(u(this,F)??p(this,F,new Promise(((e,t)=>{p(this,L,(t=>{t instanceof CustomEvent&&t.detail.id===u(this,P)&&(p(this,B,"resolved"),u(this,_).call(this),t.stopImmediatePropagation(),e())})),u(this,z).call(this,(()=>{"pending"===u(this,B)&&p(this,B,"rejected"),u(this,_).call(this),t(new Error(`Timing ${this.type.name} timeout.`))})),p(this,B,"pending"),addEventListener(this.type.name,u(this,L))}))),u(this,F)))),l(this,"done",(()=>{const e=new CustomEvent(this.type.name,{detail:{id:u(this,P)}});dispatchEvent(e)})),d(this,_,(()=>{u(this,L)&&removeEventListener(this.type.name,u(this,L))})),d(this,z,(e=>{setTimeout((()=>{e()}),this.type.timeout)})),p(this,P,Symbol(t.name)),this.type=t,e.set(t.id,this)}get status(){return u(this,B)}}F=new WeakMap,L=new WeakMap,P=new WeakMap,B=new WeakMap,_=new WeakMap,z=new WeakMap;class j{constructor(e,t=3e3){l(this,"id"),l(this,"name"),l(this,"timeout"),l(this,"create",(e=>new $(e,this))),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}}const U=(e,t=3e3)=>new j(e,t)},73686:(e,t,n)=>{"use strict";n.d(t,{Lz:()=>an,NZ:()=>Pt,zF:()=>zt});var r=n(81570),o=n(16090),i=n(11329);const s=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},a=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let l=null;const c=function(e,t,n){let r=l||(l=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},u=function(e,t,n,r){return n&&(p(e,t,n,r,-1)||p(e,t,n,r,1))},d=/^(img|br|input|textarea|hr)$/i;function p(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:h(e))){let n=e.parentNode;if(!n||1!=n.nodeType||f(e)||d.test(e.nodeName)||"false"==e.contentEditable)return!1;t=s(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?h(e):0}}}function h(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function f(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const m=function(e){return e.focusNode&&u(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function g(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const y="undefined"!=typeof navigator?navigator:null,b="undefined"!=typeof document?document:null,k=y&&y.userAgent||"",w=/Edge\/(\d+)/.exec(k),v=/MSIE \d/.exec(k),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(k),S=!!(v||x||w),E=v?document.documentMode:x?+x[1]:w?+w[1]:0,C=!S&&/gecko\/(\d+)/i.test(k);C&&(/Firefox\/(\d+)/.exec(k)||[0,0])[1];const A=!S&&/Chrome\/(\d+)/.exec(k),N=!!A,O=A?+A[1]:0,T=!S&&!!y&&/Apple Computer/.test(y.vendor),M=T&&(/Mobile\/\w+/.test(k)||!!y&&y.maxTouchPoints>2),D=M||!!y&&/Mac/.test(y.platform),I=!!y&&/Win/.test(y.platform),R=/Android \d/.test(k),F=!!b&&"webkitFontSmoothing"in b.documentElement.style,L=F?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function P(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function B(e,t){return"number"==typeof e?e:e[t]}function _(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function z(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=a(s)){if(1!=s.nodeType)continue;let e=s,n=e==i.body,a=n?P(i):_(e),l=0,c=0;if(t.top<a.top+B(r,"top")?c=-(a.top-t.top+B(o,"top")):t.bottom>a.bottom-B(r,"bottom")&&(c=t.bottom-a.bottom+B(o,"bottom")),t.left<a.left+B(r,"left")?l=-(a.left-t.left+B(o,"left")):t.right>a.right-B(r,"right")&&(l=t.right-a.right+B(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}if(n)break}}function $(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=a(r));return t}function j(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let U=null;function H(e,t){let n,r,o,i,s=2e8,a=0,l=t.top,u=t.top;for(let d=e.firstChild,p=0;d;d=d.nextSibling,p++){let e;if(1==d.nodeType)e=d.getClientRects();else{if(3!=d.nodeType)continue;e=c(d).getClientRects()}for(let c=0;c<e.length;c++){let h=e[c];if(h.top<=l&&h.bottom>=u){l=Math.max(h.bottom,l),u=Math.min(h.top,u);let e=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(e<s){n=d,s=e,r=e&&3==n.nodeType?{left:h.right<t.left?h.right:h.left,top:t.top}:t,1==d.nodeType&&e&&(a=p+(t.left>=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!o&&h.left<=t.left&&h.right>=t.left&&(o=d,i={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(a=p+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=G(r,1);if(n.top!=n.bottom&&V(t,n))return{node:e,offset:o+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:H(n,r)}function V(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function W(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(V(t,o))return W(n,t,o)}}if((i=(i+1)%r)==o)break}return e}function K(e,t){let n,r=e.dom.ownerDocument,o=0,i=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}(r,t.left,t.top);i&&({node:n,offset:o}=i);let s,l=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){let n=e.dom.getBoundingClientRect();if(!V(t,n))return null;if(l=W(e.dom,t,n),!l)return null}if(T)for(let e=l;n&&e;e=a(e))e.draggable&&(n=void 0);if(l=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(l,t),n){if(C&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){let o=-1;for(let n=t,i=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent&&!i||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&!i&&(i=!0,e.left>r.left||e.top>r.top?o=t.posBefore:(e.right<r.left||e.bottom<r.top)&&(o=t.posAfter)),!t.contentDOM&&o<0)return(t.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?t.posBefore:t.posAfter}n=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==s&&(s=function(e,t,n){let{node:r,offset:o}=H(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,l,t));let c=e.docView.nearestDesc(l,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function q(e){return e.top<e.bottom||e.left<e.right}function G(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(q(e))return e}return Array.prototype.find.call(n,q)||e.getBoundingClientRect()}const J=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Y(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=F||C;if(3==r.nodeType){if(!s||!J.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,Z(G(c(r,e,t),i),i<0)}{let e=G(c(r,o,o),n);if(C&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=G(c(r,o-1,o-1),-1);if(t.top==e.top){let n=G(c(r,o,o+1),-1);if(n.top!=e.top)return Z(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==h(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return X(e.getBoundingClientRect(),!1)}if(null==i&&o<h(r)){let e=r.childNodes[o];if(1==e.nodeType)return X(e.getBoundingClientRect(),!0)}return X(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==h(r))){let e=r.childNodes[o-1],t=3==e.nodeType?c(e,h(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Z(G(t,1),!1)}if(null==i&&o<h(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?c(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Z(G(t,-1),!0)}return Z(G(3==r.nodeType?c(r):r,-n),n>=0)}function Z(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function X(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Q(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const ee=/[\u0590-\u08ac]/;let te=null,ne=null,re=!1;class oe{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>s(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let o=this.children[n],i=t+o.size;if(i>e||o instanceof de){r=e-t;break}t=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof ie&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?s(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?s(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,a=0;;a++){let n=this.children[a],l=i+n.size;if(-1==r&&e<=l){let o=i+n.border;if(e>=o&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;for(let t=a;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=s(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||a==this.children.length-1)){t=l;for(let e=a+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=s(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&i<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((C||T)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType)c=!(!t||"\n"!=e.nodeValue[t-1]);else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(C&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&T)&&u(s.node,s.offset,l.anchorNode,l.anchorOffset)&&u(a.node,a.offset,l.focusNode,l.focusOffset))return;let d=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),d=!0}catch(e){}}if(!d){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class ie extends oe{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r))),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class se extends oe{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class ae extends oe{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],s=i&&i(t,r,n);return s&&s.dom||(s=o.ZF.renderSpec(document,t.type.spec.toDOM(t,n))),new ae(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=ae.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=Ee(o,t,i,n)),e>0&&(o=Ee(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=r;return r.children=o,r}}class le extends oe{constructor(e,t,n,r,o,i,s,a,l){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,i,s){let a,l=i.nodeViews[t.type.name],c=l&&l(t,i,(()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s),n,r),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else u||({dom:u,contentDOM:d}=o.ZF.renderSpec(document,t.type.spec.toDOM(t)));d||t.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let p=u;return u=ke(u,n,t),c?a=new pe(e,t,n,r,u,d||null,p,c,i,s+1):t.isText?new ue(e,t,n,r,u,p,i):new le(e,t,n,r,u,d||null,p,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>o.FK.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&we(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new xe(this,s&&s.node,e);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<o.length&&o[s].to==i){let e,t=o[s++];for(;s<o.length&&o[s].to==i;)(e||(e=[t])).push(o[s++]);if(e){e.sort(Se);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else{if(!(c<e.childCount))break;d=c,u=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=i&&a.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let p=i+u.nodeSize;if(u.isText){let e=p;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<p&&(l=u.cut(e-i),u=u.cut(0,e-i),p=e,d=-1)}r(u,u.isInline&&!u.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(i,u),d),i=p}}(this.node,this.innerDeco,((t,i,s)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!s&&l.syncToMarks(i==this.node.childCount?o.CU.none:this.node.child(i).marks,n,e),l.placeWidget(t,e,r)}),((t,o,s,c)=>{let u;l.syncToMarks(t.marks,n,e),l.findNodeMatch(t,o,s,c)||a&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(t,o,s,u,e)||l.updateNextNode(t,o,s,e,c,r)||l.addNode(t,o,s,e,r),r+=t.nodeSize})),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),he(this.contentDOM,this.children,e),M&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:o}=e.state.selection;if(!(e.state.selection instanceof r.U3)||n<t||o>t+this.node.content.size)return null;let i=e.domSelectionRange(),s=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=h(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let e=s.nodeValue,r=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;l+=t.text}if(i>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,o-t);return r<0?null:{node:s,pos:r,text:e}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new se(this,o,t,r);e.input.compositionNodes.push(i),this.children=Ee(this.children,n,n+r.length,e,i)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,r),0))}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(we(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ye(this.dom,this.nodeDOM,ge(this.outerDeco,this.node,t),ge(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function ce(e,t,n,r,o){ke(r,t,e);let i=new le(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class ue extends le{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),o=document.createTextNode(r.text);return new ue(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class de extends oe{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class pe extends le{constructor(e,t,n,r,o,i,s,a,l,c){super(e,t,n,r,o,i,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function he(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=ve(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(a,r);if(s instanceof ae){let t=r?r.previousSibling:e.lastChild;he(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=ve(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const fe=function(e){e&&(this.nodeName=e)};fe.prototype=Object.create(null);const me=[new fe];function ge(e,t,n){if(0==e.length)return me;let r=n?me[0]:new fe,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new fe(s.nodeName));for(let e in s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new fe(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return o}function ye(e,t,n,r){if(n==me&&r==me)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||(t=document.createElement(i.nodeName),t.pmIsDeco=!0,t.appendChild(o),s=me[0]),o=t}be(o,s||me[0],i)}return o}function be(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function ke(e,t,n){return ye(e,e,me,ge(t,n,1!=e.nodeType))}function we(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ve(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class xe{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof ae)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,o=this.stack.length>>1,i=Math.min(o,e.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=ae.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0||(this.destroyBetween(this.index,i),this.index++,0))}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof le){let l=this.preMatch.matched.get(a);if(null!=l&&l!=o)return!1;let c,u=a.dom,d=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&we(t,a.outerDeco));if(!d&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(c=this.recreateWrapper(a,e,t,n,r,i)))return this.top.children[this.index]=c,c.dirty=2,c.updateChildren(r,i+1),c.dirty=0,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=le.create(this.top,t,n,r,o,i);if(!s.contentDOM)return null;s.children=e.children,e.children=[];for(let e of s.children)e.parent=s;return s}addNode(e,t,n,r,o){let i=le.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new ie(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof ae;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ue)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((T||N)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new de(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function Se(e,t){return e.type.side-t.type.side}function Ee(e,t,n,r,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Ce(e,t=null){let n=e.domSelectionRange(),o=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&0==i.size,l=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let c,u,d=o.resolve(l);if(m(n)){for(c=d;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&r.nh.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==h(e);r||o;){if(e==n)return!0;let t=s(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==h(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;u=new r.nh(l==e?d:o.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;c=o.resolve(t)}return u||(u=Fe(e,c,d,"pointer"==t||e.state.selection.head<d.pos&&!a?1:-1)),u}function Ae(e){return e.editable?e.hasFocus():Pe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ne(e,t=!1){let n=e.state.selection;if(Ie(e,n),Ae(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&N){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&u(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,s(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&S&&E<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let o,i,{anchor:s,head:a}=n;!Oe||n instanceof r.U3||(n.$from.parent.inlineContent||(o=Te(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=Te(e,n.to))),e.docView.setSelection(s,a,e.root,t),Oe&&(o&&De(o),i&&De(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Ae(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Oe=T||N&&O<63;function Te(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(T&&o&&"false"==o.contentEditable)return Me(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return Me(o);if(i)return Me(i)}}function Me(e){return e.contentEditable="true",T&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function De(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Ie(e,t){if(t instanceof r.nh){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Re(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Re(e)}function Re(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Fe(e,t,n,o){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||r.U3.between(t,n,o)}function Le(e){return!(e.editable&&!e.hasFocus())&&Pe(e)}function Pe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Be(e,t){let{$anchor:n,$head:o}=e.selection,i=t>0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&r.LN.findFrom(s,t)}function _e(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function ze(e,t,n){let o=e.state.selection;if(!(o instanceof r.U3)){if(o instanceof r.nh&&o.node.isInline)return _e(e,new r.U3(t>0?o.$to:o.$from));{let n=Be(e.state,t);return!!n&&_e(e,n)}}if(!o.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Be(e.state,t);return!!(n&&n instanceof r.nh)&&_e(e,n)}if(!(D&&n.indexOf("m")>-1)){let n,i=o.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText)return!1;let a=t<0?i.pos-s.nodeSize:i.pos;return!!(s.isAtom||(n=e.docView.descAt(a))&&!n.contentDOM)&&(r.nh.isSelectable(s)?_e(e,new r.nh(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):!!F&&_e(e,new r.U3(e.state.doc.resolve(t<0?a:a+s.nodeSize))))}}function $e(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function je(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Ue(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,a=!1;for(C&&1==n.nodeType&&r<$e(n)&&je(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(je(e))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Ve(n))break;{let t=n.previousSibling;for(;t&&je(t);)o=n.parentNode,i=s(t),t=t.previousSibling;if(t)n=t,r=$e(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?We(e,n,r):o&&We(e,o,i)}(e):He(e)}function He(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,a=$e(n);for(;;)if(r<a){if(1!=n.nodeType)break;if(!je(n.childNodes[r]))break;o=n,i=++r}else{if(Ve(n))break;{let t=n.nextSibling;for(;t&&je(t);)o=t.parentNode,i=s(t)+1,t=t.nextSibling;if(t)n=t,r=0,a=$e(n);else{if(n=n.parentNode,n==e.dom)break;r=a=0}}}o&&We(e,o,i)}function Ve(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function We(e,t,n){let r=e.domSelection();if(m(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout((()=>{e.state==o&&Ne(e)}),50)}function Ke(e,t){let n=e.state.doc.resolve(t);if(!N&&!I&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function qe(e,t,n){let o=e.state.selection;if(o instanceof r.U3&&!o.empty||n.indexOf("s")>-1)return!1;if(D&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=o;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Be(e.state,t);if(n&&n instanceof r.nh)return _e(e,n)}if(!i.parent.inlineContent){let n=t<0?i:s,a=o instanceof r.i5?r.LN.near(n,t):r.LN.findFrom(n,t);return!!a&&_e(e,a)}return!1}function Ge(e,t){if(!(e.state.selection instanceof r.U3))return!0;let{$head:n,$anchor:o,empty:i}=e.state.selection;if(!n.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0}return!1}function Je(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ye(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let a=e.someProp("clipboardSerializer")||o.ZF.fromSchema(e.state.schema),l=st(),c=l.createElement("div");c.appendChild(a.serializeFragment(r,{document:l}));let u,d=c.firstChild,p=0;for(;d&&1==d.nodeType&&(u=ot[d.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=l.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),p++}d=c.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${i} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:c,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n")}}function Ze(e,t,n,r,i){let s,a,l=i.parent.type.spec.code;if(!n&&!t)return null;let c=t&&(r||l||!n);if(c){if(e.someProp("transformPastedText",(n=>{t=n(t,l||r,e)})),l)return t?new o.Ji(o.FK.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):o.Ji.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,i,r,e)));if(n)a=n;else{let n=i.marks(),{schema:r}=e.state,a=o.ZF.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(a.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=st().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);if((n=o&&ot[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join("")),r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),F&&function(e){let t=e.querySelectorAll(N?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(s);let u=s&&s.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(!a){let t=e.someProp("clipboardParser")||e.someProp("domParser")||o.S4.fromSchema(e.state.schema);a=t.parseSlice(s,{preserveWhitespace:!(!c&&!d),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Xe.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(d)a=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:s,openEnd:a}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=o.FK.from(t.create(n[e+1],i)),s++,a++}return new o.Ji(i,s,a)}(rt(a,+d[1],+d[2]),d[4]);else if(a=o.Ji.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),s=[];if(e.forEach((e=>{if(!s)return;let t,n=i.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&r.length&&et(n,r,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=tt(s[s.length-1],r.length));let t=Qe(e,n);s.push(t),i=i.matchType(t.type),r=n}})),s)return o.FK.from(s)}return e}(a.content,i),!0),a.openStart||a.openEnd){let e=0,t=0;for(let t=a.content.firstChild;e<a.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=a.content.lastChild;t<a.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);a=rt(a,e,t)}return e.someProp("transformPasted",(t=>{a=t(a,e)})),a}const Xe=/^(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 Qe(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,o.FK.from(e));return e}function et(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let s=et(e,t,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(o.FK.from(Qe(n,e,i+1))))}}function tt(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,tt(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(o.FK.empty,!0);return e.copy(n.append(r))}function nt(e,t,n,r,i,s){let a=t<0?e.firstChild:e.lastChild,l=a.content;return e.childCount>1&&(s=0),i<r-1&&(l=nt(l,t,n,r,i+1,s)),i>=n&&(l=t<0?a.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(o.FK.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(l))}function rt(e,t,n){return t<e.openStart&&(e=new o.Ji(nt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new o.Ji(nt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const ot={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 it=null;function st(){return it||(it=document.implementation.createHTMLDocument("title"))}const at={},lt={},ct={touchstart:!0,touchmove:!0};class ut{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function dt(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function pt(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>ht(e,t))}))}function ht(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function ft(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function mt(e){return{left:e.clientX,top:e.clientY}}function gt(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,(t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function yt(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function bt(e,t,n,r){return gt(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function kt(e,t,n,o){return gt(e,"handleTripleClickOn",t,n,o)||e.someProp("handleTripleClick",(n=>n(e,t,o)))||function(e,t,n){if(0!=n.button)return!1;let o=e.state.doc;if(-1==t)return!!o.inlineContent&&(yt(e,r.U3.create(o,0,o.content.size),"pointer"),!0);let i=o.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),s=i.before(t);if(n.inlineContent)yt(e,r.U3.create(o,s+1,s+1+n.content.size),"pointer");else{if(!r.nh.isSelectable(n))continue;yt(e,r.nh.create(o,s),"pointer")}return!0}}(e,n,o)}function wt(e){return Nt(e)}lt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!St(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!R||!N||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!M||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||function(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||D&&72==n&&"c"==r)return Ge(e,-1)||Ue(e,-1);if(46==n||D&&68==n&&"c"==r)return Ge(e,1)||Ue(e,1);if(13==n||27==n)return!0;if(37==n||D&&66==n&&"c"==r){let t=37==n?"ltr"==Ke(e,e.state.selection.from)?-1:1:-1;return ze(e,t,r)||Ue(e,t)}if(39==n||D&&70==n&&"c"==r){let t=39==n?"ltr"==Ke(e,e.state.selection.from)?1:-1:1;return ze(e,t,r)||Ue(e,t)}return 38==n||D&&80==n&&"c"==r?qe(e,-1,r)||Ue(e,-1):40==n||D&&78==n&&"c"==r?function(e){if(!T||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Je(e,n,"true"),setTimeout((()=>Je(e,n,"false")),20)}return!1}(e)||qe(e,1,r)||He(e):r==(D?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():dt(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},lt.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},lt.keypress=(e,t)=>{let n=t;if(St(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||D&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let o=e.state.selection;if(!(o instanceof r.U3&&o.$from.sameParent(o.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,o.$from.pos,o.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const vt=D?"metaKey":"ctrlKey";at.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=wt(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[vt]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(mt(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new xt(e,s,n,!!r)):("doubleClick"==i?bt:kt)(e,s.pos,s.inside,n)?n.preventDefault():dt(e,"pointer"))};class xt{constructor(e,t,n,o){let i,s;if(this.view=e,this.pos=t,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[vt],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,s=n.depth?n.before():0}const a=o?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||c instanceof r.nh&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!C||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)),dt(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((()=>Ne(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(mt(e))),this.updateAllowDefault(e),this.allowDefault||!t?dt(this.view,"pointer"):function(e,t,n,o,i){return gt(e,"handleClickOn",t,n,o)||e.someProp("handleClick",(n=>n(e,t,o)))||(i?function(e,t){if(-1==t)return!1;let n,o,i=e.state.selection;i instanceof r.nh&&(n=i.node);let s=e.state.doc.resolve(t);for(let e=s.depth+1;e>0;e--){let t=e>s.depth?s.nodeAfter:s.node(e);if(r.nh.isSelectable(t)){o=n&&i.$from.depth>0&&e>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(e);break}}return null!=o&&(yt(e,r.nh.create(e.state.doc,o),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),o=n.nodeAfter;return!!(o&&o.isAtom&&r.nh.isSelectable(o))&&(yt(e,new r.nh(n),"pointer"),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||T&&this.mightDrag&&!this.mightDrag.node.isAtom||N&&!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)?(yt(this.view,r.LN.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):dt(this.view,"pointer")}move(e){this.updateAllowDefault(e),dt(this.view,"pointer"),0==e.buttons&&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)}}function St(e,t){return!!e.composing||!!(T&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}at.touchstart=e=>{e.input.lastTouch=Date.now(),wt(e),dt(e,"pointer")},at.touchmove=e=>{e.input.lastTouch=Date.now(),dt(e,"pointer")},at.contextmenu=e=>wt(e);const Et=R?5e3:-1;function Ct(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Nt(e)),t))}function At(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Nt(e,t=!1){if(!(R&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),At(e),t||e.docView&&e.docView.dirty){let t=Ce(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}lt.compositionstart=lt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Nt(e,!0),e.markCursor=null;else if(Nt(e),C&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){e.domSelection().collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Ct(e,Et)},lt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionID++,Ct(e,20))};const Ot=S&&E<15||M&&L<604;function Tt(e,t,n,r,i){let s=Ze(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,s||o.Ji.empty))))return!0;if(!s)return!1;let a=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(s),l=a?e.state.tr.replaceSelectionWith(a,e.input.shiftKey):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}at.copy=lt.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=Ot?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Ye(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},lt.paste=(e,t)=>{let n=t;if(e.composing&&!R)return;let r=Ot?null:n.clipboardData;r&&Tt(e,r.getData("text/plain"),r.getData("text/html"),e.input.shiftKey,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Tt(e,r.value,null,e.input.shiftKey,t):Tt(e,r.textContent,r.innerHTML,e.input.shiftKey,t)}),50)}(e,n)};class Mt{constructor(e,t){this.slice=e,this.move=t}}const Dt=D?"altKey":"ctrlKey";at.dragstart=(e,t)=>{let n=t,o=e.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let i=e.state.selection,s=i.empty?null:e.posAtCoords(mt(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof r.nh?i.to-1:i.to));else if(o&&o.mightDrag)e.dispatch(e.state.tr.setSelection(r.nh.create(e.state.doc,o.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(r.nh.create(e.state.doc,t.posBefore)))}let a=e.state.selection.content(),{dom:l,text:c}=Ye(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Ot?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ot||n.dataTransfer.setData("text/plain",c),e.dragging=new Mt(a,!n[Dt])},at.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},lt.dragover=lt.dragenter=(e,t)=>t.preventDefault(),lt.drop=(e,t)=>{let n=t,s=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let a=e.posAtCoords(mt(n));if(!a)return;let l=e.state.doc.resolve(a.pos),c=s&&s.slice;c?e.someProp("transformPasted",(t=>{c=t(c,e)})):c=Ze(e,n.dataTransfer.getData(Ot?"Text":"text/plain"),Ot?null:n.dataTransfer.getData("text/html"),!1,l);let u=!(!s||n[Dt]);if(e.someProp("handleDrop",(t=>t(e,n,c||o.Ji.empty,u))))return void n.preventDefault();if(!c)return;n.preventDefault();let d=c?(0,i.Um)(e.state.doc,l.pos,c):l.pos;null==d&&(d=l.pos);let p=e.state.tr;u&&p.deleteSelection();let h=p.mapping.map(d),f=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,m=p.doc;if(f?p.replaceRangeWith(h,h,c.content.firstChild):p.replaceRange(h,h,c),p.doc.eq(m))return;let g=p.doc.resolve(h);if(f&&r.nh.isSelectable(c.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(c.content.firstChild))p.setSelection(new r.nh(g));else{let t=p.mapping.map(d);p.mapping.maps[p.mapping.maps.length-1].forEach(((e,n,r,o)=>t=o)),p.setSelection(Fe(e,g,p.doc.resolve(t)))}e.focus(),e.dispatch(p.setMeta("uiEvent","drop"))},at.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Ne(e)}),20))},at.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},at.beforeinput=(e,t)=>{if(N&&R&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,g(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in lt)at[e]=lt[e];function It(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Rt{constructor(e,t){this.toDOM=e,this.spec=t||_t,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new Pt(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Rt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&It(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ft{constructor(e,t){this.attrs=e,this.spec=t||_t}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Pt(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Ft&&It(this.attrs,e.attrs)&&It(this.spec,e.spec)}static is(e){return e.type instanceof Ft}destroy(){}}class Lt{constructor(e,t){this.attrs=e,this.spec=t||_t}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Pt(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof Lt&&It(this.attrs,e.attrs)&&It(this.spec,e.spec)}destroy(){}}class Pt{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Pt(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,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new Pt(e,e,new Rt(t,n))}static inline(e,t,n,r){return new Pt(e,t,new Ft(n,r))}static node(e,t,n,r){return new Pt(e,t,new Lt(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ft}}const Bt=[],_t={};class zt{constructor(e,t){this.local=e.length?e:Bt,this.children=t.length?t:Bt}static create(e,t){return t.length?Wt(t,e,0,_t):$t}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==$t||0==e.maps.length?this:this.mapInner(e,t,0,0,n||_t)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let a=e.slice();for(let e=0,t=i;e<n.maps.length;e++){let r=0;n.maps[e].forEach(((e,n,i,s)=>{let l=s-i-(n-e);for(let s=0;s<a.length;s+=3){let c=a[s+1];if(c<0||e>c+t-r)continue;let u=a[s]+t-r;n>=u?a[s+1]=e<=u?-2:-1:i>=o&&l&&(a[s]+=l,a[s+1]+=l)}r+=l})),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+i),u=c-o;if(u<0||u>=r.content.size){l=!0;continue}let d=n.map(e[t+1]+i,-1)-o,{index:p,offset:h}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&h==u&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,c+1,e[t]+i+1,s);r!=$t?(a[t]=u,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,o,i,s){function a(e,t){for(let i=0;i<e.local.length;i++){let a=e.local[i].map(r,o,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[i].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+i+1);return n}(a,e,t,n,o,i,s),c=Wt(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new zt(t.sort(Kt),a)}(this.children,i||[],e,t,n,r,o):i?new zt(i.sort(Kt),Bt):$t}add(e,t){return t.length?this==$t?zt.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach(((e,i)=>{let s,a=i+n;if(s=Ht(t,e,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,s,a+1):r.splice(o,0,i,i+e.nodeSize,Wt(s,e,a+1,_t)),o+=3}}));let i=Ut(o?Vt(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new zt(i.length?this.local.concat(i).sort(Kt):this.local,r||this.children)}remove(e){return 0==e.length||this==$t?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=$t?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<e.length;o++)if(n=e[o])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new zt(r,n):$t}forChild(e,t){if(this==$t)return this;if(t.isLeaf)return zt.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof Ft){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new zt(r.sort(Kt),Bt);return n?new jt([e,n]):e}return n||$t}eq(e){if(this==e)return!0;if(!(e instanceof zt)||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 qt(this.localsInner(e))}localsInner(e){if(this==$t)return Bt;if(e.inlineContent||!this.local.some(Ft.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Ft||t.push(this.local[e]);return t}}zt.empty=new zt([],[]),zt.removeOverlap=qt;const $t=zt.empty;class jt{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,_t)));return jt.from(n)}forChild(e,t){if(t.isLeaf)return zt.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=$t&&(o instanceof jt?n=n.concat(o.members):n.push(o))}return jt.from(n)}eq(e){if(!(e instanceof jt)||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,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?qt(n?t:t.sort(Kt)):Bt}static from(e){switch(e.length){case 0:return $t;case 1:return e[0];default:return new jt(e.every((e=>e instanceof zt))?e:e.reduce(((e,t)=>e.concat(t instanceof zt?t:t.members)),[]))}}}function Ut(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new Pt(o.from+t,o.to+t,o.type))}return n}function Ht(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t,i=0;i<e.length;i++)(t=e[i])&&t.from>n&&t.to<r&&((o||(o=[])).push(t),e[i]=null);return o}function Vt(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Wt(e,t,n,r){let o=[],i=!1;t.forEach(((t,s)=>{let a=Ht(e,t,s+n);if(a){i=!0;let e=Wt(a,t,n+s+1,r);e!=$t&&o.push(s,s+t.nodeSize,e)}}));let s=Ut(i?Vt(e):e,-n).sort(Kt);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new zt(s,o):$t}function Kt(e,t){return e.from-t.from||e.to-t.to}function qt(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Gt(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Gt(t,o+1,i.copy(r.to,i.to)))}}return t}function Gt(e,t,n){for(;t<e.length&&Kt(n,e[t])>0;)t++;e.splice(t,0,n)}function Jt(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=$t&&t.push(r)})),e.cursorWrapper&&t.push(zt.create(e.state.doc,[e.cursorWrapper.deco])),jt.from(t)}const Yt={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Zt=S&&E<=11;class Xt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Qt{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Xt,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);S&&E<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Zt&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Yt)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(Le(this.view)){if(this.suppressingSelectionUpdates)return Ne(this.view);if(S&&E<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&u(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let t=e.focusNode;t;t=a(t))n.add(t);for(let r=e.anchorNode;r;r=a(r))if(n.has(r)){t=r;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Le(e)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],l);n&&(i=i<0?n.from:Math.min(n.from,i),s=s<0?n.to:Math.max(n.to,s),n.typeOver&&(a=!0))}if(C&&l.length>1){let e=l.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&m(n)&&(c=Ce(e))&&c.eq(r.LN.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ne(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),function(e){if(!en.has(e)&&(en.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=C,tn)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),tn=!0}}(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Ne(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(S&&E<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==e.target?s(r)+1:0,a=n.localPosFromDOM(e.target,i,-1),l=o&&o.parentNode==e.target?s(o):e.target.childNodes.length;return{from:a,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let en=new WeakMap,tn=!1;function nn(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(T&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||T&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const rn=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function on(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Fe(e,t.resolve(n.anchor),t.resolve(n.head))}function sn(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}class an{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ut,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(pn),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=un(this),cn(this),this.nodeViews=dn(this),this.docView=ce(this.state.doc,ln(this),Jt(this),this.dom,this),this.domObserver=new Qt(this,((e,t,n,i)=>function(e,t,n,i,s){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Ce(e,t);if(n&&!e.state.selection.eq(n)){if(N&&R&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.composing&&r.setMeta("composition",e.input.compositionID),e.dispatch(r)}return}let a=e.state.doc.resolve(t),l=a.sharedDepth(n);t=a.before(l+1),n=e.state.doc.resolve(n).after(l+1);let c,u,d=e.state.selection,p=function(e,t,n){let r,{node:i,fromOffset:s,toOffset:a,from:l,to:c}=e.docView.parseRange(t,n),u=e.domSelectionRange(),d=u.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:u.anchorOffset}],m(u)||r.push({node:u.focusNode,offset:u.focusOffset})),N&&8===e.input.lastKeyCode)for(let e=a;e>s;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){a=e;break}if(!n||n.size)break}let p=e.state.doc,h=e.someProp("domParser")||o.S4.fromSchema(e.state.schema),f=p.resolve(l),g=null,y=h.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:nn,context:f});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),g={anchor:e+l,head:t+l}}return{doc:y,sel:g,from:l,to:c}}(e,t,n),h=e.state.doc,f=h.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(c=e.state.selection.to,u="end"):(c=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let y=function(e,t,n,r,o){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);return"end"==o&&(r-=s+Math.max(0,i-Math.min(s,a))-i),s<i&&e.size<t.size?(i-=r<=i&&r>=s?i-r:0,a=i+(a-s),s=i):a<i&&(i-=r<=i&&r>=a?i-r:0,s=i+(s-a),a=i),{start:i,endA:s,endB:a}}(f.content,p.doc.content,p.from,c,u);if((M&&e.input.lastIOSEnter>Date.now()-225||R)&&s.some((e=>1==e.nodeType&&!rn.test(e.nodeName)))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!y){if(!(i&&d instanceof r.U3&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let t=on(e,e.state.doc,p.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);e.composing&&n.setMeta("composition",e.input.compositionID),e.dispatch(n)}}return}y={start:d.from,endA:d.to,endB:d.to}}if(N&&e.cursorWrapper&&p.sel&&p.sel.anchor==e.cursorWrapper.deco.from&&p.sel.head==p.sel.anchor){let e=y.endB-y.start;p.sel={anchor:p.sel.anchor+e,head:p.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof r.U3&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),S&&E<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>p.from&&"  "==p.doc.textBetween(y.start-p.from-1,y.start-p.from+1)&&(y.start--,y.endA--,y.endB--);let b,k=p.doc.resolveNoCache(y.start-p.from),w=p.doc.resolveNoCache(y.endB-p.from),v=h.resolve(y.start),x=k.sameParent(w)&&k.parent.inlineContent&&v.end()>=y.endA;if((M&&e.input.lastIOSEnter>Date.now()-225&&(!x||s.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!x&&k.pos<p.doc.content.size&&(b=r.LN.findFrom(p.doc.resolve(k.pos+1),1,!0))&&b.head==w.pos)&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>y.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||sn(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(sn(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||sn(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(h,y.start,y.endA,k,w)&&e.someProp("handleKeyDown",(t=>t(e,g(8,"Backspace")))))return void(R&&N&&e.domObserver.suppressSelectionUpdates());N&&R&&y.endB==y.start&&(e.input.lastAndroidDelete=Date.now()),R&&!x&&k.start()!=w.start()&&0==w.parentOffset&&k.depth==w.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==y.endA&&(y.endB-=2,w=p.doc.resolveNoCache(y.endB-p.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,g(13,"Enter"))}))}),20));let C,A,O,T=y.start,D=y.endA;if(x)if(k.pos==w.pos)S&&E<=11&&0==k.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Ne(e)),20)),C=e.state.tr.delete(T,D),A=h.resolve(y.start).marksAcross(h.resolve(y.endA));else if(y.endA==y.endB&&(O=function(e,t){let n,r,i,s=e.firstChild.marks,a=t.firstChild.marks,l=s,c=a;for(let e=0;e<a.length;e++)l=a[e].removeFromSet(l);for(let e=0;e<s.length;e++)c=s[e].removeFromSet(c);if(1==l.length&&0==c.length)r=l[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=l.length||1!=c.length)return null;r=c[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let u=[];for(let e=0;e<t.childCount;e++)u.push(i(t.child(e)));if(o.FK.from(u).eq(e))return{mark:r,type:n}}(k.parent.content.cut(k.parentOffset,w.parentOffset),v.parent.content.cut(v.parentOffset,y.endA-v.start()))))C=e.state.tr,"add"==O.type?C.addMark(T,D,O.mark):C.removeMark(T,D,O.mark);else if(k.parent.child(k.index()).isText&&k.index()==w.index()-(w.textOffset?0:1)){let t=k.parent.textBetween(k.parentOffset,w.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,T,D,t))))return;C=e.state.tr.insertText(t,T,D)}if(C||(C=e.state.tr.replace(T,D,p.doc.slice(y.start-p.from,y.endB-p.from))),p.sel){let t=on(e,C.doc,p.sel);t&&!(N&&R&&e.composing&&t.empty&&(y.start!=y.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==T||t.head==C.mapping.map(D)-1)||S&&t.empty&&t.head==T)&&C.setSelection(t)}A&&C.ensureMarks(A),e.composing&&C.setMeta("composition",e.input.compositionID),e.dispatch(C.scrollIntoView())}(this,e,t,n,i))),this.domObserver.start(),function(e){for(let t in at){let n=at[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!ft(e,t)||ht(e,t)||!e.editable&&t.type in lt||n(e,t)},ct[t]?{passive:!0}:void 0)}T&&e.dom.addEventListener("input",(()=>null)),pt(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&pt(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(pn),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,o=!1;e.storedMarks&&this.composing&&(At(this),o=!0),this.state=e;let i=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(i||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=dn(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(i||t.handleDOMEvents!=this._props.handleDOMEvents)&&pt(this),this.editable=un(this),cn(this);let s=Jt(this),a=ln(this),l=n.plugins==e.plugins||n.doc.eq(e.doc)?e.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=r||!this.docView.matchesNode(e.doc,a,s);!c&&e.selection.eq(n.selection)||(o=!0);let d="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:$(e.dom)}}(this);if(o){this.domObserver.stop();let t=c&&(S||N)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(c){let n=N?this.trackWrites=this.domSelectionRange().focusNode:null;!r&&this.docView.update(e.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ce(e.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return u(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Ne(this,t):(Ie(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():d&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;j(n,0==r?0:r-t)}(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof r.nh){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&z(this,t.getBoundingClientRect(),e)}else z(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let o=this.directPlugins[r].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[e];if(null!=i&&(n=t?t(i):i))return n}}hasFocus(){if(S){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(U)return e.focus(U);let t=$(e);e.focus(null==U?{get preventScroll(){return U={preventScroll:!0},!0}}:void 0),U||(U=!1,j(t,0))}(this.dom),Ne(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return K(this,e)}coordsAtPos(e,t=1){return Y(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){return te==t&&ne==n?re:(te=t,ne=n,re="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return Q(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Y(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=c(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return ee.test(r.parent.textContent)&&a.modify?Q(e,t,(()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:s}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),p=u&&!c.contains(1==u.nodeType?u:u.parentNode)||t==u&&o==d;try{a.collapse(i,s),t&&(t!=i||o!=s)&&a.extend&&a.extend(t,o)}catch(e){}return null!=l&&(a.caretBidiLevel=l),p})):"left"==n||"backward"==n?i:s}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return Tt(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Tt(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Jt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){ht(e,t)||!at[t.type]||!e.editable&&t.type in lt||at[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return T&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom?function(e){let t;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,o=t.startOffset,i=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return u(a.node,a.offset,i,s)&&([r,o,i,s]=[i,s,r,o]),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function ln(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[Pt.node(0,e.state.doc.content.size,t)]}function cn(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Pt.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function un(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function dn(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function pn(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}},74635:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(72016);function o(e,t){(0,r.A)(e,t),t.add(e)}},77508:(e,t,n)=>{"use strict";n.d(t,{N:()=>o});var r=n(17884);function o(e,t,n,o){const i=o?o-1:Number.POSITIVE_INFINITY;let s=0;return function(o){return(0,r.On)(o)?(e.enter(n),a(o)):t(o)};function a(o){return(0,r.On)(o)&&s++<i?(e.consume(o),a):(e.exit(n),t(o))}}},80096:(e,t,n)=>{"use strict";n.d(t,{JJ:()=>s,fV:()=>o,tG:()=>i});var r=n(11329);class o{constructor(e,t){var n;this.match=e,this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,o){let i=n;if(t[1]){let e=t[0].lastIndexOf(t[1]);i+=t[0].slice(e+t[1].length);let n=(r+=e)-o;n>0&&(i=t[0].slice(e-n,e)+i,r=o)}return e.tr.insertText(i,r,o)}):t}}function i(e,t,n=null,i){return new o(e,((e,o,s,a)=>{let l=n instanceof Function?n(o):n,c=e.tr.delete(s,a),u=c.doc.resolve(s).blockRange(),d=u&&(0,r.oM)(u,t,l);if(!d)return null;c.wrap(u,d);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&(0,r.n9)(c.doc,s-1)&&(!i||i(o,p))&&c.join(s-1),c}))}function s(e,t,n=null){return new o(e,((e,r,o,i)=>{let s=e.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(o,i).setBlockType(o,o,t,a):null}))}new o(/--$/,"—"),new o(/\.\.\.$/,"…"),new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new o(/"$/,"”"),new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new o(/'$/,"’")},81570:(e,t,n)=>{"use strict";n.d(t,{$t:()=>S,LN:()=>s,U3:()=>u,hs:()=>O,i5:()=>f,k_:()=>C,nh:()=>p,yn:()=>a});var r=n(16090),o=n(11329);const i=Object.create(null);class s{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new a(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=r.Ji.empty){let n=t.content.lastChild,o=null;for(let e=0;e<t.openEnd;e++)o=n,n=n.lastChild;let i=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?r.Ji.empty:t),0==a&&y(e,i,(n?n.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),y(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new u(e):g(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?g(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):g(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new f(e.node(0))}static atStart(e){return g(e,e,0,0,1)||new f(e)}static atEnd(e){return g(e,e,e.content.size,e.childCount,-1)||new f(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=i[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in i)throw new RangeError("Duplicate use of selection JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t}getBookmark(){return u.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class a{constructor(e,t){this.$from=e,this.$to=t}}let l=!1;function c(e){l||e.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class u extends s{constructor(e,t=e){c(e),c(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=e.resolve(t.map(this.anchor));return new u(r.parent.inlineContent?r:n,n)}replace(e,t=r.Ji.empty){if(super.replace(e,t),t==r.Ji.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof u&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new d(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new u(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=s.findFrom(t,n,!0)||s.findFrom(t,-n,!0);if(!e)return s.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(s.findFrom(e,-n,!0)||s.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new u(e,t)}}s.jsonID("text",u);class d{constructor(e,t){this.anchor=e,this.head=t}map(e){return new d(e.map(this.anchor),e.map(this.head))}resolve(e){return u.between(e.resolve(this.anchor),e.resolve(this.head))}}class p extends s{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?s.near(o):new p(o)}content(){return new r.Ji(r.FK.from(this.node),0,0)}eq(e){return e instanceof p&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new h(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new p(e.resolve(t.anchor))}static create(e,t){return new p(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}p.prototype.visible=!1,s.jsonID("node",p);class h{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new d(n,n):new h(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&p.isSelectable(n)?new p(t):s.near(t)}}class f extends s{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=r.Ji.empty){if(t==r.Ji.empty){e.delete(0,e.doc.content.size);let t=s.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new f(e)}map(e){return new f(e)}eq(e){return e instanceof f}getBookmark(){return m}}s.jsonID("all",f);const m={map(){return this},resolve:e=>new f(e)};function g(e,t,n,r,o,i=!1){if(t.inlineContent)return u.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&p.isSelectable(r))return p.create(e,n-(o<0?r.nodeSize:0))}else{let t=g(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function y(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,a=e.steps[r];(a instanceof o.Ln||a instanceof o.Wg)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(s.near(e.doc.resolve(i),n)))}class b extends o.dL{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function k(e,t){return t&&e?e.bind(t):e}class w{constructor(e,t,n){this.name=e,this.init=k(t.init,n),this.apply=k(t.apply,n)}}const v=[new w("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new w("selection",{init:(e,t)=>e.selection||s.atStart(t.doc),apply:e=>e.selection}),new w("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new w("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class x{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=v.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new w(e.key,e.spec.state,e))}))}}class S{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new S(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new b(this)}static create(e){let t=new x(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new S(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new x(this.schema,e.plugins),n=t.fields,r=new S(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new x(e.schema,e.plugins),i=new S(o);return o.fields.forEach((o=>{if("doc"==o.name)i.doc=r.bP.fromJSON(e.schema,t.doc);else if("selection"==o.name)i.selection=s.fromJSON(i.doc,t.selection);else if("storedMarks"==o.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],a=s.spec.state;if(s.key==o.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(i[o.name]=a.fromJSON.call(s,e,t[r],i))}i[o.name]=o.init(e,i)}})),i}}function E(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=E(o,t,{})),n[r]=o}return n}class C{constructor(e){this.spec=e,this.props={},e.props&&E(e.props,this,this.props),this.key=e.key?e.key.key:N("plugin")}getState(e){return e[this.key]}}const A=Object.create(null);function N(e){return e in A?e+"$"+ ++A[e]:(A[e]=0,e+"$")}class O{constructor(e="key"){this.key=N(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},83751:(e,t,n)=>{"use strict";n.d(t,{B:()=>yt,y:()=>bt});var r=n(44254),o=n(81570),i=n(30072);function s(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function a(e){return e instanceof s(e).Element||e instanceof Element}function l(e){return e instanceof s(e).HTMLElement||e instanceof HTMLElement}function c(e){return"undefined"!=typeof ShadowRoot&&(e instanceof s(e).ShadowRoot||e instanceof ShadowRoot)}var u=Math.max,d=Math.min,p=Math.round;function h(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function f(){return!/^((?!chrome|android).)*safari/i.test(h())}function m(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&l(e)&&(o=e.offsetWidth>0&&p(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&p(r.height)/e.offsetHeight||1);var c=(a(e)?s(e):window).visualViewport,u=!f()&&n,d=(r.left+(u&&c?c.offsetLeft:0))/o,h=(r.top+(u&&c?c.offsetTop:0))/i,m=r.width/o,g=r.height/i;return{width:m,height:g,top:h,right:d+m,bottom:h+g,left:d,x:d,y:h}}function g(e){var t=s(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function y(e){return e?(e.nodeName||"").toLowerCase():null}function b(e){return((a(e)?e.ownerDocument:e.document)||window.document).documentElement}function k(e){return m(b(e)).left+g(e).scrollLeft}function w(e){return s(e).getComputedStyle(e)}function v(e){var t=w(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function x(e,t,n){void 0===n&&(n=!1);var r,o,i=l(t),a=l(t)&&function(e){var t=e.getBoundingClientRect(),n=p(t.width)/e.offsetWidth||1,r=p(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),c=b(t),u=m(e,a,n),d={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(i||!i&&!n)&&(("body"!==y(t)||v(c))&&(d=(r=t)!==s(r)&&l(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:g(r)),l(t)?((h=m(t,!0)).x+=t.clientLeft,h.y+=t.clientTop):c&&(h.x=k(c))),{x:u.left+d.scrollLeft-h.x,y:u.top+d.scrollTop-h.y,width:u.width,height:u.height}}function S(e){var t=m(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function E(e){return"html"===y(e)?e:e.assignedSlot||e.parentNode||(c(e)?e.host:null)||b(e)}function C(e){return["html","body","#document"].indexOf(y(e))>=0?e.ownerDocument.body:l(e)&&v(e)?e:C(E(e))}function A(e,t){var n;void 0===t&&(t=[]);var r=C(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=s(r),a=o?[i].concat(i.visualViewport||[],v(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(A(E(a)))}function N(e){return["table","td","th"].indexOf(y(e))>=0}function O(e){return l(e)&&"fixed"!==w(e).position?e.offsetParent:null}function T(e){for(var t=s(e),n=O(e);n&&N(n)&&"static"===w(n).position;)n=O(n);return n&&("html"===y(n)||"body"===y(n)&&"static"===w(n).position)?t:n||function(e){var t=/firefox/i.test(h());if(/Trident/i.test(h())&&l(e)&&"fixed"===w(e).position)return null;var n=E(e);for(c(n)&&(n=n.host);l(n)&&["html","body"].indexOf(y(n))<0;){var r=w(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var M="top",D="bottom",I="right",R="left",F="auto",L=[M,D,I,R],P="start",B="end",_="viewport",z="popper",$=L.reduce((function(e,t){return e.concat([t+"-"+P,t+"-"+B])}),[]),j=[].concat(L,[F]).reduce((function(e,t){return e.concat([t,t+"-"+P,t+"-"+B])}),[]),U=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function H(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var V={placement:"bottom",modifiers:[],strategy:"absolute"};function W(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function K(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?V:o;return function(e,t,n){void 0===n&&(n=i);var o,s,l={placement:"bottom",orderedModifiers:[],options:Object.assign({},V,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],u=!1,d={state:l,setOptions:function(n){var o="function"==typeof n?n(l.options):n;p(),l.options=Object.assign({},i,l.options,o),l.scrollParents={reference:a(e)?A(e):e.contextElement?A(e.contextElement):[],popper:A(t)};var s,u,h=function(e){var t=H(e);return U.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(r,l.options.modifiers),u=s.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(u).map((function(e){return u[e]}))));return l.orderedModifiers=h.filter((function(e){return e.enabled})),l.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:l,name:t,instance:d,options:r});c.push(i||function(){})}})),d.update()},forceUpdate:function(){if(!u){var e=l.elements,t=e.reference,n=e.popper;if(W(t,n)){l.rects={reference:x(t,T(n),"fixed"===l.options.strategy),popper:S(n)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach((function(e){return l.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<l.orderedModifiers.length;r++)if(!0!==l.reset){var o=l.orderedModifiers[r],i=o.fn,s=o.options,a=void 0===s?{}:s,c=o.name;"function"==typeof i&&(l=i({state:l,options:a,name:c,instance:d})||l)}else l.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(e){d.forceUpdate(),e(l)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(o())}))}))),s}),destroy:function(){p(),u=!0}};if(!W(e,t))return d;function p(){c.forEach((function(e){return e()})),c=[]}return d.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),d}}var q={passive:!0};function G(e){return e.split("-")[0]}function J(e){return e.split("-")[1]}function Y(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Z(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?G(o):null,s=o?J(o):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case M:t={x:a,y:n.y-r.height};break;case D:t={x:a,y:n.y+n.height};break;case I:t={x:n.x+n.width,y:l};break;case R:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?Y(i):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case P:t[c]=t[c]-(n[u]/2-r[u]/2);break;case B:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}var X={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,f=a.x,m=void 0===f?0:f,g=a.y,y=void 0===g?0:g,k="function"==typeof d?d({x:m,y}):{x:m,y};m=k.x,y=k.y;var v=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),S=R,E=M,C=window;if(u){var A=T(n),N="clientHeight",O="clientWidth";A===s(n)&&"static"!==w(A=b(n)).position&&"absolute"===l&&(N="scrollHeight",O="scrollWidth"),(o===M||(o===R||o===I)&&i===B)&&(E=D,y-=(h&&A===C&&C.visualViewport?C.visualViewport.height:A[N])-r.height,y*=c?1:-1),o!==R&&(o!==M&&o!==D||i!==B)||(S=I,m-=(h&&A===C&&C.visualViewport?C.visualViewport.width:A[O])-r.width,m*=c?1:-1)}var F,L=Object.assign({position:l},u&&X),P=!0===d?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:p(n*o)/o||0,y:p(r*o)/o||0}}({x:m,y},s(n)):{x:m,y};return m=P.x,y=P.y,c?Object.assign({},L,((F={})[E]=x?"0":"",F[S]=v?"0":"",F.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",F)):Object.assign({},L,((t={})[E]=x?y+"px":"",t[S]=v?m+"px":"",t.transform="",t))}const ee={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];l(o)&&y(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});l(r)&&y(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,s=j.reduce((function(e,n){return e[n]=function(e,t,n){var r=G(e),o=[R,M].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[R,I].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,i),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}};var ne={left:"right",right:"left",bottom:"top",top:"bottom"};function re(e){return e.replace(/left|right|bottom|top/g,(function(e){return ne[e]}))}var oe={start:"end",end:"start"};function ie(e){return e.replace(/start|end/g,(function(e){return oe[e]}))}function se(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&c(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ae(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function le(e,t,n){return t===_?ae(function(e,t){var n=s(e),r=b(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;var u=f();(u||!u&&"fixed"===t)&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l+k(e),y:c}}(e,n)):a(t)?function(e,t){var n=m(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):ae(function(e){var t,n=b(e),r=g(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=u(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=u(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+k(e),l=-r.scrollTop;return"rtl"===w(o||n).direction&&(a+=u(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(b(e)))}function ce(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ue(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function de(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,s=void 0===i?e.strategy:i,c=n.boundary,p=void 0===c?"clippingParents":c,h=n.rootBoundary,f=void 0===h?_:h,g=n.elementContext,k=void 0===g?z:g,v=n.altBoundary,x=void 0!==v&&v,S=n.padding,C=void 0===S?0:S,N=ce("number"!=typeof C?C:ue(C,L)),O=k===z?"reference":z,R=e.rects.popper,F=e.elements[x?O:k],P=function(e,t,n,r){var o="clippingParents"===t?function(e){var t=A(E(e)),n=["absolute","fixed"].indexOf(w(e).position)>=0&&l(e)?T(e):e;return a(n)?t.filter((function(e){return a(e)&&se(e,n)&&"body"!==y(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),s=i[0],c=i.reduce((function(t,n){var o=le(e,n,r);return t.top=u(o.top,t.top),t.right=d(o.right,t.right),t.bottom=d(o.bottom,t.bottom),t.left=u(o.left,t.left),t}),le(e,s,r));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}(a(F)?F:F.contextElement||b(e.elements.popper),p,f,s),B=m(e.elements.reference),$=Z({reference:B,element:R,strategy:"absolute",placement:o}),j=ae(Object.assign({},R,$)),U=k===z?j:B,H={top:P.top-U.top+N.top,bottom:U.bottom-P.bottom+N.bottom,left:P.left-U.left+N.left,right:U.right-P.right+N.right},V=e.modifiersData.offset;if(k===z&&V){var W=V[o];Object.keys(H).forEach((function(e){var t=[I,D].indexOf(e)>=0?1:-1,n=[M,D].indexOf(e)>=0?"y":"x";H[e]+=W[n]*t}))}return H}const pe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,y=G(g),b=l||(y!==g&&f?function(e){if(G(e)===F)return[];var t=re(e);return[ie(e),t,ie(t)]}(g):[re(g)]),k=[g].concat(b).reduce((function(e,n){return e.concat(G(n)===F?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?j:l,u=J(r),d=u?a?$:$.filter((function(e){return J(e)===u})):L,p=d.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=de(e,{placement:n,boundary:o,rootBoundary:i,padding:s})[G(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,v=t.rects.popper,x=new Map,S=!0,E=k[0],C=0;C<k.length;C++){var A=k[C],N=G(A),O=J(A)===P,T=[M,D].indexOf(N)>=0,B=T?"width":"height",_=de(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),z=T?O?I:R:O?D:M;w[B]>v[B]&&(z=re(z));var U=re(z),H=[];if(i&&H.push(_[N]<=0),a&&H.push(_[z]<=0,_[U]<=0),H.every((function(e){return e}))){E=A,S=!1;break}x.set(A,H)}if(S)for(var V=function(e){var t=k.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},W=f?3:1;W>0&&"break"!==V(W);W--);t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function he(e,t,n){return u(e,d(t,n))}function fe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function me(e){return[M,I,D,R].some((function(t){return e[t]>=0}))}var ge=K({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,l=void 0===a||a,c=s(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach((function(e){e.addEventListener("scroll",n.update,q)})),l&&c.addEventListener("resize",n.update,q),function(){i&&u.forEach((function(e){e.removeEventListener("scroll",n.update,q)})),l&&c.removeEventListener("resize",n.update,q)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Z({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:G(t.placement),variation:J(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Q(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Q(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},ee,te,pe,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,p=n.altBoundary,h=n.padding,f=n.tether,m=void 0===f||f,g=n.tetherOffset,y=void 0===g?0:g,b=de(t,{boundary:l,rootBoundary:c,padding:h,altBoundary:p}),k=G(t.placement),w=J(t.placement),v=!w,x=Y(k),E="x"===x?"y":"x",C=t.modifiersData.popperOffsets,A=t.rects.reference,N=t.rects.popper,O="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,F="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(C){if(i){var _,z="y"===x?M:R,$="y"===x?D:I,j="y"===x?"height":"width",U=C[x],H=U+b[z],V=U-b[$],W=m?-N[j]/2:0,K=w===P?A[j]:N[j],q=w===P?-N[j]:-A[j],Z=t.elements.arrow,X=m&&Z?S(Z):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Q[z],te=Q[$],ne=he(0,A[j],X[j]),re=v?A[j]/2-W-ne-ee-F.mainAxis:K-ne-ee-F.mainAxis,oe=v?-A[j]/2+W+ne+te+F.mainAxis:q+ne+te+F.mainAxis,ie=t.elements.arrow&&T(t.elements.arrow),se=ie?"y"===x?ie.clientTop||0:ie.clientLeft||0:0,ae=null!=(_=null==L?void 0:L[x])?_:0,le=U+oe-ae,ce=he(m?d(H,U+re-ae-se):H,U,m?u(V,le):V);C[x]=ce,B[x]=ce-U}if(a){var ue,pe="x"===x?M:R,fe="x"===x?D:I,me=C[E],ge="y"===E?"height":"width",ye=me+b[pe],be=me-b[fe],ke=-1!==[M,R].indexOf(k),we=null!=(ue=null==L?void 0:L[E])?ue:0,ve=ke?ye:me-A[ge]-N[ge]-we+F.altAxis,xe=ke?me+A[ge]+N[ge]-we-F.altAxis:be,Se=m&&ke?function(e,t,n){var r=he(e,t,n);return r>n?n:r}(ve,me,xe):he(m?ve:ye,me,m?xe:be);C[E]=Se,B[E]=Se-me}t.modifiersData[r]=B}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=G(n.placement),l=Y(a),c=[R,I].indexOf(a)>=0?"height":"width";if(i&&s){var u=function(e,t){return ce("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ue(e,L))}(o.padding,n),d=S(i),p="y"===l?M:R,h="y"===l?D:I,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],g=T(i),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=f/2-m/2,k=u[p],w=y-d[c]-u[h],v=y/2-d[c]/2+b,x=he(k,v,w),E=l;n.modifiersData[r]=((t={})[E]=x,t.centerOffset=x-v,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&se(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=de(t,{elementContext:"reference"}),a=de(t,{altBoundary:!0}),l=fe(s,r),c=fe(a,o,i),u=me(l),d=me(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),ye="tippy-content",be="tippy-arrow",ke="tippy-svg-arrow",we={passive:!0,capture:!0},ve=function(){return document.body};function xe(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Se(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Ee(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Ce(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ae(e){return[].concat(e)}function Ne(e,t){-1===e.indexOf(t)&&e.push(t)}function Oe(e){return[].slice.call(e)}function Te(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Me(){return document.createElement("div")}function De(e){return["Element","Fragment"].some((function(t){return Se(e,t)}))}function Ie(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Re(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Fe(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function Le(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var Pe={isTouch:!1},Be=0;function _e(){Pe.isTouch||(Pe.isTouch=!0,window.performance&&document.addEventListener("mousemove",ze))}function ze(){var e=performance.now();e-Be<20&&(Pe.isTouch=!1,document.removeEventListener("mousemove",ze)),Be=e}function $e(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var je=!("undefined"==typeof window||"undefined"==typeof document||!window.msCrypto),Ue=Object.assign({appendTo:ve,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),He=Object.keys(Ue);function Ve(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;return o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=Ue[o])?r:i),t}),{});return Object.assign({},e,t)}function We(e,t){var n=Object.assign({},t,{content:Ee(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Ve(Object.assign({},Ue,{plugins:t}))):He).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Ue.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Ke(e,t){e.innerHTML=t}function qe(e){var t=Me();return!0===e?t.className=be:(t.className=ke,De(e)?t.appendChild(e):Ke(t,e)),t}function Ge(e,t){De(t.content)?(Ke(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Ke(e,t.content):e.textContent=t.content)}function Je(e){var t=e.firstElementChild,n=Oe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ye)})),arrow:n.find((function(e){return e.classList.contains(be)||e.classList.contains(ke)})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function Ye(e){var t=Me(),n=Me();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Me();function o(n,r){var o=Je(t),i=o.box,s=o.content,a=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Ge(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(i.removeChild(a),i.appendChild(qe(r.arrow))):i.appendChild(qe(r.arrow)):a&&i.removeChild(a)}return r.className=ye,r.setAttribute("data-state","hidden"),Ge(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Ye.$$tippy=!0;var Ze=1,Xe=[],Qe=[];function et(e,t){var n,r,o,i,s,a,l,c,u=We(e,Object.assign({},Ue,Ve(Te(t)))),d=!1,p=!1,h=!1,f=!1,m=[],g=Ce(q,u.interactiveDebounce),y=Ze++,b=(c=u.plugins).filter((function(e,t){return c.indexOf(e)===t})),k={id:y,reference:e,popper:Me(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){if(!k.state.isDestroyed){R("onBeforeUpdate",[k,t]),W();var n=k.props,r=We(e,Object.assign({},n,Te(t),{ignoreAttributes:!0}));k.props=r,V(),n.interactiveDebounce!==r.interactiveDebounce&&(P(),g=Ce(q,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?Ae(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded"),L(),I(),x&&x(n,r),k.popperInstance&&(Z(),Q().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))),R("onAfterUpdate",[k,t])}},setContent:function(e){k.setProps({content:e})},show:function(){var e=k.state.isVisible,t=k.state.isDestroyed,n=!k.state.isEnabled,r=Pe.isTouch&&!k.props.touch,o=xe(k.props.duration,0,Ue.duration);if(!(e||t||n||r||O().hasAttribute("disabled")||(R("onShow",[k],!1),!1===k.props.onShow(k)))){if(k.state.isVisible=!0,N()&&(v.style.visibility="visible"),I(),$(),k.state.isMounted||(v.style.transition="none"),N()){var i=M();Ie([i.box,i.content],0)}var s,l,c;a=function(){var e;if(k.state.isVisible&&!f){if(f=!0,v.offsetHeight,v.style.transition=k.props.moveTransition,N()&&k.props.animation){var t=M(),n=t.box,r=t.content;Ie([n,r],o),Re([n,r],"visible")}F(),L(),Ne(Qe,k),null==(e=k.popperInstance)||e.forceUpdate(),R("onMount",[k]),k.props.animation&&N()&&function(e){U(e,(function(){k.state.isShown=!0,R("onShown",[k])}))}(o)}},l=k.props.appendTo,c=O(),(s=k.props.interactive&&l===ve||"parent"===l?c.parentNode:Ee(l,[c])).contains(v)||s.appendChild(v),k.state.isMounted=!0,Z()}},hide:function(){var e=!k.state.isVisible,t=k.state.isDestroyed,n=!k.state.isEnabled,r=xe(k.props.duration,1,Ue.duration);if(!(e||t||n)&&(R("onHide",[k],!1),!1!==k.props.onHide(k))){if(k.state.isVisible=!1,k.state.isShown=!1,f=!1,d=!1,N()&&(v.style.visibility="hidden"),P(),j(),I(!0),N()){var o=M(),i=o.box,s=o.content;k.props.animation&&(Ie([i,s],r),Re([i,s],"hidden"))}F(),L(),k.props.animation?N()&&function(e,t){U(e,(function(){!k.state.isVisible&&v.parentNode&&v.parentNode.contains(v)&&t()}))}(r,k.unmount):k.unmount()}},hideWithInteractivity:function(e){T().addEventListener("mousemove",g),Ne(Xe,g),g(e)},enable:function(){k.state.isEnabled=!0},disable:function(){k.hide(),k.state.isEnabled=!1},unmount:function(){k.state.isVisible&&k.hide(),k.state.isMounted&&(X(),Q().forEach((function(e){e._tippy.unmount()})),v.parentNode&&v.parentNode.removeChild(v),Qe=Qe.filter((function(e){return e!==k})),k.state.isMounted=!1,R("onHidden",[k]))},destroy:function(){k.state.isDestroyed||(k.clearDelayTimeouts(),k.unmount(),W(),delete e._tippy,k.state.isDestroyed=!0,R("onDestroy",[k]))}};if(!u.render)return k;var w=u.render(k),v=w.popper,x=w.onUpdate;v.setAttribute("data-tippy-root",""),v.id="tippy-"+k.id,k.popper=v,e._tippy=k,v._tippy=k;var S=b.map((function(e){return e.fn(k)})),E=e.hasAttribute("aria-expanded");return V(),L(),I(),R("onCreate",[k]),u.showOnCreate&&ee(),v.addEventListener("mouseenter",(function(){k.props.interactive&&k.state.isVisible&&k.clearDelayTimeouts()})),v.addEventListener("mouseleave",(function(){k.props.interactive&&k.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",g)})),k;function C(){var e=k.props.touch;return Array.isArray(e)?e:[e,0]}function A(){return"hold"===C()[0]}function N(){var e;return!(null==(e=k.props.render)||!e.$$tippy)}function O(){return l||e}function T(){var e,t,n=O().parentNode;return n?null!=(t=Ae(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function M(){return Je(v)}function D(e){return k.state.isMounted&&!k.state.isVisible||Pe.isTouch||i&&"focus"===i.type?0:xe(k.props.delay,e?0:1,Ue.delay)}function I(e){void 0===e&&(e=!1),v.style.pointerEvents=k.props.interactive&&!e?"":"none",v.style.zIndex=""+k.props.zIndex}function R(e,t,n){var r;void 0===n&&(n=!0),S.forEach((function(n){n[e]&&n[e].apply(n,t)})),n&&(r=k.props)[e].apply(r,t)}function F(){var t=k.props.aria;if(t.content){var n="aria-"+t.content,r=v.id;Ae(k.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(k.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function L(){!E&&k.props.aria.expanded&&Ae(k.props.triggerTarget||e).forEach((function(e){k.props.interactive?e.setAttribute("aria-expanded",k.state.isVisible&&e===O()?"true":"false"):e.removeAttribute("aria-expanded")}))}function P(){T().removeEventListener("mousemove",g),Xe=Xe.filter((function(e){return e!==g}))}function B(t){if(!Pe.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!k.props.interactive||!Le(v,n)){if(Ae(k.props.triggerTarget||e).some((function(e){return Le(e,n)}))){if(Pe.isTouch)return;if(k.state.isVisible&&k.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[k,t]);!0===k.props.hideOnClick&&(k.clearDelayTimeouts(),k.hide(),p=!0,setTimeout((function(){p=!1})),k.state.isMounted||j())}}}function _(){h=!0}function z(){h=!1}function $(){var e=T();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,we),e.addEventListener("touchstart",z,we),e.addEventListener("touchmove",_,we)}function j(){var e=T();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,we),e.removeEventListener("touchstart",z,we),e.removeEventListener("touchmove",_,we)}function U(e,t){var n=M().box;function r(e){e.target===n&&(Fe(n,"remove",r),t())}if(0===e)return t();Fe(n,"remove",s),Fe(n,"add",r),s=r}function H(t,n,r){void 0===r&&(r=!1),Ae(k.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function V(){var e;A()&&(H("touchstart",K,{passive:!0}),H("touchend",G,{passive:!0})),(e=k.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(H(e,K),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(je?"focusout":"blur",J);break;case"focusin":H("focusout",J)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),m=[]}function K(e){var t,n=!1;if(k.state.isEnabled&&!Y(e)&&!p){var r="focus"===(null==(t=i)?void 0:t.type);i=e,l=e.currentTarget,L(),!k.state.isVisible&&Se(e,"MouseEvent")&&Xe.forEach((function(t){return t(e)})),"click"===e.type&&(k.props.trigger.indexOf("mouseenter")<0||d)&&!1!==k.props.hideOnClick&&k.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function q(e){var t=e.target,n=O().contains(t)||v.contains(t);if("mousemove"!==e.type||!n){var r=Q().concat(v).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:u}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,s=o.placement.split("-")[0],a=o.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,u="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=t.top-r+l>i,h=r-t.bottom-c>i,f=t.left-n+u>i,m=n-t.right-d>i;return p||h||f||m}))})(r,e)&&(P(),te(e))}}function G(e){Y(e)||k.props.trigger.indexOf("click")>=0&&d||(k.props.interactive?k.hideWithInteractivity(e):te(e))}function J(e){k.props.trigger.indexOf("focusin")<0&&e.target!==O()||k.props.interactive&&e.relatedTarget&&v.contains(e.relatedTarget)||te(e)}function Y(e){return!!Pe.isTouch&&A()!==e.type.indexOf("touch")>=0}function Z(){X();var t=k.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,s=t.moveTransition,l=N()?Je(v).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||O()}:e,u=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(N()){var n=M().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];N()&&l&&u.push({name:"arrow",options:{element:l,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),k.popperInstance=ge(c,v,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:u}))}function X(){k.popperInstance&&(k.popperInstance.destroy(),k.popperInstance=null)}function Q(){return Oe(v.querySelectorAll("[data-tippy-root]"))}function ee(e){k.clearDelayTimeouts(),e&&R("onTrigger",[k,e]),$();var t=D(!0),r=C(),o=r[0],i=r[1];Pe.isTouch&&"hold"===o&&i&&(t=i),t?n=setTimeout((function(){k.show()}),t):k.show()}function te(e){if(k.clearDelayTimeouts(),R("onUntrigger",[k,e]),k.state.isVisible){if(!(k.props.trigger.indexOf("mouseenter")>=0&&k.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=D(!1);t?r=setTimeout((function(){k.state.isVisible&&k.hide()}),t):o=requestAnimationFrame((function(){k.hide()}))}}else j()}}function tt(e,t){void 0===t&&(t={});var n=Ue.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",_e,we),window.addEventListener("blur",$e);var r,o=Object.assign({},t,{plugins:n}),i=(r=e,De(r)?[r]:function(e){return Se(e,"NodeList")}(r)?Oe(r):Array.isArray(r)?r:Oe(document.querySelectorAll(r))).reduce((function(e,t){var n=t&&et(t,o);return n&&e.push(n),e}),[]);return De(e)?i[0]:i}tt.defaultProps=Ue,tt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Ue[t]=e[t]}))},tt.currentInput=Pe,Object.assign({},ee,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),tt.setDefaultProps({render:Ye});const nt=tt;var rt,ot,it,st,at,lt,ct,ut=n(16512),dt=Object.defineProperty,pt=(e,t,n)=>(((e,t,n)=>{t in e?dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),ht=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ft=(e,t,n)=>(ht(e,t,"read from private field"),n?n.call(e):t.get(e)),mt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},gt=(e,t,n,r)=>(ht(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class yt{constructor(e){mt(this,lt),mt(this,rt,void 0),mt(this,ot,void 0),mt(this,it,void 0),mt(this,st,void 0),pt(this,"element"),mt(this,at,((e,t)=>{const{state:n,composing:o}=e,{selection:i,doc:s}=n,{ranges:a}=i,l=Math.min(...a.map((e=>e.$from.pos))),c=Math.max(...a.map((e=>e.$to.pos))),u=t&&t.doc.eq(s)&&t.selection.eq(i);if(ft(this,rt)??gt(this,rt,nt(e.dom,{trigger:"manual",interactive:!0,...ft(this,ot),content:this.element})),!o&&!u){if(!ft(this,st).call(this,e,t))return void this.hide();ft(this,rt).setProps({getReferenceClientRect:()=>(0,r.MG)(e,l,c)}),this.show()}})),pt(this,"update",((e,t)=>{i(ft(this,at),ft(this,it))(e,t)})),pt(this,"destroy",(()=>{var e;null==(e=ft(this,rt))||e.destroy()})),pt(this,"show",(()=>{var e;null==(e=ft(this,rt))||e.show()})),pt(this,"hide",(()=>{var e;null==(e=ft(this,rt))||e.hide()})),pt(this,"getInstance",(()=>ft(this,rt))),this.element=e.content,gt(this,ot,e.tippyOptions??{}),gt(this,it,e.debounce??200),gt(this,st,e.shouldShow??((e,t,n)=>(ht(this,t,"access private method"),n))(0,lt,ct))}}rt=new WeakMap,ot=new WeakMap,it=new WeakMap,st=new WeakMap,at=new WeakMap,lt=new WeakSet,ct=function(e){const{doc:t,selection:n}=e.state,{empty:r,from:i,to:s}=n,a=!t.textBetween(i,s).length&&e.state.selection instanceof o.U3,l=this.element.contains(document.activeElement),c=!e.hasFocus()&&!l,u=!e.editable;return!(c||r||a||u)};const bt=e=>{const t=(0,ut.Qx)({},`${e}_TOOLTIP_SPEC`),n=(0,ut.Gf)((n=>{const r=n.get(t.key);return new o.k_({key:new o.hs(`${e}_TOOLTIP`),...r})})),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-tooltip",displayName:`Ctx<tooltipSpec>|${e}`},n.meta={package:"@milkdown/plugin-tooltip",displayName:`Prose<tooltip>|${e}`},r}},88966:e=>{e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},89575:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:()=>r})},92466:(e,t,n)=>{"use strict";n.d(t,{Nj:()=>l,hG:()=>a,pb:()=>s,y5:()=>i});var r=n(18769);const o=(0,r.createContext)({}),i=()=>{const e=(()=>{const{dom:e,editor:t,setLoading:n,editorFactory:i}=(0,r.useContext)(o),s=(0,r.useRef)(null);return(0,r.useEffect)((()=>{const r=s.current;if(!i||!r)return;e.current=r;const o=i(r);return o?(n(!0),o.create().then((e=>{t.current=e})).finally((()=>{n(!1)})).catch(console.error),()=>{var e;null==(e=t.current)||e.destroy()}):void 0}),[e,t,i,n]),s})();return r.createElement("div",{"data-milkdown-root":!0,ref:e})},s=({children:e})=>{const t=(0,r.useRef)(void 0),[n,i]=(0,r.useState)(void 0),s=(0,r.useRef)(),[a,l]=(0,r.useState)(!0),c=(0,r.useMemo)((()=>({loading:a,dom:t,editor:s,setLoading:l,editorFactory:n,setEditorFactory:i})),[a,n]);return r.createElement(o.Provider,{value:c},e)},a=(e,t=[])=>{const n=(0,r.useContext)(o),i=(0,r.useCallback)(e,t);return(0,r.useLayoutEffect)((()=>{n.setEditorFactory((()=>i))}),[n,i]),{loading:n.loading,get:()=>n.editor.current}},l=()=>{const e=(0,r.useContext)(o),t=(0,r.useCallback)((()=>e.editor.current),[e.editor]);return[e.loading,t]}},99492:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(12559);function o(e,t,n,o){return t((0,r.A)(e,n),o),o}},99742:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>i,d_:()=>o});let r=e=>crypto.getRandomValues(new Uint8Array(e)),o=(e,t=21)=>((e,t,n)=>{let r=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*r*t/e.length);return(i=t)=>{let s="";for(;;){let t=n(o),a=o;for(;a--;)if(s+=e[t[a]&r]||"",s.length===i)return s}}})(e,t,r),i=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),"")},99896:(e,t,n)=>{"use strict";function r(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCharCode(n)}n.d(t,{C:()=>r})}}]);
3
- //# sourceMappingURL=7768.078dabf3.js.map
1
+ /*! For license information please see 9641.4938f7a1.js.LICENSE.txt */
2
+ (globalThis.webpackChunk_next_bricks_markdown=globalThis.webpackChunk_next_bricks_markdown||[]).push([[9641],{135:(e,t,n)=>{"use strict";n.d(t,{b6:()=>I,eD:()=>O,Eb:()=>N});var r=n(27647),o=200,i=function(){};i.prototype.append=function(e){return e.length?(e=i.from(e),!this.length&&e||e.length<o&&this.leafAppend(e)||this.length<o&&e.leafPrepend(this)||this.appendInner(e)):this},i.prototype.prepend=function(e){return e.length?i.from(e).append(this):this},i.prototype.appendInner=function(e){return new a(this,e)},i.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?i.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},i.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},i.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},i.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},i.from=function(e){return e instanceof i?e:e&&e.length?new s(e):i.empty};var s=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=o)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=o)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(i);i.empty=new s([]);var a=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(i);const l=i;var c=n(11329),u=n(81570);class d{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new p(e.map));let t,o=e.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new p(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new d(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),u=new p(e.mapping.maps[n],c,t);(l=a&&a.merge(u))&&(u=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(u),t&&(i++,t=void 0),r||(a=u)}let l=i-n.depth;return l>f&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),i-=l),new d(s.append(o),i)}remapping(e,t){let n=new c.X9;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new d(this.items.append(e.map((e=>new p(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(a+1,r));c&&s++,n.push(new p(l,i,c))}else n.push(new p(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new p(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),u=new d(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&o++;let l,c=new p(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new d(l.from(r.reverse()),o)}}d.empty=new d(l.empty,0);class p{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new p(t.getMap().invert(),t,this.selection)}}}class h{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const f=20;function m(e){let t=[];return e.forEach(((e,n,r,o)=>t.push(r,o))),t}function g(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function y(e,t,n,r){let o=w(t),i=v.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,o),c=new h(r?l:s.remaining,r?s.remaining:l,null,0,-1);n(s.transform.setSelection(a).setMeta(v,{redo:r,historyState:c}).scrollIntoView())}let b=!1,k=null;function w(e){let t=e.plugins;if(k!=t){b=!1,k=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){b=!0;break}}return b}const v=new u.hs("history"),x=new u.hs("closeHistory");const S=(e,t)=>{let n=v.getState(e);return!(!n||0==n.done.eventCount||(t&&y(n,e,t,!1),0))},E=(e,t)=>{let n=v.getState(e);return!(!n||0==n.undone.eventCount||(t&&y(n,e,t,!0),0))};var C=n(16512);const A=(e,t)=>(Object.assign(e,{meta:{package:"@milkdown/plugin-history",...t}}),e),N=(0,C.yu)("Undo",(()=>()=>S));A(N,{displayName:"Command<undo>"});const O=(0,C.yu)("Undo",(()=>()=>E));A(N,{displayName:"Command<redo>"});const T=(0,C.Qx)({},"historyProviderConfig");A(T,{displayName:"Ctx<historyProviderConfig>"});const M=(0,C.Gf)((e=>function(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new u.k_({key:v,state:{init:()=>new h(d.empty,d.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(v);if(i)return i.historyState;n.getMeta(x)&&(e=new h(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(v))return s.getMeta(v).redo?new h(e.done.addTransform(n,void 0,r,w(t)),e.undone,m(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new h(e.done,e.undone.addTransform(n,void 0,r,w(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new h(e.done.rebased(n,o),e.undone.rebased(n,o),g(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new h(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),g(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),a=s?g(e.prevRanges,n.mapping):m(n.mapping.maps[n.steps.length-1]);return new h(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,w(t)),d.empty,a,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?S:"historyRedo"==n?E:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(e.get(T.key))));A(M,{displayName:"Ctx<historyProviderPlugin>"});const D=(0,C.pq)("historyKeymap",{Undo:{shortcuts:"Mod-z",command:e=>{const t=e.get(r.MD);return()=>t.call(N.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:e=>{const t=e.get(r.MD);return()=>t.call(O.key)}}});A(D.ctx,{displayName:"KeymapCtx<history>"}),A(D.shortcuts,{displayName:"Keymap<history>"});const I=[T,M,D,N,O].flat()},1440:(e,t,n)=>{"use strict";n.d(t,{$D:()=>p,Ik:()=>g,TR:()=>h,XM:()=>c,Xm:()=>f,_K:()=>m,dI:()=>d,j7:()=>l,nr:()=>u,pj:()=>b,sm:()=>k,zD:()=>y});var r=Object.defineProperty,o=(e=>(e.docTypeError="docTypeError",e.contextNotFound="contextNotFound",e.timerNotFound="timerNotFound",e.ctxCallOutOfScope="ctxCallOutOfScope",e.createNodeInParserFail="createNodeInParserFail",e.stackOverFlow="stackOverFlow",e.parserMatchError="parserMatchError",e.serializerMatchError="serializerMatchError",e.getAtomFromSchemaFail="getAtomFromSchemaFail",e.expectDomTypeError="expectDomTypeError",e.callCommandBeforeEditorView="callCommandBeforeEditorView",e.missingRootElement="missingRootElement",e.missingNodeInSchema="missingNodeInSchema",e.missingMarkInSchema="missingMarkInSchema",e.ctxNotBind="ctxNotBind",e.missingYjsDoc="missingYjsDoc",e))(o||{});class i extends Error{constructor(e,t){super(t),((e,t,n)=>{((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n)})(this,"code"),this.name="MilkdownError",this.code=e}}const s=(e,t)=>"function"==typeof t?"[Function]":t,a=e=>JSON.stringify(e,s),l=e=>new i(o.docTypeError,`Doc type error, unsupported type: ${a(e)}`),c=e=>new i(o.contextNotFound,`Context "${e}" not found, do you forget to inject it?`),u=e=>new i(o.timerNotFound,`Timer "${e}" not found, do you forget to record it?`),d=()=>new i(o.ctxCallOutOfScope,"Should not call a context out of the plugin."),p=(...e)=>{const t=e.reduce(((e,t)=>{if(!t)return e;const n=e=>Array.isArray(e)?e.map((e=>n(e))).join(", "):e.toJSON?a(e.toJSON()):e.spec?a(e.spec):e.toString();return`${e}, ${n(t)}`}),"Create prosemirror node from remark failed in parser");return new i(o.createNodeInParserFail,t)},h=()=>new i(o.stackOverFlow,"Stack over flow, cannot pop on an empty stack."),f=e=>new i(o.parserMatchError,`Cannot match target parser for node: ${a(e)}.`),m=e=>new i(o.serializerMatchError,`Cannot match target serializer for node: ${a(e)}.`),g=e=>new i(o.expectDomTypeError,`Expect to be a dom, but get: ${a(e)}.`),y=()=>new i(o.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized"),b=e=>new i(o.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`),k=e=>new i(o.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)},1854:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>ie,PD:()=>lt,hm:()=>Ie,Wf:()=>U,e0:()=>A,vY:()=>M,oO:()=>ne,Xk:()=>Ee,Ej:()=>Te});var r=n(16512),o=n(27647),i=n(25715),s=n(16090),a=n(1440),l=n(80096),c=n(37096);const u=[["ß","ss"],["ẞ","Ss"],["ä","ae"],["Ä","Ae"],["ö","oe"],["Ö","Oe"],["ü","ue"],["Ü","Ue"],["À","A"],["Á","A"],["Â","A"],["Ã","A"],["Ä","Ae"],["Å","A"],["Æ","AE"],["Ç","C"],["È","E"],["É","E"],["Ê","E"],["Ë","E"],["Ì","I"],["Í","I"],["Î","I"],["Ï","I"],["Ð","D"],["Ñ","N"],["Ò","O"],["Ó","O"],["Ô","O"],["Õ","O"],["Ö","Oe"],["Ő","O"],["Ø","O"],["Ù","U"],["Ú","U"],["Û","U"],["Ü","Ue"],["Ű","U"],["Ý","Y"],["Þ","TH"],["ß","ss"],["à","a"],["á","a"],["â","a"],["ã","a"],["ä","ae"],["å","a"],["æ","ae"],["ç","c"],["è","e"],["é","e"],["ê","e"],["ë","e"],["ì","i"],["í","i"],["î","i"],["ï","i"],["ð","d"],["ñ","n"],["ò","o"],["ó","o"],["ô","o"],["õ","o"],["ö","oe"],["ő","o"],["ø","o"],["ù","u"],["ú","u"],["û","u"],["ü","ue"],["ű","u"],["ý","y"],["þ","th"],["ÿ","y"],["ẞ","SS"],["à","a"],["À","A"],["á","a"],["Á","A"],["â","a"],["Â","A"],["ã","a"],["Ã","A"],["è","e"],["È","E"],["é","e"],["É","E"],["ê","e"],["Ê","E"],["ì","i"],["Ì","I"],["í","i"],["Í","I"],["ò","o"],["Ò","O"],["ó","o"],["Ó","O"],["ô","o"],["Ô","O"],["õ","o"],["Õ","O"],["ù","u"],["Ù","U"],["ú","u"],["Ú","U"],["ý","y"],["Ý","Y"],["ă","a"],["Ă","A"],["Đ","D"],["đ","d"],["ĩ","i"],["Ĩ","I"],["ũ","u"],["Ũ","U"],["ơ","o"],["Ơ","O"],["ư","u"],["Ư","U"],["ạ","a"],["Ạ","A"],["ả","a"],["Ả","A"],["ấ","a"],["Ấ","A"],["ầ","a"],["Ầ","A"],["ẩ","a"],["Ẩ","A"],["ẫ","a"],["Ẫ","A"],["ậ","a"],["Ậ","A"],["ắ","a"],["Ắ","A"],["ằ","a"],["Ằ","A"],["ẳ","a"],["Ẳ","A"],["ẵ","a"],["Ẵ","A"],["ặ","a"],["Ặ","A"],["ẹ","e"],["Ẹ","E"],["ẻ","e"],["Ẻ","E"],["ẽ","e"],["Ẽ","E"],["ế","e"],["Ế","E"],["ề","e"],["Ề","E"],["ể","e"],["Ể","E"],["ễ","e"],["Ễ","E"],["ệ","e"],["Ệ","E"],["ỉ","i"],["Ỉ","I"],["ị","i"],["Ị","I"],["ọ","o"],["Ọ","O"],["ỏ","o"],["Ỏ","O"],["ố","o"],["Ố","O"],["ồ","o"],["Ồ","O"],["ổ","o"],["Ổ","O"],["ỗ","o"],["Ỗ","O"],["ộ","o"],["Ộ","O"],["ớ","o"],["Ớ","O"],["ờ","o"],["Ờ","O"],["ở","o"],["Ở","O"],["ỡ","o"],["Ỡ","O"],["ợ","o"],["Ợ","O"],["ụ","u"],["Ụ","U"],["ủ","u"],["Ủ","U"],["ứ","u"],["Ứ","U"],["ừ","u"],["Ừ","U"],["ử","u"],["Ử","U"],["ữ","u"],["Ữ","U"],["ự","u"],["Ự","U"],["ỳ","y"],["Ỳ","Y"],["ỵ","y"],["Ỵ","Y"],["ỷ","y"],["Ỷ","Y"],["ỹ","y"],["Ỹ","Y"],["ء","e"],["آ","a"],["أ","a"],["ؤ","w"],["إ","i"],["ئ","y"],["ا","a"],["ب","b"],["ة","t"],["ت","t"],["ث","th"],["ج","j"],["ح","h"],["خ","kh"],["د","d"],["ذ","dh"],["ر","r"],["ز","z"],["س","s"],["ش","sh"],["ص","s"],["ض","d"],["ط","t"],["ظ","z"],["ع","e"],["غ","gh"],["ـ","_"],["ف","f"],["ق","q"],["ك","k"],["ل","l"],["م","m"],["ن","n"],["ه","h"],["و","w"],["ى","a"],["ي","y"],["َ‎","a"],["ُ","u"],["ِ‎","i"],["٠","0"],["١","1"],["٢","2"],["٣","3"],["٤","4"],["٥","5"],["٦","6"],["٧","7"],["٨","8"],["٩","9"],["چ","ch"],["ک","k"],["گ","g"],["پ","p"],["ژ","zh"],["ی","y"],["۰","0"],["۱","1"],["۲","2"],["۳","3"],["۴","4"],["۵","5"],["۶","6"],["۷","7"],["۸","8"],["۹","9"],["ټ","p"],["ځ","z"],["څ","c"],["ډ","d"],["ﺫ","d"],["ﺭ","r"],["ړ","r"],["ﺯ","z"],["ږ","g"],["ښ","x"],["ګ","g"],["ڼ","n"],["ۀ","e"],["ې","e"],["ۍ","ai"],["ٹ","t"],["ڈ","d"],["ڑ","r"],["ں","n"],["ہ","h"],["ھ","h"],["ے","e"],["А","A"],["а","a"],["Б","B"],["б","b"],["В","V"],["в","v"],["Г","G"],["г","g"],["Д","D"],["д","d"],["ъе","ye"],["Ъе","Ye"],["ъЕ","yE"],["ЪЕ","YE"],["Е","E"],["е","e"],["Ё","Yo"],["ё","yo"],["Ж","Zh"],["ж","zh"],["З","Z"],["з","z"],["И","I"],["и","i"],["ый","iy"],["Ый","Iy"],["ЫЙ","IY"],["ыЙ","iY"],["Й","Y"],["й","y"],["К","K"],["к","k"],["Л","L"],["л","l"],["М","M"],["м","m"],["Н","N"],["н","n"],["О","O"],["о","o"],["П","P"],["п","p"],["Р","R"],["р","r"],["С","S"],["с","s"],["Т","T"],["т","t"],["У","U"],["у","u"],["Ф","F"],["ф","f"],["Х","Kh"],["х","kh"],["Ц","Ts"],["ц","ts"],["Ч","Ch"],["ч","ch"],["Ш","Sh"],["ш","sh"],["Щ","Sch"],["щ","sch"],["Ъ",""],["ъ",""],["Ы","Y"],["ы","y"],["Ь",""],["ь",""],["Э","E"],["э","e"],["Ю","Yu"],["ю","yu"],["Я","Ya"],["я","ya"],["ă","a"],["Ă","A"],["ș","s"],["Ș","S"],["ț","t"],["Ț","T"],["ţ","t"],["Ţ","T"],["ş","s"],["Ş","S"],["ç","c"],["Ç","C"],["ğ","g"],["Ğ","G"],["ı","i"],["İ","I"],["ա","a"],["Ա","A"],["բ","b"],["Բ","B"],["գ","g"],["Գ","G"],["դ","d"],["Դ","D"],["ե","ye"],["Ե","Ye"],["զ","z"],["Զ","Z"],["է","e"],["Է","E"],["ը","y"],["Ը","Y"],["թ","t"],["Թ","T"],["ժ","zh"],["Ժ","Zh"],["ի","i"],["Ի","I"],["լ","l"],["Լ","L"],["խ","kh"],["Խ","Kh"],["ծ","ts"],["Ծ","Ts"],["կ","k"],["Կ","K"],["հ","h"],["Հ","H"],["ձ","dz"],["Ձ","Dz"],["ղ","gh"],["Ղ","Gh"],["ճ","tch"],["Ճ","Tch"],["մ","m"],["Մ","M"],["յ","y"],["Յ","Y"],["ն","n"],["Ն","N"],["շ","sh"],["Շ","Sh"],["ո","vo"],["Ո","Vo"],["չ","ch"],["Չ","Ch"],["պ","p"],["Պ","P"],["ջ","j"],["Ջ","J"],["ռ","r"],["Ռ","R"],["ս","s"],["Ս","S"],["վ","v"],["Վ","V"],["տ","t"],["Տ","T"],["ր","r"],["Ր","R"],["ց","c"],["Ց","C"],["ու","u"],["ՈՒ","U"],["Ու","U"],["փ","p"],["Փ","P"],["ք","q"],["Ք","Q"],["օ","o"],["Օ","O"],["ֆ","f"],["Ֆ","F"],["և","yev"],["ა","a"],["ბ","b"],["გ","g"],["დ","d"],["ე","e"],["ვ","v"],["ზ","z"],["თ","t"],["ი","i"],["კ","k"],["ლ","l"],["მ","m"],["ნ","n"],["ო","o"],["პ","p"],["ჟ","zh"],["რ","r"],["ს","s"],["ტ","t"],["უ","u"],["ფ","ph"],["ქ","q"],["ღ","gh"],["ყ","k"],["შ","sh"],["ჩ","ch"],["ც","ts"],["ძ","dz"],["წ","ts"],["ჭ","tch"],["ხ","kh"],["ჯ","j"],["ჰ","h"],["č","c"],["ď","d"],["ě","e"],["ň","n"],["ř","r"],["š","s"],["ť","t"],["ů","u"],["ž","z"],["Č","C"],["Ď","D"],["Ě","E"],["Ň","N"],["Ř","R"],["Š","S"],["Ť","T"],["Ů","U"],["Ž","Z"],["ހ","h"],["ށ","sh"],["ނ","n"],["ރ","r"],["ބ","b"],["ޅ","lh"],["ކ","k"],["އ","a"],["ވ","v"],["މ","m"],["ފ","f"],["ދ","dh"],["ތ","th"],["ލ","l"],["ގ","g"],["ޏ","gn"],["ސ","s"],["ޑ","d"],["ޒ","z"],["ޓ","t"],["ޔ","y"],["ޕ","p"],["ޖ","j"],["ޗ","ch"],["ޘ","tt"],["ޙ","hh"],["ޚ","kh"],["ޛ","th"],["ޜ","z"],["ޝ","sh"],["ޞ","s"],["ޟ","d"],["ޠ","t"],["ޡ","z"],["ޢ","a"],["ޣ","gh"],["ޤ","q"],["ޥ","w"],["ަ","a"],["ާ","aa"],["ި","i"],["ީ","ee"],["ު","u"],["ޫ","oo"],["ެ","e"],["ޭ","ey"],["ޮ","o"],["ޯ","oa"],["ް",""],["α","a"],["β","v"],["γ","g"],["δ","d"],["ε","e"],["ζ","z"],["η","i"],["θ","th"],["ι","i"],["κ","k"],["λ","l"],["μ","m"],["ν","n"],["ξ","ks"],["ο","o"],["π","p"],["ρ","r"],["σ","s"],["τ","t"],["υ","y"],["φ","f"],["χ","x"],["ψ","ps"],["ω","o"],["ά","a"],["έ","e"],["ί","i"],["ό","o"],["ύ","y"],["ή","i"],["ώ","o"],["ς","s"],["ϊ","i"],["ΰ","y"],["ϋ","y"],["ΐ","i"],["Α","A"],["Β","B"],["Γ","G"],["Δ","D"],["Ε","E"],["Ζ","Z"],["Η","I"],["Θ","TH"],["Ι","I"],["Κ","K"],["Λ","L"],["Μ","M"],["Ν","N"],["Ξ","KS"],["Ο","O"],["Π","P"],["Ρ","R"],["Σ","S"],["Τ","T"],["Υ","Y"],["Φ","F"],["Χ","X"],["Ψ","PS"],["Ω","O"],["Ά","A"],["Έ","E"],["Ί","I"],["Ό","O"],["Ύ","Y"],["Ή","I"],["Ώ","O"],["Ϊ","I"],["Ϋ","Y"],["ā","a"],["ē","e"],["ģ","g"],["ī","i"],["ķ","k"],["ļ","l"],["ņ","n"],["ū","u"],["Ā","A"],["Ē","E"],["Ģ","G"],["Ī","I"],["Ķ","K"],["Ļ","L"],["Ņ","N"],["Ū","U"],["č","c"],["š","s"],["ž","z"],["Č","C"],["Š","S"],["Ž","Z"],["ą","a"],["č","c"],["ę","e"],["ė","e"],["į","i"],["š","s"],["ų","u"],["ū","u"],["ž","z"],["Ą","A"],["Č","C"],["Ę","E"],["Ė","E"],["Į","I"],["Š","S"],["Ų","U"],["Ū","U"],["Ќ","Kj"],["ќ","kj"],["Љ","Lj"],["љ","lj"],["Њ","Nj"],["њ","nj"],["Тс","Ts"],["тс","ts"],["ą","a"],["ć","c"],["ę","e"],["ł","l"],["ń","n"],["ś","s"],["ź","z"],["ż","z"],["Ą","A"],["Ć","C"],["Ę","E"],["Ł","L"],["Ń","N"],["Ś","S"],["Ź","Z"],["Ż","Z"],["Є","Ye"],["І","I"],["Ї","Yi"],["Ґ","G"],["є","ye"],["і","i"],["ї","yi"],["ґ","g"],["IJ","IJ"],["ij","ij"],["¢","c"],["¥","Y"],["߿","b"],["৳","t"],["૱","Bo"],["฿","B"],["₠","CE"],["₡","C"],["₢","Cr"],["₣","F"],["₥","m"],["₦","N"],["₧","Pt"],["₨","Rs"],["₩","W"],["₫","s"],["€","E"],["₭","K"],["₮","T"],["₯","Dp"],["₰","S"],["₱","P"],["₲","G"],["₳","A"],["₴","S"],["₵","C"],["₶","tt"],["₷","S"],["₸","T"],["₹","R"],["₺","L"],["₽","P"],["₿","B"],["﹩","$"],["¢","c"],["¥","Y"],["₩","W"],["𝐀","A"],["𝐁","B"],["𝐂","C"],["𝐃","D"],["𝐄","E"],["𝐅","F"],["𝐆","G"],["𝐇","H"],["𝐈","I"],["𝐉","J"],["𝐊","K"],["𝐋","L"],["𝐌","M"],["𝐍","N"],["𝐎","O"],["𝐏","P"],["𝐐","Q"],["𝐑","R"],["𝐒","S"],["𝐓","T"],["𝐔","U"],["𝐕","V"],["𝐖","W"],["𝐗","X"],["𝐘","Y"],["𝐙","Z"],["𝐚","a"],["𝐛","b"],["𝐜","c"],["𝐝","d"],["𝐞","e"],["𝐟","f"],["𝐠","g"],["𝐡","h"],["𝐢","i"],["𝐣","j"],["𝐤","k"],["𝐥","l"],["𝐦","m"],["𝐧","n"],["𝐨","o"],["𝐩","p"],["𝐪","q"],["𝐫","r"],["𝐬","s"],["𝐭","t"],["𝐮","u"],["𝐯","v"],["𝐰","w"],["𝐱","x"],["𝐲","y"],["𝐳","z"],["𝐴","A"],["𝐵","B"],["𝐶","C"],["𝐷","D"],["𝐸","E"],["𝐹","F"],["𝐺","G"],["𝐻","H"],["𝐼","I"],["𝐽","J"],["𝐾","K"],["𝐿","L"],["𝑀","M"],["𝑁","N"],["𝑂","O"],["𝑃","P"],["𝑄","Q"],["𝑅","R"],["𝑆","S"],["𝑇","T"],["𝑈","U"],["𝑉","V"],["𝑊","W"],["𝑋","X"],["𝑌","Y"],["𝑍","Z"],["𝑎","a"],["𝑏","b"],["𝑐","c"],["𝑑","d"],["𝑒","e"],["𝑓","f"],["𝑔","g"],["𝑖","i"],["𝑗","j"],["𝑘","k"],["𝑙","l"],["𝑚","m"],["𝑛","n"],["𝑜","o"],["𝑝","p"],["𝑞","q"],["𝑟","r"],["𝑠","s"],["𝑡","t"],["𝑢","u"],["𝑣","v"],["𝑤","w"],["𝑥","x"],["𝑦","y"],["𝑧","z"],["𝑨","A"],["𝑩","B"],["𝑪","C"],["𝑫","D"],["𝑬","E"],["𝑭","F"],["𝑮","G"],["𝑯","H"],["𝑰","I"],["𝑱","J"],["𝑲","K"],["𝑳","L"],["𝑴","M"],["𝑵","N"],["𝑶","O"],["𝑷","P"],["𝑸","Q"],["𝑹","R"],["𝑺","S"],["𝑻","T"],["𝑼","U"],["𝑽","V"],["𝑾","W"],["𝑿","X"],["𝒀","Y"],["𝒁","Z"],["𝒂","a"],["𝒃","b"],["𝒄","c"],["𝒅","d"],["𝒆","e"],["𝒇","f"],["𝒈","g"],["𝒉","h"],["𝒊","i"],["𝒋","j"],["𝒌","k"],["𝒍","l"],["𝒎","m"],["𝒏","n"],["𝒐","o"],["𝒑","p"],["𝒒","q"],["𝒓","r"],["𝒔","s"],["𝒕","t"],["𝒖","u"],["𝒗","v"],["𝒘","w"],["𝒙","x"],["𝒚","y"],["𝒛","z"],["𝒜","A"],["𝒞","C"],["𝒟","D"],["𝒢","g"],["𝒥","J"],["𝒦","K"],["𝒩","N"],["𝒪","O"],["𝒫","P"],["𝒬","Q"],["𝒮","S"],["𝒯","T"],["𝒰","U"],["𝒱","V"],["𝒲","W"],["𝒳","X"],["𝒴","Y"],["𝒵","Z"],["𝒶","a"],["𝒷","b"],["𝒸","c"],["𝒹","d"],["𝒻","f"],["𝒽","h"],["𝒾","i"],["𝒿","j"],["𝓀","h"],["𝓁","l"],["𝓂","m"],["𝓃","n"],["𝓅","p"],["𝓆","q"],["𝓇","r"],["𝓈","s"],["𝓉","t"],["𝓊","u"],["𝓋","v"],["𝓌","w"],["𝓍","x"],["𝓎","y"],["𝓏","z"],["𝓐","A"],["𝓑","B"],["𝓒","C"],["𝓓","D"],["𝓔","E"],["𝓕","F"],["𝓖","G"],["𝓗","H"],["𝓘","I"],["𝓙","J"],["𝓚","K"],["𝓛","L"],["𝓜","M"],["𝓝","N"],["𝓞","O"],["𝓟","P"],["𝓠","Q"],["𝓡","R"],["𝓢","S"],["𝓣","T"],["𝓤","U"],["𝓥","V"],["𝓦","W"],["𝓧","X"],["𝓨","Y"],["𝓩","Z"],["𝓪","a"],["𝓫","b"],["𝓬","c"],["𝓭","d"],["𝓮","e"],["𝓯","f"],["𝓰","g"],["𝓱","h"],["𝓲","i"],["𝓳","j"],["𝓴","k"],["𝓵","l"],["𝓶","m"],["𝓷","n"],["𝓸","o"],["𝓹","p"],["𝓺","q"],["𝓻","r"],["𝓼","s"],["𝓽","t"],["𝓾","u"],["𝓿","v"],["𝔀","w"],["𝔁","x"],["𝔂","y"],["𝔃","z"],["𝔄","A"],["𝔅","B"],["𝔇","D"],["𝔈","E"],["𝔉","F"],["𝔊","G"],["𝔍","J"],["𝔎","K"],["𝔏","L"],["𝔐","M"],["𝔑","N"],["𝔒","O"],["𝔓","P"],["𝔔","Q"],["𝔖","S"],["𝔗","T"],["𝔘","U"],["𝔙","V"],["𝔚","W"],["𝔛","X"],["𝔜","Y"],["𝔞","a"],["𝔟","b"],["𝔠","c"],["𝔡","d"],["𝔢","e"],["𝔣","f"],["𝔤","g"],["𝔥","h"],["𝔦","i"],["𝔧","j"],["𝔨","k"],["𝔩","l"],["𝔪","m"],["𝔫","n"],["𝔬","o"],["𝔭","p"],["𝔮","q"],["𝔯","r"],["𝔰","s"],["𝔱","t"],["𝔲","u"],["𝔳","v"],["𝔴","w"],["𝔵","x"],["𝔶","y"],["𝔷","z"],["𝔸","A"],["𝔹","B"],["𝔻","D"],["𝔼","E"],["𝔽","F"],["𝔾","G"],["𝕀","I"],["𝕁","J"],["𝕂","K"],["𝕃","L"],["𝕄","M"],["𝕆","N"],["𝕊","S"],["𝕋","T"],["𝕌","U"],["𝕍","V"],["𝕎","W"],["𝕏","X"],["𝕐","Y"],["𝕒","a"],["𝕓","b"],["𝕔","c"],["𝕕","d"],["𝕖","e"],["𝕗","f"],["𝕘","g"],["𝕙","h"],["𝕚","i"],["𝕛","j"],["𝕜","k"],["𝕝","l"],["𝕞","m"],["𝕟","n"],["𝕠","o"],["𝕡","p"],["𝕢","q"],["𝕣","r"],["𝕤","s"],["𝕥","t"],["𝕦","u"],["𝕧","v"],["𝕨","w"],["𝕩","x"],["𝕪","y"],["𝕫","z"],["𝕬","A"],["𝕭","B"],["𝕮","C"],["𝕯","D"],["𝕰","E"],["𝕱","F"],["𝕲","G"],["𝕳","H"],["𝕴","I"],["𝕵","J"],["𝕶","K"],["𝕷","L"],["𝕸","M"],["𝕹","N"],["𝕺","O"],["𝕻","P"],["𝕼","Q"],["𝕽","R"],["𝕾","S"],["𝕿","T"],["𝖀","U"],["𝖁","V"],["𝖂","W"],["𝖃","X"],["𝖄","Y"],["𝖅","Z"],["𝖆","a"],["𝖇","b"],["𝖈","c"],["𝖉","d"],["𝖊","e"],["𝖋","f"],["𝖌","g"],["𝖍","h"],["𝖎","i"],["𝖏","j"],["𝖐","k"],["𝖑","l"],["𝖒","m"],["𝖓","n"],["𝖔","o"],["𝖕","p"],["𝖖","q"],["𝖗","r"],["𝖘","s"],["𝖙","t"],["𝖚","u"],["𝖛","v"],["𝖜","w"],["𝖝","x"],["𝖞","y"],["𝖟","z"],["𝖠","A"],["𝖡","B"],["𝖢","C"],["𝖣","D"],["𝖤","E"],["𝖥","F"],["𝖦","G"],["𝖧","H"],["𝖨","I"],["𝖩","J"],["𝖪","K"],["𝖫","L"],["𝖬","M"],["𝖭","N"],["𝖮","O"],["𝖯","P"],["𝖰","Q"],["𝖱","R"],["𝖲","S"],["𝖳","T"],["𝖴","U"],["𝖵","V"],["𝖶","W"],["𝖷","X"],["𝖸","Y"],["𝖹","Z"],["𝖺","a"],["𝖻","b"],["𝖼","c"],["𝖽","d"],["𝖾","e"],["𝖿","f"],["𝗀","g"],["𝗁","h"],["𝗂","i"],["𝗃","j"],["𝗄","k"],["𝗅","l"],["𝗆","m"],["𝗇","n"],["𝗈","o"],["𝗉","p"],["𝗊","q"],["𝗋","r"],["𝗌","s"],["𝗍","t"],["𝗎","u"],["𝗏","v"],["𝗐","w"],["𝗑","x"],["𝗒","y"],["𝗓","z"],["𝗔","A"],["𝗕","B"],["𝗖","C"],["𝗗","D"],["𝗘","E"],["𝗙","F"],["𝗚","G"],["𝗛","H"],["𝗜","I"],["𝗝","J"],["𝗞","K"],["𝗟","L"],["𝗠","M"],["𝗡","N"],["𝗢","O"],["𝗣","P"],["𝗤","Q"],["𝗥","R"],["𝗦","S"],["𝗧","T"],["𝗨","U"],["𝗩","V"],["𝗪","W"],["𝗫","X"],["𝗬","Y"],["𝗭","Z"],["𝗮","a"],["𝗯","b"],["𝗰","c"],["𝗱","d"],["𝗲","e"],["𝗳","f"],["𝗴","g"],["𝗵","h"],["𝗶","i"],["𝗷","j"],["𝗸","k"],["𝗹","l"],["𝗺","m"],["𝗻","n"],["𝗼","o"],["𝗽","p"],["𝗾","q"],["𝗿","r"],["𝘀","s"],["𝘁","t"],["𝘂","u"],["𝘃","v"],["𝘄","w"],["𝘅","x"],["𝘆","y"],["𝘇","z"],["𝘈","A"],["𝘉","B"],["𝘊","C"],["𝘋","D"],["𝘌","E"],["𝘍","F"],["𝘎","G"],["𝘏","H"],["𝘐","I"],["𝘑","J"],["𝘒","K"],["𝘓","L"],["𝘔","M"],["𝘕","N"],["𝘖","O"],["𝘗","P"],["𝘘","Q"],["𝘙","R"],["𝘚","S"],["𝘛","T"],["𝘜","U"],["𝘝","V"],["𝘞","W"],["𝘟","X"],["𝘠","Y"],["𝘡","Z"],["𝘢","a"],["𝘣","b"],["𝘤","c"],["𝘥","d"],["𝘦","e"],["𝘧","f"],["𝘨","g"],["𝘩","h"],["𝘪","i"],["𝘫","j"],["𝘬","k"],["𝘭","l"],["𝘮","m"],["𝘯","n"],["𝘰","o"],["𝘱","p"],["𝘲","q"],["𝘳","r"],["𝘴","s"],["𝘵","t"],["𝘶","u"],["𝘷","v"],["𝘸","w"],["𝘹","x"],["𝘺","y"],["𝘻","z"],["𝘼","A"],["𝘽","B"],["𝘾","C"],["𝘿","D"],["𝙀","E"],["𝙁","F"],["𝙂","G"],["𝙃","H"],["𝙄","I"],["𝙅","J"],["𝙆","K"],["𝙇","L"],["𝙈","M"],["𝙉","N"],["𝙊","O"],["𝙋","P"],["𝙌","Q"],["𝙍","R"],["𝙎","S"],["𝙏","T"],["𝙐","U"],["𝙑","V"],["𝙒","W"],["𝙓","X"],["𝙔","Y"],["𝙕","Z"],["𝙖","a"],["𝙗","b"],["𝙘","c"],["𝙙","d"],["𝙚","e"],["𝙛","f"],["𝙜","g"],["𝙝","h"],["𝙞","i"],["𝙟","j"],["𝙠","k"],["𝙡","l"],["𝙢","m"],["𝙣","n"],["𝙤","o"],["𝙥","p"],["𝙦","q"],["𝙧","r"],["𝙨","s"],["𝙩","t"],["𝙪","u"],["𝙫","v"],["𝙬","w"],["𝙭","x"],["𝙮","y"],["𝙯","z"],["𝙰","A"],["𝙱","B"],["𝙲","C"],["𝙳","D"],["𝙴","E"],["𝙵","F"],["𝙶","G"],["𝙷","H"],["𝙸","I"],["𝙹","J"],["𝙺","K"],["𝙻","L"],["𝙼","M"],["𝙽","N"],["𝙾","O"],["𝙿","P"],["𝚀","Q"],["𝚁","R"],["𝚂","S"],["𝚃","T"],["𝚄","U"],["𝚅","V"],["𝚆","W"],["𝚇","X"],["𝚈","Y"],["𝚉","Z"],["𝚊","a"],["𝚋","b"],["𝚌","c"],["𝚍","d"],["𝚎","e"],["𝚏","f"],["𝚐","g"],["𝚑","h"],["𝚒","i"],["𝚓","j"],["𝚔","k"],["𝚕","l"],["𝚖","m"],["𝚗","n"],["𝚘","o"],["𝚙","p"],["𝚚","q"],["𝚛","r"],["𝚜","s"],["𝚝","t"],["𝚞","u"],["𝚟","v"],["𝚠","w"],["𝚡","x"],["𝚢","y"],["𝚣","z"],["𝚤","l"],["𝚥","j"],["𝛢","A"],["𝛣","B"],["𝛤","G"],["𝛥","D"],["𝛦","E"],["𝛧","Z"],["𝛨","I"],["𝛩","TH"],["𝛪","I"],["𝛫","K"],["𝛬","L"],["𝛭","M"],["𝛮","N"],["𝛯","KS"],["𝛰","O"],["𝛱","P"],["𝛲","R"],["𝛳","TH"],["𝛴","S"],["𝛵","T"],["𝛶","Y"],["𝛷","F"],["𝛸","x"],["𝛹","PS"],["𝛺","O"],["𝛻","D"],["𝛼","a"],["𝛽","b"],["𝛾","g"],["𝛿","d"],["𝜀","e"],["𝜁","z"],["𝜂","i"],["𝜃","th"],["𝜄","i"],["𝜅","k"],["𝜆","l"],["𝜇","m"],["𝜈","n"],["𝜉","ks"],["𝜊","o"],["𝜋","p"],["𝜌","r"],["𝜍","s"],["𝜎","s"],["𝜏","t"],["𝜐","y"],["𝜑","f"],["𝜒","x"],["𝜓","ps"],["𝜔","o"],["𝜕","d"],["𝜖","E"],["𝜗","TH"],["𝜘","K"],["𝜙","f"],["𝜚","r"],["𝜛","p"],["𝜜","A"],["𝜝","V"],["𝜞","G"],["𝜟","D"],["𝜠","E"],["𝜡","Z"],["𝜢","I"],["𝜣","TH"],["𝜤","I"],["𝜥","K"],["𝜦","L"],["𝜧","M"],["𝜨","N"],["𝜩","KS"],["𝜪","O"],["𝜫","P"],["𝜬","S"],["𝜭","TH"],["𝜮","S"],["𝜯","T"],["𝜰","Y"],["𝜱","F"],["𝜲","X"],["𝜳","PS"],["𝜴","O"],["𝜵","D"],["𝜶","a"],["𝜷","v"],["𝜸","g"],["𝜹","d"],["𝜺","e"],["𝜻","z"],["𝜼","i"],["𝜽","th"],["𝜾","i"],["𝜿","k"],["𝝀","l"],["𝝁","m"],["𝝂","n"],["𝝃","ks"],["𝝄","o"],["𝝅","p"],["𝝆","r"],["𝝇","s"],["𝝈","s"],["𝝉","t"],["𝝊","y"],["𝝋","f"],["𝝌","x"],["𝝍","ps"],["𝝎","o"],["𝝏","a"],["𝝐","e"],["𝝑","i"],["𝝒","k"],["𝝓","f"],["𝝔","r"],["𝝕","p"],["𝝖","A"],["𝝗","B"],["𝝘","G"],["𝝙","D"],["𝝚","E"],["𝝛","Z"],["𝝜","I"],["𝝝","TH"],["𝝞","I"],["𝝟","K"],["𝝠","L"],["𝝡","M"],["𝝢","N"],["𝝣","KS"],["𝝤","O"],["𝝥","P"],["𝝦","R"],["𝝧","TH"],["𝝨","S"],["𝝩","T"],["𝝪","Y"],["𝝫","F"],["𝝬","X"],["𝝭","PS"],["𝝮","O"],["𝝯","D"],["𝝰","a"],["𝝱","v"],["𝝲","g"],["𝝳","d"],["𝝴","e"],["𝝵","z"],["𝝶","i"],["𝝷","th"],["𝝸","i"],["𝝹","k"],["𝝺","l"],["𝝻","m"],["𝝼","n"],["𝝽","ks"],["𝝾","o"],["𝝿","p"],["𝞀","r"],["𝞁","s"],["𝞂","s"],["𝞃","t"],["𝞄","y"],["𝞅","f"],["𝞆","x"],["𝞇","ps"],["𝞈","o"],["𝞉","a"],["𝞊","e"],["𝞋","i"],["𝞌","k"],["𝞍","f"],["𝞎","r"],["𝞏","p"],["𝞐","A"],["𝞑","V"],["𝞒","G"],["𝞓","D"],["𝞔","E"],["𝞕","Z"],["𝞖","I"],["𝞗","TH"],["𝞘","I"],["𝞙","K"],["𝞚","L"],["𝞛","M"],["𝞜","N"],["𝞝","KS"],["𝞞","O"],["𝞟","P"],["𝞠","S"],["𝞡","TH"],["𝞢","S"],["𝞣","T"],["𝞤","Y"],["𝞥","F"],["𝞦","X"],["𝞧","PS"],["𝞨","O"],["𝞩","D"],["𝞪","av"],["𝞫","g"],["𝞬","d"],["𝞭","e"],["𝞮","z"],["𝞯","i"],["𝞰","i"],["𝞱","th"],["𝞲","i"],["𝞳","k"],["𝞴","l"],["𝞵","m"],["𝞶","n"],["𝞷","ks"],["𝞸","o"],["𝞹","p"],["𝞺","r"],["𝞻","s"],["𝞼","s"],["𝞽","t"],["𝞾","y"],["𝞿","f"],["𝟀","x"],["𝟁","ps"],["𝟂","o"],["𝟃","a"],["𝟄","e"],["𝟅","i"],["𝟆","k"],["𝟇","f"],["𝟈","r"],["𝟉","p"],["𝟊","F"],["𝟋","f"],["⒜","(a)"],["⒝","(b)"],["⒞","(c)"],["⒟","(d)"],["⒠","(e)"],["⒡","(f)"],["⒢","(g)"],["⒣","(h)"],["⒤","(i)"],["⒥","(j)"],["⒦","(k)"],["⒧","(l)"],["⒨","(m)"],["⒩","(n)"],["⒪","(o)"],["⒫","(p)"],["⒬","(q)"],["⒭","(r)"],["⒮","(s)"],["⒯","(t)"],["⒰","(u)"],["⒱","(v)"],["⒲","(w)"],["⒳","(x)"],["⒴","(y)"],["⒵","(z)"],["Ⓐ","(A)"],["Ⓑ","(B)"],["Ⓒ","(C)"],["Ⓓ","(D)"],["Ⓔ","(E)"],["Ⓕ","(F)"],["Ⓖ","(G)"],["Ⓗ","(H)"],["Ⓘ","(I)"],["Ⓙ","(J)"],["Ⓚ","(K)"],["Ⓛ","(L)"],["Ⓝ","(N)"],["Ⓞ","(O)"],["Ⓟ","(P)"],["Ⓠ","(Q)"],["Ⓡ","(R)"],["Ⓢ","(S)"],["Ⓣ","(T)"],["Ⓤ","(U)"],["Ⓥ","(V)"],["Ⓦ","(W)"],["Ⓧ","(X)"],["Ⓨ","(Y)"],["Ⓩ","(Z)"],["ⓐ","(a)"],["ⓑ","(b)"],["ⓒ","(b)"],["ⓓ","(c)"],["ⓔ","(e)"],["ⓕ","(f)"],["ⓖ","(g)"],["ⓗ","(h)"],["ⓘ","(i)"],["ⓙ","(j)"],["ⓚ","(k)"],["ⓛ","(l)"],["ⓜ","(m)"],["ⓝ","(n)"],["ⓞ","(o)"],["ⓟ","(p)"],["ⓠ","(q)"],["ⓡ","(r)"],["ⓢ","(s)"],["ⓣ","(t)"],["ⓤ","(u)"],["ⓥ","(v)"],["ⓦ","(w)"],["ⓧ","(x)"],["ⓨ","(y)"],["ⓩ","(z)"],["Ċ","C"],["ċ","c"],["Ġ","G"],["ġ","g"],["Ħ","H"],["ħ","h"],["Ż","Z"],["ż","z"],["𝟎","0"],["𝟏","1"],["𝟐","2"],["𝟑","3"],["𝟒","4"],["𝟓","5"],["𝟔","6"],["𝟕","7"],["𝟖","8"],["𝟗","9"],["𝟘","0"],["𝟙","1"],["𝟚","2"],["𝟛","3"],["𝟜","4"],["𝟝","5"],["𝟞","6"],["𝟟","7"],["𝟠","8"],["𝟡","9"],["𝟢","0"],["𝟣","1"],["𝟤","2"],["𝟥","3"],["𝟦","4"],["𝟧","5"],["𝟨","6"],["𝟩","7"],["𝟪","8"],["𝟫","9"],["𝟬","0"],["𝟭","1"],["𝟮","2"],["𝟯","3"],["𝟰","4"],["𝟱","5"],["𝟲","6"],["𝟳","7"],["𝟴","8"],["𝟵","9"],["𝟶","0"],["𝟷","1"],["𝟸","2"],["𝟹","3"],["𝟺","4"],["𝟻","5"],["𝟼","6"],["𝟽","7"],["𝟾","8"],["𝟿","9"],["①","1"],["②","2"],["③","3"],["④","4"],["⑤","5"],["⑥","6"],["⑦","7"],["⑧","8"],["⑨","9"],["⑩","10"],["⑪","11"],["⑫","12"],["⑬","13"],["⑭","14"],["⑮","15"],["⑯","16"],["⑰","17"],["⑱","18"],["⑲","19"],["⑳","20"],["⑴","1"],["⑵","2"],["⑶","3"],["⑷","4"],["⑸","5"],["⑹","6"],["⑺","7"],["⑻","8"],["⑼","9"],["⑽","10"],["⑾","11"],["⑿","12"],["⒀","13"],["⒁","14"],["⒂","15"],["⒃","16"],["⒄","17"],["⒅","18"],["⒆","19"],["⒇","20"],["⒈","1."],["⒉","2."],["⒊","3."],["⒋","4."],["⒌","5."],["⒍","6."],["⒎","7."],["⒏","8."],["⒐","9."],["⒑","10."],["⒒","11."],["⒓","12."],["⒔","13."],["⒕","14."],["⒖","15."],["⒗","16."],["⒘","17."],["⒙","18."],["⒚","19."],["⒛","20."],["⓪","0"],["⓫","11"],["⓬","12"],["⓭","13"],["⓮","14"],["⓯","15"],["⓰","16"],["⓱","17"],["⓲","18"],["⓳","19"],["⓴","20"],["⓵","1"],["⓶","2"],["⓷","3"],["⓸","4"],["⓹","5"],["⓺","6"],["⓻","7"],["⓼","8"],["⓽","9"],["⓾","10"],["⓿","0"],["🙰","&"],["🙱","&"],["🙲","&"],["🙳","&"],["🙴","&"],["🙵","&"],["🙶",'"'],["🙷",'"'],["🙸",'"'],["‽","?!"],["🙹","?!"],["🙺","?!"],["🙻","?!"],["🙼","/"],["🙽","\\"],["🜇","AR"],["🜈","V"],["🜉","V"],["🜆","VR"],["🜅","VF"],["🜩","2"],["🜪","5"],["🝡","f"],["🝢","W"],["🝣","U"],["🝧","V"],["🝨","T"],["🝪","V"],["🝫","MB"],["🝬","VB"],["🝲","3B"],["🝳","3B"],["💯","100"],["🔙","BACK"],["🔚","END"],["🔛","ON!"],["🔜","SOON"],["🔝","TOP"],["🔞","18"],["🔤","abc"],["🔠","ABCD"],["🔡","abcd"],["🔢","1234"],["🔣","T&@%"],["#️⃣","#"],["*️⃣","*"],["0️⃣","0"],["1️⃣","1"],["2️⃣","2"],["3️⃣","3"],["4️⃣","4"],["5️⃣","5"],["6️⃣","6"],["7️⃣","7"],["8️⃣","8"],["9️⃣","9"],["🔟","10"],["🅰️","A"],["🅱️","B"],["🆎","AB"],["🆑","CL"],["🅾️","O"],["🅿","P"],["🆘","SOS"],["🅲","C"],["🅳","D"],["🅴","E"],["🅵","F"],["🅶","G"],["🅷","H"],["🅸","I"],["🅹","J"],["🅺","K"],["🅻","L"],["🅼","M"],["🅽","N"],["🆀","Q"],["🆁","R"],["🆂","S"],["🆃","T"],["🆄","U"],["🆅","V"],["🆆","W"],["🆇","X"],["🆈","Y"],["🆉","Z"]];const d=[["&"," and "],["🦄"," unicorn "],["♥"," love "]];function p(e,t){if("string"!=typeof e)throw new TypeError(`Expected a string, got \`${typeof e}\``);const n=(t={separator:"-",lowercase:!0,decamelize:!0,customReplacements:[],preserveLeadingUnderscore:!1,preserveTrailingDash:!1,preserveCharacters:[],...t}).preserveLeadingUnderscore&&e.startsWith("_"),r=t.preserveTrailingDash&&e.endsWith("-");e=function(e,t){if("string"!=typeof e)throw new TypeError(`Expected a string, got \`${typeof e}\``);t={customReplacements:[],...t};const n=new Map([...u,...t.customReplacements]);return(e=((e,t)=>{for(const[n,r]of t)e=e.replace(new RegExp((0,c.A)(n),"g"),r);return e})(e=e.normalize(),n)).normalize("NFD").replace(/[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u0898-\u089F\u08C9-\u08D2\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C3C\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u1714\u1715\u1734\u17C9-\u17D3\u17DD\u1939-\u193B\u1A60\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABE\u1AC1-\u1ACB\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1BE6\u1BF2\u1BF3\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA806\uA82C\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3\u{102E0}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D22}-\u{10D27}\u{10D4E}\u{10D69}-\u{10D6D}\u{10EFD}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11046}\u{11070}\u{110B9}\u{110BA}\u{11133}\u{11134}\u{11173}\u{111C0}\u{111CA}-\u{111CC}\u{11235}\u{11236}\u{112E9}\u{112EA}\u{1133B}\u{1133C}\u{1134D}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113CE}-\u{113D0}\u{113D2}\u{113D3}\u{113E1}\u{113E2}\u{11442}\u{11446}\u{114C2}\u{114C3}\u{115BF}\u{115C0}\u{1163F}\u{116B6}\u{116B7}\u{1172B}\u{11839}\u{1183A}\u{1193D}\u{1193E}\u{11943}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D42}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{11F5A}\u{13447}-\u{13455}\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16D6B}\u{16D6C}\u{16F8F}-\u{16F9F}\u{16FF0}\u{16FF1}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1E030}-\u{1E06D}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E946}\u{1E948}-\u{1E94A}]/gu,"").normalize()}(e,{customReplacements:new Map([...d,...t.customReplacements])}),t.decamelize&&(e=(e=>e.replace(/([A-Z]{2,})(\d+)/g,"$1 $2").replace(/([a-z\d]+)([A-Z]{2,})/g,"$1 $2").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-rt-z\d]+)/g,"$1 $2"))(e));const o=(e=>{let t="a-z\\d";if(t+=e.lowercase?"":"A-Z",e.preserveCharacters.length>0)for(const n of e.preserveCharacters){if(n===e.separator)throw new Error(`The separator character \`${e.separator}\` cannot be included in preserved characters: ${e.preserveCharacters}`);t+=(0,c.A)(n)}return new RegExp(`[^${t}]+`,"g")})(t);return t.lowercase&&(e=e.toLowerCase()),e=(e=(e=e.replace(/([a-zA-Z\d]+)'([ts])(\s|$)/g,"$1$2$3")).replace(o,t.separator)).replace(/\\/g,""),t.separator&&(e=((e,t)=>{const n=(0,c.A)(t);return e.replace(new RegExp(`${n}{2,}`,"g"),t).replace(new RegExp(`^${n}|${n}$`,"g"),"")})(e,t.separator)),n&&(e=`_${e}`),r&&(e=`${e}-`),e}var h=n(81570),f=n(44254),m=n(11329);var g=n(73686),y=n(66641);const b=function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),(0,y.VG)(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)},k={}.hasOwnProperty;function w(e){return String(e||"").toUpperCase()}function v(){return e=>{const t=function(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),(0,y.VG)(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)}(e,"definition",(e=>{const n=w(e.identifier);n&&!k.call(t,n)&&(t[n]=e)})),function(e){const n=w(e);return n&&k.call(t,n)?t[n]:null}}(e);!function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),(0,y.VG)(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)}(e,((e,n,r)=>{if("definition"===e.type&&null!==r&&"number"==typeof n)return r.children.splice(n,1),[y._Z,n];if("imageReference"===e.type||"linkReference"===e.type){const o=t(e.identifier);if(o&&null!==r&&"number"==typeof n){const t="imageReference"===e.type?{type:"image",url:o.url,title:o.title,alt:e.alt}:{type:"link",url:o.url,title:o.title,children:e.children};return r.children[n]=t,[y._Z,n]}}}))}}const x=(e,t)=>{var n;if(!(t.childCount>=1&&"hardbreak"===(null==(n=t.lastChild)?void 0:n.type.name)))return void e.next(t.content);const r=[];t.content.forEach(((e,n,o)=>{o!==t.childCount-1&&r.push(e)})),e.next(s.FK.fromArray(r))},S=(e,t)=>(Object.assign(e,{meta:{package:"@milkdown/preset-commonmark",...t}}),e),E=(0,r.JY)("emphasis");S(E,{displayName:"Attr<emphasis>",group:"Emphasis"});const C=(0,r.hk)("emphasis",(e=>({inclusive:!1,parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>"italic"===e}],toDOM:t=>["em",e.get(E.key)(t)],parseMarkdown:{match:e=>"emphasis"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"emphasis"===e.type.name,runner:(e,t)=>{e.withMark(t,"emphasis")}}})));S(C.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"}),S(C.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});const A=(0,r.yu)("ToggleEmphasis",(()=>()=>(0,i.wh)(C.type())));S(A,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});const N=(0,r.pq)("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:e=>{const t=e.get(o.MD);return()=>t.call(A.key)}}});S(N.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"}),S(N.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});const O=(0,r.JY)("strong");S(O,{displayName:"Attr<strong>",group:"Strong"});const T=(0,r.hk)("strong",(e=>({inclusive:!1,parseDOM:[{tag:"b"},{tag:"strong"},{style:"font-style",getAttrs:e=>"bold"===e}],toDOM:t=>["strong",e.get(O.key)(t)],parseMarkdown:{match:e=>"strong"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strong"===e.type.name,runner:(e,t)=>{e.withMark(t,"strong")}}})));S(T.mark,{displayName:"MarkSchema<strong>",group:"Strong"}),S(T.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});const M=(0,r.yu)("ToggleStrong",(()=>()=>(0,i.wh)(T.type())));S(M,{displayName:"Command<toggleStrongCommand>",group:"Strong"});const D=(0,r.pq)("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:e=>{const t=e.get(o.MD);return()=>t.call(M.key)}}});S(D.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"}),S(D.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});const I=(0,r.JY)("inlineCode");S(I,{displayName:"Attr<inlineCode>",group:"InlineCode"});const R=(0,r.hk)("inlineCode",(e=>({priority:100,code:!0,inclusive:!1,parseDOM:[{tag:"code"}],toDOM:t=>["code",e.get(I.key)(t)],parseMarkdown:{match:e=>"inlineCode"===e.type,runner:(e,t,n)=>{e.openMark(n),e.addText(t.value),e.closeMark(n)}},toMarkdown:{match:e=>"inlineCode"===e.type.name,runner:(e,t,n)=>{e.withMark(t,"inlineCode",n.text||"")}}})));S(R.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"}),S(R.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});const F=(0,r.yu)("ToggleInlineCode",(()=>()=>(e,t)=>{const{selection:n,tr:r}=e;if(n.empty)return!1;const{from:o,to:i}=n;return e.doc.rangeHasMark(o,i,R.type())?(null==t||t(r.removeMark(o,i,R.type())),!0):(Object.keys(e.schema.marks).filter((e=>e!==R.type.name)).map((t=>e.schema.marks[t])).forEach((e=>{r.removeMark(o,i,e)})),null==t||t(r.addMark(o,i,R.type().create())),!0)}));S(F,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});const L=(0,r.pq)("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:e=>{const t=e.get(o.MD);return()=>t.call(F.key)}}});S(L.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"}),S(L.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});const P=(0,r.JY)("link");S(P,{displayName:"Attr<link>",group:"Link"});const B=(0,r.hk)("link",(e=>({attrs:{href:{},title:{default:null}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:t=>["a",{...e.get(P.key)(t),...t.attrs}],parseMarkdown:{match:e=>"link"===e.type,runner:(e,t,n)=>{const r=t.url,o=t.title;e.openMark(n,{href:r,title:o}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"link"===e.type.name,runner:(e,t)=>{e.withMark(t,"link",void 0,{title:t.attrs.title,url:t.attrs.href})}}})));S(B.mark,{displayName:"MarkSchema<link>",group:"Link"});const _=(0,r.yu)("ToggleLink",(()=>(e={})=>(0,i.wh)(B.type(),e)));S(_,{displayName:"Command<toggleLinkCommand>",group:"Link"});const z=(0,r.yu)("UpdateLink",(()=>(e={})=>(t,n)=>{if(!n)return!1;let r,o=-1;const{selection:i}=t,{from:s,to:a}=i;if(t.doc.nodesBetween(s,s===a?a+1:a,((e,t)=>{if(B.type().isInSet(e.marks))return r=e,o=t,!1})),!r)return!1;const l=r.marks.find((({type:e})=>e===B.type()));if(!l)return!1;const c=o,u=o+r.nodeSize,{tr:d}=t,p=B.type().create({...l.attrs,...e});return!!p&&(n(d.removeMark(c,u,l).addMark(c,u,p).setSelection(new h.U3(d.selection.$anchor)).scrollIntoView()),!0)}));S(z,{displayName:"Command<updateLinkCommand>",group:"Link"});const $=(0,r.dz)("doc",(()=>({content:"block+",parseMarkdown:{match:({type:e})=>"root"===e,runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>"doc"===e.type.name,runner:(e,t)=>{e.openNode("root"),e.next(t.content)}}})));S($,{displayName:"NodeSchema<doc>",group:"Doc"});const j=(0,r.YR)("paragraph");S(j,{displayName:"Attr<paragraph>",group:"Paragraph"});const U=(0,r.Yh)("paragraph",(e=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:t=>["p",e.get(j.key)(t),0],parseMarkdown:{match:e=>"paragraph"===e.type,runner:(e,t,n)=>{e.openNode(n),t.children?e.next(t.children):e.addText(t.value||""),e.closeNode()}},toMarkdown:{match:e=>"paragraph"===e.type.name,runner:(e,t)=>{e.openNode("paragraph"),x(e,t),e.closeNode()}}})));S(U.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"}),S(U.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});const H=(0,r.yu)("TurnIntoText",(()=>()=>(0,i.y_)(U.type())));S(H,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});const V=(0,r.pq)("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:e=>{const t=e.get(o.MD);return()=>t.call(H.key)}}});S(V.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"}),S(V.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});const W=Array(6).fill(0).map(((e,t)=>t+1)),K=(0,r.Qx)((e=>p(e.textContent)),"headingIdGenerator");S(K,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});const q=(0,r.YR)("heading");S(q,{displayName:"Attr<heading>",group:"Heading"});const G=(0,r.Yh)("heading",(e=>{const t=e.get(K.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:""},level:{default:1}},parseDOM:W.map((e=>({tag:`h${e}`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw(0,a.Ik)(t);return{level:e,id:t.id}}}))),toDOM:n=>[`h${n.attrs.level}`,{...e.get(q.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:e})=>"heading"===e,runner:(e,t,n)=>{const r=t.depth;e.openNode(n,{level:r}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"heading"===e.type.name,runner:(e,t)=>{e.openNode("heading",void 0,{depth:t.attrs.level}),x(e,t),e.closeNode()}}}}));S(G.node,{displayName:"NodeSchema<heading>",group:"Heading"}),S(G.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});const J=(0,r.b_)((e=>(0,l.JJ)(/^(?<hashes>#+)\s$/,G.type(),(t=>{var n,r;const i=(null==(r=null==(n=t.groups)?void 0:n.hashes)?void 0:r.length)||0,s=e.get(o.kY),{$from:a}=s.state.selection,l=a.node();if("heading"===l.type.name){let e=Number(l.attrs.level)+Number(i);return e>6&&(e=6),{level:e}}return{level:i}}))));S(J,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});const Y=(0,r.yu)("WrapInHeading",(()=>e=>(e??(e=1),e<1?(0,i.y_)(U.type()):(0,i.y_)(G.type(),{level:e}))));S(Y,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});const Z=(0,r.yu)("DowngradeHeading",(()=>()=>(e,t,n)=>{const{$from:r}=e.selection,o=r.node();if(o.type!==G.type()||!e.selection.empty||0!==r.parentOffset)return!1;const s=o.attrs.level-1;return s?(null==t||t(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...o.attrs,level:s})),!0):(0,i.y_)(U.type())(e,t,n)}));S(Z,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});const X=(0,r.pq)("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,3)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,3)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:e=>{const t=e.get(o.MD);return()=>t.call(Y.key,3)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:e=>{const t=e.get(o.MD);return()=>t.call(Z.key)}}});S(X.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"}),S(X.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});const Q=(0,r.YR)("blockquote");S(Q,{displayName:"Attr<blockquote>",group:"Blockquote"});const ee=(0,r.Yh)("blockquote",(e=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:t=>["blockquote",e.get(Q.key)(t),0],parseMarkdown:{match:({type:e})=>"blockquote"===e,runner:(e,t,n)=>{e.openNode(n).next(t.children).closeNode()}},toMarkdown:{match:e=>"blockquote"===e.type.name,runner:(e,t)=>{e.openNode("blockquote").next(t.content).closeNode()}}})));S(ee.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"}),S(ee.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});const te=(0,r.b_)((()=>(0,l.tG)(/^\s*>\s$/,ee.type())));S(te,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});const ne=(0,r.yu)("WrapInBlockquote",(()=>()=>(0,i.Im)(ee.type())));S(ne,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});const re=(0,r.pq)("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:e=>{const t=e.get(o.MD);return()=>t.call(ne.key)}}});S(re.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"}),S(re.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});const oe=(0,r.YR)("codeBlock",(()=>({pre:{},code:{}})));S(oe,{displayName:"Attr<codeBlock>",group:"CodeBlock"});const ie=(0,r.Yh)("code_block",(e=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{language:e.dataset.language}}}],toDOM:t=>{const n=e.get(oe.key)(t);return["pre",{...n.pre,"data-language":t.attrs.language},["code",n.code,0]]},parseMarkdown:{match:({type:e})=>"code"===e,runner:(e,t,n)=>{const r=t.lang,o=t.value;e.openNode(n,{language:r}),o&&e.addText(o),e.closeNode()}},toMarkdown:{match:e=>"code_block"===e.type.name,runner:(e,t)=>{var n;e.addNode("code",void 0,(null==(n=t.content.firstChild)?void 0:n.text)||"",{lang:t.attrs.language})}}})));S(ie.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"}),S(ie.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});const se=(0,r.b_)((()=>(0,l.JJ)(/^```(?<language>[a-z]*)?[\s\n]$/,ie.type(),(e=>{var t;return{language:(null==(t=e.groups)?void 0:t.language)??""}}))));S(se,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});const ae=(0,r.yu)("CreateCodeBlock",(()=>(e="")=>(0,i.y_)(ie.type(),{language:e})));S(ae,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"}),S((0,r.yu)("UpdateCodeBlockLanguage",(()=>({pos:e,language:t}={pos:-1,language:""})=>(n,r)=>e>=0&&(null==r||r(n.tr.setNodeAttribute(e,"language",t)),!0))),{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});const le=(0,r.pq)("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:e=>{const t=e.get(o.MD);return()=>t.call(ae.key)}}});S(le.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"}),S(le.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});const ce=(0,r.YR)("image");S(ce,{displayName:"Attr<image>",group:"Image"});const ue=(0,r.Yh)("image",(e=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:""},alt:{default:""},title:{default:""}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:t=>["img",{...e.get(ce.key)(t),...t.attrs}],parseMarkdown:{match:({type:e})=>"image"===e,runner:(e,t,n)=>{const r=t.url,o=t.alt,i=t.title;e.addNode(n,{src:r,alt:o,title:i})}},toMarkdown:{match:e=>"image"===e.type.name,runner:(e,t)=>{e.addNode("image",void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}})));S(ue.node,{displayName:"NodeSchema<image>",group:"Image"}),S(ue.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});const de=(0,r.yu)("InsertImage",(()=>(e={})=>(t,n)=>{if(!n)return!0;const{src:r="",alt:o="",title:i=""}=e,s=ue.type().create({src:r,alt:o,title:i});return s&&n(t.tr.replaceSelectionWith(s).scrollIntoView()),!0}));S(de,{displayName:"Command<insertImageCommand>",group:"Image"});const pe=(0,r.yu)("UpdateImage",(()=>(e={})=>(t,n)=>{const r=(0,f.UM)(t.selection,ue.type());if(!r)return!1;const{node:o,pos:i}=r,s={...o.attrs},{src:a,alt:l,title:c}=e;return void 0!==a&&(s.src=a),void 0!==l&&(s.alt=l),void 0!==c&&(s.title=c),null==n||n(t.tr.setNodeMarkup(i,void 0,s).scrollIntoView()),!0}));S(pe,{displayName:"Command<updateImageCommand>",group:"Image"}),S((0,r.b_)((()=>new l.fV(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,((e,t,n,r)=>{const[o,i,s="",a]=t;return o?e.tr.replaceWith(n,r,ue.type().create({src:s,alt:i,title:a})):null})))),{displayName:"InputRule<insertImageInputRule>",group:"Image"});const he=(0,r.YR)("hardbreak",(e=>({"data-is-inline":e.attrs.isInline})));S(he,{displayName:"Attr<hardbreak>",group:"Hardbreak"});const fe=(0,r.Yh)("hardbreak",(e=>({inline:!0,group:"inline",attrs:{isInline:{default:!1}},selectable:!1,parseDOM:[{tag:"br"}],toDOM:t=>["br",e.get(he.key)(t)],parseMarkdown:{match:({type:e})=>"break"===e,runner:(e,t,n)=>{var r;e.addNode(n,{isInline:Boolean(null==(r=t.data)?void 0:r.isInline)})}},leafText:()=>"\n",toMarkdown:{match:e=>"hardbreak"===e.type.name,runner:(e,t)=>{t.attrs.isInline?e.addNode("text",void 0,"\n"):e.addNode("break")}}})));S(fe.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"}),S(fe.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});const me=(0,r.yu)("InsertHardbreak",(()=>()=>(e,t)=>{var n;const{selection:r,tr:o}=e;if(r.empty){const i=r.$from.node();if(i.childCount>0&&"hardbreak"===(null==(n=i.lastChild)?void 0:n.type.name))return null==t||t(o.replaceRangeWith(r.to-1,r.to,e.schema.node("paragraph")).setSelection(h.LN.near(o.doc.resolve(r.to))).scrollIntoView()),!0}return null==t||t(o.setMeta("hardbreak",!0).replaceSelectionWith(fe.type().create()).scrollIntoView()),!0}));S(me,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});const ge=(0,r.pq)("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:e=>{const t=e.get(o.MD);return()=>t.call(me.key)}}});S(ge.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"}),S(ge.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});const ye=(0,r.YR)("hr");S(ye,{displayName:"Attr<hr>",group:"Hr"});const be=(0,r.Yh)("hr",(e=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:t=>["hr",e.get(ye.key)(t)],parseMarkdown:{match:({type:e})=>"thematicBreak"===e,runner:(e,t,n)=>{e.addNode(n)}},toMarkdown:{match:e=>"hr"===e.type.name,runner:e=>{e.addNode("thematicBreak")}}})));S(be.node,{displayName:"NodeSchema<hr>",group:"Hr"}),S(be.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});const ke=(0,r.b_)((()=>new l.fV(/^(?:---|___\s|\*\*\*\s)$/,((e,t,n,r)=>{const{tr:o}=e;return t[0]&&o.replaceWith(n-1,r,be.type().create()),o}))));S(ke,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});const we=(0,r.yu)("InsertHr",(()=>()=>(e,t)=>{if(!t)return!0;const n=U.node.type().create(),{tr:r,selection:o}=e,{from:i}=o,s=be.type().create();if(!s)return!0;const a=r.replaceSelectionWith(s).insert(i,n),l=h.LN.findFrom(a.doc.resolve(i),1,!0);return l&&t(a.setSelection(l).scrollIntoView()),!0}));S(we,{displayName:"Command<insertHrCommand>",group:"Hr"});const ve=(0,r.YR)("bulletList");S(ve,{displayName:"Attr<bulletList>",group:"BulletList"});const xe=(0,r.Yh)("bullet_list",(e=>({content:"listItem+",group:"block",attrs:{spread:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{spread:e.dataset.spread}}}],toDOM:t=>["ul",{...e.get(ve.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!t,runner:(e,t,n)=>{const r=null!=t.spread?`${t.spread}`:"false";e.openNode(n,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>"bullet_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!1,spread:"true"===t.attrs.spread}).next(t.content).closeNode()}}})));S(xe.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"}),S(xe.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});const Se=(0,r.b_)((()=>(0,l.tG)(/^\s*([-+*])\s$/,xe.type())));S(Se,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});const Ee=(0,r.yu)("WrapInBulletList",(()=>()=>(0,i.Im)(xe.type())));S(Ee,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});const Ce=(0,r.pq)("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:e=>{const t=e.get(o.MD);return()=>t.call(Ee.key)}}});S(Ce.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"}),S(Ce.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});const Ae=(0,r.YR)("orderedList");S(Ae,{displayName:"Attr<orderedList>",group:"OrderedList"});const Ne=(0,r.Yh)("ordered_list",(e=>({content:"listItem+",group:"block",attrs:{order:{default:1},spread:{default:!1}},parseDOM:[{tag:"ol",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{spread:e.dataset.spread,order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:t=>["ol",{...e.get(Ae.key)(t),...1===t.attrs.order?{}:t.attrs.order,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!!t,runner:(e,t,n)=>{const r=null!=t.spread?`${t.spread}`:"true";e.openNode(n,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>"ordered_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!0,start:1,spread:"true"===t.attrs.spread}),e.next(t.content),e.closeNode()}}})));S(Ne.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"}),S(Ne.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});const Oe=(0,r.b_)((()=>(0,l.tG)(/^\s*(\d+)\.\s$/,Ne.type(),(e=>({order:Number(e[1])})),((e,t)=>t.childCount+t.attrs.order===Number(e[1])))));S(Oe,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});const Te=(0,r.yu)("WrapInOrderedList",(()=>()=>(0,i.Im)(Ne.type())));S(Te,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});const Me=(0,r.pq)("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:e=>{const t=e.get(o.MD);return()=>t.call(Te.key)}}});S(Me.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"}),S(Me.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});const De=(0,r.YR)("listItem");S(De,{displayName:"Attr<listItem>",group:"ListItem"});const Ie=(0,r.Yh)("list_item",(e=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•"},listType:{default:"bullet"},spread:{default:"true"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.Ik)(e);return{label:e.dataset.label,listType:e.dataset["list-type"],spread:e.dataset.spread}}}],toDOM:t=>["li",{...e.get(De.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,n)=>{const r=null!=t.label?`${t.label}.`:"•",o=null!=t.label?"ordered":"bullet",i=null!=t.spread?`${t.spread}`:"true";e.openNode(n,{label:r,listType:o,spread:i}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{e.openNode("listItem",void 0,{spread:"true"===t.attrs.spread}),e.next(t.content),e.closeNode()}}})));S(Ie.node,{displayName:"NodeSchema<listItem>",group:"ListItem"}),S(Ie.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});const Re=(0,r.yu)("SinkListItem",(()=>()=>{return e=Ie.type(),function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));if(!i)return!1;let a=i.startIndex;if(0==a)return!1;let l=i.parent,c=l.child(a-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==l.type,o=s.FK.from(r?e.create():null),a=new s.Ji(s.FK.from(e.create(null,s.FK.from(l.type.create(null,o)))),r?3:1,0),u=i.start,d=i.end;n(t.tr.step(new m.Wg(u-(r?3:1),d,u,d,a,1,!0)).scrollIntoView())}return!0};var e}));S(Re,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});const Fe=(0,r.yu)("SplitListItem",(()=>()=>{return e=Ie.type(),function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,a=r.$to.end(r.depth);i<a&&(o.step(new m.Wg(i-1,a,i,a,new s.Ji(s.FK.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new s.u$(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const l=(0,m.jP)(r);if(null==l)return!1;o.lift(r,l);let c=o.mapping.map(i,-1)-1;return(0,m.n9)(o.doc,c)&&o.join(c),t(o.scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),a=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,c=n.endIndex==o.childCount,u=i.node(-1),d=i.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?s.FK.empty:s.FK.from(o))))return!1;let p=i.pos,h=p+a.nodeSize;return r.step(new m.Wg(p-(l?1:0),h+(c?1:0),p+1,h-1,new s.Ji((l?s.FK.empty:s.FK.from(o.copy(s.FK.empty))).append(c?s.FK.empty:s.FK.from(o.copy(s.FK.empty))),l?0:1,c?0:1),l?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))};var e}));S(Fe,{displayName:"Command<liftListItemCommand>",group:"ListItem"});const Le=(0,r.yu)("SplitListItem",(()=>()=>{return e=Ie.type(),function(t,n){let{$from:r,$to:o,node:i}=t.selection;if(i&&i.isBlock||r.depth<2||!r.sameParent(o))return!1;let a=r.node(-1);if(a.type!=e)return!1;if(0==r.parent.content.size&&r.node(-1).childCount==r.indexAfter(-1)){if(3==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let o=s.FK.empty,i=r.index(-1)?1:r.index(-2)?2:3;for(let e=r.depth-i;e>=r.depth-3;e--)o=s.FK.from(r.node(e).copy(o));let a=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;o=o.append(s.FK.from(e.createAndFill()));let l=r.before(r.depth-(i-1)),c=t.tr.replace(l,r.after(-a),new s.Ji(o,4-i,0)),u=-1;c.doc.nodesBetween(l,c.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0==e.content.size&&(u=t+1)})),u>-1&&c.setSelection(h.LN.near(c.doc.resolve(u))),n(c.scrollIntoView())}return!0}let l=o.pos==r.end()?a.contentMatchAt(0).defaultType:null,c=t.tr.delete(r.pos,o.pos),u=l?[null,{type:l}]:void 0;return!!(0,m.zy)(c.doc,r.pos,2,u)&&(n&&n(c.split(r.pos,2,u).scrollIntoView()),!0)};var e}));S(Le,{displayName:"Command<splitListItemCommand>",group:"ListItem"});const Pe=(0,r.pq)("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:e=>{const t=e.get(o.MD);return()=>t.call(Le.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:e=>{const t=e.get(o.MD);return()=>t.call(Re.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:e=>{const t=e.get(o.MD);return()=>t.call(Fe.key)}}});S(Pe.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"}),S(Pe.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});const Be=(0,r.dz)("text",(()=>({group:"inline",parseMarkdown:{match:({type:e})=>"text"===e,runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>"text"===e.type.name,runner:(e,t)=>{e.addNode("text",void 0,t.text)}}})));S(Be,{displayName:"NodeSchema<text>",group:"Text"});const _e=(0,r.YR)("html");S(_e,{displayName:"Attr<html>",group:"Html"});const ze=(0,r.Yh)("html",(e=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:""}},toDOM:t=>{const n=document.createElement("span"),r={...e.get(_e.key)(t),"data-value":t.attrs.value,"data-type":"html"};return n.textContent=t.attrs.value,["span",r,t.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>Boolean("html"===e),runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>"html"===e.type.name,runner:(e,t)=>{e.addNode("html",void 0,t.attrs.value)}}})));S(ze.node,{displayName:"NodeSchema<html>",group:"Html"}),S(ze.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});const $e=[$,j,U,K,q,G,he,fe,Q,ee,oe,ie,ye,be,ce,ue,ve,xe,Ae,Ne,De,Ie,E,C,O,T,I,R,P,B,_e,ze,Be].flat(),je=[te,Se,Oe,se,ke,J].flat(),Ue=[H,ne,Y,Z,ae,me,we,de,pe,Te,Ee,Re,Le,Fe,A,F,M,_,z],He=[re,le,ge,X,Pe,Me,Ce,V,N,L,D].flat(),Ve=/\[(?<span>((www|https:\/\/|http:\/\/)[^\s\]]+))]\((?<url>[^\s\]]+)\)/,We=e=>{let t=e,n=t.match(Ve);for(;n&&n.groups;){const{span:e}=n.groups;t=t.replace(Ve,e),n=t.match(Ve)}return t},Ke=(e,t,n)=>{const r=e.split(""),o=r[t];return r[t]&&r[n]&&(r[t]=r[n],r[n]=o),r.join("").toString()},qe={placeholderConfig:{hole:"∅",punctuation:"⁂",char:"∴"},globalNodes:["footnote_definition"],shouldSyncNode:({prevNode:e,nextNode:t})=>e.inlineContent&&t&&e.type===t.type&&!e.eq(t),movePlaceholder:(e,t)=>{const n=["*","_"];let r=t.indexOf(e);for(;n.includes(t[r-1]||"")&&n.includes(t[r+1]||"");)t=Ke(t,r,r+1),r+=1;return t}},Ge=(0,r.Qx)(qe,"inlineSyncConfig");S(Ge,{displayName:"Ctx<inlineSyncConfig>",group:"Prose"});const Je=e=>e.split("\n\n")[0]||"",Ye=(e,t)=>{try{const n=((e,t)=>{const{globalNodes:n}=e.get(Ge.key),r=[];return t.doc.descendants((e=>{if(n.includes(e.type.name)||n.includes(e.type))return r.push(e),!1})),r})(e,t),i=(e=>e.selection.$from.node())(t),s=((e,t,n,r)=>e.get(o.M)(t.schema.topNodeType.create(void 0,[n,...r])))(e,t,i,n),[a,l]=((e,t)=>{const n=e.get(Ge.key),o=n.placeholderConfig.hole,[i="",...s]=t.split("\n\n");let a=(0,r.Fs)((e=>t=>t.replace((e=>new RegExp(`\\\\(?=[^\\w\\s${e}\\\\]|_)`,"g"))(e),""))(o),(e=>n.movePlaceholder(o,e)),We)(i);const l=(e=>t=>{const n=t.indexOf(e.hole),r=t.charAt(n-1),o=t.charAt(n+1),i=/[^\w]|_/;return o?r&&i.test(r)&&i.test(o)?e.punctuation:e.char:e.punctuation})(n.placeholderConfig)(a);return a=a.replace(o,l),a=[a,...s].join("\n\n"),[a,l]})(e,s),c=((e,t)=>{const n=e.get(o.bQ)(t);return n?n.firstChild:null})(e,a);return!c||i.type!==c.type||(e=>1===e.childCount&&"html"===e.child(0).type.name)(c)?null:(c.attrs={...i.attrs},c.descendants((e=>{var t;const n=e.marks.find((e=>"link"===e.type.name));n&&(null==(t=e.text)?void 0:t.includes(l))&&n.attrs.href.includes(l)&&(n.attrs.href=n.attrs.href.replace(l,""))})),{text:Je(a),prevNode:i,nextNode:c,placeholder:l})}catch{return null}},Ze=(0,r.Gf)((e=>{let t=null;const n=new h.hs("MILKDOWN_INLINE_SYNC");return new h.k_({key:n,state:{init:()=>null,apply:(r,i,s,a)=>{var l;const c=e.get(o.kY);if(null==(l=c.hasFocus)||!l.call(c)||!c.editable||!r.docChanged||r.getMeta(n))return null;const u=Ye(e,a);if(!u)return null;t&&(cancelAnimationFrame(t),t=null);const{prevNode:d,nextNode:p,text:f}=u,{shouldSyncNode:m}=e.get(Ge.key);return m({prevNode:d,nextNode:p,ctx:e,tr:r,text:f})&&(t=requestAnimationFrame((()=>{t=null;const{dispatch:r,state:i}=e.get(o.kY);((e,t,n,r,o)=>{const{placeholderConfig:i}=e.get(Ge.key),s=i.hole;let a=n.tr.setMeta(t,!0).insertText(s,n.selection.from);const l=n.apply(a),c=Ye(e,l);if(!c)return;const{$from:u}=l.selection,d=u.before(),p=u.after(),f=((e,t,n)=>{let r=t,o=!1;return e.descendants((e=>{var t;if(o)return!1;if(e.isText){const i=null==(t=e.text)?void 0:t.indexOf(n);if(null!=i&&i>=0)return o=!0,r+=i,!1}r+=e.nodeSize})),r})(c.nextNode,d,c.placeholder);a=a.replaceWith(d,p,c.nextNode).setNodeMarkup(d,void 0,o).delete(f+1,f+2),a=a.setSelection(h.U3.near(a.doc.resolve(f+1))),r(a)})(e,n,i,r,d.attrs)})),r.setMeta("addToHistory",!1)),null}}})}));S(Ze,{displayName:"Prose<inlineSyncPlugin>",group:"Prose"});const Xe=(0,r.lz)((()=>()=>e=>{b(e,"list",(e=>{if(e.ordered){const t=e.start??1;e.children.forEach(((e,n)=>{e.label=n+t}))}}))}));S(Xe,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});const Qe=(0,r.lz)((()=>()=>e=>{const t=/[\t ]*(?:\r?\n|\r)/g;b(e,"text",((e,n,r)=>{if(!e.value||"string"!=typeof e.value)return;const o=[];let i=0;t.lastIndex=0;let s=t.exec(e.value);for(;s;){const n=s.index;i!==n&&o.push({type:"text",value:e.value.slice(i,n)}),o.push({type:"break",data:{isInline:!0}}),i=n+s[0].length,s=t.exec(e.value)}return o.length>0&&r&&"number"==typeof n?(i<e.value.length&&o.push({type:"text",value:e.value.slice(i)}),r.children.splice(n,1,...o),n+o.length):void 0}))}));S(Qe,{displayName:"Remark<remarkLineBreak>",group:"Remark"});const et=(0,r.lz)((()=>v));S(et,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});const tt=(0,r.lz)((()=>()=>e=>{!function(e){(function e(t,n,r){if((e=>!!e.children)(t)){const n=[];for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r];if(o){const i=e(o,r,t);if(i)for(let e=0,t=i.length;e<t;e++){const t=i[e];t&&n.push(t)}}}t.children=n}return((e,t,n)=>(e=>"html"===e.type)(e)?("root"===(null==n?void 0:n.type)&&(e.children=[{...e}],delete e.value,e.type="paragraph"),[e]):[e])(t,0,r)})(e,0,null)[0]}(e)}));S(tt,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});const nt=(0,r.Gf)((()=>{let e=!1;const t=new h.hs("MILKDOWN_INLINE_NODES_CURSOR"),n=new h.k_({key:t,state:{init:()=>!1,apply(e){if(!e.selection.empty)return!1;const t=e.selection.$from,n=t.nodeBefore,r=t.nodeAfter;return!(!(n&&r&&n.isInline&&!n.isText&&r.isInline)||r.isText)}},props:{handleDOMEvents:{compositionend:(t,r)=>!!e&&(e=!1,requestAnimationFrame((()=>{if(n.getState(t.state)){const e=t.state.selection.from;r.preventDefault(),t.dispatch(t.state.tr.insertText(r.data||"",e))}})),!0),compositionstart:t=>(n.getState(t.state)&&(e=!0),!1),beforeinput:(t,r)=>{if(n.getState(t.state)&&r instanceof InputEvent&&r.data&&!e){const e=t.state.selection.from;return r.preventDefault(),t.dispatch(t.state.tr.insertText(r.data||"",e)),!0}return!1}},decorations(e){if(n.getState(e)){const t=e.selection.$from.pos,n=document.createElement("span"),r=g.NZ.widget(t,n,{side:-1}),o=document.createElement("span"),i=g.NZ.widget(t,o);return setTimeout((()=>{n.contentEditable="true",o.contentEditable="true"})),g.zF.create(e.doc,[r,i])}return g.zF.empty}}});return n}));S(nt,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});const rt=(0,r.Gf)((()=>new h.k_({key:new h.hs("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(e,t,n)=>{if(!e.length)return;const[r]=e;if(!r)return;const[o]=r.steps;if(r.getMeta("hardbreak")){if(!(o instanceof m.Ln))return;const{from:e}=o;return n.tr.setNodeMarkup(e,fe.type(),void 0,[])}if(o instanceof m.XE){let e=n.tr;const{from:t,to:r}=o;return n.doc.nodesBetween(t,r,((t,n)=>{t.type===fe.type()&&(e=e.setNodeMarkup(n,fe.type(),void 0,[]))})),e}}})));S(rt,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});const ot=(0,r.Qx)(["table","code_block"],"hardbreakFilterNodes");S(ot,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});const it=(0,r.Gf)((e=>{const t=e.get(ot.key);return new h.k_({key:new h.hs("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(e,n)=>{const r=e.getMeta("hardbreak"),[o]=e.steps;if(r&&o){const{from:e}=o,r=n.doc.resolve(e);let i=r.depth,s=!0;for(;i>0;)t.includes(r.node(i).type.name)&&(s=!1),i--;return s}return!0}})}));S(it,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});const st=(0,r.Gf)((e=>{const t=new h.hs("MILKDOWN_HEADING_ID"),n=n=>{if(n.composing||!n.editable)return;const r=e.get(K.key),o=n.state.tr.setMeta("addToHistory",!1);let i=!1;n.state.doc.descendants(((e,n)=>{if(e.type===G.type()){if(0===e.textContent.trim().length)return;const s=e.attrs,a=r(e);s.id!==a&&(i=!0,o.setMeta(t,!0).setNodeMarkup(n,void 0,{...s,id:a}))}})),i&&n.dispatch(o)};return new h.k_({key:t,view:e=>(n(e),{update:e=>{n(e)}})})}));S(st,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});const at=(0,r.Gf)((()=>{const e=e=>{if(e.composing||!e.editable)return;const t=Ne.type(),n=xe.type(),r=Ie.type(),o=e.state,i=(e,t)=>{let n=!1;const r=`${t+1}.`;return e.label!==r&&(e.label=r,n=!0),n};let s=o.tr,a=!1;o.doc.descendants(((e,o,l,c)=>{if(e.type===n){const n=e.maybeChild(0);(null==n?void 0:n.type)===r&&"ordered"===n.attrs.listType&&(a=!0,s.setNodeMarkup(o,t,{spread:"true"}),e.descendants(((e,t,n,o)=>{if(e.type===r){const n={...e.attrs};i(n,o)&&(s=s.setNodeMarkup(t,void 0,n))}return!1})))}else if(e.type===r&&(null==l?void 0:l.type)===t){const t={...e.attrs};let n=!1;"ordered"!==t.listType&&(t.listType="ordered",n=!0),(null==l?void 0:l.maybeChild(0))&&(n=i(t,c)),n&&(s=s.setNodeMarkup(o,void 0,t),a=!0)}})),a&&e.dispatch(s.setMeta("addToHistory",!1))};return new h.k_({key:new h.hs("MILKDOWN_KEEP_LIST_ORDER"),view:t=>(e(t),{update:t=>{e(t)}})})}));S(at,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});const lt=[$e,je,Ue,He,[Ge,Ze,rt,ot,it,nt,Xe,et,Qe,tt,st,at]].flat()},2402:(e,t,n)=>{"use strict";n.d(t,{AL:()=>J,D8:()=>de,GU:()=>re,J3:()=>u,LF:()=>he,RC:()=>ne,_t:()=>ee,aH:()=>b,aR:()=>ae,gR:()=>ie,i4:()=>le,kG:()=>pe,of:()=>f,rn:()=>C});var r,o,i=n(81570),s=n(16090),a=n(73686),l=n(15939),c=n(11329);if("undefined"!=typeof WeakMap){let e=new WeakMap;r=t=>e.get(t),o=(t,n)=>(e.set(t,n),n)}else{const e=[],t=10;let n=0;r=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},o=(r,o)=>(n==t&&(n=0),e[n++]=r,e[n++]=o)}var u=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,o=t/this.width|0;let i=r+1,s=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;s<this.height&&this.map[t+this.width*e]==n;e++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(e,t){const{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:s,right:a,top:l,bottom:c}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(o,l),right:Math.max(r,a),bottom:Math.max(i,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){const i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==e.left&&o&&this.map[i-1]==s||r==e.top&&r&&this.map[i-this.width]==s||t.push(s))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width;const r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return r(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);const t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const o=e.child(r);let i=0;if(n)for(let t=0;t<r;t++){const n=e.child(t);for(let e=0;e<n.childCount;e++){const o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){const t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[];let o=0,i=null;const s=[];for(let e=0,o=t*n;e<o;e++)r[e]=0;for(let a=0,l=0;a<n;a++){const c=e.child(a);l++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==c.childCount)break;const u=c.child(e),{colspan:d,rowspan:p,colwidth:h}=u.attrs;for(let e=0;e<p;e++){if(e+a>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:p-e});break}const c=o+e*t;for(let e=0;e<d;e++){0==r[c+e]?r[c+e]=l:(i||(i=[])).push({type:"collision",row:a,pos:l,n:d-e});const n=h&&h[e];if(n){const r=(c+e)%t*2,o=s[r];null==o||o!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):o==n&&s[r+1]++}}}o+=d,l+=u.nodeSize}const u=(a+1)*t;let d=0;for(;o<u;)0==r[o++]&&d++;d&&(i||(i=[])).push({type:"missing",row:a,n:d}),l++}const a=new u(t,n,r,i);let l=!1;for(let e=0;!l&&e<s.length;e+=2)null!=s[e]&&s[e+1]<n&&(l=!0);return l&&function(e,t,n){e.problems||(e.problems=[]);const r={};for(let o=0;o<e.map.length;o++){const i=e.map[o];if(r[i])continue;r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null;const l=s.attrs;for(let n=0;n<l.colspan;n++){const r=t[(o+n)%e.width*2];null==r||l.colwidth&&l.colwidth[n]==r||((a||(a=d(l)))[n]=r)}a&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}(a,s,e),a}(e))}};function d(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function p(e,t){if("string"==typeof e)return{};const n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((e=>Number(e))):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(const n in t){const r=t[n].getFromDOM,o=r&&r(e);null!=o&&(i[n]=o)}return i}function h(e,t){const n={};1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(","));for(const r in t){const o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function f(e){const t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(const e in t)n[e]={default:t[e].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:()=>["table",["tbody",0]]},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:()=>["tr",0]},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:e=>p(e,t)}],toDOM:e=>["td",h(e,t),0]},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:e=>p(e,t)}],toDOM:e=>["th",h(e,t),0]}}}function m(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}var g=new i.hs("selectingCells");function y(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function b(e){const t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function k(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;const n=y(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function w(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function v(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function x(e,t,n){const r=e.node(-1),o=u.get(r),i=e.start(-1),s=o.nextCell(e.pos-i,t,n);return null==s?null:e.node(0).resolve(i+s)}function S(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((e=>e>0))||(r.colwidth=null)),r}function E(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}var C=class extends i.LN{constructor(e,t=e){const n=e.node(-1),r=u.get(n),o=e.start(-1),s=r.rectBetween(e.pos-o,t.pos-o),a=e.node(0),l=r.cellsInRect(s).filter((e=>e!=t.pos-o));l.unshift(t.pos-o);const c=l.map((e=>{const t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);const r=o+e+1;return new i.yn(a.resolve(r),a.resolve(r+t.content.size))}));super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(e,t){const n=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(w(n)&&w(r)&&v(n,r)){const e=this.$anchorCell.node(-1)!=n.node(-1);return e&&this.isRowSelection()?C.rowSelection(n,r):e&&this.isColSelection()?C.colSelection(n,r):new C(n,r)}return i.U3.between(n,r)}content(){const e=this.$anchorCell.node(-1),t=u.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let n=r.top;n<r.bottom;n++){const a=[];for(let i=n*t.width+r.left,s=r.left;s<r.right;s++,i++){const n=t.map[i];if(o[n])continue;o[n]=!0;const s=t.findCell(n);let l=e.nodeAt(n);if(!l)throw RangeError(`No cell with offset ${n} found`);const c=r.left-s.left,u=s.right-r.right;if(c>0||u>0){let e=l.attrs;if(c>0&&(e=S(e,0,c)),u>0&&(e=S(e,e.colspan-u,u)),s.left<r.left){if(l=l.type.createAndFill(e),!l)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else l=l.type.create(e,l.content)}if(s.top<r.top||s.bottom>r.bottom){const e={...l.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};l=s.top<r.top?l.type.createAndFill(e):l.type.create(e,l.content)}a.push(l)}i.push(e.child(n).copy(s.FK.from(a)))}const a=this.isColSelection()&&this.isRowSelection()?e:i;return new s.Ji(s.FK.from(a),1,1)}replace(e,t=s.Ji.empty){const n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){const{$from:i,$to:a}=r[o],l=e.mapping.slice(n);e.replace(l.map(i.pos),l.map(a.pos),o?s.Ji.empty:t)}const o=i.LN.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new s.Ji(s.FK.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=u.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<o.length;n++)e(t.nodeAt(o[n]),r+o[n])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const n=e.node(-1),r=u.get(n),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(t.pos-o),a=e.node(0);return i.top<=s.top?(i.top>0&&(e=a.resolve(o+r.map[i.left])),s.bottom<r.height&&(t=a.resolve(o+r.map[r.width*(r.height-1)+s.right-1]))):(s.top>0&&(t=a.resolve(o+r.map[s.left])),i.bottom<r.height&&(e=a.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))),new C(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=u.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),o=t.colCount(this.$headCell.pos-n);if(Math.min(r,o)>0)return!1;const i=r+this.$anchorCell.nodeAfter.attrs.colspan,s=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,s)==t.width}eq(e){return e instanceof C&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const n=e.node(-1),r=u.get(n),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(t.pos-o),a=e.node(0);return i.left<=s.left?(i.left>0&&(e=a.resolve(o+r.map[i.top*r.width])),s.right<r.width&&(t=a.resolve(o+r.map[r.width*(s.top+1)-1]))):(s.left>0&&(t=a.resolve(o+r.map[s.top*r.width])),i.right<r.width&&(e=a.resolve(o+r.map[r.width*(i.top+1)-1]))),new C(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new C(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new C(e.resolve(t),e.resolve(n))}getBookmark(){return new A(this.$anchorCell.pos,this.$headCell.pos)}};C.prototype.visible=!1,i.LN.jsonID("cell",C);var A=class{constructor(e,t){this.anchor=e,this.head=t}map(e){return new A(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&v(t,n)?new C(t,n):i.LN.near(n,1)}};function N(e){if(!(e.selection instanceof C))return null;const t=[];return e.selection.forEachCell(((e,n)=>{t.push(a.NZ.node(n,n+e.nodeSize,{class:"selectedCell"}))})),a.zF.create(e.doc,t)}var O=new i.hs("fix-tables");function T(e,t,n,r){const o=e.childCount,i=t.childCount;e:for(let s=0,a=0;s<i;s++){const i=t.child(s);for(let t=a,r=Math.min(o,s+3);t<r;t++)if(e.child(t)==i){a=t+1,n+=i.nodeSize;continue e}r(i,n),a<o&&e.child(a).sameMarkup(i)?T(e.child(a),i,n+1,r):i.nodesBetween(0,i.content.size,r,n+1),n+=i.nodeSize}}function M(e,t){let n;const r=(t,r)=>{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){const o=u.get(t);if(!o.problems)return r;r||(r=e.tr);const i=[];for(let e=0;e<o.height;e++)i.push(0);for(let e=0;e<o.problems.length;e++){const s=o.problems[e];if("collision"==s.type){const e=t.nodeAt(s.pos);if(!e)continue;const o=e.attrs;for(let e=0;e<o.rowspan;e++)i[s.row+e]+=s.n;r.setNodeMarkup(r.mapping.map(n+1+s.pos),null,S(o,o.colspan-s.n,s.n))}else if("missing"==s.type)i[s.row]+=s.n;else if("overlong_rowspan"==s.type){const e=t.nodeAt(s.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+s.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-s.n})}else if("colwidth mismatch"==s.type){const e=t.nodeAt(s.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+s.pos),null,{...e.attrs,colwidth:s.colwidth})}}let s,a;for(let e=0;e<i.length;e++)i[e]&&(null==s&&(s=e),a=e);for(let l=0,c=n+1;l<o.height;l++){const n=t.child(l),o=c+n.nodeSize,u=i[l];if(u>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);const i=[];for(let n=0;n<u;n++){const n=m(e.schema)[t].createAndFill();n&&i.push(n)}const d=0!=l&&s!=l-1||a!=l?o-1:c+1;r.insert(r.mapping.map(d),i)}c=o}return r.setMeta(O,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&T(t.doc,e.doc,0,r):e.doc.descendants(r),n}function D(e,t){const n=e.createAndFill();return new c.dL(n).replace(0,n.content.size,t).doc}function I(e,t,n,r,o,i,s,a){if(0==s||s==t.height)return!1;let l=!1;for(let c=o;c<i;c++){const o=s*t.width+c,i=t.map[o];if(t.map[o-t.width]==i){l=!0;const o=n.nodeAt(i),{top:u,left:d}=t.findCell(i);e.setNodeMarkup(e.mapping.slice(a).map(i+r),null,{...o.attrs,rowspan:s-u}),e.insert(e.mapping.slice(a).map(t.positionAt(s,d,n)),o.type.createAndFill({...o.attrs,rowspan:u+o.attrs.rowspan-s})),c+=o.attrs.colspan-1}}return l}function R(e,t,n,r,o,i,s,a){if(0==s||s==t.width)return!1;let l=!1;for(let c=o;c<i;c++){const o=c*t.width+s,i=t.map[o];if(t.map[o-1]==i){l=!0;const o=n.nodeAt(i),u=t.colCount(i),d=e.mapping.slice(a).map(i+r);e.setNodeMarkup(d,null,S(o.attrs,s-u,o.attrs.colspan-(s-u))),e.insert(d+o.nodeSize,o.type.createAndFill(S(o.attrs,0,s-u))),c+=o.attrs.rowspan-1}}return l}function F(e,t,n,r,o){let i=n?e.doc.nodeAt(n-1):e.doc;if(!i)throw new Error("No table found");let a=u.get(i);const{top:l,left:c}=r,d=c+o.width,p=l+o.height,h=e.tr;let f=0;function g(){if(i=n?h.doc.nodeAt(n-1):h.doc,!i)throw new Error("No table found");a=u.get(i),f=h.mapping.maps.length}(function(e,t,n,r,o,i,a){const l=m(e.doc.type.schema);let c,u;if(o>t.width)for(let i=0,s=0;i<t.height;i++){const d=n.child(i);s+=d.nodeSize;const p=[];let h;h=null==d.lastChild||d.lastChild.type==l.cell?c||(c=l.cell.createAndFill()):u||(u=l.header_cell.createAndFill());for(let e=t.width;e<o;e++)p.push(h);e.insert(e.mapping.slice(a).map(s-1+r),p)}if(i>t.height){const d=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,o);e++){const o=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==l.header_cell;d.push(o?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const p=l.row.create(null,s.FK.from(d)),h=[];for(let e=t.height;e<i;e++)h.push(p);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),h)}return!(!c&&!u)})(h,a,i,n,d,p,f)&&g(),I(h,a,i,n,c,d,l,f)&&g(),I(h,a,i,n,c,d,p,f)&&g(),R(h,a,i,n,l,p,c,f)&&g(),R(h,a,i,n,l,p,d,f)&&g();for(let e=l;e<p;e++){const t=a.positionAt(e,c,i),r=a.positionAt(e,d,i);h.replace(h.mapping.slice(f).map(t+n),h.mapping.slice(f).map(r+n),new s.Ji(o.rows[e-l],0,0))}g(),h.setSelection(new C(h.doc.resolve(n+a.positionAt(l,c,i)),h.doc.resolve(n+a.positionAt(p-1,d-1,i)))),t(h)}var L=(0,l.K)({ArrowLeft:B("horiz",-1),ArrowRight:B("horiz",1),ArrowUp:B("vert",-1),ArrowDown:B("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:z,"Mod-Backspace":z,Delete:z,"Mod-Delete":z});function P(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function B(e,t){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof C)return P(n,r,i.LN.near(s.$headCell,t));if("horiz"!=e&&!s.empty)return!1;const a=H(o,e,t);if(null==a)return!1;if("horiz"==e)return P(n,r,i.LN.near(n.doc.resolve(s.head+t),t));{const o=n.doc.resolve(a),s=x(o,e,t);let l;return l=s?i.LN.near(s,1):t<0?i.LN.near(n.doc.resolve(o.before(-1)),-1):i.LN.near(n.doc.resolve(o.after(-1)),1),P(n,r,l)}}}function _(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof C)s=i;else{const r=H(o,e,t);if(null==r)return!1;s=new C(n.doc.resolve(r))}const a=x(s.$headCell,e,t);return!!a&&P(n,r,new C(s.$anchorCell,a))}}function z(e,t){const n=e.selection;if(!(n instanceof C))return!1;if(t){const r=e.tr,o=m(e.schema).cell.createAndFill().content;n.forEachCell(((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new s.Ji(o,0,0))})),r.docChanged&&t(r)}return!0}function $(e,t){const n=y(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new C(n))),!0)}function j(e,t,n){if(!b(e.state))return!1;let r=function(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.child(0).type.spec.tableRole);)n--,r--,t=t.child(0).content;const o=t.child(0),i=o.type.spec.tableRole,a=o.type.schema,l=[];if("row"==i)for(let e=0;e<t.childCount;e++){let o=t.child(e).content;const i=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(i||c)&&(o=D(m(a).row,new s.Ji(o,i,c)).content),l.push(o)}else{if("cell"!=i&&"header_cell"!=i)return null;l.push(n||r?D(m(a).row,new s.Ji(t,n,r)).content:t)}return function(e,t){const n=[];for(let e=0;e<t.length;e++){const r=t[e];for(let t=r.childCount-1;t>=0;t--){const{rowspan:o,colspan:i}=r.child(t).attrs;for(let t=e;t<e+o;t++)n[t]=(n[t]||0)+i}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(s.FK.empty),n[o]<r){const i=m(e).cell.createAndFill(),a=[];for(let e=n[o];e<r;e++)a.push(i);t[o]=t[o].append(s.FK.from(a))}return{height:t.length,width:r,rows:t}}(a,l)}(n);const o=e.state.selection;if(o instanceof C){r||(r={width:1,height:1,rows:[s.FK.from(D(m(e.state.schema).cell,n))]});const t=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),a=u.get(t).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=function({width:e,height:t,rows:n},r,o){if(e!=r){const t=[],o=[];for(let e=0;e<n.length;e++){const i=n[e],a=[];for(let n=t[e]||0,o=0;n<r;o++){let s=i.child(o%i.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(S(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),a.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}o.push(s.FK.from(a))}n=o,e=r}if(t!=o){const e=[];for(let r=0,i=0;r<o;r++,i++){const a=[],l=n[i%t];for(let e=0;e<l.childCount;e++){let t=l.child(e);r+t.attrs.rowspan>o&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,o-t.attrs.rowspan)},t.content)),a.push(t)}e.push(s.FK.from(a))}n=e,t=o}return{width:e,height:t,rows:n}}(r,a.right-a.left,a.bottom-a.top),F(e.state,e.dispatch,i,a,r),!0}if(r){const t=k(e.state),n=t.start(-1);return F(e.state,e.dispatch,n,u.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function U(e,t){var n;if(t.ctrlKey||t.metaKey)return;const r=V(e,t.target);let o;if(t.shiftKey&&e.state.selection instanceof C)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(o=y(e.state.selection.$anchor))&&(null==(n=W(e,t))?void 0:n.pos)!=o.pos)i(o,t),t.preventDefault();else if(!r)return;function i(t,n){let r=W(e,n);const o=null==g.getState(e.state);if(!r||!v(t,r)){if(!o)return;r=t}const i=new C(t,r);if(o||!e.state.selection.eq(i)){const n=e.state.tr.setSelection(i);o&&n.setMeta(g,t.pos),e.dispatch(n)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",a),null!=g.getState(e.state)&&e.dispatch(e.state.tr.setMeta(g,-1))}function a(n){const o=n,a=g.getState(e.state);let l;if(null!=a)l=e.state.doc.resolve(a);else if(V(e,o.target)!=r&&(l=W(e,t),!l))return s();l&&i(l,o)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",a)}function H(e,t,n){if(!(e.state.selection instanceof i.U3))return null;const{$head:r}=e.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){const i=r.before(o),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?i:null}}return null}function V(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function W(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?y(e.state.doc.resolve(n.pos)):null}var K=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),q(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,q(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function q(e,t,n,r,o,i){var s;let a=0,l=!0,c=t.firstChild;const u=e.firstChild;if(u){for(let e=0,n=0;e<u.childCount;e++){const{colspan:s,colwidth:d}=u.child(e).attrs;for(let e=0;e<s;e++,n++){const s=o==n?i:d&&d[e],u=s?s+"px":"";a+=s||r,s||(l=!1),c?(c.style.width!=u&&(c.style.width=u),c=c.nextSibling):t.appendChild(document.createElement("col")).style.width=u}}for(;c;){const e=c.nextSibling;null==(s=c.parentNode)||s.removeChild(c),c=e}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var G=new i.hs("tableColumnResizing");function J({handleWidth:e=5,cellMinWidth:t=25,View:n=K,lastColumnResizable:r=!0}={}){const o=new i.k_({key:G,state:{init:(e,r)=>(o.spec.props.nodeViews[m(r.schema).table.name]=(e,r)=>new n(e,t,r),new Y(-1,!1)),apply:(e,t)=>t.apply(e)},props:{attributes:e=>{const t=G.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(t,n)=>{!function(e,t,n,r,o){const i=G.getState(e.state);if(i&&!i.dragging){const r=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target);let s=-1;if(r){const{left:o,right:i}=r.getBoundingClientRect();t.clientX-o<=n?s=Z(e,t,"left"):i-t.clientX<=n&&(s=Z(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){const t=e.state.doc.resolve(s),n=t.node(-1),r=u.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Q(e,s)}}}(t,n,e,0,r)},mouseleave:e=>{!function(e){const t=G.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Q(e,-1)}(e)},mousedown:(e,n)=>{!function(e,t,n){const r=G.getState(e.state);if(!r||-1==r.activeHandle||r.dragging)return!1;const o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=e.domAtPos(t);let s=i.node.childNodes[i.offset].offsetWidth,a=n;if(r)for(let e=0;e<n;e++)r[e]&&(s-=r[e],a--);return s/a}(e,r.activeHandle,o.attrs);function s(t){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);const r=G.getState(e.state);(null==r?void 0:r.dragging)&&(function(e,t,n){const r=e.state.doc.resolve(t),o=r.node(-1),i=u.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let e=0;e<i.height;e++){const t=e*i.width+a;if(e&&i.map[t]==i.map[t-i.width])continue;const r=i.map[t],u=o.nodeAt(r).attrs,d=1==u.colspan?0:a-i.colCount(r);if(u.colwidth&&u.colwidth[d]==n)continue;const p=u.colwidth?u.colwidth.slice():(c=u.colspan,Array(c).fill(0));p[d]=n,l.setNodeMarkup(s+r,null,{...u,colwidth:p})}var c;l.docChanged&&e.dispatch(l)}(e,r.activeHandle,X(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(G,{setDragging:null})))}function a(t){if(!t.which)return s(t);const r=G.getState(e.state);if(r&&r.dragging){const o=X(r.dragging,t,n);!function(e,t,n,r){const o=e.state.doc.resolve(t),i=o.node(-1),s=o.start(-1),a=u.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let l=e.domAtPos(o.start(-1)).node;for(;l&&"TABLE"!=l.nodeName;)l=l.parentNode;l&&q(i,l.firstChild,l,r,a,n)}(e,r.activeHandle,o,n)}}e.dispatch(e.state.tr.setMeta(G,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),t.preventDefault()}(e,n,t)}},decorations:e=>{const t=G.getState(e);if(t&&t.activeHandle>-1)return function(e,t){const n=[],r=e.doc.resolve(t),o=r.node(-1);if(!o)return a.zF.empty;const i=u.get(o),s=r.start(-1),l=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let e=0;e<i.height;e++){const t=l+e*i.width-1;if(!(l!=i.width&&i.map[t]==i.map[t+1]||0!=e&&i.map[t-1]==i.map[t-1-i.width])){const e=i.map[t],r=s+e+o.nodeAt(e).nodeSize-1,l=document.createElement("div");l.className="column-resize-handle",n.push(a.NZ.widget(r,l))}}return a.zF.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return o}var Y=class{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,n=e.getMeta(G);if(n&&null!=n.setHandle)return new Y(n.setHandle,!1);if(n&&void 0!==n.setDragging)return new Y(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){let n=e.mapping.map(t.activeHandle,-1);return w(e.doc.resolve(n))||(n=-1),new Y(n,t.dragging)}return t}};function Z(e,t,n){const r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;const{pos:o}=r,i=y(e.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;const s=u.get(i.node(-1)),a=i.start(-1),l=s.map.indexOf(i.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function X(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Q(e,t){e.dispatch(e.state.tr.setMeta(G,{setHandle:t}))}function ee(e){const t=e.selection,n=k(e),r=n.node(-1),o=n.start(-1),i=u.get(r);return{...t instanceof C?i.rectBetween(t.$anchorCell.pos-o,t.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function te(e,{map:t,tableStart:n,table:r},o){let i=o>0?-1:0;(function(e,t,n){const r=m(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(t,r,o+i)&&(i=0==o||o==t.width?null:0);for(let s=0;s<t.height;s++){const a=s*t.width+o;if(o>0&&o<t.width&&t.map[a-1]==t.map[a]){const i=t.map[a],l=r.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,E(l.attrs,o-t.colCount(i))),s+=l.attrs.rowspan-1}else{const l=null==i?m(r.type.schema).cell:r.nodeAt(t.map[a+i]).type,c=t.positionAt(s,o,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function ne(e,t){if(!b(e))return!1;if(t){const n=ee(e);t(te(e.tr,n,n.left))}return!0}function re(e,t){if(!b(e))return!1;if(t){const n=ee(e);t(te(e.tr,n,n.right))}return!0}function oe(e,{map:t,table:n,tableStart:r},o){const i=e.mapping.maps.length;for(let s=0;s<t.height;){const a=s*t.width+o,l=t.map[a],c=n.nodeAt(l),u=c.attrs;if(o>0&&t.map[a-1]==l||o<t.width-1&&t.map[a+1]==l)e.setNodeMarkup(e.mapping.slice(i).map(r+l),null,S(u,o-t.colCount(l)));else{const t=e.mapping.slice(i).map(r+l);e.delete(t,t+c.nodeSize)}s+=u.rowspan}}function ie(e,t){if(!b(e))return!1;if(t){const n=ee(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;oe(r,n,e),e!=n.left;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=u.get(e)}t(r)}return!0}function se(e,{map:t,table:n,tableStart:r},o){let i=0;for(let e=0;e<o;e++)i+=n.child(e).nodeSize;const s=i+n.child(o).nodeSize,a=e.mapping.maps.length;e.delete(i+r,s+r);for(let i=0,s=o*t.width;i<t.width;i++,s++){const l=t.map[s];if(o>0&&l==t.map[s-t.width]){const t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(a).map(l+r),null,{...t,rowspan:t.rowspan-1}),i+=t.colspan-1}else if(o<t.width&&l==t.map[s+t.width]){const s=n.nodeAt(l),c=s.attrs,u=s.type.create({...c,rowspan:s.attrs.rowspan-1},s.content),d=t.positionAt(o+1,i,n);e.insert(e.mapping.slice(a).map(r+d),u),i+=c.colspan-1}}}function ae(e,t){if(!b(e))return!1;if(t){const n=ee(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;se(r,n,e),e!=n.top;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=u.get(n.table)}t(r)}return!0}function le(e,t){return function(n,r){if(!b(n))return!1;const o=k(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){const i=n.tr;n.selection instanceof C?n.selection.forEachCell(((n,r)=>{n.attrs[e]!==t&&i.setNodeMarkup(r,null,{...n.attrs,[e]:t})})):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[e]:t}),r(i)}return!0}}function ce(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<r.length;e++){const o=t.table.nodeAt(r[e]);if(o&&o.type!==n.header_cell)return!1}return!0}function ue(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!b(t))return!1;if(n){const r=m(t.schema),o=ee(t),i=t.tr,s=o.map.cellsInRect("column"==e?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==e?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map((e=>o.table.nodeAt(e)));for(let e=0;e<s.length;e++)a[e].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[e],r.cell,a[e].attrs);if(0==i.steps.length)for(let e=0;e<s.length;e++)i.setNodeMarkup(o.tableStart+s[e],r.header_cell,a[e].attrs);n(i)}return!0}}(e):function(t,n){if(!b(t))return!1;if(n){const r=m(t.schema),o=ee(t),i=t.tr,s=ce("row",o,r),a=ce("column",o,r),l=("column"===e?s:"row"===e&&a)?1:0,c="column"==e?{left:0,top:l,right:1,bottom:o.map.height}:"row"==e?{left:l,top:0,right:o.map.width,bottom:1}:o,u="column"==e?a?r.cell:r.header_cell:"row"==e?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach((e=>{const t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,u,n.attrs)})),n(i)}return!0}}function de(e){return function(t,n){if(!b(t))return!1;const r=function(e,t){if(t<0){const t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){const r=e.node(-1).child(t),o=r.lastChild;if(o)return n-1-o.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){const e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}(k(t),e);if(null==r)return!1;if(n){const e=t.doc.resolve(r);n(t.tr.setSelection(i.U3.between(e,(o=e,o.node(0).resolve(o.pos+o.nodeAfter.nodeSize)))).scrollIntoView())}var o;return!0}}function pe(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function he({allowTableNodeSelection:e=!1}={}){return new i.k_({key:g,state:{init:()=>null,apply(e,t){const n=e.getMeta(g);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;const{deleted:r,pos:o}=e.mapping.mapResult(t);return r?null:o}},props:{decorations:N,handleDOMEvents:{mousedown:U},createSelectionBetween:e=>null!=g.getState(e.state)?e.state.selection:null,handleTripleClick:$,handleKeyDown:L,handlePaste:j},appendTransaction:(t,n,r)=>function(e,t,n){const r=(t||e).selection,o=(t||e).doc;let s,a;if(r instanceof i.nh&&(a=r.node.type.spec.tableRole)){if("cell"==a||"header_cell"==a)s=C.create(o,r.from);else if("row"==a){const e=o.resolve(r.from+1);s=C.rowSelection(e,e)}else if(!n){const e=u.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];s=C.create(o,t+1,n)}}else r instanceof i.U3&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<e.pos-6)return!1;let n=e.pos,r=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(o).type.spec.tableRole)}(r)?s=i.U3.create(o,r.from):r instanceof i.U3&&function({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){const r=e.node(t);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;break}}for(let e=t.depth;e>0;e--){const n=t.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){r=n;break}}return n!==r&&0===t.parentOffset}(r)&&(s=i.U3.create(o,r.$from.start(),r.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}(r,M(r,n),e)})}ue("row",{useDeprecatedLogic:!0}),ue("column",{useDeprecatedLogic:!0}),ue("cell",{useDeprecatedLogic:!0})},5536:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(12559);function o(e,t,n){return n((0,r.A)(e,t))}},8653:(e,t,n)=>{"use strict";n.d(t,{F_:()=>p,Ob:()=>u});var r=n(67488),o=n(27647),i=n(81570),s=n(30072),a=Object.defineProperty,l=(e,t,n)=>(((e,t,n)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class c{constructor(){l(this,"beforeMountedListeners",[]),l(this,"mountedListeners",[]),l(this,"updatedListeners",[]),l(this,"markdownUpdatedListeners",[]),l(this,"blurListeners",[]),l(this,"focusListeners",[]),l(this,"destroyListeners",[]),l(this,"beforeMount",(e=>(this.beforeMountedListeners.push(e),this))),l(this,"mounted",(e=>(this.mountedListeners.push(e),this))),l(this,"updated",(e=>(this.updatedListeners.push(e),this)))}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}}const u=(0,r.Z0)(new c,"listener"),d=new i.hs("MILKDOWN_LISTENER"),p=e=>(e.inject(u,new c),async()=>{await e.wait(o.ge);const t=e.get(u),{listeners:n}=t;n.beforeMount.forEach((t=>t(e))),await e.wait(o.g3);const r=e.get(o.M);let a=null,l=null;const c=new i.k_({key:d,view:()=>({destroy:()=>{n.destroy.forEach((t=>t(e)))}}),props:{handleDOMEvents:{focus:()=>(n.focus.forEach((t=>t(e))),!1),blur:()=>(n.blur.forEach((t=>t(e))),!1)}},state:{init:()=>{},apply:t=>t.docChanged&&!1!==t.getMeta("addToHistory")?s((()=>{const{doc:o}=t;if(n.updated.length>0&&(null==a||!a.eq(o))&&n.updated.forEach((t=>{t(e,o,a)})),n.markdownUpdated.length>0&&(null==a||!a.eq(o))){const t=r(o);n.markdownUpdated.forEach((n=>{n(e,t,l)})),l=t}a=o}),200)():void 0}});e.update(o.TP,(e=>e.concat(c))),await e.wait(o.CU),n.mounted.forEach((t=>t(e)))});p.meta={package:"@milkdown/plugin-listener",displayName:"Listener"}},9760:(e,t,n)=>{"use strict";n.d(t,{E:()=>s});var r=n(27647);function o(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=o(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}const i=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=o(e))&&(r&&(r+=" "),r+=t);return r},s=e=>{e.update(r.QM,(e=>{const t=e.attributes;return{...e,attributes:e=>{const n="function"==typeof t?t(e):t;return{...n,class:i("prose dark:prose-invert outline-none",(null==n?void 0:n.class)||"","milkdown-theme-nord")}}}}))}},10660:(e,t,n)=>{"use strict";n.d(t,{y:()=>i});var r=n(43890);const o={}.hasOwnProperty;function i(e){const t={};let n=-1;for(;++n<e.length;)s(t,e[n]);return t}function s(e,t){let n;for(n in t){const r=(o.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;for(s in i){o.call(r,s)||(r[s]=[]);const e=i[s];a(r[s],Array.isArray(e)?e:e?[e]:[])}}}function a(e,t){let n=-1;const o=[];for(;++n<t.length;)("after"===t[n].add?e:o).push(t[n]);(0,r.m)(e,0,0,o)}},11329:(e,t,n)=>{"use strict";n.d(t,{$L:()=>N,Ln:()=>y,Um:()=>A,Wg:()=>b,X9:()=>l,XE:()=>h,dL:()=>$,jP:()=>v,n9:()=>C,oM:()=>x,zy:()=>E});var r=n(16090);const o=Math.pow(2,16);function i(e){return 65535&e}class s{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class a{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&a.empty)return a.empty}recover(e){let t=0,n=i(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/o}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let u=this.ranges[l+i],d=this.ranges[l+a],p=c+u;if(e<=p){let i=c+r+((u?e==c?-1:e==p?1:t:t)<0?0:d);if(n)return i;let a=e==c?2:e==p?1:4;return(t<0?e!=c:e!=p)&&(a|=8),new s(i,a,e==(t<0?c:p)?null:l/3+(e-c)*o)}r+=d-u}return n?e+r:new s(e+r,0,null)}touches(e,t){let n=0,r=i(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let i=this.ranges[t]-(this.inverted?n:0);if(i>e)break;let a=this.ranges[t+o];if(e<=i+a&&t==3*r)return!0;n+=this.ranges[t+s]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new a(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?a.empty:new a(e<0?[0,-e,0]:[0,0,e])}}a.empty=new a([]);class l{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new l(this.maps,this.mirror,e,t)}copy(){return new l(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r: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,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new l;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new s(e,r,null)}}const c=Object.create(null);class u{getMap(){return a.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=c[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.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 d{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new d(e,null)}static fail(e){return new d(null,e)}static fromReplace(e,t,n,o){try{return d.ok(e.replace(t,n,o))}catch(e){if(e instanceof r.vI)return d.fail(e.message);throw e}}}function p(e,t,n){let o=[];for(let r=0;r<e.childCount;r++){let i=e.child(r);i.content.size&&(i=i.copy(p(i.content,t,i))),i.isInline&&(i=t(i,n,r)),o.push(i)}return r.FK.fromArray(o)}class h extends u{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),o=n.node(n.sharedDepth(this.to)),i=new r.Ji(p(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),o),t.openStart,t.openEnd);return d.fromReplace(e,this.from,this.to,i)}invert(){return new f(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new h(t.pos,n.pos,this.mark)}merge(e){return e instanceof h&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new h(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("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new h(t.from,t.to,e.markFromJSON(t.mark))}}u.jsonID("addMark",h);class f extends u{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new r.Ji(p(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return d.fromReplace(e,this.from,this.to,n)}invert(){return new h(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new f(t.pos,n.pos,this.mark)}merge(e){return e instanceof f&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new f(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("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new f(t.from,t.to,e.markFromJSON(t.mark))}}u.jsonID("removeMark",f);class m extends u{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new m(this.pos,t.marks[n]);return new m(this.pos,this.mark)}}return new g(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new m(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new m(t.pos,e.markFromJSON(t.mark))}}u.jsonID("addNodeMark",m);class g extends u{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new m(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new g(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new g(t.pos,e.markFromJSON(t.mark))}}u.jsonID("removeNodeMark",g);class y extends u{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&k(e,this.from,this.to)?d.fail("Structure replace would overwrite content"):d.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new a([this.from,this.to-this.from,this.slice.size])}invert(e){return new y(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new y(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof y)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new y(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new y(this.from,this.to+(e.to-e.from),t,this.structure)}}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("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new y(t.from,t.to,r.Ji.fromJSON(e,t.slice),!!t.structure)}}u.jsonID("replace",y);class b extends u{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(k(e,this.from,this.gapFrom)||k(e,this.gapTo,this.to)))return d.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return d.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?d.fromReplace(e,this.from,this.to,n):d.fail("Content does not fit in gap")}getMap(){return new a([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 b(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),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new b(t.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new b(t.from,t.to,t.gapFrom,t.gapTo,r.Ji.fromJSON(e,t.slice),t.insert,!!t.structure)}}function k(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function w(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function v(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!w(r,o,i))break}return null}function x(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<o;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return i?o.map(S).concat({type:t,attrs:n}).concat(i.map(S)):null}function S(e){return{type:e,attrs:null}}function E(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function C(e,t){let n=e.resolve(t),r=n.index();return o=n.nodeBefore,i=n.nodeAfter,!(!o||!i||o.isLeaf||!o.canAppend(i))&&n.parent.canReplace(r,r+1);var o,i}function A(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,i=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(i,i,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function N(e,t,n=t,o=r.Ji.empty){if(t==n&&!o.size)return null;let i=e.resolve(t),s=e.resolve(n);return O(i,s,o)?new y(t,n,o):new T(i,s,o).fit()}function O(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}u.jsonID("replaceAround",b);class T{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.FK.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=r.FK.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(e<0?this.$to:n.doc.resolve(e));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&1==i.childCount;)i=i.firstChild.content,s--,a--;let l=new r.Ji(i,s,a);return e>-1?new b(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new y(n.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,o=null;n?(o=I(this.unplaced.content,n-1).firstChild,e=o.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let s,{type:a,match:l}=this.frontier[e],c=null;if(1==t&&(i?l.matchType(i.type)||(c=l.fillBefore(r.FK.from(i),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:n,frontierDepth:e,parent:o,inject:c};if(2==t&&i&&(s=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:o,wrap:s};if(o&&l.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,o=I(e,t);return!(!o.childCount||o.firstChild.isLeaf||(this.unplaced=new r.Ji(e,t+1,Math.max(n,o.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,o=I(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new r.Ji(M(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new r.Ji(M(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let s=this.unplaced,a=n?n.content:s.content,l=s.openStart-e,c=0,u=[],{match:d,type:p}=this.frontier[t];if(o){for(let e=0;e<o.childCount;e++)u.push(o.child(e));d=d.matchFragment(o)}let h=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let e=a.child(c),t=d.matchType(e.type);if(!t)break;c++,(c>1||0==l||e.content.size)&&(d=t,u.push(R(e.mark(p.allowedMarks(e.marks)),1==c?l:0,c==a.childCount?h:-1)))}let f=c==a.childCount;f||(h=-1),this.placed=D(this.placed,t,r.FK.from(u)),this.frontier[t].match=d,f&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=a;e<h;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=f?0==e?r.Ji.empty:new r.Ji(M(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new r.Ji(M(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!F(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=F(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=F(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=D(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=D(this.placed,this.depth,r.FK.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.FK.empty,!0);e.childCount&&(this.placed=D(this.placed,this.frontier.length,e))}}function M(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(M(e.firstChild.content,t-1,n)))}function D(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(D(e.lastChild.content,t-1,n)))}function I(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function R(e,t,n){if(t<=0)return e;let o=e.content;return t>1&&(o=o.replaceChild(0,R(o.firstChild,t-1,1==o.childCount?n-1:0))),t>0&&(o=e.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.FK.empty,!0)))),e.copy(o)}function F(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function L(e){return e.spec.defining||e.spec.definingForContent}function P(e,t,n,o,i){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(P(r.content,t+1,n,o,r)))}if(t>o){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.FK.empty,!0))}return e}function B(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}class _ extends u{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let o=t.type.create(n,null,t.marks);return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(o),0,t.isLeaf?0:1))}getMap(){return a.empty}invert(e){return new _(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 _(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new _(t.pos,t.attr,t.value)}}u.jsonID("attr",_);let z=class extends Error{};z=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(z.prototype=Object.create(Error.prototype)).constructor=z,z.prototype.name="TransformError";class ${constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new l}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new z(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,n=r.Ji.empty){let o=N(this.doc,e,t,n);return o&&this.step(o),this}replaceWith(e,t,n){return this.replace(e,t,new r.Ji(r.FK.from(n),0,0))}delete(e,t){return this.replace(e,t,r.Ji.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,o){if(!o.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),s=e.doc.resolve(n);if(O(i,s,o))return e.step(new y(t,n,o));let a=B(i,e.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(i.depth+1);a.unshift(l);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(e)>-1?l=e:i.before(e)==t&&a.splice(1,0,-e)}let c=a.indexOf(l),u=[],d=o.openStart;for(let e=o.content,t=0;;t++){let n=e.firstChild;if(u.push(n),t==o.openStart)break;e=n.content}for(let e=d-1;e>=0;e--){let t=u[e].type,n=L(t);if(n&&i.node(c).type!=t)d=e;else if(n||!t.isTextblock)break}for(let t=o.openStart;t>=0;t--){let l=(t+d+1)%(o.openStart+1),p=u[l];if(p)for(let t=0;t<a.length;t++){let u=a[(t+c)%a.length],d=!0;u<0&&(d=!1,u=-u);let h=i.node(u-1),f=i.index(u-1);if(h.canReplaceWith(f,f,p.type,p.marks))return e.replace(i.before(u),d?s.after(u):n,new r.Ji(P(o.content,0,o.openStart,l),l,o.openEnd))}}let p=e.steps.length;for(let r=a.length-1;r>=0&&(e.replace(t,n,o),!(e.steps.length>p));r--){let e=a[r];e<0||(t=i.before(e),n=s.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,o){if(!o.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,o.type);null!=r&&(t=n=r)}e.replaceRange(t,n,new r.Ji(r.FK.from(o),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=B(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:o,$to:i,depth:s}=t,a=o.before(s+1),l=i.after(s+1),c=a,u=l,d=r.FK.empty,p=0;for(let e=s,t=!1;e>n;e--)t||o.index(e)>0?(t=!0,d=r.FK.from(o.node(e).copy(d)),p++):c--;let h=r.FK.empty,f=0;for(let e=s,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,h=r.FK.from(i.node(e).copy(h)),f++):u++;e.step(new b(c,u,a,l,new r.Ji(d.append(h),p,f),d.size-p,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let o=new y(t-n,t+n,r.Ji.empty,!0);e.step(o)}(this,e,t),this}wrap(e,t){return function(e,t,n){let o=r.FK.empty;for(let e=n.length-1;e>=0;e--){if(o.size){let t=n[e].type.contentMatch.matchFragment(o);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=r.FK.from(n[e].type.create(n[e].attrs,o))}let i=t.start,s=t.end;e.step(new b(i,s,i,s,new r.Ji(o,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,o=null){return function(e,t,n,o,i){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(o,i)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(s).map(n),o)){e.clearIncompatible(e.mapping.slice(s).map(n,1),o);let a=e.mapping.slice(s),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new b(l,c,l+1,c-1,new r.Ji(r.FK.from(o.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,o),this}setNodeMarkup(e,t,n=null,o){return function(e,t,n,o,i){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(o,null,i||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new b(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new r.Ji(r.FK.from(a),0,0),1,!0))}(this,e,t,n,o),this}setNodeAttribute(e,t,n){return this.step(new _(e,t,n)),this}addNodeMark(e,t){return this.step(new m(e,t)),this}removeNodeMark(e,t){if(!(t instanceof r.CU)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new g(e,t)),this}split(e,t=1,n){return function(e,t,n=1,o){let i=e.doc.resolve(t),s=r.FK.empty,a=r.FK.empty;for(let e=i.depth,t=i.depth-n,l=n-1;e>t;e--,l--){s=r.FK.from(i.node(e).copy(s));let t=o&&o[l];a=r.FK.from(t?t.type.create(t.attrs,a):i.node(e).copy(a))}e.step(new y(t,t,new r.Ji(s.append(a),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(p)||(o&&o.to==c&&o.mark.eq(u[e])?o.to=d:s.push(o=new f(c,d,u[e])));i&&i.to==c?i.to=d:a.push(i=new h(c,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,o){let i=[],s=0;e.doc.nodesBetween(t,n,((e,a)=>{if(!e.isInline)return;s++;let l=null;if(o instanceof r.sX){let t,n=e.marks;for(;t=o.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else o?o.isInSet(e.marks)&&(l=[o]):l=e.marks;if(l&&l.length){let r=Math.min(a+e.nodeSize,n);for(let e=0;e<l.length;e++){let n,o=l[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==s-1&&o.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=s):i.push({style:o,from:Math.max(a,t),to:r,step:s})}}})),i.forEach((t=>e.step(new f(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,o=n.contentMatch){let i=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<i.childCount;t++){let l=i.child(t),c=a+l.nodeSize,u=o.matchType(l.type);if(u){o=u;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new f(a,c,l.marks[t]))}else s.push(new y(a,c,r.Ji.empty));a=c}if(!o.validEnd){let t=o.fillBefore(r.FK.empty,!0);e.replace(a,a,new r.Ji(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}(this,e,t,n),this}}},15186:(e,t,n)=>{"use strict";n.d(t,{C:()=>r});const r=function(e){if(null==e)return i;if("string"==typeof e)return t=e,o((function(e){return e&&e.type===t}));var t;if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=r(e[n]);return o((function(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}))}(e):function(e){return o((function(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}))}(e);if("function"==typeof e)return o(e);throw new Error("Expected function, string, or object as test")};function o(e){return function(t,...n){return Boolean(t&&"object"==typeof t&&"type"in t&&Boolean(e.call(this,t,...n)))}}function i(){return!0}},15939:(e,t,n)=>{"use strict";n.d(t,{K:()=>g,w:()=>m});for(var r={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:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),a="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),l=s||i&&+i[1]<57,c=0;c<10;c++)r[48+c]=r[96+c]=String(c);for(c=1;c<=24;c++)r[c+111]="F"+c;for(c=65;c<=90;c++)r[c]=String.fromCharCode(c+32),o[c]=String.fromCharCode(c);for(var u in r)o.hasOwnProperty(u)||(o[u]=r[u]);var d=n(81570);const p="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function h(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);p?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function f(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function m(e){return new d.k_({props:{handleKeyDown:g(e)}})}function g(e){let t=function(e){let t=Object.create(null);for(let n in e)t[h(n)]=e[n];return t}(e);return function(e,n){let i,s=function(e){var t=!(l&&(e.ctrlKey||e.altKey||e.metaKey)||a&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?o:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),c=t[f(s,n)];if(c&&c(e.state,e.dispatch,e))return!0;if(1==s.length&&" "!=s){if(n.shiftKey){let r=t[f(s,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||s.charCodeAt(0)>127)&&(i=r[n.keyCode])&&i!=s){let r=t[f(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}},16090:(e,t,n)=>{"use strict";function r(e){this.content=e}n.d(t,{S4:()=>Z,ZF:()=>ae,FK:()=>a,CU:()=>d,sX:()=>G,bP:()=>D,u$:()=>T,Z6:()=>K,vI:()=>p,Sj:()=>J,Ji:()=>h}),r.prototype={constructor:r,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var o=n&&n!=e?this.remove(n):this,i=o.find(e),s=o.content.slice();return-1==i?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new r(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var o=this.remove(t),i=o.content.slice(),s=o.find(e);return i.splice(-1==s?i.length:s,0,t,n),new r(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};const o=r;function i(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),s=t.child(r);if(o!=s){if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let e=0;o.text[e]==s.text[e];e++)n++;return n}if(o.content.size||s.content.size){let e=i(o.content,s.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function s(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let a=e.child(--o),l=t.child(--i),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let e=0,t=Math.min(a.text.length,l.text.length);for(;e<t&&a.text[a.text.length-e-1]==l.text[l.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let e=s(a.content,l.content,n-1,r-1);if(e)return e}n-=c,r-=c}else n-=c,r-=c}}class a{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let a=this.content[i],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,r+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(e,a)-a,t-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new a(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let s=this.content[o],a=i+s.nodeSize;a>e&&((i<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=a}return new a(n,r)}cutByIndex(e,t){return e==t?a.empty:0==e&&t==this.content.length?this:new a(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new a(r,o)}addToStart(e){return new a([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new a(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,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return i(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return s(this,e,t,n)}findIndex(e,t=-1){if(0==e)return c(0,e);if(e==this.size)return c(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?c(n+1,o):c(n,r);r=o}}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 a.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new a(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return a.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new a(t||e,n)}static from(e){if(!e)return a.empty;if(e instanceof a)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new a([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}a.empty=new a([],0);const l={index:0,offset:0};function c(e,t){return l.index=e,l.offset=t,l}function u(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!u(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!u(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class d{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||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&&u(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 n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return d.none;if(e instanceof d)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}d.none=[];class p extends Error{}class h{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=m(this.content,e+this.openStart,t);return n&&new h(n,this.openStart,this.openEnd)}removeBetween(e,t){return new h(f(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 h.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new h(a.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new h(e,n,r)}}function f(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(f(i.content,t-o-1,n-o-1)))}function m(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=m(s.content,t-i-1,n);return a&&e.replaceChild(o,s.copy(a))}function g(e,t,n){if(n.openStart>e.depth)throw new p("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new p("Inconsistent open depths");return y(e,t,n,0)}function y(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=y(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(a.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return x(i,S(e,o,s,t,r))}{let r=e.parent,o=r.content;return x(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return x(i,E(e,t,r))}function b(e,t){if(!t.type.compatibleContent(e.type))throw new p("Cannot join "+t.type.name+" onto "+e.type.name)}function k(e,t,n){let r=e.node(n);return b(r,t.node(n)),r}function w(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function v(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(w(e.nodeAfter,r),i++));for(let e=i;e<s;e++)w(o.child(e),r);t&&t.depth==n&&t.textOffset&&w(t.nodeBefore,r)}function x(e,t){return e.type.checkContent(t),e.copy(t)}function S(e,t,n,r,o){let i=e.depth>o&&k(e,t,o+1),s=r.depth>o&&k(n,r,o+1),l=[];return v(null,e,o,l),i&&s&&t.index(o)==n.index(o)?(b(i,s),w(x(i,S(e,t,n,r,o+1)),l)):(i&&w(x(i,E(e,t,o+1)),l),v(t,n,o,l),s&&w(x(s,E(n,r,o+1)),l)),v(r,null,o,l),new a(l)}function E(e,t,n){let r=[];return v(null,e,n,r),e.depth>n&&w(x(k(e,t,n+1),E(e,t,n+1)),r),v(t,null,n,r),new a(r)}h.empty=new h(a.empty,0,0);class C{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?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[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].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 n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}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):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return d.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(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 n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new T(this,e,n);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 n=[],r=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s)break;if(t=t.child(e),t.isText)break;o=s-1,r+=i+1}return new C(t,n,o)}static resolveCached(e,t){for(let n=0;n<A.length;n++){let r=A[n];if(r.pos==t&&r.doc==e)return r}let n=A[N]=C.resolve(e,t);return N=(N+1)%O,n}}let A=[],N=0,O=12;class T{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const M=Object.create(null);class D{constructor(e,t,n,r=d.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||a.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,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,n,r){return this.content.textBetween(e,t,n,r)}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,n){return this.type==e&&u(this.attrs,t||e.defaultAttrs||M)&&d.sameSet(this.marks,n||d.none)}copy(e=null){return e==this.content?this:new D(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new D(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return h.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new h(a,r.depth-i,o.depth-i)}replace(e,t,n){return g(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return C.resolveCached(this,e)}resolveNoCache(e){return C.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),R(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,n=a.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=d.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!d.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.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((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=a.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}D.prototype.text=void 0;class I extends D{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):R(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 I(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new I(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&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 R(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class F{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new L(e,t);if(null==n.next)return F.empty;let r=P(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);U(e,n).forEach((e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new F(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(j);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}(U(e,0))}(function(e){let t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(e(n,i))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(i,s),o(e(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(e(t.expr,i),s),o(e(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(i)].concat(e(t.expr,i));if("range"==t.type){let s=i;for(let r=0;r<t.min;r++){let r=n();o(e(t.expr,s),r),s=r}if(-1==t.max)o(e(t.expr,s),s);else for(let i=t.min;i<t.max;i++){let i=n();r(s,i),o(e(t.expr,s),i),s=i}return[r(s)]}if("name"==t.type)return[r(i,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=e(t.exprs[r],i);if(r==t.exprs.length-1)return s;o(s,i=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((e=>e.to=t))}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&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 n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let l=i.matchFragment(e,n);if(l&&(!t||l.validEnd))return a.from(s.map((e=>e.createAndFill())));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.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=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}F.empty=new F(!0);class L{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 P(e){let t=[];do{t.push(B(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function B(e){let t=[];do{t.push(_(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function _(e){let t=function(e){if(e.eat("(")){let t=P(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&o.push(r)}return 0==o.length&&e.err("No node type or group '"+t+"' found"),o}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=$(e,t)}return t}function z(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function $(e,t){let n=z(e),r=n;return e.eat(",")&&(r="}"!=e.next?z(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function j(e,t){return t-e}function U(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(j)}function H(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function V(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function W(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new q(e[n]);return t}class K{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=W(n.attrs),this.defaultAttrs=H(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==F.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:V(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new D(this,this.computeAttrs(e),a.from(t),d.setFrom(n))}createChecked(e=null,t,n){return t=a.from(t),this.checkContent(t),new D(this,this.computeAttrs(e),t,d.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=a.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(a.empty,!0);return o?new D(this,e,t.append(o),d.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:d.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new K(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class q{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class G{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=W(r.attrs),this.excluded=null;let o=H(this.attrs);this.instance=o?new d(this,o):null}create(e=null){return!e&&this.instance?this.instance:new d(this,V(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new G(e,r++,t,o))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class J{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=o.from(e.nodes),t.marks=o.from(e.marks||{}),this.nodes=K.compile(this.spec.nodes,this),this.marks=G.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",o=t.spec.marks;t.contentMatch=n[r]||(n[r]=F.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==o?null:o?Y(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Y(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof K))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new I(n,n.defaultAttrs,e,d.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return D.fromJSON(this,e)}markFromJSON(e){return d.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Y(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Z{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new re(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new re(this,t,!0);return n.addAll(e,t.from,t.to),h.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(oe(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ie(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ie(e)),e.node||e.ignore||e.mark||(e.node=t)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Z(e,Z.schemaRules(e)))}}const X={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},Q={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ee={ol:!0,ul:!0};function te(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class ne{constructor(e,t,n,r,o,i,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=d.none,this.stashMarks=[],this.match=i||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(a.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=a.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(a.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):se(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!X.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class re{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,o=t.topNode,i=te(null,t.preserveWhitespace,0)|(n?4:0);r=o?new ne(o.type,o.attrs,d.none,d.none,!0,t.topMatch||o.type.contentMatch,i):new ne(n?null:e.schema.topNodeType,null,d.none,d.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style");if(t){let n=this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t));if(!n)return;let[r,o]=n,i=this.top;for(let e=0;e<o.length;e++)this.removePendingMark(o[e],i);for(let e=0;e<r.length;e++)this.addPendingMark(r[e]);this.addElement(e);for(let e=0;e<r.length;e++)this.removePendingMark(r[e],i);for(let e=0;e<o.length;e++)this.addPendingMark(o[e])}else this.addElement(e)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],o=e.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();ee.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&ee.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:Q.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let t,n=this.top,i=this.needsBlock;if(X.hasOwnProperty(r))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=i}else this.addElementByRule(e,o,!1===o.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=d.none,n=d.none;for(let r=0;r<e.length;r+=2)for(let o;;){let i=this.parser.matchStyle(e[r],e[r+1],this,o);if(!i)break;if(i.ignore)return null;if(i.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach((e=>{i.clearMark(e)&&(n=e.addToSet(n))})):t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;o=i}return[t,n]}addElementByRule(e,t,n){let r,o,i;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):r=this.enter(o,t.attrs||null,t.preserveWhitespace)):(i=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(i));let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(e,t,n){let r=t||0;for(let o=t?e.childNodes[t]:e.firstChild,i=null==n?null:e.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let i=te(e,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new ne(e,t,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].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("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function oe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ie(e){let t={};for(let n in e)t[n]=e[n];return t}function se(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class ae{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=ce(t).createDocumentFragment());let r=n,o=[];return e.forEach((e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=ae.renderSpec(ce(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ae.renderSpec(ce(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,o=t[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?e.createElementNS(n,o):e.createElement(o),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let o=l;o<t.length;o++){let i=t[o];if(0===i){if(o<t.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=ae.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ae(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=le(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return le(e.marks)}}function le(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ce(e){return e.document||window.document}},16486:(e,t,n)=>{"use strict";n.d(t,{Se:()=>u,wu:()=>l});var r=n(27647),o=n(81570),i=n(73686),s=n(16512),a=n(1440);const l=(0,s.Qx)({uploader:async(e,t)=>{const n=[];for(let t=0;t<e.length;t++){const r=e.item(t);!r||!r.type.includes("image")||n.push(r)}const{image:r}=t.nodes;if(!r)throw(0,a.pj)("image");return(await Promise.all(n.map((e=>(e=>new Promise((t=>{const n=new FileReader;n.addEventListener("load",(()=>{t({alt:e.name,src:n.result})}),!1),n.readAsDataURL(e)})))(e))))).map((({alt:e,src:t})=>r.createAndFill({src:t,alt:e})))},enableHtmlFileUploader:!1,uploadWidgetFactory:(e,t)=>{const n=document.createElement("span");return n.textContent="Upload in progress...",i.NZ.widget(e,n,t)}},"uploadConfig");l.meta={package:"@milkdown/plugin-upload",displayName:"Ctx<uploadConfig>"};const c=(0,s.Gf)((e=>{const t=new o.hs("MILKDOWN_UPLOAD"),n=(n,o,i)=>{var s;if(!i||i.length<=0)return!1;const a=Symbol("upload symbol"),c=e.get(r.pZ),{tr:u}=n.state,d=o instanceof DragEvent?(null==(s=n.posAtCoords({left:o.clientX,top:o.clientY}))?void 0:s.pos)??u.selection.from:u.selection.from;n.dispatch(u.setMeta(t,{add:{id:a,pos:d}}));const{uploader:p}=e.get(l.key);return p(i,c).then((e=>{const r=((e,n)=>{var r;const o=t.getState(e);if(!o)return-1;const i=o.find(void 0,void 0,(e=>e.id===n));return i.length?(null==(r=i[0])?void 0:r.from)??-1:-1})(n.state,a);r<0||n.dispatch(n.state.tr.replaceWith(r,r,e).setMeta(t,{remove:{id:a}}))})).catch((e=>{console.error(e)})),!0};return new o.k_({key:t,state:{init:()=>i.zF.empty,apply(t,n){const r=n.map(t.mapping,t.doc),o=t.getMeta(this);if(!o)return r;if(o.add){const{uploadWidgetFactory:n}=e.get(l.key),i=n(o.add.pos,{id:o.add.id});return r.add(t.doc,[i])}if(o.remove){const e=r.find(void 0,void 0,(e=>e.id===o.remove.id));return r.remove(e)}return r}},props:{decorations(e){return this.getState(e)},handlePaste:(t,r)=>{var o,i;const{enableHtmlFileUploader:s}=e.get(l.key);return!(!(r instanceof ClipboardEvent)||!s&&(null==(o=r.clipboardData)?void 0:o.getData("text/html")))&&n(t,r,null==(i=r.clipboardData)?void 0:i.files)},handleDrop:(e,t)=>{var r;return t instanceof DragEvent&&n(e,t,null==(r=t.dataTransfer)?void 0:r.files)}}})}));c.meta={package:"@milkdown/plugin-upload",displayName:"Prose<upload>"};const u=[l,c]},16512:(e,t,n)=>{"use strict";n.d(t,{Fs:()=>C,Gf:()=>h,Ht:()=>m,JY:()=>x,KD:()=>S,Qx:()=>y,YR:()=>v,Yh:()=>b,b_:()=>d,dz:()=>p,hk:()=>k,lz:()=>f,m5:()=>g,pq:()=>w,yh:()=>E,yu:()=>u});var r=n(27647),o=n(67488),i=n(99742),s=n(1440),a=n(15939),l=n(16090),c=n(81570);(0,i.d_)("abcedfghicklmn",10);const u=(e,t)=>{const n=(0,r.qf)(e),o=i=>async()=>{o.key=n,await i.wait(r.x8);const s=t(i);return i.get(r.MD).create(n,s),o.run=t=>i.get(r.MD).call(e,t),()=>{i.get(r.MD).remove(n)}};return o},d=e=>{const t=n=>async()=>{await n.wait(r.x8);const o=e(n);return n.update(r.f4,(e=>[...e,o])),t.inputRule=o,()=>{n.update(r.f4,(e=>e.filter((e=>e!==o))))}};return t},p=(e,t)=>{let n;const o=i=>async()=>{const a=t(i);if(i.update(r.P_,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),o.id=e,o.schema=a,await i.wait(r.x8),n=i.get(r.pZ).nodes[e],!n)throw(0,s.pj)(e);return()=>{i.update(r.P_,(t=>t.filter((([t])=>t!==e))))}};return o.type=()=>n,o},h=e=>{let t;const n=n=>async()=>(await n.wait(r.x8),t=e(n),n.update(r.TP,(e=>[...e,t])),()=>{n.update(r.TP,(e=>e.filter((e=>e!==t))))});return n.plugin=()=>t,n.key=()=>t.spec.key,n},f=e=>{const t=n=>async()=>{await n.wait(r.ge);const o=e(n);return n.update(r.eM,(e=>[...e,o])),t.plugin=o,()=>{n.update(r.eM,(e=>e.filter((e=>e!==o))))}};return t},m=e=>{const t=n=>async()=>{await n.wait(r.x8);const o=e(n),i=(0,a.w)(o);return n.update(r.TP,(e=>[...e,i])),t.keymap=o,()=>{n.update(r.TP,(e=>e.filter((e=>e!==i))))}};return t},g=(e,t)=>{const n=o=>async()=>{await o.wait(r.x8);const i=t(o);return e.type()instanceof l.Z6?o.update(r.pe,(t=>[...t,[e.id,i]])):o.update(r.aD,(t=>[...t,[e.id,i]])),n.view=i,n.type=e,()=>{e.type()instanceof l.Z6?o.update(r.pe,(t=>t.filter((t=>t[0]!==e.id)))):o.update(r.aD,(t=>t.filter((t=>t[0]!==e.id))))}};return n},y=(e,t)=>{const n=(0,o.Z0)(e,t),r=e=>(e.inject(n),()=>()=>{e.remove(n)});return r.key=n,r},b=(e,t)=>{const n=y(t,e),o=p(e,(e=>e.get(n.key)(e))),i=[n,o];return i.id=o.id,i.node=o,i.type=o.type,i.schema=o.schema,i.ctx=n,i.key=n.key,i.extendSchema=t=>o=>()=>{const s=o.get(n.key),a=t(s)(o);o.update(r.P_,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),i.schema=a},i},k=(e,t)=>{const n=y(t,e),o=((e,t)=>{let n;const o=i=>async()=>{const a=t(i);if(i.update(r.u7,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),o.id=e,o.schema=a,await i.wait(r.x8),n=i.get(r.pZ).marks[e],!n)throw(0,s.sm)(e);return()=>{i.update(r.u7,(t=>t.filter((([t])=>t!==e))))}};return o.type=()=>n,o})(e,(e=>e.get(n.key)(e))),i=[n,o];return i.id=o.id,i.mark=o,i.type=o.type,i.schema=o.schema,i.ctx=n,i.key=n.key,i.extendSchema=t=>o=>()=>{const s=o.get(n.key),a=t(s)(o);o.update(r.u7,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),i.schema=a},i},w=(e,t)=>{const n=Object.fromEntries(Object.entries(t).map((([e,{shortcuts:t}])=>[e,t]))),r=y(n,`${e}Keymap`),o=m((e=>{const n=e.get(r.key),o=Object.entries(t).flatMap((([t,{command:r}])=>[n[t]].flat().map((t=>[t,r(e)]))));return Object.fromEntries(o)})),i=[r,o];return i.ctx=r,i.shortcuts=o,i.key=r.key,i.keymap=o.keymap,i},v=(e,t=()=>({}))=>y(t,`${e}Attr`),x=(e,t=()=>({}))=>y(t,`${e}Attr`);function S(e,t){return n=>n.get(r.MD).call(e,t)}const E=(e,t=!1)=>n=>{const o=n.get(r.kY),i=n.get(r.bQ)(e);if(!i)return;if(!t){const{state:e}=o;return o.dispatch(e.tr.replace(0,e.doc.content.size,new l.Ji(i.content,0,0)))}const s=n.get(r.pZ),a=n.get(r.Sr),u=n.get(r.TP),d=c.$t.create({schema:s,doc:i,plugins:u,...a});o.updateState(d)},C=(...e)=>{const t=e.length;let n=t;for(;n--;)if("function"!=typeof e[n])throw new TypeError("Expected a function");return(...n)=>{let r=0,o=t?e[r](...n):n[0];for(;++r<t;)o=e[r](o);return o}}},17884:(e,t,n)=>{"use strict";n.d(t,{CW:()=>r,lV:()=>s,cx:()=>l,JQ:()=>c,BM:()=>o,ok:()=>i,ol:()=>a,HP:()=>d,Ee:()=>u,On:()=>p,es:()=>f,Ny:()=>h});const r=m(/[A-Za-z]/),o=m(/\d/),i=m(/[\dA-Fa-f]/),s=m(/[\dA-Za-z]/),a=m(/[!-/:-@[-`{-~]/),l=m(/[#-'*+\--9=?A-Z^-~]/);function c(e){return null!==e&&(e<32||127===e)}function u(e){return null!==e&&(e<0||32===e)}function d(e){return null!==e&&e<-2}function p(e){return-2===e||-1===e||32===e}const h=m(/\s/),f=m(/[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/);function m(e){return function(t){return null!==t&&e.test(String.fromCharCode(t))}}},20062:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},23796:(e,t,n)=>{"use strict";function r(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}n.d(t,{W:()=>r})},24586:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(11369);function o(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},25715:(e,t,n)=>{"use strict";n.d(t,{Im:()=>g,RV:()=>E,wh:()=>b,y_:()=>y});var r=n(11329),o=n(16090),i=n(81570);const s=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function a(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function l(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function c(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function u(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var d;function p(e,t,n){let s,l,c=t.nodeBefore,u=t.nodeAfter;if(c.type.spec.isolating||u.type.spec.isolating)return!1;if(function(e,t,n){let o=t.nodeBefore,i=t.nodeAfter,s=t.index();return!(!(o&&i&&o.type.compatibleContent(i.type))||(!o.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(s,s+1)||!i.isTextblock&&!(0,r.n9)(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,o.type,o.contentMatchAt(o.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let d=t.parent.canReplace(t.index(),t.index()+1);if(d&&(s=(l=c.contentMatchAt(c.childCount)).findWrapping(u.type))&&l.matchType(s[0]||u.type).validEnd){if(n){let i=t.pos+u.nodeSize,a=o.FK.empty;for(let e=s.length-1;e>=0;e--)a=o.FK.from(s[e].create(null,a));a=o.FK.from(c.copy(a));let l=e.tr.step(new r.Wg(t.pos-1,i,t.pos,i,new o.Ji(a,1,0),s.length,!0)),d=i+2*s.length;(0,r.n9)(l.doc,d)&&l.join(d),n(l.scrollIntoView())}return!0}let p=i.LN.findFrom(t,1),h=p&&p.$from.blockRange(p.$to),f=h&&(0,r.jP)(h);if(null!=f&&f>=t.depth)return n&&n(e.tr.lift(h,f).scrollIntoView()),!0;if(d&&a(u,"start",!0)&&a(c,"end")){let i=c,s=[];for(;s.push(i),!i.isTextblock;)i=i.lastChild;let a=u,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(i.canReplace(i.childCount,i.childCount,a.content)){if(n){let i=o.FK.empty;for(let e=s.length-1;e>=0;e--)i=o.FK.from(s[e].copy(i));n(e.tr.step(new r.Wg(t.pos-s.length,t.pos+u.nodeSize,t.pos+l,t.pos+u.nodeSize-l,new o.Ji(i,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function h(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return!!o.node(s).isTextblock&&(n&&n(t.tr.setSelection(i.U3.create(t.doc,e<0?o.start(s):o.end(s)))),!0)}}const f=h(-1),m=h(1);function g(e,t=null){return function(n,o){let{$from:i,$to:s}=n.selection,a=i.blockRange(s),l=a&&(0,r.oM)(a,e,t);return!!l&&(o&&o(n.tr.wrap(a,l).scrollIntoView()),!0)}}function y(e,t=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,e,t)}r(o.scrollIntoView())}return!0}}function b(e,t=null){return function(n,r){let{empty:o,$cursor:i,ranges:s}=n.selection;if(o&&!i||!function(e,t,n){for(let r=0;r<t.length;r++){let{$from:o,$to:i}=t[r],s=0==o.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(o.pos,i.pos,(e=>{if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,e))return!1;if(r)if(i)e.isInSet(n.storedMarks||i.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let o=!1,i=n.tr;for(let t=0;!o&&t<s.length;t++){let{$from:r,$to:i}=s[t];o=n.doc.rangeHasMark(r.pos,i.pos,e)}for(let n=0;n<s.length;n++){let{$from:r,$to:a}=s[n];if(o)i.removeMark(r.pos,a.pos,e);else{let n=r.pos,o=a.pos,s=r.nodeAfter,l=a.nodeBefore,c=s&&s.isText?/^\s*/.exec(s.text)[0].length:0,u=l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+c<o&&(n+=c,o-=u),i.addMark(n,o,e.create(t))}}r(i.scrollIntoView())}return!0}}function k(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let w=k(s,((e,t,n)=>{let s=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!s)return!1;let c=l(s);if(!c){let n=s.blockRange(),o=n&&(0,r.jP)(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let u=c.nodeBefore;if(!u.type.spec.isolating&&p(e,c,t))return!0;if(0==s.parent.content.size&&(a(u,"end")||i.nh.isSelectable(u))){let n=(0,r.$L)(e.doc,s.before(),s.after(),o.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(a(u,"end")?i.LN.findFrom(r.doc.resolve(r.mapping.map(c.pos,-1)),-1):i.nh.create(r.doc,c.pos-u.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!u.isAtom||c.depth!=s.depth-1||(t&&t(e.tr.delete(c.pos-u.nodeSize,c.pos).scrollIntoView()),0))}),((e,t,n)=>{let{$head:r,empty:o}=e.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=l(r)}let a=s&&s.nodeBefore;return!(!a||!i.nh.isSelectable(a)||(t&&t(e.tr.setSelection(i.nh.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),0))})),v=k(s,((e,t,n)=>{let s=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}(e,n);if(!s)return!1;let l=c(s);if(!l)return!1;let u=l.nodeAfter;if(p(e,l,t))return!0;if(0==s.parent.content.size&&(a(u,"start")||i.nh.isSelectable(u))){let n=(0,r.$L)(e.doc,s.before(),s.after(),o.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(a(u,"start")?i.LN.findFrom(r.doc.resolve(r.mapping.map(l.pos)),1):i.nh.create(r.doc,r.mapping.map(l.pos))),t(r.scrollIntoView())}return!0}}return!(!u.isAtom||l.depth!=s.depth-1||(t&&t(e.tr.delete(l.pos,l.pos+u.nodeSize).scrollIntoView()),0))}),((e,t,n)=>{let{$head:r,empty:o}=e.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=c(r)}let a=s&&s.nodeAfter;return!(!a||!i.nh.isSelectable(a)||(t&&t(e.tr.setSelection(i.nh.create(e.doc,s.pos)).scrollIntoView()),0))}));const x={Enter:k(((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))}),((e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof i.i5||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=u(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=e.tr.insert(n,s.createAndFill());a.setSelection(i.U3.create(a.doc,n+1)),t(a.scrollIntoView())}return!0}),((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if((0,r.zy)(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let o=n.blockRange(),i=o&&(0,r.jP)(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)}),((e,t)=>{let{$from:n,$to:o}=e.selection;if(e.selection instanceof i.nh&&e.selection.node.isBlock)return!(!n.parentOffset||!(0,r.zy)(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(t){let s=o.parentOffset==o.parent.content.size,a=e.tr;(e.selection instanceof i.U3||e.selection instanceof i.i5)&&a.deleteSelection();let l=0==n.depth?null:u(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=d?[d]:s&&l?[{type:l}]:void 0,p=(0,r.zy)(a.doc,a.mapping.map(n.pos),1,c);if(c||p||!(0,r.zy)(a.doc,a.mapping.map(n.pos),1,l?[{type:l}]:void 0)||(l&&(c=[{type:l}]),p=!0),p&&(a.split(a.mapping.map(n.pos),1,c),!s&&!n.parentOffset&&n.parent.type!=l)){let e=a.mapping.map(n.before()),t=a.doc.resolve(e);l&&n.node(-1).canReplaceWith(t.index(),t.index()+1,l)&&a.setNodeMarkup(a.mapping.map(n.before()),l)}t(a.scrollIntoView())}return!0})),"Mod-Enter":(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),a=u(o.contentMatchAt(s));if(!a||!o.canReplaceWith(s,s,a))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,a.createAndFill());o.setSelection(i.LN.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},Backspace:w,"Mod-Backspace":w,"Shift-Backspace":w,Delete:v,"Mod-Delete":v,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new i.i5(e.doc))),!0)},S={"Ctrl-h":x.Backspace,"Alt-Backspace":x["Mod-Backspace"],"Ctrl-d":x.Delete,"Ctrl-Alt-Backspace":x["Mod-Delete"],"Alt-Delete":x["Mod-Delete"],"Alt-d":x["Mod-Delete"],"Ctrl-a":f,"Ctrl-e":m};for(let e in x)S[e]=x[e];const E=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&"darwin"==os.platform())?S:x},26243:(e,t,n)=>{"use strict";function r(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}n.d(t,{B:()=>r})},27647:(e,t,n)=>{"use strict";n.d(t,{KE:()=>fo,CU:()=>Lr,ge:()=>nr,x8:()=>hr,g3:()=>Er,MD:()=>qr,qf:()=>Kr,CI:()=>Or,Sr:()=>Mr,kY:()=>Pr,QM:()=>_r,f4:()=>ir,aD:()=>cr,u7:()=>yr,pe:()=>lr,P_:()=>gr,bQ:()=>vr,TP:()=>sr,eM:()=>ar,k:()=>zr,pZ:()=>mr,M:()=>Ar});var r={};n.r(r),n.d(r,{attentionMarkers:()=>Ee,contentInitial:()=>be,disable:()=>Ce,document:()=>ye,flow:()=>we,flowInitial:()=>ke,insideSpan:()=>Se,string:()=>ve,text:()=>xe});var o=n(67488),i=n(16090);const s={};function a(e,t){const n=t||s;return l(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function l(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return c(e.children,t,n)}return Array.isArray(e)?c(e,t,n):""}function c(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=l(e[o],t,n);return r.join("")}var u=n(10660),d=n(77508),p=n(17884);const h={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,(function(n){if(null!==n)return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),(0,d.N)(e,t,"linePrefix");e.consume(n)}),(function(t){return e.enter("paragraph"),r(t)}));let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):(0,p.HP)(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};var f=n(43890);const m={tokenize:function(e){const t=this,n=[];let r,o,i,s=0;return a;function a(r){if(s<n.length){const o=n[s];return t.containerState=o[1],e.attempt(o[0].continuation,l,c)(r)}return c(r)}function l(e){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}w(s);let a=n;for(;a<t.events.length;)t.events[a][1].end=Object.assign({},o),a++;return(0,f.m)(t.events,i+1,0,t.events.slice(n)),t.events.length=a,c(e)}return a(e)}function c(o){if(s===n.length){if(!r)return h(o);if(r.currentConstruct&&r.currentConstruct.concrete)return y(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(g,u,d)(o)}function u(e){return r&&v(),w(s),h(e)}function d(e){return t.parser.lazy[t.now().line]=s!==n.length,i=t.now().offset,y(e)}function h(n){return t.containerState={},e.attempt(g,m,y)(n)}function m(e){return s++,n.push([t.currentConstruct,t.containerState]),h(e)}function y(n){return null===n?(r&&v(),w(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:r}),b(n))}function b(n){return null===n?(k(e.exit("chunkFlow"),!0),w(0),void e.consume(n)):(0,p.HP)(n)?(e.consume(n),k(e.exit("chunkFlow")),s=0,t.interrupt=void 0,a):(e.consume(n),b)}function k(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(a),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,a,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){a=t.events[l][1].end;break}o=!0}for(w(s),e=n;e<t.events.length;)t.events[e][1].end=Object.assign({},a),e++;(0,f.m)(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function w(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},g={tokenize:function(e,t,n){return(0,d.N)(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};var y=n(35460);function b(e){const t={};let n,r,o,i,s,a,l,c=-1;for(;++c<e.length;){for(;c in t;)c=t[c];if(n=e[c],c&&"chunkFlow"===n[1].type&&"listItemPrefix"===e[c-1][1].type&&(a=n[1]._tokenizer.events,o=0,o<a.length&&"lineEndingBlank"===a[o][1].type&&(o+=2),o<a.length&&"content"===a[o][1].type))for(;++o<a.length&&"content"!==a[o][1].type;)"chunkText"===a[o][1].type&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,k(e,c)),c=t[c],l=!0);else if(n[1]._container){for(o=c,r=void 0;o--&&(i=e[o],"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type);)"enter"===i[0]&&(r&&(e[r][1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);r&&(n[1].end=Object.assign({},e[r][1].start),s=e.slice(r,c),s.unshift(n),(0,f.m)(e,r,c-r+1,s))}}return!l}function k(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,d,p=-1,h=n,m=0,g=0;const y=[g];for(;h;){for(;e[++o][1]!==h;);i.push(o),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<a.length;)"exit"===a[p][0]&&"enter"===a[p-1][0]&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(g=p+1,y.push(g),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):y.pop(),p=y.length;p--;){const t=a.slice(y[p],y[p+1]),n=i.pop();l.unshift([n,n+t.length-1]),(0,f.m)(e,n,2,t)}for(p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const w={tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):(0,p.HP)(t)?e.check(v,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}},resolve:function(e){return b(e),e}},v={tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),(0,d.N)(e,o,"linePrefix")};function o(o){if(null===o||(0,p.HP)(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}},partial:!0},x={tokenize:function(e){const t=this,n=e.attempt(y.B,(function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(r)}),e.attempt(this.parser.constructs.flowInitial,r,(0,d.N)(e,e.attempt(this.parser.constructs.flow,r,e.attempt(w,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}},S={resolveAll:N()},E=A("string"),C=A("text");function A(e){return{tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,s);return i;function i(e){return l(e)?o(e):s(e)}function s(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),a)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}},resolveAll:N("text"===e?O:void 0)}}function N(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function O(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,s=o.length,a=-1,l=0;for(;s--;){const e=o[s];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)l++,a--;if(a)break;a=-1}else if(-2===e)i=!0,l++;else if(-1!==e){s++;break}}if(l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-l,offset:r.end.offset-l,_index:r.start._index+s,_bufferIndex:s?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},o.start),r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}var T=n(23796);function M(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},i=[];let s=[],a=[],l=!0;const c={consume:function(e){(0,p.HP)(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,v()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e,l=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=g(),u.events.push(["enter",n,u]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=g(),u.events.push(["exit",t,u]),t},attempt:k((function(e,t){w(e,t.from)})),check:k(b),interrupt:k(b,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if("string"==typeof i)s=i;else switch(i){case-5:s="\r";break;case-4:s="\n";break;case-3:s="\r\n";break;case-2:s=t?" ":"\t";break;case-1:if(!t&&o)continue;s=" ";break;default:s=String.fromCharCode(i)}o=-2===i,r.push(s)}return r.join("")}(m(e),t)},now:g,defineSkip:function(e){o[e.line]=e.column,v()},write:function(e){return s=(0,f.V)(s,e),function(){let e;for(;r._index<s.length;){const t=s[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)y(t.charCodeAt(r._bufferIndex));else y(t)}}(),null!==s[s.length-1]?[]:(w(t,0),u.events=(0,T.W)(i,u.events,u),u.events)}};let d,h=t.tokenize.call(u,c);return t.resolveAll&&i.push(t),u;function m(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;return n===o?s=[e[n].slice(r,i)]:(s=e.slice(n,o),r>-1&&(s[0]=s[0].slice(r)),i>0&&s.push(e[o].slice(0,i))),s}(s,e)}function g(){return Object.assign({},r)}function y(e){l=void 0,d=e,h=h(e)}function b(e,t){t.restore()}function k(e,t){return function(n,o,i){let s,d,p,h;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return function(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return s=e,d=0,0===e.length?i:m(e[d])}function m(e){return function(n){return h=function(){const e=g(),t=u.previous,n=u.currentConstruct,o=u.events.length,i=Array.from(a);return{restore:function(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=o,a=i,v()},from:o}}(),p=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?b():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,y,b)(n)}}function y(t){return l=!0,e(p,h),o}function b(e){return l=!0,h.restore(),++d<s.length?m(s[d]):i}}}function w(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&(0,f.m)(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function v(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const D={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),s(i)):o>=3&&(null===i||(0,p.HP)(i))?(e.exit("thematicBreak"),t(i)):n(i)}function s(t){return t===r?(e.consume(t),o++,s):(e.exit("thematicBreakSequence"),(0,p.On)(t)?(0,d.N)(e,i,"whitespace")(t):i(t))}}},I={name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,s=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:(0,p.BM)(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(D,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return(0,p.BM)(t)&&++s<10?(e.consume(t),a):(!r.interrupt||s<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(y.B,r.interrupt?n:c,e.attempt(R,d,u))}function c(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function u(t){return(0,p.On)(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(y.B,(function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,(0,d.N)(e,t,"listItemIndent",r.containerState.size+1)(n)}),(function(n){return r.containerState.furtherBlankLines||!(0,p.On)(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(F,t,o)(n))}));function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,(0,d.N)(e,e.attempt(I,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)}},R={tokenize:function(e,t,n){const r=this;return(0,d.N)(e,(function(e){const o=r.events[r.events.length-1];return!(0,p.On)(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},F={tokenize:function(e,t,n){const r=this;return(0,d.N)(e,(function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0},L={name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return(0,p.On)(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){const r=this;return function(t){return(0,p.On)(t)?(0,d.N)(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(L,t,n)(r)}}},exit:function(e){e.exit("blockQuote")}};function P(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d):null===t||41===t||(0,p.JQ)(t)?n(t):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(n))}function h(t){return 62===t?(e.exit("chunkString"),e.exit(a),d(t)):null===t||60===t||(0,p.HP)(t)?n(t):(e.consume(t),92===t?f:h)}function f(t){return 60===t||62===t||92===t?(e.consume(t),h):h(t)}function m(o){return 40===o?++u>c?n(o):(e.consume(o),m):41===o?u--?(e.consume(o),m):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(o)):null===o||(0,p.Ee)(o)?u?n(o):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(o)):(0,p.JQ)(o)?n(o):(e.consume(o),92===o?g:m)}function g(t){return 40===t||41===t||92===t?(e.consume(t),m):m(t)}}function B(e,t,n,r,o,i){const s=this;let a,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),c};function c(d){return null===d||91===d||93===d&&!a||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs||l>999?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):(0,p.HP)(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||(0,p.HP)(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a=a||!(0,p.On)(t),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function _(e,t,n,r,o,i){let s;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),s=40===t?41:t,a};function a(n){return n===s?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===s?(e.exit(i),a(s)):null===t?n(t):(0,p.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),(0,d.N)(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===s||null===t||(0,p.HP)(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===s||92===t?(e.consume(t),c):c(t)}}function z(e,t){let n;return function r(o){return(0,p.HP)(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):(0,p.On)(o)?(0,d.N)(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}var $=n(26243);const j={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return B.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=(0,$.B)(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s):n(t)}function s(t){return(0,p.Ee)(t)?z(e,a)(t):a(t)}function a(t){return P(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(U,c,c)(t)}function c(t){return(0,p.On)(t)?(0,d.N)(e,u,"whitespace")(t):u(t)}function u(i){return null===i||(0,p.HP)(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},U={tokenize:function(e,t,n){return function(t){return(0,p.Ee)(t)?z(e,r)(t):n(t)};function r(t){return _(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return(0,p.On)(t)?(0,d.N)(e,i,"whitespace")(t):i(t)}function i(e){return null===e||(0,p.HP)(e)?t(e):n(e)}},partial:!0},H={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),(0,d.N)(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?a(t):(0,p.HP)(t)?e.attempt(V,i,a)(t):(e.enter("codeFlowValue"),s(t))}function s(t){return null===t||(0,p.HP)(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),s)}function a(n){return e.exit("codeIndented"),t(n)}}},V={tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):(0,p.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):(0,d.N)(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):(0,p.HP)(e)?o(e):n(e)}},partial:!0},W={name:"headingAtx",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||(0,p.Ee)(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),s(n)):null===n||(0,p.HP)(n)?(e.exit("atxHeading"),t(n)):(0,p.On)(n)?(0,d.N)(e,i,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function s(t){return 35===t?(e.consume(t),s):(e.exit("atxHeadingSequence"),i(t))}function a(t){return null===t||35===t||(0,p.Ee)(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),a)}},resolve:function(e,t){let n,r,o=e.length-2,i=3;return"whitespace"===e[i][1].type&&(i+=2),o-2>i&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4),o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},(0,f.m)(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e}},K={name:"setextUnderline",tokenize:function(e,t,n){const r=this;let o;return function(t){let s,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){s="paragraph"===r.events[a][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!s?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t))};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),(0,p.On)(t)?(0,d.N)(e,s,"lineSuffix")(t):s(t))}function s(r){return null===r||(0,p.HP)(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const s={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",s,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[o][1].end)):e[n][1]=s,e.push(["exit",s,t]),e}},q=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],G=["pre","script","style","textarea"],J={name:"htmlFlow",tokenize:function(e,t,n){const r=this;let o,i,s,a,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),i=!0,f):63===a?(e.consume(a),o=3,r.interrupt?t:L):(0,p.CW)(a)?(e.consume(a),s=String.fromCharCode(a),m):n(a)}function u(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,a=0,h):(0,p.CW)(i)?(e.consume(i),o=4,r.interrupt?t:L):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:L):n(o)}function h(o){return o==="CDATA[".charCodeAt(a++)?(e.consume(o),6===a?r.interrupt?t:N:h):n(o)}function f(t){return(0,p.CW)(t)?(e.consume(t),s=String.fromCharCode(t),m):n(t)}function m(a){if(null===a||47===a||62===a||(0,p.Ee)(a)){const l=47===a,c=s.toLowerCase();return l||i||!G.includes(c)?q.includes(s.toLowerCase())?(o=6,l?(e.consume(a),g):r.interrupt?t(a):N(a)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):i?y(a):b(a)):(o=1,r.interrupt?t(a):N(a))}return 45===a||(0,p.lV)(a)?(e.consume(a),s+=String.fromCharCode(a),m):n(a)}function g(o){return 62===o?(e.consume(o),r.interrupt?t:N):n(o)}function y(t){return(0,p.On)(t)?(e.consume(t),y):C(t)}function b(t){return 47===t?(e.consume(t),C):58===t||95===t||(0,p.CW)(t)?(e.consume(t),k):(0,p.On)(t)?(e.consume(t),b):C(t)}function k(t){return 45===t||46===t||58===t||95===t||(0,p.lV)(t)?(e.consume(t),k):w(t)}function w(t){return 61===t?(e.consume(t),v):(0,p.On)(t)?(e.consume(t),w):b(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,x):(0,p.On)(t)?(e.consume(t),v):S(t)}function x(t){return t===l?(e.consume(t),l=null,E):null===t||(0,p.HP)(t)?n(t):(e.consume(t),x)}function S(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||(0,p.Ee)(t)?w(t):(e.consume(t),S)}function E(e){return 47===e||62===e||(0,p.On)(e)?b(e):n(e)}function C(t){return 62===t?(e.consume(t),A):n(t)}function A(t){return null===t||(0,p.HP)(t)?N(t):(0,p.On)(t)?(e.consume(t),A):n(t)}function N(t){return 45===t&&2===o?(e.consume(t),D):60===t&&1===o?(e.consume(t),I):62===t&&4===o?(e.consume(t),P):63===t&&3===o?(e.consume(t),L):93===t&&5===o?(e.consume(t),F):!(0,p.HP)(t)||6!==o&&7!==o?null===t||(0,p.HP)(t)?(e.exit("htmlFlowData"),O(t)):(e.consume(t),N):(e.exit("htmlFlowData"),e.check(Y,B,O)(t))}function O(t){return e.check(Z,T,B)(t)}function T(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return null===t||(0,p.HP)(t)?O(t):(e.enter("htmlFlowData"),N(t))}function D(t){return 45===t?(e.consume(t),L):N(t)}function I(t){return 47===t?(e.consume(t),s="",R):N(t)}function R(t){if(62===t){const n=s.toLowerCase();return G.includes(n)?(e.consume(t),P):N(t)}return(0,p.CW)(t)&&s.length<8?(e.consume(t),s+=String.fromCharCode(t),R):N(t)}function F(t){return 93===t?(e.consume(t),L):N(t)}function L(t){return 62===t?(e.consume(t),P):45===t&&2===o?(e.consume(t),L):N(t)}function P(t){return null===t||(0,p.HP)(t)?(e.exit("htmlFlowData"),B(t)):(e.consume(t),P)}function B(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},concrete:!0},Y={tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(y.B,t,n)}},partial:!0},Z={tokenize:function(e,t,n){const r=this;return function(t){return(0,p.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},X={tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},Q={name:"codeFenced",tokenize:function(e,t,n){const r=this,o={tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s};function s(t){return e.enter("codeFencedFence"),(0,p.On)(t)?(0,d.N)(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=a?(e.exit("codeFencedFenceSequence"),(0,p.On)(t)?(0,d.N)(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||(0,p.HP)(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0};let i,s=0,a=0;return function(t){return function(t){const n=r.events[r.events.length-1];return s=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(a++,e.consume(t),l):a<3?n(t):(e.exit("codeFencedFenceSequence"),(0,p.On)(t)?(0,d.N)(e,c,"whitespace")(t):c(t))}function c(n){return null===n||(0,p.HP)(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(X,m,w)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||(0,p.HP)(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):(0,p.On)(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),(0,d.N)(e,h,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),u)}function h(t){return null===t||(0,p.HP)(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||(0,p.HP)(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===i?n(t):(e.consume(t),f)}function m(t){return e.attempt(o,w,g)(t)}function g(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),y}function y(t){return s>0&&(0,p.On)(t)?(0,d.N)(e,b,"linePrefix",s+1)(t):b(t)}function b(t){return null===t||(0,p.HP)(t)?e.check(X,m,w)(t):(e.enter("codeFlowValue"),k(t))}function k(t){return null===t||(0,p.HP)(t)?(e.exit("codeFlowValue"),b(t)):(e.consume(t),k)}function w(n){return e.exit("codeFenced"),t(n)}},concrete:!0};var ee=n(51157);const te={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=p.lV,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=p.ok,c):(e.enter("characterReferenceValue"),o=7,i=p.BM,c(t))}function c(a){if(59===a&&s){const o=e.exit("characterReferenceValue");return i!==p.lV||(0,ee.s)(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return i(a)&&s++<o?(e.consume(a),c):n(a)}}},ne={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return(0,p.ol)(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},re={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),(0,d.N)(e,t,"linePrefix")}}},oe={name:"labelEnd",tokenize:function(e,t,n){const r=this;let o,i,s=r.events.length;for(;s--;)if(("labelImage"===r.events[s][1].type||"labelLink"===r.events[s][1].type)&&!r.events[s][1]._balanced){o=r.events[s][1];break}return function(t){return o?o._inactive?u(t):(i=r.parser.defined.includes((0,$.B)(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(ie,c,i?c:u)(t):91===t?e.attempt(se,c,i?l:u)(t):i?c(t):u(t)}function l(t){return e.attempt(ae,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}},resolveTo:function(e,t){let n,r,o,i,s=e.length,a=0;for(;s--;)if(n=e[s][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[s][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[s][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=s,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(o=s);const l={type:"labelLink"===e[r][1].type?"link":"image",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[r][1].start),end:Object.assign({},e[o][1].end)},u={type:"labelText",start:Object.assign({},e[r+a+2][1].end),end:Object.assign({},e[o-2][1].start)};return i=[["enter",l,t],["enter",c,t]],i=(0,f.V)(i,e.slice(r+1,r+a+3)),i=(0,f.V)(i,[["enter",u,t]]),i=(0,f.V)(i,(0,T.W)(t.parser.constructs.insideSpan.null,e.slice(r+a+4,o-3),t)),i=(0,f.V)(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=(0,f.V)(i,e.slice(o+1)),i=(0,f.V)(i,[["exit",l,t]]),(0,f.m)(e,r,e.length,i),e},resolveAll:function(e){let t=-1;for(;++t<e.length;){const n=e[t][1];"labelImage"!==n.type&&"labelLink"!==n.type&&"labelEnd"!==n.type||(e.splice(t+1,"labelImage"===n.type?4:2),n.type="data",t++)}return e}},ie={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return(0,p.Ee)(t)?z(e,o)(t):o(t)}function o(t){return 41===t?c(t):P(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return(0,p.Ee)(t)?z(e,a)(t):c(t)}function s(e){return n(e)}function a(t){return 34===t||39===t||40===t?_(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return(0,p.Ee)(t)?z(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},se={tokenize:function(e,t,n){const r=this;return function(t){return B.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes((0,$.B)(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},ae={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},le={name:"labelStartImage",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:oe.resolveAll};var ce=n(66990);const ue={name:"attention",tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=(0,ce.S)(r);let i;return function(t){return i=t,e.enter("attentionSequence"),s(t)};function s(a){if(a===i)return e.consume(a),s;const l=e.exit("attentionSequence"),c=(0,ce.S)(a),u=!c||2===c&&o||n.includes(a),d=!o||2===o&&c||n.includes(r);return l._open=Boolean(42===i?u:u&&(o||!d)),l._close=Boolean(42===i?d:d&&(c||!u)),t(a)}},resolveAll:function(e,t){let n,r,o,i,s,a,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d=Object.assign({},e[n][1].end),p=Object.assign({},e[u][1].start);de(d,-a),de(p,a),i={type:a>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[n][1].end)},s={type:a>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[u][1].start),end:p},o={type:a>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[u][1].start)},r={type:a>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({},s.end)},e[n][1].end=Object.assign({},i.start),e[u][1].start=Object.assign({},s.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=(0,f.V)(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=(0,f.V)(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=(0,f.V)(l,(0,T.W)(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=(0,f.V)(l,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=(0,f.V)(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,(0,f.m)(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e}};function de(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const pe={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return(0,p.CW)(t)?(e.consume(t),i):l(t)}function i(e){return 43===e||45===e||46===e||(0,p.lV)(e)?(r=1,s(e)):l(e)}function s(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||(0,p.lV)(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||(0,p.JQ)(r)?n(r):(e.consume(r),a)}function l(t){return 64===t?(e.consume(t),c):(0,p.cx)(t)?(e.consume(t),l):n(t)}function c(e){return(0,p.lV)(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||(0,p.lV)(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}},he={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,s;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),x):63===t?(e.consume(t),w):(0,p.CW)(t)?(e.consume(t),C):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,m):(0,p.CW)(t)?(e.consume(t),k):n(t)}function c(t){return 45===t?(e.consume(t),f):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),h):(0,p.HP)(t)?(s=u,F(t)):(e.consume(t),u)}function h(t){return 45===t?(e.consume(t),f):u(t)}function f(e){return 62===e?R(e):45===e?h(e):u(e)}function m(t){return t==="CDATA[".charCodeAt(i++)?(e.consume(t),6===i?g:m):n(t)}function g(t){return null===t?n(t):93===t?(e.consume(t),y):(0,p.HP)(t)?(s=g,F(t)):(e.consume(t),g)}function y(t){return 93===t?(e.consume(t),b):g(t)}function b(t){return 62===t?R(t):93===t?(e.consume(t),b):g(t)}function k(t){return null===t||62===t?R(t):(0,p.HP)(t)?(s=k,F(t)):(e.consume(t),k)}function w(t){return null===t?n(t):63===t?(e.consume(t),v):(0,p.HP)(t)?(s=w,F(t)):(e.consume(t),w)}function v(e){return 62===e?R(e):w(e)}function x(t){return(0,p.CW)(t)?(e.consume(t),S):n(t)}function S(t){return 45===t||(0,p.lV)(t)?(e.consume(t),S):E(t)}function E(t){return(0,p.HP)(t)?(s=E,F(t)):(0,p.On)(t)?(e.consume(t),E):R(t)}function C(t){return 45===t||(0,p.lV)(t)?(e.consume(t),C):47===t||62===t||(0,p.Ee)(t)?A(t):n(t)}function A(t){return 47===t?(e.consume(t),R):58===t||95===t||(0,p.CW)(t)?(e.consume(t),N):(0,p.HP)(t)?(s=A,F(t)):(0,p.On)(t)?(e.consume(t),A):R(t)}function N(t){return 45===t||46===t||58===t||95===t||(0,p.lV)(t)?(e.consume(t),N):O(t)}function O(t){return 61===t?(e.consume(t),T):(0,p.HP)(t)?(s=O,F(t)):(0,p.On)(t)?(e.consume(t),O):A(t)}function T(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,M):(0,p.HP)(t)?(s=T,F(t)):(0,p.On)(t)?(e.consume(t),T):(e.consume(t),D)}function M(t){return t===o?(e.consume(t),o=void 0,I):null===t?n(t):(0,p.HP)(t)?(s=M,F(t)):(e.consume(t),M)}function D(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||(0,p.Ee)(t)?A(t):(e.consume(t),D)}function I(e){return 47===e||62===e||(0,p.Ee)(e)?A(e):n(e)}function R(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function F(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),L}function L(t){return(0,p.On)(t)?(0,d.N)(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):P(t)}function P(t){return e.enter("htmlTextData"),s(t)}}},fe={name:"labelStartLink",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:oe.resolveAll},me={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return(0,p.HP)(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},ge={name:"codeText",tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),s(t)};function s(t){return 96===t?(e.consume(t),i++,s):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):(0,p.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||(0,p.HP)(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type}},ye={42:I,43:I,45:I,48:I,49:I,50:I,51:I,52:I,53:I,54:I,55:I,56:I,57:I,62:L},be={91:j},ke={[-2]:H,[-1]:H,32:H},we={35:W,42:D,45:[K,D],60:J,61:K,95:D,96:Q,126:Q},ve={38:te,92:ne},xe={[-5]:re,[-4]:re,[-3]:re,33:le,38:te,42:ue,60:[pe,he],91:fe,92:[me,ne],93:oe,95:ue,96:ge},Se={null:[ue,S]},Ee={null:[42,95]},Ce={null:[]},Ae=/[\0\t\n\r]/g;var Ne=n(99896),Oe=n(47938);function Te(e){return e&&"object"==typeof e?"position"in e||"type"in e?De(e.position):"start"in e||"end"in e?De(e):"line"in e||"column"in e?Me(e):"":""}function Me(e){return Ie(e&&e.line)+":"+Ie(e&&e.column)}function De(e){return Me(e&&e.start)+"-"+Me(e&&e.end)}function Ie(e){return e&&"number"==typeof e?e:1}const Re={}.hasOwnProperty,Fe=function(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(v),autolinkProtocol:h,autolinkEmail:h,atxHeading:s(b),blockQuote:s((function(){return{type:"blockquote",children:[]}})),characterEscape:h,characterReference:h,codeFenced:s(y),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(y,l),codeText:s((function(){return{type:"inlineCode",value:""}}),l),codeTextData:h,data:h,codeFlowValue:h,definition:s((function(){return{type:"definition",identifier:"",label:null,title:null,url:""}})),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s((function(){return{type:"emphasis",children:[]}})),hardBreakEscape:s(k),hardBreakTrailing:s(k),htmlFlow:s(w,l),htmlFlowData:h,htmlText:s(w,l),htmlTextData:h,image:s((function(){return{type:"image",title:null,url:"",alt:null}})),label:l,link:s(v),listItem:s((function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}})),listItemValue:function(e){i("expectingFirstListItemValue")&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),o("expectingFirstListItemValue"))},listOrdered:s(x,(function(){o("expectingFirstListItemValue",!0)})),listUnordered:s(x),paragraph:s((function(){return{type:"paragraph",children:[]}})),reference:function(){o("referenceType","collapsed")},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(b),strong:s((function(){return{type:"strong",children:[]}})),thematicBreak:s((function(){return{type:"thematicBreak"}}))},exit:{atxHeading:u(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:u(),autolinkEmail:function(e){f.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){f.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:u(),characterEscapeValue:f,characterReferenceMarkerHexadecimal:g,characterReferenceMarkerNumeric:g,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=i("characterReferenceType");let r;n?(r=(0,Ne.C)(t,"characterReferenceMarkerNumeric"===n?10:16),o("characterReferenceType")):r=(0,ee.s)(t);const s=this.stack.pop();s.value+=r,s.position.end=Le(e.end)},codeFenced:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),o("flowCodeInside")})),codeFencedFence:function(){i("flowCodeInside")||(this.buffer(),o("flowCodeInside",!0))},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:f,codeIndented:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")})),codeText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),codeTextData:f,data:f,definition:u(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,$.B)(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:u(),hardBreakEscape:u(m),hardBreakTrailing:u(m),htmlFlow:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlFlowData:f,htmlText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlTextData:f,image:u((function(){const e=this.stack[this.stack.length-1];if(i("inReference")){const t=i("referenceType")||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;o("referenceType")})),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(o("inReference",!0),"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=(0,Oe.s)(t),n.identifier=(0,$.B)(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(i("atHardBreak"))return n.children[n.children.length-1].position.end=Le(e.end),void o("atHardBreak");!i("setextHeadingSlurpLineEnding")&&t.canContainEols.includes(n.type)&&(h.call(this,e),f.call(this,e))},link:u((function(){const e=this.stack[this.stack.length-1];if(i("inReference")){const t=i("referenceType")||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;o("referenceType")})),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,$.B)(this.sliceSerialize(e)).toLowerCase(),o("referenceType","full")},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){o("inReference")},setextHeading:u((function(){o("setextHeadingSlurpLineEnding")})),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).charCodeAt(0)?1:2},setextHeadingText:function(){o("setextHeadingSlurpLineEnding",!0)},strong:u(),thematicBreak:u()}};Pe(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let n={type:"root",children:[]};const s={stack:[n],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:p,setData:o,getData:i},a=[];let u=-1;for(;++u<e.length;)"listOrdered"!==e[u][1].type&&"listUnordered"!==e[u][1].type||("enter"===e[u][0]?a.push(u):u=r(e,a.pop(),u));for(u=-1;++u<e.length;){const n=t[e[u][0]];Re.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},s),e[u][1])}if(s.tokenStack.length>0){const e=s.tokenStack[s.tokenStack.length-1];(e[1]||_e).call(s,void 0,e[0])}for(n.position={start:Le(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Le(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)n=t.transforms[u](n)||n;return n};function r(e,t,n){let r,o,i,s,a=t-1,l=-1,c=!1;for(;++a<=n;){const t=e[a];if("listUnordered"===t[1].type||"listOrdered"===t[1].type||"blockQuote"===t[1].type?("enter"===t[0]?l++:l--,s=void 0):"lineEndingBlank"===t[1].type?"enter"===t[0]&&(!r||s||l||i||(i=a),s=void 0):"linePrefix"===t[1].type||"listItemValue"===t[1].type||"listItemMarker"===t[1].type||"listItemPrefix"===t[1].type||"listItemPrefixWhitespace"===t[1].type||(s=void 0),!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let s=a;for(o=void 0;s--;){const t=e[s];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",o=s}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||a,0,["exit",r,t[2]]),a++,n++}"listItemPrefix"===t[1].type&&(r={type:"listItem",_spread:!1,start:Object.assign({},t[1].start)},e.splice(a,0,["enter",r,t[2]]),a++,n++,i=void 0,s=!0)}}return e[t][1]._spread=c,n}function o(e,t){n[e]=t}function i(e){return n[e]}function s(e,t){return function(n){c.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(e,t,n){return this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n]),e.position={start:Le(t.start)},e}function u(e){return function(t){e&&e.call(this,t),d.call(this,t)}}function d(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Te({start:e.start,end:e.end})+"): it’s not open");return r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||_e).call(this,e,r[0])),n.position.end=Le(e.end),n}function p(){return a(this.stack.pop())}function h(e){const t=this.stack[this.stack.length-1];let n=t.children[t.children.length-1];n&&"text"===n.type||(n={type:"text",value:""},n.position={start:Le(e.start)},t.children.push(n)),this.stack.push(n)}function f(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Le(e.end)}function m(){o("atHardBreak",!0)}function g(e){o("characterReferenceType",e.type)}function y(){return{type:"code",lang:null,meta:null,value:""}}function b(){return{type:"heading",depth:void 0,children:[]}}function k(){return{type:"break"}}function w(){return{type:"html",value:""}}function v(){return{type:"link",title:null,url:"",children:[]}}function x(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}}(n)(function(e){for(;!b(e););return e}(function(e={}){const t={defined:[],lazy:{},constructs:(0,u.y)([r].concat(e.extensions||[])),content:n(h),document:n(m),flow:n(x),string:n(E),text:n(C)};return t;function n(e){return function(n){return M(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,s){const a=[];let l,c,u,d,p;for(o=n+o.toString(i),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);u<o.length;){if(Ae.lastIndex=u,l=Ae.exec(o),d=l&&void 0!==l.index?l.index:o.length,p=o.charCodeAt(d),!l){n=o.slice(u);break}if(10===p&&u===d&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),u<d&&(a.push(o.slice(u,d)),t+=d-u),p){case 0:a.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),a.push(-2);t++<c;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return s&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))};function Le(e){return{line:e.line,column:e.column,offset:e.offset}}function Pe(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Pe(e,r):Be(e,r)}}function Be(e,t){let n;for(n in t)if(Re.call(t,n))if("canContainEols"===n){const r=t[n];r&&e[n].push(...r)}else if("transforms"===n){const r=t[n];r&&e[n].push(...r)}else if("enter"===n||"exit"===n){const r=t[n];r&&Object.assign(e[n],r)}}function _e(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Te({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Te({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Te({start:t.start,end:t.end})+") is still open")}function ze(e){Object.assign(this,{Parser:t=>{const n=this.data("settings");return Fe(t,Object.assign({},n,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}var $e=n(14706);function je(e,t){let n,r=-1;if(t.extensions)for(;++r<t.extensions.length;)je(e,t.extensions[r]);for(n in t)"extensions"===n||("unsafe"===n||"join"===n?e[n]=[...e[n]||[],...t[n]||[]]:"handlers"===n?e[n]=Object.assign(e[n],t[n]||{}):e.options[n]=t[n]);return e}function Ue(e,t,n){return">"+(n?"":" ")+e}function He(e,t){return Ve(e,t.inConstruct,!0)&&!Ve(e,t.notInConstruct,!1)}function Ve(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function We(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if("\n"===n.unsafe[o].character&&He(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}var Ke=n(45344);function qe(e,t){return Boolean(!t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Ge(e,t,n){return(n?"":" ")+e}function Je(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ye(e,t,n,r){const o=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),i=n.enter("emphasis"),s=n.createTracker(r);let a=s.move(o);return a+=s.move(n.containerPhrasing(e,{before:a,after:o,...s.current()})),a+=s.move(o),i(),a}Ye.peek=function(e,t,n){return n.options.emphasis||"*"};var Ze=n(66641);function Xe(e,t){let n=!1;var r,o,i,s;return r=e,o=e=>{if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,Ze.dc},"function"==typeof o&&"function"!=typeof i&&(s=i,i=o,o=null),(0,Ze.VG)(r,o,(function(e,t){const n=t[t.length-1];return i(e,n?n.children.indexOf(e):null,n)}),s),Boolean((!e.depth||e.depth<3)&&a(e)&&(t.options.setext||n))}function Qe(e){return e.value||""}function et(e,t,n,r){const o=Je(n),i='"'===o?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),a()),c+=l.move(")"),s(),c}function tt(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(d+"]"),l}function nt(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function rt(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=nt(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}function ot(e,t){const n=a(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function it(e,t,n,r){const o=Je(n),i='"'===o?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(ot(e,n)){const t=n.stack;n.stack=[],a=n.enter("autolink");let r=s.move("<");return r+=s.move(n.containerPhrasing(e,{before:r,after:">",...s.current()})),r+=s.move(">"),a(),n.stack=t,r}a=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=s.move(" "+o),c+=s.move(n.safe(e.title,{before:c,after:o,...s.current()})),c+=s.move(o),l()),c+=s.move(")"),a(),c}function st(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(d+"]"),l}function at(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function lt(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ct(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}Qe.peek=function(){return"<"},et.peek=function(){return"!"},tt.peek=function(){return"!"},rt.peek=function(){return"`"},it.peek=function(e,t,n){return ot(e,n)?"<":"["},st.peek=function(){return"["};const ut=(0,n(15186).C)(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","link","linkReference","strong","text"]);function dt(e,t,n,r){const o=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),i=n.enter("strong"),s=n.createTracker(r);let a=s.move(o+o);return a+=s.move(n.containerPhrasing(e,{before:a,after:o,...s.current()})),a+=s.move(o+o),i(),a}dt.peek=function(e,t,n){return n.options.strong||"*"};const pt={blockquote:function(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const s=n.indentLines(n.containerFlow(e,i.current()),Ue);return o(),s},break:We,code:function(e,t,n,r){const o=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),i=e.value||"",s="`"===o?"GraveAccent":"Tilde";if(qe(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(i,Ge);return e(),t}const a=n.createTracker(r),l=o.repeat(Math.max((0,Ke.D)(i,o)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const t=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...a.current()})),t()}return u+=a.move("\n"),i&&(u+=a.move(i+"\n")),u+=a.move(l),c(),u},definition:function(e,t,n,r){const o=Je(n),i='"'===o?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),a(),e.title&&(a=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),a()),s(),c},emphasis:Ye,hardBreak:We,heading:function(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(Xe(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),s=n.containerPhrasing(e,{...i.current(),before:"\n",after:"\n"});return r(),t(),s+"\n"+(1===o?"=":"-").repeat(s.length-(Math.max(s.lastIndexOf("\r"),s.lastIndexOf("\n"))+1))}const s="#".repeat(o),a=n.enter("headingAtx"),l=n.enter("phrasing");i.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...i.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c},html:Qe,image:et,imageReference:tt,inlineCode:rt,link:it,linkReference:st,list:function(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let s=e.ordered?lt(n):at(n);const a=e.ordered?function(e){const t=lt(e),n=e.options.bulletOrderedOther;if(!n)return"."===t?")":".";if("."!==n&&")"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrderedOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bulletOrdered` (`"+t+"`) and `bulletOrderedOther` (`"+n+"`) to be different");return n}(n):function(e){const t=at(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n),l=n.bulletLastUsed;let c=!1;if(t&&(e.ordered?n.options.bulletOrderedOther:n.options.bulletOther)&&l&&s===l&&(c=!0),!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==s&&"-"!==s||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(c=!0),ct(n)===s&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){c=!0;break}}}}c&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=i,o(),u},listItem:function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"tab";if(1===t||"1"===t)return"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||at(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let s=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));const a=n.createTracker(r);a.move(i+" ".repeat(s-i.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),(function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?i:i+" ".repeat(s-i.length))+e}));return l(),c},paragraph:function(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),s=n.containerPhrasing(e,r);return i(),o(),s},root:function(e,t,n,r){const o=e.children.some((e=>ut(e)));return(o?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:dt,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(ct(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}},ht=[function(e,t,n,r){if("code"===t.type&&qe(t,r)&&("list"===e.type||e.type===t.type&&qe(e,r)))return!1;if("list"===e.type&&e.type===t.type&&Boolean(e.ordered)===Boolean(t.ordered)&&!(e.ordered?r.options.bulletOrderedOther:r.options.bulletOther))return!1;if("spread"in n&&"boolean"==typeof n.spread){if("paragraph"===e.type&&(e.type===t.type||"definition"===t.type||"heading"===t.type&&Xe(t,r)))return;return n.spread?1:0}}],ft=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],mt=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:ft},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:ft},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:ft},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:ft},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:ft},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:ft},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:ft},{atBreak:!0,character:"~"}];function gt(e){return e.label||!e.identifier?e.label||"":(0,Oe.s)(e.identifier)}function yt(e,t,n,r){let o=r.join.length;for(;o--;){const i=r.join[o](e,t,n,r);if(!0===i||1===i)break;if("number"==typeof i)return"\n".repeat(1+i);if(!1===i)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const bt=/\r?\n|\r/g;function kt(e,t){const n=[];let r,o=0,i=0;for(;r=bt.exec(e);)s(e.slice(o,r.index)),n.push(r[0]),o=r.index+r[0].length,i++;return s(e.slice(o)),n.join("");function s(e){n.push(t(e,i,!e))}}function wt(e,t){return e-t}function vt(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],o=[],i=e+t;let s,a=-1,l=0;for(;s=n.exec(i);)r.push(s.index);for(;++a<r.length;)l!==r[a]&&o.push(e.slice(l,r[a])),o.push("\\"),l=r[a];return o.push(e.slice(l)),o.join("")}function xt(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,o=n.line||1,i=n.column||1;return{move:function(e){const t=e||"",n=t.split(/\r?\n|\r/g),s=n[n.length-1];return o+=n.length-1,i=1===n.length?i+s.length:1+s.length+r,t},current:function(){return{now:{line:o,column:i},lineShift:r}},shift:function(e){r+=e}}}function St(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function Et(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function Ct(e,t){if("definition"===e.type&&e.type===t.type)return 0}function At(e,t){return function(e,t,n){const r=t.indexStack,o=e.children||[],i=[];let s=-1,a=n.before;r.push(-1);let l=t.createTracker(n);for(;++s<o.length;){const c=o[s];let u;if(r[r.length-1]=s,s+1<o.length){let n=t.handle.handlers[o[s+1].type];n&&n.peek&&(n=n.peek),u=n?n(o[s+1],e,t,{before:"",after:"",...l.current()}).charAt(0):""}else u=n.after;i.length>0&&("\r"===a||"\n"===a)&&"html"===c.type&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=t.createTracker(n),l.move(i.join(""))),i.push(l.move(t.handle(c,e,t,{...l.current(),before:a,after:u}))),a=i[i.length-1].slice(-1)}return r.pop(),i.join("")}(e,this,t)}function Nt(e,t){return function(e,t,n){const r=t.indexStack,o=e.children||[],i=t.createTracker(n),s=[];let a=-1;for(r.push(-1);++a<o.length;){const n=o[a];r[r.length-1]=a,s.push(i.move(t.handle(n,e,t,{before:"\n",after:"\n",...i.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),a<o.length-1&&s.push(i.move(yt(n,o[a+1],e,t)))}return r.pop(),s.join("")}(e,this,t)}function Ot(e,t){return function(e,t,n){const r=(n.before||"")+(t||"")+(n.after||""),o=[],i=[],s={};let a=-1;for(;++a<e.unsafe.length;){const t=e.unsafe[a];if(!He(e.stack,t))continue;const n=nt(t);let i;for(;i=n.exec(r);){const e="before"in t||Boolean(t.atBreak),n="after"in t,r=i.index+(e?i[1].length:0);o.includes(r)?(s[r].before&&!e&&(s[r].before=!1),s[r].after&&!n&&(s[r].after=!1)):(o.push(r),s[r]={before:e,after:n})}}o.sort(wt);let l=n.before?n.before.length:0;const c=r.length-(n.after?n.after.length:0);for(a=-1;++a<o.length;){const e=o[a];e<l||e>=c||e+1<c&&o[a+1]===e+1&&s[e].after&&!s[e+1].before&&!s[e+1].after||o[a-1]===e-1&&s[e].before&&!s[e-1].before&&!s[e-1].after||(l!==e&&i.push(vt(r.slice(l,e),"\\")),l=e,!/[!-/:-@[-`{-~]/.test(r.charAt(e))||n.encode&&n.encode.includes(r.charAt(e))?(i.push("&#x"+r.charCodeAt(e).toString(16).toUpperCase()+";"),l++):i.push("\\"))}return i.push(vt(r.slice(l,c),n.after)),i.join("")}(this,e,t)}function Tt(e){Object.assign(this,{Compiler:t=>{const n=this.data("settings");return function(e,t={}){const n={enter:function(e){return n.stack.push(e),function(){n.stack.pop()}},indentLines:kt,associationId:gt,containerPhrasing:At,containerFlow:Nt,createTracker:xt,safe:Ot,stack:[],unsafe:[],join:[],handlers:{},options:{},indexStack:[],handle:void 0};je(n,{unsafe:mt,join:ht,handlers:pt}),je(n,t),n.options.tightDefinitions&&je(n,{join:[Ct]}),n.handle=(0,$e.A)("type",{invalid:St,unknown:Et,handlers:n.handlers});let r=n.handle(e,void 0,n,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return r&&10!==r.charCodeAt(r.length-1)&&13!==r.charCodeAt(r.length-1)&&(r+="\n"),r}(t,Object.assign({},n,e,{extensions:this.data("toMarkdownExtensions")||[]}))}})}var Mt=n(659),Dt=n(88966),It=n(89710);function Rt(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}var Ft=n(4934);function Lt(e){return Bt(e&&e.line)+":"+Bt(e&&e.column)}function Pt(e){return Lt(e&&e.start)+"-"+Lt(e&&e.end)}function Bt(e){return e&&"number"==typeof e?e:1}class _t extends Error{constructor(e,t,n){const r=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),"string"==typeof t&&(n=t,t=void 0),"string"==typeof n){const e=n.indexOf(":");-1===e?r[1]=n:(r[0]=n.slice(0,e),r[1]=n.slice(e+1))}var i;t&&("type"in t||"position"in t?t.position&&(o=t.position):"start"in t||"end"in t?o=t:("line"in t||"column"in t)&&(o.start=t)),this.name=((i=t)&&"object"==typeof i?"position"in i||"type"in i?Pt(i.position):"start"in i||"end"in i?Pt(i):"line"in i||"column"in i?Lt(i):"":"")||"1:1",this.message="object"==typeof e?e.message:e,this.stack="","object"==typeof e&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=r[0],this.ruleId=r[1],this.file,this.actual,this.expected,this.url,this.note}}_t.prototype.file="",_t.prototype.name="",_t.prototype.reason="",_t.prototype.message="",_t.prototype.stack="",_t.prototype.fatal=null,_t.prototype.column=null,_t.prototype.line=null,_t.prototype.source=null,_t.prototype.ruleId=null,_t.prototype.position=null;const zt=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Vt(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.charCodeAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(47===e.charCodeAt(i)){if(n){r=i+1;break}}else s<0&&(n=!0,s=i+1),a>-1&&(e.charCodeAt(i)===t.charCodeAt(a--)?a<0&&(o=i):(a=-1,o=s));return r===o?o=s:o<0&&(o=e.length),e.slice(r,o)},$t=function(e){if(Vt(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.charCodeAt(0)?"/":".":1===n&&47===e.charCodeAt(0)?"//":e.slice(0,n)},jt=function(e){Vt(e);let t,n=e.length,r=-1,o=0,i=-1,s=0;for(;n--;){const a=e.charCodeAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?i<0?i=n:1!==s&&(s=1):i>-1&&(s=-1);else if(t){o=n+1;break}}return i<0||r<0||0===s||1===s&&i===r-1&&i===o+1?"":e.slice(i,r)},Ut=function(...e){let t,n=-1;for(;++n<e.length;)Vt(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Vt(e);const t=47===e.charCodeAt(0);let n=function(e,t){let n,r,o="",i=0,s=-1,a=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.charCodeAt(l);else{if(47===n)break;n=47}if(47===n){if(s===l-1||1===a);else if(s!==l-1&&2===a){if(o.length<2||2!==i||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),s=l,a=0;continue}}else if(o.length>0){o="",i=0,s=l,a=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(s+1,l):o=e.slice(s+1,l),i=l-s-1;s=l,a=0}else 46===n&&a>-1?a++:a=-1}return o}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.charCodeAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},Ht="/";function Vt(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Wt=function(){return"/"};function Kt(e){return null!==e&&"object"==typeof e&&e.href&&e.origin}const qt=["history","path","basename","stem","extname","dirname"];class Gt{constructor(e){let t;t=e?"string"==typeof e||function(e){return Dt(e)}(e)?{value:e}:Kt(e)?{path:e}:e:{},this.data={},this.messages=[],this.history=[],this.cwd=Wt(),this.value,this.stored,this.result,this.map;let n,r=-1;for(;++r<qt.length;){const e=qt[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)qt.includes(n)||(this[n]=t[n])}get path(){return this.history[this.history.length-1]}set path(e){Kt(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!Kt(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.charCodeAt(n)&&50===t.charCodeAt(n+1)){const e=t.charCodeAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),Yt(e,"path"),this.path!==e&&this.history.push(e)}get dirname(){return"string"==typeof this.path?$t(this.path):void 0}set dirname(e){Zt(this.basename,"dirname"),this.path=Ut(e||"",this.basename)}get basename(){return"string"==typeof this.path?zt(this.path):void 0}set basename(e){Yt(e,"basename"),Jt(e,"basename"),this.path=Ut(this.dirname||"",e)}get extname(){return"string"==typeof this.path?jt(this.path):void 0}set extname(e){if(Jt(e,"extname"),Zt(this.dirname,"extname"),e){if(46!==e.charCodeAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ut(this.dirname,this.stem+(e||""))}get stem(){return"string"==typeof this.path?zt(this.path,this.extname):void 0}set stem(e){Yt(e,"stem"),Jt(e,"stem"),this.path=Ut(this.dirname||"",e+(this.extname||""))}toString(e){return(this.value||"").toString(e||void 0)}message(e,t,n){const r=new _t(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=null,r}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}}function Jt(e,t){if(e&&e.includes(Ht))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ht+"`")}function Yt(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Zt(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Xt=function e(){const t=(0,Ft.S)(),n=[];let r,o={},i=-1;return s.data=function(e,t){return"string"==typeof e?2===arguments.length?(rn("data",r),o[e]=t,s):Qt.call(o,e)&&o[e]||null:e?(rn("data",r),o=e,s):o},s.Parser=void 0,s.Compiler=void 0,s.freeze=function(){if(r)return s;for(;++i<n.length;){const[e,...r]=n[i];if(!1===r[0])continue;!0===r[0]&&(r[0]=void 0);const o=e.call(s,...r);"function"==typeof o&&t.use(o)}return r=!0,i=Number.POSITIVE_INFINITY,s},s.attachers=n,s.use=function(e,...t){let i;if(rn("use",r),null==e);else if("function"==typeof e)u(e,...t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?c(e):l(e)}return i&&(o.settings=Object.assign(o.settings||{},i)),s;function a(e){if("function"==typeof e)u(e);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;u(t,...n)}else l(e)}}function l(e){c(e.plugins),e.settings&&(i=Object.assign(i||{},e.settings))}function c(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;)a(e[t])}}function u(e,t){let r,o=-1;for(;++o<n.length;)if(n[o][0]===e){r=n[o];break}r?(Rt(r[1])&&Rt(t)&&(t=It(!0,r[1],t)),r[1]=t):n.push([...arguments])}},s.parse=function(e){s.freeze();const t=an(e),n=s.Parser;return tn("parse",n),en(n,"parse")?new n(String(t),t).parse():n(String(t),t)},s.stringify=function(e,t){s.freeze();const n=an(t),r=s.Compiler;return nn("stringify",r),on(e),en(r,"compile")?new r(e,n).compile():r(e,n)},s.run=function(e,n,r){if(on(e),s.freeze(),r||"function"!=typeof n||(r=n,n=void 0),!r)return new Promise(o);function o(o,i){t.run(e,an(n),(function(t,n,s){n=n||e,t?i(t):o?o(n):r(null,n,s)}))}o(null,r)},s.runSync=function(e,t){let n,r;return s.run(e,t,(function(e,t){(0,Mt.V)(e),n=t,r=!0})),sn("runSync","run",r),n},s.process=function(e,t){if(s.freeze(),tn("process",s.Parser),nn("process",s.Compiler),!t)return new Promise(n);function n(n,r){const o=an(e);function i(e,o){e||!o?r(e):n?n(o):t(null,o)}s.run(s.parse(o),o,((e,t,n)=>{if(!e&&t&&n){const o=s.stringify(t,n);null==o||("string"==typeof(r=o)||Dt(r)?n.value=o:n.result=o),i(e,n)}else i(e);var r}))}n(null,t)},s.processSync=function(e){let t;s.freeze(),tn("processSync",s.Parser),nn("processSync",s.Compiler);const n=an(e);return s.process(n,(function(e){t=!0,(0,Mt.V)(e)})),sn("processSync","process",t),n},s;function s(){const t=e();let r=-1;for(;++r<n.length;)t.use(...n[r]);return t.data(It(!0,{},o)),t}}().freeze(),Qt={}.hasOwnProperty;function en(e,t){return"function"==typeof e&&e.prototype&&(function(e){let t;for(t in e)if(Qt.call(e,t))return!0;return!1}(e.prototype)||t in e.prototype)}function tn(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `Parser`")}function nn(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `Compiler`")}function rn(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function on(e){if(!Rt(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function sn(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function an(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Gt(e)}var ln,cn,un,dn,pn,hn,fn,mn=n(1440),gn=Object.defineProperty,yn=(e,t,n)=>(((e,t,n)=>{t in e?gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),bn=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},kn=(e,t,n)=>(bn(e,t,"read from private field"),n?n.call(e):t.get(e)),wn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},vn=(e,t,n,r)=>(bn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class xn{}class Sn{constructor(){yn(this,"elements",[]),yn(this,"size",(()=>this.elements.length)),yn(this,"top",(()=>this.elements.at(-1))),yn(this,"push",(e=>{var t;null==(t=this.top())||t.push(e)})),yn(this,"open",(e=>{this.elements.push(e)})),yn(this,"close",(()=>{const e=this.elements.pop();if(!e)throw(0,mn.TR)();return e}))}}class En extends xn{constructor(e,t,n){super(),this.type=e,this.content=t,this.attrs=n}push(e,...t){this.content.push(e,...t)}pop(){return this.content.pop()}static create(e,t,n){return new En(e,t,n)}}const Cn=class extends Sn{constructor(e){super(),yn(this,"schema"),wn(this,ln,i.CU.none),wn(this,cn,(e=>e.isText)),wn(this,un,((e,t)=>{if(kn(this,cn).call(this,e)&&kn(this,cn).call(this,t)&&i.CU.sameSet(e.marks,t.marks))return this.schema.text(e.text+t.text,e.marks)})),wn(this,dn,(e=>{const t=Object.values({...this.schema.nodes,...this.schema.marks}).find((t=>t.spec.parseMarkdown.match(e)));if(!t)throw(0,mn.Xm)(e);return t})),wn(this,pn,(e=>{const t=kn(this,dn).call(this,e);t.spec.parseMarkdown.runner(this,e,t)})),yn(this,"injectRoot",((e,t,n)=>(this.openNode(t,n),this.next(e.children),this))),yn(this,"openNode",((e,t)=>(this.open(En.create(e,[],t)),this))),wn(this,hn,(()=>{vn(this,ln,i.CU.none);const e=this.close();return kn(this,fn).call(this,e.type,e.attrs,e.content)})),yn(this,"closeNode",(()=>(kn(this,hn).call(this),this))),wn(this,fn,((e,t,n)=>{const r=e.createAndFill(t,n,kn(this,ln));if(!r)throw(0,mn.$D)(e,t,n);return this.push(r),r})),yn(this,"addNode",((e,t,n)=>(kn(this,fn).call(this,e,t,n),this))),yn(this,"openMark",((e,t)=>{const n=e.create(t);return vn(this,ln,n.addToSet(kn(this,ln))),this})),yn(this,"closeMark",(e=>(vn(this,ln,e.removeFromSet(kn(this,ln))),this))),yn(this,"addText",(e=>{const t=this.top();if(!t)throw(0,mn.TR)();const n=t.pop(),r=this.schema.text(e,kn(this,ln));if(!n)return t.push(r),this;const o=kn(this,un).call(this,n,r);return o?(t.push(o),this):(t.push(n,r),this)})),yn(this,"build",(()=>{let e;do{e=kn(this,hn).call(this)}while(this.size());return e})),yn(this,"next",((e=[])=>([e].flat().forEach((e=>kn(this,pn).call(this,e))),this))),yn(this,"toDoc",(()=>this.build())),yn(this,"run",((e,t)=>{const n=e.runSync(e.parse(t),t);return this.next(n),this})),this.schema=e}};let An=Cn;ln=new WeakMap,cn=new WeakMap,un=new WeakMap,dn=new WeakMap,pn=new WeakMap,hn=new WeakMap,fn=new WeakMap,yn(An,"create",((e,t)=>{const n=new Cn(e);return e=>(n.run(t,e),n.toDoc())}));const Nn=class extends xn{constructor(e,t,n,r={}){super(),yn(this,"push",((e,...t)=>{this.children||(this.children=[]),this.children.push(e,...t)})),yn(this,"pop",(()=>{var e;return null==(e=this.children)?void 0:e.pop()})),this.type=e,this.children=t,this.value=n,this.props=r}};let On=Nn;var Tn,Mn,Dn,In,Rn,Fn,Ln,Pn,Bn,_n,zn,$n;yn(On,"create",((e,t,n,r={})=>new Nn(e,t,n,r)));const jn=class extends Sn{constructor(e){super(),wn(this,Tn,i.CU.none),yn(this,"schema"),wn(this,Mn,(e=>{const t=Object.values({...this.schema.nodes,...this.schema.marks}).find((t=>t.spec.toMarkdown.match(e)));if(!t)throw(0,mn._K)(e.type);return t})),wn(this,Dn,(e=>kn(this,Mn).call(this,e).spec.toMarkdown.runner(this,e))),wn(this,In,((e,t)=>kn(this,Mn).call(this,e).spec.toMarkdown.runner(this,e,t))),wn(this,Rn,(e=>{const{marks:t}=e,n=e=>e.type.spec.priority??50;[...t].sort(((e,t)=>n(e)-n(t))).every((t=>!kn(this,In).call(this,t,e)))&&kn(this,Dn).call(this,e),t.forEach((e=>kn(this,$n).call(this,e)))})),wn(this,Fn,((e,t)=>{var n;if(e.type===t||1!==(null==(n=e.children)?void 0:n.length))return e;const r=e=>{var n;if(e.type===t)return e;if(1!==(null==(n=e.children)?void 0:n.length))return null;const[o]=e.children;return o?r(o):null},o=r(e);if(!o)return e;const i=o.children?[...o.children]:void 0,s={...e,children:i};return s.children=i,o.children=[s],o})),wn(this,Ln,(e=>{const{children:t}=e;return t&&(e.children=t.reduce(((e,t,n)=>{if(0===n)return[t];const r=e.at(-1);if(r&&r.isMark&&t.isMark){t=kn(this,Fn).call(this,t,r.type);const{children:n,...o}=t,{children:i,...s}=r;if(t.type===r.type&&n&&i&&JSON.stringify(o)===JSON.stringify(s)){const t={...s,children:[...i,...n]};return e.slice(0,-1).concat(kn(this,Ln).call(this,t))}}return e.concat(t)}),[])),e})),wn(this,Pn,(e=>{const t={...e.props,type:e.type};return e.children&&(t.children=e.children),e.value&&(t.value=e.value),t})),yn(this,"openNode",((e,t,n)=>(this.open(On.create(e,void 0,t,n)),this))),wn(this,Bn,(()=>{const e=this.close();return kn(this,_n).call(this,e.type,e.children,e.value,e.props)})),yn(this,"closeNode",(()=>(kn(this,Bn).call(this),this))),wn(this,_n,((e,t,n,r)=>{const o=On.create(e,t,n,r),i=kn(this,Ln).call(this,kn(this,Pn).call(this,o));return this.push(i),i})),yn(this,"addNode",((e,t,n,r)=>(kn(this,_n).call(this,e,t,n,r),this))),wn(this,zn,((e,t,n,r)=>e.isInSet(kn(this,Tn))?this:(vn(this,Tn,e.addToSet(kn(this,Tn))),this.openNode(t,n,{...r,isMark:!0})))),wn(this,$n,(e=>{!e.isInSet(kn(this,Tn))||(vn(this,Tn,e.type.removeFromSet(kn(this,Tn))),kn(this,Bn).call(this))})),yn(this,"withMark",((e,t,n,r)=>(kn(this,zn).call(this,e,t,n,r),this))),yn(this,"closeMark",(e=>(kn(this,$n).call(this,e),this))),yn(this,"build",(()=>{let e=null;do{e=kn(this,Bn).call(this)}while(this.size());return e})),yn(this,"next",(e=>{return t=e,Object.prototype.hasOwnProperty.call(t,"size")?(e.forEach((e=>{kn(this,Rn).call(this,e)})),this):(kn(this,Rn).call(this,e),this);var t})),yn(this,"toString",(e=>e.stringify(this.build()))),yn(this,"run",(e=>(this.next(e),this))),this.schema=e}};let Un=jn;Tn=new WeakMap,Mn=new WeakMap,Dn=new WeakMap,In=new WeakMap,Rn=new WeakMap,Fn=new WeakMap,Ln=new WeakMap,Pn=new WeakMap,Bn=new WeakMap,_n=new WeakMap,zn=new WeakMap,$n=new WeakMap,yn(Un,"create",((e,t)=>{const n=new jn(e);return e=>(n.run(e),n.toString(t))}));var Hn=n(81570),Vn=n(73686),Wn=n(44254),Kn=n(25715),qn=n(15939),Gn=Object.defineProperty,Jn=(e,t,n)=>(((e,t,n)=>{t in e?Gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),Yn=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Zn=(e,t,n)=>(Yn(e,t,"read from private field"),n?n.call(e):t.get(e)),Xn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Qn=(e,t,n,r)=>(Yn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);const er=(e,t)=>(e.meta={package:"@milkdown/core",group:"System",...t},e),tr=(0,o.CR)("ConfigReady"),nr=(0,o.CR)("InitReady"),rr=(0,o.Z0)([],"initTimer"),or=(0,o.Z0)({},"editor"),ir=(0,o.Z0)([],"inputRules"),sr=(0,o.Z0)([],"prosePlugins"),ar=(0,o.Z0)([],"remarkPlugins"),lr=(0,o.Z0)([],"nodeView"),cr=(0,o.Z0)([],"markView"),ur=(0,o.Z0)(Xt().use(ze).use(Tt),"remark"),dr=(0,o.Z0)({},"remarkStringifyOptions"),pr=e=>{const t=t=>(t.inject(or,e).inject(sr).inject(ar).inject(ir).inject(lr).inject(cr).inject(dr).inject(ur,Xt().use(ze).use(Tt)).inject(rr,[tr]).record(nr),async()=>{await t.waitTimers(rr);const e=t.get(dr);return t.set(ur,Xt().use(ze).use(Tt,e)),t.done(nr),()=>{t.remove(or).remove(sr).remove(ar).remove(ir).remove(lr).remove(cr).remove(dr).remove(ur).remove(rr).clearTimer(nr)}});return er(t,{displayName:"Init"}),t},hr=(0,o.CR)("SchemaReady"),fr=(0,o.Z0)([],"schemaTimer"),mr=(0,o.Z0)({},"schema"),gr=(0,o.Z0)([],"nodes"),yr=(0,o.Z0)([],"marks"),br=e=>{var t;return{...e,parseDOM:null==(t=e.parseDOM)?void 0:t.map((t=>({priority:e.priority,...t})))}},kr=e=>(e.inject(mr).inject(gr).inject(yr).inject(fr,[nr]).record(hr),async()=>{await e.waitTimers(fr);const t=e.get(ur),n=e.get(ar).reduce(((e,t)=>e.use(t)),t);e.set(ur,n);const r=Object.fromEntries(e.get(gr).map((([e,t])=>[e,br(t)]))),o=Object.fromEntries(e.get(yr).map((([e,t])=>[e,br(t)])));return e.set(mr,new i.Sj({nodes:r,marks:o})),e.done(hr),()=>{e.remove(mr).remove(gr).remove(yr).remove(fr).clearTimer(hr)}});er(kr,{displayName:"Schema"});const wr=(0,o.CR)("ParserReady"),vr=(0,o.Z0)((()=>{throw(0,mn.dI)()}),"parser"),xr=(0,o.Z0)([],"parserTimer"),Sr=e=>(e.inject(vr).inject(xr,[hr]).record(wr),async()=>{await e.waitTimers(xr);const t=e.get(ur),n=e.get(mr);return e.set(vr,An.create(n,t)),e.done(wr),()=>{e.remove(vr).remove(xr).clearTimer(wr)}});er(Sr,{displayName:"Parser"});const Er=(0,o.CR)("SerializerReady"),Cr=(0,o.Z0)([],"serializerTimer"),Ar=(0,o.Z0)((()=>""),"serializer"),Nr=e=>(e.inject(Ar).inject(Cr,[hr]).record(Er),async()=>{await e.waitTimers(Cr);const t=e.get(ur),n=e.get(mr);return e.set(Ar,Un.create(n,t)),e.done(Er),()=>{e.remove(Ar).remove(Cr).clearTimer(Er)}});er(Nr,{displayName:"Serializer"});const Or=(0,o.Z0)("","defaultValue"),Tr=(0,o.Z0)({},"editorState"),Mr=(0,o.Z0)((e=>e),"stateOptions"),Dr=(0,o.Z0)([],"editorStateTimer"),Ir=(0,o.CR)("EditorStateReady"),Rr=new Hn.hs("MILKDOWN_STATE_TRACKER"),Fr=e=>(e.inject(Or).inject(Tr).inject(Mr).inject(Dr,[wr,Er,Jr]).record(Ir),async()=>{await e.waitTimers(Dr);const t=e.get(mr),n=e.get(vr),r=e.get(ir),o=e.get(Mr),s=e.get(sr),a=((e,t,n)=>{if("string"==typeof e)return t(e);if("html"===e.type)return i.S4.fromSchema(n).parse(e.dom);if("json"===e.type)return i.bP.fromJSON(n,e.value);throw(0,mn.j7)(e)})(e.get(Or),n,t),l=[...s,new Hn.k_({key:Rr,state:{init:()=>{},apply:(t,n,r,o)=>{e.set(Tr,o)}}}),(0,Wn.Z6)({rules:r}),(0,qn.w)(Kn.RV)];e.set(sr,l);const c=o({schema:t,doc:a,plugins:l}),u=Hn.$t.create(c);return e.set(Tr,u),e.done(Ir),()=>{e.remove(Or).remove(Tr).remove(Mr).remove(Dr).clearTimer(Ir)}});er(Fr,{displayName:"EditorState"});const Lr=(0,o.CR)("EditorViewReady"),Pr=(0,o.Z0)({},"editorView"),Br=(0,o.Z0)([],"editorViewTimer"),_r=(0,o.Z0)({},"editorViewOptions"),zr=(0,o.Z0)(null,"root"),$r=(0,o.Z0)(null,"rootDOM"),jr=(0,o.Z0)({},"rootAttrs"),Ur=new Hn.hs("MILKDOWN_VIEW_CLEAR"),Hr=e=>(e.inject(zr,document.body).inject(Pr).inject(_r).inject($r).inject(jr).inject(Br,[Ir]).record(Lr),async()=>{await e.wait(nr);const t=e.get(zr)||document.body,n="string"==typeof t?document.querySelector(t):t;e.update(sr,(t=>[new Hn.k_({key:Ur,view:t=>{const r=n?((e,t)=>{const n=document.createElement("div");n.className="milkdown",e.appendChild(n),t.set($r,n);const r=t.get(jr);return Object.entries(r).forEach((([e,t])=>n.setAttribute(e,t))),n})(n,e):void 0;return(()=>{if(r&&n){const e=t.dom;n.replaceChild(r,e),r.appendChild(e)}})(),{destroy:()=>{null!=r&&r.parentNode&&(null==r||r.parentNode.replaceChild(t.dom,r)),null==r||r.remove()}}}}),...t])),await e.waitTimers(Br);const r=e.get(Tr),o=e.get(_r),i=Object.fromEntries(e.get(lr)),s=Object.fromEntries(e.get(cr)),a=new Vn.Lz(n,{state:r,nodeViews:i,markViews:s,...o});return(e=>{e.classList.add("editor"),e.setAttribute("role","textbox")})(a.dom),e.set(Pr,a),e.done(Lr),()=>{null==a||a.destroy(),e.remove(zr).remove(Pr).remove(_r).remove($r).remove(jr).remove(Br).clearTimer(Lr)}});var Vr,Wr;er(Hr,{displayName:"EditorView"}),Vr=new WeakMap,Wr=new WeakMap;const Kr=(e="cmdKey")=>(0,o.Z0)((()=>()=>!1),e),qr=(0,o.Z0)(new class{constructor(){Xn(this,Vr,new o.mc),Xn(this,Wr,null),Jn(this,"setCtx",(e=>{Qn(this,Wr,e)}))}create(e,t){const n=e.create(Zn(this,Vr).sliceMap);return n.set(t),n}get(e){return Zn(this,Vr).get(e).get()}remove(e){return Zn(this,Vr).remove(e)}call(e,t){if(null==Zn(this,Wr))throw(0,mn.zD)();const n=this.get(e)(t),r=Zn(this,Wr).get(Pr);return n(r.state,r.dispatch,r)}},"commands"),Gr=(0,o.Z0)([hr],"commandsTimer"),Jr=(0,o.CR)("CommandsReady"),Yr=e=>(e.inject(qr).inject(Gr).record(Jr),e.get(qr).setCtx(e),async()=>(await e.waitTimers(Gr),e.done(Jr),()=>{e.remove(qr).remove(Gr).clearTimer(Jr)}));var Zr,Xr,Qr,eo,to,no,ro,oo,io,so,ao,lo,co,uo,po;er(Yr,{displayName:"Commands"});const ho=class{constructor(){Xn(this,Zr,!1),Xn(this,Xr,"Idle"),Xn(this,Qr,[]),Xn(this,eo,(()=>{})),Xn(this,to,new o.mc),Xn(this,no,new o.zD),Xn(this,ro,new Map),Xn(this,oo,new Map),Xn(this,io,new o.Kj(Zn(this,to),Zn(this,no))),Xn(this,so,(()=>{const e=(e=>{const t=t=>(t.record(tr),async()=>(await e(t),t.done(tr),()=>{t.clearTimer(tr)}));return er(t,{displayName:"Config"}),t})((async e=>{await Promise.all(Zn(this,Qr).map((t=>t(e))))})),t=[kr,Sr,Nr,Yr,Fr,Hr,pr(this),e];Zn(this,ao).call(this,t,Zn(this,oo))})),Xn(this,ao,((e,t)=>{e.forEach((e=>{const n=Zn(this,io).produce(Zn(this,Zr)?e.meta:void 0),r=e(n);t.set(e,{ctx:n,handler:r,cleanup:void 0})}))})),Xn(this,lo,((e,t=!1)=>Promise.all([e].flat().map((e=>{const n=Zn(this,ro).get(e),r=null==n?void 0:n.cleanup;return t?Zn(this,ro).delete(e):Zn(this,ro).set(e,{ctx:void 0,handler:void 0,cleanup:void 0}),"function"==typeof r?r():r}))))),Xn(this,co,(async()=>{await Promise.all([...Zn(this,oo).entries()].map((([e,{cleanup:t}])=>"function"==typeof t?t():t))),Zn(this,oo).clear()})),Xn(this,uo,(e=>{Qn(this,Xr,e),Zn(this,eo).call(this,e)})),Xn(this,po,(e=>[...e.entries()].map((async([t,n])=>{const{ctx:r,handler:o}=n;if(!o)return;const i=await o();e.set(t,{ctx:r,handler:o,cleanup:i})})))),Jn(this,"enableInspector",((e=!0)=>(Qn(this,Zr,e),this))),Jn(this,"onStatusChange",(e=>(Qn(this,eo,e),this))),Jn(this,"config",(e=>(Zn(this,Qr).push(e),this))),Jn(this,"removeConfig",(e=>(Qn(this,Qr,Zn(this,Qr).filter((t=>t!==e))),this))),Jn(this,"use",(e=>{const t=[e].flat();return t.flat().forEach((e=>{Zn(this,ro).set(e,{ctx:void 0,handler:void 0,cleanup:void 0})})),"Created"===Zn(this,Xr)&&Zn(this,ao).call(this,t,Zn(this,ro)),this})),Jn(this,"remove",(async e=>"OnCreate"===Zn(this,Xr)?(console.warn("[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code."),new Promise((t=>{setTimeout((()=>{t(this.remove(e))}),50)}))):(await Zn(this,lo).call(this,[e].flat(),!0),this))),Jn(this,"create",(async()=>("OnCreate"===Zn(this,Xr)||("Created"===Zn(this,Xr)&&await this.destroy(),Zn(this,uo).call(this,"OnCreate"),Zn(this,so).call(this),Zn(this,ao).call(this,[...Zn(this,ro).keys()],Zn(this,ro)),await Promise.all([Zn(this,po).call(this,Zn(this,oo)),Zn(this,po).call(this,Zn(this,ro))].flat()),Zn(this,uo).call(this,"Created")),this))),Jn(this,"destroy",(async(e=!1)=>"Destroyed"===Zn(this,Xr)||"OnDestroy"===Zn(this,Xr)?this:"OnCreate"===Zn(this,Xr)?new Promise((t=>{setTimeout((()=>{t(this.destroy(e))}),50)})):(e&&Qn(this,Qr,[]),Zn(this,uo).call(this,"OnDestroy"),await Zn(this,lo).call(this,[...Zn(this,ro).keys()],e),await Zn(this,co).call(this),Zn(this,uo).call(this,"Destroyed"),this))),Jn(this,"action",(e=>e(Zn(this,io)))),Jn(this,"inspect",(()=>Zn(this,Zr)?[...Zn(this,oo).values(),...Zn(this,ro).values()].map((({ctx:e})=>{var t;return null==(t=null==e?void 0:e.inspector)?void 0:t.read()})).filter((e=>Boolean(e))):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])))}static make(){return new ho}get ctx(){return Zn(this,io)}get status(){return Zn(this,Xr)}};let fo=ho;Zr=new WeakMap,Xr=new WeakMap,Qr=new WeakMap,eo=new WeakMap,to=new WeakMap,no=new WeakMap,ro=new WeakMap,oo=new WeakMap,io=new WeakMap,so=new WeakMap,ao=new WeakMap,lo=new WeakMap,co=new WeakMap,uo=new WeakMap,po=new WeakMap},29796:(e,t,n)=>{"use strict";n.d(t,{Wj:()=>p,mS:()=>u});var r=n(44254),o=n(81570),i=n(37082),s=n(16512),a=n(73686);const l=(e,t=[])=>e.flatMap((e=>{var n;return"element"===e.type?l(e.children,[...t,...(null==(n=e.properties)?void 0:n.className)||[]]):[{text:e.value,className:t}]}));function c(e,t,n){const{highlight:o,listLanguages:i}=n,s=i(),c=[];return(0,r.xe)((e=>e.type.name===t))(e).forEach((e=>{let t=e.pos+1;const{language:n}=e.node.attrs;if(!n||!s.includes(n))return void console.warn("Unsupported language detected, this language has not been supported by current prism config: ",n);const r=o(e.node.textContent,n);l(r.children).forEach((e=>{const n=t+e.text.length;if(e.className.length){const r=a.NZ.inline(t,n,{class:e.className.join(" ")});c.push(r)}t=n}))})),a.zF.create(e,c)}const u=(0,s.Qx)({configureRefractor:()=>{}},"prismConfig");u.meta={package:"@milkdown/plugin-prism",displayName:"Ctx<prism>"};const d=(0,s.Gf)((e=>{const{configureRefractor:t}=e.get(u.key),n="code_block";return new o.k_({key:new o.hs("MILKDOWN_PRISM"),state:{init:(e,{doc:r})=>{const o=t(i.L);return c(r,n,o??i.L)},apply:(e,t,o,s)=>{var a,l;const u=s.selection.$head.parent.type.name===n,d=o.selection.$head.parent.type.name===n,p=(0,r.xe)((e=>e.type.name===n))(o.doc),h=(0,r.xe)((e=>e.type.name===n))(s.doc);return e.docChanged&&(u||d||p.length!==h.length||(null==(a=p[0])?void 0:a.node.attrs.language)!==(null==(l=h[0])?void 0:l.node.attrs.language)||e.steps.some((e=>{const t=e;return void 0!==t.from&&void 0!==t.to&&p.some((e=>e.pos>=t.from&&e.pos+e.node.nodeSize<=t.to))})))?c(e.doc,n,i.L):t.map(e.mapping,e.doc)}},props:{decorations(e){return this.getState(e)}}})}));d.meta={package:"@milkdown/plugin-prism",displayName:"Prose<prism>"};const p=[d,u]},30072:(e,t,n)=>{var r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),d=Object.prototype.toString,p=Math.max,h=Math.min,f=function(){return u.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=i.test(e);return n||s.test(e)?a(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,s,a,l,c=0,u=!1,d=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,i=o;return r=o=void 0,c=t,s=e.apply(i,n)}function k(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function w(){var e=f();if(k(e))return v(e);a=setTimeout(w,function(e){var n=t-(e-l);return d?h(n,i-(e-c)):n}(e))}function v(e){return a=void 0,y&&r?b(e):(r=o=void 0,s)}function x(){var e=f(),n=k(e);if(r=arguments,o=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(w,t),u?b(e):s}(l);if(d)return a=setTimeout(w,t),b(l)}return void 0===a&&(a=setTimeout(w,t)),s}return t=g(t)||0,m(n)&&(u=!!n.leading,i=(d="maxWait"in n)?p(g(n.maxWait)||0,t):i,y="trailing"in n?!!n.trailing:y),x.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=o=a=void 0},x.flush=function(){return void 0===a?s:v(f())},x}},30537:(e,t,n)=>{"use strict";n.d(t,{vh:()=>Rt,_r:()=>It,RP:()=>Lt,kD:()=>Ft,pK:()=>Dt,bA:()=>ot,xu:()=>it,Te:()=>Xt,f$:()=>Ct,tt:()=>Nt,lW:()=>At,cq:()=>Tt,kr:()=>Ot,A7:()=>Mt,zF:()=>Pt,$l:()=>et});var r=n(1440),o=n(1854),i=n(80096),s=n(16512),a=n(27647),l=n(81570),c=n(2402),u=n(44254),d=n(25715),p=n(10660),h=n(17884);const f={tokenize:function(e,t,n){let r=0;return function t(i){return(87===i||119===i)&&r<3?(r++,e.consume(i),t):46===i&&3===r?(e.consume(i),o):n(i)};function o(e){return null===e?n(e):t(e)}},partial:!0},m={tokenize:function(e,t,n){let r,o,i;return s;function s(t){return 46===t||95===t?e.check(y,l,a)(t):null===t||(0,h.Ee)(t)||(0,h.Ny)(t)||45!==t&&(0,h.es)(t)?l(t):(i=!0,e.consume(t),s)}function a(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),s}function l(e){return o||r||!i?n(e):t(e)}},partial:!0},g={tokenize:function(e,t){let n=0,r=0;return o;function o(s){return 40===s?(n++,e.consume(s),o):41===s&&r<n?i(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(y,t,i)(s):null===s||(0,h.Ee)(s)||(0,h.Ny)(s)?t(s):(e.consume(s),o)}function i(t){return 41===t&&r++,e.consume(t),o}},partial:!0},y={tokenize:function(e,t,n){return r;function r(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),r):38===s?(e.consume(s),i):93===s?(e.consume(s),o):60===s||null===s||(0,h.Ee)(s)||(0,h.Ny)(s)?t(s):n(s)}function o(e){return null===e||40===e||91===e||(0,h.Ee)(e)||(0,h.Ny)(e)?t(e):r(e)}function i(e){return(0,h.CW)(e)?s(e):n(e)}function s(t){return 59===t?(e.consume(t),r):(0,h.CW)(t)?(e.consume(t),s):n(t)}},partial:!0},b={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return(0,h.lV)(e)?n(e):t(e)}},partial:!0},k={tokenize:function(e,t,n){const r=this;return function(t){return 87!==t&&119!==t||!C.call(r,r.previous)||T(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(f,e.attempt(m,e.attempt(g,o),n),n)(t))};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:C},w={tokenize:function(e,t,n){const r=this;let o="",i=!1;return function(t){return 72!==t&&104!==t||!A.call(r,r.previous)||T(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),s)};function s(t){if((0,h.CW)(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),s;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),a}return n(t)}function a(t){return 47===t?(e.consume(t),i?l:(i=!0,a)):n(t)}function l(t){return null===t||(0,h.JQ)(t)||(0,h.Ee)(t)||(0,h.Ny)(t)||(0,h.es)(t)?n(t):e.attempt(m,e.attempt(g,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:A},v={tokenize:function(e,t,n){const r=this;let o,i;return function(t){return O(t)&&N.call(r,r.previous)&&!T(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(t)):n(t)};function s(t){return O(t)?(e.consume(t),s):64===t?(e.consume(t),a):n(t)}function a(t){return 46===t?e.check(b,c,l)(t):45===t||95===t||(0,h.lV)(t)?(i=!0,e.consume(t),a):c(t)}function l(t){return e.consume(t),o=!0,a}function c(s){return i&&o&&(0,h.CW)(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:N},x={},S={text:x};let E=48;for(;E<123;)x[E]=v,E++,58===E?E=65:91===E&&(E=97);function C(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||(0,h.Ee)(e)}function A(e){return!(0,h.CW)(e)}function N(e){return!(47===e||O(e))}function O(e){return 43===e||45===e||46===e||95===e||(0,h.lV)(e)}function T(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}x[43]=v,x[45]=v,x[46]=v,x[95]=v,x[72]=[v,w],x[104]=[v,w],x[87]=[v,k],x[119]=[v,k];var M=n(35460),D=n(77508),I=n(26243);const R={tokenize:function(e,t,n){const r=this;return(0,D.N)(e,(function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function F(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){s=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!s||!s._balanced)return n(o);const a=(0,I.B)(r.sliceSerialize({start:s.end,end:r.now()}));return 94===a.codePointAt(0)&&i.includes(a.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)):n(o)}}function L(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[r+1],e[r+2],["enter",o,t],e[r+3],e[r+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(r,e.length-r+1,...l),e}function P(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),a};function a(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(a){if(s>999||93===a&&!i||null===a||91===a||(0,h.Ee)(a))return n(a);if(93===a){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes((0,I.B)(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(a)}return(0,h.Ee)(a)||(i=!0),s++,e.consume(a),92===a?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function B(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,s,a=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(a>999||93===t&&!s||null===t||91===t||(0,h.Ee)(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=(0,I.B)(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return(0,h.Ee)(t)||(s=!0),a++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),a++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),(0,D.N)(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function _(e,t,n){return e.check(M.B,t,e.attempt(R,t,n))}function z(e){e.exit("gfmFootnoteDefinition")}var $=n(43890),j=n(66990),U=n(23796);function H(e){let t=(e||{}).singleTilde;const n={tokenize:function(e,n,r){const o=this.previous,i=this.events;let s=0;return function(t){return 126===o&&"characterEscape"!==i[i.length-1][1].type?r(t):(e.enter("strikethroughSequenceTemporary"),a(t))};function a(i){const l=(0,j.S)(o);if(126===i)return s>1?r(i):(e.consume(i),s++,a);if(s<2&&!t)return r(i);const c=e.exit("strikethroughSequenceTemporary"),u=(0,j.S)(i);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(i)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const o={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",o,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],a=t.parser.constructs.insideSpan.null;a&&(0,$.m)(s,s.length,0,(0,U.W)(a,e.slice(r+1,n),t)),(0,$.m)(s,s.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",o,t]]),(0,$.m)(e,r-1,n-r+3,s),n=r+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class V{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let o=0;if(0!==n||0!==r.length){for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(((e,t)=>e[0]-t[0])),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1])),n.push(this.map[t][2]),e.length=this.map[t][0];n.push([...e]),e.length=0;let r=n.pop();for(;r;)e.push(...r),r=n.pop();this.map.length=0}}function W(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}const K={flow:{null:{tokenize:function(e,t,n){const r=this;let o,i=0,s=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?v:a;return i===v&&r.parser.lazy[r.now().line]?n(e):i(e)};function a(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(o=!0,s+=1),l(e)}(t)}function l(t){return null===t?n(t):(0,h.HP)(t)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):(0,h.On)(t)?(0,D.N)(e,l,"whitespace")(t):(s+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||(0,h.Ee)(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,(0,h.On)(t)?(0,D.N)(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?m(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):w(t)}function f(t){return(0,h.On)(t)?(0,D.N)(e,m,"whitespace")(t):m(t)}function m(t){return 58===t?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(s+=1,g(t)):null===t||(0,h.HP)(t)?k(t):w(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),y(t)):w(t)}function y(t){return 45===t?(e.consume(t),y):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(t))}function b(t){return(0,h.On)(t)?(0,D.N)(e,k,"whitespace")(t):k(t)}function k(n){return 124===n?p(n):(null===n||(0,h.HP)(n))&&o&&i===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):w(n)}function w(e){return n(e)}function v(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||(0,h.HP)(n)?(e.exit("tableRow"),t(n)):(0,h.On)(n)?(0,D.N)(e,x,"whitespace")(n):(e.enter("data"),S(n))}function S(t){return null===t||124===t||(0,h.Ee)(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?E:S)}function E(t){return 92===t||124===t?(e.consume(t),S):S(t)}},resolveAll:function(e,t){let n,r,o,i=-1,s=!0,a=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new V;for(;++i<e.length;){const h=e[i],f=h[1];"enter"===h[0]?"tableHead"===f.type?(u=!1,0!==d&&(G(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(s=!0,o=void 0,l=[0,0,0,0],c=[0,i+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",r,t]])),a="tableDelimiterRow"===f.type?2:r?3:1):!a||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(s?s=!1:(0!==l[1]&&(c[0]=c[1],o=q(p,t,l,a,void 0,o)),l=c,c=[l[1],i,0,0])):(s=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],o=q(p,t,l,a,void 0,o),l=[0,0,0,0]),c[2]=i)):"tableHead"===f.type?(u=!0,d=i):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=i,0!==l[1]?(c[0]=c[1],o=q(p,t,l,a,i,o)):0!==c[1]&&(o=q(p,t,c,a,i,o)),a=0):!a||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=i)}for(0!==d&&G(p,t,d,n,r),p.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=W(t.events,i))}return e}}}};function q(e,t,n,r,o,i){const s=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},J(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const a=J(t.events,n[1]);if(i={type:s,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=J(t.events,n[2]),i=J(t.events,n[3]),s={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",s,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==o&&(i.end=Object.assign({},J(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function G(e,t,n,r,o){const i=[],s=J(t.events,n);o&&(o.end=Object.assign({},s),i.push(["exit",o,t])),r.end=Object.assign({},s),i.push(["exit",r,t]),e.add(n+1,0,i)}function J(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const Y={tokenize:function(e,t,n){const r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o):n(t)};function o(t){return(0,h.Ee)(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(r){return(0,h.HP)(r)?t(r):(0,h.On)(r)?e.check({tokenize:X},t,n)(r):n(r)}}},Z={text:{91:Y}};function X(e,t,n){return(0,D.N)(e,(function(e){return null===e?n(e):t(e)}),"whitespace")}var Q=n(58999),ee=n(37096),te=n(66641),ne=n(15186);const re={}.hasOwnProperty;function oe(e){return"string"==typeof e?new RegExp((0,ee.A)(e),"g"):e}function ie(e){return"function"==typeof e?e:()=>e}const se="phrasing",ae=["autolink","link","image","label"],le={transforms:[function(e){!function(e,t,n,r){let o,i;"string"==typeof t||t instanceof RegExp?(i=[[t,n]],o=r):(i=t,o=n),o||(o={});const s=(0,ne.C)(o.ignore||[]),a=function(e){const t=[];if("object"!=typeof e)throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let n=-1;for(;++n<e.length;)t.push([oe(e[n][0]),ie(e[n][1])])}else{let n;for(n in e)re.call(e,n)&&t.push([oe(n),ie(e[n])])}return t}(i);let l=-1;for(;++l<a.length;)(0,te.VG)(e,"text",c);return e;function c(e,t){let n,r=-1;for(;++r<t.length;){const e=t[r];if(s(e,n?n.children.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=a[l][0],o=a[l][1];let i=0;const s=n.children.indexOf(e);let c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){const n=d.index,s={index:d.index,input:d.input,stack:[...t,e]};let a=o(...d,s);if("string"==typeof a&&(a=a.length>0?{type:"text",value:a}:void 0),!1!==a&&(i!==n&&u.push({type:"text",value:e.value.slice(i,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),i=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}return c?(i<e.value.length&&u.push({type:"text",value:e.value.slice(i)}),n.children.splice(s,1,...u)):u=[e],s+u.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,de],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,pe]],{ignore:["link","linkReference"]})}],enter:{literalAutolink:function(e){this.enter({type:"link",title:null,url:"",children:[]},e)},literalAutolinkEmail:ue,literalAutolinkHttp:ue,literalAutolinkWww:ue},exit:{literalAutolink:function(e){this.exit(e)},literalAutolinkEmail:function(e){this.config.exit.autolinkEmail.call(this,e)},literalAutolinkHttp:function(e){this.config.exit.autolinkProtocol.call(this,e)},literalAutolinkWww:function(e){this.config.exit.data.call(this,e),this.stack[this.stack.length-1].url="http://"+this.sliceSerialize(e)}}},ce={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:se,notInConstruct:ae},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:se,notInConstruct:ae},{character:":",before:"[ps]",after:"\\/",inConstruct:se,notInConstruct:ae}]};function ue(e){this.config.enter.autolinkProtocol.call(this,e)}function de(e,t,n,r,o){let i="";if(!he(o))return!1;if(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}(n))return!1;const s=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=(0,Q.D)(e,"(");let i=(0,Q.D)(e,")");for(;-1!==r&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function pe(e,t,n,r){return!(!he(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function he(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||(0,h.Ny)(n)||(0,h.es)(n))&&(!t||47!==n)}var fe=n(47938);function me(e){return e.label||!e.identifier?e.label||"":(0,fe.s)(e.identifier)}function ge(e,t,n,r){let o=r.join.length;for(;o--;){const i=r.join[o](e,t,n,r);if(!0===i||1===i)break;if("number"==typeof i)return"\n".repeat(1+i);if(!1===i)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const ye=/\r?\n|\r/g;function be(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function ke(e,t){return we(e,t.inConstruct,!0)&&!we(e,t.notInConstruct,!1)}function we(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ve(e,t,n){const r=(n.before||"")+(t||"")+(n.after||""),o=[],i=[],s={};let a=-1;for(;++a<e.unsafe.length;){const t=e.unsafe[a];if(!ke(e.stack,t))continue;const n=be(t);let i;for(;i=n.exec(r);){const e="before"in t||Boolean(t.atBreak),n="after"in t,r=i.index+(e?i[1].length:0);o.includes(r)?(s[r].before&&!e&&(s[r].before=!1),s[r].after&&!n&&(s[r].after=!1)):(o.push(r),s[r]={before:e,after:n})}}o.sort(xe);let l=n.before?n.before.length:0;const c=r.length-(n.after?n.after.length:0);for(a=-1;++a<o.length;){const e=o[a];e<l||e>=c||e+1<c&&o[a+1]===e+1&&s[e].after&&!s[e+1].before&&!s[e+1].after||o[a-1]===e-1&&s[e].before&&!s[e-1].before&&!s[e-1].after||(l!==e&&i.push(Se(r.slice(l,e),"\\")),l=e,!/[!-/:-@[-`{-~]/.test(r.charAt(e))||n.encode&&n.encode.includes(r.charAt(e))?(i.push("&#x"+r.charCodeAt(e).toString(16).toUpperCase()+";"),l++):i.push("\\"))}return i.push(Se(r.slice(l,c),n.after)),i.join("")}function xe(e,t){return e-t}function Se(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],o=[],i=e+t;let s,a=-1,l=0;for(;s=n.exec(i);)r.push(s.index);for(;++a<r.length;)l!==r[a]&&o.push(e.slice(l,r[a])),o.push("\\"),l=r[a];return o.push(e.slice(l)),o.join("")}function Ee(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,o=n.line||1,i=n.column||1;return{move:function(e){const t=e||"",n=t.split(/\r?\n|\r/g),s=n[n.length-1];return o+=n.length-1,i=1===n.length?i+s.length:1+s.length+r,t},current:function(){return{now:{line:o,column:i},lineShift:r}},shift:function(e){r+=e}}}function Ce(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ae(){this.buffer()}function Ne(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,I.B)(this.sliceSerialize(e)).toLowerCase()}function Oe(e){this.exit(e)}function Te(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Me(){this.buffer()}function De(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,I.B)(this.sliceSerialize(e)).toLowerCase()}function Ie(e){this.exit(e)}function Re(e,t,n,r){const o=Ee(r);let i=o.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return i+=o.move(ve(n,me(e),{...o.current(),before:i,after:"]"})),a(),s(),i+=o.move("]"),i}function Fe(e,t,n,r){const o=Ee(r);let i=o.move("[^");const s=n.enter("footnoteDefinition"),a=n.enter("label");return i+=o.move(ve(n,me(e),{...o.current(),before:i,after:"]"})),a(),i+=o.move("]:"+(e.children&&e.children.length>0?" ":"")),o.shift(4),i+=o.move(function(e,t){const n=[];let r,o=0,i=0;for(;r=ye.exec(e);)s(e.slice(o,r.index)),n.push(r[0]),o=r.index+r[0].length,i++;return s(e.slice(o)),n.join("");function s(e){n.push(t(e,i,!e))}}(function(e,t,n){const r=t.indexStack,o=e.children||[],i=t.createTracker(n),s=[];let a=-1;for(r.push(-1);++a<o.length;){const n=o[a];r[r.length-1]=a,s.push(i.move(t.handle(n,e,t,{before:"\n",after:"\n",...i.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),a<o.length-1&&s.push(i.move(ge(n,o[a+1],e,t)))}return r.pop(),s.join("")}(e,n,o.current()),Le)),s(),i}function Le(e,t,n){return 0===t?e:(n?"":" ")+e}function Pe(e,t,n){const r=t.indexStack,o=e.children||[],i=[];let s=-1,a=n.before;r.push(-1);let l=t.createTracker(n);for(;++s<o.length;){const c=o[s];let u;if(r[r.length-1]=s,s+1<o.length){let n=t.handle.handlers[o[s+1].type];n&&n.peek&&(n=n.peek),u=n?n(o[s+1],e,t,{before:"",after:"",...l.current()}).charAt(0):""}else u=n.after;i.length>0&&("\r"===a||"\n"===a)&&"html"===c.type&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=t.createTracker(n),l.move(i.join(""))),i.push(l.move(t.handle(c,e,t,{...l.current(),before:a,after:u}))),a=i[i.length-1].slice(-1)}return r.pop(),i.join("")}Re.peek=function(){return"["},ze.peek=function(){return"~"};const Be={canContainEols:["delete"],enter:{strikethrough:function(e){this.enter({type:"delete",children:[]},e)}},exit:{strikethrough:function(e){this.exit(e)}}},_e={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"]}],handlers:{delete:ze}};function ze(e,t,n,r){const o=Ee(r),i=n.enter("strikethrough");let s=o.move("~~");return s+=Pe(e,n,{...o.current(),before:s,after:"~"}),s+=o.move("~~"),i(),s}function $e(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=be(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}$e.peek=function(){return"`"};var je=n(67395);const Ue={enter:{table:function(e){const t=e._align;this.enter({type:"table",align:t.map((e=>"none"===e?null:e)),children:[]},e),this.setData("inTable",!0)},tableData:Ve,tableHeader:Ve,tableRow:function(e){this.enter({type:"tableRow",children:[]},e)}},exit:{codeText:function(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,We)),this.stack[this.stack.length-1].value=t,this.exit(e)},table:function(e){this.exit(e),this.setData("inTable")},tableData:He,tableHeader:He,tableRow:He}};function He(e){this.exit(e)}function Ve(e){this.enter({type:"tableCell",children:[]},e)}function We(e,t){return"|"===t?t:e}function Ke(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:function(e,t,n,r){return a(function(e,t,n){const r=e.children;let o=-1;const i=[],s=t.enter("table");for(;++o<r.length;)i[o]=l(r[o],t,n);return s(),i}(e,n,r),e.align)},tableRow:function(e,t,n,r){const o=a([l(e,n,r)]);return o.slice(0,o.indexOf("\n"))},tableCell:s,inlineCode:function(e,t,n){let r=$e(e,0,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r}}};function s(e,t,n,r){const o=n.enter("tableCell"),s=n.enter("phrasing"),a=Pe(e,n,{...r,before:i,after:i});return s(),o(),a}function a(e,t){return(0,je.Q)(e,{align:t,alignDelimiters:r,padding:n,stringLength:o})}function l(e,t,n){const r=e.children;let o=-1;const i=[],a=t.enter("tableRow");for(;++o<r.length;)i[o]=s(r[o],0,t,n);return a(),i}}const qe={exit:{taskListCheckValueChecked:Je,taskListCheckValueUnchecked:Je,paragraph:function(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1],n=e.children[0];if(n&&"text"===n.type){const r=t.children;let o,i=-1;for(;++i<r.length;){const e=r[i];if("paragraph"===e.type){o=e;break}}o===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}}},Ge={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:function(e,t,n,r){const o=e.children[0],i="boolean"==typeof e.checked&&o&&"paragraph"===o.type,s="["+(e.checked?"x":" ")+"] ",a=Ee(r);i&&a.move(s);let l=function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"tab";if(1===t||"1"===t)return"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||function(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let s=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));const a=n.createTracker(r);a.move(i+" ".repeat(s-i.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),(function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?i:i+" ".repeat(s-i.length))+e}));return l(),c}(e,t,n,{...r,...a.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,(function(e){return e+s}))),l}}};function Je(e){this.stack[this.stack.length-2].checked="taskListCheckValueChecked"===e.type}function Ye(e={}){const t=this.data();function n(e,n){(t[e]?t[e]:t[e]=[]).push(n)}n("micromarkExtensions",function(e){return(0,p.y)([S,{document:{91:{tokenize:B,continuation:{tokenize:_},exit:z}},text:{91:{tokenize:P},93:{add:"after",tokenize:F,resolveTo:L}}},H(e),K,Z])}(e)),n("fromMarkdownExtensions",[le,{enter:{gfmFootnoteDefinition:Ce,gfmFootnoteDefinitionLabelString:Ae,gfmFootnoteCall:Te,gfmFootnoteCallString:Me},exit:{gfmFootnoteDefinition:Oe,gfmFootnoteDefinitionLabelString:Ne,gfmFootnoteCall:Ie,gfmFootnoteCallString:De}},Be,Ue,qe]),n("toMarkdownExtensions",function(e){return{extensions:[ce,{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:Fe,footnoteReference:Re}},_e,Ke(e),Ge]}}(e))}const Ze=(e,t)=>(Object.assign(e,{meta:{package:"@milkdown/preset-gfm",...t}}),e),Xe=(0,s.JY)("strike_through");Ze(Xe,{displayName:"Attr<strikethrough>",group:"Strikethrough"});const Qe=(0,s.hk)("strike_through",(e=>({inclusive:!1,parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>"line-through"===e}],toDOM:t=>["del",e.get(Xe.key)(t)],parseMarkdown:{match:e=>"delete"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strike_through"===e.type.name,runner:(e,t)=>{e.withMark(t,"delete")}}})));Ze(Qe.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"}),Ze(Qe.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});const et=(0,s.yu)("ToggleStrikeThrough",(()=>()=>(0,d.wh)(Qe.type())));Ze(et,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});const tt=(0,s.pq)("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:e=>{const t=e.get(a.MD);return()=>t.call(et.key)}}});Ze(tt.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"}),Ze(tt.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});const nt=(e=3,t=3)=>{const n=Array(t).fill(0).map((()=>kt.type().createAndFill())),r=Array(t).fill(0).map((()=>wt.type().createAndFill())),o=Array(e).fill(0).map(((e,t)=>bt.type().create(null,0===t?r:n)));return yt.type().create(null,o)},rt=e=>(0,u.KP)((e=>"table"===e.type.spec.tableRole))(e),ot=(e,t)=>{const n=rt(t);if(!n)return;const r=c.J3.get(n.node);return e<0||e>=r.width?void 0:r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map((e=>{const t=n.node.nodeAt(e);if(!t)return;const r=e+n.start;return{pos:r,start:r+1,node:t}})).filter((e=>null!=e))},it=(e,t)=>{const n=rt(t);if(!n)return;const r=c.J3.get(n.node);return e<0||e>=r.height?void 0:r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map((e=>{const t=n.node.nodeAt(e);if(!t)return;const r=e+n.start;return{pos:r,start:r+1,node:t}})).filter((e=>null!=e))};function st(e,{map:t,tableStart:n,table:r},o){const i=Array(o).fill(0).reduce(((e,t,n)=>e+r.child(n).nodeSize),n),s=Array(t.width).fill(0).map(((e,n)=>{const o=r.nodeAt(t.map[n]);return kt.type().createAndFill({alignment:null==o?void 0:o.attrs.alignment})}));return e.insert(i,bt.type().create(null,s)),e}const at=e=>t=>n=>{const r=rt(n.selection),o="row"===e;if(r){const e=c.J3.get(r.node);if(t>=0&&t<(o?e.height:e.width)){const i=e.positionAt(o?t:e.height-1,o?e.width-1:t,r.node),s=n.doc.resolve(r.start+i),a=o?c.rn.rowSelection:c.rn.colSelection,l=e.positionAt(o?t:0,o?0:t,r.node),d=n.doc.resolve(r.start+l);return(0,u.I9)(n.setSelection(a(s,d)))}}return n},lt=at("row"),ct=at("col"),ut=e=>e[0].map(((t,n)=>e.map((e=>e[n])))),dt=(e,t)=>{const n=[],r=c.J3.get(e);for(let o=0;o<r.height;o++){const i=e.child(o),s=[];for(let n=0;n<r.width;n++){if(!t[o][n])continue;const i=r.map[o*r.width+n],a=t[o][n],l=e.nodeAt(i).type.createChecked(Object.assign({},a.attrs),a.content,a.marks);s.push(l)}n.push(i.type.createChecked(i.attrs,s,i.marks))}return e.type.createChecked(e.attrs,n,e.marks)},pt=e=>{const t=c.J3.get(e),n=[];for(let r=0;r<t.height;r++){const o=[],i={};for(let n=0;n<t.width;n++){const s=t.map[r*t.width+n],a=e.nodeAt(s),l=t.findCell(s);i[s]||l.top!==r?o.push(null):(i[s]=!0,o.push(a))}n.push(o)}return n},ht=(e,t,n,r)=>{const o=t[0]>n[0]?-1:1,i=e.splice(t[0],t.length),s=i.length%2==0?1:0;let a;return a=-1===r&&1===o?n[0]-1:1===r&&-1===o?n[n.length-1]-s+1:-1===o?n[0]:n[n.length-1]-s,e.splice(a,0,...i),e},ft=(e,t)=>{let n=e,r=e;for(let o=e;o>=0;o--){const e=ot(o,t.selection);e&&e.forEach((e=>{const t=e.node.attrs.colspan+o-1;t>=n&&(n=o),t>r&&(r=t)}))}for(let n=e;n<=r;n++){const e=ot(n,t.selection);e&&e.forEach((e=>{const t=e.node.attrs.colspan+n-1;e.node.attrs.colspan>1&&t>r&&(r=t)}))}const o=[];for(let e=n;e<=r;e++){const n=ot(e,t.selection);n&&n.length&&o.push(e)}n=o[0],r=o[o.length-1];const i=ot(n,t.selection),s=it(0,t.selection),a=t.doc.resolve(i[i.length-1].pos);let l;for(let e=r;e>=n;e--){const n=ot(e,t.selection);if(n&&n.length){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){l=n[0];break}if(l)break}}return{$anchor:a,$head:t.doc.resolve(l.pos),indexes:o}},mt=(e,t)=>{let n=e,r=e;for(let o=e;o>=0;o--)it(o,t.selection).forEach((e=>{const t=e.node.attrs.rowspan+o-1;t>=n&&(n=o),t>r&&(r=t)}));for(let n=e;n<=r;n++)it(n,t.selection).forEach((e=>{const t=e.node.attrs.rowspan+n-1;e.node.attrs.rowspan>1&&t>r&&(r=t)}));const o=[];for(let e=n;e<=r;e++){const n=it(e,t.selection);n&&n.length&&o.push(e)}n=o[0],r=o[o.length-1];const i=it(n,t.selection),s=ot(0,t.selection),a=t.doc.resolve(i[i.length-1].pos);let l;for(let e=r;e>=n;e--){const n=it(e,t.selection);if(n&&n.length){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){l=n[0];break}if(l)break}}return{$anchor:a,$head:t.doc.resolve(l.pos),indexes:o}};const gt=(0,c.of)({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:e=>e.style.textAlign||"left",setDOMAttr:(e,t)=>{t.style=`text-align: ${e||"left"}`}}}}),yt=(0,s.Yh)("table",(()=>({...gt.table,parseMarkdown:{match:e=>"table"===e.type,runner:(e,t,n)=>{const r=t.align,o=t.children.map(((e,t)=>({...e,align:r,isHeader:0===t})));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table"===e.type.name,runner:(e,t)=>{var n;const r=null==(n=t.content.firstChild)?void 0:n.content;if(!r)return;const o=[];r.forEach((e=>{o.push(e.attrs.alignment)})),e.openNode("table",void 0,{align:o}),e.next(t.content),e.closeNode()}}})));Ze(yt.node,{displayName:"NodeSchema<table>",group:"Table"}),Ze(yt.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});const bt=(0,s.Yh)("table_row",(()=>({...gt.table_row,parseMarkdown:{match:e=>"tableRow"===e.type,runner:(e,t,n)=>{const r=t.align,o=t.children.map(((e,n)=>({...e,align:r[n],isHeader:t.isHeader})));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table_row"===e.type.name,runner:(e,t)=>{e.openNode("tableRow"),e.next(t.content),e.closeNode()}}})));Ze(bt.node,{displayName:"NodeSchema<tableRow>",group:"Table"}),Ze(bt.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});const kt=(0,s.Yh)("table_cell",(()=>({...gt.table_cell,parseMarkdown:{match:e=>"tableCell"===e.type&&!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>"table_cell"===e.type.name,runner:(e,t)=>{e.openNode("tableCell").next(t.content).closeNode()}}})));Ze(kt.node,{displayName:"NodeSchema<tableCell>",group:"Table"}),Ze(kt.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});const wt=(0,s.Yh)("table_header",(()=>({...gt.table_header,parseMarkdown:{match:e=>"tableCell"===e.type&&!!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>"table_header"===e.type.name,runner:(e,t)=>{e.openNode("tableCell"),e.next(t.content),e.closeNode()}}})));Ze(wt.node,{displayName:"NodeSchema<tableHeader>",group:"Table"}),Ze(wt.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});const vt=(0,s.b_)((()=>new i.fV(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,((e,t,n,r)=>{var o,i;const s=e.doc.resolve(n);if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),yt.type()))return null;const a=nt(Number(null==(o=t.groups)?void 0:o.row),Number(null==(i=t.groups)?void 0:i.col)),c=e.tr.replaceRangeWith(n,r,a).scrollIntoView();return c.setSelection(l.U3.create(c.doc,n+3))}))));Ze(vt,{displayName:"InputRule<insertTableInputRule>",group:"Table"});const xt=(0,s.yu)("GoToPrevTableCell",(()=>()=>(0,c.D8)(-1)));Ze(xt,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});const St=(0,s.yu)("GoToNextTableCell",(()=>()=>(0,c.D8)(1)));Ze(St,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});const Et=(0,s.yu)("BreakTable",(()=>()=>(e,t)=>{if(!(0,c.aH)(e))return!1;const{$head:n}=e.selection,r=n.after(),i=e.tr.replaceWith(r,r,o.Wf.type().createAndFill());return i.setSelection(l.LN.near(i.doc.resolve(r),1)).scrollIntoView(),null==t||t(i),!0}));Ze(Et,{displayName:"Command<breakTableCommand>",group:"Table"});const Ct=(0,s.yu)("InsertTable",(()=>({row:e,col:t}={})=>(n,r)=>{const{selection:o,tr:i}=n,{from:s}=o,a=nt(e,t),c=i.replaceSelectionWith(a),u=l.LN.findFrom(c.doc.resolve(s),1,!0);return u&&(null==r||r(c.setSelection(u))),!0}));Ze(Ct,{displayName:"Command<insertTableCommand>",group:"Table"});const At=(0,s.yu)("MoveRow",(()=>({from:e,to:t}={})=>(n,r)=>{const{tr:o}=n,i=null==r?void 0:r(function(e,t,n,r=!0){const o=rt(e.selection);if(!o)return e;const{indexes:i}=mt(t,e),{indexes:s}=mt(n,e);if(i.includes(n))return e;const a=((e,t,n)=>{let r=pt(e.node);return r=ht(r,t,n,0),dt(e.node,r)})(o,i,s),l=(0,u.I9)(e).replaceWith(o.pos,o.pos+o.node.nodeSize,a);if(!r)return l;const d=c.J3.get(a),p=o.start,h=n,f=d.positionAt(h,d.width-1,a),m=l.doc.resolve(p+f),g=c.rn.rowSelection,y=d.positionAt(h,0,a),b=l.doc.resolve(p+y);return l.setSelection(g(m,b))}(o,e??0,t??0,!0));return Boolean(i)}));Ze(At,{displayName:"Command<moveRowCommand>",group:"Table"});const Nt=(0,s.yu)("MoveCol",(()=>({from:e,to:t}={})=>(n,r)=>{const{tr:o}=n,i=null==r?void 0:r(function(e,t,n,r=!0){const o=rt(e.selection);if(!o)return e;const{indexes:i}=ft(t,e),{indexes:s}=ft(n,e);if(i.includes(n))return e;const a=((e,t,n)=>{let r=ut(pt(e.node));return r=ht(r,t,n,0),r=ut(r),dt(e.node,r)})(o,i,s),l=(0,u.I9)(e).replaceWith(o.pos,o.pos+o.node.nodeSize,a);if(!r)return l;const d=c.J3.get(a),p=o.start,h=n,f=d.positionAt(d.height-1,h,a),m=l.doc.resolve(p+f),g=c.rn.colSelection,y=d.positionAt(0,h,a),b=l.doc.resolve(p+y);return l.setSelection(g(m,b))}(o,e??0,t??0,!0));return Boolean(i)}));Ze(Nt,{displayName:"Command<moveColCommand>",group:"Table"});const Ot=(0,s.yu)("SelectRow",(()=>(e=0)=>(t,n)=>{const{tr:r}=t,o=null==n?void 0:n(lt(e)(r));return Boolean(o)}));Ze(Ot,{displayName:"Command<selectRowCommand>",group:"Table"});const Tt=(0,s.yu)("SelectCol",(()=>(e=0)=>(t,n)=>{const{tr:r}=t,o=null==n?void 0:n(ct(e)(r));return Boolean(o)}));Ze(Tt,{displayName:"Command<selectColCommand>",group:"Table"});const Mt=(0,s.yu)("SelectTable",(()=>()=>(e,t)=>{const{tr:n}=e,r=null==t?void 0:t((e=>{const t=(e=>{const t=rt(e);if(!t)return;const n=c.J3.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map((e=>{const n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}}))})(e.selection);if(t&&t[0]){const n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){const t=e.doc.resolve(r.pos);return(0,u.I9)(e.setSelection(new c.rn(t,n)))}}return e})(n));return Boolean(r)}));Ze(Mt,{displayName:"Command<selectTableCommand>",group:"Table"});const Dt=(0,s.yu)("DeleteSelectedCells",(()=>()=>(e,t)=>{const{selection:n}=e;if(!(n instanceof c.rn))return!1;const r=n.isRowSelection(),o=n.isColSelection();return r&&o?(0,c.kG)(e,t):o?(0,c.gR)(e,t):(0,c.aR)(e,t)}));Ze(Dt,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});const It=(0,s.yu)("AddColBefore",(()=>()=>c.RC));Ze(It,{displayName:"Command<addColBeforeCommand>",group:"Table"});const Rt=(0,s.yu)("AddColAfter",(()=>()=>c.GU));Ze(Rt,{displayName:"Command<addColAfterCommand>",group:"Table"});const Ft=(0,s.yu)("AddRowBefore",(()=>()=>(e,t)=>{if(!(0,c.aH)(e))return!1;if(t){const n=(0,c._t)(e);t(st(e.tr,n,n.top))}return!0}));Ze(Ft,{displayName:"Command<addRowBeforeCommand>",group:"Table"});const Lt=(0,s.yu)("AddRowAfter",(()=>()=>(e,t)=>{if(!(0,c.aH)(e))return!1;if(t){const n=(0,c._t)(e);t(st(e.tr,n,n.bottom))}return!0}));Ze(Lt,{displayName:"Command<addRowAfterCommand>",group:"Table"});const Pt=(0,s.yu)("SetAlign",(()=>(e="left")=>(0,c.i4)("alignment",e)));Ze(Pt,{displayName:"Command<setAlignCommand>",group:"Table"});const Bt=(0,s.pq)("tableKeymap",{NextCell:{shortcuts:["Mod-]","Tab"],command:e=>{const t=e.get(a.MD);return()=>t.call(St.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:e=>{const t=e.get(a.MD);return()=>t.call(xt.key)}},ExitTable:{shortcuts:["Mod-Enter"],command:e=>{const t=e.get(a.MD);return()=>t.call(Et.key)}}});Ze(Bt.ctx,{displayName:"KeymapCtx<table>",group:"Table"}),Ze(Bt.shortcuts,{displayName:"Keymap<table>",group:"Table"});const _t="footnote_definition",zt="footnoteDefinition",$t=(0,s.Yh)("footnote_definition",(()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:""}},parseDOM:[{tag:`dl[data-type="${_t}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,r.Ik)(e);return{label:e.dataset.label}},contentElement:"dd"}],toDOM:e=>{const t=e.attrs.label;return["dl",{"data-label":t,"data-type":_t},["dt",t],["dd",0]]},parseMarkdown:{match:({type:e})=>e===zt,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===_t,runner:(e,t)=>{e.openNode(zt,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}})));Ze($t.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"}),Ze($t.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});const jt="footnote_reference",Ut=(0,s.Yh)("footnote_reference",(()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:""}},parseDOM:[{tag:`sup[data-type="${jt}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,r.Ik)(e);return{label:e.dataset.label}}}],toDOM:e=>{const t=e.attrs.label;return["sup",{"data-label":t,"data-type":jt},t]},parseMarkdown:{match:({type:e})=>"footnoteReference"===e,runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===jt,runner:(e,t)=>{e.addNode("footnoteReference",void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}})));Ze(Ut.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"}),Ze(Ut.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});const Ht=o.hm.extendSchema((e=>t=>{const n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,r.Ik)(e);return{label:e.dataset.label,listType:e.dataset["list-type"],spread:e.dataset.spread,checked:e.dataset.checked?"true"===e.dataset.checked:null}}},...(null==n?void 0:n.parseDOM)||[]],toDOM:e=>n.toDOM&&null==e.attrs.checked?n.toDOM(e):["li",{"data-item-type":"task","data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread,"data-checked":e.attrs.checked},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,r)=>{if(null==t.checked)return void n.parseMarkdown.runner(e,t,r);const o=null!=t.label?`${t.label}.`:"•",i=null!=t.checked?Boolean(t.checked):null,s=null!=t.label?"ordered":"bullet",a=null!=t.spread?`${t.spread}`:"true";e.openNode(r,{label:o,listType:s,spread:a,checked:i}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{if(null==t.attrs.checked)return void n.toMarkdown.runner(e,t);const r=t.attrs.label,o=t.attrs.listType,i="true"===t.attrs.spread,s=t.attrs.checked;e.openNode("listItem",void 0,{label:r,listType:o,spread:i,checked:s}),e.next(t.content),e.closeNode()}}}}));Ze(Ht,{displayName:"NodeSchema<listItem>",group:"ListItem"});const Vt=(0,s.b_)((()=>new i.fV(/^\[(?<checked>\s|x)\]\s$/,((e,t,n,r)=>{var o;const i=e.doc.resolve(n);let s=0,a=i.node(s);for(;a&&"list_item"!==a.type.name;)s--,a=i.node(s);if(!a||null!=a.attrs.checked)return null;const l=Boolean("x"===(null==(o=t.groups)?void 0:o.checked)),c=i.before(s),u=e.tr;return u.deleteRange(n,r).setNodeMarkup(c,void 0,{...a.attrs,checked:l}),u}))));Ze(Vt,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});const Wt=[tt,Bt].flat(),Kt=[vt,Vt],qt=(0,s.Gf)((()=>{const e=new l.hs("MILKDOWN_AUTO_INSERT_ZERO_SPACE"),t=e=>e.type===o.Wf.type();return new l.k_({key:e,props:{handleDOMEvents:{compositionstart(e){const{state:n,dispatch:r}=e,{tr:o,selection:i}=n,{$from:s}=i;return u.T.safari&&(0,c.aH)(n)&&i.empty&&(e=>t(e)&&2===e.nodeSize)(s.parent)&&r(o.insertText("⁠",s.start())),!1},compositionend(e){const{state:n,dispatch:r}=e,{tr:o,selection:i}=n,{$from:s}=i;return u.T.safari&&(0,c.aH)(n)&&i.empty&&t(s.parent)&&s.parent.textContent.startsWith("⁠")&&r(o.delete(s.start(),s.start()+1)),!1}}}})}));Ze(qt,{displayName:"Prose<autoInsertZeroSpaceInTablePlugin>",group:"Prose"});const Gt=(0,s.Gf)((()=>(0,c.AL)({})));Ze(Gt,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});const Jt=(0,s.Gf)((()=>(0,c.LF)()));Ze(Jt,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});const Yt=(0,s.lz)((()=>Ye));Ze(Yt,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"});const Zt=[qt,Gt,Jt,Yt],Xt=[[Ht,yt,bt,wt,kt,$t,Ut,Xe,Qe].flat(),Kt,Wt,Zt,[St,xt,Et,Ct,At,Nt,Ot,Tt,Mt,Dt,Ft,Lt,It,Rt,Pt,et]].flat()},33971:(e,t,n)=>{"use strict";n.d(t,{vo:()=>D,e2:()=>y,$X:()=>k,hi:()=>x,Uv:()=>E,W4:()=>N,rJ:()=>T});var r,o,i,s,a=n(18769),l=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},c=(e,t,n)=>(((e,t)=>{if(!t.has(e))throw TypeError("Cannot access private method")})(e,t),n);class u{constructor({node:e,view:t,getPos:n,decorations:o,innerDecorations:i,options:s}){l(this,r),this.selected=!1,this.selectNode=()=>{var e,t;this.selected=!0,null==(t=(e=this.options).selectNode)||t.call(e)},this.deselectNode=()=>{var e,t;this.selected=!1,null==(t=(e=this.options).deselectNode)||t.call(e)},this.shouldUpdate=e=>!(e.type!==this.node.type||e.sameMarkup(this.node)&&e.content.eq(this.node.content)),this.update=(e,t,n)=>{var r,o;const i=this.options.update;let s;return i&&(s=i(e,t,n)),"boolean"!=typeof s&&(s=this.shouldUpdate(e)),this.node=e,this.decorations=t,this.innerDecorations=n,s&&(null==(o=(r=this.options).onUpdate)||o.call(r)),s},this.shouldIgnoreMutation=e=>!(this.dom&&this.contentDOM&&!this.node.isLeaf&&!this.node.isAtom)||"selection"!==e.type&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)),this.ignoreMutation=e=>{if(!this.dom||!this.contentDOM)return!0;let t;const n=this.options.ignoreMutation;return n&&(t=n(e)),"boolean"!=typeof t&&(t=this.shouldIgnoreMutation(e)),t},this.destroy=()=>{var e,t,n;null==(t=(e=this.options).destroy)||t.call(e),this.dom.remove(),null==(n=this.contentDOM)||n.remove()},this.setAttrs=e=>{const{dispatch:t,state:n}=this.view,r=this.getPos();if("number"==typeof r)return t(n.tr.setNodeMarkup(r,void 0,{...this.node.attrs,...e}))},this.node=e,this.view=t,this.getPos=n,this.decorations=o,this.innerDecorations=i,this.options=s,this.dom=this.createDOM(s.as),this.contentDOM=e.isLeaf?null:this.createContentDOM(s.contentAs),this.dom.setAttribute("data-node-view-root","true"),this.contentDOM&&(this.contentDOM.setAttribute("data-node-view-content","true"),this.contentDOM.style.whiteSpace="inherit"),this.setSelection=s.setSelection,this.stopEvent=s.stopEvent}createDOM(e){return c(this,r,o).call(this,e)}createContentDOM(e){return c(this,r,o).call(this,e)}get component(){return this.options.component}}r=new WeakSet,o=function(e){const{node:t}=this;return null==e?document.createElement(t.isInline?"span":"div"):e instanceof HTMLElement?e:e instanceof Function?e(t):document.createElement(e)};class d{constructor(e){this.view=e.view,this.options=e.options}get component(){return this.options.component}get root(){var e,t;let n=null==(t=(e=this.options).root)?void 0:t.call(e,this.view.dom);return n||(n=this.view.dom.parentElement??document.body),n}update(e,t){var n,r;this.view=e,this.prevState=t,null==(r=(n=this.options).update)||r.call(n,e,t)}destroy(){var e,t;null==(t=(e=this.options).destroy)||t.call(e)}}class p{constructor({pos:e,spec:t,options:n}){l(this,i),this.pos=e,this.options=n,this.spec=t,this.dom=c(this,i,s).call(this,n.as),this.dom.setAttribute("data-widget-view-root","true")}bind(e,t){this.view=e,this.getPos=t}get component(){return this.options.component}}i=new WeakSet,s=function(e){return e instanceof HTMLElement?e:document.createElement(e)};var h=n(99742),f=n(59435),m=n(73686);const g=(0,a.createContext)({contentRef:()=>{},view:null,getPos:()=>0,setAttrs:()=>{},node:null,selected:!1,decorations:[],innerDecorations:null}),y=()=>(0,a.useContext)(g),b=(0,a.createContext)((e=>{throw new Error("out of scope")})),k=()=>(0,a.useContext)(b);class w extends u{constructor(){super(...arguments),this.key=(0,h.Ak)(),this.context={contentRef:e=>{e&&this.contentDOM&&e.firstChild!==this.contentDOM&&e.appendChild(this.contentDOM)},view:this.view,getPos:this.getPos,setAttrs:this.setAttrs,node:this.node,selected:this.selected,decorations:this.decorations,innerDecorations:this.innerDecorations},this.updateContext=()=>{Object.assign(this.context,{node:this.node,selected:this.selected,decorations:this.decorations,innerDecorations:this.innerDecorations})},this.render=()=>{const e=this.component;return(0,f.createPortal)(a.createElement(g.Provider,{value:this.context},a.createElement(e,null)),this.dom,this.key)}}}const v=(0,a.createContext)({view:null}),x=()=>(0,a.useContext)(v),S=(0,a.createContext)((e=>{throw new Error("out of scope")})),E=()=>(0,a.useContext)(S);class C extends d{constructor(){super(...arguments),this.key=(0,h.Ak)(),this.context={view:this.view,prevState:this.prevState},this.updateContext=()=>{Object.assign(this.context,{view:this.view,prevState:this.prevState})},this.render=()=>{const e=this.component;return(0,f.createPortal)(a.createElement(v.Provider,{value:this.context},a.createElement(e,null)),this.root,this.key)}}}const A=(0,a.createContext)({view:null,getPos:()=>{}}),N=()=>(0,a.useContext)(A),O=(0,a.createContext)((e=>{throw new Error("out of scope")})),T=()=>(0,a.useContext)(O);class M extends p{constructor(){super(...arguments),this.key=(0,h.Ak)(),this.context={view:this.view,getPos:this.getPos,spec:this.spec},this.updateContext=()=>{Object.assign(this.context,{view:this.view,getPos:this.getPos,spec:this.spec})},this.render=()=>{const e=this.component;return(0,f.createPortal)(a.createElement(A.Provider,{value:this.context},a.createElement(e,null)),this.dom,this.key)}}}const D=({children:e})=>{const{renderReactRenderer:t,removeReactRenderer:n,portals:r}=(()=>{const[e,t]=(0,a.useState)({}),n=(0,a.useRef)(!1);(0,a.useEffect)((()=>(requestAnimationFrame((()=>{n.current=!0})),()=>{n.current=!1})),[]);const r=(0,a.useCallback)((e=>{n.current?(0,f.flushSync)(e):e()}),[]);return{portals:e,renderReactRenderer:(0,a.useCallback)(((e,n=!0)=>{r((()=>{n&&e.updateContext(),t((t=>({...t,[e.key]:e.render()})))}))}),[r]),removeReactRenderer:(0,a.useCallback)((e=>{r((()=>{t((t=>{const n={...t};return delete n[e.key],n}))}))}),[r])}})(),o=((e,t)=>(0,a.useCallback)((n=>(r,o,i,s,a)=>{const l=new w({node:r,view:o,getPos:i,decorations:s,innerDecorations:a,options:{...n,onUpdate(){var t;null==(t=n.onUpdate)||t.call(n),e(l)},selectNode(){var t;null==(t=n.selectNode)||t.call(n),e(l)},deselectNode(){var t;null==(t=n.deselectNode)||t.call(n),e(l)},destroy(){var e;null==(e=n.destroy)||e.call(n),t(l)}}});return e(l,!1),l}),[t,e]))(t,n),i=((e,t)=>(0,a.useCallback)((n=>r=>{const o=new C({view:r,options:{...n,update:(t,r)=>{var i;null==(i=n.update)||i.call(n,t,r),e(o)},destroy:()=>{var e;null==(e=n.destroy)||e.call(n),t(o)}}});return e(o,!1),o}),[t,e]))(t,n),s=((e,t)=>(0,a.useCallback)((n=>(r,o={})=>{const i=new M({pos:r,options:n}),s={...o,destroy:e=>{var n;null==(n=o.destroy)||n.call(o,e),t(i)}};return i.spec=s,m.NZ.widget(r,((t,n)=>(i.bind(t,n),e(i),i.dom)),s)}),[t,e]))(t,n),l=(0,a.useMemo)((()=>Object.values(r)),[r]);return a.createElement(b.Provider,{value:o},a.createElement(S.Provider,{value:i},a.createElement(O.Provider,{value:s},e,l)))}},35435:(e,t,n)=>{"use strict";n.d(t,{pZ:()=>a});var r=n(81570),o=n(16512);const i=(0,o.Qx)({type:"space",size:2},"indentConfig");i.meta={package:"@milkdown/plugin-indent",displayName:"Ctx<indentConfig>"};const s=(0,o.Ht)((e=>({Tab:(t,n)=>{const o=e.get(i.key),{tr:s}=t,a=((e,t)=>{const{doc:n,selection:o}=e;if(!n||!o||!(o instanceof r.U3||o instanceof r.i5))return e;const{to:i}=o,s="space"===t.type?Array(t.size).fill(" ").join(""):"\t";return e.insertText(s,i)})(s,o);return!!a.docChanged&&(null==n||n(a),!0)}})));s.meta={package:"@milkdown/plugin-indent",displayName:"Shortcut<indent>"};const a=[i,s]},35460:(e,t,n)=>{"use strict";n.d(t,{B:()=>i});var r=n(77508),o=n(17884);const i={tokenize:function(e,t,n){return function(t){return(0,o.On)(t)?(0,r.N)(e,i,"linePrefix")(t):i(t)};function i(e){return null===e||(0,o.HP)(e)?t(e):n(e)}},partial:!0}},37082:(e,t,n)=>{"use strict";n.d(t,{L:()=>Ye});var r={};function o(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}function i(e){e.register(o),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}function s(e){e.register(i),function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(e)}function a(e){e.register(s),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}function l(e){!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],i=r.variable[1].inside,s=0;s<o.length;s++)i[o[s]]=e.languages.bash[o[s]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash}(e)}function c(e){e.register(o),function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,n){return"(?:"+t[+n]+")"}))}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,(function(){return"(?:"+e+")"}));return e.replace(/<<self>>/g,"[^\\s\\S]")}var o="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",i="class enum interface record struct",s="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",a="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(i),u=RegExp(l(o+" "+i+" "+s+" "+a)),d=l(i+" "+s+" "+a),p=l(o+" "+i+" "+a),h=r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),f=r(/\((?:[^()]|<<self>>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,g=t(/<<0>>(?:\s*<<1>>)?/.source,[m,h]),y=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,g]),b=/\[\s*(?:,\s*)*\]/.source,k=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[y,b]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[h,f,b]),v=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),x=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[v,y,b]),S={keyword:u,punctuation:/[<>()?,.:[\]]/},E=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,C=/"(?:\\.|[^\\"\r\n])*"/.source,A=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[C]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[y]),lookbehind:!0,inside:S},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,x]),lookbehind:!0,inside:S},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[c,g]),lookbehind:!0,inside:S},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[y]),lookbehind:!0,inside:S},{pattern:n(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[k]),lookbehind:!0,inside:S},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[x,p,m]),inside:S}],keyword:u,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:S},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[x,y]),inside:S,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[x]),lookbehind:!0,inside:S,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,h]),inside:{function:n(/^<<0>>/.source,[m]),generic:{pattern:RegExp(h),alias:"class-name",inside:S}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,g,m,x,u.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[g,f]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:u,"class-name":{pattern:RegExp(x),greedy:!0,inside:S},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var N=C+"|"+E,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[N]),T=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[O]),2),M=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,D=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[y,T]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[M,D]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[M]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[T]),inside:e.languages.csharp},"class-name":{pattern:RegExp(y),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var I=/:[^}\r\n]+/.source,R=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[O]),2),F=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[R,I]),L=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[N]),2),P=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,I]);function B(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,I]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[F]),lookbehind:!0,greedy:!0,inside:B(F,R)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[P]),lookbehind:!0,greedy:!0,inside:B(P,L)}],char:{pattern:RegExp(E),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(e)}function u(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.value.replace(/&amp;/,"&"))})),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return t})),"i"),lookbehind:!0,greedy:!0,inside:o},e.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}function d(e){!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(e)}function p(e){!function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),"diff"===n&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(e)}function h(e){e.register(o),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}function f(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}function m(e){e.register(o),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(e)}function g(e){!function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",o=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(e)}function y(e){e.register(o),e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}function b(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}function k(e){e.register(o),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(e)}function w(e){e.register(d),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}function v(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}function x(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}function S(e){!function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<value>>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<key>>/g,(function(){return"(?:"+o+"|"+i+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(i),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(e)}function E(e){e.register(u),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var o=t[n];if("code"===o.type){var i=o.content[1],s=o.content[3];if(i&&s&&"code-language"===i.type&&"code-block"===s.type&&"string"==typeof i.content){var a=i.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());s.alias?"string"==typeof s.alias?s.alias=[s.alias,l]:s.alias.push(l):s.alias=[l]}}else e(o.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,o=t.classes.length;r<o;r++){var i=t.classes[r],s=/language-(.+)/.exec(i);if(s){n=s[1];break}}var a=e.languages[n];if(a)t.content=e.highlight(t.content.value,a,n);else if(n&&"none"!==n&&e.plugins.autoloader){var l="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=l,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(l);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}})),RegExp(e.languages.markup.tag.pattern.source,"gi"),String.fromCodePoint||String.fromCharCode,e.languages.md=e.languages.markdown}(e)}function C(e){e.register(i),e.languages.objectivec=e.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}function A(e){!function(e){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;e.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}}(e)}function N(e){e.register(u),function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,i){if(n.language===r){var s=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof i&&!i(e))return e;for(var o,a=s.length;-1!==n.code.indexOf(o=t(r,a));)++a;return s[a]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,i=Object.keys(n.tokenStack);!function s(a){for(var l=0;l<a.length&&!(o>=i.length);l++){var c=a[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=i[o],d=n.tokenStack[u],p="string"==typeof c?c:c.content,h=t(r,u),f=p.indexOf(h);if(f>-1){++o;var m=p.substring(0,f),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=p.substring(f+h.length),b=[];m&&b.push.apply(b,s([m])),b.push(g),y&&b.push.apply(b,s([y])),"string"==typeof c?a.splice.apply(a,[l,1].concat(b)):c.content=b}}else c.content&&s(c.content)}return a}(n.tokens)}}}})}(e)}function O(e){e.register(N),function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,o=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,i=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:o,punctuation:i};var s={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},a=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:s}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:s}}];e.languages.insertBefore("php","variable",{string:a,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:a,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:o,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){/<\?/.test(t.code)&&e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(e)}function T(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}function M(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}function D(e){e.register(o),function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(e)}function I(e){!function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(e)}function R(e){e.register(d),function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(e)}function F(e){e.register(d),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}function L(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}function P(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach((function(t){t.inside.interpolation.inside=e.languages.swift}))}function B(e){e.register(y),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(e)}function _(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}function z(e){e.register(_),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}n.r(r),n.d(r,{boolean:()=>W,booleanish:()=>K,commaOrSpaceSeparated:()=>Z,commaSeparated:()=>Y,number:()=>G,overloadedBoolean:()=>q,spaceSeparated:()=>J}),o.displayName="clike",o.aliases=[],i.displayName="c",i.aliases=[],s.displayName="cpp",s.aliases=[],a.displayName="arduino",a.aliases=["ino"],l.displayName="bash",l.aliases=["sh","shell"],c.displayName="csharp",c.aliases=["cs","dotnet"],u.displayName="markup",u.aliases=["atom","html","mathml","rss","ssml","svg","xml"],d.displayName="css",d.aliases=[],p.displayName="diff",p.aliases=[],h.displayName="go",h.aliases=[],f.displayName="ini",f.aliases=[],m.displayName="java",m.aliases=[],g.displayName="regex",g.aliases=[],y.displayName="javascript",y.aliases=["js"],b.displayName="json",b.aliases=["webmanifest"],k.displayName="kotlin",k.aliases=["kt","kts"],w.displayName="less",w.aliases=[],v.displayName="lua",v.aliases=[],x.displayName="makefile",x.aliases=[],S.displayName="yaml",S.aliases=["yml"],E.displayName="markdown",E.aliases=["md"],C.displayName="objectivec",C.aliases=["objc"],A.displayName="perl",A.aliases=[],N.displayName="markup-templating",N.aliases=[],O.displayName="php",O.aliases=[],T.displayName="python",T.aliases=["py"],M.displayName="r",M.aliases=[],D.displayName="ruby",D.aliases=["rb"],I.displayName="rust",I.aliases=[],R.displayName="sass",R.aliases=[],F.displayName="scss",F.aliases=[],L.displayName="sql",L.aliases=[],P.displayName="swift",P.aliases=[],B.displayName="typescript",B.aliases=["ts"],_.displayName="basic",_.aliases=[],z.displayName="vbnet",z.aliases=[];class ${constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function j(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new $(n,r,t)}function U(e){return e.toLowerCase()}$.prototype.property={},$.prototype.normal={},$.prototype.space=null;class H{constructor(e,t){this.property=e,this.attribute=t}}H.prototype.space=null,H.prototype.boolean=!1,H.prototype.booleanish=!1,H.prototype.overloadedBoolean=!1,H.prototype.number=!1,H.prototype.commaSeparated=!1,H.prototype.spaceSeparated=!1,H.prototype.commaOrSpaceSeparated=!1,H.prototype.mustUseProperty=!1,H.prototype.defined=!1;let V=0;const W=X(),K=X(),q=X(),G=X(),J=X(),Y=X(),Z=X();function X(){return 2**++V}const Q=Object.keys(r);class ee extends H{constructor(e,t,n,o){let i=-1;if(super(e,t),te(this,"space",o),"number"==typeof n)for(;++i<Q.length;){const e=Q[i];te(this,Q[i],(n&r[e])===r[e])}}}function te(e,t,n){n&&(e[t]=n)}ee.prototype.defined=!0;const ne={}.hasOwnProperty;function re(e){const t={},n={};let r;for(r in e.properties)if(ne.call(e.properties,r)){const o=e.properties[r],i=new ee(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[U(r)]=r,n[U(i.attribute)]=r}return new $(t,n,e.space)}const oe=re({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),ie=re({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function se(e,t){return t in e?e[t]:t}function ae(e,t){return se(e,t.toLowerCase())}const le=re({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:ae,properties:{xmlns:null,xmlnsXLink:null}}),ce=re({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:K,ariaAutoComplete:null,ariaBusy:K,ariaChecked:K,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:J,ariaCurrent:null,ariaDescribedBy:J,ariaDetails:null,ariaDisabled:K,ariaDropEffect:J,ariaErrorMessage:null,ariaExpanded:K,ariaFlowTo:J,ariaGrabbed:K,ariaHasPopup:null,ariaHidden:K,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:J,ariaLevel:G,ariaLive:null,ariaModal:K,ariaMultiLine:K,ariaMultiSelectable:K,ariaOrientation:null,ariaOwns:J,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:K,ariaReadOnly:K,ariaRelevant:null,ariaRequired:K,ariaRoleDescription:J,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:K,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null}}),ue=re({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:ae,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Y,acceptCharset:J,accessKey:J,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:J,autoFocus:W,autoPlay:W,capture:W,charSet:null,checked:W,cite:null,className:J,cols:G,colSpan:null,content:null,contentEditable:K,controls:W,controlsList:J,coords:G|Y,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:q,draggable:K,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:J,height:G,hidden:W,high:G,href:null,hrefLang:null,htmlFor:J,httpEquiv:J,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:J,itemRef:J,itemScope:W,itemType:J,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:W,optimum:G,pattern:null,ping:J,placeholder:null,playsInline:W,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:J,required:W,reversed:W,rows:G,rowSpan:G,sandbox:J,scope:null,scoped:W,seamless:W,selected:W,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:K,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:K,width:G,wrap:null,align:null,aLink:null,archive:J,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:K,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:W,disableRemotePlayback:W,prefix:null,property:null,results:G,security:null,unselectable:null}}),de=re({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:se,properties:{about:Z,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:J,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Y,g2:Y,glyphName:Y,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:Z,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:J,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Z,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Z,rev:Z,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Z,requiredFeatures:Z,requiredFonts:Z,requiredFormats:Z,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:Z,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Z,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Z,to:null,transform:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),pe=j([ie,oe,le,ce,ue],"html"),he=(j([ie,oe,le,ce,de],"svg"),/^data[-\w.:]+$/i),fe=/-[a-z]/g,me=/[A-Z]/g;function ge(e){return"-"+e.toLowerCase()}function ye(e){return e.charAt(1).toUpperCase()}const be=/[#.]/g;var ke=n(10010),we=n(36469);const ve=new Set(["menu","submit","reset","button"]),xe={}.hasOwnProperty;function Se(e,t,n,r){const o=function(e,t){const n=U(t);let r=t,o=H;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&he.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(fe,ye);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!fe.test(e)){let n=e.replace(me,ge);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=ee}return new o(r,t)}(e,n);let i,s=-1;if(null!=r){if("number"==typeof r){if(Number.isNaN(r))return;i=r}else i="boolean"==typeof r?r:"string"==typeof r?o.spaceSeparated?(0,ke.q)(r):o.commaSeparated?(0,we.q)(r):o.commaOrSpaceSeparated?(0,ke.q)((0,we.q)(r).join(" ")):Ce(o,o.property,r):Array.isArray(r)?r.concat():"style"===o.property?function(e){const t=[];let n;for(n in e)xe.call(e,n)&&t.push([n,e[n]].join(": "));return t.join("; ")}(r):String(r);if(Array.isArray(i)){const e=[];for(;++s<i.length;)e[s]=Ce(o,o.property,i[s]);i=e}"className"===o.property&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[o.property]=i}}function Ee(e,t){let n=-1;if(null==t);else if("string"==typeof t||"number"==typeof t)e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(;++n<t.length;)Ee(e,t[n]);else{if("object"!=typeof t||!("type"in t))throw new Error("Expected node, nodes, or string, got `"+t+"`");"root"===t.type?Ee(e,t.children):e.push(t)}}function Ce(e,t,n){if("string"==typeof n){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(""===n||U(n)===U(t)))return!0}return n}const Ae=(Ne=pe,function(e,t,...n){let r,o=-1;if(null==e)r={type:"root",children:[]},n.unshift(t);else if(r=function(e){const t=e||"",n={};let r,o,i=0;for(;i<t.length;){be.lastIndex=i;const e=be.exec(t),s=t.slice(i,e?e.index:t.length);s&&(r?"#"===r?n.id=s:Array.isArray(n.className)?n.className.push(s):n.className=[s]:o=s,i+=s.length),e&&(r=e[0],i++)}return{type:"element",tagName:o||"div",properties:n,children:[]}}(e),r.tagName=r.tagName.toLowerCase(),i=t,s=r.tagName,null==i||"object"!=typeof i||Array.isArray(i)||"input"!==s&&i.type&&"string"==typeof i.type&&("children"in i&&Array.isArray(i.children)||("button"===s?!ve.has(i.type.toLowerCase()):"value"in i)))n.unshift(t);else{let e;for(e in t)xe.call(t,e)&&Se(Ne,r.properties,e,t[e])}for(var i,s;++o<n.length;)Ee(r.children,n[o]);return"element"===r.type&&"template"===r.tagName&&(r.content={type:"root",children:r.children},r.children=[]),r});var Ne,Oe=n(49054);const Te={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function Me(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}function De(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Ie(e){return function(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}(e)||Me(e)}var Re=n(51157);const Fe=String.fromCharCode,Le=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Pe(e,t={}){const n="string"==typeof t.additional?t.additional.charCodeAt(0):t.additional,r=[];let o,i,s=0,a=-1,l="";t.position&&("start"in t.position||"indent"in t.position?(i=t.position.indent,o=t.position.start):o=t.position);let c,u=(o?o.line:0)||1,d=(o?o.column:0)||1,p=f();for(s--;++s<=e.length;)if(10===c&&(d=(i?i[a]:0)||1),c=e.charCodeAt(s),38===c){const o=e.charCodeAt(s+1);if(9===o||10===o||12===o||32===o||38===o||60===o||Number.isNaN(o)||n&&o===n){l+=Fe(c),d++;continue}const i=s+1;let a,u=i,y=i;if(35===o){y=++u;const t=e.charCodeAt(y);88===t||120===t?(a="hexadecimal",y=++u):a="decimal"}else a="named";let b="",k="",w="";const v="named"===a?Ie:"decimal"===a?Me:De;for(y--;++y<=e.length;){const t=e.charCodeAt(y);if(!v(t))break;w+=Fe(t),"named"===a&&Oe.K.includes(w)&&(b=w,k=(0,Re.s)(w))}let x=59===e.charCodeAt(y);if(x){y++;const e="named"===a&&(0,Re.s)(w);e&&(b=w,k=e)}let S=1+y-i,E="";if(x||!1!==t.nonTerminated)if(w)if("named"===a){if(x&&!k)m(5,1);else if(b!==w&&(y=u+b.length,S=1+y-u,x=!1),!x){const n=b?1:3;if(t.attribute){const t=e.charCodeAt(y);61===t?(m(n,S),k=""):Ie(t)?k="":m(n,S)}else m(n,S)}E=k}else{x||m(2,S);let e=Number.parseInt(w,"hexadecimal"===a?16:10);if((h=e)>=55296&&h<=57343||h>1114111)m(7,S),E=Fe(65533);else if(e in Te)m(6,S),E=Te[e];else{let t="";Be(e)&&m(6,S),e>65535&&(e-=65536,t+=Fe(e>>>10|55296),e=56320|1023&e),E=t+Fe(e)}}else"named"!==a&&m(4,S);if(E){g(),p=f(),s=y-1,d+=y-i+1,r.push(E);const n=f();n.offset++,t.reference&&t.reference.call(t.referenceContext,E,{start:p,end:n},e.slice(i-1,y)),p=n}else w=e.slice(i-1,y),l+=w,d+=w.length,s=y-1}else 10===c&&(u++,a++,d=0),Number.isNaN(c)?g():(l+=Fe(c),d++);var h;return r.join("");function f(){return{line:u,column:d,offset:s+((o?o.offset:0)||0)}}function m(e,n){let r;t.warning&&(r=f(),r.column+=n,r.offset+=n,t.warning.call(t.warningContext,Le[e],r,e))}function g(){l&&(r.push(l),t.text&&t.text.call(t.textContext,l,{start:p,end:f()}),l="")}}function Be(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||!(65535&~e)||65534==(65535&e)}var _e=0,ze={},$e={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++_e}),e.__id},clone:function e(t,n){var r,o;switch(n=n||{},$e.util.type(t)){case"Object":if(o=$e.util.objId(t),n[o])return n[o];for(var i in r={},n[o]=r,t)t.hasOwnProperty(i)&&(r[i]=e(t[i],n));return r;case"Array":return o=$e.util.objId(t),n[o]?n[o]:(r=[],n[o]=r,t.forEach((function(t,o){r[o]=e(t,n)})),r);default:return t}}},languages:{plain:ze,plaintext:ze,text:ze,txt:ze,extend:function(e,t){var n=$e.util.clone($e.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var o=(r=r||$e.languages)[e],i={};for(var s in o)if(o.hasOwnProperty(s)){if(s==t)for(var a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);n.hasOwnProperty(s)||(i[s]=o[s])}var l=r[e];return r[e]=i,$e.languages.DFS($e.languages,(function(t,n){n===l&&t!=e&&(this[t]=i)})),i},DFS:function e(t,n,r,o){o=o||{};var i=$e.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var a=t[s],l=$e.util.type(a);"Object"!==l||o[i(a)]?"Array"!==l||o[i(a)]||(o[i(a)]=!0,e(a,n,s,o)):(o[i(a)]=!0,e(a,n,null,o))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if($e.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=$e.tokenize(r.code,r.grammar),$e.hooks.run("after-tokenize",r),je.stringify($e.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new Ve;return We(o,o.head,e),He(e,o,t,o.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=$e.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=$e.hooks.all[e];if(n&&n.length)for(var r,o=0;r=n[o++];)r(t)}},Token:je};function je(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function Ue(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function He(e,t,n,r,o,i){for(var s in n)if(n.hasOwnProperty(s)&&n[s]){var a=n[s];a=Array.isArray(a)?a:[a];for(var l=0;l<a.length;++l){if(i&&i.cause==s+","+l)return;var c=a[l],u=c.inside,d=!!c.lookbehind,p=!!c.greedy,h=c.alias;if(p&&!c.pattern.global){var f=c.pattern.toString().match(/[imsuy]*$/)[0];c.pattern=RegExp(c.pattern.source,f+"g")}for(var m=c.pattern||c,g=r.next,y=o;g!==t.tail&&!(i&&y>=i.reach);y+=g.value.length,g=g.next){var b=g.value;if(t.length>e.length)return;if(!(b instanceof je)){var k,w=1;if(p){if(!(k=Ue(m,y,e,d))||k.index>=e.length)break;var v=k.index,x=k.index+k[0].length,S=y;for(S+=g.value.length;v>=S;)S+=(g=g.next).value.length;if(y=S-=g.value.length,g.value instanceof je)continue;for(var E=g;E!==t.tail&&(S<x||"string"==typeof E.value);E=E.next)w++,S+=E.value.length;w--,b=e.slice(y,S),k.index-=y}else if(!(k=Ue(m,0,b,d)))continue;v=k.index;var C=k[0],A=b.slice(0,v),N=b.slice(v+C.length),O=y+b.length;i&&O>i.reach&&(i.reach=O);var T=g.prev;if(A&&(T=We(t,T,A),y+=A.length),Ke(t,T,w),g=We(t,T,new je(s,u?$e.tokenize(C,u):C,h,C)),N&&We(t,g,N),w>1){var M={cause:s+","+l,reach:O};He(e,t,n,g.prev,y,M),i&&M.reach>i.reach&&(i.reach=M.reach)}}}}}}function Ve(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function We(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function Ke(e,t,n){for(var r=t.next,o=0;o<n&&r!==e.tail;o++)r=r.next;t.next=r,r.prev=t,e.length-=o}const qe=$e,Ge={}.hasOwnProperty;function Je(){}Je.prototype=qe;const Ye=new Je;Ye.highlight=function(e,t){if("string"!=typeof e)throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&"object"==typeof t)n=t;else{if(r=t,"string"!=typeof r)throw new TypeError("Expected `string` for `name`, got `"+r+"`");if(!Ge.call(Ye.languages,r))throw new Error("Unknown language: `"+r+"` is not registered");n=Ye.languages[r]}return{type:"root",children:qe.highlight.call(Ye,e,n,r)}},Ye.register=function(e){if("function"!=typeof e||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Ge.call(Ye.languages,e.displayName)||e(Ye)},Ye.alias=function(e,t){const n=Ye.languages;let r,o={};for(r in"string"==typeof e?t&&(o[e]=t):o=e,o)if(Ge.call(o,r)){const e=o[r],t="string"==typeof e?[e]:e;let i=-1;for(;++i<t.length;)n[t[i]]=n[r]}},Ye.registered=function(e){if("string"!=typeof e)throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Ge.call(Ye.languages,e)},Ye.listLanguages=function(){const e=Ye.languages,t=[];let n;for(n in e)Ge.call(e,n)&&"object"==typeof e[n]&&t.push(n);return t},Ye.util.encode=function(e){return e},Ye.Token.stringify=function e(t,n){if("string"==typeof t)return{type:"text",value:t};if(Array.isArray(t)){const r=[];let o=-1;for(;++o<t.length;)""!==t[o]&&null!==t[o]&&void 0!==t[o]&&r.push(e(t[o],n));return r}const r={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n};return t.alias&&r.classes.push(..."string"==typeof t.alias?[t.alias]:t.alias),Ye.hooks.run("wrap",r),Ae(r.tag+"."+r.classes.join("."),function(e){let t;for(t in e)Ge.call(e,t)&&(e[t]=Pe(e[t]));return e}(r.attributes),r.content)},Ye.register(o),Ye.register(i),Ye.register(s),Ye.register(a),Ye.register(l),Ye.register(c),Ye.register(u),Ye.register(d),Ye.register(p),Ye.register(h),Ye.register(f),Ye.register(m),Ye.register(g),Ye.register(y),Ye.register(b),Ye.register(k),Ye.register(w),Ye.register(v),Ye.register(x),Ye.register(S),Ye.register(E),Ye.register(C),Ye.register(A),Ye.register(N),Ye.register(O),Ye.register(T),Ye.register(M),Ye.register(D),Ye.register(I),Ye.register(R),Ye.register(F),Ye.register(L),Ye.register(P),Ye.register(B),Ye.register(_),Ye.register(z)},43890:(e,t,n)=>{"use strict";function r(e,t,n,r){const o=e.length;let i,s=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),[].splice.apply(e,i);else for(n&&[].splice.apply(e,[t,n]);s<r.length;)i=r.slice(s,s+1e4),i.unshift(t,0),[].splice.apply(e,i),s+=1e4,t+=1e4}function o(e,t){return e.length>0?(r(e,e.length,0,t),e):t}n.d(t,{V:()=>o,m:()=>r})},44254:(e,t,n)=>{"use strict";n.d(t,{I9:()=>_,KP:()=>$,MG:()=>B,T:()=>S,UM:()=>j,Z6:()=>A,xe:()=>z});var r=n(81570);const o="undefined"!=typeof navigator?navigator:null,i="undefined"!=typeof document?document:null,s=o&&o.userAgent||"",a=/Edge\/(\d+)/.exec(s),l=/MSIE \d/.exec(s),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(s),u=!!(l||c||a),d=l?document.documentMode:c?+c[1]:a?+a[1]:0,p=!u&&/gecko\/(\d+)/i.test(s),h=p&&+(/Firefox\/(\d+)/.exec(s)||[0,0])[1],f=!u&&/Chrome\/(\d+)/.exec(s),m=!!f,g=f?+f[1]:0,y=!u&&!!o&&/Apple Computer/.test(o.vendor),b=y&&(/Mobile\/\w+/.test(s)||!!o&&o.maxTouchPoints>2),k=b||!!o&&/Mac/.test(o.platform),w=/Android \d/.test(s),v=!!i&&"webkitFontSmoothing"in i.documentElement.style,x=v?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var S=Object.freeze({__proto__:null,ie:u,ie_version:d,gecko:p,gecko_version:h,chrome:m,chrome_version:g,safari:y,ios:b,mac:k,android:w,webkit:v,webkit_version:x});function E(e,t,n,r,o,i){if(e.composing)return!1;const s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;const l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,void 0,"")+r;for(let a=0;a<o.length;a++){const c=o[a].match.exec(l),u=c&&c[0]&&o[a].handler(s,c,t-(c[0].length-r.length),n);if(u)return e.dispatch(u.setMeta(i,{transform:u,from:t,to:n,text:r})),!0}return!1}const C=new r.hs("MILKDOWN_CUSTOM_INPUTRULES"),A=({rules:e})=>{const t=new r.k_({key:C,isInputRules:!0,state:{init:()=>null,apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,o,i)=>E(n,r,o,i,e,t),handleDOMEvents:{compositionend:n=>(setTimeout((()=>{const{$cursor:r}=n.state.selection;r&&E(n,r.pos,r.pos,"",e,t)})),!1)},handleKeyDown(n,r){if("Enter"!==r.key)return!1;const{$cursor:o}=n.state.selection;return!!o&&E(n,o.pos,o.pos,"\n",e,t)}}});return t};var N=Object.defineProperty,O=Object.defineProperties,T=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,R=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F=(e,t)=>{for(var n in t||(t={}))D.call(t,n)&&R(e,n,t[n]);if(M)for(var n of M(t))I.call(t,n)&&R(e,n,t[n]);return e},L=(e,t)=>O(e,T(t));function P(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function B(e,t,n){const r=e.state.doc.content.size,o=P(t,0,r),i=P(n,0,r),s=e.coordsAtPos(o),a=e.coordsAtPos(i,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),u=Math.min(s.left,a.left),d=Math.max(s.right,a.right),p={top:l,bottom:c,left:u,right:d,width:d-u,height:c-l,x:u,y:l};return L(F({},p),{toJSON:()=>p})}const _=e=>Object.assign(Object.create(e),e).setTime(Date.now()),z=e=>(t,n)=>((e,t=!0)=>{const n=[];return e.descendants(((e,r)=>{if(n.push({node:e,pos:r}),!t)return!1})),n})(t,n).filter((t=>e(t.node))),$=e=>t=>(e=>t=>{for(let n=t.depth;n>0;n--){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}})(e)(t.$from),j=(e,t)=>{if(!(e instanceof r.nh))return;const{node:n,$from:o}=e;return((e,t)=>Array.isArray(e)&&e.includes(t.type)||t.type===e)(t,n)?{node:n,pos:o.pos,start:o.start(o.depth),depth:o.depth}:void 0}},47938:(e,t,n)=>{"use strict";n.d(t,{s:()=>s});var r=n(51157),o=n(99896);const i=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function s(e){return e.replace(i,a)}function a(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return(0,o.C)(n.slice(t?2:1),t?16:10)}return(0,r.s)(n)||e}},53373:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=s(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=s(t,n));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},61408:(e,t,n)=>{"use strict";function r(e,t,n,r,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,o)}n.d(t,{i:()=>i});var o=n(41361),i=function(){var e,t=(e=function*(e,t,n){var r=new FormData,i=function*(){if(Array.isArray(a)){var e="".concat(s,"[]");a.forEach((t=>{r.append(e,t)}))}else r.append(s,a)};for(var[s,a]of Object.entries(t))yield*i();return(yield o.http.put("api/gateway/object_store.object_store.PutObject/api/v1/objectStore/bucket/".concat(e,"/object"),r,n)).data},function(){var t=this,n=arguments;return new Promise((function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,l,"next",e)}function l(e){r(s,o,i,a,l,"throw",e)}a(void 0)}))});return function(e,n,r){return t.apply(this,arguments)}}()},66641:(e,t,n)=>{"use strict";n.d(t,{dc:()=>o,_Z:()=>i,VG:()=>s});var r=n(15186);const o=!1,i="skip",s=function(e,t,n,s){"function"==typeof t&&"function"!=typeof n&&(s=n,n=t,t=null);const a=(0,r.C)(t),l=s?-1:1;!function e(r,c,u){const d=r&&"object"==typeof r?r:{};if("string"==typeof d.type){const e="string"==typeof d.tagName?d.tagName:"string"==typeof d.name?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+r.type+(e?"<"+e+">":"")+")"})}return p;function p(){let d,p,h,f=[];if((!t||a(r,c,u[u.length-1]||null))&&(f=function(e){return Array.isArray(e)?e:"number"==typeof e?[true,e]:[e]}(n(r,u)),f[0]===o))return f;if(r.children&&f[0]!==i)for(p=(s?r.children.length:-1)+l,h=u.concat(r);p>-1&&p<r.children.length;){if(d=e(r.children[p],p,h)(),d[0]===o)return d;p="number"==typeof d[1]?d[1]:p+l}return f}}(e,void 0,[])()}},66990:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var r=n(17884);function o(e){return null===e||(0,r.Ee)(e)||(0,r.Ny)(e)?1:(0,r.es)(e)?2:void 0}},67488:(e,t,n)=>{"use strict";n.d(t,{CR:()=>U,Kj:()=>I,Z0:()=>g,mc:()=>h,zD:()=>R});var r,o,i,s=n(1440),a=Object.defineProperty,l=(e,t,n)=>(((e,t,n)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),c=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},u=(e,t,n)=>(c(e,t,"read from private field"),n?n.call(e):t.get(e)),d=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},p=(e,t,n,r)=>(c(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class h{constructor(){l(this,"sliceMap",new Map),l(this,"get",(e=>{const t="string"==typeof e?[...this.sliceMap.values()].find((t=>t.type.name===e)):this.sliceMap.get(e.id);if(!t){const t="string"==typeof e?e:e.name;throw(0,s.XM)(t)}return t})),l(this,"remove",(e=>{const t="string"==typeof e?[...this.sliceMap.values()].find((t=>t.type.name===e)):this.sliceMap.get(e.id);!t||this.sliceMap.delete(t.type.id)})),l(this,"has",(e=>"string"==typeof e?[...this.sliceMap.values()].some((t=>t.type.name===e)):this.sliceMap.has(e.id)))}}class f{constructor(e,t,n){l(this,"type"),d(this,r,[]),d(this,o,void 0),d(this,i,(()=>{u(this,r).forEach((e=>e(u(this,o))))})),l(this,"set",(e=>{p(this,o,e),u(this,i).call(this)})),l(this,"get",(()=>u(this,o))),l(this,"update",(e=>{p(this,o,e(u(this,o))),u(this,i).call(this)})),this.type=n,p(this,o,t),e.set(n.id,this)}on(e){return u(this,r).push(e),()=>{p(this,r,u(this,r).filter((t=>t!==e)))}}once(e){const t=this.on((n=>{e(n),t()}));return t}off(e){p(this,r,u(this,r).filter((t=>t!==e)))}offAll(){p(this,r,[])}}r=new WeakMap,o=new WeakMap,i=new WeakMap;class m{constructor(e,t){l(this,"id"),l(this,"name"),l(this,"_typeInfo"),l(this,"_defaultValue"),this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw(0,s.dI)()}}create(e,t=this._defaultValue){return new f(e,t,this)}}const g=(e,t)=>new m(e,t);var y,b,k,w,v,x,S,E,C,A,N,O,T;class M{constructor(e,t,n){d(this,y,void 0),d(this,b,void 0),d(this,k,void 0),d(this,w,new Set),d(this,v,new Set),d(this,x,new Map),d(this,S,new Map),l(this,"read",(()=>({metadata:u(this,y),injectedSlices:[...u(this,w)].map((e=>({name:"string"==typeof e?e:e.name,value:u(this,E).call(this,e)}))),consumedSlices:[...u(this,v)].map((e=>({name:"string"==typeof e?e:e.name,value:u(this,E).call(this,e)}))),recordedTimers:[...u(this,x)].map((([e,{duration:t}])=>({name:e.name,duration:t,status:u(this,C).call(this,e)}))),waitTimers:[...u(this,S)].map((([e,{duration:t}])=>({name:e.name,duration:t,status:u(this,C).call(this,e)})))}))),l(this,"onRecord",(e=>{u(this,x).set(e,{start:Date.now(),duration:0})})),l(this,"onClear",(e=>{u(this,x).delete(e)})),l(this,"onDone",(e=>{const t=u(this,x).get(e);!t||(t.duration=Date.now()-t.start)})),l(this,"onWait",((e,t)=>{const n=Date.now();t.finally((()=>{u(this,S).set(e,{duration:Date.now()-n})}))})),l(this,"onInject",(e=>{u(this,w).add(e)})),l(this,"onRemove",(e=>{u(this,w).delete(e)})),l(this,"onUse",(e=>{u(this,v).add(e)})),d(this,E,(e=>u(this,b).get(e).get())),d(this,C,(e=>u(this,k).get(e).status)),p(this,b,e),p(this,k,t),p(this,y,n)}}y=new WeakMap,b=new WeakMap,k=new WeakMap,w=new WeakMap,v=new WeakMap,x=new WeakMap,S=new WeakMap,E=new WeakMap,C=new WeakMap;const D=class{constructor(e,t,n){d(this,A,void 0),d(this,N,void 0),d(this,O,void 0),d(this,T,void 0),l(this,"produce",(e=>e&&Object.keys(e).length?new D(u(this,A),u(this,N),{...e}):this)),l(this,"inject",((e,t)=>{var n;const r=e.create(u(this,A).sliceMap);return null!=t&&r.set(t),null==(n=u(this,T))||n.onInject(e),this})),l(this,"remove",(e=>{var t;return u(this,A).remove(e),null==(t=u(this,T))||t.onRemove(e),this})),l(this,"record",(e=>{var t;return e.create(u(this,N).store),null==(t=u(this,T))||t.onRecord(e),this})),l(this,"clearTimer",(e=>{var t;return u(this,N).remove(e),null==(t=u(this,T))||t.onClear(e),this})),l(this,"isInjected",(e=>u(this,A).has(e))),l(this,"isRecorded",(e=>u(this,N).has(e))),l(this,"use",(e=>{var t;return null==(t=u(this,T))||t.onUse(e),u(this,A).get(e)})),l(this,"get",(e=>this.use(e).get())),l(this,"set",((e,t)=>this.use(e).set(t))),l(this,"update",((e,t)=>this.use(e).update(t))),l(this,"timer",(e=>u(this,N).get(e))),l(this,"done",(e=>{var t;this.timer(e).done(),null==(t=u(this,T))||t.onDone(e)})),l(this,"wait",(e=>{var t;const n=this.timer(e).start();return null==(t=u(this,T))||t.onWait(e,n),n})),l(this,"waitTimers",(async e=>{await Promise.all(this.get(e).map((e=>this.wait(e))))})),p(this,A,e),p(this,N,t),p(this,O,n),n&&p(this,T,new M(e,t,n))}get meta(){return u(this,O)}get inspector(){return u(this,T)}};let I=D;A=new WeakMap,N=new WeakMap,O=new WeakMap,T=new WeakMap;class R{constructor(){l(this,"store",new Map),l(this,"get",(e=>{const t=this.store.get(e.id);if(!t)throw(0,s.nr)(e.name);return t})),l(this,"remove",(e=>{this.store.delete(e.id)})),l(this,"has",(e=>this.store.has(e.id)))}}var F,L,P,B,_,z;class ${constructor(e,t){l(this,"type"),d(this,F,null),d(this,L,null),d(this,P,void 0),d(this,B,"pending"),l(this,"start",(()=>(u(this,F)??p(this,F,new Promise(((e,t)=>{p(this,L,(t=>{t instanceof CustomEvent&&t.detail.id===u(this,P)&&(p(this,B,"resolved"),u(this,_).call(this),t.stopImmediatePropagation(),e())})),u(this,z).call(this,(()=>{"pending"===u(this,B)&&p(this,B,"rejected"),u(this,_).call(this),t(new Error(`Timing ${this.type.name} timeout.`))})),p(this,B,"pending"),addEventListener(this.type.name,u(this,L))}))),u(this,F)))),l(this,"done",(()=>{const e=new CustomEvent(this.type.name,{detail:{id:u(this,P)}});dispatchEvent(e)})),d(this,_,(()=>{u(this,L)&&removeEventListener(this.type.name,u(this,L))})),d(this,z,(e=>{setTimeout((()=>{e()}),this.type.timeout)})),p(this,P,Symbol(t.name)),this.type=t,e.set(t.id,this)}get status(){return u(this,B)}}F=new WeakMap,L=new WeakMap,P=new WeakMap,B=new WeakMap,_=new WeakMap,z=new WeakMap;class j{constructor(e,t=3e3){l(this,"id"),l(this,"name"),l(this,"timeout"),l(this,"create",(e=>new $(e,this))),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}}const U=(e,t=3e3)=>new j(e,t)},73686:(e,t,n)=>{"use strict";n.d(t,{Lz:()=>an,NZ:()=>Pt,zF:()=>zt});var r=n(81570),o=n(16090),i=n(11329);const s=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},a=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let l=null;const c=function(e,t,n){let r=l||(l=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},u=function(e,t,n,r){return n&&(p(e,t,n,r,-1)||p(e,t,n,r,1))},d=/^(img|br|input|textarea|hr)$/i;function p(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:h(e))){let n=e.parentNode;if(!n||1!=n.nodeType||f(e)||d.test(e.nodeName)||"false"==e.contentEditable)return!1;t=s(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?h(e):0}}}function h(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function f(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const m=function(e){return e.focusNode&&u(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function g(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const y="undefined"!=typeof navigator?navigator:null,b="undefined"!=typeof document?document:null,k=y&&y.userAgent||"",w=/Edge\/(\d+)/.exec(k),v=/MSIE \d/.exec(k),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(k),S=!!(v||x||w),E=v?document.documentMode:x?+x[1]:w?+w[1]:0,C=!S&&/gecko\/(\d+)/i.test(k);C&&(/Firefox\/(\d+)/.exec(k)||[0,0])[1];const A=!S&&/Chrome\/(\d+)/.exec(k),N=!!A,O=A?+A[1]:0,T=!S&&!!y&&/Apple Computer/.test(y.vendor),M=T&&(/Mobile\/\w+/.test(k)||!!y&&y.maxTouchPoints>2),D=M||!!y&&/Mac/.test(y.platform),I=!!y&&/Win/.test(y.platform),R=/Android \d/.test(k),F=!!b&&"webkitFontSmoothing"in b.documentElement.style,L=F?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function P(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function B(e,t){return"number"==typeof e?e:e[t]}function _(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function z(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=a(s)){if(1!=s.nodeType)continue;let e=s,n=e==i.body,a=n?P(i):_(e),l=0,c=0;if(t.top<a.top+B(r,"top")?c=-(a.top-t.top+B(o,"top")):t.bottom>a.bottom-B(r,"bottom")&&(c=t.bottom-a.bottom+B(o,"bottom")),t.left<a.left+B(r,"left")?l=-(a.left-t.left+B(o,"left")):t.right>a.right-B(r,"right")&&(l=t.right-a.right+B(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}if(n)break}}function $(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=a(r));return t}function j(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let U=null;function H(e,t){let n,r,o,i,s=2e8,a=0,l=t.top,u=t.top;for(let d=e.firstChild,p=0;d;d=d.nextSibling,p++){let e;if(1==d.nodeType)e=d.getClientRects();else{if(3!=d.nodeType)continue;e=c(d).getClientRects()}for(let c=0;c<e.length;c++){let h=e[c];if(h.top<=l&&h.bottom>=u){l=Math.max(h.bottom,l),u=Math.min(h.top,u);let e=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(e<s){n=d,s=e,r=e&&3==n.nodeType?{left:h.right<t.left?h.right:h.left,top:t.top}:t,1==d.nodeType&&e&&(a=p+(t.left>=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!o&&h.left<=t.left&&h.right>=t.left&&(o=d,i={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(a=p+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=G(r,1);if(n.top!=n.bottom&&V(t,n))return{node:e,offset:o+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:H(n,r)}function V(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function W(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(V(t,o))return W(n,t,o)}}if((i=(i+1)%r)==o)break}return e}function K(e,t){let n,r=e.dom.ownerDocument,o=0,i=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}(r,t.left,t.top);i&&({node:n,offset:o}=i);let s,l=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){let n=e.dom.getBoundingClientRect();if(!V(t,n))return null;if(l=W(e.dom,t,n),!l)return null}if(T)for(let e=l;n&&e;e=a(e))e.draggable&&(n=void 0);if(l=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(l,t),n){if(C&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){let o=-1;for(let n=t,i=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent&&!i||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&!i&&(i=!0,e.left>r.left||e.top>r.top?o=t.posBefore:(e.right<r.left||e.bottom<r.top)&&(o=t.posAfter)),!t.contentDOM&&o<0)return(t.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?t.posBefore:t.posAfter}n=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==s&&(s=function(e,t,n){let{node:r,offset:o}=H(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,l,t));let c=e.docView.nearestDesc(l,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function q(e){return e.top<e.bottom||e.left<e.right}function G(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(q(e))return e}return Array.prototype.find.call(n,q)||e.getBoundingClientRect()}const J=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Y(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=F||C;if(3==r.nodeType){if(!s||!J.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,Z(G(c(r,e,t),i),i<0)}{let e=G(c(r,o,o),n);if(C&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=G(c(r,o-1,o-1),-1);if(t.top==e.top){let n=G(c(r,o,o+1),-1);if(n.top!=e.top)return Z(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==h(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return X(e.getBoundingClientRect(),!1)}if(null==i&&o<h(r)){let e=r.childNodes[o];if(1==e.nodeType)return X(e.getBoundingClientRect(),!0)}return X(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==h(r))){let e=r.childNodes[o-1],t=3==e.nodeType?c(e,h(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Z(G(t,1),!1)}if(null==i&&o<h(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?c(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Z(G(t,-1),!0)}return Z(G(3==r.nodeType?c(r):r,-n),n>=0)}function Z(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function X(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Q(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const ee=/[\u0590-\u08ac]/;let te=null,ne=null,re=!1;class oe{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>s(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let o=this.children[n],i=t+o.size;if(i>e||o instanceof de){r=e-t;break}t=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof ie&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?s(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?s(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,a=0;;a++){let n=this.children[a],l=i+n.size;if(-1==r&&e<=l){let o=i+n.border;if(e>=o&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;for(let t=a;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=s(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||a==this.children.length-1)){t=l;for(let e=a+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=s(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&i<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((C||T)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType)c=!(!t||"\n"!=e.nodeValue[t-1]);else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(C&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&T)&&u(s.node,s.offset,l.anchorNode,l.anchorOffset)&&u(a.node,a.offset,l.focusNode,l.focusOffset))return;let d=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),d=!0}catch(e){}}if(!d){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class ie extends oe{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r))),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class se extends oe{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class ae extends oe{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],s=i&&i(t,r,n);return s&&s.dom||(s=o.ZF.renderSpec(document,t.type.spec.toDOM(t,n))),new ae(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=ae.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=Ee(o,t,i,n)),e>0&&(o=Ee(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=r;return r.children=o,r}}class le extends oe{constructor(e,t,n,r,o,i,s,a,l){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,i,s){let a,l=i.nodeViews[t.type.name],c=l&&l(t,i,(()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s),n,r),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else u||({dom:u,contentDOM:d}=o.ZF.renderSpec(document,t.type.spec.toDOM(t)));d||t.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let p=u;return u=ke(u,n,t),c?a=new pe(e,t,n,r,u,d||null,p,c,i,s+1):t.isText?new ue(e,t,n,r,u,p,i):new le(e,t,n,r,u,d||null,p,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>o.FK.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&we(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new xe(this,s&&s.node,e);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<o.length&&o[s].to==i){let e,t=o[s++];for(;s<o.length&&o[s].to==i;)(e||(e=[t])).push(o[s++]);if(e){e.sort(Se);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else{if(!(c<e.childCount))break;d=c,u=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=i&&a.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let p=i+u.nodeSize;if(u.isText){let e=p;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<p&&(l=u.cut(e-i),u=u.cut(0,e-i),p=e,d=-1)}r(u,u.isInline&&!u.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(i,u),d),i=p}}(this.node,this.innerDeco,((t,i,s)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!s&&l.syncToMarks(i==this.node.childCount?o.CU.none:this.node.child(i).marks,n,e),l.placeWidget(t,e,r)}),((t,o,s,c)=>{let u;l.syncToMarks(t.marks,n,e),l.findNodeMatch(t,o,s,c)||a&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(t,o,s,u,e)||l.updateNextNode(t,o,s,e,c,r)||l.addNode(t,o,s,e,r),r+=t.nodeSize})),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),he(this.contentDOM,this.children,e),M&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:o}=e.state.selection;if(!(e.state.selection instanceof r.U3)||n<t||o>t+this.node.content.size)return null;let i=e.domSelectionRange(),s=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=h(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let e=s.nodeValue,r=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;l+=t.text}if(i>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,o-t);return r<0?null:{node:s,pos:r,text:e}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new se(this,o,t,r);e.input.compositionNodes.push(i),this.children=Ee(this.children,n,n+r.length,e,i)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,r),0))}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(we(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ye(this.dom,this.nodeDOM,ge(this.outerDeco,this.node,t),ge(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function ce(e,t,n,r,o){ke(r,t,e);let i=new le(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class ue extends le{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),o=document.createTextNode(r.text);return new ue(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class de extends oe{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class pe extends le{constructor(e,t,n,r,o,i,s,a,l,c){super(e,t,n,r,o,i,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function he(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=ve(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(a,r);if(s instanceof ae){let t=r?r.previousSibling:e.lastChild;he(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=ve(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const fe=function(e){e&&(this.nodeName=e)};fe.prototype=Object.create(null);const me=[new fe];function ge(e,t,n){if(0==e.length)return me;let r=n?me[0]:new fe,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new fe(s.nodeName));for(let e in s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new fe(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return o}function ye(e,t,n,r){if(n==me&&r==me)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||(t=document.createElement(i.nodeName),t.pmIsDeco=!0,t.appendChild(o),s=me[0]),o=t}be(o,s||me[0],i)}return o}function be(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function ke(e,t,n){return ye(e,e,me,ge(t,n,1!=e.nodeType))}function we(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ve(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class xe{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof ae)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,o=this.stack.length>>1,i=Math.min(o,e.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=ae.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0||(this.destroyBetween(this.index,i),this.index++,0))}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof le){let l=this.preMatch.matched.get(a);if(null!=l&&l!=o)return!1;let c,u=a.dom,d=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&we(t,a.outerDeco));if(!d&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(c=this.recreateWrapper(a,e,t,n,r,i)))return this.top.children[this.index]=c,c.dirty=2,c.updateChildren(r,i+1),c.dirty=0,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=le.create(this.top,t,n,r,o,i);if(!s.contentDOM)return null;s.children=e.children,e.children=[];for(let e of s.children)e.parent=s;return s}addNode(e,t,n,r,o){let i=le.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new ie(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof ae;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ue)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((T||N)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new de(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function Se(e,t){return e.type.side-t.type.side}function Ee(e,t,n,r,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Ce(e,t=null){let n=e.domSelectionRange(),o=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&0==i.size,l=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let c,u,d=o.resolve(l);if(m(n)){for(c=d;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&r.nh.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==h(e);r||o;){if(e==n)return!0;let t=s(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==h(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;u=new r.nh(l==e?d:o.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;c=o.resolve(t)}return u||(u=Fe(e,c,d,"pointer"==t||e.state.selection.head<d.pos&&!a?1:-1)),u}function Ae(e){return e.editable?e.hasFocus():Pe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ne(e,t=!1){let n=e.state.selection;if(Ie(e,n),Ae(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&N){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&u(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,s(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&S&&E<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let o,i,{anchor:s,head:a}=n;!Oe||n instanceof r.U3||(n.$from.parent.inlineContent||(o=Te(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=Te(e,n.to))),e.docView.setSelection(s,a,e.root,t),Oe&&(o&&De(o),i&&De(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Ae(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Oe=T||N&&O<63;function Te(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(T&&o&&"false"==o.contentEditable)return Me(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return Me(o);if(i)return Me(i)}}function Me(e){return e.contentEditable="true",T&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function De(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Ie(e,t){if(t instanceof r.nh){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Re(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Re(e)}function Re(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Fe(e,t,n,o){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||r.U3.between(t,n,o)}function Le(e){return!(e.editable&&!e.hasFocus())&&Pe(e)}function Pe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Be(e,t){let{$anchor:n,$head:o}=e.selection,i=t>0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&r.LN.findFrom(s,t)}function _e(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function ze(e,t,n){let o=e.state.selection;if(!(o instanceof r.U3)){if(o instanceof r.nh&&o.node.isInline)return _e(e,new r.U3(t>0?o.$to:o.$from));{let n=Be(e.state,t);return!!n&&_e(e,n)}}if(!o.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Be(e.state,t);return!!(n&&n instanceof r.nh)&&_e(e,n)}if(!(D&&n.indexOf("m")>-1)){let n,i=o.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText)return!1;let a=t<0?i.pos-s.nodeSize:i.pos;return!!(s.isAtom||(n=e.docView.descAt(a))&&!n.contentDOM)&&(r.nh.isSelectable(s)?_e(e,new r.nh(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):!!F&&_e(e,new r.U3(e.state.doc.resolve(t<0?a:a+s.nodeSize))))}}function $e(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function je(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Ue(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,a=!1;for(C&&1==n.nodeType&&r<$e(n)&&je(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(je(e))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Ve(n))break;{let t=n.previousSibling;for(;t&&je(t);)o=n.parentNode,i=s(t),t=t.previousSibling;if(t)n=t,r=$e(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?We(e,n,r):o&&We(e,o,i)}(e):He(e)}function He(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,a=$e(n);for(;;)if(r<a){if(1!=n.nodeType)break;if(!je(n.childNodes[r]))break;o=n,i=++r}else{if(Ve(n))break;{let t=n.nextSibling;for(;t&&je(t);)o=t.parentNode,i=s(t)+1,t=t.nextSibling;if(t)n=t,r=0,a=$e(n);else{if(n=n.parentNode,n==e.dom)break;r=a=0}}}o&&We(e,o,i)}function Ve(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function We(e,t,n){let r=e.domSelection();if(m(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout((()=>{e.state==o&&Ne(e)}),50)}function Ke(e,t){let n=e.state.doc.resolve(t);if(!N&&!I&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function qe(e,t,n){let o=e.state.selection;if(o instanceof r.U3&&!o.empty||n.indexOf("s")>-1)return!1;if(D&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=o;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Be(e.state,t);if(n&&n instanceof r.nh)return _e(e,n)}if(!i.parent.inlineContent){let n=t<0?i:s,a=o instanceof r.i5?r.LN.near(n,t):r.LN.findFrom(n,t);return!!a&&_e(e,a)}return!1}function Ge(e,t){if(!(e.state.selection instanceof r.U3))return!0;let{$head:n,$anchor:o,empty:i}=e.state.selection;if(!n.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0}return!1}function Je(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ye(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let a=e.someProp("clipboardSerializer")||o.ZF.fromSchema(e.state.schema),l=st(),c=l.createElement("div");c.appendChild(a.serializeFragment(r,{document:l}));let u,d=c.firstChild,p=0;for(;d&&1==d.nodeType&&(u=ot[d.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=l.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),p++}d=c.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${i} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:c,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n")}}function Ze(e,t,n,r,i){let s,a,l=i.parent.type.spec.code;if(!n&&!t)return null;let c=t&&(r||l||!n);if(c){if(e.someProp("transformPastedText",(n=>{t=n(t,l||r,e)})),l)return t?new o.Ji(o.FK.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):o.Ji.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,i,r,e)));if(n)a=n;else{let n=i.marks(),{schema:r}=e.state,a=o.ZF.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(a.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=st().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);if((n=o&&ot[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join("")),r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),F&&function(e){let t=e.querySelectorAll(N?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(s);let u=s&&s.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(!a){let t=e.someProp("clipboardParser")||e.someProp("domParser")||o.S4.fromSchema(e.state.schema);a=t.parseSlice(s,{preserveWhitespace:!(!c&&!d),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Xe.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(d)a=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:s,openEnd:a}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=o.FK.from(t.create(n[e+1],i)),s++,a++}return new o.Ji(i,s,a)}(rt(a,+d[1],+d[2]),d[4]);else if(a=o.Ji.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),s=[];if(e.forEach((e=>{if(!s)return;let t,n=i.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&r.length&&et(n,r,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=tt(s[s.length-1],r.length));let t=Qe(e,n);s.push(t),i=i.matchType(t.type),r=n}})),s)return o.FK.from(s)}return e}(a.content,i),!0),a.openStart||a.openEnd){let e=0,t=0;for(let t=a.content.firstChild;e<a.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=a.content.lastChild;t<a.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);a=rt(a,e,t)}return e.someProp("transformPasted",(t=>{a=t(a,e)})),a}const Xe=/^(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 Qe(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,o.FK.from(e));return e}function et(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let s=et(e,t,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(o.FK.from(Qe(n,e,i+1))))}}function tt(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,tt(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(o.FK.empty,!0);return e.copy(n.append(r))}function nt(e,t,n,r,i,s){let a=t<0?e.firstChild:e.lastChild,l=a.content;return e.childCount>1&&(s=0),i<r-1&&(l=nt(l,t,n,r,i+1,s)),i>=n&&(l=t<0?a.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(o.FK.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(l))}function rt(e,t,n){return t<e.openStart&&(e=new o.Ji(nt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new o.Ji(nt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const ot={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 it=null;function st(){return it||(it=document.implementation.createHTMLDocument("title"))}const at={},lt={},ct={touchstart:!0,touchmove:!0};class ut{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function dt(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function pt(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>ht(e,t))}))}function ht(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function ft(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function mt(e){return{left:e.clientX,top:e.clientY}}function gt(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,(t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function yt(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function bt(e,t,n,r){return gt(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function kt(e,t,n,o){return gt(e,"handleTripleClickOn",t,n,o)||e.someProp("handleTripleClick",(n=>n(e,t,o)))||function(e,t,n){if(0!=n.button)return!1;let o=e.state.doc;if(-1==t)return!!o.inlineContent&&(yt(e,r.U3.create(o,0,o.content.size),"pointer"),!0);let i=o.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),s=i.before(t);if(n.inlineContent)yt(e,r.U3.create(o,s+1,s+1+n.content.size),"pointer");else{if(!r.nh.isSelectable(n))continue;yt(e,r.nh.create(o,s),"pointer")}return!0}}(e,n,o)}function wt(e){return Nt(e)}lt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!St(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!R||!N||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!M||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||function(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||D&&72==n&&"c"==r)return Ge(e,-1)||Ue(e,-1);if(46==n||D&&68==n&&"c"==r)return Ge(e,1)||Ue(e,1);if(13==n||27==n)return!0;if(37==n||D&&66==n&&"c"==r){let t=37==n?"ltr"==Ke(e,e.state.selection.from)?-1:1:-1;return ze(e,t,r)||Ue(e,t)}if(39==n||D&&70==n&&"c"==r){let t=39==n?"ltr"==Ke(e,e.state.selection.from)?1:-1:1;return ze(e,t,r)||Ue(e,t)}return 38==n||D&&80==n&&"c"==r?qe(e,-1,r)||Ue(e,-1):40==n||D&&78==n&&"c"==r?function(e){if(!T||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Je(e,n,"true"),setTimeout((()=>Je(e,n,"false")),20)}return!1}(e)||qe(e,1,r)||He(e):r==(D?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():dt(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},lt.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},lt.keypress=(e,t)=>{let n=t;if(St(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||D&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let o=e.state.selection;if(!(o instanceof r.U3&&o.$from.sameParent(o.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,o.$from.pos,o.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const vt=D?"metaKey":"ctrlKey";at.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=wt(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[vt]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(mt(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new xt(e,s,n,!!r)):("doubleClick"==i?bt:kt)(e,s.pos,s.inside,n)?n.preventDefault():dt(e,"pointer"))};class xt{constructor(e,t,n,o){let i,s;if(this.view=e,this.pos=t,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[vt],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,s=n.depth?n.before():0}const a=o?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||c instanceof r.nh&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!C||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)),dt(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((()=>Ne(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(mt(e))),this.updateAllowDefault(e),this.allowDefault||!t?dt(this.view,"pointer"):function(e,t,n,o,i){return gt(e,"handleClickOn",t,n,o)||e.someProp("handleClick",(n=>n(e,t,o)))||(i?function(e,t){if(-1==t)return!1;let n,o,i=e.state.selection;i instanceof r.nh&&(n=i.node);let s=e.state.doc.resolve(t);for(let e=s.depth+1;e>0;e--){let t=e>s.depth?s.nodeAfter:s.node(e);if(r.nh.isSelectable(t)){o=n&&i.$from.depth>0&&e>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(e);break}}return null!=o&&(yt(e,r.nh.create(e.state.doc,o),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),o=n.nodeAfter;return!!(o&&o.isAtom&&r.nh.isSelectable(o))&&(yt(e,new r.nh(n),"pointer"),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||T&&this.mightDrag&&!this.mightDrag.node.isAtom||N&&!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)?(yt(this.view,r.LN.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):dt(this.view,"pointer")}move(e){this.updateAllowDefault(e),dt(this.view,"pointer"),0==e.buttons&&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)}}function St(e,t){return!!e.composing||!!(T&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}at.touchstart=e=>{e.input.lastTouch=Date.now(),wt(e),dt(e,"pointer")},at.touchmove=e=>{e.input.lastTouch=Date.now(),dt(e,"pointer")},at.contextmenu=e=>wt(e);const Et=R?5e3:-1;function Ct(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Nt(e)),t))}function At(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Nt(e,t=!1){if(!(R&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),At(e),t||e.docView&&e.docView.dirty){let t=Ce(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}lt.compositionstart=lt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Nt(e,!0),e.markCursor=null;else if(Nt(e),C&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){e.domSelection().collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Ct(e,Et)},lt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionID++,Ct(e,20))};const Ot=S&&E<15||M&&L<604;function Tt(e,t,n,r,i){let s=Ze(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,s||o.Ji.empty))))return!0;if(!s)return!1;let a=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(s),l=a?e.state.tr.replaceSelectionWith(a,e.input.shiftKey):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}at.copy=lt.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=Ot?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Ye(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},lt.paste=(e,t)=>{let n=t;if(e.composing&&!R)return;let r=Ot?null:n.clipboardData;r&&Tt(e,r.getData("text/plain"),r.getData("text/html"),e.input.shiftKey,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Tt(e,r.value,null,e.input.shiftKey,t):Tt(e,r.textContent,r.innerHTML,e.input.shiftKey,t)}),50)}(e,n)};class Mt{constructor(e,t){this.slice=e,this.move=t}}const Dt=D?"altKey":"ctrlKey";at.dragstart=(e,t)=>{let n=t,o=e.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let i=e.state.selection,s=i.empty?null:e.posAtCoords(mt(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof r.nh?i.to-1:i.to));else if(o&&o.mightDrag)e.dispatch(e.state.tr.setSelection(r.nh.create(e.state.doc,o.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(r.nh.create(e.state.doc,t.posBefore)))}let a=e.state.selection.content(),{dom:l,text:c}=Ye(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Ot?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ot||n.dataTransfer.setData("text/plain",c),e.dragging=new Mt(a,!n[Dt])},at.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},lt.dragover=lt.dragenter=(e,t)=>t.preventDefault(),lt.drop=(e,t)=>{let n=t,s=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let a=e.posAtCoords(mt(n));if(!a)return;let l=e.state.doc.resolve(a.pos),c=s&&s.slice;c?e.someProp("transformPasted",(t=>{c=t(c,e)})):c=Ze(e,n.dataTransfer.getData(Ot?"Text":"text/plain"),Ot?null:n.dataTransfer.getData("text/html"),!1,l);let u=!(!s||n[Dt]);if(e.someProp("handleDrop",(t=>t(e,n,c||o.Ji.empty,u))))return void n.preventDefault();if(!c)return;n.preventDefault();let d=c?(0,i.Um)(e.state.doc,l.pos,c):l.pos;null==d&&(d=l.pos);let p=e.state.tr;u&&p.deleteSelection();let h=p.mapping.map(d),f=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,m=p.doc;if(f?p.replaceRangeWith(h,h,c.content.firstChild):p.replaceRange(h,h,c),p.doc.eq(m))return;let g=p.doc.resolve(h);if(f&&r.nh.isSelectable(c.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(c.content.firstChild))p.setSelection(new r.nh(g));else{let t=p.mapping.map(d);p.mapping.maps[p.mapping.maps.length-1].forEach(((e,n,r,o)=>t=o)),p.setSelection(Fe(e,g,p.doc.resolve(t)))}e.focus(),e.dispatch(p.setMeta("uiEvent","drop"))},at.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Ne(e)}),20))},at.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},at.beforeinput=(e,t)=>{if(N&&R&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,g(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in lt)at[e]=lt[e];function It(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Rt{constructor(e,t){this.toDOM=e,this.spec=t||_t,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new Pt(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Rt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&It(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ft{constructor(e,t){this.attrs=e,this.spec=t||_t}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Pt(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Ft&&It(this.attrs,e.attrs)&&It(this.spec,e.spec)}static is(e){return e.type instanceof Ft}destroy(){}}class Lt{constructor(e,t){this.attrs=e,this.spec=t||_t}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Pt(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof Lt&&It(this.attrs,e.attrs)&&It(this.spec,e.spec)}destroy(){}}class Pt{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Pt(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,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new Pt(e,e,new Rt(t,n))}static inline(e,t,n,r){return new Pt(e,t,new Ft(n,r))}static node(e,t,n,r){return new Pt(e,t,new Lt(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ft}}const Bt=[],_t={};class zt{constructor(e,t){this.local=e.length?e:Bt,this.children=t.length?t:Bt}static create(e,t){return t.length?Wt(t,e,0,_t):$t}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==$t||0==e.maps.length?this:this.mapInner(e,t,0,0,n||_t)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let a=e.slice();for(let e=0,t=i;e<n.maps.length;e++){let r=0;n.maps[e].forEach(((e,n,i,s)=>{let l=s-i-(n-e);for(let s=0;s<a.length;s+=3){let c=a[s+1];if(c<0||e>c+t-r)continue;let u=a[s]+t-r;n>=u?a[s+1]=e<=u?-2:-1:i>=o&&l&&(a[s]+=l,a[s+1]+=l)}r+=l})),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+i),u=c-o;if(u<0||u>=r.content.size){l=!0;continue}let d=n.map(e[t+1]+i,-1)-o,{index:p,offset:h}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&h==u&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,c+1,e[t]+i+1,s);r!=$t?(a[t]=u,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,o,i,s){function a(e,t){for(let i=0;i<e.local.length;i++){let a=e.local[i].map(r,o,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[i].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+i+1);return n}(a,e,t,n,o,i,s),c=Wt(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new zt(t.sort(Kt),a)}(this.children,i||[],e,t,n,r,o):i?new zt(i.sort(Kt),Bt):$t}add(e,t){return t.length?this==$t?zt.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach(((e,i)=>{let s,a=i+n;if(s=Ht(t,e,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,s,a+1):r.splice(o,0,i,i+e.nodeSize,Wt(s,e,a+1,_t)),o+=3}}));let i=Ut(o?Vt(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new zt(i.length?this.local.concat(i).sort(Kt):this.local,r||this.children)}remove(e){return 0==e.length||this==$t?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=$t?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<e.length;o++)if(n=e[o])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new zt(r,n):$t}forChild(e,t){if(this==$t)return this;if(t.isLeaf)return zt.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof Ft){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new zt(r.sort(Kt),Bt);return n?new jt([e,n]):e}return n||$t}eq(e){if(this==e)return!0;if(!(e instanceof zt)||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 qt(this.localsInner(e))}localsInner(e){if(this==$t)return Bt;if(e.inlineContent||!this.local.some(Ft.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Ft||t.push(this.local[e]);return t}}zt.empty=new zt([],[]),zt.removeOverlap=qt;const $t=zt.empty;class jt{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,_t)));return jt.from(n)}forChild(e,t){if(t.isLeaf)return zt.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=$t&&(o instanceof jt?n=n.concat(o.members):n.push(o))}return jt.from(n)}eq(e){if(!(e instanceof jt)||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,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?qt(n?t:t.sort(Kt)):Bt}static from(e){switch(e.length){case 0:return $t;case 1:return e[0];default:return new jt(e.every((e=>e instanceof zt))?e:e.reduce(((e,t)=>e.concat(t instanceof zt?t:t.members)),[]))}}}function Ut(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new Pt(o.from+t,o.to+t,o.type))}return n}function Ht(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t,i=0;i<e.length;i++)(t=e[i])&&t.from>n&&t.to<r&&((o||(o=[])).push(t),e[i]=null);return o}function Vt(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Wt(e,t,n,r){let o=[],i=!1;t.forEach(((t,s)=>{let a=Ht(e,t,s+n);if(a){i=!0;let e=Wt(a,t,n+s+1,r);e!=$t&&o.push(s,s+t.nodeSize,e)}}));let s=Ut(i?Vt(e):e,-n).sort(Kt);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new zt(s,o):$t}function Kt(e,t){return e.from-t.from||e.to-t.to}function qt(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Gt(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Gt(t,o+1,i.copy(r.to,i.to)))}}return t}function Gt(e,t,n){for(;t<e.length&&Kt(n,e[t])>0;)t++;e.splice(t,0,n)}function Jt(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=$t&&t.push(r)})),e.cursorWrapper&&t.push(zt.create(e.state.doc,[e.cursorWrapper.deco])),jt.from(t)}const Yt={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Zt=S&&E<=11;class Xt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Qt{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Xt,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);S&&E<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Zt&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Yt)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(Le(this.view)){if(this.suppressingSelectionUpdates)return Ne(this.view);if(S&&E<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&u(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let t=e.focusNode;t;t=a(t))n.add(t);for(let r=e.anchorNode;r;r=a(r))if(n.has(r)){t=r;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Le(e)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],l);n&&(i=i<0?n.from:Math.min(n.from,i),s=s<0?n.to:Math.max(n.to,s),n.typeOver&&(a=!0))}if(C&&l.length>1){let e=l.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&m(n)&&(c=Ce(e))&&c.eq(r.LN.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ne(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),function(e){if(!en.has(e)&&(en.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=C,tn)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),tn=!0}}(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Ne(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(S&&E<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==e.target?s(r)+1:0,a=n.localPosFromDOM(e.target,i,-1),l=o&&o.parentNode==e.target?s(o):e.target.childNodes.length;return{from:a,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let en=new WeakMap,tn=!1;function nn(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(T&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||T&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const rn=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function on(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Fe(e,t.resolve(n.anchor),t.resolve(n.head))}function sn(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}class an{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ut,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(pn),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=un(this),cn(this),this.nodeViews=dn(this),this.docView=ce(this.state.doc,ln(this),Jt(this),this.dom,this),this.domObserver=new Qt(this,((e,t,n,i)=>function(e,t,n,i,s){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Ce(e,t);if(n&&!e.state.selection.eq(n)){if(N&&R&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.composing&&r.setMeta("composition",e.input.compositionID),e.dispatch(r)}return}let a=e.state.doc.resolve(t),l=a.sharedDepth(n);t=a.before(l+1),n=e.state.doc.resolve(n).after(l+1);let c,u,d=e.state.selection,p=function(e,t,n){let r,{node:i,fromOffset:s,toOffset:a,from:l,to:c}=e.docView.parseRange(t,n),u=e.domSelectionRange(),d=u.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:u.anchorOffset}],m(u)||r.push({node:u.focusNode,offset:u.focusOffset})),N&&8===e.input.lastKeyCode)for(let e=a;e>s;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){a=e;break}if(!n||n.size)break}let p=e.state.doc,h=e.someProp("domParser")||o.S4.fromSchema(e.state.schema),f=p.resolve(l),g=null,y=h.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:nn,context:f});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),g={anchor:e+l,head:t+l}}return{doc:y,sel:g,from:l,to:c}}(e,t,n),h=e.state.doc,f=h.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(c=e.state.selection.to,u="end"):(c=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let y=function(e,t,n,r,o){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);return"end"==o&&(r-=s+Math.max(0,i-Math.min(s,a))-i),s<i&&e.size<t.size?(i-=r<=i&&r>=s?i-r:0,a=i+(a-s),s=i):a<i&&(i-=r<=i&&r>=a?i-r:0,s=i+(s-a),a=i),{start:i,endA:s,endB:a}}(f.content,p.doc.content,p.from,c,u);if((M&&e.input.lastIOSEnter>Date.now()-225||R)&&s.some((e=>1==e.nodeType&&!rn.test(e.nodeName)))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!y){if(!(i&&d instanceof r.U3&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let t=on(e,e.state.doc,p.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);e.composing&&n.setMeta("composition",e.input.compositionID),e.dispatch(n)}}return}y={start:d.from,endA:d.to,endB:d.to}}if(N&&e.cursorWrapper&&p.sel&&p.sel.anchor==e.cursorWrapper.deco.from&&p.sel.head==p.sel.anchor){let e=y.endB-y.start;p.sel={anchor:p.sel.anchor+e,head:p.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof r.U3&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),S&&E<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>p.from&&"  "==p.doc.textBetween(y.start-p.from-1,y.start-p.from+1)&&(y.start--,y.endA--,y.endB--);let b,k=p.doc.resolveNoCache(y.start-p.from),w=p.doc.resolveNoCache(y.endB-p.from),v=h.resolve(y.start),x=k.sameParent(w)&&k.parent.inlineContent&&v.end()>=y.endA;if((M&&e.input.lastIOSEnter>Date.now()-225&&(!x||s.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!x&&k.pos<p.doc.content.size&&(b=r.LN.findFrom(p.doc.resolve(k.pos+1),1,!0))&&b.head==w.pos)&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>y.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||sn(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(sn(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||sn(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(h,y.start,y.endA,k,w)&&e.someProp("handleKeyDown",(t=>t(e,g(8,"Backspace")))))return void(R&&N&&e.domObserver.suppressSelectionUpdates());N&&R&&y.endB==y.start&&(e.input.lastAndroidDelete=Date.now()),R&&!x&&k.start()!=w.start()&&0==w.parentOffset&&k.depth==w.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==y.endA&&(y.endB-=2,w=p.doc.resolveNoCache(y.endB-p.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,g(13,"Enter"))}))}),20));let C,A,O,T=y.start,D=y.endA;if(x)if(k.pos==w.pos)S&&E<=11&&0==k.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Ne(e)),20)),C=e.state.tr.delete(T,D),A=h.resolve(y.start).marksAcross(h.resolve(y.endA));else if(y.endA==y.endB&&(O=function(e,t){let n,r,i,s=e.firstChild.marks,a=t.firstChild.marks,l=s,c=a;for(let e=0;e<a.length;e++)l=a[e].removeFromSet(l);for(let e=0;e<s.length;e++)c=s[e].removeFromSet(c);if(1==l.length&&0==c.length)r=l[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=l.length||1!=c.length)return null;r=c[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let u=[];for(let e=0;e<t.childCount;e++)u.push(i(t.child(e)));if(o.FK.from(u).eq(e))return{mark:r,type:n}}(k.parent.content.cut(k.parentOffset,w.parentOffset),v.parent.content.cut(v.parentOffset,y.endA-v.start()))))C=e.state.tr,"add"==O.type?C.addMark(T,D,O.mark):C.removeMark(T,D,O.mark);else if(k.parent.child(k.index()).isText&&k.index()==w.index()-(w.textOffset?0:1)){let t=k.parent.textBetween(k.parentOffset,w.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,T,D,t))))return;C=e.state.tr.insertText(t,T,D)}if(C||(C=e.state.tr.replace(T,D,p.doc.slice(y.start-p.from,y.endB-p.from))),p.sel){let t=on(e,C.doc,p.sel);t&&!(N&&R&&e.composing&&t.empty&&(y.start!=y.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==T||t.head==C.mapping.map(D)-1)||S&&t.empty&&t.head==T)&&C.setSelection(t)}A&&C.ensureMarks(A),e.composing&&C.setMeta("composition",e.input.compositionID),e.dispatch(C.scrollIntoView())}(this,e,t,n,i))),this.domObserver.start(),function(e){for(let t in at){let n=at[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!ft(e,t)||ht(e,t)||!e.editable&&t.type in lt||n(e,t)},ct[t]?{passive:!0}:void 0)}T&&e.dom.addEventListener("input",(()=>null)),pt(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&pt(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(pn),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,o=!1;e.storedMarks&&this.composing&&(At(this),o=!0),this.state=e;let i=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(i||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=dn(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(i||t.handleDOMEvents!=this._props.handleDOMEvents)&&pt(this),this.editable=un(this),cn(this);let s=Jt(this),a=ln(this),l=n.plugins==e.plugins||n.doc.eq(e.doc)?e.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=r||!this.docView.matchesNode(e.doc,a,s);!c&&e.selection.eq(n.selection)||(o=!0);let d="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:$(e.dom)}}(this);if(o){this.domObserver.stop();let t=c&&(S||N)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(c){let n=N?this.trackWrites=this.domSelectionRange().focusNode:null;!r&&this.docView.update(e.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ce(e.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return u(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Ne(this,t):(Ie(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():d&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;j(n,0==r?0:r-t)}(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof r.nh){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&z(this,t.getBoundingClientRect(),e)}else z(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let o=this.directPlugins[r].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[e];if(null!=i&&(n=t?t(i):i))return n}}hasFocus(){if(S){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(U)return e.focus(U);let t=$(e);e.focus(null==U?{get preventScroll(){return U={preventScroll:!0},!0}}:void 0),U||(U=!1,j(t,0))}(this.dom),Ne(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return K(this,e)}coordsAtPos(e,t=1){return Y(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){return te==t&&ne==n?re:(te=t,ne=n,re="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return Q(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Y(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=c(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return ee.test(r.parent.textContent)&&a.modify?Q(e,t,(()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:s}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),p=u&&!c.contains(1==u.nodeType?u:u.parentNode)||t==u&&o==d;try{a.collapse(i,s),t&&(t!=i||o!=s)&&a.extend&&a.extend(t,o)}catch(e){}return null!=l&&(a.caretBidiLevel=l),p})):"left"==n||"backward"==n?i:s}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return Tt(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Tt(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Jt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){ht(e,t)||!at[t.type]||!e.editable&&t.type in lt||at[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return T&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom?function(e){let t;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,o=t.startOffset,i=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return u(a.node,a.offset,i,s)&&([r,o,i,s]=[i,s,r,o]),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function ln(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[Pt.node(0,e.state.doc.content.size,t)]}function cn(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Pt.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function un(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function dn(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function pn(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}},74635:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(72016);function o(e,t){(0,r.A)(e,t),t.add(e)}},77508:(e,t,n)=>{"use strict";n.d(t,{N:()=>o});var r=n(17884);function o(e,t,n,o){const i=o?o-1:Number.POSITIVE_INFINITY;let s=0;return function(o){return(0,r.On)(o)?(e.enter(n),a(o)):t(o)};function a(o){return(0,r.On)(o)&&s++<i?(e.consume(o),a):(e.exit(n),t(o))}}},80096:(e,t,n)=>{"use strict";n.d(t,{JJ:()=>s,fV:()=>o,tG:()=>i});var r=n(11329);class o{constructor(e,t){var n;this.match=e,this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,o){let i=n;if(t[1]){let e=t[0].lastIndexOf(t[1]);i+=t[0].slice(e+t[1].length);let n=(r+=e)-o;n>0&&(i=t[0].slice(e-n,e)+i,r=o)}return e.tr.insertText(i,r,o)}):t}}function i(e,t,n=null,i){return new o(e,((e,o,s,a)=>{let l=n instanceof Function?n(o):n,c=e.tr.delete(s,a),u=c.doc.resolve(s).blockRange(),d=u&&(0,r.oM)(u,t,l);if(!d)return null;c.wrap(u,d);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&(0,r.n9)(c.doc,s-1)&&(!i||i(o,p))&&c.join(s-1),c}))}function s(e,t,n=null){return new o(e,((e,r,o,i)=>{let s=e.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(o,i).setBlockType(o,o,t,a):null}))}new o(/--$/,"—"),new o(/\.\.\.$/,"…"),new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new o(/"$/,"”"),new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new o(/'$/,"’")},81570:(e,t,n)=>{"use strict";n.d(t,{$t:()=>S,LN:()=>s,U3:()=>u,hs:()=>O,i5:()=>f,k_:()=>C,nh:()=>p,yn:()=>a});var r=n(16090),o=n(11329);const i=Object.create(null);class s{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new a(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=r.Ji.empty){let n=t.content.lastChild,o=null;for(let e=0;e<t.openEnd;e++)o=n,n=n.lastChild;let i=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?r.Ji.empty:t),0==a&&y(e,i,(n?n.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),y(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new u(e):g(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?g(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):g(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new f(e.node(0))}static atStart(e){return g(e,e,0,0,1)||new f(e)}static atEnd(e){return g(e,e,e.content.size,e.childCount,-1)||new f(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=i[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in i)throw new RangeError("Duplicate use of selection JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t}getBookmark(){return u.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class a{constructor(e,t){this.$from=e,this.$to=t}}let l=!1;function c(e){l||e.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class u extends s{constructor(e,t=e){c(e),c(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=e.resolve(t.map(this.anchor));return new u(r.parent.inlineContent?r:n,n)}replace(e,t=r.Ji.empty){if(super.replace(e,t),t==r.Ji.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof u&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new d(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new u(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=s.findFrom(t,n,!0)||s.findFrom(t,-n,!0);if(!e)return s.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(s.findFrom(e,-n,!0)||s.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new u(e,t)}}s.jsonID("text",u);class d{constructor(e,t){this.anchor=e,this.head=t}map(e){return new d(e.map(this.anchor),e.map(this.head))}resolve(e){return u.between(e.resolve(this.anchor),e.resolve(this.head))}}class p extends s{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?s.near(o):new p(o)}content(){return new r.Ji(r.FK.from(this.node),0,0)}eq(e){return e instanceof p&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new h(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new p(e.resolve(t.anchor))}static create(e,t){return new p(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}p.prototype.visible=!1,s.jsonID("node",p);class h{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new d(n,n):new h(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&p.isSelectable(n)?new p(t):s.near(t)}}class f extends s{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=r.Ji.empty){if(t==r.Ji.empty){e.delete(0,e.doc.content.size);let t=s.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new f(e)}map(e){return new f(e)}eq(e){return e instanceof f}getBookmark(){return m}}s.jsonID("all",f);const m={map(){return this},resolve:e=>new f(e)};function g(e,t,n,r,o,i=!1){if(t.inlineContent)return u.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&p.isSelectable(r))return p.create(e,n-(o<0?r.nodeSize:0))}else{let t=g(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function y(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,a=e.steps[r];(a instanceof o.Ln||a instanceof o.Wg)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(s.near(e.doc.resolve(i),n)))}class b extends o.dL{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function k(e,t){return t&&e?e.bind(t):e}class w{constructor(e,t,n){this.name=e,this.init=k(t.init,n),this.apply=k(t.apply,n)}}const v=[new w("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new w("selection",{init:(e,t)=>e.selection||s.atStart(t.doc),apply:e=>e.selection}),new w("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new w("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class x{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=v.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new w(e.key,e.spec.state,e))}))}}class S{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new S(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new b(this)}static create(e){let t=new x(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new S(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new x(this.schema,e.plugins),n=t.fields,r=new S(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new x(e.schema,e.plugins),i=new S(o);return o.fields.forEach((o=>{if("doc"==o.name)i.doc=r.bP.fromJSON(e.schema,t.doc);else if("selection"==o.name)i.selection=s.fromJSON(i.doc,t.selection);else if("storedMarks"==o.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],a=s.spec.state;if(s.key==o.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(i[o.name]=a.fromJSON.call(s,e,t[r],i))}i[o.name]=o.init(e,i)}})),i}}function E(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=E(o,t,{})),n[r]=o}return n}class C{constructor(e){this.spec=e,this.props={},e.props&&E(e.props,this,this.props),this.key=e.key?e.key.key:N("plugin")}getState(e){return e[this.key]}}const A=Object.create(null);function N(e){return e in A?e+"$"+ ++A[e]:(A[e]=0,e+"$")}class O{constructor(e="key"){this.key=N(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},83751:(e,t,n)=>{"use strict";n.d(t,{B:()=>yt,y:()=>bt});var r=n(44254),o=n(81570),i=n(30072);function s(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function a(e){return e instanceof s(e).Element||e instanceof Element}function l(e){return e instanceof s(e).HTMLElement||e instanceof HTMLElement}function c(e){return"undefined"!=typeof ShadowRoot&&(e instanceof s(e).ShadowRoot||e instanceof ShadowRoot)}var u=Math.max,d=Math.min,p=Math.round;function h(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function f(){return!/^((?!chrome|android).)*safari/i.test(h())}function m(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&l(e)&&(o=e.offsetWidth>0&&p(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&p(r.height)/e.offsetHeight||1);var c=(a(e)?s(e):window).visualViewport,u=!f()&&n,d=(r.left+(u&&c?c.offsetLeft:0))/o,h=(r.top+(u&&c?c.offsetTop:0))/i,m=r.width/o,g=r.height/i;return{width:m,height:g,top:h,right:d+m,bottom:h+g,left:d,x:d,y:h}}function g(e){var t=s(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function y(e){return e?(e.nodeName||"").toLowerCase():null}function b(e){return((a(e)?e.ownerDocument:e.document)||window.document).documentElement}function k(e){return m(b(e)).left+g(e).scrollLeft}function w(e){return s(e).getComputedStyle(e)}function v(e){var t=w(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function x(e,t,n){void 0===n&&(n=!1);var r,o,i=l(t),a=l(t)&&function(e){var t=e.getBoundingClientRect(),n=p(t.width)/e.offsetWidth||1,r=p(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),c=b(t),u=m(e,a,n),d={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(i||!i&&!n)&&(("body"!==y(t)||v(c))&&(d=(r=t)!==s(r)&&l(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:g(r)),l(t)?((h=m(t,!0)).x+=t.clientLeft,h.y+=t.clientTop):c&&(h.x=k(c))),{x:u.left+d.scrollLeft-h.x,y:u.top+d.scrollTop-h.y,width:u.width,height:u.height}}function S(e){var t=m(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function E(e){return"html"===y(e)?e:e.assignedSlot||e.parentNode||(c(e)?e.host:null)||b(e)}function C(e){return["html","body","#document"].indexOf(y(e))>=0?e.ownerDocument.body:l(e)&&v(e)?e:C(E(e))}function A(e,t){var n;void 0===t&&(t=[]);var r=C(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=s(r),a=o?[i].concat(i.visualViewport||[],v(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(A(E(a)))}function N(e){return["table","td","th"].indexOf(y(e))>=0}function O(e){return l(e)&&"fixed"!==w(e).position?e.offsetParent:null}function T(e){for(var t=s(e),n=O(e);n&&N(n)&&"static"===w(n).position;)n=O(n);return n&&("html"===y(n)||"body"===y(n)&&"static"===w(n).position)?t:n||function(e){var t=/firefox/i.test(h());if(/Trident/i.test(h())&&l(e)&&"fixed"===w(e).position)return null;var n=E(e);for(c(n)&&(n=n.host);l(n)&&["html","body"].indexOf(y(n))<0;){var r=w(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var M="top",D="bottom",I="right",R="left",F="auto",L=[M,D,I,R],P="start",B="end",_="viewport",z="popper",$=L.reduce((function(e,t){return e.concat([t+"-"+P,t+"-"+B])}),[]),j=[].concat(L,[F]).reduce((function(e,t){return e.concat([t,t+"-"+P,t+"-"+B])}),[]),U=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function H(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var V={placement:"bottom",modifiers:[],strategy:"absolute"};function W(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function K(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?V:o;return function(e,t,n){void 0===n&&(n=i);var o,s,l={placement:"bottom",orderedModifiers:[],options:Object.assign({},V,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],u=!1,d={state:l,setOptions:function(n){var o="function"==typeof n?n(l.options):n;p(),l.options=Object.assign({},i,l.options,o),l.scrollParents={reference:a(e)?A(e):e.contextElement?A(e.contextElement):[],popper:A(t)};var s,u,h=function(e){var t=H(e);return U.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(r,l.options.modifiers),u=s.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(u).map((function(e){return u[e]}))));return l.orderedModifiers=h.filter((function(e){return e.enabled})),l.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:l,name:t,instance:d,options:r});c.push(i||function(){})}})),d.update()},forceUpdate:function(){if(!u){var e=l.elements,t=e.reference,n=e.popper;if(W(t,n)){l.rects={reference:x(t,T(n),"fixed"===l.options.strategy),popper:S(n)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach((function(e){return l.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<l.orderedModifiers.length;r++)if(!0!==l.reset){var o=l.orderedModifiers[r],i=o.fn,s=o.options,a=void 0===s?{}:s,c=o.name;"function"==typeof i&&(l=i({state:l,options:a,name:c,instance:d})||l)}else l.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(e){d.forceUpdate(),e(l)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(o())}))}))),s}),destroy:function(){p(),u=!0}};if(!W(e,t))return d;function p(){c.forEach((function(e){return e()})),c=[]}return d.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),d}}var q={passive:!0};function G(e){return e.split("-")[0]}function J(e){return e.split("-")[1]}function Y(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Z(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?G(o):null,s=o?J(o):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case M:t={x:a,y:n.y-r.height};break;case D:t={x:a,y:n.y+n.height};break;case I:t={x:n.x+n.width,y:l};break;case R:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?Y(i):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case P:t[c]=t[c]-(n[u]/2-r[u]/2);break;case B:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}var X={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,f=a.x,m=void 0===f?0:f,g=a.y,y=void 0===g?0:g,k="function"==typeof d?d({x:m,y}):{x:m,y};m=k.x,y=k.y;var v=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),S=R,E=M,C=window;if(u){var A=T(n),N="clientHeight",O="clientWidth";A===s(n)&&"static"!==w(A=b(n)).position&&"absolute"===l&&(N="scrollHeight",O="scrollWidth"),(o===M||(o===R||o===I)&&i===B)&&(E=D,y-=(h&&A===C&&C.visualViewport?C.visualViewport.height:A[N])-r.height,y*=c?1:-1),o!==R&&(o!==M&&o!==D||i!==B)||(S=I,m-=(h&&A===C&&C.visualViewport?C.visualViewport.width:A[O])-r.width,m*=c?1:-1)}var F,L=Object.assign({position:l},u&&X),P=!0===d?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:p(n*o)/o||0,y:p(r*o)/o||0}}({x:m,y},s(n)):{x:m,y};return m=P.x,y=P.y,c?Object.assign({},L,((F={})[E]=x?"0":"",F[S]=v?"0":"",F.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",F)):Object.assign({},L,((t={})[E]=x?y+"px":"",t[S]=v?m+"px":"",t.transform="",t))}const ee={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];l(o)&&y(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});l(r)&&y(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,s=j.reduce((function(e,n){return e[n]=function(e,t,n){var r=G(e),o=[R,M].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[R,I].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,i),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}};var ne={left:"right",right:"left",bottom:"top",top:"bottom"};function re(e){return e.replace(/left|right|bottom|top/g,(function(e){return ne[e]}))}var oe={start:"end",end:"start"};function ie(e){return e.replace(/start|end/g,(function(e){return oe[e]}))}function se(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&c(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ae(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function le(e,t,n){return t===_?ae(function(e,t){var n=s(e),r=b(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;var u=f();(u||!u&&"fixed"===t)&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l+k(e),y:c}}(e,n)):a(t)?function(e,t){var n=m(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):ae(function(e){var t,n=b(e),r=g(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=u(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=u(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+k(e),l=-r.scrollTop;return"rtl"===w(o||n).direction&&(a+=u(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(b(e)))}function ce(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ue(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function de(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,s=void 0===i?e.strategy:i,c=n.boundary,p=void 0===c?"clippingParents":c,h=n.rootBoundary,f=void 0===h?_:h,g=n.elementContext,k=void 0===g?z:g,v=n.altBoundary,x=void 0!==v&&v,S=n.padding,C=void 0===S?0:S,N=ce("number"!=typeof C?C:ue(C,L)),O=k===z?"reference":z,R=e.rects.popper,F=e.elements[x?O:k],P=function(e,t,n,r){var o="clippingParents"===t?function(e){var t=A(E(e)),n=["absolute","fixed"].indexOf(w(e).position)>=0&&l(e)?T(e):e;return a(n)?t.filter((function(e){return a(e)&&se(e,n)&&"body"!==y(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),s=i[0],c=i.reduce((function(t,n){var o=le(e,n,r);return t.top=u(o.top,t.top),t.right=d(o.right,t.right),t.bottom=d(o.bottom,t.bottom),t.left=u(o.left,t.left),t}),le(e,s,r));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}(a(F)?F:F.contextElement||b(e.elements.popper),p,f,s),B=m(e.elements.reference),$=Z({reference:B,element:R,strategy:"absolute",placement:o}),j=ae(Object.assign({},R,$)),U=k===z?j:B,H={top:P.top-U.top+N.top,bottom:U.bottom-P.bottom+N.bottom,left:P.left-U.left+N.left,right:U.right-P.right+N.right},V=e.modifiersData.offset;if(k===z&&V){var W=V[o];Object.keys(H).forEach((function(e){var t=[I,D].indexOf(e)>=0?1:-1,n=[M,D].indexOf(e)>=0?"y":"x";H[e]+=W[n]*t}))}return H}const pe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,y=G(g),b=l||(y!==g&&f?function(e){if(G(e)===F)return[];var t=re(e);return[ie(e),t,ie(t)]}(g):[re(g)]),k=[g].concat(b).reduce((function(e,n){return e.concat(G(n)===F?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?j:l,u=J(r),d=u?a?$:$.filter((function(e){return J(e)===u})):L,p=d.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=de(e,{placement:n,boundary:o,rootBoundary:i,padding:s})[G(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,v=t.rects.popper,x=new Map,S=!0,E=k[0],C=0;C<k.length;C++){var A=k[C],N=G(A),O=J(A)===P,T=[M,D].indexOf(N)>=0,B=T?"width":"height",_=de(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),z=T?O?I:R:O?D:M;w[B]>v[B]&&(z=re(z));var U=re(z),H=[];if(i&&H.push(_[N]<=0),a&&H.push(_[z]<=0,_[U]<=0),H.every((function(e){return e}))){E=A,S=!1;break}x.set(A,H)}if(S)for(var V=function(e){var t=k.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},W=f?3:1;W>0&&"break"!==V(W);W--);t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function he(e,t,n){return u(e,d(t,n))}function fe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function me(e){return[M,I,D,R].some((function(t){return e[t]>=0}))}var ge=K({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,l=void 0===a||a,c=s(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach((function(e){e.addEventListener("scroll",n.update,q)})),l&&c.addEventListener("resize",n.update,q),function(){i&&u.forEach((function(e){e.removeEventListener("scroll",n.update,q)})),l&&c.removeEventListener("resize",n.update,q)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Z({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:G(t.placement),variation:J(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Q(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Q(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},ee,te,pe,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,p=n.altBoundary,h=n.padding,f=n.tether,m=void 0===f||f,g=n.tetherOffset,y=void 0===g?0:g,b=de(t,{boundary:l,rootBoundary:c,padding:h,altBoundary:p}),k=G(t.placement),w=J(t.placement),v=!w,x=Y(k),E="x"===x?"y":"x",C=t.modifiersData.popperOffsets,A=t.rects.reference,N=t.rects.popper,O="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,F="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(C){if(i){var _,z="y"===x?M:R,$="y"===x?D:I,j="y"===x?"height":"width",U=C[x],H=U+b[z],V=U-b[$],W=m?-N[j]/2:0,K=w===P?A[j]:N[j],q=w===P?-N[j]:-A[j],Z=t.elements.arrow,X=m&&Z?S(Z):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Q[z],te=Q[$],ne=he(0,A[j],X[j]),re=v?A[j]/2-W-ne-ee-F.mainAxis:K-ne-ee-F.mainAxis,oe=v?-A[j]/2+W+ne+te+F.mainAxis:q+ne+te+F.mainAxis,ie=t.elements.arrow&&T(t.elements.arrow),se=ie?"y"===x?ie.clientTop||0:ie.clientLeft||0:0,ae=null!=(_=null==L?void 0:L[x])?_:0,le=U+oe-ae,ce=he(m?d(H,U+re-ae-se):H,U,m?u(V,le):V);C[x]=ce,B[x]=ce-U}if(a){var ue,pe="x"===x?M:R,fe="x"===x?D:I,me=C[E],ge="y"===E?"height":"width",ye=me+b[pe],be=me-b[fe],ke=-1!==[M,R].indexOf(k),we=null!=(ue=null==L?void 0:L[E])?ue:0,ve=ke?ye:me-A[ge]-N[ge]-we+F.altAxis,xe=ke?me+A[ge]+N[ge]-we-F.altAxis:be,Se=m&&ke?function(e,t,n){var r=he(e,t,n);return r>n?n:r}(ve,me,xe):he(m?ve:ye,me,m?xe:be);C[E]=Se,B[E]=Se-me}t.modifiersData[r]=B}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=G(n.placement),l=Y(a),c=[R,I].indexOf(a)>=0?"height":"width";if(i&&s){var u=function(e,t){return ce("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ue(e,L))}(o.padding,n),d=S(i),p="y"===l?M:R,h="y"===l?D:I,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],g=T(i),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=f/2-m/2,k=u[p],w=y-d[c]-u[h],v=y/2-d[c]/2+b,x=he(k,v,w),E=l;n.modifiersData[r]=((t={})[E]=x,t.centerOffset=x-v,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&se(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=de(t,{elementContext:"reference"}),a=de(t,{altBoundary:!0}),l=fe(s,r),c=fe(a,o,i),u=me(l),d=me(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),ye="tippy-content",be="tippy-arrow",ke="tippy-svg-arrow",we={passive:!0,capture:!0},ve=function(){return document.body};function xe(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Se(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Ee(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Ce(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ae(e){return[].concat(e)}function Ne(e,t){-1===e.indexOf(t)&&e.push(t)}function Oe(e){return[].slice.call(e)}function Te(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Me(){return document.createElement("div")}function De(e){return["Element","Fragment"].some((function(t){return Se(e,t)}))}function Ie(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Re(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Fe(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function Le(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var Pe={isTouch:!1},Be=0;function _e(){Pe.isTouch||(Pe.isTouch=!0,window.performance&&document.addEventListener("mousemove",ze))}function ze(){var e=performance.now();e-Be<20&&(Pe.isTouch=!1,document.removeEventListener("mousemove",ze)),Be=e}function $e(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var je=!("undefined"==typeof window||"undefined"==typeof document||!window.msCrypto),Ue=Object.assign({appendTo:ve,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),He=Object.keys(Ue);function Ve(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;return o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=Ue[o])?r:i),t}),{});return Object.assign({},e,t)}function We(e,t){var n=Object.assign({},t,{content:Ee(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Ve(Object.assign({},Ue,{plugins:t}))):He).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Ue.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Ke(e,t){e.innerHTML=t}function qe(e){var t=Me();return!0===e?t.className=be:(t.className=ke,De(e)?t.appendChild(e):Ke(t,e)),t}function Ge(e,t){De(t.content)?(Ke(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Ke(e,t.content):e.textContent=t.content)}function Je(e){var t=e.firstElementChild,n=Oe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ye)})),arrow:n.find((function(e){return e.classList.contains(be)||e.classList.contains(ke)})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function Ye(e){var t=Me(),n=Me();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Me();function o(n,r){var o=Je(t),i=o.box,s=o.content,a=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Ge(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(i.removeChild(a),i.appendChild(qe(r.arrow))):i.appendChild(qe(r.arrow)):a&&i.removeChild(a)}return r.className=ye,r.setAttribute("data-state","hidden"),Ge(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Ye.$$tippy=!0;var Ze=1,Xe=[],Qe=[];function et(e,t){var n,r,o,i,s,a,l,c,u=We(e,Object.assign({},Ue,Ve(Te(t)))),d=!1,p=!1,h=!1,f=!1,m=[],g=Ce(q,u.interactiveDebounce),y=Ze++,b=(c=u.plugins).filter((function(e,t){return c.indexOf(e)===t})),k={id:y,reference:e,popper:Me(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){if(!k.state.isDestroyed){R("onBeforeUpdate",[k,t]),W();var n=k.props,r=We(e,Object.assign({},n,Te(t),{ignoreAttributes:!0}));k.props=r,V(),n.interactiveDebounce!==r.interactiveDebounce&&(P(),g=Ce(q,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?Ae(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded"),L(),I(),x&&x(n,r),k.popperInstance&&(Z(),Q().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))),R("onAfterUpdate",[k,t])}},setContent:function(e){k.setProps({content:e})},show:function(){var e=k.state.isVisible,t=k.state.isDestroyed,n=!k.state.isEnabled,r=Pe.isTouch&&!k.props.touch,o=xe(k.props.duration,0,Ue.duration);if(!(e||t||n||r||O().hasAttribute("disabled")||(R("onShow",[k],!1),!1===k.props.onShow(k)))){if(k.state.isVisible=!0,N()&&(v.style.visibility="visible"),I(),$(),k.state.isMounted||(v.style.transition="none"),N()){var i=M();Ie([i.box,i.content],0)}var s,l,c;a=function(){var e;if(k.state.isVisible&&!f){if(f=!0,v.offsetHeight,v.style.transition=k.props.moveTransition,N()&&k.props.animation){var t=M(),n=t.box,r=t.content;Ie([n,r],o),Re([n,r],"visible")}F(),L(),Ne(Qe,k),null==(e=k.popperInstance)||e.forceUpdate(),R("onMount",[k]),k.props.animation&&N()&&function(e){U(e,(function(){k.state.isShown=!0,R("onShown",[k])}))}(o)}},l=k.props.appendTo,c=O(),(s=k.props.interactive&&l===ve||"parent"===l?c.parentNode:Ee(l,[c])).contains(v)||s.appendChild(v),k.state.isMounted=!0,Z()}},hide:function(){var e=!k.state.isVisible,t=k.state.isDestroyed,n=!k.state.isEnabled,r=xe(k.props.duration,1,Ue.duration);if(!(e||t||n)&&(R("onHide",[k],!1),!1!==k.props.onHide(k))){if(k.state.isVisible=!1,k.state.isShown=!1,f=!1,d=!1,N()&&(v.style.visibility="hidden"),P(),j(),I(!0),N()){var o=M(),i=o.box,s=o.content;k.props.animation&&(Ie([i,s],r),Re([i,s],"hidden"))}F(),L(),k.props.animation?N()&&function(e,t){U(e,(function(){!k.state.isVisible&&v.parentNode&&v.parentNode.contains(v)&&t()}))}(r,k.unmount):k.unmount()}},hideWithInteractivity:function(e){T().addEventListener("mousemove",g),Ne(Xe,g),g(e)},enable:function(){k.state.isEnabled=!0},disable:function(){k.hide(),k.state.isEnabled=!1},unmount:function(){k.state.isVisible&&k.hide(),k.state.isMounted&&(X(),Q().forEach((function(e){e._tippy.unmount()})),v.parentNode&&v.parentNode.removeChild(v),Qe=Qe.filter((function(e){return e!==k})),k.state.isMounted=!1,R("onHidden",[k]))},destroy:function(){k.state.isDestroyed||(k.clearDelayTimeouts(),k.unmount(),W(),delete e._tippy,k.state.isDestroyed=!0,R("onDestroy",[k]))}};if(!u.render)return k;var w=u.render(k),v=w.popper,x=w.onUpdate;v.setAttribute("data-tippy-root",""),v.id="tippy-"+k.id,k.popper=v,e._tippy=k,v._tippy=k;var S=b.map((function(e){return e.fn(k)})),E=e.hasAttribute("aria-expanded");return V(),L(),I(),R("onCreate",[k]),u.showOnCreate&&ee(),v.addEventListener("mouseenter",(function(){k.props.interactive&&k.state.isVisible&&k.clearDelayTimeouts()})),v.addEventListener("mouseleave",(function(){k.props.interactive&&k.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",g)})),k;function C(){var e=k.props.touch;return Array.isArray(e)?e:[e,0]}function A(){return"hold"===C()[0]}function N(){var e;return!(null==(e=k.props.render)||!e.$$tippy)}function O(){return l||e}function T(){var e,t,n=O().parentNode;return n?null!=(t=Ae(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function M(){return Je(v)}function D(e){return k.state.isMounted&&!k.state.isVisible||Pe.isTouch||i&&"focus"===i.type?0:xe(k.props.delay,e?0:1,Ue.delay)}function I(e){void 0===e&&(e=!1),v.style.pointerEvents=k.props.interactive&&!e?"":"none",v.style.zIndex=""+k.props.zIndex}function R(e,t,n){var r;void 0===n&&(n=!0),S.forEach((function(n){n[e]&&n[e].apply(n,t)})),n&&(r=k.props)[e].apply(r,t)}function F(){var t=k.props.aria;if(t.content){var n="aria-"+t.content,r=v.id;Ae(k.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(k.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function L(){!E&&k.props.aria.expanded&&Ae(k.props.triggerTarget||e).forEach((function(e){k.props.interactive?e.setAttribute("aria-expanded",k.state.isVisible&&e===O()?"true":"false"):e.removeAttribute("aria-expanded")}))}function P(){T().removeEventListener("mousemove",g),Xe=Xe.filter((function(e){return e!==g}))}function B(t){if(!Pe.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!k.props.interactive||!Le(v,n)){if(Ae(k.props.triggerTarget||e).some((function(e){return Le(e,n)}))){if(Pe.isTouch)return;if(k.state.isVisible&&k.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[k,t]);!0===k.props.hideOnClick&&(k.clearDelayTimeouts(),k.hide(),p=!0,setTimeout((function(){p=!1})),k.state.isMounted||j())}}}function _(){h=!0}function z(){h=!1}function $(){var e=T();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,we),e.addEventListener("touchstart",z,we),e.addEventListener("touchmove",_,we)}function j(){var e=T();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,we),e.removeEventListener("touchstart",z,we),e.removeEventListener("touchmove",_,we)}function U(e,t){var n=M().box;function r(e){e.target===n&&(Fe(n,"remove",r),t())}if(0===e)return t();Fe(n,"remove",s),Fe(n,"add",r),s=r}function H(t,n,r){void 0===r&&(r=!1),Ae(k.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function V(){var e;A()&&(H("touchstart",K,{passive:!0}),H("touchend",G,{passive:!0})),(e=k.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(H(e,K),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(je?"focusout":"blur",J);break;case"focusin":H("focusout",J)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),m=[]}function K(e){var t,n=!1;if(k.state.isEnabled&&!Y(e)&&!p){var r="focus"===(null==(t=i)?void 0:t.type);i=e,l=e.currentTarget,L(),!k.state.isVisible&&Se(e,"MouseEvent")&&Xe.forEach((function(t){return t(e)})),"click"===e.type&&(k.props.trigger.indexOf("mouseenter")<0||d)&&!1!==k.props.hideOnClick&&k.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function q(e){var t=e.target,n=O().contains(t)||v.contains(t);if("mousemove"!==e.type||!n){var r=Q().concat(v).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:u}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,s=o.placement.split("-")[0],a=o.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,u="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=t.top-r+l>i,h=r-t.bottom-c>i,f=t.left-n+u>i,m=n-t.right-d>i;return p||h||f||m}))})(r,e)&&(P(),te(e))}}function G(e){Y(e)||k.props.trigger.indexOf("click")>=0&&d||(k.props.interactive?k.hideWithInteractivity(e):te(e))}function J(e){k.props.trigger.indexOf("focusin")<0&&e.target!==O()||k.props.interactive&&e.relatedTarget&&v.contains(e.relatedTarget)||te(e)}function Y(e){return!!Pe.isTouch&&A()!==e.type.indexOf("touch")>=0}function Z(){X();var t=k.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,s=t.moveTransition,l=N()?Je(v).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||O()}:e,u=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(N()){var n=M().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];N()&&l&&u.push({name:"arrow",options:{element:l,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),k.popperInstance=ge(c,v,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:u}))}function X(){k.popperInstance&&(k.popperInstance.destroy(),k.popperInstance=null)}function Q(){return Oe(v.querySelectorAll("[data-tippy-root]"))}function ee(e){k.clearDelayTimeouts(),e&&R("onTrigger",[k,e]),$();var t=D(!0),r=C(),o=r[0],i=r[1];Pe.isTouch&&"hold"===o&&i&&(t=i),t?n=setTimeout((function(){k.show()}),t):k.show()}function te(e){if(k.clearDelayTimeouts(),R("onUntrigger",[k,e]),k.state.isVisible){if(!(k.props.trigger.indexOf("mouseenter")>=0&&k.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=D(!1);t?r=setTimeout((function(){k.state.isVisible&&k.hide()}),t):o=requestAnimationFrame((function(){k.hide()}))}}else j()}}function tt(e,t){void 0===t&&(t={});var n=Ue.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",_e,we),window.addEventListener("blur",$e);var r,o=Object.assign({},t,{plugins:n}),i=(r=e,De(r)?[r]:function(e){return Se(e,"NodeList")}(r)?Oe(r):Array.isArray(r)?r:Oe(document.querySelectorAll(r))).reduce((function(e,t){var n=t&&et(t,o);return n&&e.push(n),e}),[]);return De(e)?i[0]:i}tt.defaultProps=Ue,tt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Ue[t]=e[t]}))},tt.currentInput=Pe,Object.assign({},ee,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),tt.setDefaultProps({render:Ye});const nt=tt;var rt,ot,it,st,at,lt,ct,ut=n(16512),dt=Object.defineProperty,pt=(e,t,n)=>(((e,t,n)=>{t in e?dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),ht=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ft=(e,t,n)=>(ht(e,t,"read from private field"),n?n.call(e):t.get(e)),mt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},gt=(e,t,n,r)=>(ht(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class yt{constructor(e){mt(this,lt),mt(this,rt,void 0),mt(this,ot,void 0),mt(this,it,void 0),mt(this,st,void 0),pt(this,"element"),mt(this,at,((e,t)=>{const{state:n,composing:o}=e,{selection:i,doc:s}=n,{ranges:a}=i,l=Math.min(...a.map((e=>e.$from.pos))),c=Math.max(...a.map((e=>e.$to.pos))),u=t&&t.doc.eq(s)&&t.selection.eq(i);if(ft(this,rt)??gt(this,rt,nt(e.dom,{trigger:"manual",interactive:!0,...ft(this,ot),content:this.element})),!o&&!u){if(!ft(this,st).call(this,e,t))return void this.hide();ft(this,rt).setProps({getReferenceClientRect:()=>(0,r.MG)(e,l,c)}),this.show()}})),pt(this,"update",((e,t)=>{i(ft(this,at),ft(this,it))(e,t)})),pt(this,"destroy",(()=>{var e;null==(e=ft(this,rt))||e.destroy()})),pt(this,"show",(()=>{var e;null==(e=ft(this,rt))||e.show()})),pt(this,"hide",(()=>{var e;null==(e=ft(this,rt))||e.hide()})),pt(this,"getInstance",(()=>ft(this,rt))),this.element=e.content,gt(this,ot,e.tippyOptions??{}),gt(this,it,e.debounce??200),gt(this,st,e.shouldShow??((e,t,n)=>(ht(this,t,"access private method"),n))(0,lt,ct))}}rt=new WeakMap,ot=new WeakMap,it=new WeakMap,st=new WeakMap,at=new WeakMap,lt=new WeakSet,ct=function(e){const{doc:t,selection:n}=e.state,{empty:r,from:i,to:s}=n,a=!t.textBetween(i,s).length&&e.state.selection instanceof o.U3,l=this.element.contains(document.activeElement),c=!e.hasFocus()&&!l,u=!e.editable;return!(c||r||a||u)};const bt=e=>{const t=(0,ut.Qx)({},`${e}_TOOLTIP_SPEC`),n=(0,ut.Gf)((n=>{const r=n.get(t.key);return new o.k_({key:new o.hs(`${e}_TOOLTIP`),...r})})),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-tooltip",displayName:`Ctx<tooltipSpec>|${e}`},n.meta={package:"@milkdown/plugin-tooltip",displayName:`Prose<tooltip>|${e}`},r}},88966:e=>{e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},89575:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:()=>r})},92466:(e,t,n)=>{"use strict";n.d(t,{Nj:()=>l,hG:()=>a,pb:()=>s,y5:()=>i});var r=n(18769);const o=(0,r.createContext)({}),i=()=>{const e=(()=>{const{dom:e,editor:t,setLoading:n,editorFactory:i}=(0,r.useContext)(o),s=(0,r.useRef)(null);return(0,r.useEffect)((()=>{const r=s.current;if(!i||!r)return;e.current=r;const o=i(r);return o?(n(!0),o.create().then((e=>{t.current=e})).finally((()=>{n(!1)})).catch(console.error),()=>{var e;null==(e=t.current)||e.destroy()}):void 0}),[e,t,i,n]),s})();return r.createElement("div",{"data-milkdown-root":!0,ref:e})},s=({children:e})=>{const t=(0,r.useRef)(void 0),[n,i]=(0,r.useState)(void 0),s=(0,r.useRef)(),[a,l]=(0,r.useState)(!0),c=(0,r.useMemo)((()=>({loading:a,dom:t,editor:s,setLoading:l,editorFactory:n,setEditorFactory:i})),[a,n]);return r.createElement(o.Provider,{value:c},e)},a=(e,t=[])=>{const n=(0,r.useContext)(o),i=(0,r.useCallback)(e,t);return(0,r.useLayoutEffect)((()=>{n.setEditorFactory((()=>i))}),[n,i]),{loading:n.loading,get:()=>n.editor.current}},l=()=>{const e=(0,r.useContext)(o),t=(0,r.useCallback)((()=>e.editor.current),[e.editor]);return[e.loading,t]}},99742:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>i,d_:()=>o});let r=e=>crypto.getRandomValues(new Uint8Array(e)),o=(e,t=21)=>((e,t,n)=>{let r=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*r*t/e.length);return(i=t)=>{let s="";for(;;){let t=n(o),a=o;for(;a--;)if(s+=e[t[a]&r]||"",s.length===i)return s}}})(e,t,r),i=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),"")},99896:(e,t,n)=>{"use strict";function r(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCharCode(n)}n.d(t,{C:()=>r})}}]);
3
+ //# sourceMappingURL=9641.4938f7a1.js.map